From 71a2bd140aaea457087e8a61365f2855fe81f160 Mon Sep 17 00:00:00 2001 From: Chris Want Date: Tue, 22 Apr 2008 22:13:06 +0000 Subject: [PATCH 01/76] Creating GSoC branch for jaguarandi --- release/datafiles/splash.jpg | Bin 79258 -> 72804 bytes source/blender/src/splash.jpg.c | 4756 +++++++++++++++---------------- 2 files changed, 2277 insertions(+), 2479 deletions(-) diff --git a/release/datafiles/splash.jpg b/release/datafiles/splash.jpg index da88c0b8eaa25949fcb6fb74401fb7fc7b67ff19..0d328ee4b7ccf066eb69d138884cbeebe3d4d44f 100644 GIT binary patch literal 72804 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 Nr$9d_`*tfU|Jiw=2~Ge2 literal 79258 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çy@O?VuZfbmHbRe#urtVawH~ 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 diff --git a/source/blender/src/splash.jpg.c b/source/blender/src/splash.jpg.c index c1ca8b575e6..440f4f763e6 100644 --- a/source/blender/src/splash.jpg.c +++ b/source/blender/src/splash.jpg.c @@ -1,2483 +1,2281 @@ /* DataToC output of file */ -int datatoc_splash_jpg_size= 79258; +int datatoc_splash_jpg_size= 72804; char datatoc_splash_jpg[]= { -255,216,255,224, 0, 16, 74, 70, 73, 70, 0, 1, 1, 1, 0, 72, 0, 72, 0, 0,255,225, 0, 22, 69,120, -105,102, 0, 0, 77, 77, 0, 42, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0,255,219, 0, 67, 0, 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, 1, 2, 2, 1, 1, 2, - 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,255,219, 0, 67, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,255,192, 0, 17, - 8, 1, 15, 1,245, 3, 1, 34, 0, 2, 17, 1, 3, 17, 1,255,196, 0, 31, 0, 0, 1, 3, 5, 1, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 4, 0, 7, 10, 3, 5, 6, 8, 9, 2, 1, 11,255,196, 0,103, 16, 0, 1, 3, 3, 2, 4, 3, 4, 6, 4, 7, - 11, 5, 9, 13, 9, 1, 2, 3, 4, 5, 6, 17, 0, 7, 8, 18, 33, 49, 19, 65, 81, 9, 20, 34, 97, 10, 21,113,129,145,240, 35, - 50,161,193, 22, 23, 24, 66,177,209,225, 25, 26, 36, 40, 51, 56, 73, 82, 98,232,241, 72,104,105,136,168, 41, 52, 57, 67, 84, 88, -120,150,178, 37, 38, 68, 83, 87,115,130,135,147,152,181,200,210, 54, 89, 99,114,146,184,213,214,215,255,196, 0, 29, 1, 0, 0, - 6, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 5, 6, 7, 1, 4, 8, 9,255,196, 0, 80, 17, 0, 2, 1, - 2, 4, 4, 3, 4, 6, 7, 5, 7, 0, 7, 9, 0, 1, 2, 3, 4, 17, 0, 5, 18, 33, 6, 19, 49, 65, 7, 34, 81, 20, 97,113, -240, 8, 35, 50,129,161,209, 21, 66, 82,145,177,193,210, 36, 51, 98,162,225, 9, 67, 83, 84,114,130,241, 52, 56, 68, 85,116,148, -211, 22, 23, 24,115,131,146,147,180,181,255,218, 0, 12, 3, 1, 0, 2, 17, 3, 17, 0, 63, 0,159,198,150,150,150,134, 6, 22, -150,150,190,100,122,143,199, 67, 3, 31,116,203,220, 60, 68,108,181,171,123, 70,219,170,254,224,209, 41,183,140,167, 25,101, 20, -135,189,241, 73,101,249, 28,165,136,243,170, 77, 69, 84, 74,116,149,133,163,149,185, 15,180,226,185,211,132,158, 97,151,159, 35, -212,126, 35, 92,108,227, 63,131, 43,145, 85,251,143,120, 54,213, 18,235,236, 86, 37,191, 87,185,237,148,243, 72,170, 67,146,224, - 11,147, 81,162,128, 57,167, 69, 42, 5, 75,143,213,230,242, 75, 94, 34, 50,148, 86,158, 42,113, 39, 27,112,159, 14, 38,119,193, - 60, 55, 23, 19,212, 81,204,173, 89, 4,134, 67, 34,209,128,198, 87,130, 56,138,188,146, 2, 0,242,151, 49,169, 50,114,101, 1, -128,179,188, 40,225,158, 7,226,222, 37,108,143,142, 56,150,110, 23,166,172,133,150,142,120,196, 98, 54,173, 44,162, 36,158, 73, - 85,146, 56,200, 44,124,193, 4,140, 4,124,232,139, 41, 61,145,109,196, 58,132,173,181, 37,104, 80,200, 82, 72, 32,131,243, 26, -247,174, 11,240,211,199, 61,219,180,206, 66,179, 55, 36, 79,186,108,118, 29, 68, 54,166, 58, 92,122,228,181,217, 65, 13, 22,219, - 47, 30,106,157, 61,174, 95,242, 14, 16,243, 97, 37, 45, 44,128,150,181,219,219, 46,247,181,247, 6,129, 2,231,180, 43, 48,171, -148,106,139, 65,216,211, 33, 58, 29, 65,232, 57,219,113, 63,172,203,233, 86, 66,219, 88, 74,208,160, 66,146, 14,147,240,211,197, -174, 19,241, 67, 46, 53, 25, 37, 79,179,102,180,202, 13, 86, 95, 49, 2,166,156,244, 38,219, 9, 97,213,178,207, 29,212,220, 7, - 17,201,120,194,158, 38,248, 69,197,190, 22,102, 66,159, 60,166,246,156,166,165,136,165,204, 33, 4,210,212,142,160, 95,115, 12, -218,119,104, 36,179, 11, 18,134, 72,237, 33,202,244,180,180,181,103,226,173,194,210,210,210,208,192,194,210,210,210,208,192,194, -210,210,210,208,192,194,210,210,210,208,192,194,210,210,210,208,192,194,210,210,210,208,192,194,210,210,210,208,192,194,210,210, -215, 13,125,163,254,220, 13,158,224,130,240,159,178,214, 5,156,238,249,111,173, 45,150, 21,116, 81,219,173,155,110,200,219,199, - 39,194, 98,116, 8,215, 53,192,138,116,167,170,213,245, 68,151, 17,255, 0,171, 32,177,132, 50,233, 76,186,132, 39,249, 26, 91, -214, 67,195,217,207, 19,102, 9,149,228,116, 47, 95, 90,224,177, 85, 42,161, 80, 16, 11,200,238, 85, 35, 64, 72, 5,157,128,185, - 10, 46,204, 1, 98,226, 46, 38,200,248, 79, 45,124,219,136, 51, 20,203,104, 81,130, 6, 96,204,206,237,114,169, 28,104, 26, 73, - 28,128, 78,148, 86, 58, 85,152,128,170,196,119, 43, 75, 80,124, 63, 73,159,141,131, 84, 83,195,103, 56, 94, 20, 82,242,212,138, -127,240,103,117, 13, 77, 44, 20,171,195,105, 85,127,227,115,194, 91,193,101, 37, 75, 16,146, 20, 1, 1,180,147,204, 58,247,192, - 39,183,219,102,184,168,189,173,253,156,222,171, 32,236, 38,233,221, 18,227,210,109, 58,154,110, 6,238, 13,182,188,107,111,132, -162, 53, 29,138,204,184,113, 36,218,181,233,114, 84, 26,131, 10, 91, 82, 88,144,233, 68,118,234,107,152,244,120,206,205,115,175, - 7,248,243, 35,161,151, 49,169,202, 86,166,150,157, 75,200,105,230,142,102,141, 64,185,102,140, 17, 33, 10, 55, 98,138,225, 64, - 44,108,160,156, 64,178, 47, 27,188, 58,226, 12,194, 28,174,151, 57,106, 90,186,150, 9, 16,169,134, 72, 82, 71, 38,202,171, 35, - 3, 26,179, 27, 5, 18, 50, 22, 36, 42,130,196, 12, 72, 35, 75, 94, 80,180,173, 41, 90, 8, 82, 84, 1, 73, 29, 65, 7,204, 29, -122,213, 97,139,107, 11, 75, 75, 94, 29,117,182, 91,113,231,156, 67, 76,180,133, 56,235,174, 41, 40,109,182,208,146,165,184,226, -212, 64, 66, 2, 65, 36,147,128, 6, 78,134, 6, 61,233,107,140, 28, 63,123, 94,236,238, 39,253,160,119,151, 9,219, 61,108,210, - 43,219, 63,103, 88,247, 29, 77,157,231, 77, 86, 91,178,239, 43,178,215,171, 80,169,213, 69,219, 84,214,227,166, 57,178,252,106, -195,236,197,150, 92,117, 83,126,173,247,214, 23,238,178, 89, 3,231,181,219,218,129,127,123, 56, 15, 15,137,177,182,194,209,220, -115,188,169,221, 85, 85, 13,213, 86,172,210,254,165,254, 47, 78,219,136, 94,225,245, 74, 79,188,123,199,240,222, 95,139,226,126, -167,184,183,201,250,202,212,182, 30, 7,226,105,179,220,183,134,191, 71,242,179,156,218, 1, 81, 12, 50, 72,136,121, 70, 41, 38, - 5,203, 48, 17,183, 46, 39, 37, 28,171,130, 52,149, 12,109,136, 92,222, 32,240,164, 60, 61,154,241, 87,233, 46,118, 69,147, 78, -105,167,158, 56,228,145,121,162,104,160, 34, 48,170, 90, 84,230,202,138, 36,140, 50, 48, 58,149,138,139,227,180, 26, 90,134, 23, -247,207,155,251,255, 0,155, 30,209,127,235, 93,227,255, 0,232,210,254,249,243,127,127,243, 99,218, 47,253,107,188,127,253, 26, -152,127,247, 29,226, 55,254,233,139,255, 0,155,166,255, 0,234, 98, 19,255, 0,226, 11,194,239,253,245, 55,255, 0, 37, 87,255, - 0,210,196,207,116,181,166,252, 3,241, 57, 89,226,255, 0,133,157,171,223,235,138,219,165,218, 85,203,250,153, 89,157, 81,183, -232,178,101,204,165,211,157,166, 93, 53,202, 3,109,195,147, 56,120,175, 33,108, 82,154,113, 69,125, 66,221, 80, 29, 0,214,228, -106,172,174,163,168,203,171,107, 50,250,180, 17,213, 80, 75, 36, 50,168, 33,128,146, 39, 40,224, 48, 36, 16, 25, 72,184, 36, 30, -160,219, 22,246, 95, 93, 77,154, 80, 80,230, 84,110,100,163,204, 97,138,120,152,130,165,163,153, 22, 68, 37, 88, 6, 82, 85,129, - 32,128, 71, 66, 47,133,165,165,165,173, 92,110, 97,105,105,105,104, 96, 97,105,105,105,104, 96, 97,105,105,105,104, 96, 97,105, -105,105,104, 96, 97,105,105,105,104, 96, 97,105,105,105,104, 96, 97,105,105,105,104, 96, 97,105,105,105,104, 96, 97,105,105,107, - 3,168,110, 45, 6, 60,249,116,122, 75, 21,123,182,183, 5,239,118,155, 75,181, 41,174, 85, 12, 9, 92,174,168,197,170, 85,150, -166,169,212,105, 67,194, 32,183, 54,108,117,130,164,229, 32, 40, 29, 12, 12,103,154, 90,104,166,239, 21, 38,143, 91,167,219,119, - 13,169,123,209, 43,245,152, 83, 39,208,233, 9,165, 83, 46,121,213,134, 41,225,159,126, 83, 12, 88,181,170,177,130,134,188, 97, -151, 38,251,171, 42,228, 95, 35,139,228, 86, 47,143, 95, 53, 54,130,157,111,109,119, 6, 76, 70,208, 28,118, 91, 44, 90, 40, 45, -183,221,106, 77, 58, 85,222,220,217, 43, 74,114, 75,108,197,113,213, 99,149,182,214,178, 18, 70, 6, 28, 29, 45, 88,232, 23, 37, - 18,231,136,236,202, 36,244, 76,110, 60,135, 33,205, 97, 77,191, 18,125, 54,115, 56, 47, 83,234,212,201,141, 55, 38,149, 80, 64, - 82, 10,216,146,211, 78,164, 45, 36,160, 5, 2,111,154, 24, 24, 90, 90, 90, 90, 24, 24, 90, 90, 90, 90, 24, 24, 99,120,143,168, -110,117, 51,103,174,233, 91, 65, 29,201, 23,200,138,203,116,255, 0,119,109,167,170, 12, 69,114, 67,104,169, 72,165, 50,240, 40, -118,166,136, 69,226,200, 32,144,175,137, 0,184, 17,174, 20, 60,223, 25, 18, 95,121,199,215,190,238, 72, 83,138, 83,202, 92,139, -187,156,186,165, 18,178,175,210,126,183, 54,117, 36,133, 36, 40, 16,160, 8, 61, 8, 35, 32,253,218,208,158, 40, 56,198,176, 54, - 85,185,246,165,163, 22,151,119,238,105, 66,153, 92, 54,212,151,168,214,187,171, 78, 67,245,249, 12, 43,244,179, 83,148,148,194, -109, 65,206,185,121,108,167,148, 47,157, 60,116,224,190, 27,204, 99,139,140, 56,175,196,124,203,131,114,188,170, 14, 66,193, 75, - 56, 17, 77, 38,167,144,114, 96,182,185, 42,165,190,146, 16, 51, 50, 70,132,233, 84,102,199, 72,120, 15,198,220, 77,151, 75, 55, - 7,112,151,134,185,103, 26,102,153,172,252,246,158,170, 2,101,134, 61, 49,198,121,211,223, 68,116,145, 17,172, 23,210,170,242, - 53,139, 51,170,227,143,215, 53,223,196,133,153,238,191,194,219,167,117,237,195, 59,196,247, 52,214,107,151, 20, 5,201, 13, 99, -196, 83, 45,200,148,149, 45, 41, 42, 0,144, 49,147,140,231, 88,195, 91,199,188,114, 93,109,134, 55, 39,112,100, 60,226,194, 90, -101,171,158,186,235,142, 44,159,133, 40,109, 50,201, 90,179,216, 0, 78,177,155,198,244,186,247, 18,225,151,114, 93,181,137,181, -218,221, 69,209,207, 34, 82,202,131,105, 39, 13, 68,134,194,112,136,145, 17,156, 33,166,210,148, 36,118, 25, 36,157,221,188, 47, - 45,145,246,104,112,186,239, 19, 59,221, 70, 93,217,123,214,159,133, 73,179,173, 8,106,140,213,106,227,187, 42,177, 94,153, 78, -181,233, 18, 37,182,177, 72,167,177, 22, 51,207,212,167,150,214, 25,110, 59,132, 37,229,170, 52,119,121, 7,194,159, 15,120,203, -198,222, 60,159,134,248, 23,136, 51,106,108,146, 23, 75,212, 85,212,201, 45, 66,164,141,162, 37, 49,195, 36, 81, 52,243,178,187, - 44, 97,214, 56,145, 92,188,204,177,150,110,196,241,107,196,110, 10,240, 51,128, 32,226,126, 62,225,252,162,167, 58,153, 28,251, - 61, 37, 52,112,211, 51, 70,161,230, 97, 36,209,203, 42,211,192,172,138,210, 20,105, 37,118,141, 82, 21,105, 2,174,163, 72,218, -189,222,170,162, 69,126, 85,135,123,206, 76,183, 23, 46, 77, 77,218, 13, 81,227, 33,199,137, 91,146, 29,120,199, 37,106, 82,148, - 73, 81,238, 73, 58,203,118, 91,127, 55, 47,135,155,149,114,173,233, 18, 19, 1,201, 8, 23, 5,159, 86, 18, 27,166,212,210,217, -229, 80,122, 50,192, 84, 10,130, 81,144,135,219, 1,196,246, 80, 91,101, 77,171,150, 85, 47,164,143,198, 35,151, 97,170, 81,118, -183, 97,169, 54,130, 37,133,179,102, 61,111, 92, 53, 14,120, 40, 95,195, 22, 93,192,171,133,185, 46, 62,166,176, 22,235, 65,161, -204, 74,144,218, 6, 18, 59,121,195,151, 16, 59, 31,237,121,225,250,232,188,108,251, 74, 62,216,241, 35,181,232,138,205,221,106, - 37,246,165,173,185,210, 97,201,126,152,244, 42,139,108,182,186,213,159, 85, 16,103, 34, 50,222,109, 50, 33,200,136,182, 92, 7, -194, 14,201,234,207, 16,126,128,222, 38,248, 71,147,143, 16,120, 59,138,106, 38,207, 50,127,174,217,162, 46,210, 29,204,124,216, -156,104,105,141,227, 9, 42, 77, 79, 51,176,134, 89, 64,146,237,200,222, 28,127,180, 43,194,191, 25, 51,195,225,207, 24,112,181, - 60, 89, 30,113,245, 32, 50,202, 17, 98, 29, 36, 17, 76,191, 88,176,139, 72,205, 19,193, 81, 10, 35, 77, 20, 76, 99, 32,118, 27, - 96,248,137,177,183,250,218, 21,123,106, 66,161,213,225, 37,166,235,214,228,213,160, 84,232,242,156, 78, 64,113, 41, 56,147, 13, -101, 43,240,159, 71,192,224, 65, 7,149,105, 90, 19,106,226, 39,139,222, 29,184, 78,110,198,145,196, 38,229, 82,246,206, 6,226, -214, 42, 20, 27, 86,171, 91,137, 84, 93, 38, 85, 78,151, 17,153,211, 89,157, 82,131, 5,214,105, 13,162, 43,237,171,196,148,182, - 91, 86, 72, 74,138,129, 26,224,102,199,110,133,115, 99,247, 86,135,116,199, 84,134, 26,129, 81,250,170,231,166, 5,148, 9,180, -119, 95, 17,234,144,223,108, 28, 41,230,185, 75,173,103, 33, 47,197, 65,236, 8, 56,167,210,118,170,198,173,240,251,194, 53, 82, - 35,168,126, 52,237,202,189, 36,178,235,106, 10,109,214,222,179,169,238, 54,226, 20, 58, 41, 37, 10, 4, 31, 67,171, 87,232,151, -199,112,248,245, 61, 22, 67,196,119,203,243,234, 9,141, 61,127,179,133, 66,234,105,230,150, 10,168,209,213,213, 57,175, 11,164, -177,216,133,120,223, 78,133,116, 11, 85,125, 48,120, 26,127,163,229, 30, 99,196, 92, 52, 23, 49,200,107, 97, 90,156,188, 84,150, -112,140, 42, 96,138,162,146, 87, 70, 70,147,148,147, 35,197, 32, 96, 89, 36,143, 86,182, 71, 38, 80,214, 61,247,102,238,101,169, - 68,190,118,250,231,162, 94, 86,117,203, 5,186,157, 2,229,183,106, 17,170,180, 90,196, 7, 74,146,220,186,125, 66, 35,138,110, - 83, 5, 72, 80,230, 66,136,202, 72,238, 8,214, 89,168, 64,112,175,237,189,221,253,134,225,159,102,120,123,225,163,133,105,251, -189, 82,218,155, 26, 53, 58,249,186, 43,172, 93, 53, 88,104,168, 59, 62,163, 61,244, 83, 40, 54, 52,101, 57, 18,156,216,146, 0, -149, 42, 82, 84,242,185,200,142,216, 71, 50,250, 53,193,103,210, 48,176, 55,151,114, 45,253,161,226,123,106,154,216,235,138,230, -171,179,111,210,175,154, 45,102, 69, 70,198, 98,189, 45,246,226, 66,166, 92,208, 43, 49,218,153,107, 54,228,197,120, 94,244,183, -101, 50,219,175, 32, 72, 17,218, 11,121, 61, 57,156,120, 63,198,153,119,233, 74,154,108,168,214, 80, 80, 73, 45,180,205, 3,212, -154,116,102,229,204,244,233, 33,144,107,140, 7,210, 20,181,143,217, 29,185,103, 35,241,187,128,243, 63,209, 20,149, 89,184,162, -204,179, 40,225, 7, 84, 53, 9, 74, 42, 93, 19,153, 2, 84,188, 98, 35,203,145,140,122,139,232,184,251,102,226,253,250,171,113, - 37,195,245, 6,251,107,107,171, 91,211,182, 52,173,200,122,165, 79,163, 51, 98,207,189,104, 17,110,183,106,213,101, 50,154, 93, - 53, 20, 39,167, 9, 42,157, 33, 82, 99,134, 90, 13,243,184, 95, 72, 64, 60,195, 47, 80, 32,128, 65, 4, 17,144, 71, 98, 53, 2, -158, 50, 84,211,191, 72, 26,128,243, 1, 10, 14,113, 65,195,147,232, 82, 80,159,137,193, 34,193, 91, 78,246,248,156, 5, 45,144, -174,224,164, 16,122, 13,118, 87,143, 15,111, 68, 62, 31,247, 89,238, 25,120, 83,218,134, 55,231,120,232,117, 24,214,189,203, 90, -170, 59, 86,145,107, 83,239, 39, 22, 24,122,204,183,168, 86,222, 39,222, 53,230, 36, 56,219, 82, 84,212,136,236,177, 41, 11,138, -145, 33,196, 56, 91, 91, 48,240,167, 51,118,225, 88,120,116,201,154,212,103,249,106,102, 51,243, 57,112,197, 76,172, 19, 86,169, - 89,130, 8,193,123, 6, 98, 25,182, 0, 19,182, 17,203, 60, 97,202,145, 56,190,163,137,196,121, 61, 47, 14,230,178,101,148,252, -190,100,210,213,186,151,211,162, 37, 82,237, 35, 4,185, 84, 5, 84, 92,179, 1,190, 36,133,165,168,139,220,190,218,255, 0,106, -111, 13,237, 80,239,190, 41,184, 29,183,169, 27, 89, 90,168, 69,138,228,225, 66,187,237, 23, 16,167,193,117, 20,246, 46, 35, 90, -169, 70,163, 85,156,101, 14,120, 77, 84, 34,149,172,182,172, 54, 74, 84, 7, 85, 46,223,109,143, 13, 22,231, 5,182, 47, 26,148, -171,102,247,187,237, 43,183,112,233,251, 83, 88,178, 40,166,138,205,225,100, 95, 50, 40, 85,218,228,250, 85,194,221, 66,123,108, -120, 76, 51, 65,115,145,214,150,161, 37,154,132, 89, 13, 39,195,116,242,177,215,248,105,197,180, 35, 47,120,168,226,205,105,243, - 57,189,158, 25,168,170, 33,169,137,167,177, 60,146,241,185, 8,246, 6,193,244,130, 65, 0,146, 8,196,131, 46,241, 91,131, 43, -206,100,147, 87, 77,147,212,229, 48,251, 76,240,215,211, 79, 73, 50,211,220, 14,112,142, 68, 5,227,187, 45,202,106, 32, 16, 72, - 0,223, 29,148,210,212, 92,183, 35,233, 31,162,243,160,209,233,124, 25,112,161,184,187,163,185, 51, 34, 63, 58,227,131,120, 83, -170,147,233,118,147, 44,202,113,150,152,250,163,111,196,153,119, 10,221,142, 27,116,188,153, 48,153, 96,159, 12,248,202, 37, 72, -198,248, 54,250, 69,151,109,251,190,214,214,200,241,107,178, 86,230,220,166,238,185, 96,217,113, 46,235, 45, 87, 21, 53,219, 86, -231,169,204, 77, 62,159, 26,239,181,110,153, 50, 30, 76, 37,212, 94,142,195,174,178,251, 78, 69, 46,135, 23, 29,196,133, 99,108, -248, 71,199,171, 65, 85, 94,249, 46,143, 99, 86,119,128,205, 7,180,136,210,247,113, 0,144,200, 87, 98, 84, 91, 83,129,116, 86, - 4, 95, 68,120,211,225,211,102, 52,121,116,121,233,147,219,157, 99,142,160, 83,212,123, 33,145,237,166, 51, 80, 99, 17,134,243, - 0,198,250, 99, 38,210, 50,144,109, 43, 29,120,113,198,217,109,199,157, 90, 91,105,164, 45,199, 28, 89, 9, 67,109,161, 37, 75, - 90,212,122, 37, 33, 32,146,124,128,215, 14,253,164,222,219,221,157,224, 86,233, 59, 61,101,218, 15,111, 86,249, 34,155, 14,165, - 92,161, 49, 88, 69, 18,210,176, 89,169,199,110,101, 41,155,170,176,220,103,222,151, 90,126, 19,172,190,154,124, 86,130,209, 30, - 75, 79, 63, 37,143, 17,182,220,230, 77,175,244,142, 56,132,142,220,122,222,253,112, 91,245, 86,205, 92,140,191, 79, 85,221,100, - 38,245,165, 74,102, 61, 69,151, 99,183, 46,153, 83,187,226,187, 77,174,184,128,224, 80,100, 59, 27,198, 13,148,165,214,201,230, - 8,229, 94, 22,113,190,113,150, 83,230,244,153, 69,168,170,198,168,121,147, 65, 20,147,169, 23, 6, 24,228,145, 93,245, 13,211, - 97,172, 88,173,193, 4,175,156,120,191,192, 25, 38,109, 81,146,214,231,119,174,163, 58,103,229, 65, 81, 52, 84,237,123, 17, 52, -177, 70,232,133, 78,207,185,229,155,135,210, 65, 2, 71,219, 95,199,191, 8,187,217,187,147,118, 59,104, 55,194,208,220,189,198, -166,208,234, 87, 13, 70,153,102, 59, 46,189, 76,133, 76,164,205,137, 79,158,183,238, 88, 81, 85, 78, 18, 91,151, 54, 58, 11, 41, -148,167, 73, 89, 33, 4, 37, 68,109,254,160, 19,244,127,110,123,126,214,227,115,113,175, 26,237, 82, 45, 14,212,183,182, 43,113, - 46, 74,213,102,160,164,196,131, 73,183,233, 85,139,126,167, 62,165, 57,121, 34, 52, 86, 32, 48,235,174, 30,161, 9,104,247,198, -186,103,185, 63, 72, 83,125,183,147,120, 38,237, 23,179,215,133,198,183, 45,182,164, 77, 98,145,112,222, 16,174, 10,229,197,113, -192,167, 58, 82,245,199, 30,212,183,230, 68,102,215,162, 45, 1, 42, 11,168, 75,116,161,181,165, 79,248, 14, 57,225, 53, 36,226, - 95, 8,115, 26, 94, 38,172,201,120,104, 61, 93, 6, 89, 75, 4,245, 53,117,114,195, 4, 81, 25, 67,146,100,145,185,104,163,202, - 74,160,212,224, 2, 73, 32, 18, 34,220, 41,227, 94, 89, 89,194,148, 57,247, 21,178, 81,102, 57,181,101, 69, 61, 45, 29, 20, 83, -212, 77, 48,132,160, 2, 56,151,153, 35,155,184, 12,231, 66, 18, 85, 64, 4,128,101,135,165,168,156,219,158,223, 30, 44,184,114, -221, 75,123,111,253,161,252, 36, 55,183,244, 42,247,131, 37,117,235, 78,155, 93,160, 92, 80,232,239,201, 68,119,171,244,186,109, -102,169, 54,159,121,211,227, 40, 44, 58,212, 57,113,220,230, 73, 71,139,226, 0,218,186, 89,198, 87,182,211,135, 30, 14,235, 27, - 75, 6,163,102,223, 59,171, 70,222, 93,176,167,238,197,161,117, 88, 18, 40, 31, 82,200,182,106,181, 25,180,248, 5, 70,177, 61, -135,125,225,126,226,183, 10,124, 49,200,151, 18,149,128,224, 82, 83, 20,171,240,211,140,105,171,114,250, 40,178,177,152,182,106, -143, 37, 52,148,179, 67, 60, 19,172, 66,242, 24,230, 71,208, 74, 13,202,146, 26,219,128, 70,248,152,209,120,173,192,245,116, 57, -149,124,217,177,202,215, 39,120,227,171,138,178, 9,169,234, 41,218, 83,166, 46,100, 14,156,192, 28,236, 25, 67, 45,246, 36, 29, -177,217,173,112,163,112,253,133, 28, 55, 95,188,105,212,248,162,173,202,171,215,108,187,186,163, 93,190, 47,125,152,175,202,157, - 87,160,214,183, 90,175, 85,141, 82,118,228,122,179, 46,114,165,201,181,228, 73,126,179, 50,101, 17,245, 57, 25,115, 93,105,180, - 56, 41, 5,116,160,202,240,191,237,190,220,158, 50,248,231,219, 77,158,218, 29,130,147,111,112,189, 93,145,119,193,184,247, 10, -229,165,214,170, 87,151,189,209,182,206,237,185,233,142,205,168,210,100,170,143,106, 52,237,203, 71,166, 71,110, 59,134, 83,174, -180,249, 30, 48,117,228, 33,185, 31,161, 92,200, 74,187,115, 37, 42,199,166, 64, 58, 74,170, 30, 49,240,218,181,169, 26,169,242, - 74,252,226,140, 25, 82, 41, 81,156, 65, 43,200,129, 36, 40, 91,149, 48,104,217,133,136,150, 59,130, 25, 75, 17,133,169, 38,224, -127, 20,232, 22,181,105, 35,207,242,236,146,184,136,164,154, 23, 84, 53, 16,164,110, 94, 33, 32, 83, 44, 44,178,170,155,131, 20, -182, 33,149,130,131,134,126,151,176,123, 71, 74,180, 27,176,226,237,253,162,205,158,136,126,226, 45,102,173,218, 59, 86,224,136, - 80, 27, 49, 69, 13,184, 98, 40,143,200, 0,228, 13,114,224, 99, 24,212, 4,189,180, 92, 57,109,223, 10,156,122, 93,182,174,205, -192,141,105,218,119, 45,169,102,238,133, 50,218,161,145, 14,159,102,213,171,255, 0, 88, 69,169,211,168,140,199,193,165, 66, 53, -106, 19,243,227,176,217, 74, 34,138,178, 89,140,150,163, 54,195, 77,254,136, 21, 90,173, 54,133, 75,169, 86,235, 51,225,210,168, -244,120, 19, 42,149, 90,165, 66, 67, 81, 32, 83,105,180,248,238, 75,157, 62,108,183,214,148, 70,136,204, 86, 93,113,199, 22,160, -132, 33,181, 41, 68, 0, 78,191, 57, 62, 35,175,107,151,218,161,237, 50,184, 37,109,235, 50,196, 29,229,220,202, 77,141,183,190, - 43, 14,184,170, 30,215, 90, 80,163, 80, 97,220,243, 97, 43, 10,140,219,118,133, 14,117,126,160,198, 73,109,217, 50,144,146,162, - 19,155, 39,192, 39,174,139, 62,226, 12,218,122,167,135, 34,160,161,145,235, 29,217,140, 69,217,213,208,184, 38,197,194, 71, 52, -154,236, 88, 42,184,189,156,131, 86,125, 35,211, 47,155,135,120,111, 38,167,164, 73,184,135, 50,204, 35,142,133, 17, 84, 74, 17, - 81,146, 64,132, 0, 66, 51,201, 4,122, 1, 10, 89,144,218,233,113, 61,206, 11,119, 14,189,187, 28, 40,240,239,185, 23, 75,138, -118,228,190,118, 83,107,110,250,243,171, 32,173,202,197,203, 99,208,235, 85, 53,168,134,209,146,102,205,124,159,129, 61, 79,234, -167,176,217,253, 55, 59, 75,100,210,182,231,110,237, 11, 38,133, 20, 65,162,218,246,245, 30,223,164, 66, 7,152, 68,165, 81,169, -241,233,212,232,193, 88, 25, 13,196,142,210,123, 15,213,211,141,170, 34,178, 72,102,172,170,154,158, 62, 77, 60,178, 59, 34,126, -202, 51, 18,171,255, 0,106,144, 62,236,116, 69, 12, 83,193, 69, 71, 5, 76,188,250,152, 98,141, 36,127,219,117, 64, 29,191,238, - 96, 79,223,133,168,165,123,119,125,170,238,209, 91,175,240, 39,195,117,192,235,151, 29, 77, 14, 81,120,135,190, 40, 15,243,187, - 74,135, 49, 41,105,123, 57,111, 76,138,162,181,214,165, 33,194, 46, 23, 26, 41, 49,152, 90, 40,225, 78, 63, 38,166,204, 61,237, -246,205,251, 82,224,240, 79,182,174,108,238,209, 85,161,203,226,135,116, 40,142,253, 82,227, 78, 37,255, 0,226,146,206,156,167, -161,191,184, 53, 54, 18, 8, 53,247,252, 41,108, 80, 99, 56, 82, 61,229,165,212,159, 75,177,161, 8,147,185, 93,236,136,246, 94, -213,106,214,149,199,198,255, 0, 17,212,217,179,238, 10,173,173,115,221, 27, 61, 64,185, 22,228,217,136, 85, 70,147, 62,106,247, - 98,229, 19,146,183,100,220, 18,214,234,221,164,120,203, 82,154,110, 66,170,174, 5,201,122, 11,177,110, 14, 3,225,236,179,135, -178,212,241, 23,140, 33,215, 71, 11,133,202,168,154,193,235,170,175,228,151, 73,191,212,196,192,178,146, 8, 37, 76,132, 21, 68, - 89,105, 31, 17,120,151, 54,226,108,214, 79, 12, 56, 34,126, 93,116,209,151,206, 43,214,229, 40, 41, 45,231,132, 50,145,245,242, -169, 10,202, 8, 32, 50,196, 8,105, 29,161,210,223,163,211,255, 0,132, 11,255, 0,169, 75,243,255, 0,199,236,141,116, 43,233, - 74,255, 0,148,224, 99,255, 0,154,226, 91,255, 0,107, 96, 53,207, 95,163,211,255, 0,132, 11,255, 0,169, 75,243,255, 0,199, -236,141,116, 43,233, 74,255, 0,148,224, 99,255, 0,154,226, 91,255, 0,107, 96, 53,106,102,159,250,197,112,231,255, 0, 5, 39, -255, 0,208,175,197, 59,147,255, 0,234,195,197, 95,252,124,127,255, 0,161,150,227,167,222,201,206, 30,246, 78,244,224, 27,134, -234,253,209,181,155,125, 93,172,206,219,232,206,205,170, 85,108,219,118,161, 80,150,239,214, 85, 36,151,101, 76,151, 78, 91,146, - 29,229, 74, 71, 50,212, 78, 0,235,174,142,127, 36,254, 28,127,249, 20,218,239,253, 65,181,127,255, 0, 21,168, 67,236,206,242, -251,107,106, 27, 11,183,118,135, 14,118,230,248,218,123, 35, 96,219, 49,169,246,138,246,239,108,225, 81, 63,132, 20,246, 12,185, - 95, 92,181,113, 85,232,203,170, 93,234,124,188,224,255, 0, 4,146,236, 21, 45,180,166, 60,100, 57,144,172,147,102,189,184,158, -209,254, 22,247, 41, 54,175, 17, 19,170,123,167, 72,160, 84, 35,193,188,246,187,121,108,216, 86,109,253, 75, 99,149,165,201, 68, - 43,134, 21, 2, 5, 86,143, 93, 49, 75,106,105, 85, 86,234, 49,190, 62,117, 68, 87,136, 87,168, 78,113,225, 63, 21,230,217,158, -127, 91,147,241, 53, 5,117, 75, 84,212,207,236, 81, 87, 72,103, 68,121,153,145, 24, 4,229,164,150,101, 82,174,202,138,219,115, - 58, 98,193,200,252,101,224,252,151, 41,225,202, 12,239,133, 51, 44,186,145, 41,105, 96,246,233,178,248,197, 59,201, 28, 17,171, -186,157,124,201, 35,186,179, 6, 68,121, 25, 70,174, 95,164,237,173, 75, 62,218,177,233, 17,168, 22,157, 22,153,111,209, 33, 37, -105,135, 73,163,193,139, 77,167, 68, 67,142,173,231, 17, 26, 20, 54,144,211, 9, 83,206, 56,178, 16,144, 10,156, 82,143, 82, 78, -178, 93, 49, 28, 53,113, 19,183, 28, 85,108,189,139,190,123, 87, 80,118,125,159,125,210, 5, 74, 19,114,219,105,138,157, 46, 99, - 18, 31,167,214, 40, 85,152,204,188,226, 34,214, 96, 85,226, 78,135, 45,180, 56,227,105,126, 18,252, 55, 93,108,161,197, 62,250, -231,250,168,106, 41,170,106, 41,234,227,104,170,224,119, 73, 85,193, 14,178, 43, 21,117,112,119, 12, 24, 16,215,222,247,190, 58, - 70,146,122, 90,170, 74,106,154, 41, 18,106, 58,136,209,225,120,200, 40,209, 58,134,141,144,141,138, 50,144, 84,141,172, 69,176, -180,180,180,180,134, 54, 48,180,180,180,180, 48, 48,180,180,181,192,111,104, 5,251,125, 80, 56,143,220,198, 45,253,213,169, 89, - 9,183, 54,167,110,238, 27,118, 11,123,151,122, 90, 50,220,172,139,138,158,153, 72,178, 45,251,125,102, 37,197,116, 63, 9, 82, - 82,182, 38, 6, 89, 68,111, 26, 95,138, 30,142,216, 47, 57, 30, 78,249,221, 99, 81,164,226, 6, 84, 47,168,169,111,215, 68,181, -129, 7,171,130, 78,246, 0,236, 78,216,215,169,168, 20,209,243, 10,234, 23,181,175,110,196,255, 0, 44,119,231, 75, 81,244,103, -138, 29,229,219,186,190,226, 38,204,169, 55,100, 67,220,238, 34,247, 45,250,213,217,125, 65,164,205,147,104,206,165,216,118, 61, - 94,129,106,212, 95,186,100,197,162, 91,207, 73,151, 86,156,153, 30, 59,169, 82,141, 53,244,196,109,181, 55,135,114,241,198,191, - 22, 21,107, 15,123,247, 58, 21,239,182, 80, 41,252, 61,195,225,246, 85, 90,221,164,217,177,110, 10,125,254,238,232, 42, 29, 18, -168, 34,221, 38,172, 62,174,129,245,162, 36,204, 82,163, 52,225, 82,101,134, 98,190,203,109, 37,110, 59,183, 5,230, 62, 70, 90, -152, 57,114,114,192, 44,206, 14,169, 36, 72,144, 16,168,246,213, 43,132, 6,228, 91,204,218, 84,223, 8, 12,198, 29,193, 70,184, -191, 64, 58, 0, 88,157,200,232,162,231,111,112,185,199,119, 52,181, 31,219,163,138, 13,215,187,247, 63,109,175,153, 87,125, 18, -185,126,217, 23,151, 19, 82,104,252, 60,211, 45,201, 52,233,150, 71,240, 34,193,174,162,217,167,220,143,211,222, 93, 66,233,145, - 84,147, 75,108,134,220, 72,230,113,130,136,203, 97, 74,115,194,187,218, 60,116,241, 71, 94,159,183, 22,253, 63,112, 54,166,175, - 63,117,119, 39,104,237,104,115,229, 80,109,233,245, 11, 49,235,225,117,154,109,106,149, 86,182, 45, 90,232,117,138, 91, 85, 35, - 79, 91,126,254,228,106,167, 37, 61,109,158, 66,226,214,144,220, 23,153, 8,213,214,162, 27,132,212,225,139,174,147,174, 69, 33, - 78,131,172, 1, 25,109,118, 10,194,252,179, 32, 1,136, 25,140, 58,136, 42,221,108, 45, 99,125,129,245,219,115,107,117, 29,237, -142,245,233,107,147,209,223,222, 43, 46,151,189,123,171, 87,168, 91,247, 45,193, 96,238,236,107, 86,163,184, 18,175, 13,204,135, - 26,223, 51,155,219,155,122,229,185,225,109, 4,121,171,160, 11, 66,149, 6,229,173, 86, 75, 18,101,144,211, 81, 94, 47, 30, 86, -130,245,116,153,197,253,205,104,175,125,224,212,119, 98,196,186,104,182, 78,217,238,236,253,159,220, 25, 80,109,250, 84, 61,204, -189,109, 75,111,110,106,180, 88,240, 28,129, 37, 16, 46,122,140, 59,158,240,173,209,164, 71,165, 4,181, 37,202, 9,253, 10, 30, - 67,199, 90, 31,253,157,169,144,255, 0,100,153, 42,109, 96,108, 24, 93,173, 25, 33,108, 27, 96, 37, 66, 3,232,144,141, 71,151, -101, 98, 20,246,180, 31,222, 41, 75,252, 58,110, 5,250,122, 30,151, 3,109,247, 24,234,110,150,185,121,125,113, 27,190,246,141, - 14,226,220,138, 85,122,149, 95,137, 79,221, 29,192,219, 42, 86,219,187,104, 69,247, 57, 66,135,195,181,213,186,212,122,171,149, -122,104, 85, 74, 93, 76, 92,212, 56,173,120, 13,169,182, 94,140,242,153, 95,134,178, 36,161,188,127,125,171, 86,214,225,238, 11, - 22,199, 16, 84,107,178,163,121, 39,108,124, 29,207, 68,141,169,183,108, 72,233,163,237,245,233, 92,170,211,106, 53,186,204, 89, - 52,202, 39, 35,139,138,182, 99, 49, 2,101, 90, 83, 81,212,194,240,184,239, 73, 25,143,134,171, 36, 66,194,104,254,198,161,110, - 97, 23, 14,138,202,199, 64, 11,164, 54,162,119, 6,214, 93, 86, 98,161,171, 35, 6,218, 79, 91,118,238, 9, 4, 11,239,126,158, -238,246,218,253,134,210,215, 23,168,252, 66,238,173,122,152,237,253, 54,243, 85,110,231,171, 76,225,138,243,161,236,203, 18,102, -193,102,123,213,219, 34,129, 34,173, 62,218,133, 2,172,137,173,218,242, 46,180,203,140,244, 86, 80,236, 39,101,213,208,220,211, - 33,228,132,186,236, 80,248,135,221,139,146,237,218,187, 18,214,222,123,102,243,129,185, 51,246,200,220,219,133,110,217,182,220, -151, 54,246,175,118, 89, 27,207,114,220, 59,126,196, 88,238, 61, 5,154,162,127,128,148, 71,161,179, 83, 67,181, 56, 13,161,255, - 0,172, 27,152,151,144, 18,105,120, 98,178, 37,118, 51,199,104,151, 83,147,204, 1,108,138,237,184, 67,125, 33,173,125,181, 16, - 66,106,107,129,133,173,141,136, 1, 79,155,167, 77,247, 32,119,239,248,119,182, 58,147,171, 69,118,187, 74,182,233,114,107, 21, -153,105,135, 2, 47,132,149,185,225,188,251,206,189, 33,212, 71,139, 18, 28, 72,205,173,217,211,223,148,235, 45, 49, 29,148, 45, -231,222,121, 13, 52,133,184,180,164,182, 60, 63, 94, 23, 13,249,180,118,173,203,117,202,141, 58,225,125,219,146,149, 84,168, 68, -134,221, 57,154,140,139,106,235,174,219, 34,165,238, 12,168,183, 13,217, 13, 81,219,121,198,219,253, 26, 28,125, 73,108, 37, 1, - 41, 13, 62,232,111,214,218, 88, 87, 53,221, 90,189,235,241,103, 84, 54,214, 35,223,192,237,191,166,243,212, 43,146,234,168,162, -210,230,214,174, 85,210,219,108, 4, 84, 20,139,146, 5, 54, 10,228, 56,219,108, 55,239, 43,109,212,137,238, 41, 44, 50,192,240, -207, 45, 59, 88,201, 19,178, 27,116,186,146, 13,137,182,215, 29, 72, 27,117,198,210,176,101, 86, 29, 24, 3,251,247,199,221,233, -222,106,181,159, 75,167, 84,174,234, 93, 66,210,177,231, 69,184,235,115,168,180, 74,161,155,188,183, 37,187,104, 81,151, 91,175, - 70,163, 80, 40,200, 81,166, 32, 83, 84,169, 82,149, 18, 91,178,216,139, 78, 83, 11,126,159, 42,107, 42,103,136,187,179,237, 34, -226,147,119,235, 63,197,223, 8,251,124,189,158,219,184, 97, 16, 40,176,233,212,196, 92,251,157, 84,166,150,212,167,102,185, 76, -180, 34, 77,106,221,117,114, 22, 2, 25,135, 45, 15, 52,181, 45,110,204,125, 71,175,108,182, 23,109,174,187,130,169, 84,222,157, -223,125,186,149,249,123, 65,247,101,210, 60,100,212,104, 54, 69,155, 36, 7,224,237,133,176,149, 2,203,148,166,146,166,158,173, -205,109, 3,235,170,160, 43, 86, 98, 69,134,211, 59, 51,104,216,150, 77,129, 77,110,141, 99, 90, 54,213,159, 74,109, 41, 66,105, -246,205, 18,155, 68,137,132,126,169, 91, 20,232,205,165,197,117, 57, 82,129, 81, 36,146, 73, 39, 78,217,109, 94, 95,150, 60,146, - 85, 80,254,145,169, 22,208, 11, 40,141, 58,223, 82,180,114, 93,186, 91, 96, 71, 98,164, 27,234,212,195, 81, 80, 21, 35,159,217, -227,223, 81, 0,150, 61, 45, 98, 25,108, 58,223,168,247, 17,136,175,109,165,111,136, 46, 22,110, 90,253,251,188, 55,190,238, 65, -226, 39,118,227, 73, 22,188, 43,214,173, 93, 15,170,216,230,151, 29, 53, 11,198, 13, 89,199, 26,118,108,119, 24,169, 38,135, 69, - 37,232,207,174, 19,213,119,127,239, 68, 64,213, 43,151,138,189,231,148,233, 93,203,191,247,220,103, 10,148,232,142,246,226, 85, -105, 32, 96,149, 21, 51, 79,141, 84,100, 37, 35,175, 68, 55,129,142,128,107,190, 92, 81,109,158,214,113, 35, 67,184,108,237,202, -102, 60, 43, 2,198,163,212, 42,247, 21,248,211, 49,155,173, 80, 37,183,202,252,118,173,218,155,209,221, 83, 79,170,117, 53,160, -227, 77, 36,169,228, 67,121, 32,178,242,233,207, 57,194,234, 71, 15,220, 39, 90, 75,109,193, 77,191,119, 2,124, 94, 96,220,151, -161,219,182,108,103,243,144, 18,185, 21,119,174, 89,106,100,163, 0,129,224,171,201, 60,131, 83,252,135, 54,165,204,160,150,105, - 50,197,106,184,152, 41, 60,176,194,223,170, 17,180, 5, 22, 29, 67, 58,155,146,119,189,240,193, 93, 73, 45, 59,170, 45, 73,228, -176,184, 26,172,111,176, 36,139,220,223,181,129,216, 91,107, 91, 29, 21,246,100,113, 47,186, 91,235,125,110, 4, 59,162, 92, 75, -222,214,164, 89,244,136,116,189,196,146,195,109, 87,221, 69, 6,164,227, 77, 68,157, 83,101,164,170,228,142,252,250,245, 93,166, - 94,150, 12,132,127, 7, 30, 90, 93,113,183, 73, 87,102,245,197, 62, 8,247, 59,106,118,179,113, 23,103, 90,182, 36, 75, 2, 30, -235, 85,168,116, 25, 13,199,172,212,107, 14, 87, 43,209,216,152,205,189, 33,239,126, 9,109,170,147,105,114, 75, 75, 16,216,138, -219,177, 93, 46, 62,219,134, 27, 74, 71,107, 53, 4,226,104,132,121,180,197, 40,197, 20,114, 5,101, 80, 0, 13,113,230,112, 20, -149, 23,107,139, 2,109,109,247,185, 47,153,107, 22,165, 75,205,206,101,184, 39,115,107,116, 27,128,122, 88,239,235,233,133,165, -165,165,168,254, 55,240,180, 29, 66,161, 2,147, 6, 93, 78,169, 50, 45, 58,157, 2, 59,178,166,206,154,251,113,162, 68,140,194, - 11,143, 72,147, 33,229, 4,178,202, 80,149, 21, 41, 68, 0, 6, 73,209,154,212,158, 53,182,250,255, 0,220,189,141,169,219,187, -118,235,139,169,181, 89,166,213,106,148,134,158, 12, 59,113, 81, 32, 51, 52,201,162,180,181, 16,149, 58,102, 59, 6, 74, 80,165, - 0,225,167, 6,243,149, 0, 88,184,159, 52,173,201, 56,123, 58,205,242,220,170, 76,242,191, 45,166,150,104,105, 34,254,242,162, - 68, 66,203, 18,216, 19,118, 35,162,171, 57, 23, 8,172,214, 82,253,194,249, 85, 14,121,196, 89, 38, 79,153,230,209,228, 89,126, -101, 83, 12, 51, 86, 75,253,221, 60,114, 56, 87,149,174, 85,108,160,245,102, 84, 6,197,221, 86,236, 52,131,138, 95,104, 4,186, -199,214, 54, 22,197, 77,122, 13, 40,151,161,213,183, 5, 41, 91, 51,234, 13,245,109,214,109,116, 44, 5, 64,138,174,191,225,138, - 1,245,164,254,133, 45,116,112,232,102,217,108,157,245,187,134,183, 88,166,198,146,138, 37, 30, 21, 78,171, 88,184,102, 54,243, -205,188,244, 72,207, 77,118, 44,101, 40,243, 79,168,186,180, 97, 88, 36, 32,185,206,226,129, 32, 43,100, 54, 19,129,203,238,248, -173,181, 55,114, 41,115,173, 91,118, 27,233,241,105,111,225,154,189, 85, 72, 80,230,100,242, 40,251,132, 63, 37, 44,159, 21, 64, -225,180,167, 62, 34,123,107,102,109,165,171,100,219,108, 91, 52,106, 68, 40,116,214, 97, 24, 34, 35, 12, 33,184,233,142,182,203, -107,104, 54, 7, 80,164,169, 92,196,228,168,168,149, 18, 73, 58,227, 46, 26,240,155,196, 15, 27,243,131,198,254, 48,212, 79,148, -100,169,175,216,178,205, 50, 64,197, 79,217, 84,129,142,186, 74, 91,129,173,223,251, 93, 72, 91,234, 0,172,216,237, 78, 38,241, -115,195,223, 3, 50, 97,192,254, 13, 83, 65,156,103,114, 20, 53,217,166,164,168, 64, 71,218,103,168, 81,162,174,168,169,109, 8, -159,217, 41, 75, 17,164,144,208,226, 44, 52,185, 13,195,169,211,165,188,142,118, 98,207,137, 33,212, 30,203,109,137, 13,184,226, - 8,249,165, 36,125,250,127,189,191, 59, 1,126,241, 15,193, 94,202,238,238,208,211,167, 93,244,109,151,184,170,119,101,215, 68, -161,176,236,233,235,179,175, 10, 4, 24,142, 93, 76, 66,140, 20,185, 76,211, 95,167, 69, 50, 66, 18,165,179, 30,166,244,130, 3, - 76, 60,164,211,226,127,101, 42, 59, 29,186,181,187,117,109, 62,187,118,168,251,213,155, 78,162,182,200,106, 93, 34, 91,202, 95, -186,135, 57, 66, 85, 38, 43,203, 84,119, 64,193,253, 26, 87,128,151, 18, 75,183,195, 79, 26, 53,221,151,166,139, 34,240,164,187, -122,109,226,148,224,141, 17, 46,182,154,189, 13,183,212,165, 72,102, 2,165, 31, 10,109, 61, 74, 90,213,238,238,148, 4, 41,106, - 40,113, 41, 37, 5,151,232,189,226,236,127, 70,191, 20,115,188,175,140,233,189,135,151, 83, 26, 73, 43,163, 50, 69, 61, 47, 62, - 45, 50,104, 12,254,207, 83, 5, 76,154, 39,141, 95, 65, 49, 74, 20,198,204,234,241,244,170,240,114, 79,164,247,132,249, 46, 99, -193,117, 94,220, 37,165,149,227,137, 29, 21,229,130,168,211,204, 26, 46, 97, 84,246,154, 89,233,163,215, 79, 35, 71,204, 2, 88, -139, 9, 21, 81,160, 87,169,110,253, 27, 78, 31,247, 14,201, 78,246,241, 53,120, 64,159,107,237,173,207,108, 82,237,139, 90, 69, - 85,167,160,179,114, 68,163, 76,149, 92,175,220,241,144,248, 79,137, 70,138, 26,139, 29,153, 56, 45,188,228,137, 73,109, 71,193, - 94,122, 95, 89,143,236,147,185,110, 37,110, 61,103,134,205,190,118,245,118, 71,214, 47,186,246,201, 80, 28,168, 63, 81,230,241, - 76,135,214,152, 94,233, 38,103,139,215,198,113, 69,124,221,121,181,134,239,223, 25, 43,190,109,119, 54,195,105,109,159,226,243, -110, 28, 97, 16,106, 24, 17,153,172,214,169,236, 0,134,169,158, 5, 63,244, 20,106, 55, 34, 82, 21, 29,165, 56,167, 82, 2, 22, -180,183,204,210,189, 25,241,187,233,237,225,100,220, 3,152, 80,112,253, 92, 57,166, 99,153, 70,182,130, 10,152,234,164,119, 86, - 89, 18, 33,201, 5, 97, 70,145, 87,153, 52,237, 25, 88,195,132,133,228, 42, 7,154, 94, 3,127,179,211,197,122, 79, 17,114,220, -207,136,233,166,203, 50,220,174, 70,250,249,233,164,165,141, 17,213,163,121,155,158,193,230,117,141,219,151, 5, 58,200, 30, 82, -133,230, 72,149,201,211,219,222,171, 18,185,121,221,181,168, 8, 8,131, 86,185,107,149, 40,105, 74,121, 64,139, 58,167, 42, 76, -127,132,143,135,244, 78, 35,167,207, 77, 71,183,193, 83,207, 4, 92, 7,166,161,226,120,232,185,171,137, 62, 46,121,194, 5,131, - 73,240, 82,160,174,160,134, 66, 7,221,173,145,216,173,173,169,238,230,227,208,109,120,108, 60,170,120,148,204,234,252,180, 33, - 69,184,116,136,238,161, 82, 57,156, 72,194, 30,120,132,178,214,123,173,224,113,202,149, 17,210, 31,105, 23,179, 6, 31,180, 15, -107, 54,119,111,211,186, 82,118,157, 59, 83,112, 85,238, 6, 95,131,103, 71,187, 17, 86, 21,122, 52,122, 72,130, 99,187,113, 83, -133, 57, 44,166, 58, 86,149,165, 78,133, 5, 20, 20, 12, 5,107,144,127,217,239, 11,228,156,117,155,248,159,196, 50, 53, 6, 69, - 81, 49,167, 14, 35,118, 89, 36,209, 81, 36,238,145,198, 25,217, 98,121, 98,141, 74,171, 13, 82, 58,223,200,246,236,191,246,140, -186,241, 7,135,185, 87,133,124, 53, 18,230, 60, 67, 79, 0,168, 49,153, 35, 86,142, 62,101, 52,112, 70,242, 72,200,138,210,199, - 20,210,176,118, 83,166, 56,218,223, 88,151,102,125,130,112,118, 42,169,192, 62,220,155, 3,248, 58,253,211, 14, 69,121,189,216, -141, 20,197,250,250, 61,248,229,122,168, 93,114,229,109, 39,197, 75,206, 82, 17, 78, 84, 37, 57,240,170, 2, 88, 75, 71, 8, 80, - 17,173,246,250, 13,156, 87,180, 78,224,103,100, 28,162, 63, 88,110,202,179, 25,220,245,218, 78, 69,118, 49,221,175,121,170, 25, -141,184,237, 53, 69,181,220, 41,161, 42,215, 76,222, 83,227, 38, 98, 92, 68,140, 74, 75,192,117, 38,227,250, 54,119,189,161, 79, -164, 73,216, 46, 46,110,123, 78,180,253, 25,154,101,232,154,149, 18,165, 73,135, 95,154,143, 16, 72,168,192,114,215,185, 18,237, - 62, 19,168, 82, 1,129, 35,223, 2, 20,149, 45, 50,202, 86, 27, 67,243,193,111,209,227,219,173,146,220,107,127,118,119,231,112, -164,239, 85,205,109, 84,218,174, 81,173,207,169, 81, 69,178, 35, 87, 35, 60,153, 16,234,149,118, 37,204,149, 42,232,125,153, 9, - 75,205, 33,229,199,142, 93, 0,191, 29,240,156, 31, 80, 50,110, 36,240,255, 0,133,248,167,136,120,250,159,140,167,206,102,204, -197, 81,139, 47, 20,147,199, 51, 60,242, 9, 52, 75, 52,159, 86,209,161, 80, 35, 44, 16, 5,210,199,204,186, 91,202,188,243,133, -252, 73,226,222, 17,225,159, 14,106,120, 26,159, 34,131, 42, 52,130,108,204,214,211, 75, 2,165, 60, 92,190,100, 48, 71,245,171, - 35,134, 38, 64,165,201,109,106, 60,175,173,120,101,186,226,227, 30,216,222, 31,145,113,169,212,222, 13,238, 7, 6,204,215,213, - 43,196, 18, 19,114,181,106,109,123, 85, 19, 47,197,202,132,164,212,146,231,141,205,215,196, 74,201,235,211, 90,121,178,118,150, -251, 86,248,244,118,209,176, 55, 14,149,181, 28, 67, 63,187,123,137, 77,165, 94, 87,124,150,160,183, 79,191, 68,251,137,138,172, - 71,101, 79,167,202, 75, 85,121,111,253, 99, 25,144,182,148,167, 95,150,150,144,124, 71, 18, 12,191, 55,139,216,145, 27,114,184, -246,164,241,181, 23,126,103,210, 85, 77,220,141,186,220, 36,237,202,118,242, 36,168,229, 86, 2,232,107, 69, 32, 92,230,240,109, - 65,169, 66,136,128, 94,247, 2,166,125,229, 68, 33,194,145,159,188,127,251, 8,246,135,139,155,230, 86,246,237,181,237, 81,216, -221,230,170,248, 18,174,153,244,186, 83, 85,171, 78,238,170, 68,109,180, 49, 90,169, 81, 81, 50, 35,244,171,136,165,166,146,236, -232,146,128,119,194, 75,143, 69,117,254,103, 75,214, 91,226,215, 8, 67, 22, 85,150,205, 86, 35,138,175, 35,134,138,121,205, 36, -147, 69, 73, 85, 26,176,229,203, 3,162,251, 69, 57,230, 48, 97, 30,180,109, 10,167,202,197,149,139, 52,240,103,141,106, 37,205, -243, 72,104,140,147, 80,241, 4,245,244,244,226,182, 40, 37,173,163,149,163, 60,200,170, 35,145,189,154,161,121, 42, 80,203,203, -117,214,204, 6,181, 8,220,174,226, 71,130,207,107,101, 91,105,167,218,220, 83,113,207,179,208,246,122,238,169,208,173,233,177, -183, 54,243,164,208,173,170,181,102,101, 69,135,109,234, 98,103,201,178, 88, 45,207, 85, 69,134,150,209, 67,168, 82, 61,221, 78, -173, 73,109,181,173, 58,117,197, 87, 1,155,253,192,167,179,178,235,160,238,229,199,101,215,173,141,200,226,147,102,174,107, 61, - 22, 93, 90,117, 86, 35,117, 8, 59,103,187,240,170,243,222, 92,168, 76,160, 38, 69, 61,202, 40,109,109,115,248,137,137,146,174, - 80,141,116,161,143,163,193,196, 46,228,213,168, 20,254, 34,120,219,187,111,155, 38,221,113,180,211,233, 77,199,185,174, 25,241, - 97,167, 8,114, 37, 29,203,202,228,122, 53,190,165, 48, 57, 82,234, 35,200, 8, 29, 60, 21,142,154,234,183, 19,126,200,187, 31, -124, 56, 36,218,238, 11,108,125,198,175,109,125,165,181, 87,181, 22,242,163, 87, 39,211,158,220,106,188,245,210,168,215, 85, 46, - 68, 42,129,170,215,224,171,196,147, 34,233,147, 37,110,182,234, 91,105, 81,195, 44, 70,109,146,148, 54,214,158, 34,228,185, 53, - 87, 15, 81, 71,196,212, 85,249,107, 87, 71, 81, 94,180, 57, 43, 81, 65, 18, 68, 85,227,149, 89,109, 43, 77,170, 53, 86, 9, 12, -154,144,144, 89, 2,128,238,210,120, 95,158,231,148,156, 75,152, 73,194,149,249,118,106,153,124,148,217,123,102, 25,242,215, 84, - 77, 36,193,146, 72,157, 90,240,164, 26,100,118, 66,243, 71,165,192, 96,175,172,152,216,127,163,207,182, 54, 85, 63,129, 26, 5, -213, 18,131, 1,186,245,225,121, 94,117, 27,146,168, 35, 51,239,213,105, 84,250,195,212,170,127,190, 73, 8, 11,121,152,244,248, -205, 54,202, 20, 74, 90, 10, 95, 32, 5,107, 39,133, 62,218,203,122,129,108,123, 96,109,245,210, 41,177,105,109,213,209,195,221, -118,176, 97,180,134, 12,218,147,149, 56,208,159,168, 62, 91, 3,158, 81,133, 78,134,130,179,241, 17, 25, 57, 61, 53, 47, 47,103, -175, 7, 75,224,115,135,139,127, 97,141,234,237,254,138, 5, 74,189, 81, 77,202,253, 13,187,113,201,102,185, 84,122,164,166,141, - 41,170,164,208,194, 90, 47,114, 3,239, 11, 42, 8,230, 56,206, 53,160, 92,119,251, 21,218,227, 43,139,138, 79, 20,201,223,169, -214, 59,244,232, 27,125, 4,217,141,109,212,106,251, 11, 22, 36,247, 38,120,191, 94,185,121,196, 82, 76,164, 44, 39,151,221, 15, -128, 83,205,151,129,228, 17,110, 24,227,108,134,131,196,238, 46,226, 60,195, 51,120,242,140,217, 51, 4,134,110, 92,238, 92, 77, - 42, 52, 0,198,177,153, 20,104, 81, 96,232, 2, 5, 0,233,176, 24,151,241,111, 0,241, 22, 99,225, 63, 5,112,190, 91,148,164, -153,214, 76,249,107,207, 8,150,157, 4,109, 4, 46,181, 12, 36,105, 22, 38, 58,216,234, 40,236, 92,177, 35, 85,201,196, 94,166, -255, 0, 4,227,251,102,171,138,226,141, 80,145,106,127, 43,106,227,151,155,183,111,130, 40, 41,134,253,197, 45,203,106, 77,100, -206, 72,103,248, 45,250, 74, 26,201, 88, 17,189,203,148,159,208,106,118,219,255, 0, 77,225,202, 23, 11,155,155, 59,120,151,101, -141,146,115,108, 43,142,220,242,235, 79, 83, 77, 2, 85,186,237, 13,231, 25, 76, 37,173, 94, 28,153, 78, 35,192,250,189, 49,242, -243,146, 21, 28, 67, 5,242,214,185,225,237, 10,246, 37,236,223, 28, 51,160,110, 93, 50,230,159,180,155,231, 14,139, 6,141, 84, -188,169, 20,168,245,170, 53,231, 14,149, 20, 69,166, 34,238,183, 93,151, 24,202,168, 48,195,108,176,204,230, 36,178,250, 35, 54, -134, 94, 76,166,217,142,134,185,163, 99,253, 27,221,214,159, 80,165, 91,187,205,197,181,110,187,181,116,121, 33,246,109, 11, 90, -155, 92, 73,125,180,171, 33,152,105,184, 43,142,194,160,169, 67,169,117,184,146, 84,156, 20,165, 25, 60,195,123, 59,206,248, 23, -142, 41, 56, 79, 52,204, 56,182,110, 23,174,225,202,104,160,154,140, 82, 79, 49, 38, 34,167, 93, 35,197,104,209,156,173,149,152, -146, 20, 70, 93, 84,165,153,191, 32,200, 60, 65,240,254,183,140,178,156,183,130,224,226,234, 14, 40,171,154,162, 10,227, 91, 4, - 0, 9,129, 81, 29,108,114,131, 35,162, 6,187,162,128, 11, 25, 66, 51,137, 46,188, 20,224,130, 37,122,161,107,241,207, 22,205, - 68,229,213,151,193,189,253, 34, 59,113,121,149, 53, 84, 40, 55,206,223, 79,185,147,150,134, 72, 22,172,106,177,123, 29, 60, 36, - 57,159,135, 58,112,125,151, 27,107,197,206,231,238,109,253, 66,224,219,124,109,173,154,220,132, 90,144,164, 85,209, 87,159, 18, - 13, 86,231,182,219,170,182,183,153,164,123,205, 6,114,159,102, 44,244,195,114, 64,108, 32,164, 58,218,149,148,246,148,183, 0, - 30,195,186,103, 4, 59,219, 95,221, 41, 91,210,238,236, 81,174, 43, 18,191, 97, 78,179,235, 27,115, 6,133, 5,234,101,126, 92, - 7,229, 25,178,149,117,212, 19, 61,159,118,131,224,173,133,199, 8,117, 50, 23,206,113,240,235, 95,184,128,250, 57, 52, 5,238, - 92,237,211,224,251,126,238,109,132,155, 34,168,253, 90,157,107, 61, 18,125, 66, 21,175, 38, 90,150,227,236,218, 87, 93, 26,179, - 18,165, 71,166,165, 75, 33,152,239, 9,107,109, 10, 40, 18,121, 2, 82, 39,213,158, 45,112, 93,125,119, 19,229,145,230,113,193, - 73,155,199, 76,244,245,181, 20, 18,212,211,115,163, 69, 71,134,162,150, 72,214, 70, 81,203, 66,172, 80,165,217,219, 82,178,174, -170,226,135,193,142, 59,203,114,254, 18,205,101,202,100,158,183, 36,150,174, 58,154, 26, 92,198, 42, 74,174, 68,178, 51,199, 61, - 45, 92, 82, 52,106,228, 72,225,215,152, 30,200,138, 85,149,155, 79, 63,120,152,246,113,123, 73,247,246,235,219,109,167,226,139, -140,141,138,188,175,178,213,122,187,181,118, 29,241,126, 64,166,221,115, 99, 73, 93, 54,159,112, 78,182, 41,145,237, 56,210,106, - 13, 56,228,106,115,110, 33, 60,254, 41,132, 84,218, 23,238,207, 41,173, 31,246,169,108, 70,229,240,207, 70,224,147, 98,119,114, -163, 71,170,222,187,125,195,213,118,150,252,234, 12,137, 18,233, 70,139, 43,118,239, 89,244, 56,177,164,203, 97,167, 29, 12, 68, -146, 91, 60,200, 72, 79, 32, 74, 71, 40, 26,238, 94,204,253, 30, 26,228,253,212,164,238,167, 22,156, 77, 94,219,207, 82,164, 79, -131, 56,192,167, 63, 93,167, 79,170,174,154,224,118, 27, 85, 91,234,181, 93,149, 83, 76, 20,173, 8, 10,106, 34, 99, 59,203,144, -220,182,137,206,183, 63,218, 81,236,103,137,199,254,225,237,141,254,141,242,159,182, 63,197,206,219,177,183,108, 80,227,216, 76, - 93,200,157, 30, 61,114,165, 89,102,162,106, 82,110,248, 10,142,176,154,138,153, 45, 22,157,230, 12, 37,207, 23, 42, 41,211, 54, - 91,226,118, 67,149,113, 15, 14, 82, 84,113, 37, 61,110, 65,151, 37, 76,179, 61, 46, 80,244,112, 67, 83, 36, 82,198,139, 2, 70, - 26, 87, 71,230,182,191,169, 81,168, 7, 46,218,138,163,238,105,225, 55, 17,103, 28, 53,197, 21,180,220, 43, 85, 67,196,121,172, -148,176,195, 29,102,117, 29,117, 68,244,145,205, 12,142,213, 15, 41, 72, 99,120,249, 43,203,250,242,218, 47, 24,141,116,134,125, -234,246,125,236,206,223,237,103, 9,155, 11, 64,179,173,250,125, 38, 3, 59, 97,100,212, 92, 17,163, 54,202,230, 85,234,214,237, - 54,167, 88,172, 76, 82, 19,151,234, 82,234, 82,100, 72,125,213,100,173,199,207,100,132,164,111, 48, 24, 24, 29,135, 65,166,203, -102,236, 37,237,126,216, 88,187,122,185,202,169,155, 50,212,183,173,113, 82, 83, 9,138,169,233,160, 82, 33,210,147, 53, 81,146, -234,196,117, 58,152,129,101,176,181,132, 21,242,133, 40, 12,150, 11,143, 78, 49,236,142, 6, 56,109,189,119,206,237,247,106,133, - 98, 35, 63, 80,109,189,164,235,165,183,175,125,198,171, 71,147,252, 28,183,209,200,180,173, 16, 18,168,242, 38, 84, 93, 65,230, -143, 77,165,203,121,176,183, 80,219, 78,115,121,134,183, 63,207, 30, 26, 53,122,250,236,222,165,132, 99,114,242,188,210, 27, 18, - 91,123,146,215, 98,214,176,185,107, 0,113,212, 98,122, 30, 27,225,232,231,174,100,203,178,252,150,145, 76,135, 96,145, 71, 12, - 64, 48, 1,118,178,133,178,170,222,230,193, 65, 36, 12,113, 23,233, 10,251, 69,127,139,219, 56,240, 51,180,149,207, 14,246,220, - 58, 76, 90,158,253,213,105,238,225,251,107,110,170, 45,166, 69, 35,111,195,236,175,154, 61, 90,224, 64, 68,138,131,100,165, 72, -161,165,182, 28,109,216,245,192,166,197,250, 63, 62,207,199, 44, 27, 45,238, 46,247, 46,142,166,111, 45,207,164, 38, 30,218,192, -168, 71, 90, 31,183,118,209,231,218,148, 43,105,105,228, 15, 10,125,126, 68,104,146, 26, 88, 10, 34,147, 18, 26,217,112, 38,161, - 37,189,113, 27,217,255, 0,195, 62,227,251, 81,184,218,174,223,155,197, 50,161,115,219, 13, 92,234,221, 61,253,186, 37, 37,214, -218,174, 63, 83,168,185, 34,149, 99, 68, 49,148,129, 0, 85, 37, 71,114, 43, 76, 50,166,145, 6,141, 74,151,238,188,134, 52,102, -151,250, 18,218,182,237, 58,213,161,211,168,148,168,145,160,194,167,196,143, 18, 60, 88,140,183, 30, 52,118, 35,180,150,153,143, - 29,134, 82, 16,203, 8,109, 41, 74, 16,144, 18,148,164, 37, 32, 0, 53,117,113,253,101, 39, 0,112,165, 23,134, 89, 44,193,243, - 42,197, 90,140,226,116,234,236,225, 88, 67,126,160, 61,151,202,108, 86,153, 34, 86,213,206,123,208,254, 27, 80,214,248,145,198, - 53,254, 44,103,208, 52,121, 85, 11, 61, 54, 73, 76,251,132, 68, 44,166,123,116, 38, 59,183,152, 92, 53, 84,146,178,149,228, 32, - 25, 10, 82, 18,144,148,140, 4,128, 0,244, 3,160,215, 62, 61,164, 30,208, 29,190,246,125,108, 68,221,193,174,166, 21,195,185, -183, 74,103,208,246,111,110, 92,144, 91,126,238,186,153,142,218,156,168, 84,144,203,169,118, 61,155, 75, 18,162, 72,171, 73, 65, - 65, 8,121,152,108,172, 76,155, 21, 42,223,186,157, 78,157, 69,167, 84, 43, 21,138,132, 42, 77, 34,147, 10, 85, 74,169, 84,169, - 74, 98, 13, 58,155, 78,130,195,146,166,207,159, 54, 83,137,106, 28, 38, 99, 52,235,142,186,226,146,134,208,218,150,181, 4,130, - 71, 9,184,174,225,239,128,223,109, 5,235,103,196,178,120,186,133, 90,187,118, 26,145,116,193, 93,191,180, 87, 53,159, 80,147, - 34,153,115,212,232,158,253, 88,147, 10,183, 72,146,245, 74,148,212,218, 52, 38,155,157, 7,154, 22,102, 37, 42,117, 74,117,156, -212,252, 35, 69,149,207,156, 82,213,241, 20, 21, 13,195, 52, 45,174,178, 72, 34,146, 64,163, 75, 24,163,145,145, 78,133,154, 64, -177,177,184,109, 37,180,144, 64, 34,228,227, 92,195, 55,166,201, 42,232,248, 98,122,101,226,188,193,116, 80,199, 81, 52, 81, 22, - 98,202, 37,146, 53,145,135, 49,160,137,154, 69, 91, 50,235, 85, 12, 10,155, 24,223,112, 43, 69,217,158, 45,184,165,187,120,165, -246,138,241, 35,182,116,170,123, 23, 91,119, 61, 74,223,220,203,198,221,164,212,247, 82,240, 90,154,145, 18, 4,155,122, 83,169, - 76, 13,179,165,195,106, 27, 94,232,150, 88,134,243,109, 69,164,194,109, 80,163,204,105,153,125,220, 94,209,127,103,156, 61,184, -186,232, 52, 94, 47, 56,125,117,247,237, 26,244, 24,113, 99,110, 45,186, 93,145, 37,234, 60,166, 35,176,203,104,151,241, 45, 78, - 41, 9, 74, 64,234, 84, 0,215, 43,127,189,146,225,251,255, 0,151,141,236,252,108, 47,255, 0,212,117, 98,186, 62,141, 70,193, - 80,109,171,134,184,206,250,111, 75,206,209,168,117,106,171, 77, 58,108, 79, 9,215, 41,240, 31,150,134,220,228,180,193,240,212, -166, 64, 56, 32,224,156, 28,234,227,226,156,231,194,238, 48,205, 41, 42,234,248,179, 49,165,167,161, 88,226,165,164,134,136, 37, - 61, 52,107,164,104,141, 76,102,218,138,130,204,119, 54, 10, 44,136,138, 40,222, 15,200,252, 93,224,124,162,178,142,139,131, 50, -202,202,154,247,146,106,202,201,235,245,213, 85, 72,218,137,121, 92, 72, 47,160, 51, 4, 81,176,187, 49,187,187,179,241,151,216, -125,188,123, 87,177,188,108,155,223,120,111,251, 87,109,173, 15,226,150,243,164,127, 8,239, 10,196, 74, 37, 35,235, 57,181,155, - 69,248,144, 61,246,107,137, 71,189, 56,212, 57, 74, 66, 51,149, 6, 20, 64,192, 58,156, 37,241,179, 92, 40,241,203,106,237, 46, -225,220,246,214,221,239,165,175,107, 85,218,191,118,150,241,196,122,245, 54, 52,165,184,202, 93,157, 69,169, 68,120, 38,161, 71, -146,245, 54, 31,189, 67,112,189, 2,106,233, 81,140,168,239, 42, 43, 5,184, 0,123, 51,184, 59,180,120,227,226, 73,123, 35,122, - 92,215, 45,167, 72,254, 47,238, 75,185, 21, 91, 80,210,133, 79,223,104,181, 43,126, 19, 17,149,245,197, 62, 75, 62,234,182,234, -239, 21,254,143,159,153,164,114,168, 12,131,250, 11,240,185,177,214,207, 9,155, 29,181,187, 7, 78,186,100,213, 41,118,141, 53, - 54,133,175, 62,230,151, 77, 98,183, 95,122, 59, 21, 90,234,227,165,168,172,176,212,202,144,167,198,170, 72, 83,113,218, 4, 70, -167, 60,241, 64,109,167, 22, 49,227,201,203,105, 56,158,154,191, 47,204,234, 97,226,113, 20, 74,241,160, 40,145,211,114,230, 28, -196,153, 44,218,218,229, 29,117,125,130,110, 45,140,253, 29, 23, 52,173,225, 42,188,187, 50,202,105,103,225, 38,158,102, 73,100, - 43, 36,146, 85,137, 41,207, 41,224,123,174,133, 0, 58, 57, 91,243, 2,216,220, 12, 63,180,219,118,145, 74,138,212, 72,144,152, - 67, 77, 33, 40, 72, 13,164, 97, 41, 24, 0, 0, 58, 12, 1,168,214,125, 36,238, 26, 44,170,175, 15, 59,113,196,205, 42,137, 14, - 22,224,216, 59,137, 73,176,171, 53,136,200, 98, 51,213, 75, 2,242,167, 86,221, 76, 42,145, 5, 42,168, 46, 29,213, 78,163, 42, - 16, 60,230, 50, 42,243,249, 18, 18,251,170, 18,111, 4, 30,160,228,122,141, 71, 19,233, 42,111, 69,183,107,112,145,182,219, 37, -239,241,156,189,119, 91,118,169,119, 3, 20,143, 17,179, 37,155, 43,111,169, 53,105, 85,170,210,208, 57,148,210, 5,199, 87,180, -163, 53,144,128,239,189,200, 40, 89,247,119, 16,170,219,194,167,174, 95, 16,120, 99,216, 11, 9, 94,160, 7,211,125,224, 42,220, -240,214,234,188,157,100,223,109,175,219, 22,175,140, 41,151,191,134,156, 91,250, 68, 41,133, 41,137,143, 85,182,168, 14,158,207, -166,253, 27,157,160, 45,183,222,221,240,212,253, 25, 45,199,171,212,118,115,136, 29,176,151, 33,247,169, 54,142,229, 80,110,122, - 75,110,168, 41,184,138,190, 45,181, 67,159, 26, 49, 42, 42, 67, 62, 61,152,135,139,120, 8, 14, 76, 91,137,202,221,112,234, 82, - 58,139,207,209,155,219, 90,149, 31, 99,247,187,115,230, 71,118, 60, 91,231,115,160,208,105,106,117,183, 80, 38,192,177,109,214, - 20,185,241,212,165,114,187, 24,213,110,170,156,110,100,164, 31, 22,152,242, 20,163,202, 2,101, 13,163,120,178,105,219,196, 78, - 41, 52,214,229,243,208, 27,116,230, 8, 34, 19,125,252,208,250,189,247,193, 60, 25, 90,149,240,199,132, 5, 93,249,190,206,228, - 95,175, 40,212, 76, 97,251,185, 38, 61, 63,225,181,182,194,210,210,210,213,119,139, 59, 11, 75, 75, 75, 67, 3, 11, 86,231,168, -244,137, 50,219,159, 34,151, 78,126,123, 74,105,109, 77,122, 12,103,101,180,182, 20, 20,202,155,146,182,138,208,164, 40, 2,146, - 20, 10, 72,200,193,213,199, 75, 89, 4,141,193,177,247, 96, 98,222,186, 77, 45,198,165,199,114,155, 79,113,137,239,123,196,230, - 87, 14, 50,154,153, 32, 41, 11, 15,203,109, 77,226, 67,220,237,182,121,150, 10,178,128,115,144, 52,195, 92,219,245,176,182,149, -122,185,103,220,245, 58,117, 38,177, 14,165, 62,137, 88,166,205,183,100,165, 18, 94,180,182,226, 54,233, 43,153,126,224, 91,159, - 5,155, 45,232,238,197, 88, 82,208,167,241, 10, 62,100,128,214,182, 39, 90,175,186,220, 34,237,174,239, 92, 87,189,203,114,202, -174,179, 62,249,180,173,155, 70,114, 96, 73, 97,182,233,177,104, 55, 4, 90,205, 74,117, 39,196, 97, 70, 44,234,189, 58,155, 70, -165,212,213,146,151,233,244,134, 89,229, 24, 36,239,229,230,133,166, 97,152,203, 44,112, 21,216,197, 98,193,245, 40, 4,130, 13, -194,173,216,141,137,210, 0, 32,219, 9, 75,204, 10, 12, 42,165,129,253,111, 75, 29,135,199, 97,247,227,225,226,159,135, 84, 56, -170,163,213, 95,119,172, 38, 13,219, 88,247,105, 22,125, 85,171,145, 66,203,155, 66,162,214, 18,136,138,166,123,195,149, 5, 46, -227,166, 8,173,167, 43,148,194,220,113,158,102,153,112,164,250, 39, 17,220, 62, 92, 21, 58, 93, 58,145, 81,141, 34,185, 94,151, - 97,212,226,211,133,167, 80,106,170,170,149,249,112,215, 45,203,118, 92,198, 28,166,133,197,168, 51, 86,164, 85,125,241,199,121, - 87, 1,181,165,233, 10,109, 15,161, 74,182,220, 60, 32,109,125,201,123,215, 47,185,174, 86, 27,170, 87, 55, 43,109, 55, 45,216, -204, 61, 29, 48, 33,205,219,106, 84,138, 75, 84, 24, 49,212,193, 12, 91,213, 70,167, 84,156,170,176, 58,201,118,122,151,204, 20, -134,139,116,232, 92, 31,109,165,187,120,209,239,138, 92,218,235, 53,202, 30,226,110,142,227, 66,113, 79, 68,117,145, 63,115,169, -177,233,206, 81,214,211,177,136, 85, 10,144,168, 20,183,233, 12,118,138,245, 57, 11,202,185,222, 14, 56,145,195,220,178, 86,106, -161, 46,139,128, 74,144, 27, 78,161, 30,201,246, 67,125, 94,175,251,237,109,176,143,246,189, 67,202,133,111,239,189,175,107,245, -235,111, 53,190,235,247,192,151, 23, 20,214,213,149,120,238,245,161,112, 90,149, 90,123,118, 93,223,110,218,116,155,146, 37, 34, -165, 34,213,175, 92, 87,142,216, 91,119,181, 10, 5,199, 93,102, 0, 98,139, 83,155, 86,172,154, 91, 40,230,144, 74,145, 17, 79, -169,147, 50, 58, 23,100,166,241,143,176,110, 91,118,252,155,150, 60,202,122, 85,111, 48,244,196,211,236,186,197,114,218,166, 92, -206, 88,209,239, 59,138,199,163,207,137, 73, 87,214, 85,120,214,244,153,202, 90, 88,103,194,117, 48,100, 69, 14, 42, 91,110,197, - 77,226,167,194, 53, 62,224,168,214,164, 92,187,177,184,117,202, 93,207, 86,176,238,171,166,132,252, 75, 34, 52, 75,138,247,219, -171, 22,218,178,232, 23,101, 70,124, 75, 81, 19, 90,146,100, 90,180,154,171,241, 99, 73, 98, 19,149, 8,201,195, 8,139,207, 29, -204, 89,174, 3, 54,230, 28, 89, 84,218, 93,213,112, 83,169, 85, 8, 13,183, 62, 50,109,173,179,153, 84,126,170,109,166, 45,137, -213, 38,111, 9,246, 59,149,202,124, 73, 44,199, 68,199, 96,199,169,183, 24, 77, 91,133, 9, 76, 55, 93,134,181,227, 28, 52, 99, - 65, 52,210, 44,161, 35,212, 99, 50, 88,176,141, 85,236, 90, 50, 67, 23,214,214,210, 86,214,179,139,144, 10, 77,101,201, 85, 4, - 92,245,183, 75,220,116, 61,133,133,239,123,246, 56,201,110, 78, 45, 54,210,143, 71,187, 69, 26,206,190,106, 23,221,159, 10,239, -174, 77,176,164,109,229,114,157, 93,162,200,181,109, 26, 5,194,253,122,230, 66,160, 17,111,208,220,164,222, 86,170, 68,245, 41, - 75, 91, 85,192,134, 91,117,109,188,218, 1,107,139,222, 30, 41,208,160, 38,182,212,154, 96, 81, 98, 34,164, 83,236,138,173, 86, -132,229,233, 73,143, 2, 77, 86,210,160,202,167, 82,150,229,102,224,167, 57, 85,155,240,177, 28,130,105,117, 4, 48,181,191, 26, - 67, 73,200,239, 78, 20,232,247, 93,227,184,151,181, 59,113,239,187, 58,175,186, 16,107, 20, 59,177, 20, 6,109, 25, 81, 38, 91, - 85,235, 26,194,177,234,148, 36, 49,113, 91, 83, 67, 13,174, 54,221, 80,228,162, 75,124,147, 24,118, 76,180,176,251,104,120,114, - 97, 71,129, 29,185,102, 75,134,157,116, 87,233,212,215,107,237,221,142,192,102,217,219, 23,234, 46,220,107,153, 26,125, 70, 66, -175, 41, 86, 50,235,200,165, 73,156,220,169, 11,130,138,162, 26, 67,243,150, 16, 68, 68,166, 32,196, 67,134,204, 81,243,102,154, - 55, 96, 25,172, 90,225,180,141, 75,126, 89, 22, 86,190,141,141,197,203, 50,155, 12, 6,246,205, 70,202,164, 3,177,176,251,143, -218,190,227,175,167, 96,112,231, 92,188, 65,108,253,156,237, 21, 85,234, 37,205, 77,117, 54,204, 75,162,127,188,109,197,114, 52, -173,190,178,220,185,255, 0,131,148,235,130,242,141, 38,152,219,246,149, 21,117,198, 37, 41,160,227, 97,192,213, 50, 76,191, 5, - 44,199,113,212,227,232,226,211,100, 21, 21,169,244,186, 61,249, 82, 97,202,109,126,252,241,169,187, 81,118,165, 40,183,173,245, - 24,119, 77,250, 28,149, 70,101, 47, 81,162,201,144, 35, 61, 61,165, 56, 94,122, 73,102, 57,144,174,112,155,149,235,194,253, 54, -254,147, 62, 77,127,114,247, 1, 75,185,109,201,150, 53,252,136,169,180, 27, 69,243,183,234,190,107,183,181, 30,208,169,151,173, -119, 21, 76,139, 79, 23, 21, 86,150,196,154,122,162,203,114,155, 49,212, 72,121,217, 74, 76,164, 52,251,165,194,237,235, 26,209, -179,173,109,147,172, 76,141, 81,133,182, 87,238,208, 87, 46,106,213,219, 71,163, 71,122,208,188,167,211, 39,166, 53,106,131, 47, -109,107,104,172, 50,153,222,250,242,158,167, 46,147, 80, 97,184,166, 59, 47,172,204, 15, 66, 37, 60, 57, 12,220,152,228,168,144, - 77, 35, 16,197,159, 68,106,161, 88,234,102,104,191,104, 88, 1,114, 84,173,192,114,193,114,237, 84,161,152, 32, 33, 64,176, 2, -228,155,141,128, 13,233,248,131,216, 12,110,107,245,216,236,216,210,174,155,102, 19, 51, 24,254, 12, 74,185,104,144, 74,126,174, -102,127,139, 76,118,175, 5,151, 65,108,123,159,142,181,183,206, 74,121,146, 94, 82,148, 50, 14,180,215,116,165,219,144, 32,213, -182,215,234, 10, 53,122,167, 42,135, 42,149,118,221,213, 70,214,169, 21,107,134,188,202,229, 86,106, 18, 4, 96,219,174,148,212, - 36,135,144,147, 32, 54,202,144, 24,109,164, 55, 29,160,157,199,135,107, 57, 22,193,139,100,166,162,160,236,107, 61,139, 88, 85, -154, 99,195, 80,113,154, 42,105, 34,162,212,101, 58,174, 69,115, 39,197, 74, 10,206, 14, 19,204,123,235,144, 59,209, 19,116,167, - 75,115,110,234, 52,115,107,213, 46,219,210,159, 99,220,151,204, 58,236, 73,212,214, 41,117,135,213, 18,124,250, 47,142,152,243, - 99,207,171, 72, 8,129, 8,201,140,219, 77, 59, 90,111,154, 74,212,166,148,189, 76,174, 26,121,106,106, 29,239, 34, 68, 9, 80, -110, 46, 9,181,201,219,183, 91,237,190,248, 60,236,234,136, 7,148,183, 95,203, 29, 10,217,141,236,135,113,237,133,155, 34,137, -104, 94, 55, 7,131, 64,143, 79,110,109, 18,136,236,138, 4,185, 20, 96,229, 38, 91, 17,174, 7,228, 6, 36,186,204,216, 18, 99, -188,239, 63, 35,146, 34,186,166, 84,235, 74,109,197,229,117,203,231,113,228, 81, 38, 76, 27,115, 80,181,169, 66, 35,130,109, 86, -161, 91,167,203,170,192,109,238,102,132,198,233, 52, 53, 63, 33,184, 44,146,133,204,125, 1, 82, 99, 70,241, 95,139, 22, 83,173, - 37,181,115,182,167,188,183, 37,129, 6,159,182,219, 79, 95,118,221,177,236,232, 45,208,224,166,152,212, 39, 19, 54, 68, 95,130, - 92,184,146,164, 69, 83,145,233,254, 40, 83,113,195,107, 72,113,182, 68,151, 7,140,251,152,109,170, 91,157,184,213,165,133, 85, - 47,171,178,127, 33,230, 75,114,171,213, 23, 35,250,156,199, 84,159, 15,147, 25,200, 41,229,229,200, 61, 52,228,156, 45, 83, 33, - 46,213, 9, 12,109,184,184, 98,214, 61, 46, 54,177,183, 93,246,239,141,118,204, 17,118,208, 89,135, 93,192, 23,247,125,248,187, -241, 61,191, 16,171, 20,120, 91, 43,100, 59, 38, 45, 50,223,155,227,110,163,143,165,182,103,212,183, 14, 41,104,204,160,206,247, - 98, 91,122,157, 79, 90, 99, 41,149, 50,183, 97,190,216,132,184, 46, 57, 2, 52, 39,156,210, 5, 41, 40, 66,220, 89, 66, 27,109, - 42, 90,220, 95,192,219,105, 72,202,150,226,212,112,218, 7, 82, 73, 32, 0, 59,247,214,204, 79,218,105, 60, 77, 67,171,238, 54, -206,186,245, 31,112, 40,173, 83,169, 53,218, 12, 24,116,183,153,221, 11,113,130,220, 51,122, 91, 76, 85, 22,150, 26, 76, 26,164, -146,195, 50, 28, 10, 83,241,203,235,111,199,134,228, 45,102,150, 23,179, 43,113,174,103,163, 78,220,186,172, 10, 83, 3,192,117, -104,185,234,127,195, 25,237, 41, 32,164,174, 53,175, 72, 83, 84,104,143,114, 21,146,164,150,212, 20,190,185,198, 4,179, 46,173, -203, 50,156,190, 58,121,100, 74, 87,131,103, 86, 97,169,159, 98, 92, 0, 11,184,125,138,176, 91,105, 32,109,107, 6,154,136,106, -106,106, 25,213, 76,161,250, 16, 54, 3,176, 36,216, 2, 58, 17,126,183, 62,252, 48, 60, 43,109,125, 79,127,119,214,218,118,158, -185, 44,218, 22,100,195, 85, 21,152, 78,173,176, 24,129, 33,164,215, 46, 72, 51, 89, 87,232,220,113,192,221, 34,148,242, 50,174, -121,115,101, 55,205, 29,104,115, 82, 78,211, 25,177, 59, 3,102,236, 21,187, 50,139,108,185, 46,165, 62,173, 33,153, 53,170,245, - 73, 17,145, 54,114,162,180, 89,135, 17,150,162,180,148, 67,165,176,133, 61,224,176, 57,202, 21, 37,197, 41,197,149,100, 62,122, -131,113, 6,106,185,165, 96,104,175,236,208, 11, 33, 34,197,137,182,166, 35,168,189,128, 0,244, 85, 23,220,156, 61, 80,210,154, -104,136,127,239, 28,220,251,189, 7,243, 39,212,156, 45, 45, 45, 45, 48,227,119, 11, 95, 8, 4, 16, 70, 65,232, 65,215,221, 45, - 12, 12, 83, 67, 45, 53,146,219,104, 65, 61,202, 82, 1, 63,128,213, 77, 45, 45, 12, 12, 51,123,215,177,246, 78,250, 90,142,219, - 55,132, 15, 17, 77,169, 82, 41, 53, 88,229, 45, 85, 40,211,185, 57, 19, 46,159, 36,164,248,107,198, 2,208,160,166,221, 72,229, -113, 10, 24,199, 21, 55, 95,128,189,229,176,101,201,126,218,136,213,251, 65, 75,139, 49,164, 82,249, 99, 86, 27,103, 36,161, 50, -233, 82, 22, 57,221, 9,192,203, 14, 59,205,140,242,163, 60,162, 65,250,242,180, 33,192, 82,180,165, 96,247, 10, 0,143,219,170, -147,196,127, 5, 56, 23,196,226,149, 89,229, 28,148,121,204, 74, 17, 43,169, 25, 98,168,208, 62,202, 73,169, 94, 41,209,127, 84, - 75, 27, 50, 11,136,217, 1, 55,183,188, 54,241,191,143, 60, 47, 87,165,200,171, 99,172,201,165,114,239, 65, 86,173, 45, 54,179, -246,158, 61, 46,146,192,237,250,198, 41, 21, 92,216,200,174, 64,180, 88,213,177,251,198,219,222, 2,182,186,252, 11, 10,228,255, - 0,246, 90,178, 91,207,151,233,189,211,147, 31, 62,108,117,239,167,207,108,248, 36,222, 91,238,100,115, 87,165,127, 3,105, 10, -113, 62, 60,170,176,241,106, 37,172,142,111,119,166, 48,172,135, 49,156,120,203,100, 12,103,174, 48,100, 58,105,148,245, 30, 99, - 13,130,123,231,195, 26, 33,168,236, 50, 48,211, 77,182, 63,217, 72, 31,208, 53, 83,100,223, 67,239, 15,232,107, 82,167, 52,206, -115, 28,238,154, 50, 15,179,179, 69, 4,111, 99,246,100,120, 99, 18,149, 61,249,111, 17,244, 97,139,115, 58,250, 99,248,133, 95, - 67, 37, 46, 85,146,229,217, 29, 76,128,143,104, 85,150,162, 68,184,251, 81,164,210, 24,131, 14,220,200,229, 95,240,156,107,150, -193,112,227,103,236,125, 9,184, 52,136,161,218,131,220,143, 84,106,146,130, 29,168, 84,101, 37, 56, 15, 74,120, 32, 14, 80, 10, -130, 27, 64, 13,182, 9, 8, 72,201, 39,100,244,180,181,212,185, 94, 87,151,100,153,125, 38, 85,148,209, 71,151,101,180, 40, 35, -134, 24,148, 36,113,160,232, 21, 70,221,110, 73,234,204, 75, 49, 36,147,142, 85,205,115, 92,203, 59,204,106,243,108,222,182, 76, -199, 50,175,115, 36,211,204,197,228,145,207, 82,204,119,233, 96, 7, 69, 80, 21, 64, 0, 0,180,180,180,181,191,134,252, 45, 45, - 45, 45, 12, 12, 45, 45, 45, 45, 12, 12, 45, 45, 45, 45, 12, 12, 45, 45, 45, 45, 12, 12,104, 15, 16,151, 95, 24, 54,239, 17,123, - 83,103,109, 12, 84,212, 54, 75,118, 69,182, 47, 27,216,219,148, 90,131,187, 24,189,180,184,101, 92,219,132, 23, 42, 76, 82, 37, -139,234,202,151, 77,160,210,125,241,138,135,213,181, 58,116,137,140,248, 9, 90, 64,231,117, 43,136,239,106,117,199, 89,185,105, -117, 10, 52,219, 42, 68,189,220,218,235, 50,177, 79,135,177,151,213,106,118,216, 64,186,248,146,182,109, 10,197, 94,196,168,220, - 27, 33, 79,182,247, 3,109, 33,236,132,171,166,163, 88,171, 53,117,221,106,132,229, 62, 29, 72,212, 41,241, 36, 73,106, 28,131, - 84,132, 47, 28,201, 10,199,108,140,227, 84, 76, 88,197, 69, 69,150,202,143,115,203,215,203,250,134,165, 20, 60, 69, 77, 73, 4, -113, 75,195,212, 85,111, 18,196, 57,143, 18,150,102,142, 70, 98,238, 24, 50,182,184,244, 70,234, 2,130, 99, 89, 13,218, 73,249, -209, 44,195,134, 42,235,106, 36,154, 46, 37,175,163,142, 87,148,152,210,102, 8,171, 36,106,161, 35, 42,200,203,203,148, 73, 42, - 49, 44, 87,154,209,139, 36,116,252,158, 18,111, 54,228,113,174,250,120,178,217,207,122,222, 77,206,102,216,218,235, 50,169,182, -183,141, 11, 96,170,118,165,187, 86,174, 81, 46, 93,174,102,187,109,151, 87,181,116,241,125,223,117,200,235,187,229, 59, 34,206, -174, 87,232,109, 83,149, 52, 24,150,188,232,144,226,189,121,221,222, 37,189,160,182,229,237,191,208,108, 59, 58,250,169,203,183, -173,190, 38,157,179,108,216,155, 3, 85,170, 88,180,107, 78,206,216,154,213,197,195,166,226,216,251,164,154, 35,177,247, 99,117, - 46, 45,225,139,109,211,166, 90,113,234, 19,223, 67, 85,233,113, 87,111, 66, 52,228,205,149,220, 51, 22, 58,149,204, 89, 65, 80, - 24, 4,167,168, 30,131,211, 95, 12, 72,196,133, 22, 91, 42, 29, 1,229, 25, 3,211, 75,197,197, 20,136,176,163,240,229, 36,235, - 18,176, 33,145, 44,210, 60, 84,241,180,133, 86, 48,170, 73,131,152, 2, 42,144,206,124,197, 76,130, 93,105,120, 70,177,218,103, -143,138, 43, 96,121, 93, 72, 43, 36,132,172,105, 45, 76,169, 24,102,149,157,128, 21, 28,178,100,103, 82,136, 60,129,132, 70, 29, - 28,224,214,249,226, 54,181, 83,222,219, 55,136, 39, 43, 85,241,100, 94,246,107, 27,119,127, 86,246,245,141,190,145,120, 91, 23, -102,204,109,181,247, 91,109,168,212,184, 17,169,213,150, 40,215,245,201,118,208,253,234, 19, 64,161,116, 5, 67,154,165,207,141, - 37, 70, 41, 62,217,106,175, 29, 60,104,113, 79, 93,164, 80,248, 84,226,128,108,102,199,212,235,214, 38,211,193,135,178, 27,169, - 46,147,113, 46, 44,255, 0,115,185,183, 61, 15,199,182, 20,196,245, 87, 38,211,216, 92, 23,154, 60,130,143, 6,156,148,254,148, -200,113,217,206, 33,150,155, 57, 67,105, 73,237,144, 49,211,211, 67,187, 77,128,242,138,221,136,195,139, 61,212,180, 5, 19,247, -157,111,240,175, 28,175, 11,103,243,113, 12, 25, 5, 53, 85, 91, 66,177, 70,164,152,227,133,180, 34, 75, 44,105, 26,133, 87,155, - 75, 19,164, 5, 65, 35,170, 0,166,216,110,227, 15, 15,159,139,248,110, 14, 25,168,226, 74,186, 58, 36,153,165,149,192, 89,101, -157, 4,143, 36, 48,202,242,146,204,144,234, 80, 53, 18,206, 99,141,156,150, 92,126,116,252, 63,207,246,190,240,179,111, 84, 45, -109,128,218, 78, 44,118,210,133, 86,172, 61, 95,169,195,163,240,195,113, 77,114,125, 93,248,145, 32,174,108,185,213,189,175,149, - 33,245,136,112, 98,182,132,169,210,134,210,214, 16,148,229, 89,216, 95,229,123,244,129, 63,242,126, 52, 63,251,173,204,255, 0, -254, 61,169,231,253, 81, 76,255, 0,200, 99,127,246, 73,254,173, 47,170, 41,159,249, 12,111,254,201, 63,213,169,173, 79,140,244, -149,147,203, 85, 89,225,206, 77, 85, 85, 49,212,242, 73, 10,188,142,118,221,157,162, 44,199,110,164,147,211,211, 16, 58, 95, 2, -107,104,105,226,164,162,241, 71, 60,163,164,128,105, 72,162,157,227,141, 23,246, 81, 18, 80,170, 58,236, 0, 27,226, 37,155,115, -253,212,126, 49,125,153,188,113,237,174,247,198,222,153, 59,193, 46,175, 96, 72,219,250, 22,228,109,202,182,202,225,187,172,138, - 21, 82,137,114,222,246,157,180,203,246,205, 29, 85, 20,205,129, 74,154,216, 8, 67,198, 83,220,180,197, 40, 34, 90,211,174,108, -123, 29, 56, 93,226,149, 28,122,109, 85,237, 78,219,189,198,219,219,123,106,234,245,201,187,145,114,220,214,181,114,217,129, 10, -149, 34,223,173, 81,102, 90, 18, 69,110, 36,113, 58,173, 81,126, 98, 97,251,154, 2,223,101, 46, 57, 49, 77,165, 17, 22,226, 63, - 64, 22, 96,195,143,159, 6, 51, 45,115, 12, 43,145, 0,100,124,245, 69,170, 85, 61,151,140,134,162, 50,135,137, 36,184,148, 36, - 40,147,243,198,154,161,241,114,174,151, 42,226,204,162,135,135, 40,168,169, 56,157,157,130, 68,186, 35,166,230,211, 71, 75, 40, - 72,213, 66, 72,165, 35, 14,129,130,132,145,152,182,181, 58,112,239, 63,130,212, 85,153,191, 6,103, 85,252, 79, 95, 95, 91,194, - 43, 26,151,149,181,201, 87,201,170,146,174, 18,242,179, 23,141,131,202, 81,202,150, 47, 18,162,175, 45,134,178, 91, 28,254, 11, - 94, 39,235,248,104,231,255, 0,249,185, 70,127,110,177,109,192,143, 34, 93,135,122,196,136,195,210,165, 74,180,238, 40,241,163, - 71,105,111, 72,145, 33,234, 68,198,217, 97,134, 91, 73, 83,175, 45,197, 37, 41, 74, 65, 82,148,160, 0, 36,235, 46,210, 35, 32, -131,216,244, 58,169, 35,115, 27,163,129,114,132, 31,220,111,139,166, 68, 18, 35,161, 54, 14, 8,253,226,216,132, 15,176,167,134, -142, 35,182,159,142,131,114,110,159, 15,251,217,182,150,232,218, 43,214,152,107,251,129,181, 87,213,153, 69,250,202, 85,110,207, -118, 45, 59,235, 91,142,131, 25,143,127,113,168,178, 84,219, 62, 39,136,180,199,112,165, 36, 33, 68,117, 47,219,205,195, 55, 28, -251,238, 54, 30,243,225,142, 29, 70,225,177,182, 89, 85,139,166,109,187, 96,220, 82, 40,155,167, 77,220,121,146, 24,110, 13,239, - 72,138,151, 99, 46,172,220, 26, 44, 70, 24,129,245,108,167, 42,145,159,169,206, 83,113, 11, 78,151, 83, 34,132,192,132,135, 60, -100,198,101, 46,147,146,224, 64, 11,207,219,162, 84,132,172, 20,173, 41, 82, 79,112,160, 8, 63,113,213,149,152,120,159,153, 87, -113,173, 39, 27,140,170,149, 43,105, 34, 16,136, 36, 15, 44, 37,116, 73, 27, 19,114,172, 24,164,140, 1, 7,202,108,119,232,106, -156,179,194, 76,171, 47,224, 42,222, 1,108,226,174, 74, 26,217,140,230,162, 50,144,206,175,174, 41, 20, 11, 43,161, 85,120,148, -144, 65,212, 46, 54,216,136, 25,208, 61,170, 30,218,237,168,164, 39,110,107,112,119, 42,161, 86,167,180,154,124, 73,123,145,195, -123,147,175,152, 73, 79, 52,102, 82,236,185, 86,131, 14,213,229, 7, 80,172, 61, 80,106, 99,238,173, 39,196,113,206,163, 77,149, -151,192,119,180,211,218, 97,189, 44,110, 46,255, 0, 64,220,170, 74,107, 38, 36, 90,246,237,239,133, 26, 85,175, 26,139,111, 48, -234,221,106,157,101, 88, 47,198,128,235,144, 71,143, 49,200,112, 41, 20,248,116,144,252,135, 28,117,248,190, 58,222, 95,232, 6, -237, 2,142,250,185,220,129, 29, 74,245,240,211,253, 90, 50, 61, 62, 20, 79,251,222, 43, 45, 99,205, 8, 0,254, 56,212,132,120, -202,153,122,212, 79,195, 92, 13,149,240,246,109, 84,165, 90,170, 40,213,156,106,234, 81, 86, 56,128,223,205,165,153,208,176, 5, -209,237, 99, 26, 62, 5,190,100,244,176,113, 87,136, 57,191, 19,100,212,110,174,148,114,202,202,135, 79, 64,238,210,202, 78,215, - 82,200,169, 32, 82, 66, 58, 94,248,215,190, 20,248,114,178,184, 89,217, 43, 15,102, 44, 56, 70, 37,191,100,208,163,210,163, 45, -222, 85, 76,168, 74, 82,220,153, 87,173, 84,156, 72, 1,218,172,250,188,153,211, 37, 41, 41, 74, 21, 34,123,133,180, 33, 28,168, - 78,200,105,105,106,151,168,168,158,174,121,234,170,101,105,234, 42, 93,164,145,216,221,157,220,150,102, 98,119, 44,204, 73, 39, -185, 56,189,233,169,169,232,233,169,232,233, 97, 90,122, 90, 84, 88,227,141, 5,149, 35, 69, 10,136,160,108, 21, 84, 0, 7, 96, - 48,180,180,180,180,142, 23,194,210,210,210,208,192,194,210,210,210,208,192,194,210,210,210,208,192,194,210,210,210,208,192,194, -210,210,210,208,192,194,210,210,210,208,192,194,210,210,210,208,192,194,214, 53,117,217,246,213,239, 67,171,219,183, 69, 34, 21, - 94,149, 91,165, 79,163, 84, 24,146,195,107,113,112, 42,113, 93,135, 45,182, 95, 41,231,142,178,203,206,114,173, 5, 42, 66,136, - 82, 72, 80, 7, 89, 46,150,178, 24,169, 5, 77,136,238, 48, 8, 7, 98, 46, 49,196,171,235,133,221,241,219,202,252,170, 5, 5, -186,133,255, 0,110, 54,227,142, 91,183, 24,180, 43, 87, 5, 89,218, 66,156, 34, 28, 91,130,109, 22,174,210, 93,171,176,128, 27, -113,199, 24,105,215,249, 3,170, 47, 40,169,247, 49, 56,124, 52,111,189,235, 81,137, 67,173, 91, 85,184,244, 57,175, 52,212,250, -127,240, 58,177,105,211,231, 52,181, 0, 89,174,220, 21,122,163,202, 77, 11,186,164,199, 97, 13, 46, 66, 17,224,173,197,178,183, - 24,123,188, 58, 90,146,167, 20, 85,172, 74,141, 2, 59,168,182,162, 91,115,107, 92,168, 54,223,184,232,119,216, 13,176,222,114, -248,203, 92, 57, 11,126,155,126, 7,249,225,157,217,141,156,160,236,245,178,138, 85, 60, 53, 50,183, 53, 12, 57, 94,173,134, 82, -202,230,190,210, 57, 90,139, 21,176, 63,193,105, 44, 36,169, 17,217, 29, 0, 37,106,202,214,163,167,139, 75, 75, 81,233,166,150, -162, 87,154,103, 50, 73, 33,185, 39,231, 96, 58, 0, 54, 3, 97,182, 55,149, 85, 20, 42,139, 42,244,194,210,210,210,210, 88, 54, - 22,150,150,150,134, 6, 32,111,253,251,111,253, 25,127,246,206,255, 0,117, 13, 84, 31, 77,167, 61,189,153,157,251,127,142,111, -251,168,234, 6,201, 25, 61, 71, 79,216,116, 66, 7, 92,227,160,237,253, 29,191, 61,180,202,213,149, 2,195, 94,231,220,191,150, - 52,249,178,126,215,224, 63, 44, 79, 25, 63, 77,151, 39,255, 0, 6,119,218,127,150,103,111,251, 41,107,223,247,236, 95,244,103, -255, 0,219, 47,253,212,245, 4, 4, 2, 7, 95, 63, 47,223,170,169, 25, 61,186,122,250, 31, 81,243,210,126,219, 83,255, 0, 19, -240, 95,203, 24,230,201,127,181,183,192, 98,119,163,233,176,103, 24,246,104, 30,163,167,248,229,121,231, 24,255, 0, 53, 62,250, -168, 62,154,225, 35,175,179, 71, 31, 47,229,149,254,234,154,130, 42, 65,207, 67,215,212,255, 0, 96,209, 9,238, 1, 57,207, 66, -113,249,198,136,213,245, 67, 97, 37,143,253, 43,249, 99, 60,217, 45,187,126, 3,242,196,238, 7,211, 87,201,199,247, 52,251,255, - 0,207, 39,240,255, 0,146,174,190,171,233,171,114,130,127,185,167,159,151,242,200,255, 0,117, 93, 65, 69, 9,235,159,151, 79, -207,231,190,171, 4,115, 15,151,207,215,229,233,211, 26, 76,230, 21,118, 63, 93,254, 85,254,156, 37,237, 18,245,215,248, 15,203, - 19,165, 79,211, 89, 73, 4,159,102,170, 83,233,158, 50,135,207,254,106,191, 45, 18,215,211, 80,241, 19,205,253,205, 94, 80,123, -127,142, 62,115,255, 0,101,109, 65, 56, 67,100,168, 18,128,163,223,185,239,242, 25,237,223, 87, 54,211,203,202, 0, 0,118, 29, - 49,229,158,131,238,210,103, 49,173, 22,250,254,191,225, 79,233,198, 13, 68,189,155,240, 31,150, 39, 74,159,166,146, 79,127,102, -191, 47,111,249, 99,122,255, 0,213, 99, 85, 71,211, 69,207,250, 54, 71, 94,199,249, 98,244,199,175,249,172,106, 11,137, 0,145, -159, 63, 79,199,240,209, 41, 7,203, 0,118, 57,237,143, 77, 96,230, 85,191,241,191,202,159,211,140,123, 76,223,183,248, 15,203, - 19,158,254,253, 11,254,141,175,251, 98,127,186,206,189,143,166,127,144, 15,247, 54,241,159,249,225,255, 0,186,214,160,208,144, - 8,234,123,244,199,237,253,218, 36, 39, 29,124,250,119, 29,189,116,145,205, 43,199,251,255, 0,242, 39,187,252, 56,199,180,205, -109,218,196,123,135,229,137,201,143,166,116, 79,250, 55, 15,111,252,240,187,127,217,107, 94,199,211, 56, 39,191,179,119, 29, 51, -254,120, 95,111,127,241, 91,233,219, 80,111, 66,135,111, 60,254, 7, 24,209, 8,238,125, 72,239,223, 31,119,231,182,138,115, 90, -253,254,190,214,255, 0, 10,127, 78, 11,237, 51,116, 50, 88,250,233, 31,150, 39, 26, 62,153,166,112, 71,179,131, 57,237,142, 48, - 63,221,115, 94,135,211, 49, 57, 0,251, 55,241,156,227,252,112, 51,219,254,171,154,131,194, 82, 70, 48, 64,232, 51,143, 33,242, -252, 52, 66, 49,158,191, 96,244,255, 0,142,136,115,108,195,114, 42, 46, 7,248, 19,250, 48, 95,107,159,246,255, 0, 5,252,177, - 56, 65,244,203, 15,159,179,135, 31,245,191,207,255, 0,149,221,122,254,252,175,166,127,185,197,246,143,229,127,219,211,254, 75, -218,132, 10,112, 10,114,160, 9, 29, 7,168, 61,127,167, 94,243,144, 72,238,122,100,244,207,207, 69,253, 47,152,255, 0,204,127, -146, 63,233,198, 13, 93, 64,255, 0,121,248, 47,229,137,189,127,126, 89,255, 0, 71, 16,255, 0,239,127,229,235,254,107,186, 95, -223,150,127,209,197,255, 0,107,255, 0,247, 93,212, 32,130, 70, 78, 83,156,121,142,227,167, 97,235,175,129, 39, 36, 96,158,227, -228, 15,174,116, 63, 75,230, 63,243, 31,228, 79,233,198, 61,174,163,175, 50,254,235, 47,229,137,191,255, 0,126, 86,112, 79,247, - 56,187, 99, 63,227,127,235,216,255, 0,154,238,144,250,101,100,228, 15,103, 9,200, 56,255, 0, 59,241,143,159, 95,228,189,168, - 65, 28, 19,201,158,160, 12,125,189, 71, 93,124,228, 56, 61, 58,142,199,215,215, 67,244,190, 96,127,246,143,242, 39,244,227, 34, -170,163,188,157, 61,195,242,196,224, 26,250,101, 42,117,105, 66,125,155,238,173, 74, 90, 16,134,216,226,229,114, 31,117,110, 45, - 45,180,204,120,237,112,184, 87, 34, 67,142,173, 8,109,180, 2,183, 28,113, 40, 64, 42, 80, 26,145,125,139,237, 28,187,106,123, -107, 97, 92,219,161,195,163, 59, 99,184,215, 61,173, 2,228,186,182,189,141,220, 55,106,172, 25, 85, 68,137, 81,173,154,141,204, -118,206,154,106, 53,248,244,231,225,154,131,105,167, 50,136,178,214,252, 70,220,146, 35,151,215,249,251,123, 18,120, 79,167,111, -111, 18,114,247,186,251,163, 49, 85,218,222, 24,163,210,111, 53,194,156,128,245, 62,228,222, 74,163,175, 29,169,183,157, 96,172, - 9,108, 83,222,131, 80,184,101, 52,174,132,209, 41,225, 89, 75,196, 25,105, 85,110, 39,101, 73,126,161, 41,197,174, 75,239,169, -114,139,171,241, 63,239,176,162,251,170, 86,121,157, 65, 89,113, 67, 7, 35,169, 4, 18,115, 82,113,247,137,217,238, 79, 87, 22, - 91,147,230, 34, 26,136,198,185,156, 69, 79, 33, 23,221, 80, 44,145, 56, 6,222, 98,116,157,153,122,110, 71, 99,125, 27, 60, 13, -161,241, 3, 47,175,226,174, 50,162,122,236,146, 71, 48, 81, 64, 36,150, 14,107, 70,214,150,114,244,239, 20,133,117,222, 36, 93, - 65,110,172, 77,203, 45,186,186,215,180, 61,151,139, 72, 78,210, 40, 56,230, 50,147,125, 47,149, 37, 77,151, 65,231,254, 5, 97, - 72, 9,229,201,242,231, 29, 51,240,235, 38,139,199, 80,146,160,145,181,193, 5,104, 75,168,255, 0,223,202, 78, 90, 39,195, 82, -214, 13,164, 11,120,116,164, 96,142,161, 65, 94,120,215, 37, 97,212,227,199,149, 78, 9,151, 17,105,146, 42, 43,109,228,184,158, - 66,150,152, 96,162, 49, 81, 60,133,229, 15, 16,124, 93, 73, 25,192,198,117,127,135,119,198,133, 85,181,154, 92,152,232, 50, 28, -186,224, 45, 77,133,168,134,145, 77,106,160,134,156, 25,228,241,210,136, 43, 91,107, 60,205,168,199, 90, 80, 50,188, 26,248,120, -191,199, 91,223, 62,222,224, 91,217,168,122, 27,111,255, 0,163,123,205,183,183,173,183,183, 70,215,125, 26,252, 47,211,253,139, -131,216, 17, 28,143,189,110,104,215, 17,164,174,118, 53,123,111, 17, 95, 80, 78,224,219, 29,102,143,198,144,125,124,131,109, 74, - 72, 74, 85,145,120,165,105,198, 84,135, 7, 50,109,142,133, 46,164,167, 31,102,112, 78, 53,145,195,226,200, 74,117, 13, 42,195, - 67, 36,164, 41,197, 27,185, 11, 13, 21, 41, 73,194,147,252, 30, 10, 94, 8, 28,197, 41, 32, 5,103, 39,166,121,115, 2,240,167, - 70, 20, 80,180,187,134,229,185, 73,145, 29,134,150,242,101, 73,157, 30, 64, 97,134,152, 42,230,117,245, 61, 19,152,140,164, 39, - 42, 42, 1, 32,105,211,165, 85, 16,235,177,228, 37,200,205, 55, 48,170, 47,130,211,169,144,168,175,186,194,157, 76, 57, 13,129, -240,203, 11,104,243,140, 39,147,168, 74, 84, 64,202,195,197,222, 56, 99,182,126, 45,113,183,178,209,131, 98, 7, 66,105,253,247, -233,115,110,128, 3,138,247, 55,240, 35,129, 40,195, 21,225,118,129, 72,107, 19, 85, 94,119, 82,194,219,213, 27,146,171,175, 96, - 71,152,124, 11,113,237, 58,246,213,110,191,179,158,220,176, 55, 74, 7, 3, 3,126,182, 34,238,121,155,106,229,220,202, 87, 17, - 78, 89, 19,118,199,113,165,190,239,212,246,205,239,105,183,176,245,193, 6,220,171, 67, 74, 62,167,174,138,129,141, 46,106, 28, -166,201,143, 6, 89,138,153,124,121, 63, 76,188,131,211,217,192, 8,233,212,113,129,228,124,255, 0,205,115,211, 93,240,187,108, - 11, 23,121, 44, 27,215,104,183, 62,212,167,238, 22,218,110, 61,183, 91,177,239,203, 66,160,208, 85, 46,224,160, 85, 98, 2,253, - 61,213,161,121,131, 48, 56,162,244, 73, 72, 34, 68, 57,212,248,242,227, 45,183,153,109, 73,252,231,120,230,246,106,239,183, 6, - 60, 82, 94,220, 62, 83,108,205,193,221, 91, 81,182, 13,241,179, 87,213,187,104,220, 55, 36,155,231,104,106,242,164, 10, 21, 78, -166,154, 13, 41,239, 10,232,165,186,219,212,154,235,124,169,228,168,210, 87, 32, 1, 30,100,114,171, 79,131, 60, 72,204,115,136, - 37,165,205, 43, 2, 87, 83,141, 66, 67, 28, 72,146,161, 61,172,129, 53,165,192,178,216, 50, 16, 84, 54,151,115,201,126, 41,240, - 67,240,133, 90, 87,229,108, 70, 77, 84,193, 66, 19,169,160,115,246, 86,238, 90, 66,143,111, 41,114, 72,109,181, 29, 64, 44,156, -255, 0,191, 47,234, 71,247, 56, 71, 65,159,243,192,245,237,255, 0, 37,221,124,254,252,192,255, 0,251,184, 58,127,233,129,251, -191,146,230,161, 89, 94,176, 47,187, 81,114, 17,117,216,247,149,174, 99,171,195,147,252, 35,181,171,244, 20,198,115,152,128,219, -235,171,211, 88, 13, 56, 84, 8, 9, 81, 4,144, 64, 7, 88,123, 74, 75,159, 19, 69, 14,164, 21, 0,180, 45, 46, 36, 20,146, 20, - 9,109, 68, 2, 15,124,246,212,249, 51,218,185, 55,142,181, 92,123,132,103,248, 46, 42, 15,110,150,246, 51, 0,111,208,133,191, -238,181,241, 56, 81,244,203,137,239,236,225,192, 29,201,226,255, 0,215,254,171,186,248,126,153,120, 29, 15,179,135,175,203,139, -254,159,143,242, 93,212, 32, 71,158, 48, 9,235,223,204,253,191,118,188,167, 39,161,193,199, 83,242, 36,159,221,165,127, 75,230, - 63,243, 31,228, 79,233,193,189,170,162,223,222,111,255, 0, 72,252,177, 56, 1,244,203,201, 56, 30,206, 14,191,250, 95,255, 0, -186,238,190, 43,233,152, 4,128,127,185,195,159, 80, 56,191,234, 62,223,241, 93,212, 32,142,124,128,239,248,116,243,251,245,224, - 2, 84,115,211, 3,186,122,117, 63,111,200,157, 15,210,249,143,252,199,249, 19,250,113,159,106,159,254, 39,224, 63, 44, 78, 11, -251,242,241,128,127,185,197,247,127, 43,254,191,183,133,221, 47,239,203,198, 79,253,206, 35,129,231,252,175,186,125,255, 0,226, -187,211, 80,130, 66, 58,149, 12,115,116, 4,159, 63,159,111,206, 53,240,167,226,206, 58,142,135, 29,189, 58,232,126,151,204,127, -230, 63,200,159,211,129,237,117, 31,183,248, 47,229,137,190, 15,166, 96, 9, 35,251,156, 36, 99,204,241,125,223,236,255, 0, 21, -237,123, 31, 76,184, 28,127,220,226,239,156,127,141,247,167,127,249, 47,106, 16, 24,207,151,108,247,244,199, 92,126,124,181,244, -117,192,232, 61, 63,183,166,135,233,124,199,254, 99,252,145,255, 0, 78, 49,237, 85, 23, 31, 89,248, 47,229,137,191,143,166, 88, - 79,250, 56,122,245,233,252,175,255, 0,163,252, 87,122,235,233,250,101,100,119,246,112,227, 63,243,191,235,248,127, 37,221, 66, - 19, 3,190, 50, 71, 94,159,213,159,150,190,247, 32,249,119,193, 25,253,190, 93,244, 63, 75,230, 63,243, 31,228,143,250,112, 61, -170,163,254, 39,224,191,150, 38,238,126,153,113, 31,232,224, 56,245,254, 87,248,253,159,201,119,166,169, 43,233,153, 17,254,141, -252,140,227, 63,203, 3, 30, 93,255, 0,205,115, 80,137, 32,156,156, 0, 51,142,224,117,245, 61,123,245,213, 5, 32, 17,128, 51, -158,253,127, 63,145,172,254,151,204, 44,127,180,111,255, 0, 68,127,211,140,251, 84,255, 0,183,248, 15,203, 19,121, 63, 76,212, -130,113,236,221, 39, 7, 31,231,129,248,255, 0,201,111, 95, 15,211, 55, 35,183,179,120, 30,153,255, 0, 60, 47,217,254,107,125, -245, 7,245,128, 51,129,133,119,198, 14, 62,255, 0, 77, 10,172,140,244, 29,122,244,245, 31,111,111,237,209,151, 54,175,239, 83, -123,255, 0,129, 63,167, 25,246,169,251,191,224, 63, 44, 78, 33, 95, 76,228,167,253, 27,185, 30,191,203, 11,253,214,245, 72,253, - 51,220, 28,127,115,115, 63,245,194,255, 0,117,175, 77, 65,216,247,233,128,113,149, 30,227, 30,127,111,150,188, 16,112,114, 0, -207, 92, 14,248,249,244,232, 59,232,227, 53,175, 32, 30,127, 95,240,167,244,224,235, 81, 49, 23, 50,126, 3,242,196,226, 85,244, -208, 57,127,209,181,145,235,252,176,255, 0,221,103, 84,207,211, 67, 35,253, 27, 63,135, 24,191,238,177,168, 57, 45, 35, 56,193, -193, 29,252,191, 31, 95,234,208,235, 73, 57,230, 30,125,255, 0,163, 74, 46,103, 90,127,223,127,149, 63,167, 0,212,205,183,155, -175,184,126, 88,156,137,250,105, 24,200,254,230,199,108, 99,252,113,123,255, 0,217, 99, 84,213,244,210,249,127,209,175,159,250, -227,126,239,228,175,168, 52, 41, 61, 72, 62, 89,255, 0,142,168, 41, 56, 62,164,103, 31,126, 58,232,227, 50,173,255, 0,141,127, -251, 83,250,113,145, 81, 41,232,255, 0,128,252,177, 57,179,244,211,113,219,217,173,147,233,252,177,255, 0,221, 95, 94, 15,211, - 80,198,127,238,106,246,242,254, 88,253,127,254,213,181, 6, 5,142,164,147,229,220,116,200,251, 71, 97,211, 84,150, 6, 51,159, -179,211,246,104,227, 48,172,218,243, 94,253,244,175,244,227, 62,209, 55,237,254, 3,242,196,231,207,211, 85, 32,103,251,154,121, -199,252,242,113,255, 0,229, 87, 84,149,244,214, 72,255, 0, 70,150, 71,254,153, 61,191,236,169,168, 45,169, 56,237,219,247,143, - 95,191, 67, 44,117, 35, 3,175, 92,104,195, 48,171,190,242,237,255, 0, 74,254, 88, 56,158, 75,253,187,253,195,221,238,196,233, -215,244,215,249, 15,254, 13, 12,143, 95,229,149,251,191,146,159,174,168, 31,166,202, 57,185, 71,179, 56,159, 60,255, 0, 44,190, -159,179,133, 62,250,130,147,205,243,116, 35,207,203,167,159, 76,103,203,250,244, 42,153, 60,221,200, 3,183,150, 62,206,158,154, - 88, 86,212,216,125,109,255, 0,237, 95,203, 6,231, 73,183,159,240, 24,157,183,247,236,196,140,143,102,104,199,110,188,102,224, -231,211, 31,201, 71, 94, 15,211,105,229,239,236,204,199,253,115,191,221, 71, 80, 71, 82, 0,206, 51,208,227,167, 94,222,154, 25, -105, 72, 7, 35,174,124,242,122,252,243,246,104,235, 89, 57, 27,203,191,192,126, 88,199, 58, 77,183,189,253,195, 19,188,254,253, -183,254,140,191,251,103,127,186,134,150,160,120, 80, 60,142, 63,111,239,210,209,253,170,163,254, 39,224,191,150, 13,205,147,246, -191, 1,249, 99,234, 65, 0, 3,249,235,162,146, 15, 64,123,244, 31,156,106,138, 70, 79,203,207,243,246,232,132, 12,159,179,175, -223,157,105, 22,185,191, 75,116,194,120,174, 1, 61,189,113,249,249,106,176, 0, 96,121,121,254,253, 83, 70,122,244,200, 36, 12, -231,183,231, 58,174,144, 14,115,158,131, 61, 52, 76, 12,123, 74, 74, 73,234, 49,249,252, 52, 66, 7, 76,250,254,204,106,130, 50, - 71, 92,224,158,153,235,223,231,231,253,154, 41,180,246, 7,203,169,252,253,186, 65,141,205,241,131,176,191,166, 43,163, 29,135, -197,143, 79,159,217,162,144,140,142,131, 3,207,237,253,231, 84, 17,208,244, 3,175,125, 20,140,253,223,191, 68, 98, 69,192,194, - 36, 91,248,227,210, 7, 98, 79, 83,230,122,244,253,253,180, 72,193, 3,207,211,167,159,110,218,164,145,147,246,117,209, 9,237, -140,128, 1,200,251, 71,223,219, 73, 49,185,233,108, 99, 21, 18, 0,193,193,235,223, 61,241,233,162, 83,140, 14,157, 60,134,124, -191,118,168,164,115, 31,219,247,116,237,162, 80,158,163,167, 65,235,162,147, 97,115,219, 4,244, 23,177,255, 0,199,207,250, 98, -170, 64,242, 3,229,162, 82, 9,192,249,119,249,252,245,118,183, 45,171,130,238,172, 83,173,203, 86,135, 85,184,238, 26,180,164, -196,164, 80,104, 52,233,117,122,213, 90, 99,129,106, 68, 58,109, 46,158,203,143,206,146,164,161,100, 33,180, 40,242,182,165, 16, - 2, 73,213,222,187, 99, 94,182,156,151, 98, 93, 54,117,215,108, 74, 96,148, 63, 30,227,182,235,180, 39, 90, 90, 78, 20, 28, 77, - 82,158,215, 41,230, 7, 90,109, 60, 43, 32,137,165, 81, 43, 11,133, 36,106,181,237,123,117,183,107,224,250, 36,229,180,162, 54, - 49, 41,179, 56, 83,164, 27, 94,197,173,164, 27, 88,218,247,182,248,198, 80,144,123,128, 8,207, 65,220,156,249,122,157, 86, 70, - 62, 33,143,179,215,239,252, 63,110,188, 32, 18, 50,217, 14, 1,220,161, 73,115,211,185, 65, 56,237,162, 27, 73, 86, 58,128,125, - 7,127, 95, 61,101,136,223,126,191,127,195, 26,250,131, 11,131,127,120,239,138,168, 73, 56,233,212, 12, 30,190, 64,234,179,125, - 79,108,128, 65, 3,191,221,251, 53,245, 40,236, 58,103,190,122,253,191,187, 85,144,140, 43,169, 3,207,228,114, 15, 95,217,164, -240, 49, 84, 39, 42,193,232, 59,129,129,148,140,118,207,225,175, 74,108,245, 4,242,143, 47, 81,233,175,160,149,103, 24, 10,245, - 30, 99,243,231,175, 67,174, 2,178, 51,230, 48,123,121,159,195,246,235, 24,199,195,174, 40,165, 56,206, 85,212,156,142,157,254, -204,246,215,148,164, 2, 50,163,223,238,235,242,243, 58,172,224,201, 29,122,122,142,157, 51,140,159,151, 93, 92,168,148, 58,189, -195, 84,167, 81, 40,116,202,141,102,177, 88,152,213, 58,145, 73,165, 65,153, 85,171, 85,170, 18, 20, 16,196, 10, 77, 42, 3, 46, - 72,169,206, 90,136, 8,101,134,214,226,179,209, 58,195, 50,162,150,118, 10,171,185, 39, 96, 48, 91,133, 2,231, 97,181,254, 54, -183,239,197,153, 93,240, 57, 64, 30,106, 3,174, 51,128, 61, 53,233, 88, 67, 69,215, 84, 27,101, 56,241, 29, 89, 8,105, 40,238, -165, 21,172,129,140,103, 82, 39,224,247,232,242,113, 5,186, 44,209,175,126, 45,110,120,252, 41,109,245, 65, 45, 76, 98,212,168, -192,137,115,111,205,126, 34,210,167, 80,219, 22, 95,189, 38, 13,132,167, 80,143,133, 85,151,221,152, 18,178, 69, 47,152, 99, 82, - 25,217,126, 4,125,158,220, 32, 70,111,248,177,225,226,214,187,174,202, 84,112,204,221,208,222,132,198,220,171,212,205,121,104, - 12, 72,241,238, 54,151, 77,163,211,164, 45, 56,103,220,169,241,154,109, 74,229, 79, 82, 64,134,103, 28,115,148,101,101,145, 24, -213,204,187, 89, 14,215,247,144, 9,248, 27, 91,212,226,216,224,191, 5,184,251,142, 12,111,150,229, 38,134,142, 80, 8,158,164, - 20, 4, 18, 0,100,140,217,216, 94,195,204, 99,185,176, 23, 36, 3,170,254,203, 46, 26, 46, 77,165,224, 39,102,233,180,203, 98, -123, 55, 94,240,135,247,210,247,144,229, 50, 82, 28,149, 42,249, 17,191,130, 80, 39,169,184,229, 79,197,133, 96,194,183,154,100, -100, 99,197,117, 73, 37, 43, 81, 86,234, 87,236,203,238,132,204, 33, 46,221,170, 32,138,139, 45, 45,243, 6, 98, 99, 20,165,137, -143,123,195,179, 60, 34, 27, 65,240,249, 15, 57, 79, 42,214, 17,130, 72, 35, 99,155,223, 42,234,221,136,202,101,194,143, 66,171, -184,105,112,211, 76, 5,132,211,101,181, 28,123,180,100, 71, 82, 83,238,168, 82, 80,227, 9, 67, 73, 8, 14, 54,132, 97,180, 20, -130, 37, 39,125, 42,234,171,170,153, 34,124,151,131,206,170, 19, 32, 54, 57,101,207,141,200,137,172, 48, 57,190, 37, 8,222, 27, -165, 60,170, 39, 42, 9, 10,109, 42, 35,158,243, 89,104,243,106,250,186,249, 38,156,203, 86,236,231,104,202,139,157,149, 87, 85, -236, 1, 10,190,110,130,198,230,248,244,231,129,168,248,183,129,184,107, 38,225,202, 14, 30,163,155, 47,200,105, 99, 77, 38, 89, -121,146,114,215, 68,146, 59, 8,236,178, 22, 87,121, 1, 82, 69,181, 95, 73, 7, 26, 81, 90,169, 61, 79,168,208,167,204, 91, 44, -184,170,148,168, 83, 66, 11,141, 70,124, 78,167, 84, 35, 51, 29,198, 66,130, 11, 8,121,168,165, 36,146,181, 41, 14, 44, 21, 40, -224, 88,100, 92,178, 84,252, 41, 12, 58,134,169,236,223, 20, 56, 17, 31, 91,158, 31,213,209,106, 45, 85,162,212, 38, 53,239, 67, -159,220,194,222,100,171, 9, 37, 41,111, 45,133, 37,120,214,238,238, 21,145,110,110,237, 53,104,141, 18,147, 65,187,160,213,226, - 84,226, 75, 44, 52,154, 77, 70,163,111,200,247,152,240,235,208,227,114,167,192,113, 14, 20, 25, 44,164, 59, 28,191,226, 56,135, -145,206,141,115, 74,240, 69, 70,139, 58,226, 93, 94,157, 42,151, 38,217,171,209,163,191, 18, 75, 72, 91,241,167,211,107,148, 86, -235, 13,120,141,225, 15,143,117,147,200,218,176,158,118,242,164,158, 78,241, 42,202,121,105,230, 69, 46, 37,138, 83,229, 96, 54, - 39, 96, 53, 11, 27, 48,191,217, 61,150,247, 32, 99,163,184, 11, 53,202,248,178,154, 72,228,131,244,126,105, 66,170,147,211, 72, -202,218, 17,229, 26, 94, 18, 8, 15, 27, 23,116, 14,187, 34, 6, 89, 17, 67,170, 54,206, 82,238,185,177,160,198, 76,229,153, 13, -208,110, 74, 4,198,235, 44, 56,149,128, 69,106, 35, 41,155, 33, 8,201, 46, 37,233,173,153, 1,226, 91, 60,203, 41, 39,176,223, -221,171,219,215,238, 40,178, 42,213,233, 10,163,209,233,181, 8,142, 38,114, 84,251,110,185, 54, 35,209, 31, 13,197, 91,138, 79, -143,206,150,212, 57,242,124, 38,229, 16, 84, 73,240,213,204, 75, 50,143, 87,173, 84,164, 89, 20,181,168, 46,225,151, 26,159, 71, -109, 65, 14,184,229,111,223,226,166, 53, 41,224,179,148, 64,114, 79,132, 90,113, 73,200,104,184,146,174,118,146, 79,101,175,201, -205,219,204,155,102,128,180, 26,125, 18, 28,150, 98,195,105, 10, 14, 85, 92,139, 49, 44, 74,113, 69,160, 66,149, 34, 98, 36, 58, - 20, 83,202,178,235,104, 56, 3, 26,125,225,170,120,167,231,215, 85,141,112,211,105, 68, 66,108, 25,200, 98, 1, 35,204, 2,129, -118, 32,139,221, 73,211,171, 88,164, 60,112,168,124,170,167, 38,200,178,103, 72, 51, 44,237,231,149,166, 81,253,213, 50, 10, 79, -172, 10, 67, 42,201, 44,175, 42,128,126,168, 90, 67,176, 82, 27, 44,157,124, 91, 86,163,172,210, 40,209, 33, 66,112,182,149, 48, -228,143, 4,186,243,202,144,134,136, 71, 50, 71, 59,195,196, 43,253, 81,128,121,143, 54, 9,213, 9,123,191, 49,153,245, 55, 35, -206,109,168,116,233,113, 41,236,173,165,115,203,126,108,150, 24,126, 66, 34,165,149,164, 32, 41,215,163,182,233, 78, 22,166,155, - 90,143, 48,108,145,165, 85, 75,154, 37, 70,161, 46,164,219,243,155,165,183, 95,162, 83, 41,204,184,183, 31,120, 38, 3,190, 45, -101,232,203,231, 40, 76,115, 83, 50,127, 74, 20,164,143,112, 40,242, 9, 31, 98, 92, 79, 79,129, 78,140,203, 11,121,138,245, 72, -215,101,185, 49,196, 39,158, 19, 18, 21, 36,165,158, 84,115,163,196,105,234,116,116, 44,252, 60,143,172,114,249,234,105,237,243, -234, 88,226,151,149, 96, 84, 34, 93, 22,215, 29,128, 4, 3,181,141,183,216,168,177,185,166,163,240,166,136, 67, 12,245,145, 53, - 84,238, 0,153,166,177, 96,204, 18, 87, 55,144,155,186, 70,146, 43, 45,216,107,212, 1, 59, 91,122,169, 91,167, 70,186,227,184, -197,203, 10,131, 87,163,189, 10, 69, 85,214,171,148, 90, 69,113,166, 35, 70, 56,136,137, 81,234,204,184,151,100,173,214,164,200, -104, 6,254, 24,254, 26,193, 30, 33,214,177,238,127, 2, 62,206, 30, 34,208,151,119,167,131, 14, 31,170, 51,171, 76, 70,150,170, -189, 2,208,133,100, 93, 16,152,156,135, 92, 15,166,232,176, 13, 54, 74,101,165,135, 57,220, 33, 69, 97,249, 39,169,192, 0, 26, - 93,210, 95,153, 46,142,195, 48,212,207,240,138, 76,170,188,247,144, 86,212,166, 41,209, 88, 17,109,147,200,217,240, 91,113,230, - 10, 86,128,162,166, 98,165, 96, 97,201, 9, 78,178,250, 69, 65,249,177,152,150,228,245, 53, 78,141,239,234,159, 40,211,220,125, -234,189,102,123,128,204,166,210,121, 79, 70,152, 89, 40,114, 90,121,185, 11, 65,166,199,232,221,121,189,200,179, 42,152, 93, 92, - 75,230,181,135,235, 18,204, 69,152,107,221, 75, 2, 72,234, 69,174, 46, 14, 32, 60, 65,225, 38, 67, 80,102,246,156,185, 96,142, - 64,186, 65, 26,216, 43, 6, 40, 6,149,221,157,212, 46,150, 93, 69, 68,110,116,131, 41,199, 40, 55,231,232,175,112, 39,186, 52, -233,149,158, 27,247,143,120, 56,116,174,173,153, 18, 34,210,174, 57,144,247,130,194,102, 74,185,149, 26, 52,200, 23, 10,162, 86, - 96,176, 86,182,130,146,213, 93,197,161,183, 1, 8, 39,149, 38, 53, 60,110,123, 1,189,162, 92, 20, 64,171,222, 82,246,226, 47, - 16,123, 65, 75, 15, 72,127,116,120,126, 77, 82,239, 20,202,115, 40, 46,174,117,219,183,111, 65, 69,126,215, 97, 8,232,243,169, -139, 58, 27, 74, 74,185,166,114,142, 99,250, 18,209, 46,181,183,224, 68,113,102, 52,106,107,177, 37,200, 76, 89,105,113,113,218, - 56,118, 12, 55,101, 50, 10,230, 23, 86, 85, 37,215,208, 22,167,192, 67, 77,169, 69,206,125,108,205,177,123,137, 81,132,228, 77, -240,230, 79,154,105,244,170, 68,172, 70,170, 45, 44,243, 23,229,205,128,165,133,198, 42, 67,110, 60,176,176,144,220, 86,155, 75, -156,175,184, 82, 37,249,111, 22, 85, 64,218, 42, 36, 46,150,235,171, 86,247,176,186,185, 5,172, 47,228,140,198, 46, 44, 72,234, -121,147,139, 60, 39, 92,176,153,168,117, 68,140,198,218, 71,144, 3, 98,138, 64,212,159,103, 84,140,214, 0, 32, 12, 28,131,124, -126, 50,105,198, 21,146, 20, 2,150,143,132,228, 7, 26, 81,109,214,212, 65,248, 92, 74,194,146,164,156, 20,169, 37, 42, 0,131, -165,219,161,234, 58, 18, 58,228,124,254, 71, 95,166,111,180,163,216, 17,194, 7, 31,240,238, 45,193,218,248,212,110, 26,248,173, -144,137, 82,206,229, 89, 52, 54, 25,176,183, 2,186,219, 40,113, 49,183,135,111,169, 74,106, 53, 73,215,223,228, 75,245,122,111, -187,214,152, 50, 20,235,206, 84, 2, 61,217,127,158,255, 0, 24,156, 20,241, 33,192,134,239,206,217, 30, 38, 54,238,125,139,118, -182,211,245, 43,118,166,211,159, 90,217,123,137,109, 53, 37,113,155,187,182,234,235,101,180,177,115, 80,148,226, 64,116, 0,220, -200, 46,171,221,234, 49, 34, 72, 30, 25,177,178,252,214,159, 48,137, 36,141,135,159,161, 6,234, 78,231, 77,251, 48, 0,221, 90, -199,202,197,117, 32,214,105,170,234, 26,172,186, 65, 29, 84,101, 65, 54, 87,177, 10,215, 32, 13,141,138,150,236, 14,199,245, 75, -111,141, 87,232, 7, 78,223, 46,186,240,164,147,156, 28, 3,215, 4,145,249,235,175, 68,129,142,189, 7, 76, 99,191,151,125, 32, - 65, 39, 61, 71, 76, 36,140,103,167,252,116,233,141, 78,248,166, 18, 9,199, 92,122,143, 95,234,239,175,161, 36,250,244,200, 30, - 93,115,158,191,142,170,121,127,171,248,116,215,196,144, 1,202,147,156,231,167, 92,228,232, 96,111,143,129, 56, 33, 89,201, 25, -230,243,242,215,164,117, 4,143,135, 25, 61,115,251, 63, 29,125,233,140,254,206,216,252,245,215,209,215,246, 12, 1,220,121,253, -253, 52, 48, 58,123,176,136,207, 68,245,233,231,142,164,103,246,106,130,219,198, 9,242, 61, 70,124,244, 78, 14, 58,140,121, 2, - 70, 49,246,252,191,175, 84,207,110,131, 39,246,103, 63,212,127,167, 88, 6,255, 0, 17,140,224, 37,160,224,249,103,215,184,207, -168,252,247,208,170, 64, 0,231, 36, 18,123,250,252,190, 90,184, 57,205,158,184, 61, 58,231,190,125, 58,121,245,208,238, 32,242, -231, 4,117,232, 58,231,175,203,236,214, 65,232,122, 99, 32,158,221, 78, 45,197, 1, 39, 32,245, 29, 49,158,152,199,174,188, 20, -231, 36, 28,121, 28,159,179,207,240,209, 42, 73,234, 20, 7, 79,245,123,146,126,126, 67,174,168,242, 12, 40,100, 99,166, 0,243, -235,158,231, 75,169,184,235,131,168, 34,219,109,243,243,111,195, 3, 40, 3,212,147,129,248,125,186,160, 70, 70, 63, 35, 70, 41, - 35, 56, 30,153, 63, 44, 13, 12,180,144, 73, 3,167,246,126,206,186, 81, 79,108, 24,216,116, 23,254, 71, 0,184, 0, 32,116,206, -122,159,217,215, 31,158,154,162,160, 78, 58,100,103,175,175,221,163, 20,147,230, 7,221,216,158,250, 25, 89,201,230, 56, 39,183, -207,211, 31,119,244,105, 92, 1,208, 95,113,129, 22,128,114, 64,199,200,249,250,140,104,117, 35,166, 6, 1,239,246,103,200,244, -209,138,206, 65, 56,207,160,242,208,199,169,200,207, 95, 92, 14,221, 63,118,149, 7,160, 39,167,207, 95,158,248, 54, 5, 87, 76, -228,103, 25,253,159,187, 66,172,116,206, 15, 78,216,253,164,244,237,211, 70,172,100,142,152,235,220, 30,253,124,255, 0, 62,122, - 25,196,228,156,100, 1,208,227,182, 79,228,104,248, 50,250, 91,127, 92, 91,215,128,112, 14, 73, 39,167,161, 29,123,232,115,223, -168,235,158,191,184,104,199, 19,144, 83,211, 62,126,189, 61, 63, 13, 12, 80, 70, 78,114,125, 15,225,223, 58, 89,122, 97, 81,107, - 3,210,216, 29,105,243, 25,206,133, 90, 72, 39,183,153,251, 62,223,150,116,105, 25,251,186,250,103,228,126, 90, 25,105,206, 73, -200, 62,126,125, 59,253,250, 85, 79, 91,157,176, 69,216,144,119,183,250, 96, 34, 48,113,165,175,107, 73, 39, 35,175,224, 52,180, -174, 15,113,220,216,227,234, 49,143,233,209, 40, 24, 3,231,215,243,247,106,128,198, 6, 1, 31, 35,223, 85,211,204, 59,128, 49, -233,223, 61, 58,233, 18,118, 3,231,221,140,226,178, 60,250,253,223,191, 85,209,220,253,157,189,127, 63,191, 84, 81,143, 33,215, -204,234,178, 6,122,231,177,237,249,242,254,173, 16,157,137,190, 6, 8, 78,112,112, 70, 7,124,143,196,244,243,233,162, 27,234, -126,239,234,213, 4,125,189,188,191,126,189, 18, 64, 86, 14, 8, 30,125, 1,207,244,255, 0,102,181,216,133,193, 78,224,142,199, - 7, 54,115,211, 61, 62,206,158,126, 99, 69,164, 14,128, 16,123, 15,151,236,213,189,146,233, 74, 78, 19,142,153,251,112, 63,171, - 71, 55,223,162,122,140, 28,224,246,249,233, 34,215,194, 71,174, 43,165, 61, 65, 57,232,123, 99,191,167,237,209, 9, 0,142,169, -249,103, 39,175,175,217,170, 64, 18, 71,145,233,231,230,123,231,229,170,232,200, 36,116, 29,135,203,168,243, 62,103,182,176, 73, - 61,123, 96,167, 21,209,156, 1,208, 14,195,241,243,249,104,148, 3,216,156,228,224,103,250,117, 65,160, 72, 29, 58, 3,231,163, - 16, 58,231,175,203,211,211, 73,191,175,207,108, 99,107,145,181,206, 58,159,236,114,180, 36,215,120,223,178,238,166, 92,121,134, - 54,178,207,191,175,249, 50,154, 42, 65,101,248,212, 39,104, 52,196,151, 17,213,181, 46,101, 96,132,144, 65,248, 62,103, 82,170, -147,119, 79,171, 52, 99,214, 12, 27,130, 56,200, 92, 43,154,147, 73,175,197,113, 32,149, 96,181, 85,136,238, 83,215,166,114, 61, -117, 30,111, 98, 93, 13, 12,206,226,110,249, 80, 74, 93,129,102,217,118,147, 11, 61, 22,147, 89,172,205,170, 73, 66, 84, 58,128, -180, 66,104, 17,242,215,110, 85, 89, 62, 34, 74, 78, 18,162, 18,178, 78, 2, 72, 24,243,252, 53,207,158, 33,214, 52,188, 67, 60, - 91,218,146, 56,163, 6,254,160, 73,191,190,242, 16, 55,233,143, 67,190,140,252, 57, 24,240,222, 10,185, 97, 89, 6,113, 87, 87, - 57, 12, 1, 4, 44,130,152, 2, 8,181,138,211,143,223,140, 91,113,184, 80,224,223,122, 90,127,248,197,225,195,111,141, 78, 74, - 74, 28,185,236, 6,100,109,189,210,202,149,255, 0,194, 25,155,109, 45,182, 30,116, 14,184,114, 58,193, 35, 36, 29,114,235,126, - 61,136,232,153, 30,101,195,194, 78,234, 11,142, 74, 18,167, 81,180, 59,192,184, 84, 27,145,224,126, 38,225,219, 27,129, 13, 41, -129, 85,124,254,171,109, 79,106, 42,220, 56, 5,240, 78, 79, 93,141,126, 51,110,161,151, 93, 72, 82,213,250, 21,147,128,162,159, -242,172,156,116, 75,192, 96,143,245,128,214,109,101, 34,179,125, 87, 98,219,150,188, 73,117, 58,171,235, 8, 75,113, 88,113,228, -190,130,160,148, 6,130, 7,194,176,163,212,158,137, 41,207,108,226, 37, 67,197, 89,254, 85, 44,107, 65, 92,242,128,109,202,127, -172,140,251,130, 53,244,131,234,154, 77,174, 21,133,241,105,113, 79,128,254, 26,113,109, 13, 76,249,182, 65, 22, 83, 80, 16,177, -174,164, 11, 73, 52,123,127,120,210, 70,162, 57,108,123, 78,146,165,250,169,223, 16,133,191,246,226,251,218,171,186,173, 97,110, - 77,165,112,216,183,165, 5,229, 49, 86,182,110,106,115,212,202,172, 69, 5, 40, 7, 80,219,163,150,100, 37,129,150,164, 48,167, - 88,117, 63, 19,110, 40, 29, 97,233,193,243, 24, 29,250,143,184,116,215,232,143,190, 62,204, 45,147,226, 95,110, 34,219, 28, 90, - 85,225, 64,173,211, 34, 4,217, 87, 45, 7,192,123,116,108, 57, 14, 35,197, 13,193,172,182,131,239, 52,194,172,248,180,249,101, -232,171,201,194, 80,172, 40,106, 85,157,236, 48,246, 94, 89, 49, 96, 11,150,111, 16, 59,185, 80, 43, 83, 18, 93,168,222, 84,251, - 54,159, 41,214,155,241, 92, 81,129, 64,166,133,196, 36,117, 74, 67,170,207,108,116,206,173,202, 63, 17, 40,214,142, 55,205,233, - 13, 21,112,217,227, 87,141,135,185,128, 46, 29, 67,117,210,202, 74,244,212,246,213,142, 20,207,126,143,124, 95, 14,119, 61, 31, - 6,200, 56,195, 36, 55,104,107, 68,114, 83, 2, 59,199, 46,168,204, 70, 69,177,250,200,100,120,157,124,223, 84, 73,137, 96,225, -130, 70,121, 22, 8,237,202,133, 96,250, 28,227, 72,168, 32, 0, 58,146,113,140, 31, 63,151,222, 53, 61,230,125,146,190,201, 76, - 62,208,225,254,252, 87,128,217,112,248,251,193,118,173,197, 4, 39,152,242,173, 11, 29,115,211, 32,117,193,211, 69,186, 94,193, -159,103, 5,247, 75, 55, 6,222,220,187,247,177,170,142,168,178, 84,212, 27,150,141,124,210, 39, 70, 74,144,228,182,226,199,187, -233,222, 60, 23, 11, 1,196, 7, 82,242,195,107,113, 42,240,151,142, 83,177, 77,226, 46, 75, 83, 47, 41, 81,193,177, 55,242,216, - 0, 46, 73,185, 22,183,223,238,190, 25,235,190,143,254, 42,229,177,123, 69, 87, 14,170,171, 21, 80, 22,161, 11, 51, 57, 1, 84, - 2,160, 93,137, 3,114, 63,142, 35, 1,192, 79,179,155,127,248,252,190,165,208,246,210,151, 26,220,219,219, 90, 68, 49,185,187, -209,119,179, 45,157,189,219,184,210,112,227,112,228, 57, 29, 33,219,162,244,145, 27,153, 80, 40, 80, 57,165, 61,128,236,151, 33, -196, 10,146, 38,173,194, 71, 5, 92, 32,251, 61,109,198,127,137, 11, 71,248,111,187,134, 47,186, 92,156, 68, 95,208,233,213, 77, -203,169,188,166,210,220,230, 45,176,210, 20,198,221, 91, 60,222, 42,147, 78,163,161, 14,132, 16,169, 50,102, 40, 41,100,251, 2, - 70,221,108,222,222,208,118, 35,135,219, 98,141,182,187, 99,183, 80,221, 22,253,169, 5,240, 28,175,120,202,109,117, 43,158,224, -172,168, 42, 69,193,113,212,166, 35,154,109, 86, 73,117,239,122, 88, 75,220,172, 22,219, 70, 15, 39,112, 35,202,153, 34,108, 9, - 83, 16,228,242,167, 30,167,205, 67,209,101, 60,247, 40, 75,203,132,133,184, 16,103,115, 6,213,204,193,117,183,249,130, 73, 35, - 5, 53, 87, 20,120,131, 91,154, 84, 73, 73, 68,198,158,137, 73, 10, 65,221,198,214,239,181,250,134,185,234, 8, 61,113,217, 30, - 12,253, 20, 41, 50,184,169,243,158, 45,133,115, 76,244, 44,114,114,236, 90, 10,109,118,101, 69, 7,109, 69,110, 68,166,247, 32, -244, 91, 5,122, 46, 93,207,151,112,185, 82, 84,201,237, 85,196,152,174,184, 88,241, 23,239,197, 8,146,129,239,112,210,195,217, -143, 82, 97,220,134,151,240, 7,148,160,230, 82, 64, 42,108, 46, 11,170, 52,200,142, 42,108,229, 75,154, 25, 10,128,251,176,220, - 69, 62,231,164,248,160, 73,129, 34, 43, 32,148, 79,109,191, 21,101,149, 97,198,164, 54, 36, 52,149, 5,184, 19, 97,136,251,117, -212, 9,207, 47,222, 75, 83,204, 70,166,198,109, 84,203,178,149, 49, 96, 25, 28,237,178,132,166, 28, 66,181,167, 45,188,144, 84, -217, 47, 45,181,163,161,199,231,178,168,238, 61, 67,174,165, 50, 30, 68,210,138,101, 69, 41, 66,226,214, 24,154,175, 18, 68, 23, - 25,200, 16, 43,237, 53,206, 89, 40, 41,101,229, 18,227, 11, 67,153,107, 85,228,149, 94,103,214, 88,177,181,218,251, 49,190,198, -219, 19,126,194,199,107,117, 59, 14,220,202, 56,115, 41,161,100,166,134, 46, 65,164,220,199, 24, 80,202, 6,149, 99, 29,208, 93, - 86,200,179, 38,148,109, 12,205,160, 36,107, 36, 87,151,170,161,165, 46,223,113,167,151, 78,170, 42, 43,148,218,139,143,133, 60, -212,244, 50,100,136,203,150,242,135,136,250, 60, 22,164,198,112,144,183, 19, 29, 76, 58,165, 45, 0,185,112,131, 94,118, 83,239, - 68, 41,110,145, 84,110, 85, 61, 77, 75,109,178, 94,166,215,169,104, 8, 67,209,226,188, 8,118, 28,136,175, 69,146,129,147,227, -180,167,144,130,160, 73, 24,237, 74,148, 41,180,184,241,225,200,118,224,181,231, 71,136, 98, 84,161,159, 30,183,110, 75,101,207, -122,101,135, 67,139, 34,171, 78, 67,173,161, 72,116, 98, 92, 85,128,204,132, 60,193,241, 18, 44,199,101, 84, 85,252, 43,112,177, - 42, 84, 4, 52, 95, 52,245, 4,179, 84,167,160, 46, 60,163,202, 84, 82,137,173,158,119, 35, 43, 36, 50,180, 41,160, 2, 22, 0, - 48,114,196,178,177, 80, 55,211,178,238, 64,223,114,118,234, 70,226,196,234,190,160,112,250, 40,232,234, 98, 13, 29,180, 72, 74, -135, 58,129, 51,142, 88, 77,113,191,149, 76,133, 66, 76,142, 54, 49,137, 46,240,201,115,180,187,121,113,159,112,167, 74,168,126, -134,164, 39, 75, 21,246,192, 76,150, 24,152,101, 59, 6,160, 22,251,164, 23, 22, 86, 34,169, 37, 64, 41, 77,186,215,114,156,150, - 43,139, 43, 97,169, 85,218,101,105,162, 25, 69,219,106, 92, 52,234,159, 51,106,114, 59,213,187, 98, 11,114, 96,186,162,129,133, - 58,105, 47, 71, 91,228,165, 74,112,210, 83,241, 18,146, 11,135,106,214, 98, 78,172, 73,102, 43,177,164, 67,184,105,116,249, 76, -184,164, 4, 42, 59,240, 23,245, 98,155,113,151,208, 49, 37,216,174, 66, 88, 82,250, 45,200,200,202,137, 72, 26,161,196, 82,249, - 44,237,191,114,123, 77,202,228,191, 13, 50,108,176,183, 27, 75,109,213, 41, 83,161, 73, 7, 42, 42, 37,230,219,111,224, 71, 41, - 82,129, 72, 56, 26, 82,178,211, 80,176, 96,117, 33, 87, 27,130, 65, 15,123,139,250, 43, 17,247,133,176, 59,154,251, 35,230,229, - 30, 34,101,181, 84,209,154,121,115, 5,168,137,162, 38,222, 89,169,228,145, 35,177, 23,211, 13, 74, 42,128,222, 98,209, 33, 93, -247, 45,207, 13,114,155,103,122, 54,250,161, 33,214, 94,250,215,234,202,139,111,115, 54,235, 9,117,115, 33, 84, 25,247,117,161, - 36,186, 75,171,142,226, 92, 32,132,169, 8,234, 2,250,244,178,232,151, 46, 85, 85, 97, 46,180,218,152,141, 41,185, 10, 82,146, -133, 56, 87, 49,135, 28, 75,206, 54,128, 82,149,182,149,114,148,252, 73, 40, 42, 25, 63,173,202,173,165,149,245, 27, 59,105, 37, -133,198,106, 75, 46,199, 11,153,201,226, 56,179, 68,204,101, 51,206,133, 4,148,184,138,122, 64,229,229,233,145,221, 56, 61, 81, -185, 75, 51, 27,159, 80,109, 41,125,186,148, 24,239, 53, 37,180,135, 92,106, 52,136,171,113, 78,165, 68,140, 37, 16,223, 89, 4, -156,167,195, 25, 30,171,240,236,165,105,234,169,128, 26,161,150,226,251, 18, 25,116,220,216,131,250,167,125,192, 39,222,113, 12, -241,161, 4,252, 89,144,102,166, 63, 45, 69, 19,211,173,192, 32, 52, 53, 5, 73,183,217, 0,172,167, 96,196,253, 93,251,227, 89, -170,116,137,115, 41,150,180, 88,239, 52,228,155,128,190,219,171,105, 45,132, 20, 84,125,242,101,110, 97,109,192, 60, 15, 6, 4, -169, 41, 7,205,101, 42, 4, 30,100,235, 48, 98,100,183,170,109, 55, 77,129, 26, 53, 90, 77, 38,159, 64,165, 69,109,165, 59, 30, - 52,118, 31, 90,205,199, 80, 1,144, 68, 88,139, 74, 3, 44,182, 0,117, 80,218,100,243, 23, 20, 81,245,170, 20,128,229,191, 57, -231, 18,227,180,170, 21, 94, 83,170,231,105, 13,211, 41, 41,129, 19,194, 45,180, 74, 72,152,162,162,165,171, 24, 90,155, 91,121, - 64, 1, 10,190, 89,208,106, 49,147, 38,123,140,190, 42,215, 59,205, 63, 4, 41, 77, 7,232,116,248, 77, 39,221, 90,229, 3, 45, - 60,220, 25, 11,121, 77,164,169,180,203,154, 2,178,180,171, 50, 56, 55,242,106, 47,163,123,251,137,182,215, 39,127,128, 23, 32, -147,183, 70, 90,252,198, 22,163,102,103,142,115, 15, 52,168, 39, 72, 47, 37, 68,133,131, 88,139,196,145, 68,178, 49, 42, 54, 4, - 38,158,106, 17,126,147, 14,157, 74,146,213, 34,214,106,160, 3,145, 23, 72, 93, 65,214,154,147, 60, 45,214,208,171,150,181,227, - 40,145, 58,176,135, 20, 0, 88, 40, 71,191, 85, 50,133, 16,199, 40,204,233,149,217, 16, 81, 74,106,213,167,196, 41,166, 68, 93, - 61,218,202,202,222,163, 83, 36,180,202,163, 63,224, 83, 73, 82,235, 51,209, 30, 63, 41, 12,169, 45,248,223, 4,213,169, 74, 90, - 53,128,211,101, 42, 82,164, 55,109,135, 89,147, 41, 74,163,196,152,181, 2,229, 14,132,196,169,105,114, 84,194,235, 37, 15,213, -165,203, 74,222,142,144, 8, 75,184,116,146, 25,235,123, 77,126, 53, 26,159, 50,222,163, 82, 34, 87,170,209, 34,199,165,211, 98, -196,145, 42, 52, 27, 97,182,148, 76,169,143,206,119,244, 45, 5, 21,254,145, 74, 46, 58,167, 16,167, 2, 71, 51,139,214,220,104, - 21,172, 65, 37,238, 69,201, 58,119, 82, 55, 23, 34,254, 81,127, 40,177, 82, 54, 23, 48,154,250, 57, 42, 21,105,164,129,171,170, - 20,141, 98, 87, 0,144,254, 73, 38,170, 44,234,129, 19, 88,176,146, 78, 89, 34,103,179,171,162, 77,157, 81,164,143,123,163, 8, - 73,114, 60, 56, 14, 56, 25,153, 92, 82, 27, 64,113,230,129,159,116,212,234,141,165, 30, 35,232,150,149, 34, 26,138, 67, 35,195, -229,195, 64,160,161,215,163,214,229, 61,114,193,118, 3, 18,169,144,234,116,244, 83,105,213, 73,128, 42,170,162,244,180, 53, 84, -173, 73,139, 52,114,195,114, 72, 17,209, 13, 46,130, 91, 66,252, 80,144,164,132,233,150,102,139, 89,170,162, 58, 42, 11,109, 2, -156,194, 86,221, 33,181,251,181, 38, 42,218, 67, 77,174, 97,127,153, 78,214, 92, 14, 2,191, 29,239, 13,182, 62, 55, 80,210, 57, -121,206,113, 74,153, 54,127,189, 8,203, 67,140,225,184,143, 85,220,123,222,211, 87,121,197,162, 59, 80,232,138, 96,225,196, 37, -231, 93,231,158,158,124,173,226,166, 18,183, 1,113, 59,104,206, 7,217,212,166,214, 54, 39,125,193,177,184,189,190,201, 2,219, -129,115,109, 36, 64,115,202, 58,106,133,145,131,199, 51,172,111, 27,220,150, 84, 18, 57, 32,181,236, 38,119,102,187, 2,172,173, -245,138,161,227,115, 42,109, 53,183, 89,113,151,211, 75,165,167, 49, 32,171,220, 30, 90, 20,243,205, 83,164, 33,100, 75, 87,189, -190,190,121, 21, 18,250, 71, 48, 94, 91,105, 75, 43,121, 74,230,229, 45,103, 23,124, 32,112,213,237, 11,217, 74,166,193,241, 37, -103,179,117, 80, 93,247,138,133,163,115, 83, 94, 17,183, 11,108, 46,100,165,216,113, 47, 43, 30,236, 12, 41,116, 27,141,183,211, -202, 18,144,184,181, 22,208, 98,204,139, 46, 18,220,104,135, 30,225, 76, 56, 81,105,212,133, 48, 41,180,229, 70,162,206,126, 38, - 92, 98,148,206, 66,164,193,166,164, 45,105,171,200, 68,140,120,203, 37, 97, 47, 60,174,114,244,144, 80, 29,171, 42,165, 30,155, - 49, 51, 37,181, 81, 79,132, 15,185,196,151,151,234,114, 30, 44,248, 41,113,104, 4,248,238,184,148,190,180,184, 74,188, 52,182, - 16,234,154, 81, 58,124,203,115, 9,169, 39, 2, 57, 12,104,246, 82,172, 26,204,163, 72, 34,253, 44, 52, 92, 91,236,149, 12,133, -109,183, 62,241,103, 9, 69, 81, 77, 83, 52,208,150, 44, 27, 66,145,121, 36, 63,181, 37,206,204,250,129, 61,116,169,212, 89,131, - 43,201,249,104,123, 74,253,155,155,225,236,203,226, 10,102,204,110,202, 63,132, 86,125,198,138,149,127,100,183,134,155, 1,112, -237,173,219,177,225,202, 67, 75,152,211, 60,203, 77, 6,247,167,123,204, 54,107,180, 85,184,167, 33, 62,251,114, 35,170, 69, 54, - 84, 73, 46,115,200, 36,167, 25,234, 60,137, 61, 71,217,242,198,191, 92,191,104, 95, 2, 27, 99,237, 47,225, 82,247,225,235,116, -208,197, 6,191, 47, 55, 54,209,110, 43, 17, 27,149, 84,218, 45,211,165,197,120, 90,215,101, 56,171, 11,149, 13, 70, 66,225,214, - 96,115,165, 21, 26, 85, 74, 92, 66,166,214,227, 79, 55,249, 64,239, 46,206,238, 55, 15,155,187,185,155, 17,187,212, 5, 91, 27, -163,180, 55,157,106,194,190,104,165,101,216,241,171,116, 57, 30, 18,166,211, 37, 16, 5, 70,131, 54, 18,226, 79,167, 74, 70, 81, - 42, 5, 78, 52,132, 18, 28, 26,183,178,186,229,171,129, 84, 73,169,212,119, 35, 85,129, 0,134,181,188,202, 72, 5,128,210,110, -164,121,139, 34,115,126, 99,150,201,150, 78,208,177,215, 21,236,173,125, 91,218,250, 75,126,181,187, 55,113,190,246, 44, 91, 95, -135,148,129,156,147,147,205,212, 31,144,244, 3, 58,243,202,158,132, 96,121,118,234, 51,223,167,152,213, 84,132,144, 83,212,144, -122,231,250, 71, 93,121,229, 7,168,206, 61, 58,103,231,212,233,216,126,242, 48,223,133,202,123,243, 12,118,207,203,183,111, 61, - 32, 14,126, 17,140, 14,161, 90,245,202, 0,199,235, 2,114, 60,191,110,190, 5, 15,139, 57,201, 32,114,253,216,239,161,239,192, -233,108,123, 39,162,135, 78,189, 62,195,246,249,106,136, 10, 78,112, 73, 80, 61,113,230, 62, 64,254,122,234,166, 18, 83,202,122, -103,184,207, 81,130, 49,223,236,215,174, 80, 6, 9,201,199, 47,111, 46,189, 71,203, 89,192, 63, 27, 96, 53, 1,149, 31, 49,140, -143,183,211, 84, 10,122,103,152,159, 49,204,115,211,229,233,253,186, 57,109,140, 0, 0, 42, 35,161, 61,188,137,207,221,161, 86, - 58,145,216,118,198, 58,231, 30, 93,116, 48, 63,158, 1,112, 96,228,246, 63,119,203, 84, 21,220, 28,101, 35,160,235,242,245, 31, -102,138, 90, 22,121, 72,232, 51,231,247,231,247,104,117, 39, 61, 58, 2, 59, 96,249,104,234, 64,191,160,198, 65, 55,247,255, 0, - 60, 14,160, 50, 60,137, 24,206, 58,103,203, 61, 58,234,146,135,124,156,121, 99,160, 31, 51,219,236,252,116, 73,206, 49,128, 51, -231,231,251,123,106,130,209,216,142,152, 32,159, 63,195, 75, 14,184, 84, 94,215, 29, 79,250, 96, 55, 19,215, 9, 7,190, 79,166, -113,212,157, 10,180,231,174, 51,219, 30,163,230, 61,124,245,112, 94, 8, 35, 56,199,150, 58,254, 63, 97,208,174, 36,246, 79, 78, -132,250,231,203,175,160,237,165,148,155, 11,141,240, 1, 23,176,233,128,148,158,253,122,158,192,247,206,126,126, 93,116, 42,219, - 61,126, 33,142,248, 29,128,238, 64,251,180, 98,130, 72,235,144,115,140, 99, 39,215, 61,190, 90, 29,105, 56, 32,252,142,124,190, -223,195, 58, 58,223,238,254, 95, 39, 6,192,106, 72, 24,199,207,169,245, 30, 90,160,176, 6, 79, 92,227,183,145,249,118,249,104, -165,167, 61,148, 78, 62, 93,254,239, 93, 12,179,220, 30,157, 60,198,115,242,249,127,110,150,193,148,246,192, 42, 80,207, 64,115, -230, 7, 95,188,250,119,213, 21, 12,100, 99, 63,179,231,162,150,129,220, 12,103, 57, 35,191,246,104,101, 2, 7, 81,158,249, 35, -174,127,183, 74, 39,124, 40,187,129,129,212, 62, 68,122,250,125,199, 84, 23,140,143, 92,117,213,117, 19,215,184, 4,231,175, 66, - 79,245,106,130,251,142,158, 93,255, 0,118,149, 29,122, 95, 24, 34,198,227,107,126,239,159,158,216, 20,140, 18, 59,227, 75, 95, - 85,250,199, 75, 75, 13,192, 56, 53,129,222,221,113,224, 31, 34, 70,125, 6,170,115,117, 4, 36,146,112,146, 71,252, 62, 67, 84, - 57, 57,156, 74,190, 46,131,167,126,189, 72,198, 14,138, 73, 72, 0,249,103,174,123,247,243,198,181,201, 39,189,191, 44, 27,238, -190, 43,164,129,129,211, 63,236,245,233,243, 58, 32, 97, 35, 36,140, 31, 65,231,246,249,232,100,242,133, 16, 14, 78, 58,158,157, - 7,144, 58, 37, 4, 36, 28,167,155, 7,168,239,223,182,147, 44,119, 29,113,140, 86, 9, 88, 80, 33, 67,148,142,189, 58,147,229, -223,183,125, 16, 27, 14, 36, 37, 73,206, 14, 71,113,233,215, 84,146,114, 59, 96,121,126,113,162,219, 33, 61, 20,122,227,203, 61, -135,228,105, 51,107,111,211, 4, 38,221, 6,253,190,126, 24,172,132,132,167, 25,192, 31, 46,167,238,209,141,168,114,132,252,186, - 31, 95,234, 58, 17, 41, 24, 32,168,146,115,128, 59,159,179,174,138,108, 18,115,203,216, 12,131,215, 0,103,174,144,194, 71,174, - 42,227,160,207, 92,117,206, 62,223, 33,242,209, 40,194,176, 79, 64,124,186,245, 61,190,239,236,213, 16, 1, 81, 29, 64,242,237, -249,245,209, 45,130, 6, 1,237,228,113,147,251, 59,104, 99, 7,241,193, 13,224,100, 14,158,159,183, 68, 33,125,121,112,122,103, - 36,117, 25,207,111,219,170, 8,237,156, 12,250,116,207,217,159, 61,101, 86,165,169,113,222,213,218, 85,175,104,208,234,151, 29, -199, 92,154,205, 58,143, 67,162, 64,145, 83,170,213,103, 62,174, 86,162,193,129, 17,181, 57, 37,226, 79, 92, 12, 36, 30,101, 16, -144, 78,144,150, 68,141, 93,157,130, 34,110, 73, 54, 0, 1,212,158,192, 96, 14,194,219,159, 78,228,237, 97,234, 73,216,119, 56, -239, 95,177,184, 52,198,205,241, 34,250, 82,145, 37,219,203,111,154,116,243, 97, 74,140,138, 52,229,161, 36,121, 36, 56,165, 99, - 62,127,102,186,125, 58,178,168,165,224,240,108,180,227,106, 45,243,168,133, 3,219,224, 41,253, 99,156, 28,124,181,130,123, 43, - 61,153,123,231,176,246, 46,230, 76,226, 66, 69, 19,109, 99,238,172,123,102, 85,189,105, 61, 82,102,161,115, 83, 77, 53, 47, 41, -114,110, 56,241, 22, 91,166,201, 83, 79, 37, 41, 96, 41, 78, 35, 7,156,131,211, 91,183,187, 60, 21, 87,216,164,202,171,216, 55, - 44, 43,172,211, 80,185, 34,157, 13,254, 73,133,108,167,153, 73,110, 58,212,124, 76,167,200,119,206,185,175,140,211,219,115,250, -250,186,121,150,106, 87, 41,102, 86, 4,217, 99, 69, 62, 95,180, 64, 96, 69,237, 98, 6,161,177, 7, 30,160,125, 30, 51, 92,167, - 42,240,231,133, 50, 92,240,205,148,102, 10, 42, 3,172,240, 74,138,188,202,201,222, 50,206,202, 2,106, 70, 70,243, 90,193,183, -223, 26, 33, 89,187, 38, 56,211,173, 73, 82, 68,134, 29,100, 33,180, 43,195,241,146,165,129, 30,115, 42, 79, 82,234, 84, 82, 20, - 61, 53,220,158, 22,104,113,246,115, 98,169, 87, 66,163,180,230,226,223, 48,159,157,245,162,217,109,215,233, 84,130, 15,134,212, - 53,167, 42, 99,197, 78, 84,181,167,226,199, 98, 53, 30, 10,163,245, 54,234,111,196,144,202,209, 82,166, 75, 80,109,137, 72, 83, - 78, 49, 38, 59,153,147, 79,146,210,250,165,126, 35,100, 96,227, 24,215,127,118,138,242,164,110, 62,192,109,157,106,149, 47, 30, -229, 76, 54,197, 89, 17,150, 68,186,101, 86, 23, 51,106, 97,104, 7, 45,130, 23,217, 88,202,117, 28,118, 20, 81, 23,136,105,153, -198,204, 58,139,149,189,143,111, 45,236, 65,254, 3, 29, 5,199,185,104,158, 14, 29,203,164, 80,217,101, 77, 86,170,133, 93,209, -180,199,170, 20, 96, 14,241,187, 6, 37,127, 93,148, 45,136,181,242,106,229,223, 42,176, 31,122, 91,235, 11,114, 43,173, 63, 43, -152,169,199,159,143,135,153, 45,243, 30,101,243,182,162,159,187,215, 88,194,171,109, 42, 52, 22,155,105,229, 73,168, 62, 22,203, -206, 5, 45,198,219, 49,203, 37, 62, 31, 54,124, 70,223, 9,248,135, 92, 47,174,172,242, 97, 74,133, 54,150,235,136, 92,152,237, - 58,252, 89, 13, 45, 92,139, 46, 50,219,136, 74, 20, 9,248, 28, 41, 32,143, 62,190,122,188, 83, 18,164, 54,242,101, 71, 65,114, - 44, 22,132, 53, 40,114,187, 30, 75,239, 23, 82, 65, 72,234,224, 65, 70,125,121,117, 30, 87, 45,172,129,168,158,155,237,126,135, -115,211,189,187,236, 62, 56,127,142,130,130,138,154, 49, 79, 24,120,134,234,170,193,123,180, 96, 91,169, 10, 66, 18, 15,151, 77, -128, 4,226,231, 71,140,106,110,203,144, 95, 44, 50,131, 42, 92,249, 46, 56,161,202,196, 32,136,201,141, 24, 96, 36,190,183,201, -194, 51,149, 21, 28,117,214,187,111,102,251,181, 33,243,106, 81,228, 61, 14, 37, 33, 97,130,251, 50, 21, 30, 63, 51,105,194,152, - 98,106,148, 82, 95, 81,200, 60,195,245,138,142, 20, 14, 19,125,222, 75,250, 78,218,216,238,219,180,169,142, 42,187, 85,231,169, -204, 91,107,109, 14,183, 50,106, 86,182, 24,105,167,112,133,173,168,202, 43, 80,230, 79,199, 45, 56, 33, 67, 58,228,228,187,229, -250,132,217, 47, 75, 67,178, 96, 58,242, 83, 61,164, 56,226,208,226,208,181,175,198,125, 46,167,157, 35,226,117, 68, 43,152, 40, - 32, 32, 40,140,101,246, 58, 73, 18,147,146,135, 76,211,128,242,145,107,170,177,186,198, 9,237,250,205,184,185,216,218,219,233, -112,238, 72, 56,183, 63,169,204,229, 28,252,143,135,165, 49, 82, 40, 35,235,170, 18,203, 36,204,173, 96,202,132, 24, 98, 13,183, -146, 66,118, 56,218,122,181,245, 81,114,145, 37,110, 60,103,198, 97,207,125,165, 84, 31, 79,131, 90,163,190,219, 97, 10,108, 48, - 26, 9,169, 66, 90, 80,227, 47,128, 80,181, 33,204,169, 42, 79, 34,145,144, 27,238, 36,202, 77, 46, 61, 71,146,158, 91, 77, 34, - 80,129, 80,121,196,192,149, 37,107, 67,234,250,134,230,105, 96,211,223,104,169, 92,205,169, 77, 58,128, 83,145,140, 41, 90,141, - 75,174,173, 77,251,204, 9, 44,170,156,220,176,219,244,224,164,200,165, 79,117,183, 20,184,138, 75,160,173,218,100,118, 89, 33, - 75, 40,230, 73, 95, 94, 82, 7, 38,179,218,117,105, 35,154,151, 61,164,211, 34, 50,180, 74,121,186,147,237,205,163, 21, 60,162, - 29,110, 35,204,164, 37,216,238, 48,180,134,146,248, 5,180,189,243,232,211, 62, 92,169,112,162,228, 27,221,109,123,121,123, 16, -109,110,225, 46, 44,215,186, 62,199,161,242,220,190,156, 36,113,114, 47,203,109,107,162,234,192,145,231, 26, 47,177,110,190, 75, - 27, 13, 65,145,137, 24,220,138, 82,100, 86,167, 67, 85, 85, 5,217, 21, 54, 83, 26,153, 91,143, 41, 84,218,173, 77,175, 19,157, - 16,100, 78,167,184,142,105,169, 96,169, 46,243, 41,104,121,178, 22,223, 34,202,155, 23,250,140,137, 20,138,148,138,125, 82, 20, -234,253, 56, 69,122, 35,244,247, 86,135, 43,244,199,152,112, 33,197, 60,228, 96,159,173,226,132, 50, 84,121,113, 53,165,176,135, - 82,167, 71,194, 53,242, 20, 11,121, 84,166, 35,198,155, 38, 4, 37,169, 19, 41,142,209, 42, 19,225,165,233, 62, 34, 25,142,226, - 80, 30,113, 17,157, 66,149,252,196,164, 18,216, 82, 84,115,167, 38,148,205,126,152,227, 49, 97,220, 38,171, 81, 86, 91, 68, 26, -187, 13,248, 14, 69, 97, 62, 35,143,138,156,112, 22,101, 41, 15, 18, 22,226, 10,194,136,230,230,233,134,127, 42, 6, 37,206,199, -117,101, 43,181,186,143,180, 75, 2,110, 73, 96, 5,128,176, 42, 44,157, 77, 28, 1,181, 71, 86,166, 56,195,160,133,227,150, 34, - 10, 48, 60,200,165, 70,147,146,168,163,204, 71, 45, 85,148, 2,193, 25,163,195,167,111,214, 86,203,172,196,137, 45,186,155,174, -161, 10,167, 73,203, 62,227, 94,136,211,232, 33,202,160, 82,127,192,238, 54, 24, 88, 10,120, 37, 1,208,149, 43,151,151,153,182, -170,166, 34,105,117, 25,181, 40,161, 79,194,159, 53, 78,221,148, 2,130,244,202, 62, 11,173,203,168,196,140,210,177,239,188,139, - 79,188, 52,148,143, 25, 25,113,159,210,140,171, 8,167, 26, 85, 94, 65,131, 35,235, 11,102,226,130, 87, 49,132, 48,166, 27,155, - 34,167, 24, 20, 49, 81,133, 37, 81,151, 26,170, 90,112, 31, 21,124,188,252,170, 13,201, 72, 73,201,204,105,149, 74,157, 57,200, -147,110, 38,154,139, 18, 67,205,195,153,115, 70,104, 51, 79,155, 83, 70, 23, 21, 85, 85, 0,161, 70,146,242,249, 2, 78, 76,126, -101,128,219,173,128,148,235, 34, 80,196, 0,231, 83, 92, 1,220, 90,204, 10,145,112, 0,185, 42, 1, 2,236,108, 45, 99,136,197, -109, 57,134, 90,147, 78, 60,243,173,165,136,149, 15, 48,189,215,148, 86,241,202,190, 93, 81,152,134,165,148, 13, 11,202,242, 35, -169,110,248,110,177, 16, 67, 42,158,104,128,170, 20,215, 22,194,141,110,142,176,131, 25,131,225, 54, 11,133, 84,196,180, 99,164, - 18, 82,252, 36, 58, 2, 73, 90,181,243,137,137,169, 94,219, 91, 8,140,165,159, 30,241,143, 84, 66,139,156,202,240, 96,192, 62, - 18,156, 82,206,124, 78, 89,140,129,203,241, 21, 30, 76, 19,163,109,106, 99,148,203,129,215,161, 22,149, 70,170, 36, 45,108,171, - 31,224, 53, 5,243, 58,217,101,215, 79,193, 25, 79,185, 33, 32, 39, 1,165,190, 66, 50,135, 15, 45,187,123,227, 46,167, 87,178, - 45,198, 26,115,194,143, 66,171,214,144, 26, 91,156,200,171, 26,148,118, 84,145, 31,151, 10, 8,167,198, 11, 4, 31,135,197,207, -235, 37, 39, 74,201, 56, 20,179, 48,220, 2,160, 89,137, 27, 48,218,251, 92,218,224, 27,108,182,181,237,189, 90,213,112,199,197, -185, 37, 66, 63, 50, 26, 82,245, 33,186, 21, 2, 41, 29,149,214,224, 41, 89,127, 85, 64, 0,155,129,164,168,195,121,106,210,157, - 49, 16,180, 67,123,221,105, 23,132,151, 98,143, 8,133,181, 9,233, 2,160,114,132,149, 41,152,202, 77, 80, 0,122, 20,224,133, -140, 19,174,145,216, 85, 22,174,139, 58,117, 20,167,255, 0,116, 45,215,218,183, 92,253, 48,116, 59, 66,168, 71,135, 84,162,201, - 91,137, 33, 46,115, 83,165, 76,101, 96,101, 41, 92, 44,103,200,106,117,145,110,169,112,231, 15, 1,196,123,195, 84,153, 12,178, - 20,148, 41, 94, 28, 38,226,200,119,157,100,120, 95,165,138, 1,112,228,146,114,114,161,173,186,219, 8, 70,145, 86,150,137, 9, - 45, 70,158,138, 76, 55,148,216, 65,109, 45,150, 86,152,239,128, 57, 65, 12, 75,229,234,122,225,213,148,244,209,114,119,104,171, - 4,128,125, 92,254, 87,191, 96,110,192,158,223,104, 2,109,189,142,214,189,197,123,226,102,115, 14,101,151,130,175,170,167, 41, -126,116, 54, 59,220, 24,181, 41, 23,243, 93, 94, 65, 97,177,125, 39,160, 56,182, 92, 20, 69, 77,185,225,210,208,218, 12,121,177, -214,245,101,132,175,147, 20,200,207,169, 77, 67, 12,161, 64,187,239, 14, 55, 24, 58, 82,112,164,176,232,229, 32,231, 94, 29, 77, - 69,138,133, 70, 29, 29,163, 30,174,236, 24, 12, 74,171,176,182, 29, 93, 18,157, 80, 46,135, 10, 99,172, 22,209, 86,126, 34, 28, -247, 86, 74,249, 90, 42, 50,212,149, 37,164,133, 61,149, 74, 50, 96,174,108,231,227,148, 73,104, 70, 98, 34, 90,232,251,142, 52, -174, 65, 30, 63, 46, 28,230,126, 90,201,119, 25, 60,138,113, 64,225,189, 82,183,173,152,148,155,102,178,203,203, 68,215,166, 72, -114,183, 95,156,227,173,149, 84,171, 51, 30, 74, 27, 67, 12,173, 36, 52,203, 81,219,102, 60, 68,130,144,203,109,165, 36,133,120, -138,212,193, 31, 77,212,144, 72, 34,198,251, 27,245, 44, 15,154,214, 6,230,224,239,182,149, 3, 21, 18,113, 76, 43, 65, 3, 50, -137,214, 49, 12, 40,135,117,121, 29,209,158, 71,223, 75, 42, 46,136,204,108, 8,145,132, 74,193,144, 72, 75, 74,213, 54, 21, 45, - 76, 91,246,218, 94,139, 17,193, 28, 86, 29, 14, 46,115,208,212,249, 67, 77, 64,167, 72,144, 20,185,149,135,226,180,158,101,145, -202,195, 40, 83,141,144,227,200, 2,245, 21,216, 52, 92,248, 96, 70,161, 83,252,103, 98,197,145, 15,156,115, 78,109, 49, 66,157, -109, 1,110,205,152,167, 16,175,119, 65,203,206,130,172,229, 69, 42, 23, 85,184,213, 38,116,122, 77, 49, 30,243,112, 48,191,122, -156,175, 0,120, 52,218,131,205, 97, 18,106, 83,146,149, 4,194, 76, 0,146, 91, 88,241,164,101, 41,109,188,184, 10,126, 34,216, - 84, 0,137,213,234,155,149, 73,236,160, 76, 76,164,176,212,104,116,198,150,183, 7,131, 18, 42, 93,229,167,198,253, 69, 23,214, - 76,149,151, 57, 71,195,200,157,109, 69, 33, 82,243, 60,133,180,234,176,248,250,244,211,107, 91,226, 72,211,167,112,188,181,209, - 76,160,213,204,197,106, 0, 96, 24,179, 79, 82,204, 72, 51,121,144,128, 10,249, 98,149,218,225, 28,149, 89, 27,152,205, 94,144, -220,249, 80,209, 79,171, 70, 91, 20,181,184,135, 92,141, 50, 72, 14, 84, 76,118, 19, 36, 34,177, 25,151, 21,138,119,187,114, 19, - 21, 68, 12,117,150,149,132,150,213,150, 54, 98,220,136, 16,188,119,163, 67,101, 5,113,196,105, 72,165,185, 82,119,197, 5,126, -248,228,114,219,144,233,141, 70, 67,104,106, 56, 82,124, 82, 79,136,218, 88, 9,105, 88,156,247,222,169, 82,227,191, 45,232,212, -218, 11, 78, 71, 98, 59,143,161,113, 39, 84, 75, 46,153, 13, 76,172, 45,229,243, 37,135, 29,104,251,180, 52,101,110, 6,210,236, -148,169, 74, 12,138,140, 74,153, 50, 51,206, 33,177, 76,164,162, 59, 73,171, 73, 72,104, 78,168,197,125,231,124, 63, 6, 48,109, -102,142,200, 60,234, 28,229, 82, 93, 7,244,104,105, 39, 91,241,105,141, 99, 37,254,169,195, 11, 90,214,220,144, 53, 30,151,233, -216, 2, 62,226,207, 81, 79, 37, 64, 53, 1,150,150,100,144,129,164,144,145, 57, 33,117, 0, 73,102,157,197,144,162,146,201,229, -185, 91, 7,133,199,163,200,101, 79,198,131, 70,106, 76,183, 83, 33, 17, 40,212,166, 60, 24,241,189,234, 27,101,247,106, 85,121, - 13, 51,138, 77, 9,190, 85, 34, 58,146,217, 82,185,213,225,182,227,202,108, 33,244,163, 51, 30,132, 13,122,179, 61, 46,206,167, -178,218,106, 21, 83, 17,198,105,113, 16,255, 0,130,203, 84,152, 48,121,220,112, 58, 60, 70,144,219, 72, 14,202,154,226, 91, 75, -137,117,229,164, 37,133,166, 84,233, 54,205, 18,152, 42, 78, 72, 74,100, 38,109, 70,157, 75,167,176,101,215,110,185, 45,168,183, - 26, 21, 45,132, 58, 22,233, 81, 25, 47, 73, 45, 70,101, 9, 42,121,228, 37, 28,165,217,183, 32,206,171, 85,105,149,250,165, 82, -149, 14, 75, 94, 12,218, 69,174,167, 26, 93, 42,136,182,199, 51,171,157, 33,213,135,234, 53, 63, 17,100,187, 57, 41,104, 33, 40, - 8,142,218, 24, 74,121,221,169, 86, 22, 72,193,212,205, 96,202, 46, 67, 48,184, 22, 31,101,130,133,184, 4, 88, 49, 35, 72,181, -216, 86, 28, 81, 1,116,150, 73, 25,169,242,225,205, 66,229, 73,146,164,163,105,104,209,130,181,131, 0, 76,135, 75, 68,143,118, -149,228,145, 98,129, 95,138, 36,233,202,152,138,141, 93,169,141, 69, 80, 30,227, 5,244, 43,222, 82,165, 36,243, 74,171,176,208, - 41,106,160,226,222, 82, 83, 28,169, 98, 40, 10, 73, 90,220,201, 68, 52,254,150,111, 2,144,225,187,179,158,209,187, 10,132,211, - 79,213,165, 82,118, 15,137, 25, 20,246,210,148, 75, 91,140,190,246,200, 95,117, 36, 32,115, 57, 41, 10,102,175,109,202,146,122, - 41, 18,232,108, 40,225,134,134,166, 17, 71,172, 75,173,183,254, 28,202,224,136, 19,125,223,220,189,237,247, 37, 21,179, 37,214, - 81, 80,121,191, 1, 45, 16,166,130, 31,105, 33,106, 75, 76,149, 56,163,206,177,200,205,113,141,195,133, 51,141, 78, 12,248,147, -225,150,176,148, 59, 23,119,182,166,230,182,237, 57, 15, 97,150,105,151,140, 70, 87, 85,176,107,200, 50, 27,253, 3,177,111, 58, - 93,191, 49,181, 28, 41, 2, 57, 60,193, 74,200,158,100,149,102, 22,210,191, 88,166,198,203,123,107, 2,250, 84, 17,179, 17,170, - 37, 36, 88, 6, 45,176, 1,135, 60,241, 94, 80,210,197, 55, 50, 52,167,146, 27, 38,149,177,141,119,250,189, 44, 46, 13,254,219, - 16,222,117, 4,220,220,223,242, 16, 41, 10, 0,121,103, 35, 29, 63, 35,174,144, 0,146,129,231,232,122,252,251,246,242,213,103, -105,213, 58, 52,201,244, 90,252, 69,192,174,208,170, 53, 26, 21,114, 3,128,135, 96, 86,232,211, 30,166, 85,233,238,115, 96,133, -177, 82,139, 41,165,103,205,147,175, 33, 3, 57, 79,194, 14, 78,124,199,203,236,212,253, 72, 96, 25, 78,160, 70,198,251, 27,216, -220, 31, 76, 83,251,247, 22, 56,241,142, 65,215,160,207, 76,143, 35,229,243,210, 78, 79,144, 72, 39,250,186,145,142,218,250, 74, -136, 25,198,115,208,129,220,124,245,247, 36,146,124,191,217,244,236,126,205,103,127,191, 3, 30, 72,200,230,229,206, 58,121, 15, -199,215,251,117,236, 5, 31,245, 72,242, 7,190, 62,223, 76,233,114,133,144,114,164,245,198, 7, 65,219,215,238,215,190, 92,127, - 56,224,103, 31, 47,191,211, 67,221,233,129,138, 43, 71,124,156, 15,196, 14,221,186,244,208,171, 3, 3,191,166, 64,201,249,119, -249,234,232,212, 41,147, 22,132, 71,105, 74, 46,186,134, 91, 32, 16, 29,125,194, 18,211, 12,249,188,250,213,209, 40, 72, 43, 89, - 56, 72, 39,166,186, 71,195,191,178, 43,142,110, 36, 99,196,171,219, 27, 61, 83,178,237, 25, 97,151, 26,188,247, 98, 90, 54,206, -131, 38, 59,229, 63,225, 52,182,171,241,205, 66,178,148, 52,175, 16,166, 60, 5,115, 36, 97, 43,202,147,157,121,171, 41,169,236, - 37,148, 43, 55, 69,234,199,224,162,228,159,112,198,205, 37, 29, 93,124,188,138, 26, 89, 43, 38, 29, 86, 36,103, 32,122,182,144, -116,143,123, 88,123,241,204, 5,140,156, 36,231, 29,252,135,224,124,251,232,117, 0, 14, 70, 1, 7, 7,183,159,203,207,166,117, -177,124, 80,240,223,126,112,157,189,183,214,195,110,107, 49,211,119,216, 53, 54, 96,207,155, 77, 84,151,104,213,200,115,224,199, -169,209,174, 75,118, 76,184,204,185, 50,223,157, 79,148,219,177,157,113,166,212, 74, 28, 66,144, 20,218,181,174,203,234, 48, 7, -159, 79, 94,255, 0,111, 83,141,108, 83,203, 28,200,146,198,218,163,144, 2, 58,142,190,160,216,223,220, 69,240,155,199, 36, 18, -203, 12,200, 98,158, 22,100,116, 59, 50,178,157, 44,164, 14,132, 16, 65,247,140, 12,160, 58, 18,122, 12,253,253, 63,179, 67,171, -168,200, 61, 58,140,249,227,207,167,231,182,138, 63,173,208, 17,223,167,203, 25,201,252, 53, 69, 64, 1,142,253,115,246, 15, 67, -173,144,108, 65,244,198, 70,227,125,199,254, 48, 26,129,245, 28,189,186,140,125,224,250,245,208,171,192,201, 25, 7,255, 0,104, -122,103, 69,184, 70, 72, 57, 0, 30,195, 29,124,186,126, 31,179, 66, 47, 62,163, 30,158,121,249,116,210,202, 73, 23, 56, 0,108, - 61, 54,192,202,193,193,193, 4,247,206,116, 58,199,159,175, 67,233,162, 87,235,229,140,122, 96,250,252,244, 58,129,201,200,200, -251,113,131,219, 56,209,199,198,216, 54, 6, 88, 0,100, 39,175,203,167,231,251, 52, 43,131, 39, 36, 2, 64,236, 58,254, 63, 61, - 22,231, 76,100,244,201,251, 60,134,132, 80, 30,188,221,127,104,193,245,251, 52,170,155,223,107, 91, 25, 22,223, 2, 44, 12, 18, - 70, 49,219,212,117,237,161, 87,243,234, 15,111, 44, 31, 92,249,249,232,197,140,103,249,222,127,105,251, 6,133,115, 24,236,123, -246,244,239,223,229,165,147, 10,139, 27,123,190,126,126,252, 12,188,246,199, 76,103, 62,152,254,142,154, 13,206,249,201, 78, 51, -156,140,231,211, 31, 46,250, 49,194, 2,122,244,243,207,151, 79, 93, 90,212,167,148,162, 20, 50,159, 34,158,248, 35,184,244,210, -152, 2,247, 55,232, 48, 59,171, 82, 85,220,156,231,177,199, 79,179, 75, 84,137, 89, 82,129, 64,192, 61, 9,238,125,123,157, 45, - 11,159, 92,102,195,211, 7, 1,145,228, 49,230,115,215,175,153,251,245, 85, 41,199, 65,212,158,255, 0,159, 77, 82, 78,114, 7, -145,207, 79, 35,223,203,237, 26, 37, 0,231, 61, 49,231,219,242, 53,130, 1,198,113, 85,164, 37, 39, 24, 29, 70, 51,230,123,121, -232,129,156,245, 31, 8, 29,193,235,233,231,223,190,169,163, 29,176, 58,117, 7, 26,244,121,242, 2, 82, 20, 60,250,224,142,189, -251,246,210, 76, 0,248,223, 3, 5, 39, 29, 51,146, 59,252,240,123,103,174,138, 64,206, 8, 35, 31,183,240,208,109, 54, 70, 78, - 78, 73,235,147,144, 6, 78, 6, 51,215, 70,163, 57,233,142,157,199,203,229,162, 27,218,255, 0,203,124, 17,187,155,224,134,240, -161,156,231,174, 64,235,211, 29, 63,164,104,132,168,143, 60, 14,199, 24,243,245,249,127, 86,168,160, 96,103,207,203,243,246,141, - 16,132,224,228,245, 7,174, 63,160,231,215, 73, 16, 5,253,223, 39, 9, 28, 86, 71,127, 62,223,143,231, 58, 44, 1,220,122, 99, -160,192,252, 52, 58, 82, 7,219,143,207,238,213, 86,242,162, 60,134,112, 57,142, 0,243, 42, 62,128, 12,232,167, 5, 97,182,231, -108,101, 54,149,175, 93,188,238, 42, 37,171,108, 82,103,215,174, 43,142,169, 10,139, 68,162,210,216, 92,170,133, 82,169, 80,121, - 49,225, 64,134,195, 96,151, 31,113,229,164,118,194, 70, 84, 72, 0,157, 78, 55,217,195,236,235,180, 56, 5,219,136,183,189,229, - 6,143,114,241,101,120,210,144,245,197,112,186,195, 83, 99,109,101, 38,115, 41,113, 22, 77,152,167, 82, 66, 42, 9, 66,147,245, -132,212, 0,227,174,130,132,144,210, 64, 58, 65,236, 48,224, 78,145,183,150, 91, 28,115,238,229, 25, 47, 93, 23, 10,101,211,120, -127,163, 84,163,165, 73,163,211, 57, 87, 30,165,184, 46, 48,226, 73, 76,201, 4, 45,184,107, 35, 40,101, 37,105, 33, 78,103, 93, -206,171,207,168, 77,158,242,214,234,165,120,206, 45,240,239, 57, 83,188,203, 36,252, 62,157, 9,239,170, 51,196, 46, 48,105, 37, -147, 42,160,151, 76, 16,146, 37, 96,109,169,129, 27, 92,118, 83,208,119, 32,181,143,145,135,112,125, 25,188, 13,143, 54, 16,113, -223, 19, 82,137, 17,172,244, 16, 72, 60,170,157,125,165,213,191, 93,246, 49,126,194, 16,247,212,254, 92,102,175, 95,155, 82, 46, -162,100,151,208,236,151, 84, 86,135,157, 83,143, 45, 96,146, 94,142,181, 28,149, 31,231, 39, 61,245, 66,141,115,205,137, 57,175, - 1,247, 75, 76, 35,195, 76,148, 41, 72,125, 46, 37, 67,149, 50, 80, 63, 89,178,122,100,246, 29,245,245,218, 59,147,164, 45, 78, - 62,215, 50,202,148,134,101,254,133,244, 62,145,140,180,188,124, 11, 56,232, 71, 67,171, 83,148,233, 49,170, 13,190,247,248, 44, -245,182, 90,104, 56,144,150, 39, 33, 63, 10,154,125, 67,225,241, 20,158,202,245,193,243,213, 56,106, 88,146,193,203,105,235,239, - 59, 19,191,201,199,127,158, 23,202,218,157,233,146, 24,236, 81,136, 80, 46, 1, 43,107,143, 46,174,130,197,183, 3,169,212, 47, -102, 23,138, 45,142,166,222, 16, 42, 27,183,108,211, 81, 10,232,163, 70,247,155,186,155, 13,174, 83, 92,132, 0, 8,170,165,134, -192, 6,115, 39, 5,106, 72,203,136, 86, 73,233,166,207,131,205,208,115,108,174, 89,118,133,206,234,163,216, 59,146,166, 20,169, - 42, 82,136,161, 93, 77,252, 49, 42, 33, 4,225,182,215,204,148,185,216, 20,171, 61,198,186, 27,110,114,132,166, 53, 69,148, 59, - 30, 90, 23, 25,101,236,171,154, 43,201,240,223,133, 36, 17,241, 35,145, 74,229, 39,161,215, 63,238,253,167,145,106,238,109,193, -110,177, 27,154,158,103,166,165, 71,109,208, 75, 65,135,207,188, 66,117,149,227,252,159, 41,228,233,219, 3, 75,181, 66,188,109, - 27,157, 72,221, 61,223,199, 99,123,219,220, 65,219,108, 51,192, 88,210, 85,228, 53,174, 76,116,104, 30,157,201,185,229, 35, 0, - 2, 19,125,224,147, 75, 37,239,101, 33, 13,213, 69,250,103,114, 80, 10,102,173, 46, 58,164,199,113,180,212,163,184,159,141, 18, - 38,180,144, 27,150,219,136,255, 0, 40,194,218,193,244,234, 52, 13, 53,152, 76, 85,228, 75,126, 75,175, 83,218,112,212,170, 11, -111, 28,170,135, 77,132,169, 78,242,115, 15,209,175, 45,242,143,153,236,117,227, 97,231, 85,171,148, 38,109,155,155,154, 91, 20, -248,232,126,139, 84, 87,199, 38, 34, 85,134,223,163, 74, 82,186,185, 28, 40,126,141, 95,205, 7, 30, 67, 69,110,125, 33,219, 19, -109,119, 58,172, 90, 66, 93,116, 66,166,211,214,225, 63,160,250,214, 82, 3,169, 64,233,241,150, 27,112, 39,168, 3,155, 62, 88, - 58,244,144,243,106,233,148, 11,197, 35,128,123,129,109,205,246,238, 6,199,184,235,108, 71, 42,184,155,216,242,188,198,154,162, - 95,237,180,208,232,140, 11, 90, 66,236,136,172,189,245, 3,160,145,212, 16,122,249, 73,227,159, 17,187,137, 50,231,190,101, 63, - 18,112,228,140,252,162,176, 30, 62, 10,228, 73, 82,164, 22, 95, 72, 63, 2, 91, 10, 66, 22,112, 8, 82, 66,185,126, 28, 29, 79, -145, 81, 80,168, 42, 68,213, 63, 12, 37,188, 63, 45,130,209,128,132,156,150, 26, 75,203, 73, 74,254, 39, 10,138, 92, 67,124,164, -229, 42, 25, 25,186,221,245, 35, 87,185, 43, 18,155, 90,227, 77,126,164,251,143, 7,129,118, 51,188,178, 11,120,144,148,242,135, - 91,232, 71, 50, 10, 92, 36, 36, 39,211, 88,139,213,131, 77,117,196,212, 27, 16,219, 83,220,225,196,169, 47,211,101,161, 71,194, - 11, 92,133, 4,174, 9, 66,203,105,113,183,145,240,248,193,124,202,108,130, 38, 34, 59,179, 29,137,125,253,230,246, 63,127,165, -250, 13,186, 11,218,248,225,108,186, 60,159, 36,202,104, 33, 80,239, 79, 18, 6,232, 36, 44,108,206, 88,216,171,134,102, 58,137, -189,193,232,183,182, 51,138,107,197,167, 35,145, 32,194, 75,137, 45,162,170,204,129, 26, 59,172, 0, 57, 16,250, 88, 42, 67,173, -168, 44,132, 33, 97,105, 81, 89,194,193,192, 15, 21,183, 34, 93,189, 17,133,173,196,213, 88,150,133,188,239, 51, 44,199,149, 29, - 45,142, 86,210, 82,135, 2, 38, 68,112,144,144,148,168, 41, 39, 32,133, 0, 2, 89,200, 80,154,117,109,186,212,100,199,139, 80, -101, 13, 33,216, 78,199,114, 51,238, 37, 74, 91, 78,189, 27,148,178,231, 80,164,172,130, 9, 41,201,238, 14,179,250, 11, 83,227, -182,194,154,145, 2,161, 25,212,187, 44,196, 66,213, 18,124,111, 5,107,100,166, 20,148,169,198,211, 12,115,175,153, 42, 74, 80, - 70, 78, 78, 51,166,186,192,172,178, 6,109,136,220,117,189,189,227,117,177, 30,160, 27,119,233,139, 14,158,162, 39,142, 0,101, - 66, 93,128, 10,247, 70,216,130,108,214,176, 96,108, 65,243, 95,175,187, 27, 7,111,210, 27,168,182,211,116,199,151, 78, 75,232, -110, 83,209,169,177, 26,125, 10,125, 72, 91,143,187, 34, 34,142, 34,172, 0,129,128,132, 45, 73, 72, 9, 43, 56, 80,206,163,202, -184,216,125,223, 26,158,154,225, 56, 80,114,142,180, 69,150,162,178,150,227, 46, 61, 62,106,200, 76,129,146, 74, 91,146, 28, 87, - 54, 67,121, 73,211, 37, 69,159, 9, 83, 19, 42,175, 34,171, 13,106, 74,227,154,156, 84,200, 79,185,120,108,229,135, 25,169, 81, -213,250, 96,176,134,208,128, 65, 64,248,130,145,141, 58,116, 74,219,236,148,159,175, 97, 86, 33,180,182, 20, 87, 17,108,199,169, -180,216, 91,106, 47, 79,130,128, 61,245,230,208,113,204,207, 34,215,156,148,247,212, 94,170, 25,163,109,148, 76,140, 5,245, 41, -218,254,142, 8,213,107,116, 44, 47, 97,229, 55,198,205, 75, 85, 29, 71,255, 0, 73, 68, 85, 96,178,164,159,111, 98,202,179, 71, -229, 98, 69,134,130,202, 77,238, 0, 83, 96,239, 82,107, 84,106,164,152,205,214, 16,245, 17, 75,247,101, 22, 43, 1,232, 83,105, -203,136,165, 50,229, 98, 34,151,202, 17,226, 61,202,145,202,178, 48,162,146,142,250,216,251,105,128,186, 36,170,100,211, 22, 67, - 77,176,209,122, 60,214,153,145, 30,167, 10, 65,240,214,164,164,158, 79, 13, 73, 45,115, 37,224,181, 33,120, 81,230, 79, 42,131, - 59, 69, 16,106,201,139, 50, 64,129, 87,142,243,161,150,146, 80,211,168, 90, 71,134,148, 54,236, 25, 3,150, 43,129, 5,101,229, - 41, 92,199,162, 51,130,112,245,208,236,136, 14, 52, 88,165, 63, 50,139, 34, 51,197,246, 98, 51,239, 14, 83,216, 91,139,113,121, - 76, 73,110,172, 58,223, 48, 72, 13,160,134,135,112,144, 6,154,194, 70, 23,117,229,143,129,216,236, 71, 80, 47, 96,118,184, 4, -222,231,114, 6, 41,222, 44,205,105, 4, 73, 28,205, 45, 7, 45,193,177,250,212,141,149,187, 31, 44,137,107,144,124,172,109,102, -184,117, 1,243, 59, 82,158,154, 90, 88,167,200,142,181,210,164,169,181, 70, 81, 89,144,237, 61,164, 97, 8,142, 95, 89, 89,114, -156,227,128, 6,143, 58,148,202,185,146,172,161, 73, 41, 58,230,163,187, 82,190,163,190,164, 15,240, 15,170, 97, 12,245, 79, 47, -184,169, 46, 41,174,193, 14,169,111,140,231,161, 40,198,122,227, 89, 5, 18, 3,176,154,143, 6,166,202, 9, 1, 73,143, 61,174, -116,199,117, 99, 11,126, 47,134, 18, 84,193,229, 10, 37, 10, 37,180,225, 64, 40, 28, 13,100,168,166,120,245,217, 15,133,120,168, -146,220, 87,219, 46, 28,171, 6, 52,112,158,128,225, 60,175, 70, 87,197,205,140, 40, 16,112, 64,214, 42,193, 90,101, 10,126,211, -169,184,233,123, 31,188,110, 72,220, 3,125,207, 67,138, 55, 49,206,155,219,234, 42,132,129,216,197, 32, 46, 15,145,195, 50, 2, -235,191, 86, 80, 85,250, 18, 70,227, 86,166, 57,149,157,109,178,148,183,224, 71, 1,183, 35,200,142,217, 40, 25, 72,109,212,201, - 82,185, 20,122,144,165,158,100,158,128,171, 25,198, 50,253,209, 40,136, 75,137, 56, 90, 16,244,102,139,216, 60,229, 92,174, 20, -160, 14,224, 59,241,225, 62,105,200,244,214, 51,107,195,108,165,151, 16,146, 22, 20,133, 20, 2, 74, 64,121, 60,138, 65, 87, 76, - 96,117,207,114, 8,243, 3, 79, 5, 53,182,146, 64, 57,193,111,145, 35,178, 84, 80,226, 28,232,165,126,162,177,219, 31,234, 19, -220,105,223, 44,132,121, 88,223, 77,198,253,250,119, 62,253,247,252,113, 75,113, 30,119, 60,175, 32, 4,249,186,239,191, 91,252, - 54,176,222,214,184,191,174, 50, 89, 20,195, 81,143, 72,144,180,173, 79,134, 84,226,176, 3,206, 10,131, 10, 49,156,120,149, 12, -182, 3, 33,100, 31, 37,188, 73,238, 14,172, 46, 81, 36,215,106, 78,136, 82, 13, 46,159, 29,244,173,218,140, 98, 3,147, 86,130, -148, 42,159, 79,101,212,148,184, 90, 82, 9,117,242, 64, 39,157,182, 86, 64, 39, 89,163,142, 4,210, 26,113,106,112, 18,169,104, -109, 13,148, 32,151, 20,219, 9, 95, 85,156,163, 43, 88, 5, 64, 16, 3,157, 50, 73,215,199, 43, 45, 65, 83,113, 91, 14,161,136, -145, 25, 84,196,198, 1,231, 22, 91, 74, 20,150,219,107, 33, 42,116,156, 18,165, 16, 57, 84, 58,142,131, 82, 86,141,140,129, 80, - 14, 99, 42, 29,250, 93,128, 39, 98, 55,238, 64,233, 99,214,219, 98,176,130,186,186, 61, 66,153, 3,200, 12,138,151, 0,172,107, -174,228,216,130, 24,139,170,168, 32,128, 73,218,246, 35, 9,159, 71,167,209,161,120, 20,248,236,194,134,100,203, 91,178, 29, 95, -186,251,203,202, 90, 28,149, 81,118, 76,215,143,188, 39,196, 74,202,151, 33, 97, 35,155,151,196, 40, 72,195, 37, 84,174, 73,169, - 84,154,106,129, 77, 18,105, 49, 10,229, 68,157, 80,241,218,102,167, 32,224, 55, 84, 90, 25,111,222,102,198, 15, 5,251,154, 64, -109, 11,229, 46,180,231, 39, 33, 15,133, 74, 59,117,246,189,234,168,242, 95,136,212,199, 36,199,182,218,105,167,105,241,249, 74, -146,211,181,151, 92, 73, 53, 87, 2,149,206,150, 9, 76, 54,221, 64, 80,109,197, 32, 43, 88,189, 94,149, 6, 43,205,191, 86,230, -247,217,135,221,162,211,216,142,170,140,185,124,205,173, 45, 70,131, 10, 58,124,106,140,226, 75,124,160, 0,202, 50, 8, 82, 18, - 57,198,220, 72,224,134,210, 45,176,191, 96,122, 95,208, 6,189,206,219,216, 29,247,196,207, 33,174,134,153,155,219, 85,171,171, -156, 48,220,187, 89,207, 83, 96, 67, 75, 32, 91,221,193, 17, 45,216,175, 48, 50,178,224, 84, 74, 44,154,236,184,109, 72,113,234, -237,116,165,197,177, 54, 82,143,185,194,138,164,184,249, 16,105,241,143, 44,103,208,121, 50,164,146,226,240,182,220,119, 4,235, - 37,164, 65,153, 92, 80,137,106, 70,139, 82,125,151,164,197,155, 93,168,123,196,123, 46,150,251, 8,240,252, 17,238, 40, 42,185, -170,222, 34,155, 80,141, 16,150, 88,230, 75,114,101, 51,130,141,103,113,118,222, 84,228,199,126,232, 95,240,106,136, 16,215,189, -218, 86,235,201, 53,185, 52,220,146, 81,114, 92,236, 97, 49, 90,112,128, 36,194,166, 1,146,181, 52,236,199,138, 84, 53,147, 85, -149, 73,182, 92,129, 6,223,109, 81,169,207,198,147, 79,163, 83, 41,232, 5, 82, 81, 29,145,152,108,180,165, 54, 91,134,211,156, -200,113,210, 18,218, 3,193,103,153, 99, 39,101,145,165, 85,144, 39, 49,211,208,128,187,218,251,146, 58, 53,134,171, 94,215, 4, - 88,173,147,175,226,120,170,103,246,122, 6, 21,149, 44, 27, 66,168,189, 44, 37, 67, 23, 6, 68, 33, 36, 54, 58,210, 58,127,236, -202,171,173,165,149, 12,145, 11, 77, 10,223,167, 90, 47,203,153, 93,154, 39,203,117,178,229, 86,225,153, 22, 43, 10, 90,217, 97, -108,173,148, 73,109,194,197, 34,138,149,128, 98,176,158, 86, 18,160,180, 32,169,197, 18,171,243, 12, 71,188, 39, 42,174,205, 61, - 18, 45, 72,169, 45, 52,144,181, 82, 30,158,238, 86,184,179,219,134,160,218,163, 82,146,160,225,109, 14, 58,219,178, 20, 76,135, -249, 18, 91,109, 56,227,176, 25,153, 75,137, 81,185,166,184,212, 78, 68,193,165, 81, 33, 56, 20,195, 85, 39, 10, 11, 82,165, 48, -193, 47, 87,234,137,240,209,202,128,158, 72,168, 70, 91, 66, 74,214,240,187,209,162, 25,147, 29,241, 80,243, 20, 40, 45,185, 21, -234,107,146, 57,170,243,146,235,172,178,227, 19,125,225,132, 36,196, 91,197, 42, 68,112,151, 28, 82, 94, 80,113,210, 62, 13, 58, -210,106, 66,183, 75, 35, 17,168,117, 97,109,198,228, 16,111,212,237,190,224, 90,197,113, 23,172,103,117,158,190, 74,182,147, 48, - 80, 99,105, 64,211, 10, 1,101,209, 78,168, 99, 38,107,105,141, 52, 17, 20, 68,221,110,162, 55, 14,212, 81, 18,171, 73, 69, 54, -151, 80,170,193,183,229,135,231, 85, 42,149, 41, 47, 79,143, 80,247, 20, 52,203, 16, 98,229,240,126,168,115,170, 31,125, 39,149, -208,202, 26, 10, 40,231,230,113,232, 15, 68,139, 87,166, 53, 26, 60,198, 94,122, 51, 68, 71,148,250,148, 25,103, 63,162, 83,229, - 41, 41, 99, 37, 69, 44,160, 37, 60,201,103,152,129,206, 20, 27,135, 43, 8,141, 22,153, 2,220,110, 28,171,174,170,134, 89,142, -153,169, 66, 35,209, 88,108,174, 57,126, 80,125, 99,220, 96,135, 91,113, 92,141,161, 33,199, 27, 75,101, 92,216, 34,241, 2, 53, - 62,152,134,101, 34,161, 49,233,206,169,137,117, 56,178,156, 90,231, 45,245,190, 29,112,130,215,199,159, 17, 9,113, 10, 64, 72, -240,130, 80, 82, 83,212, 76,105, 31,217,222, 25, 64,230,104, 8,110,162,224, 1,102,223, 85,193, 99,246,172,183, 96, 73,103, 47, -101, 81, 84,230, 84,205, 52, 18,164,134, 72,163,156,202, 35,140,221,164,118, 98, 85,165,150,214,109, 39, 74,162, 72,246, 71,229, - 5, 65, 26,139,159,203,207,219, 83,176,204,240,223,237, 79,227, 35,111, 41,204, 69,139, 67,175,238, 80,222, 59, 98, 36, 38,195, -113,161,208,183,162,149, 7,112,132, 52,182,144, 3,101,170,213,102,182,215, 40,232,148,176,158,221,135, 48, 73, 36,100, 96, 99, -184, 61,250,246,212,159, 62,150, 45,137, 6,222,246,135,108,254,224, 66, 67,137,123,117, 56, 94,183,220,168,135, 22,209, 74,230, - 88, 87,181,215, 66,109,109,161,180, 2,209, 52,250,172, 0,176,165, 45, 68,165, 61, 64, 1, 34, 48, 64,228, 21, 18, 15,251, 56, -236,115,211, 86, 37, 3,171, 82, 68, 23,236, 70, 90, 53,182,195, 76,108,209,131,111, 66, 22,227,189,136,190,247,199, 60,230, 49, -152,171,170, 80,253,162,193,143,184,200,162, 66, 62,237, 86,255, 0, 76,120, 41,206, 48,160,113,145,142,217,207,150, 15,125,123, - 0,227,148, 14, 92,116, 63,209,247,244,215,220, 39, 25, 35,191, 83,230, 71,159,125, 87,109,178,242,146,134, 70, 92, 87, 96,172, - 36, 4,128, 84,165, 45, 71,162, 80, 0, 36,146,112, 0,201,233,173,195,210,228,218,223,187, 26, 93,174,118,199,134, 90,117,213, - 33,166,208,167, 28, 90,185, 80,132, 2,165, 40,158,192, 1,174,165,240, 33,236,163,226, 11,141,133,195,187,161,181, 31,108, 54, - 57,185,170,102,161,188,215,148, 9, 46,210, 42,138,140,234, 81, 54,157,182,214,243, 78, 53, 39,113, 42,232,234,133, 62,203,140, - 81,226,186,164,251,205, 65, 68, 45,141,111,127,178,155,217, 11, 7,117,232,244, 30, 38,184,174,161,203,107,103,231,248, 21,109, -173,218, 73,190,241, 78,168,239, 51, 13,168,169,155,182,242,228, 90, 36, 81,246,136,186,131,238,144,210, 90,151,113,134,203,171, - 91, 20,149, 36,203,150,181, 2, 36, 72,241, 41,180,202,125, 62, 5, 42,149, 74,131, 14,149, 68,162, 82,162, 70,166,209,168,180, -168,109, 37,152, 52,202, 93, 50, 19, 72, 98,155, 79, 98, 58, 66, 90, 97,150,208,219,105, 24, 66, 83,166, 25,243, 9, 42, 36, 48, -211, 63, 42, 59,216,200, 44, 75, 90,215, 17,131,112, 7, 91,187, 2, 54,178,171, 92,178, 89,124, 43,192, 18,102, 49, 69,153,103, - 74,240,208,200, 3, 69, 2,157, 18, 76,166,196, 60,141,179, 69, 19, 15,178, 22,210, 56, 58,131, 70,186, 89,244,203,132,143,102, - 23, 8,220, 37,199,165,207,176,182,222, 37,237,184,240,218, 71,188,239, 38,234, 68,167,221, 55,203,178, 8, 5,199,104, 48,157, -143,245,101,141, 16,184, 57,155,143, 75,138,210,217, 36,230, 83,228,243,158,151, 69,160,187, 49,126, 36,133, 58,235,129, 35, 46, - 60, 86,226,143, 94,131,153, 68,246, 24, 3,200,118,213,202,135, 74,248, 27, 28,132,168,164, 41, 71, 3, 60,167,178,137,239,204, -123, 15, 64, 52,232,211,232,248, 74, 64, 64, 35, 29, 71,146, 73,235,146,113,212, 96,254,205,107, 90, 40, 75,114,198,159, 86, 38, -236,109,251, 76, 73, 38,219,253,162,109,208, 91, 22,226, 81, 83,208,192,148,180,116,233, 71, 78,189, 18, 53, 84, 94,219,144,182, -187, 30,236,110,205,212,155,226, 36,191, 73,131,133,184, 14,237,254,198,241,107, 70,166, 37,170,205, 10,172,246,199,238, 12,230, - 90, 72, 51,232,213, 6,101, 92, 59,127, 50,122,210, 50,227,241,167, 51, 87,134,218,213,158, 86,166, 6,193, 0, 1,168,116,169, - 41, 33, 39,204,245,237,215, 39,203,251,117,250, 82,251,111,182,226,159,122,123, 47,248,158, 68,212,183,205,103,209,237,109,192, -166, 56,164,149,248, 53, 59, 98,234,166, 45,165,183,223,145, 74, 98,100,132,103,253, 85,145,219, 95,154,217, 61, 0, 4, 2, 74, -134, 8, 61, 7, 49,198, 52,227,147, 73,255, 0,165, 66, 15,216,112,195,220, 36, 0,159,222,225,201,223,169,197, 33,199,180,137, - 77,196, 45, 34, 0, 5,116, 17, 74, 69,250,190,167,136,155,109, 98,194, 32,222,246, 36,247,192,206,116, 56, 35,174, 1,207,238, -253,186, 25, 65, 61,243,212,246,243, 7, 26, 53,192, 0,199, 55, 83,220,158,189,254, 95,142,132, 88, 87, 83,128, 65,237,142,152, -192,193, 56,199,174,159,241, 15,192, 46, 18, 50, 66,124,241,246,227,185,249,232, 98, 58,147,216,252,251, 39,236, 30, 90, 53,207, - 47,191, 65, 58, 65,207,175,110,189,250, 16, 14, 52,178,244, 30,252, 20,218,254,159,207,182, 5,112,227, 39,190, 51,142,131, 31, -120,199, 78,154, 17, 68,242,243, 31,159, 40,251,126,126,154, 37, 72, 61,249,137,198,122,121,118,238,122,245,213, 5,161, 68,100, - 16,191, 34,124,135,231,247,232,227,183,207,254, 48,111,134, 5, 42, 36, 16, 71,124,114,231,182, 61,126,122, 29, 68,103, 25,234, - 1,232, 6, 0,235,229,162, 84,147,145,215,246,116, 0,106,130,240, 62,121,237,229,142,217,251,124,180,162,141,133,183, 31, 63, - 61,177,144, 1, 62,151,192,138, 73, 25,229, 57,201, 57,255, 0,103,240,208,221,251,232,197, 2, 50, 70, 0,235,156, 30,227, 61, - 50, 61,116, 50,192, 29,129,245, 39,203,236,252,116,170,117,249,219, 10, 40, 4,116,183,200,197,185,230,249,199, 41, 42,198, 70, - 82, 58,103, 25,238, 71,150,116, 51,141,184, 1,235,202, 2,112,144, 0, 36,143,159,167,158,174, 42, 0, 30,132,158,249,207,174, -132,121,178,164,158, 85,169, 7, 39, 24,254,119,219,234, 51,165,176,110,158,235,226,222, 82,148,255, 0,148, 36,147,212, 99,211, -208,244,239,165,175, 69,181,182, 0, 82,148,225, 61, 73,192,233,242,239,165,161, 99,233,140,227,210, 7, 92,249, 15,233,252,157, - 20,130, 49,129,223,185,251,245, 65, 32,224, 12,117,234, 63, 19,255, 0, 13, 86, 64,238,124,199, 76,122,104, 96, 96,148,167, 3, -175, 66,127, 28,126,227,253, 90,168,210, 0,200, 56, 61,207, 79,158, 58,231,243,223, 84,210, 73,233,142,131,166,126,239,219,162, - 91, 73, 57,233,223,215,207,166,147,112, 55, 61,255, 0,241,129,143, 96,121,224,159,199,161,251,180, 91, 63, 23,113,203,215, 25, -238,123, 13, 83,109, 35,160,235,215,175,223,141, 18,148,131,208,116,233,158,223,102,147,193, 77,141,238,118,193, 72, 79,216,122, -118,249,250,227,203,207, 85,146, 1, 56, 61, 61, 49,251, 7,109, 14,216,230,198,125, 50,122, 99, 68,160, 2, 64,198,125, 63,225, -164, 90,192,144, 62,122, 97, 28, 86, 29, 14, 58,140,121,159, 62,158,186,218,174, 11,120,121,159,197, 23, 18,123, 87,179,145,130, -147, 79,185,110, 40,206,220,178, 66, 73, 76, 27, 74,150,164,207,184,229,172,143,213, 6,158,202,219, 7,253,105, 35, 90,172, 1, -206,113,144, 59,143,159,245,234, 71,254,193,173,178, 98,146,141,245,226, 34,165, 22, 63,188, 82,169,144,118,234,211,150,250, 66, -158, 98, 93, 83, 19,235,142, 70,200,253, 26,253,223,221, 91, 42, 24, 61,198,152, 56,151, 50, 57, 86, 77, 91, 84,173,166, 80,186, - 80,142,161,155,107,143,122,130, 91,254,220, 76, 56, 7,134, 79, 24,113,142, 65,195,218, 75, 67, 95, 58,243,173,255, 0, 2, 48, -101,152, 92,116,213, 26, 20, 7,179, 48,196,149,103,214, 45,203,102,139, 77,179,109,136,172, 83,237,139, 54,149, 2,215,182,224, - 65, 9,106, 37, 62,145, 72,142,136, 76,165, 49,147,211, 5, 45,100,145,212,231, 39, 86,118,235, 42,143,200,227, 47, 37,210,234, - 18, 24, 83,124,167, 5,120, 37, 7, 39,169, 39, 31,142,154, 22,235,241,228,173,213, 7, 98,188,149,229,164,178,233,228, 89, 82, -186, 30,101,122, 21,107, 39,167, 33,181,182,204, 85, 70,113,109, 7, 2,195,161,204,169,167, 50, 20, 18,130, 15,196, 61, 53,201, - 85,114,187,206,236,205,119,148,147,111,221,239,252,122, 91,240,246,231,132, 50, 26, 12,191, 43,166,165,142, 30, 84, 80,168, 93, - 32, 13, 58, 85, 84,105,177,176, 1,109,176, 91, 3,211, 99,135,136,196,145, 38, 52,105,210, 76,121, 79,186, 10, 76,117,169, 45, -200, 65, 31,170,160, 65,233,140,104,132,199, 66,144,161, 62, 50,221,107,148,150,150,164,248,168,109, 67, 33, 74, 86, 6, 71,200, -131,160, 41,209,224, 56, 99,202,116, 72, 15, 50,217, 66,222,125, 75, 64,192, 24, 0,163,205, 35,215,229,172,162, 35,108, 56,218, -125,222,104, 97,121,193, 42, 81,113, 50, 18,162, 73, 1,181,118, 3, 58, 69,199,148,148, 66,227,107,244,216,237,190,219,127, 28, - 18,170, 83, 9, 43,230,178, 30,161, 74, 4,185, 54, 11,164,181,128, 27, 95, 77,200, 59,139, 97, 81,169,202,247,134,228, 67, 90, - 39, 71, 36, 55, 34, 19,199, 15, 6,193, 24, 91, 89,234,160, 7,109, 86,220,221,191, 69, 90, 85,181,115, 68, 96, 46, 68, 6,140, - 7,138,147,149,150, 82,160,166,208,188,140,168, 39, 39, 25,242,233,167, 58,137, 71,166,201,142,194,201,142,212,216,196, 6,229, - 50,121, 11,153, 61, 65, 3,161,199,207, 78,207,240,125,201,244,162,195,141,165,106, 65, 67,236,188,216,248, 92, 90, 48, 74, 84, - 7, 98, 83,144,126,221,106,152,228,100,145, 44, 64,101, 22,223,184,183, 79,141,173,235, 98,111,138,187,136,120,137, 99,171,130, -101, 58, 30, 38,100,109, 86, 82,202,195, 78,228, 88, 56, 32,141,236,172, 58, 16,109,124, 91,182, 90,193,101,183,152, 82, 35,165, - 30,248,200,113, 65, 41, 9, 79,140, 82, 57,198, 49,211,152,245,251, 78,155,223,104, 77, 33,251, 91,135,122,140,200,202, 44, 42, - 69,199, 77,109, 75, 9, 39,197,247,120, 85, 7, 27,105,208, 6, 86,128,176,147,145,219,151, 56, 58,220,141,174,167, 53, 29,232, -216, 70, 58, 14,152,232,133,143,214, 72, 31,205, 26, 97,253,170,148,143, 23,133, 86,229, 70, 46,101,187,202, 15, 56,105, 57, 89, - 75,148,154,162, 84, 79, 78,191,171,143, 92,159, 93, 75, 50, 90,104,205, 42,203,166,242, 70,111,241,189,135,243,239,235,142,124, -204,184,154,105,248,255, 0, 33,161,119,211, 75, 85, 83, 4,100,118,176,147, 86,254,237,133,254, 24,136, 5, 65,227, 38, 82,145, -202,226, 39, 41,110,184,151,185,156,241, 27, 46, 17,149,180,210, 23,200,250, 75,169,109, 32, 45, 42, 64,235,207,202,174,244,225, - 84,213, 6, 69, 67,223,225,189, 84,158,167,131,113,207,129, 29,150,216,138, 80,148,182,153,212,240,151, 19, 0,248,133,126,240, -180,243,120,152, 79,110,128, 7, 61,166, 95, 74, 93, 83,147, 93,247,105, 92,175, 73,101,190, 69, 71,105, 74,202,153, 10,108,130, -212,142,100,163, 40, 88,230, 36,130,160, 83,202, 52, 77, 26, 68,232,229, 30, 27, 79,123,184, 37, 79,205,166,196,101, 85,116,182, - 73, 71, 35,108, 72, 90, 68,166,220, 46, 4, 56,180, 23, 84,209, 5, 97, 7, 3,149,225,214,234,123,129,216,253,221,239,113,176, - 23, 3,174,219, 95,167,161,116,245, 3,200,177,221,159,162,132,176, 97,182,229, 73, 27,128, 53, 11,223,179, 1,176, 39, 14, 61, -179,110, 49, 87, 92,138,164, 73,146,233,178,165,150, 16,227, 84, 69, 42, 50, 94,109, 10, 71, 71, 96,168, 22, 37,159,133,105, 75, -193, 9, 83,132,168, 41, 95, 14,158, 74, 45, 26,235,147, 34, 76,184,244,134,171, 40,104,204, 83,146, 41,175, 68,162, 76,140, 26, -117, 76,161, 51,233,207, 31, 0,115,161,149,165, 62, 10,135, 57, 87,234, 12,157, 54,148,138,123, 5, 81,133,159, 38,108, 39, 22, -195,242,231, 68, 66,152,157, 2, 68,128,208, 83,174, 57, 5,247, 3,144, 18,140,142,105, 41, 91,107, 89, 89, 79,134, 84,158,109, -108,157,156,170,253, 2, 24,110, 77, 1, 74, 65,106, 28,151,106, 52, 57, 77,206,132,236,118,255, 0, 72,150,159,167,169, 41,148, -219,202,116, 37,124,170,241, 18,165, 16, 50, 10,136,212,110,190, 89, 0,102, 91, 57, 54, 10,173, 96,125, 45,246,150,247,176,217, - 88,139,245,185,184,195,137,205,164,100, 34,153, 99,169,146, 43, 14, 92,202, 82, 66,118,230,106, 62, 73, 25, 71, 75,134,111, 41, - 23, 70, 4, 1,238,148,138, 91, 79,179, 2,163, 42,161,107, 43,221,217,145, 13, 23, 52, 5,211, 28, 76,196,148,190, 35,243,188, -223,129, 37,188,163,195,105,198, 94, 1,193,212, 37, 68,105,199,141,108,212,103, 60,153,146,233, 80,100,164, 73,113, 42,158,134, -163,128, 66,210,128,223, 59,193,178, 90, 87, 40, 29, 82, 74,185, 79, 84,231,174,179,235, 33,170, 93, 82, 77, 65,154,147, 17, 46, - 76,178,176, 41, 85, 40,140, 45,104,144,248, 64, 74, 13, 62,115,105,115, 41,101, 46,164,185,225,171,144, 31,132,142,153,120,104, -155, 91,103, 58,196,127,118,165, 59,108,201,150,211, 50,140,139, 86,167, 83,165,188,209, 10, 66, 17, 17,112, 22,243,140, 60, 16, - 72, 81,231, 97,105,115,147,153, 93,245, 22,146,172,134,180,138,209, 72, 58,244, 55,189,174, 71,217, 35,212,143, 54,251,139, 30, -173,181,252,117, 14, 86,239, 28,240, 77, 72,225, 81,117, 42, 44,182, 50, 45,220,171, 22,130, 84,251, 42, 72, 28,237, 90, 65, 85, - 58, 66,227, 1,178,236,216, 17,129,148,194,170,116,121,146, 79,188, 38, 93, 38, 95,133, 10, 82,217, 78, 91, 18, 24,229,114, 60, -196,167,194, 87,134, 28,105, 10,115,149, 65, 71, 7, 26,218,107,126,109, 90, 10,162,154,132,152, 21, 33, 32, 55,133, 48,201,165, -212, 26, 80, 33, 63, 20,102,159,113,167,222, 82, 65, 82,130, 11,105, 73, 39,225,199, 46,172,180, 45,177,175,198,113,230,233,151, -117, 62,124, 98,178,148,183, 92,183,144,196,137, 9, 81,248,202,103, 82, 28, 65,109, 73,194,146, 20, 24,229, 74,149,158, 83,170, -151,157, 90, 22,218, 91,117,139,187,113, 17, 73,181,172,155, 85,134,101,215,110,181,213, 99,253, 77, 72, 98, 68,134,161, 70, 15, -171,149, 18, 12,199,165, 63, 30, 59, 44, 48,211,146,228, 58,240, 75, 8,112,149, 16,164, 80,243, 60,247, 50, 62,199,125,199,193, - 73, 23,219, 99,125,143, 82, 0,239, 80,241, 39, 21, 71,196,149,209, 83, 82,212,174,107, 81, 80,226, 56,226, 80,230,162, 70,147, -234,226,138, 33, 50, 71, 80,238,238, 21, 99,138, 13,122,152,170,128,194,195, 15, 28,122,147,162, 40,105,244, 58,132, 37,223, 18, - 3,231,194,234,242, 86, 28,114, 59,165, 43, 30, 26,249,214,164,228,128,219,188,202,202,185,192,213,242, 37, 81,151, 30,143, 37, -197, 57,226, 48, 3, 43, 43, 9, 11, 44,184,174,102,157, 83, 95,206, 90, 22, 66, 70, 64,200, 86,124,137, 13, 21,189,112, 82, 46, - 11,114,151,114, 91,117,216,119, 21,175,113, 83, 33, 86,232,117,120,238,174, 76,106,173, 26, 82, 67,145,101, 66,125,192, 11,141, - 45, 4,130,146,128,164, 41, 37,183, 57, 92, 66,210, 3,147,114,251,147,205, 46, 54, 83,202,178, 2, 20,226, 80,132,161, 96,169, - 73, 10, 36,120,173,129,204,140,147,204, 20, 64,198, 59,150,162, 37,117, 42, 5,134,194,253,108, 65,216,110,125, 71, 75, 11,250, - 92,139, 85, 45, 11, 75, 83, 85, 72,209,180, 51,196,206,140,172, 25, 25, 24, 29, 14,146, 35, 0,209,184, 32,134, 82, 46, 24, 18, - 55, 26, 78,240, 90,213, 31,208,130, 86, 9, 4, 18,130, 72, 73,229, 80, 42,230,108,126,177,199, 46,112, 65, 25,207, 93, 58,209, - 39,130, 16,145,159,214, 81, 60,157, 65,194, 72, 0,114,156,158,128, 96, 14,165, 71, 30,128,234, 46,217,220,212,153,116,202,237, -193,112,215,105,214,197,177,108, 64,126,171, 91,175,213, 37,166, 53, 46,151, 79,136, 18,100, 76,145, 41, 67,244, 76, 39, 45,163, -148, 5, 41,199, 22,134,154, 11, 82,210,147,121,177, 56,210,225,140,221, 20,202, 80,185, 43,180,231, 43, 85, 4,209,236,251,142, -240,181,165,219, 54,109,110,224,123,244, 52,198,233,213,121,111, 56,150,164,191, 39, 34, 8,154,220, 70,223,145,203,133,133,114, - 37, 82, 44,159, 40,174,158,140, 87,178, 8,168, 83,237, 72, 72, 38,202, 69,200, 91,220,219, 97,125,133,250,145,136, 77,103, 11, -113, 14, 98,249,179,100,188, 59, 93,159, 12,160, 94,161,169,105,165,154, 56,137, 78, 96, 87,150, 53,100, 83,203, 28,198, 91,150, - 88,129,148,174,133, 36,110,229,114, 79,128,205, 58,148,133, 31, 26, 20,100, 59, 45, 60,196,132,212, 39, 20,202,122, 50, 84, 70, - 84, 27, 10,142,218,188,129,109, 73,206, 70, 5,137,201, 14, 46, 63, 35,110,172, 30, 98,236,137, 60,136, 43, 66,208, 65, 73, 5, -196,225,111,114,171,166, 73,229, 9, 25,193, 3, 88, 95,215,200,158,183, 30, 67,206, 41, 43,116,248,202,117,107,231, 82,249,143, - 62, 86,165,101, 75, 43, 42,230, 4, 2, 9, 87, 55,198, 14,178, 38, 92, 98, 67, 32, 20,251,201, 8, 88,240, 16,146,164, 41, 67, -178,192, 65,194,147,145,216,231, 10,198,125,116,226,139,237, 51,153,109,101,216, 45,137,176, 85, 0, 40, 38,219,249, 64,243, 91, -246,186, 2, 70, 32,113, 80,251, 44, 81, 44,131, 83,130, 89,141,129,187, 49,212,196,131,181,139, 18, 64, 38,192, 90,228,140, 52, - 23, 71, 18,155, 27,182,247,133, 23,109,175,221,230,219,141,180,184,238, 72,209,228,209,169,247,213,194,220, 10,181, 86, 20,201, - 78, 65,135, 62, 60,103,163,251,172, 38, 37, 75,102, 75, 81,164,214, 36, 66,142,250,153, 91,141,169,214,146, 84,119, 30,147, 66, -165, 80,195,147, 41,232, 38,166,235,108, 25,149,121, 74, 76,250,173, 65, 50, 26, 67,141,184, 37,252, 94, 36, 34,194,208,182,218, -140, 81, 20,180, 82, 89, 10,109, 73, 89,131, 15,180, 99,113, 31,190,120,217,226,105,247, 21, 37, 48,237,189,193,122,201,132,220, -231, 27, 90,216,183,172, 58, 52, 11, 98, 37, 40,182,149, 41, 9,140,210,225,202, 12,167,155,149,105,150,162,177,158,154,222,143, -101, 55,180,158,109,129,120, 91, 92, 38,241, 1,118, 84,165,108,197,201, 83,133, 67,218, 59,194,177, 84,117, 3,105,238, 58,130, -145, 22,145,102,215, 42, 78,168,190, 54,130,167, 53,198, 99,180,128,239,129, 65,155, 33,153, 40, 74, 41,207, 76, 66, 18,163,204, - 18,106,169,105,103,136, 44,113,146,169, 37,205,135,152, 11, 55, 64, 21,137,251, 98,218, 65, 1,129, 26,156,119,103,137,223, 65, - 12,230,155,192,222, 23,241, 67,129,120,142,163, 57,207,166,202,105,115, 92,243, 34,120, 80,201, 36, 83,210, 71, 89, 57,203, 94, - 45, 47, 81, 37, 18,146,173, 69, 62,179, 89,161,231,164,145, 39, 16,209, 79, 40,202,229,206,203, 50, 92,167,210,208,107, 18,249, - 17,239,226, 44,119,234, 17,224,182,163,206,183, 36, 8,104, 87,141, 37, 68, 5, 37,149,169, 33,190,156,196,116, 73, 21, 52,233, - 79,123,195,137,167, 34,158,186,130, 89,101,234,213, 77, 81,234, 87, 35, 64,168, 41,152,136,167, 35, 45,198,233,144,132,186,180, -161,158,159,161, 42, 57,214,118,211,109, 82,144, 99,162, 60,122,107, 81,146,184,210, 98, 6,209, 25, 12,173,165,168, 41,185, 13, -180,145,149,165,224,224, 89, 57, 61,193, 61, 53,141, 63,114, 33,233, 11, 85, 22, 2,170, 6, 42, 84,212,185, 46,120, 80,168,201, -117, 77,148,182, 88,156,160,181, 73,125, 4,163, 41,105, 11, 32, 40,146,226, 20, 64,212,177, 40,249,104,218,136, 93, 29, 1,247, -238, 71,235, 92,237,232, 58, 18, 54,181,252,231,165,168, 98,130, 44,186,134,201, 24, 5,166,121, 54, 99,112, 87, 94,233, 10,130, -202,186, 81,249,136, 78,144,193,201, 44, 84,122, 5, 38, 28, 86,234,113,156,144,169,205,161,212, 57, 82,170,201, 76,201, 45, 60, -163,153,137,113,197,182,159,113,143,202,130, 20,219, 0, 33, 33, 33, 36,173, 0,232, 37,215, 92,148,250,153,181,195,113, 24,204, - 83,252, 40,144,178,220,218,116,212, 96,205, 77,188,203,169,196,146,181,168, 6,221,112, 41,150,139,220,205,165, 69, 32,139, 44, -136,107,113,106,122,179, 49,215,100, 48,241,113, 20,248,234,113,186,107, 6, 70, 20,166,155,136, 28,230,125, 10, 89, 0,151, 66, -148,164,164,149, 30,184, 24,253,199,122, 66,165, 47,234,152,208, 81, 88,170, 60,133,169,134,151, 37, 17, 89,142,182,144,160,195, -138,116, 16,184,175,115,146, 26,228, 35,152, 2,144, 10, 70,182, 97, 64, 14,163,229,113,223,173,246,245,220,141,236, 46,119,233, -208,144,112,239, 75,150, 79, 93, 50,162,150,205,103,109, 68,106,254,230, 52,186,181,201,144,170,200,168, 55, 28,194,177, 0, 89, - 74, 58, 49,195,130,197, 46,151, 71,143, 89,156,136, 50, 16,226,147,239, 45,220,146,230, 75, 91,181, 22,228,134, 85, 46, 53, 65, - 42,116,169,215, 27, 81,116, 21,143,136, 56,176, 83,223, 69,209,101,194,118,104,120,212,188,105, 41,116,182,242, 25, 83,206,149, - 54,218,214,160,181,186,242,194,131,168,108,182, 83,205,250,200,108, 3,147,240,233,134,126, 83,142,181, 21,235,160,213, 20,137, -105,109,136,245, 1, 33,149, 69,131, 86, 73, 74,228,162, 18,225, 47,194, 98, 66,176,143,133,208, 29, 73, 36,133, 44,128, 52,237, - 91, 17,157, 91,145, 84,244,169,143,180,227, 68, 21, 75,109,133,243, 33,111,129, 20, 74,114, 56,241, 39,182, 84,174, 82, 70, 20, -165,173, 69, 57,239,167,120,101, 42,241,198, 6,146, 55,181,138,219,126,164, 14,187, 16, 5,245, 16, 5,201, 45,115,133, 51, 76, -165,169, 40,229,154,170,189,170,102,150,227, 88, 37,145,130, 42,169, 88,221,140,154,183, 83,169, 71, 40, 43,236,138, 6,155,195, -227,233,107,174,155, 39,136,190, 10, 30, 97,107,118,164, 56,127,220, 70,158,146,160, 16,217,132,155,246,143,200,210,154, 35,155, -222, 4,191,120, 37, 71, 9, 82, 86, 10, 64,235,168,152,132,228, 28,164,164, 19,215,231,143, 77, 73,155,233, 79, 95,204, 87,248, -240,217,189,185, 66,217,147, 47,105,120,111,164,154,148,182,157, 83,138,126, 70,226,221,245,186,220, 86,150,133,146, 80,148, 83, -104,144,212,158,249, 18,186,147,129,168,234,237,246,223,222, 27,165,119,219,150, 21,133,110, 86,174,219,186,237,172, 68,160, 91, -118,213,189, 79,122,169, 91,174, 86, 39, 44, 34, 53, 58,153, 1,128, 75,239, 43,226, 82,212, 74, 91,101,180, 45,231,150,219, 72, - 90,211, 98,229, 79,202,203,150, 89, 92, 34,171, 76, 88,147,176, 28,199, 55,185,216, 11,111,185,252, 49,198, 60, 76,139,250,126, -189, 32, 28,197,102,132, 46,145,114,196,195, 16, 0, 0, 1, 44, 73,181,128, 4,182,214, 7,108, 96,193, 42, 89, 72, 66,114, 71, -100,165, 36,149, 99,176, 0,119, 58,237,167,177,211,217,215, 3,138,221,197,169,239, 54,241,210, 85, 43,135, 45,155,171,194, 77, -122,148,248, 83,108,110,166,227, 37, 13, 84,169, 27, 94,149,140, 21,219,145, 99, 42, 44,251,145, 77,156,169,135,162, 82,185,144, -185,207, 4,246, 39,129,175,163,187,181, 22, 69, 46,141,184, 92,116,214,164,223, 87,121,101,186,140,141,132,177,171,110,211,108, - 90, 17, 41, 14, 34,153,125,223, 20,181,162,117,229, 60, 3,201, 42, 45, 53,216, 84,224,161,200,151,229, 4,149, 43,177, 76, 91, - 27,113,181,244, 24,150, 14,210, 88, 54,166,216,237,189,188,185, 31, 81,216,214, 37, 26, 21, 6,221,166, 25,110,243, 75,144,204, - 24,141,132,174,107,238,225,201, 18, 29, 43,126, 67,129, 42,121,215, 23,130, 27,243, 44,205,164,167, 43, 26, 24,161, 39,118, 99, -165,220,118, 10,191,105, 84,157,152,182,150,181,202,117, 86, 19,158, 18,240,238,182,106,218, 90,236,242, 5,138,150, 59, 56,166, - 62,103,145,133,180, 9, 71,217, 84,185, 12,200, 75, 22,182,135, 80, 11, 12,100, 74,154,169,242,176,132, 54,203,109, 54,195, 44, - 71,140,203, 81,226, 70,137, 29,164,179, 10, 4, 72,236,165, 45,195,134,212,102, 91, 75,109,182,148,182,219, 76,161, 8, 74, 80, - 18,144,232, 90,112, 2,249, 93,117, 25, 66,146,209, 71, 66, 22,162,163,134,241,211,245,150,177,159,152, 58,106,104,113, 92, 82, -188, 39, 22, 57,159,117,107,144,172,114,134,208,144, 20,235, 77,249,242, 37, 62, 27, 96,249,156,159,144,217, 59, 62,158, 23, 33, -162,160,146, 26, 67, 60,168,236,129, 33,209,134,130,134, 48, 2, 26, 35, 31, 51,211, 77,180, 46,116, 52,199,224, 54,176, 30,128, - 14,214, 29,134,219,219, 98, 14, 47,113, 78, 21, 72, 3, 87,123,254,238,135,222,126,240, 59, 91, 14,157, 22,158, 26,105,164,172, - 5,168, 4,243,159,213,231,121,125,145,208, 99, 30, 93, 60,129,211,139, 26, 35,109, 54, 49,133, 17,220, 16, 79, 83,232, 60,250, -246, 31,187, 86,138,100, 68,165, 73, 8,229, 81,142, 64, 42, 86,112,183, 22,144, 21,130, 15, 85, 36, 19,242, 28,218,203,218, 78, - 49,240,169, 41, 70, 66, 74,122,165, 68,142,170,207,160, 57, 72,251,254, 88,216, 14, 90,230,251, 15,244,249,254,125, 48,211, 87, -166, 54,210, 5,205,133,251,123,192,239,235,247, 3,211, 99,142, 83,123,105,234,144, 40, 62,204, 78, 45,213, 56,172, 10,158,223, -193,161, 68,109,166,214,234,222,168,213,110,106, 44,120, 49,210,219,105,230, 42, 83,161,103,253,144,131,228, 53,249,148, 74,163, - 86, 33,178, 31,157, 73,168, 68, 97, 73, 37, 15, 75,136,244,102,150,130,114, 10, 29,117,176,149,119,242, 39, 7,166,117,250,228, -239, 21, 54,139,113, 81,162, 91, 21,234, 77, 58,187, 2,167, 53,185, 83, 41, 53,168, 81, 42,144, 36, 71,167, 16,227,102, 68, 9, -141, 45,167,146, 37,173,178,146,164,171, 5, 25,232, 70,154, 39,182,131,105, 43,148,145, 68,173,237, 86,217, 86,168,230, 58,226, -138, 93, 86,195,181,102,211,147, 24,131,204,194, 99,191, 75, 41,109,188, 19,219,175, 94,132, 30,186,205, 29,108,244,181, 21, 13, - 12,113,200,178,104, 7, 83, 48, 55, 91,237,178,176,177,213,114,119, 55,218,198,215,196, 43,137,120, 6,163,136,230,167,205,151, - 49, 90, 53, 72, 22, 32,134, 2,250,180,203, 43,106, 45,205, 75, 41, 46, 64,178,159,179,125,239,183,228,250,227,101, 60,188,224, -140,142,128,244,207,144,199,168,198, 48,126,122, 21,192, 0, 3,155, 35, 57,233,215,215,166,191, 65, 78, 47,125,129,220, 19,241, - 21, 2,167, 90,218,170, 35,252, 48,110, 99,233,144,252, 74,205,131, 29,202,134,222,212,103,172, 18,132, 92, 59,119, 53,242,134, - 99, 45,220,115, 59, 76,122, 43,169, 25, 41,109, 88,229, 48,230,227,131,217,183,196,255, 0, 1,119, 35,112,119,146,205, 19,108, - 74,180,247, 33,217,251,193,104,151,171, 59,105,118,144,165,248, 44, 49, 88, 13, 5,219,245,162,132,229, 84,234,138, 35,202, 73, -200,108, 58,145,204,100,244,217,164, 82,178,199, 50, 26,105, 9, 0, 92,221, 24,250, 43,250,158,193,130,177,236,164, 11,226,164, -206,184, 91, 56,200, 65,146,174, 1, 45, 32,219,159, 17, 47, 24,222,195, 93,194,188,123,216, 93,212, 33, 36, 42,187, 28,115,229, -210,158,163,169, 24, 62, 96,119,253,255, 0,215,160,212, 66,187,167, 24,232, 58,249,116,198, 49,219,174,141,117, 3,152,133,229, - 39, 56, 41,199, 80,122,227, 65,120, 97,165,169, 73,201, 43,238, 14, 79, 41,235,146, 61, 52,244, 14,192, 1,182, 35,160, 31, 92, - 14,231, 32, 73, 74,186,231,203, 24,251,137,244,208,101, 3,148, 32, 40,165, 57,236, 60,201,209,133, 63, 26,186,168,231,201, 71, -225, 29,187,121, 13, 81, 86, 50,122, 16,115,246, 12,124,177,163,142,222,236,103, 3, 40, 3,211, 29,186, 30,189,241,215, 57,208, -203, 24, 36, 15, 67,140,252,199,207,203, 69, 47,208,103,166,115,229,147,129,215, 62,186, 25, 64,244,230, 29,124,143,175,113,215, -212,233, 85,189,129,245,235,243,240,198, 69,172,126,125, 48, 42,129,193, 30,127,147,161, 85,246,156, 17,215,204, 2, 8,199,217, -162,148, 58,146, 20,122,103,207,167,159, 83,161, 92, 42,235,233,230, 71,159, 95,232,210,139,215,173,176,170,143, 95,157,176, 50, -206, 15, 76, 31, 80, 71,224,126,220,104, 85,168,227, 28,189,125, 61,126,206,154, 37,100,103, 3,200,156,244,243,249,232,117,227, - 57,235,233,242,251,180,182, 50,126, 54, 56, 25, 99,175,159, 81,231,229,242,210,215,178,172,119,200,244,198, 14,127, 31, 61, 45, - 40, 47, 97,229,191,200,255, 0, 79,155,224,126, 56,162,144, 64, 30,191,143,158,170,163, 62,125,137,232,115,220,250,106,159,236, -213, 69, 35,156,131,204, 71,166, 63, 63,156,233, 54,219,160,220, 99, 35,227,108, 20,131,208, 14,228,121, 99,231,251,116, 80, 56, - 35,184,249,250,104, 22, 57,146, 8, 81,234, 59, 31, 80, 60,243,247,232,209,216,117,207,207, 68,223, 77,200,244,254, 88, 24, 45, - 24,207, 92,231,203, 69, 35,207,183,239,208,173,124,207, 92,126,127,118,138, 64,232, 79,221,249,252,249,105, 44, 16,142,190,251, - 15,145,130, 80, 58,103,215,250,244, 66, 49,140,129,215,212,247,207,245,106,146, 48, 57, 79,150, 7,252,116, 64,193,232, 49,223, - 31, 97,210, 44, 79, 91,236,127,211,253, 48,153,183, 97,138,128, 40, 5,103,208,224,119,235,169,123,123, 41,104,112,173, 78, 2, -173,121, 73,134,167,220,191,111,139,158,183, 80,116, 97, 14, 1, 26, 65,131, 29, 41,199,146, 91,142, 0, 58,136,106, 65,193, 4, -140,224,156,227,211,175, 77, 75,111,217,163,113,199,172,240, 9,183,233,105,231,146,187, 86,241,187, 45,249,133,131,143, 9,213, - 78,114, 75, 97,196,121, 2,219,168, 32,158,224,244,213,121,226, 65,147,244, 28, 33, 13,148,206,186,191,254, 57, 45,142,131,250, - 49, 71, 12,158, 42,209,137,118,101,162,169, 41,214,225,249,148,226,226,196, 27,233, 45,211,181,251, 99,118,128, 83,114,214,210, -153,146,220,116,144,235,125, 10,212,129,205,144, 20,161,156,249,105,224,180,100,161, 50, 35, 25,130, 74, 80, 57, 85,206, 20,176, - 26,230,198, 22,164, 30,253,198,153, 40,181, 49,238,232, 92,122,195, 47, 73, 82,210,211, 81,100, 39,149,110,184,178, 82,218, 1, - 61,252,180,248,219,242,107, 80,222,162, 71,155, 77, 98,169, 61,192,124,102, 35, 56,130, 91,108,254,170, 94, 72,254,110, 58,245, -215, 54,213, 70,193,217,152,217,148,130,111,182,219,117,233,112,127, 28,123, 9,151,215,172, 84,113,194,236,164,181,215,237,232, -114,116,222,246,144, 11,142,228,222,194,248,216, 58, 84,210,135, 89,145,227, 49, 81,108,184, 26, 12,189,132,132,180,123, 21,146, - 58,249,103, 78, 29, 49,216,145,157, 46,202,141, 0, 50,165, 99,153,162,151, 0, 10,255, 0, 80, 14,216,207, 93, 55, 22,253, 58, -116,249, 14,180,186, 68,194,162,227,110, 41, 40,100, 22,154, 72,236,208, 41,238, 63,167, 78,237, 50,222,105,197, 50,210,160,203, - 5, 43,248,209,238,139, 82, 16,172,254,170, 84, 6, 15, 64,123,246,209, 97,137,100, 58,121,100, 21, 38,219,129,125,253,251,159, -203,124, 66, 51,202,138, 53, 13,169,202,221,119, 10,203,112,189, 71,216, 96, 1, 27,139,233,177,239,124, 60, 54,123, 86,252,196, -161, 45,162, 50,155,229, 7,170, 74, 10,129,238, 6, 71,112,116,252,211,104,240,209, 29, 41,140,174, 68, 20,228, 53,207,204,217, - 24,234, 19,232,174,250,105,109, 74, 83,112,209, 24, 57, 24, 70, 14, 44, 8,200,152, 24,136,167,206,112,124, 36,200, 90, 75,189, - 71,243,115,233,167,174,148,195,204, 73,247,101,182,182, 20,172, 18,219,237, 41, 33, 67,200,161, 67,203,168,237,167,136,114,230, -101,187, 11,252, 13,192,191, 66,125,255, 0,150, 57,147,139,234,195, 84,202, 96,169,114,138, 75, 0,206, 26,224,108, 77,134,219, -119, 54,216,237,113,131,109,233, 2,149, 48,165, 68,165, 30, 38, 65, 7,177,206, 58, 19,172, 11,142,250,104,187,248, 72,189,156, -100,243,201,160,212,173,234,211, 33, 37, 75, 0, 55, 52,196,120,156,116, 8,228,153,212,158,131, 26,214,142, 52, 56,200,162,240, -178,104,182,149, 18,205,170,110, 30,239, 93,144, 68,251,106,214,167,179, 37,200,145,162, 56,240,138,204,250,159,186, 52,167, 29, - 74,229, 97, 13,180,210, 74,150, 65,201, 72, 25,215, 24,110,255, 0,109,214,236, 89,181,169,123, 63,196,206,212,209,225,216,219, -139, 33, 54,133,121,152,140,200,163, 86,236,207,172, 95, 67, 44,213, 92, 50, 29, 90, 28,247, 39,220,142,243,241,228,161, 37,109, - 48,160, 22,133, 16,160,237,150,210, 77, 74, 30, 57, 24, 4,148, 29, 42, 55,123,122,233, 0,155, 3,252,176,190, 77,224,151, 30, -113,173, 21, 7, 27,228,116, 52,241,195,151,149,172,136, 84,213,193, 77, 53, 92, 16, 72,162, 73, 41,163,149,129,100, 44, 12,107, - 36,134, 56,222, 75, 34,185, 39, 28,240,171, 81, 92, 18,235, 15,189, 50, 83, 15,182,251,205,242,193, 1,135, 11,172,188,227,129, -215, 90,116, 41, 15,167,152, 55,128,160,127, 87,190,113,171,197,186,251, 84,199, 27,110,231, 91, 11, 8,109,105,102,164,211,204, -152, 75, 4,120,205, 50,166, 93, 67,142, 51, 33,194, 84,147,146,190, 85, 0, 82,178, 59,103,187,207, 96, 84,168,155,135, 92,164, -148,251,168,139, 80,118, 74,101, 49,206,195,115, 26, 83,165,196,200, 97,164,164,165, 44,172,160, 41, 39, 56, 83,110, 36,144, 0, -213, 45,183,165,251,180,225, 57,214, 41,211,231, 46, 59,134, 32,155, 57,137, 75, 47, 56,165, 48,251,207, 7, 20,216, 97,211,207, - 28, 22,210,121,212,147,204,148,242,228,105,122,137, 21, 98, 46,198,247, 22, 0, 1,112,118, 0, 3,218,222,150,216,220,157,247, -199, 91,101, 89,173, 61, 78, 87, 77, 84, 36, 38, 42,136, 21,215, 65,180,182, 96, 28, 89,154,203,123,157,181, 30,246, 5,126,214, - 30, 11, 94,207,114,229,117,201,237, 69,164,202,120,197,143, 54, 85, 82,157, 37,183,147, 22, 59,235,108, 65,134,165, 70,194,224, - 61,226, 33, 45,144,231, 55, 47,196,226,209,149,116,219,107, 39,110,107,207,161,154, 43, 53, 69,192,105,220, 59, 45, 51,224, 51, - 86, 64,151,226,135,152,104,200, 64, 67,211, 90, 7, 24, 74, 94, 41,111, 9,230, 0,233,156,176,182,201, 77,169, 18,170,137,115, -223, 42,193,152,112, 99, 91,243,158,143, 35,199, 74,144,226, 36, 74,147, 13,192,137,144, 80,224, 4,151, 2,137, 82,194, 64, 37, - 56, 27,217,102, 90,215,133, 41, 49, 27,133, 84, 98,165, 57,224,159,142,189, 5,146, 26,113, 35,153,236,152,138,109, 46,169, 69, - 25, 87,137,133,140,117, 36, 18, 53, 10,175,145,203, 5,138, 80,109,208, 48, 59, 17, 96, 8,190,160,123,246, 0,108, 20, 27, 91, - 12, 57,247, 17, 10,106,116,134,130,190,154, 78, 89, 80,156,196, 87, 1,193, 91, 30, 97, 18,163,152,205,238,197, 65, 6,218, 88, - 22,108, 90,237,237,189,152,234,185, 95,164, 89,245,210,228,149, 56,245, 82,107, 53, 74,100,246, 35, 52,164,165,243, 25, 77,135, -115,204,242, 70,121, 29, 74,177,211,148, 96, 43, 79, 29,187, 98, 95,172, 58,106, 17,164, 80, 67, 45, 56, 12, 74,109, 70,100,217, -240, 85, 24,171,153, 44, 69,113,113, 82,236, 53, 20, 4,149, 21, 41, 69, 5, 39, 41, 86, 6,179,123,118,157, 92,141, 29, 16,156, -183,161,203,117,169, 45, 41, 85, 8,181, 70, 27,109, 47,173,212,248,236, 71,106, 84, 99,132,175, 36, 36,133,242,100,225, 68, 4, -141, 58,241, 37,169, 36,181, 81,162,206,163,163,196, 75,109,173,245,177, 34, 3, 69, 39,152,189,239,177, 10,146,225, 89, 79,232, -208,128, 73,194,129, 72, 61,117,169, 79, 70,103, 39,152, 2,179,118,234, 61,230,215,211,210,196,129, 98, 64, 29,141,241, 79,103, -220,101,153, 30,114, 70,144, 85, 43, 2, 13,228, 73, 14,130, 64, 58, 33,230, 2,133,252,192,233,140, 21,185, 0,130, 72,108,110, -143, 14,191, 8,188, 39,209, 80,234, 30, 65,115,252, 6,171, 17,212, 71, 73, 7,149, 40, 68,198,155,113,192, 74, 65, 61,137, 39, -175,124,235,131,126,216,205,247,152,111,141,190,225,194,146,243,176,233,118,141, 10,155,186,215,228, 17, 33,165,138,133,245,119, - 54,244,107, 38, 20,208,210,212, 86,213, 50,201, 6, 83, 77, 44,254,130, 77,220,242,193, 10, 9, 34, 68, 98,167, 69,113,239,115, - 98,162,209,150,227,169,100,164, 50,250, 30,142,153, 10, 67,104, 47,161,113,185,149,250,217,193,234, 7,124,117, 58,132,167,180, - 11,114,157,191, 56,207,226,110,235, 91,220,193,123,191,119, 82,161,167, 35, 13,210,109, 57,205,218, 52,134, 80,174, 65,250, 54, -233,246,252,102,210, 48, 48,150,250,247, 58,147, 81,229,101, 16,136,212, 49,107,111,110,151,247,223,215,107,145,238, 29,206, 45, - 63,161,246, 88,153,247,139,149,156, 79,155,208, 8,233,184, 47, 46,150,174, 32,203, 38,147, 89, 80,241, 82,211,189,164,119, 95, - 36, 18,213,200,157, 74, 75, 28,114, 11, 50,130, 59,157,236,172,221, 24,215,231, 13, 23, 37,147, 81,118, 25,168,236,189,253, 46, -152,218, 93,144,151,101, 53,102,223,141,191,116, 91,190, 19,107, 28,209, 97, 71,172, 69,186,152, 65,253, 80,165, 4,167, 7, 26, -218,107,158,228,161,191, 61,218,125, 49, 94,245, 40,172, 37,210,202,148, 67, 42, 11,229, 81,117,224, 57, 60,114, 15, 92, 2,160, -149, 14,100,228,234, 49,124, 2,239,229, 79,110, 55,233,155, 77,234,234,233,116, 45,237,130,141,181,173,200,114, 66, 99, 70,106, -181, 46,104,159, 98, 79,117,194,147,225, 52,221,203, 17,152,171,112, 17,134,171,110,142, 96, 9,204,138,108,186, 50,226,248, 65, -230, 94, 18,210,234,138,218,116, 40, 56,144,201,253, 42,228, 2,144, 82,232,125, 39,155,155,185, 24,199,163, 70,113, 75, 61, 53, - 66,211, 24,192,102, 80,250,173,177, 4,158,128,236,109,107, 27,244,244, 55,216,120,245,195,212, 92, 51,226,119, 20,241, 60, 83, - 51,208,241, 68,223,164, 41, 96, 4,170, 44,179, 42,251,111, 53,134,197,189,176, 77, 41,141,108,170,146,160, 98, 5,181, 97, 28, - 75,220,181, 26, 38,200,211,104,247, 69, 74,235,183,182,170,177,190,251, 65, 11,117,110,107, 14,159, 10,179,117, 91,182, 75,207, -220, 78,183, 82,133, 14,168, 4, 79,171,216,186,153,183, 21, 41, 82,210, 98, 36, 41, 9,115, 46,170, 58, 78,196,185,236,244,224, -218,187,107, 59,115,220,156, 71,239,126,228,237,173, 2,138,187,170,107, 84,230, 45, 75, 86, 5,193, 65,109,135,229, 52,252, 91, -142,223,106, 82,213, 70,114, 67,192,198,106, 35, 40,154,243,242, 91,140,151, 91,112,244,112,233,245, 17, 14, 44,120,174, 52,203, -140, 76,104,179, 45,183, 16,135, 25,122, 52,130,142,120,210,155,117, 36, 60,203,137, 64, 5,181,165, 73, 88, 7, 57,232, 53,131, -111, 20,122,181,183,183, 23,101,181,105,248, 52,138, 5, 74, 76, 74,251,148,250,116, 97, 1, 16,222,167, 60,106, 47, 70,165, 53, - 21, 77,181, 6,159, 41,244,182,244,150, 67,100, 56,236,116,184, 10, 10,220, 42, 89, 95, 56,135, 46,142, 10, 39,138, 88, 81,180, -202, 38, 14, 74,164,134,226, 72,138, 50,168,146, 61,200, 73, 86, 72,223,161, 85,177,213, 91,112,255, 0,139,220, 97, 77, 6, 89, -195,156, 53,196, 21, 60, 22,207,152, 77, 60,242,208,138, 52, 21, 75, 82,148,144,150,121, 38,162,154,174,158,178, 4,129,185,117, - 52,245, 41,169, 36, 80, 81, 94, 4,118, 96,232,187,243,188, 52, 58, 53,183, 22,179,113, 84,169, 53,196, 81,160,251,245, 41,201, - 62,244,245, 37, 30, 24, 17,105,181, 9, 10,121,208,245, 77,152, 9,140,153, 37,110, 58,225,146,151,148,235,139,112, 41,106,217, -189,151,227, 46,253,131,118,219,180,250,252,122,125,201, 79,118,165, 17,114,150,164, 24,178,216,166,197,117, 15,212, 36, 41,109, -252, 46,145, 13,149,146, 84,156, 16,146,163,211, 58,229, 18,107,239, 62,242,147, 37,199, 31, 91,206,242,186,241,117,192,165, 58, -115,211, 39,155,149,210,121, 78, 15,117, 43,161,198,175,245,237,208,133,180,123, 77,185, 27,181, 83,195,175,211, 41, 12,109,245, -155, 17,197,165, 15, 85, 55, 47,117, 95, 93,149,109, 82, 48,149,164,169,198,162, 73,174, 84, 86, 89,234,134,109,247, 20,190, 92, -115, 20, 34,161,174,138,166, 35, 73, 52,177, 73, 35, 11, 42,177, 35,177,251, 38,224,129,110,227,176,216, 3,139, 63, 49,225,124, -159, 58,137,168,171, 50,122, 67, 83,155,200,176,199,104,150, 37, 89,170,228, 17, 68, 21,129,214,136, 36,145, 64, 37,137, 84, 80, - 88,147,124,113, 55,116,247, 70, 69,253,187,251,165,124,248,206, 6,183, 3,113, 47,219,205,230,124,103, 29,108, 53,115, 87, 43, - 21, 40,234, 47,172,146,232, 75, 18, 90, 9, 39, 39, 13, 39, 9,232, 14,172, 14,214,153,120, 48,183, 78, 92,152, 57,157, 10, 37, - 43,109,167, 26, 13,184,150,207, 80,131,206,176,172, 30,169, 9, 5, 24, 32,105,155,145, 77,159, 79,177, 55,214,248,122, 99,102, - 14,214,238, 37, 54,195,167, 33,244, 45,181,207,144,221, 5,213,204, 44, 21, 16,151,138, 88,241,164,244, 32,167,198, 64, 82, 64, - 41,200, 53, 27,141, 40,118,147, 76, 15, 45,169, 62, 12, 25,243, 2, 86, 20,234, 16,197, 62, 19, 65,165,164,117,229,247,167,138, - 73, 61, 22,177,202, 7, 66, 69,171, 7, 12,211, 48,141, 68, 97,196, 42, 34,118,176,243,125, 68, 82, 27,237,230, 26,101, 64, 77, -183, 59, 94,221,125, 38,200,188, 76,203,114,202, 54,165,142, 67, 20,116, 65, 22, 8,217,183, 68, 90,250,204,182, 21, 7,236,171, - 60,153,116,228, 2, 70,148, 58,202,134,186, 15,209, 95,217,213,187,149,126, 36, 56, 44,216,253,206,187,174, 26,157,110,227,126, -218,126,193,186,149,240,199, 84,155,163,109, 39,191,101, 84, 39,204,125,144, 23, 80,149, 50,149, 75,163, 76,121,231, 85,202,227, -245, 23,148, 15, 58,213,173,192,169,181, 57,184,233, 69, 62, 75, 17,217,117,148, 54, 25,157, 8, 41, 77,184, 20, 57, 18, 85, 21, -196, 40, 55,148, 36,167, 33,106,235,158,185, 26,226,103,176,146,232,171, 73,224,105,202, 90,107, 52,248, 49, 97,111,182,232,183, - 25,185,145,221,148,239,233,169,118, 36,151, 91, 74,223,144,136,236, 44, 74, 46, 41, 40,108,169, 68,173,101, 73,230, 86,187, 41, - 49,154,218,209,205, 42,173, 52, 52,180,165, 74, 68, 70, 98, 69,116,182, 9, 42, 83, 15,150, 84, 82,172,173, 43,228, 0,100, 3, -231,140,166,170, 86,154, 21,107,179,160, 10, 88,238,110,160,139,147,114, 77,254, 59,238,122,227,195,207, 25,248,114,151,135,188, -100,241, 27, 44,203,158, 10, 60,158,155, 59,204, 26,142,156, 69,166, 56,105,158,169,228,130, 24,163, 88,121, 65, 97,137,146, 53, - 32,147,100, 5,141,201,182, 5, 94, 69,230, 10, 94,145, 46,158,251, 79, 45,104,148,212, 6, 23, 14, 74,219,229, 12, 45,182, 36, - 58,225, 37,149, 97, 25,231, 83,121, 7,151,152,115,103, 88,171,145,168,116,244,134, 97,194,115,222,240,219,142,210,234,106,145, - 26, 99, 65,211,209,246,222,146, 74,159,116, 16, 64, 41,113, 93,130, 80,224, 61, 53,146,220, 18, 42,169, 71,189, 65,175, 23,224, - 43,196,110,100,138,180, 52, 73,141, 20,132,150,219,121,201, 49,146,211,140, 32,184, 66, 20, 84, 8, 65, 74, 73,198,117,138, 87, - 28,148,234,162, 34,187, 74,117,192,134,195,141, 85,221,124,204,165, 74, 66, 64, 8,106, 33,105, 1,113,212,225, 81, 86, 31, 66, - 49,205,221, 67, 11,214,189,142,171, 48,185,237,109,186,218,221,251, 94,219,220,117, 0,118,198,190, 89,205,228, 83,161,104,226, -136,234,212,180,224,194,199, 64, 4, 7,140,136,249,140,128,157,144,137, 21, 72,107,233, 54, 57, 45, 21,111, 50,239,128,212,167, -155,106, 99,237, 53, 50, 5, 82, 58,170,112,130, 22,133,248,114,226,201, 82, 20, 84,194, 84,162, 75, 79,133, 20,150,202,144,180, -144, 70,158,219, 70,151, 29,231,155,118, 60,104,204, 22, 63,193,222,142,151, 20,169, 10,146,203,194, 58,208,195,190, 63,232,220, - 83,255, 0, 26, 27, 64, 12,165, 9, 10,230, 9, 32,105,148,162, 91,141, 33,248, 83, 89,126, 99, 48,230,182, 20,180,198,150,244, -129, 79,113, 60,188,170,101,153,170,115,222, 32,173, 37, 93,149,240, 99,149,124,169, 9, 89,109,184,249,226, 98, 31, 5,220, 21, -239,191, 17, 15,200,136,155,150,213,178,166,210,246,246, 59, 73,141, 4, 86, 55, 54,239,228,181,236, 42, 83, 8, 90,185, 31,124, -220, 21, 40,178,202, 18,149,144,213, 45,220,101, 41, 86,157,232,209,181,169, 10,100,111, 40, 23, 59,177, 54,181,129, 23, 4,146, - 58, 1,212,220, 92, 98, 11,198,117,212,212,212,243, 58,213, 20, 77, 12,210, 54,146, 52,132, 30,109, 96, 29,244,170,155,187, 57, - 42, 0, 96,197, 77,204, 4,253,172,219,203, 47,139, 95,105,175, 18,183,101,176,204,138,245, 61,141,200,141,179, 22, 18, 41, 9, - 93, 86, 93,102,147,182,162, 46,222,210,152,166, 51, 24, 19, 62,108,219,142, 29, 80,176,134,211,151, 87, 57, 0, 2, 78, 76,168, -189,147, 30,205, 59,119,129,141,189,137,185,219,145, 71,167,212,120,177,191,168, 72,110,225,150,239,131, 57,157,155,182, 42,104, -109,241,183, 54,188,132,130,150,171,238,183,225,154,253, 69,162, 22,251,224,192,105, 98, 36,114, 29,230,127,176,159,128, 53, 76, -144,190, 60,247,198,152,229, 94,166,106,149, 39, 54, 34, 21,106, 58, 84, 43, 87,116,135,159, 77,209,188,211,162, 60,140, 58,227, - 18,159,150,197, 29,103, 9, 19, 37, 74,154,140,150,153, 34, 80,232,121,231, 86, 94,194,151,206, 84,165,229, 89, 83,132,156,149, -100,255, 0, 59,169,238,117, 52,214,174,144,192, 15,246,106, 75, 42,129,210, 73, 19,102,115,254, 20, 96,116, 95,171,221,172, 52, -163, 53, 11,192,252, 48,106,170,102,226,204,206, 29, 53, 57,147,188,180,145, 48,254,234, 41, 9,101,148,237, 96,238,166,209,126, -196, 86, 97,188,158, 91,213,199, 90, 49,104, 79,128,238, 30,144,121, 9, 61,192,192,201, 10,245,242,251,181,174, 71,196,148,241, -192, 74,219,247,143, 25,101,101, 88, 83,109,158,100, 32,143,231,159, 20,183,140,231,245,116,231,222,179, 3,236,178,194, 18,160, -158, 67,240,159,214,231, 63, 8,200,245,230, 7,246,107, 16,183,233,171,125,220,148, 41, 94, 26,193, 82, 72, 56, 30, 24, 42, 25, - 7,182, 93, 82,127,254,159,144,211, 69, 97,106,138,152,227, 83,176,254, 38,222,238,150,252, 15, 81,139, 78, 53, 68, 46, 72,176, - 83,107,124, 58,253,247,191,243,198,113,108,211, 19,227,169,194,215, 63,134,203, 99, 5, 93, 27,101,146, 22,246, 14, 62, 37, 45, -242, 7,255, 0, 71, 91, 55,104, 83,196, 88,200, 91,141, 21, 62,226,125,225,196,142,201,144,233, 1,182,178,161,208, 1,200, 7, -158, 18,112, 52,218,218, 20, 34, 11, 72, 82, 48,167, 29, 66, 86,162, 9, 37,168,227,198,115, 36,249,169,100, 15,158,126,122,216, - 74, 93, 56,165,176,160, 48, 80,160,230, 79, 96,234,193,228, 24,207, 80,150,250,245,243, 58,216,145,194,132,133, 59,122,123,247, -233,252, 61, 58,123,176,171,188,113,197,169,205,134,223,126,214, 23,251,250,216,250, 19,223, 23,184, 45, 45, 45,164,250,130,146, - 81,130,165, 58, 79,198,161,205,211,205, 71, 39, 29,135,217,171,242, 82,161,202,146, 14, 66, 64, 79, 92, 18,112, 18,132, 16, 7, - 82, 71,151,110,167,174, 79, 64,225, 49,204, 6, 74,148, 8,194, 60,151,142,203, 80, 0,244,206, 50, 62, 95,110,173, 87,197, 93, - 84, 74, 17, 76,101,242,212,170,171, 93, 62,154, 51,254, 77,126, 25, 50,166, 56,148,245, 8,102, 57, 81, 78, 59,184,180, 13, 2, -252,184,139,157,194,142,158,167,111,226,127,215, 17,237, 18, 87, 87, 69, 75, 8, 13, 45, 67,233, 30,130,251,146,127,194,160, 22, -111, 64, 9,233,134, 94,191, 60,214,174, 57,178,155, 80, 92, 88,138,250,178, 34,146, 73, 75,205,197, 89,247,133,181,215,245, 87, - 40,172, 41, 93,185, 91, 30, 93,117,113,101,178,148, 36, 20,167, 60,185, 33, 32,115,124,125,242,123, 32, 17,235,228, 58,103, 58, - 6,155, 5, 49,217, 1, 3, 41, 72, 72, 43, 80,202,251,124, 13,167, 57,231,230, 87,116,142,188,202,202,181,122,119,157,164,242, -182,128, 48,114, 74,210, 29, 82,148,174,231,149, 4, 14,112,122, 96,156, 36, 12,232, 82,130, 20, 22,181,207, 83,241,235,252,127, -134, 38,117,241,198,136,144, 66, 60,145, 40, 65,126,182, 80, 5,205,187,158,167,191,125,177,107,145,209, 56, 56, 42,192, 31, 7, - 50,136, 81, 39,245,114, 6,113,145,215,212,143, 62,186,109,183, 18,195,178,183, 58,203,185,118,235,114, 45, 74, 13,245, 98, 93, -244,185, 20,123,178,204,185,224,179, 84,161,215, 41,210,208, 90, 83, 50,227,188,143,209,202, 66, 15, 51, 50, 26, 45,202,140,234, - 80,244,119, 91, 90, 65, 46, 20,133,132,149, 18,121, 66, 82,146,158,167,227, 3, 9, 11,231,233,205,133, 28,116,233,240,231,231, -171, 4,167,130,146, 70,115,130, 7, 41,230, 1,190, 97,133,140,168,119,230, 25, 87, 47,167, 66,115,128,228,164, 50,233, 32, 21, - 35,161, 23, 7,226, 15, 81,234, 45,238,196, 78,170, 0,218,129, 93, 72,247, 12, 8, 22, 32,141,193, 7, 98, 10,220, 16,110, 45, -112,118,216,254,127, 62,215,111,101, 5,107,129, 75,173,157,208,218,223,173, 46,126, 22, 47,170,217,166,219, 21, 73,139,114,161, - 95,218,219,154, 98, 29,148,206,220,223, 83, 66, 63,194, 24, 91, 77,191,245, 45, 81, 88, 76,246, 99,150, 29,196,198,148, 28,226, - 11,202,192,207,250,185,206, 65,252, 7,207,183,227,175,213, 99,121,118,187,111,119,183,109,239,125,163,221, 75,114, 53,215,183, - 27,137, 66,147,110, 93,212, 9, 73, 66,132,168, 18, 70, 89,155, 1,197, 28,211,235,208,230, 33,137,116,249, 72, 41, 92,105,113, -154, 90, 84, 7, 50, 85,249,178,113,225,194, 13,235,193, 55, 17,215,238,197, 93,238,191, 80,167, 82,159, 69,111,111,238,242,201, -110, 45,251,182,117,197,186,245,165,117,196,233,203,239, 75,138,218,226,212, 26, 24, 84,122,141, 58, 75, 74, 74, 64, 71, 51,238, - 85, 86,192,138, 57,152,176,223,150,204,110, 72, 29, 81,137,234,203,216,159, 51, 46,237,118, 86, 99, 65,113,143, 12,174, 75, 50, -215, 81, 41, 25,101, 83,105, 43,215,145, 46,237,160, 27,127,116,226,230, 50,126,201, 86, 67, 97,203,213,166, 30, 57, 89, 86, 50, - 57, 63, 91, 35,175,110,154,250,115,156,144,122,249,254,255, 0,158,190,132, 99,161, 63, 14, 7, 46, 51,204,122,121,244,234,117, -245, 72,229, 29, 50,113,234,114, 6,127,226, 52,254, 46,118,196, 36, 11, 11,116,192,142, 40,231,160, 24, 29,207,175,231,166,135, - 82,137,238, 64,232,124,241,143,179, 68, 44, 19,211, 24,237,156, 99,160,245, 31,126, 52, 50,128,235,212,121,128, 78, 49,215,207, -246,105, 68, 59, 91,211, 6,181,253,109,251,240, 59,128, 1,240,171,174,122,121,121,246,207,159,246,104,101,244,200,243, 35,246, - 1,147,162, 21,140, 28,140,254,113,161,148,112, 8,235,215, 56,237,248,125,154, 85,112,176,189,136, 39, 3,168, 0, 15,145, 62, - 99,204,143, 35,249,242,208,203,229,235,235,211,242,126,225,162, 87,140,117,249,224,122,159,158,135, 88,233,231,247,118,251,254, -237, 44, 58,142,248,193,237,183, 67,243,247, 96, 69, 12, 31,183,175,217,165,175,171,198,113,140,126,255, 0,187,241,210,210,202, - 77,133,197,207,221,131, 99,202,112, 72, 7,242,117, 92, 15, 35,128, 60,190, 67,250,245, 69, 3, 39,236, 25,209, 40,239,246, 15, -207,219,164,143,175,174, 6, 42,164,124, 64, 14,131,166, 15,207,236,243,242,209, 35,215, 56,198, 62,220,124,191, 62,122,164,143, - 51,208,255, 0, 72,235,253, 31,213,170,160,100,227, 56,233,145,243,252,254,237, 17,175,109,186,223, 3, 4,160,140,231, 62, 93, -207, 79, 77, 22,130, 49,143, 63,233,251, 52, 26, 72, 30, 64,143,179,183,217,162, 1, 74,146, 72, 61, 65,252,115,142,159,159, 93, - 35,140, 48,184,235,108, 20,140, 18, 1,239,158,135,203,239,209,169, 7,166, 14, 79,145,253,186, 1,158,132, 17,149, 14,196, 19, -140,124,243,251,180,122, 72, 79, 76,145,211,160,233,147,164, 9, 36,220,225, 54, 29,199,206,216, 33, 4,224,142,153, 29, 85,219, -183,166,164, 73,236,110,220, 31,173,246,111,125,182,170, 68,175, 13,251,106,189, 68,191,169,177,199,196,183, 33, 84,227, 24, 21, - 2,134,250,229, 41,151, 17, 57, 35, 63,229, 6,117, 29,198,252,179,144,122, 1,230, 79,219,211, 93, 44,246, 85,110,228, 13,175, -226,214,210,164,215,229, 24,246,198,234,192,168,237,157, 95,227,228,108, 75,174, 32, 59,111,188,224, 39, 4, 38,172,195,104, 4, -246,247,157, 70,120,186,135,219,242, 26,232,130,234,146, 37,230, 46,215,221, 14,166,255, 0, 32, 97,247,226,198,240,131,136,227, -225, 95, 18, 56, 87, 54,157,180, 83,123, 64,167,148,237, 97, 29, 72, 48,220,223,107, 43,186, 57,255, 0,166,248,146, 36, 30,101, -188, 76,200, 92,160,148,190,196,228, 14, 82,218,114, 10, 92, 8,242, 87, 93,108,205,136,136, 94, 60,105,208,170, 83, 26,151, 9, -191, 29, 82,222, 74,157, 92,231, 64, 7,195, 90, 79, 64,192,244,244, 26,103, 63,131,149,104,117, 26,148, 68,184,195,109, 83,228, -173,134,209, 44, 2,226,202, 22, 82, 16,178, 79,234,114,242,159,179, 79,213,149, 33,113, 88, 77, 61,112, 27,121,229,248,106,149, - 58, 39, 41,101,148, 19,213, 63, 32, 79, 66, 62,237,115, 51,211,150,121, 6,155,219,175, 91,109,181,133,253,226,219,123,241,235, - 75,241, 11, 79, 76,188,137, 11, 48, 93,149, 89,118, 13,107,151, 89, 1,176, 11,212, 3, 98, 79, 75,219, 27, 67,183,181, 74,244, -214,231, 56,229, 74,158,135, 38, 41, 14, 18,160,166,156, 74, 16,156, 36, 32,118, 65, 62,159,191, 89,190,241,113, 11,110,112,191, -176,215,206,245, 95, 6, 20,202, 61,145, 74, 92,138,101, 45, 18,130,100, 92,247, 68,212,150, 40,116, 70,185,198, 84, 94,156,164, -120,132, 3,202,211,110, 40,118,198,137,219,165, 83,139, 76,133, 80, 28, 90,114,210,212,240,109, 10,241, 74, 15, 76,167,253, 94, -159,126,117,202, 47,164, 21, 92,174, 69,225,135,102, 32,209,169,178,160, 90,181,125,216,152,229,206,180, 71, 8,142,167,224, 81, - 11,148,102, 36,173,177,132,143, 17,201, 42, 66, 85,208,148,156,117, 26,113,203,168, 3, 58,157, 54,103, 33,125,118, 36, 94,196, -237,222,227,213,182,195, 70, 89, 79, 69,197, 92, 91,144,112,245,125, 61,168, 43,234, 1,157,252,177,147, 20, 49, 60,207, 26,149, - 58,245, 75, 28, 77, 18,149, 55, 93, 87, 27,139,227,130,123,191,198,175, 16, 27,247,184, 53, 45,208,191,119, 70,231, 85, 90,163, - 41,199,233,180,154, 61,106,117, 46,133,107,211, 84,247, 52, 26, 77, 22,153, 17,228, 34, 20,118, 27, 40, 72, 87, 47, 57, 41, 37, -106, 42, 36,235,167, 28, 15,251,109,119,107, 98,106,116,123, 7,136,169,179,119,107,102, 31,113,136, 72,172, 74, 90,101,223,214, - 83, 75, 33,180, 78,165,212, 93, 60,213,120,109,143,137,113,159, 82,138,146,217, 13,173, 11,198,163,142,186,235,108,188,164,169, -213,165,121, 56, 0,143,231, 19,148, 16, 58,242,145,159, 46,186, 6,109,204,220, 84,151,229, 73, 75, 76,165, 69, 13,186,181,124, - 13,149,252, 65,167, 20,122, 32, 43,175, 41, 61, 51,208, 28,156, 25, 60, 92, 63, 80, 37, 67, 1, 49, 19,208,129,189,141,182,255, - 0, 21,246,184, 55, 7,184, 56,236,142, 32,151,195,140,255, 0,133,223,133,248,147,134,104, 42, 50, 10, 88,196,113,162,172,112, -123, 24, 69,210,178, 83, 74,129,100,164,145, 7,247,111, 27, 39, 75, 54,164, 44,167,244, 98,220,125,244,218,109,207,181, 44, 93, -211,218,219,134,218,187, 42, 87, 53, 36, 51, 69,220, 10, 51, 17,100, 76, 69,191, 35,149,215, 40, 82,159,113, 5,234, 52,228, 57, -209,198, 86, 27,121,151, 16,161,243, 44, 38,219,240, 59,195,109,247,187, 50,119,219,118,236,200,251,153,118, 75,170, 65,173, 67, -182,174,118,154,153,103,210,171, 16,188, 32,197, 90, 69, 61,192, 77,102, 97, 83, 13, 41, 94, 54, 91, 36,117, 74,129, 58,135, 95, - 6,188,107,223,252, 45,110, 43, 52,233, 52,170,149,203, 96,222, 20,101,215, 83,103, 60,250,190,174,187,227,193, 5,199, 38, 91, -143, 44,148,196,174,178,208,123,149, 72,234,165, 37, 41, 87, 50, 84, 70,166, 95,193, 71, 19,251, 57,196,190,221, 82,183, 35,102, -111, 8,119, 37, 13,224,211, 21,170, 59,206,165,155,154,207,170,129,201, 34,143,114, 82,138,185,226,186,219,193, 72, 75,184,240, -221, 9,202, 85,215, 26,134,231,185, 70,123, 75,158, 38,105, 42,145, 71,202, 88,163,146, 50, 90, 29, 18, 16,197, 88, 92,133,119, -146, 38,219,245,140,108,190,102, 70, 11,198, 92, 75,194, 16,120, 95, 13,105,224,204,246,176, 46,111, 21, 85, 20,213, 74,239, 79, - 89,200,142, 74,121, 30,138,165, 99, 8,209,242, 82,106, 70, 89, 32,229,195, 52, 53, 48, 77, 24, 84,168, 68, 26,105,237, 7,217, - 19, 64,220,153,215, 20, 88,210,156,133, 88,145, 38,124, 79,119,101, 69,163, 18,166,128,243,109, 37, 40, 1, 44,161,169, 41,117, -174,100,245, 74, 25, 74, 0, 3, 3, 90, 51, 69,177,226,173,138, 60,234,204,122, 85, 38,221,129, 41, 51,103,211,161,176, 94,110, - 91,208,250,114, 84,204,148,115, 56,210,150,121,194, 65, 70, 22, 18, 73, 35, 82, 72,226, 42,210,160,110,117,160,197,162,168,115, - 29,188,213, 74,168, 86, 45, 9, 77, 65,126, 76, 10,156,120,126, 17,171,208,229, 78,105, 60,176,167,150, 84,151,226,161,194, 60, -101, 71,113,182,200, 89, 26,226, 82, 54,226, 82, 43,245, 56, 55, 19,146,165, 82,168,173,189, 53,234,122,121,219,167,174, 92, 53, - 21,161,215,162,173,172, 60,148, 33, 24, 82, 73, 88,113, 92,185,201,201, 27,117,108,244,241,194, 26, 80, 4,200,175,177, 5,212, -177, 33,144,129,246, 88,144, 74,234,211,113,184,242,225,135,128,248,146,174,159, 42,143, 44,172,115, 72,249,120, 15, 20,146, 35, - 63, 50,152, 72,218, 26, 20, 93,164,179,172,144,173,201, 8,234, 67,105,179, 12, 29,182,244,136,190,236,139,162, 43,211, 44,218, - 8,144,234,232,245, 56, 11, 17,235, 21,134,156,116,152, 20,134, 80,176,164, 56,209, 72, 43,143,200,135, 22,133,101, 74,113, 57, -214,238,237,187,251,130,203, 76, 67,151, 72,167, 84, 98,133,170, 91,213, 42,148,233, 12, 76,138,192, 82,148,219,210, 68,113,202, -170,138,219,193, 89, 73, 67,106, 72, 42, 40,200,248,181,222,133, 7,252, 38, 61, 94,168,236, 48,218, 34,198,106,222,121,215, 12, - 42, 5,177, 73, 72,109,202,131, 44, 54,165, 4,166,172,236,131,241, 5,128, 23,219,155,149, 1, 39,109, 54,169, 47,214,159,141, - 78, 48, 42, 53, 11, 73,106,126, 99,142,173,244,196,145,119,169,196,182,166,100,201, 84,167, 3,137,162,161,194, 72,100, 6,202, -154, 9, 82,143,134, 60, 50,195, 58,115, 25,121,138, 2, 2, 5,250,155,236, 2,134,216,220, 95,168,238, 13,133,186, 73,115,220, -216,213, 80, 74,207, 75, 13, 76, 72,128,234,144,106, 49, 40, 80,161, 99,149, 74, 52,149, 4,141,198,181, 87,112,116,142, 90,187, -151,130,212,169,221, 85,192, 81, 71,162, 69,143, 17,233,177, 66,234,213,121,210, 29,109,249,104, 83,136, 47,211, 99,197,142,149, - 42, 58, 27, 13,132,100,161, 42, 4, 36, 14,234,214,192, 82,168,207, 6,100, 72,146,243,115, 36,115, 37,223,120, 83, 66, 40,134, -150,151,200,182,225, 67,103,224,109,191, 19,152,143,214, 95, 97,205,166,202,221,175,203,122,100, 42,117, 14, 27, 48, 96, 45,217, -109,187, 93,144,132, 73,164,149, 65, 11,113,200,212, 8,170, 80, 21,149,224, 37, 41,120,242, 70, 10, 10, 9, 83,160, 99, 78, 43, -116,232,146, 18,162,237, 86,169, 54, 43, 79, 52,133, 63, 42,172,182,163, 42, 83,190, 32,120,165,166, 16,210, 27, 75, 65, 69,178, - 18,158, 64,162, 82, 50, 81,157,111, 81, 68, 21,129, 8, 22,227,101,189,237,123,109,114, 1,185,236,109,232, 47,107,226,137,226, -141, 77, 41, 30,203, 30, 87, 20,158, 96,168, 26,121,138, 19,111,172,118,118,179, 18,159,221,137, 20, 88,110,150, 85,193, 53, 73, -145,226,170, 46,101,196, 76,164,184, 28,240, 12,134,153, 95, 43, 10, 74,155, 46,181,207,144,121,194, 7, 62, 9, 82,143, 47,108, -234, 4, 62,210, 58, 72,219,158, 58,184,155,183, 37, 40,183, 29,237,225,189,234, 44, 58, 57,127,200,220,181, 35,117,198, 37, 8, - 56,229,118,159, 89, 74,128,242, 87, 67,131,157, 78,142,170,138, 83,209,158, 69, 30, 52, 6,160, 54,228,136,114, 46, 38, 99, 50, -181,206,146,133,248, 78, 67,166, 72,113, 37, 82, 16,149,149, 37,199,134, 91, 66,242, 26, 11, 88, 90,147, 16,207,164, 3,178,234, -161,113, 5,183,251,173, 73,167,134,104, 59,189, 97,210,168, 85, 9, 52,211,200,236, 43,223,109,162, 38,218,168,185, 41,231, 21, -137, 21, 23,168, 70,202,152,128, 87,226, 56, 92, 95,235,114,171, 51, 28,157, 98,150,190, 8,100,110, 92, 83,221, 79,199, 69,239, -185,177,177, 27, 15,128,189,142, 45, 63,163,127, 17,212,112,127, 20,113, 29, 53, 38,185,106,243,156,177,196, 81, 58,133,230,212, - 82, 85, 83, 84, 44,108,169,172,160, 52,166,171, 97,169,163, 3, 91,114,200, 24,226, 4,154,196,244,219,106,220, 88, 18, 36,123, -230,213,238,117, 58,151,184,116,120,110,184,212,168,118,117, 66, 76, 20,196,186,144,180, 43,157,136,145,234, 12,197, 91,146, 81, -132, 70,114, 83, 75, 43, 75,110,100, 74,151,217,207,198,213, 39,137, 54,238, 61,133,221, 10,180, 42,127, 21,123, 72,167,219,169, -193,146,168,241, 90,223,139, 2, 44,118,170, 52, 45,207,178, 66, 74, 81, 80,184, 88,183,166,211,141,199, 76,103,157,106, 33, 53, -232,129,216,210,102,162, 20, 59,161,215,121,234, 81, 43, 84, 91,170,177,103,222,204, 45,171, 98,241,138,155,114,161, 89, 69, 74, -148,180, 59, 78,143, 92,122,151, 17,151, 83,112, 82,132, 69,184,196,200,129,133, 59, 38, 25,125,133,176,243,141,180,149,244, 87, -132,222, 13,248,140,184, 47,203, 39,113,120,121,171,199,191,238, 93,185, 98, 53,251,111, 91,251, 99, 85,166,215,175, 87, 41,240, - 42,241,155,165,214,182,154, 47,191, 41, 91,145,104,211,234, 42, 83, 92,148,103, 83, 85,163,199,117, 84,250,197, 33,136,225, 97, -185,206,113,194,121,109,101, 27, 45,125, 80,163,171, 2, 95, 99, 38, 41,121,134,115,162, 78, 66,144,133, 38,141,138,205,202, 84, -102,150,120,231,139,150,134, 90,104,163,158, 75,196,249,142,105,226,180,212, 89,118, 93,165,163,138,170,138, 74,220,202, 74,236, -184,209, 80,208,200,239, 65, 46, 97, 87, 27,213, 71, 85, 72,252,182,203, 23, 53,133,225,134, 42, 12,195, 41,170,210,211, 69,154, -203, 85,150,205,166,227,165, 61, 6, 5, 54, 97, 74,156, 18,227, 69,110, 35,140,180,165,169,249, 82,156, 67, 13, 71,138,218, 85, -241,185,226,184,218, 91, 31, 9, 82,214, 50,122,244, 11,114,111, 27,114,131,182,251,199, 34,255, 0,136,154, 45,247,176,245, 58, - 22,218,111, 22,216,181, 81,143, 85,184, 45,221,195,188, 89,183,161, 89, 20, 42,100,159,117, 96, 92,148,187,141,187,194,223,118, -133, 84,102, 59,113,170, 72,126, 72,105, 41,114, 12,164, 55, 75, 99,119,122,224,174, 51,245, 7, 19,219, 89,112,112,215,186,220, - 60,220,144,175, 61,215, 77,193,108, 87,174,237,159,151,101,211,226, 77,189, 33,110,173,151, 93,162, 70,144,154,221,142, 81, 76, -164, 63, 80,165, 60,241,153, 77, 68,215, 72,114,100, 8,147, 31,135,146,113, 71,183, 59,103, 34, 92, 13,253,110,235,173,110,165, -205,184,176,173,202,147,143,193,221, 91, 86, 92, 45,209,191,156,186,104, 59,129,181, 86,205,199,245, 20,121, 48,102,109,181,175, -123,214, 32, 86,104, 82, 40,181, 28,208,209, 13, 52, 53,191, 38,135, 86,101,109,214, 19, 84,229,188, 53, 74,207,159,161,161,167, -175,150, 56, 86,121,140,113,211, 67,100, 55, 51,107,101,157, 73,146, 72,180,145, 11, 42,168,147,153,162,197,146,162,201, 56,112, -210,113,141, 46, 79,196, 20,245, 18, 53, 58,173, 84, 67, 46, 95,106,106,245, 73, 41,170, 2,208,207, 24, 52,245, 80, 86, 80, 37, - 72,165,150,158,114, 90,122,170, 9,135,212,151, 87,227, 20,104, 45, 87, 24, 85, 86,218,241, 42,148, 71,110, 43,170,211, 76,212, - 52,150,132,106,245,151,114, 85,109, 11,162,129, 84,104,168,251,149,106,157,112,209, 42,113,229, 48,188, 58,218,227,142,108, 33, - 77,169, 90, 21,237, 94,168,222, 22,133,223,195,254,202, 10, 93, 82, 93,177,180, 43,183,183,154,236,164, 81, 20,153,146, 98,238, -125,229, 73,129, 91,163,213,175,116, 52,191, 22, 53, 66, 29,188,253,173, 71,167, 81, 57, 76,150,133,213, 81,149, 33, 81,220,148, -211, 74,150,182,225,218, 92, 50,112,247,195,165,153, 77,165, 90,219,117, 99, 91,150, 60, 43,174,244,174,223, 49,109, 27,134,228, -218,202,205,255, 0,107,212,149, 18,116,251,243,114,104,207,201,168, 51,121, 72,220, 7,211, 38,169, 13,184,115,170,215,251,244, -217,244, 88,238, 70,155, 37,169, 49,121, 20,212, 93,185,118,222,225, 46,203,225,223, 98,183, 23,120,253,160,252,116, 84, 55,118, -117,213,191, 91,223, 72,247, 69,219,219,105,184, 23,221, 98, 20,254, 44,230,237,204, 42,236,138,109, 42, 84,217,212,251,153,118, - 17,144, 93, 52,138,101,143, 85,175,174, 58,252, 58,125, 67, 79,254, 28, 54, 93,153,214,174,113, 79, 20,121,133, 44, 97,185,112, - 9,150,105,100, 73, 41, 86, 94, 92, 38, 35, 21,167, 43, 81, 29, 57,169,144, 44, 20,142, 37,170,101,154, 49, 70,106,111,238, 14, -168,151,137,248,115,244,207, 19,210,215,101,116,144,212,140,186,131, 48,134,146, 36,164,139, 59,164,121,107,219, 53,204, 26,181, -229,163,139, 38,160,162,201,235, 36,205,169, 85,235,234,125,154,190, 36,140, 9,162,154, 90, 72,169,213, 45,253,208,118,151, 97, - 90, 91,181, 38, 13,167,103, 94,215,213,102,231,174, 55, 49,215, 31,172,238, 77,247, 17,216,119, 14,228, 45, 49,233,233, 9, 77, - 46, 21, 66, 69,159, 70, 41,134,135, 99,193,140,211, 84,180,200,231,102, 82,155, 18,155, 83,131,120, 85,111,219,154, 3, 50,105, -148,169, 19,160,193,160,214,170,113,194,103,214, 98,211,229,168,183, 62,159, 72, 66,178, 89,147, 84, 14,152,173,252, 45,248, 13, - 54,178, 84,149,147,169,133,123, 64,189,146, 86,255, 0, 13,187,109,182,187,145, 64,219,248,219,185, 14,215,178,234,116, 13,218, -222, 42,148,217, 2, 53, 42,184,204, 22,226,237,117,131, 14,206,132,240,114,194,225,222,157, 83, 53,138,149,106,161, 29, 14, 73, -171, 86, 42,171,153, 89,124,169,230,121, 34,177,182, 91, 65,116,111, 46,243,196,218,253,171,247,251,206,183,116,213,106,146,228, -110, 45, 77,182, 89,136,139,118, 28,148,197,186,119, 9, 54,243, 47, 6,109,107, 54,152,143, 26, 45, 38, 35,139,255, 0, 5,141, - 9, 78,190, 85, 41,232,140,170,115, 83, 86,212,245, 25,140, 21,212, 63,162,231,161,141, 36,125, 43,202,166, 45, 35,172,211, 73, - 10, 63,152,169, 40,176, 6,149,220,186,195,120,162,104,238, 34,191,184, 15, 62,224,252,219,132,178,206, 51,225,190, 45, 60, 75, -193,102,174,190, 55,168,174,180,249,164,116,185,109, 52,249, 86, 93, 75,153, 84,195, 32,246,103,141,107, 43,115,158, 82,101,249, - 74,150,205,227,150,183, 49,167,173,118,253, 35, 52,143, 98,189, 5, 54,159,179,243,109, 77,101, 98, 4,221,196,190,119, 71,112, - 90,102,181, 21, 8,139, 91,164,212,174, 88,182,196, 10,140, 85, 56, 18,219,240,220,254, 9,200, 41,115, 33, 74,231, 82,146,146, -218,155, 42,234,187,209, 27,163,184,237, 90, 72,168, 42,130,200,240,165, 64,143, 38, 82,158,160,173, 74, 13, 9, 84,182,157,124, - 46, 93, 57, 73, 90, 10,152, 73, 43,100,172, 41,160,180,115, 32, 49, 27, 9, 77,177,109, 93,139,217,139, 99,111,227, 72,143,183, -214,214,217,218,118,173,163, 6,173,153, 19, 88,131,108,210, 99,208,101, 65,174,135, 83,148,212,157,159, 79,150,244,181, 20,148, -123,204,229, 43,177, 57,114,208,124, 17, 57,202, 83, 14,170, 36, 5,137, 85, 10, 36,185, 75, 84, 55, 96,202, 71, 42,132,120,171, -113,106,241,219,116,146,219,173, 15, 11,186, 85,148,168,114,194,132,136,200,173, 31,158, 54, 80, 65, 3,168, 34,224,129,232, 65, -213,184,220,116, 23,199, 0,113,150,101, 55, 20,241,127, 20,113, 19,235,165, 25,245,125, 85, 67,198,196,108,179, 84,182,152,185, -133,129, 73,145, 89, 34, 14,220,203, 72, 8,103,229,150, 86,247, 81,110, 91, 49,167, 78,161,215, 37,212,219,113,213,165,218, 85, - 69,240,244, 26,132, 54,129, 11, 49,228,181, 29, 46, 66,168,140,245, 75,156,193,124,161,183, 27, 28,201, 86,190, 81,155,125,104, -135, 34, 12,114,220,121, 41, 40, 98,157, 53,228,170, 35,114, 20,230, 86,221, 26, 80,200,167, 40,169,103,158, 59,169, 8,202,112, -128,131,144, 60,211,163, 71,152,183,230, 83,229,191, 4,133,169,153, 76,134,179, 60,198, 89,109,232, 14,212,225, 62, 86,221, 65, - 13,185,148,165,196,101, 78, 32,243, 37,209,130, 19,153,208,146,134, 81, 41, 19, 11, 49,214, 86, 24,121,165,178,165, 69,168, 40, - 31,135, 1, 64,169, 46,149, 41, 36, 40,254,144, 5, 36,146,188,100, 38,134, 48, 25,152,141,172, 46, 77,136,220, 27,250,141,253, -222,226,122,130,193, 89, 80, 41,169,164,139, 72,146, 84, 43,112,200, 85,236, 84, 40, 87, 84, 1, 94,219, 21,144, 93,244,155, 22, - 69,101,209,125,183,168,209, 97,190,250,204, 70,152, 5, 64,200,140,166,150,203,176, 87,241,151, 94,136,160,178,134,218, 89,230, - 82,128,202,114,162,164,100, 2, 53, 28,111,107, 60, 59,251,143, 63,104, 23, 11,126,205,170, 3, 53,106, 46,201,109,173, 53, 27, -255, 0,189,117,166,249,216,137, 90,147, 49, 18,105,172,202, 66,146,174, 71, 98, 81, 45,102,106, 49, 24, 42,193, 53,155,189,229, -160, 5,197, 73,215,123, 47,141,211, 98,142,167,173,155, 89,193, 42,229, 25,106, 76,148,165, 47, 71,180, 91,112, 5,120,181, 23, - 14, 83, 34,182, 58,174, 44, 18,162,180, 43,149,249, 92,173,165, 40,113,184,160,218,118,243, 51,158,189,219,161, 64, 93,228,170, - 58,109,137, 55, 99,177,210,229,194,253,186,103, 61, 86, 93, 46, 69, 85,196,248,174,194, 85, 90, 68,169, 42, 65, 86, 20,243,235, - 89,234,113,167, 76,190, 73, 36,154, 36, 66, 2,174,204,196,216,168, 96, 86,235, 97,187,142,171,113,179, 0, 79, 96, 43, 78, 39, -200,167,207,168, 64,172,169, 48,195, 60,176,243, 35, 59,153,169,213,129,145, 9,184, 40,178,128, 35,189,201,120,217,238, 72, 33, -152, 74, 45,191,110,218, 20, 10, 5,159,104, 82,163, 80,109, 43, 50,145, 78,182,173,138, 20, 36, 37,152,116,202, 37, 38, 58, 33, - 65,136,219,104, 24, 24, 97,176,165, 43,186,214,165, 45, 89, 82,137,214, 66,192, 44, 56, 50, 64, 66,255, 0, 84,246, 74, 22,174, -188,167,230, 79,109,121, 92,114, 87,226,132,243, 5, 16,162,145,156, 45, 62, 69, 56,238,161,231,246,106,239, 2, 58, 29,109,109, -140, 45, 4,158,231,170, 65, 29, 58, 31, 49,251,181, 41, 93,150,200, 52, 42,216, 5,236,161, 64, 0, 1,233,167,107, 95,107, 15, -118, 6,132,133, 20,133,242, 45,129, 0, 88, 1,181,128, 29, 5,187, 14,150,219,160,198, 15, 92,140,185,115,138, 64, 42, 71,192, - 48, 51,148,245, 42, 81, 7,237,199,237,198,179, 75, 74,130,162,174,110, 64,124, 66, 48,124,213,215,155,149, 64,142,249, 35,240, -215,148, 83, 60, 73,124,161, 36,156,132,103,190,121, 71, 64,125,124,254,243,173,128,177,237,177,134,150,166,134, 7, 42,186,224, -143, 44, 12,121, 14,154, 67,202,160,201,111, 49,218,255, 0, 63,127,239,196,120,213, 0, 90,237,117,185, 55,251,239,238,249,252, - 47,182,197,185,224,181,226,148, 36, 57,202,148, 5,148,228,167,152, 5, 58, 79, 79, 76, 14,157,180,226, 8,126,236,203,104,229, - 60,234, 39, 41, 0,168,144,160, 20,178, 64, 31,173,203,129,242,206,178,138, 93, 27,145,148, 5, 35,225, 35, 39, 61,212, 7,196, - 78, 60,251, 1,143, 61,123,145, 19,153, 69, 69, 4, 41,106, 8, 66, 83,212,227, 32, 37, 32,103,190, 59,159, 85,124,134,144,177, -221,137,249,239,127,225,134,106,140,228, 77, 49,141, 79,213,198,127,211,243, 54,237,139, 84,118, 89,109, 14, 61, 41,212, 70,139, - 13,135, 37,204,148,176, 18,212,104,172, 36,184,227,206, 40,246,108, 37, 56,249,146, 7,158,181,250,179, 86,126,239,172,200,171, -165,165, 49, 78,105, 40,133, 70,101,239,129, 48, 41,109,171,225, 88, 0,126,146, 83,234,203,139, 61, 57, 66,130,124,177,167, 30, -243,170, 10,151, 53,173, 13,126, 37, 62, 51,173,185, 94,117, 25,228,155, 49,165, 7, 24,164,151, 19,254, 82, 35, 74, 8, 47, 36, -116, 83,129, 32,146, 1, 26,196,209, 13,152,192,120,189, 72, 36,248,109,160, 56, 2,128, 5, 63,163, 79, 92,103, 3, 39,160,236, - 58,233, 61, 70,161,194,166,241, 70,119, 63,180,195,227,217,127, 22,248, 41,196,175,135,160, 90, 56,228,204, 39, 66,107,106,150, -209, 41, 6,241,194,108, 75, 91, 99,174, 91, 3,191,217,140, 1,191, 54, 69,192, 76, 50, 27,111, 13, 54, 73, 64, 9, 75,139, 82, -155, 0, 43,169, 44,128, 9, 62, 93, 64,193, 61,206,129,152, 95, 41, 82,138,208, 22, 65, 72, 12,164, 32,165, 0, 36,148,163,152, -144,217,234,147,145,223, 36,228, 96, 13, 93,159, 83,174,103,149, 32, 40,182,126, 55, 51,206,132,145,201,240,161, 7, 35, 62, 99, - 32,129,158,249,214, 55, 45,212, 37, 96, 41, 41,120,167,152, 0,148, 0,129,149,167, 39,148,225, 32,224,247, 61, 71,166,116,224, -158, 91,109,185, 27,219,231,253,127,117,240,237, 35,179,146, 77,153,143,253,199,183,115,176,223,225,139, 75,238,163,147,144, 21, - 40, 96,142,116,142,164,165, 71,170,222, 82,187, 31,136, 4,140,243, 1,229,215, 88,252,183, 65, 72, 11, 82, 74,126, 16, 8, 28, -184, 82, 72, 9, 66, 86,188, 18, 18,124,176, 62,100,224,157, 92, 39, 56,224, 82,146, 23,204,162,174, 95, 9, 9, 79, 55, 83,240, - 40,169, 64,252, 33, 36,252, 92,160,245,192,214, 45, 49,208,142,112, 21,241,171,170, 65, 78, 85,128, 50, 82, 74,129,229, 60,160, -143,187,169,234, 53,176,135,175,112, 15,243, 31,187,175,201,195, 45, 82, 13,247,235,252, 62,255, 0,187,182,253,175,139, 84,247, - 82,160,163,130, 9, 39, 36,167,159,175,196, 10,138, 66,176, 19,215,191,145, 57, 25,215, 6, 61,188, 92, 35, 69,226, 19,132,201, - 91,199,110, 82,195,187,161,195, 10,102, 93,241, 28,140,192,126,125,115,105,170, 47, 48,214,226,219,142,184,128, 86,242, 33, 44, -195,173,196, 64,207, 34,224, 76,242,116,235,186,178,222, 24, 37, 41, 81,237,144, 82,160, 20, 48, 84, 0, 3,162,199, 82, 58,245, - 31,127, 70,250,191, 79,164,215, 96, 84, 40, 85,216,173, 79,160,215, 96, 84, 40, 53,232, 14,182,151, 35,203,161,214, 98, 61, 73, -173, 66,121,165,116,117,135,105,115,166, 54, 71,126, 85,224, 28,246,216, 14,203,105, 35, 63, 89, 25, 12,191, 17, 98, 47,238, 61, - 15,184,145,176, 59,197,243, 92,186, 44,214,138,175, 46,156,218, 42,180, 41,114, 7,145,137, 5, 36,183,172,110, 22, 65,210,229, -109,238,199,229,128, 82, 2,137,239,143, 49,212, 31,152,199,126,154,248,172,145,219,166, 51,147,251,191, 13, 61,188, 74,237, 67, -251, 7,196, 22,245,108,212,198, 21, 21, 91,103,185, 87,117,161, 21,133,168,173, 72,164, 83, 42,242, 5, 1, 65, 71,170,194,232, - 46, 83, 92, 10,235,144,230,114,115,146,198,169,106, 88, 4, 43,155,166, 71, 76,119,245, 30,186,153,211,202,179,197, 12,202,124, -178,168, 97,235, 98, 1,254,120,230,119,142, 72,157,226,149,116, 75, 17, 42,227,209,212,233,101,251,152, 17,138, 46, 16, 70, 51, -235,156, 28, 99,251,116, 42,177,142,195,148,103, 30,125,187,147,243,213,117,168, 30,224, 12,142,248,206, 79,217,161, 87,208, 31, - 60,156,126,255, 0,221,173,192, 44, 0,244,192, 29,190, 56, 29, 89,193,233,255, 0, 14,253, 52, 34,142,113,223,207,184, 3,240, -209,107,237,223, 29, 71,231,243,233,161,156, 32, 2, 51,147,231,142,191, 62,154, 85, 7,124, 42, 44,119,192,171, 35,203, 63,126, -113,231,228,117, 69,125,179,147,255, 0, 31, 93, 87, 95, 55,158, 49,229,249,245,208,235,199,207, 62, 94,159,126,149, 2,228, 99, - 29, 0, 3,231,255, 0, 24, 21,103,175,216, 49,159, 93, 45, 37,254,183,221,211, 75, 74,139,128, 0, 31,142, 13,143,168,198, 79, -124,227,238,199, 79,219,162,145,140,118,235,230,113,251,254,205, 8,223, 83,147,145,208,244,251,241,215, 69, 35,177,235,231,219, -247,232,141,107, 47,108, 12, 18,142,199,167,223,235,249,253,250,169,158,221,250,124,254,126, 94,154,164,140,245,233,211,215,247, -124,245,237, 36, 40,144, 15, 99,131,223,161,210, 78, 54,248, 96, 99,223,140,142,249, 24, 0,103, 25,202, 78,139,108,149,129,212, - 0,124,241,215,168,233,211,239,253,154, 16,180, 1, 56, 0, 36,228,159, 79, 44,147,243,254,189, 86,109, 65, 36, 14,184,198, 2, -143,203,212,253,218, 64,155,117,192,193,237, 39,151, 3,175, 66,123,119, 63, 63,144,209, 8, 95, 51,137, 73, 78, 57,115,241, 30, -221, 60,178,126,122, 8, 60,140,148,130, 85,216,224,117, 87,159,124,253,167,240,209, 63, 11,137,248,186, 28,252, 35,168,207,219, -248,233, 22,234,113,131,235,243,233,139,187, 64, 43,162,136, 63, 49,147,235,233,247,106,247, 70,169,212,104, 85, 90,117,110,145, - 41,200, 53, 90, 68,248,117, 58, 92,198,148, 80,236, 90,141, 62, 75, 82,225, 74,109, 67,170, 84,137, 44,180,175,184,141, 88,152, - 10,229, 79, 96, 48, 57,177,219, 35,167, 79,219,162,211,156, 40,118, 30, 71,184,249,245,242,233,162,144, 24, 21, 97,112,118, 32, -239,132, 15,196,169, 30,155, 16, 71,112, 71, 67,137,193,240,233,185, 20, 62, 44,120,124,219, 61,240,167, 76, 71,191, 84,105,140, - 81, 55, 14,155, 5, 64, 73,165,223,148, 54,155,135, 89,139, 53, 8, 57,103,197,121,191, 25, 25,253,100, 72, 65, 4,131,173,161, -180,210,245, 40,183, 10, 44, 52,248, 14,171,153,247, 36, 40,150,208,211,100, 16,181,171,201, 93, 7, 79, 83,168,161,123, 40,248, -226,137,194,214,237,191, 97,110, 76,199, 6,196,111, 20,202,117, 42,239,113,106, 82,155,179,174, 82, 83, 18,135,123,178,146,127, - 69, 25, 42,113, 12, 78,199,254, 43,149,211,158, 67,169,140, 46,220,104,182,207,128,184,210,104, 79,178,197, 70,159, 80,128,226, - 36, 70,171, 65,146,132,189, 18, 92,121, 77,168,165,248,174, 52,182,212, 10, 73, 7,155, 84, 39, 16,240,233,203,115, 25, 99, 88, -201,130, 67,170, 35,216,169, 61, 47,220,173,244,155,247,243, 17,102, 24,239,143, 11, 60, 80,110, 39,225,218, 88,107,103, 15,152, -229,170,144,213, 33, 98, 60,234, 0, 89,236, 55, 34,117, 93, 98,219,115, 3,198, 8,209,135, 82,196,175,212,218,113,133,198, 84, -117, 38, 71, 32, 67, 78,101, 4,182,142,157, 7,255, 0, 22,125,124,255, 0, 13,121,226,147, 97,169,220,100,236, 45,251,195,253, -214, 96, 83, 89,184, 96, 55, 58,221,184,156, 71,138, 45,139,210,151,207, 34,220,169,161, 93,196,113, 36,248, 82,113,221,137, 11, -244,198,172,116, 62,102,100,181, 29,160, 61,231,149, 60,142, 99,224,101,164,246, 3, 29,128, 25,233,173,128,164, 74, 18, 99,198, - 73,116,183, 25,181,114, 60,178, 57, 76,151, 16, 50,162,162, 14,124, 60,129,246,235, 82,158, 2,165,118,210,203, 98, 45,216,245, -190,219, 94,253, 7,223,139, 66,108,214,122, 57,232,179, 76,177, 18,150,182,141,214,104,102,243, 49, 73, 35, 33,209,244,220,171, -217,133,180,176,210,230,225,188,151,199,230,211,196, 86,208,238, 55, 15,155,153,121,237, 22,231, 81,100,219,215,221,143, 82,149, - 79,168, 71,125,106,110, 52,230, 88, 90,132,122,157, 46,106,128, 76,202,124,136,220,143, 71,121, 63, 11,141,186,146, 8, 36,141, -107, 90,238,137,210, 99,242, 84,194, 39,208,228,243, 69,156,165,101, 50, 16,209, 35,156,184, 17,212, 56,158,138, 66,198, 72,229, - 26,253, 19,125,160,126,206, 29,169,246,133, 88,112,226,214,219,129,100,111, 5,191, 18, 68, 91, 19,116,219,132, 28,148,220, 38, -208,181, 53, 65,186, 99,180, 66,170,182,233,119, 30, 25, 39,198,138, 86,165, 50,121, 74,144, 97, 29,196,223,179,219,138,238, 14, -171, 85, 42, 30,238,109, 69,202,253,158,137,146, 26,165, 95,150,229, 61,202,229,149, 91,134,219,133, 41,155, 18,173, 13,165, 6, - 91, 82, 48,172, 57,202,180,231, 5, 26,179,178, 42,250, 57,225, 72,106,149, 86,169, 74,233, 44,116,220, 29,175, 27,118,123,216, -133,216,130, 59,142,146,250,158, 42,173,226,215, 74,204,190,189,178,218,167,133,214,182,141,111, 32, 18,142,242, 68,219, 84,208, -202,162, 69,119,250,199, 68, 58, 38, 17,181,158, 86, 98,205, 98,245,184,155,179,246,190,133,117, 81, 43,212, 69,205, 93,107,111, -171,201,247,180,220, 22,125, 75,170,221,143, 77,172, 67, 70, 41, 51,212, 66,147,225, 62,180,195,146,121,152,117, 41, 82,145,153, - 39,123, 14, 56,116,186,118,163,136, 57,119,139, 91,231,181, 82,105,117, 56,211, 85,187, 59, 81, 50,174,154, 46,225, 86, 41,142, -178,236, 71, 96, 81, 44, 39,154, 15, 79,169,138,138,154,146,169,140,169,198,154,240,202,146,121, 8,214,156,123, 19,246,162,147, -184,219,245,181,214,173, 74,157,114, 91,212, 68, 94,177, 46, 9, 87,209,164, 82, 35,166,152,213, 40, 26,147,148,152, 53,249, 12, -182,135,161, 77, 92,118,163,188,212,150,221, 87, 43,171, 72, 10, 95, 41,212,194,248,217,224, 59, 96,239,203,211,110,184,157,163, -220,219,119,195,142,224,236,189, 90, 53,199,112,238,141,180,213, 54,131, 86,184,173, 90, 80,241,158,162,204,105,137, 44, 68,247, -146,216,120, 38, 83,136, 82,185, 95, 91,106, 14, 36,132,105, 42,177, 85, 95, 69,196, 84,180,235, 13, 45, 13, 59, 8,229, 63, 84, -100,153,228, 44,254,209,101,229, 8,180, 29, 45, 34, 57,120,102, 98,238, 84, 54,248,177,115, 46, 32,224,110, 24,171,225,142, 26, -226,122,217,198,119,199, 25, 21, 76,116,245,242, 71, 93, 93, 67,144, 67, 83, 72,217,122,208,154, 38,146,170, 74,254,122,137, 97, -203,171, 80,123,126, 86, 13, 50,114,230,134, 52, 43,104,160,110, 52,106,229, 82,239,218, 10,165,197, 42,143, 92,155,112, 63, 79, -182,109,170,172, 86, 42, 53, 42,212, 72,110,166, 83, 17, 83, 38, 18,137,166,133, 50,164,172, 60, 85,240,145,228,123, 92,248,153, -225, 90,117,139, 14,223,186,217,144,212,184,247, 13, 37,217,245,234, 50, 30, 68,154,188, 47,118, 5,245,153, 13, 36, 5, 84,225, -248, 64, 45,114, 16,133, 4,120, 5,183,210,145,135, 23,170, 17,120,166,246,122,210,239, 8,251,245, 73,221, 42,108,202,125, 54, - 85,110, 12,136,116, 25,110, 42,164,252,181,186,183, 36, 84,100, 71,157,200,243,176,212,251, 97, 40,154,128, 27, 80, 87, 42, 0, - 73,215, 28,248,248,246,138,238,223, 31, 27,209,100, 13,189,190,175, 61,174,217, 13,133,184,168,247,110,220, 46,215,168, 72,182, - 43, 50,175, 26, 23,136,134,174, 58,133, 66, 41, 14,213, 96, 61,144,143,113,148, 85, 17,198,121,155,117,149,165, 68, 30, 78,240, -151, 41,171,203,168,248,214,139,140,242,218,147, 61, 39, 46,146,154,176, 74, 94, 58,115, 70,238,237,110,102,210,194,237, 49, 74, -101,167,176,152,106,242, 71,253,233, 17,120, 7,226,111,137,188, 85,195,180,126, 29,112,252,188, 55,150, 71, 72,245, 89,147,103, -144, 54, 91, 11,230, 13, 18, 65,236,212,236,144, 84, 78,202,220,184,170, 37,144,199, 57,137, 21,156, 76,199,149, 3,245, 94,101, -153, 14, 91, 11,118,106, 60, 38, 42, 50, 98,248, 52,232,255, 0,224, 76,210,169,176,210, 23, 58, 67, 75, 75,170,196,215, 65, 90, - 66,200, 82,134, 70, 57,121,122,190,116, 74, 93, 58,224,113, 52,104,137,117, 22,180, 38, 41,236, 84,166,201,117,250,127,189,196, -138,202,165, 63, 77,135, 61,213, 5, 70,128,166,194, 12,199, 18,144,165,140,160, 16,130,179,166,155,101, 55,170,133,187,214,166, -214,220, 55, 67, 20, 74, 22,231,223,150, 76, 91,182, 85,181, 1,133, 66,160,215,231,197,159, 82,164,204,170, 90, 80,221, 39,244, - 42,118,154,185, 47,211,155, 89,114, 42,164,175,221,144,228, 84, 39,195,216, 74,124, 72,107, 67,204, 60,133,205, 66,221, 76,153, -140,248,200,105, 21,106,162,212,144,195,107,125, 39,244,116,228, 20,254,149, 32,124, 73, 74, 16, 82,160,149, 5, 73,200, 40,225, - 8, 33,133,138,157,182, 82, 3, 95, 73,181,137,216,116,212, 13,238,110, 49, 90,230,167, 55,225,188,207, 50,225,188,237,100,164, -205,114, 10,186,138,102, 10, 67, 66,181, 20,181, 15, 75, 52,145, 56, 33,102, 11, 36, 14,177,206, 9, 14, 84, 59, 29,188,174, 84, - 59,173,112, 93,143, 85,131, 21,160,229,114, 44, 58, 45,153, 66, 12, 7, 27,139, 74, 91,136,101,170,139,205, 35,148, 83,216, 89, -109, 47,175,160, 45,198, 97,150, 17,149, 40,129,153,191, 33,138, 45, 46, 76, 10,157, 73, 53,234,220,249, 45, 83,233,211, 28,109, - 44, 82,226, 34,114,131, 18, 43, 40,129, 31,153, 48, 97, 70, 47, 36,186,181,120,174, 58,242, 82,209, 95, 50,212, 18,208, 73, 83, - 80, 80,204,199,127,194, 85, 21,242, 79,187, 56,168,170,169,212,221,108, 50, 91,138,234,193,240,227,178,130, 24,101, 57,229,108, - 41, 75, 86, 74, 20, 9,139,172, 74,165, 58,245,126,172,220, 89,142, 26,131,177,226,196,130, 86,202, 30,125,154,122,189,198,155, - 17,167, 0, 8,166,198,149,239, 78, 60,238, 79,139,135, 31, 80, 75,139, 70,183,210, 72,208, 37,152, 14,131,107,157,246,216,129, -183, 77,134,221,141,183, 54,195, 12,185,100, 85,145,194,212,139,125, 68,121, 69,150, 73, 36, 70, 28,168,213,141,221, 80, 38,242, -239,121, 25,155,153,118, 55,137,194,174, 84, 41,148, 85,183, 64,162,120, 21, 9, 84,184, 49,145, 29, 46, 45, 79, 64,165, 64,110, - 50,132,154,165, 69,214,148, 82,194,220, 74,138,147, 28,101,231,150,232,192, 66, 9, 86,185, 17,237, 36,216, 24,156, 79,108, 45, - 91,106,157,145, 17,119,146,170, 52,251,163,110,235,115,214,150, 35,192,191,179, 38, 60, 55, 42, 47,160, 19, 2,219,168,211, 29, -118,157, 56,164, 20, 50,202,227,203, 3,158, 10, 73,232,220,233,143,193,167,180,203, 82, 67,210, 37,192,145, 88,170, 20, 52,150, -230, 54,253, 90,120,113, 41,119,149, 69, 38,115,235, 1, 12,182, 7,193, 25, 9, 82,185,130, 82,117,175,119,139, 85,218,217,157, -245,121, 66, 42,143,213, 32,176,154,170,185, 28,143, 69, 75, 2,115,178,106, 74,141,250,175, 22, 25,108,248, 12, 35, 8, 91,142, - 54,181,252, 5,122, 88,213,203, 28,145, 75, 78,229, 37,167, 97, 34,183,236,148, 33,148,223, 96, 69,197,183,176, 63,102,214,216, - 58,240,190, 68,114,250,243,152, 23, 19,199, 8,114,242, 72, 72,231, 22,188,108,205,176,101,137,213,157,138,160, 37,149,131,121, -245, 2, 96,171,183, 20,137,123, 31,191,149, 91, 47,123,232, 85, 27, 62, 93, 6,181, 34,220,190,237,155,214,132,186,220, 88,179, -217,150,220, 71,128,149, 75,125,138,149,169, 90, 75,203, 96,211,110, 42, 91,143,176,165,184,194,229,195,126, 59,201,121, 83,127, -216,175,102,198,192,241,189,192, 78,211, 93,151,173, 66,131, 11,121,110, 27,122,109, 78,202,226,103,134,152,244,170, 29,255, 0, -106, 75, 77, 80,127, 7,147,118,200,183,170, 81,169, 27,137,124, 65,102, 20, 38,171, 53, 4, 24,110,205,241, 18,226,164,123,227, - 13,202,211, 37,186,124, 33,108, 79, 16, 66,211,103,113,182,182,139,118, 84,173, 7,156,166,216,183, 99,192, 67,187, 32,202, 95, - 52,202,236,231,238, 88,201, 46,213,173,214,193, 83,203,133, 49, 50, 99,173,245,243, 52,203, 11,115,159, 93, 2,225, 42,126,233, -240,185,105, 84,108, 74, 45, 95,108, 43, 59, 35, 69, 97,250,141, 10,138,230,217, 90,251, 48,139, 9,233, 47,173, 83,167, 92, 23, -133,177, 85, 69, 46,182,212,244, 48,183, 86,228,216,112,223, 43,138, 95,241, 29,230,228, 19,170, 78, 41,201,115, 12,218,154,183, - 54,203,228, 66,244,207, 79, 57, 83,174, 48,118,211, 36,113,139, 51,236,182,144,200,197,209, 89, 4, 74, 66, 18,100,220, 71,196, - 25,253, 47,135,176,101, 60, 41,197, 99, 32,207,114, 92,228,102, 52,138,194,116,168,154, 25, 34,146, 41,169,214,165, 68,180,176, -199, 36,210, 6,122, 3, 28, 20,213, 45, 28,143, 83, 37, 84,238, 34,143, 74,120, 89,225,111,121,247,111,121,238, 89,155,225,184, -220, 82,237,142,251,112,146,253, 17,207,229,239, 14,200,188, 40,150,199, 16, 91, 53,100,203,106,223,161,219, 59,177,105,238, 28, - 8,141,191,184, 84,122,123,188,237, 86, 66, 93,102,187, 65,135, 61,155,146,157, 54, 68,117, 85,170, 29, 5,246,132,237, 76,171, - 94,215,181, 54,235,103,182,227, 99,237,219, 50,147,100,221,151,117,186,253, 38,155, 38,143,114, 90, 87, 4,106,212, 53,220,242, -118,242,194,180,160,179, 75,166, 81, 39, 84,235,112, 68,217,140, 61,226, 50,212,247, 22, 89,118, 35, 77,235, 83,184,202,246,199, -112,111, 70,219,122,181, 6,171,108, 65,226,231,125,105,213,122,204, 75, 11,108,236, 27,130,252,141,176,118,155, 98, 2, 33,193, -175,238,213,251, 13, 81, 98,223, 52,197,206, 75,206,187, 71,165, 38,170,196,168,241,155,138, 85, 9,111, 46, 98, 52, 47,111,189, -188,183, 37,209,109, 10,103, 17, 22, 2,110,109,194,146,227,138,131,118,219,246,163,116, 11, 98,132,235,103, 52,122, 75,118,253, -157, 38, 77, 80, 90, 17,210,101,178,248,116,206,118, 75, 83,212, 28,101,175, 1,149,162, 45,226,190, 70,185,231, 0,203,149,228, -121,123,231,153,198,105, 91, 28,230, 88, 16, 36,112,211, 70,154,212, 24, 39,149,165, 18, 74,198, 72, 89, 35,105,100, 12, 41,231, -158,112, 57,145,137,231, 10,100, 94, 51,241, 87, 23,112,111, 30,211,112, 52,153, 38, 73,225,242, 10, 90,124,155, 50,146, 42,116, - 99, 45, 52,112,243,178,218,153, 12, 21, 85, 52,171, 42,205, 88,212,181,201, 75,149,209, 37, 91, 81,100,148, 51, 81, 75, 49, 50, - 6,217,173,183,155,188, 84,118,173,158, 32,172,235, 87,118, 54,166,179,183,149,203,134,222,225,242, 30,215, 80,233, 54,151,241, -165,100,213,106,245,122,156,138,221,227, 2,160,150, 46, 42,164,235,130,161, 57, 86,251,132, 51, 77,169, 64,173,174,167, 38, 59, - 85, 4, 56, 26, 3,109,118,123,135, 41,252, 96,110,135, 23,245,109,254,221,189,165,168,219,173, 91,123, 97, 87,216,251,190,175, -183,219, 85, 99,219,212,155,126,209,183,217,137,183, 10,131, 66,169, 76,169,205,176,225, 70,165,194, 83,180,116,125, 88,219,175, -148,178,243,175,199, 75,173, 59, 29, 61,249,246,206,238, 94,228,237, 61,211,181,155,117, 97, 50,205, 62,247,110,151, 14,183,114, - 57, 71,149,102, 55,111,211, 40,145,161,125, 74,213, 25, 54,141,222,227,180,202,188,130,169, 82, 23, 30,151, 57,136, 16,218, 83, -108, 72, 50, 38, 25, 64,114, 67,110, 47,253,229,176,174, 10,205,199,103,238,253,237, 99, 85,238,119,154,122,231,157, 75,174,215, - 74,238, 7, 25, 46,152,207,214,220,157, 58, 73,170, 74,109, 18, 30, 75,110,190, 29,121,180, 44,165, 42, 9,232, 21,240,162,151, - 56,225, 46, 16,143, 36,205,178, 88,214,186,130,176,206,181, 50,212,206, 37,168,141, 97,228, 37, 63, 46, 9,201, 90, 37, 96,103, -142, 25,155, 74,243, 26,157, 97,150, 33,237, 83,203,114,127,162,199,141,220, 86,188, 75, 85,151,241,125, 31, 2,167, 23,193, 83, -150, 54, 91, 79, 78,166,152,101, 85,109, 75, 81, 85, 61, 59, 60, 98,150,158,166,174,122, 58, 72, 42,106,150,136,102, 51,123, 10, - 85,205,152, 73, 43, 44, 16,206,123,218, 61,196,127, 12, 59,235,177, 53, 46, 29,169, 86,189, 55,136,234,109,215, 88,166, 26,197, - 38, 53,233,116,109,198,223, 91,198,222, 80,171,209,234,119, 5,221, 67,164, 25,151, 10, 5, 85,136, 33,154, 93, 49, 37, 18, 15, -233,100,202, 97,150,139,131,132,251, 87,179,251, 79,179,194,224,147,101,216,244,202, 5, 90,229,159, 17,119,149,211, 72,110, 69, - 46,248,110,163, 29,217, 43,129, 66,171, 79,122,116,167, 35, 90, 76, 72,147, 37,216,236, 37,215, 98,203,117,126,245, 45, 50,100, -114,186,222,133,219, 60, 77,113, 16,220,102, 29,123,136, 11,214,170, 86,194,217,230,148,229, 46, 98, 20,211,128,115, 50,125,254, -146,190,100,228,116,200, 4, 30,163, 7,187,151, 72,226,234,249,165, 72,105,119,173, 54,145,119,199, 91,105,138, 42,209,169,240, -173,203,214, 44,100,188,211,178, 16,205,110,152,208,135,112, 48,176,215,197, 10,171, 13,109,124, 69,109,200, 97, 95, 24,214,226, -126, 46,204,248,131, 53,169,253, 34,207, 26, 53,144, 71, 4, 79, 21, 56, 17,133, 22,229,150,231, 57, 26, 1, 47, 34,187, 2, 44, - 52,198,170,139, 50,202,126,130,126, 47,120,111,192,109,194,252, 57,154,229,220, 65,148, 9,205,116,180,137,154,214, 10,186,170, -162, 10,137,109, 91, 69, 71,150,198,235, 25, 10, 22, 25,169,163,100, 69,105,125,166,116, 70,126,237,240,173,188,242,233, 18,100, -237, 93,235, 42, 60,202,109,114, 92,138,190,220,221,209,196,104,148,181, 76, 74, 16,170,157,149, 92,105,110,132,210, 43,242, 74, - 19, 42,158,164,115,198,158,234, 36, 48,143, 6, 66,144,210,247,177, 85,202,124, 85, 41, 50, 23,238,234, 96,171,220, 84,131,201, - 81,167,186,242, 66,220,103,194,112,116,136,167, 49,204,218,135, 38,114,149, 36,142, 82,142, 24,109,205,249,100,111,109,188,154, -141,169, 87,121,132, 69,149, 25,154,133, 12, 70,102, 35,244,170,162,202,228,211,227,215,160,171,156, 70, 90,220,109,197,198,112, - 60, 25,150,134, 86, 98, 60,242,193, 74, 54, 70, 21,203,185,137, 49, 41,209, 55, 38,242,181,228,211, 26, 17,157,129, 46,114, 42, -180,121, 76,135,128,240,207,214,112,156,148,134, 86, 18, 75, 79, 49, 33, 50,163,165,120,248,146, 57, 73,105,106,159,147, 26, 7, - 37, 20,121, 74,249,129, 29,199, 81,176, 38,192,147,176,176, 11,229, 39, 28,113,196, 92, 57, 81,148,103, 21,249,110,121, 69, 46, - 69,155, 81,200,201, 87, 73, 60,114, 67, 44, 19, 46,155,235,139, 65,117, 46,165, 73, 11, 30,131,175, 80,250,185, 64,199, 74,170, -247,117,187,111, 83,215, 94,171,203,137, 65,135, 79, 67,143,174,161,207, 41, 13, 62,140, 15, 16, 83, 24,105,167, 37, 84, 28, 81, - 82,130,227, 69,105,245, 45, 71, 41, 66,191, 91, 76,133, 87,124,171,187,130, 29,167,217, 76,213,237,251,106, 66,189,205,119,162, - 28, 98, 37,199, 86,142, 16,162,185, 54,235, 12, 41,106,181,161,242, 45, 99,199,119,154,162, 48, 80, 81, 16,158,154,182,205, 62, -117, 86,178,221, 66,238,151, 81,166,214,156, 82,227, 66,168, 73,171, 77,171,198,152, 82,188,180,236, 27,145,222, 95,115, 36,148, -242, 70, 81,136,160, 29, 56, 67,138, 29, 54, 42,202,179,153,139, 37,154,143, 44,138, 93, 90,115, 13,179, 42, 84, 55, 84,228, 58, -130,154, 32,177, 34,167, 76,116,248, 83,164,158, 85, 21, 58, 66, 29,194,202, 84,242,134, 53,191, 74, 37,168,148, 34, 92,139,239, -126,187,219,125,133,150,228,146, 47, 98, 55,179, 1,136, 86,103, 62, 91, 69, 8, 36,153,106, 8, 60,182,111, 58, 40,216,157, 54, - 98, 36, 0,234,243,171, 58, 3,101,229,106,179, 43,139,104, 91, 70, 44,120,176,217, 45, 59, 21,146,164, 50,232, 71, 43,133,111, -117, 90,230,100,144,252,149, 40,149, 41,210, 74,150,181, 21, 44,149,171, 39, 97,160,209,196, 74, 98,138,211,204, 1,101, 39, 41, -232,160, 84, 80, 91, 86,122, 5,117,207,217,171, 93,167, 74,230,109,190,118,227,151, 50, 18, 67, 73, 80,101,207,212, 10, 45,182, -190,169, 65, 32, 16, 14, 72, 61, 50,113,157, 59,206,211,128,167,184,215,134, 84,218,139, 67, 9,202,136, 9, 81,207,134, 79,235, - 28, 17,243,252,113,169,165, 53, 56,166, 68,176, 35, 72, 23,245, 29, 5,183,191, 78,155,254, 24,174,234,171, 13, 76,138,146,157, -228,111, 49,216, 94,228,111,219,173,201, 22,181,250,250,130,207, 61, 76, 83, 78,129,201,136,206, 30,102,214, 63,241, 74, 61,219, - 81,242, 79, 81,141, 92, 33, 83, 11, 11, 43, 74, 70, 79,235,128, 48,146,159, 95,183, 89,187, 48, 16,248,113,190, 78,100,130, 82, -160,176, 65, 32, 28, 5, 99,215,168,252, 53, 65,216,162, 34,146,199,235, 39, 31, 2,200,193,233,215,144,231, 79, 81,206,164,117, -233,252,125,253,240,213, 89,206, 82,241,176,243, 14,190,132,117, 7,227,110,189,143, 94,183,197,134,155, 9, 14, 77, 73, 35,160, -115, 31,105,236,123,140,118,214,207,217,208, 91, 67, 45, 2, 19,212, 36, 12, 14,163,212,156,142,135,247,233,135,163, 69, 10,155, -158, 95,135,196,200, 0,103, 57,200,252,115,173,138,183, 84,150, 18,214, 79, 47, 42, 82, 64,200,200,192, 25, 63, 34, 51,173,102, -107,129,181,255, 0,158, 33, 53,234,201, 4,224,108,194,246,251,207,207,175,124, 57,232,109,180, 51,202, 72,248,130,113,142,248, - 78, 0, 31, 35,235,246,233,191,188, 42,206, 66,108,193,167,132,253,103, 41,181, 0, 71,255, 0, 2,140,174,134, 73, 35,245, 92, - 39, 33, 30,121,235,229,171,141, 90,228,106, 11, 32, 52, 80,236,183, 73, 12, 70, 4,229, 74, 7, 30, 43,152, 63, 3, 41, 29, 84, -123, 28,224,100,235, 5, 13,173,197, 57, 46, 67,138,125,249, 46,120,146, 95, 88,253,117,156, 97, 40, 39,245, 91, 0,225, 35,176, - 29,180,142,179, 80,220,168,205,149,126,211, 15,223,164, 16,122,250,158,195,208,145,134,108,155, 45,116,149,107,106,210,241, 41, -186,161,255, 0,120,194,221, 71,236, 47,127,218, 35, 79, 77, 86,176, 66,163, 8,205,225,197, 43, 56, 37,105, 65, 56, 36,252, 75, - 82,212,174,171,112,149, 28,156,245,207, 93, 15, 45,216,241, 57,146, 57, 27, 56,200, 72,192, 89, 78, 15, 85,168,159,128, 99, 39, -226, 63, 33,223, 89, 20,167,114,130, 10,130, 80, 72,248, 26, 31, 30, 65, 0, 16,165, 3,208,231,174, 61, 61, 53,129,212,188, 52, - 7, 20, 82,214, 78, 74,148,226,186,164,228, 18, 84,181,103, 36,244,238,122, 30,157, 53,185, 26, 44,106,170,160, 1,238,236, 54, -253,214,249,247,206,169,100,122,153, 25,234, 36,251, 71,160,233,212,122,216,124,236,119,197,146,116,196, 43,156, 23, 20,234,176, - 66, 83, 24, 44, 50, 18, 79, 66,235,132,167,159, 61, 50, 50, 18, 9,206, 15, 83,172, 58,116,165, 37, 64, 4,182,218, 73,199, 59, -139, 10, 82, 73, 66,186, 33, 13, 30, 94, 96,174,108,228,231,168,198,123,139,140,202,131, 79, 30, 70,148,227,238, 33, 74, 65,102, - 43, 97,196, 54,147,211,226, 81, 41, 74,129, 0,103,226, 56,236, 70, 51,172, 78,114,228,243, 5, 43,193,100,115,243, 36,120,134, - 75,201,194,128, 42, 71, 54, 17,204, 60,206, 74,114,122, 18,116,112,214,210, 59,223,241,219,240,190,226,251,116,251,158,201,176, - 10, 23, 73, 61,143, 95,141,182, 61, 58, 16,167,226,118,197, 23,220, 24, 42, 82,202,147,250, 50,234,130,146,217, 45, 36,168,133, - 45, 94, 71,175,197,215,174, 49,223,174,177,233, 50,208, 66,131,105, 61,214, 66, 64, 78,114, 64, 32,244, 61, 27, 42, 36,100, 30, - 80, 0, 29,250,232,185,104, 66, 49, 33,199, 21,150,220, 43, 66,158, 90,158, 9, 94, 72,229, 74, 84,180,165, 36,173, 63,234,146, -156,146, 6,173,114, 20, 80,180,165, 72, 80,112, 20,145,206,164, 41, 92,139, 1, 96,182,144,172, 56,130, 20, 14, 50, 0, 39, 56, -233,141, 46,141, 98, 54,244,254, 95, 29,247,198,133, 76, 90,206,166, 58,175,233,178,237, 97,238,254, 93,189,215,178,204, 42, 33, - 93, 64, 42,248,136, 81, 57,235,147,209, 95,205, 61, 51,156,117,229,239,140,107, 16,158, 7, 42,147,206, 74,138, 85,241,171,148, - 17,140, 96,145,216, 96, 12,125,253, 6,178,233, 89, 1, 42, 89, 0,224,140, 40, 16,146,179,204,164, 55,201,216, 60,158,153, 29, -114, 59,100,118,197,106, 10,207, 40, 35,170, 73,230, 36,114,149,103,155,161, 9, 87, 86,241,147,231,213, 88,193, 58, 92, 49,218, -223,135,110,159,187,221,238,253,216,103,145, 0, 34,219,123,186,124,143,147,136, 13,251,114,237,134,237,143,105, 46,242, 73, 13, - 22,133,233,109,109,125,248,227,197, 1, 40,126, 69,118,199,166,197,148,182,249, 0,241, 0,122,146,174,101, 31,136,168,158, 98, - 78,117,200,194,180,168,126,137,101, 88,239,233,246,107,183,127, 72, 24,180,175,104, 99,158, 27,161,215, 19,195,254,205, 37,246, -129,255, 0, 34,180,195,184,124, 52,148, 17,150,202,152, 45,175,169,201, 11, 7, 0, 99, 92, 70, 83,105,199, 81,140,246,229,242, -249, 29, 75,178,155,181, 13, 41, 59,217,109,211,176, 36,116,235,219,242,199, 51,241, 50, 44,124, 69,158, 34,159, 47,181,212, 31, -255, 0,116,172,199,247, 18,113, 76,168, 40,116, 72, 29, 62, 47, 63,188,117,208,235, 35, 24,207, 92,244,254,221, 86, 40, 35, 62, -152,207, 95,232,251,116, 51,133, 67,168, 78, 71, 81,243,251,244,236, 6,194,221, 48,206,160, 29,173,211,161,253,216,162,179,229, -143,191,211,175,217,170, 11, 0,227,176,245,245,199,175,207,160, 58,244,188,254,177,201, 82,124,188,177,231,246, 29, 81, 39, 39, - 58, 93, 70,194,221, 63,158, 20, 24,164,230, 60,136,232, 72,244, 39,183,109, 12,178, 9, 61,242, 59,122, 30,223,214,116, 74,241, -130, 73, 3, 7,167,246,245,213,189,240,234,136,240,212,148, 97, 95, 22, 70, 74,128,236, 58,249,233, 68,235,140, 3,126,155,227, -193, 36,156,254,113,165,175, 10, 63,237, 99,238,206,116,180,125, 62,182,191,207,191, 25,199,180,146, 15, 65,159,151,174,171,165, - 93,142, 58,142,227, 61, 70,135, 31,120,254,145,251,117, 92, 96,245, 30,127, 46,250, 37,188,191, 15,195,231,231,124, 12, 86,241, - 19,156,117,235,231,142,159,126,136,111, 10,193, 74,187, 28, 99, 24,201, 62,191,136,252, 53, 65, 9, 0,131,220,244,251, 58,232, -164,225, 61,178, 7, 94,221,254,236,246,210, 76, 24,139,124,252,223, 25,219,239,197, 69,160,168,119,233,221, 93, 78, 6, 49,216, -125,186, 33,164,115, 36, 40,247, 29, 66, 71,160,233,235,170, 64,133, 15,207,113,215, 69, 36,242,224,244,244, 35,208,105, 34, 0, - 39,190, 49,143,104,101, 42,238, 57, 85,215,168,198, 72,251,188,244,123,104, 72, 72, 24,201, 79, 78,191,187,166,132, 65, 39,226, - 72, 25,244, 39,167,152,251,180, 90, 22,144, 1, 87,195,147,231,252,236,250,124,244,153, 23,216,158,159,233,140, 17,124, 28,214, - 58,114,244, 24, 61, 62, 93,191,167, 70, 32, 12,103, 39,230, 60,137,199, 94,154, 13,178, 23,215,168, 29,253, 59, 99,250,245, 93, - 11, 73, 95, 47,114, 62,127,102,127,103,150,147,194, 39,221,190, 13,108,129,145,140,228, 16,160, 70, 82,164,158,133, 36,121,130, - 9,200,212,133,253,149, 30,214, 40,187, 66,197,191,195, 39, 20,245,169, 15,236,235,143,162, 14,220,110,140,213,189, 54,163,181, -211,100,184, 17, 30,135,114, 58,162,165,203,177,148,226,240,211,164,149, 65,206, 21,150, 70, 83, 30,118,242, 14,122,121,126,206, -218, 33, 39, 37, 68,227,168,229, 32,128, 82, 65,232, 65, 7,184, 56,237,231,157, 55,102, 89,109, 54,103, 78,208, 84, 37,251,171, - 11,106, 86,236, 71,240, 32,236, 71, 81,211, 14,249, 22,123,153,112,230, 99, 22,103,149,205,202,158, 63, 43, 43, 92,199, 44,100, -130,209, 74,160,141, 72,214, 29,195, 41, 1,144,171, 0, 71,233,189, 78,163,199,149, 6, 5,118,137, 50,159, 88,161, 86, 97,179, - 50,145,112,209,228,179, 81,164,214, 32,202, 66, 93,106,101, 62,161, 25, 74,109,214,150,210,146, 82, 66,186,115,105,198,165,210, -220, 45, 54,156, 0,210, 18,130, 16,156,144,132,160,130,113,234,163,215, 63,102,191, 63,142, 13, 61,168,188, 90,112, 88, 35, 91, -187,121,119,179,119,109,106,165, 54,185,123, 83,184, 1,218,213,172,195, 74,112, 25, 31,193,231,222,112,191,110, 58,164, 21,224, - 48,176,215, 49, 7,195,198,117, 59, 45,161,226,130,149,124,109,157,131,126, 59,105, 34, 25,190,109, 42, 53,196,184,241, 30, 15, -198,138,237, 78, 35, 82, 31,140,211,167,245,219, 66,220, 41, 7,190, 19,170,167, 56,203,165,200,101,140, 85,149,104,230,213,203, -101,189,155, 78,155,220,117, 82, 3, 46,198,227,123, 43,181,137,199, 98,248,121,226, 4, 60,107, 28,144, 81,211, 52, 25,134, 94, -168,243,195, 33, 13,165, 88,233, 15, 20,151, 2, 68,212, 8, 23, 84,117,184,212,128, 27,157,174,166,211,138,218,110, 68,166,202, - 12,226,136,177,129,232,166,216, 72,248,148, 83,159,213, 41, 3, 58,199,247,101,136,115, 44,202,189,191, 58, 53, 62,165, 75,147, - 13,232,255, 0, 85, 84,225, 70,168,193,124, 22,212, 1, 92, 57,109,173, 42, 25,207, 92,107, 7, 94,247, 82,222, 44,120, 49, 37, - 54,166,153, 62, 27, 97,162,180,183,147,212, 19,228,122,244,251, 53,166, 60, 82,241,139, 69,219,203, 98, 69, 54,140,180, 86,247, - 30,234,150,139, 66,201,183, 25,149, 29,233,234,185, 42,196, 70,134,169,113,219, 89,247, 70,154, 91,161,107, 46,114,242,132,100, -244,206,153,205, 97,168, 2,158, 4, 44,100,219,125,135, 64, 78,228,219,222, 73,244,222,221,174, 76,131, 35,204,179,124,218,130, -135, 45,164, 51, 85,202,227, 76,106, 62,206,255, 0,109,219,126, 90, 70,190,103,145,136, 84, 93, 78, 72, 23,191, 48,247,123,113, - 54,107, 98,106,146,105, 9,180, 41, 21,123,162,141, 80,151, 62,153,110, 91,228, 81,105,212,218,178,156,241, 34, 77,169, 72,130, -226, 75, 2, 57,229, 90, 91, 71, 95, 19, 25, 61, 49,174,102,239,183, 16, 27,245,196,245, 64, 82,110,171,182,181, 46,217, 96, 6, - 35,218,212,137, 51, 32,219,108,198,105, 92,201, 85, 69,199, 30, 6,166,164,128, 10,220,112,144, 72,251, 53,214,202, 31,178,178, -163,118, 58,154,214,227,110,196,250,141,229, 94, 90,234,215, 82,232,240, 89,168, 70,166, 84,170, 4,190,168, 41,121,249, 0, 76, - 90, 29,119,151, 56, 9,248, 73, 25,214,146,202,219, 91, 51,104,184,161,111,104, 55, 2,101, 83,114, 54,198,194,191,169, 77,110, - 68,221,177,164, 63, 85,175,214,237, 88,241,211, 82,147, 76,141, 78,128, 22, 91, 87,142,150, 98,205, 74, 85,132,248,171,248,142, - 53,173,150, 83, 84, 83,203, 81, 44,142,139,160, 27, 2,160,233, 3,114,117, 16, 12,141,127, 70, 80, 9, 35,125,241,233,239,130, - 41,224, 38,103, 13,117, 54, 67,153,205,226, 87, 28,112,190, 95, 45,125, 92,210, 83, 86,187,242,226, 42,178,174, 80,149,113,165, - 44, 65,229,100,134, 4,141,150,122,141, 81, 51, 73,162,237, 30,168,196,225,210,109,131,180,183,158,251, 93,182,173, 90, 77,131, - 96, 89,181, 75,242,173, 86, 98, 49,102, 9,183, 41, 18, 99, 82,213, 61,169,147, 28,108, 26,115,213,233,208, 41,241,139, 73, 89, -155, 50, 88, 98, 57, 82,144,225, 71, 44,173,110, 47,174,107,174,254, 98, 13, 58,249, 85, 6,131, 87,171, 39,220, 44,241,181,244, -153,180,166, 32, 5,149,154,122, 42,162,227, 19, 75,165,128, 71,188, 56,178,174,115,204, 82,145,128, 36, 3,237,235,223,234,222, -215,112, 55,182,219, 31, 86, 98, 61,181,187,220,112, 95,208,183,126,253,180, 97, 54,220, 21,109,191, 13,155, 89, 33,113, 54, 95, -106,218,165, 50, 18, 40,148,150,231,154,107,198, 55, 42, 67,242, 41,179, 93,113, 42,113, 74, 86,162, 97,177, 48,209, 39,113,161, - 58, 64, 13,211,225, 75,148, 51,140, 36,165,190, 84,143,159, 65,171, 75,135,178,168,107,242, 90,172,214,180, 51, 59,234, 16,134, - 17,190,133, 64, 20, 55,158, 54, 2, 70,146,225,136, 0,174,157, 43, 97,185,243, 63,233, 63,244,231,241, 66,159,196,102,225, 15, - 14, 51, 37,224,188,143,132, 9,142,161,114,156,207, 55,165,122,154,211,180,201, 83, 95,148,230, 89,116,181,212,212,192, 8,224, - 5,150, 25,142,186,190, 84,124,245,138, 25,117,109,141,230,157,201,225, 47, 99,174,184,147, 81, 37,251, 42,185,185, 27,109,239, -116,234,109, 66,219,122, 4,155, 82,247,170, 85, 97,120, 77, 63, 82,121,198, 42, 45, 83,110,106, 65,247,182, 36,165, 14,184,226, -150,194, 25, 9,113, 3,110,182,151,139,125,212,183,132,104, 23,139,113, 55, 18,137, 24, 33, 42,171,202,150,138, 77,231, 10, 58, - 80,148, 41,215,106,105,101,113,238, 23, 2, 0,109, 6, 99, 41,127,224, 0,190, 84,115,174, 89,251, 50,110,182,111,109,161,226, - 3,101, 36, 58,211,149,138, 21, 94,218,222,203, 78, 35,202, 81, 46, 82,231,199, 69,129,126,193,167,180, 63, 93,214,103,194,179, -170, 50, 48, 15, 42,103, 21,168, 17,147,174,130,217,182, 49, 51,154, 91,177,188,102,144,164, 58, 35,144,191,242,169, 25, 99,159, -148,124, 72, 7,226,207, 80, 49,207,131,216, 83, 92, 69, 69, 29, 6, 99, 95, 73, 34,235, 8,250,148,236, 9, 14, 17,197,138,133, - 2,215,210,116,217,110,164, 91, 97,105,119,134, 62, 33,208,248,151,225,118, 89,196, 28, 81, 28, 85,249,213, 91,213,189, 89, 99, - 36,143,237,143, 83, 41,169,117,146, 89,165,169, 6,105,139, 75,170, 73,228,145,245,134,150, 73, 9, 44,122, 97,110,111,221,149, -120, 67,165,189, 58,161, 34,214,201,105,134,233, 55,148, 69, 83, 11, 50,221, 90, 92, 68, 40,213, 72,110,200,135, 46, 73, 41,108, -171, 14,167,245, 84,130, 65,200,211,166, 94,171, 84,102, 51, 47,194,143, 89,131, 9, 5,184,240,105, 85, 40,147,218, 74,222, 40, - 89, 97,227, 2, 67,137, 97, 78,252, 5,254,110, 85,114,132, 39, 9, 72, 32,233, 93, 14,201,122, 65,143, 22,156,212, 69, 86,100, - 46, 44,135, 38, 57,135, 33,219,180,231, 22,234, 83, 60,161,192, 10,170,170, 8,144, 33,178, 71,233, 29, 30,242,191,208,181,133, -191,182,125,129, 22,137, 24,184,219, 16,105,244,122,116,229, 24,172,196,140,227, 51,106, 82, 37,172, 0, 92,153,226, 37,249,213, - 57, 83, 22,165, 18,225, 82,222,113, 69, 74, 9, 71,234, 68, 9,208,198,209, 94,219,218,228, 15, 83,112, 65,184, 62,227,110,189, -109,178,169, 62, 83, 5,218,149,249, 37,181, 42,198, 87, 89, 80,199,253,217, 86, 70, 70, 98,204, 20,146, 89,197,201,101, 22,230, - 59,242, 41,215, 69, 77, 73,128,236, 67, 18, 58,167,154,138,231, 60, 4,102,158,150, 80, 82,130,218,157,115, 45,198,101,174, 84, -165, 1, 68,114, 52,130,156, 99, 89, 45, 34,212,134,228, 73, 16,146,227,205,181, 1,201, 78, 77,171, 38, 42,218,143,227,144, 4, -201, 12,201,115, 36, 71, 12, 32,165, 43, 3,226,248,212,144, 10,146, 53,126,180,172,233, 73,154,154,212,168,202, 93,197, 80, 97, -136,104,140,211,242,100,192,162,196,109,194,166, 41,208,221,148,163,201,135, 23,227, 62,232, 78, 95,127, 36, 0,218, 27, 1,238, -160, 90,138,170,136,112, 34,196,122,116, 24,179, 26, 97,224,201, 66,151, 91,158, 22,121, 26, 8,112, 2,184,136,155,133, 28, 30, - 89, 15, 32, 1,204,132,117,220,138, 25,100, 69,141, 33, 42, 95,185,185, 36,108, 64,216, 41, 3,125, 76,119, 96, 54,234,214, 58, - 53,249,220, 11, 78,232,142,144,194,128, 23,101, 1, 6,175,214, 62,103,112,219,249, 82,197, 84,238,108, 17,110, 52,139,118, 47, - 29,184,225,215,110, 42,187,173,184,204,207, 72, 80, 85,167,183,182, 36, 9,173, 70,184,111,106,192, 66,170,116,219,106,146,227, -200, 80,164, 50,235, 10, 77, 66,191, 84,117, 10,106,153, 79,228, 73,241, 36,174, 36,119,184, 21,190, 59,243,185,156, 69, 84,159, -170,238, 77,125,233,212, 64,224,114,153, 96, 80,157,149, 74,219, 91,113,168,200, 9,139, 79,161,218,173,191,225,204,247,118,130, - 18,103,207, 18,106, 18, 92, 10,125,231,194,214, 80,151,139,218, 61,196, 11, 91,199,196,197,237, 22,149, 81, 84,157,189,217,229, -191,180,182, 2, 88, 11, 17,100, 68,160,212, 84,221,239,112,178,210, 9,241,102,214,111,225, 52,151, 48, 84,168,148,168, 76,161, - 74,109,180,160,115,231,137,235,103,118, 56,127,147,104,217, 55,156,251,107,111,175,235,178,220,141,117, 86,109, 75,154,123,113, -238, 29,183,163, 87, 2, 87,106,211,239, 74, 50,150,145, 64,189,234,148,231, 29,158,154, 36,149,174,165, 75,167,166, 52,138,188, - 24,138,159, 21,133,236, 83,112,252,185,180,169, 8,169, 20,176,234, 0, 18, 88, 7,176, 39, 89,211,114,119, 4, 70,189, 44,161, -148, 22,190,159, 75,188, 43,225,207, 12,190,140,158, 22,229, 62, 49,120,177, 11,207,199,124, 79, 74, 43, 96,166,138,138, 92,199, - 54,166,167,120, 99,153, 50,252,166,134, 37,121,162,150, 40, 36,137,243,154,231,228, 65, 75, 44,172,185,141,117, 61, 12, 49,202, - 64,184,109,119,103,132,181, 74,129, 79,134,194,135, 43,190,237, 21,191, 29,100, 96, 37, 40,117, 73, 82, 99, 35, 32,124, 88, 42, - 63,170, 53,226,221,219, 54,154,144,210,159,144,184,110,188,191, 9,111, 50,130,176,158,110, 80, 84,251,171,202,128, 1, 93, 73, -229, 25, 56, 37, 0,140,233,155,215,238,236,178, 81,245, 6,230,196,184, 38, 72,117,114,146,204, 10,157, 18,124,222, 68, 55,238, -229, 13,192, 85, 62, 51,171,139,134,207, 35, 41,140,233,231,202,146,147,144,117, 96,166,239,230,251, 91, 78,170, 52,187,154,100, -238, 69,175,198,143, 95,161, 83,106, 18,154,101, 79,165,231,152,117,164, 67,133, 45,134,212, 82, 91,194,156, 5, 45, 44,164, 2, - 66, 84,155, 34,147,133,243, 36,165, 20,116,217,188, 35,151,238,126, 97, 4,254,177,125, 68,239,211, 82,223,173,172, 0, 24,167, -179, 47,246,170,125, 30,232,243,104, 31,139,124, 24,227,142, 30,161,169,102,142,147, 50,172,203, 50,121, 41,229, 42, 69,218, 3, - 30,118,241,202, 0,243,200, 41, 94,165,129, 22, 42, 88,227,163,116,203, 17, 8,185, 93,183,106,208,252, 38,221, 75,239, 69, 82, -148,212, 98,226, 86,217,118, 44,165,167, 9, 65,101,223, 60,148,144,181, 96,168, 43, 0,252,174, 91,214,181,183, 10,117, 86,179, - 50,153, 73,166, 83,194,214,252,233, 83,209, 26, 43, 44,162, 64,140,219,206, 58,234,210,112,235,191, 11, 64,100, 44,244, 4,168, -145,172,123, 98,119,186,189,184,148,118,141, 70,148,197, 50,191,111,207, 66,201,167,161,249, 52,249,241, 42,212,229, 7,204, 15, -126, 66, 92,110, 3,140,161, 73,118, 19,202, 81, 97,108,148,161,199, 27, 91, 78,107, 86,119,238,216,221, 43,230,252,250,182, 13, - 58,183, 46,147, 70, 13, 38, 4, 56,116,185,179,162, 69, 46,180,223,141, 81,142,184,140, 41,147, 41,114, 84,242, 75,171, 82, 84, -194, 91, 72,230, 64, 90,214,181, 33,200,201,170, 43, 89, 94,208, 24,128, 15,166, 66, 20,216, 3,112,111, 96, 88,110, 78,159,118, -155,220, 99,160, 60, 98,250, 99,112,207,134,255, 0, 71, 46, 29,250, 64,120, 83,195, 50,248,169,148,241,245, 69, 30, 93,144,193, - 67, 79, 83, 28, 82,215, 85,189,122,153,115, 32,105,154,178,134, 26,105,168,101,163,146,156,211,189, 75,102,130, 44,173, 68,114, - 77,207, 71,110, 15, 18, 59, 61, 18,251,183, 45,234,180,107,233,187, 1,250,171, 17,238,235,214,213,164, 83,170,247, 53, 22,146, -247, 59,114, 43, 22,149,141, 85,159, 17,119,100,134, 63, 68,234,163,187, 34, 18,164, 53,206,152,138,117,244,161,183, 58,193, 87, -225, 15,135,235,154,206,165, 93,187, 71,198, 37,215,186, 16,174, 74, 84,106,197,183,252, 7,217, 27,135,115, 66,233,111,133,248, - 82,110, 88, 27,108,185, 18, 44, 98,226,138,217, 76, 74,176, 98,168,211,208, 31, 14, 67,113, 0, 40,199,138, 77, 58,219,219, 50, -244,105,201,133,114, 94, 12, 56,227, 82,225, 41,246,106, 20,107,126, 74, 1, 10, 21,105,145, 29, 83, 87, 29,105,183,135, 90, 99, - 14, 24,108,168,230,161, 33,210,145, 21,121,134,197,241,157,196,167, 13,119,204,187,239,101,247, 94,228,180,103, 85, 93, 74,238, -122, 27,239, 11,130,196,190, 89, 74, 3, 65,139,247,111,234,106, 52,187,152, 37,129,200,203,193,152,211, 98, 54, 3,112,101,197, -108, 4,133,235, 56, 58, 10,228, 87,202, 71,178,152,134,242, 75,119, 19, 27,222,225, 88,150, 31,254, 96, 54, 34,214,141,213,129, - 30, 77, 63,251, 74,190,146, 28, 63,196,245, 21, 94, 41,241, 81, 90,138,137,238,120,103,135,232,114, 90, 51,145,166,250,161,204, - 42,243, 28,191, 56,115, 80,172, 17, 36,201,106, 30,171, 49,165, 99, 58,215,215,101, 85,180,199, 46,155,165, 84,250,206,231,112, -167,186, 84,202,229, 58, 84, 41,147,169,133,248,238,197,175, 91,119, 93, 18,221,187,232,146, 84,224,168,218,183,125,171,122, 80, -169,146, 69, 62, 91, 77,165,197, 50,182,199,186,202, 90, 37,197,125,153, 76,161,221, 73, 67,102,161,181,186, 27, 75, 97,238,133, -149, 75,174, 53,111,223, 86,211, 87,109, 54,213,185, 35, 77,146,237, 17,137, 14,200,167, 84,169, 77, 86, 23, 24,190,212,104, 85, - 56,114,217, 98, 72, 75,241,159,101,166,228, 0, 16,240, 9,226,206,213,123,125,246,154,253,183, 26,179,248,203,225,125,202,139, - 46,178,168,179,235,251,104,229, 22,255, 0,179,166, 52, 82,164, 41,247,246,211,115,158,110,161, 69,150,180,149,143, 14,155, 84, -150,134,210,172, 54,180,249,236,206,213,123, 69, 61,143,214,236,216, 85,123,123,115, 55,238,195,166,195,122, 53,197, 19,108, 46, - 26, 79, 16, 44,236,253, 26,226,128,250,223,131, 85,141,183, 84,234,188,232,106,173,199, 90,212, 89,142,137, 15, 83, 81,144,125, -209,101, 40,228,141, 47, 10,102,180,149, 86,154,156, 24, 92, 29,108,129,135,154,226,204, 2, 44,137,115,111, 54,226,254, 93,182, - 24,147,120,185,244,188,240,119,233, 7,195,249, 54,103, 93, 17,224,159, 17,114, 33,203,106,209, 45, 37, 92,121,173, 8, 71, 34, -150,170, 58,150,200,101,166,150, 41,220, 61, 44,139, 5, 76,112,171,213, 71, 20,136, 39, 4,118, 6, 29,186,134,194, 27,148,195, -193, 62, 44, 68,187, 21,106,102, 84, 30, 70, 85,205,142, 80,158, 87,201, 81, 7,153,192, 0,192, 80, 64,211,149, 66,165,180,203, -136, 67,104,240, 27, 90,130,130, 17,226, 37,166,148,162, 1, 67, 73, 94, 66, 83,252,227,140, 39, 39,160,215, 35, 46,223,110, 95, -179,178,219,105,233,244,219,195,120, 47,233,139, 89,112, 67,182,118,102,191, 77,247,149, 21,115, 41,196,213,175, 41,244,200,241, - 80, 85,142,139,201,194,137, 9,207, 77,115,159,136,255, 0,164,222,229,137, 30,163, 15,134,190, 13,228, 85,153, 9, 87,213, 91, -165,191, 87,204,167, 45, 40,174, 45, 76,182,204,169, 86, 14,216,198,101,228,255, 0,133,202,109,178,212,219,137,132, 41,194,148, -158, 96,180,131, 37,202,248,118,182, 90,133,138, 42,118,185,221,117,133, 75,133, 32, 29,216,168,185,189,236, 14,163,109,129, 0, -219,143,243, 63, 16,184, 90,150, 55,105,115,232, 42,165, 31,169, 77, 42,212,177, 32, 14,130, 18,226,224, 0, 53, 57, 0,216,238, - 55,196,195, 45, 68, 22,211,205,146,176,133, 54,151, 20,132, 15,133,229,231,144, 40,224, 37, 5, 65, 39,151,155,148, 18,158,152, -235,167, 48, 77, 75,205,166, 35, 10,241, 36,158, 64,164, 52, 60, 79, 9, 9,207, 48, 83,160,114,149,103,148, 96,103,182, 73,215, -230, 7, 43,219,203,237, 79,157,190,246,230,253, 61,196,180,212, 75,181, 94,156,213, 51,101,233,182,221, 22,223,225,210, 69, 2, -168,227, 11,169,218,181,125,167,162,176,212,122,212, 25, 8,142,218,126,176,154,244,170,211, 68, 7, 88,168,182,234, 82,177,213, -203,167,233, 12,113,211,199,133,235,182,188, 54,240, 99,176,227,101,238,251,254, 37, 46,135, 81,183,246,214,113,190,247, 95,112, - 47, 39, 98, 37,203,129, 54,157,199, 86,136,195, 22, 53,140,193,106, 91,252,225,149,204, 98, 19, 75,118, 84,180,165, 7, 18,169, -178, 74,170, 69, 51, 56, 73,209, 23, 81,210,224, 42,219,115,204, 50, 5,109, 34,219,149, 87, 3,115,219, 16, 36,241, 71, 32,204, - 22, 85,167,138,163,219, 12,129, 32,128, 37,228,152,177, 1,116, 88,216, 92,246,107, 17,218,230,195, 19,125,171, 92,246,205, 30, - 90, 32, 84,171,244,168,149, 5, 16, 61,205, 83, 89,247,180,147,216, 56,218, 23,148,121,247,198,178,122,125, 22, 5,114, 40,154, -138,154, 22,210,134, 80, 99,180,183,112, 79,162,136, 1, 95,118,123,235,152,220, 17,123, 63,247, 3,103,237, 26, 77,219,197, 85, -255, 0, 51,114,119,174,160,202, 42, 21, 90, 12, 74,180,170,149,181,104,202,120, 37,197,211,222,171, 73, 81,114,229,171,182,181, - 40, 63, 37, 88,100,184,149,120, 41,228,194,143, 75,153,101, 48,185, 91,107,153,134,155, 1, 8,109,165, 41, 41, 74, 64, 1, 32, - 4,224, 99, 3, 80,103, 78, 51,204,101,157,185,180, 57, 21, 10,146, 34, 81, 20,149, 19,184,236,206, 95,148,177,131,216,104, 15, -110,168,167,108, 60,209,182,123, 57,246,138,169,146,133, 91,117,142, 38,105,152,127,215, 43, 89, 24,145,251, 10, 7,241,197, 84, -154,117, 14, 91, 72, 18,147, 35, 46,114, 97,104, 83,107, 42, 39, 25, 0,249,254,115,167, 66, 11,229, 77,120,141, 0,191,209, 21, - 33, 25,229,241, 84, 82, 74, 83,146, 59,103, 90,221, 94, 77, 82,101,118,154,148,130,244, 86,221,202,228,255, 0, 60, 39,160,229, - 89,254,119,200,247,211,203, 6,164, 88,105,150, 65,236,148,131,147,213, 56, 24,206, 62,221, 45,195,237,153,206, 43,169, 51,119, - 73,100,164,125, 34, 72,211, 64, 97, 96,110, 1,191, 81,243,214,210, 12,210,138, 24, 41, 40,102, 89, 57,178,213, 33,105, 1, 32, -244, 32,111, 96, 45,125,246,219,221,139,140, 97, 48, 58,236,154,131, 46,153, 46,146, 87,204,146, 82,132, 15,242,109, 36,167,167, -132, 6, 59,119,206,190,200,170,100,132,160, 21, 41, 56, 1, 36,134,210,133,100,156,114,158,195,191,225,170,166,170,211,105,248, -149,212,255, 0, 59, 56, 36,156,100, 15, 64,113,246,235, 24,171,213,226, 60, 10,142, 60, 84,244, 75,137,232,164,103,245, 65, 82, - 71, 80, 58,100,117, 7, 79,209, 82,242,147, 69, 59,116,245, 27,159, 93,250,111,240,235,241,195,116, 85,144, 77, 56, 50,195,229, - 27,121,122, 40, 22, 2,202,123, 1,254, 33,247,226,229, 38, 74,212,210,138,159, 75, 96, 2, 2, 89, 3,156,146, 72,192, 46,118, -242,234, 6,176,138,131,208,130,143, 59,105,144,180,243, 97,114, 84,183, 74, 71,117, 30, 85,124, 41, 72, 32,103,160,201,234, 15, - 82, 53,100,169,214,165, 52,218,131, 78,182, 91, 7, 5,229,115, 43, 41, 62,101, 9,253, 85, 99, 29,115,128,122, 16, 53,132, 78, -168,190,250,242,169,137, 87, 33, 4, 48, 26, 80,111, 0, 28,172,132,175,226, 56, 4,128,162, 71,159, 77, 32,237, 34, 54,153, 1, - 86, 59,239,247,110, 15,243,248,219,221, 40,164,162, 89, 84,201, 21, 66,136,191,195,112,122,116, 32, 11,143,131, 90,221, 78,196, - 28, 93,170, 53, 86,220, 45,182,214,121,193, 56, 75, 24,202, 63,156,175,242,120, 8, 79,194, 49,147,208,172,140,107, 28,144,185, - 14,165,196,243, 54,128,227,107, 95, 40, 1,247,148, 10, 82,160,148, 36,114,161,156, 18,146,126, 53, 99, 7,225,193, 26, 21,201, -165,223,209,170, 87, 43, 69,196,145,224,199,109, 32, 21,142, 84, 37, 68,147,135, 50, 73, 61, 7,235, 99, 61,180, 42,150, 9, 83, -110, 45,199,193, 66,138, 91, 83,156,173,178, 57, 84,149, 20,132, 36, 4, 47, 4,158,234, 33, 74, 7,212,107, 34, 85, 36, 91,174, -195,111,187, 14, 2, 4,136, 88, 88, 50,239,114, 9,216,252, 64,239,107,131,210,253,111, 96,106,135, 9,241, 91, 90,152,154,224, - 81, 10,117,183, 66,150,132,132, 32,132,199, 90, 18, 18,211, 62, 25,202,136,229, 86, 80, 71, 55, 78,180, 86,211,138, 90,218,109, -210,132,173, 42, 40,195, 97,226,160,188,146,149, 61,202, 17, 24,252, 7, 4,147,128,148,146,114,179,143,162, 72, 66, 20, 93, 82, - 91, 32,243,151, 0, 13,184,226,121, 87,250, 54,210,216, 3, 57, 40,248,112, 84, 48,188,119,233,112,142, 86,234, 29, 75,124,173, -161,158,235,112,133, 50, 75,156,174, 56,246, 66,135, 48, 3, 10, 10, 0,128, 64, 10, 4, 29,108, 70,250,118,191,227,252,183,237, -110,134,223,125,175,163, 80,140,221,139, 15, 94,194,214,251,186,251,205,239,140,110,108, 82,150,189,228, 33,212, 54,225, 10,142, - 29,108, 40,168, 1,209, 40, 65, 63, 3, 28,169, 5, 42,200,193, 95, 80, 71,124, 14,168, 18,210, 86, 21,203,202, 82,160, 8, 0, -169, 41, 24, 9, 81, 60,184, 87,196,165,224, 12, 28, 28,231,190,156,202,203, 43,100, 60,180,187, 46, 83,142,128, 90, 68,167, 20, - 70, 74,148,144,167, 1,235,149, 35,157, 71,249,216, 72, 0, 37, 61,155,106,154, 76,153, 41,136,149, 4,169,231,163,196, 66,202, -129, 9,117,245, 33,158, 98,160,112, 71,136,224, 32,158,132,126, 26, 84, 48, 2,250,134,223,233,191,126,157,125,253,112,216,241, - 18,202,161, 65, 55, 29, 0,222,246,181,135,238, 29,126,252, 64, 99,219,127,112,181,112,123, 74,183,173,166, 28, 82,255, 0,130, -214,206,212, 89,178, 82,176, 66, 90,159, 67,176,105, 47, 75, 67, 68,147,204,215,137, 82, 24, 35,204, 30,154,228,170,206, 51,216, -231,166, 58, 99,237,251, 53,183, 60,121,238, 60, 93,220,227, 99,138,189,200,132,233,122,157,114,111,133,244,154,114,249,150,180, -154,125, 6,168,171, 94, 25,104,172,228, 50, 89,161,161, 72, 29,130, 92, 0,116, 26,212,101,246, 56, 61, 59, 96,227, 63,241,212, -247, 43,140,165, 5, 18,176,179, 8,144,144,122,130, 84, 18, 62, 32,155, 28,114,150,121, 50, 85,103,185,197, 66, 29, 81,207, 87, - 80,202,123, 21, 51, 57, 82, 15,189,108,126,252, 8,178, 15, 79, 76,232,117,245, 36,142,192,224,252,191,179, 85,214,174,254,137, -207,231,246,104,101,224, 28,231,161,235,248,233,200,126,252,104, 1,220,109,129,221,230,199, 97,142,189,189, 51,215, 63,159, 61, - 14, 64, 0, 96,247, 29,126, 71, 68,169, 89, 62,120,252,245,208,202,238, 79,204,253,154, 92,108, 5,240, 48, 58,192,202,135, 67, -215,243,231,249,198,133, 81, 3, 57,249,224,119,237,229,162, 28, 39,169,249,249,126,125, 52, 26,200,251,199,127,179, 74, 45,198, -227,126,216,200,253,248,160,178, 50, 58, 3,211,207, 63,184,253,186, 90,240,163,147,159,195,236,210,210,184, 24,175,170,168, 61, - 49,215,167,225,161, 16,112,122,156,116,213, 97,248,103,161,251, 51,164,216, 90,227,174,173,255, 0, 60,100,245, 38,214,190, 14, - 73, 56, 0,142,152,239,145,247,116,213, 66,176, 7, 82,172,142,216,249,246,207,222, 52, 58, 84, 83,211, 29, 7,111,236, 58,242, - 80,162,174,101, 47, 8, 61,128,206, 71,222, 7,174,116,131,222,222,236,101, 69,254,127,150, 46,141,168, 96, 0, 57,137,206, 73, -254,145,243,192,215,213, 44,173, 73, 8, 39, 9, 56, 87,124,103,247,245,254,141, 80,105,188,242,146,174, 81,158,128,117, 61, 49, -215, 25,244,209,205,167, 57,192,206,127,164,117,237,249,237,164,172, 79,207,166, 48,109,219, 21, 90, 56, 35, 35, 32,143, 46,221, - 61,125, 15,125, 28, 57, 72, 79,160, 62,127,205,251, 62,125,244, 50,121,112, 0,252,253,190,154, 37,176, 85,142,192,124,135,244, -231,207,166,177, 97,123,227, 24,184,178, 15, 76,159, 82, 63,163,247,234,184, 24, 57, 24,201, 57, 7, 31,135,219,161, 16,175, 35, -231,219,250, 49,162,146,113,220,245,232, 65,198, 59,246,199,175,246,233, 22, 22, 36, 97, 50,187,220,155,223,231,255, 0, 56, 37, - 43, 8,199, 58,186,159, 32, 59,244,249,104,146,238, 70,113,140,249,250,227,183,159, 77, 4,113,144,190,153, 63, 44,227,184,200, -252, 53, 81, 36,116, 32,231, 29,201,251,125, 7,150,146, 98, 58,223,225,130,219,221,123,117,193, 41,119, 24,248,249, 64, 32,224, -227,175, 94,160,122,244,206,167, 39,236,166,220,118,247,115,129,157,165,148,252,148, 73,171, 88, 74,169,237,245, 93, 33, 73, 46, - 54,186, 44,133, 38, 1,113, 61, 74, 65,132,228,126, 92,227, 35,168,212, 42,118,215,108,110,189,211,185, 98,219, 86,181, 49, 83, -231, 73, 5,229,186,227,137,139, 78,167,194, 66,128,145, 85,173, 84, 93, 79,135, 74,164,183,252,247,156,234,162, 66, 26, 67,174, -148,160,203, 23,217, 2,214,215,112,241,106,238,110,209,215,119,102,143, 34,181, 87,151, 2,239,168, 76,172, 75,110,139,108, 53, - 53,136,201,133, 34, 21,179,239,238, 5,184,218, 82,218, 11,139,119,149,215, 15,196, 91, 66,126, 17, 4,227, 9,104,167,142,154, -137,228, 6,169, 95, 86,155, 95, 74, 21, 96, 75,158,136, 11, 5, 3, 81, 26,142,194,230,246,184, 60, 26,124,214,135,136,167,204, - 41,105,100,124,178, 88, 36,167,158, 80, 44,129,137, 73, 35, 0,159,180,193,212, 2, 20, 18,129,238,218, 65, 23,235,214,231, 75, -174,219, 59, 83,184, 21,235, 93,151, 30,184,224, 91,147, 13, 27,193,104,188,236,105,178, 18, 35, 38,162,134, 82, 50,234,163, 33, -213,188, 0,207, 86, 70,181,171,102,120, 8,183,217,222,155,115,124, 46, 59,138, 53,229,105,208,108, 90,123, 86, 21, 10, 66,223, -155, 42,179,121,215, 33,166, 69,211,124,221,210, 95,234,244,211, 45,231, 83, 25,177,128,216,198,122,164,107,107,162,239,150,195, - 32,148, 57,188,187,110,233,193, 75,141, 34,227,167, 60,130,146, 48,180, 45, 33,226, 20, 8, 39, 35,207, 26, 14,226,227, 7,134, - 29,183,182,107,183, 12,173,200,163,213,169,246,180, 23, 39,205,163, 89,141,125,115, 86, 84,102,186,172, 83,169,144,129, 84,133, -127,178,128,126,237, 65,225,142,150,158, 82,226,162, 33,169,116, 0, 89,111,114, 69,200, 23, 59,157,133,183, 61,135, 91, 99,179, -242,190, 62,226, 28,135, 33,205,114,204,161,165,203, 70,109,205,246,202,132, 82, 30, 74, 87,138, 56,249, 76,250,117, 70,177, 5, -155, 76,136,234,116, 85, 84, 45,129,101, 97,144,207,224,179,103,238,181, 56,183, 81,123,208,158,152,250,158,156,245,169,125,220, - 20,116, 60,235,202, 42,121,197, 48,137, 42, 66,150, 73, 60,184, 78, 0, 56,244,208, 91,129,114,240,113,236,166,216,187,155,114, -235, 20,202,117,183, 21,229,201,153, 69,162,189, 37,138,222,236,111, 13,232,227, 74, 84, 26, 29, 62,109, 77, 74,149, 44, 56,247, - 39,140,233, 40,139, 17,165, 41,231,112, 0,207, 27,248,128,250, 66,114,226, 82,170, 52,190, 16,184,115,190, 43, 19, 3, 14, 52, -141,201,220,155,106,174, 41, 84,247,112, 66,100,195,183, 41,209, 86,185, 78,160, 14, 96, 30,113, 8, 56,248,186,103, 81,143,226, - 11,136,157,247,226,127,114,100,238, 30,253,238, 45,126,244,188,158,105,214,162,199,173, 62,168,205, 81,169,238, 40,172,211,168, - 86,223,192,221, 6,154, 50, 7, 43, 76,160,168, 1,206,181,158,186,127,203, 56,124,207, 46,161, 18,211, 34,253,166, 54, 14, 6, -215,180,103,204, 24,247, 50, 42,129,179, 89,197,215, 20,239, 27,253, 36,248,135,244, 13, 71, 12, 80,113, 94, 97,196, 20,179,105, - 38, 7,168,168,108,188, 50,127,118,243,135, 96,181, 38, 34,111, 20, 96, 58,169,220, 60,100, 95, 24, 39,180,115,137,253,201,226, -247,127,170,251,223,186, 82, 27,254, 16, 94, 74,118,124, 26, 44, 87, 92,118,155,105, 91, 81,121,162, 91, 54,141, 31,196, 63, 13, - 58, 13, 59, 9,230,192, 47, 62,243,210, 23,241,186,117,175, 92, 57,196, 97,202,237,211, 57,208,178,252, 42, 34,147, 24, 1,211, - 46,149, 5, 18, 60,253, 6,173,251,228,231, 53,219, 29,128, 65,247, 42, 12, 6, 79, 41,200, 5, 73, 4,129,215,191,174,178, 14, - 26,216,118, 93,122,230,134,202,121,164,204,167, 68,139, 29, 9,238,183,223,119,194,101, 41,207,153,113,104, 31,126,172,212,141, - 41,120,124,197, 24,209, 26, 34,128, 46,118, 28,192,119, 59,147,183, 82, 73, 39,169, 36,239,142, 53, 53,117, 21,115,214, 86, 85, - 74,211,213, 84,180,178, 72,231,118,103, 42,204, 73,176,238,123, 0, 0,232, 0, 27, 98,109, 63, 71,223,128,234,125,203,195, 15, - 16,156, 74,220,244,174,123,199,114, 99,200,218,237,155,145, 45,177,136,116,123, 98, 92, 90,221,217, 83,134,149,167,225, 85, 82, -187, 18, 29, 56,186, 15,197, 30,152,164, 14,138, 57,216,168,246, 17,161,213, 31,142,228,117, 50, 90,146,235, 97, 10,230, 75,225, - 8, 56,228,115,185, 67,169,229, 41,229,239,204,112, 8, 58,236,151, 0,219, 99, 15, 98,184, 76,225,239,107,105,113, 83, 17,187, - 99,109,109,231,167,180,148,132, 41, 85,138,164, 38,234,181,105, 14,116, 28,206,174,124,199,201, 39,174,123,233,168,226, 23,134, -171,150, 93,110,226,220, 91, 38, 61, 58,161, 65,144,255, 0,214,146,168, 44, 62,182, 43,237,206,148,240,247,152, 52,168, 9,103, -146,167,207, 53,197, 58,202, 3,136, 63,166, 80, 94, 2, 65, 52,151, 19,209, 54, 99, 28, 89,138, 38,170,131,118,127, 82,142,117, - 40, 61, 55,137, 74,160,247, 13,239,215, 29,145,225,180,210,240,102, 89, 6, 69, 36,194, 24, 42,163, 73,100,212,214, 95,105,101, - 94,110,228,237,169,174, 22,254,128,108, 0, 3, 82,108,234, 84,116, 52,134,210,201, 41,147, 33, 50, 29, 8,240,203,143,186, 2, - 0, 83,220,201,207, 58, 67, 40, 7, 36, 0, 19,132,156,107, 99,104, 52, 8,210, 93, 98,116,150,210, 36,193,113, 47, 65, 13,129, -225,199,203,101,135,198, 79,235, 74,113,133, 41, 10, 89, 5, 32, 16,148,242,167, 36,170, 87, 15, 59,203, 71, 82, 20,230,223, 76, -148,128,134,151,205, 74,153, 75,168, 33,105,194, 64, 39, 19,144,162, 0, 37, 71, 41, 4, 99, 28,189,244,241,218,123, 83,186, 79, - 41,180, 35,109,238,133, 20,114,133, 45,113,162, 37, 61, 14, 28, 74,221,114,104, 72, 79, 81,147,216,245,198,162, 81,100,213, 74, - 64,146,146, 66, 91,182,134,244, 22,232, 13,237,215,211,210,214, 24,178, 78,125, 70,186,229,108,198, 24,237,177,102,158, 32, 0, - 54, 4, 18, 91, 96, 64, 3,222, 5,177,113,161,208, 12,134, 16,211, 10, 90, 34,143,242,202,115,224,151, 49,158,230, 50, 29, 74, -147,238,236, 18,160, 10,191, 89, 64,114, 35, 1, 74, 86,178,171,163,112,237,237,158, 85,185, 95,170,208,239,234,203,242, 38,132, - 82,227,109,214,216,222,251,153, 34, 51,212,224,196,176,253,106,153, 99,209,229, 46,149, 79, 64,228, 45, 41,208,217,144,176, 88, -142,149,168, 40, 7,150,209,216, 45,211,158,164, 57, 54,149, 73,183,217, 80,229, 46,213,234, 77, 72,113, 41, 0,142,127,114,166, -182,234,138,136, 63, 8,231, 66,124,250,119,214,136,251,111,106,123,151,194, 15,179, 87,116,183, 91,103,247, 82,225,178,183, 81, - 55, 54,223, 91, 16,111, 43,121,168,212,249,212,202,101,201,112,177, 6,177, 22,136,227,168,117,112,106, 47,198, 43, 67,115,185, -253,229,144, 74,152, 83, 75,194,132,166,147,135,179, 55,167,146,177,104,218, 8,163, 49,131, 44,171,101, 82,242, 36,105,101, 37, - 93,174,238, 0,210, 13,137,213,184,190, 34, 25,199,137,124, 27,150, 48, 25,157, 89,207,105, 98, 73,154, 90, 74, 25,209,101,153, - 68, 78,197, 69, 87, 38,162, 8,201, 42, 11,115, 17,137, 23, 64, 22,225,150, 51,124,116,238, 62,206,240, 93,121,221, 53,125,139, - 98,254,183,183,166,236,173,213, 46,123, 18,139,190, 78, 91,107,223,205,183,143,115, 74,157, 85, 27,132,254,217,209, 34,200,137, -176,244,148, 57, 59,154,223,149,118,189, 34,254,168, 6,195,212,202, 37, 1,178,229,101, 17,220,184, 46,123,134,236,174, 85,110, -107,134,183, 87,184,110, 58,228,233,117, 42,229,201, 93,156,253, 74,191, 90,168,206,125,114, 39, 77,169, 84,100,184, 86,235,239, - 72, 90,214,224, 4, 37, 74, 86, 72, 39, 36,218, 42,181, 73,149,138,165, 74,181, 92,157, 58,167, 88,172,212,165, 86, 43, 53,106, -148,217, 85, 42,173, 98,179, 80,115,198,159, 87,171,212,230,186,183,234,149, 55,158, 37, 78,200,125,199, 29,112,245, 90,142, 6, -128,109,101,110, 97, 36, 6,179,241,128, 71, 49, 62,185,242, 26,176,114, 30, 31,163,201, 33,178, 14,117, 76,191,106, 66, 5,197, -194,141, 9,251, 40, 52,128, 22,229,136, 85,214,206, 85, 72,164,252,120,250, 73,120,157,244,128,204,169, 36,227, 28,238, 99,195, -217, 60,113, 67, 69,150,137,165,120, 17, 41,193, 88,102,171,119, 98,213,213,195, 83,191,180, 77,245,112, 73, 61, 64,160,130,138, - 25,228,133,136, 90,148,234, 57, 93, 9,121, 9, 80, 90, 91,144,148,188,144,176,114,149,165, 14, 2, 18,224, 80, 4, 40, 96,130, - 50, 8, 58,204,169,155,143,113,209,211, 21,169,110,192,185,160, 68, 11, 17,232,183,173, 53,187,170,154,198, 82, 82, 61,205,249, -174, 9,212,229, 15,255, 0,131, 48, 54, 63,248,163,211, 24, 96,228, 10, 88,201, 41, 7,162,137,244,238, 63, 57,213, 53,164, 43, - 36, 14,185,200,252,159,150,159, 39,166,130,161, 52, 77, 10,202,163,166,160, 13,137,238, 13,174,167,222, 44, 71, 99,138,111,135, -120,167,136,248, 74,170,106,190, 27,206,170, 50,105, 42,192, 74,133,134, 66,176,213, 68, 13,249, 53,148,230,244,245,180,228,253, -170,106,184,166,129,255, 0, 94, 54, 24,116,231,239,189,238,150, 89,133, 64,254, 15,237,252, 36,248,206,123,141,131, 77, 48, 29, -151, 33,230,210,209,151, 80,170, 84,195,206,184,250, 26, 64,229, 8, 74, 50,160,149, 45,107, 8,109, 8,177,171,117,119, 10,108, - 7,169,170,189,110,207,170,159, 74,208,253, 57, 21,201,173, 71,113, 46,161, 40,144,133, 73, 74,196,165, 54,232, 78, 92,111,222, - 60, 37,149,168,148,124, 74,206, 0,166,219,230, 33,120, 36,117,206,124,251,143,219,175,170, 91, 74, 90, 19,207,241, 32, 19,200, -147,240,156,250,254,205, 37, 29, 21, 36, 32,133,167, 64, 24,223,236,130,111,182,228,145,114, 71, 98, 73, 54,218,248,156,102,190, - 58,120,209,157,242, 99,172,241, 87, 62,130,146,154,148, 80,197, 71, 69,153,213,101,153,108, 20, 34, 40,225, 52, 84,185, 86, 89, - 37, 30, 91, 75, 70,241, 68,139, 37, 45, 45, 36, 84,242,232, 13, 44,108,196,177,172,227,188,193, 37, 92,169, 75,105, 8,109,150, -208, 16,219,109,131,209, 13,161, 0, 37,180,228,147,128, 7, 82, 79,114,117, 72,146,163,205,129,140, 14, 81,216,140,129,158,184, -237,223, 94, 84,177,158,216, 4,224, 31, 32, 73,237,246,107,233, 9, 80, 79, 50,129,198, 79,194, 64, 35,215, 61,126,205,109, 95, -111, 47,109,189,216,170, 85, 2,233, 91,105, 10, 6,221, 0, 3,160, 30,158,131,165,177,229,212,133,160,131,128,125,112, 51,211, -236,243,208,105, 11,230, 60,201, 8,109,191,139,226,248, 78, 71,159,207,251,116,122, 20, 20, 50, 7,145,200, 61,199,151, 95,191, - 67,169, 36, 55,151, 49,215,161,201, 4,252,137, 0,246,233,161,179,111,219, 6,177, 6,221,251,126,255, 0,227,138,110,123,186, -192, 82,130,150, 8,200,194, 73, 3,182, 73, 31, 61, 75,227,232,215,112,195, 99,223,219, 35,198, 38,227,110,133,131,105,238, 13, -175,184,202,183,248,125, 93,173,121, 80, 32, 92, 54,253,118,207, 69, 45,203,170,246,167, 78,131, 84, 97,109,174, 60,137,213,122, - 35, 78,132,242,171, 48, 16,160,164,173,180, 40, 68, 24,149,143, 8, 54,158,138, 74,147,205,144,144,181, 99, 24, 3, 29, 15,109, - 77,123,217,103,184,103,103,189,143,246,187,116, 6,164, 81,171,123,149,186,219,227, 85,173,205, 79, 52,105,170,164, 82,174,168, -214,139, 78,199,144,180,167,195,143, 48, 82, 93, 67, 79,160,169, 10,102, 26,210,135, 57,138,185, 98,156, 99,155,193,146,101, 73, - 89, 80, 12,138, 37, 10,177,139, 6,150, 66,173,201,141, 9,232, 76,161, 9, 36, 16,136, 25,200, 33, 72,197,129,225,126, 86,115, -110, 47,162,164, 72,185,210,136,228,101, 7,117,187, 20,132,234,244, 26,101,111,190,214,223, 28,193,223, 63, 97, 79, 4,115,184, -194,185,209,179, 27,239,185, 54,175, 14,116,135,150, 47, 93,165,163, 83,105,149,186,237,191,122,205, 66,164,162,196,218,237,215, -185, 31,144,220,155, 36, 48,243, 62, 60,137,208, 39,207,167, 56,164, 69,140,229, 65, 78,120,204,111, 6,212,251, 26,125,155,123, -125, 58,216,185,109,203, 55,136,138,110,227, 80, 37,198,122,216,220, 26, 55, 21,119,221,175,121,219,245,200,177,194,145,114, 81, -170, 86,149, 42, 2,105, 21,166,212, 60, 80,227, 40, 75, 45,172,132,134,150,223,194,108, 27, 71,113,203,157, 91,184, 42,197, 34, - 81,147,122, 93, 21, 71, 34,115, 36, 46, 82,152,170, 10,100, 82,181,243,128,150,154, 17, 84,177,200, 6, 11,105, 81, 80, 1, 58, -222,155, 74,229,118,163, 38,164,121, 90,136,212, 8,204, 83, 34,180,202,131,110,158, 98, 36, 84,159, 83, 97, 28,172, 45, 43, 91, -109, 37, 72,230, 95, 43, 74, 4,164,144, 53, 71,103,220, 99,198,175, 58,200,217,245, 68, 48,132, 0,197, 3,242, 22,221, 8, 44, -154,100,147,169, 93, 83,188,174, 86,218,156,144,111,212,220, 79,225, 79, 9,228, 78,100,161,201,225, 89, 2,172,143, 33, 82, 89, -164,178,130,234, 9,180,107,204, 58,149, 35, 85, 80,157, 55, 14,113,212,219, 99,136,234,228,106,101, 18,155, 87, 66, 43,171,106, - 35, 20,230,230,213, 86,165, 86,106, 81,233,145,219,143,245,157, 94,162,202, 82, 39,213,158, 8, 74,228, 72,240,144, 31,125,213, -185,225,160,171,151, 78,181,189,187, 22,141,226,232,140,220,143,169,234, 75,115,193,110, 28,247, 27, 75, 82, 94,236, 27,137, 40, - 30, 71, 22, 72,232,147,202,162,122, 0, 78,185, 81, 30,244,240, 36, 85, 11, 97, 75,143, 66,134,205, 38, 36,144,114,151,170,110, -182,100, 75, 96, 4,171,162,144,234,163,165, 65, 32,245, 74,178, 8, 26, 10, 61,219, 41,136, 17,203,239, 31,124,142,204,154,156, -175, 13,210,158, 95,136, 52,201,108,142,169, 62, 50,148,126, 69,191,150,148,202,184,199, 54,167,208, 37,169, 53,106, 7,153,101, -243, 27, 0,162,250,143,152, 27,234, 59,146, 0,182,199, 21,248,142,186,130, 68, 16, 73,204, 22, 91,197, 37,200, 58,148,200, 0, - 63,105,108,186, 23, 99,179, 29,212,244, 27,233,106,113,119,182,151,183, 20,183,231, 10, 22, 90, 95,184,110,205,174,179, 85,117, -110, 45,213, 17,214, 92,183,173,234,168,126, 51, 38,204, 66,193,230,145, 91,105, 50,153,247,130, 7, 35, 78, 18,214, 74,210,172, -108,130,235,136, 99,157,106, 88,230, 57, 24,206,126, 30,184, 29,122, 99, 35,174,184,239,193,253,153,180, 27, 99,196,214,228,110, -244, 17, 42,218,187,248,132,179, 97,219,181,104, 40,144,201,180,230,222, 73,172,174,167, 38,226,195,235, 46,192,175,213,208,195, -104,125, 33, 94,236,228,180, 23,194, 91,114, 74,129,232,125,205,113, 42, 50,221, 64,113, 73, 41, 74,147,200, 62, 21,165,105, 39, - 60,201, 61,142, 2,178, 62, 90,181,184,106,180,102,212,111, 59, 48, 18, 60,132, 50, 0, 46,130,202, 66,144, 55,247,134, 61, 71, -223,105,215, 25, 75,194, 85,210,100,173,193,144,212,211,209, 46, 91, 68,149,130,172,222, 99,154, 8,239, 94,118,188, 98, 35, 41, - 2, 1, 17,229,242, 66,157,152,184, 14,149, 74,248,109,178, 71,136, 2,123,168,115, 2, 14, 14, 57,186,118, 32,228, 31, 62,191, - 45, 97, 51, 47, 98, 23,151, 29, 87,134,165, 30, 85, 12,144, 73, 56, 9, 36, 28,115,140,128, 50, 48,190,217,242,214,190, 84,238, -181,120,174, 53,206, 10,138, 20,251,121, 81,248,208, 14, 28,111, 62,153, 35,167,145, 94,177,148, 93,188,217,104,175,152, 41, 36, -165, 46, 12,115, 32, 15,137, 25, 36, 18,180, 96,127,181,202,144,175, 93, 74, 99,129, 80,108,110,126, 63, 15,221,249,252,113, 22, -167,164, 88,198,195, 87, 75,254, 23,239,215,227,252,142, 54,149,187,161, 46,158,100,184, 10, 85,203,158,101, 4,148,156,144,121, -194,199,192,114, 21,229,141, 90, 42,114,158, 91,107,145, 76, 8,113,208, 10,213, 17, 74, 45,161,212,100,229, 76, 41, 32,144,224, -234,174, 78,161, 92,159, 14, 20,113,166, 18, 37,213,201,202, 92,120, 40, 0, 57, 92, 36, 41, 65, 39, 56, 67,160,145,146, 15, 76, -158,152, 57, 32, 19,157,102,144,110, 4,175,225, 82,207, 50, 70, 72, 4,148,117, 57,200,207, 83,144, 6, 64,237,203,243,234,149, - 69, 58, 78,154, 36, 23,244, 61,193,236,111,235,211,249,140,110, 67, 81, 45, 20,162,104, 13,237,177, 83,114,174, 63,101,198,215, - 30,253,136,189,193, 83,190, 47,109,215,101,185,200,130,228,102,194, 92, 90, 75,164, 58,231, 42,146, 73,229, 80,113, 35, 60,189, -138,136,248, 74,128, 86, 58,234,234,212,199,221, 1, 78,200, 88, 33, 68, 16,142,102, 27, 82, 21,132,242, 40, 55,146, 82,112, 59, - 17,133, 39, 33, 64,231, 88, 13,198,183, 11, 6,169, 79, 9, 91,204, 2,185,108,130,176,149,181,132,149,201, 71,135,250,206,161, -180,146,226,123,173, 0,158,139, 29,113,232,181,233,174, 28,169, 77,128,142, 71, 27, 45,169,120, 83, 43, 79, 55, 50,121,143,249, - 64, 84,147,211,161, 24,193,202,134, 98,211, 43, 81,204, 98,153,246,107,216,216, 88,131,109,238, 59,250,223,241, 6,248,157, 80, -188,121,165, 42,212, 83, 34, 68,192,217,212,145,169, 24,117,235,185,235,117, 35,175,186,197, 67,227, 22, 64, 10, 60,141,168,243, -128, 10,146, 74,212, 91, 65, 32, 37, 74, 41, 42, 91, 32,227,252,152,234, 9,207, 49, 35, 87,149, 84, 92,140,217, 90, 25, 74, 60, -117, 4, 33, 47,165,213,199,195,201, 42,109,160,129,149,198,144,226,142, 19,206, 49,147,240,163,148,243,105,158,139, 82, 82,138, - 1,113, 92,142, 19,203, 33,183,156,229, 70, 87,204,203,109,242,184,163, 29,174,101,225, 33, 28,203, 82,148,148,148,231, 35, 87, -196, 84,214,134,138,188, 73, 40,112,151,217, 83,209,203,109,180,180,164,252, 94, 34, 22,162,183,100,103, 28,223,168, 83,130,148, -143,136,157, 47, 28,195,190,192, 88, 95,247,119,235,183,190,247,177,191, 77,244, 42,224,209,114, 95, 93,183,232,119,183,196,245, - 29, 59, 16, 63, 12,178,167, 82,117,101,214,158,116,143, 5, 24, 90, 23,206,135,176,149, 30,171, 28,152, 67,133,148, 37, 68,130, - 72, 82,136,233,216,106,111, 20,187,199, 75,216, 78, 31,183,187,123,107, 14, 3, 11,107, 54,178,243,187,194, 90, 57,118, 69, 74, - 29, 37,232,118,227, 17, 80,181, 15, 26, 67,151, 45, 70,140,218, 83,159,252, 98,186,121,105,253,153, 86, 47, 7, 9,115, 32, 43, - 45, 41,124,222, 48,200, 88, 62, 39, 83,200,159,140,117, 57, 42,192,233,231,168,229,253, 33,126, 36,209,101,112,247,183,156, 51, - 81,166, 20,220,123,253,118,139,190,234,105, 14,114,189, 19,107, 54,170,107, 47, 14,101, 54,172, 24,245, 77,192,149, 76,140,166, - 92,229,230,106,223,125, 65, 36, 5, 99,118,157, 26,170,122,122, 52, 39, 85, 75, 0,125, 66,117,118, 29, 62,202, 6, 59,122,116, -190,198, 41,159, 87,166, 83,147,230, 89,163, 16,134,138, 38,100,189,183,152,128,144,169, 29,124,210,178, 41,223, 96, 73,219, 16, -244, 92,153, 82,150,236,202,131,161,234,140,247,159,157, 80,125, 32, 97,234,132,215,151, 38,107,224, 96,116, 92,167, 94, 87,207, -155, 66,172,131,211,207, 61,115,246,127,110,136,115,169, 29,135,115,161, 87,230,174,152,245,239,216,121,254,124,181,105,160, 0, - 11,108, 63, 45,182,199, 34, 42,236, 13,205,207,174,253, 14, 6, 86, 50,113,249, 63, 47,150,135, 81, 10,242,192,235,159,159,204, -250,104,133,250,130, 20, 72,252,244, 26, 21, 71,161, 62,125, 79,223,165, 20, 18, 70, 21,192,234, 32,117,249,224,103,231,246,124, -180, 51,131, 57,234, 1, 4,245,209, 90, 17,194, 14,122,247, 57,199,203,231,165,199, 81,129,129, 85,211,167, 82, 79,115,242,244, -199,166,116, 42,200,207,108,117,199,219,215,207, 68,185,242,238, 7,159,111, 95,223,160,150, 79,126,152, 61,193,243, 61,127, 63, -118,148, 65, 97,210,247,249,255, 0, 92, 12, 82, 36, 2,122,129,247,254,255, 0, 61, 45, 81, 95,235,119,242,252, 62, 95,159, 93, - 45, 31, 3,108, 86, 29,251,103,229,162, 52, 42, 87,219, 61, 15,145,199, 76,131,229,170,129, 68,158, 94,108,116,207,111,159, 94, -190,189,244, 71, 2,221,108, 70, 14,195,173,190, 63,195, 7, 54,123, 21,125,223, 63, 67,162, 7, 95, 35,246,121,232, 38,240, 58, -100,147,243,252,247,254,173, 22,149,245,244, 62, 94,126, 95,102,146,193, 58,116, 56, 41,161,203,212,156, 99,200,252,243,216,104, -214,200,243, 0,253,248, 39, 64,165, 89, 29,191, 17,231,231,131,157, 86,108, 20, 44,168,172, 16,172, 1,159, 47,179,238,210,109, -233,109,135,242,198,113,112, 10,193, 1, 67, 4,249,129,223,237, 35,243,215, 68,167, 3,168,200, 39,161, 29,191,102,122,118,208, -169, 81, 32, 12, 12,140,119,237,140, 1,140,143, 60,232,128,172,100,156,100, 96,228, 96,147,246, 99,229,253, 58, 79, 24,193,141, -168,119, 61,113,211,239,233,131,248,104,132, 28,224,245, 56,235,243,233,235,143, 45, 0,133,103, 3,168, 4,250, 14,255, 0,105, -213,126,108, 17,133, 41, 57,207,234,250,255, 0,195, 72, 55, 94,183,198, 45,251,240, 96,194,212, 65,206, 15, 99,156, 99,167, 83, -223,166,178,107, 86,133, 46,228,174, 83,168, 84,230,131,242,231,203,102, 43, 41, 89,195, 69,215, 20,122,190,224,255, 0, 37, 29, - 13,165,110, 56,175,230,182,210,136,235,140,226,141,149,172,148, 40,242,164,140,243, 0,115,229,231,167, 83,107,106,201,163,215, - 27,102, 59,168,106,161, 80, 68,168, 17,165,168, 14,120,254,244,202,121,148,223, 55,119,212,203,110,165, 63, 53,159, 44,231, 74, -177,164,138,154,105, 34, 0,200,138, 72,248,250,159,147,183, 77,240,231,146,208,195,153,231, 25, 94, 91, 81, 57,166,167,174,158, - 24,157,199, 85, 87,117, 86, 43,125,181, 16,108,183,219, 81, 23,218,248,222,138,101,205,111,109, 53,188,139, 14,206, 6, 92,185, -106, 97,219,158,165, 20, 33,169,181,218,147,105,229, 75,211,229, 39,172,106,107, 74, 42, 76, 88,249,229,105,177,148,165, 78,169, -197,168,202, 52, 58,189,201, 45,107,152,251,134, 43,136,241, 26,136,133, 56,212, 96, 73,206, 22, 82,160,183,187,255, 0, 56,129, -159,230,233,172,181,109,231,101, 77,113,174, 96, 84,151, 11,234, 90,143, 58,214,238,114,165,184,181, 28,173,106, 39,185,234,115, -211,167, 77,109, 61,163, 22, 44, 22, 27, 91,137, 83,171, 74,128, 82, 1,207,234,158,188,201, 56, 29,255, 0, 15,232,173, 43,102, -142,152, 57, 86,230,207, 39,153,152,245, 98,109,185,219,238, 30,131, 97,176,176,238, 92,135,135, 96,160,165,130,158,154,139,217, -233,169,194,164, 80, 40,217, 20, 91,173,247,102, 39,119, 98,117, 51, 18,204, 75, 18,113,157, 88, 27, 77, 6,162,243, 10, 91, 45, -173,210, 17,204,134,249,192, 79, 80, 63,214,237,246,249, 13,116,123, 98,182, 58, 4, 74,205, 30,167, 79,136,195, 21, 8,242, 27, -109,110,132, 5, 41, 73, 87,235,167, 43, 4, 56,130,140,228, 96,131,208, 99, 90,225,182, 40, 67,142, 48, 16,148,176,211,139,108, -165, 13,164, 41,196,146, 1, 0, 28, 0,122,103,200,227, 93, 65,218,186,205,175,107,194, 23, 45,203, 58, 29, 22,218,182, 96, 72, -174,220,149,170,131,237,177, 22,155, 74,165,199, 84,185,211,101,200,116,132,182,210, 35, 52,242,142, 78,112,156, 0, 78, 6,171, - 12,238,173,234,222, 88,228,156,164,106, 9, 35,215,160, 2,195,177, 61,189, 58, 92,224,103,185,230,105,150, 32,167,167,102, 26, -193, 82, 7,165,183, 6,219, 90,219, 1,190, 56,205,197,103,181,207,127,173, 13,203,184,118,215,133,170,141, 31,104,108,203, 18, -227,169,219,114,110, 38,173, 59,114,175,120,222, 85,138, 12,199, 41,181,154,156,153, 53,154,123,241,232,148,133, 84,163, 74,110, - 60, 86, 88, 82,220,105,176,227,238,146,190, 68,232,182,233,123, 64,184,141,223,154, 60,154, 6,249, 57,181,123,167, 78,146, 84, -227, 18,107,187, 67, 98, 81,110, 42,116,165, 0,145, 34,159,117,218,148,120,114, 99,114,227,163,101, 42, 70, 84,115,229,173, 86, -221,155,170, 61,231,185, 27,133,121, 69, 66, 4, 43,174,251,188, 46,104, 37,150,148,210, 87, 78,184, 46,106,173, 86,152,226, 26, - 95, 86,138,160, 76,140, 84,147,241, 37, 74, 32,128, 65, 26,194,202,138, 27, 72, 66, 66,146,164,249,147,216,250,231,207, 87, 69, - 31, 7,240,224,142,134,170,163, 33,165,108,202, 5, 70, 19,180, 17,154,132,144, 1,186,205,167,154,132, 27,219, 75, 46,158,139, -101,216,113, 46,113,196, 25,150,101,152,213,213, 75, 88,211,164,146,185, 69, 33, 74, 4,212,116, 0, 45,109,150,194,253, 77,174, -196,146, 78, 25, 29,226, 14, 57,121,205,113,232,130, 3,142,211,225,184, 35,161,210,251, 60,158, 24,194,153,113, 74, 39,194,232, - 48, 51,240,246,211,245,236,251,162,194,185,248,143,179, 45,121, 83, 19, 21,250,213,203,107,181, 9,165, 71,118, 87,191,186,213, -102, 27,130, 3, 81,152, 66,148,243,239, 41, 41,105, 3, 24, 5,238,101,124, 41, 58,101,247,161,159, 22,181, 69,168, 39, 42,110, -109, 13,166,193,234, 48,228,124, 36,164,245,239,145,174,129,251, 9,174,186, 5,165,237, 66,225,233,203,134,153, 75,169,179, 93, -122,232,183,105,102,171, 29,185, 77,211,107,245, 27,114,161,245, 77, 90, 19,110,130,148, 84,153,121,149, 6, 86, 70, 82, 94, 37, - 63, 16, 4, 76,106,145,166,225,202,216,163,115, 19,154,118, 0,141,244, 17,182,175, 48,111,179,107,216,131,211,124, 55,240,245, - 50,102,121,237, 29, 36,238, 33, 74,218,128,140, 64, 27,115, 13,172,189, 64, 38,246, 91,130, 3, 17,112, 70,216,253, 60,108,203, -170, 61, 38,218,163, 69,169,210,215, 6,123, 52,168, 12, 42, 18, 30, 74,149, 13, 45,197,109, 30, 2,136,232, 84,156, 96,142,195, - 24,211,173, 99,205,135, 95, 67,163,195, 82,216,105,226,174, 71,124,148,149, 2, 51,235,129,141,105, 44, 90,227,175,203,110, 58, -159, 60,234,145,200,227,139, 86,113,133,225, 74, 81,201,236,156,159,187,231,170, 28, 4,113, 50,246,254,220,188, 78,211, 27,167, -174,157, 67,217,253,200, 98,198,160, 62,226, 84,149,213,154,110, 59,134, 85, 65, 74, 80,193, 38, 67, 46,128,145,156, 36,167, 56, -206,171,117,160,130,138,122, 97,237, 82,206,210, 2,164, 74,193,245,233, 0,234, 42, 2,170,144,127,100, 1,189,173,233,213,116, - 57, 94,103,152,229, 89,246,102,140,213, 17,228,201, 12,179, 73, 36,128, 58, 9,234, 18,153, 52, 40,182,162,210, 72,183, 8, 0, - 85, 5,141,128, 24,234, 84, 22, 97,190,160,211,140,160, 37, 73, 9, 37, 39,151, 35,203, 4,118, 61, 53,114,153, 78,153, 71,107, -235, 40, 14, 61, 50,158,222, 60, 88,104, 36,186,207,108, 43,161,248,155, 29, 63, 29, 97, 20,201,202, 47,103,152,116,235,202, 79, -126,158, 94,167,229,242,211,203,110,200,247,142, 86,186, 45, 43, 28,139, 74,199, 69, 36,140, 40, 28,142,185,211,232,142, 26,149, -210,124,143,250,172, 54, 32,246,233,212,123,143,108, 87, 57,193,168,203, 88, 74,126,186, 30,174,140,110, 24, 27, 95,115,186,183, -163, 11, 88,251,182, 38, 90,149,147, 81,103, 43,113, 42, 36,101, 41, 4, 97, 63,236,131,246,106, 57,159, 74,191,116, 98, 90,254, -207, 59, 39,109,189,229, 13,212,183,107,126, 44,232,173, 70, 10, 79,139, 34,151,103,194,170,220, 21, 37, 33, 4,228,182,151, 83, - 3,152,129,211,196, 79, 81,158,178, 30,102,146,109,219,145, 41, 96, 40, 65,169, 43,197,142,145,209, 8,117, 68, 7, 25, 3,237, - 80, 32,127,181,168, 24,253, 41,190, 42,105,187,177,198, 54,217,240,225,110, 85, 81, 54,139,195,101,145, 34,125,214,152,206, 7, - 99,181,184,187,128,182, 37, 59, 9,124,170,199,189,197,183, 98, 83,146,176,122,161, 83, 8, 58, 74, 58,202,145, 17,201,101, 26, -102,168,170,131, 88,244, 90,105, 22,173,158,223,176,226, 5,136,155, 90,243, 32,234,192, 98, 1,158, 71, 76,139, 85, 95, 79,189, - 36,176, 18,155, 91,205, 48,228,232,235,246,147, 91,189,183, 39,148,198,196, 2,113, 23,105, 12,224,142, 92,114,128, 57,115,230, - 60,193, 31,158,218,166,220,116, 96,148,167, 35,185, 0, 30,135,231,131,219, 70, 58, 91,112,228,147,129,219,200,129,212,245, 26, -163,239, 1,162,164,182, 58, 16, 2,148, 48,123,246,233,248,234, 69,123,110, 78,199,253, 49, 95,238,192, 91,182, 41,184,218,146, -112, 2, 85,145,205,128,115,240,232,117,175,166, 2,185, 84,122,144,123,252,146, 48, 58,249,126, 26,246,165,183,205,207,226,242, - 41, 68, 0,146,160, 57,188,186,141, 8,236,164,182,248, 10, 66, 79, 40,192, 24,234, 78, 51,205,246,235, 5,182,178,131,140,233, - 61,206, 62, 37, 37,100,130, 84,143, 85, 20,247,251, 9,215,196, 52,218, 22, 28,108, 23, 20, 73, 10, 73, 32, 16, 58,117, 3, 29, -117,111, 83,203,146,247, 41,116,161,190, 96,162,140,245, 64, 79,113,246,247,209,173,134,220,112, 58,130,174, 68,156, 21, 96,167, - 56, 29,142,124,186,235, 23, 38,226,214,237,108, 24, 0, 8,223,231,108, 84,202, 80,181, 45, 75, 37, 10,236,140, 14, 84, 19,208, - 21, 19,249,206,145,240, 91, 89, 35, 4,168, 2,181, 39, 36, 1,143, 63,207,219,175, 14,180,248, 91,135,225, 44, 44, 19,203,230, -113,158,202, 35,190,147, 72, 75,188,184, 10, 97,180,167,149, 94,101, 68,116,193,200,235,219, 67,113,176,234, 62,253,255, 0,241, -140, 88, 27,158,199,247, 99,223,138,128,176, 16, 74,202,192,200, 64,234, 51,216,159,151,174,144, 56,112,168,255, 0,226,210, 65, - 39,211,169,193, 30,191,219,161,201, 91, 97,101, 11,229, 33,124,169,112,164, 97, 67, 25, 41,193, 29, 62,221, 18,149, 30, 64, 28, - 41, 83,138,201, 81,233,203,131,211, 7,167, 95,158,178,160,129,238,248, 99, 4, 11,219,211,111,159,187, 23, 91,122,216,174,223, -151, 45,171,103, 91, 30, 48,173, 94, 23, 45, 2,211,161,169,134,124,101,166,185,117,214,160,219,116, 71, 18,206, 63, 72,148,213, -170,176,202,135,110, 84,156,234,116,188, 70, 90, 86,214,200,237,141,191,195,253,145, 22, 45, 26,196,217,203, 30,212,219, 59,118, -140,216, 15, 52,105,182, 85, 52,210,220,144,228,146, 7,188, 57, 58,187, 14,173, 81,121,213,101,199,100, 86,221,117,213, 5,175, - 81, 5,246,122, 41,151,120,231,225, 49,165, 45,167, 25, 70,253,237,171,138,109, 68, 6,138,152,185, 35, 72, 66, 58,164,128, 60, - 86, 81,140,142,248, 24,212,167,184,174,185,213, 80,146,133, 73, 46,189, 42,116,101,176,243,171,116,136,206,165, 92,181, 24,242, - 29, 66,122, 56,175,137,244, 12,128,174,102,202,115,202, 19,170, 83,197, 9,101,168,206,184,107, 46, 36,242, 99,215, 57,177, 27, -176, 33,119, 7,246, 0,242,159,241,145,183,126,148,250, 56,229,176,205,157, 87,230, 36, 3, 52, 82, 67, 18,237,186, 42,142,113, - 96, 78,222,114, 22,253,238,138, 65,198,134,236,221,125, 48,227, 85,230, 51, 33,182, 20, 46,139,193, 78, 71,146, 11,172,173, 49, -107,213, 39, 22,218,176, 65,104, 45,181, 17,240, 28,231, 10, 57,192,214,224, 91, 87, 56, 52,186,124, 87, 37, 60,195, 17, 27,114, -181, 86,168, 52,165, 33,208,211,232, 84,135, 35,180, 82,172, 45,194,149, 57,206, 62, 17,225,181,156,149, 19,174,110, 88, 21,191, -119,114,244,165,183,202, 67, 27,155,118,199, 87, 58,178, 4, 89, 50, 96,212,208,176,140,117, 30, 4,208, 18, 6,122, 47,168, 24, -193,216,148,220,233, 17, 19, 8, 58,234,126,185,152,195,115,214,218,208, 94, 77, 49, 13,178,244,133,248,196, 0,223,193, 29,180, - 33, 36,116, 68,133,242,242,101, 71, 81,250,188,185,106, 15, 67,113, 99,239,183,107,245,232, 9,183,107,219,224, 58,227, 63,165, -142,190,158, 48, 77,158,254, 98, 55,217,118, 36, 14,246, 5,200, 7,112, 64, 22, 35,166,219,210, 47,185, 82,233, 80,131,107,114, - 60,217, 83, 30,159, 55, 1, 97, 10,126, 99,143, 59,200, 93, 39, 36,248, 79, 52,216, 74,146, 85,208,149, 28,227, 87, 58,150,229, - 67,154,202, 4, 96, 35, 72,171, 77,110, 44, 73,100, 36,180,229, 58,157,136,136, 91,136, 10,230,111,157,193, 37,215, 17,208,101, -244,168,228,117,214,181, 64,187,158,122, 93, 82, 99, 15, 54,251, 37,214,153,128, 31,117, 72,105,199, 39,177,225, 23,146,164,156, - 48,194, 20,135,157, 91,128,140, 41,148,243,100, 17,156, 82,117,230,220,185,110, 46,150,234,204, 86,210,213, 38, 18,207, 68,178, -246, 20,194,221,232, 57,159, 45, 69, 67,133, 75, 72, 8, 74,217, 4,243, 28,107, 65,114,134, 28,192, 19, 72,150,215,216,116,216, -247, 29,143,240, 35,215, 20,246,103,146, 44,245, 78,252,176,174,237,171, 80, 54,208, 8, 14, 67, 30,182, 4,169, 0,130, 8,141, -150,215, 27,108,165, 82,240, 65, 91,130, 60,226,182,132,167,101,192,151, 29,238, 83, 25, 20,197,120, 81,158, 74,218, 87,253,240, - 30, 74,156, 5, 56, 40, 82,144, 70, 78, 52,237, 90, 94,211,206, 31,238, 61,215, 87, 13,251,187,120,211,246, 99,125,216,166,219, - 53, 27, 46, 70,225,213,169,180,173,188,223,218, 29,126, 20,116,211,238, 11, 14,254,117,214,224,219,183,114,235, 2,165, 77,157, -110,215,151, 5,255, 0,172, 41,143, 26,124,233,201, 95,132,215, 47,235,155,134,253, 49,169,137,139, 33, 17,217, 13,120,112, 82, - 15, 49,240, 35, 44,163,195,112,169, 32,252,110,120,100, 14,255, 0, 6, 84, 78,117,197,111,105,134,220,238, 93,231, 65,219, 45, -247,167,109,213,197, 90,217,251, 58,155,114,237,149,225,186, 16,105,102,169,111,209,111, 26,133,206,237,223, 6,220,186, 37, 68, - 46, 57, 71, 74,105,117,120,239,199,126, 99, 76,195, 90,234,170,101,153, 10,125, 14,182,139, 3,128,178,227, 14,113,200,102, 49, -197, 94,146, 41, 26,186, 58, 14,100, 76, 1, 54,102, 4, 50,105,239,205,107, 48,109,241, 25,226,106, 58,222, 29,225,154,236,230, -154,152, 85, 54, 88,209,177,136, 41, 60,216,218,101,137,193, 42, 24,198,232,143,175, 85,138,168,137,139, 93, 73, 6,112,183, 37, - 78,163, 2, 75,208,150,135,161,212, 82,216,153, 17,169,141,173,151,176,166,195,172,115, 50,232, 25,142,243, 42,192, 88,248, 20, -135, 67,169, 82,146, 1,214, 30,110,102,229, 6,164, 37,229,248, 15,167,153, 14, 21,167,199,131, 45,149, 41,178,218,193,232,133, - 37,208,234, 20,133, 14,138, 74,146,161,200,172,136, 53,240,131,237,106,226,159,133, 24, 84, 59, 53,218,219, 59,239,178, 52,133, -176, 33,109, 62,233,213, 42,115, 87,110, 83,210, 19,207, 27,108,183, 21,133,187, 86,176, 89, 90, 16,222, 98,161, 83,232,235, 9, -248,233, 74,207, 48,145,223, 13,254,212,238, 15,184,152,159, 78,162,209, 47,183, 54,118,249,175,188,219, 14,237, 94,249, 74,164, -218,245, 37, 92, 79,169, 49, 99, 27, 63,112,216,112, 91,183,164,105,106, 74, 80,226, 84,253, 38,123,107, 83, 14,125, 94,162,183, - 66,108,186,204,183, 48,166,102,149, 71, 62,156, 30,169,168,233, 30,174,159,105, 0, 23, 14,192, 50,168, 43,245,131, 77,196, 95, -135,248,215,135,243,244,142, 40, 42,125,147, 48, 63,251, 60,246, 73, 9, 31,170,141,253,220,164,236, 80, 35,107,102, 86, 28,176, - 93, 65,235,149, 54,227,231, 82,252, 98,143,120,111, 30, 50, 3,153, 10, 74,242,148,190,207, 95,141,149, 1,219,201, 64,160,158, -157, 92, 10, 45,120, 41, 72, 30, 42,210,211,129, 60,138, 36, 39,194, 40, 56, 9,201,199, 34, 15,194, 82,125, 71, 47, 98, 51,173, - 78, 57, 42, 4,150,225, 74, 68,136, 85, 24,204, 38, 66, 27,148,194,153, 91,140, 60,112,210,188, 53,165, 42, 92, 71, 18,144, 65, - 31, 2,199, 43,141, 41, 93, 9,204,232,245,213, 45, 41,192, 82, 28, 24, 15, 5,245, 67,125, 1,240,211,143,214, 37, 36, 97, 93, -148, 8, 56, 7, 58,212, 89, 53, 45,155,126,155,250,244,189,247,220,131,214,195,222, 7, 80, 36, 83, 0,111,109,143, 66, 55,176, -233,219,176,244,244,232,113,182,208,103, 41,109, 2,130, 8, 28,170, 10, 7, 24, 72, 25,194,155, 35,170,130,179,216, 16,115,215, - 3, 58,111, 43, 10,114,143, 57, 62, 8, 83,116,247,138,158,104, 35, 42,247, 7, 50, 75,237, 35, 36,226, 62, 87,206, 17,241, 16, - 21,132,140, 32, 1,125,182,231,180,168, 76, 58, 9, 40, 84,116,130,133, 30, 98,133, 5, 4,164,144,145,213, 29,122,131,213, 61, - 0, 36, 29, 13,118, 6,157,142,165,164,161, 74, 66,131,137, 36, 16, 75,137, 11,198, 66, 58, 1,225,133,117, 7,177,199, 76,105, -179, 52,167, 21, 20,206, 20, 94, 88,188,203,247, 14,159,247, 13,175,219, 99,141,204,138,188,229,245,233,172,222,154,164,132,144, -123,143, 71,223, 96, 84,155,244, 59,106, 94,135,127, 84,218,177, 40, 8,109, 77,171,152, 21,173,176,163,224,169, 71,153, 72,125, - 10, 73,232,160, 71, 80,122,228,147,140,224,235, 37,102,160, 10, 82,164,185,132, 45, 57, 74,215,202,149, 96,228, 37, 5, 93, 73, - 30, 65, 68,115, 96,128, 73,233,134, 98,157, 41, 13, 56, 75, 78,101, 30, 32, 41,200, 60,139,109,106, 31,174,223, 79,137, 36, 30, -189,207, 76,140,117,214, 72,221,101, 45,182,162,165, 36, 32,100,243, 41, 75, 81, 70,115,204, 0,245,193,235,219, 60,157,117, 24, -134, 67,166,254,131,225,214,223,195,240,185, 63, 9,141,122, 6,118, 85, 58,239,247, 92,246,191,191,212,255, 0,166, 51, 26,229, -207, 71,161, 82,171, 21,250,253, 86, 21, 10,222,160,210,170, 53,218,245,110,162,164,183, 78,161,208,104,176,228, 85, 43,117,153, -206, 45, 73, 9,137, 18,151, 18, 91,238,228,225, 72,142,160,158,165, 57,252,241,248,236,226,198,175,198,143, 19,187,139,190,210, -211, 34, 37,167, 54, 67, 54,134,209, 80, 36, 40,149, 91,187, 67,106, 59, 42, 29,153, 29,224, 82, 63,247, 86,123, 78,203,172, 84, - 21,128,163, 54,224,117, 10,232,210,117,219,143,110, 55, 31,168,247, 9,220, 13,237, 45,117,106,153, 60, 65,155,196,245,118,153, - 33, 73,250,186,148,129, 22,167,110,108,123, 50,218, 88,204,249,174, 8,181, 59,157,180,158,102, 99, 49, 2,144,247, 42,222,154, -216,140, 58,201, 42, 87, 55, 92,245, 24,242, 62, 93, 51,208, 99, 86, 23, 10,101,174,168,115, 74,133,179,204,161, 98, 4,110, 35, -184, 38, 79,255, 0, 83,109, 63,224, 1,129, 34, 76,115,135,139, 28, 75, 29, 69, 68,124, 51, 69, 46,168,168, 95, 93, 91, 41,184, -105,192,178, 67,126,252,133, 36,200, 55,250,214,208, 64,120,119,164,226,207, 66, 6, 58, 99, 61,253,127,110,168, 40,146, 14, 79, -145, 3,176,234,117,236,175, 32,140,119,245,254,173, 14,178, 50, 7,166,115,251, 53, 54,197, 56, 6,195,215,223,143, 26, 25,222, -163,190,112,127,103, 95,199,190,136, 80, 4, 28,249,117,233,242,208,171,236, 62,223,191, 74,170,144, 55, 30,252, 27, 3,172, 12, - 19,233,219,241, 26, 21,194,122,100, 96, 15, 50,122, 99,167,203, 68, 45, 88, 7,168,198,127, 12,119,207,207, 39,246,104, 39, 14, - 65,238,122,244,207, 92,117,243,209,240, 49, 73,194,122,158,135,167, 78,221,191,225,160,214, 70, 49,230,127,175, 85,214,124,179, -246,254,237, 12,162,115,131,131,230, 15,203, 74,168,176, 3,231,255, 0, 56, 24,164,161,156,124, 57,251,241,165,175, 42, 81, 4, -128,123,105,104,248, 61,215,161,234, 61,195, 9, 4, 17,131,140,142,223,159,183, 85, 65,193, 7,254, 56,208,233, 56, 57,252,117, - 84, 28,245,242,237,243,207,245,104, 16, 14,221,176,115,176,176,216,246,251,173,130,144,113,212,117, 31,209,147,251, 52, 64, 81, - 7, 3, 57,199, 92, 12,227,237,208,169, 35,151, 56,237,220,122,227,174,171,161, 97, 64, 96, 17,233,247, 31,233,206,144, 35,125, -251,225, 50, 15,218,181,186,127, 44, 28,217, 61,137,207, 79,219,211, 69,160,115, 4,228,115, 96,228, 12,227,183,110,191,142,129, - 66,176,164,143, 53, 1,246,117,209,136, 61,199,167, 81,162,144, 13,182,219, 5,193,232, 56,201, 61,187,103,231,233,170,157, 57, -128,201,237,219,190,122,158,195, 61,244, 58, 14, 70, 85,219,229,220,254, 78,137, 78, 6, 9,248,142, 58, 30,199,229,215, 73,176, - 32,251,176, 49, 85,178, 80, 71, 49, 24, 29,179,128,122,159,234,206,170,161,228,172,227, 5, 63, 51,208,106,130,129, 57, 36, 12, - 43,246, 12,103,250, 53,245, 33, 41, 28,169, 39,168,200, 39,169,243, 62,154,215,113,110,214,192,193, 69, 75, 80, 41, 11, 40, 72, -242, 79,235, 44,117,198, 14,142,138, 84,193, 74,208,181,165,208, 82,164,172, 44,165,214,212,133, 5,182,227,107, 79, 84, 56,149, - 0, 82, 71,108,122,116,213,184, 21,116, 32, 12, 36, 16,175, 92,121, 99,240, 58, 41, 11, 82,192,198, 50,156, 1,158,159,143,207, - 73,144, 8, 32,238, 14, 5,200, 32,131, 98, 8, 32,251,198,227,247, 28,108, 53,141,190,213,107,108,134, 43,180,182,171,204,124, - 41, 19, 35, 60,136, 85, 18,145,128, 11,205,175, 13,186,160, 60,210,164,149, 28,156, 13,108,141,181,197, 54,220, 70, 82,197, 66, -151,116,195,121, 72,202,146,221, 49,185,109,229, 32,244, 75,141, 75, 60,221,199, 95, 93,115,201, 4,164,124, 94,189,207, 82, 7, -168,253,186, 37,176, 66,144, 22, 84,164,142,169, 32,227,161,236, 8,243,244,251,245, 28,174,225,188,174,181,153,164,137,162,103, -235,203,114,160,244,191,151,117, 31,114,140, 91,121, 55,141,220,125,147,211,199, 74,107,169,243, 88,225, 80,170,107, 41,214, 89, - 52,139, 90,242,161,142, 87, 35,177,119,115,110,248,235,133,191,199,206,218,219, 45, 52,170,125,157,118,214,229, 55,146,132,186, -136,148,166,213,201,219,244,179,102,224, 18, 71,250,170, 3, 29,180,196,241, 5,199, 86,232,111,197, 1,251, 8, 50,221,147,182, -143, 56,211,211,237, 58, 60,167,100, 74,185,156,140,226, 94,138,213,215, 87, 83,109,251,229, 61,183,144,219,158,226,195,104,140, -227,141,161,111,151,249, 82,145,162, 3,148,130, 92, 5,192, 20, 20,148,231,148, 55,212,227, 4, 14,186, 61,162, 86,176,146,225, - 80, 56,228,194,113,201,219,161,207,235,116, 56,211,117, 47, 5,112,245, 21, 84,117,201, 69,207,170,132,134, 71,149,218, 77, 12, - 8, 33,149, 73,229,134, 82, 46,173,163, 82,145,169, 72, 32, 28, 53,241, 15,138,188, 97,196,116,243, 82,213, 84,195, 69, 77, 80, - 10,200,180,176, 44, 69,212,245, 83, 35, 25, 38, 10,219,134, 85,145, 85,193, 42,192,169, 32,158,135, 75,235,241, 20,165,243,156, -130,149,228,227,191,234,252,191,175, 69, 53,226, 20,169,146, 9, 42, 80, 87, 50,134, 0, 79, 79,192,118,208,142, 44, 52,130, 84, -175,137, 56,248,146, 49,143, 64,122,117,233,170,145,222, 81, 66, 66, 73,248,178, 73, 87, 82, 79,108, 12,246, 29, 53, 36, 61, 54, - 29, 62, 70, 43, 94,183, 35,123, 91,175,205,241,136,238,148, 54,166, 91, 20,250,139, 88, 47,209,166,170, 59,233, 79,254, 76,255, - 0, 80,172, 99,160,230, 39,240, 58,198,120,103,221, 57,187, 25,196,150,199,238,244, 21,134, 94,176, 55, 62,210,175,186,181, 28, - 15,112,143, 87,142,138,146, 84,113,217, 84,215,101, 39,255, 0,165,167,117,218,108,106,205, 62,177, 68, 90, 2, 93,157, 79,120, -165, 71,245, 68,134, 82, 86,218,243,228,123,254, 61,245,167, 85, 38, 11,109,188,210,135,233,152, 91,140,184,160,122,120,145,212, - 83,145,142,255, 0,171,251,117,187, 66, 18,104,170, 41, 36,251, 18,234, 83,255, 0, 68,162,196,254,253, 93,251,227, 20,149, 82, -101,249,133, 45,100, 91, 73, 4,145,202,189, 62,212,108,174, 63, 16, 49,250,180,211,238,200,245, 37, 67,171,211,156, 15,194,174, - 65,129, 89,167, 45, 4, 20,189, 10,173, 21,153,145,214,133,121,160,178,242,122,249,231,190,180,239,217, 89,188,242,168, 28,101, -113,223,195, 53, 74,165, 21,248,241,110,200, 59,151,105, 48,148, 54,212,150, 99, 85, 66, 25,171, 70, 90,211,133, 72, 8,121,198, -149,215, 37, 35, 61,129,214,138,112,241,237, 18,181,246,247,217, 85,195,199, 23, 55,221,185, 92,188, 87,110,170,222,216,155,158, -135, 70,113,168, 85, 74,133,213, 66,154,237,182,137,209,228,212, 2, 90,247, 81, 18, 12,119,150,178,172, 40, 40,165, 36,172, 99, - 92, 76,225,195,218, 43,112,108,191,180, 68,241,163, 87,137, 53,218, 13,213,121, 85, 13,251,109, 69,117, 79, 59,252, 93,220,210, - 61,214, 85, 57,148,140, 9,179,169,240, 12, 87, 90, 24,253, 35,176,207, 39, 85,140,213, 94,201, 95, 89, 89, 81, 50, 68, 88,229, - 41, 44, 77, 97,114,211,137, 33, 50, 70,130,251,177,141, 24, 11,126,210,130,124,216,234, 92,247,139,178,110, 30,135,135, 86, 26, -240,171,156,212, 69, 53, 68, 96, 18, 70, 89, 60, 14, 18, 89, 46, 45,161,102,104,166, 0, 18,247,167,107, 0, 6,255, 0,166, 5, - 42,103, 57, 65, 82,185, 64, 32,133,247,194,134, 58, 28,253,191,183, 79,189,167, 40,130,133, 15,136,130, 15, 48,207, 92,244,234, - 62,127,191, 90,215,182,213,122, 45,249,108, 90, 55,197,175, 49, 85, 11, 94,248,160,211,110, 91,114,123,145,228,195, 92,170, 77, - 82, 51,114,163, 41,232, 51, 90,109,232,174,134,220, 0,165,196, 37, 67, 29,181,181, 22,173, 32,176,218, 22,172, 0, 58,144, 15, - 48, 35,161,232, 51,211,182,149,165,204, 0,210,250,182, 96, 8, 55,216,131,107, 17,234, 8,177, 7,208,223, 12,252,106,244,209, - 69, 44, 79,229,112, 89, 74,158,160,131,165,148,142,161,131, 2, 8,234, 8, 32,216,139, 99, 84,189,166, 92, 73, 94, 92, 36,240, - 71,190, 60, 72,109,253,170,139,190,243,218,251, 81,202,181, 6,152,247, 63,185,197,151, 53,246,105,136,172, 84, 2, 7, 50,224, - 67, 84,180,200,117, 35, 4,165,140, 2,158,227,242,123,220, 13,193,188,183,102,246,187, 55, 70,255, 0,174,202,185,175,125,193, -184,106,119,117,217, 95,154,225, 92,154,165,106,179, 33, 82,165,200, 61,127, 70,202, 74,130, 26, 64,248, 91,109,180, 33, 32, 37, - 35, 95,176,103, 17, 91, 65, 79,226, 3, 96, 55,155,100,106, 73,104,195,221, 29,180,188, 44,162,167,194, 11, 49,228,215,104,147, - 33, 65,146,176,160, 71, 43, 83, 28, 97,207,145,107, 58,252,126,111,173,183,174,109,101,223,114,237,205,200,243, 14, 87,172,107, -134,183,104, 86, 21, 21,196,191, 31,235, 27,118,163, 34,153, 41,108, 62,142,143, 50,181,199, 42, 74,135,250,248,242,211,205, 11, - 23,205,103,169,168,185,146,170,158, 46, 83,159, 68,102, 90,132, 67,211,202, 69, 43,202,122,183, 50, 37, 98,121,105,106, 87, 55, - 74,198,201,233,231,141, 79,232,234, 57,204, 82, 16, 6,132,158, 85, 50, 83,153, 27,174,169, 99, 74,129, 10, 55,149, 68, 19,180, -118, 47, 41, 56, 67,100,168,171,151,155, 61, 79, 95, 60,122, 15, 61, 35,130,164,243, 43,195,200,232, 85,144,149, 30,190,103,160, -235,163,138, 10, 81,148,161, 61, 1, 57,207,196, 1,237,229,215, 58,179, 73, 73,100, 1, 32,169,109,175, 10,108,133,117, 65, 61, - 64, 35,211,190,164, 33, 71, 78,184,138, 6, 12,221,108,127,211,249, 99,203,205, 18,188,146,148,164, 30,157,114,114, 49,212,122, -121,235,227,237, 45,212, 2, 7, 84,167,184, 57,230,251,255, 0,214,210,105,196,231,225,201, 72, 78,112, 71,161,193,239,249,235, -162,163, 54,227,231, 9,229,102, 56, 25, 86,126, 37, 18, 58,142,158,154, 26, 64,223,165,177,147,211,115,112, 58,252,252,223, 22, -213, 70,117,150,146,176,201, 81, 88,230, 39, 35,152, 1,253, 61,115,159,248,104,168,146,144,231,232,202,255, 0, 85, 56, 40,229, - 0, 30,157, 78,124,245,114, 83, 5, 65, 72, 11,202,122,142,131, 4, 30,196,245,208, 41,136,220, 55, 57,130, 80,160,172,229, 74, - 5, 71, 24, 57,192, 61,188,255, 0, 13,102,195,174, 10, 13,246,245,219,231,231,243,194, 75,106, 66,138,139,202,121, 62, 73, 39, - 41, 64,244,249,235,195,175,165, 29, 16,164,129,215, 3,176, 10,244,237,242, 58, 13,247, 86, 20,162,210,241,205,219, 9,199, 76, -118, 57,252,252,244, 57,121,183, 22, 18,162,114, 8, 46, 36,167,166,122, 30,132,122,147,160, 1, 61,122,224,218,109,176, 59,124, -252,244,193, 73, 62, 42,249,210,160,160, 6, 10, 58, 4,243,117,237,215,174,169,202,116,144,148,163, 9, 35, 41,232,112, 73, 35, - 26,244,226,149,225, 44, 52,218, 83,202, 50, 6,112, 73, 3,166, 20, 60,186,106,200, 38, 56, 22,159, 25, 41, 42, 74,136,229, 35, - 39,237,230, 7, 25, 25,253,154,205,172, 79, 99,140,129,115,240,254,120,124,184,115,189,156,218,173,243,217,253,196,140,226,154, -114,201,221, 29,189,186,157,144, 2, 28, 76,104,148, 91,202,137, 62,170,234,144,226,146, 10, 19, 71,106,164, 78, 72,192,235,229, -214, 89,252, 84, 79,135, 38,165, 91,167, 64,144,125,222, 21, 90, 83,212,194, 9,203,148,103,102,202,149, 75,147, 29,226,231,198, -199,134,165,180, 86,174, 83,250, 48, 82,145,204,117, 12,134, 36, 32, 58, 89,144,219,141, 68,148, 28, 97,215, 25,112,135,124, 41, - 13,150, 30, 13,148,156,182,191, 13,197,224,142,160,224,143, 93, 73,106,193,222, 9,123,221,195,158,213,110, 37, 84, 5,220,177, -173,145, 99,221,170, 9, 90, 82,245,211, 97, 33,139, 66,186,235,106,113, 41, 18, 89,144,221, 38,151, 80,109,206,169,241,170, 79, - 3,133,165, 68,213,126, 32,229,133,243, 12,131, 53, 81,228,136,205, 3,157,175,169,213, 36,139,223,107, 71, 40,244, 5,135, 82, -109,142,146,250, 55,230, 49,199,158,230,217, 92,205,165,166,142, 42,152,199,111,171, 99, 12,173,241,188,212,235,255, 0,117,239, -229,177,215, 10, 45,116,211,119, 43,112,233,170, 37,182,230, 76,183, 43,177, 16, 48, 67,141,212,104,203,167, 84, 84,210, 85,250, -200,247,186, 39, 42,135, 76,169,127, 17,201, 25,126, 41,181,229, 37, 94,246,130,227,139, 83, 98,158,134,210,180,160,134,139,132, -169, 8,228,234, 57,157, 60,196,119, 33,160, 58, 3,173, 54,220,106,162,232,187,147, 64,173, 32,128,221,114,157, 86,182,101,168, - 2,112,236, 98,110, 58, 71, 42, 0,200, 82,156,139, 85,108,168, 12, 37, 47, 14, 99,215, 89,237, 42,241,122, 42, 89,121,149,120, -143, 68,240,228, 71, 67,193, 97, 42,112, 20,248,104, 82,146, 14, 81,149, 36, 43, 61,130,149,202, 79, 77, 54,154, 98,201, 79, 48, - 93,157, 23,215,245, 64,140,254,242,183,247, 3,113,214,216,234,185,107, 85, 90,190,153,200,103,134, 73, 8,185,181,196,141,207, - 0,122,217, 95, 77,199,166, 54, 18,161, 94,151, 79,143,238,201, 90,156, 74, 11,144,195, 67, 45,167,222,100,242,185, 41,107, 79, - 47, 68,161,128,211, 94, 17, 4,143,139,237,214, 33, 94,188,163, 65,166, 48,194, 95, 91,117, 54,202,144,132, 54,165,128,183, 95, -199,188,184,162,159,133, 33, 12,114, 39, 3,184,113, 99, 62, 90,108,110,125,200,155, 57,192,243,237, 54,135, 98, 37, 65,105,104, -184, 83, 38, 67,170, 74,157,117,106, 82, 65,231, 43, 42, 36,158,164, 28,103,182,152, 91,179,113, 22,203, 82, 31,144,227,141,177, - 29,133, 60,243,188,138,117,126, 27,202,229, 79,134,132,140,173,213,186,224, 64,230, 35, 28,249, 82,146,156,168,109, 83, 80,180, -133, 70,155,131,247,250, 91,173,253,215,233,123,143,190, 31,153,230, 40,116,234, 94, 76,155, 11, 13,199,112,250,136, 0, 48,181, -193, 30,164,142,215, 14, 21,209,121,205, 91,172,198,128, 37,214, 37,203,151, 18,147, 71,162, 69, 74,158,159, 91,173, 84, 31, 76, - 74, 61, 38, 10, 82, 57,149, 46, 76,199,210,132, 36,116, 79,141,204,122, 13, 72,111,103,182,153,253,140,217, 59, 59,105,234,166, - 43,245,214, 40,146,102,238, 75,165,136,243,169,213, 75,230,241,120, 86, 47, 54, 36,211,230,178,227, 21, 26, 75, 53, 55, 26,167, - 24,207,180,236,119, 35,210, 16, 22,218,146,117, 21, 91, 99,137, 58,134,192,111, 54,211,110, 76,122, 84, 42,181,197,100,221,246, -174,224,205,167, 84,216, 19,169,212,123, 66, 37, 89, 42,151, 77, 97,181, 39,195,159,114, 79,128,212,245,169,240, 22,212,111,116, -105, 13,225, 69, 58,152,173,218,236, 42,179,108, 87,233, 14,186,253, 46,181, 6,157,112, 82, 30,120, 56,211,238,209,110, 10,124, -106,204, 5, 62,219,128, 41, 18, 61,194,107, 60,193, 64, 44, 45, 4, 30,186,117,106,119,163, 48,188,177,253, 92,232,116, 31,218, -177, 26,182, 29, 0, 5,108,118, 44, 24,145,181,142, 35,114,231,116, 85,239,152,101,148,181,162, 92,195, 43,146, 35, 87, 18,135, -188, 13, 42, 22,128, 23, 42, 35, 98, 66,200, 24, 35, 57,137,208,164,161, 30,202,120, 41,197,183,177,147, 96, 55,194,117, 82,245, -225,250,163, 11,134,125,197,158,169, 14,206,182,216,166, 75,169,236, 93,114,190,156,248,141,189,108,196, 90,166,237,169,121,196, -181,250,106, 40,147, 79, 30, 49,116, 81,219, 78,117, 26, 30, 33,248, 90,223,142, 22,238, 53, 90,251,235,183, 21, 75, 77,169,146, -228, 66,162, 92,232, 13, 87,118,250,239,240, 22,241, 75,150,189,233, 78, 11,167,214, 10,153, 99,198, 17,203,141,204,109,181,161, - 79, 69,104,144, 53, 62, 58,210, 27,142,235,239, 21,135, 25, 12,160, 78,108, 32,130, 2, 20,150,218,156,215,108, 60,148,173, 41, - 88, 7, 42, 65, 24, 28,201, 25,193,174,203,122,131,116,219,213,139,110,241,182,232, 55,173,161,112, 70, 84, 43,170,207,186,169, - 84,234,253,183,113,211,152,109, 97, 46, 84,104,245, 86, 28,142,237, 70, 59, 5,226,196,128,132,200, 66, 22,182,154,125,146, 80, -180,201,178,222, 38,170,167,211, 29, 71,246,200, 86,223,104,218, 69, 29, 1, 87,177,189,186,233, 96,214, 30, 85, 40, 0, 56,170, -184,143,195,156,143, 60, 18, 84, 69, 23,232,156,193,247, 18,194,160, 70,237,183,247,176,221, 84,146, 79,219, 83, 27,110, 29,203, -146,109, 13, 30, 23, 61,163, 28,100,240,219, 38,149,107,237,182,228, 73,189,236,148, 58,150,218,218, 61,216, 67,151,221,136,166, -144,210, 25,240, 41, 6,169, 45, 53, 11, 53, 66, 58, 57, 80,186, 76,248, 97,190, 98,160,218,142,164,109,178,158,214,237,167,175, - 65,161,127, 41,109,181,191,248, 74,174, 85,212,196, 72,247,141,118,159, 86,189,184,118,184, 38, 56,243,200, 67, 20,205,205,163, - 65, 92,187,103,244,108,243,134, 42,113, 37,120, 42,121, 41,114,160, 80, 84,117,167,220, 73,251, 19,182,242,247,150,245,217,194, - 29,220,173,162,186,165, 45,185,180,237,176,187,166,214,235, 27,115, 85,154,242,203,141, 53,105,221,169,247,138,213,131, 33,111, - 58, 60, 24,243, 19, 85,132,218, 80, 19,227,198, 71,195,173, 7,218,190, 57,120,161,246,121,238,117,107,135, 46, 42, 54,246,212, -222,125,182, 66,215, 76,220,221,149,190,133,155,115,191, 81,182,165,170, 84, 41, 82,173,155,198,146,212,216, 50,159,240,155,121, -200,241,235, 44, 76, 97,206, 80,135,152,140,178,151, 90,121,170,146, 44,222, 17, 46, 79, 77, 21,101, 90,144,210, 68,210, 26, 90, -141, 23, 26,157, 24, 36,177, 72,226,224,221,193, 66, 60,166,100, 39,106,230,105,184,247,129,158, 20,172,144,102, 25, 56, 96,130, - 73, 11, 77, 13,172, 72, 85,114, 4,208,176, 63,238,220,198, 0, 12,193, 90,219,205,107,111, 55, 22,222,185,109,106, 77,203,105, - 92,212, 27,170,209,172,183,227,209, 46,123, 90,179, 79,185, 45,186,219, 47,160, 44, 55, 78,175, 80,230, 63, 25,215,130, 20, 20, -227, 72,116,188,206, 64,121,180, 19,141,103,175, 87,204,134,148,133, 47,152,148,124, 42, 90,135, 81,202, 0, 79, 42,142, 57,128, -233,159,246, 64, 39, 57, 58,138, 47, 16, 27, 71,120,112, 95, 98,211, 61,164, 94,203, 13,207,174,217,124, 50,238, 29,187,102,110, - 70,229,240,243,119,189, 42, 85,155, 77,162,222,245, 72, 16, 41,117, 22,108,155,169,231, 90,184,109, 7,235, 46,162,151, 58,152, -243,203,175,208,101,130,245, 6,171, 58,144, 89,145, 18, 68,155, 3,127,214,247,155, 98,118,115,120,231, 91,109, 90,114,247, 99, -108,236,173,194,145,108,177, 83, 77, 90, 45,188,253,219, 67,139, 87,122,147, 14,164,243,190, 44,248, 45,185, 37, 98, 59,143,101, -242,194,155, 18, 15,188, 7, 73,143,214,196, 35,167,138,170, 9,185,212,211, 51, 37,153,116, 75, 28,128, 41, 49, 75, 29,205,152, - 95,170,150, 83,177,218,235,123, 43,134,115,213,207,218, 72,189,141,233,170,169,213, 93,148,221,209,145,142,149,120,220, 40,189, -200,177, 4, 41, 27, 0, 8,185,198,215,109,149, 22, 37,219,112, 75,167, 73,165, 92, 21,191,118,183,110, 26,195, 20,107, 85,228, - 68,174, 84,165, 82,105,206,202, 98, 44, 87, 92,162,212, 48,165, 45,180,169,192,152,142,168,161, 4, 36, 36,229, 99, 64, 56,226, -223, 77,219,218,203, 74,243,176,184,111,131,100,212,184,131,106,210,106,188,182,174,237,198,176,104,236,108,117, 26,191,107,238, - 45,231, 67,159,114, 83,238, 42,188, 53,220, 59,203, 46,201,218,125,206,169,219, 54,146, 99,166,100,164,216,146,234, 18,227,161, - 2,157, 2,167,204, 14, 62, 61,170,123,199,195,134,245,239, 23, 13,187,105,102,194,182,165, 83,246,238,171,105, 84,183, 81, 53, -244,170,245,137, 87,220,107, 45,183,233,117,187, 54, 41,166, 73,133, 64,143, 76,250,217,135,130,156, 67,211,229, 61, 20,165, 50, - 32,160,164,235,150,155,127,199,229, 2,218,166,220, 17, 47,141,155,184,239,201,213, 27, 39,106,105,180,122,212,125,229,250,134, -170,214,227,109, 78,199,111,230,200, 68,190,174,249,149,109,181,172,187,121, 82,106, 16, 56,129,184, 42,147, 41, 97,218,124,229, - 79,183,224, 36,215,213, 28,203,110, 70,206, 69,195,144, 85, 69, 5, 70, 98,154,105,203, 23, 84, 82, 9,145, 88, 2,188,203, 43, - 29, 22,223, 64,107,155,217,130, 11,134,211,227, 63, 18,206, 91, 83, 89,150,100, 83,153,115, 5, 2, 9,166,100,112, 41,101, 77, - 75, 50,195,172,141, 83, 43,150, 83, 39, 47, 66,149,186, 60,183, 82,141,110,225,240, 39,196,221,155, 81,191,231,222,141, 89,213, - 55,237, 88,247,245,205,127,221,171,222,173,181,185, 61,226,240,182,175, 86,237, 91,186,211,159, 89, 98,236,113,202,246,245, 75, -190,106,209,152,110,218,100, 61,112, 84, 36,212, 28, 91, 16, 22,220,105,170,139,127,159,236,242,222,186, 77, 26,239,166, 87,232, -112,233,215,213,183,115, 90,106,118,188, 55, 27,106, 92,217,154, 61,128,237, 3,137,199,119, 10,177,114,223, 77,221,139, 75, 53, -122, 53,223,195, 53,253, 73,112, 71,241, 98,181, 54,200,172, 83,221,113,115,223,163, 51, 57,230,147,199, 5,183,187,182,199, 20, -139,188,118,233,203, 98,159, 84,186,183,115,137, 91, 34, 52, 27,238, 84,170,188, 61,236,220, 94, 32, 44,203,171,108, 40,237, 75, -107,110, 95,141, 88,160, 80,145, 95,186, 77, 97,137,205, 83, 25,174,211,162,188, 99, 84, 40,149, 52, 64,143, 46,157, 75,218, 83, -101, 77,186,105, 19,162,236, 45,249,108,218, 84, 43,254,198,220, 58,109, 34,211,226, 14,155, 2,237, 19,173,203,215,141, 77,199, -186,173,217,247,125, 99, 98,170, 16,170,182,125,110,232,227, 78,236,167,187, 2, 77, 5,212,166,211,181,219,161, 84, 87, 88,151, - 81,153, 91, 22, 42,173, 58,216, 2, 66,109,243,176,249,247,227,159,188,172,197,153,181, 23,220,146, 73, 36,158,189,183, 55,238, -119,191, 83,134, 79,133, 94, 26, 54,163,119, 40, 23,245, 15,114,220,191,142,226,213, 56,139,225,227,133,189,165,172,237,181,249, - 97,155, 30,221,191,119,242,131,196, 96,167, 93,151,172, 39,236,250,202, 55, 62,208,102,241,218,107, 53,128,138, 37,126,130,149, - 83,107, 53, 9,204, 84,230, 17, 17,189, 55,212,190, 3,248,146,172,211,160,212,169,214,189,181, 33,186,142,219,211,247, 54, 44, - 95,227, 14,196,106,162,186,125, 98,181,178,180, 58, 45,166,105,207, 92, 9,120,110,100,217, 28, 70,108,107,177,109,190, 79,173, -221, 99,115, 41,203, 76, 94, 97, 37, 17,242,109,137,226,246,211,217,104,251,163, 81,127,101, 62,187,186,171,187,235,180,188, 70, -108,210,237,235,249, 22, 93,137,180,219,153,179, 84,221,245,137,101, 55, 93,179, 23, 99,212,230,110, 13,155, 14,126,244, 71,153, - 30,155, 22,183,110, 58,135, 44,136,172,191, 58, 84,105, 79,178,151,218, 87,181, 90,244, 52,109,183, 49,108, 26,164,171,191,110, - 45, 11, 30,153, 2,181,115,110, 83,149,219, 97,171,198,196,221, 46, 9,183, 14, 21,126,223,177, 98,217, 80,152,183,109,137, 17, -184, 39,182,216,149, 73,247,169,115, 94,157,126,212, 38,174,188,170,109, 62,145, 66,136,100, 17, 21, 93, 71,204, 47,211,227,220, -219,115,111,195,225,108, 1,107, 11,252,252,239,134,106, 63,179,199,115,133,155,125,215,171,187,135,179,118,237,197,106,110,150, -201,109,205, 10,223,153,185,246, 52,250, 21,249, 15,122,172, 61,215,189,169, 23, 85,173,123,210,110, 87,226, 85,161,161,221,180, - 69, 50, 35, 16,154,153,245,133, 70,101, 86, 39,143, 18,101,191, 50, 43,173, 61,131,193, 94,250,238,142,241,110, 54,200, 89,144, -172,105,247,150,215, 94, 63,197,253,209, 54,126,230, 88,150,253,156,245,230,245,238,157,187,165, 91,118,205,231,112, 87,162,211, -175, 26,213, 74,234, 15,179, 73,139, 75,126, 92,138,179, 48,164, 75,167,183, 38, 43, 46, 58,157,172,107,218, 71,106,187,184,205, - 93,151, 6,202,110, 37,197,110,209,175, 29,134,190,172,246, 39,241, 13, 5,253,203,160, 93, 60, 62,109,135, 18,118,213,139,112, - 73,220, 10,142,200, 73,165, 84,170,177,119, 63,136, 8, 23, 60, 70,218,180,225,210,217,143,182,241, 40,114,169,117, 3, 80,155, - 86, 12, 7, 9,252, 89,216,124, 52,223,247, 21,199, 92,217,203,159,115,109, 71,183, 27,106,119, 94,200,183,218,221,216, 86, 93, -205,110,222, 91, 37,184,134,249,219,247, 46, 91,196,109, 93, 86, 53,227, 71, 49,101, 84,161,213,227,179, 69,164, 59, 61,217, 13, - 76,139, 38,154,150, 85, 17,245,109, 21,212, 94,194,230,253,122,118,237,252, 63,118, 51,229,219,231,249, 97,202,188, 61,155,155, -199,118,239,117,185,183,155, 45,111,219, 48,169,151,253,165,181,247, 29,144,197,255, 0,186, 86, 69,154,185,177,175,167, 54,191, -110,233, 53, 41,149, 43,218,189, 9,184,108,215,247,190,249,155, 69,160, 50,234,210,253, 65,250, 53, 77,200,172, 42,159, 74,151, - 45,166,227,134, 30, 29,118,127,120,246,186,191, 46,244, 59,148,198,229, 93, 91,162,198,209,109, 69, 98,214,187, 45,122, 85,145, -109,220,147, 54,155,112,111,218, 69, 66,255, 0,180,170,251,125, 80,157,121, 82,101,220,150,181, 18,154,240,167,215,104, 46, 83, -162, 85, 36,212, 19,245,147,172, 55, 5,237,158,182,189,170,118,111,241,175,183,251,177,186, 92, 50,213, 47,138,213,133, 67,216, - 27,113, 74,181,183,186, 14,223, 84,174,122, 47, 11,119,174,202,223, 59, 29, 14,226,170,191,178,245,148,204,114,158,230,219,222, - 52, 89,210, 61,212, 74,157,109,221,244, 74,100,119,233,207,218,140,207,171,105,175, 15, 60, 86,219, 59, 19,183, 23, 37,185, 55, -107, 42,215,157,246,197,244,141,202,218,155,189,189,196,135,110,218,246, 85,232,222,219,222,187,117, 26,163,120, 88,142,109,229, - 70, 70,225, 69,136,139,192, 85, 33, 71,143, 94,160, 33, 53, 10, 36,116,205, 53, 8, 43,126, 27,135, 2, 45, 74,111,229,107,222, -224,251,173,219,227,235,252,241,159, 47, 99,243,255, 0,140,109,229,209,192, 61,139, 67,254, 54, 13, 55,134, 30, 56,238,159,226, -247,134,189,165,221,155, 88, 82,239, 26, 58,127,141, 58,134,224, 29,184,254, 17,110,133,181,238,252, 37, 74,228,217,202, 39,240, -190,165,239, 17, 99,253,100,191,208, 49,227,221, 17,185, 92,241,117, 46,135,178,187, 35, 81, 28, 31,213, 31,183,183,186,171, 31, -122,172,157,204, 93,241,102,218,215,157,151, 58,233,188,119, 54,204,184,111, 91, 90,206,160,237,157, 94,102,218, 53, 31,110,232, - 55, 5,201, 73,181, 97, 62,229, 82, 21,212,253, 17,170,156,202,136, 53,143, 5,170,122,233,238,255, 0, 21,182, 21,251, 73,221, - 38,109, 61,163,187,173, 42,230,243,109,206,204,217,215,189, 66,226,221,186, 53,235, 74,102,187,180, 15, 88,202,106,225,181, 40, -212,205,160,161, 61, 71,164,207,141,102,114, 42,155, 50,125, 77,232,203,169,120,130,166,250, 89,240,157,111,237,173,252,177, 83, - 70,217,139, 67,114,246,121,205,192,178,182,194,199,221,235, 38,179, 78,133,124, 51,107,215,171,138,221, 10,189,205, 93,167, 93, - 54,173,114, 93,149, 85,143,101, 93, 20, 42,173,118, 11,240,157,147, 78,174, 70,121,218, 70, 95,139,225,190, 91,109, 66, 82,230, -223, 59,143,119,166, 50, 8,184, 3,231,127,135,166, 49, 78, 42,118,162,139,177,156, 68,238,246,208, 80, 63,132, 77, 83,182,246, -242,168, 91, 74,166, 93,239, 65,153,117,219,117, 40, 41,100, 86,172,219,150,169, 75,166,194,137, 94,175, 81, 43, 42,159, 72,151, - 83,133, 10, 28, 42,156,138, 35,149, 8, 81, 34,197,146,211, 13,173, 88,184,129,221,147,190, 91,193,122,238,130, 40, 10,181,162, - 92,146,233,172,210,109,231,107, 47, 92,147, 40,244, 11,118,135, 75,181,237,216, 53, 75,142, 68, 40,170,184,107, 72,161, 81,105, -222,253, 60, 68,134,137,147, 11,242, 90,133, 13,183, 81, 21,165,172, 21, 55, 58, 70,221,186,116,193,180,169,223,215, 31,255,217, +255,216,255,224, + 0, 16, 74, 70, 73, 70, 0, 1, 2, 0, 0,100, 0,100, 0, 0,255,236, 0, 17, 68,117, 99,107,121, 0, 1, 0, 4, 0, 0, 0, + 85, 0, 0,255,238, 0, 14, 65,100,111, 98,101, 0,100,192, 0, 0, 0, 1,255,219, 0,132, 0, 2, 1, 1, 1, 1, 1, 2, 1, + 1, 2, 3, 2, 1, 2, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 4, 4, 4, 4, 3, 5, 5, 5, 6, 6, + 6, 5, 5, 7, 7, 8, 8, 7, 7, 10, 10, 10, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 1, 2, 2, 2, 4, 3, 4, 7, + 5, 5, 7, 10, 8, 7, 8, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,255,192, 0, 17, 8, 1, 26, + 1,245, 3, 1, 17, 0, 2, 17, 1, 3, 17, 1,255,196, 0,213, 0, 0, 2, 2, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 5, 6, 4, 7, 0, 3, 8, 2, 9, 1, 1, 0, 1, 5, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 2, + 4, 5, 6, 7, 8, 9, 16, 0, 1, 3, 3, 3, 2, 3, 4, 6, 6, 6, 6, 6, 6, 8, 7, 1, 2, 3, 4, 17, 5, 6, 0, 33, + 18, 49, 7, 65, 19, 8, 81, 97, 34, 20,113,129,145, 50, 35, 9,161,177, 66, 51, 36, 21,193, 82, 98,114, 52, 22,209,225,130,115, + 53, 54,240,146, 67, 83, 23, 55,162,131, 68,116, 37, 10,241,178,194, 84,132,148,180, 25, 99,147,100,212, 69,213, 56, 17, 0, 1, + 4, 1, 2, 3, 5, 5, 6, 3, 6, 3, 6, 7, 1, 0, 1, 0, 17, 2, 3, 4, 33, 18, 49, 65, 5, 81, 97,113, 19, 6,129,145, + 34, 50, 7,240,161,177,193,210, 20,209, 66, 35,225, 82,146, 51, 21, 23,114,178, 67,241, 98,130, 83, 99, 52,162, 36, 68, 84, 37, + 22, 8,115,255,218, 0, 12, 3, 1, 0, 2, 17, 3, 17, 0, 63, 0,251,245,164,146,205, 36,148,123,178,174, 73,181,201, 85,152, + 33, 87,112,211,134, 42, 95, 36, 54, 94,224,120, 5,148,239,199,149, 43, 77, 10,253,251, 37,177,183, 49,103,224,252,159,185, 22, +141,155,227,189,246,184,118,226,220,219,189,114,126, 3,235,143,186, 93,174,238, 44,204, 7,213, 60, 34,150, 60,213, 1, 50, 60, +100, 52,228, 64, 79,194, 82,134, 64, 75,172,211,162,133, 85,239, 58,241, 94,153,245, 19, 55,166,229,203, 27,171, 69,181,249,128, +102,246, 15,154, 61,227, 95, 21,237,221, 79,233,198, 23, 83,196,142, 79, 72,147,233,242,146,239,237, 63, 44,187,142,158, 11,170, +241,236,138,197,150, 89,216,200, 49,169,109, 78,178,201, 72,113,137, 49,150,149,182,180,159, 97, 78,189,163, 27, 38,188,136, 11, + 43,144,148,101,168, 35, 80, 87,137,228,226,217,143, 97,174,200,152,202, 58, 16, 67, 16,166,232,232, 11, 52,146, 89,164,146,205, + 36,150,105, 36,179, 73, 37,154, 73, 44,210, 73,102,146, 75, 52,146, 89,164,146,205, 36,150,105, 36,179, 73, 37,154, 73, 44,210, + 73,102,146, 75, 52,146, 89,164,146,205, 36,150,105, 36,179, 73, 37,154, 73, 44,210, 73,102,146, 75, 52,146, 89,164,146,205, 36, +150,105, 36,179, 73, 37,154, 73, 44,210, 73,102,146, 75, 52,146, 89,164,146,205, 36,150,105, 36,179, 73, 37,154, 73, 44,210, 73, +102,146, 75, 52,146, 89,164,146,205, 36,150,105, 36,179, 73, 37,154, 73, 44,210, 73,102,146, 75, 52,146, 89,164,146,205, 36,150, +105, 36,179, 73, 37,154, 73, 44,210, 73,102,146, 75, 52,146, 89,164,146,230,239, 83,144, 61,109,201,238, 67,139,237, 12,178,207, +111,124,166,132, 36,219,220,142,218,130,184, 15, 51,206,243,135, 34,174,117,165, 54,165, 61,250,242,207, 86, 97,250,146,220,178, +112,166, 5, 44, 25,140, 65,239,119,213,223,216,203,213,189, 37,153,233,170,113, 0,205,129, 55, 57,119, 18, 35,185,155, 70,111, +107,170, 3, 63,239,223,171,190,217,222, 63,203,217,118, 89, 33,155,226, 69, 93,138,212,136,175, 56,213, 69, 71,152, 26, 7,137, + 32,244, 59,235,203,122,207,168,186,247, 75,179,202,187, 36,239,230, 4,162, 72,241,110, 11,213, 58, 55,167, 58, 7, 84,175,205, +163, 27,224,228, 76,101, 16,124, 31,138,136,246, 41,234,175,212,188, 8,215, 43,179, 18,175, 48, 26,170,226, 74,154,150, 26, 52, + 80,161,224,181, 4,168,131,246,105,199, 70,245, 7,168,170,140,231, 25, 78, 3, 88,153,109,143,184,150, 45,247, 37,254,179,233, +239, 78, 91, 40, 66, 81,132,206,146, 17,221, 47,120, 14, 31,239, 68, 59,117,220, 79, 80,158,139, 50, 38,153,200,173,207,183,136, +204,114,178, 45,115, 13, 98,200,167,222, 83, 46, 39,146, 82,224, 30, 35,235, 7, 68,233,157, 75,171,250, 62,208, 46,172,249, 82, + 58,196,252,167,254, 18, 28, 3,246, 33, 11,170,116,222,145,235, 26,137,166,193,230,196,105, 33,164,135,252, 64,177, 35,236, 10, +237, 44, 63,212, 22, 7,155,246,118,103,121,236, 42,113,235, 13,186, 36,153,243,226, 32, 39,230, 89, 84, 54, 11,238,178, 82,162, + 19,204, 1,182,244, 59,111, 77,125, 27,233,238,173, 79, 89,166, 22,208,116,145,109,121, 30, 96,248, 47,155,125, 71,210, 46,232, +183, 78,171,198,176, 15,167, 49,200,143, 31,236, 41,111,209,183,173,190,197,250,234,237,163,189,210,236, 84,137,110, 89, 98,200, + 54,233,241,174,177, 85, 18, 76,105, 73,105, 14,169,181,164,149, 37, 84, 74,199,196,133, 41, 62,253,116,253, 91,163,221,211,173, +242,237,103,103, 12, 95, 69,202,244,110,183, 71, 84,171,205,164,150, 5,139,134, 32,167, 62,246,119,167,183, 62,158, 59, 97,118, +239, 31,118,167,155,103,111,108,141,161,251,148,224,203,207,150,144,183, 82,202, 79,151, 29, 43, 89,170,148, 6,195, 85, 48,240, +236,202,176, 87, 88,121, 75,128, 87, 51,179,107,196,170, 86,218, 90, 49,226, 86,190,197,119,215,182, 30,164,251, 95,108,239, 39, +103, 46, 63,205,123,123,119, 14,170, 4,226,203,209,203,129,151,215, 25,117,110, 66, 80,226,104,182,212, 55, 2,189,122,105,243, +112,236,196,180,213, 96,105, 71,136,251,210,193,206,171, 50,168,219, 81,120, 75,129,246,183, 52,221,170,170,218,205, 36,150,105, + 36,179, 73, 37, 73,246, 47,215,231,167,239, 81,157,255, 0,205,189, 57,118,185,233,210,179,108, 1,107,141,144, 73,147, 17, 81, +225,166, 75, 82,215, 9,214, 25, 91,170, 11, 90,144,227,102,164, 35,137, 29, 9,214,190,119, 68,191, 18,138,238,177,132,108,225, +174,172,206,235, 23,167,245,252,124,204,139, 40,173,204,171,249,180, 96,238,204,174,205,100, 45,165,154, 73, 33, 57,246,117,138, +246,195, 7,188,119, 35, 58,152,155,126, 23, 96,133, 38,241,118,156,224, 82,146,196, 72,108,170, 67,206, 20,160, 21, 30, 40, 73, + 52, 0,147,224, 43,162,209, 76,174,156, 97, 0,242,145, 0, 14,242,131,145,124, 40,174, 86, 76,180, 98, 9, 39,184,113, 95, 58, +151,249,245,119,191,186,119, 25,215,239, 73,222,155,178, 44,215,180, 22,231,150,202,175,174, 61, 45, 47, 72,225, 66,164,134,173, +208,165, 52,218,248,239,196, 58,225, 21, 21, 3,161,239, 15,162,168,160, 8,228,229, 66, 19, 60,180,252,200,252, 2,243,177,235, +204,140,130,101,139,137, 59, 43, 28,245,215,221, 18, 62,242,186, 63,242,243,252,209,187, 57,249,128,192,186, 89,108,118,217, 88, +175,120,108, 20, 55,204, 74,238,164,184,235, 77,149,249,126,115, 15, 37, 40, 14,182, 28,248, 21, 84, 33, 73, 86,202, 72, 5, 36, +224,117,239, 78, 93,210,204, 76,136,148, 37,194, 67,243,236, 62,255, 0, 21,210,122,119,213, 20,245, 97, 33, 16, 97,100,120,196, +254, 32,243, 28,185, 30,238, 11,167, 53,206,174,153,102,146, 74,131,245,151,249,132,246,127,209,174, 77,131,246,239, 38,109,119, +142,233,103,183,120, 22, 91, 77,134, 19,200,109,214, 98, 75,152,136,142,220,100, 41, 65, 92, 25,108,170,137,218,174, 43,225, 78, +193, 74, 78,223, 73,232, 86,231,194,201,199, 72, 87, 18, 73,239, 1,216,119,254, 30,229,129,214,125, 67, 79, 79,157,117,203,226, +157,146, 0, 1,216, 75, 57,238, 31,121,246,178,127,230, 65,249,160, 91,191, 47,119,240, 8, 74,194, 37,230,183, 28,249, 87, 86, +161, 71,183,206, 76, 71, 25,114,218,168, 72, 8, 8, 44, 62,167, 20,233,152, 2, 64, 0,212,120,215, 86,189, 61,233,195,213, 5, +135,204, 16, 21,179,184,126, 47,222, 25,153, 84,245, 55,169,199, 72, 53, 15, 44,216,108,118, 98,220, 27,184,187,186,163, 7,231, +209,222, 66, 42, 61, 44,102,148,254,252,239,255, 0,213,235,103,255, 0,210,232,255, 0,239, 43,251,191, 82,195,255, 0,247,188, +143,254,202,223,191,244,174,254,237, 62,116,255, 0,115, 59,107, 98,207,229,219,158,180, 76,188,219,225,220,222,181, 75,175,159, + 13,201, 81,208,250,163,185,201, 40, 60,155, 42,226,106,145,184,232, 53,195,228, 84, 42,178, 80, 5,216,144,253,172,120,174,255, + 0, 26,227,109,113,153, 12,100, 1, 99,201,195,183,177, 48,232, 40,235, 52,146, 89,164,146,205, 36,150,105, 36,179, 73, 37,154, + 73, 44,210, 73,102,146, 75, 52,146, 89,164,146,205, 36,150,105, 36,179, 73, 37,154, 73, 44,210, 73,102,146, 75, 52,146, 89,164, +146,205, 36,148, 75,158, 65, 97,178, 41, 9,188,205,143, 17, 78, 84,182, 37, 60,219, 69, 64,117,167, 50, 43, 74,234, 81,129,151, + 0,233,137,101,170, 46, 91,138,206,200, 31,196,161, 92,226, 61,149, 69,105,185,114,173,141, 72,101,114,217, 97,223,221,186,227, + 41, 81, 90, 80,175, 5, 17, 67,167, 53,200, 71,113, 5,187,121, 36,225,217, 16,212, 19,168, 25, 30, 87,139,225,240, 81,116,203, +110, 81,109,118,215, 29,110, 43,114, 46, 50, 25,140,210,158,116,241,109,176,183,148,148,149, 40,236, 5,106,124, 53, 56, 87, 41, +150,136, 36,247, 38, 36, 14, 42,126,160,157, 66,155,145,227,214,217,105,183,220,103,198,143, 61,116, 40, 97,247,218, 67,138, 10, + 52, 20, 74,136, 38,167,166,166, 33, 34, 28, 2,153,194,155,168, 39, 89,164,146,140,187,213,157,187,195,120,235,146,217, 78, 64, +243, 46, 77,106, 9,117, 2, 66,227,178,180, 52,227,169,104,158,101, 9, 91,136, 74,148, 5, 1, 80, 7,168,212,182, 22,118,209, + 51,173,210,100,198,133, 29,114,230, 56,150,162,182, 10,220,117,213, 4,161, 41, 27,146, 84,173,128,211, 0,233,215,189, 50, 75, + 52,146, 89,164,146, 83,238, 15,119,177, 92, 6,209, 38,235,113,144,134,224,196, 81,110,109,194, 71, 52, 64,133,197, 60,214,169, + 50, 0, 41, 72, 74, 65, 36,117,240, 52,174,156, 7, 73,113,223,121,191, 53, 59, 98,175, 82, 48,142,193, 88,110,249,166, 82, 21, +242,204,223,100,201,151,102,181,121,165, 92, 20,235, 49,162, 22,223,113,148, 26,145,200,130, 64,251,221, 9,219,167,162,157,187, +172, 45,236,251,126,106,148,243, 3,180, 67,169,142,254,100, 12,219,108,145, 45, 95,201,228,223,175, 44, 71,100, 76,187,179,145, + 76,102, 43,239,134,135,152,182,126, 77,180, 5, 55,202,180, 62, 61,119,235,171, 21,244, 13,218,153,105,225,253,168,114,207,110, + 74,252,244,105,234,154,219,234,106,193,123,145, 18, 60,136,242,236,178, 25,142,234,100, 41, 15,160, 7,217,231, 68, 73,108, 36, + 57,197,105, 90,126, 36,133, 10,111, 94,186,202,207,192, 56,196,106,224,171, 84, 95,230, 14, 10,232,213, 4,117,229,247,216,138, +194,228,201, 90, 91,140,218, 74,220,113,194, 18,148,165, 34,164,146,118, 0, 13, 70, 82, 17, 4,146,192, 41, 70, 38, 68, 0, 28, +149,201,254,168,125,125,121, 78,191,219,158,193, 57,231, 92, 20, 85, 22, 86, 64,216,230, 2,143,192, 81, 12,111,200,255, 0,252, + 79,250,190,221,120,151,172,190,167, 23, 56,221, 60,188,142,134, 99, 95,100, 59,124,125,221,171,220,125, 25,244,191, 65,149,212, + 67, 68,106, 32,116,239,121,246,120,123,251, 23, 52,246,163, 31, 25,199,121,237, 22, 12,181, 75,117, 83,167,132, 79,249,146,162, +226,215,200,169, 97,101, 91,213, 68, 80,215, 94, 87,233,156, 17,155,213,106,171, 33,206,233,252, 79,196,179,146, 15,137, 12, 87, +171,250,163, 56,225,116,155,173,199, 97,182, 31, 11,112, 14,192, 17,224, 11,133,199,223,156,239,171,191, 81,110,250,203,201,187, + 11,110,188, 92,113,126,212, 97, 46, 49,105,178, 88,109, 82, 31,130,203,205,252,171,111,124,235,161,146,143, 49, 79, 21,114, 73, + 53, 1, 52, 3, 95,166,126,138,232,152,181, 96,194, 98, 49, 50,144,212,176,211,147, 14,198, 95,150,222,188,235,217,118,245, 11, + 43, 51,148, 99, 19,160,114, 31,155,158,210, 85,235,249, 38,122,135,239, 15,169,222,216,119, 63,211, 79,125,238, 50,242, 94,222, + 88,109, 41,200, 49,251,205,225,197,201,126,211, 49, 60,192,101, 50, 30,170,248, 43,143, 52,164,171,110, 42,166,196,235,206,254, +181,122, 99, 10,236, 9, 19, 17, 19, 40,203,134,154,196, 56,151,136, 63,138,244,159,161,126,170,206,167,168, 68,110, 50, 17,148, + 89,245,210, 69,140,124, 8,224, 57, 50,232, 31, 74,185,213,202,205, 96,238, 30, 21,230, 40,217,174,120,197,226, 66,154,169,226, + 30, 98, 19,137, 10,167, 64, 74, 84, 65, 62,225,175,149,126,135,245, 25,195,168,203, 29,254, 25, 52,189,162, 64,125,224,253,193, +125,111,245,215,167, 66,125, 52,100, 55,197, 23,143,178, 81, 39,238, 35,239, 43,141, 63, 39,175, 68,254,164, 61, 95,246,115, 34, +103, 7,238,253,227,183, 29,171,181, 92,214,150,224, 99, 11, 91,110,202,185,185, 21,165, 56,252,133, 50,235, 36,161, 40, 8, 9, + 73, 38,187,211,143,143,220,158,174,235, 84, 96, 95, 23,162, 54, 76,199,140,185, 7, 58, 13, 15,122,248, 43,209,125, 11, 39,168, +227,207,110, 68,170,172, 75,132,121,150, 26,157, 71,119,246, 40,249,247,171, 47, 85,125,188,237,215,168,191,203, 75,212,190, 82, +238,117, 19, 31,182,190,171, 69,254, 98,212,252,150, 94,182, 93, 34, 40,143, 57,202,186, 90,121,149,242,226,226,137, 66,133, 1, +220,232,180,244,204,107,108,197,206,162, 27, 55, 29, 71, 45, 65,251,193,236,226,133,127, 86,203,170,172,190,159,145, 63, 51,108, +116,151, 61, 8,251,136,237,224,144, 17,235,155,189,152,231,167,174,201,122, 56,193,239,247,156, 87,180,203,128,229,227, 40,153, +133,165,195,124,184, 25,183,233,192,180,207,148,164, 41, 73,109,150,193, 74, 2,128, 82,137,229, 90, 10, 92, 29, 22,153, 95,145, +149, 40,198, 83,118,136,151,202, 26, 49,227,237, 84, 79, 94,190, 56,248,184,144,148,161, 94,215,145,143,204, 94, 82,225,224, 57, +118,167,107,103,170,206,235,122, 89,239, 62, 35,220,111, 69,215,222,234, 95,177, 52,188, 27,204,241,206,230, 91,229,200,135, 41, +130,226, 2,131, 97, 42,113, 7,154, 10,247,226, 20,130, 1, 7, 84,143, 78,175, 50,153,195, 40, 83, 25,127, 41,129, 0,143,183, +222,175, 14,169,110, 13,245,217,134,111,148, 95,226,141,128,144, 71,219,220,175, 46,213,247, 83,243, 5,252,196, 61,108,247,159, +210,197,163,188,119, 44, 67,177, 54, 11,205,216,147,106,141, 17,171,139, 16, 24,187,187, 26, 36, 56,207,178,134,158, 64,225,178, +212, 87, 90, 36, 3, 93, 98,229,211,131,210,176,177,242, 60,129, 59, 39, 17,196,150,118, 4,147,196, 45,220, 59,250,135, 88,207, +201,198,253,193,133, 80,145,224, 3,182,226, 0, 7, 67,227,170, 87,192, 61, 74,122,169,252,170,253,109,119, 79,211,214, 79,157, + 92,123,149,128, 88,177,105,249, 28, 22, 50, 89, 18, 95, 74,165, 34,214,139,148, 39, 56,186,227,138,109, 65,107,242,220,224,160, + 20,154,157,182,165,188,142,159,141,214,112,169,184, 86, 43,148,166, 34,118,246, 59, 31,226, 21, 60,110,165,149,208,243,175,162, + 86, 27, 97, 26,204,134,231,226,206, 60, 59, 11, 35,158,134,125, 56,250,254,252,205,176, 59,151,171,140,195,212, 54, 67,139, 94, + 37,206,148,213,138, 5,149,247,211, 13,151, 34,174,149, 84,118, 31,101,166,219, 11,248, 67,105, 71,221, 21, 39,125, 87,235,125, + 79, 11,164, 90, 49,161,141, 25, 0, 3,147,199, 94,246, 62,245,103,160,116,172,254,181, 81,203,179, 42,112, 36,157,160,112,211, +185,192, 3,185,115,119,100,125, 79,250,129,244, 83,115,245, 55,220, 69, 92, 91,127,212,179,151, 54,113, 41,183,246, 80,203,173, +183,120,151,121,150, 38,207,109, 60, 3,100,213,151, 74, 62, 26,114, 32,211,195, 93, 22,119, 77,163,168,156, 72, 55,244,182,153, + 55,112, 1,135,222, 23, 51,211,250,174, 71, 76, 25,179,119,183,112,137, 61,230, 69,207,220, 89,121,198,123,175,123,191,246, 53, + 93,203,149,220, 46,244, 63,234,241,246,156,185, 64,184, 91,154,156,245,129,114,124,194,182,153,243, 3,254, 97,109, 73, 0, 21, +167,161, 53, 9, 32, 80,181,184,226, 57, 27, 60,188,113, 64, 44, 65,109,205,238,227,221,247,167,171, 36,207, 27,204,243, 50, 78, + 65, 14, 8, 7,107,242, 28,120,119,253,202,205,238,159,230,197,249,144,223,187,113,217, 27, 6, 49,145,205,196,187,183,119,114, +227,139,223, 85, 38,221, 25,175,230,178,217,184, 69, 98, 28,199, 81, 54, 58,136,228,219,224, 44,160, 0, 84, 9,213, 12, 95, 77, +116,232,217,145, 41, 68, 78, 17,105, 6, 60, 3, 18, 70,135,185,104,229,250,175,169,206,188,104,198, 70, 22, 73,226, 92, 13, 75, +128, 14,163,189,125, 78,252,190,253, 44,119, 51,211, 87,102,174,184,151,121,179,153,221,197,201,178, 75,139,217, 21,194,233,124, +230,181,161,217,112,163,198,118, 58, 3,206, 58,124,160, 88, 42, 0,159,218, 59, 13,121,151, 90,234,112,205,184, 78,186,197,113, +136, 96, 7,113, 37,249,107,170,245,126,131,210,103,129, 73,133,150, 27,101, 41,110, 36,247,128, 27,158,154,125,234,220,193,251, + 87,219, 62,211, 98,172,226,248, 69,166, 29,151, 13,183,182,164,198,131, 9,150,163, 69,140,208, 37,197, 4, 33, 0, 37, 41,169, + 36,253,186,204,182,233,221, 51, 41,147, 41, 30,103, 82, 86,181, 52,215, 68, 4, 32, 4, 98, 56, 1,160, 11,229,143,229, 69, 29, +190,253,126,110,189,240,245, 77,219, 6,252,174,204, 37,235,196, 40,178,227, 2,150,102, 42,233,118,109,200,235, 29, 1,243, 91, +138,183,212, 60, 9, 77,122,141,122, 79,170,143,237,122, 86, 62, 52,255, 0,204,208,248, 48, 47,238,118, 94, 91,232,241,251,190, +177,149,149, 95,249,122,135,237,121, 6,247,128, 74,250,231,175, 49, 94,176,169,191, 93, 30,181,187, 91,232, 71,176,243,251,203, +220,119, 3,247, 19, 88, 56,237,137,165,132,200,187, 92,214,217, 83, 81,219, 52, 60, 82, 40, 84,226,200,162, 18, 9,220,208, 29, +110,139,209,237,234, 87,138,161,226, 79, 96,237,254, 3,154,198,235,221,110,174,151,142,109,179,143, 0, 57,147,217,252, 79, 32, +190, 44,247,183,183,126,166,238,126,165, 59, 27,235, 27,213,140,181,142,231,119,139, 45,106,227, 26,198,182,212,216,181, 90,173, +151, 43, 95,201, 50,148, 41, 74, 45,164,183, 46,137,104,252, 72, 74, 71, 50, 86,165, 83,214,176,242,241,191,109,147,141,142, 62, + 10, 96,207,218, 72,147,248,240,227,207,150,140,188, 99, 55, 15, 43,247, 88,185,121, 71,227,190,199,219,253,216,131, 22,240,227, +195,144,227,171,174,182,255, 0,230, 12,202,173,184, 47,117, 61, 43,102,247,164, 56,229,158,205,118,190, 93,101,183, 25, 33,111, + 41,152,147,172, 50, 28, 13,164,144, 10,138, 82,104, 42, 42,117,203,250, 14,147,109, 25,112, 28,101, 24,143,120,152, 93,119,212, + 75,133, 57, 24, 83, 60, 35, 41, 19,236, 48, 41,215, 8,255, 0,230, 10,244,177, 27, 54,133,132,119,135,183,153, 70, 21,100,150, +164, 34, 61,238,239, 22, 58,210,219,107, 95, 16,252,136,232, 88,121, 45,143, 18,208,112,251,142,169, 89,232, 28,143, 44,202,171, + 33, 50, 57, 3,247, 3,195,222,202,253, 95, 81,177,188,193, 11,107,178,176,121,145,247,145,197,188, 29,125, 16,198, 47,120,246, + 75,143,195,200,177, 73, 44,204,198,231,178,220,200, 51, 33,173, 46,176,251, 15, 32, 56,219,141,173, 4,165, 73, 82, 72, 32,131, + 66, 53,195, 78, 6, 4,196,134, 35,138,244, 24, 76, 78, 34, 81, 46, 14,160,169,250,138,146,205, 36,150,105, 36,179, 73, 37,154, + 73, 44,210, 73,102,146, 75, 52,146, 89,164,146,205, 36,150,105, 36,179, 73, 37,154, 73, 44,210, 73,102,146, 75, 52,146, 89,164, +146,205, 36,150,105, 36,179, 73, 37,243,203,243,157,237, 93,255, 0,184,221,243,237, 99,173,219, 39, 72,195,153,179,102, 17,110, + 55, 56, 56,204,220,161,168,111, 73,128,150,226,133,196,135,199,241, 22,247, 16,218,202,135,150,170, 57, 67,194,154,237, 61, 47, +144, 43,166,221, 67,188, 88,110, 17,125,117,212,253,253,188, 57,172,236,216, 60,163,237,228,234,140,195,172,126,189,251,111,133, +139,231,110,177, 28,147, 27,203, 19,138, 96,246, 28,149, 80, 33, 78, 93,213,155, 20, 59,132,246,228, 46, 42,148,203,142,166, 66, +155, 76,119, 22,134,208, 92,101, 11, 34,128, 39, 90,214,207, 14,217, 52,231, 25, 13,211, 35, 80,206, 64,103,215,135, 30,226,171, +196, 89, 17,160, 35, 64,157,251,111,115,252,193, 59,157,113,187,225,151,188,243, 62,135,133, 90, 49,124,170,253, 98,189, 64,182, + 92,237,146, 39, 75,183,150,223,183, 68,122, 69,226, 3, 79,200, 81,113,197,182, 84,148, 33,110, 4,241, 77, 41,170,183,199, 10, +160, 36, 33, 89, 38, 81, 4, 56, 44, 15, 18,192,176,252,145, 34,108,150,142,120, 20, 3, 55,200,189, 92,247,162,219,101,133,223, +166,179,249,153,171,115,123,103, 62,197, 99,143,100,156,222, 54,236, 20, 69,140,245,218,124,239, 34, 55, 15,153, 76,206,124,202, +212,146,149, 18, 0,166,201, 53, 80,198,160,147, 87,150, 3, 88,229,198,231,213,128,215,131, 40,200,206, 95, 51,242,240, 81,178, + 14,239,254,106,214,102,178, 59,157,214,235,153,196,238,185, 23,134,175,120,244,123, 29,230, 84, 22,120, 63,230,194,145,107,113, +168, 63, 32,195, 67,138, 16,149, 54,242,203,129, 84,167,197,187,195, 27,167, 75,104, 2, 6, 58, 49,112, 15,120, 58,185, 62,205, + 19, 25,219,175, 23, 93, 35,143,122, 89,239,139,189,226,207, 50, 87,110,141,101,249,188, 12, 71, 20,185, 91, 47, 29,200,197,237, +247,105, 19,238,107,118,247, 44, 66,133, 36,152,140, 69, 44,175,203, 66,184, 54,170, 5, 32,168,108, 43,137, 62,161, 87,149, 0, +219, 98,103, 32, 68,100, 67, 15,132, 57, 26,146,255, 0,197, 90, 21, 75,113,230, 88,113, 30, 43, 71,111, 59,193,223, 28, 27,187, +216, 46, 72, 38,247, 6,237,233,225,166,237,237,247, 37,204,150,195,124,149, 37,140,138, 77,130,246,137, 17,218,141,242, 66, 81, +104, 76, 16,249,134, 27, 83, 13,185,192, 36,142, 68, 23,191, 26,171, 42,152,106,197,154,237, 98, 62, 87,142,174,236,236,252,117, + 33,211, 70,114, 4,113,110,126, 44, 86,156, 63, 32,245,109,148,224,211,179,219,213,223, 47,137,147,227,214,126,222, 93, 44,208, + 3,114,163,183, 46,117,203, 41,184, 49,119, 76,184,171,102,178, 8,134,211, 65,198,214, 8, 66, 72, 36, 3, 66, 30,216, 99, 66, + 98, 32, 65,164,102, 15,112, 17, 12,199,150,174,197, 40,153,144,250,232,223,138, 77, 86, 81,223, 84,229, 86,108,250,237, 23, 54, +159,221,249, 24,141,206,199,220, 9,242, 99,100,208, 98, 99,215, 41,121,189,139,230, 5,189,112,161,172,252,187, 76,178,226,138, + 32, 5, 41,108,128,174, 66,188,245,107,203,167,105,136, 48, 16,222, 12,126, 82,100, 4, 36,206,231,139,255, 0,123,129,247, 40, + 60,157,245,118,215,142,154,143,182,136, 62, 77,110,239,182, 77,137,100,217, 78,118,114,203,221,237, 88, 94,123,139,226,139,145, + 98,189,169,139,154,162,222, 83, 50, 4,105,177, 39,198,117,242, 23, 25,194,180, 38,105,171,129,180,133, 21, 20,144, 73, 92,169, +140,163, 24,236, 3,124, 9,212,105,163, 18, 8, 45,199,179,131,168,145, 34, 9, 47,192,171, 3, 60,204, 61, 92, 56,219,204, 98, +183, 60,225,142,236,189,114,188,196,238, 20, 83, 2,106,109, 54,171,114,178,102,152,180, 57,102,117,216,198, 39, 35, 21, 73,242, +213, 25,110, 21,181,230, 41,218,144, 72,167, 77, 88,223,204, 33,181,134,221, 67,147,183, 93,218,191, 30,214,213,153, 18, 82,159, + 39,126,126,253, 25,116,247,165, 72,249,221,153,238,227, 97,185,140,203,173,194,201, 98,203,164, 91,177,121,153, 35,143,200,148, +237,165,203, 21,178,112,227, 38, 64,230,243, 98, 83,239,165, 42,169,165, 10,107,240,208, 96,117, 19, 9,121,114,136, 0,152, 57, +110,215, 35,135, 45, 0, 86,170,112,224,246,167,126,232,228,179, 49,124, 69,233,150,214, 36, 74,185,186,164, 50,212,123,115, 97, +217, 75, 73, 85, 94, 44,160,169, 32,173, 45, 5,168, 84,210,163, 89,200,201, 11,183, 88,219,157,221,201,102,228,153,132, 36,198, +194, 44, 50, 36,217,108,120,203,233, 74,208,215,225,121,111,201,146,146, 84,135, 30,121, 14, 40, 87,112, 27, 85, 1, 37,107,169, +223,103, 14, 42, 44,233,197,188, 75,182,189,162,198,213,111,194,172, 16, 32, 38, 64,249, 88,208, 45,241, 99,177,243, 46, 44,113, + 74, 21,196, 10,131,227, 95, 13, 70,203,167, 97,121, 18,124, 82,140, 4,120, 6, 92, 5,234, 15,178, 94,153,109, 93,213,184,183, +105,181, 73,184, 92,144,180,155,139, 81,230,165,155, 67, 87, 0, 74,159, 76, 72,233,105, 95, 0, 81,166,197, 59,131,174,171, 0, +218,107, 27,136,246,241,252, 86,101,226, 59,139, 43,175,242,233,238, 62, 27,139,101, 83,187, 23,140,218, 88,180,192,184, 52,237, +241,166, 98, 41,229, 36, 62,200, 67, 74,175,154,165,144, 92, 64, 36, 1, 65,240, 18, 5,107, 92,238,177,143, 45, 38,239,249, 35, +226, 76,112,101,216, 26,193, 87,149, 23,235,191, 10,239, 78,121,219,203,125,143,181, 28,222,180,173,247, 5,246, 20,119, 3,110, +190,217, 74, 75, 53, 36,128, 91, 74,130,185, 38,187,154,123, 53,231, 95, 81,250, 87, 81,234, 24,176,175, 15, 80, 73,222, 1, 98, + 70,141,197,180, 26,184,240, 94,143,244,219,170,244,222,159,149, 59,115, 52,144, 3, 97, 33,192, 58,191, 7,212,232,199,197, 46, +122, 86,244, 67,110,193, 67, 57,167,113,144,153, 89, 86,203,105,146, 42,220,122,142,137, 7,169,246,171,236,208,189, 21,244,246, +158,144, 5,215, 52,239,251,163,225,223,223,238, 70,245,191,212, 75,186,185, 52,208,240,163,239,151,143,119,119,189, 80,126,172, +251, 83,145,246, 3,190,239,100, 86, 48,182, 44,147,228,170,245, 99,154,132,252, 40,112,185,230,173,160,119, 28,155, 89,233,236, +167,183, 94, 67,235,142,141,127, 67,234,134,250,220, 70, 82,223, 9,118, 23,114, 60, 65,251,153,123, 7,161,122,205, 29,119,165, + 10, 44, 99, 40, 71,100,227,218, 25,129,240, 35,239,116, 59,189,182, 95,203,243,215, 90, 96,100,158,176, 49, 41,112,187,185,111, +142,220, 21,100,120,242,222,105,114, 89,107,116,165,102, 58,210,162, 1, 38,129,105, 87, 26,236,117,236,158,146,255, 0,250, 3, +246,116,236,183,117,114,230,195,116, 73,237, 28,199,219, 85,226,190,176,255, 0,249,220,103, 93,190,177, 27, 7, 34, 73,140,128, +236, 60,139,125,130,131, 3, 34,244,225,233,223,181, 23, 14,197,250, 50,198, 92,176,226,247,131, 75,229,238,113, 42,157, 57, 28, +120, 20,149, 45,110, 56,121, 39,225, 37,106,216, 84, 0, 43,174, 55,234, 39,214, 75,186,245,114,166,173,205, 32,198, 69,134,156, +196, 64,224, 15, 51,197,118,191, 77,254,139, 83,233,249,198,235, 4, 94, 37,196, 98,231,226,228,101, 35,196,142, 67,130,181,125, + 17,122,119,188,230,152,174, 79,145,206, 63, 39, 26,245,108,155, 97,183, 72,113, 5, 92, 68,166, 20,210,158,227, 81, 84,242, 34, +148, 59,208,235, 67,232,215, 67,158, 43,231,216, 62,102, 17, 28,200, 4, 18,124, 9, 0, 15, 2,168,125,105,235,176,203, 3,167, +214,126, 87, 50, 60,129, 32,128, 60, 64, 36,159, 16,169, 14,197,254, 75, 63,152, 39,163,187, 61,197, 62,148,251,244,205,150,227, +119, 93, 46,177, 28,182, 17, 9,244, 33, 60, 90,117, 40,116,200, 9,117, 53, 80,228, 19, 90, 83,125,125, 89,157,235, 12, 44,249, + 3,145,141,184, 14, 26,235,249,104,190, 71,192,244, 70,127, 78,137, 24,217, 91, 76,184,141,186,126,122,163,157,188,252,132,114, + 38, 59, 83,220,233, 29,211,207, 77,251,212,199,114,163, 42, 36,188,186,116,119, 30, 68,111, 58,115,115,228,171,130,221,243, 28, + 91,206, 55,241, 45, 74, 7,165, 0,222,160,191,214,251,174,171,101,123,106,168,184,136, 60,116, 97,203, 70,236, 86, 49,253, 3, +182,139,188,203,119, 93,104, 99, 34, 56,106, 9,230,229,200,212,175, 87,223,200, 50,241,255, 0,130,221,183, 95,111,179,180,227, +222,170,123,104,151,163, 65,203, 98,196, 95,202,207,142,110, 79,220,163,165,214, 11,133, 72, 83, 43,125, 65, 42, 4,212, 18, 8, + 34,148,106,253,109,253,107,188,202,247, 83,111, 24,191, 13, 0, 58,183, 54, 74,223, 64,255, 0, 70,159, 46,221,183, 85,160,144, + 26, 29, 73, 26, 63, 39, 86, 15, 96,253, 5,254, 99,140,119,242,197,221,207, 83, 61,242, 85,207, 30,176,161, 81,198, 59,141, 66, +102, 28, 27,131, 42, 33, 74, 68,182,203, 72,105, 65, 74, 72,228,124,162,186, 15,133, 73,235,172,236,238,179,128,104,149, 84, 99, + 8,153,127, 52,139,145,225,207,239,110,229,167,211,250, 23, 81, 25, 17,183, 35, 40,200, 71,249, 98, 24, 31, 30, 95,115,247,132, +229,232,223,242,217,201,189, 44,250,207,238,199,169,185,217, 35, 23,107, 39,114, 39, 78,185,199,182, 51, 17,113,215, 4, 76,185, +187,112, 13,169,106,113, 97,124, 67,156,106, 0,173, 43,170,253, 95,175,140,220, 90,104, 16,111, 40, 0,239,197,128, 10,207, 69, +244,217,192,204,191, 32,207,119,154, 73,102,102,114, 79,110,168, 23,119,255, 0, 41, 81,222, 47,204, 46,245,234,235, 48,190,199, +153,218,252,142,202,238, 47,117,196,204,103, 16,250,163,191,103, 22,151, 8,146, 28,160, 52,170,133, 17,182,143, 71,170, 13, 56, + 17,198,132, 90, 81,144,144,147,246, 23,224,129,145,233, 33,127, 81,150, 84,228, 12, 37, 19, 19, 22,228, 98,220, 93, 83,253,186, +252,159,127, 48,175, 74, 50,238,248, 7,163,206,254,155, 15, 98,239, 18, 87, 37,113, 37,193, 14, 76, 96, 57,240, 21,160, 20,173, +176,239, 0, 1, 91,101,186,144, 13, 6,218,214,201,245,102, 14, 99, 79, 39, 27,117,128,113, 7, 67,253,158,245,141,139,232,222, +161,130,240,197,202,219, 81, 60, 8,212,127,111,120,101, 35,211,255, 0,255, 0, 47,196, 76, 43, 29,238,119,111,251,207,154, 43, + 35,197, 59,129, 17,134,163, 78, 98, 41,102,227, 2,116, 73,106,152,196,210,183, 92,117, 43,112, 45, 95, 22,223, 21, 72,232,117, + 12,239, 93, 74,217,211, 58,235,218,107, 39,155,130, 8, 98, 57,104,137,211,254,158,194,152, 93, 93,182,111,141,160,106,204, 65, + 5,193,226,117, 80, 44,223,149,111,230, 85,217,254,217, 35,177, 24,175,168,152,182, 95, 78,144, 20, 11, 51,154,131,242,183, 56, +145,131,222,104,109,185, 68,135, 27, 79, 46,128, 72, 3,195,166,218,149,158,165,233,247,219,231, 75, 23,117,167,189,193, 62, 31, +216,161, 95,165,122,158, 61, 94, 76,115, 54,210, 59,152,129,227,203,222,172,255, 0, 86, 31,148,119,113,189, 72,102, 29,150,206, + 95,207,195,215,190,215, 33,132, 92,229,221,224,165,217,151,167, 26,158,204,213, 60,227,145,150,211,104, 82,188,162, 62,225,235, +227,172,238,151,234,136, 98, 87,124, 5, 95,230,187, 49, 97, 29, 8,230,253,171, 83,171,250, 74,121,182,227,216,109,214,150,114, + 67,153, 49, 7,147,118, 46,234,183,176,184,208, 89,142,191,190,132, 37, 38,158,208, 41,174, 61,118,203,231,255, 0,231,131,235, +111, 40,197,241,187,103,160, 15, 78, 37,115,253, 69,247, 64, 55,110,185,181, 1, 85,126, 13,154, 98,254, 95,201,168,160, 67,147, + 13, 81, 82,126, 22,130,212,105, 84,171, 93,215,163,186, 60, 37, 35,153,126,149, 85,168,126,100,127, 15,197,151,158,250,227,173, +206, 49,142, 14, 62,182,219,161,110, 81, 58,127,241,125,193,251,151, 65,126, 91,222,139,113,127, 69, 62,156,173, 29,179,181, 4, +189,146, 41, 63, 63,127,185, 4,241, 84,219,155,232, 79,158,246,251,132,138, 4, 32,120, 33, 34,181, 53, 39,157,235,189, 94,125, + 71, 38, 86,203,135, 0, 59, 7, 33,249,158,245,211,250,127,162,195,165,226,198,152,234,120,200,246,200,241, 63,144,238, 93, 8, +163,196, 21, 30,131,125, 99,173,181,240,243,185,189,236,245,111,223,255, 0, 92,173,122,166,245, 59,233,203,184, 25, 47,111,177, +133, 41, 24, 7,111,155,178,222,162,194,182, 37, 14,133,180,236,146,236, 23, 67,174,213, 33,199, 40,144, 22,224, 77,126, 4, 37, + 26,246, 10,177, 49, 49,176,191,111, 70, 85, 80,148,190,121,238,137, 39,184,106, 27,176,118, 14,242,235,196,110,204,205,202,207, + 25, 57, 24,118,206, 16,249, 33,182, 64, 14,194,126, 18,231,153,237, 61,193,144,223,204,175,215, 55,116,189, 65,119,115,176,249, + 22, 83,216,236,155,183,179,176,139,196,201,246,171, 78, 64,212,196, 72,200, 93,122,117,173,227, 30, 16,126, 19, 4,173, 38, 50, + 80,120,165,102,174, 39,110,149, 47,167, 58, 37, 56,180,100, 70, 25, 16,176, 78, 32, 18, 25,163,164,181, 58,158,222,238, 5, 11, +213, 29,122,252,188,140,105, 79, 26,117,152, 72,144, 36, 11,203, 88,232, 30, 35,179,191,136, 95, 89,251, 18,222, 27,235, 3,180, +248, 47,125,251,199,219,143,242,247,114,173,137,151, 46,213,106,202,161,165,203,189,133,231, 30, 84, 87, 60,181,202,101,167, 90, + 83,168,101, 11, 52, 74,106, 56,245,160, 58,242,220,193, 44, 59, 44,166,187,119, 64,176, 38, 39, 73,115,228, 72, 44,235,215,112, +140,115,171,174,251,105,219, 48,228, 9, 15,138, 60,185,128, 67,183,224,169,159,207, 83,179, 29,179,201,127, 46, 12,207, 44,190, +194, 97, 57, 14, 44,187, 93,210,197,112,113, 40, 14,198,146,237,218, 52, 21, 37,181,171,113,230,182,242,155, 34,187,212,120,129, +173,175, 68,228, 78,190,163, 92, 98,116,147,130, 59, 67, 19,247, 51,172, 47, 94,226,215,111, 76,178, 82, 1,224,196, 30,194,224, +125,224,178, 7,249, 73,250,173,193,251,119,232, 23,177,248, 79,119, 46,197, 61,192,203,100, 77,198, 49,155, 98, 65,118, 83,205, + 49,121,153, 30, 59,133, 21,170, 24,110, 59, 72, 5,197, 81, 35,100,141,200, 4,190,167,233,179,183, 63, 34, 85,143,134, 13, 34, +121,107, 16, 79,180,147,193, 11,210,125, 86, 21,116,236, 88, 91, 47,142,111, 24,142,122, 74, 64,123, 0, 28, 87, 92, 98,254,161, + 59,115,155,119,118,253,217,124, 69,215,238, 25, 54, 46,211, 11,200,102, 71, 97, 70,223, 2, 76,148,165,214, 96,185, 36,209, 42, +146,166,150, 29, 45,163,151, 20,238,190, 36,164, 30, 98,220, 43, 43,170, 54,201,128,151, 14,210, 7, 54,236,125, 31,220,186,186, +179,235,182,233, 85, 23, 38, 31, 49,228, 9,228,253,173,171,114, 28, 81, 94,226,119, 79, 21,237,130,172, 45,100,223, 50,169, 25, + 45,222, 30, 45,105,102, 4, 71,229,184,228,233,169,113,196,115, 76,116,168,161,164, 54,210,220,113,197, 81, 40, 66, 74,148, 64, + 4,234, 24,248,210,187,118,214,248, 98,100, 92,182,131,243,228, 7, 50,137,147,151, 10, 54,238,127,138, 66, 33,131,234,127, 45, + 28,158, 65, 87, 16,125,122,118, 70,255, 0,101,179, 93,112,120, 57, 22, 73, 58,245,106,107, 43,110,211,143,227,151, 89,151, 24, +150,105, 14, 45,184,243,102, 71, 67, 65, 76,162, 65,109,101,132,171,227,124, 2, 90, 74,192, 36,104, 75,162, 93, 19, 33, 51, 24, +177,218,230, 64, 2,121,128,121,183, 62, 67,155, 44,216,245,250, 39, 24,152, 9,200,202, 59,152, 68,146, 34,120, 18, 27, 71,229, +204,242, 5, 92, 81,238,214,233, 43,101,148, 58, 19, 46, 67, 66, 75, 81,222, 5,167,203,123,124, 69,151, 66, 92, 20,168, 4, 20, +130, 14,199,125,100,152,144,182, 68,193,246,173,127,230, 44,127,130,220,249,232,254, 91,126, 80,113, 94,115,116, 73,124, 5, 53, +200,215,110, 96,130,159,111,134,159,203,151, 97, 77,230, 71,180, 45,203,185, 91,154,152, 45,206,200,109, 55, 2,130,248, 97, 75, + 72,112,182, 13, 10,248,147, 94, 32,248,244,212,118,150,116,251,131,179,234,180, 55,146, 99,175, 41, 40,106,124,101, 45,106,105, +180, 4,190,209, 42, 83,232,243, 90, 72,161,220,173, 31, 18, 71,136,220,106, 94, 92,187, 10, 97,108,123, 66, 64,201,125, 88,246, +167, 19,238,155,157,159,188, 55,116, 25,123, 87, 60,127, 31, 90,154,181, 77,118, 47,204,100,241,229,200,183,184, 36, 33, 5,178, +201,249, 39, 80,227,128,241,109,116, 10,165, 70,175, 87,210,237,157, 94, 96,109,173, 35,196, 63,194,207,167,110,161,135, 49,193, +103,219,213,234,174,223, 40,238,220,241, 28, 11, 60,129,109,123, 52, 32,158, 71,138,179, 53,156,180,214,105, 36,179, 73, 37,154, + 73, 44,210, 73,102,146, 75, 52,146, 89,164,146,205, 36,150,105, 36,179, 73, 37,154, 73, 44,210, 73,102,146, 74,188,245, 11,234, + 63, 19,244,221,107,181, 95,115,104, 82,228, 88,174,142, 92, 98,166, 84, 20,182,176,212,136, 22, 73,119,180, 52,164,169, 73, 81, + 83,232,134,182,154, 9, 6,174, 20,143, 29, 93,194,193,150, 73, 34, 36, 56,111,188,129,247, 59,158,228, 59, 45, 16,226,170,137, +255, 0,154,111, 99, 45,246, 73, 57, 43,150,123,203,150, 22, 97,137,209,222,102, 51, 78, 57, 41,244,198,177, 74,126, 27, 76,161, +101,210,251, 9,191,181,230, 32,164,113, 45, 59,253, 77,244, 71,167,238, 36, 7, 14,255, 0,171, 95, 3,180,183,136, 65,253,220, +126,222,207,226,167, 73,252,203,187, 49,111,190, 34,217,115,181,221, 26,180,204,186, 53,102,179,221, 80,136,239, 69,184, 50,114, + 11,141,130, 76,230, 75, 78, 21,124,188,115,108,118, 67,138,165,124,146, 20, 7, 80, 32, 58, 21,164, 56, 33,192,114, 59, 62, 16, + 64,241, 46, 7,138,127,221, 71,237,226,202,118, 77,234,231, 49,188, 89,187, 51,155,118,123, 28,114,231,103,238,101,198,123, 31, +201,102, 57, 22, 60,199,160, 53,142,220, 46,177,157,106, 67,174,134, 27, 10, 49,155,120,146, 85, 86,234, 0, 42, 32,106, 21,244, +216,196,221, 27, 36,198,176, 53,228,251,128, 58,113,230,222, 41,205,199,225, 32,113,254, 10,171,176,126,110,118, 31,230,153, 18, +239,152,236,149,182,153,171, 69,142,208,227,176,173,239,197,141,108,198,237,115,174,172, 73,149, 41,239, 37,233, 41,184, 78, 45, + 52,134,190,248,161,216, 10,157, 25,250,108,180, 90, 67,134,167, 83,198, 82, 1,135, 16, 24, 57,116, 33,152, 53,211,236,193, 57, + 55,249,159,225,107,199,218,206,156,194,111,141,246,234,227, 42,253,101,199,238, 43,118,216, 36, 92,174,150, 39,254, 95,229,147, + 19,207,243, 26, 15,174,169,109, 78,241,162,129, 10, 9, 20, 81,171,254,129, 61,219,119,199,112, 0,145,174,128,243,118,213,187, +148,255, 0,116, 56,177,100, 2,249,249,157, 94,187, 83,220, 92,215, 7,239, 46, 30,228,107,245,150,106,156,183,217, 33,220, 45, +129,230, 45,145, 49,219, 77,206, 66, 85, 41,215,210,212,169, 78,189,113, 5,150,154, 2,169,216,144, 83, 82,104,116, 17,116, 33, + 42,231,161, 26,150, 60, 76,164, 56, 54,128, 54,164,168,156,173,164,130, 62,204, 21,141,108,245,221,101,190,246,242,243,220,235, + 30, 25,121,123, 20,135,125,255, 0, 35,216, 30,117,219, 83, 74,191, 94,220,200, 6, 56,203, 17,155, 50, 75,173, 33,114, 20,146, + 87, 33, 8,226,154,236,104, 43, 74, 93, 32,198, 98, 6, 97,204,119, 30, 58, 13,187,181,211,179,177,209, 6, 67,135,110,109,247, +178, 94,151,249,149, 89, 96, 93,178,140,102, 87,111,111,202,202,112,150, 26,119, 43,140,196,139, 42,154,133, 34, 77,210, 69,162, + 44,100, 56,228,180, 23,149, 33,230, 80, 91, 40, 73, 79, 23, 1, 89, 69, 8,209,135, 66, 36, 68,249,145,105,240,227,174,128,147, +195, 70, 28,124, 20,127,117,199, 67,162,182,251, 33,222,249,189,218,185,229,120,197,255, 0, 30,145,141,102,152,117,194, 53,154, +241,111,149, 38, 44,196,121,178,237,113,239, 12,173,167,226, 41, 73, 82, 75, 18,155,175, 66, 13, 71,134,179,114,241, 5, 34, 50, + 18,220, 36, 28, 29, 71, 2, 71, 62,240,141, 93,155,159, 70,101, 15,212,150, 96,238, 21,103,133,115, 73, 92,102, 31, 76,136, 43, +185, 2,176,220, 98,234,153, 85, 20,164,236,146,176,130,144,163, 74,110, 1,169,212, 49, 34, 37, 61, 83,216, 88, 42,107,181, 61, +235, 70, 45,100,157,148,228, 83, 46, 45, 99,247,233, 6, 85,138, 5,171,229,208,227,241,155,108, 48,101,190,185, 73, 43, 72,121, + 73,170, 56, 83,110,181, 53,165,235, 48,205,242,120,232,130, 45,216, 53, 90,115,223, 80, 70,251,103,144,206, 4,101,217,242,159, + 37,104,137,118,186,220, 28,152, 67,138, 79, 14, 60, 93, 10, 8, 43, 73, 40,170, 72,251,213,251,193, 36, 56,233,222, 83, 72,252, + 77,201, 49,191,118,131, 69,207, 22,222,221,119,143, 32,201,158,195,236,184,164,227,146, 69, 89,102,115, 15, 39,145, 97,193,178, +129,249,127, 50,180, 62, 42, 41, 7,173,117,190,114, 96, 34, 36, 72, 0,170, 62, 89,118, 93,121,232,127,210,221,239,179, 48,110, + 25,223,113,144, 7,113,110,164,178,150,127, 12,252,180, 96, 65,160,242,202,128, 42,160, 20,169,160, 27,238, 78,185,238,165,154, + 45,104,196,233,249,171,216,244,237,212,241, 93, 3,172,149,105,101, 43,177,233,164,146,205, 36,144, 30,227,118,207, 11,238,182, + 54,238, 41,156,193,110,109,165,221,192, 88,162,219, 85, 40, 22,218,197, 20,149, 15,104, 53,214,127, 83,233, 88,253, 66,163, 85, +240, 19,137,237,252, 65,226, 15,120, 90, 29, 47,170,228,116,235,133,212, 76,194, 99,152,252, 8,224, 71,113, 92,211,150,254, 87, +246,199,231, 41,236, 51, 35,114, 52, 5, 18, 82,204,198, 18,250,146, 61,129,105, 91,127,164,107,202,115,126,141, 99, 78, 79, 77, +242,128,236, 49, 18,251,222, 43,214,176,190,180,100,215, 22,186,136,204,246,137, 24,253,205, 36, 87,182,255, 0,150,206, 33,143, +220, 90,184,230,247, 5,221,139, 74, 11, 12,113, 13, 50,162, 13,126, 36, 2, 73,250, 9,166,180,186, 55,210,108, 12, 73,137,221, + 35,113, 28,142,145,246,128,239,237, 44,178,250,215,213,204,252,184, 24, 83, 17, 72, 60,198,178,246, 18,205,236, 14,186, 74,193, +143, 90,113,155, 99,118,139, 51, 41, 98, 11, 73, 8, 66, 16, 0, 20, 2,131, 97,175, 82,132, 4, 0, 0, 48, 11,202,231, 51, 50, + 73, 46, 74,155,169, 40,172,210, 73,102,146, 75, 52,146, 89,164,146,205, 36,149, 5,234,219,182,126,168,114,174,228, 98, 19,251, + 9,144,202,182,118,254,236,164,227,189,193,101,153,166, 58,224, 91, 89,156,205,225, 55, 27,120,168, 41,148,227,113,223,183,169, + 72,170,169, 37, 43,232,213, 70,215, 77,201,198,174,185,249,177, 6, 67, 88,105,196,177, 12,123,181, 18,255, 0,194, 71, 53,133, +213,113,114,172,182,191, 38,100, 64,233, 61, 89,131,137,110, 29,229,140,116,254,240, 60,151, 57, 79,236,247,230,163,117,186,230, + 76, 92,242, 91,251, 50,230, 92,225, 54,217,182, 76,182,198,129, 46,220,238,115, 2, 90,164, 90, 37,255, 0, 56, 83,209, 12, 91, + 27,111,182,182,204, 8,254, 96, 81, 73,243, 92,162,149,184, 51,122,108, 68, 26, 17,208, 30, 32,146, 15,151, 32,210, 27, 24,188, +216,131,186, 77,220, 23, 62,112, 58,172,141,143, 57,107, 33,192,128, 8,243, 34, 94, 39,123,134,131,130, 54, 69,251,207, 19,221, +244,236,135,173, 43,158, 65,220,126,223,224, 76,228,215,190,218, 92,108, 48, 99,227, 55, 28,131, 34,134,150,218,159, 1,235, 99, +173,199,132,133, 92,157, 83,233,119,200,125, 79, 59, 54, 51, 14,215,154, 75,175, 33,192, 18, 12, 44,236, 72,198,169,207,100,102, + 36,119, 1, 19,192,238,212,252, 58, 51,134, 17, 36,112,210, 36,106,124,254,159,155, 41, 93, 10,196,229, 3, 17,180,153, 14, 35, +110,131,226, 46,236, 92,200, 68,241,214, 64,233,179,188, 24, 55,230, 75, 55, 54,207,215,219,169, 23,180,203,155, 11, 52, 77,150, +226,213,238,214,205,141,232, 18,177,119, 99, 99, 48,109,112,213, 33, 15,197,185, 49,116, 44,184,236,135, 90,109, 63, 10,207,156, +164,168, 37, 45,137,145,211,196, 43,222, 35,161,131,141,167,115,137, 13,230, 69,152,196,197,192, 0,158, 90, 41,102,227,117, 41, + 89,111,150,101,168,177,142,225,181,140, 8,128,136,119, 18, 18, 98, 73, 0,113,248,139,171, 95,211,213,183,213,119,102, 49, 78, +232, 51,149,195,187,102,191, 34,236,123,159,109,237,247,187,196, 25, 19,174, 69,120,196, 39,101, 68,249,233, 47, 15, 41, 6,239, +243, 8, 73,144,160, 16, 55, 77, 81,198,185,185,182, 99,100, 78,173,164, 65,193, 19, 32, 22, 31, 17, 98,192,107,240,183, 14, 62, + 43, 83, 2,188,172,104, 93,184, 74,108, 65,128, 50, 4,159,130, 46, 28,157, 62, 55, 26,240,229,163, 47,153,152,119,165,223,206, +187, 9,245, 97,123,245,149, 47,181,144, 47,189,243,188,185, 41,213,203,200, 46,120,244,182, 33,153, 52, 65, 17, 91,110,234,216, + 64, 67, 32, 50,141,207, 22,254, 17,175, 68,200,234,189, 22,220, 88,226,249,198, 53,197,180, 2, 65,219,183,225,237,212,247,175, + 51,197,233, 29,122,156,201,101,249, 17,149,146,125,101, 40, 22,126,207,140, 54,154, 14,237, 23, 76,224, 93,250,255, 0,230, 20, +190,229, 48,113,236,191,183, 88,197,143, 22,150,179, 22, 85,221, 6,208,231,200,161,196, 20, 9, 28, 25,187, 72, 90,131,106, 33, + 68, 37,165,147, 79,186,122,107,157,191, 27,160, 66, 4,194,217,200,142, 3,226,215,187,229, 31,136, 93, 54, 62, 95,169, 39, 49, + 25,213, 8,196,241, 47, 29, 59,254,115,195,192,167, 47,201,227, 6,252,207, 48,108,175, 58, 71,174,187,165,206,110, 41, 45,214, + 77,154, 62, 75,116,106,237, 36, 77, 75,139, 50, 29,136,227,110,189,229, 70, 40, 41, 1, 1, 65, 53,167, 20,141,235, 83,213,153, + 61, 54,209, 95,237, 0, 4,113, 96,193,185, 63, 7, 63, 98, 85,207, 70,226,245, 74, 77,191,189,145, 32,157, 28,238, 47,204,141, + 75, 14,239,112, 93,228,187,101,189,197, 21,184,202, 74,143, 82, 70,184,197,221, 46, 20,252,223, 61, 30,119,239,212, 79,125, 61, + 59,102,157,141,198,191,156, 98,248, 69,246,117,199, 43,146,220,203,116, 79,146,142,245,194,206,251,107, 40,154,251, 75,114,168, +138,233,163, 73, 81, 28,122, 84,138,246, 94,151,234,216,248,152,249, 80,182, 76,108,136, 17,208,151, 45, 46,192, 91,136,226,184, +111, 87,116,124,156,220,156, 73,211, 29,209,174,100,203, 80, 24, 60, 15, 50, 31,129,224,234,192,252,193, 99,126,100,184,204, 76, + 27, 58,252,191, 19,107,152,205,144,206, 57, 94, 47,116, 83, 9, 93,223,230, 18,210, 99,164,137,106,101,162,219, 97, 43, 39,139, +237,185, 82, 40, 72,168,213, 14,128,122,113, 19,134,102,225,185,182,200,114,226,252, 28,235,224, 66,209,245, 24,234, 96,215, 60, + 29,167,107,238,137,111,137,217,184,176, 97,175, 48, 87, 34,247,251, 6,252,232,127, 52, 27,109,171,177, 29,238,195,172,253,173, +236, 91,115, 88,157,123,145, 17,198,201,148,227, 6,169, 83,141,137,146,228, 59,229,130, 84,219,105, 8, 65, 93, 10,149, 80, 10, +122,172, 44,190,143,209,137,182,153,202,219, 25,135,119,220, 0,239, 58,150,224, 23, 33,159,133,215, 58,224,141, 55, 66, 52,212, +238, 75,241,251,201, 61,195, 64,252, 79,103,101,100,126,141,229,118,231,180, 61,145,237, 87,103, 45,134, 85,147, 1,202, 44, 51, +110, 46,169,216,237, 60,221,174,221,110,154,195,178, 92, 46,169, 5,197, 23, 95, 10, 82, 81, 85, 21, 44,144,154, 87, 92,133, 93, + 83,205,179, 34,203, 78,182, 66, 77,226, 72,211,220, 62,229,218,221,210, 60,170,177,170,164, 60,106,156, 95,135, 0, 8,126,253, + 79,222,171,222,196,250, 88,245, 1,217,255, 0, 81,240,103,217,109,183,168, 45, 43, 49,203,178,204,207, 49,145,145, 34, 78, 61, +144,216,111,139,159, 38, 20, 54,172,198,107,142, 34, 91,110,200,139,205, 74,136,218, 80,166,150,164,184,190,116, 55,243,186,157, + 23,227,144, 76, 79,244,225, 24,199,107, 74, 50,142,208, 78,230,225,161,254, 98,238, 52, 12,179,176, 58, 86, 70, 62, 72, 32, 72, +127, 82,114,148,183, 60,101, 25,110, 32,109,221,243, 2, 99,252,161,152,234, 93,118,212,235, 53,170,240, 34,185,119,140,220,135, + 97,186,137,177, 75,200, 74,203, 50, 16,146,132,184,138,244, 80, 10, 34,163,192,157,114,145,153,139,177,226,187, 25, 64, 73,156, + 59,106,185,179, 58,237, 63,121, 59, 45,220,174,225,205,236,182, 25,112,191,118,251,184,118,123, 28, 59, 92,140, 30,233, 98,179, +221, 49,187,149,138, 3,150,182,217, 41,189,201,134,215,201,169,160,202,208,182, 84,181,161, 69,193,229,144, 65,215, 67, 78, 85, + 57, 21,214, 45,152,140,171,148,159,112,145, 18, 18, 47,252,160,235,199,139, 3,166,171,153,191, 18,236,107,109, 53, 86,101, 27, + 35, 22,218, 99, 19, 19, 16,223,204, 64,218,205,193,200,215, 69, 80,200,244,183,235, 94,235,222,222,217,119, 7,184, 56,239,243, + 44,215, 18,145,219,137, 23, 92,190,196, 48,166,254,125,152, 86,136,240,114,117,220,174,115,148,221,249,217, 31, 52,185, 28, 25, + 99,132,101,199,220,243,117, 92, 53,172, 58,158, 28,105,182, 16,147, 70, 98,198,137,223,163,146, 96,192,124, 0, 51,106, 94, 66, + 93,131, 85,142,122, 86,116,175,166,115,139,202, 6,167,144,217,171, 0, 39,186, 71,227, 37,221,128,104,152,246,157, 22,190,213, +126, 89, 14, 91,240, 28, 2,205,158,118,174,198,187,180, 30,205,228, 24,174, 80,137, 12, 88, 31, 81,205,223,122,215,252,188,186, +180,173, 65,217, 9,109, 51, 2, 36,130,164,160, 21, 15, 49, 60,133, 86, 87,168,222,203, 12, 45,147, 27,227, 40,252,223, 39,196, +254, 3,229,211,159,102,137,177, 61, 46,213,212, 39, 76, 92, 99,202, 50,249,127,204,248, 91,196,252,205, 46, 90,235,170,135,217, +255, 0, 64,221,247,110,251,110,119,191,118, 60,134,225,220,214,101,218,114, 72,121,229,162,127,111,214,196,116, 65,177, 71,105, + 22,153,211,103, 52,230, 67,197, 14, 52,168, 78,181, 25,213, 48,235,106, 82,130,211,201, 90,158, 95, 92,163,105,242,101, 17, 6, + 35,105, 22,115,145,248,128, 31, 7,253,224, 72,112,116,109, 16,240,253, 63,145,184,121,209,153,155,137,111, 6,189, 26, 35,225, + 36,143, 51,150,210, 1,218, 70,175,170, 31,221,143,203,187,188, 42,244,157,219,110,205,118,227,182, 86,216,121,108,126,220, 57, +106,200,110, 88,252, 44, 17, 87,168,217,226,173,112,155, 65,184, 92,239,229, 74, 68, 79,152,109,107, 92,139,106,151, 39,204, 66, + 74, 22,132,132,171, 68,197,235,245,126,234,219,103,105, 35,205,112, 9,155, 24, 57,224, 35,205,185, 73,162,199, 80, 84, 50,253, + 57,119,237, 42,170,186, 64,144,169,137, 2,189,194,198, 28,101, 46, 79,196,193,228,227, 66, 56,174,247,196, 48,219, 51,182,123, + 86, 69,145,217, 35,179,158,148, 68,185,206,126, 83, 17, 28,154,221,205, 54,209,111, 91,174, 62,201,112, 41,228,178, 84,193,113, + 43, 87,193, 84,133, 20,235,135,182,226,230, 49,145,219,168,230,204,239,195,177,245,110,213,223,211, 76, 90, 50,148, 70,237, 9, +224,238,205,199,181,180,119,225,220,153, 53, 93, 89, 89,164,146,205, 36,150,105, 36,179, 73, 37,154, 73, 44,210, 73,102,146, 75, + 52,146, 89,164,146,205, 36,150,105, 36,179, 73, 37,154, 73, 37,158,233,246,127,183,221,232,179, 91,241,254,227,192, 23, 11, 69, +178,231,110,200,226, 50,165, 45, 33, 51,173,114, 83, 42, 58,207, 2, 57, 36, 45, 52, 82, 78,202, 4,130, 40,116,124,124,153,208, + 73,129, 98, 65, 30,195,197, 70,112, 18,226,149,109,254,141,125, 58, 91,101,218,229,199,199,155, 81,179, 94,239,121,132, 6,157, +113,215, 26, 69,203, 32,105,214, 39, 44,182,181, 20,169, 10, 67,196, 37, 4,113, 69, 19,196, 14, 35, 86,101,213, 47, 32,252, 92, + 98, 35,236,143, 5, 1, 76,123, 57,191,189, 68,111,208,223,166,134,241,171, 30, 39,254, 95,229,102,199,113,251,190, 11,107, 75, +146, 36, 45,104,180, 95, 16,148, 77,109, 75, 82,138,148,181,132,236,181, 30, 73, 42, 85, 8,169,212,191,213,175,221, 41,110,214, + 82, 18, 62, 35,130,111, 34, 44, 3,112, 12,183, 95,189, 26,246, 98,251, 18,209, 13, 42,188, 91,145,143,174, 35,150, 21,217,175, +183,107,123,150,211, 10,204,171, 3, 98, 34,226, 60,133, 52,147, 13,106, 66,194, 8, 11,169, 42,169, 39, 77, 14,167,108, 73,224, +119, 59,184, 5,220,238,213,199,106, 70,136,159,103,253,136, 93,175,242,255, 0,244,205,142, 56,153,120, 93,182,225,143,222, 80, +164,169,171,166, 61,124,188, 91,103,182,143,229,145,109, 14, 54, 37,196,144,135,138, 29, 98, 27, 37,192,165, 30,110, 36, 56,127, + 19,226,212,229,214,111,151,204, 68,135, 97, 0,142, 36,240, 35,145, 37,187,180,224,152, 99,196,112,209, 77,149,232,111,211,108, +236, 38, 47,110,231, 89, 94,127, 17,135, 42,249,115,143, 25,235,132,247, 22,153, 57, 17,116,206,115,207, 91,165,226,162,167, 84, +164, 40,175,146, 21, 66,146, 8, 7, 81, 29, 90,241, 51, 48,117, 32, 14, 3,249,120, 39,242, 34,205,246,213, 70,143,232, 63,176, +208,238,114,114, 56, 78,228, 76,102,147, 93,122, 68,220,133,140,175, 35,106,239, 32, 73,135, 22, 11,237, 59, 57,185, 97,245, 54, +182,225, 49,240, 21, 81, 37, 9, 41,226, 64,212,143, 87,184,128, 62, 22, 28,182,197,184,147,193,155,153,247,166,253,188,123,253, +229, 79, 71,162,222,193, 35, 22,155,132,136, 51,191,202,211,156,153, 45,200,127,205,238,128, 55, 46,109,233, 57, 10,165,180,160, +240, 90, 36, 55, 53, 33,198,221, 74,185,162,148, 6,149, 26,135,250,165,219,132,156, 56,110, 67,128, 27, 91,135, 6,226, 19,249, + 17,102,251,118,161,119, 47, 66,253,148,131,133,102, 22, 76, 58,220, 14, 79,152, 90,191,147, 93, 39,228, 83, 46,215, 49, 49,198, +231,201,186,181, 34, 98,254,105,169, 75,116, 75,148,181,151, 16,242, 86, 62, 16,149, 0,148,128, 72,245,107, 76,224,100,116,137, +112,192, 6,208, 6, 26, 55, 1,193,153, 49,162, 44, 91,154, 39,233, 75,211,125,223,211,221,171, 38,149,149,223,220,200,179,108, +182,234,155,237,206,107,139,184, 56,134,203, 54,248,246,198, 90, 67,151, 89, 83, 37, 47,139, 81,210, 74,156,120,238,104,144,148, +132,164, 15,168,231, 12,131, 29,177,219, 24,134, 28, 59, 73,228, 0,231,216,158,154,182, 59,151,117,104, 92,173,118,235,196, 69, + 64,186,176,137, 16,151,247,155,121, 33, 73, 62,250, 31, 29, 80,140,140, 75,132, 82, 29,115,111,125,189, 35,247, 5,236,176,223, + 59, 60, 89,145,141,201, 72,173,170, 87, 0, 96,173, 63,120, 50,183, 30,104,121, 74, 63, 16, 73,169, 4,154,109, 74,108, 98,117, + 8,198, 45, 34,202,181,180,146,116, 66,123, 95,232,167,184,151,156,177,137,221,227,242,163,227, 17, 20, 31, 76, 88,165,170,184, +161,208,126, 27,175, 30, 95,218, 42, 20, 29, 5,119, 4,191,169, 68, 71,225, 46, 84, 97, 65,125, 87, 85, 67,133, 14,223, 29, 17, + 32,182,150,163, 33, 41, 66, 16,128, 0, 9, 74, 66, 82, 62,160, 41,172, 34, 73,226,174, 50,219,166, 73,102,146, 75,231, 46, 63, +249,187,122,158,185,249,159, 59, 96,198, 83,197, 37, 73,242,225,221, 5,104, 43,227, 60,235,197,170,250,143,155, 63,229,175,221, + 47,212,131, 57,144,180,221,127, 55,239, 84, 13,217,127,152, 90,241,252,100,201, 73, 1, 65,232, 87, 85, 39,236, 76,240,127, 78, +166,126,162,230, 3,242,215,238,151,234, 79,188,173, 80, 63, 55,127, 87, 55, 8,168,125,172,119, 22,230,170, 2, 62, 70,239,250, + 63,248,142,133, 63,169, 89,145,254, 90,253,210,253, 73, 70, 68,162, 81,255, 0, 53,159, 87,101,250, 72,199, 49,159,151,240, 40, +133,118, 7,167,190,224,117, 84,253, 82,204,254,229,126,233,126,164, 64,232,196, 79,205, 51,212,106,156,109,169,150, 60,121, 43, + 80,170,169, 14,230, 62,138, 86,105,208, 39,245, 83, 60,127, 37, 94,233,126,180,218,169,183, 95,205, 3,191,182,242, 11,118, 91, + 10,155, 62,216,183, 26,236,105,225, 51, 67,135,213,110,163, 47,228,171,221, 47,214,164, 10,214,159,205, 15,212, 2,225,153, 73, +179, 88, 43, 83,196,124,165,203,244,255, 0, 27,162, 15,170,125, 69,219,101, 94,233,126,180,150,184,255, 0,154, 31,169, 7,149, +229,155, 5,128,184,122,113,135,114,255, 0,251,221, 41,253, 85,207,143,242, 85,238,151,235, 73, 23,133,249,139,250,155,144,217, +113,220,126,196, 18, 0, 87,195, 14,228, 63, 92,211,160, 31,171, 89,238,219, 41,247, 75,245,169, 70, 46, 20,156,107,243, 12,245, + 41,120, 83,142, 75,176,216,209, 21,181,240, 42, 68, 75,136, 52,229, 79,218,152,116,174,250,179,212, 34,205, 10,125,210,253,106, +117,213,184,169,240,255, 0, 48, 46,253, 79,121, 41, 98,209,100, 13, 82,171, 81,141, 60,211,236,151,164, 62,171,245, 34, 88, 87, + 81, 63,240,203,245,171, 7, 20, 33, 23,207,204,127,212, 29,154,236,237,189,118,156,124,182,157,144, 76, 91,141,107, 90,111,252, +102,141, 71,213, 62,163,103,242, 85,238,151,235, 66,149, 12,129,187,249,154,250,170, 68,192,215,242,108, 99,229,137, 52, 38, 21, +215,149, 60, 63,246,253, 91, 31, 84, 51, 27, 88, 87,238,151,234, 66, 48, 71,237,127,152,111,168,169,240, 85, 57,251,126, 50,130, +145,208, 66,185,117,167,254,253,172,252,159,171,121,213,159,134,186,253,210,253,105,196, 7, 52, 58, 71,230, 91,234, 29,190, 78, + 34,217,141, 20, 32,241, 36,195,185,125, 31,253,251, 76, 62,173,103,145,254, 93, 94,233,126,180,132, 66,158,159,204,111,191,207, + 33, 14,179,106,199,150,159,218,164, 75,143, 74, 87,111,227,117, 40,253, 88,234, 18,255, 0,167, 87,186, 95,173, 64,179,168, 25, + 15,230,133,222,187, 26, 18,143,229, 22, 19, 36,141,210, 98,220, 41,211,221, 48,104,227,234,135, 82, 63,201, 87,186, 95,173, 49, + 75,147,127, 55, 14,250,166, 90, 97,194,177, 99,190,122,129, 63,137, 18,226,124, 61,211, 70,141,254,229,245, 22,125,149,123,165, +250,211, 2,165, 65,252,214,251,252,227, 11, 84,171, 6, 60, 31, 29, 56, 68,184,129,250,102,147,161,127,186, 29, 67,251,149,123, +165,250,212,128, 90, 46,191,155, 31,168,168,173, 3,108,177, 99,102, 81, 52, 33,112,238,100, 83,253,153,195, 69,143,212,236,254, +112,171,221, 47,214,162, 65, 81,162,126,107,126,174,222, 99,230, 28,199,113,143, 47,246,105, 6,237,191,219,112,212,101,245, 75, + 55,148, 42,247, 75,245, 41,109, 41,135, 31,252,208,253, 65, 92, 35,242,187,217,113,244,189,236,110, 29,200, 10,255, 0,181, 52, +234,142, 71,213,142,165, 14, 21,213,238,151,235, 68,141, 96,135, 40,244, 31,204,159,187,146,225,115,114,217,100, 18, 9,160, 31, + 43, 63,143,217,243,122,174,126,174,245, 63,252,186,125,211,253,104,158, 92, 89, 25,123,243, 7,206,161, 65, 68,135, 96, 89,211, + 49, 95,120, 8,242,192,255, 0,245, 53,253, 58, 20,126,175,245, 82,127,203,167,252, 51,253,105,121,112,239, 81, 99,254, 98, 61, +216,185, 7, 4, 8, 54, 62,104, 21, 72, 92,105,198,166,190,233, 99, 69,255, 0,119, 58,160,227, 85, 94,233,254,181, 63, 34, 39, +130, 84,185,254,100,254,170, 34, 42, 66,162,216,177,183, 80,201, 88, 74,132, 11,169,217, 29, 73,164,239, 15, 29,108,226,125, 79, +206,184, 57,174,191,116,191, 82, 9,164,190,156, 20,120,191,154, 31,169,119,203, 73, 85,151, 27,243, 86,160,149, 36, 67,185,248, +164, 40,211,248,253, 18,223,169,153,177, 26, 66,191,116,191, 82,128,129, 76,150,207,204,135,189,171, 83,137,187, 91, 44, 77,169, + 9, 10, 1,184,215, 1,191,251, 83, 14,179,109,250,171,212,128,210,186,189,210,253,105,128, 76,120,207,175, 30,237,100, 22,183, +167,166, 13,148, 45,170,236,152,243,105,183,211, 43, 84, 44,250,193,212,225,198,186,127,195, 63,214,165,180, 47,199,253,122,119, +102, 27, 2, 68,155,125,156,182,118,170, 99,205,254,153, 90,171, 47,173, 61, 76, 22,242,233,255, 0, 12,255, 0, 90, 32,174, 40, + 92,207,204, 55,188,173,188,132,197,183,216,212,202,235,186,163, 79, 39,165,124, 37,234,205,127, 88,250,148,134,181,213,238,159, +235, 81,242,194, 29,145,254,100, 61,243,180, 50, 36, 69,182,216, 20,215,237,121,145,110, 7,245, 76, 26,181, 71,213,206,161, 51, +173,117,123,165,250,211,121, 97, 13,183,126,105, 61,225,185,173,108,181,108,176,165,212, 3, 94, 81,167,210,191,254,115, 87,127, +221, 46,161,253,202,189,210,253,105,140, 16,135,127, 53, 63, 81,233,184, 57, 25,187, 70, 52,166, 82,118,254, 18,231,202,149,255, + 0,223,181, 33,245, 71, 63,251,149,123,165,250,211, 8, 58,144,159,205, 31,212,131,197,191, 42,207,141,132,168,144,162,168,151, + 63, 15,255, 0, 29,165,254,232,231,255, 0,114,175,116,191, 90, 91, 10,203,239,230,143,234, 62,214,105, 30,207,142, 56,125,241, + 46,103,195,221, 56,106, 31,238,143, 81,254,229, 94,233,126,180,230, 0, 47,199,255, 0, 52,159, 82, 95, 34,212,136,246, 76,119, +205, 81,163,156,162, 92,200, 30, 59, 82,112,210,255, 0,116,122,139,235, 10,191,195, 47,214,163, 32,200,153,252,208, 59,208,213, +184,202,126,217, 97, 75,225, 60,136,249,107,133, 43,255, 0,231, 52, 57,253, 85,234, 35,254,157, 94,233,126,180,128, 90,113,159, +205, 51,188,183,103,146,212,251,101,129, 33, 70,137, 45, 70,184, 15,254,180,195,160,207,234,199, 82,229, 93, 95,225,159,235, 82, + 17,143, 52,114,251,249,144,119,122,210,210, 95,110,223, 99, 83, 52, 5, 85,141, 62,180, 39,221, 47, 64,255, 0,119, 58,167,254, + 85, 95,225,159,235, 77,240,160,115,255, 0, 53, 30,239, 70,105, 78, 51,109,176,146, 5, 82, 21, 26,224,127, 84,193,169, 15,171, + 93, 83,255, 0, 46,175,240,207,245,164, 54,161,209, 63, 53,254,250,186,190, 79,218,113,224,198,244,164, 91,136, 59,125, 51,117, +108,125, 84,234, 95,249,117,123,165,250,212, 75, 34, 22,159,205, 7,191,183, 69,184,164, 89,108, 38, 58,126,234,147, 22,227,244, +239,252,102,165, 47,170,153,241, 26,194,175,116,191, 90, 76, 74,253,147,249,152,250,153,104,169,230,172, 24,250,162, 36,138,159, +148,185, 86,135,255, 0,198,234, 7,234,206,112,254, 90,189,210,253,106, 91, 10,241, 7,243, 65,245, 13, 48,184, 6, 63, 99,248, + 83,201, 39,229,110, 52, 39,255, 0,206,104,176,250,167,158,127,150,175,116,191, 90,139, 20, 45,191,205,103,212,171, 83,147, 18, +125,131, 30, 64, 89,160,164, 75,152, 61,125,243,181, 41,125, 81,234, 0, 56,133, 94,233,126,181, 33, 2, 83, 53,163,243, 37,245, + 5,113,228,181, 89,172, 33,164,210,188, 98,220,107,250,102,106,145,250,181,212, 71,253, 58,189,210,253,104,166,144, 2,252,202, + 63, 51,174,239, 99,176,154,116,218,236,134, 83,132, 14, 42,143, 62,155,154,120, 75,174,139, 31,170,125, 76,143,146,159,240,207, +245,168,236,138,220,223,230,111,221, 71,162,165, 77, 90,236,198, 74,129, 81, 31, 47, 59,143,135,255, 0,213, 87, 72,125, 82,234, +135,254,157, 63,225,159,235, 81, 34, 33, 3,185,126,107,125,228,183,220,211, 7,249, 77,132,182, 77, 9, 49,174, 21,255, 0,245, +154, 48,250,161,212,191,242,234,255, 0, 12,191, 90,139, 4,102,229,249,150,119,181,171, 31,243, 91,117,170,196,183, 41, 80,149, +198,184, 17,250, 38, 13, 71,253,209,234, 96,235, 93, 95,225,151,235, 73,180, 74, 71,243, 94,245, 48, 94, 33, 22, 60,111,200, 29, + 73,135,116,175, 74,255, 0,247,253, 16,253, 80,234, 3,249, 42,247, 75,245,168,162,182, 95,205, 27,212, 37,218, 56,150, 45, 24, +239,146, 15, 21,113,137,114,168,251,102,234, 51,250,165,212, 34, 91,101, 94,233,126,181, 49, 20,106,245,249,143,247,250, 4, 38, +167, 68,180,216, 84,210,233,203,156, 91,129,161, 35,194,147, 6,170, 67,234,231, 80, 50,219,178,175,116,191, 90, 39,148,162,255, + 0,251,152,119,253, 54,181, 73, 54,107, 9,152, 55, 74, 68, 91,143, 19,245,124,229,127, 78,154,127, 87,115,227, 38,217, 87,186, + 95,173, 35, 80, 73,185, 95,230,245,234, 67, 24,113,128,230, 63,142,169, 14, 40, 37, 99,228,238,149, 0,251, 41, 59, 86,241,254, +169,117, 27,120, 66,175,116,191, 90, 28,162,203,100, 31,206, 15,190,111,201, 74, 36, 88,172, 9, 96,245, 41,139,114, 7,244,204, +212,238,250,153,213, 33,252,148,255, 0,134,127,173, 65,194,131,148,254,114,157,255, 0,179, 73,242, 45,246, 28,117,196,248, 23, + 34, 92,201,167,251, 51,134,137, 95,212,190,165, 32,251, 42,255, 0, 12,191, 90,144, 1,104,179,254,114,254,163,103,147,243, 88, +254, 54,129, 66, 83,198, 37,208,116,250,103, 29, 47,247, 47,169,127,114,175,240,203,245,165, 32, 2,252, 31,157, 15,127,188,245, + 70, 85,139, 28, 14,164,248,195,186,110, 7,179,248,237, 56,250,149,212,155,228,171,221, 47,214,162, 8, 41,131, 26,252,222,251, +205,120,152,220,105,150,107, 10, 18,189,137, 68, 91,136,222,149,241,152,116,227,234, 79, 82, 35,228,171,221, 47,214,152,150, 70, +191,253,212,123,197,230,150,205,162,198, 7, 36, 37, 63,195, 79,220, 43,169,255, 0, 23,170,255, 0,238,127, 83,118,217, 87,248, +101,250,211,130,137,159,204,215,187,194,114, 97,255, 0, 42,178,212,176,167,255, 0,195, 79,234, 20, 5, 63,197,123,244,191,221, + 14,165,253,202,191,195, 47,214,153,215, 20, 91,109,151, 43, 85,201, 81,156, 28,152, 8,226,165,120, 87, 92, 6, 14, 64,144,116, +211,138,101,198, 44,182, 91,141,165,230,228, 41, 36,133, 21, 41, 39,195,195, 81,200,182, 70, 90, 41, 16, 20,137,183,140, 83, 31, +138,208,143,199,152,167,214, 65,213, 57,215,108,148, 92, 5, 38,209,220, 59, 68,136,107,113, 33, 42, 82, 85,176,167,191, 85,191, +101, 53, 35,102,138, 67,247,184,215, 71, 17, 33,134,192, 80, 1, 52,165, 60,117, 90,112,144,209,245, 67,223,216,138,218,152,143, + 62,224,219, 83,144, 60,170, 37, 70,190,250,232, 96,152,196,234,165, 25, 45,238,204,199,161, 60,155,122,144, 10,212,118, 31, 94, +152, 89, 57, 35, 70, 65, 26,181, 94,113,171, 13,254, 43, 87, 22,211,229,186, 7,222, 3,199, 84,114,161,108,195,133, 47, 48, 50, +122,159,220, 76, 65,151,126, 94, 43,104,242, 72, 27,237, 79,103,134,170, 87,137,113,213, 60, 44, 26,163, 61,164, 54,158,226, 38, + 86, 49, 96, 91, 45,221, 82,133,204, 5,243, 70,212, 26, 32,169, 37, 93, 5,107,246, 87,232,215, 73,208,253, 59,147,212,111, 16, +143, 47,183,225,170,183,137, 89,178, 65,149, 93,234,167,213,206, 45,233,176,175, 18,237, 76, 86, 36,229,206, 71,109,187,210, 37, +150,164,195,113,185, 76, 20, 56, 26, 80, 1, 73, 88, 77, 22, 8, 88,234, 5, 43, 93,125, 43,233, 79, 66, 99, 98,192, 78,216,188, +199,107, 16,235,168,175,167,136,128,227, 95,237, 76, 61,192,192,238,189,224,244,225, 97,245, 65,139, 69, 9,186, 34, 11, 3, 32, +142,194, 64, 15,178,218, 72, 23, 4,129,212,211,136,112, 15,239,120, 29,115, 30,181,244,157, 80, 31,184,198,139, 8,252,195,223, +241,126, 71,196, 44,158,167,141,178, 78, 57,253,202,152, 98,244,233, 64,149, 41, 91, 10,129,246,107,202,231, 88,224, 22, 20,160, + 93, 65,133,153,202, 50, 95,183,182,237, 26,166,194,186,171,109, 1,144,229, 21, 51, 20, 50,175, 48,229, 33,213, 18, 27, 82,149, + 95,170,163, 64, 34, 32,104,134, 3, 47,198, 59,133,252,174, 90, 96,242,252, 46, 69, 53, 39,216, 53, 58,107,125, 83,136,173, 89, + 44,248,119, 75,170, 11,148,162,147,201, 62,255, 0,134,186, 59, 16,144, 65,166, 68,180, 25,232,144, 54,113, 59,125,186,177, 93, +135,129, 83,109, 17,123, 50, 98,132,188, 37, 15,189,186, 15,213, 67,160,203, 66,136, 2, 45, 15, 23,183,189, 29,187,139,192, 6, +235, 67, 94,155, 43, 89,249, 57, 36, 6, 9,135, 20,236,226, 49, 56, 54,120,237,168, 38,135,142,244, 30,202,107,155, 55, 91,188, +162, 27, 2,211, 14,193,143, 59,117, 12,161, 73,242, 92, 78,223, 81,209,229,125,140,152,200, 40,247,155,125,138,202,235, 45,249, +137, 9, 43, 74, 78,254,221, 79, 30,203, 36, 89,148, 4,130,135,151,219,140,251,131, 12, 91, 22, 86,149, 39,144, 74, 42,106, 2, +106,122,123,134,180,105, 5,142,136,155, 31, 64,174, 43,119,110,123, 91,233,115,181,223,248,143,222,245,252,254,113,115,138, 29, +182,227,201, 52, 83, 1,207,197,252, 93,246, 82,135, 20,146,126,232,168, 21, 58,245,239, 77,122, 24,221, 92,108,188, 49, 35,135, + 96, 61,189,235,107,167, 98, 57,220, 70,157,255, 0,151,217,146,151,110,125, 83,118,174,126, 97,112,118,108, 24,198,216,228, 70, +163,183, 20,181,193,183,228,189, 47,138,252,180,168,124, 41, 8, 41, 59,248, 39,125,206,187,250,125, 27,141, 92, 12, 0,226,182, + 37,141, 2, 11, 15,179,161,126,162,241,220, 67,183,253,250,123, 25,192,210, 21,140,195,106, 42,252,212,171,146, 93, 91,241, 83, + 39,154, 77, 78,220, 86,145,244,131,175, 33,245, 87, 77,142, 54, 84,171,135, 0,184,235,254, 18,204,202,171,203,115,175, 42,231, + 51,202, 87, 14, 2,148, 39,216, 53,207, 67, 20,201, 81,156,216,168,253,180,239,195,136,133, 54, 27, 14,111,241, 38,149,241,212, +165,209,247,113, 80,149,200,237,207,186,147, 30,177,169, 60,170,158, 36,142,190,205, 97,221,211, 4,108, 83,132,220, 37,188, 91, +185, 87, 57, 13,134,223, 81, 43, 4,132,141,253,180,213,200,244,248, 4, 51,105,117,249,151,228,121, 4,251,122,162,199, 39,205, + 63,119,232, 26, 37, 56,240,137, 69,137, 41, 78,219, 43, 44,182, 77, 42,117, 10, 5, 70,167,175, 74,107, 65,171,102, 9,245, 71, +108, 41,155,112,186,169,101, 68, 40, 37, 32,138,251, 58,234,181,145, 3,130,148,100, 66,100, 72,118, 60, 21, 58, 72, 43,108,215, +237, 59,232, 76,197, 56, 46, 87,236, 25,145,239,113,144,241, 32,254,201,175,211, 77, 25,152, 58, 69, 78,186, 22, 97, 69,114, 32, + 86,244,168,251, 53, 92,201,202,138, 82,184, 42,115,241,220, 42,119,240, 73, 41,235,245,105, 70,200,187, 20,220, 87,171,102, 61, + 42, 12, 52,207,101,234,132, 16,179, 67,245,232,224,192, 38,213, 79,188,223, 38, 92,224, 47,201, 89, 45, 37, 31, 22,245,241,174, +137,228,198, 90,166, 33,146, 80,118, 92,249,172,196, 14, 42,139, 52,219,217,169,154,162, 20,132, 83,115,184, 36,232,173,199,117, +194,124,133,129,184,175,142,179, 47,204,132, 75, 5, 40,214, 85,149,128,167, 31,199,112,185, 50,238, 52, 50,147,202,149,251, 53, +205,229,217,101,146,209, 91,129, 17, 10,118, 53,149, 88,167, 90,188,137, 41, 0,186,163,185,246, 87, 66,149, 22,146, 19,121,193, +122,191,100,152,181,168,152,208,194, 3,188,104, 72,166,137, 69, 87, 13, 74, 97, 96, 85,238, 73,144,219, 38,177,243, 45,148,135, +153, 53,228, 58,143, 29,106,209, 27, 18, 51, 12,191,112,142,227, 72, 98, 74,154, 82,194,162, 42,169, 59,214,154,182,104,112,132, +108, 80,243,123,140,107,197,195,203,117,127, 0, 33,198,253,149, 78,231, 87,107,129, 80, 50, 66,109,249, 75,237,203, 84,100, 40, +121,109,130,145,239,213,216, 64, 5, 23,117,162, 76, 87,110,215, 36,204, 89, 32, 87,169,212, 37, 32,250, 41, 4,126,126, 90,205, +162,208,109,104, 88, 91,132, 83,111,126,161, 52,130, 25, 62,236,151,236,129,168,128, 9,142,212, 10,117,169, 30, 26,106,196, 73, +213, 49, 8,135,110, 68,203,101,109, 19, 77, 86,170, 44,215,216, 69,117, 87, 49,134,161, 40,185, 41,205,121, 4,105,176, 19,108, + 82,147,197, 20,169,215, 59,107,196,184, 87, 97, 20,215,140, 99,182,137,150,161, 45,245, 36,212,128, 5, 71,211,172,108,187,236, +228,136, 32, 29, 40,119,139, 6,177,193, 75,115,150,132,173, 4, 2, 7,215,174,135,211,134,118, 30,197, 27, 42,113,162,172,127, +150, 91,101, 91,228, 78,109, 60, 93, 65, 41,108, 15,236,141,117,163, 82,197, 80, 60, 82,250,113,231,175,243,154, 97,164,149,202, + 52,219,245,232, 54,216, 32, 20,226, 93, 50, 89,187, 63,146, 77,112,161,136,202, 10,103,225,115,111,118,169, 30,161, 8,243, 83, +242, 73, 69,222,244,237, 53,199,155,187, 45,146,150,197, 66,199,215,190,171,203,173,196,104, 20,191,110, 83,172, 95, 79, 78,193, +177, 55, 54,219, 28,173,213,144,106, 7,141, 41,170, 51,245, 29,100,176, 44, 81,134, 25, 33,214,169,157,180,153, 30,224,204, 89, +109, 20, 56,120,245, 26, 23,250,177,150,160,168, 74,150, 91, 14, 57, 39,252,224,155, 71, 31,136,199, 81,229,238, 4,104,191,191, +150,221,200, 91, 2,173, 49,235,234,229,201,118, 60,197,126, 35,128,138,251, 53,208,199, 31,202,224,128,181,227,232, 69,189, 51, +191, 28,252, 68,237, 95, 15,102,172, 11,192,228,145,173,208,249, 54,203,125,233,246,193,112,209, 53, 61,116,199, 33,249, 38, 53, +133, 47, 16,183,192,131, 49,196, 56, 74,152, 74,186, 31,112,208,238,176,144,163, 48, 2, 45, 47, 43,143,108,154, 17, 25, 4,180, + 56,210,154,206,150, 33,145,213, 13,215,155,143,118, 36,219,228, 41,213, 54,161,176, 9, 20,246, 13, 74,190,156, 9, 81,220, 80, +136,253,196,149,114,188,176,249, 4, 36, 29,201,246,146, 52,106, 48, 3,145,216,141, 41, 48, 69,115,220,178, 93,206,225, 21,248, +196,213,180,131, 81,208,104,223,181,140, 67, 20,163, 23, 91,172,153,101,214,231,111, 49, 1, 82,165, 45, 65, 9,226,119, 36,154, + 0, 62,179,167,174,136,141, 0,226, 81,163, 73, 60, 23,231,112, 61, 64,206,244,253,104,184,224, 48,102,214,226,225, 45, 92, 86, +133, 17, 73, 1,176,149,160,116, 53,109, 69,104,247,235,232, 79, 76,122,112, 97,227, 68,144,211, 32, 19,226, 87,160,116,140,120, +208, 35, 22,213,181,241, 92,147,158,247, 50,243,155,228, 9,185, 77, 89,112,173, 99, 99,224,146,173,133, 62,205,117,240,248, 70, +139,166,141, 97,254,223,110,245,246,215,177,214, 91, 38, 13,232,127, 15,199,178, 8,192,219, 31,199,162,193,145, 24,214,170,110, + 92, 96,135,146, 64,161, 31,134,226,135,215,174,127,124,103,108,163, 45, 99, 45, 8, 92, 85,213,249,247,202, 35,128, 92, 61,158, +118,198,255, 0, 96,201,238, 88,123,206, 85, 86,217, 50, 34, 7,147, 94, 46,134, 93, 40, 14, 38,190, 10, 0, 17,244,235,231,110, +165, 87,236,178,167, 68,181, 48,145,137,246, 22, 92,229,173, 9, 17,222,201,103,255, 0, 11,239,204,129, 56, 56, 67,142, 18,145, +244,248,106,149,217,176, 1,149, 9,151, 41,235, 30,193,238,216,253,151,205, 59,174, 66,104,173, 97,254,244, 58,130,171,243,139, + 29,210,198,167, 30, 88, 43,115,153, 80,167,211,173,124, 92,136,200, 39, 8,173,169,102,241, 13,137,136, 20,121,164,209, 64,245, +233, 77, 89,180, 14, 73,192,117,230,237,105,146,203, 37,231, 15, 23,156, 39,128,253, 90,175, 18,164, 75, 39, 92, 50,194,205,234, + 36,117,205,162, 20,216, 60,253,251, 15,233,214, 94,126, 68,161,160, 77,189, 29,187,200,198,162,194, 77,153, 14, 14, 92,128,251, +117,144, 77,135, 86, 75,112, 69,108,182,124, 99, 37,105,187, 19,235, 1,240,145,199,126,186,170,103, 96, 46,201,206,214, 82,178, + 44, 37,171, 85,153,225, 13,124,110, 44,212,182,175,235,120,131,246,107, 67, 10,215,151,197,193, 68, 7, 72,153, 6, 5,125,202, + 44,172,200,133, 32,252,210, 84, 15, 94,132,107, 71, 30,248, 70,210,227, 68, 79, 44,174,183,244,159,233,106,215,133,224, 49, 59, +201,220, 23, 4,139,241,136,183,162, 71,119,100, 54, 93, 71,150, 43, 94,191, 9,167,215,175, 97,244,175,166,171,200,128,186,113, +227,160, 11, 95, 18, 62, 84,163, 17,243, 30, 61,192,255, 0, 98,225, 47, 92, 30,166,111,157,199,238,220,235,116,119,202,172, 17, + 36, 62,142, 85,248, 85,229,184, 91,175, 74, 1, 65,244,211,111, 13,123, 52, 68, 97,240, 69,118, 17,163,225,126, 67,128, 84,254, + 17,159,121,174,190,251,235, 45, 58,213, 16,170, 42,189, 18, 9, 72,223,218,154,215, 70,226, 10, 1,142,210, 35,246,212,174,150, +193, 51, 43,111,112,187, 62,197,245,136,143, 63,155,227,228, 34,124,180, 81, 72, 93,173,105, 8,109,111,120,242,109,194, 17, 90, +253,210,159,102,222, 79,245, 11,165, 9, 8,100, 68,124, 92, 37,248,131,248,172, 78,185,129,177,167, 30, 10,172,207,225,220,175, +183, 9, 15, 90,118, 91,156,137, 30,234,107,206,105,178, 49, 33,215, 47, 42, 73, 74,120, 54, 25,146,218,110,206,165,205,252,197, + 18,175,175,166,175, 89,155, 6,209, 87, 52, 50,126,130,242,213, 29,118,247, 1, 11, 2,128, 31,118,185,251,154,122,162, 68, 48, +100, 61,153, 14, 89,238,201,109,198,200,100,147, 85, 83, 85,200, 50, 10, 39, 69,178, 78,109,230, 78, 83,188, 79,150,210,183,250, + 41,190,137, 86, 43,197,209, 1, 71,133,225,236,128,137,112, 88,168, 74, 40, 82, 7, 83, 65,161,154,152,241, 82, 18,101, 5, 83, +151,107,150,135, 84,146,135,214, 77, 82, 71,191, 71, 96,201, 5, 38,217, 58,235,112,157, 33,133, 36,166, 47,137,223,233,208,167, + 16,144, 44, 84, 40,215, 85, 90,231, 11,115, 10, 37,178, 73, 63,175, 82, 46, 98,162,189,221,111, 50,238,114, 10, 99,172,151, 0, + 21, 27,244,166,131,160, 77,181,212,107,106, 46, 18,225, 62,203,202, 33,196,215,237,165,116,164, 34, 53, 78, 34, 66,217,108,255, + 0, 52, 65, 74, 35, 73, 39,228,158, 28, 69,126,154,234,212, 77,102, 61,232,127, 19,169, 54, 72, 51,224, 74,126, 60,181,131, 13, +100,238,125,135, 66,187, 36, 66, 58, 35,194, 47,197, 54, 96,216, 70, 53, 61,228,188,162, 8,110,148, 39,174,177, 50, 51,172, 33, +149,145, 24,133, 97, 93, 21,139,124,131,118,212, 41, 37,198, 71, 47, 15, 13,181,129,253, 89, 73,203,162, 78,216, 50,253,126,201, +141, 77,196, 92,101, 10, 1,215, 42, 7,188,245,211,215,101,155,147, 60, 87,235,184,166, 45,111,177, 69,106, 50,199,205,132,239, + 79,163, 90, 53,217, 55,225,162, 20,163, 21, 94, 93,113,149,200, 14, 74, 46, 16, 84,178,145, 83,224, 85,254,141,107, 70,224,220, + 16, 77,104, 77,199,183,239, 71,182,188,146,239,196,232, 36,126,173, 30, 25, 64,114, 72, 65,106,176,118,252, 89,224, 32, 56,225, + 46, 47,145,175,186,154,144,191,114,159,148, 23,185,120,108,187,140,158, 17, 84, 84,180,236, 62,202,106, 99, 41,147, 26,194,137, + 35,183,115,173,146, 67,174,238,175, 16, 61,221,116,195, 51,114, 66,176,141,228,150, 84, 64,181,199,113, 35,138,148, 42,162, 61, +180,211,194, 74, 81, 1, 36,197,252, 71,223,113,127, 18,146,162, 19, 93,246, 26, 36,138,114,193, 18,182,182,185,210,155,105,161, +248,136,248,142,171,206, 91, 80,230, 2, 56,204, 73,161, 78, 72, 77,126,100,164,164, 31,163, 76,100, 8,213, 15,130, 68,189,228, +121, 45,166,115,209,209,200,171,145, 41, 3,223,162, 67, 18, 19,226,156, 88, 93, 88,221,173,205, 47,210, 88,141,111,156, 74, 82, +163,241, 18,124, 56,234,134, 94, 4, 57, 39,223, 36,237,150, 24,179,173,165, 51,213,201,161, 78, 39, 84,168,145,171, 72,232,139, + 11,143,106, 93,180,227, 88,130,217,249,114,177,230, 45,102,181,246, 87,125, 28,100, 90,144,136, 42,124, 27, 38, 39,100,188, 42, +229, 23,136,242, 5,118,166,231,254,131, 80,148,236,176, 50, 36, 76, 98,155,113,158,238,227,205, 45,242,219, 40,162,129,228, 64, + 21,165, 53,147,118, 5,132,241, 68, 57,128, 41,209,187,149,106,188,175,228,227, 37, 37,151, 5, 72,218,128,211, 76,122,108,130, + 29,153,125,138, 29,179,190,141,217, 94,118,202,178, 10, 26, 81, 72, 6,158, 27,141, 6,206,139,205, 22, 57,186, 45, 55, 62,236, +217,242, 87, 28,117, 64, 38, 99, 35,146, 72,166,244,223, 71,171,167, 24,232,165,251,136,203,138, 70,255, 0,197,113,254, 98, 23, +110, 31,143,187, 31, 87, 42,107, 95,246, 31, 11, 42,126,110,170,157,195, 45,183,251,197,245, 82, 56, 41, 9, 64, 37, 73, 80,167, + 94,154,236,137,139, 42,242,118, 94,231, 71,188,140,141,203,122, 42, 26, 83,156, 77, 43,208,237,170, 80, 96, 84,157, 30,110,205, + 18,208,223,146,242,255, 0, 16,128,165,123,129,220,234,173,132,182,136,102,197, 55, 26,183, 48,169,110,185,214, 42, 71, 51,250, +244, 56,200,158, 41,188,192, 83, 54, 58,140, 78, 83, 42,144,250, 80,167, 57, 17,241,117,235, 77, 83,190,203, 4,152, 33, 27, 89, +109,200,236,248,132,135,124,222, 8,242, 91, 20,247,109,171, 20,155, 25, 74, 54, 58, 7, 38,211,136,177, 5, 50, 26, 9, 74,143, +136,167,142,173,195,120, 69,222, 17,139, 77,163, 24,147, 5, 75,124,167,131,137, 5, 4,253, 99, 84,238,149,142,152,204, 5, 94, +101, 55, 72,152, 76, 89,247, 88,143,124, 17, 18, 86, 55, 27, 40,252, 40,235,253,181, 39, 94,137,232, 62,137, 44,219,133,147, 31, + 12, 8, 63,111,114,217,232,248,230,251, 1, 28,138,230, 46,238,103,215, 28,226,255, 0, 42,116,231, 73,184,203,117,201,139, 93, +119, 43,113,126,105,175,188,147,175,161,108, 3,107, 14, 11,190,193,172,194, 78, 70,173,248,160,157,171,110,227,124,204,173,214, + 53, 0,228,233, 51,163,180,210, 23,176, 52,112, 26,106,145, 96, 8, 91,146,145,218, 36, 2,251,139,234, 75,184,145,108, 29,134, + 17,236, 77,169, 13,170, 15, 56,104, 52,252, 54,213, 24, 10, 26,108, 56,131, 79,167, 92,182, 49, 18,180,120,174,111, 19, 24,131, + 41,158, 39, 69,205,125,193,206,109,183,159,150,200,157,248,103, 77,139, 10, 82,171,247,137,122, 3, 78, 18,122, 86,164,235,199, + 62,160, 97, 24,245,139,219,153, 7,252, 81, 18,252, 74,224,122,188,133,119,200,119,254, 73, 70,103,114,237, 81, 97, 53, 10, 66, +128,124,113, 88,233, 93,235,174, 42,204, 9, 72,184, 88,214,222,202, 96,239, 4, 73, 22, 6,216, 82,135, 47,186, 43,237,173,127, + 86,179,207, 79, 32,170,241,202, 33, 38,229,249, 18,100,203,109,199,192, 44, 57, 90, 86,157, 60, 53,115, 31, 28,196,171,181, 91, +185, 66,125,153, 81,153, 76,168, 67,131, 70,133, 84,233,236, 58,215, 7, 77, 85,168, 69,121,201, 19,122,184,197,142,251, 10,168, +107,138,182,247,111,161, 85,197, 41, 5,230, 63,113,174,150,166, 86,193,170, 29, 74, 8,219,232,209,127, 97, 27, 14,171, 54,217, +145, 38, 85,163,253,208,203,110,249, 19,230, 48, 90,155,105,116, 36, 86,149, 26,189, 62,157, 92, 98,202, 95, 19, 43, 47,182,249, +157,234, 77,238, 45,193,231, 20,217, 64, 21,174,221, 69, 70,177,115, 49, 33, 88, 68,140,137, 10,209,200,243,213, 75,142, 31,126, + 71,198,148,208,208,245, 61, 53,155,229,128,116, 10,221, 80, 40,143,100,161,220, 50,140,174, 5,145,165,149, 69,146,242, 75,131, +216,223, 46, 74,251, 0,214,255, 0, 78,233,163, 34,248, 65,184,149,167,131, 71,153,100, 65,225,252, 23, 89,250,154,238, 28,206, +223,246,112,197,178,130, 26,135,111,156, 83, 77,210,218,225, 65,118,107, 74, 52,241, 11,101, 39,234,215,209,254,159,162, 53,200, + 68, 15,146, 37,189,139,166,199,196,142,233, 72,142, 36,127, 5,241,235, 34,126, 67,151, 87, 36, 54, 60,218,211,204,113,123,239, + 78, 68,239,212,212,131,173,250,194,216,180,143, 4,173,106, 98,105, 67,241,218, 88, 68, 67, 90,240, 20, 87, 37,171,245,158,154, +156,193,224, 57,168, 9, 65,220,190,139,168,125, 6,230, 86,235, 30, 70,254, 39,149, 57,195, 14,200, 98,200,199,111, 74,221, 69, + 16,230,163,202, 83,201,241,228,210,130, 93, 20,222,169,214, 87, 82,199,142, 68, 77,115, 31, 12,129, 7,193, 79, 35, 22, 57, 24, +210,143, 19,196,119, 16,255, 0,199, 84, 99, 63,237,212,158,218,231,215, 60, 46,246,186, 76,129, 50, 77,184,186,118, 11, 68,103, + 75, 97,196,143, 20,184,126, 32,125,131,223,175,156,115,241,101,139,108,234,151, 24, 72,131,236, 44,188,234, 81,209, 70,106,200, +212, 16,236,184,235,243, 61,159, 71, 77,103,249,133, 84,176, 50, 7, 50,230,218,238,173,166, 58,127, 18,160, 46,158,253,180, 45, +165, 52, 98,141,101, 86,150, 3,108,150,219,171,188, 2,148, 41,253,154,233,156,197, 40,193,210,221,134, 20, 53, 23, 27,117,158, + 78, 45,100, 29,181, 45,242, 70, 21,133, 97, 99,139,181, 89,156,101,176,128,148,157,148, 8,246,234,189,162, 71,130, 20,244, 43, +101,234,213,103,189,220,150,164,165, 35,129, 11, 73, 3,111,110,161, 8,205, 45,234, 93,158, 37,141,215,222,132, 2, 65, 82, 64, + 39,253,157, 33, 25,130,160, 75,160,242,112,123, 75, 51,229,202, 85, 57, 54,217, 82, 1, 63,217,213,208,100, 98,202, 60, 18, 75, + 23, 24, 54,247, 92,147, 78, 74, 4,133,125, 91,106, 21,214,100,164, 10,136,230, 73, 33, 82,139,176,209,248, 10, 34,167,233,235, +169,203, 29,194,152,154, 34,214, 81, 42,107,205,169,224, 4,118,134,223,101, 53, 24,210,193, 62,224,129,231, 25, 53,214, 12,114, +236,122,148, 57,208,167, 69,134, 48,151, 20, 57, 30,197,187,183,249,173,234,219,102,145, 50, 74,148,144, 71,194, 21,238, 21,241, +209,165,211,226, 80,229, 34,203,123,157,192,187,186,215,206,135, 15,226, 2, 40, 61,231, 85,165,211,226, 16, 68,137, 41,146,203, +159, 94,103,194,141, 31,145, 9, 70,228, 87,173, 53,156, 48,162, 29, 89, 94,243, 14,225,223, 96, 73,142,168,156,138, 18, 2, 72, +250,181,163, 28, 72,237, 77,170,147, 55, 55,113,235, 83, 34,180,127,101, 47,234, 21,208,255, 0,104,200,132,150, 67, 14, 99, 62, +230,201, 90, 87, 86,134,218, 25,160, 59, 38,114,182,222,114,185, 40,136,210, 34, 26,185, 74, 80,123,244, 74,232, 9,196,138,223, +133,101,146,154,121, 78,201, 63,137, 95, 31,211,169, 75, 28, 20,198,101, 77,200,123,137,252, 71,150, 40, 64, 0,172,251,201,255, + 0, 78,165, 86, 18,136,185, 67,189,102,205, 94,224, 55,111, 10, 1,225,177,220,123, 55,212,109,164,192,128,141, 9,115, 42, 21, +154,200,155,156,159,144, 96,132,186, 5, 84,107,239,174,165,176,128,161, 57,186,214,167,133,130,239,242,140,175,148,147,240,154, +125, 59,233,252,131, 48,134, 78,137,170, 45,213,149,216, 87, 32, 40,121,200, 4, 19,227, 83,182,129, 44,111,137, 73,244, 73,151, + 22,147, 49,105,144,229, 57,169, 69, 74, 62,192, 14,175, 66,161, 16,134, 9, 68,160,200,159, 14, 75, 75, 96,128,193, 20, 65, 30, + 53,213,107, 32, 25, 17, 16,200,175,151, 9, 44, 34, 2, 94,226,242,104, 85,191,187, 84,170,199, 27,156,164,200, 1, 69,237,137, +237,252,163,138, 83, 91,114, 80, 39,233,213,227, 76, 64, 72, 22, 70,204,153,159, 46,180,114, 42, 36,124, 71,115,211, 77, 93, 81, + 72,201,208, 7, 47,146,236,105,125, 72, 10,242,192, 80, 7,127, 1, 77, 16, 85, 25, 21, 18, 29,109,192,243,233, 48,155, 84,169, + 42, 32, 87,138, 65,235,190,165, 44,112,160,120,173,121, 19,183,197, 73,114,247, 20, 40,178,231,197, 81, 93,246,208,182, 68,150, + 82, 5, 64,176,222, 46,239,203,242,220, 82,146,225, 6,160,251,245, 35, 76, 66,111, 49,145, 79, 53, 5,144,175,218, 4,212,255, + 0,104,159,245,105,182, 39,222, 17,155,203,204,217,239, 63, 49,110,108, 33,135, 0,173, 7,184,234,196, 0, 33, 94, 41,110,248, +228,212, 93, 90,184, 50,215,196,165,164,158,187,143, 29, 6, 1, 2,113, 67, 59,133,112,188, 37,223,152,101, 10,226,180,132,138, + 87,196, 29,104,215, 8, 51, 42,147,166, 74, 53,147, 36,188,196,182, 58,209, 74,131,139, 79,136,235,182,152,209, 4, 47, 42, 65, +122,199,230,223, 27, 74, 82,178, 71, 35, 83,244,242, 39, 64,149, 80, 5,209,127,110,233,235, 29,176,221, 47, 88, 44,249, 79,147, +243, 21,224,217, 61,122,127,175, 83,223, 0, 81, 99, 67, 4, 27, 36,193,242, 24, 24,163, 46,149, 31, 55,128, 63, 96,209,133,177, + 7, 85, 41,210,202, 0,187,221,218,197, 88, 2,161,109, 10, 84,215,192,232,103,100,164, 20, 14, 57, 33, 80,157,227,238, 29,206, +109,198,101,144,186, 83, 13,181,182,251,232,168, 63,140,134,248,211,219, 80, 14,250,250, 43,211, 61, 42, 24, 24,145,139,107, 45, + 79,228,189, 3,211,125, 56,213, 3, 46, 10,160,189, 94,138,100, 42, 83, 67,146,197,104, 43, 90, 87,111,232,214,185,158,238, 11, +179,142, 56,129, 46,117, 94, 48, 92,190,117,143, 50,183, 95, 98, 43,141,194, 44,150,100,164,170,160, 14, 46, 36,128,117, 33, 94, +224,167, 99, 70, 44,190,185,247,143,186,206,229, 94,155, 44,183,214,138, 83,115,186,196,142,148, 52, 56,148,149,186,218, 92,113, + 2,164, 0, 2, 91, 36,109,225,239,215, 35,143, 29,183, 55, 97, 65, 21, 60, 10,230, 92,203,185,109,255, 0,151,177,103,203,160, +169,251, 84, 96,105,237, 97,199, 34, 80,251,199,151,174, 71,215,152, 66,121,242,179,182, 48, 62,232, 68, 47, 35,245, 21, 77,147, + 63,103,224,171,110,225,247, 2,106,178,136,172, 68, 89, 41, 45,212,129, 95, 0,125,154,229, 40,193, 27, 87, 49,100, 10,141, 27, +185, 23, 95,152, 17,199, 34,158, 72, 73, 27,239, 78,132,123,255, 0, 94,178,115, 48, 68, 71,138,141, 84,238, 41,203,187,185,162, +160, 99, 22,153,172, 43,227, 90, 69, 74, 79, 90,157,103,226, 98,157,228, 17,193, 88,140, 76, 10,100,237,238,110, 50, 60,124,181, + 40,236, 17, 90,125, 84,213,203,113,196, 85,216, 88,232,157,166,226,152,240,158,125,213, 85,164, 3, 64,125,192,141, 81,149, 91, + 74, 46,231, 80, 33, 72,181,100,126,107,203,160,112,166,155,127,118,154,153, 50,137, 12,135,176, 2,160,227,118,187, 28, 37, 72, +226,148,149,149,158,103,110,160,233, 89, 41, 73, 19, 68,196,136,182,248,237,173,200,128, 33,208,147, 74,109,176, 26,171,108, 76, +131, 20, 35, 23, 42, 13,206,229, 42, 85,185, 65,165,124, 64,245,246,208,234,165, 20,185,215,146,211,172, 6,101,114,250, 81,189, + 46,215,148,166,123,231,247, 45,113, 66,186,209, 69, 99,250, 53,232, 62,148,197,123,141,135,249, 98, 87, 77,233,220, 93,215, 19, +220, 85,171,235, 67, 63,254,103,130, 73,182, 64,124,121,191,202,111,142, 41, 9,241, 42,180, 62,209, 39,174,233, 74,149, 77,181, +236, 93, 8, 29,230, 93,160,254, 11,160,186,177, 86,157,225,124,180,149,144, 60,103,161, 9, 81, 72, 82,131,123, 83,195,199,244, +235,118, 33,138, 86,252,164,253,181, 88,212,135, 26,146,209,228, 67, 11,170,210, 19,215,144, 87, 83,183,133,125,186, 59, 42, 17, +146,181,189, 63,220, 87,108,202, 25,146, 8, 87, 53,166,137,222,188, 8,223, 89, 57,238, 3,174,143,165, 84, 39,240,157, 2,232, +223, 90,182,217,183, 56, 24, 71,114,237,200,226,253,206,220,229,182,230,162,162, 86,228,219, 83,137, 73,116,142,148, 83, 14,180, + 1,246,131,175, 42,245,150, 0, 18,133,224,124,193,143,136,255, 0,176,175, 60,245, 22, 31,147,149, 38,249, 73,209, 87, 24, 53, +194,229, 54, 50,219,144, 42,162, 10,105,245,107,207,109,172, 21,205,217, 18,234,127,109,240,245,220, 50, 73,111, 92,118,101,181, + 2,154,143,234,171, 77,101, 96, 69, 68, 72,132,205,121, 84, 22, 38, 41,183, 72,170, 91,227, 83, 79,110,169,206,189,195, 68,226, +214, 74,217, 5,194,219,141, 91, 17,113, 72, 21, 43, 53, 34,157, 73,213,184, 99,104,167,231, 45, 54,123,201,188, 66,118,226, 86, + 2, 82,158, 73, 26, 70,157,168, 68,186,142,238,122,136,138,110, 34, 79,241, 78,109, 95,171,142,138,106, 0, 38, 95,152,166,118, +182,179, 86,173,175, 16, 80,224,170,141, 70,192,104,102,141, 29, 70, 65,107,206, 51,215, 90,204, 36,178,211,156, 98, 20,112, 2, +187, 29, 26,186,244, 67,212,132,187,139,190,139,156,137,173, 47,226, 69, 73, 31, 89,210, 20,178,125,204,181,179,123, 97, 19,151, +109,216, 33, 34,181,250, 79,183, 78, 43,116,241,154, 59,108,136,213,210, 55,150,193, 27,147, 82, 15,179, 77,229, 34, 41,173, 88, +161, 92, 27,110,215, 34,133,105, 93, 20, 79,176,106,141,207, 19,162, 98, 87,230, 79, 14,201,110,179, 61, 29,176,144,150,182, 52, +167,179, 70,166, 82,109, 84, 76,144, 12,101, 16, 39, 64,109,102,133, 33, 92, 71,208, 14,136, 65,100,225,145,136, 50, 89,102,235, +229,197,161,105, 4, 3, 79,167, 84, 4, 52,213, 54,229, 38,229, 33,137, 19,138,151,247, 19,185, 31,160,232,241,212, 5, 33, 45, + 16, 27,133,222, 50,239,255, 0, 38,133,254, 3,136, 0, 13,182, 53,161,213,232,129,197, 33, 45,193, 28,181, 99,238, 70,177,249, +172, 85, 96,172,214,155,237,170,214,134, 46,159,114,243, 55,229,224, 75, 67,242,104, 16,148, 21, 16,122,117, 27,104, 85, 3, 36, +238,134, 61,120, 66,101,186, 99,236,133, 18, 80, 71,187, 71,217,180, 40, 18,225, 70,122, 66, 17,107,149, 33,229,254, 49,220,114, + 62,193, 81,162, 70,212, 33,161, 64,236, 23, 85,191,122, 4,172,148,167,166,254,193,162, 24, 3,197, 20,148,241, 22, 99,150,185, +107,149, 29,202, 60,226, 2, 82, 1,241,165,116, 57,199, 69, 21,183, 22,180, 61,119,187,162,100,195,248,203,169, 21,246,232, 50, +188, 13, 20,181, 68,231,217, 36,216, 97,203, 68,245,209,181,154,182, 61,213,168,213,115, 45,210,112,156,165,166,211, 34, 76, 7, + 86, 15,195,209,179,171, 17,159, 34,148, 84,236,114, 75,175, 51,202, 90,168,152,192, 40, 19,227,161,204, 4,139,168, 15, 93,205, +219, 40, 80,105, 85,105, 73,240, 62, 58, 97, 16, 2,112,152,172,210, 35,218,225,186, 38, 40, 21,171,238, 3,239,213, 91,164, 72, + 78, 23,229,178,251, 13,135,190, 85, 68, 41,215,148, 0, 30,202,157, 14,161, 41, 4,164,193, 72,201, 87,143,198, 81,130,104, 86, + 18, 10,171, 78,167,127,215,162, 87, 92,129,116,201, 50,227, 18, 53, 88, 49,200, 72, 82,194,232, 15,191, 68,243, 75,164,201,237, +119,219, 75,118, 1, 14, 64, 72, 80, 64, 9, 38,157, 71, 77, 68,213, 46, 40, 36,234,133, 95,216,181,219,162, 51,119,102,129, 75, + 27,145,239,209,163, 92,164,161, 61, 23,145, 1,175,242,242,174,127,246, 53, 75,188,189,251,143,215,162,121, 69,217, 15,147,175, + 87,185,237, 77, 96,240, 87,227, 35,136,160,240,213, 56,146, 22,225,144,100, 71, 33,141, 21, 24,181,190,234,208, 27, 0,151, 15, +190,135, 79,171, 40, 62,168, 5,220,137,246,163, 33, 0, 40, 50,119, 61,124,117, 33, 34,236,156, 72, 40,119,179, 6, 53,181, 15, + 54, 0, 42,167,196, 62,144, 52, 93, 89, 62,232,148, 45,219,211,113,135,146,159,223,109, 74,104,226,178, 98,131, 41,178,183, 48, + 9,100,224, 77, 33,196,128,167, 8,113, 68,211,222,106,117, 1, 94,136, 18,183, 85, 43, 50,157, 30, 77,166,223, 28,210,142,252, + 31, 80, 6,154,115, 89, 10, 98,110, 93, 85,253,212,200,173,216, 63,108,110,185,139,173,243,131,108,121,134,222,105, 37, 33,107, + 75,206,165,181,112,175,136, 10, 42,250,181,214,122, 43,165,254,239,168, 86, 8,120,135, 39,192, 2, 71,222,193, 93,195,172,206, +192, 59,215, 19, 74,203,100, 93,231, 63,115,152,170,200,148,227,146, 93,229,226,183, 22, 86,161,191,211,175,160,237,150,210,195, +130,245, 92, 10,255, 0,167,160,102, 31,197,208,105,242,219, 50, 72,108,130, 20,106,147,236,222,186,141,112,218,116, 86, 39,118, +248,187,241, 68, 59, 91,137,207,204,187,133, 26,201,109,108, 58,243,171,111,147, 70,181, 80, 42,162,130,105,236, 30,193,163, 89, + 49, 88, 37, 87,220,102, 25,125, 52,206,240,201, 56,127,165, 91, 29,189,228,184,227,214,118,203, 14,177, 33,101, 5,178, 91, 89, + 69, 84, 1, 73, 79, 32, 40,122, 82,131, 92, 97,183,118, 65, 35,154,208,199, 31, 1, 5,114,191,108,173, 87,174,228, 98,226, 12, +149, 41, 74,199,164,170, 26, 84,176, 66,148, 36,214, 97, 77,127,178, 87,250,117,141,245, 22,193, 92,105,159, 51, 22,241,227,255, + 0, 98,243, 46,191, 80,156,221, 52, 66,237, 60,111,243, 99, 15, 92,147,201, 37, 52,170,136,216, 16, 71,142,188,182, 57,211,102, + 0,191,130,230,141, 8,236,254,210,217, 32,182,242,163,179,201,226,180, 22,200, 21,161, 7,151, 93, 44,140, 28,203, 64, 62, 92, +136,240, 37, 76, 98,145,201, 5,238, 78, 61,141, 92,236,177,224,221,164,136,239,182, 2,138,125,148, 53,174,192,210,164, 83,233, +250,245,208,116, 47, 74,231,102,105,229,152,247,144,195,239,251,143,228,156, 97,153,241, 8, 4,110,242,118,215,183, 22,183,109, +143,190, 93,116,178,175, 45,224,146, 8, 90, 85,247, 86, 5, 72,168,251, 62,189,186,203,126,148,230,202, 64,198,200, 17,227,203, +248,247, 38,158, 41,138,222,215,169, 46,208,221,176,194,166, 46,106,143,114, 40, 42, 91, 15, 52,224, 80, 59,147, 66,144, 66,128, +241,166,177,242,254,153,245, 90, 38,194, 17,152,228, 65, 30,230, 40, 70,137,197, 6,196,251,147,108,139,113, 13, 49, 61,165,161, +105, 82,209,197,193, 66,133, 30, 33, 94,224, 79, 74,235,159,201,244,214,102, 49,254,165, 50,143,179,236,232, 83, 18, 8,221,171, + 37,125,134,167,203,229, 95,197,230,154, 26,142, 42,232, 69, 53,155, 44, 93,120, 32,139, 8, 8,180, 14,224,187, 43, 39,102,222, +237,124,183, 83, 66, 62,162,117, 8,226,130,234, 62,113, 82, 51, 28,177, 22, 40, 43, 76,115, 85,149, 5, 26,111,196, 42,157,124, + 62,173, 84,167, 9,230, 95,130,209,174,237, 21,129,233,207, 56,126,107, 46,203, 42,226,216, 82, 27, 10, 38,149, 41,221, 66,167, +220,160,117,222,122, 90,141,176,182, 93,171,186,244,137, 54, 72,158,196,203,222,172,230, 69,226, 20,216, 41,124, 58, 63,149,221, + 89, 10,175, 94, 86,151,154,165, 71,133, 87,175, 78,232, 92,214,175, 84,248,108, 15,205,112,181,189,245,201,150,135, 92,235, 82, +106,106, 55,234, 79,233,215, 64, 34, 10, 29,164,136,150,224,139, 64, 46, 75, 9,116,252, 45, 2, 27, 66,143, 80,147, 93,254,146, + 70,164, 98,234,157,101,164,202,210,236,176, 66,111, 16,162, 52, 79,158,217,111,205, 90,250,242, 94,224, 19,238, 26,200,234, 37, +184, 46,159,164,142, 47,205,118, 95,117,109, 12,221,189, 49,133, 60,134,215, 46,215, 58, 20,182, 92, 45,149, 60,148, 72,105,200, +174, 37, 42, 27, 37, 10, 81, 65, 85,122,144,157,121,231,170, 43, 54, 97,159,251,178, 7,241, 30,237, 87, 63,235, 26, 67, 70,206, +223,204, 42,119,183,144,173,232, 97,201, 18, 77, 36,160,145,196,251, 43,175, 46,148, 93,112, 18,144, 83,109,183,200, 48,157,150, +250, 22, 0,173, 54,250,105,160, 77,217, 85,153, 9, 63, 42,186, 95,103, 60,161, 8,242,113,210,174, 59,248, 40,106, 84,200, 13, + 10, 25,134,224,133,230,107,147, 39, 21, 76, 9, 70,146, 27, 36, 40, 30,181,173, 53,106, 86, 54,137,227, 20, 58,215,114,153, 14, +206,171, 92, 90,249,203,216,125, 0, 83, 72, 37,181,215,171,141,154, 75,211,163,188,163, 69,148,210,163,218,116,206,157,145,171, +110, 6,252, 75,227, 55, 82,162,165, 45, 39,226,246, 80, 83, 82, 36, 33,237, 41, 99, 63,179, 92,158,191, 25, 76, 87,203,169, 6, +158,208, 52,160, 66, 91, 74,139,142,195,202,108, 16,158,148,251, 71,202,119,225,229, 67,236,212,173,156, 93, 68,196,160,175, 68, +189, 54,137, 23, 67, 90, 80,145,237, 2,135, 79, 89,137, 81, 98, 17,238,208,102,139,122,210,242,159, 85, 95,111,150,223, 70,138, + 64,137, 76, 9, 40,149,183, 38,188, 63,112,115,201, 6,170, 89,223,127, 29, 81,148,225, 50,234,102, 37, 67,201, 45,217,125,232, +188,148,114, 12, 56,118,235,236, 7, 77, 43,225, 29, 19, 10,202,204, 83, 24,200,173,145, 93,140,225, 37, 73, 4,167,175,142,250, +107, 50, 34, 20,132, 17, 76, 73,153,113,238,174,196,184,168,135, 92, 5,202,159, 13,245, 31,134, 65, 75,104, 69,185,134,224,186, +243,194,166,156, 74,190,131, 77, 3,107, 37,181, 44,197,129, 25, 55, 69, 92,121,115, 2,165, 59,253,122, 60,166,120, 34, 8, 58, +109,178,229,207, 65,179,252,176, 77, 89, 89,160, 81,251,116, 43,102, 8,101, 17, 4,175,146, 79,155,114, 91,136, 46,113, 20,246, +251,119,219, 82,140,246,104,201, 16,143, 98,216,252, 89,209,163,115, 80, 83,193, 36,171,244,104, 22,100, 18, 83, 16, 0, 81,243, + 44, 72, 8,138, 83,107,224,215,197, 93,253,130,186, 53,115, 96,233,182,165,251, 28, 8,118, 88, 10,152,241, 10,121,102,155,245, +212,231, 97, 60, 20,163, 16, 19,222, 45,103,106,242,194,101,172,209,134,144, 9, 81, 62,234,234,173,150,201, 45, 22,203, 21,204, + 55,112,114, 99, 42, 30, 67, 42,242,219, 3,161, 61, 6,128,204, 18, 91,251,153,145, 41,232,105, 71, 46, 75,162,121,111,210,163, + 70,174,173, 18, 66,110, 50,154,131, 97,107,229,135,197,196, 21,159,125, 43,167,218, 93, 74, 43,198, 7, 14, 70, 73, 30, 91, 64, + 20,182, 18,119,222,155,244,210,156, 74,114, 2, 7,106,177, 94,224,101, 47,176, 62,234,106, 81, 83,225,255, 0,209,171, 85,152, +144,161, 40,149, 38,228, 47, 14,172,173, 68,134,144,119, 30,250,211,245,106, 22,136,144,193, 49, 5,107,181,217,114, 23, 37, 51, +118, 74, 73, 64, 81, 41, 30,255, 0, 13, 42,118, 71, 68,138, 89,206,238,153,164,108,171,131,168, 87,146,162, 43, 74,236, 58,106, +236, 99, 2, 10, 28,201, 10, 67, 87, 27,220,165,130,148, 41, 69, 0, 0, 7,182,154,203, 17, 27,212,181,101,178, 76,156,174,230, + 91, 77, 20,150,154, 21, 95, 95, 1,173, 41,152,136,160,135,116, 82,229, 58,235,123,176, 53, 9,178,106,143,128,253, 91,106, 56, +243,142,210,149,160,190,136,152,187,223, 63,240,241, 88,233, 73,249,222,105, 72, 59,215,143, 19, 95,211, 77, 19,204,135, 30,229, + 29,133,144,167, 50,198, 17,120, 44,169, 91, 26, 84,125, 85,214,116,104, 44, 10,186,108,209, 31,201,114,146,206, 0,166,210,170, +167,144, 41,247,111,169,198,151, 81, 18,117, 3, 14,157, 42,243,219,219,156,180,110,227,102,164, 15,175, 66,157,109, 96, 72, 88, +235,197,198, 29,198,243,133, 38, 84, 38,202,148,154, 3, 65, 93,193,247,106,208,136, 72, 73, 45, 51, 14,224,187,145, 92,160, 82, +218, 91,216, 31,111,253, 6,172, 0, 25, 41, 18,172,251, 62, 76,229,175, 24, 68, 71, 21,199,205,103,240,190,193,183,233,209,170, +168, 21, 74,195, 39, 67,174,249,179,211,110, 86,219, 58, 9, 46, 69,108,184,189,252, 77,122,233,237,172, 69, 26,178, 85, 43,234, +243, 37,189, 35,180, 83, 35,182, 20, 45,174,206,142, 38, 81, 43,226, 83,200,148,213,105, 52, 7,144,241, 26,244,223,166,213, 1, + 57,200,142, 32,177,211,248,191,220,183,250, 59,139, 1,239, 92,163, 26,238,165,184, 2,213,183, 77,245,233,209,134,233, 47, 69, + 57, 27, 32,235,241,249,203, 83,192, 21, 80,131,176,220,245,209,101, 6, 40,117, 93,186, 62, 10,229,244,153,107,150,223,114,109, +247,166, 88, 14,165,183, 26,121,206, 73, 37, 73, 8,115,226, 80, 41, 5, 67,168, 32,141, 83,206, 47, 2, 21,188, 82,250,242, 95, + 68,253, 89,101, 82,110,158,158,226,222,108,107, 66, 67,145, 20,196,148,238, 16,243, 43,110,138, 74,131,117, 41,226,174, 42, 73, + 29, 55,167, 74,107,146,194,164,249,172, 85,171,174, 16,129, 61,171,147,187,127,119,149,131,225,151,108,145,153,113,219, 19,223, +101,192,216, 62,105, 65, 67,124, 10,148,164,108, 79, 26, 3, 67,225, 95,118,181,186,223, 68,163,169,249,112,180, 22,137,125, 52, +126, 58,118,113, 61,133,113, 25, 85,139,184,242, 65,167,247,166,226,250,150,203,215, 86,214,166,213,243, 45, 7, 22,186,240, 73, +169, 69, 82, 41,191,128, 35,221,173, 92, 62,155,141,141, 16, 42,172, 15,102,191,128, 89,147, 2, 37, 14,202,251,151, 62,122,129, +129,121, 49,194,195,106, 75, 37, 42,117, 13,168,138, 40, 18, 14,219,244,223,221, 77,104,198,198,228, 2,137, 61,139,205,130,251, +103, 93,201,219,117,214, 67, 82, 82,251,128,184,219,224, 20,115,227,200,148, 5,148,240,175,176, 16, 61,213,211, 74,201, 18,225, + 60,102, 6,133, 87,125,233,236,205,165,155,130,110, 56,180,163,242,139, 10, 90, 25, 66,214,226, 77,106, 83,192, 44,169, 65, 52, +240, 81,168,213,170,178, 73, 12, 80,229, 0,171,100,203,187,226, 76, 61, 26,109, 23, 8, 20,165,198,214,223, 34, 90, 66,234,165, + 26, 42,155,110, 13, 5, 52, 97,105,228,134,204, 23,140,179, 44,183,220, 98,176,221,144, 5,176,210, 80,180, 58,129,202,187, 4, +144, 69,107, 78,170, 3,195,245, 30,171,228, 56,148, 59, 0, 60, 23,172, 27,189, 89,142, 47, 36, 38, 12,133, 44,185,196, 45, 15, + 56,162,133, 83, 96, 22,149, 29,192,216, 10, 17, 77, 80,234,125, 23, 11, 62, 6, 54,214, 59,136, 0, 17,238, 84,229, 72,151, 37, +209, 93,186,239, 13,155, 33,186,183,121,189,197, 48,156, 40, 75, 65,198,255, 0, 21, 32,154, 2,161, 68,208, 18,125,166,131,175, +134,254, 79,213,190,157,221,140,101, 58, 37,230, 68,106, 1, 12,124, 57,187,123,202, 12,176,149,207,103,197,241, 78,225, 91,151, + 6, 52,216,238, 44, 2,190, 13, 60,219,138, 6,191,181, 69, 19, 83,239,215,152,223, 70, 70, 57, 50,182, 18, 29,228, 17,238,112, +134, 98,151,114,252,178, 39,105, 27,131,131,195,119,201,185, 75, 87,204,149, 2, 65,226, 84, 17,212,127,100,107,208,189, 43,142, +101,131,230, 31,230,252,139, 47, 72,244,139, 87, 91,255, 0,121,108,177,102,174,220,190,114,109,229, 5, 54,248, 54,201, 41, 88, + 53, 87,154,226,218, 80, 27, 13,190, 53,171,166,189, 15,164, 87,161, 79,214, 44, 62,116, 66,161, 45,238, 56,243,171,120,245, 65, + 59, 18, 5, 55,165, 7, 79, 19, 77,106, 19,170, 52,100, 54,183,106, 47,107,100,178, 20,146,121, 60,181, 37, 3,217, 94, 32,114, +175,210, 78,156, 29, 18,136, 14, 11,104, 53,251,202,182,123, 29, 0,156,149,190, 42, 10, 66,150,146, 87,202,187,141,171,183,217, +172,140,229,189,211, 72, 1,118,245,246, 44,145,233,162,253,112, 67,126,115,205,252,132, 68, 37, 47,161,151,120,184, 92,113,197, + 36, 57, 94, 97, 33, 9,170, 18, 9, 32,248,107,132,245, 4,141,120, 22, 22,226, 64,239,237,127,187,177, 97,122,206,248,237,140, + 7, 29, 79,185, 81, 16, 68, 8,209,151,113, 67,148, 82,211,247,125,228, 83, 94, 77, 25,149,230,178,213, 47, 76,242, 69,201, 49, + 24, 86,210, 13, 85,191,141,107,161,202,221, 89, 2, 81, 70,172, 22,184,235,185, 37,114,126,235, 73,167,184,211, 67,144,116,162, + 8, 8, 14,125, 97, 84,151,144,243, 95,185,125,116, 32, 31,237, 31,244,104,149,105,197, 73,148, 41,177, 90,180,200, 41,109,170, +136,205,142, 71,111, 16, 63,215,169,151,226,155,114, 21, 19, 36,249,251,162, 90, 90, 72,109, 59,133, 83,110,181,211,194, 36,148, +210,179,181, 48, 92,115,230,236,147, 89,183,172,143, 55,134,213,250, 53, 96,208, 83,121,168, 12,172,162, 60,136, 34, 77, 65,116, +185,191,215,215,245,104, 70,178, 20, 60,224, 74,107,129,148, 90,110, 61,185,146,185, 44,165, 75, 36,165, 4, 15, 18,105,253, 26, + 13,180, 18, 93,212,227, 32, 80,171,197,186,213, 19, 1,155, 53,196,143, 51,203, 33, 3,199,238,234, 24,178, 50, 46,165, 32,171, +206,214, 64,110, 4,180,195,121, 6,143,146,181,127,180,107,171,153, 51,113,162,140, 67, 43, 2,211,109,139, 14,242,166, 56,241, + 73, 53, 79, 77,197, 14,177,235,119,101, 34,156,156, 77,170, 38, 55,230, 60, 0,113, 41,169, 86,221,104, 71,244,104,115,150,227, +224,131, 41, 23, 80, 49,117,198,155, 96,145,118,112, 14, 9,168,173, 61,244,210,147,168,204,151, 64,173,205,162,239,127,126, 98, + 69, 25,101, 42, 82,136,219,225,165,117,111, 24,148,162, 75,173,136, 72,188,218,102, 51,111, 79, 37, 41, 42, 74, 0,246,131, 79, +215,162, 89, 47,140, 4, 66,233,111, 9,192,242,123,179,142, 14, 10, 72, 99,225,114,181,241,248, 78,172,202,200, 69, 56, 37,214, +236,138,201,144, 91,236, 95, 45, 24,126, 59, 46,209, 99,220, 70,133, 27, 32, 74,125, 80, 73,216,230, 71,113,118, 60,184,234, 33, +162, 0, 88,220,245, 58, 54,248, 20,128, 36, 39, 44, 31, 29,190, 89,239,237,177,112, 37, 80, 84, 6,254,192,119,213,121, 8,238, + 67,178, 37, 66,239,246, 66,171, 12, 2,204, 58,144,165,124, 60,122,238,106,118,213,184,214, 36, 64, 80, 50, 32, 42, 90,127,114, +174,134, 92, 91, 97, 73, 10, 42, 28,146,107,215,174,175, 28, 32, 2, 81,180,149,104, 61,221, 79,242,183,111, 22, 80, 72,158,226, +119, 30, 61, 53, 67,246,160,201, 41, 72,146,134,246,215, 63,126, 77,141, 82,229,214,133, 69,195, 90,239,212,233, 89,136, 55,132, +198,122,169, 55,220,186,109,198,202,212,213,215,148,137, 9, 72,175,130,121, 83,245,104,194,144, 17,119,232,157, 35, 64,145,125, +199,219,105,148,254, 27,128, 2,175,102,213, 58,205,182,192, 9,100, 65,162,120,198,109,182,108, 79, 10, 89,104, 15,159, 85,121, +145,214,180, 26, 0,153,146, 78,171,247, 47, 18, 95,202, 20,243, 91,175,113, 79,104, 3, 86, 54,104,166, 39,162,215,113,191, 37, + 73, 91,142,167,138, 66,136, 88,253, 7, 83,141, 74, 41,155, 8,200, 98, 77,142,136,160, 2,144,161,199,233,213, 91, 98,197,148, + 93,121,207, 97,219, 98, 78, 55, 89, 8, 74,163,146, 16,118, 27, 84,255, 0,175, 82,216, 83,186,137,134, 91,225,200,154,244, 38, + 80,146,226,135,152,131, 74,251,244,198,178, 20,244, 68,174,150, 6, 27,182,159, 33, 32, 60,237, 82,178, 7, 77, 51, 30, 9,152, + 37,113, 13,120,250,218,113, 96, 41, 5,101, 36, 30,149, 42,210,216,145,138, 36, 30,144,110, 5, 94, 80,160, 72,114,158,227, 95, +244,104,111,162,139, 42,114,221, 37,203,238, 72,194, 83, 80, 22, 40, 72,254,238,186, 31, 36, 70, 58,170, 59,137, 1, 63, 42,195, + 54, 69,181,203, 60,138,169,130,161,199,232,214,101,151, 0, 88, 43,245, 82, 89, 59,118,123, 25, 98,215, 99,157,109,150,154, 33, + 96,138, 43,198,163, 84,109,183,113,112,167, 26,245, 79, 88, 38, 37,107,139,137, 46, 28,148, 10,149, 26, 84,120, 84,143,233,210, +149,146, 68,140, 0, 74, 93,195,193,237,177,228,166, 84, 84,132,199, 9,240,218,189,116,133,242,100,251, 65, 40, 13,234, 0, 74, +173,145, 15,221,165, 65,254,206,218,181, 86, 73, 3,193, 52,234, 14,183, 79,198,173,240,175, 2,232,208,252, 87, 82, 27, 26,108, +156,195, 56,232,148,105, 0,164,191, 84, 61,188,178,228, 93,177,149,100,147, 33,200,197,198,148,235,110,199,228,178, 93, 79,198, + 7,150,144,121, 84,128, 79, 78,149,174,187, 79, 64,117,139,113,179, 35, 0, 6,201, 22,147,191, 2, 27,139,176,237,252,149,186, +108,242,164, 8, 92, 16,214, 61, 53,169,138,134,235,110, 9, 8, 87, 5, 0,154, 17, 77,183, 73,233,175,163,227,140, 14,160,174, +146, 29, 72,202, 41,130,211,218,220,198,247, 33, 44, 91,224, 63, 33,178, 43,201, 13, 44,168, 14,189, 18, 43,183,186,186, 29,241, + 17, 10,214, 53,196,151, 11,161,253, 53,246,251, 35,199,153,114, 98,237,242,221,122, 58,144,239, 40,136, 90,164,182,148,237,205, + 8, 69, 92,174,221, 66, 78,222, 26,192,202,176,153, 50,233,168, 48, 21,187,177, 86, 71,127,253, 64, 91,114, 75, 3, 56, 5,190, +100,241,108,141, 73, 82,143, 4,177, 71, 0, 53, 71, 5,167,204, 74,201,221, 84, 66,106,116,248,248,123, 37,187,154,192,203,204, +243, 6,213,206, 25, 62,107, 38,254,219,168,132, 30,136,132,133, 37,106,153, 32,185,205, 41,173, 62, 6,155,170, 65,254,246,181, +106,165,203,149,129,118, 67,104, 18,101,218,101,253,229,162, 68,194,164, 67, 66,146,227, 74, 87, 53, 36,131,247,130,121, 29,171, +212, 29, 93,133, 65,150,116,237, 46,152,237, 55, 81,114,181,162, 81,121, 46, 60,214,201, 91,206,135, 28, 27, 80,208,148, 3, 79, +113, 58, 9,164, 58,113, 97, 80,231,223,203,137, 15, 49, 33, 65,228, 20,182,243,133, 11, 20,226, 62, 26, 18, 0,240,209, 99, 80, + 81, 54, 39,142,207, 95,162,221,231, 42,220,250,188,201,193, 1,182,212, 20, 57, 30, 68, 55, 68,146, 64,162, 71, 77, 6,200, 54, +168,181, 77,210,215,122, 49,111,228,179,110,152,187,207, 45,198, 82,234, 20,177, 68,128,177, 66,180, 16, 8,235,241, 26,239,227, +165, 76,212,172, 28,149, 64, 49, 11,245,154,228,171, 57, 74,215, 21, 91,149, 0,160, 74,200,169, 78,227,168, 4,138,106,208,177, + 3,105, 26, 45,234,199, 28,110,226,155,106,199, 21,157,157, 60,146,158, 28,182, 9, 62,102,195,235,211,139, 10,111, 45, 88,118, +216,119,235, 53,169, 6,204,182,150,194, 20, 86, 22,132,182,149,171,144, 0, 32,114, 82,185, 36, 83,197, 26, 25,176, 58, 52, 70, +139, 94, 23,146,101, 81,114, 17, 63, 25, 97,216,153, 31, 18, 67,144, 29,109,161, 67,177, 42,105, 52,228,107,239, 3, 80,190,154, +178, 33,182,216,137, 14,240,232,114,168, 30, 72,159,115, 59,177,146,223, 50,155, 92,188,201,106, 55,168,136, 68, 68, 62, 91, 82, + 3,220, 87,205, 60,184,169, 98,190, 4,130, 53,146,122, 5, 56,216,230, 52, 6,139,146,218, 54,164,147,248,173,126,145,159,228, + 89, 24, 30, 31,197, 93, 88,124,213,220,241,139,147, 16,148, 0, 48, 66,222,124,144,132,178,148,138,169, 41, 53,253,162,106, 78, +155,165, 85,240,151, 90, 93, 94,207,235,130, 15, 32,170, 75, 36,201, 13, 7,192, 9, 92,102,212, 28, 21,219,110,116,173, 9,241, +165, 6,173, 69,209, 4,128, 26,113, 70, 45,178, 92,184, 5,203,113,207, 41,166,194, 82,223,130, 81,182,202, 53,241,161,160,212, +228, 9, 14,137, 93,162,178, 34, 53,237, 87, 39,166,116, 71,159,126,110, 45,172, 46, 83,109, 58,134,252,228, 2, 66,156, 38,128, + 36,117, 38,167,111,209,172,108,154,223, 78, 43,160,199,188,199, 83,162,234,142,250,102,179,152,198, 96,246,162,198,243,114, 33, +148,137, 55,165,178,220,103,129,184, 21, 87,224,125, 60,156, 79, 4, 81,178, 2,130, 77, 42, 69,117,228,126,179,234,162,100, 99, +194, 64,198, 39, 86,110, 62, 60, 87,155,245,188,179,147,121, 35,130,166,228,219, 47, 44,199,114,156,144,210, 10, 80, 18,161, 78, +158, 58,225,231,116, 34,177,132, 9, 11,202, 49,233,110, 95, 35, 44,172,143, 48,164, 2, 60, 14,170, 78,224, 82,140, 19, 85,226, +204,237,161,196,192,117, 92, 36, 43,170,188,119, 26, 7,156, 81, 4, 2,135,124,118, 44,118,163,193,121, 92,159, 73,248,125,253, +116,171,188,186,127, 40, 45, 22,232, 76, 75,146,252,121, 66,175, 61, 64, 71,187, 79, 60,130,116, 10, 63,183,209,101,203,182, 81, + 93,182, 25, 54,202, 7,218, 60,151, 78,180,241,209,106,200,218,135, 60,103, 72, 25, 86, 7,116,187, 94,219,187, 54,178, 89, 80, + 8,167,179,254,149,214,135,250,136, 32,168,126,213,150,219,159,111,223,128,227,112,119, 8,224, 86,125,228,141, 12,228,104,232, + 39, 27, 84,110,211,139,200,180,217,216,128,106,168,178, 8, 82,135,178,134,186, 17,200,220, 17,124,157,165,126, 95,218,106,100, + 68,219, 93,170, 35, 41,105, 65, 73,232, 64,235,182,154,175,128,104,150,199, 58,161,115,227, 91,172, 87, 52,184,216, 9, 9, 72, + 32,255, 0,119, 82, 36,201, 70,205, 20, 43, 94, 81, 38,237,125,117,244,254,237, 2,136, 62, 26,140,233, 16, 14, 80, 98, 73, 42, + 79,115,178,249,240,177,120,241, 98,146, 93,124,248,117, 53,213,108, 10, 55,146, 74, 86, 22, 94, 49,172,233,246,123, 97, 58, 27, + 64,170, 67, 71,226,250,119, 63,211,171,211,198, 26, 4, 25, 79, 84,115,183,211, 31,147,133, 23, 18,209,249,217,202,242,138,252, +104,118,210,156, 5, 72,245,141, 17, 44, 22, 36,156, 94,242,228,121, 20, 80, 79, 45,143, 77,197,107,170, 54,203, 87, 71, 21,167, +204, 10,116, 88,208,101,121,233, 72,126, 66,213,184, 27,237,176,213, 57,185, 41,205,101, 47, 92, 96,139,237,213,216,204,167,225, + 82,137, 32,123,180,183, 24,135, 72, 86, 81,155,119,111, 91, 45, 71, 97,180, 15, 57, 91,145, 79,163, 74,171, 73,213, 48,129, 83, +220,180,197,135,118,106, 11,212,249,128,133, 41, 64,251,180, 83, 39, 75,105, 85,254,121,143, 91,110, 51,147,252,197, 1,109,135, + 56,164, 30,149, 39,109, 88,141,178, 18,209, 71,106, 66,185,246,142,195, 31, 41, 55, 87, 18,146, 18, 63, 9, 30,253,107,126,240, +178,136,136, 69, 91,237,125,166,231,106,114,229, 50,139,134, 15, 26, 30,128,245,166,170,207, 32,130,164, 34, 22,182, 48,251, 53, +190,206,166,216, 1, 12, 10,128, 7,141,116,142, 73,220,155,203, 5, 7,185,198,132,184,241,173,204,236,134,213,205, 53,246,214, +163, 79, 27,228,120,164, 43,213, 91,120, 43, 45,219,240,212, 46, 77, 42,173,211, 95,160, 29,101, 93, 18, 45,117, 46, 40, 60,236, +173,147, 33,216,124,255, 0, 9, 64,212,123,250, 87, 87, 43,173,148,118,175, 61,191,194,164, 95, 39, 59,121, 7,240, 80, 84,164, +251,197, 53, 9,204,196,164,129,101,205,197,110,236,182,212, 66, 91,113,101, 4,123,198,218, 52, 37, 34, 17, 97, 16, 87,238, 36, +226,109,151, 37, 41,181,127, 10,149, 4,159, 96, 36, 17,168, 90, 29,138,129,142,169,159, 41,109,139,237,157,232,104, 80, 60,207, + 48,107,211,106,232,209,147, 4,194, 11,243, 6,110, 61,158,224,137,202, 85, 80,144, 26, 62, 58,148, 62, 32,156, 7, 68,111,207, +205,182, 73,118, 42,197, 89, 90,188,214,143,182,187,106, 70, 17, 36, 40,149, 89,102,153, 44,200,239,182,218, 1, 40, 76,132,115, +167,176,171,125, 18,117,197,146, 4,171, 45, 66, 55, 36,206,219,129,128,167, 72,254,208, 41,166,178, 20,119,104,171, 60, 39, 27, +105,171,250,228, 74,103,203, 67, 42,224,216,161,233,211, 90,211,201,209, 76,212, 19,107,225, 49,178,102,227,160,255, 0, 15, 84, +144, 7,176,235, 46,113, 36,186,176, 44, 96,201,138,225,124,102,219,118, 85,189, 0, 36,134,195,155,120,232,120,213,153,161,217, + 61, 81,198,115, 38, 23,101,141, 38, 50,197, 43,193, 64,120,158,159,209,163,206, 59,100,201,226, 73, 8, 93,218,246,139,162, 29, + 74,212, 20,134,234, 69, 60, 52, 19, 23, 68, 35, 68, 14,232,243,115,226,183, 57,161,180, 97,192, 29, 56,208, 50,158,140,165,187, + 33,183,152,101,199, 55,229, 64,157,189,189, 52, 21, 48, 66,211,147,121, 14, 56,150, 93,169, 82, 0, 74,210, 9, 27, 31,160,215, + 69,162,217, 87, 45,195,138,112,197, 80,157,251,244,150,235, 63, 51,220, 30,220, 72,144,171,217,252, 85, 68, 33,151, 80,186,212, +148,165, 10, 77,106,126,147,175,110,244,143,212, 81,165, 25, 0, 55, 34, 63, 53, 98,191,135,130, 87,244,251,234,102,217,129,102, +236, 98,189,194,199, 82,153,173,150,210,250, 94, 74,152,146, 84, 13, 1, 9, 65, 28,171,224, 55,215,168,100, 84, 50,161,186,185, +184, 62, 11,160,193,207,140, 15,196, 23, 96,247,155,214, 94, 13,143,118,105,201,125,186,132,252, 91,252,150, 82,134,248, 63,229, + 42, 59,171, 65,163,128, 56,216, 93, 1, 21, 62,223,110,176,232,233,114, 19,121, 45,108,174,171, 25, 71,225, 95, 61,178,188,179, + 44,202, 47,207,190,212,246,213, 50, 81,114, 93,205,247, 75, 78, 5, 40,142,101, 68, 52, 84,175, 48,154,159, 3,174,134, 49,137, + 92,197,150, 21, 14,208,197,237,114, 87, 22, 4,180,195,183,121,137,229, 33,212,186,154,182,164,141,184,146, 16, 15, 65,190,143, + 29, 21, 41,241, 76,177, 49,108, 94, 57,117, 78, 60,143,230,139,226,176, 67,136, 14, 56,179,224,164,113, 85, 54,175,179,233,212, +101, 97, 9,180, 40,109,217,219, 69,160,150,221,248, 94,111,241, 24, 44,180,177,211,115,205, 60, 73, 59,120,214,154,136,176,168, +146, 16,116,183,252,246, 89,139,110, 82,158,101,105,171,143, 52,219,137, 72, 42,241, 9, 88, 10,229,169,249,189,168, 64, 57, 93, + 23,233,187,211,124,139,108, 35,151, 93, 88, 76, 88,204,121, 74, 75, 79,209,165,186,207, 34,165,175,115,200,141,136,175,178,190, +202,235, 59, 39, 60, 56, 11, 75, 31, 20,170, 59,212,151,112,161,220,243,185,247, 27,120, 66, 22,243,252,208,145,247, 19,197, 97, + 41, 41, 6,187, 4,164,109,171,244, 65,160,171,219, 55,146, 19,113,202, 33, 93, 88,136,234, 79, 55, 35,165,182,155, 91,102,129, +213,114, 43,243, 20, 18, 41,202,139,160,250, 43,227,169, 68, 40,202, 97, 17, 98, 38, 59,111,120, 73,152,133, 25, 73,162,252,197, +172, 44,112, 29, 70,251,113,175,133, 55,212,228,234, 34, 65, 16,191,247, 34,222,109, 14, 88,237, 37,182,152, 5, 38, 68,132,169, +199, 22,162,234,232,148, 2,176, 64, 28,169,176,160,210,174,135, 46,161,102, 78,212,177, 96,115,231,174,239, 79,121,231, 68,120, +252,154, 83,229,104,142,210,202, 9, 85, 10,148, 66,149,211,194,160, 83, 70,149, 69, 2, 25, 40,141,231, 60,139,121,129, 38, 44, +104,145,230, 70, 74, 1, 5,106, 83,156, 55,218,170,124,241, 81, 7,112, 64, 52,212,170,139,104,121,163,249,175,170, 98,237,223, +113,209,255, 0,135, 55,196,161, 72, 85,217, 49,214,148, 64, 75,116, 82, 16,131,183, 22,197,106,107,226,118, 29, 72,211, 28, 47, + 41,246,240, 42,228, 51, 13,146, 4,242,209, 32,218,123,131, 42,115, 10,109, 6,143,127,237, 43,229, 82, 18, 9, 60, 42,126,195, +191,134,171,138, 73, 28, 22,151,157, 16,123, 83, 85,146,237, 35, 49,151, 26,207,143, 52, 95,100, 16,216, 75, 97, 92, 66,137,216, +154,237,183,215,168, 89, 0, 2, 61, 51,109, 79, 53,220,158,145,113, 88,189,148,198, 25,205,242, 48,129,127, 45,151, 45, 81, 84, +194,220,242, 86,107,252, 75,161,189,194,252, 16, 15, 78,180,173, 41,200,117,254,187, 71, 78,131,203,231, 60, 3, 63,181, 7, 59, +168,233,182, 39,218,153, 31,188,204,191, 78, 55, 41,191,141,113,125,222,106, 81, 9, 78,213,167, 68,132,254,173,124,233,155,153, + 44,139,140,201,117,129, 57, 58,211,157, 24,145,173,143,200,101, 28,120,129, 81,253,173,101,137, 25,204,170,243,147, 4,161,137, + 92, 92,185,228,176,154, 88, 37, 10,226,174,157, 40,117,110,117, 0, 21, 67, 50,153,251,174,235,238,100, 12, 73,108,252, 41, 77, + 22, 62,132,106, 94, 72, 33, 48,153,116,141,122, 85,210, 83,176,164,178,146,165,169,101, 59,125, 58,170, 3, 20,104,204,186, 58, +226,151, 14, 84, 71, 80, 9,154,126, 23, 52,204,136, 36, 81, 11,102, 72, 90,185, 63, 9, 68,132,185, 81,238,209,197, 97,212,183, +148, 55, 31,150,204,229,204,183, 42,138,122, 58,138,146, 7,211,254,173, 52,226,201,141,139,213,152,200,203,178, 33,106, 80,252, + 85, 37, 73, 36,143,186, 6,250, 41, 31, 10,136,154,201,207,139,100,150,236,203,251,236,146, 9, 62, 20, 86,245,208,246,169,198, + 97,104,187, 88, 29,145,112, 76,132, 30, 81, 80,144,225, 35,165,104, 52,109,237,162, 26, 81,201,226, 73,154,243,142,161, 4,176, +154,163,149, 58,106, 66,196, 9,135, 43,222, 41,136,162, 51,106,156,107,193,193,196, 15,110,250,161,153,150, 72,100, 90,234,230, + 83,165,231, 3,182,171, 27,102,116,230,194,159, 41,226,192,235,198,191,234,209,177,175, 53,196, 40,249, 78, 84,107, 47,110,108, +246, 14,223, 73, 15,128,185,210,221,169, 7,173, 9,233,171, 51,203, 50, 82, 24,224, 20, 86,207, 18,221,143, 90, 35,169,105, 8, +132,200, 43, 53,233,207,168,208,103, 97,154, 32,128, 5, 40, 72,205,210,185,210, 93, 86,238,184,162, 16,125,131,167,234,211,138, +157, 66,114, 79, 56, 67,223, 59, 21,183,214,104,211, 77, 23,151,244,145, 81,161,202,164,254,102,137,135, 19,179,197,110, 43,215, + 73, 20, 15,186,190, 45, 15,113, 35,125, 82,176,238,208, 40, 25,128,136,219,111,241,160,101, 18, 22,234,135,203, 69,104,108,125, +180,174,136, 70,208,164, 10,175,242, 12,205, 79,100,143,222,249,124, 38,173,182, 7,191,109, 88,170, 26, 58,107, 11, 4, 26,244, +185,119,102, 35,188,210,170,242, 94, 10, 80,246,167,115,171, 52,176, 37,208,200,126, 10, 30, 97,111,150,139,188, 55, 98,142, 97, +227, 66, 7,133,116, 99, 56,149, 2, 25,120,152,205,206,211,132, 92, 44, 41, 36,207, 75,222, 98, 71,137, 7, 69, 6, 37,144,136, + 40, 19, 49,239, 47, 72,102, 52,160, 67, 42,220,143,175, 76, 98, 29, 16, 58,133,123,182, 76,183, 54,185, 37, 39,201,109, 99,130, +135,141, 14,167,183, 68,238,156,163,101, 78,205,197, 24,136,215,194,176,154, 10,125, 20,208,103, 72, 37,211, 18,202,190,200,110, +147,237,178,100, 56,242, 84, 10,135,193,244,147,171, 53, 86, 20, 12,203, 43,159,181, 87, 73, 16, 49,136,145,194, 74, 95,125,174, + 84, 62, 53, 3, 84,111,135,196,134,102, 89, 83,189,204,188, 92, 78,106,155,122, 82, 79,150,249, 82,168, 61,164,127,167, 87,233, +175, 69, 40,204,162,214, 84, 75,101,215, 96,187, 95, 49,215, 80,226, 79,246, 70,231, 66,156, 67, 41,130, 93, 18,141,115,185, 57, +243, 9, 96, 19, 20,114, 72, 95,190,157, 52,251, 3, 50,144, 37, 67,199,110,215,153,178,154,181, 50, 21,230,149,239, 95,236,157, + 40,196, 4,209, 37, 58, 93,242, 39, 47,183,104,118,226, 40,166, 27, 9, 81, 61, 74,147,170,147,150,210,164, 18,182, 89,102, 97, +167, 20,183,199,192,181,164,215,251, 85, 3, 68,140,204,194,103, 77, 5,226,111, 98,197,189, 68, 18, 15,210, 80, 20, 63, 86,151, +145,201, 13,123,188,219, 99,201, 92,151,160,163,136, 69, 20, 8, 26,204,172, 21,162, 67,132, 24, 68,184,185,152,161, 46,213, 72, + 44,130,159,164,127,244,235, 70, 36, 72, 50,166, 67, 45, 25,149,235,201,186,198,186,168, 41, 33,228, 42, 58,182,216, 45, 58,142, + 20, 90, 68, 21, 27, 11,128,161,196,201, 23,111,197,144,219,234,163,190, 97,216,251,207,191, 74,248,188,244, 68,140,246,169, 22, +236,148, 35, 18,157, 49,197,126, 47,153,196, 26,244, 7, 82,242, 24, 4,241,155,175,113,223,148,213,134, 52,119,149, 79,153, 95, +153, 90,254,205,107,161, 74,181, 35,102,136,188,107,135,157,193,212, 10,199,102,148,246, 84,109,170,222, 91,148,222, 98,139, 50, +236,221,194,236,153,149, 4, 57, 68,172,120, 87,174,136,106,209, 78, 54,178, 49, 6,242,212,124,157, 22,201, 4,112, 80, 10, 74, + 79,141, 55,219, 80,148, 8, 70, 23, 5, 79,122,225,237, 54, 31, 53,230,123,149, 98,137, 37,155,234,214,212, 87,166, 48,220,132, + 86,134,156, 11,143, 4, 54,145, 77,128, 73, 39,216, 60, 71,178,125, 51,234,121, 6,195, 76,166,240, 1,192,248,127, 45,126,228, +122,239,213,146, 38, 82,152,142, 96,172,219, 32,221,211, 33,128, 4,110, 11, 64, 74,249,113, 0,132,186,167, 28,113, 74,223,170, +146, 40, 58, 84,235,215, 76,137,151, 5,171, 18, 54,165,188,115,183, 86,166, 33,190,212,177,231, 78, 82, 66, 20,219,165,107,220, +124, 68,142, 42, 64,241, 59,145, 95, 96,246, 20,241, 85,228,154, 59, 79,217,233, 93,200,200,153,237,220,117, 46, 92,247, 22,137, + 83, 29,217, 44,197,101, 79, 2,149, 41, 69, 60,170,118,232,127, 78,129,145,144, 42,137,145,209, 14,186, 13,178, 97,197, 89,125, +204,238,215,162,143, 79,247,129,219, 28, 58,201, 39,185, 29,233,140,133, 42, 77,171, 26, 64, 83, 17, 31,105, 94, 83,136,126, 65, + 95,148,223, 21,144, 23,196, 45,105, 38,138, 0,144, 15, 55, 60,219,110, 46, 52,143,105, 93, 93, 61, 51, 31, 28, 53,174,102,121, + 14, 41, 34,127,106, 61, 71,122,149,192,207,119, 59,109,217, 27, 85,207, 10, 89, 91, 11, 93,131, 54,132,187,131, 14, 52, 65, 91, + 46, 53, 58, 52,100, 37,196,215,116, 41, 96,253,186,140,122,196,106,150,217, 75, 94,240,179,172,197,133,129,196, 8, 31,241, 7, +247, 16,168,188, 55,185,110,246,179,184,238, 97,121,118, 51, 42,195,147,197, 83,110,203,177,101,241, 12, 41,205,182,181,249,105, +144,149, 18, 82,243,100,138,115,108,241,250,122,235, 90, 25, 49,186, 47, 18,168,156,113, 29, 98,253,224,232, 71,241, 93, 11,221, + 31, 84,152, 15,109,123,111, 50,238,250,208,237,230,228,202,237,232,102, 50,197, 82, 22,128,144,144, 28, 42, 52, 9,220,236,145, + 79,168,105,168,195,157,147,213, 18,204,152,194, 58, 46, 16,191,119, 50,110,109,148, 57,144, 60,178,166, 95,112,172, 54,221, 56, +182,223, 34,174, 32, 36, 1,176,160,215, 72, 43,218, 25, 96, 27, 92,186,219,110,204, 46, 49, 50, 38, 33,201, 10,105,150,221,109, +148,114,253,170, 30, 32,208,109, 64,145,166,218,145,155, 43, 35,186, 55,246,173,248,148,124,142,206,201, 44,173,142, 46,202,108, + 84,166,169, 4, 4,143,235, 10, 18, 73,233, 95,177, 66, 42, 54, 77,152,170, 94, 78,125, 54,252, 27, 93,180,169,199,144, 60,198, +221,104, 26,252, 35,226, 88,165,122, 31, 17,163, 87,161, 85,231, 39, 71, 45,185,101,198, 53,193,153, 23, 40,200, 90, 16, 18,151, + 8,117, 77, 6,214, 71, 21, 5, 22,182, 73,166,195,150,250, 58,174, 74,127,129,151,220,219,182,201,138,218, 27,101, 97, 42, 64, +137, 40,169,228, 58,210,252, 67,139, 32,164,251, 15, 29, 12,192, 34, 70,194,132,225,147,215,111,186, 34, 67,124, 86,235, 74, 10, + 83, 65,124,131,136, 38,165,165, 43,159, 5, 37, 67,110, 38,186,177, 92,219, 66,137, 11, 72, 46,175,204, 15,183, 93,139,153, 5, +171,244, 21, 58,228,185,132, 60,228, 55,144, 94, 91,110, 44,241, 41, 80, 77, 17, 65, 77,128, 20, 30,205, 81,183,120, 37,184, 45, + 72,229,196, 55,106,185,123, 91,140,227,118, 11,131, 87,152, 54,196,162,209, 12,164, 54, 22,195,117, 83,132,212,249,156,141,104, +105,224,154,123,107,174, 35,212,158,164,175,166,192,185,121,145,160, 68,191, 60,136,171, 86,255, 0,220, 57,121, 89, 76,251,146, +144,150, 99,169, 45, 52,219, 96, 32, 1, 90,211,225,160, 63,102,190,122,235, 93, 90,236,235, 65,176,147,247,170, 39, 36,148, 86, +235,114, 78, 61,110,143, 62,180,145, 34,139, 4,248, 0,157, 99, 87,163,133, 8,218,232, 30, 73,148, 42,225,142,165,181,174,174, +200, 95, 65,227,184, 26,175, 94,147, 42, 50,150,228,103,183, 86,184, 34,106, 28,113, 32, 45,182,146,162,175, 97,235,163, 74, 69, + 32, 66,153,220,233, 17,221,186, 48,211, 10, 28, 30, 79,196,175,102,135,143,113, 32,167,248, 89, 9,105,219,101,189, 49, 99, 26, +121,168, 93, 83, 90, 86,149,211,234, 67,165,188, 5, 19, 34,151, 17, 16, 93,184,199, 88,230,194,185,245,247, 29, 24, 7, 9,163, + 32,135,192,158,137,141,155,130, 8, 4, 54,167, 73,250,191,213,162, 10,200, 42, 70,206, 74, 71,110,217,142,155,192,186, 83,147, +111,165,194,175,126,158,196, 57, 7, 76, 24, 21,145,111, 94,100,100,241,126, 22, 24,119,227,227,236,161, 4,126,157, 79,112, 17, +100, 55, 64,187,149, 45,135, 50,105, 51,161,236,133, 40,165, 63,237,117,208,145,107, 29,169,183, 18, 98, 36,140, 80,249,233,171, +206,160, 54, 20,127,172,122,104, 18, 58,163,237, 5, 15,200,236,118,187, 68, 85, 88,222, 74, 76,151, 80, 20, 78,219, 26,106, 17, +145, 67, 49, 65, 23, 29,136,150, 72,108,160,254, 58, 30,242,214,125,213,235,166,242,220,185, 86, 8, 0, 35, 63,205, 89,153,107, +126,223, 94, 66, 58,128, 30,225, 65,163, 8, 32,146, 0, 64,231,220,230, 75,142,210, 91,168,101,167, 56,113,246,154,237,254,157, + 24, 86,193, 71,115,168,189,200,187, 45, 48, 90,180,180,170, 6, 80, 22,224, 29, 74,136,211,152,136,186, 24,147,149, 86, 64,188, +201,185,228,191,202,227, 10,172, 16,143,168,157,245,126,184,124, 14,133, 62, 37, 95, 56,251,236,219, 49, 5,199, 64,163,239,173, + 12, 5,127,100, 1, 93, 84,200,210, 42, 60, 81, 43,214, 64,213,154, 48, 90,149,248, 77, 34,169, 3,250,196,106,181,116,104,253, +168, 70,101,210, 83,185,111,159, 1,217, 74,112,252,219,202, 37, 64, 31,217,212,103, 91,201,149,136,203, 68,159, 43, 34, 84,251, +203, 48,153, 63,135, 90,171,232, 27,235, 90, 20,180, 80,229, 55, 40,237,178,243,228,171,229, 1, 6, 82,149, 81,238, 77, 53, 94, +234,152, 58, 85,216,153, 45,247, 8, 47, 92,225, 9, 52, 86,252, 77,124, 8,255, 0, 94,170,236, 36, 34,111, 82, 27, 68, 37,222, + 31,184, 62,223, 38, 2,168, 82, 71, 90, 10,141, 41, 56,100,196,232,162,101,130,214,202, 33, 94,225,129,197,229,148, 41, 61, 8, +166,218, 35,151, 68,143, 4, 62,250,237,166,229, 21,171, 52,112, 15, 26,188,226,136,240, 34,191,175, 71, 23, 48, 81, 17, 66,177, +132,195,114, 35,150,183, 8, 4, 57,248,106, 39,160, 6,186, 47,152,218,166,219,201, 19,202,108,150, 91,163,177, 24,117,170,200, + 31, 18,168, 54,162,124,127, 70,163, 43,187, 20,188,176,139,193,201, 45,140,203, 12,180, 66, 92,134,208, 75, 65, 62, 39,166,171, +137,147, 36,165, 86,136,124,172, 82,207,119,156,230, 65, 53, 0, 60, 18, 72, 39,196,145, 93, 26, 89, 6, 37, 12,197,150,140,118, + 20, 43,189,194, 83,241,192, 63, 35, 29, 85,167,183,125, 57,158,137, 73,111, 77,157,136,214, 6, 99,162,137,113,247,133, 85,244, +157, 11,204, 58,148,162, 59, 84,102,226,198,176,102, 77, 37, 27, 44, 40, 54,170, 83,170,182,212, 68,204,131,164,203, 47, 79, 71, +182,103, 38, 58, 77, 3, 99,154,143,188,138,233,228,116, 72,112, 90,114,197,183,118,185,219,161,116,106, 67,168, 82,191,235, 3, +162,213, 45,169,132, 29, 31, 75, 44,127,156, 87,119,175,240,254, 98, 45,181,219,254,237, 67, 68,243,121,168,237,228,137,219, 90, +110, 69,178, 67,108,145,243, 8, 85, 40,105,189,124, 53,142, 74,210,218,188,217,225, 71, 50, 37, 93, 37, 80, 62,192, 13,239, 77, +143,179, 82,140,200,213, 14,113, 5, 47,247, 2, 36, 7,173,255, 0, 39, 65, 84,185,231, 36,248,133, 31,102,167, 92,200,147,164, + 40, 4, 36, 44,174, 43,239, 33,168,145,119, 90,143, 58, 15, 0, 55,213,234, 38,250,149, 94,250,214,204, 86,203, 54,247,140,220, + 45,138, 37, 42, 43, 10, 73,247,167,255, 0,163, 86,229, 33, 19,170,140, 99,162,105, 77,177,249,137,139,104, 86,207,178,205, 83, +244,210,154, 5,210, 3, 85, 22, 68, 49,187, 76,150,138,172,215, 4, 16, 93,170, 78,222,250, 3,160, 68,129,170,144,172,160,247, +235, 36,252, 86,234,211, 18, 18,124,133,172,148,168,251, 58,141, 18, 50, 18, 42, 70, 12, 20, 94,229,100, 44, 98,119,219, 62, 95, + 45,208,205,171,128, 47, 56, 73,167, 20,129, 93,128, 36,154,120, 1, 93,104, 99, 96,203, 34, 66, 48,137,148,137, 96, 7, 51,249, + 32, 18,120, 5, 89,247, 55, 55,190,119,154,252,111,236,182,235, 56,108, 37, 31,229, 81, 29, 41, 65, 10, 90, 2, 84,243,129, 71, +136, 91,148,160, 31,120, 13,190,245,117,239,190,152,244,212, 58, 69, 44,117,178, 95, 49,252,135,114,217,196,199,218, 28,241, 94, +109,157,164,187,202,182, 68,137, 54, 48, 10,152,181, 41, 84,120, 7, 74,212, 41,201,192, 40, 18, 19, 80, 79, 77,181,210, 74,206, + 37,105, 70, 4,128, 22,235,247, 96,114,204,125,232,246,120,149, 92, 71, 72,113,167,219,114, 43,172,190,154,208, 26,161,103,127, +167,125, 66, 25, 49,144,117, 41,227,144,152, 59,178,140,155,211, 55,164,140,165,252, 89, 50, 99,119,123, 45,121,139, 36, 41,212, +113,135,227,198, 9, 66, 74,154,147,199,144, 41, 14, 45, 65,104, 63, 9, 0,138, 83, 88,153,247,249,146, 3,147,173,190,147,143, +183,116,184, 24,135,252,191, 55, 92,249,150, 71,239,159,167,107,102, 43,219,127, 69,214,134,151,110,190, 64,110,118,103,220,137, + 81,226,202,254,105, 53,199, 7,155, 29,249, 82,249,183, 18, 43, 28, 18, 82,208, 41,216,215,226, 81, 82,149, 80,221, 89, 7,119, + 46, 74,190, 77,121, 53,204, 10, 70,135, 83, 46,247,231,220, 63, 53,246, 67,242,185,244,105,221,142,201,224,253,194,190,247,214, +212,213,141,204,134, 92, 24,214,251, 19, 75, 97,214,193,182, 48,227,111,207, 73,142,183, 91,227, 33,199,104,130, 20, 73, 74, 1, +232, 70,179, 51,250,124,252,157,243,208,131,162,161,155,213, 99,101,209, 21,123, 87, 37,126,118, 61,134,192,178,126,213,221, 47, + 41, 97,166,243, 44,105,185, 23,251, 28,244,128, 30,101,216,109, 42, 67,140,133, 36,138,182,243,105, 40, 82, 79,194, 73, 10, 34, +169, 20, 93, 32,201,149,239, 48,110, 4,246,133,241,251,188,153,157,223,228, 27,179, 2,227,241, 89, 89, 83,143,168, 18,165, 84, + 81, 94,222, 59,147, 81,227,227,190,189, 27,167,135,139,174,111, 59,225, 36, 4,173,133,100, 81,146,164,176,232, 0,211,141,119, + 7,226,216,244,246,141,104, 77,102, 87, 32,155,162,201,141,117, 71,206,202,119,132,160,164,148, 84,142, 66,130,131,199,250,163, +199, 67, 8,178, 42,220,236,143,112,177,233,246, 59,158, 3,144, 15,155, 19,152,226,174, 72, 75,156, 18, 27,226,146,147,213, 37, + 33, 53,168,223,233,208,236,129,119, 10, 2, 79,162,161, 47,114,226,195,187,220,225,246,242,220,253,214,205, 13, 14, 57,231,199, +109, 68, 68, 75,138, 28, 93, 83,159, 15, 20,149,158, 6,187, 84,145, 90,212,106,169,201,218, 81,191,100, 76, 93, 77,145,220, 89, + 88,223,149,117,189,219,164,193,109,198, 16, 46,141,206,105,213, 68,228,177,177, 83,169, 5,170, 42,129, 73, 80, 62, 62,221, 89, +142,104,224, 85, 51,143, 33,201, 49, 90,187,181, 18,253, 38, 44, 91, 36,166,121, 44, 37, 15,180,226, 93, 42, 73, 41,173, 40,121, +124, 42, 78,227, 98, 43,211,221,106,187, 68,248, 33,202, 6, 39, 84,235, 14,235, 98,182,135, 2,219,109,219,146, 82,159,154, 67, + 64, 22,195, 78, 14, 68,164, 41, 72, 38,158,193, 66, 61,157, 52, 70, 72, 73, 92, 62,142, 21,142,231,119, 71,240,155,123,143,177, + 42, 58,140,176,203,143, 41,178,164,172, 84,128,186,252, 67,106,143,175,174,178,189, 67,212, 63,101,133, 59,128,115, 22,238,226, + 81,234, 27,164,186,141,118,105,176,173,235,179,197, 28, 27, 72, 10,240,216, 15,120,215,202,125, 83,172, 89,159,116,173,176,243, + 86, 44,168,146,139,218,241,116,170,223,111,135,200,149, 62,239,152,178,124, 64,222,186,199,141,155,164,170,236, 42, 95,120,238, +107, 69,170, 50,163,159,194,105, 62, 90,105,210,160, 1,167, 17,123, 60, 83, 1,162, 85,180,203,113,251,108, 89,207, 18, 90, 74, +248,160,120,114, 29,117, 9, 86,214, 20,252, 0, 86, 94, 48,251,237, 88, 94,187,199, 77, 66,168,130,161,236,216, 29, 66,109,180, + 39,218, 74, 31,127,121, 55, 89, 72, 90, 85,240,183,239,247,106,172, 32, 64, 79, 48, 64, 65,111,145,110, 75,150,155,146,129, 1, +180,130,144, 58, 83,254,135, 87, 4,128, 9,132, 9, 8,102, 64, 95, 85,129,198, 65, 33, 75, 73,113, 71,127,126,141, 89, 5, 72, + 67, 68, 19, 4,188,202,145,103,149, 13,245, 20,188,134,138, 91, 39,161, 7,111,233,213,241, 16,132, 83, 54, 47,116, 54,139, 50, +121,170,146, 91,162, 18, 61,198,162,186,169,145, 80,100,206,159,240,187,162, 98,224, 51, 80,193,254, 53,199, 60,211,237, 32,141, + 86,152,112, 8, 74, 39, 84,142,202, 21,145,229, 95,201,222, 39,154,249, 45, 7,218, 70,250,148,131,106,172, 70, 65, 49, 51,147, +185, 97,198,149, 15,144, 11,101,208,163,254,202,169,253, 26, 20, 43,220,167,230,104,129,230,249, 79,157,112, 85,211,204,168, 91, + 97, 98,167,221,162,202,157,186, 40,139, 28,173, 86, 75,219, 55,140,122, 65, 89, 0,130,149,165,126,197, 2, 52, 72,212,158, 86, + 21,150,107,151,151,121,118, 35,171,226,212,196, 36, 34,167,246,128,174,159,104, 37, 6, 82, 82, 38, 72, 97,139, 12,169,168, 63, + 20,117,130,176, 60, 8,241,253, 26,148, 99,171, 40, 9,178, 86,206,110, 15, 25,106,144,149,114, 14,182,151, 6,253, 69, 52, 50, + 52, 61,201, 70, 76,146,241,119,154,137,148,155,162, 72,243, 86, 66, 0,254,209, 59,106,237, 35,224, 1, 41, 23, 42,227,181, 94, + 31, 92,115, 20,255, 0,216, 36, 41, 34,191,182,105, 93, 85,202,142,224, 2,104,201, 9,206,242,151,228, 77, 24,237, 56,190,211, + 97,210,124, 85, 81, 81,162,157, 25, 54,213, 5,219, 67,145, 89,138, 18, 9, 15, 50,167, 28, 62, 3, 81,132, 6,231, 69,150,129, +146,125,157,213, 53,117,114,232,248, 33,181,184, 89,110,189, 40,157,181,165, 25,196, 29,188,208, 8,208,173, 22,220,170,106,243, + 66, 29,248, 90,113, 74,160,246, 37, 35,109, 44,186,218, 40, 84,133, 97,227,243,153,135, 10, 29,254,112, 42, 74,159, 90, 83,244, +212,234,140,106, 96,200,132,151, 77,248,250, 25,184,216, 36, 93,158, 32, 37, 79,154, 15,160,109,250,181, 90,216,106,166,250, 36, + 62,224, 94,158,128,250, 34,127,217, 36,169,196,143,101, 78,152, 71,146, 53,101, 10,177, 92,228, 75,151,205,106, 41,243,126, 4, +143,104,166,139,100, 24, 38, 5,120,118,225,252,138, 91,172, 19, 71, 2,171, 66,119,223, 81,144, 44,164,116, 86, 47,146, 39, 49, + 10,236,206,233, 17,234,170,120,242, 21,208,226, 84,156,148,164,235, 75,254, 99,231,180,126, 53, 43,141, 62,179,167,140,117,117, + 39, 70,178,203,193,131, 10, 60, 52, 26, 56, 19,197, 64, 29,206,212,208,229, 2,232,114,208,161, 29,165,187,124,188,251,227,110, + 42,190, 96, 9, 0,159,117,124,117,114,218,254, 4, 18,117, 68,111,183,132,166, 59, 44,133,209,109,168, 57, 74,244, 32,234,179, + 16,139, 18,131, 92,111,235,115, 49,140,250,205, 66,214, 29,246,253,221,247,209,235,175, 69, 19,168, 67,110,247,247,174,185, 5, +206,238, 87,251,181,132,253, 92,105,167,148, 62, 20,137, 12,180, 94,243, 49, 14, 69,169,197, 44,121,137, 88, 53,175,128, 58, 45, + 84,186, 99, 45, 22,244,247, 60,213,103,204, 20,249,228, 57, 90,254,215, 5,105,121, 90,168,186,123,182, 95, 23, 24, 71,136,149, +126, 36,167,146, 79, 94,131, 89,178,165,145, 69,234, 52,252,164,199,155, 45,144,170, 23,100, 82,155,251, 70,139, 28,100,198,212, + 23, 53,191,169, 76,161,210,173,214,231, 17,185,240, 26,151,146,218, 41,249,186, 45,118,150,216,149,104,110,254,104, 84,128,177, +241,116, 32,105, 74, 59,116,237, 77, 25,191, 20,127,182,238,219,222,177,205,154,132,128,219,166,180,246, 30,186, 21,242, 32,163, + 86,200,232,139, 16,221, 35,220, 2,128,100, 36, 36,251,232, 52, 35,105, 60, 83,136, 34,147,101, 68,249,230,221,104, 10,161, 53, + 73, 26,173, 43,153, 26, 92, 16,190,242, 42, 52,155, 69,190, 74, 85,252, 79, 2,227,148,218,159, 89,213,204, 82,100,116,231,246, +225,196,161,104,203,154,111,157,216,151,223, 12,149,142,221,226, 37,165,227,246,135, 84,195,151, 37, 44, 41,151,159,175, 21,148, +146, 1, 82, 27, 27, 0,145,185,222,180,166,190,138,244, 71,166, 70, 5, 63,184,184, 31, 50, 92, 1,226, 7,223,199,199,144, 75, + 22,145, 41, 58,185,216,197,240,190,217,216, 89,109, 18,151, 42,238, 9,125, 92, 99,169,227,178,104, 82,138,212,242,169,167,221, + 20, 6,128, 15, 30,166, 83, 50, 61,129,111,194, 2, 33, 46,185,220,185, 88,220,215,174,115, 17,230, 76, 89,243, 91, 98, 50, 74, +248,165, 73, 4,115,175, 21, 36,238, 42, 1, 7,221,165, 32, 8,100,104,186,184,189, 61,119, 59,179,189,217,190,196,107,187, 63, + 20,198, 71,146,218, 28, 67,174,167,250,201,228,178,218,148, 10,105, 93,134,222,221,103,228,215, 42,135,194,174, 86, 68,147,255, + 0,170, 44, 91, 5,203, 32,217, 94,237, 12,200, 87, 60,175, 28,157, 30,247, 6, 52,183, 66, 96, 41,112,223, 68,196, 50,226,190, + 33,193,197, 55,229,184, 66, 43,197, 71, 99, 74,107, 14,248, 78,112, 35, 94, 43, 95, 2, 85,194,194, 38, 90, 50,137, 7,187, 77, + 62,246,246, 39,239, 79, 16,125, 15,118,222, 74, 59,139,112,237, 53,170,211,157,151, 90,152, 94,121,113,229,179, 22, 94,206,114, +140,203,175, 59, 29,149, 37, 95,180,202, 18, 43,189,116, 12,121,219, 81,121, 68, 72,142,208,177, 51,177,108,177,227, 27, 26, 42, +229,238,111,174,204,125, 22, 71,147,101, 97,231, 7, 15, 50,177,155, 83,245, 65, 21, 4, 22,121, 2, 41,239,209,239,202,158, 71, +249,133,135,135,217,213, 44,110,139, 40,200,109, 14,124, 71,230,190,103,126, 97,217,223,115, 59,210,196,220, 82, 4, 99, 2,211, +115,109,216,178, 38,188,235, 75,112,199,116, 6,221, 67, 13, 50,165, 30,106,109, 69, 60,151,192, 38,188,135, 35,182,174,224,237, +254, 87, 42,253,253, 58,116,151,180,129,220, 8, 39,238,112,184, 47,185,254,159, 35, 48,151,217,106,174, 58,194,200, 66,156, 33, + 45,172,114, 42, 81, 35, 97,254,191, 13,118,216,115,216, 25,115,183,213,184,191, 53,205,153,205,177, 56,238, 72,184, 80,137,228, +104,182,208,129, 82, 1, 87, 16, 54,233, 77, 91,222,235, 50, 84,152,148, 74,207,113,117,212,161, 14,149, 39,238,132,144,146, 55, + 62, 4,248,244,212, 29, 41, 2, 2,126,198, 45, 47, 42,212,252,168, 75, 9, 50, 16, 80,225, 4,161, 64,165, 10,219, 96,125,181, +168,209, 12, 30, 37, 6, 5,164, 22,175, 76,140,122,172, 99, 1,204, 36, 89, 35, 91, 7,167,187, 4,171, 93,199, 56,141,113,122, +211, 30, 83,204,222, 86,228, 56,207, 48, 29, 90,103, 74, 75, 37,142, 4, 49,204, 51,200, 21, 4,243, 36,224,201,163,175,122,215, +167, 34,221,251, 71,202,126,220, 87,208,207, 74, 30,137,111,119,255, 0, 68,246,156,251,187, 86,127,148,255, 0, 48,189, 58, 69, +158, 60,214, 60,181,189,102, 82,248, 48,181,182,232, 4,161,197, 5,169, 21, 27,160,131,208,235, 38,252,194, 38, 0, 86,140, 65, +118, 92, 81,235,107,210, 28, 63, 78,217, 52, 46,228,224, 10,249, 44, 49,217,204, 69,145, 21, 0,134, 45,114,228, 57,229, 50,251, +124,105,198, 43,142, 16,219,173, 86,129, 74, 74,147,190,218,215,198,180,176,144, 84,100,211,248, 15,177, 8,118,220,172,102, 56, +155,122, 63, 41,112,146,219,127,128,133,149,172,162,149,171,107, 59, 26,111,240,174,181, 27, 3, 93,111,215, 51, 48,178,109,134, +210,159,125, 34,229,127,229,158,250, 66,157, 62, 42,156,130,195,209,140,181, 21,243, 83, 8,125, 85, 81, 41, 60, 79,194,144,162, +120,147,160,117, 76, 67,149,133,117, 67,140,163,248,107,249, 41, 85, 54, 43,189,174,119,148,177, 34,115, 84, 28, 41,229,239,177, + 2,167, 95, 26,228,213, 56, 19, 9,134,144, 37,244,213,193,247,171,210,177, 77,114,243, 21,152,176, 86,202,232,180, 52, 72, 35, +223,182,171,194, 4, 20, 56,144, 74, 31,144, 92, 99, 94, 49, 70,150,250,170,166,221, 40, 62,250,157, 29,136,144, 61,138, 17, 8, + 43, 17,126, 79, 29, 67, 76,238, 4,128,164, 15,239, 43,125, 88,143,196, 93, 65,216, 43, 42,221, 61,184, 56, 84,200, 9, 60,121, + 80,166,189,106, 5, 78,169,202,174, 9, 70,105, 52, 95,221,106,216, 37, 0, 84,162,176,157,171,184, 38,154, 39,237,244, 79, 41, +184, 77,178, 37,199,149,109, 98, 74,168, 90, 13, 4,172,123,233, 77, 82,144, 32,178,132,102,201,107, 52,133, 75,107,173,197, 35, +226,108,175,233, 77, 55,166,172, 99,233, 34,136, 44,112,149,241,104,172, 42,195,193,103,139,171,229,193,126,211,214,154,210, 18, +213, 13, 69,147,145,173, 72, 96,179,247,218, 95,146,242,125,180,218,186,105,143,132,160, 74, 93,137,206, 6, 88, 96, 65,139, 49, +181,127, 15, 83,205, 35,161, 30,205, 83,119, 96,150,160,148,219, 22,221,102,135,145, 65,204, 24,160,132,235, 11,117, 64,120, 43, +254,131, 70,148, 9, 12,151,152,171,188,166,248, 85,116,155,107, 89,161, 46,121,141,239,213, 42, 53,211,215, 78,210,154, 54, 57, +100, 22,252,244,135,218,254, 94,209, 37,228, 36, 41, 53,241, 4,104,246, 67,154,144,119, 90,177,187,196,171,118, 53,115,138,160, + 75,201, 28,169,189, 71,191, 72, 0, 74, 36,138, 47, 10,106,110,201,182,201,136,175,199, 74, 3,202,247,142,132,104, 70, 35, 80, +144,213, 16,185,174, 76,104,151, 27,106,137,242, 39,209, 77,171,174,231,253,122,156, 8,116, 41,196,186,129,150, 98,215,104,120, +148, 75,146,129, 46, 54,124,146,124,120,158,154, 28,153,212,227, 20,153,145,227, 55, 11, 52, 91, 85,246, 56, 41, 76,135,130, 84, + 61,167,144, 35, 87, 41,218, 66,140,193, 77, 71, 36,187, 91,174,236,171,129,249, 87, 40, 85,214,181, 0, 84, 29, 67,104,146,136, + 12,136, 60,216,202,243,215, 46,172,143,133, 8, 66, 10,124, 54,213,108,147,180, 4,104,132,217, 34, 55,205,219,221,132,216, 6, +105,163, 13, 36,120,114, 77, 54,213, 11,108, 98,145,119, 75,153, 31,111,223,129,136, 6, 2, 71,207,176,240, 10,160,241, 82,180, + 60,108,147, 44,159, 16,166, 71,194,145,101,226,147,155,203,222,148,132, 17, 21,148,161,176, 71,245,136,169,215, 69,109,187,224, + 2, 8,139, 43, 18,234, 91,182, 98, 16, 25,124, 1, 29,149,121,138,254,241, 26,171, 41,114, 9,194, 99,237,178,227,206,178,195, +128,243,149, 98,115,235,168, 21,168,223,109, 86,151, 21, 38,116,159,222,203, 41,182,202, 66,159,162,127, 17,113,171,239,240, 58, +106,156,201, 56,146, 3,139,249, 33,108,202,112,138, 48, 74, 15,211, 93, 91,156, 95, 68,219,146,198,127,146, 39,252,206, 28,108, +209,181,128, 13, 61,218,120,210,193, 52,166, 21,195,219,155,210, 46, 24, 51,100, 42,170, 69, 27,169, 62, 27, 15, 29, 86,133, 90, +148,230, 73, 91, 53,185, 11, 6, 87, 21,142, 95,130,245, 22, 41,181, 77, 70,139,229,104, 82,140,212,200,168,115, 42,184, 34, 98, + 62, 38, 26, 95,150,126,146, 54,235,168, 93, 29,177, 83, 39,113, 73, 76, 95,164,227, 57,252,139, 81, 60, 67,170, 28,147,211, 86, +225,241, 86,171, 76,177, 83,110,183,231,110, 51,101, 70,140,170,200, 66,194, 83,244, 87, 65,149, 73, 70,213, 3, 52,187, 63, 98, +184,196,124,253,244,162,132,239,212,232,244, 86,233,231, 99, 45, 13, 92, 87, 27, 17,122,115,191,226, 38, 44,172, 31, 26, 13, 78, +200,114, 81,141,138,186,200,114, 91,131,207,199,220,144,218,142,254,202,157, 89,199,172, 37, 57,169, 13,222,157, 54, 87,156,228, +124,209, 53,148,211,122,238,203,138,254,141, 63,146, 55,123, 16,252,197,107, 90,179, 69,171, 56,131,107,113,127,187,228,119,240, + 35, 84, 37, 67,242, 66,243, 86, 74,200,145, 43, 46, 68,102,213,205, 43,146, 85, 81,253,145,190,172,254,216,162, 9,160, 93,206, +204, 16,197,205,184, 77,171,225,111,154,143,211,211, 80,141, 4,169, 74,205, 20,139, 14, 88,231,254, 16, 59, 33, 10,229, 32, 41, + 69, 32,120, 2, 78,135,101, 63, 27, 34,194,127, 10, 57,218,107,188,209,143, 34, 83,171,252, 37, 21, 7, 17,236,166,168,229,213, +170, 61, 51, 78,215, 11,139,240,236,232,123,149, 25, 90,121,160,239, 83, 67,191,234,214,116, 66,178,235,197,163, 32,114,228,180, +173,179,248,133, 35,138, 79,141, 58,232, 54,199,107,168,239,220, 21, 77,249,144,122,137,141,218, 30,207,198,182,192,115,134, 87, +144,159,144,138,161, 90,179, 29, 32,169,247, 69, 63,104,138, 37, 62,243, 95, 13,122, 71,211, 31, 79,142,161,157, 27,103,173,117, +252, 94, 36,112, 30,246, 39,193,144, 55,149, 77,122, 17,187,200,191,135,174, 18,130,156,186, 60,166,209,109,182, 64, 72,162, 91, + 4,133, 41, 84, 39,221,237, 63,105,215,209, 93, 70, 91, 64, 1,109,244,200,233,170,235, 12,249,251,126, 39,136,170,230,204,132, +185,145,184,134,219,146,226,156, 73,116, 36,172,164, 54,146, 57, 44,168,124, 91, 84, 15,102,199, 92,253, 82,148,166,199,130,220, +144, 17,142,138,162,185,187,112,185, 68,230,149,249, 77,186, 82, 18,130,242,150,225, 42,216, 41,102,129, 32,145,238,213,228, 39, + 44,138,226,119,203,222, 59, 14, 69,129,183,158,224, 40,217,107,204,116,138,208, 38,165, 32,211,106,127,171, 67,178, 2, 74, 80, +155, 43, 3, 25,202,238,146,172, 74, 76,135,202, 80, 1,242, 5, 18, 21,197, 39,122, 5, 85, 3,115,237, 30,237, 87, 53,177,100, +231, 80,163,220, 51,107,220,249, 2, 20,127, 55,229,121, 41,177,201, 74,115,226, 73,228,124,180,168,238, 64,216,145,250,116, 65, + 80, 10,188,164, 87,137, 93,217,206,241,203, 90,103,254, 58, 82,231,224,149, 16, 42, 27,248,147, 80,148, 16, 41,198,167,127,163, +221,168, 28,120,205, 48,178, 81, 85,214,115,234, 4, 73,186,249,247,116,174, 74, 8,161, 46, 21,143,188,181, 86,167,160,232, 9, +219, 86, 41,195, 0,104,135, 44,146,232, 44,238,212, 91, 59,151,107, 55, 23, 90, 82, 45,210, 26, 74,163,184,207,152, 27, 79, 45, +146,106,107,202,160, 29,200, 27,251,246, 58,117, 93, 24,241, 65, 53, 25,234, 23, 39,119,239,210,110, 87, 96,190, 57,124,178, 50, +244,203, 35,239, 17,230,113,252, 69, 45, 36,236,221,104,104,120,236,124, 53,100,218, 36,171,207, 28,141, 82, 5,179,182,185, 93, +185,197, 71,186,194,121,164,172,121,169, 74,146, 56,144, 72,167, 2, 9,251,164,113,210,112,171, 89, 81,101,100, 88, 49, 41,120, +206, 48, 92,185,178,182,227,189,184,243, 0, 11, 11, 34,128,128,163,210,159, 93, 53,110,160,235, 62,192, 2,181,125, 24,119,171, +181, 62,159,179,148,231, 25,167,108, 49,108,241,228,201, 67,168,111, 43,182,137,171,101,198,135,239,163,242, 80, 74, 92, 4, 3, + 85,182,232,218,161, 32,212,235, 31, 63, 14,195, 45,213,173,156, 11,104,182, 2, 22, 19, 25,118,143,204, 46,209,238,135,230,203, +110,245, 9,206,125,201, 38, 36,226, 3,127, 40,104, 3, 98,148, 9, 64, 79,128,233,184, 26,199, 29, 46,210, 94, 64,191,219,177, + 78,216, 70,176,213,202, 50,240,227,238, 43,144, 61,121,247, 42,201,155,246, 46,245,137,206, 41,254,109,123, 49,224,219,227, 59, +251,197,188,101,180,232, 90, 83,214,141, 4,151, 9,232, 2,117,160, 42, 53,197,155,185, 84,197,132,167,104, 45,160,212,170,195, +187,211, 49,187,189,147, 28,187, 72,142,133,150,109,205,196,150,202,144,242, 22,183,152, 71,148, 10,220,160, 77, 42, 73, 21,250, +235,177,214,254, 53,100, 5,151,147, 32,100, 91,181, 42,118,179, 32, 98,199,122,145, 21,129,229,220,228, 2, 66, 9, 53,242,210, +193, 79, 36, 56,149, 16, 21, 82,122,142,132,143,163, 67, 22, 77, 46, 10, 17, 93,191,218,174,226,207,238, 71,108,220,188, 73,228, +111, 86,230,217,141,115,113,102,165,105, 41, 62, 83,196,138,253,240,157,207,183,233,215,128,253, 80,244,140,177,114,142,109,122, +215,105,115,221, 46, 7,216, 78,190, 37, 76,157, 17,139, 78, 86,202,131, 42,125,207,195, 13,169, 41,223,221,175, 41, 20,235,193, + 68, 77, 69,103, 42,117,120,147,181, 63,134,100, 81,179,244, 29, 78, 84,178,113, 52,199,140,100,112,165,196,136, 31, 80,226, 93, + 8, 30,245,248,106, 38,162, 6,137,247, 39, 92,134,224,136,211, 83, 98,220, 60,166,249,173, 35,173, 84, 53, 90,209,180, 39,139, + 32,247,216,209,236,248,131, 40, 90, 72,113,194, 84,146,122,208,234, 66,110, 2, 48,136, 69, 49,233,129, 88,195,118,215, 5, 67, +139, 73, 66,235,184, 30, 58, 20,225,205, 14,202,220,168,247, 73, 63, 55, 14, 77,172, 14, 75, 66, 20,210, 28, 30,218, 29, 6,161, +168, 42, 32,106,148,237, 54,245,219,236,242, 99, 75, 85, 36, 33,196,174, 56,247, 43,195, 90, 51,144, 3, 69, 58,226,229,104, 56, +131,236,207,106,224, 43,242,210,106,181,131,224,160, 52,226, 96,132, 41,195,226,116,211,140, 90, 62,125, 45,227,178, 83, 71,146, +181, 58,158,155,208,244,251, 53,159,115, 68,186,150,212,238,171,123, 16, 44, 44, 89,222, 33, 79,113, 90, 17, 95,217, 10, 31,233, +209, 99,120,116, 51, 91,232,171, 44,146, 19, 98,233, 6, 83,201,252, 84,185,242,206,159,104, 10,160,209,167,112, 60, 20, 97, 4, +106,235,133,178,238, 82,204,152,123,199, 62, 90, 22, 61,196, 13, 70, 55,184, 32,162,236, 68, 50,142,222, 69,137,113,114,109,189, + 3,202, 45,252,180,132,143, 26,142, 85,253, 58,171, 27,136, 68,148, 18,237,134,207, 30, 19, 69,164, 30, 15, 70,251,190,244,158, +163, 79, 59, 9, 41,227, 4,126,197, 1,121, 37,158, 82, 31, 64,243,173,197, 60,149,237, 21,174,154,118, 17,170,150,192,143,228, +206, 70,157,106, 85,129, 9, 10,242,216, 67,181,247,129,160, 9,150, 78, 35,201, 47, 49,105,135,148,218,153,178,184,129,198, 58, +131,173, 87,168, 82,119,209,171,180,136,161,200, 37,236,208,166, 60,164, 53,198,142,144, 64,254,240, 26, 62, 44,202,105, 0, 86, +238,220, 92,154, 84,183,229, 44,129, 68,132, 43,233,211,228,130, 67, 41,104,157,112,247, 99, 74,191, 55, 37,197, 13,144,167, 5, + 79,237, 38,180,214,101,177, 46,152,234, 86,200, 87, 72,183,169, 47,197,124,142, 14, 72,173, 15,247,169,253, 26,157, 53,109,147, +243, 80,153,209, 67,201,172,182,166, 62,126, 4, 2, 23, 55,205, 11,168,166,212, 4,235, 82, 18, 36,178,128, 41, 31,184,183,229, + 53,129, 45,182,126, 41, 33, 92, 20, 7,133, 13, 53, 26,139,204,164, 84, 28, 7, 63,118,215,126,178,193, 67,149,101,165, 85, 67, +194,167, 70, 53,110, 41,110,100, 87,212,197,253,203,150, 28,197,238, 56,163,236,202, 10,118,158,202,245, 63, 81,212,177,169,105, +145,218,170,249,175,193, 87, 29,190,201, 28,187,220,228, 65, 66,170,218,136, 80,223,196,141, 92,157, 91, 36, 19,139, 28, 36,172, +250,246,251, 23,151, 18,239,239, 25, 90,144, 73,247, 29, 91, 20,252, 62, 42, 34,110,173,126,209,101,202, 61,189, 98, 75, 75,169, + 50, 18,147, 67,224,126,189, 80, 21, 49, 41,229, 50,142,247, 94,210,251,233,182,221,192,170,155,112,110, 63,169,215, 77, 1,241, + 49, 74, 18, 44,153,253, 60, 38, 53,239, 31,185,183, 34,133,228,203,252, 51,227,183,179, 67,207,171,108, 85,186, 75,133, 80,119, +174, 4,203, 31,116,228, 95, 92, 4, 71, 47,165,134,192,241, 33, 34,186, 62, 32, 6, 13,220,133, 96,114,235, 87,110,228,201,151, +150, 38, 68,228,145, 25,231, 20, 77,124, 64, 27,106, 54, 16,204,154, 48, 76, 93,194,182,179,113,101,135, 86, 42,143, 63,201,228, + 7,129,219, 66,170, 70, 37, 18, 80,112,160,100,113, 91, 22,104,246,148,117,140, 10, 62,145, 74,233,229, 61, 84, 60,190, 9, 35, + 60,181, 71,182, 99,104,152,194,127, 21,199, 18,149,171,250,191, 21, 0,213,156, 57,252, 73,172,142,136,138,112,212, 39, 7, 93, +208, 39,248,181, 20, 74, 35,251,173, 41, 35,244, 43, 82,253,199,199,247, 40,121, 92,211, 41,193, 46,182,236,214, 85,233,202,170, + 56,105,197, 70, 80,241, 38,181,251, 52,254,104, 33, 87,157, 36, 2,162,118,227, 24,187,204,205, 99, 71,151, 94,104,230,250,138, +186,208,146, 43,171, 50,190, 32, 34, 70,162,202, 46,107,219,139,141,214,227, 62,252,215, 35, 17,151,126, 93, 9, 3,175, 46,167, + 64, 25, 49,138, 36,168,117, 39, 23,192,239, 22, 92, 25,248,234, 5, 72, 43, 40, 35,233, 58,173,102, 76, 76,157, 19,202, 33, 74, +194,226, 93,109,215, 68,217, 92,170, 82,162, 10,134,244,220,106,173,196, 29, 81,225, 21,110,103, 22, 25,104,197, 97,219,216, 79, +227, 54,128,181,175,125,146,175,110,177,137,248,207, 98,156, 73, 0,160, 22, 56,143,192,200, 35,199, 64, 62, 91, 40, 42, 89,246, +212,106, 50, 59,156, 40,151,128,117,243,163,243, 89,239,148,158,229,250,143,107, 3,183,186,218,236,248,170, 4, 48,219, 41,227, + 73, 43,252, 71,188,199, 22,126, 37, 10,164, 26, 0, 19,210,149,169,215,211,127, 76,122, 40,196,233,240,181,142,251, 53,227,201, +249,118, 13, 61,170, 3, 85,110,250, 21, 98,233,129,246,253,172,158, 79, 52,202,152,225, 83, 62, 96,161,109,180, 0,157,193,241, + 81, 37, 66,187,237,174,183,168,252,114,101,209,244,209,178, 46,121,171,247,182,119, 75,101,229, 79,228, 25, 26,137, 97,181, 58, +219,105,112,212,149,132,249,105,219,125,192, 85, 77,126,141,181,153,105, 49, 96, 22,149, 68, 16,229, 22,177,223,240,185,119, 48, +194, 82,223, 22, 86,227,238, 44,208,161, 5,175,188,176,145, 80, 40, 79,135,143,188,234,102, 18,110, 41,133,145,117, 31, 33,205, + 49, 5, 66,126, 93,173,175, 45, 11, 5,196,147, 64,226,138,213,197, 1, 69, 39,225,223,115, 78,191,167, 74, 21,201,217, 41, 92, + 20,121,153,125,174, 4, 4, 77, 46,172,151,154, 66, 27,229,196, 81,197, 81, 35,143, 47,132, 82,132, 19, 67,191,219,167, 21,151, +224,135, 43, 64, 8,124, 12,182, 68,104,102,229,114,144, 18,218, 42,134, 20,190,161, 53, 38,161, 32,237,241, 10,239,214,154, 33, +172, 20, 19, 97, 81,102,103,173, 93, 35,183, 13,158, 44, 69, 90, 83, 85,184,173,139,109, 18, 86,120,131,176,240, 20, 30,222,186, + 66,160, 19, 27,221, 86, 29,250,191,219, 31, 74,213,109,224,153, 64, 81,110, 40, 26,124, 61, 82, 56,251, 0, 59,248,157, 89,162, + 61,168, 19,147,149,105,254, 95,183,184, 14,227, 19, 25,185, 48,252,155,187,109,190,136,136,124,188, 26,105, 9,230,181, 15,196, + 37, 6,139, 36, 0, 0,161,165, 65,213, 14,164, 36, 14,139, 91,167,109, 63, 50,189, 44,246,190,198,103,237,189,139,100, 73, 85, +142,246,197, 20,152,115,148, 18, 84,164,163,135,154,144,138, 5, 15,136,210,149, 34,187,208,235, 23,247,215,215, 45, 66,244,106, +186, 39, 78,190,128, 97, 45,199,155,113, 10,165,239,143,167, 12, 11, 18,181,252,205,162,231, 29, 86,244,176,168,233, 8, 74, 28, + 41, 66,136, 82,137, 11, 5, 66,165, 53,250, 78,181,241,122,156,143,204, 22, 6, 79,165, 41,176,252, 19, 35, 69,197,253,252,207, +254,110, 98,221, 82,210, 98, 68, 74,227,161,109, 41, 62, 75,174,182, 82, 1, 77, 58,146, 55, 39,173,126,189,117,184,214,131, 23, + 11,202, 51,168, 48,153,137, 46,197, 42,224, 88, 78,117,144,218, 25,158,235,170,140,201, 65, 90,124, 18,121,124, 65, 38,180,220, +251, 61,218, 28,236,114,158,186, 73,139,160,153,109,151, 40,180,220, 2,228,186,165,202, 88, 81, 83,123,146, 41,241, 83,245,248, +232,177, 67,176, 16,135,179,220,188,250,200,223,200, 33, 78, 75,182, 0, 79,146, 66,157, 77, 41,184, 41, 80, 35, 68,112,126, 96, +233, 70,249, 71,129, 70,229,231,215,204,205,134,173,242, 80,134, 20, 82, 27,113, 46,161,109,130, 62,233,220, 16, 70,194,157, 40, +125,154,181, 92, 34, 70,133, 14, 71,114,151,130, 90,219,199,175,204, 74,187,254, 27, 92,138,146,166, 18,209, 9,169, 59, 7, 16, + 19, 80, 69, 69,119,209, 5,100, 20,192, 46,228,244,245,141, 51,157,227, 74,187, 96, 87, 36,198,201,196,111,229,147,109,237,144, + 12,200,138, 3,146,120,213, 73, 87,196, 43,197, 94, 52, 59, 29, 87,234, 24,208,204,162,116,217,194, 65,190,222, 5, 88,133, 98, + 65,148, 92,223, 7,205,176, 41, 79, 91,175, 44,112, 40, 0, 52,234, 2,146,149,242,233,240,171,116,157,183, 30,222,154,249,147, +212, 94,159,151, 75,200, 21, 72, 14,208, 71, 2,168,217, 89,140,144,236,177,249, 86, 75, 13,166,220,215,220, 85, 29,127,220, 73, +241,214, 47,146, 9, 80, 14,152,176,187,124,166,173, 16,148,146, 84,249,185, 51,196,127, 96,170,186, 83,164, 8,148,163, 37,100, +127, 25,121,239,208,138,149,127, 8,211,109,182,176,127,181,215, 88, 89, 81,104, 35, 9, 58,113,238, 86, 30,213,202,243, 46,201, + 4, 19, 6,216,207,159,191,182,149,161,250,245, 70,169, 48, 70,140,146,139,127, 59, 11, 30,142,230,226, 65, 60,210, 63,179,162, +206,108,139, 35,162,159, 98,108, 34, 18,231, 57,241, 56, 66,214,107,253,106,116,213, 83, 55, 80,100, 26,109,138,124,143, 38,123, +167,240, 94,113, 59, 1, 77,130,180,111, 48, 50, 35, 50, 55,144, 54,164,227,162, 51, 32, 9,173,188,158, 32,117, 9, 59, 29, 66, + 51, 81,140, 73, 81,110,209,238,120,196,216,183, 86, 43,230,148, 7, 20,124, 57, 29, 52,134,229, 34, 22,203,174, 91, 46, 79,149, + 45,229,116, 4,168,123, 9, 53,208,219,146,113, 20, 26,239,112,106,124,184,104, 35,226, 92,134,220, 36,123,136, 58,156, 9,220, +130,155,174, 23,102, 16,227, 15, 53, 64,227,138, 77, 64,247, 4,232,230, 28,209, 35,193, 54, 76,109, 46,192,113,110,117,146,223, +154, 41,224, 80,154,127, 70,170,200,106,164,171,184,112, 85, 34,109,193,182,254,250, 91, 14,164,143,167, 79, 36,242, 44, 19,118, + 3, 5, 17, 98, 93, 88, 41, 60,230, 52,135, 5,125,201,210,155, 18,147, 50,142,182, 28, 91, 46, 75, 31,121, 77, 4,147,227, 64, +105,168, 72, 48, 81, 28, 86,118,254,218,212,135,209, 37, 35,116,249,202,161,241, 34,187,104,213, 51,234,148,254, 84,135,158,162, +109,203,205,122, 42,106,243, 79,158, 0,123, 2,168,117,106,150,130,174,163,246,246,197,114, 84,123,138,212,130, 28, 82,124,196, +143, 10,141, 90, 44, 66, 76, 84,252, 85,219,138,209, 34, 81, 81, 72,137,178,143,211,190,168,221, 0, 36, 20,235, 14,234, 53,158, +241, 45,188,136,121, 38,172, 21,249,138, 39,192,233, 8,135,116,242,142,137,186, 11, 15,202,201,164,160, 29,157,101, 75, 73, 62, + 42,166,165, 85,154,166,242,138,135, 59, 4,131, 34,207, 29,153,130,137,121, 78,169,100,244, 37, 53, 58,169,184,198, 68,132, 95, + 44, 50, 67,127,183, 83,109,235,114,248,221, 82,204,121, 8, 91,100, 86,156,107,173, 26,114, 53, 5, 10,117, 58,179,243, 14,220, + 69,201,240, 23,210, 5, 91,122, 63, 52,251,214, 83,165, 28,159,136, 30,194,129, 26, 54,146,169, 46,220,118,198,237,103,184, 38, +224, 1, 13,151, 67,106,175,181, 10,165, 62,205, 91,187, 48, 73, 12, 80,193, 37,119,191, 17,153, 15, 36,154,208, 77, 28, 90,148, +242, 64,175,141, 14,181, 49,110, 18,130, 82,169,111,244,213,117,149, 35, 30,151,102,144,126, 24,206,151, 0, 63,217,211,229,192, + 13, 80,182, 50,183, 50,252,183,206,237,136,186,210,175,199,230,105,227, 74,144, 53, 74,202,218,200,132,213,240, 37, 28,244,223, +115,143,109,178,187, 53,215, 2, 90,113, 10,152,226, 65,232,163, 82, 6,163,159, 29,218, 43, 84,150, 9, 79,188,114,224,229,147, +225,249, 84, 41, 92,174, 70,158, 63, 17,223, 85, 42,145,137, 40,140,191,110,240, 34, 68,202,237, 22,235,114, 66, 99,165,149, 45, + 92,124, 72, 27,147,165, 23, 47,226,144, 41,138,195,142, 39, 33,182,189,107,146, 15, 38,200,125, 39,251,101, 91,126,189, 14,226, +199, 68,224, 58, 88,207,163, 53,104,154, 82,165,124, 77,159, 45, 95,102,148, 1, 41, 20, 2,125,141,156,146,210,184, 41, 80, 82, + 22,227, 74, 66,122,239,200,106,113,153,174, 78,159,110,228,240,108,144,197,180, 89,120,143, 44,180, 69,126,132,129,215,235,208, + 60,195,199,189, 65,147,109,142, 45,170, 77,213,248,114, 72, 89,109,154, 55, 90, 80,168,130, 21,250,180,210,180,141, 85,141,129, +150,220,107, 23,183,183,112,157,127,105, 33, 42, 66,145, 13,175,160,157,207,219,161,221,144, 89, 74,170,244, 83,178, 59, 21,190, +200,204,139, 18, 16, 11,132,135,157, 86,213,169, 3, 85,236,182, 69, 78,184,106,180,163, 30,134,222, 44,185,203, 72,230, 18,227, +137,111,192,211,161,211, 69,202,150,208,232, 4, 11, 4,105,140, 69,190, 2, 3,169, 87,152,233,241, 60, 78,195, 86, 1,125, 18, + 0, 5,101, 73, 67, 23, 37,181, 17,208, 21,201,132,151, 41,189, 19, 74,211, 85,167, 91, 20, 50,201, 46, 20, 64, 23,115,187, 36, +127,134,168, 77,106, 64, 72,218,167,136, 39, 79, 93,111, 33,226,154,208,241, 95, 27,187,211, 45,251,255, 0,169,140,167, 33,134, +180,173,148, 92,222, 75, 47,169, 10, 74, 82, 67,198,170, 9, 59,142, 39, 97, 95,167,174,250,250,255, 0,211,180,121,125, 62,152, +183,242, 15,193, 86,172, 49, 11,167,251, 55,153,255, 0,151,240, 24, 13,184,232,120,178,147,242,204,236, 19, 66,121, 56,226,234, +107,236,255, 0,161,212,239,134,233, 46,139, 30,205,177, 70, 15,118,100, 41,137, 13, 52,178,134, 30,243, 93,109, 1, 84, 80, 73, + 71, 34, 71,179,199,221,166, 20,186, 94,105, 68, 45,153,124,215,144,211,112, 1, 72, 44,150,214, 82, 79,223, 36,148,167,109,213, +184,229,185,210, 49, 77,184,175,217,125,201,135,102,113,134, 84, 20,124,162, 11,105, 81, 20, 90,248,113, 46,174,189, 72, 27, 15, +163, 78, 41, 37, 49,181,138, 26,174,233,166,253,124,102, 85,201,197, 22, 34,175,204, 76,118, 1, 82,190, 2, 66, 84,178,162,132, +129, 83, 94,163,217,182,167, 26,140, 66, 28,173,117,234,251,220,104,172, 72,109,164,165,247,165, 58, 73, 80,142,164,164,167,145, +226,148, 10, 37,193, 82, 60, 6,250, 81,165, 52,172,101, 58,204,243,249, 92,245, 89,165,195,185, 67,157,229,143, 42, 58, 28,139, +230,148, 36, 84, 16,137,102, 57, 52, 78,228,147, 79, 30,154, 28,154, 60,199,223,253,169, 2, 74, 27,158, 88,123, 85, 18, 63, 27, +238,116,220, 23,194, 75, 72,128,152,223,204,228, 41,124, 2,120,133, 90,220,117,144,175,239, 56,157,252,116,245,219, 51,194, 46, + 61,195,239,215,238, 80,176, 1,198, 67,237,246,237, 87, 15,163,203,247,111,196, 6,113, 12, 55, 33,188, 92,103,150,203,234, 71, +242, 4,182,136,237, 54,247,146,151, 20,148, 92, 28, 8, 73, 95,237, 43,175,137,213,108,136,216, 11,202, 35,223,253,138,254, 53, +145,219,161,116,225,223, 88, 56, 12,232,225,135,165,155,149,185,130,159, 33,106, 73,143, 44, 33,179,201,106,109,232,206,147, 95, + 49, 95,126,187,248, 26,109,166,141, 70,200,180,226, 62,222,196,122,242,236,162,123,161, 34, 10, 78, 86, 33,140, 92,160, 38, 44, + 91,178,212,193, 72, 92,153,119,107,179, 97, 17,155, 82,210,130,162,103, 45,182,127,173, 67,200,154, 13,245, 60,108, 72,198, 78, +223,218,167,159,215, 50, 44,134,217, 75, 79,114,161, 59,185,216, 62,214,220,242,251,109,130,235,158,183, 62,227, 25,215,190,102, + 14, 53,107,145,114,150,144,133, 9, 27,249,238,198, 97,127, 10,184,146,135, 8,168,214,209,178, 77,164, 91,196,174, 76,252, 69, +201, 79, 88,170,253, 50, 71,181,181, 0,204,200,223,118, 50,214, 30, 90,227,219,162, 56,133,110,207,196,201, 91,224, 84,154, 83, +204,241,213, 50, 44,126, 74,240,150,136, 14, 73,153,246, 94, 53,208,255, 0,148,236,104,118, 96, 43,142,185, 23,104, 14,189, 37, + 20, 36, 85,167, 19,113, 28, 9, 20,220, 14,186,177, 8,207,153,251,255, 0,177, 87,145,117, 75,101,136,135,116,187,159, 54, 39, +152,226, 84, 90,120,187,243, 42,232, 2,146,161,230, 62,233,161, 73,246,234,208, 85,100,183, 68,198, 45, 65,176, 27,132,195, 78, +113,170,219, 73,146, 10, 72,253,186,121,148, 33, 73, 62, 30, 58, 36,102, 66,138,247, 54, 19,137,113, 49, 88, 90, 80,144, 66, 31, + 66,138,156, 64, 81, 2,138, 73, 85,126, 21, 39,127,183, 87,171,185,248,164, 10,232, 63, 72,153, 77,211, 0,202,224,221,173, 92, + 25,184,132,161,185, 12,154, 56,218,130,200,242,156, 79, 32, 9,222,169, 53,175,215,163,109, 4, 35, 87, 38,213,118,237,213,184, +157,230,129, 14, 29,234, 43, 79,200,121, 44, 74,136,254,193,228,164, 14, 78,165, 37, 32, 21, 36,114, 27, 43,122, 10,208,109,175, + 55,250,153,210,142, 70, 8,182, 48,221, 58,207, 30,108, 70,190, 58,142, 8,215,180,194,172,178, 30,202,180,111, 51,236,183, 52, +254, 19, 1, 74,110,190, 28, 58,107,231, 8,230,179, 42,134, 44,191, 49,108, 35,229,242, 56, 81,153,255, 0, 4,148, 9, 73, 30, +197,183,237,213,159,222,143, 44,191, 21, 3, 88,117,181, 18, 76, 94,238,155,164,132,249,111,173,214, 66,138, 77, 2,130, 77, 1, +213, 27,166, 37, 22, 72, 65,149,133, 38,252, 73,201,110, 50, 69, 30,146,160,194, 9,234, 65, 78,218,171, 42,192, 98,154, 4,164, + 11,230, 89, 21,216,177, 99,161, 60, 75, 73,242, 56,123, 77,116,214, 86,225,209,183, 41,179,158, 22,236, 93, 18, 16, 77, 29,124, + 1, 79,234,145,170,245, 69,194, 97, 36,218, 45,145,215,135, 67,117, 34,175, 33,196, 82,130,181, 36,238, 53, 86, 37,236,218,173, +158, 8, 5,202, 83, 98,238,182,194,122, 58, 2,171,211,125, 90,219,162,104, 22, 82,187,159, 46, 27,118,215, 80,205, 60,197,121, + 72,110,190, 0, 13,255, 0, 78,144, 96,162,101,197, 37,184,135,215,108,105,213,130, 82,174, 65, 95, 81, 52,212, 52,116,209,146, +133,102, 66,231, 74, 51,218, 37, 76, 51, 84,148,255, 0, 85, 67, 96,116, 82, 26, 73,160,204,183,220,242, 98,205,214, 12,126,123, +115,109, 39,125,183,165,117,116, 65,194, 25,147, 21, 97, 68,204,162,184,187,160,113, 85, 49, 16,132,178, 9, 62,205,233,170,118, + 86,197, 20, 76, 50, 31,219,169,241,110, 18,230, 75, 89,170, 86,213, 72,246, 83, 64,176, 22, 81, 50,209, 62, 63, 29,187, 83,176, +210,148,208, 57, 25,101, 84,241,218,163, 66,142,165, 18, 50, 12,150, 98, 92, 26, 45, 41,149,109,230, 36,166,158,193,207, 69,188, + 50,103, 96,183,225,179,153,129,116,114, 57,217,182, 92, 86,254, 31, 16,169,208,251, 10,140, 75,130,135, 89,173, 17,111, 57, 60, +216,136,253,215, 53, 60, 43,208,111, 93, 78,115, 41,226, 3, 39, 27, 62, 49,106,176, 95,225,197,121, 35,229, 93, 87,150,245, 7, +138,197, 71,233,209, 43,184,152,169, 0,225, 34,221, 97,179,143,100, 25, 62, 62,164,241, 60,202, 26,175,188,114, 31,163, 70, 58, +136,148, 58,248,144,150,176,139, 4,235,155, 87, 80, 83,248,172, 54,151, 27, 39,233,175,244,106, 82, 97, 23,228,144, 5, 60,150, +191,151,196,139, 61,123, 72, 45,164, 87,233, 20, 58,163, 68,183, 76,163, 29, 2,253,153, 52, 93, 44,209,173,204,167,248,198,214, +183, 0,241, 41, 59, 29, 28, 65,204,148, 39, 50,202, 10,159,105,120,220,187, 34,155,170,202,170, 42, 63,101, 39, 81, 49,218,150, +231, 1, 53,226,247, 72,146,109,177,172,206, 10, 52,147,229,168,127,179, 93, 68,196,135, 42, 22, 73,248, 33,240,113, 6,217,254, + 99, 25, 45,252, 81,143,204,176,145,214,149,169,211, 88,238, 59,208,183,104,202,146,239,181,136,191,220,152,138,242,207,202,186, +208, 27,244, 53, 7, 91,152,179,219, 6, 76, 75,164, 14,208, 90,151,143,222,114, 8,171, 20, 74,124,199, 19,244, 19, 93,107, 76, +137, 49, 85,200, 36,163,243, 46,190,126, 46, 44, 47, 43,224, 91, 74,113, 73,246,239, 93, 6, 48,221, 99,170,242, 59, 87,172, 99, + 55,115, 21,237,211,174, 45, 92, 95,152,191, 33,173,255, 0,103,113,165,100, 55, 76,162,137,176, 65, 33,101, 10, 93,202, 27, 15, +170,170, 75,156,134,250,173, 26, 82,243,139, 43, 41,171, 53,226,101,198, 45,249,214,202, 33, 33,131, 69,171,165, 58,255, 0, 70, +148,107, 1, 42,237,116,225,219,233,237,182,204,137,107, 31, 8, 79,154, 79,182,134,137,213, 57,212,232,145,177, 84,221,227,157, +115,114,234,176, 16, 67,143, 60, 72, 20, 61, 41,162,209, 21, 9, 76,234,162,226, 98,224,195, 48, 86,186,249,109, 40, 62,253,124, + 1, 86,218, 29,209,116,106,166, 74,182, 75,112,149,119, 3,255, 0,103, 76,114,162,105,253, 96, 20, 63,250,186,173,183,226,218, +166,250, 32,223,207, 29,110,230,227,209,205, 86,147,197, 60,124,106,116, 59, 70,138,123,147,166, 37, 61, 50,146,108,207,213, 42, +112,165,247, 20, 60, 56,158, 90,175, 92, 95,197, 28, 77, 66,201,243, 6,239,217, 28,215, 35,170,158,119,224,183,255, 0,171, 31, +211,162,249,111,162,111, 53,148,236, 74,106,114,107,252,108, 69, 43,170, 85, 13,194,177, 95,218, 52,240,210,219,182, 42, 50,181, + 1,141,117,105,187,219,184,195, 27,165,151, 60,144, 7,245,129,167,235,211,192,104,233,183,234,156, 46, 87,132,227,113,139, 46, + 56, 12,181, 32,165,197,215, 96, 72,233,168,100,190,129, 60, 78,133,112,103,174, 47,204, 14,251,141,181,117,236,111,104,166,170, + 28,151,148,166,175, 87,136,110, 36,187, 78,133,150,150, 1,227,239, 41, 85,124, 53,239, 30,134,244, 21, 80,136,201,201, 2, 69, +190, 24,158, 3,188,191,240, 80,149,132,174,100,236,142, 30,246,107, 53, 62, 77, 20,181,172,124, 11, 5, 75, 89, 39,175, 31, 19, +237, 58,245,203,164, 33, 30,192,137,143, 94,249, 43,190, 28, 3,143,220,156,105,198, 15,203,180,144,133, 7, 5, 19,181,118, 0, +144, 60, 55,214, 93,146,220,181,192,100,157,127,202, 34, 91,239,119, 15,147,120,188,133,213, 33,100,242,169, 85, 83,197, 62,192, + 1,254,141, 22, 32,178, 25,152, 5, 48,227,157,193,153, 28,121,150,167,121, 48, 92, 89,101, 78,113,168,110,137, 71, 21, 1, 95, +136,154,215,221,246,105,252,176, 82,243, 59, 17, 40,208, 46,247,187,143,241,199,204,148,175,141,146, 55, 37,197, 40,130,120, 80, +147, 68,212, 0,117, 45,194, 42, 1,228,181, 77,197, 94,180,180,155,147,114, 35,196,104,164,252,114,127, 17,250,162,170, 39,202, +109, 46, 41, 39,217,204, 36, 29, 39, 37, 66, 81,100, 38,109,233,167, 96, 59, 25,165, 73,153, 85,164, 9, 19,158,118, 59,101, 52, + 28,136,143, 25,202,133, 87,196,186,164,211,110, 58,127, 44,248, 33, 25,251, 84,123,142, 75,153, 94,210,187, 29,185, 42, 92,153, + 8, 66, 83, 14, 19, 73, 97,142, 35,238,169, 77,176,150,219, 38,130,165,100, 87,196,159, 29, 74, 85,198, 33,202,143,152, 74,109, +197, 59, 65,143,199, 84,105, 25, 74, 69,254,254,143, 49, 78,194,140,242,147,110,105,194,132, 4,121,178, 26,162,222, 32,214,168, + 96,161, 36, 80,135, 79, 77, 2,118,158, 3, 69, 40, 71,181, 23,200,175,221,200,176, 45,153,152,163, 47,252,149,181,149,187, 2, +209, 99,105, 45, 70, 62, 84,119, 56, 1, 25,158, 40, 91,170, 36, 81,106, 5,100,154,146,118,213,123,108,132, 3,159,127, 18,181, + 48,105,178,233,109,128,114,135, 99,221,247,184, 95,155, 91,239,220, 57,200, 87,148,102, 71,116,240,117,146,211,129, 38, 42,218, +112, 85,178, 7, 34,160,104,121, 31,102,130, 50, 98,120, 43, 6,131, 18,210,112, 71,114, 27,153,250,142,197,239,247,223,228, 44, +220, 82,140,189, 77,134,132, 37, 19,229,182,137, 41, 82, 93, 81,242,209, 74,213, 3,198,162,160,208, 2, 53,119, 15, 32, 18,203, + 63, 54,141, 28, 23, 75,183, 56,121,157,162,247,111,204,242,103,158,127,230, 19, 34,224, 91,112,135, 89,161, 43, 4, 20, 56,158, + 34,169, 9, 32, 83, 98, 61,167, 86,188,193, 45, 22,118,194, 3,166, 11,111,117,238,147,218, 93,151, 47,106, 37,205,165,184,181, + 50, 93, 79, 37,213, 9, 46, 37, 44, 72,110,142, 33, 59, 38,129, 36, 36,251, 60, 52,226,174,245, 19, 61, 20,107,153,199, 92,243, + 47, 86,133, 57, 18,115,203, 67,170,109,254, 78,178,150,254,237, 82,235, 73,220,212,116, 40, 20, 29, 78,136, 34, 80,204,144,140, +138,209, 38, 35,174,173,208, 12, 3, 85,124,210,126, 38,206,192, 18,151, 16, 74, 8, 73, 32,236, 79,244,104,142,132,232, 93,203, + 34,183,139, 75, 78, 52,178,155,211,116, 1,230,143, 54,212,129, 74, 86,149,246,131,167, 73, 2,183,228,143,205, 72, 18,104,151, +146, 20,145,196, 26,146,147,176, 62,207,134,159,103,191, 70,137,100,149,173,219,108,132,218,236, 17,110,109,173,104,226, 18,182, + 92, 81, 53, 40, 43, 34,160,143,101, 6,175, 86, 75, 39,117,217, 30,153,187,213, 37,219,133,165, 23,103, 74, 45, 50,155, 75, 75, + 43, 52,226,132,169, 96,169, 36,214,132,111,168,117, 44, 24,102, 99,217, 68,254, 89,134, 40,149,201,244, 87, 86,104,216,121,217, +215, 93,139,234, 81, 98,187, 86,131, 99, 90,107,226, 30,163,143, 44, 91, 37, 89,227, 18, 71,187,181, 13,181,100,150,196,159,229, +151,251, 99, 75, 20, 75,137, 88,229,237, 73,213, 80, 73,138,115,162, 95,207,194, 99,231,209,219, 99,103,129, 73,175,215, 93, 72, + 19,181, 74, 33, 53, 94,165,170,245,112,126,197, 0,132,190,162,203,155,120,154, 10,215, 80,149,191, 10,109,136, 54,109,219,191, +254, 56,203,136, 60, 27, 80, 11, 52,240,113, 61, 70,161, 94, 75, 64,132,251, 29, 19,201, 45,254, 69,174, 11, 42,111,248,101,132, + 21, 87,193, 64,141,244,209,155, 40,195,138, 32, 50,133, 69,198,141,184,241,167,156, 10,106,119, 0, 1, 67,250, 52, 26,225,241, +186, 52,229,162, 89, 92,137, 13,203,112, 46,138,117,110, 9, 13,215,196,120,234,228, 75, 22, 81, 18, 91,114,185,137,190, 88,207, +148, 65,146,148, 45, 65, 62, 60,135, 81,161,109,208,120,162,187,132, 59, 4,147, 26,245,111, 98, 28,149, 0, 27,115,202,112, 43, +192, 29, 70,208, 65,117, 16,206,163,227, 80, 17,109,191,221,237,174,142, 36, 41, 71,143,129, 65,220, 40,125, 35, 86,164,117,140, +144, 99, 38,209, 37,184,153, 73,201,146,212,143,136,199,125, 42, 29,119, 70,244, 58,191, 13, 84, 38, 83, 52, 91,202, 92,159, 60, + 48,186,249,169, 33,193, 95, 16, 42, 52, 11,126, 19,170, 81,147,169, 61,150,188, 56,234,231,182,163,241, 6,143, 31,162,180,211, + 91, 72, 42, 30,103, 37,107,119, 82,249,252,162,101,172, 36,241, 73,132, 84,163,225, 82, 41,170,162,141, 84,163,102,170,173,198, +242,215,174, 55, 25,237,242,171,113, 26, 82,235, 95, 10,215, 69,186, 3, 78,245, 41, 72,144,136,193,203,218,139, 45,114, 22,177, +193, 73, 75,138,223,218, 41,161,249, 90, 38,223,162,100,236,211,138,187,228, 23, 21,180,126, 58,126, 25,254,205,107,166, 48, 96, +161,231,104,139, 74,201,214,238, 86,195, 75, 53,108,186,144, 15,128,224, 64,208,233,135,194,141, 93,156, 86,159, 81,204,194,181, +102,237, 93,173,228, 40,221, 89,109,106, 66,119,170,210,154,104,210,137,224,137, 68,184,173, 93,183,141, 25,200,115,103,182,143, +142, 65,106, 45, 0,216, 15,218,211, 73,216, 5,103, 69,231,185,147, 35, 65, 75,109,182,186, 71, 72,242,154, 9,241, 41,208, 43, +172,196,184, 77, 50, 2,141,132, 20, 75,200, 27,184,201, 63,194, 50,148,165, 93,105, 90, 84,234,112,113, 36,206, 19, 5,190,201, + 14,226,151,167,172, 4,183, 38, 74,144,159,247,116,169,219, 76, 11,201, 65,150, 98, 48, 25,114,238, 25, 4, 7,196,147,196, 31, + 96, 26, 45,131,114,128, 26,166,139,162,217,180,229,237, 60,186,121,114,227,173,133,163,192, 21, 10, 15,174,186, 16,131,233,204, + 33,152,185, 85,110,117,132,162,255, 0,156,198,183, 13,220,138,142, 33, 94,210, 42,105,171, 66,237,170, 49,139,170,158,225,137, + 73,131,145, 60, 88, 28, 27,146,167, 97,184,174,149, 60,182,253, 90,212, 22,238,128, 80, 43, 85,199, 29, 76,139,106,165, 4,240, +125, 46,124,138, 79,129,218,186, 63,157,229,203,185, 71,202, 18, 14,128,228,184,132,233, 24,116, 71,208,133,121, 17,229, 41, 1, + 59,252, 84, 36, 29, 40,100, 13,202, 18,172,112, 90, 15,110,174,163, 52,138,226, 9,254, 88,176,208, 65, 31,247,135,239, 15,171, + 74, 23, 3, 22, 79,228,133,115,222,140,152, 88,195,214,148, 19,241, 22,153,108, 87,165, 15,196,126,205, 82, 22,124, 78,150,198, + 9,163,183,214, 59,124,155,108,132,164,209, 12, 45,164, 62, 79, 66, 54, 52, 26, 5,150,180, 84,227, 88, 1,210,142, 69,138, 65, +200,178,233,211,222, 0,196,142,178,150, 18, 63,172, 18, 55,253, 26,140, 45,104,167, 33,212,140, 59, 13,183, 57, 99,188,206,125, +158, 49, 90,101, 9,100,245, 37,100,255, 0, 70,166,117,101, 24,150, 40,191,242,246,133,183,205, 8,252,115, 23,200, 35,246,168, + 5, 1,250,104, 78,153,254, 55, 82,228,201, 58,199,108, 90, 20,229,229,223,240,229, 94, 90, 43,244,245,251,116, 57, 65,194,145, +237, 77, 45, 93,224,227,246, 11,197,205, 95,226, 18,218, 89,109, 71,175, 35,215, 77, 85,108, 82,220,171,152,185, 23,159,145,197, + 17,149,248,104, 37,199, 20,125,157, 78,143, 93, 46, 80,141,154,166,255, 0, 79,119,227, 51,186,151, 44,157,127, 13,182, 20,103, +212,154,157,190, 20,215,245,234, 82,164, 51, 40,206,106, 47,107,163, 61,120,187, 28,157,241,248,151, 91,130,153,140, 61,169, 14, + 18,163,191,187, 67,216, 61,200,206,144,189,126,247,230, 71,104,240,217,242,236, 13,149,221,156,121,113, 34,184,231, 20,180,133, + 1,197, 74,248,143,196, 71, 94, 32, 19,238,215, 87,233,111, 77,142,167,153, 88, 37,163, 18, 9,239, 31,109, 31,146,104,201,194, +249, 77,114,186,203,201,178, 39, 95,150, 84,236,151,157, 83,143, 62,225,161, 90,214,162,165, 40,129,225,236, 3, 95, 80, 68, 70, + 33,162, 52, 78,186, 71,209,254, 57, 5,203,147,114,219,125, 49,173,172,165, 38,108,165,166,135,143, 45,208,149, 43,161, 87, 67, + 78,131, 84, 51,102,118,178,212,193,135, 53,208, 57, 4, 59, 6, 85, 31,249,133,133,228, 27, 75,238,169,176, 29, 9,109,110,165, + 53, 66,120,214,138, 0,159, 15,139,109,102, 86,241,226, 53, 90, 83,105,112, 85,141,219,210,244,220,134,238,226,109,229, 75,101, + 78,126, 31,201,130,180,212,157,202,146,149, 2, 0, 52, 31,209,171, 95,187,136, 26,170,199, 24,201, 15, 95,105,239,125,189, 44, + 53,120,138,225, 66, 79, 52, 54, 17, 84, 4,244, 7,225, 0, 84,168, 84,147,189, 6,137, 27,227, 62, 9,188,131, 13, 10,155, 3, + 32,184, 59, 29,110,160, 41, 9, 75,161,214,151, 66, 43,193,202,129,176,222,181,210,112, 74,147,118, 40,162, 45,219, 45,146,139, +124, 6,202, 91, 1, 74, 90,148, 43, 85, 36,114, 34,131,112, 18, 18, 52, 81, 96,142,168, 6,162, 84,137, 29,189,189, 76,101,181, + 58,215,150,149,172, 15,133, 60,148, 91, 69, 82, 13, 60, 54,212,127,113, 16,162,113,202,149,137, 96,215, 31,154, 84, 63, 44,114, + 42, 83,170, 6,159,136, 60,190, 92,150,161,186,184,210,160, 86,130,157, 55,211, 89,120, 67,242,153, 89, 56, 6, 60,234,165, 51, +107,130,218,190,101,194, 67, 32, 2, 64, 37, 66,174, 29,170,122,236, 61,192,106,140,166,250,164, 32,228, 5,222, 62,153,127, 45, +123,157,239, 5,133,124,117,170,221, 33, 72, 23, 55, 28, 88,175,157, 84, 81, 64,211,160,166,201, 10,165, 6,185, 62,165,212,140, +165,182, 60, 23, 97,209,236,142, 28,132,228, 89,211, 95,168,159,202,195,208,215,122,109,105,188,119,119, 23,105,156,181, 60, 60, +217,241,218,122, 28,197, 20, 14, 52, 84,168, 74, 67,133, 52,240, 42, 35, 85, 33,146, 64, 12, 72, 43,183,187, 43, 31, 40,255, 0, + 86,168, 74, 61,174,210,247,134, 63,122,226,159, 80,222,135,189, 47,246, 66,249,106,199, 59, 27,142, 49, 13,165,190,149, 73,152, +231,157, 41,229,178,133, 5, 31, 49,233, 10, 91,138, 28,146, 58,171, 91,253, 54,102, 71,113,119, 11,151,245, 21,152,213,213,229, +211, 24,197,251, 56,251,248,253,233, 7,188,157,178,145,114,176,166,222,252,118,209, 62,221,205, 13,183, 80, 20,228,117,149,121, +106, 72, 32, 18, 66,118, 62,253,107, 71, 37,164,235,140,157, 78, 25,115,190,111, 98, 94, 61,123,122, 53,176, 4, 41, 0,150, 67, + 73,160, 80, 73,228, 80,164,138, 84,210,190,250, 82,154,216,166,123,128, 43, 46,234,246,173, 22,151,228, 48,133,189, 25,196,200, +140, 88,243,156, 65,113, 65,104,228,119, 29,118, 32,166,135,109,252,122,234,194,172,130,187,220, 9,182,235, 89,143,107,150,181, + 91,138,130,100, 49,181, 23,205, 9,167,194,107, 90, 5, 83,137,168,253, 26,102,116,146,180,121,220,175,207, 52,195, 73, 49, 29, +160, 79,151, 84, 5, 85, 69, 73, 60, 62,239, 79, 4,129,190,164, 2, 98, 81,123, 52, 64,227,222,100,149,121, 47, 46,165, 47, 20, +172, 22,235, 80,174, 98,170, 27, 84,251, 58,104,160, 38, 37, 88, 56, 94, 83, 17,187, 57,176, 92, 30, 10, 82, 63, 21,135,145, 68, +252, 41,226,162,129,239, 27,170,158,237, 91,174, 65,146, 26,171,155,178, 89,155,238,221,161, 69,134,164,252,160,243, 18, 16,190, + 74,223,239, 37, 41,167, 77,247,213,200, 23, 10, 97,118,109,166,246,153,214, 73,141,169, 1, 7,130, 21, 64,165, 16,162, 18, 62, + 33,200,158,181,250, 61,154,248,143,213,122,103,228, 0, 27,250,146,237,254,241, 72, 29, 84, 44,186, 60,119,114, 59, 84, 8,224, + 37,193, 24, 40,123,121, 84, 40,141, 99, 68, 52, 18,117,170,253,134, 27,213,202,101,194, 48,229, 57, 8, 14, 68,246,159, 41, 28, +149, 77, 70, 51,224, 20,193, 98,160,216, 99, 93, 32,223,226, 95,148,138,161, 43, 66,164, 87,216, 60, 62,173, 86,175,230,144, 70, + 58, 4,195,155,228,208,100,221, 16, 24, 72, 74, 82,162,149,143, 97, 52, 35, 77, 85,127, 55, 98,128,146,215,145, 74, 77,194,199, +252,169, 73,254, 37,149,133, 33, 94, 36, 40,109, 77, 16, 6, 1, 11,154, 64,186,189,114, 72,101,100,144,252,117, 40, 56, 61,161, + 39,253, 26,183, 16, 1,241, 77,169, 10, 68, 59,138, 29,129, 30,114,207,196,219,171, 64, 81,254,170,199, 77, 53,240, 32,104,161, + 92,220, 33, 50,175,111, 66,159,243,169,168,142,149, 41, 15, 39,217, 95, 29, 40, 2,116,237, 86, 1,209,120,183, 37,235, 13,217, + 78,199, 81, 85,158,119, 23, 25,115,122, 5, 19,186,126,157, 30, 85, 2, 21,121, 88, 68,147, 66,146,185,114,147,127, 64,254, 45, +176, 35, 72, 72, 31,121, 42, 27, 29, 13,158, 32,118, 40, 74,205, 82,102, 81, 9,216,193, 87,150,198,236,184, 90, 89, 31,213,174, +172, 85, 39,100, 87,112,132, 90, 25,186,177,150,188,134, 18, 87, 22, 83, 62, 98, 58,144, 84, 6,227, 71,201, 2,202,251,194, 29, +113, 32,167,142,218, 89, 83, 8, 92,110, 73,217,159,149, 90,211,238, 88, 59,131,170,248,150,249,145, 99,196, 40,219, 86,169,187, +188,247, 56,243,112, 88, 55,244, 26,173,112,208,211,103,222, 54,167,232,209,204,117, 85,193, 98,169, 12,110,245, 50,217, 34,232, +130, 42,228,166,210,210,125,212, 21, 35, 70,182,160, 68, 74,181, 18, 74,223,112,153, 62, 28, 71, 31,126,160, 45,180, 4, 39,127, + 29, 52,107,213, 8, 59, 21,109,250,112,184,202, 51, 46, 75,105, 63, 28,120, 60,137, 61, 10,202,122,111,170,214, 86,132, 11, 13, + 80,139,230,102,109,205,176,227,191, 12,245, 56, 92, 80, 61,119, 61, 53, 8, 86,202,221, 71,159,106,131,147,101, 23, 12,134,249, + 9, 79,184, 92,117,161,201, 38,181,162,148, 40, 0,211,144,218,162, 66, 65,149,161,136,121, 24,254, 32,220,101,124,119, 5, 15, + 49, 67,216,165,253,209,170,224,110, 82, 22, 42,239,184, 89, 35,106,184, 55, 25,213,243, 48,194,138,192,232, 92, 89,160, 31, 86, +141, 40, 48, 79, 41,186, 98,195, 93, 74, 45,140, 14, 84,248,121, 60,125,171, 86,244,213, 81, 6,114,152,205, 24,183, 94,156,102, +226,197,177,213, 81,182,185, 73,113, 62,196,251,254,173, 60, 32,159,204,209,106,192,110,174, 79,203,229, 95, 66,138,109,172,173, + 74, 4, 86,132,141,205, 52,113, 29, 19, 25, 50,147,118,202,156,151, 61,119,103, 84, 75, 65,192, 25, 29,119, 42,219, 65, 33,181, + 77, 25,144,131, 74,202,213, 23,185,101, 42, 53, 45, 4,184,225,247, 41, 52, 58, 30,215,131,246,167, 18,100,181,156,185, 25,118, +247, 87, 25, 35,230,155,150,167, 57, 10,116, 59,235, 66,191,132,109, 42, 0,169, 42,183, 64,149,133,198,147,194,146, 22,175,155, + 89, 63,214, 73,212,140,247, 58, 78,179, 33,143,110,143,111,249,116,182, 63,151, 37,191, 60, 5,116,243, 28,219,245,232, 85, 59, + 38,148,156,186, 93,145,113,182, 34, 93,190, 35, 31, 2, 99,172,243, 39,127,138,149,174,137, 45,206,158, 51, 68,114, 76,190, 59, +209,235, 21, 53, 17,192, 91,135,250,196,154,105,246,188, 89, 64,241, 91,187,119,220, 97,111,122,227, 26, 75,149,130,150,139,197, + 53,175,199,225,166,242, 92, 0, 82,148,217,121,181, 95,227,179, 1,153, 79, 40,243,125,215, 30,122,157,104,170,208,104, 83,210, + 64, 36,250, 38,158,218,220, 24,188, 89, 23,109, 70,200,124,184, 72, 63,217, 86,195, 78,100,210, 66,226,189, 38, 74, 63,205,203, +177,126,207, 36, 48, 15,254,173, 71, 76,220,212,183, 37,107,220,208,139, 76, 75,109,176,127, 15, 82,250,192, 31, 17, 0,237, 95, +175, 86, 99, 29, 64, 41,237,249, 82, 94,125,149, 62,206, 36,251,110, 57, 71, 29,123,226,247,211, 86,171,168, 25,170,190, 99, 4, +191, 21, 19,109, 24,172,139,212,138,166,227, 36, 37,166, 18,175, 15, 51,253, 90,182, 34, 4, 73, 74, 32,232,172, 46,215,199,122, +217,219,235,204,200,130,146,164,182,220, 52,171,253,231,222,233,172,201,216,192,149,118, 53,185, 76, 86,199,173,248,163, 22,169, + 16, 71,154,171, 52, 55, 36,169,132,169, 40, 30, 98,200, 5,199, 22,175,133, 8, 21,169, 42,235,224, 10,168, 11, 98, 86,103, 31, + 31,179, 14,243,253,188, 18, 60, 89,124,200,245,169,221,171,159,118,123,175, 41,232,211,156,184,219,161,169,200,209,156,230,175, + 32,173,106,228,234,163, 55, 64, 16,217, 86,194,191, 17, 2,170, 36,239,175,166,125, 25,210,191, 97,131, 16, 99,182, 82,212,246, +235,219,223,248,112, 83, 17, 84,196, 43,104,136,191, 63,133, 79, 34,165,169, 98,133, 70,155, 0, 20,122,123,117,213, 41, 0,202, +219,237, 85,202,245,100,100, 50,228,215, 17, 1,208,135,223,102, 58, 90,224,164,175,227, 74, 84, 86, 43,191,142,199, 64,178, 59, +149,218,100, 98, 21,163,134,228,178, 27,187, 25, 43,117, 1,197, 35,139, 97,117, 79,146, 9, 7,224,107,116, 18, 61,201, 26,132, +171, 12,143, 27, 53, 86,166, 37,147,223,236,252, 92,199,102,182,167, 1, 42, 17,229,151, 90, 73,216, 2, 84, 2,208,119, 59,252, + 58,163,117, 81, 35,130,187, 81,144, 58, 21,112,218,153,178,103,152,180,104, 23,171,120, 18,219, 72,105,197,249, 18, 62, 53, 41, + 74, 89, 82, 23, 32, 4,134,192, 36,130, 9,253, 52,214, 60,160,107,145, 33,106,129,188,106,128, 93,189, 30,216,165, 60,155,245, +184, 44, 41, 65,208, 26, 37,196,114,105,142, 43, 42,230,177, 94, 5, 75,222,130,190, 26,156,122,140,248, 21, 31,217, 68,168, 86, + 14,217, 59, 97,101,139,109,150, 10,155,138,162, 27,146,235,104,252, 69, 85, 37,197,110,104, 82, 14,196, 10,116,235, 93, 79,207, +221,169,213, 55,237,155,130, 62,239,111, 46, 46, 48,234,147, 1,100,176, 82,130,174, 32, 40, 14, 59, 2, 87,176,169, 30, 62,237, +180, 49,102,161,210, 56,250, 45, 24, 87,167, 12,178,249,115,100, 8,197, 45, 5, 37,181, 56,174, 67,136,116,113, 21, 36, 86,128, + 87,113,215, 70,187, 32, 68,119,170,159,180, 37,116, 87, 98,189, 45, 90,241,251,165,189,119, 40,193,198,220,113,180,191, 41,124, + 67,110,169,106, 42, 9,230,106,105,238, 3,235,214, 94, 70,105, 49, 40,213, 97,128, 67,175,169,253,146,193, 96,226,120, 44, 43, +124,101, 5, 35,202, 77, 82,132,241,108, 87,127,133, 52, 31,167,125,102,244,236, 49,105, 50, 37,100,117, 92,163, 43, 25,153,145, +252,143, 4,197, 50, 88,229,139,244, 54,164,180,161,196,165,196,131,215, 90, 57, 61, 54,184,135,118, 42,149, 25,214,215,242,146, +185,207,212,239,161,238,215,229, 54,177,125,129, 21, 13,200,140,146, 26,111,203, 11,160,161,216, 29,141, 42,117,154, 50,103,142, + 88, 29, 22,198, 53,255, 0,185, 45, 49,170,249,215,234,103,181, 12, 67,150,245,145, 8,228,244,116,121,141,167,129, 63, 3,103, +226, 64, 81,232,164,157,233,253, 26,214,162,211, 48,234,221,149,237,209,112,231,126,177,169, 23, 7,216,122, 50, 82,214, 65, 21, + 40, 42, 72, 4, 23, 60,186,132, 2,158,160,144,120,253, 90,232,112,167,162,199,204,130,161,110,243, 46,240, 36, 42,225,108,105, + 73,101,214, 40,161,184,248, 84,157,234, 0, 29, 64, 4,123,245,172, 36,178, 8, 74,206,192,191,161,196,183, 41,165, 54, 1, 33, + 69, 35,239, 4,149, 2, 77, 61,226,157,124, 61,218,155,178,101,180, 79,144,133, 37,207,151, 81,125, 52, 11, 65, 80, 90, 73, 79, + 34, 20,149, 87,122, 80, 83,253, 58,115, 36,204,137, 76,204,195,173, 41,181, 32,137,192,113, 90,233,247,130,192,165,124, 42, 52, +132,153, 38, 94,237, 25,140,132,203, 67,145,208,164, 71, 85, 91, 75, 78, 14, 73, 85, 73, 10,235,184,240,240,209, 33, 36,220, 23, + 71,122, 93, 98,101,211, 37,142, 84,219,172, 50,148,165,194, 22,127, 14,158, 36,151, 57, 2, 62,158,154,185, 11,153, 22,184,185, + 93,175,219,220,219, 4,189, 92,127,201, 22,219,155,107,184,186,148, 22, 25,248, 18, 73, 78,202,108, 20,147,189,122, 3,245,107, +199,126,165,122, 50, 89,245,156,204,120,189,177,249,135,247,135,110,173,168,211,159, 7,231,162,183, 44,112, 70,137,177,203, 11, +146,114, 21, 92,100, 33, 72,126, 8, 82,144, 22,146,154,130,142, 52,223, 95, 61,100, 66,116,141,147, 12,123, 15,219, 95, 98,168, + 33,170,101,197,226,197,110,237,104,142,247,239, 3, 15,200,116,255, 0,124,113, 0,215,221,170, 33,221, 40,234, 86,252,115, 22, +133,112,147, 46,214, 64, 46,199,125, 69,105, 52,175,150,164,109,250,117, 2, 8, 36,171, 58, 29, 18, 39,112, 49,246,224,221,164, + 72,173, 97, 21,182,133,120,113, 87, 16, 52,106, 78,224,156, 65,151,139,130,139, 55,178,218,235,195,202, 96,130,122, 29,182, 58, + 53,177,254,158,138, 16,139,113, 81,238,214,139,114,217,118,104, 2,174, 35,204,167,191,238,157, 14,162, 75, 30,196, 72,192, 7, + 73, 56,172,113, 41,235,134, 45, 33, 84,113,165,135, 89,254,234,183, 78,180, 50, 65,218, 36, 22,125, 81,109, 20,252,179, 15, 84, + 75,117,221,247, 5, 60,150, 90, 90,193,246,147, 74,232, 48,147,144,138,205,162, 71,199,178, 87,134, 52, 45,242,149,201, 37,242, + 88, 39,246, 84,147,225,173, 51, 4, 2, 53, 86,148, 52, 41,200, 13, 93, 34,142, 81,213, 21, 46, 58,145,226, 65,166,179,165,240, +132,246, 85,170, 29,116,179,252,230, 45, 47,229,192, 91,242, 30, 66, 66, 79,133,126,241,251, 53, 26,230,210, 69, 17,209, 52,118, +151,182,145,231,150,229,200, 64, 72,108,173, 13, 41, 67,168,225,211,125, 74,203, 8, 8,176,136, 65, 92,142, 44, 54,251,182, 47, +108,169,121,228,184, 82,179,185, 41, 39,115,244,106, 84, 71,226,222,163, 54, 91,111,214, 39,239, 56, 77,174,202,181,213, 48,163, +161,199,149,239,229, 82, 62,205,104, 59, 49, 89,230,179,185, 33, 90,112, 71,175, 25, 19,240,162,182, 75,252, 86,224,227,224, 86, + 54,174,148,236,208, 5,106, 35, 69, 63,188,152,164,139, 30,101, 97,192,163,163,148,245,195,105,249,101, 63,247,170, 20,167,213, +169, 87, 39,121, 33, 74, 46, 25, 53, 98, 18,162, 97, 57, 92,156,117,135, 7,203, 64,143,243, 23,103, 73,251,203, 82,107,195, 80, +144, 40, 86, 69,180, 84,198, 67,150,221,115,188,197,217,177, 63, 10,220,227,202, 76,100,143, 6,208,170,109,245,232,230,161, 1, +170, 36, 74,126,196,237,200,106,122, 29,144,121,169,134,170, 74,191,173, 81, 82,126,189,103,201,228,236,160,100, 93,147, 30,107, +220, 88,216,141,136, 56,135, 57,220, 87, 80,132,141,201, 89,216, 83,232, 26, 37, 84,104,167, 25,106,202,160,187,230, 78,221, 46, +205, 70,106,170,125,215, 2,151,190,229,100,236, 53,103,200,209, 74, 83,213,149,194, 38,167, 26,110,215, 99,121, 64,206, 74, 18, +252,148,255, 0,109, 99,149, 15,208, 53, 82, 85, 62,138,123,144,215,242, 73,108, 99,247, 12,177,229, 86,229,117,145,242, 48,135, +177, 35,225, 37, 62,237, 76, 82,193, 39, 77,246,230,145,141, 96,144,227,180,104,235,169, 83,146, 20, 77, 54, 61, 73,208, 46, 60, +130,121,142, 73,110,195,144, 38,234,183,230,201, 87, 27, 92,110,110,138,244, 33,190,154, 22, 68, 26, 0, 14, 42, 32,185, 73, 22, +188,213,251,142, 67,116,188,185, 85, 59, 32, 43,202, 79,246, 65,219, 70, 56,255, 0, 4, 66,145,150,171, 91,247,217,158, 76,166, + 36, 40,213, 92, 84, 9,175,245,117,110,202,120, 21, 88, 76,137, 38,203,198, 67,228, 98,173,179, 31,102,252,132, 33, 52,241, 36, +212,232,112,135, 20,140,245, 43,199,118, 46,206,199,237,226,209, 27,105, 76,180,203,142, 17,215,143, 93, 18,170,190, 32, 59, 84, + 68,221, 84,191,231, 9, 15, 50,110, 9, 63, 14,203, 42,175, 66, 5, 14,143, 58, 94, 76,167, 25, 40, 47,119, 77,113,109, 83,210, +242,183, 91, 39,141,125,160,234,197,120,206, 83, 78,107, 87,111, 50,217,247,152,111,249, 39,227,125, 21, 82,189,192,239,163,156, +112, 16,201,220,142,227,185,211,215,102, 31, 96, 18, 81, 29,222, 3,251,164,208, 29,102,229, 99,237, 46,137, 25,185, 79,152,118, +108,172, 99, 34, 22,228, 43,240,211,193, 66,167,193,205,143,235,213, 99, 83,234,155,118,169,201,182,100, 43, 59,118,127, 35,228, + 33,109, 72,229,239, 91, 14, 46,159, 98,116,182,124, 41,110,213, 14,237,195,104,184,150,221,157,187,239,180,178,132,157,194, 25, + 66,126,247,214,116, 27,102,197,213,194, 52,100,155,124,195,134, 71,155, 65,178,253,235, 92,112,227,239,167,192,210,170, 4,234, +223, 78,191,115,146,170,217, 79, 5,187, 57,199,221,145, 34,223,106, 41,227,200,124,225,246, 83,142,212,253, 90, 44,239,248, 76, + 81, 68, 0, 78, 93,177,179,202,186,217,191,203,237,158, 17,213,206, 91,228, 16, 10, 80,216,226, 9, 59,208,106,149,146, 4, 34, +192,234,169,175, 90,157,212,186,118,231,180, 18,236,248,161, 75, 2,226,240,183, 45,218,173, 46, 62,165, 87,154,170, 13, 74, 82, +158,181,235, 79,234,212, 43,187,244, 7, 77,142, 94,116,119,235,182, 36,247, 14, 31,111,237,100,226, 58,174, 5,139,106,151,126, +186,189, 49,180,131, 17,189,156,125,123, 37, 9, 42,227,201, 68,144, 1, 81, 27, 10,212,235,232,162, 91, 64,143, 16,234, 38, 85, +108,142,137,129,166, 92,242,210,146, 79,156,177,247,129,223,109,171,211,175, 77, 60, 74,140,194, 35, 99,153, 54, 43,160, 66, 88, + 75,169, 33,106, 88, 60, 73, 59,159,216,232, 71,215,167,100,226, 69, 60,226, 25, 11,182,214, 75,183,143,198,158,170, 20,114, 10, +168,166,252,184, 5, 38,170, 63, 70,162, 98,234,197, 82,237, 87,111, 99,174, 44,230, 23, 22,224,194, 92,175,230, 2,129,111,240, +142,160,138,251, 75,138,175, 31,109, 21,211,192,235, 43, 44,109, 91, 24,165,202,250,149,232,187,211, 68, 70,112,200, 25, 62, 90, + 32,200,152,166,212,164,221, 2,213,231, 41,181,184, 20, 91, 12,134, 5, 42,221, 64,161,226, 79,183, 92,142,102, 80, 50, 96,235, + 98, 47, 17,222,173,165,118, 35, 9,184,201,254, 83,103,101,182,218,142,163, 20,147, 21, 62,106, 68,129,201,214,234,148,168,165, + 42, 41,168,174,255, 0, 71, 77, 87, 54,144, 53, 68, 19,101, 34,127,162,238,222, 8,110, 72,141,198, 58,231, 60,167, 84, 80,130, + 62, 42, 42,158, 41, 36, 80,210,148, 31, 70,130, 50,230, 19,139, 65, 44,200, 77,159,209,238, 43,100,140,252,119, 82,153, 41,146, +165, 21,198, 64,122,142, 43,204, 9,231,178,193,228, 42, 0,169, 32, 3,211,218,231, 54, 74, 68,197, 74,199, 61, 48,192,178, 67, +126,222,244, 46, 44, 54, 80,219, 41, 41, 33,106,109, 0, 41, 41,234, 77,118,161,216,116,208,236,203,151, 30,105,124, 37, 66,204, + 48, 73,150,194,133, 91,217, 91, 11,130, 27,119,229,208,148,249,137, 72,113, 36,185,182,201,173, 13, 43,184,247,233,161,107,241, +213,211,109,236, 87, 87,106,125, 83, 99,239,217,226,217,175, 15,161,187,209, 75, 73, 17,247,228,149, 20, 37, 75, 36,253,221,138, +169, 74,254,173, 74,187, 44,171, 64,178, 51, 58,100,109,150,225,196,241, 86, 60, 62,238, 99,151, 84,173,200,143, 5, 70, 66, 74, +202,129,173, 18, 15, 30, 70,158,221, 18, 89,114,151,204,179,127,210,164, 18, 55,115,187,180,155,123, 82,146, 28, 66,225, 22,194, +185,114,221, 5, 68,129, 90,234, 59, 68,202,210,199,198, 21,248,174, 8,245,105,150,219,111,153,100, 59,181,149, 1,114, 80, 86, + 36,160, 29,184, 41, 60, 87,204, 39,122, 19,202,149,214,214, 38, 62,133, 26,219, 25,115,231,125,123, 21,137,100,214,225,147, 33, +174, 18, 36, 4,172,200,106,129, 74,109, 73, 36, 10,141,141, 20,106,118,235,171,248,119, 24,157,170,174, 85, 27,131,174,102,202, +123, 49,136,218, 46,201, 74,137,110, 40,115,247, 15, 37, 77,144,150,213,205, 20, 36,116,232, 62,173,116, 21,146, 66,193,182, 12, + 82,106,251, 69,110,152, 60,169, 79, 52, 74, 18,165,208, 84,158, 94, 95, 50, 5, 71, 66,181, 42,187,215,122,232,193,208, 76, 66, +136, 61, 62,170,241, 58, 52, 88,204,241,226, 67,203, 84,100, 14,102,131,192,109,189, 72,174,219,211,232,210, 54, 55, 20,133, 6, + 92, 23,236, 63, 73,119,151, 82,183,158,101,201, 72,113,192,162,181,182,148,166,133, 59, 80,159,103, 34, 58,105,188,225,218,138, + 49, 10,177, 59, 27,232,251, 16,141,116, 98,102, 65,107, 14, 73,109, 97,208, 29,146,149,164,211,127,221,165,178, 0, 32,120,154, +234,189,247,202, 33,129, 86,104,196,143,243, 46,131,201, 59, 71,142,195,198,184, 89,236,101,166, 84,128,143, 62,205, 23, 96,144, +118, 73,113,176,170,154,143,218, 26,169, 70, 77,128,235, 39,241, 43, 70,120,245,182,145,101, 78,222, 44, 89, 94, 27,116, 76,247, + 30,117, 49,138,184, 69,118, 74, 28, 82,146,160,106, 42,164,132,208,253, 71,232,214,237, 57, 59,130,207,148, 12, 75,174,157,244, +251,222, 25,121,189,137,252,119, 39,144,217,200,221, 74, 20,212,151,129, 74, 36, 20, 39,143,150,104,148,241, 81, 78,193, 85, 31, + 78,188,163,215,190,135, 25, 82, 57, 52, 2,228,124, 81, 0, 16, 88,104, 72,112,207,193,198,186,113, 66,200,173,195,132,223,105, +200, 34, 51,153,205,109,231, 22,204,168, 97, 16,148,195,136,170,144, 80, 62, 33, 94, 67,199,221,175, 6,191, 14, 48,147, 18, 65, + 28, 65, 3,248,172,232,150,116,115, 16,203, 32,198,238, 68,245, 37,194,166, 93,183,169,231, 10,146, 18, 2,208,120,142,138, 86, +171, 79, 28,109, 36, 31,187,251, 84,140,217,138, 85,206, 36,139,165,182,105,111,103, 36,187,243, 42, 31,213, 9, 77, 6,171,225, + 86,196,130,172, 78,122, 58, 3,113,186, 46,241,133, 69,189,176,170, 92,216, 96,177, 41, 3,239, 81,181, 85, 11,250, 41,171, 77, +240,144,161, 57,234,180, 93,239,234,107, 25,141,112,167, 36, 56,164,161, 95,250,193,254,157, 54, 13, 79, 19,226,152,218,150,108, +138,110, 85,233,219,228,115,198, 64,109, 77, 45, 63,218,105, 85,213,198,113,180,170,228,182,170,208,203, 45, 76,221, 93,118, 18, + 71, 20,221, 45,109, 42,158,213,240,255, 0, 78,171, 70,189,179, 8,126,118,139,153,100,179, 38,209,141,159, 63,103, 88,150,232, + 62,208, 82,170, 87, 91, 7, 82, 20,201,209,213,139,219,220,237,228,227,174,195,144, 69, 88, 1,183, 1,241,109,225, 64,126,163, +172,252,154, 81, 55,184, 78,178,100,197,139,142, 53, 63, 97, 21, 40, 14,169, 94,213, 26, 38,154, 0,165,202,104,201, 62, 98,153, + 52,107, 54, 40,242,211,254, 37, 12, 4,178,159, 16,167,198,234,251, 52,178, 96,208, 36, 34, 86, 92,178, 65,179,170, 21,199, 39, +126, 99,139, 41,140,218, 62, 81, 69, 93, 8,221,100,234,116, 68,236, 3,185, 52,198,171,212, 9,235,147,104,147, 13,162, 74,164, +185, 84,211,193,164,171,141, 52,113, 39, 74,113, 0, 38, 12, 34,221, 6,201,127,152,251,200, 9,113, 46, 48, 86,124, 74, 82,158, + 92,126,221, 85,184,157, 20, 15, 5, 19, 39,106, 37,223, 47,147,154,202, 64, 47, 71, 74,150,149,145, 90, 33,191,138,131,235,213, +152, 89,182, 44,152, 5, 95, 99,152,245,234,255, 0,141,222,239, 50,171,252,202,241, 37,231, 10,252, 67, 41, 77, 71,213, 77, 75, + 39, 36, 68,196, 40,237,116, 15, 22,193, 99,218,238, 48,217, 79,196,211,108, 56,226,213,253,162,106, 6,139,101,226,101, 74, 53, +178,118,129,142, 61, 34, 28,133,176, 13, 29, 91, 44,169,105,247,252,103,245,105,160,200, 70,191,137, 87, 22,203,117,195, 57,151, +124,190,206, 10,249, 43, 59, 79, 56,132,170,180, 73, 74,138, 19,245,154,106,252,154, 44, 2, 85,214,202,119,100,187, 88,139,194, +221,205, 46, 71,149,186,218,224,158,239, 33,212, 20,158, 35,237,212,204,128, 32, 40,206, 58,166, 73, 16,238, 87, 43,138,242,151, +235,252, 91, 15, 62,200, 62, 5,103,130, 71,212, 53, 82,168,130, 83,148, 49, 49,229, 77,185,217,109,178, 7,255, 0, 13,130,201, +121, 0,116, 83,165,116,174,158,233,129,162,156, 66,115,201,103, 63, 60,181,143,180,174, 44, 60, 2, 2,135,136, 9,255, 0, 78, +179,156, 72,186, 39, 20, 30,101,177, 17,237,169,176, 67,248, 95,152,219,173,109,237, 66,107,250,117, 10,190, 50,231,146,114, 25, + 40, 97,216,231,201,223,214,220,189,144,148,241,226,124, 20, 78,250,186, 44, 28, 20, 64, 70,123,165,141, 69,136,184, 73,182,208, + 33,104,226,225, 31,182,177,169,202,231, 12,135, 58,223, 84,207,103,197,227, 93,112,203,127,205, 15,139,205,249,115,244, 1, 93, + 85,149,187, 53, 76, 43, 82, 51,252, 37, 87, 56,115,224,179, 95,150,117,182,218, 65, 63,212,109, 28,206,167, 12,151, 46,154, 53, +106,170,187,111,103,165,201,130,227,105, 71, 27, 75, 40, 87, 37, 83,239,184,191, 15,171, 86, 70, 83, 57,230,159, 98, 11,147,118, + 13,215, 95,108, 13,163, 52,194, 82,177,189, 20,235,138,216,106,205, 25,193, 47, 40, 20,115,183,157,149, 86, 53,143, 75, 97,223, +134, 73,254, 28, 43,217,207,115,170,121,125, 65,230, 25, 60,106, 70,251,119,233,253,171,108,167,163, 56,174,102, 65, 67,197, 35, +246, 80,216, 36,143,183, 67,202,205,222,124, 2, 94, 91, 40, 89, 70, 29, 42, 22, 91, 26, 52, 74,151, 19,248,178, 92, 30,222, 95, + 10,126,161,161, 67, 32, 8, 38, 21,186,188, 6, 47, 27,228,213,103, 64, 63,206,127,151,166,115,138,253,175, 55,201, 41, 66,127, +254, 95, 45, 80,253,225,103,228,155, 96,116,135, 96,121, 54, 86,174, 1,147, 67, 21,161, 21, 39,217, 84,238, 62,189, 60,200,153, +101,116,214, 80,251, 36,182, 89,182,127,152,221, 80, 15,188,227,177,146, 63,105, 72,165, 13, 53,114,152,249,113,110,106, 22, 71, + 84, 42, 69,226, 77,238,107,210,102, 42,169,142, 26,140,221,127,101,180,158,159,102,167,102,131,189, 12,171, 75,177,236, 70, 24, +156,171,228,128,159,152,156,181, 70,104,175,163,108, 55, 85, 45, 95, 70,218,167,100,182,104,165, 18,184, 39,214,239,118,109,185, +207,112, 29,182, 70, 80,114,201,106, 91,200,105,178,104,133,184,163, 69, 41, 64, 31, 0, 41,246,253, 26,250, 55,233,231,166,207, + 79,198,243, 39,243,216, 3,142,193,197,191, 4,106,227,205, 85, 24,150, 31, 34,239, 29, 87,135,220,227, 25, 35,204,105, 41, 72, + 13,165, 36,208, 0, 18, 0, 21,175, 65,174,238,235, 0, 42,237, 85,184,116, 3, 34,198,210,226,214,134,202,148,134,198,206, 40, + 84,124, 70,160, 82,189,104, 70,139, 81,112,171,219, 21, 14,212, 80,218,203,107, 80,242,105,192, 45, 20,228,181,248, 20,138,211, +167, 78,186, 40, 66,224, 20,103,174,159, 39, 32,165,189,170,162,128,133, 18,107,190,230,136,235,169,152,232,161, 25,106,186, 71, +209,253,234,215,109,188,195,185, 93, 0, 48,138,208,162,243,172, 50,144, 56,147, 74, 41,224,164,141,246, 31,134, 78,179,178,232, + 50,142,156, 86,230, 45,192, 21,245, 47,179,158,167,145, 38,202, 45,136,156,164,196, 33,190, 41, 73,112,164,165,163,189, 20,191, +105, 29,104, 62,141,114,215,224, 16, 93,150,213,119,137,112, 87,159,111,251,209, 98,113, 42,189, 72,105, 79,184,232, 42,230,211, +142, 46, 64,112, 40, 13,254, 34, 13, 27, 42,233,239,250,179, 47,199, 60,145,120,171, 91, 24,191,218, 51,155, 90, 17, 99,112, 22, + 93, 75,111,182,183,169, 84,186,164,171,194,180, 32,142, 53,160,167,214, 53, 66, 64,196,178,129, 27, 75,168, 57, 23,243, 43, 14, + 67, 2, 51, 6,136, 75, 95, 50,182, 82, 42,158, 64,130,178, 15, 95,133, 94, 21,246,141, 76, 64, 72, 58,156, 38, 36, 10,117,130, +242, 94,152,196,181,214, 75, 77, 5,186,181, 54, 72,169, 53, 66,185, 17,236,118,160,141, 0,197, 84,155,109, 32,105,246,254, 9, +103, 55,198,173, 81,242, 54, 89,150,145, 42, 43,129,181, 4,186, 10,144,138,252, 65,183, 56, 40,114, 32,159, 29,137,211, 8,171, + 24,215,153,215,168,230,127,130, 11, 35,210,214, 37,125, 97,219,197,190, 47,203, 78,243, 60,213, 37,148,134,208,165,157,254,238, +199,165, 5, 9, 61, 61,250,144,178, 65, 70,121,113,140,128,146, 89,201,187, 37,220,236, 66,222,244,108, 66,121, 31, 52,149,198, + 74, 92, 11,251,138,108, 21, 21, 80, 80, 10,131, 77,182, 58,113, 99,241, 8,144,178, 19,224, 82, 62, 77,216, 30,249,230, 81,159, +102, 21,201,134, 99,178, 91, 76,170,121,161,245,150,218, 40, 71, 20,241, 80, 41,226, 2,190, 35, 82,117,102,172,170,226, 93,138, +148,224, 56, 58, 90,198,253, 37,199,198,236,178, 50, 44,149,196,220,174,110, 21,170,174, 32,171,128, 63, 17,226, 9, 6,162,191, +102,172,217,212, 37, 54, 17,209, 60, 49,163, 19,174,170,157,239,156,235, 54, 63, 21,219, 61, 16,134,144, 56,164,164, 33, 13,168, +236, 65, 52,166,231, 96, 71,187,219,171,216, 85, 74,122,148, 28,137,136,133,198,253,227,189,166,229,118, 13, 71,101, 41,144,131, +200,133,243, 35,219,183, 42,154,125, 52,215, 97,137, 81,136, 92,190,101,128,148,163,105,182,194,126,158,115, 64,172,168,114,227, + 95,133, 84, 30, 34,155,251, 14,174,237, 84,163, 48,156, 48,132, 67,133,120, 12,202,108,170, 47, 34, 80,130, 86, 40,144, 62, 32, + 40,124,107, 93,142,129,109,123,149,154,236,101,111, 97, 16,113,213,201,249,184, 42, 79,157,195,128, 15,242, 13,186, 20,154,148, + 41, 67,122,245, 0,235, 58,200, 16,175, 9,186,177,113,108, 46,199, 57,182,153,148,133,180,225, 42,242,212,144,151, 27, 82, 82, +118, 4,157,197, 0,165, 82, 70,218,165,101,146,138, 52, 64, 71,174,248, 34,229,180,227, 50, 31, 44,195,251,222,122, 2,100, 37, +105, 6,148, 80,120, 26, 80,232, 49,150,175,197, 24,203, 86,224,149, 59,165,233,214, 85,199, 15,114, 67, 95, 42,243,209,210, 93, +109,214, 86,219,110, 4,141,247, 67,169,228, 62,165, 1,239,209,232,203, 17,152, 10, 19,134,232,170, 27, 19,181,163, 16,200,154, +152,251,101, 60, 28, 1, 14, 54,175, 52,245,169, 33, 64, 19,255, 0,165,174,158,155, 4,130,167, 18,202,243,159,108,135, 33,136, +153,181,186, 91,210, 17, 45,104, 76,181,190, 18,126, 93,196,164, 4,161,106, 70,252, 72,160, 73, 35,110,149,166,188, 83,234, 95, +165,161,140, 70, 69,111,182, 68,191, 96,231,199,240,117,159,151, 64,131, 17,205, 47, 12,170, 84, 28,149,198,210,225, 75,238, 39, +202, 89, 59, 30, 53,173, 53,227,176,173,156, 21, 82,193,193, 75,139,126,147, 44,220,223,121, 95,128,212,117, 43,174,223,116,129, +160,211, 91, 74, 73,132,180, 74, 24, 62, 88,235, 51, 35, 67,144,121, 67,153, 25,113, 22,159,122,137, 3, 86, 12, 24, 21, 9, 79, +177, 49,201,142,134,177,244, 88,221, 38,173,171,204,229,236, 13,170,187,253, 90, 22, 33, 12, 71,122,105,104,171,135, 50,101, 90, + 46,247, 8,205,168,249, 77,200, 87, 78,148, 88, 6,154,212,149, 95, 16,239, 67, 18,119, 10,245,190,228,169,114,215,137,100, 80, +199,240,242, 34, 37,128, 71,181, 7,112,126,173, 2,202, 90, 74,177, 58, 21,206,185,237,208, 62, 47, 48,120,241, 82,102,172,132, +251,150,170,234,212,107,105, 5,102, 50,248, 71,122, 31,136,222,231, 63,122, 92,116,147,242,206, 71, 90, 92, 30,246,141, 65,211, +223, 88,218,234, 64, 18,173, 89,179,238, 47,246,166, 44, 26,147, 53,197, 37,197,164,245,242,146, 65, 21,213, 17, 16, 36,197, 79, + 80, 21,235,106,244,189,234,111,184, 22,168,151,172, 31, 13,186,200,181,201,130,193, 75,206, 70, 84,118,150,164,166,149, 74,228, +240, 10,250,142,180, 15,167,179,178,107,122,233,145, 7,185,191, 22, 86, 33,161, 66,103,122, 65,245, 71,133, 50,234,242,204, 38, +237, 22,222,176,183,228, 77,110, 42,164, 50,208,109, 28,135, 55, 35,115, 74,107,239, 35, 82,159,167,179,177,224,246, 83, 32, 27, +139, 63,224,233, 18,229, 47,250,122,178,255, 0,155,178,198,173,203, 73, 83, 45, 44, 50,229,125,137, 62, 98,171,246,107, 31,229, + 9, 89, 39, 8,235,240,100,204,202,238,240, 98,143,196, 19, 84,202, 71,246, 81, 82, 79,217,170, 89, 32,128, 16,193, 80,178,167, + 88, 89,184,121, 84, 68, 0,134,160,177, 79,218, 52,170,207,219,161,202, 70, 62,228,224,169, 54,232,214,251, 22, 5, 53,210, 2, + 94,110, 41, 40, 30, 53, 89,227,250,181, 74, 82, 54,106, 82,125, 85, 91,112,184,181, 17,210,227, 63,119,229,202,234, 61,251,106, +205, 19, 59,145,137,209, 57,224, 87, 85,189,218,249,207, 55,188,240,224, 83, 96,141,232,164, 17, 95,171, 90, 82,150,210, 16, 74, +203, 54, 31, 18, 47,105,114,119, 88, 64, 18,174, 70, 48, 0,108,106, 82,121,126,157,244,213,229,188,246,246, 36,189,118,110,216, +199,249, 54,237,138, 16, 3, 69,134, 67,171, 63,217, 30,221, 44,188,205,182, 69, 68,135, 81,187,138,136,246, 41, 81,109,113,254, + 22, 35,183,229, 45, 35,216, 17, 81,250,244,104, 88, 68,138,104, 33, 12, 90, 98, 69,110,205, 52,185,248,105,142,243,203,223,169, +230, 72, 26,141,182, 19, 36,137, 68, 93,182, 59, 42,209,106,190,196,170,149, 29, 74, 46,145,185,226,179,177,208, 12, 90, 41,110, +209, 71,102,142,100,102, 99,195,225,134, 86,175,119,197,190,158,161,183, 69, 53,213, 93,135,238,222,107,218, 63, 73, 54, 92,147, +181,114,218,182, 92,110,249, 5,245, 51,100,136,112,164, 56,235, 76,177, 21, 77,160,170, 83, 78,108,146,163,211, 94,183,233,108, +137, 81,211,163, 40,104, 76,228,229,135, 96, 84, 51,175,149, 96,109, 44,235, 85,219,189,118,238,236,195,106, 55,127,113, 11, 30, + 99, 9,193,201,114, 92,132,213,178,230,129,226, 88,155,109, 13, 45, 7,233, 4,123,181,127, 34, 85,100,134,190,168,207,189,154, + 94,240,197, 82,135, 80,156, 78,186,170,235,212,175,107,112,158,202,247, 33,142,217,224,139,146,188,120,174, 13,213,132, 92, 86, +135, 36, 50,139,132, 70,229,249, 74, 91,105, 72, 87, 15, 51,136, 52,173, 58,215,174,188,195,213, 93, 54,188, 12,163, 85,110, 98, +192,235,199, 80,235, 92,205,192, 40,119,120, 27,131,138,218,225, 71, 77, 5,194,117, 82,148,142,161, 42, 32,126,173,115,244,135, + 83, 28, 18,198, 69, 99, 70, 45,138,188,169, 95, 2,150,158, 73, 73,219,117, 29, 16,234, 11, 37, 18,145,103, 93,218, 49, 35,186, +237, 56,184,164, 1,239, 45,154,233,226,241, 10, 71,130, 46,244,180,162,203, 17,245, 80, 42,115,138,118,135,197, 64,209, 41,208, + 68, 53,116,194, 90, 35,118,199,191,148,135, 60,149, 3, 53,109,134, 83,238, 39,169,208,203,142, 41, 21,169,156, 78, 50,101, 42, +229, 62,132, 37,105, 42, 81,241,161,228, 70,250,168, 38, 73, 33, 52,142,136,160,190, 56,139,153,191,212,124,203,142, 7,184,215, +254,193,182,203, 28,126,197,234, 60,153, 50,141,155,118, 55, 42,197, 24,114,229, 30, 59,175,218,100, 60,228,201,110,210,170, 73, + 41, 60, 83, 64, 55, 72,246,235,175,204,232,226,169, 25,213,168,110, 31,195,181,118,249,253, 6,117,107, 0,225, 87,145,109,222, +108,132,197, 97, 36,181, 13, 44,178,218, 60, 11,178, 20, 1,247,107, 46,118, 57, 11,157,158, 58, 30,237,173,113,141,198,222,159, +138, 66,100, 20, 40,143,113, 52,253, 58,140,172,224,171,154,121,167,123,197,237, 88, 7,111,222,198,152,113, 49,229, 51, 13,201, + 18,102,184,126, 8,204,173, 3,146,206,196, 19,191,194,159,218, 86,221, 42,117, 44, 28,127,220,228, 7, 4,135, 12, 7, 51,249, +120,161, 8,176, 95, 49,123,131, 49, 23,155,212,149,199,169,101,215, 22,176,227,212,228, 82, 85,178,143,212, 54, 31, 71,211,175, +175,113, 43,242,235,140, 72,224, 7,224,142, 6,128, 43, 86,204,221,130,201,218,216,241,212,121, 73,100, 5, 56,225,216,184, 2, +107,193,180,251,214, 8, 39, 84,229,172,214,156, 64, 16, 84,222, 93,146,137,146,159,124, 16,219, 15,168,169, 0, 84, 0, 84,147, + 80,144, 41,225,176,214,173,113, 96,179, 45,155,165,185, 89, 60, 24,235, 83, 76, 26, 57,200,161, 1,190,136, 20,175, 47, 10,157, + 16, 32, 74, 64,168,234,125,239,153, 67, 45, 10, 62,104, 18,144, 42, 41,215,236,174,231,219,162,136,186, 31, 5,208, 93,141,184, + 69,181, 51, 30,243,125,123,230, 46, 43, 37, 44, 52,234,199, 4,165, 35,175,197, 95, 15, 0, 62,221, 35, 82,177, 27,153,116, 70, + 9,222,115,111, 44,190,191, 44, 62,165, 81,178, 1, 73, 74, 58, 18, 2,118,165, 14,213,213, 43,177,119, 43,212,229,178,186,112, + 79, 80,178, 36,165, 76,153, 42, 49,138,120,164,242,160, 53, 59,128, 41,184,166,219,253,154,199,200,192, 3,146,213,163, 45,215, + 97,122, 69,239, 37,149,251,139, 78,201,124, 60,211, 12,209, 9,111,145, 73,116,173, 75,224,144,104, 73, 34,181,219,160, 79,191, + 92,198,125, 6, 28,190,204,180, 28, 89, 22, 93, 35, 29, 76, 93,242,166, 23,112,101, 10,136, 45,111,173, 43, 82,170, 22,181,188, +149, 22,250, 83,112,125,187,212,107, 55,132, 80,108, 6, 3, 78,213, 54, 22, 75, 30, 30, 4,196,155, 98,120, 37,123,151,200, 10, + 42,105, 44,151,149, 83,225, 71,104, 20, 79,191,174,165,181,203, 32, 26,183, 90, 79, 16, 63, 30, 31,130, 31,101,204,172,249, 84, + 52, 94, 28,101,196,197, 67,210, 62,103,205, 71,196,164,176, 3,105,113, 97, 93, 18, 22,160, 70,164,107, 49, 69,156, 12, 56,119, + 34,183, 28,138, 61,146, 0, 74,164,135, 26,142,162,195,133,191,139,116,169, 72, 81,160,167, 74, 82,158,221,142,135,229, 58,132, +107,222, 93,184,169, 23,216,246,235,132, 38, 97,190,235,137,142,251,126, 99,124, 57,161, 84,160, 95, 20, 26,146, 9, 77, 71,143, + 67,165,179, 85, 26,137, 5,217, 87, 23,181,228,152,156,167, 77,164, 33,203,107,132, 74, 13, 41, 75, 39,143, 18, 9, 80, 36,158, +131,109,188, 62,141, 76, 66, 51, 90,113, 47,197, 40,119, 70, 96,157,105,101,248,142, 41, 1,103,227,143, 90,210,162,161, 73, 35, +101, 3,237,235,171, 88,240,213,146, 43,151,251,245,136, 34,244,211,229,144, 21, 44,167,101, 40,164,132,252, 53, 21, 7,221, 94, +186,220,195,158,214, 84,242, 32,224,174, 63,238, 7,106, 38,196,186, 8, 74,170, 28, 21, 40, 94,225, 38,167,161, 62,239,104,166, +186,204,123,196,131,142, 75,152,200,169,139, 37,137,120, 92,219,114,213,205,163,230, 55,247,128, 32,154,123,189,191,110,173, 9, +134, 84, 72,101,186,208,204,240,251,114, 34, 40, 21,141,184,171,168,222,157, 53, 9, 50,148,100,201,243, 9,157, 58, 27,234,243, + 65,171,148, 46,183,251, 53, 7,114, 41,208,248,143,110,170,219, 29, 21,168, 88,172,187, 86, 87,116,177, 33,165,176,190, 80,137, + 14,132,171,112, 15,137,216,238, 41,236,214,100,232,220, 85,200,218,193, 93,253,178,204,236, 23,150,146,151,146,150,166, 45, 32, + 6,215,186, 66,129,174,202, 80,232,126,205,100,228,211, 40, 43,117,216, 38,154,102, 73,198,175, 73,118, 27, 37, 77, 74, 1,105, +242,218,162,146,160, 19,186, 77,122, 26,248, 26,214,180,211, 64, 72, 51,132,251,187, 23, 30,119,186,219,105,178,229, 83,237,236, + 71, 9,184,178,178, 67,109,149,165, 42, 61, 65, 9, 81,165, 15,187, 93, 71, 77, 4,197,213, 11,239, 17, 42, 47,104,187,157, 18, +224, 46, 88,164,112, 85, 14,100,122,160, 18, 63, 13,214,126, 52,146,151, 1,219, 99, 90, 29, 47, 87,226, 11,250,101,145,211,128, + 58,240, 85,108,183,116, 72, 80,110,115, 93,135,152,249, 47, 86,137, 43, 61,127,100,108, 63,213,175,146, 68, 26, 37, 80, 33,207, +177, 20,135, 62, 73,182, 73,183, 64, 30,108,233,192, 52,202, 71, 82,159, 29, 66,184,252, 74, 50,142,138,110, 23,131, 49, 14,242, +235,210, 42,166, 97, 37,167, 16,147,253,115, 95,212,117, 71, 39, 36,142, 8,144,169,147, 55,201, 49,114,139,114, 90, 79,227,165, +167,120,255, 0,120,167, 65,170,102, 37, 16,192, 20,153, 31,183,209, 46,182,167, 46,206,128, 37, 58,215, 7, 54,234,234, 42, 1, +250,245,118,204,194,225, 15,201, 98, 83,162, 33,166, 6, 25, 96,198,164, 44,121,150,214, 83, 33, 68,157,234,170,212,105, 89,150, +100, 73, 77,228, 4,177,233,103,211, 75, 30,173,123,213,148, 99,215, 59,226, 49,220, 90,207, 14,126, 73,112,184, 46, 43,147, 22, + 98,219,148,223,154,134, 88,109, 72,230,231, 23, 10,128, 42, 27, 3,227,182,186,158,137,210,206,117,130,189,219, 90, 38, 68,179, +232, 27,128,237, 80, 44, 1, 39,128, 87,230, 57,216,175, 64,221,188,109, 77, 65,198, 50,108,193,214,219, 33,233,215,187,204,123, + 66, 87,203,117,121,108, 91, 88,112,165, 39,195,146,201,246,235,174,143, 68,233,240, 12, 68,231,226, 91,240, 10,140,186,136, 28, + 34,172,182,175,126,158,187, 5, 63,159,165,107,107,115,178, 11,141, 38, 28,159, 34, 97, 51, 36,218,144,226,249, 53,111,130,212, +180,169,180, 22, 17, 68,173,210, 20,165, 26,239, 74,106,221, 56, 88,152, 4,154, 35,186, 71, 93,210,212,199,176, 7,224,221,188, + 74,134, 79, 80,229, 4, 26,233,221,142,229,101,115, 37, 43, 46,200, 46, 19,164,182,146, 71,204,203,121, 73, 30, 63, 10, 57,113, + 72,175,128, 3, 79,118, 93,179,212,200,251,214,116,237,148,184,146, 84, 14,216,247, 95,185,216,221,216, 76,199,242, 11,132, 69, + 54, 22, 84,219, 50,223, 13,170,162,163,146, 57,113, 80,175,129, 26,157, 89, 86,192,184,145,247,165, 27,101, 30, 4,133,100,118, +187, 50,193, 59,227,123, 75, 29,201,133, 14,207,221,201, 14, 45,152, 57,157,181,134,162, 34, 99,234,248, 82,139,163, 12, 4,182, +190,100,129,231, 36, 5, 39,106,237, 93, 83,234, 29, 47, 31,170, 6,152, 16,183,148,198,142,127,239, 14,111,219,196, 45, 12,124, +253,223, 12,253,234,146,206, 49, 76,135,181, 93,208,191, 88,114,184,198, 46, 65, 29,217,107,121,133,110, 42, 83,240,173, 36,108, + 82,164,144,164,145,212, 26,235,203, 58,142, 21,152,215, 74,171, 3, 74, 39, 85,160, 92, 42,103, 43,204, 92,147,113,129, 99, 70, +201,113, 94,105, 35,170,148,179, 77,245, 78,117,238,137, 81,148,152,128,152,114,107,193,151,110,185,217,152, 63,143,229,182,218, + 71,185, 13,212,254,157, 6,140,125, 28,165,189,206,138,157,189, 95,132, 72,178,213, 95,220,196, 74, 79,184,147,169, 87, 64, 50, + 30, 40,219,222, 37, 51,118,155, 59,109,203,112,142, 21,252, 57,108, 54,177,239, 59,106,206,109, 91, 65, 42, 17,151, 5,103,219, +230, 54,140,110,100,122,255, 0, 14, 16,183,192,254,226, 13, 53,207,209, 97,253,203,119,127, 4,112, 52,116,183,136,222, 13,175, + 18,186, 78,109, 84, 92,148, 39,236, 78,137,212,220, 89, 95,121, 31,138,106,139,146,179,191,224, 51, 6,213,144,178,161, 73,144, + 91, 90,255, 0,188, 18, 5,117,183, 40,234,171,214,126, 20,176,237,221,169,184,133,166, 66, 21, 66, 10,163,172,131,225,185, 26, +121, 69,202,144, 42,197,236, 10, 88,201,109,159,203,230,111, 29,244,190,206,251,253,221,129,250,142,161,100, 8,138, 91,131, 37, + 60,206,228,213,138, 77,234, 35,103,241, 80,202, 25,229,237, 85, 74, 73,253, 26,120, 7, 14,164, 36,234,242,237, 5,225, 50, 63, + 47,219, 20,194,106,227, 25, 85,242, 18, 73,246,185, 6, 19,159,211,175, 82,244,232,126,154, 59,172,151,224, 22,103, 84, 58, 5, + 7, 28,184, 7,110,209,172,136,221,230,218,113, 74,167,183,168, 26,210, 17,209,214, 56,146, 57,235, 70, 50,165,250,249,149,142, + 43,226,136,196, 75, 5, 83,253, 84,162,205, 24,154,253,154,226, 61,107, 94,238,165, 62,225, 31,249, 66,232,172,147, 48, 85,119, +116,175,207,230, 93,222,199,160, 51, 83, 11,231, 92,168,234, 60,166,104, 53,205, 26, 26, 39,189, 79,126,137,123,213, 47,114, 25, +115, 39, 78, 49, 5, 64, 52,133,115, 80, 79,130, 64,162, 70,134, 42,104, 34,137, 42,190, 46, 82,139,173,254, 37,165, 31,185,142, +104,119,216,158,167, 79, 58,200,139,118,166,156,217, 62,101,183, 6,142, 79,138,227, 45, 31,134, 51,107,153, 32, 15, 10,157,171, +162,126,223,108, 2,104,203, 69, 63, 14,190,183,121,203,156,113,103,148,102,185,185, 74,237, 80,104,157, 84,190,166,138,121, 77, + 50,247,114,251, 26,208, 98, 90, 99, 14, 9, 82, 91,230, 69, 42, 84,231,196,163,172,186,234,121, 20,219,131,164,213,102, 13,127, + 56, 75,124,191, 0, 54,166,233,253,146,180,141, 16,212,120, 41,242, 95, 71, 59,113, 99,176, 93,237,173, 65,190,176,219,133, 67, +130,219,116, 38,132, 17,225, 93,119, 19,158,171,219,115, 37, 40,130,202,180,239,159,161,188, 81, 19, 92,206,187, 83,193, 18,208, +232,155, 46,208, 74, 66, 93, 83,105, 52,225,236, 59,253,122,163,147,136, 45,212,105, 46,222, 94,208,185,124,140, 15,220, 7, 3, +108,190,227,252, 23, 6, 94,127,204, 56,182, 77,125,131,149, 68,118, 13,204, 41, 69,198,159, 4, 81, 69,205,136, 34,128,143,122, + 78,178,103, 65,135,194, 70,171,152,203,170, 85, 72,198, 65,138, 9,222, 92,145,233,221,186,200, 38,161, 65, 79,174, 55,146, 8, +216, 36,113,162,138, 83,208, 26, 10,114, 53, 32,116,246,107,162,244,141, 95,252,228, 1,224,227,241,251,104,179, 76,151,206,252, +131, 49, 14,100, 13, 91,246, 81, 11,228,170,120,113,251,160,253,157, 60, 53,245, 24, 12, 20,183,185, 77, 19,187,143, 52,219, 62, + 79,114,250, 82,150, 18, 71, 68,165, 36, 13,135, 77,186,157, 0, 83,171,171, 70,214,139, 42,222,225,112,122,224,120, 54, 72, 74, + 79, 20,170,187,210,170, 31,171, 86,149, 25, 21, 46,203,143, 71, 80,249,169, 41, 89,117,123, 0, 9,167,135,196,163,224, 6,255, + 0, 80,212,196, 84, 56,169,174,182, 98,205,243,150,144, 31,170,146,128, 64,169, 74, 77, 42,117, 98,181, 2,143,216,115, 75,156, + 7,252,213,164,249, 68,134, 27, 74,183, 27,209, 85, 62,239,118,136, 82,116,231,140,247, 82,109,190,113, 92,151,124,192,162, 42, +154,144,154,141,184,245,161,167,179,244,106, 18, 9, 9, 43,111, 0,239,124, 65, 37,149, 58, 84,164,168,141,146, 74,121, 26,239, + 64,124, 0, 30,202, 13, 84,178,167, 87,168,185,151, 87,118, 31,190,171, 77,214,214,220,119, 84,197,181, 69, 9,121,182, 28,252, + 84,178, 86, 1, 9, 82,104, 2,143, 90,214,191, 70,185,236,236, 64, 65, 91,184,215,240, 11,184, 49, 30,247,205,154, 6, 73, 49, +224,181,177,206,216,211, 10, 80, 45, 82, 91, 46, 72,109, 59,208, 16, 56,164, 10,145,225,237,215, 45, 44,102,209,106, 59,167,124, +139,185, 10,189, 99, 54,139,117,145, 75, 50,209, 45,203,100,196,164,212, 37, 14,184,158, 42,113, 11, 59,165,101, 41, 4, 17, 81, + 95, 97,208,225, 94,217, 23,236, 81, 16,212,158,213,178,249,108,200, 24,187, 51,115,128,144,254, 38,243, 50, 31,125,180,236,228, +135, 66, 11,172, 50, 77,106, 56,171,226,161, 27,145,190,165, 25, 2, 59,221, 73, 3,196, 59,137,152,162,209,106,159,127,140, 34, +218,146, 83, 14, 67,201, 88,117, 94,114,154, 84,133,173,194, 77, 79,152,165,114,232,106, 41,227,169,206,161,171, 20,153, 31, 29, +246,182,222,103,221, 44,247, 87, 22,136,176,252,137,177,212,202, 15, 36, 3, 69,144,221, 9, 10, 28, 19, 81, 81,237,246,211, 81, +242, 8, 0,168, 70,160, 31,189, 25,187,231, 48,238, 23, 38, 33,202,108, 5, 33, 33, 49,110,105, 0,182,226, 92,227, 84, 37, 71, +196,145,200,117,233, 79,118,129,229, 17,170,156, 98, 2, 94,238, 75, 22,211, 26, 60, 83, 29, 77, 37,106, 47, 7, 27,221, 41, 95, + 34, 28, 5, 35,238,143,186,170, 13,186,232,148,184,213, 59,170, 87, 59,195, 90,122,232,228, 57, 95,133, 61,104, 9,110, 64,167, + 7, 43, 94, 36,145,246, 87, 90,180,216,193, 10,192,235,159,123,155,132,179,110,152,204,233, 40, 30,111, 37, 52,251,110, 14, 35, +144,170, 72, 80, 21, 2,190,209,181, 40,117,177,141,113, 98,203, 38,250,195,234,171,124,167, 10, 97,199,252,230, 91, 74, 90,235, + 68, 15, 5,110, 58,107, 90,155,244, 0,172,139,234, 74,114,241, 54,226,191,230, 51,178, 84,106,170,138,143,245, 29, 90, 18,117, + 80,197,138, 35, 6, 33,109,134, 86,217,224,242, 79, 23, 42, 15,221, 63,116,253, 26, 25, 82, 69,237,247, 43,131,113,156,180,190, +162,149,164,243, 96,157,194, 86, 55, 52, 61,104, 65,208, 76,117,117, 33, 34,204,139,192,206,239, 24,180, 51, 60,177,206, 58, 65, +228, 80, 78,212, 59,148,169, 63,116,212,116, 58, 28,233, 18, 83,174,227, 20,173,105,245,133, 54,221,119,126, 42,223, 43, 0, 56, +243, 75, 74,184,172, 80,138,130,157,193, 28,126, 33, 81, 74,106, 83,193, 12,158, 57, 68, 23, 73, 25,151,115,239, 29,200,205, 83, + 57,135,144,165, 37, 10, 5,214,208, 82, 84,146,158, 96, 40,110, 65,219,110,189, 60, 70,175,224,208, 33,162, 29,214,111, 41,131, + 3,149,118,115, 38, 90, 99,136,235,228,195,178, 4,142, 13,180,165, 33, 77,154,133,145,240,215,168,175,180,251,245, 95,214, 25, + 34,158,155,105, 60,192, 31,103,211,237,218,133, 34,192,166,199,113,166,110, 22,152,153, 75,187, 58,235, 12,196,112,116, 33,106, + 36,131,191,191, 95, 34,217, 99, 6,236, 66,130,247,143, 71, 78, 63,156, 71,145, 51,255, 0,103, 37, 41, 77, 60, 84,144,116, 29, +206, 29, 22, 45,205, 60,221, 88,141,107,191, 77, 68, 98, 10, 37,180,153, 44,129,226, 22, 43,250, 14,168, 93, 81,119, 76, 37,170, + 19, 46,107,118, 28,181,112, 10,169, 10, 75, 77,145,236,228,240,161, 31,110,155,102,232,247,165,185,181, 67,242,123,153,179, 89, + 26,131, 24, 81, 69,213, 45, 84,235, 64,170, 87, 84,163,102,203,128, 60, 17,221,226,131,119, 11, 42,144,211,241,230,199, 89,242, + 29,109, 45,212,120,120,142,159, 70,180,168,171, 67,226,129,185, 91,191,150,130, 99, 91,253, 77, 99,184,251, 68, 6,114,232,185, + 5,166,105,175,132,187, 84,132,160, 31,253, 98, 81,174,219,210, 23,255, 0,249, 10,199, 34, 37, 31,124, 79,230,202, 22, 13,192, +142,212,192,137, 9,117,187,139, 64, 80,180,149, 10, 30,180, 78,187, 53,203,175, 80,208,168,246,102,166, 36,127, 81,105,255, 0, +105, 90, 25, 42, 37, 78,112,186,244,151,103, 39,247,114, 27, 9, 3,251, 71,175,234,212,100,116, 72, 40, 54, 25, 14, 64,147, 41, + 67, 98,166,156,250,188, 53, 40,157, 20,147, 23,110, 98,249, 50,216, 46, 31,133,164, 57, 33,127, 80,219,245,232, 98,122,168,166, +238,240, 50,231,122,251, 9, 15,185,174,213,220,251, 12,125, 24,229,229,254,171,147,103,184, 5, 38, 3,206,168,238, 84,203,227, +202,175,136, 80,169,214, 71,171,177, 63,115,139, 28,145,243,214, 68,101,223, 19,192,159, 3,167,181,109, 96,219,230, 69,143, 37, +202,157,183,236,231,113,187,185,221,139,109,143, 7,178,205,187,205,136, 20,228,180, 64,142,227,193,164, 54,104, 20,226,144, 40, +128, 85,176, 42, 32,107,135,193,193,187, 40, 24,213, 3, 35,220, 29, 88,144, 36,247,171,170, 95,160,143, 84,233, 90,231,170,195, + 25,171,212,183, 22,217,129, 38,247, 99,106, 64,109, 93, 63, 13,201, 64,242,247,117,215, 69, 95,163,122,135,150,198,182, 61,155, +162,255, 0,138,132, 99,180,241, 11,149,189, 87,118, 59,189,158,157,173,183, 69,247,103, 25,184, 88,153,156,249,143, 10, 76,200, +235, 17,158, 13,167,149, 26,144,138,178,191,246, 84,117, 72,244, 92,140, 67, 17,116, 12,124, 70,158,254, 8,128, 16, 11,164, 14, +202,100,238, 57,102,144,250,201, 21, 88,227, 95,236,234,175, 84,172, 8,160,215, 45, 66,232,156,122,232, 39, 99, 79,190,181, 80, + 8,202,229,191,181, 52,215, 31,139, 83,228, 18,174, 74, 77, 4,175,104,185, 45, 86, 57, 22,142, 91,240, 82, 70,254,227,166,234, +207,230,214,123, 8, 79,137,168, 37,120,239,182, 74,243, 61,142,199, 36, 72, 87,241,141, 52, 99, 44,248,236, 43,174,170,186,183, +151, 64,145,218, 17, 63, 77,158,153,187,229,234, 71,181,133,254,223, 91, 66, 45, 17, 37,165, 83,175,247,119,155,129,106,134,142, + 53, 81,118, 92,130, 17,176, 34,169, 71, 37,111,211, 90, 56, 29, 11, 39, 54,210, 43,143,194, 56,200,233, 17,237,252,134,169,162, +126, 21,212, 29,142,244,141,218,142,219,185, 18,223,151,119,138,208,253,249,135, 92, 75,145,236, 54,187,149,202, 50,150,190,169, + 76,164,249,105, 59,248,241,215, 80,125, 21, 2, 26,121, 17, 7,186, 36,253,238, 21,115,149, 88,211,119,226,148,251,157,249,122, +228,217,173,206,233,116,236, 86,103,100,205, 31,121,247, 28, 85,141,151,149,109,187,210,132,209,184,211,248,165,124,119,173, 23, + 95, 96, 58,163,145,232,171,162, 30,153,198,206,225,161,247, 31,226,143, 85,208,159,202, 65, 95,157,173,194,179, 46,221,122, 22, +127, 7,238, 45,182, 77,171, 43,180,247, 26,231, 21,232, 87, 6, 92, 97,228, 37,120,244, 7,146, 74, 29, 0,208,131, 80,122, 30, +163, 91,253, 22,137,211,128, 97, 56,152,145,105,208,232,126, 80,169,245, 17,240,143, 20, 59,182, 72, 68,174,231, 0, 15,192, 57, + 86,190,194,157, 95,144,248, 86, 34,105,245,177, 49, 22,159, 93, 93,199,200,151,255, 0,248,232,118, 86,154, 39,218,172,122, 26, +255, 0,167, 92,167,170,171,126,163,111,254, 31,249, 98,186, 11,143,199,246,236, 84,196, 55,209,105, 97,172,234,225,247,153,109, +210,202,143, 94, 78,124, 71,174,185,249, 84,225,144,196,151, 57,247, 23,184,105,202,123,131, 38,122, 28, 36,149,240, 21,254,200, +212,109,165,130,179, 2,229,111,237, 3, 43,159,125, 76,201, 74,248, 25,113,210,234,137,240, 73,174,131,180, 25,129,224,167, 56, +232,153,153,204,211,113,190, 94,179,103,143,240,241,155, 48,226,154,237,182,219,106,237,212, 59, 4, 17, 52, 99,179,151,210, 60, +215,214,127, 21,213, 36,110,124, 43, 83,172,142,165, 13,177, 41,188,199, 43,103,116,115,117, 77,200,210,149, 57,200, 55, 83, 82, +124, 18, 40, 53, 71, 11, 24,136, 57,226, 83, 89, 99,200, 4,155,254,101,123,151,243, 10,159, 36,175,128,223,246, 70,150,207,234, +183,114,190,218, 47,161,152,127,168, 40,179,108,237,249,174,143, 49, 32, 41, 11, 6,138, 30, 61,117,218, 91,137, 32,116, 94,240, + 12,101,170, 90,238, 87,171,107,205,154, 89, 44, 62, 71,129,223,217,183,129,213,204,110,158, 39,197, 87,182,232,214, 21, 61,220, +126,227,226, 93,229,140,184,249,100, 64,227,171, 20, 18,153, 60, 31, 65,173, 65, 74,254,159, 3,171,243,232,177,156, 24,253,188, + 59, 23, 63,157, 58,178,162, 99, 48,253,253,158, 11,154,189, 82, 99,217, 6, 25,218,235,204,139, 3,174, 92, 49,183, 17, 71,215, + 25, 10, 50, 27, 71, 46,142,160,110, 18, 7, 85, 1, 79,109, 6,218,185,233, 94,129, 26,115, 68,166, 67, 13, 71, 47,177, 92,102, + 95, 74,149, 82,221, 19,186, 63,122,249,245,143, 91, 21,125,187, 72,190, 58,160,136,161,197,121,117,246,114,216, 15,171, 94,225, + 32,203, 50, 1,245, 83,239, 23, 24,177,228,173,166, 20, 84,148,143, 45, 70,190, 34,164,159,172,254,173, 52, 66,156,164,165,226, +248,146,111, 79, 39,146, 74,220,125,206, 72,225, 93,207, 42,127,167, 83, 67, 3,114,113,155, 6,219,219,235, 42, 36,222, 79,154, + 8, 80, 13,161, 37, 37,105, 64,167, 83,176,169,160,250,244,194, 78,167,177,134,169, 18, 22, 79, 10,235, 57,114,164, 33, 41,243, + 2,170,148,212, 37, 8, 73, 53, 2,187,248, 29,245,102,185,104,171,158, 43,107,247,187,114,227,161,165, 43,138, 10,139,131,143, +222, 32, 10,255, 0, 72,209,137, 5, 66, 75,211, 18,145,113,150,151, 32,168,212, 38,141,183, 80,126, 45,183,253, 58,150,215, 80, +224,136,219,178,139,206, 55,118, 9,223,138, 64,162,150, 84,160,125,158, 62, 58, 20,226,141, 25, 46,149,244,177,234, 1,184,247, +104,144,178,119,208,227,174, 40,124, 42, 72,160,230,120, 39, 99, 82,126, 34, 0, 27,120,147,211, 89,121,148,110,142,139, 95, 18, +246,103, 95, 67,187, 7, 53, 23,251, 12,171,180,135, 84,234,101,127, 19,228, 56,126, 10,184,215,150, 8, 73,165, 10, 81, 68,215, +192,141,114, 89,101,139, 5,208,211,168,117,110,246,159, 36,153, 38,246,227,210, 28, 13,188,203,233, 41,243,133, 10,202,152, 68, + 98, 1, 59, 26,150,133, 61,251,117, 27,211,184, 6, 71, 87,197,171, 34,114,100, 31,151, 42, 66,200, 41,125, 0,138, 0,182,151, +176, 32,215,175,196, 53,156, 99,183, 84,251, 80, 76,154,219, 42,210,227,113, 45,209,145, 43, 27, 33, 34, 69,180, 1,248,140,114, + 31,112, 42,137, 37, 1, 68,129,226,157,189,154, 61,115, 5, 50,131,111,197,173, 88,228, 23,230,198,105, 10, 83, 74, 13,201,226, + 63, 24, 6,194, 64, 53,241, 87, 17,201, 53, 7,167,191, 79,230, 18,146, 0, 38,220, 39, 93,164,219,225, 76, 15,218,201,243, 98, +133,143,129, 52, 32,167,142,251, 5, 0,118,222,132, 15, 96,169,244,109, 82, 76,217, 68,137, 19,237, 73,112, 1,243,124, 57,241, +235, 66, 90, 73, 59, 30,169, 10,228, 8,246,104, 48, 0, 20,146, 38, 77, 45,153,241, 3,202, 28,141, 2, 18, 79,222, 77,105, 64, + 65, 29, 66,169,245,106,212, 80,166, 85, 11,234, 18, 11,171,185, 49, 34, 25,226,149,254, 27,141, 40, 87,112, 64, 1, 84,240,223, + 91, 24, 39,181,101,228,151, 85,179,118,240,251,200,143,196, 37, 95, 19,117, 61, 66,121,168,128,105,236,233,173, 29,205,170,206, +150,169, 99, 45,180,182,195,106,117,176, 10, 9, 63, 79,188,141, 91,166, 78,169,216, 25, 8,181,178,182,166, 37, 46,143,192, 41, + 91,106,175, 74,116,167,233,174,143, 34,130, 22,185,206,203,180, 6,203, 42, 5,198,143, 14,149, 0, 2, 83,227,236, 26,140, 53, + 76, 82,238, 81,159, 53,104,129, 41,199,148,182, 31, 44,151, 10, 82,161,197, 96, 10, 40,138,212, 40,110, 42, 8,173, 61,190, 19, +216,160,185,126,237,155,174, 21,237, 87, 66,178,220,159, 48,150, 74,133, 19,197, 69, 73, 82, 84,127,170, 82,165, 15,175, 87, 76, + 62, 21, 16, 85,149,219,204,219, 25,254,105, 14,232,193, 8,243, 17,229,187,208,161, 36, 36,171,130,169,226, 55, 35, 74, 17, 32, +186, 44, 72,230,174,126,212,228,248,110, 73,109,186,192, 66,146,222, 68,219, 78, 22, 2,126, 32,182, 0,248,209,246,142, 64,142, +189, 53,205,125, 69,194,179, 43,165,203,103, 24,145, 47, 17,192,254, 42, 22,135,142,137,134, 77,237,155, 94, 28,171, 84,147, 84, +189, 21,135, 26, 80,253,151, 91,115, 99, 79,160,235,229, 73,234, 75, 40, 67, 64, 23,235,242, 85,118,154,171,146, 55,144, 16,135, +194, 71,137, 64,162,135,217,167,174, 44, 19,137, 38, 88,119,131,113,131,110,159,214, 68,117,152,206,147,226,217,221, 63,102,161, + 96,112,128,101,241, 32, 29,209,158,183, 84,155,188,113, 73, 13, 43,203, 52,246,162,139, 31,165, 58,133, 49,109, 17,206,161, 18, +189,249, 55,232, 16,238, 76, 39,240, 93,139,230,167,222, 78,228,107, 35,168, 84,100,224,113,226, 17, 49,202, 1,125,199,196,204, + 94, 68, 52,144,101, 53, 64,213,122,133, 36,114, 31,160,234,246, 5,198, 85, 70, 71,143, 52,167, 22, 37, 59,122, 36,200, 23,140, +122,156,237,125,237, 71,139,127,207,109,176, 95,169,251,159, 53, 49,184,203, 63,245, 86,117,208,250,110,253,153,180,159,253, 72, +253,229,148, 85,205,150, 99,139,199,187,133,148, 89,220, 79, 20, 71,186, 78,129,199,216,150,230, 56,207,244,107,211,179, 14,203, + 8,239, 43,150,156, 90, 68, 45, 70, 26, 30,181,196,128,157,151,204,176, 71,189, 42,219, 84, 37, 38, 76, 19,238, 33,217, 16,112, +209,152,247, 66,253,111,195,112,231,220,243, 45,178,111, 42, 90,164,205, 75, 71,227, 92,104,140,130,234,208,158,133, 84, 3,125, +171,163,200, 87, 85, 98,203,236,141,113, 60, 31,137,240, 28, 74,183, 78, 20,236,215,128, 94,147,233,234,197,152, 49,112,184,118, + 55, 48,182,102,207, 71, 66,213, 42,213,110, 15, 70,186, 54,223,222, 46, 34, 28,144, 22,226, 19,181, 74, 42,119,233,169,227,154, + 50, 65,253,181,177,176,142, 67, 73,123,142,170,118,224, 78, 1,198,169, 82,210,210,161,169,228, 16, 82,250, 89, 45, 16,122,131, +226, 63, 70,170, 2,203, 60,132,239,216, 28,147, 14,198,174, 23, 59, 71,113,210,227,157,190,191,218, 38, 65,184,181, 31,247,165, + 77, 82, 75, 62, 95, 80, 28,243, 91, 72, 73, 59, 2,106,118,213,204, 99, 85,144,157,119,124,147,137, 5,189,225,187,223,130,183, +139,112,170, 78,120, 50, 19,144,247,247, 36,186, 71, 94, 23,128, 70,107, 17,237, 99,104,121, 12, 88, 44, 85, 97,181, 44, 16, 60, +201,111, 38,142, 72,117, 64, 14, 74,112,154,157,232, 52, 90,242, 4, 43,242,233,136,174, 3,128,142,158,243,196,158,242,163,126, + 84,236,238, 9, 26,103, 57, 16,161, 17,191,150,226,156, 63,211,161,137,104,171,144,167, 64,239, 22,103,139, 71,123, 17,185, 54, +206, 73,218, 43,147, 75,102,241,135,100, 8, 19, 45, 51,152, 82,129, 40, 44,189,200, 54,189,170,149,162,138, 4, 3,238,213,234, +178,204, 96, 35, 47,138, 39, 66, 15, 4,106, 47,149,103, 67,167, 98,167,251,195,249,122, 72,197,239,118,140,167,210,149,190,125, +243,179,185,211,162, 70, 59,108,104, 46,100,251, 92,176,163,243,150,153, 5, 60,148,163, 29, 66,169,113, 95,121,189,201, 60, 84, +163,197,250,155,162, 78, 54, 67,200,137,148, 44,224, 6,164, 30, 96,248,126, 30, 11,106,160, 38, 55, 69, 89,216,215,229,231,222, + 56, 24,195,246,204,191, 39,196, 49,204,153,230, 11, 74,178,222,242, 40,237,206,109,207,234, 45, 49,146,243, 96,251, 71, 61,181, +159,133,232, 76,184,147, 41,202,184,203,176,203, 95,184, 17,247,166,178, 65,155,112, 30,213, 82,103, 30,148,253, 66,246, 42,240, +155,175,114,236, 15, 53,134, 56, 0,143,127,183,173,185,246,153, 1, 71,138, 74, 38, 68, 43,104, 21, 30,137, 81, 10,247,107,155, +245, 79, 64,202,195, 0,217, 2, 34, 72,248,134,177,227,218, 52, 70,193,137,136, 46,155,123, 69,233,131, 18,239,221,150,102, 97, +222, 73, 47, 65,244,245,132,150,174, 55,195, 24,148, 72,186, 60,231,248,123, 84, 69,237,197,199,212, 40,165, 3, 84, 39,125,137, + 4,117,190,148,233, 3, 46, 82,149,154, 87, 14, 61,253,193, 6,217, 0, 12,143, 4,245,220,222,237,100, 25,204, 56,152,227, 81, +217,178,118,206,218, 26, 99, 31,197, 45, 41, 12,219,173,209,210,126, 20,161,180, 0, 22,189,234,167, 20, 57, 40,251,182,215,113, +109,198, 76, 34, 26, 35,132, 71, 0,176,111,200,149,135, 94, 29,138, 22, 59, 43,249, 93,222, 51,205,116, 15,165, 75, 7,194,187, + 29, 2, 22, 60,152,246, 33, 24,232,167,153, 11,102,255, 0, 45, 0,209,213,200, 46, 54, 69, 65, 4, 16,161, 66, 52, 57, 30, 97, + 60,116, 70, 59,191,222,238,225,230, 88,245,171,181,217,116,211,113,198,224,202, 76,200,174,202, 5,114, 89, 80,101,108, 22,252, +226,106,164, 16,190,138,169, 20, 20, 32,109,171,115,205,178,202,246, 72,187, 31,106, 60,174,148,162, 34, 75,164, 44, 53,135,172, +185,212,169, 8, 53,226,221, 83,244, 87, 80,148,192,130,175,179,146,189,253, 94,122, 73,204, 59,141,234, 51, 60,207,178, 75,205, +187, 14,237,125,203,249, 48,141,124,191, 60, 65,152, 99, 88,225,176,242, 97,198,103,147,175, 20, 41, 36, 29,128,173, 69,106, 14, +170,117,126,129,118, 86,117,182, 18, 33, 15,133,137,231,240,142, 3,137, 93, 21,194, 32,188,139, 42,239,186,222,136,172, 89,183, +110,145,137,246, 83,186, 22, 75,142, 94,138,185, 10,223,120, 98,101,145, 18,214, 81, 64,203, 82, 37,114,111,154,142,201, 10,160, + 39,196,117,213, 56,250, 83,251,151, 70, 71,176,130, 16, 55,215, 61, 35, 32,254,229,243,195, 44,236,191,115,251, 73,220, 55,177, + 14,235,217,165, 89, 51, 72,174,186,220,251,116,246,203,110,182,226, 79, 32, 65,221, 42, 66,210, 65, 74,146, 74, 84, 55, 4,141, +115, 29, 70,169, 83, 41, 66, 97,136, 60, 10,179, 26,153, 73,193,111, 11,178, 34,239, 29, 38,171,113, 79,134,233,215,145,240,213, + 65, 91,204, 20, 78, 33,148, 91,189,233,235, 94, 25,109,177,180, 41, 34,124,132,135,189,191,122,166,191,102,181,205, 96,234,169, +236, 46,155,176,108,137,171, 72, 89, 42,221,176,105, 67,227,172, 44,186,124,201, 42,228,144, 82,206, 73,149,189,115,189, 41, 12, +158, 79, 56,175, 41, 35,233, 59,234,112,164, 66, 58,169, 87, 18,100,191, 21,123,134,111, 72,197,194,254, 20,197, 89, 81,175,253, +162,156, 77, 15,232, 58,199, 21,151, 54,119,143,118,171, 99,185, 89, 24,215,118,178,172, 70,150,251,130,139,177, 5, 18,151, 21, +253, 58,245,235, 48,227, 35,193,122,148, 51, 37, 1,218, 20,139,255, 0,113,191,204,109,146,165, 30,103,198,181,209, 40,197,216, +133,126,102,224,135, 90,239, 82, 34, 57, 85, 42,173,214,160,141, 94,216,179, 76,209, 73, 23,113, 61, 41, 33, 68, 19,209, 64,154, +131,244,141, 10, 81,229,201, 78, 18, 84,103,122,125, 34, 99,121, 91, 15,222,187,114,219, 54,108,165, 92,158, 45, 33, 28, 32,200, +117, 71,149, 92, 67, 96,240, 81, 53, 60,144, 40, 78,228, 87,125,116, 29, 63,175, 78,179,182,207,138, 63,120, 89,217, 93, 58, 51, + 15, 13, 15,220,184,215, 40,192,179,188, 19, 36,115, 25,206,160, 59, 6,246,165,243,242,222,165, 29, 65, 81, 72, 90, 22,154,165, +104,219,170, 77, 53,217,227,100, 66,248,110,129,112,185,187,105,149,101,165,162,191,187, 17,128,195, 54,232,243,214,159, 49, 79, + 26, 34,162,161, 1, 66,149, 36,251, 69, 42,125,250, 86,216,220, 21,154, 32,151, 61, 86, 35,228,110,194,218,133,114,141,197, 77, +138,236, 2, 82, 66,136, 3,222, 72,212, 40, 46,155, 40, 48, 84,205,170,216, 95, 80, 13,142, 8, 74, 69, 91, 29, 2,104,105, 95, +121,219, 87,224, 21, 5,147,224, 15, 39,231, 84, 74, 80, 85,196, 40, 31, 14, 33, 71, 71, 26, 40, 73, 15,199,242, 83,105,187,161, + 42, 87, 6,131,136, 74,146,158,164, 36,238, 43,246,234, 2,214, 42, 44,234,196, 68,203,125,249,105,150,150,255, 0,132, 32,249, + 73, 4,128, 77, 9, 42, 52, 4, 19,190,137, 57,129,197, 18, 49, 79,189,141,198,111,243, 50,118,158,182,195,118,111, 21, 9, 45, +161,134,214,186,148, 81,196,146, 18, 58, 0, 58,251, 14,178,242, 46,136,125, 86,142, 45, 5,215,208,158,193,247, 66,231,134,185, + 18,211,147,195,118, 32,114, 59, 15,150,100, 36,182,182,155, 80,248,194,194,192, 41, 38,169, 94,254, 0,235,153,202,128,153,120, +234,186, 60,114, 98, 24,171,251, 31,206, 91,148,137, 79,218,136,224,162,167,152, 93, 69, 84, 91, 63,136, 7,188, 20, 87,233, 58, +205,148, 85,176, 85,139,143,247,117,216,178, 99, 92, 16,232, 44, 85,184,243, 16,122, 40,154,132,148,159, 14, 64,237,239, 58,171, + 58,157,209, 1, 78, 81,187,174,222, 64, 24,199, 16,138,202, 66, 66,153,125, 60, 40,180,175,238,145,196,248, 20,148,144, 55, 7, +141, 42, 1,208, 5,109,170, 69,121,200,110,205,179, 10, 75,136, 15, 55,113,114, 59,140,186, 26, 40,115,206, 74, 0, 91, 68, 18, +104,165,113,161, 65,241,216, 29, 18,185,106, 20, 21,125,103,205, 31,117,232,151,139, 82,216, 80,109, 78, 50,165,238,211,156, 18, +160,135, 89,112, 82,135,138,146, 20,147, 74,129, 79, 96,173,221,160,232, 84, 9, 86, 20,124,190, 29,210,215, 13,183,214, 1, 40, +117, 40, 32,128, 80,164,168,180,180,158, 61, 8,169,247,108,117, 91, 99, 36,100,148, 46,183, 52,198,155, 34, 4,132, 16, 20, 25, +123,122, 10, 57, 66,146, 69, 63,180, 40,125,250, 56, 4,161, 74, 74,170,239,211,177, 87, 17,217,168, 33,104,101,106,113, 74, 62, +198,188,198,205, 79,188,237,173, 44, 55, 5,150,117,228, 21, 74, 92,114, 64,204,178,210,151,193,247,156,228,189,254,234, 74, 2, +149,185,233, 64,161,246,235, 94, 49,112,178,231, 38, 40, 13,235, 37,183,207,148,149,161, 99,228,212, 42, 0, 59,110,145, 80, 62, +130,117, 98,160, 64, 85,236, 33, 65,185,191,242,168,243,219, 59, 21,243,253, 66,159, 93, 52,120,151, 65,144,100,153,148,230,172, +176,219,206, 18, 2, 65, 87, 26,111,191, 64, 62,221, 26, 16,213, 12,151, 84, 71,118, 59,220,110,209,211,101,142,132,185, 13, 77, +128,226,149,247,154, 80, 21, 9, 7,223, 66, 55,251,118,213,184, 86, 29, 64,149,207,249,159,112,140,166,219,133, 29,202,112, 36, + 41, 74,169, 80, 33,100, 80,251, 71, 77, 18,114,112,202, 41,187, 1,186,186,218,216,134,167,131,113,158,113, 10,122,149, 77, 20, + 41, 67, 93,198,253, 62,157, 78, 60, 83,130,175,158,204,199,118,201,153,217,238, 19, 30, 82,109,111, 75, 98, 42,221, 21, 77, 27, +125,208,209, 42, 30,202, 19, 95,163, 86,178, 40, 23, 83, 56, 30, 6, 37, 77, 92,217,131,119, 27,123,237,218, 46, 41,227, 46, 49, +118, 3,200, 4, 40,121,145,159, 45,154, 17,177,220,108,117,241,127, 82,199,242, 47,178, 31,220,145, 30,226, 84, 64,213,145, 12, + 74,226,226,239, 12,113,175,146,128,107,244, 19,190,179,140,246,197,212, 72,213, 57, 98, 86, 89, 95, 41,118, 91,127,185,101, 73, +113,191, 97,252, 64, 8,255, 0,170, 70,162,255, 0, 10,134,199, 46,135,230, 86,135,238, 86,123,195,140, 38,166, 56,102, 90, 13, + 60, 43,197, 99,236,208,225, 45, 85,136,197,212,238,218, 71,110,231,141,197,183, 40,252, 77,165,196,167,220,149, 2, 83,160,219, +172,146, 26, 20, 17,251,138,204,183,155, 87,221,228, 66,143,246,146,158, 42,253, 90, 85,215,182, 12, 59, 81, 36, 28, 58, 35,218, + 73, 40,179,119, 6,219,145, 32,241,131, 10,237,110,185, 71, 80,216, 32,183, 37, 14, 40, 87,220, 69,117,163,131, 63, 46,218,229, +217, 33,248,161, 46,187,245, 39, 5,171,127,123,242,230,144,144, 57,221,167,188,191,114,157,125, 79, 3,245,215, 94,187,213, 67, +100, 79,196,174,107, 39,252,201,120,148,155,140, 46, 45,207, 40,179, 69,144,174, 49, 36, 92, 34, 50,249,254,170, 93,121, 45,168, +254,157, 86,170,177, 57,136,158, 4,133, 24,241, 81,253,103,220,239, 82,125, 83,229,169,191, 59,198,211, 29, 75,177,217, 35,116, +106, 52, 24, 40,249,118,218,105, 29, 18,144, 19,202,131,197, 68,248,235,203,125, 79,149,102, 71, 83,188, 79,249,100, 99, 17,200, + 70, 58, 0, 63, 31, 18,186,146, 0,136,101, 92,246,155, 36,200,112,119,160,231,248,204,181,197,201,225, 73, 18, 98, 72,104,209, +104,113,180, 26,125, 32,167, 98, 14,196,108,118,214, 70, 46, 77,152,246,137,214,118,202, 37,193, 76, 87, 73,250,145,102,220,207, +114,221,202,173,140,166, 52, 60,134,223,109,200, 76,116, 10, 37,183,167,194,110, 75,192, 15,122,212, 79,215,175,108,207, 59,228, + 38,205,190, 49,147,119,144, 9,251,215, 61,153, 17, 27, 11, 36,165, 62,220,112,202,186, 70,113,183,120,253, 43, 71, 79,183, 84, + 97, 38, 85, 86,174,214,246,250,110,121,124,185, 72,149, 49,139, 62, 13,105,100, 92, 47,249, 5,192,148,197,183,198,175, 16,165, +120,169,107, 63, 11,109,167,117,157,135,137, 23,177,234, 4, 25, 74, 66, 48,136,115, 35,192, 15,183, 1,205, 26,154, 13,164, 0, +152,176,187,207,161,222,224, 93,151,219,204, 63, 45,191, 70,201,211,201,184,247,219,229,190, 43, 54,103, 92, 39,138,106,148, 43, +230, 27, 65, 81, 31, 18,192, 9, 27,157, 84,167,174,116,203,103,229,198,115, 4,232, 36, 64,218,255, 0,136,246,133,164,122, 96, + 35, 67,170, 81,205,112, 59,230, 15,152,175, 9,202,152,242, 47,112, 22,227, 50,218, 38,160,112,169,228,146, 54, 41, 80,162,146, + 71, 80, 65,213,219,171,149, 71,108,184,133,151, 40,152,146, 15, 20,227,128,247, 35, 62,194,187, 61,115,195, 49, 43,147,176,172, +247,103, 20,236,148, 71, 81, 75,129, 72, 73, 10,242,214, 55, 71,152,138, 5,241,221, 65, 32,116,168, 51,143, 80,182, 17, 48,137, + 96, 83,198,233, 68, 24,131,161, 85,155,142,169,166, 16,186,244, 95, 19, 95, 30, 70,167, 84,235, 31, 17,240, 66, 33, 49,224, 93, +221,205,251, 89, 45,225,141, 74, 14,227,243, 85,229,220,108,147,210, 36,219,102,180,180,241, 91,114, 34,187, 86,214, 20,157,171, + 74,251, 8,213,138,242,167, 13, 6,177, 58, 16,117, 7,196,112, 83,162,233, 85,192,167, 14,229,101,221,173,201,187, 67, 3, 0, +237, 5,160,227,248,130, 12,139,205,206,211,201,107, 74,111, 50,221, 33,192,149,168,158,109,182,211,105, 75, 71,193, 6,158, 26, +183,100,233,170, 49,133, 17,219, 23, 50, 35,188,255, 0, 1,195,185, 19, 43, 43,205, 1,180,254, 42,168,149, 12, 73,180,177, 34, +148, 45, 60,211, 68,255, 0,102,155,159,183, 64,140,149, 34, 29, 58, 64,236, 78, 98,245,185,172,227, 34,157,105,196,240,153,139, +254, 2,231,152,221, 97,217,217,150, 83, 67, 86, 4,165, 5,172,111,177, 9,161,246,232,135, 24,196, 9,206, 81,132, 79, 3, 34, + 34,254, 14,175, 83,139, 57,135, 3, 68, 67, 52,236,254,101,131, 63,111,203,111, 13,199,153,137,205,117,147, 14,245,105,146,204, +235,116,154,128, 20, 17, 34, 50,148,138,236, 77, 13, 9, 27,210,154,107,104, 49,136,144, 34, 81, 60, 8, 46, 61,225, 10,236,121, + 86, 62, 32,150, 51, 91, 50, 36,229,179, 99, 15,184,210, 90,125, 4,116,161, 58,173,189,152,160,132, 53, 9,140,197,254, 84,162, + 41,230, 54, 18, 63, 81,211,217, 39,139, 5, 50, 19, 15,116,179, 28,195, 54,188, 75,201, 51,105,238,220, 47, 82, 91, 74, 16,243, +164, 81, 8,165, 82,134,208,154, 37, 9, 30, 1, 32, 13, 78, 89, 83,182,111, 34,238,165,100,204,203,158, 43, 89,131, 31, 38,196, + 82,149,167,224, 91,126, 82,146,127,101, 72, 27,157, 40,216,210, 67, 1,105,239, 78, 37, 35,212,135,166,123,149,151, 38,172,206, +236,246,202, 34,114,140, 98,230,176, 12,153, 24,243, 15, 37,171,165,189,231, 79,196,180, 48,218,195,237, 86,164,113, 32, 16,154, +234,175, 88,163,247,248, 82,145,255, 0, 50,160,224,243,218, 56,131,225,196, 45,140, 11,204,190, 19,203,130,226, 27, 47,111,220, +151,154, 41,149, 35,202,111,231, 57, 60,129,253, 80, 57, 37, 67,233,232,117,231, 81,204, 96, 60, 22,142,221, 86,187,222, 10,110, + 25,140,118, 26,105, 75,134, 26,145, 46, 26,169,240,135, 80,162,217, 79,210, 42, 14,180, 50,243,182, 87, 6,230,163, 24, 2,150, +111,140,220, 49, 75,131,144,165, 2, 42, 18,191,169, 64,255, 0,163, 83,174, 66, 97,213, 41, 85,241, 20, 2, 42,229, 90,166, 72, +186, 73,221, 8, 7,201,175,138,149,208,254,157, 53,196, 78, 32, 4, 90,225,179, 84, 49, 17,175, 98,107,185, 41, 74,188,227, 41, +166, 0,241,242,131, 75, 73, 63,245,200,208,182,195,110,213,107, 85,212,121, 94, 11, 22,187,164,115, 63,117, 73,235,175, 79, 18, + 94,130, 36,144,238,248, 99,214,199, 60,248,134,130,189, 6,194,191, 70,141, 11, 25, 52,163,185,121,139,115,106, 34,124,137,199, +141,126, 26,145,162, 56,146, 1,172,133, 62, 26,152, 36, 42, 19,129, 77,245, 41, 4, 29, 68,133, 49, 30,196, 94, 51,209,222, 71, + 39, 64,229,227, 90, 13, 12,197, 56,116,177,220,190,215,225, 29,201,179,155, 70, 79, 9,185,112, 65, 42,104,168,113,117,135, 10, +105,230, 50,177,241, 37, 67,218, 14,254, 32,141,180,124, 92,203, 49,229,186, 36,133, 11,105,141,161,164, 29, 86, 51,187,125,124, +236,117,129,119, 8, 9, 85,207, 13,132,193,101,169, 45,167,241,217, 43,216,173,244, 32, 80, 19,176, 11, 27,125, 26,236, 49,122, +172, 50,190, 19,164,187, 57, 31, 5,147, 60, 73, 81,222, 23, 56,119,183, 43,255, 0, 57,228, 46,220,150, 71,201, 50, 41,205, 32, +211,151, 37, 18, 7, 90,245, 39,236, 26,218,198,131, 5,151,151, 99,164, 1,120,135, 6, 42,227,215,139,238,116, 52, 38,164,129, +182,222,237, 92, 4, 5, 73,208,231, 81,113,154, 92,243, 29,226, 7, 21,249,116, 38,160, 36, 10,251,182, 30, 58, 40,135, 53, 2, + 84, 56, 88,172,139,236,241, 30, 18,194, 94, 59, 30, 7,153, 59,248, 15,110,218,143,149,185, 32, 85,247,216, 94,203, 66,189,221, + 80,220,183,188,215,194,195,105,136, 79,152,176,163,181, 21, 82, 16,157,235,177, 63, 73, 26,167,146,118,112, 90, 88,181,191, 21, +245, 51,242,253,236,206, 11,219,120,102, 61,202, 67, 75,188,188, 60,213,165, 73,142,167,210,145,189, 2, 80,186,128, 43,182,196, + 87,122,141,113,189, 78,114,153,101,211, 98, 87,180, 46,237,198,125, 28,246,183,189,157,175,148,223,114,236,241,231,181,112,108, + 42, 60,213,199,104, 77,100,165, 33, 72,117,167,136, 14, 37, 84, 32,138,212, 26,110, 8, 38,185,209, 50,137,248, 79, 5, 91, 47, + 48, 87, 33, 21,203,254,160,125, 46,102,254,156,103, 63,121,197, 60,235,183,108,190,100,202,141, 37,107, 65,151, 17, 64,173, 42, +109,228,142, 37, 72, 40, 9,248,146, 15,191,218, 79, 28,152, 88,123,214,165, 80,148,195,128,171, 43,119,118,162, 50,228,146,183, + 43, 6, 66,152, 99,133,105, 68, 58, 82, 91, 35,222,146, 79,217,162,154, 83, 3,170,108,194,187,187, 17,196, 33,217, 78,254, 8, +154, 28,128,180, 30, 42,143, 33, 36, 10, 84,111, 66, 66,210,124, 40,125,218, 28,233, 41,221, 94, 7, 38,180,102,208,164, 34,208, +190, 50, 91,100,201, 97,134, 86,144,234, 74, 85,247, 19, 93,137, 66,129,225, 93,142,192,236,117, 66, 0,197,157, 57, 84, 95,114, + 47,177,173,179, 26, 92, 71, 40,171,179, 50,156,137,112,100,169, 11, 50,227,178, 86, 26, 82,118, 1, 84,109, 73, 32,130, 71, 17, + 90,128,107,177, 68, 73,246,126, 10,165,211, 0,169, 61,155,238,156,140,170, 60, 91, 68,169, 73, 18, 90,142,210,208, 69, 7, 39, + 7, 31, 53, 32, 13,184, 45, 10, 65, 72,246,125,154,158, 77, 27, 92,170,245,220, 74,177,175,151, 70, 27, 76,139,171,235, 10,227, +197, 47, 19,253, 71, 17,243, 27,211,251, 72, 58,169, 30, 44,167, 46,107,155,123,173,220, 39,211, 5, 54, 73, 36,148,202, 18, 37, +188, 65, 39,156,117,220,156, 72, 31, 95, 45,110,227, 86, 31,193,101, 93, 50, 64, 84, 86, 87,150, 79,145, 46, 75, 11, 81,242,252, +233, 1, 42,175, 82, 86, 71,216, 91,223,234,214,188, 32, 4,125,139, 50,115, 46,130, 49,148, 43,231, 20, 92, 81, 8, 90,156, 75, +117, 63,247,105,225,250,211,162,109,100, 35, 45, 81, 72,189,203,133, 56,187,109, 82,249, 47,159,195, 83,238, 4,143,171, 76, 43, + 98,164,233, 10,225, 96,238, 87,113,163,204,145,130, 91, 94,145,101,140,241,139, 50,114, 80,165, 52,218,150, 66, 19,184,218,164, +157,170, 69,126,202,200,228,194, 5,137,213, 26,172, 41,204,110,109, 23, 60,119, 27, 5,238, 30, 31, 42, 99,121, 45,189, 97,165, +168,199,243, 24,230,146,219,174,213,109, 18, 22, 7,194,105, 74, 26, 26,235, 78, 17, 19, 26, 21, 90,202,140, 75, 21, 92, 68,237, +150,112,213,209,217,210,225, 56,235, 9, 82,159, 1, 3,115, 65,189, 82,189,254,192,122,105,126,214, 96,160,144,143,227,208,238, +110,202, 67,112,137, 18,192, 79,225, 40,148,172, 20,171,116,241, 52, 87, 93, 72,195, 84,195, 85,216, 93,139,176, 74,200,109, 81, +241,249,132, 42,228,128, 37, 50,211,180, 80, 10, 4,186, 40, 83,211,116,157,143,142,174, 13, 7,138, 34,180,123,179, 17,120,221, +174,197,112,144,158, 15,220,100, 72, 81,108,242,248, 84,133,142,104, 5, 71,113,241, 2, 61,128,143, 29,124,131,234,156, 93,153, +153, 29,130,115,252, 79,253,190, 10, 35, 73, 41,184,164, 2,208,113,242, 55, 75,100,129,254,240,211, 92, 93,147,254,154, 32, 26, +171, 58,212,132, 88,123,125, 26,115,244,249,153,238, 45,165,159,111, 21, 33, 35,245,104,181,203,114,104,142, 40, 86, 55, 41,153, + 56,124,233,210,232,126, 97, 82, 98, 30, 94, 33,164,168,234,112,135,198,166, 36,200, 39,105, 46,105,136, 99, 71, 87,245, 84,202, +189,202, 64, 38,191, 97,212,188,183,145, 67, 37, 39, 92,110,175,197, 85,237, 79,157,153,113,212,180, 79,137, 42,165,126,205, 88, + 48,102, 79, 25, 56, 68, 34,228, 45,217,177, 24,240,246,249,242,150,165, 45, 94,197,169, 93, 63,234,211, 76, 34,197, 50,237,223, + 88,147, 83,111,245, 23,148,161, 63,186,145, 37, 43, 85,125,139,140,211,168, 63, 97,215,179,117, 96,247,207,237,200, 46,119, 44, +127, 80,248,170,187, 30,122, 68,137,170,105,165,148, 80, 23, 91, 88,234,149, 32,243, 4, 31,113,213, 8,157,186,160, 18,172, 79, + 86,221,152,205, 61, 76, 68,183,122,132,236, 68, 21,223, 50,119,154,108,101,184,229,184,133, 92, 33,203, 44,165,167, 93,110, 53, +121,184,203,138, 72, 82, 75, 96,154,147, 80, 41,183, 51,234,127, 77,221,153,121,203,198,142,253,195,227,136,249,132,185,150,230, + 15, 29, 57,186,233, 49,114, 35,108,123,210,119,167,143, 72,125,229,190, 34,114,123,185,103,155,131,246,250, 4,152,206, 76,190, +101, 17,157,183, 33, 49,184, 31, 56, 71,110, 90, 82,227,174, 17, 80,132,161, 38,170,166,177,176, 61, 29,151,145,108,101,100, 13, + 80, 4,110, 50, 12,195,184, 29, 73,236,239, 68,156,196, 65, 39,130,116,239,159,112, 45,189,205,205,239,153, 6, 56,130,214, 56, +201,106, 13,165,162, 56,148,195,138,210, 98, 50, 56,239, 67,193, 9, 36,123,117,232,153,243,140,236,120,252,188, 7,128, 12, 23, + 55,125,190,100,201, 74, 44, 76,118,110, 56,150,191,237,227,146, 18,125,186,164, 96,199,197, 87, 7, 86, 78,183,108, 43,183, 25, +143,166, 11, 38, 41,149,231,145,241, 43,100,171,244,140,131, 37,133, 14, 51,151, 11,181,193,168,172, 38, 44, 24,233, 97,133, 36, + 37,176,162,226,130,157, 80, 72, 85, 8, 4,141,173,100,244,216,230, 97,198,169, 90, 33, 29,196,203, 71, 37,180, 1,191,138,215, +196,186, 21, 87,169,212,160,184,158, 63,232, 55, 4,200, 92,135,143,226, 89, 37,254, 67,173,173,183, 39,223,111, 77, 66, 43, 10, + 77, 85, 70,109,237,241, 0,211,109,235,170,149,250,119,165,194, 45,178,115,241,147,126, 10,103,169, 1,192, 47, 29,245,239,126, + 47,221, 46,225, 89,101,227, 86,135,172,241,173,246,168,246, 7,155,151, 47,231, 93,124, 70, 74,154,105,229,188,164,165, 74, 95, +150, 82,146, 85,185,166,182,114,108,133,177,137,136, 32, 8,129,169,115,167,122,206,201,200, 22,201,217,150,188, 17, 51,111,127, + 39,141, 64, 28,231,202,117,184,236,183,253,103, 92, 88,109, 35,235,174,179,225, 81,148,192, 28,208, 56,232,165,247,159,191,190, +156,189, 60,100, 83, 59, 91,108,237,251,121,155,182, 9,170,181,100, 87,203,197,210,108, 55, 37, 76, 97, 94, 92,161, 17,184,191, + 11, 40,109,208,164, 37, 70,164,211,112,122,156,174,161,234,156,124, 44,153, 81, 10,119,236,210, 82, 50, 33,200,208,128, 7, 13, +121,173,216,225, 87, 17,168,114,160,230,150, 46,223,231, 56, 29,183,191,189,133,113,243,218,201,243, 21,104,184,218,238, 10, 74, +230, 88,238,236,183,231, 42, 27,203, 78,203,109,109,144,182,151,226,157,149, 67,215,102,171, 41,201,160, 95, 75,237, 37,136, 60, + 98,123, 63,129, 89,185,216,222, 86,163,129, 67, 96, 60,136,206, 55, 25, 70,141,172, 23, 86, 62,144,116, 40,157, 85, 14, 73,163, +211, 78, 43,142,247, 11,187,208,172, 57, 82, 11,184,172, 4, 74,188, 92, 34,160, 84,200, 98,223, 29,114,203, 84,218,188,212,128, +147,238, 39, 87,240, 43,140,172,248,184, 0, 73,246,106,173, 98,212, 39, 48, 10,230, 63, 80, 29,195,202,251,241,220,137,253,204, +206,101,169,219,149,201,101,166, 34,133, 31, 34, 12,118, 84, 67, 17, 99,167,162, 27, 66, 77, 0, 3,222,119, 36,235,202,122,183, + 83,179, 50,211,108,203,147,247, 14, 64,119, 5,209,194, 46, 85,241,216,110,245,218,251, 61, 62,221,138,231, 77,200,184,118,110, +255, 0,102, 17,114,139, 84, 98,149,175,205,142,149, 22, 37,199, 67,138, 74, 82,251, 75, 9, 33, 85, 27,109,236,161, 61, 61,234, + 47,244,235, 12,109,115, 76,180,144, 31,113, 29,224,165,101, 66, 96,131,192,171,122,251, 19,211,246, 95,217,188,171, 60,237, 93, +190,236,155,181,165, 86, 72,226,227,127,121,142,110, 34,224,242,210, 66, 89,134,124,177, 68,183,185, 53,235,182,189, 11, 3, 63, + 19, 62,139,101, 76,102, 54,109,214, 77,252,196,242, 26,114, 89, 89, 56,144,174, 14, 29, 80,179,101, 7,221,115,203,251,233, 88, +169, 30,202,211, 72, 6, 11, 53, 91,125,234,207,187, 87,233,130, 60, 12, 29,236, 78, 62,103,220,159,149,139,112,188, 79,191, 59, + 33,152, 77, 51, 45,148, 72, 12, 68, 98, 43,137, 36,132, 56,144, 92, 89,168, 61, 5, 54, 21, 58,215, 94,171,165, 88, 41,141, 66, +201,176, 50, 50,225,168,118, 0,119,115, 91,152,248, 16,216, 12,181, 37,126,229,150,236, 6,225,135, 90, 59,175,217,214,156,139, +219,236,161,153, 11, 69,170, 83,133,231,109,179,224, 58, 24,155, 24, 56,170,169, 72, 28,146,164, 40,238, 65,213,225,109, 89, 53, +195, 34,160, 68,102,250,118, 17,161, 31,193,103,230,227,138,165,167, 2,180,122,109,183, 38,239,223,187, 62, 53, 51,226,180,221, +226,222, 44, 18,144,122, 45,169,246,185, 12,208,143, 17,201, 64,253, 90,179,210,198,235, 60,179,194, 96,143,120, 42, 24, 71,250, +129,115, 11,248, 99,118,254,224,206, 79,151,196,159, 59,203,219,163, 81,210, 26, 10,250,212, 14,188, 10,252,131, 29,123, 23, 77, + 24,104,138,217,187, 81, 30,211,143, 88, 23, 53, 63,197,207,122, 76,182,185,117, 40, 85, 87, 79,160,128, 53, 44,174,160,108,136, +101, 24,195, 86, 85,175,119,123,125,111,154,228,139,203, 45,114,121,109,242,140,138,126,211,138,226, 1,254,233,174,180, 41,234, + 59, 76, 98,152, 84,238,146,178, 78,206, 58,155,189,178,218,161, 70, 83,228, 45,253,190,242,156,112, 42,154,208,167, 59,112, 62, +212, 51, 83,178,222, 59,112,143, 48,176, 16, 60,144,248, 73, 20,218,134,164,106,183,238,116,119, 68,217,170,185, 46, 6, 29,222, + 15, 36,211,207, 72,251, 70,189,164, 21,220, 58, 95,118,209, 30, 90, 75,106, 77,107,245,234,105,221, 9,185,246,229,155,130, 15, +150,146, 2,182,168, 26,136,179,106, 36,117, 74, 55,124, 6,253,140,201,249,142, 10,242, 1,217, 64, 18, 8,250,181,106,187,196, +184,168, 74,178,165, 91, 35, 42,117, 23, 29,194,220,161,213,165,110, 21,244, 19,166,144,230,144,151,106, 42,214, 61, 38,224,215, + 20,168,161,241,251, 39, 65, 42, 78,203,212, 75, 92,219,115,230, 52,214,234,218,197, 21,226, 8,233,184,241,211,143,135,130,129, + 59,149, 21,234, 63,208,180, 44,173,147,146,118,156,162, 12,178, 84,185, 22, 83,240,196,123,157, 74,212,209, 20,242,150,122, 1, +247, 63,187, 90,235,167,233,125,124,193,161,102,163,183,159,183,181, 99,102,244,221,239, 40,104,123, 23, 14,101,248,214, 73,137, +100, 50,173, 55,200,111, 68,157, 8,165,153, 13, 73, 73, 66,195,138, 10,226,170, 31, 3, 77,136,216,245,241,215,105, 77,145,178, + 59,162, 92, 21,206,217, 19, 2,196, 49, 95,150, 56,243,166, 66,243, 86,176,175, 49,124, 93,173,121, 10,109, 79,179, 86, 68,180, + 67, 26,167,140, 50,210,196, 69, 0,243,124,210, 54,218,160,241,173, 65, 0,236,105,239, 7, 80,220,166,174,254,209,100, 16,241, + 7, 13,202,223, 25, 8,185, 10, 3, 33,180, 32, 40, 36,110, 10, 65, 4, 3, 94,180, 26,171,116,119, 43,248,243,101,214,126,154, + 59,223, 6,239,152,218, 96,220,167, 60,200,149, 41,152,142,185, 29,109, 33,213,121,138,224, 18,165, 55, 74, 39,125,245,207,117, + 42, 76, 32, 72, 11,160,233,214, 9,216, 1, 58, 47,173, 86, 14,254, 99,216,182, 46,204, 11,108,198,196, 8,108, 54,196, 84, 37, +196,148,209, 45,241, 32, 20,166,135,114, 42,117,194, 79, 34, 92,215, 68,125, 59, 27,100, 11,113,251,118,165, 76,191,186,182,108, +206, 2,162,185,228, 59, 29,242, 67,168,114,132, 40, 10,164,141,246,221, 36,142,154,165, 60,137, 30, 28, 87, 77,131,209,133, 61, +189,139,230,247,174, 76, 46,233,216,220,185,140,174,206,226, 21,128,223,222, 66,161, 54,195, 33,148,196, 91, 85,113,108,172, 35, +111,187,203,137,234, 71, 94,149,215, 95,209,114,198, 76, 54,159,152,113, 88, 62,160,233,135, 22,123,192,248, 15,220,126,223,139, + 42,223,181, 29,218,158, 83, 14, 4,213, 31,226, 38,121,234,169,173, 22,167, 80,234,142,254,192,154,125,122,218,182,142,107,148, +243,151, 65,118,163,186,146,237,249, 60, 91,219,114, 9,101,198,158,143, 41,165, 29,212, 30,142, 92, 7,221, 78, 21,250,117,153, +125, 0,197,187,255, 0, 52, 72, 95,171,170,135,186, 93,218,125,235,253,206,198,251,223,195,177,119,102, 83,107, 42, 53,109,197, +165,229,184,164, 87,160, 82, 86, 80, 64,240,160,240,214,182, 37, 13, 16,123,149, 11,174,212,133,239,179,217,244,203, 52,235, 85, +226, 10,248,182,133,173,185, 59,254,203, 47, 58,223, 33,254,192, 63,111,187, 70,190,177, 39, 5, 6, 19, 96,175,123, 15,120, 23, +124,193, 89,122, 83,188,190, 98, 20,178,233, 87,253,227, 16,193, 7,233, 5,103, 89, 39, 31,108,253,191,154,179,230,184, 92,241, +221,204,245, 45,222, 98, 54,240,248, 98,176,203, 85,222,171,109, 78, 7,192,167,247,137,214,214, 53, 47, 19,226,179,111,177,136, + 85, 46, 91,148, 63, 62, 65,184, 69,116,121, 1,231, 18, 7,180, 34,160,127, 72,214,148, 52, 12,168,207, 82,129,101,121, 19,144, +113,200,119, 20, 44,135,131,166, 50,169,212,169,105, 38,191,104,175,215,166, 5,138,137, 9,123, 19,205,237, 48,175,197,171,227, +139, 84, 93,199, 6, 9, 11, 83,202, 85, 82, 43, 77,146,161,212,143,187, 93, 14,251, 8,210, 60, 85,252, 44, 77,229,229,193,116, +150, 51,222,172, 82,219,137,196,194, 49, 11, 67, 86,235,123, 42,112,186,220,100,130, 30, 90,220, 60, 20,235,148,243, 29, 80, 4, + 10,175,169, 72,218,189,105,195, 12,153, 25, 18,175, 91,113,136,218, 2, 86, 93,148,156,133,216,210,217, 74,172, 50,211,197, 49, +228, 36,173, 36, 3, 93,130,106,160, 5, 73,175,244,215, 90,245, 75,104,112,177,173,153, 39, 84,187,220,236, 38,203,140, 74, 83, +207, 50,201,181,188,180, 54, 27,108, 23,252,162,180,113, 80,109,101, 45,184, 0,167,237, 38,163,219, 93,106, 81,145,185, 87,153, +101, 93,199,237,229,182, 69,248, 67,156,231,148, 21,196, 70,117,142, 43, 91,110, 18, 20,148, 87,110, 66,155, 26,244,247,234,193, +105, 40, 5,125,122,121,194,110,243,167, 53,112,132,219,107,156, 36, 46, 19,133,191,133,178,150, 18, 27,228,146, 61,164, 80,143, +125,117, 32,166, 29, 48,250,142,185,174,235,220, 28, 95, 19,165, 91,114, 49,146,163,200,138, 58,218,128, 74,183,235, 81, 84,154, +251,107,225,175,150, 61,127, 95,149,159,151, 31,239, 72, 55,137, 17, 47,237, 67,118,159,130,147,140,223,218, 82, 37, 44, 80, 54, + 84,148,164,251,147, 83,182,188,226,218, 14,208, 18, 22,166,254,239,228,200,178, 98, 56,197,173, 6,143, 37,145, 49,225, 90, 16, + 93, 81,115,127,209,167,170,163,230, 1,220,164, 39,240,186, 0, 47,206, 69,237,213,174, 27, 74,163,242, 30,126, 82,141,105,179, +170,220,159,171, 87,235,168, 57, 80, 54, 49,101,227, 8,112,219,224,221,174,107,216, 50, 92, 45,215,193, 42, 80, 21,250,244,140, + 62, 36,192,238, 9, 74,229, 53, 55,219,155,204, 55,251,128,162,252,138,123, 43, 90,125,122,156,131,106,137, 29, 2,247,104,103, +249,222, 89, 10,221, 44,129,111,105,192,236,195,224, 27, 64,230, 71,216, 41,160,119,169, 14, 43,186,125,104,188,183,253, 67,223, +228,126,194,154,179,184,145,237, 83,150, 72,174,126,181,107,217, 58,128,254,177,239, 3,240, 11, 3, 51,252,217,125,185, 37, 76, + 27, 13,189, 79, 67,217, 19, 12, 45,120,221,188,183, 26,108,180,138,161,167, 95, 74,150,132,174,157, 57,132, 40, 38,189,104,117, + 74, 80, 59, 12,155, 69, 85,139, 58,147,125,187, 77,182,184,155,157,177,247, 35, 56,210,168,211,172, 45, 77,173, 42, 72,169,162, +144, 65, 27,106, 0,152,151, 26, 20,129,100, 45,156,223, 40,189, 72,126,227,124,185, 74,156,233, 96,180,223,206,200,117,254, 7, +221,230, 40,211,234,213,137, 89, 41,233, 34, 74,121, 18,120,173,150,102, 46, 45, 99,162,239,229, 56,109, 92,252,151, 36,240, 87, +148, 30,113, 37,105, 65, 95, 78, 68, 36,144, 43, 93,181, 94, 96,152,187,112, 44,152, 5,190,198,130, 29, 43,115,104,142, 40, 16, + 61,195,174,154, 96, 16,132, 35,241, 58, 51,115,141,217, 78,217,246,148,250,131,239, 95,243, 75,165,142, 69,221,252,106,217,142, + 99,233,101,130,252,150, 99, 38,103,241, 83, 31, 81,242,154, 40, 87,236, 32,171,217,169, 93,147, 78, 21, 34,235,132,165,186, 76, + 0,237,103,212,242, 11, 79, 31, 22, 54, 71,113,224, 21,117,117,252,206,108,214, 27,188,104,253,174,236,230, 31,110,183,189, 68, +135, 50, 6,102, 95,229,182,145,236,126, 67,140,138,211,199,134,177,163,235, 25, 23,242,232,132, 71,123,200,251,244, 90, 35, 30, +184,240,136, 77, 93,142,245,121,223,206,255, 0,122,128,135,219, 91,109,143, 3,199,113, 70,173, 87, 12,150,249,127, 86, 25, 30, +111,242,248, 22,216,198, 67,174,249, 65,212,169, 64,168,161, 0,114, 27,168,106,223,167,189, 67,151,212,136,131, 87, 29, 9, 39, +102,128, 14,231, 80,156, 33, 25, 31,132, 48, 29,138,242,133,234,139, 4,181,199,118, 52,108,227, 32,117, 72,253,226,176,188, 99, + 22,199, 25, 88,175, 68,185, 33, 50,100,164,125, 6,186,233,103,108,153,141,243,255, 0,193, 24, 71,241, 4,170,135, 62,184,240, + 7,216, 0, 85, 31,115,113, 79, 68, 89,163, 87, 89,249, 76, 12,217, 51,167, 62,171,140,235,132, 75,189,165,217, 46, 62,242,252, +215, 29, 34, 76, 82,146, 84,163, 85, 87, 92,253,158,156,233,214,218,102,124,221,197,201, 59,135, 63, 98,111,245, 56,240, 98,188, +224,119,207, 75,221,171,236, 78, 95,218,174,204, 77,201,231, 92, 50,105,214,171,154, 27,203,152,181,134,226,185, 1, 74, 74,203, +110, 91,220,220,173,181,208,213, 30, 3, 90,152,216, 56,248, 52, 78,186,204,142,242, 14,173,163,120, 33,228,230,194,202,200, 14, +151,228, 93, 25, 98,120,113, 71,224, 67, 4,111,238, 77,117, 82, 80, 89,145, 58, 47,206,203,247,122,239,218,142,227,218,251,147, +104, 74, 93,147, 21,213,173,113,220, 52, 67,204, 44, 22,157,105, 93,118, 91,106, 41,173, 54,174,174,209, 97,166, 98, 67,146,177, + 77,134, 18, 4,114, 94, 59,137,232,169,158,231, 95, 30,205,125, 43,223,237, 83,240,139,140,165, 92,134, 49,123,184, 69,180,221, +236,229,127, 26,162,169, 19,150,134,221,105, 4,241, 67,136, 89,168,235,210,167,148,234, 30,143,149,182, 25,226,152,152, 31,229, + 37,140,123,181,226, 7, 34,235,160,175, 42, 19, 14,234,207,193,187,127,219,175, 78,141, 68,203,251,173, 34,209,151,119,125, 48, +159,137,105,197,227, 41,187,165,166, 17,120, 81,201, 55, 7,147,248, 78, 41, 40,170, 82,210, 9,220,214,189, 10, 99,210, 61, 53, + 14,159, 57, 93,147,178,201,240,140, 62,104,135,231, 46, 68,183, 47,176, 29,249,177,128,104,151, 40,142, 91,234, 19,183,247,142, +203,221,240,251, 22, 31, 19, 27,190, 94,157,133, 37,249, 22, 21, 45, 16, 92,249, 7, 84,180,164,198,113, 68, 53, 64,181, 83,129, + 53,232, 70,186,154,206, 61,117, 78, 53,212, 32,102,207,183,129,110,238, 92, 79, 5,159,118, 97,178, 27, 72, 84, 93,150, 98, 20, +234,156,116,213, 11,228,165,127, 70,129,104, 84, 66, 51,249,151,221,221,183,247,206, 68,164, 26, 33,203, 77,137, 41,250, 21,104, +140,173,190,205,113,190,180,139,245, 25,127,195, 31,249, 66,233,227, 47,128,120, 38, 47, 79,247,135, 30,244, 51,100,184, 74, 36, +249, 25,109,250, 18, 9,240, 14, 64,134,225, 27,255, 0,106,186,232,122, 4, 63,252,104, 29,150, 75,240, 11, 47,170, 73,196, 83, +247,165,230,131,190,163, 48,247,218, 20, 73,152,167,200, 62, 8,242, 86,218,126,210,117,173,210,166,249,113,241, 85,113,116,156, +124, 85, 63,150, 98,137, 70,117,124,156,249, 2,136, 22,230, 0, 27, 5, 58, 82,179, 79,180,235,231,188,191,148,142,101,116,224, +162,253,205, 49, 19,145, 66,152,210, 2, 45, 22, 56, 72,106, 50, 70,220,156,224, 83,250,183,208,161, 91, 17,216,156, 21, 82, 32, + 70,187, 72,181,166, 74, 69, 29,144,183, 0, 62, 40, 10, 36,125, 85,211,204,203,121, 61,131,248, 34,196,124, 46, 84, 5, 69,110, +243,147, 77,153,196, 24,208, 92, 15,171,109,130, 35,165, 71,127,175, 90,120, 78, 3,118,160,146,197, 6,249, 62, 56,159,243,178, +159,226, 22,239,204, 1, 79,217, 64,223,244,168,105,183,107,237, 70,219,162,210,213,198, 76,111,133,192,125,202, 4,235,222,215, +103, 40,130,189, 70,190, 8,242,131,206,138,182, 79,197, 77, 76, 20, 57,197, 60,225, 50, 45, 55, 7,146, 93, 0,182,122, 19,181, +126,157, 6,209,162, 45, 51,218, 85,158,174,216, 98,153, 61,167,136,109, 10, 81, 79,179, 89,147,186,112, 43, 82, 2, 51, 10,157, +207,251, 10,238, 51, 57, 83,108,131,148,112, 74,203, 43,220,127,178,122,141,104, 81,155,187,138,171,118, 59,112, 65,237,177, 26, + 7,138,218, 33, 73,251,220,190,242,126,143,110,173, 25,186,169,181,184,169, 87, 27, 75, 18, 69, 20, 7,149, 79,190,158,163,236, +211,137, 40,237, 8, 47,155, 50, 10,212,211,136, 46, 50, 13, 2,210, 55,167,188,105, 55, 52,198, 42,185,239,239,167,110,218,119, +231, 29,118, 53,226, 58, 90,190,165, 11,242, 37, 52, 2, 30,108,169, 5, 53, 74,169,191, 90,208,212, 87,195, 90, 24, 29, 82,220, + 66,241, 58, 30, 71,129,254,213, 87, 35, 18, 23,134,144,246,243, 92, 37,221,223, 78, 25,167, 98,239, 74,118,238, 21, 38,202,242, +138, 19, 45,180,168, 52,239, 30,133, 85, 39,138,233,185, 4,239,224, 72, 7, 94,133,129,212,171,202,143,194, 88,243, 31,110, 43, +151,202,195,157, 7, 94, 29,168, 86, 61,149, 54,194,145, 22, 69, 20,132,154, 37, 96,169, 42,219,219,199,199,219,177,213,210, 85, + 80, 89, 89,248,205,225,248,240,147,113,134,148, 60,201,253,180, 16,161, 83,181, 10,122, 3,245, 3,168, 29, 17, 99, 37, 41,174, +238, 93,241,124,142, 45,226,219,206, 37,205,165,130,135, 16,148,182,107, 95,105,241, 30,243,170, 89, 53,137, 68,133,167,133,121, +132,193,236, 43,179, 59, 47,235, 90,118, 73,132,177, 29,233, 74, 91,170, 64, 9,117,213,158, 92,147,214,160,239,183, 77,113,121, + 61, 52, 9, 21,233,248,157, 68, 89, 16, 85,249,218, 30,246,183,123,136, 45,207,200, 31, 54,165, 4,148, 2, 9,228,122,116,219, +166,176,242,240,246,133,208, 99,230, 3,170,129,221, 75,189,131,212,149,182,251,216,153, 74,109, 51,225, 71,114, 67,114, 85, 74, + 53, 37,176,162,205, 85,227,241, 1, 93, 71, 7,118, 53,177,179,147,162,231,152,229, 99, 74, 0, 57, 63,143, 34,184,187, 19,131, +113,133,116, 97,137, 73, 45, 63, 1, 10,243, 80,126,242, 93, 46, 20,172, 26,120,133, 10,107,210,228, 1,136, 35,154,241, 91, 30, + 50, 32,232, 85,181,141,203,184, 65,156,196,182, 84,124,132, 37,194,231, 93,146,168,197, 0,253, 90,161, 42,193, 26,166,220, 80, + 28,187,181,119, 75,245,237,204,134, 85,105, 37, 97,231, 19, 79,219, 65,165,127, 70,174,213,112,132, 64, 64,157,102, 69,212,155, + 94, 57, 55, 29,183,185, 9,196,148,184, 10,232,105, 74, 23,208,231,255, 0,105, 90,132,236,220, 83,109, 32, 34,118, 76,142,243, + 27, 15,143, 96,109, 42, 75,173, 51, 45, 10, 82,171, 94, 50,184, 32,125, 96, 38,154,140,224, 55, 19,246,226,150,226,147,251,133, + 14,227,120,187, 57, 36, 54, 74, 24,226,128,104,119, 67,116, 41, 63,104,213,170,102, 34, 21, 75, 34, 74,172, 46,214,123,163, 81, + 67, 41, 73, 73, 87,152, 57, 17,176, 80,116,172,126,189, 92,222, 10, 15,150, 82,127,116,110,146, 98, 97,178, 3,202,225, 49,181, +180,235, 35,218,243,106,224,138, 15, 29,149,184,212, 37, 38,213, 18,186, 12,228, 34,150,240, 12,102, 82, 75,119,155,138,150,252, +233, 69, 43, 95, 37, 16, 7, 33,208, 83,192,109, 77, 84,149,142, 87, 83, 78, 56,128,101,117, 98,205,173,134,153, 72, 36,190, 40, +180,121,135,126, 67,196,215,111,209,165,251,150, 66, 56,130, 68,186,182, 32,193,178,220,123, 93,123,184,222,164,134,154,180, 70, +143, 46, 50,129, 13,148,121,151, 8,209, 28,162,148,170, 84,135,126,186,104,184,121, 15, 34, 22,103, 83,195,217, 7, 85, 53,237, +200, 57, 23,150,235, 18, 80,107,178,148,219,203, 82,148, 0,168, 35,137,161, 27,248,141,134,182, 33, 32,185,151, 40,198, 15,219, +216,183,251,204, 86, 60,146, 32, 50,124,197,238, 82,183,156, 82, 58, 14,148,160, 31,210,119,213,168, 88,200,128, 58,185,187,117, +149,219,172, 86,168, 24, 6, 28,216, 69,214, 20,199,166,206,144,178, 74,156,121,213, 49,230, 33, 30,208, 2, 64,160,235, 74,141, + 91, 5, 25,212, 14,249, 89,203,119, 75,119,112,214,162, 84,212, 87,173,143,131,241,112,144,151, 60,218,130, 42, 40,176,121, 87, + 94, 1,245,115,165,145,124, 47,143, 9,176, 62, 35, 71,247, 0,161,111,106, 90,196,238, 14, 79,121,168,140,159,223, 40, 39,233, + 42, 35,145,251,117,229,102,151, 37,101,206,198, 83,251,243,152, 57,113,201, 28,136,209,248, 80, 89,183, 70, 64,240,109,150,194, + 84, 71,215,160,209, 91,205,251,149,160,126, 21, 51, 35,113,225,252,154,198,131,198, 59,104,105,201, 10,246, 0, 57, 4,253,103, + 86,170,172,110,240, 77, 45, 75,173,153,109,239,252,187,136, 4, 54,120,189, 61,110, 45,193,226, 25, 97, 60,135,218,173, 6,208, +243, 86,171, 12, 16, 78,218, 68,121,220, 85,119,137, 67,248,185,239,161, 8,175, 94, 59,154,126,141, 15, 46, 76, 89, 78, 1,202, + 39,112,103,252,183,140,185, 41,161,255, 0,198,174, 69,107, 30,212,160,175,203, 79, 79,112,208, 35,241,104,148,151,114,122,194, + 9,255, 0,199,187,142,219, 34, 21,141,106, 39,197, 70,195, 16,126,161,175,101,234, 31,230,251, 35,255, 0, 40, 88, 89,163,250, +135,237,201, 57,250, 59,202,110, 88,182, 23,220, 86,237,176, 98,221,110, 14,217, 13,229, 54,139,154, 74,227,205, 77,169,207, 53, +214, 10, 65,169, 82,153,113, 97, 52,232,119,161,166,155, 27, 38,116,213,118,192, 36, 68, 55, 49,224,118,241, 30,208,236,167,211, +216,200,131,192,133, 95,100,185,255, 0,163, 44,254, 12, 59,175,249,170,119,110,101,207, 91,138, 69,154,247,108,151,120,136,151, + 74,190, 52,177, 50,217,205,206, 3,162, 75,173,131, 78,186,195,198,235,253, 59, 36,110, 50,149, 71,176,131, 33,236, 35,151,136, + 86, 44,233,129,254, 18,200, 51, 25, 47,162, 28, 22,227, 30, 53,235, 62,184,230, 83,214,225,109, 54,108, 82,203, 42, 8,113, 73, + 79, 42, 57, 54,241,229, 37, 40,254,183, 4, 40,211,166,250,177, 46,179,211,235,212, 88,108, 61,145,137, 31,124,153, 48,233,173, +243, 20,253,219, 78,252,219,253, 88, 99,119,255, 0, 79,150,107, 28, 60, 98,200,212, 72,217, 95,111,172,112, 63, 17,106, 54,183, +157, 76,228, 58,250,199,152,252,151,226,184, 87, 83, 79,185,211,169, 49,233, 62,162,255, 0, 84,157,148,109, 16, 12,240, 3,185, +223, 94,100,131,247, 35,228,227, 15, 45,162, 56,106,171,169, 82, 85,252,192,195,134, 40,195, 53, 97, 20,240, 82,142,228,232,187, + 86, 26, 38,135,112, 46,231,118,250,255, 0,233,127,185, 87, 4,217,172, 55,195, 18,241,143,100, 79,161, 78, 71,180,223, 97, 5, +182,211,143,165, 27,134, 95,105,106,105,197, 10,148,131, 95,105, 6,183, 18, 25,152,242,162,101,156,131, 19,217, 33,249, 17,161, + 87, 48,239, 16,120,158, 5, 83,243, 63, 43,143, 87,232, 66,127,150,216, 34, 92,173,128,186,227,121, 4, 27,205,161, 86,146,216, + 9, 66, 93,249,149,200, 72, 8,161, 42,248,128, 85, 60, 43,182,185, 63,255, 0, 82,207,140,140, 68, 28,118,131, 22,247,186,214, +172,141,174, 72, 87, 44,124, 27, 8,244,213,218,107,166, 9,134, 93, 35,228, 93,229,202, 24,137,109,203,242, 27, 81, 43,183,193, +129, 17, 65,223,229,144, 31, 80, 10,119,205,120, 5, 60,224,162, 84, 18, 19, 67,225,209,244, 62,153, 14,149,142,107,220, 39,108, +190, 98, 56, 0,252, 1,231,222, 86,126,126, 76,100,241,143, 62, 41, 71, 0,199, 37, 95, 93,110,205, 13, 77,183, 58,124,134,160, +176,228,165,134,153, 74,222,113, 45,165, 78, 45, 91, 37, 32,157,201,233,173, 6, 51,144, 3,154,202,140, 31, 68,213,222, 30,234, +122,111,244,179,145, 92,123, 91,117,196, 38,119, 39,186,214,254, 81,111, 50, 46,178,228, 89,108,209,228,160, 81, 77,197,105,148, + 25, 15, 36, 31,135,154,248,165, 95,121, 59, 17,172,222,163,234, 28,110,159,105,168, 86,108,156, 75, 18, 78,208, 15,112,226,126, +204,181,171,233,208,128,248,131,159,185,104,186,100, 29,182,205, 61, 47,225,253,214, 95,109,162,246,243,187, 89,117,217,247,173, + 54,232, 55, 27,140,191, 59, 27,138,217, 96, 76,113,185,138, 1, 30,124,149, 81,186,163,226, 66,121, 37, 84, 58,222,174,248,228, + 99, 70,211, 1, 3, 35,166,167,135,106,169,159, 77,112,136, 17, 12, 79,224,154,125, 49,219,187,120,221,203, 59,205,251,189, 9, +115,187,127,142,227,179,221,184, 69,142,148,169,229,124,195,205, 70, 30, 87, 50, 0, 88, 73, 81, 65,168,162,168,106, 52, 44,123, +107,162, 22, 91,104,120, 66, 36,148, 62,157, 72,178,100, 30, 12,144,251,191,217, 9,221,184,180,195,203, 49, 25, 73,191,246,126, +234,210, 95,199,242,168, 73, 38, 52,166, 92, 95, 32,135,124, 90,125, 35,101,182,186, 16, 65,208,140, 98, 98, 44,132,132,171,151, + 9, 14, 7,248, 30,208,149,248,210,168,235,195,181, 65,177,216,159,110,201, 46, 98,232, 86,150,135,148,159,114,254, 18,127, 78, +170,190,168, 44,133,247, 10,244,187, 61,238, 61,161,147, 69,176,203, 77,159,164,167,146,191, 94,154,138, 92, 19,222,152,201,147, + 19,248,142, 84,174,202,183,159,185, 9,212, 98,233,154,155,127,207,173, 60, 90, 91,174, 54,165, 4, 36,154,114, 32, 36,214,149, +167,142,140, 41,147,110,111,135,243, 83,218, 89,219, 68,185,142, 33,155,133,196, 69,111,104,201,221,103,216,132, 10,157, 70,193, +170, 28,120, 41, 95,154, 3,168,115, 56,196, 46,234, 59,222,241,204,118,229,203,218,132, 91, 67,106, 63,245,155,166,184,239, 86, +197,250,128,151,247,171,135,240, 93, 28, 37,240, 71,192, 39,156, 54,212, 49,207,203,247, 23, 75, 0,164, 59,148, 92,230, 57, 94, +165, 79, 66,142, 43,246,157,116, 93, 5,191, 96,223,250,146,255, 0,150, 43, 59,169,134,140,124, 85,145,233,117, 8,139,223, 44, + 77,247,118, 91,139,138,218, 62,176, 73,213,142,139,255, 0,186,135,138, 6, 57,254,164,124, 85,115,221, 67, 14,207,150,189,110, +114,159,204, 66, 25,157, 32,127, 85,194,209, 0,125,130,186,241, 9,227,153, 88,123, 1, 43,163, 50, 96,171,206,230,230, 95, 63, + 13, 94, 73,163,101,177, 25, 38,187, 41,100, 4,147,245,104,118, 84, 31, 69, 16, 85,105, 47, 40,110, 62, 79,243, 44, 31,224,109, +233, 75, 13, 1,208,168, 10,157, 63,149,161, 86, 4,159, 68,193,135, 52,204,126,216,101,217,116,165, 14,111, 71, 49,153,175, 64, +165,186, 9,250,205,105,171, 20,196,196,132,172, 96, 16, 85,181, 39,249, 11, 86,224, 54, 22,247,102, 17, 77,128, 47,161, 32,254, +189, 75,202,209,251,212,124,213,174, 92, 20, 54,233,216, 20,248, 15,118,189,219,106,237, 55,149, 5,235,104, 65, 42,111,167,176, +233,153, 62,231, 94,109,119,217, 22, 7, 2,155, 36,178, 13, 72, 59,145,169,141, 83,152,171, 35, 7,239, 87,203, 0,219,142, 84, + 29,168, 78,129,118, 48,146, 37, 55,152,113, 76,247,140,246,223,122,136,124,202, 18,161,215,111,101, 53, 76, 99, 16, 85,207,220, + 9, 5, 90,100,228, 49, 55,230,225, 40, 32,215,127, 16,126,157, 92,172, 16, 21,121,144, 86,168, 55, 20, 73,248,217, 1, 47,138, + 5,180,118, 10,250, 43,162, 4, 50,188,207, 76,119, 17,243, 81,255, 0,122, 42, 20,133,117,247,234,109,205, 11, 84,181,115, 75, +115,219, 81, 67, 69, 18,147,247, 74, 77, 14,147,178,148, 98, 66, 91,201,113, 27, 62,115,105,127, 27,203, 34, 55, 42, 11,232, 45, + 56,212,132,213, 43, 7,223,238,246,245, 26,177, 69,210,166, 66, 81, 58,133, 27, 33, 27, 1, 18,224,184, 99,213, 95,166, 92,131, +211,229,193,204,158,200, 29,155,219, 87,148, 18,203,235, 73,113,112,157,240,106, 65, 3,238,158,137, 95, 67,208,239,215,186,233, +157, 98, 57, 49,105, 48,144,251,215, 43,157,211,205, 37,199,202,170,236,111,189, 87,107, 1, 13, 64,243, 71,154,120, 56,208, 37, + 65, 73,167,184,252, 67,254,148,214,176,177,249, 44,240,153, 87,159, 92,174,110,152,238, 36, 52,253, 0, 83,114, 56,173, 59, 80, +109,200, 87,169,167,133, 58,248,106, 38, 38, 72,245,219,181, 60,246,131, 34,153, 98,188, 70,141,113, 82,147, 10, 71,152,242, 66, + 20,126, 15, 45, 65, 38,128,157,133,117,153,155, 88,229,197,116,157, 47, 52,237, 33,248, 43, 55, 9,239,222, 99,100,238,218,172, +214,183, 86,213,173, 70,140, 61,204,146,167,128, 11, 88, 34,187, 80, 45, 7,235,214, 46, 70, 56, 49,220,120, 46,175, 7, 59,121, + 49, 39,144, 86, 6, 9,221,252,195,182, 94,171, 19, 18,254,231, 59,110, 73, 13, 18,136,169, 82,185,181, 78, 73, 39,161,228, 20, + 8,250, 14,178,175,197, 18, 27,187, 22,230, 31, 86,140, 9,131,242, 77,217, 43, 17, 46,185,197,202,247,111,108,181, 26,115,190, +111,150,161, 66,159, 52, 37,222,158,245, 18,117,211,224,218,124,160,235,207,250,236,132,178, 12,135,243,107,248,171, 3, 0,179, +181, 58, 19, 74,112, 5, 58,235, 97, 2,189, 1, 82,212, 55,250,180,214,217,180, 58,204,142,170,196,103, 28,129, 49,216,236,166, +134, 51,213,160,247,151, 21, 95,233,213, 99,105,111, 4, 81, 16,163,100,120, 52, 5, 94,218,142,234, 64,106, 66, 34,241, 52,232, +174,105, 0,159,169, 90,156, 44, 58,148,165, 0,134, 47, 2,130,148, 73,243,155, 9, 12,169,167, 0,166,252, 28, 79, 26, 87,233, + 26, 49,177,208,246, 58,146,215,102,163, 74, 91,241,214,143,137,105, 66,107, 79, 2,221, 18,126,209, 93, 4,228,178,148,105,114, +171,236,167,177,117,177,186,225,111,248,182, 74,130,144, 5, 57, 56,194,202,105,244,150,247,250,117, 98,188,150, 60, 82,253,184, +101, 75,230,189,142,114,239,109, 94, 93,119,143,207, 14,182,212,133,125,208,236,158, 28,119, 62, 33, 27,253,127, 70,161,118,120, +223,177,215, 73,210,250, 25,149, 30,113,209,206,158, 1, 86,157,158,141, 27,184, 87,121,230, 35,129,184,118,194,227,104, 42, 20, + 74,139,100,138, 15,111, 74,106, 2,254,212,246,215,183,146,177,236,144, 30, 97, 94, 90, 10, 92,113, 39,204, 42, 38,164, 3, 65, +211,174,138, 36, 25,213, 98, 20, 47, 83,217,212, 28, 35,182,246,252, 66, 69,192,195,185,223,165,178,169, 17,219,221, 78,219,226, +165,110,184, 93, 10, 60,120,121,193,162, 57,109, 84,215,168,213,206,154, 53, 50,228,177,122,245,160, 64, 67,153, 46,171,188, 71, + 40,141,120,154,220, 12, 97,213, 45,132, 20,243, 75, 68, 18, 58,117, 52, 3, 97, 77,169,236, 30,221,109, 65,202,229,140, 29, 91, +214,254,233,218,123, 95, 99, 13, 52, 10,178,185,161,216,240, 2,190, 63, 41, 33,178,183,164, 45,103,199,116,165, 63, 73, 35,166, +174, 82, 20,192,100, 71, 11,184,187,107,191, 67,186, 91, 92,160, 42,101,228, 44,255, 0, 94,156, 8, 63, 78,227,235,213,244,234, +219,238,211,141, 95,251, 80,251,232, 73, 15,185, 38, 56,113, 0, 1, 64,162,160, 77, 7, 77,233,245,235,204,254,166,211,187, 18, + 50,228, 8,252, 84,173, 15, 20,169,216,220, 62, 85,223, 35, 66, 82, 63,133,133, 29,201,143, 44,141,129, 74,171, 67,245,111,175, +159,108,183, 66,178, 77, 14, 82, 61,250,224,188,139,190, 13,193, 93,126, 88, 56,183, 82,141,246,105, 39,149, 79,247,186,234, 88, +245,109,175,113, 86,246,232,201,238,240,242,174,121,188, 59, 51, 91, 70,143, 24,220,165, 19,213, 74, 85, 66, 19,244, 36, 13, 66, +169,128,242,237, 40,219, 24, 33, 57,103,157,145,205,169, 85, 33,169, 34, 44,111,103, 16, 65, 90,135,211,160,217, 38, 42, 99,130, +105,195, 26,137, 38,208,169,108, 10, 89,173, 69,180, 51,227,205, 73,109,124,143,214,163,170,185, 58,158,242,201, 13, 20, 41, 50, + 25,189, 52,215,204,125,240,121,212,248, 32, 26, 39, 67, 14, 2, 32, 26,133,213,151,143,204,126,229,145,101,118, 24,242,187, 97, +136, 92, 50,107,179, 81,211, 46,101,226, 44,249,142, 22, 99,182,136,172,169, 73,249,132, 38,190, 75, 99,195, 93,193,245,189,164, + 63,147, 89, 35, 71, 32,158,238,212, 9,227,194, 69,200,212,167, 76, 51,243, 13,202,109,113,175,119, 91, 38, 3,132, 91,174,150, +216,174,144,236, 27, 52,150, 9, 14,159, 40,161, 69, 18,194,136, 80, 52, 32, 17, 93, 84,151,175,242,107,151,195, 77, 58,233,242, +159,212,156, 81, 8,157, 0,117,200,221,202,138,236,171,133,158,219, 29, 52, 17,120, 21, 37, 53, 33, 30,107,157, 7, 34, 79, 74, + 13,206,184,218,101,197, 30, 92,150,155,182, 44,244, 11,235,210, 26, 20,122, 37,185,247, 80,186,127,237, 19, 93, 75, 40,250,194, + 57,104,194,225, 8, 30,210, 82,144,114,172, 14,217,103, 23, 94,211,247, 69, 25,102, 38,176,205,255, 0, 26,182,176,245,173,213, + 10,132, 73,170, 64,228, 58, 16,170, 16,161,226, 42, 52, 44, 12,171, 40,178, 54,192,177,140,156, 21, 61,174, 89,116,236,155, 30, + 57,234, 98, 58,251,135,217,166,153,143,220,247, 91, 76,252,183, 5,101,127,196, 51, 33,230,194,220,151,110, 74,183,121,133,169, + 85, 41, 77, 84,130,105, 74, 17,175, 89,233,221, 70,174,175, 31, 50,173, 44,254,104,115,241,143,104, 62,240,177,115,112, 76, 73, + 49,212, 42,138,245,142,173,155,200,143,112,109, 77, 73, 67,190, 75,205,188,146,133,165, 12,142, 42, 5, 42,161, 4,157,180, 98, + 72, 37,249, 44,195, 21,145,108, 75,187,178,136,233, 79,198,165,158, 13,141,201,252, 64,160, 0, 30,225,169,137,178,134,213,111, +118,235,210,254, 87,120,199,227,187,156,200,141,137, 91,238, 82, 18,213,161,204,133, 95, 46,237,194, 75,160, 33,150, 99,176,170, + 56, 66,214, 82, 57, 16, 0, 6,187,244, 51, 24,123, 27,204,144,175,118,145,220, 88,146,120, 0, 21,218,240,231,102,188, 21,123, +148, 97,119, 28, 70,249,113,196,174, 76, 42, 45,194, 51,203,101,198, 28, 20, 83,101, 3,146,171,170,211, 50,129,219, 45, 8,226, +170, 24,237,112,156,174,125,209,194,115, 6,172,249, 7,121,112, 27, 62, 97,157,218, 81, 30, 20, 27,253,197,115, 25,125,212, 51, + 79, 40, 79,110, 51,137,110, 87, 0, 0,252, 80,106, 58,248,213,239,158, 61,228, 78,234, 99, 57,199,129, 46, 29,187, 91, 73,123, + 85,216,103, 74, 33,184,170,247, 44,190,101,253,216,238,196,236,227, 53,116, 59,112,243, 26,102, 35, 45, 32, 55, 30, 44, 72,167, +203,101,134, 26, 79,194,134,210, 54, 0,123,201,169, 36,232,246,102,202,211,175,246,120, 5, 78,217, 27, 9, 37, 58,246,251, 37, +137,219,107,141,233,188,146,218,155,190, 9,149, 91,213,106,191,218,212,226,216, 91,145,158,162,137,101,212, 84,161,196,168, 85, + 38,135,250, 64,225,124, 12,103, 9,141,208,144,218, 71,113,236,239, 82,197,176,211, 39,237, 76, 23, 75, 35, 30,148, 59,117,101, +202,187, 11,113,184,221,109, 25,231,203,193,111,182,249,189,181,139,139, 51, 35, 25, 62, 90, 31,121,152,142, 0,162,162,160,134, +202, 27, 74,150,157,235, 65, 77,115, 89, 66, 93, 2,202,206, 45,178,151,157,255, 0, 74, 81, 5,199,110,135,183, 64,192, 19,174, +186, 46,138,178, 45,131,145,167,122,253,206,114,110,213, 97,150,245, 61,220,254,212, 95,241,150,158, 82, 24,243, 44,151, 1,242, + 47, 73, 74, 11,190, 83,127,204, 24, 95,150,173,191,118, 86, 72, 30,237,105,203,212, 17,174,189,249, 24,179,175, 94, 71, 71,246, +141, 60, 21, 27,176,107, 7,159,177, 84,153,239,119, 6, 13,124,137,157,224,254,153,111,183,139, 92,134,163, 93, 63,206, 61,192, +151, 62,117,158, 36,103,210,151, 16,251,208,109,145,153,101,109, 20,169, 52, 91,142,240,223,223,173, 9,117,131, 85, 6,202,241, +164,204,239, 39, 33,143, 61, 7, 15,106, 81,193,132, 75,179,248,171,143,255, 0, 23,114,222,244,118, 1,120,215,168,124, 91, 45, +147, 1,233,236, 94,172,143,118,246,195, 8,192,102, 28,104,174, 70, 12,176,137, 15, 50,128,216, 82,213,191,196,118,221, 90, 31, + 77,235, 55,228, 82,101,147, 93,146, 18,144, 49,217, 16,192, 51,104,228,126,126, 40,215,208, 44,142,222, 1, 87,152, 53,223,209, +188, 78,218, 30,235, 70,129,220, 97,130, 77,121, 86,152,151, 73,214,203, 11, 77, 72,144, 13, 86,134, 92, 68,165,160,168,111, 93, +235,238,212, 50,186,238, 20, 43, 22, 24, 93,180,150, 5,162,207,216,238,168,255, 0,167,192,115, 42,187,245,243,150, 98,189,213, +238, 94, 5,130,225, 86,187,188, 8,214,156,122, 13,169,181,228,109,176,137, 15, 67,121,229,205,142,248, 17,137, 73, 74,153,127, + 99, 65, 81, 74,107,146,245, 63, 82,175, 34,117,217, 24,202, 34, 48, 3,226,103, 35, 82, 14,157,174,173,215, 16, 36, 34, 57, 43, +147, 41,238, 71,103,123, 81,233,203, 0,237,151,123,241,252,149, 98,251,115,155, 46,196,230, 62,168, 49,155,148, 22, 90, 73, 87, + 57,200, 88, 82, 80,144,138,241, 21, 21,214,151, 67,235, 53,225,224, 68,100, 85, 99, 19, 41, 2, 24, 9, 63, 99,241,109, 20,178, + 40,141,164, 2,234,196,179,229,221,144,237, 87,119, 44, 97,252, 79, 51,141,150,197,106, 28,251, 60,105, 42,128,164,203, 66,214, + 91,103,131, 33,148,184,231, 53, 36,167,225, 59,208,211, 90, 24,189,123, 31, 30,216, 19,143,116,102,117,136, 44,228, 30, 4, 6, +125, 80, 99,135, 8, 72, 23, 46,168, 94,233,225, 93,218,155,221,140,147, 38,187,227,247, 24, 86, 91,156,217,113,237,142,202, 97, + 97,181, 45, 64, 54,196,114,180,213, 1,195,203,238, 86,189,118,215, 15,212,122,101,212,188,205,114,136,145, 44,227,180,232, 60, +123,149,169, 72,186,174, 61, 67, 88, 47, 88,110, 99,142,246,106,219, 17,233, 25,219,129,184,174,219,217,109,106,144,185,171,123, +202,242, 82,218,106,162,178,231,194, 5, 42, 78,218,204,167, 6,195, 61,134, 39,123,179, 54,175,193,155,181,210,178, 92,149, 70, +206, 33,221,139,149,206, 5,154, 38, 63,112,122,247,127,145, 46, 45,154, 35,113,157, 83,147,164, 69,144, 98,190,220,116,129, 85, +169,183, 18, 80,160,154,208,138,106,216,233,118,153, 70, 34, 5,228, 88,105,197,142,173,224,141, 9,115, 87, 46,125,218, 62,233, +246,187,176,120,237,131, 48,178, 76,182,202,190,206,252,101, 75, 97,198,146, 28, 8, 83,200,105, 69, 67,169, 9, 38,158,227,167, +203,233,119, 99, 71,125,144, 49, 14,218,134, 81,222,101, 37, 17,181,219,134, 86,246, 44,120,124,170,153,103, 31, 74,168, 63,120, +152, 14, 56, 77,127,222,145,245,234,183,144,118, 38,222, 29,144,119,237,194, 74,118, 81, 11,246,131,175,104, 93,184,154,242,171, + 2,221, 70,219, 47,192,141, 50,150,228, 58,126, 46,234,106,162, 13, 79,136,223,244,105, 2,136, 36,151,101, 67,151,107,122,173, +212, 34,187, 17,210,186,152, 46, 19,241, 83,162,229, 87, 8, 77,142,100,173,161,224,116,194, 46,162, 92, 41, 78,100, 40,156,223, + 42,213, 52,222,186, 99, 90, 91,202,215, 18,245, 5,151,210,220,147,197,179,183, 47,119,191, 76,202, 92, 81, 39, 67,139,111,153, + 79,152,201,217, 15,160,236, 71,176,234, 32,169,131,162,253,137, 97,149, 33, 37,200,166,160,117, 73, 21,167,209,169,104, 82, 50, +101,189,140, 80,188,146,135,211,191,178,158, 61,116,152,133, 9, 73, 4,205, 59,107,104,200,237, 50,108, 23,200,232,147,106,150, +218,227,200,142,250, 66,144,235,110, 14, 42, 73, 7, 98, 8,212,171,176,192,130, 11, 16,152,180,131, 16,238,190,123,122,164,244, + 65,145,118, 58,254,238,115,134, 54,236,238,215,135, 22,226,184,114, 91,214,182,202, 69, 18,239, 42,169, 73, 43, 39,138,254,128, +173,247, 61,191, 74,234,241,191,225,158,146, 11,153,205,233,230,162,227, 80, 82, 44, 28,109,230,111,167,204, 30,100,197, 60,182, + 22,146, 1, 42,112,172, 2, 7,208, 63,167, 91, 52,220,241,220,121, 15,201,214, 90,182, 98,224, 69,171,172, 8, 60, 63, 22, 19, + 2, 84,133,215,143, 34,180,170, 67,149, 35,160,226, 82,145,239,214, 84,111, 22,213, 57, 30,114, 97,238, 13,247,171,120,249, 50, +168,146, 20,252, 43, 15,184, 74,238, 61,157,203,184,242,155,113, 18, 36,173,197,116,243, 29, 82, 22,163, 83,224, 0, 31,110,170, +103, 78, 32, 8, 71,128,251,126, 43,123,165,229, 19,190, 82, 61,138,199,238, 5,162, 78, 65, 50, 46,123,143,149,201,114,197, 45, +183,161, 45,177,187,204,150,190, 69,116,173, 62, 26, 41, 78, 1,253,145,170, 55,197,154,174,100, 63,231,248, 32,195,169,255, 0, +243, 36,190,135, 69,105, 64,184, 42,254,219, 25, 5, 0, 83,134, 59, 93, 8,169,225,192, 84,125, 35,125, 89,193,183, 67, 30,196, +186,165,131,205, 12, 92, 48,252,211,166, 5,122, 22,185,108,196,116, 1,229, 45, 14, 16,119,248, 81, 82,173, 15, 34,231,169,207, +247,128,251,213, 26,239, 1, 59,224,217, 48,151, 53, 41,112,252, 49,202,223, 65,254,207, 58, 83,255, 0, 75, 64,141,158,100,200, + 31,109, 2, 61,119, 57, 82,163,100,205,222,239, 7,122,169,132,176,132,146,127,238,212,131,253, 26,208,136,208,248,149, 33,107, +150, 9,174,229,109,102, 88,121,196, 36,114, 90, 2,200, 3,193, 14,164, 15,209, 93, 74, 58,125,187,145, 12,147,197,166,199, 22, + 67,209, 95,160,163,209, 90, 89,167,137, 28, 91,255, 0,237,211, 89,150,205,180, 86,171, 33,208,174,224,225,240, 98,218,231, 76, +112, 37, 13,180,147, 33,107, 35,238,148,164, 45, 74, 35,232, 70,250, 97,113, 10,237, 53,111,148, 71,105, 3,193,215, 53,250,248, +133, 11,183, 29,151,176,118,246,203, 41, 8,147,118,136, 39,201,101,154,126, 27,142,213,231, 20, 79,183,226,166,168,244,162,114, + 45, 50, 61,171,185,235, 25,112,198,197, 17, 26, 16, 24,123,191,138,231, 30,204,224,152,181,175,178, 17, 50,187,100,132, 12,134, +228,183, 94,122, 19,124,191, 9, 74, 93, 71,188, 10,158,135, 90, 91,165, 43, 54,142, 14,178,165, 40, 66,141,117, 97,199,189,103, +165,108,190, 46, 81,122,190,205,186,127, 29, 9, 19, 37, 67,130,107,208, 50,233, 96, 43,225, 0, 80,241, 36,123,181,122,234,200, +248, 98,126,220, 15,222,176, 33, 51, 40, 9,157, 57,251, 56,254, 9, 39,212,173,178, 22,109,220, 55,166, 93, 10,157,140,182,211, + 14, 25, 85, 15,203,180,209, 82,104,138, 1, 74,174,171,250, 78,186,140,106, 5,113,140, 87, 17,153,144,109,153, 37, 11,236,156, +104, 48,224,127, 40,183, 48,150,174, 12, 59,243, 28,105, 79,152,101,230,194, 92,105, 68,239, 81,186,146,117, 97,153, 85,220,156, +111,184,211, 17,100,198,146,167, 75,237, 44, 61,228,135, 77, 74, 18,227,117,166,255, 0, 78,173,227, 20,225, 88,125,190,183, 76, +133, 99,110,231, 36,121,140, 36, 54,226,144,107,186, 67,128,154,125, 0,242,213,192, 84,192, 87, 54, 78,239,200,225, 78,202,121, +206, 80, 86,166,159, 1, 67,144, 82,147, 85, 0, 65,232, 78,250,243,239,169, 54,109,233,197,187, 71,135, 17,246,252, 20,207, 4, + 95,182, 78,197,197, 59, 85, 39, 40,113,138, 38,242,161,104,168, 53, 80, 74,221, 73, 90,171,239, 72, 35, 95, 56,216, 33, 41, 0, + 31,241,254, 31,154,175, 49,162,169, 33,226, 82,109,221,216,186,228,179,147,184, 76,146,148,143,217, 21, 9, 66, 71,251, 0,106, +221,179, 30, 78,208,159,106,103, 84, 32,188,230, 74, 89,168,113,200,105, 97, 43,254,207,203,255, 0,166,186,160,126, 24,199,197, + 76,151, 40,125,230,220, 99,225,144,166, 69,175,157,111, 75,173, 60, 61,161,211, 84, 29, 8,106,117,237, 83,228, 17, 75, 52,145, +100,236,131, 47, 40, 81,215, 88,230,239,189,110, 58,105,250, 52,214,197,236, 80, 26,165,155,141,217,214,166, 61, 17,173,156, 87, +148,194, 66,125,165, 3,167,219,166,216,227,218,166, 14,169,195, 29,186, 11,119,121,255, 0,154,190, 57,199,178, 91,121,111,208, + 41, 17,194, 18, 55,250,244,171,131,192,248,168,147,162,116,180,180,252, 92, 74,232, 57,149, 61,120,149, 29, 32,251, 90, 43,230, +126,173,255, 0, 70,170, 26,158,207, 4,224,234,191, 18,134, 46,153,105, 10, 28,163, 33,131, 57,110, 30,135,137, 75, 72, 31, 69, +106,116, 48, 8, 4,247,169, 62,170, 86,101, 53,148,219,211, 53, 63,191,158,250,184, 83,254,238, 49,162, 64,250,193, 58,175, 50, + 76,219,177, 72, 29, 82,155,249,107,108,206,186, 74, 38,174, 63,229,181, 95,238, 80, 1,250,245,118,170,255, 0,166,202, 66, 77, + 34,172, 44, 62,255, 0,121,199, 96, 14,226, 88,229,187, 7, 36,109, 41, 69,182,108, 85,169,167,155,124,169, 12,165,109,173, 4, + 40, 30,187,131,225,170,149, 91, 58,109, 18,129, 32,141, 65, 26, 50, 14,231, 79,119,255, 0,204, 87,188, 81,157,143,108,238, 29, +171, 29,206, 36,243, 76, 86, 31,202,172,237,187, 45, 13,133,113, 32, 72,130,184,206,255, 0,214, 39,223, 93,118,244,250,215, 50, + 49,254,160,133,140, 63,154, 58,251,195, 38, 52, 66,124, 66, 59, 99,245,245,220, 72, 25, 43,144,112, 92, 99, 22,197,229,197, 73, + 42,159,100,179, 3, 48, 45,105, 34,137,122,224,236,130,158,187,208, 13, 66, 94,184,204, 58, 66, 21,214,123, 99, 29,127,248,137, + 79, 28,106,227,168, 9, 62,235,220, 60,203, 48,238, 12, 59,167,112,110,178,110,217, 28,184,160,187, 42,115,203,113,202,165,238, +105,167, 35,240,129, 93,128,160, 30, 26,228,250,150, 93,185,100,206,201, 25, 72,158, 36,235,197, 79,118,138,211, 71,171,220, 23, + 45,125,155, 63,169, 59, 19,183, 43,140,104,237,252,190, 91, 96,113,182, 47, 1,144,133, 33, 40,146,219,255, 0,129, 39, 97, 64, +165, 20,170,158, 39,174,187, 44, 63, 88,143, 42, 49,204,129,155, 6,223, 29, 39,237,125, 37,227,162,167,126, 52, 45,212,232, 84, +244,221,253, 29,205,197,154,186, 53,155,222, 19,108,101,228, 40,199, 93,128, 42, 77, 93, 7,138, 10,147, 39,203,174,253,107, 77, +106,207,212, 61, 47,105, 38,201,248,108,215,241,101, 76,116,237,126,111,185,109,183,122,149,236,207,109,164,124,199,105, 48,133, + 94,109,178,147,242,151,107,190, 96,240,249,201, 49,100, 5, 52,236,120,204,195, 62, 84,110, 84,251,245, 90,168,119,214,108,189, +119, 77, 82, 3, 26,157,195,153,153,212,142, 96, 1,164,124,117,240, 87, 41,194,132, 65,230,164,103,125,237,244,197,139,227,241, +115,140,115, 16,187,223,238, 43,242, 93,106,213,118,184,199,110,218,202,151, 84,130,234,163, 53,231, 58,134,213,213, 36,142, 93, + 9,223, 86, 71,172,112,132,119, 66,153,153,118, 72,141,160,251, 53, 40,112,192,172, 30,107,127,101,187,213,117,238,198, 93,147, +101, 89,165,201,136,221,194,149,111,184,218,177,137,107, 82, 33,198,131, 54, 76, 16,196,102, 99,169,100, 37,129,192, 45,166,205, +118, 82,134,245, 53, 56,125, 35,170, 89,151,159,101,214,200, 11,103, 92,163, 2,116, 2, 76,192, 14,205, 28, 14,243,218,180, 36, + 88, 48, 75, 29,186,198, 51, 94,223,219, 59,137,127,239,173,178, 85,151, 3,185,217,227, 91,161, 91,239, 76,185, 29,115,239, 73, +158,202,225, 63, 25,167,130, 84,224,142, 16,226,148,226, 65, 72, 73, 34,191, 22,150, 62, 53,152, 24,185, 49,200,137,132,108,131, + 1, 45, 12,166,227,105, 0,241,109, 73, 35, 64, 60, 80,184,151, 66,187,171,154,246,227,181,253,237,177,247, 54,211,106,159,112, +238,123, 88, 61,154,200,202,221,159, 29,171, 59,113,238,152,131, 80, 28, 83,241,209, 29, 78,188, 18,210,193,242,203,169, 5, 96, + 26,237, 77,109, 89,213, 42,197,157,100, 2,108, 52, 64,113, 27,117,172, 13, 67, 57, 96,120, 63, 20,199, 64,129,247,163,183,247, +142,227,225, 61,184,190, 89, 59, 91,126,205,146,172, 61,134,219,190, 88,101,202,110, 43, 47,174,231, 62,140, 45,182, 34, 62,146, +180,115, 11, 53, 88, 52, 80,219,199, 86,243,177, 13,148, 82,212, 78,207,233,128,224,150, 26,157, 56, 20, 32, 78,133, 24,237,229, +255, 0, 24,179,122, 97,237,167, 98,115,151,144,199,111,114,185, 57, 4, 57,146,151,210,217,114, 98,100,119,109,247, 3, 77,192, +105,213, 20,185,237,105,107, 29,105,172,234,115, 33, 60, 74, 40,176,255, 0, 78,221,238,127,186, 65,142,217,123, 9, 99,255, 0, +116,148,199,130,135,234, 63, 9,149,109,245, 31, 2,215,122,109, 31,230, 11, 94, 53,137,218,100, 33,181,165,196,180,244,123, 35, + 13,190,148,173, 4,164,209, 66,149, 26,161,234,140,105, 66,216,214,120,198,186,193,241, 17, 1, 63,203,170,106,238,215,112,251, + 77,147,119, 43,183, 29,190,239, 20,196,177,131, 89, 49,123, 30,111,143,184,134,220,121, 78,220,160, 94,174,144,166,219, 19,228, +133,112,249,232,156, 71, 37, 10, 5,180,138,144, 43,173,204,139,177,252,138, 40,188,180, 69,113,144,239, 34, 82,120,247,110, 31, +120, 10, 80, 44, 55, 20,237,146,119,121, 57, 15,123,112,120,247,105,173, 70,238,134, 89,219,187,163,214,153,139, 90, 90, 67, 55, + 73, 23, 9,197,180,165,197, 16, 26, 43,109,110,180,217, 36, 81, 74, 72,219, 87,229,105,182,218,236,145, 2,201,227,144, 15, 6, +148,140,189,220,192,246, 32,111,118, 61,161, 38,250, 97,237,167,112,123, 87, 51,185, 57, 7,119,109,178,172, 88,214, 64,149, 71, +183, 91,239, 44,185, 21, 83,166,199,156,211,241, 23, 25,151,194, 84,231,149,197,107,243, 18, 8, 74,107,190,251,225, 67, 14,204, +106, 46, 23, 68,198, 18,131, 0, 67, 60,156, 24,176, 60, 91, 82,227,128,241, 77, 81, 32,234,150, 61, 71,223,237, 24,230, 71, 47, +243, 23, 68,248,238, 74,176,217, 29,198,161, 91,252,212, 25, 8,238, 24,254, 2, 50,203, 36,215,136,138,240,184,212,126,211,100, +107, 86,168,196,196,103,147,241,109,102,255, 0,213,249, 93,188, 62, 63, 20,243, 58,238,251, 58,175, 61, 35, 79,122,249,152,250, + 67,140,218,188,197,124,230, 90,244,175,139,226, 9, 69,245,229, 18,175,101,125,250, 47, 78,128,223,135,220,101,255, 0, 49, 68, +140,180, 9,231,190,184, 60,155,126,109,104,157, 43,183,247,124, 99, 22,199,219, 17, 88,188, 93,158,144,184,111,184,227, 74, 88, +142,218, 94,142,210,121,209, 21,168, 89,216, 29,181,205,117, 78,158, 97, 16,124,153, 86, 31,137, 36,131,221,192, 33,212, 91, 86, +101, 71, 57,150,219,127,206, 77, 99, 73, 82,127,157,243,118,250,183,106, 43,231,252,203,106, 66,107,215,238,114, 26,169,229, 33, +239,230,139, 66,152,138,242, 89, 0, 10, 84,248,107,212,200, 93,200, 42,114, 3,211,169,199,100, 13,209,198,190, 58, 4,149,218, +117, 82, 95,132,251,209, 2, 82,215, 57, 93, 58,208, 19,160,155, 24,178,180, 41,112,233, 54,251,109,114, 60,149, 57, 48, 81, 71, + 98,144, 52,104,149, 2, 16,112,195, 75, 81,161,167,133, 14,136,162,202,124, 12,108,186,158,109,238,131,236,246,233,196,148, 10, +139,123,199, 28, 75,100,245, 3,167,184,233, 50, 97, 37,231, 27,189,220, 44, 14,152,210, 83,231, 91, 87,247,210,170,236, 61,218, +129, 10,103, 80,157, 45, 55, 8,164,165,232,138,229, 25, 91,208,210,169,211,119, 32,144, 81,246, 28,140,235, 99,153,161, 61, 8, +241,211, 58, 66, 74, 53,194,214, 31, 77, 87,186, 15,143,244,141, 50,146, 76,201,237,172, 60,181, 71,154,216, 83, 42,170, 22, 20, + 42,149, 37, 66,132, 43,218, 8,212,132,136, 69, 17,112,185,235,186, 30,137, 45,232,203, 99,102,216, 57, 13,227,234, 90,140,235, +109,127,115,231, 18, 92,117,165,117, 35,226, 36,164,238, 54,166,219, 13,177,215, 13,120,179,131, 19, 38, 13,236,102,247, 46,123, + 59,167,236,121,195,135, 48,134, 90,113, 52, 93,103,170, 83,232,226,245,245,229, 62,210,127,238,109,173, 44,148,147,253,244,167, +144,247, 13, 23,247,194,144, 53,248,106,137, 39,190, 71,226,251,150, 67,128,166, 91, 48,232,247,153,230,229,229, 2,134, 18,234, + 88, 36,159,251, 82, 5, 41,208,208, 15,209,173, 76, 2, 4, 6,225,171, 63,187,248,171, 21, 25, 1,161,103,226,172, 8,248, 99, + 22, 46,213,186,133, 14, 50,215, 41, 17,154, 20,241, 45, 17, 65,244, 21,157,114, 55,117, 97, 62,160,102,120, 8,159,185,207,224, +170,202, 95, 18, 51,108,198,100, 47,229,173, 41,218, 71,226, 44,159, 2,164,188,161, 95,253, 16,117,119, 15,168,136, 87,101,146, + 58,150, 8,177, 58, 41,214,203,123,211,110, 87,187,187, 9, 41,143, 21,135,139,105, 30,222, 9, 74,126,211,172, 44,174,173,182, +160, 15, 29,192,251,245, 85,165, 97, 0, 35, 16, 30, 85,142, 59, 98,164,201, 12,128,247,188,169,126, 97, 31,250, 35, 86,125, 59, +157,230,239,127,230,151,220,223,246,171, 20, 89,197, 75,192,146,251,243,228,186, 62,231, 47,189,239, 90,130,104, 62,218,107,107, + 3,168,249,166, 93,196,253,229, 18,137,147, 39, 86,197,142, 75, 75,150, 10,205, 91, 84,114, 21,244, 7, 58,253,180,214,173,147, + 15, 17,218,181, 4,157, 31,194,239,203,185,101, 12,217,153, 63,135, 26, 34,156, 81,254,175,199,230, 15,210,128, 62,189,100,100, +216,249, 17,135,115,159,122, 44, 39,171, 41,189,205,201, 33,162,223, 34, 52,162, 3, 82, 89, 92,111,136, 2, 57,165, 69, 73,168, + 52,235, 90, 29, 89, 52,238,211,187,242, 90, 20,228,249, 82,140,135, 34, 15,185,124,249,245, 67,117,201,179,158,224, 46, 21,221, +255, 0,152,110, 50,209, 25,143, 43,102,188,148, 10,113, 72, 36,248,143,175, 93, 7, 72,233,145,199,175, 77, 95, 85, 14,181,214, +236,205,155,144,192,112, 8, 31,109,109, 87, 8, 88,231,249,106, 68, 32,211,172,189,205, 50, 5, 40,228,114,225,113,160, 0, 63, +212, 32, 31,126,158,140, 34, 46,220,120, 42,121, 93, 75,250, 27, 65,212,176, 41,179, 14,237,102, 29,219,167, 20,172,110, 48,138, +221,201,110, 57, 42,138, 89, 1,111, 41,117, 82, 66,137, 9,169,222,131,109, 95, 24,240, 18, 37,181, 89, 54,103, 90, 99,177,244, +101, 85,103,246,144,205,241, 50, 37, 10, 56,211,129,192,149, 10,133,182,208,162,135,212, 77,117,163, 21,154,120,161, 24,109,173, +171, 85,230,109,185,128, 62, 97, 77,249,241, 92, 35,122, 52,162,217, 3,237, 65,250,180, 80, 82, 77,115,237,239, 62,195, 83, 25, +221,180, 36, 18,131,247,144,165, 43,137,175,214, 72,209,170, 44, 84,199, 5, 98,226, 83, 18,188,124,218,155,160, 90, 19,228, 1, +253,223,132,159,180,164,106,224, 68,138,181,115,209,110,129,219, 23,227,135,146,169,110,121, 73,224,175,235,133, 5, 5,167,233, +223, 94,109,245, 19,168, 85,251, 59, 41, 60,116, 35,216, 71,240, 83,145,209, 74,178,220, 98, 92,240,124,127, 16, 97, 92,154, 97, +212, 63, 41, 35,250,196,128, 63, 70,250,249,230, 33,135, 30,104, 27,117, 74, 87,171,236, 73, 89,195,246,242,105, 34,232,250,226, +164,142,136,224,107,255, 0,217,166,136, 67,251,147,148, 93,108, 54,229,241,213, 32,113,146,211, 97,147, 94,164,150,233,170,246, + 23,144, 9,130,139, 30, 1,184, 98,242,216, 77, 21,248,204, 23, 1,240,105,182,247, 52,250,116,237,167,181, 78, 42, 37,228, 9, + 93,177,151,107,104, 85,184,171,101,164,211,192, 33, 64,254,163,166,254,103, 67,175,129, 65, 27,181, 9,121,172, 55, 80,159,225, +106,183,214, 79, 79,133, 73, 74, 1,250,107,167, 18,104,165, 41, 50, 37, 25,224,229,147, 40,200, 73,254, 34, 91,141,219,219, 62, + 52, 83,129, 10,253, 3, 77, 19,183, 69, 18,116, 78, 39, 34,249, 92, 9,187,179,198,137, 74,208,195, 3,218, 91, 4, 40,254,157, + 6,248, 17,170,157,106,124,123,138, 45, 56, 11, 87,103, 5, 37, 77,110, 52, 80,127,177,230,149,210,191, 86,130, 96,229,148,164, + 89, 12,187,228,173, 92, 31,135,109,108,242, 22,232,143,200, 80, 31,215,120,154, 87,237,208,124,159,136,158,213, 8, 77,210, 37, +250,224,184,239, 71,180, 71, 5, 82,214,150,157,116,255, 0, 93,215,135, 36,164,123,128, 63,110,174,215, 95,195,237, 82,148,149, +181,118,158,187, 42,108,216, 74, 13, 95,138,207,205, 72,166,244, 91, 77, 21,212,253, 10, 93,126,173,103,194,189,198, 94, 41,171, +208, 58, 68,190,201,242,115,116,207,148, 43, 18, 3, 63, 54, 66,142,197,213,167,154,107,245,144,117,116, 67,225,251,148,129, 71, + 59,117,127, 14, 94,219,145, 48,254, 59,229, 78, 57, 83,189,120,147,168, 66, 12,233,229, 38, 9,141,236,149, 82, 59,132,101, 50, +121, 34, 43, 65,148,251,191,103, 85,132, 30, 35,237,205, 14,103,225, 65,251,161,147,124,190, 83, 61,166,206,205, 49, 21, 27, 31, + 20,182, 65,253, 90,149,149,188, 83, 68,175,219, 22,102,127,200, 2, 50, 85, 95, 48,165,100,215,254,233, 98,159,163, 84,242,170, +213,187, 83,199, 84,223,100,204,218,103, 5, 14,184,170,149,184,210,145,239, 90, 93,228,127, 64,212,171,161,167,236, 82,220,193, + 21,133,144, 68,145,142, 92,237,106, 93, 88, 20,126, 56, 62, 9,115,226,167,212,161,171,130,157,164,160, 11, 18,246, 47,157, 52, +225,184,218, 95, 85, 25,144,242, 82, 69,118,175, 47, 15,183, 74, 52,252, 33, 72,216,160,156,133,236,117, 23,187, 11,198,143,173, +176, 15,210,149,115, 7,235, 7, 80,157, 27,136, 61,137,161, 98, 25, 31, 39, 67,215,134,227,180, 0, 92,198,130,222, 3,197, 92, + 10, 15,234,174,141, 8,109,114,144,155,169, 24, 54, 55, 18,213,219, 58,206, 79, 59,164, 25,111, 58,223, 61,213,229,201, 87,196, + 5,125,155, 29, 66,235,141,135,142,173,249, 35,237,100, 53,203,132,133,134,154, 88,229, 56,185, 68, 32,117, 42, 41, 52, 26,161, +135, 47, 54,226, 7, 0, 20,140, 88, 38, 60, 58,244,214, 9,136,220, 47, 82,156,224,243, 44, 21, 45,207,234,184,180,147,246,131, +174,174, 21,105,185, 85,180, 59, 5, 83,118,123, 34, 85,247,186, 43,186, 58,121, 71,141,230, 72,117,100,215,112,159,135, 79, 94, + 62,226,231,216,154,226,225,130,126,236,133,222, 70,117,222, 11,166, 95, 33, 85,136,218, 85, 9,133, 87,225, 8, 65, 53, 3,235, +214,141,181,129, 31, 5, 86,216,237,128, 87, 71,110,111, 49,155,185, 93, 46,140,209, 48, 97, 33,108,182,125,171,112,213, 71,236, + 26,198,166, 62,100,143,138, 91,118,133,195,221,230,201, 81,149,247, 51, 42,204, 37, 30, 86, 91,123,142,147,253, 87, 29, 72, 8, + 66, 62,211,173, 12,129,182, 81,132,120,149, 98,170,159, 84,251,232,222,198,156, 66,207,115,238,253,249, 52,118, 59, 11, 44,115, +240, 90,128, 32, 10,232,205,203,177, 14,228,235,137,228, 46,197,197, 39,101, 23, 21, 86,235,120,144, 86, 10,137,173, 20,162,175, +111,213,160,249, 90,185, 80,169,202,169,219,203, 95, 61,203,123, 36,243, 63, 21, 50,217,100, 10,254,202,155,115,225,253, 26, 35, +243,228,137,228,150,101,120, 70,253,194,186,244,253,175,167,199, 94,147,201,119, 60,211, 62, 43,247, 81,215,253,190,159, 94,171, +216,175, 87,197, 54,197,234, 63,119,227,247, 58,244,214,124,214,165, 92, 18,119,113, 63,237, 63,117,227,244,253, 90, 45, 8, 54, +241,228,171, 89,127,188,253,175,246, 58,234,236, 85,116,197,139,125,193,251,222,158, 63,211,169, 32,216,166, 93, 58, 31,233,254, +157, 50, 9,226,128, 72,253,249,251,158, 29,122,105, 73, 88, 10,110, 59,254, 35,246,252, 62,231,221,208,212, 36,154, 89,255, 0, + 10, 62,255, 0, 95,233,240,211,132, 50,140,199,255, 0, 12,122,248,125,254,186,100,229, 46,228,255, 0,124,253,223,246,180,145, +160,180, 91, 63,225,223,111,222,233,167, 40, 86,240, 42,139,200,191,243, 50,239,251,191,248,112,255, 0, 13,251,175,240,135,252, + 63,246,127,215,161,102,127,237,127,241,143, 14, 92,123,151, 27,145,243, 31, 30, 92, 22, 97, 63,225,218,251,189,126,175,221, 47, +254,131, 93,108,248, 89,224,127, 17,195,185, 88,237, 79, 89,183,252,191, 96,233,255, 0, 20, 79,251,191, 15,191,239,246,107,204, + 97,254,124,188, 15,224, 85, 14,104,196, 79,248,243,125, 62,243,189, 58,253,213,244,254,157,106,127,244,231,143, 17,249,162,242, + 82,112, 47,248,117,247,238,254,237,191,189,254,240,127,208,235, 7,170,255, 0,150,127,255, 0, 65,248, 21, 78,238, 8,124,239, +241,206,127,117, 95,127,167, 81,211,250, 53,169,233,127,150, 72,180,240, 70,176, 95,248,113,255, 0,120,143,185,215,247,254, 62, +255, 0,245,107, 71,162,124,151,127,196, 63, 53,115, 31,243, 79,182,239,241, 67,239,127,133, 95,221,251,191,188, 58,235,191,234, +215,224, 22,144,226,138,118,183,254,120,185,253,255, 0,240,200,251,159,123,239,163,166,178,191,250,249,248,126,124,146,167,231, + 42, 63,126,255, 0,225,223,183,254, 44,126,239,232, 71, 79,118,186, 44,110, 42,205,139,142,115,207,249,194, 23,238,255, 0,111, +239,245,251,171,251,254,255, 0,245,235,165,198,249, 22,101,223, 50, 43,143,126,241,207,220,255, 0,135,107,175,247, 19,211,223, +168,215,197, 14,212, 67, 38,255, 0, 3, 27,239,126,241, 31,119,233,209,163,197, 83, 85, 87,115,255, 0,196, 35,238,125,233, 63, +127,239,116, 61,125,222,223,126,172,197, 13, 40, 99, 63,243, 20, 95,247,111,125,254,191,117, 29,125,222,221, 18, 41,147,107,253, + 36,253,239,221,253, 95,124,104,213,169,197, 58, 96,255, 0,191,253,158,175,253,255, 0,247,205,255, 0,208,106,224,224,137, 20, +225,220,255, 0,248,122,191,123,209,158,191,119,199,166,190,114,245,215,254,250,127, 55,183,135, 20, 67,242,163,189,175,255, 0, +139, 55,215,238, 39,239,244,251,154,243,168,254,106, 3,130, 66,127,255, 0, 52,227,253,255, 0,241,238,253,238,189, 23,247,125, +254,221, 90, 28, 20, 39,193, 89, 10,255, 0,156, 93,233,213, 29, 63,221,248,234,164,190, 98,163,205, 66,237,247,248,107,167,254, +232,191,191,247,122,126,189, 18,206, 72,144,224,160, 64,255, 0,147,111,255, 0,239, 83,247,186,125, 90,132,184,133, 24,240, 43, + 93,155,247, 35,238,254,241,158,159,188,253,218,122,127,103,219,239,212,121,168, 77, 71, 63,249,126,255, 0, 79,241,235,251,157, + 63,124,175,189,239,246,105,127,214, 30, 31,146,105,112, 68, 50, 79,249, 15, 31,251,255, 0,188,127,238,254,235,160,251,222,253, + 62,127,201, 47,103,228,137, 74, 97,238, 7,254, 90, 99,189,127,120,207,238,190,239,220,241,208, 97,196,166,179,229, 74,152,199, +252,126,243,247,191,118,143,222,245,251,135,167,187,217,169, 79,128, 85,234,228,160,202,255, 0,205,187, 55,220,253,252, 31,222, +126,239,247, 77,245,254,141, 22, 31, 34, 45,138,197,191,255, 0,230,237,235,175,248, 73, 31,189,250,254,231,187,219,238,213, 28, +110, 30,210,159,249,125,137, 75, 63,255, 0,141, 93,255, 0,223,163,251,189, 19,215,251, 58,178, 56, 39,151, 37, 23, 6,255, 0, +153,191,237, 63,107,175, 78,159,179,167, 60, 19, 91,193, 50,226,127,243, 60,207,189,213,191,222,117,251,250,174, 62, 80,163, 63, +145, 4,238,159,252,199,119,251,221, 83,215,175,221, 58,126, 67,197, 60,120,251, 22,188,123,254, 84, 79,222,253,202,190,142,186, + 6, 71,249,138,112, 76,145,127,228,139,111,239, 63,120,231,221,233,211,199,223,162,199,230, 81, 60,209,107,103,248, 4,126,243, +247, 13,125,223,247,170,251,222,237, 89,146,170,149,109, 63,241, 89, 95,189,253,248,251,159,222, 29, 52,255, 0,202,151, 52,193, +221,143,249,166, 71, 79,240,140,125,207,189,251,179,247,253,255, 0,234,208,199,202,158, 60, 82,238, 29,255, 0, 59, 90,186,253, +199, 63,121,247,116,231,129, 78, 57, 39,145,210, 71,222,253,159,185,251,174,169,235,239,213, 8,113, 42,244,190, 80,150, 45,127, +243,181,179,167,248,159,219,251,159,113,127,167, 85,186, 87,249,146, 72,242, 67,251,181,255, 0,147,215, 31,223,127,139, 63,185, +235,225,247,255, 0,179,174,198,191,144,120, 32,219,199,218,144, 61, 63,127,130,190,125,239,184,191,187,251,207,187,171,180,124, +195,130, 1,252,213,157,233,111,254, 85,153,244,189,251,159,222,253,243,215,223,237,213,110,167,254, 76,184,251, 20,167,243,127, + 21,103, 98, 31,249,125,115,251,255, 0,125,223,185,247,254,224,251,222,253,102,116,127,179,168,228,241, 92, 91,148,127,229,157, +219,238,255, 0,198, 87,211,239,254,248,126,255, 0,221,171,215,127,239,191,240,243,241, 86, 7,200,174,187,127,255, 0,243,119, +143,239, 19,254, 19,238,127,235, 61,218,179,143,198,106,174, 71, 0,188, 79,255, 0,148,237,223,188,251,136,253,223,221,251,222, + 30,255, 0,110,167,103,228,165,140,170,132,127,139,115,255, 0,122,111,251,223,113,127,167, 64, 63, 40,251,118, 43, 43,255,217, }; - From 087c66fd293c1921b4663c8c8b7bfc05cc117831 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Wed, 23 Apr 2008 12:44:10 +0000 Subject: [PATCH 02/76] Added simple UI to configure some shrinkwrap modifier properties (simple commit to try svn) --- source/blender/blenkernel/intern/modifier.c | 17 +++++++++++++++++ source/blender/makesdna/DNA_modifier_types.h | 14 ++++++++++++++ source/blender/src/buttons_editing.c | 10 ++++++++++ 3 files changed, 41 insertions(+) diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 0cd6035b9dc..8903bfd3106 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -6970,6 +6970,17 @@ static void meshdeformModifier_deformVertsEM( dm->release(dm); } + +/* Shrinkwrap */ + +static DerivedMesh *shrinkwrapModifier_applyModifier( + ModifierData *md, Object *ob, DerivedMesh *derivedData, + int useRenderParams, int isFinalCalc) +{ + return derivedData; +} + + /***/ static ModifierTypeInfo typeArr[NUM_MODIFIER_TYPES]; @@ -7290,6 +7301,12 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type) mti->requiredDataMask = explodeModifier_requiredDataMask; mti->applyModifier = explodeModifier_applyModifier; + mti = INIT_TYPE(Shrinkwrap); + mti->type = eModifierTypeType_Constructive; + mti->flags = eModifierTypeFlag_AcceptsMesh + | eModifierTypeFlag_SupportsMapping; + mti->applyModifier = shrinkwrapModifier_applyModifier; + typeArrInit = 0; #undef INIT_TYPE } diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index b7b43817474..416bb58ab53 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -35,6 +35,7 @@ typedef enum ModifierType { eModifierType_Cloth, eModifierType_Collision, eModifierType_Bevel, + eModifierType_Shrinkwrap, NUM_MODIFIER_TYPES } ModifierType; @@ -488,4 +489,17 @@ typedef struct ExplodeModifierData { float protect; } ExplodeModifierData; +typedef struct ShrinkwrapModifierData { + ModifierData modifier; + + char name[32]; /* optional vertexgroup name */ + short shrinkType; /* shrink type projection */ + short pad[3]; +} ShrinkwrapModifierData; + +/* Shrinkwrap->shrinkType */ +#define MOD_SHRINKWRAP_NEAREST 0 +#define MOD_SHRINKWRAP_NORMAL 1 + + #endif diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index f1c356a0a77..8f1b8e56df7 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -1820,6 +1820,8 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco height = 94; } else if (md->type==eModifierType_Explode) { height = 94; + } else if (md->type==eModifierType_Shrinkwrap) { + height = 48; } /* roundbox 4 free variables: corner-rounding, nop, roundbox type, shade */ uiDefBut(block, ROUNDBOX, 0, "", x-10, y-height-2, width, height-2, NULL, 5.0, 0.0, 12, 40, ""); @@ -2432,6 +2434,14 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco uiDefButBitS(block, TOG, eExplodeFlag_Unborn, B_MODIFIER_RECALC, "Unborn", lx, (cy-=19), buttonWidth/3,19, &emd->flag, 0, 0, 0, 0, "Show mesh when particles are unborn"); uiDefButBitS(block, TOG, eExplodeFlag_Alive, B_MODIFIER_RECALC, "Alive", lx+buttonWidth/3, cy, buttonWidth/3,19, &emd->flag, 0, 0, 0, 0, "Show mesh when particles are alive"); uiDefButBitS(block, TOG, eExplodeFlag_Dead, B_MODIFIER_RECALC, "Dead", lx+buttonWidth*2/3, cy, buttonWidth/3,19, &emd->flag, 0, 0, 0, 0, "Show mesh when particles are dead"); + } else if (md->type==eModifierType_Shrinkwrap) { + ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; + + char shrinktypemenu[]="Shrinkwrap type%t|nearest point %x0|normal projection %x1"; + uiDefButS(block, MENU, B_MODIFIER_RECALC, shrinktypemenu, lx,(cy-=19),buttonWidth,19, &smd->shrinkType, 0, 0, 0, 0, "Selects type of shrinkwrap algorithm for target position."); + + but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &smd->name, 0.0, 31.0, 0, 0, "Vertex Group name"); + uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob); } uiBlockEndAlign(block); From a0add959ff88c61a1f42c21de75c63bd4c25e87e Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Fri, 25 Apr 2008 18:22:20 +0000 Subject: [PATCH 03/76] Shrinkwrap skeleton code +vertex weights supported +target object now saves to file: load/save works :) for now simple moves objects vertexs to the nearest vertexs on target object (so that I can test if its working correctly with the modifier API) --- source/blender/blenkernel/BKE_shrinkwrap.h | 40 +++++ source/blender/blenkernel/intern/modifier.c | 47 +++++- source/blender/blenkernel/intern/shrinkwrap.c | 157 ++++++++++++++++++ source/blender/makesdna/DNA_modifier_types.h | 3 +- source/blender/src/buttons_editing.c | 6 +- 5 files changed, 243 insertions(+), 10 deletions(-) create mode 100644 source/blender/blenkernel/BKE_shrinkwrap.h create mode 100644 source/blender/blenkernel/intern/shrinkwrap.c diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h new file mode 100644 index 00000000000..4fd1ae354cd --- /dev/null +++ b/source/blender/blenkernel/BKE_shrinkwrap.h @@ -0,0 +1,40 @@ +/** + * shrinkwrap.c + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ +#ifndef BKE_SHRINKWRAP_H +#define BKE_SHRINKWRAP_H + +struct Object; +struct DerivedMesh; +struct ShrinkwrapModifierData; + +struct DerivedMesh *shrinkwrapModifier_do(struct ShrinkwrapModifierData *smd, struct Object *ob, struct DerivedMesh *dm, int useRenderParams, int isFinalCalc); + +#endif + + diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 8903bfd3106..a34a9133021 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -97,6 +97,7 @@ #include "BKE_utildefines.h" #include "depsgraph_private.h" #include "BKE_bmesh.h" +#include "BKE_shrinkwrap.h" #include "LOD_DependKludge.h" #include "LOD_decimation.h" @@ -6973,11 +6974,39 @@ static void meshdeformModifier_deformVertsEM( /* Shrinkwrap */ -static DerivedMesh *shrinkwrapModifier_applyModifier( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - int useRenderParams, int isFinalCalc) +static void shrinkwrapModifier_initData(ModifierData *md) { - return derivedData; + ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; + smd->shrinkType = MOD_SHRINKWRAP_NEAREST; +} + +static void shrinkwrapModifier_copyData(ModifierData *md, ModifierData *target) +{ + memcpy(target, md, sizeof(MeshDeformModifierData)); +} + +static void shrinkwrapModifier_foreachObjectLink(ModifierData *md, Object *ob, ObjectWalkFunc walk, void *userData) +{ + ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; + + walk(userData, ob, &smd->target); +} + +static DerivedMesh *shrinkwrapModifier_applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData, int useRenderParams, int isFinalCalc) +{ + return shrinkwrapModifier_do((ShrinkwrapModifierData*)md,ob,derivedData,useRenderParams,isFinalCalc); +} + +static void shrinkwrapModifier_updateDepgraph(ModifierData *md, DagForest *forest, Object *ob, DagNode *obNode) +{ + ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; + + if (smd->target) { + DagNode *curNode = dag_get_node(forest, smd->target); + + dag_add_relation(forest, curNode, obNode, DAG_RL_OB_DATA, + "Shrinkwrap Modifier"); + } } @@ -7302,10 +7331,14 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type) mti->applyModifier = explodeModifier_applyModifier; mti = INIT_TYPE(Shrinkwrap); - mti->type = eModifierTypeType_Constructive; - mti->flags = eModifierTypeFlag_AcceptsMesh - | eModifierTypeFlag_SupportsMapping; + mti->type = eModifierTypeType_Nonconstructive; + mti->flags = eModifierTypeFlag_AcceptsMesh; + /*| eModifierTypeFlag_SupportsMapping; Not yet X'D */ + mti->initData = shrinkwrapModifier_initData; + mti->copyData = shrinkwrapModifier_copyData; + mti->foreachObjectLink = shrinkwrapModifier_foreachObjectLink; mti->applyModifier = shrinkwrapModifier_applyModifier; + mti->updateDepgraph = shrinkwrapModifier_updateDepgraph; typeArrInit = 0; #undef INIT_TYPE diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c new file mode 100644 index 00000000000..18f36f68c11 --- /dev/null +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -0,0 +1,157 @@ +/** + * shrinkwrap.c + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ +#include +#include +#include +//TODO: its late and I don't fill like adding ifs() printfs (I'll remove them on end) + +#include "DNA_object_types.h" +#include "DNA_modifier_types.h" +#include "DNA_meshdata_types.h" + +#include "BKE_shrinkwrap.h" +#include "BKE_DerivedMesh.h" +#include "BKE_utildefines.h" +#include "BKE_deform.h" +#include "BKE_cdderivedmesh.h" + +#include "BLI_arithb.h" + +/* Projects the vertex on the normal direction over the target mesh */ +static void shrinkwrap_calc_normal_projection(DerivedMesh *target, float *co, short *no) +{ +} + +/* Nearest surface point on target mesh */ +static void shrinkwrap_calc_nearest_point(DerivedMesh *target, float *co, short *no) +{ + //TODO: For now its only doing a nearest vertex on target mesh (just for testing other things) + float minDist = FLT_MAX; + float orig_co[3]; + + int i; + int numVerts = target->getNumVerts(target); + MVert *vert = target->getVertDataArray(target, CD_MVERT); + + VECCOPY(orig_co, co); + + for (i = 0; i < numVerts; i++) + { + float diff[3], sdist; + VECSUB(diff, orig_co, vert[i].co); + sdist = Inpf(diff, diff); + + if(sdist < minDist) + { + minDist = sdist; + VECCOPY(co, vert[i].co); + } + } +} + +DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, DerivedMesh *dm, int useRenderParams, int isFinalCalc) +{ + + DerivedMesh *result = CDDM_copy(dm); + + //Projecting target defined - lets work! + if(smd->target) + { + int i, j; + + int vgroup = get_named_vertexgroup_num(ob, smd->vgroup_name); + int numVerts = 0; + + MDeformVert *dvert = NULL; + MVert *vert = NULL; + + float local2target[4][4], target2local[4][4]; + + DerivedMesh *target_dm = (DerivedMesh *)smd->target->derivedFinal; + + numVerts = result->getNumVerts(result); + dvert = dm->getVertDataArray(dm, CD_MDEFORMVERT); //TODO: cddm doens't supports vertex groups :S + vert = result->getVertDataArray(result, CD_MVERT); + + /* TODO: Check about editMesh stuff :S */ + /* + if(G.obedit && G.editMesh) + target_dm = CDDM_from_editmesh(G.editMesh, smd->target->data); // Needs release before returning + else + */ + + + //Calculate matrixs for local <-> target + + //Update inverse matrixs + Mat4Invert (ob->imat, ob->obmat); + Mat4Invert (smd->target->imat, smd->target->obmat); + + Mat4MulSerie(local2target, ob->obmat, smd->target->imat, 0, 0, 0, 0, 0, 0); + Mat4MulSerie(target2local, smd->target->obmat, ob->imat, 0, 0, 0, 0, 0, 0); + + + //Shrink (calculate each vertex final position) + for(i = 0; i= 0) + { + weight = 0.0f; + for(j = 0; j < dvert[i].totweight; j++) + if(dvert[i].dw[j].def_nr == vgroup) + { + weight = dvert[i].dw[j].weight; + break; + } + } + else weight = 1.0f; + + VecMat4MulVecfl(orig, local2target, vert[i].co); + + VECCOPY(final, orig); + shrinkwrap_calc_nearest_point(target_dm, final, vert[i].no); + + //TODO linear interpolation: theres probably somewhere a function for this + final[0] = orig[0] + weight * (final[0] - orig[0]); + final[1] = orig[1] + weight * (final[1] - orig[1]); + final[2] = orig[2] + weight * (final[2] - orig[2]); + + VecMat4MulVecfl(vert[i].co, target2local, final); + } + + //Destroy faces, edges and stuff + //Since we aren't yet constructing/destructing geom nothing todo for now + } + + return result; +} + diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 416bb58ab53..bbc066cdb86 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -492,7 +492,8 @@ typedef struct ExplodeModifierData { typedef struct ShrinkwrapModifierData { ModifierData modifier; - char name[32]; /* optional vertexgroup name */ + struct Object *target; /* shrink target */ + char vgroup_name[32]; /* optional vertexgroup name */ short shrinkType; /* shrink type projection */ short pad[3]; } ShrinkwrapModifierData; diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 8f1b8e56df7..425dbaf603d 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -1821,7 +1821,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco } else if (md->type==eModifierType_Explode) { height = 94; } else if (md->type==eModifierType_Shrinkwrap) { - height = 48; + height = 48+19; } /* roundbox 4 free variables: corner-rounding, nop, roundbox type, shade */ uiDefBut(block, ROUNDBOX, 0, "", x-10, y-height-2, width, height-2, NULL, 5.0, 0.0, 12, 40, ""); @@ -2440,8 +2440,10 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco char shrinktypemenu[]="Shrinkwrap type%t|nearest point %x0|normal projection %x1"; uiDefButS(block, MENU, B_MODIFIER_RECALC, shrinktypemenu, lx,(cy-=19),buttonWidth,19, &smd->shrinkType, 0, 0, 0, 0, "Selects type of shrinkwrap algorithm for target position."); - but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &smd->name, 0.0, 31.0, 0, 0, "Vertex Group name"); + but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &smd->vgroup_name, 0.0, 31.0, 0, 0, "Vertex Group name"); uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob); + + uiDefIDPoinBut(block, modifier_testMeshObj, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &smd->target, "Target to shrink to"); } uiBlockEndAlign(block); From 928b676b990486d89afa57479b85d8356e07d2d5 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Sun, 27 Apr 2008 19:29:40 +0000 Subject: [PATCH 04/76] Implemented shrink modes are now: + Nearest surface point + Normal projection + Nearest vertex (gives similar results to nearest surface if the target mesh has many vertexs and is a lot faster to calculate) ^^ all bruteforce calculation for now + fixed matrix order multiplication + request for CD_MDEDEFORMVERT --- source/blender/blenkernel/intern/modifier.c | 15 +- source/blender/blenkernel/intern/shrinkwrap.c | 261 ++++++++++++++++-- source/blender/makesdna/DNA_modifier_types.h | 5 +- source/blender/src/buttons_editing.c | 2 +- 4 files changed, 248 insertions(+), 35 deletions(-) diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index a34a9133021..04c6c6c99f0 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -6977,7 +6977,7 @@ static void meshdeformModifier_deformVertsEM( static void shrinkwrapModifier_initData(ModifierData *md) { ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; - smd->shrinkType = MOD_SHRINKWRAP_NEAREST; + smd->shrinkType = MOD_SHRINKWRAP_NEAREST_SURFACE; } static void shrinkwrapModifier_copyData(ModifierData *md, ModifierData *target) @@ -6985,6 +6985,17 @@ static void shrinkwrapModifier_copyData(ModifierData *md, ModifierData *target) memcpy(target, md, sizeof(MeshDeformModifierData)); } +CustomDataMask shrinkwrapModifier_requiredDataMask(ModifierData *md) +{ + ShrinkwrapModifierData *smd = (ShrinkwrapModifierData *)md; + CustomDataMask dataMask = 0; + + /* ask for vertexgroups if we need them */ + if(smd->vgroup_name[0]) dataMask |= (1 << CD_MDEFORMVERT); + + return dataMask; +} + static void shrinkwrapModifier_foreachObjectLink(ModifierData *md, Object *ob, ObjectWalkFunc walk, void *userData) { ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; @@ -7333,9 +7344,9 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type) mti = INIT_TYPE(Shrinkwrap); mti->type = eModifierTypeType_Nonconstructive; mti->flags = eModifierTypeFlag_AcceptsMesh; - /*| eModifierTypeFlag_SupportsMapping; Not yet X'D */ mti->initData = shrinkwrapModifier_initData; mti->copyData = shrinkwrapModifier_copyData; + mti->requiredDataMask = shrinkwrapModifier_requiredDataMask; mti->foreachObjectLink = shrinkwrapModifier_foreachObjectLink; mti->applyModifier = shrinkwrapModifier_applyModifier; mti->updateDepgraph = shrinkwrapModifier_updateDepgraph; diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 18f36f68c11..74e105125ca 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -28,6 +28,8 @@ */ #include #include +#include +#include #include //TODO: its late and I don't fill like adding ifs() printfs (I'll remove them on end) @@ -40,18 +42,196 @@ #include "BKE_utildefines.h" #include "BKE_deform.h" #include "BKE_cdderivedmesh.h" +#include "BKE_global.h" #include "BLI_arithb.h" -/* Projects the vertex on the normal direction over the target mesh */ -static void shrinkwrap_calc_normal_projection(DerivedMesh *target, float *co, short *no) +#define CONST + +static void normal_short2float(CONST short *ns, float *nf) { + nf[0] = ns[0] / 32767.0f; + nf[1] = ns[1] / 32767.0f; + nf[2] = ns[2] / 32767.0f; } -/* Nearest surface point on target mesh */ -static void shrinkwrap_calc_nearest_point(DerivedMesh *target, float *co, short *no) +/* + * This calculates the distance (in dir units) that the ray must travel to intersect plane + * It can return negative values + * + * TODO theres probably something like this on blender code + * + * Returns FLT_MIN in parallel case + */ +static float ray_intersect_plane(CONST float *point, CONST float *dir, CONST float *plane_point, CONST float *plane_normal) +{ + float pp[3]; + float a, pp_dist; + + a = INPR(dir, plane_normal); + + if(fabs(a) < 1e-5f) return FLT_MIN; + + VecSubf(pp, point, plane_point); + pp_dist = INPR(pp, plane_normal); + + return -pp_dist/a; +} + +/* + * Returns the minimum distance between the point and a triangle surface + * Writes the nearest surface point in the given nearest + */ +static float nearest_point_in_tri_surface(CONST float *co, CONST float *v0, CONST float *v1, CONST float *v2, float *nearest) +{ + //TODO: make this efficient (probably this can be made with something like 3 point_in_slice()) + if(point_in_tri_prism(co, v0, v1, v2)) + { + float normal[3]; + float dist; + + CalcNormFloat(v0, v1, v2, normal); + dist = ray_intersect_plane(co, normal, v0, normal); + + VECADDFAC(nearest, co, normal, dist); + return fabs(dist); + } + else + { + float dist = FLT_MAX, tdist; + float closest[3]; + + PclosestVL3Dfl(closest, co, v0, v1); + tdist = VecLenf(co, closest); + if(tdist < dist) + { + dist = tdist; + VECCOPY(nearest, closest); + } + + PclosestVL3Dfl(closest, co, v1, v2); + tdist = VecLenf(co, closest); + if(tdist < dist) + { + dist = tdist; + VECCOPY(nearest, closest); + } + + PclosestVL3Dfl(closest, co, v2, v0); + tdist = VecLenf(co, closest); + if(tdist < dist) + { + dist = tdist; + VECCOPY(nearest, closest); + } + + return dist; + } +} + + + +/* + * Shrink to nearest surface point on target mesh + */ +static void shrinkwrap_calc_nearest_surface_point(DerivedMesh *target, float *co, float *unused) +{ + //TODO: this should use raycast code probably existent in blender + float minDist = FLT_MAX; + float orig_co[3]; + + int i; + int numFaces = target->getNumFaces(target); + MVert *vert = target->getVertDataArray(target, CD_MVERT); + MFace *face = target->getFaceDataArray(target, CD_MFACE); + + VECCOPY(orig_co, co); + + for (i = 0; i < numFaces; i++) + { + float *v0, *v1, *v2, *v3; + + v0 = vert[ face[i].v1 ].co; + v1 = vert[ face[i].v2 ].co; + v2 = vert[ face[i].v3 ].co; + v3 = face[i].v4 ? vert[ face[i].v4 ].co : 0; + + while(v2) + { + float dist; + float tmp[3]; + + dist = nearest_point_in_tri_surface(orig_co, v0, v1, v2, tmp); + + if(dist < minDist) + { + minDist = dist; + VECCOPY(co, tmp); + } + + v1 = v2; + v2 = v3; + v3 = 0; + } + } +} + +/* + * Projects the vertex on the normal direction over the target mesh + */ +static void shrinkwrap_calc_normal_projection(DerivedMesh *target, float *co, float *vnormal) +{ + //TODO: this should use raycast code probably existent in blender + float minDist = FLT_MAX; + float orig_co[3]; + + int i; + int numFaces = target->getNumFaces(target); + MVert *vert = target->getVertDataArray(target, CD_MVERT); + MFace *face = target->getFaceDataArray(target, CD_MFACE); + + VECCOPY(orig_co, co); + + for (i = 0; i < numFaces; i++) + { + float *v0, *v1, *v2, *v3; + + v0 = vert[ face[i].v1 ].co; + v1 = vert[ face[i].v2 ].co; + v2 = vert[ face[i].v3 ].co; + v3 = face[i].v4 ? vert[ face[i].v4 ].co : 0; + + while(v2) + { + float dist; + float pnormal[3]; + + CalcNormFloat(v0, v1, v2, pnormal); + dist = ray_intersect_plane(orig_co, vnormal, v0, pnormal); + + if(fabs(dist) < minDist) + { + float tmp[3], nearest[3]; + VECADDFAC(tmp, orig_co, vnormal, dist); + + if( fabs(nearest_point_in_tri_surface(tmp, v0, v1, v2, nearest)) < 0.0001) + { + minDist = fabs(dist); + VECCOPY(co, nearest); + } + } + v1 = v2; + v2 = v3; + v3 = 0; + } + } +} + +/* + * Shrink to nearest vertex on target mesh + */ +static void shrinkwrap_calc_nearest_vertex(DerivedMesh *target, float *co, float *unused) { - //TODO: For now its only doing a nearest vertex on target mesh (just for testing other things) float minDist = FLT_MAX; float orig_co[3]; @@ -65,7 +245,7 @@ static void shrinkwrap_calc_nearest_point(DerivedMesh *target, float *co, short { float diff[3], sdist; VECSUB(diff, orig_co, vert[i].co); - sdist = Inpf(diff, diff); + sdist = INPR(diff, diff); if(sdist < minDist) { @@ -75,6 +255,7 @@ static void shrinkwrap_calc_nearest_point(DerivedMesh *target, float *co, short } } +/* Main shrinkwrap function */ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, DerivedMesh *dm, int useRenderParams, int isFinalCalc) { @@ -90,38 +271,36 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri MDeformVert *dvert = NULL; MVert *vert = NULL; + DerivedMesh *target_dm = NULL; float local2target[4][4], target2local[4][4]; - DerivedMesh *target_dm = (DerivedMesh *)smd->target->derivedFinal; - numVerts = result->getNumVerts(result); - dvert = dm->getVertDataArray(dm, CD_MDEFORMVERT); //TODO: cddm doens't supports vertex groups :S + dvert = result->getVertDataArray(result, CD_MDEFORMVERT); vert = result->getVertDataArray(result, CD_MVERT); - /* TODO: Check about editMesh stuff :S */ - /* - if(G.obedit && G.editMesh) - target_dm = CDDM_from_editmesh(G.editMesh, smd->target->data); // Needs release before returning - else - */ + target_dm = (DerivedMesh *)smd->target->derivedFinal; + if(!target_dm) + { + printf("Target derived mesh is null! :S\n"); + } + //TODO should we reduce the number of matrix mults? by choosing applying matrixs to target or to derived mesh? //Calculate matrixs for local <-> target + Mat4Invert (smd->target->imat, smd->target->obmat); //inverse is outdated - //Update inverse matrixs - Mat4Invert (ob->imat, ob->obmat); - Mat4Invert (smd->target->imat, smd->target->obmat); - - Mat4MulSerie(local2target, ob->obmat, smd->target->imat, 0, 0, 0, 0, 0, 0); - Mat4MulSerie(target2local, smd->target->obmat, ob->imat, 0, 0, 0, 0, 0, 0); + Mat4MulSerie(local2target, smd->target->imat, ob->obmat, 0, 0, 0, 0, 0, 0); + Mat4Invert(target2local, local2target); //Shrink (calculate each vertex final position) for(i = 0; i= 0) { @@ -135,23 +314,45 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri } else weight = 1.0f; - VecMat4MulVecfl(orig, local2target, vert[i].co); - - VECCOPY(final, orig); - shrinkwrap_calc_nearest_point(target_dm, final, vert[i].no); + if(weight == 0.0f) continue; //Skip vertexs where we have no influence - //TODO linear interpolation: theres probably somewhere a function for this - final[0] = orig[0] + weight * (final[0] - orig[0]); - final[1] = orig[1] + weight * (final[1] - orig[1]); - final[2] = orig[2] + weight * (final[2] - orig[2]); + VecMat4MulVecfl(orig, local2target, vert[i].co); + VECCOPY(final, orig); + + //We also need to apply the rotation to normal + if(smd->shrinkType == MOD_SHRINKWRAP_NORMAL) + { + normal_short2float(vert[i].no, normal); + Mat4Mul3Vecfl(local2target, normal); + Normalize(normal); //Watch out for scaling (TODO: do we really needed a unit-len normal?) + } + + + switch(smd->shrinkType) + { + case MOD_SHRINKWRAP_NEAREST_SURFACE: + shrinkwrap_calc_nearest_surface_point(target_dm, final, normal); + break; + + case MOD_SHRINKWRAP_NORMAL: + shrinkwrap_calc_normal_projection(target_dm, final, normal); + break; + + case MOD_SHRINKWRAP_NEAREST_VERTEX: + shrinkwrap_calc_nearest_vertex(target_dm, final, normal); + break; + } + + VecLerpf(final, orig, final, weight); //linear interpolation VecMat4MulVecfl(vert[i].co, target2local, final); } //Destroy faces, edges and stuff //Since we aren't yet constructing/destructing geom nothing todo for now + CDDM_calc_normals(result); + } - return result; } diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index bbc066cdb86..f2d053d612c 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -499,8 +499,9 @@ typedef struct ShrinkwrapModifierData { } ShrinkwrapModifierData; /* Shrinkwrap->shrinkType */ -#define MOD_SHRINKWRAP_NEAREST 0 -#define MOD_SHRINKWRAP_NORMAL 1 +#define MOD_SHRINKWRAP_NEAREST_SURFACE 0 +#define MOD_SHRINKWRAP_NORMAL 1 +#define MOD_SHRINKWRAP_NEAREST_VERTEX 2 #endif diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 425dbaf603d..4c550d8c444 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -2437,7 +2437,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco } else if (md->type==eModifierType_Shrinkwrap) { ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; - char shrinktypemenu[]="Shrinkwrap type%t|nearest point %x0|normal projection %x1"; + char shrinktypemenu[]="Shrinkwrap type%t|nearest surface point %x0|normal projection %x1|nearest vertex %x2"; uiDefButS(block, MENU, B_MODIFIER_RECALC, shrinktypemenu, lx,(cy-=19),buttonWidth,19, &smd->shrinkType, 0, 0, 0, 0, "Selects type of shrinkwrap algorithm for target position."); but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &smd->vgroup_name, 0.0, 31.0, 0, 0, "Vertex Group name"); From 29f0f74b05462e9bd0b641602b89fa1c39ed29c8 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Wed, 30 Apr 2008 17:55:26 +0000 Subject: [PATCH 05/76] Changed a bit of code structure to make method optimization easier --- source/blender/blenkernel/BKE_shrinkwrap.h | 24 +++ source/blender/blenkernel/intern/shrinkwrap.c | 193 ++++++++++-------- 2 files changed, 132 insertions(+), 85 deletions(-) diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h index 4fd1ae354cd..0a302b21141 100644 --- a/source/blender/blenkernel/BKE_shrinkwrap.h +++ b/source/blender/blenkernel/BKE_shrinkwrap.h @@ -33,6 +33,30 @@ struct Object; struct DerivedMesh; struct ShrinkwrapModifierData; + +typedef struct ShrinkwrapCalcData +{ + ShrinkwrapModifierData *smd; //shrinkwrap modifier data + + struct Object *ob; //object we are applying shrinkwrap to + struct DerivedMesh *original; //mesh before shrinkwrap + struct DerivedMesh *final; //initially a copy of original mesh.. mesh thats going to be shrinkwrapped + + struct DerivedMesh *target; //mesh we are shrinking to + + //matrixs for local<->target space transform + float local2target[4][4]; + float target2local[4][4]; + + //float *weights; //weights of vertexs + unsigned char *moved; //boolean indicating if vertex has moved (TODO use bitmaps) + +} ShrinkwrapCalcData; + +void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *data); +void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *data); +void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *data); + struct DerivedMesh *shrinkwrapModifier_do(struct ShrinkwrapModifierData *smd, struct Object *ob, struct DerivedMesh *dm, int useRenderParams, int isFinalCalc); #endif diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 74e105125ca..606f8938985 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -46,7 +46,10 @@ #include "BLI_arithb.h" + #define CONST +typedef void ( *Shrinkwrap_ForeachVertexCallback) (DerivedMesh *target, float *co, float *normal); + static void normal_short2float(CONST short *ns, float *nf) { @@ -55,6 +58,7 @@ static void normal_short2float(CONST short *ns, float *nf) nf[2] = ns[2] / 32767.0f; } + /* * This calculates the distance (in dir units) that the ray must travel to intersect plane * It can return negative values @@ -134,7 +138,7 @@ static float nearest_point_in_tri_surface(CONST float *co, CONST float *v0, CONS /* * Shrink to nearest surface point on target mesh */ -static void shrinkwrap_calc_nearest_surface_point(DerivedMesh *target, float *co, float *unused) +static void bruteforce_shrinkwrap_calc_nearest_surface_point(DerivedMesh *target, float *co, float *unused) { //TODO: this should use raycast code probably existent in blender float minDist = FLT_MAX; @@ -179,7 +183,7 @@ static void shrinkwrap_calc_nearest_surface_point(DerivedMesh *target, float *co /* * Projects the vertex on the normal direction over the target mesh */ -static void shrinkwrap_calc_normal_projection(DerivedMesh *target, float *co, float *vnormal) +static void bruteforce_shrinkwrap_calc_normal_projection(DerivedMesh *target, float *co, float *vnormal) { //TODO: this should use raycast code probably existent in blender float minDist = FLT_MAX; @@ -230,7 +234,7 @@ static void shrinkwrap_calc_normal_projection(DerivedMesh *target, float *co, fl /* * Shrink to nearest vertex on target mesh */ -static void shrinkwrap_calc_nearest_vertex(DerivedMesh *target, float *co, float *unused) +static void bruteforce_shrinkwrap_calc_nearest_vertex(DerivedMesh *target, float *co, float *unused) { float minDist = FLT_MAX; float orig_co[3]; @@ -255,104 +259,123 @@ static void shrinkwrap_calc_nearest_vertex(DerivedMesh *target, float *co, float } } + +static void shrinkwrap_calc_foreach_vertex(ShrinkwrapCalcData *calc, Shrinkwrap_ForeachVertexCallback callback) +{ + int i, j; + int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); + int numVerts = 0; + + MDeformVert *dvert = NULL; + MVert *vert = NULL; + + numVerts = calc->final->getNumVerts(calc->final); + dvert = calc->final->getVertDataArray(calc->final, CD_MDEFORMVERT); + vert = calc->final->getVertDataArray(calc->final, CD_MVERT); + + //Shrink (calculate each vertex final position) + for(i = 0; i= 0) + { + weight = 0.0f; + for(j = 0; j < dvert[i].totweight; j++) + if(dvert[i].dw[j].def_nr == vgroup) + { + weight = dvert[i].dw[j].weight; + break; + } + } + else weight = 1.0f; + + if(weight == 0.0f) continue; //Skip vertexs where we have no influence + + VecMat4MulVecfl(orig, calc->local2target, vert[i].co); + VECCOPY(final, orig); + + //We also need to apply the rotation to normal + if(calc->smd->shrinkType == MOD_SHRINKWRAP_NORMAL) + { + normal_short2float(vert[i].no, normal); + Mat4Mul3Vecfl(calc->local2target, normal); + Normalize(normal); //Watch out for scaling (TODO: do we really needed a unit-len normal?) + } + (callback)(calc->target, final, normal); + + VecLerpf(final, orig, final, weight); //linear interpolation + + VecMat4MulVecfl(vert[i].co, calc->target2local, final); + } +} + /* Main shrinkwrap function */ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, DerivedMesh *dm, int useRenderParams, int isFinalCalc) { - DerivedMesh *result = CDDM_copy(dm); + ShrinkwrapCalcData calc; + + + //Init Shrinkwrap calc data + calc.smd = smd; + + calc.original = dm; + calc.final = CDDM_copy(calc.original); - //Projecting target defined - lets work! if(smd->target) { - int i, j; + calc.target = (DerivedMesh *)smd->target->derivedFinal; - int vgroup = get_named_vertexgroup_num(ob, smd->vgroup_name); - int numVerts = 0; - - MDeformVert *dvert = NULL; - MVert *vert = NULL; - DerivedMesh *target_dm = NULL; - - float local2target[4][4], target2local[4][4]; - - numVerts = result->getNumVerts(result); - dvert = result->getVertDataArray(result, CD_MDEFORMVERT); - vert = result->getVertDataArray(result, CD_MVERT); - - target_dm = (DerivedMesh *)smd->target->derivedFinal; - if(!target_dm) + if(!calc.target) { printf("Target derived mesh is null! :S\n"); } - //TODO should we reduce the number of matrix mults? by choosing applying matrixs to target or to derived mesh? //Calculate matrixs for local <-> target Mat4Invert (smd->target->imat, smd->target->obmat); //inverse is outdated - - Mat4MulSerie(local2target, smd->target->imat, ob->obmat, 0, 0, 0, 0, 0, 0); - Mat4Invert(target2local, local2target); - - - //Shrink (calculate each vertex final position) - for(i = 0; i= 0) - { - weight = 0.0f; - for(j = 0; j < dvert[i].totweight; j++) - if(dvert[i].dw[j].def_nr == vgroup) - { - weight = dvert[i].dw[j].weight; - break; - } - } - else weight = 1.0f; - - if(weight == 0.0f) continue; //Skip vertexs where we have no influence - - VecMat4MulVecfl(orig, local2target, vert[i].co); - VECCOPY(final, orig); - - //We also need to apply the rotation to normal - if(smd->shrinkType == MOD_SHRINKWRAP_NORMAL) - { - normal_short2float(vert[i].no, normal); - Mat4Mul3Vecfl(local2target, normal); - Normalize(normal); //Watch out for scaling (TODO: do we really needed a unit-len normal?) - } - - - switch(smd->shrinkType) - { - case MOD_SHRINKWRAP_NEAREST_SURFACE: - shrinkwrap_calc_nearest_surface_point(target_dm, final, normal); - break; - - case MOD_SHRINKWRAP_NORMAL: - shrinkwrap_calc_normal_projection(target_dm, final, normal); - break; - - case MOD_SHRINKWRAP_NEAREST_VERTEX: - shrinkwrap_calc_nearest_vertex(target_dm, final, normal); - break; - } - - VecLerpf(final, orig, final, weight); //linear interpolation - - VecMat4MulVecfl(vert[i].co, target2local, final); - } - - //Destroy faces, edges and stuff - //Since we aren't yet constructing/destructing geom nothing todo for now - CDDM_calc_normals(result); + Mat4MulSerie(calc.local2target, smd->target->imat, ob->obmat, 0, 0, 0, 0, 0, 0); + Mat4Invert(calc.target2local, calc.local2target); } - return result; + + calc.moved = NULL; + + + //Projecting target defined - lets work! + if(calc.target) + { + switch(smd->shrinkType) + { + case MOD_SHRINKWRAP_NEAREST_SURFACE: +// shrinkwrap_calc_nearest_vertex(&calc); + shrinkwrap_calc_foreach_vertex(&calc, bruteforce_shrinkwrap_calc_nearest_surface_point); + break; + + case MOD_SHRINKWRAP_NORMAL: + shrinkwrap_calc_foreach_vertex(&calc, bruteforce_shrinkwrap_calc_nearest_surface_point); + break; + + case MOD_SHRINKWRAP_NEAREST_VERTEX: + shrinkwrap_calc_foreach_vertex(&calc, bruteforce_shrinkwrap_calc_nearest_vertex); + break; + } + + } + + //Destroy faces, edges and stuff + if(calc.moved) + { + //TODO + } + + CDDM_calc_normals(calc.final); + + return calc.final; } + From 64f5d1bdf3b2c99ee2282f2b3cf454da02b8c775 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Thu, 1 May 2008 01:00:01 +0000 Subject: [PATCH 06/76] Nearest-vertex mode optimized with kdtrees currently uses the kdtree code avaible on blender --- source/blender/blenkernel/intern/shrinkwrap.c | 117 +++++++++++++++++- 1 file changed, 112 insertions(+), 5 deletions(-) diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 606f8938985..9d70c129a87 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -30,6 +30,7 @@ #include #include #include +#include #include //TODO: its late and I don't fill like adding ifs() printfs (I'll remove them on end) @@ -45,8 +46,41 @@ #include "BKE_global.h" #include "BLI_arithb.h" +#include "BLI_kdtree.h" +#define TO_STR(a) #a +#define JOIN(a,b) a##b + +#define OUT_OF_MEMORY() ((void)puts("Shrinkwrap: Out of memory")) + +/* Benchmark macros */ +#if 1 + +#define BENCH(a) \ + do { \ + clock_t _clock_init = clock(); \ + (a); \ + printf("%s: %fms\n", #a, (float)(clock()-_clock_init)*1000/CLOCKS_PER_SEC); \ + } while(0) + +#define BENCH_VAR(name) clock_t JOIN(_bench_step,name) = 0, JOIN(_bench_total,name) = 0 +#define BENCH_BEGIN(name) JOIN(_bench_step, name) = clock() +#define BENCH_END(name) JOIN(_bench_total,name) += clock() - JOIN(_bench_step,name) +#define BENCH_RESET(name) JOIN(_bench_total, name) = 0 +#define BENCH_REPORT(name) printf("%s: %fms\n", TO_STR(name), JOIN(_bench_total,name)*1000.0f/CLOCKS_PER_SEC) + +#else + +#define BENCH(a) (a) +#define BENCH_VAR(name) +#define BENCH_BEGIN(name) +#define BENCH_END(name) +#define BENCH_RESET(name) +#define BENCH_REPORT(name) + +#endif + #define CONST typedef void ( *Shrinkwrap_ForeachVertexCallback) (DerivedMesh *target, float *co, float *normal); @@ -317,15 +351,22 @@ static void shrinkwrap_calc_foreach_vertex(ShrinkwrapCalcData *calc, Shrinkwrap_ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, DerivedMesh *dm, int useRenderParams, int isFinalCalc) { - ShrinkwrapCalcData calc; + ShrinkwrapCalcData calc = {}; //Init Shrinkwrap calc data calc.smd = smd; + calc.ob = ob; calc.original = dm; calc.final = CDDM_copy(calc.original); + if(!calc.final) + { + OUT_OF_MEMORY(); + return dm; + } + if(smd->target) { calc.target = (DerivedMesh *)smd->target->derivedFinal; @@ -349,19 +390,24 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri //Projecting target defined - lets work! if(calc.target) { + printf("Shrinkwrap (%s)%d over (%s)%d\n", + calc.ob->id.name, calc.final->getNumVerts(calc.final), + calc.smd->target->id.name, calc.target->getNumVerts(calc.target) + ); + switch(smd->shrinkType) { case MOD_SHRINKWRAP_NEAREST_SURFACE: -// shrinkwrap_calc_nearest_vertex(&calc); - shrinkwrap_calc_foreach_vertex(&calc, bruteforce_shrinkwrap_calc_nearest_surface_point); + BENCH(shrinkwrap_calc_foreach_vertex(&calc, bruteforce_shrinkwrap_calc_nearest_surface_point)); break; case MOD_SHRINKWRAP_NORMAL: - shrinkwrap_calc_foreach_vertex(&calc, bruteforce_shrinkwrap_calc_nearest_surface_point); + BENCH(shrinkwrap_calc_foreach_vertex(&calc, bruteforce_shrinkwrap_calc_normal_projection)); break; case MOD_SHRINKWRAP_NEAREST_VERTEX: - shrinkwrap_calc_foreach_vertex(&calc, bruteforce_shrinkwrap_calc_nearest_vertex); + BENCH(shrinkwrap_calc_nearest_vertex(&calc)); +// BENCH(shrinkwrap_calc_foreach_vertex(&calc, bruteforce_shrinkwrap_calc_nearest_vertex)); break; } @@ -378,4 +424,65 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri return calc.final; } +void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) +{ + int i; + KDTree* target = NULL; + KDTreeNearest nearest; + float tmp_co[3]; + + BENCH_VAR(build); + BENCH_VAR(query); + + int numVerts; + MVert *vert = NULL; + + //Generate kd-tree with target vertexs + BENCH_BEGIN(build); + + target = BLI_kdtree_new(calc->target->getNumVerts(calc->target)); + if(target == NULL) return OUT_OF_MEMORY(); + + numVerts= calc->target->getNumVerts(calc->target); + vert = calc->target->getVertDataArray(calc->target, CD_MVERT); + + for( ;numVerts--; vert++) + BLI_kdtree_insert(target, 0, vert->co, NULL); + + BLI_kdtree_balance(target); + + BENCH_END(build); + + //Find the nearest vertex + numVerts= calc->final->getNumVerts(calc->final); + vert = calc->final->getVertDataArray(calc->final, CD_MVERT); + for(i=0; ilocal2target, vert[i].co); + + BENCH_BEGIN(query); + t = BLI_kdtree_find_nearest(target, tmp_co, 0, &nearest); + BENCH_END(query); + + if(t != -1) + { + float weight = 1.0f; + + VecMat4MulVecfl(nearest.co, calc->target2local, nearest.co); + VecLerpf(vert[i].co, vert[i].co, nearest.co, weight); //linear interpolation + + if(calc->moved) + calc->moved[i] = TRUE; + } + } + + BENCH_BEGIN(build); + BLI_kdtree_free(target); + BENCH_END(build); + + + BENCH_REPORT(build); + BENCH_REPORT(query); +} From 9026559ded7eb0607f3c5118ff0b306583910a60 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Fri, 2 May 2008 00:16:48 +0000 Subject: [PATCH 07/76] +normal projection optimized with RayTree (RE_raytrace.h) +control for normal projection direction (default,inverted,both) There are some bugs on projection over quads.. it seems to work 100% on fully triangulized meshs --- source/blender/blenkernel/intern/shrinkwrap.c | 242 ++++++++++++++++-- source/blender/makesdna/DNA_modifier_types.h | 6 +- source/blender/src/buttons_editing.c | 10 +- 3 files changed, 239 insertions(+), 19 deletions(-) diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 9d70c129a87..f95e696734c 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -48,11 +48,12 @@ #include "BLI_arithb.h" #include "BLI_kdtree.h" +#include "RE_raytrace.h" #define TO_STR(a) #a #define JOIN(a,b) a##b -#define OUT_OF_MEMORY() ((void)puts("Shrinkwrap: Out of memory")) +#define OUT_OF_MEMORY() ((void)printf("Shrinkwrap: Out of memory\n")) /* Benchmark macros */ #if 1 @@ -85,13 +86,127 @@ typedef void ( *Shrinkwrap_ForeachVertexCallback) (DerivedMesh *target, float *co, float *normal); -static void normal_short2float(CONST short *ns, float *nf) +static void normal_short2float(const short *ns, float *nf) { nf[0] = ns[0] / 32767.0f; nf[1] = ns[1] / 32767.0f; nf[2] = ns[2] / 32767.0f; } +static float vertexgroup_get_weight(MDeformVert *dvert, int index, int vgroup) +{ + if(dvert && vgroup >= 0) + { + int j; + for(j = 0; j < dvert[index].totweight; j++) + if(dvert[index].dw[j].def_nr == vgroup) + return dvert[index].dw[j].weight; + } + return -1; +} + +/* + * Raytree from mesh + */ +static MVert *raytree_from_mesh_verts = NULL; +static float raytree_from_mesh_start[3] = { 1e10f, 1e10f, 1e10f }; +static int raytree_check_always(Isect *is, int ob, RayFace *face) +{ + return TRUE; +} + +static void raytree_from_mesh_get_coords(RayFace *face, float **v1, float **v2, float **v3, float **v4) +{ + MFace *mface= (MFace*)face; + + if(mface == NULL) + { + *v1 = raytree_from_mesh_start; + *v2 = raytree_from_mesh_start; + *v3 = raytree_from_mesh_start; + *v4 = NULL; + return; + } + + *v1= raytree_from_mesh_verts[mface->v1].co; + *v2= raytree_from_mesh_verts[mface->v2].co; + *v3= raytree_from_mesh_verts[mface->v3].co; + *v4= (mface->v4)? raytree_from_mesh_verts[mface->v4].co: NULL; +} + +/* + * Creates a raytree from the given mesh + * No copy of the mesh is done, so it must exist and remain + * imutable as long the tree is intended to be used + * + * No more than 1 raytree can exist.. since this code uses a static variable + * to pass data to raytree_from_mesh_get_coords + */ +static RayTree* raytree_create_from_mesh(DerivedMesh *mesh) +{ + int i; + float min[3], max[3]; + + RayTree*tree= NULL; + + int numFaces= mesh->getNumFaces(mesh); + MFace *face = mesh->getFaceDataArray(mesh, CD_MFACE); + int numVerts= mesh->getNumVerts(mesh); + raytree_from_mesh_verts = mesh->getVertDataArray(mesh, CD_MVERT); + + + //calculate bounding box + INIT_MINMAX(min, max); + + for(i=0; iob, calc->smd->vgroup_name); int numVerts = 0; @@ -310,23 +425,11 @@ static void shrinkwrap_calc_foreach_vertex(ShrinkwrapCalcData *calc, Shrinkwrap_ //Shrink (calculate each vertex final position) for(i = 0; i= 0) - { - weight = 0.0f; - for(j = 0; j < dvert[i].totweight; j++) - if(dvert[i].dw[j].def_nr == vgroup) - { - weight = dvert[i].dw[j].weight; - break; - } - } - else weight = 1.0f; - if(weight == 0.0f) continue; //Skip vertexs where we have no influence VecMat4MulVecfl(orig, calc->local2target, vert[i].co); @@ -402,7 +505,8 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri break; case MOD_SHRINKWRAP_NORMAL: - BENCH(shrinkwrap_calc_foreach_vertex(&calc, bruteforce_shrinkwrap_calc_normal_projection)); + BENCH(shrinkwrap_calc_normal_projection(&calc)); +// BENCH(shrinkwrap_calc_foreach_vertex(&calc, bruteforce_shrinkwrap_calc_normal_projection)); break; case MOD_SHRINKWRAP_NEAREST_VERTEX: @@ -424,9 +528,18 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri return calc.final; } + +/* + * Shrinkwrap to the nearest vertex + * + * it builds a kdtree of vertexs we can attach to and then + * for each vertex on performs a nearest vertex search on the tree + */ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) { int i; + int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); + KDTree* target = NULL; KDTreeNearest nearest; float tmp_co[3]; @@ -436,6 +549,7 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) int numVerts; MVert *vert = NULL; + MDeformVert *dvert = NULL; //Generate kd-tree with target vertexs BENCH_BEGIN(build); @@ -446,6 +560,7 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) numVerts= calc->target->getNumVerts(calc->target); vert = calc->target->getVertDataArray(calc->target, CD_MVERT); + for( ;numVerts--; vert++) BLI_kdtree_insert(target, 0, vert->co, NULL); @@ -453,12 +568,18 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) BENCH_END(build); + //Find the nearest vertex numVerts= calc->final->getNumVerts(calc->final); vert = calc->final->getVertDataArray(calc->final, CD_MVERT); + dvert = calc->final->getVertDataArray(calc->final, CD_MDEFORMVERT); + for(i=0; ilocal2target, vert[i].co); BENCH_BEGIN(query); @@ -486,3 +607,90 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) BENCH_REPORT(query); } +/* + * Shrinkwrap projecting vertexs allong their normals over the target + * + * it builds a RayTree from the target mesh and then performs a + * raycast for each vertex (ray direction = normal) + */ +void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) +{ + int i; + int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); + char use_normal = calc->smd->shrinkOpts; + RayTree *target = NULL; + + int numVerts; + MVert *vert = NULL; + MDeformVert *dvert = NULL; + float tmp_co[3], tmp_no[3]; + + if( (use_normal & (MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL | MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL)) == 0) + return; //Nothing todo + + //setup raytracing + target = raytree_create_from_mesh(calc->target); + if(target == NULL) return OUT_OF_MEMORY(); + + + + //Project each vertex along normal + numVerts= calc->final->getNumVerts(calc->final); + vert = calc->final->getVertDataArray(calc->final, CD_MVERT); + dvert = calc->final->getVertDataArray(calc->final, CD_MDEFORMVERT); + + for(i=0; itarget + VecMat4MulVecfl(tmp_co, calc->local2target, vert[i].co); + + normal_short2float(vert[i].no, tmp_no); + Mat4Mul3Vecfl(calc->local2target, tmp_no); //Watch out for scaling on normal + Normalize(tmp_no); //(TODO: do we really needed a unit-len normal? and we could know the scale factor before hand?) + + + if(use_normal & MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL) + { + dist = raytree_cast_ray(target, tmp_co, tmp_no); + } + + normal_short2float(vert[i].no, tmp_no); + Mat4Mul3Vecfl(calc->local2target, tmp_no); //Watch out for scaling on normal + Normalize(tmp_no); //(TODO: do we really needed a unit-len normal? and we could know the scale factor before hand?) + + if(use_normal & MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL) + { + float inv[3]; // = {-tmp_no[0], -tmp_no[1], -tmp_no[2]}; + float tdist; + + inv[0] = -tmp_no[0]; + inv[1] = -tmp_no[1]; + inv[2] = -tmp_no[2]; + + tdist = raytree_cast_ray(target, tmp_co, inv); + + if(ABS(tdist) < ABS(dist)) + dist = -tdist; + } + + if(ABS(dist) != FLT_MAX) + { + VECADDFAC(tmp_co, tmp_co, tmp_no, dist); + VecMat4MulVecfl(tmp_co, calc->target2local, tmp_co); + VecLerpf(vert[i].co, vert[i].co, tmp_co, weight); //linear interpolation + + if(calc->moved) + calc->moved[i] = TRUE; + } + + } + + free_raytree_from_mesh(target); +} + + diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index f2d053d612c..6dc018c33c0 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -495,7 +495,8 @@ typedef struct ShrinkwrapModifierData { struct Object *target; /* shrink target */ char vgroup_name[32]; /* optional vertexgroup name */ short shrinkType; /* shrink type projection */ - short pad[3]; + short shrinkOpts; /* shrink options */ + short pad[2]; } ShrinkwrapModifierData; /* Shrinkwrap->shrinkType */ @@ -503,5 +504,8 @@ typedef struct ShrinkwrapModifierData { #define MOD_SHRINKWRAP_NORMAL 1 #define MOD_SHRINKWRAP_NEAREST_VERTEX 2 +/* Shrinkwrap->shrinkOpts */ +#define MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL (1<<0) +#define MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL (1<<1) #endif diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 4c550d8c444..2a10c2e5fce 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -1821,7 +1821,10 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco } else if (md->type==eModifierType_Explode) { height = 94; } else if (md->type==eModifierType_Shrinkwrap) { - height = 48+19; + ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; + height = 67; + if (smd->shrinkType == MOD_SHRINKWRAP_NORMAL) + height += 19*2; } /* roundbox 4 free variables: corner-rounding, nop, roundbox type, shade */ uiDefBut(block, ROUNDBOX, 0, "", x-10, y-height-2, width, height-2, NULL, 5.0, 0.0, 12, 40, ""); @@ -2440,6 +2443,11 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco char shrinktypemenu[]="Shrinkwrap type%t|nearest surface point %x0|normal projection %x1|nearest vertex %x2"; uiDefButS(block, MENU, B_MODIFIER_RECALC, shrinktypemenu, lx,(cy-=19),buttonWidth,19, &smd->shrinkType, 0, 0, 0, 0, "Selects type of shrinkwrap algorithm for target position."); + if (smd->shrinkType == MOD_SHRINKWRAP_NORMAL){ + uiDefButBitS(block, TOG, MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL, B_MODIFIER_RECALC, "Default normal", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Allows vertices to move in the normal direction"); + uiDefButBitS(block, TOG, MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL, B_MODIFIER_RECALC, "Invert normal", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Allows vertices to move in the inverse direction of their normal"); + } + but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &smd->vgroup_name, 0.0, 31.0, 0, 0, "Vertex Group name"); uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob); From 2b5432e6bb78ac10779b5f2d4206cb155c2daee9 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Fri, 2 May 2008 22:09:01 +0000 Subject: [PATCH 08/76] Added control over distance to kept form target mesh Quad bug was fixed by splitting the quads that are feed to RayTree --- source/blender/blenkernel/BKE_shrinkwrap.h | 1 + source/blender/blenkernel/intern/modifier.c | 2 + source/blender/blenkernel/intern/shrinkwrap.c | 75 +++++++++++++------ source/blender/makesdna/DNA_modifier_types.h | 2 +- source/blender/src/buttons_editing.c | 3 +- 5 files changed, 60 insertions(+), 23 deletions(-) diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h index 0a302b21141..03c3f897dd4 100644 --- a/source/blender/blenkernel/BKE_shrinkwrap.h +++ b/source/blender/blenkernel/BKE_shrinkwrap.h @@ -48,6 +48,7 @@ typedef struct ShrinkwrapCalcData float local2target[4][4]; float target2local[4][4]; + float keptDist; //Distance to kept from target (units are in local space) //float *weights; //weights of vertexs unsigned char *moved; //boolean indicating if vertex has moved (TODO use bitmaps) diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 04c6c6c99f0..194ce65cd86 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -6978,6 +6978,8 @@ static void shrinkwrapModifier_initData(ModifierData *md) { ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; smd->shrinkType = MOD_SHRINKWRAP_NEAREST_SURFACE; + smd->shrinkOpts = MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL; + smd->keptDist = 0.0f; } static void shrinkwrapModifier_copyData(ModifierData *md, ModifierData *target) diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index f95e696734c..122256aef6f 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -102,14 +102,15 @@ static float vertexgroup_get_weight(MDeformVert *dvert, int index, int vgroup) if(dvert[index].dw[j].def_nr == vgroup) return dvert[index].dw[j].weight; } - return -1; + return 1.0; } /* * Raytree from mesh */ static MVert *raytree_from_mesh_verts = NULL; -static float raytree_from_mesh_start[3] = { 1e10f, 1e10f, 1e10f }; +static MFace *raytree_from_mesh_faces = NULL; +//static float raytree_from_mesh_start[3] = { 0.0f, 0.0f, 0.0f }; static int raytree_check_always(Isect *is, int ob, RayFace *face) { return TRUE; @@ -117,21 +118,33 @@ static int raytree_check_always(Isect *is, int ob, RayFace *face) static void raytree_from_mesh_get_coords(RayFace *face, float **v1, float **v2, float **v3, float **v4) { - MFace *mface= (MFace*)face; + MFace *mface= raytree_from_mesh_faces + (int)face/2 - 1 ; - if(mface == NULL) + if(face == (RayFace*)(-1)) { - *v1 = raytree_from_mesh_start; - *v2 = raytree_from_mesh_start; - *v3 = raytree_from_mesh_start; + *v1 = NULL; //raytree_from_mesh_start; + *v2 = NULL; //raytree_from_mesh_start; + *v3 = NULL; //raytree_from_mesh_start; *v4 = NULL; return; } - *v1= raytree_from_mesh_verts[mface->v1].co; - *v2= raytree_from_mesh_verts[mface->v2].co; - *v3= raytree_from_mesh_verts[mface->v3].co; - *v4= (mface->v4)? raytree_from_mesh_verts[mface->v4].co: NULL; + //Nasty quad splitting + if(((int)face) & 1) //we want the 2 triangle of the quad + { + assert(mface->v4); + *v1= raytree_from_mesh_verts[mface->v1].co; + *v2= raytree_from_mesh_verts[mface->v4].co; + *v3= raytree_from_mesh_verts[mface->v3].co; + *v4= NULL; + } + else + { + *v1= raytree_from_mesh_verts[mface->v1].co; + *v2= raytree_from_mesh_verts[mface->v2].co; + *v3= raytree_from_mesh_verts[mface->v3].co; + *v4= NULL; + } } /* @@ -152,7 +165,10 @@ static RayTree* raytree_create_from_mesh(DerivedMesh *mesh) int numFaces= mesh->getNumFaces(mesh); MFace *face = mesh->getFaceDataArray(mesh, CD_MFACE); int numVerts= mesh->getNumVerts(mesh); + + //Initialize static vars raytree_from_mesh_verts = mesh->getVertDataArray(mesh, CD_MVERT); + raytree_from_mesh_faces = face; //calculate bounding box @@ -165,9 +181,16 @@ static RayTree* raytree_create_from_mesh(DerivedMesh *mesh) if(tree == NULL) return NULL; - //Add faces to the RayTree - for(i=0; itarget, final, normal); - VecLerpf(final, orig, final, weight); //linear interpolation + VecMat4MulVecfl(final, calc->target2local, final); - VecMat4MulVecfl(vert[i].co, calc->target2local, final); + dist = VecLenf(vert[i].co, final); + if(dist > 1e-5) weight *= (dist - calc->keptDist)/dist; + VecLerpf(vert[i].co, vert[i].co, final, weight); //linear interpolation } } @@ -484,7 +510,8 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri Mat4Invert (smd->target->imat, smd->target->obmat); //inverse is outdated Mat4MulSerie(calc.local2target, smd->target->imat, ob->obmat, 0, 0, 0, 0, 0, 0); Mat4Invert(calc.target2local, calc.local2target); - + + calc.keptDist = smd->keptDist; //TODO: smd->keptDist is in global units.. must change to local } calc.moved = NULL; @@ -588,9 +615,11 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) if(t != -1) { - float weight = 1.0f; + float dist; VecMat4MulVecfl(nearest.co, calc->target2local, nearest.co); + dist = VecLenf(vert[i].co, tmp_co); + if(dist > 1e-5) weight *= (dist - calc->keptDist)/dist; VecLerpf(vert[i].co, vert[i].co, nearest.co, weight); //linear interpolation if(calc->moved) @@ -643,8 +672,7 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) { float dist = FLT_MAX; float weight = vertexgroup_get_weight(dvert, i, vgroup); -// if(weight == 0.0f) continue; - weight = 1.0; + if(weight == 0.0f) continue; //Transform coordinates local->target VecMat4MulVecfl(tmp_co, calc->local2target, vert[i].co); @@ -680,8 +708,13 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) if(ABS(dist) != FLT_MAX) { + float dist_t; + VECADDFAC(tmp_co, tmp_co, tmp_no, dist); VecMat4MulVecfl(tmp_co, calc->target2local, tmp_co); + + dist_t = VecLenf(vert[i].co, tmp_co); + if(dist_t > 1e-5) weight *= (dist_t - calc->keptDist)/dist_t; VecLerpf(vert[i].co, vert[i].co, tmp_co, weight); //linear interpolation if(calc->moved) diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 6dc018c33c0..2a38358c383 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -494,9 +494,9 @@ typedef struct ShrinkwrapModifierData { struct Object *target; /* shrink target */ char vgroup_name[32]; /* optional vertexgroup name */ + float keptDist; /* distance offset from mesh/projection point */ short shrinkType; /* shrink type projection */ short shrinkOpts; /* shrink options */ - short pad[2]; } ShrinkwrapModifierData; /* Shrinkwrap->shrinkType */ diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 2a10c2e5fce..d007ffad020 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -1822,7 +1822,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco height = 94; } else if (md->type==eModifierType_Shrinkwrap) { ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; - height = 67; + height = 86; if (smd->shrinkType == MOD_SHRINKWRAP_NORMAL) height += 19*2; } @@ -2452,6 +2452,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob); uiDefIDPoinBut(block, modifier_testMeshObj, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &smd->target, "Target to shrink to"); + uiDefButF(block, NUM, B_MODIFIER_RECALC, "Offset:", lx,(cy-=19),buttonWidth,19, &smd->keptDist, 0.0f, 100.0f, 1.0f, 0, "Specify distance to kept from the target"); } uiBlockEndAlign(block); From 0b7ab2f8ec1405b60262a13cf5d1ed671579dd69 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Mon, 5 May 2008 17:30:33 +0000 Subject: [PATCH 09/76] Merge from trunk svn merge -r 14626:14692 https://svn.blender.org/svnroot/bf-blender/trunk/blender --- CMakeLists.txt | 4 + SConstruct | 17 + config/darwin-config.py | 5 +- config/win32-vc-config.py | 1 - extern/verse/dist/v_bignum.c | 2 +- intern/ghost/intern/GHOST_SystemCarbon.cpp | 20 +- .../blenderhook/KX_blenderhook.vcproj | 2 +- .../gameengine/ketsji/KX_ketsji.vcproj | 2 +- .../rasterizer/RAS_rasterizer.vcproj | 2 +- .../RAS_openglrasterizer.vcproj | 2 +- release/scripts/console.py | 14 +- release/scripts/wizard_curve2tree.py | 4 +- release/scripts/x3d_export.py | 1662 ++++++++--------- source/blender/blenkernel/BKE_node.h | 3 +- .../blender/blenkernel/intern/DerivedMesh.c | 4 +- source/blender/blenkernel/intern/constraint.c | 6 +- source/blender/blenkernel/intern/image.c | 25 +- source/blender/blenkernel/intern/library.c | 2 +- source/blender/blenkernel/intern/mball.c | 64 +- source/blender/blenkernel/intern/node.c | 3 - source/blender/blenkernel/intern/packedFile.c | 6 +- .../blenkernel/intern/particle_system.c | 3 +- source/blender/blenkernel/intern/pointcache.c | 2 +- source/blender/blenkernel/intern/sound.c | 6 +- source/blender/blenkernel/intern/text.c | 6 +- source/blender/blenkernel/intern/writeavi.c | 2 +- .../blender/blenkernel/intern/writeffmpeg.c | 3 +- source/blender/blenlib/BLI_blenlib.h | 3 +- source/blender/blenlib/intern/bpath.c | 4 +- source/blender/blenlib/intern/util.c | 122 +- source/blender/blenloader/intern/genfile.c | 24 +- source/blender/include/BIF_screen.h | 1 - source/blender/include/butspace.h | 2 +- .../nodes/intern/SHD_nodes/SHD_dynamic.c | 8 +- source/blender/python/BPY_interface.c | 4 +- source/blender/python/BPY_menus.c | 8 +- source/blender/python/api2_2x/Blender.c | 22 +- source/blender/python/api2_2x/Library.c | 77 +- source/blender/python/api2_2x/Library.h | 2 + source/blender/python/api2_2x/Node.c | 19 +- source/blender/python/api2_2x/Sys.c | 3 +- source/blender/python/api2_2x/doc/LibData.py | 8 +- source/blender/python/api2_2x/sceneRender.c | 7 +- .../quicktime/apple/quicktime_export.c | 2 +- .../blender/render/intern/source/pipeline.c | 3 +- source/blender/src/buttons_editing.c | 10 +- source/blender/src/buttons_object.c | 10 +- source/blender/src/buttons_scene.c | 24 +- source/blender/src/buttons_shading.c | 6 +- source/blender/src/drawimage.c | 2 +- source/blender/src/drawobject.c | 2 + source/blender/src/drawview.c | 34 +- source/blender/src/editcurve.c | 12 +- source/blender/src/editdeform.c | 24 +- source/blender/src/editimasel.c | 3 +- source/blender/src/editipo.c | 107 +- source/blender/src/editobject.c | 38 +- source/blender/src/editscreen.c | 8 +- source/blender/src/editsima.c | 6 +- source/blender/src/editsound.c | 8 +- source/blender/src/filesel.c | 2 +- source/blender/src/fluidsim.c | 4 +- source/blender/src/ghostwinlay.c | 36 + source/blender/src/header_action.c | 39 +- source/blender/src/header_ipo.c | 17 +- source/blender/src/header_nla.c | 13 +- source/blender/src/interface_draw.c | 2 +- source/blender/src/outliner.c | 2 +- source/blender/src/screendump.c | 3 +- source/blender/src/seqaudio.c | 5 +- source/blender/src/sequence.c | 22 +- source/blender/src/space.c | 2 + source/blender/src/view.c | 4 +- source/blender/src/writeimage.c | 3 +- source/blender/src/writemovie.c | 2 +- source/blender/yafray/intern/export_File.cpp | 2 +- .../blender/yafray/intern/export_Plugin.cpp | 2 +- .../BlenderRoutines/BL_KetsjiEmbedStart.cpp | 4 +- .../BlenderRoutines/KX_BlenderRenderTools.cpp | 4 + .../Converter/BL_BlenderDataConversion.cpp | 5 +- .../Converter/KX_ConvertActuators.cpp | 2 +- .../GameLogic/SCA_KeyboardSensor.cpp | 43 + .../gameengine/GameLogic/SCA_MouseSensor.cpp | 26 + .../GamePlayer/common/GPC_RenderTools.cpp | 4 + .../gameengine/GamePlayer/ghost/GPG_ghost.cpp | 2 +- .../gameengine/Ketsji/KX_BlenderMaterial.cpp | 14 +- source/gameengine/Ketsji/KX_BlenderMaterial.h | 1 + .../Ketsji/KX_ConvertPhysicsObjects.cpp | 9 +- source/gameengine/Ketsji/KX_GameObject.cpp | 19 +- source/gameengine/Ketsji/KX_GameObject.h | 17 + source/gameengine/Ketsji/KX_Scene.cpp | 2 + .../Physics/Bullet/CcdPhysicsController.cpp | 4 + .../Physics/Bullet/CcdPhysicsController.h | 2 + .../Rasterizer/RAS_BucketManager.cpp | 1 + .../gameengine/Rasterizer/RAS_IRenderTools.h | 4 + .../Rasterizer/RAS_MaterialBucket.cpp | 8 +- 96 files changed, 1656 insertions(+), 1160 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c34233245a..b58fe945663 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -250,6 +250,10 @@ IF(WIN32) ELSE (MSVC80) SET(OPENEXR_LIBPATH ${OPENEXR}/lib_msvc) ENDIF(MSVC80) + IF (MSVC90) + SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008) + ENDIF(MSVC90) + SET(QUICKTIME ${LIBDIR}/QTDevWin) SET(QUICKTIME_INC ${QUICKTIME}/CIncludes) diff --git a/SConstruct b/SConstruct index 942bef078d6..869ba6454c8 100644 --- a/SConstruct +++ b/SConstruct @@ -398,9 +398,26 @@ for tp, tn, tf in os.walk('release/plugins'): if '.svn' in tn: tn.remove('.svn') for f in tf: + print ">>>", env['BF_INSTALLDIR'], tp, f pluglist.append(tp+os.sep+f) plugtargetlist.append(env['BF_INSTALLDIR']+tp[7:]+os.sep+f) +# header files for plugins +pluglist.append('source/blender/blenpluginapi/documentation.h') +plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep +'documentation.h') +pluglist.append('source/blender/blenpluginapi/externdef.h') +plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep +'externdef.h') +pluglist.append('source/blender/blenpluginapi/floatpatch.h') +plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep +'floatpatch.h') +pluglist.append('source/blender/blenpluginapi/iff.h') +plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep +'iff.h') +pluglist.append('source/blender/blenpluginapi/plugin.h') +plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep +'plugin.h') +pluglist.append('source/blender/blenpluginapi/util.h') +plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep +'util.h') +pluglist.append('source/blender/blenpluginapi/plugin.DEF') +plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep + 'plugin.def') + plugininstall = [] for targetdir,srcfile in zip(plugtargetlist, pluglist): td, tf = os.path.split(targetdir) diff --git a/config/darwin-config.py b/config/darwin-config.py index 8fec38ac48e..8fd6c3251ba 100644 --- a/config/darwin-config.py +++ b/config/darwin-config.py @@ -221,9 +221,10 @@ if USE_SDK=='true': CCFLAGS=SDK_FLAGS+CCFLAGS CXXFLAGS=SDK_FLAGS+CXXFLAGS +# you can add -mssse3 if gcc >= 4.2 if MAC_PROC == 'i386': - REL_CFLAGS = ['-O2','-ftree-vectorize','-msse','-msse2','-msse3','-mssse3'] - REL_CCFLAGS = ['-O2','-ftree-vectorize','-msse','-msse2','-msse3','-mssse3'] + REL_CFLAGS = ['-O2','-ftree-vectorize','-msse','-msse2','-msse3'] + REL_CCFLAGS = ['-O2','-ftree-vectorize','-msse','-msse2','-msse3'] else: CFLAGS = CFLAGS+['-fno-strict-aliasing'] CCFLAGS = CCFLAGS+['-fno-strict-aliasing'] diff --git a/config/win32-vc-config.py b/config/win32-vc-config.py index 1f7e62102af..32b6597b5d5 100644 --- a/config/win32-vc-config.py +++ b/config/win32-vc-config.py @@ -170,7 +170,6 @@ PLATFORM_LINKFLAGS = ''' /NODEFAULTLIB:"libcd.lib" /NODEFAULTLIB:"libcpd.lib" /NODEFAULTLIB:"libcp.lib" - /NODEFAULTLIB:"libcmtd.lib" ''' BF_BUILDDIR = '..\\build\\win32-vc' diff --git a/extern/verse/dist/v_bignum.c b/extern/verse/dist/v_bignum.c index 3f3ea7f9ccc..3f65af03427 100644 --- a/extern/verse/dist/v_bignum.c +++ b/extern/verse/dist/v_bignum.c @@ -768,7 +768,7 @@ void v_bignum_square_half(VBigDig *x) for(j = i + 1; j < t; j++) { /* printf("computing uv=%X+2*%X*%X+%X\n", w[i + j], x[1 + j], x[1 + i], c);*/ - uv = x[1 + j] * x[1 + i]; + uv = ((VBigDigs)x[1 + j]) * ((VBigDigs)x[1 + i]); high = (uv & 0x80000000) != 0; uv *= 2; ouv = uv; /* Addition below might wrap and generate high bit. */ diff --git a/intern/ghost/intern/GHOST_SystemCarbon.cpp b/intern/ghost/intern/GHOST_SystemCarbon.cpp index 568f7ecf9b8..78c25997806 100644 --- a/intern/ghost/intern/GHOST_SystemCarbon.cpp +++ b/intern/ghost/intern/GHOST_SystemCarbon.cpp @@ -34,10 +34,9 @@ * @date May 7, 2001 */ -#ifdef HAVE_CONFIG_H -#include -#endif +#include +#include #include "GHOST_SystemCarbon.h" #include "GHOST_DisplayManagerCarbon.h" @@ -52,6 +51,7 @@ #include "GHOST_WindowManager.h" #include "GHOST_WindowCarbon.h" #include "GHOST_NDOFManager.h" +#include "AssertMacros.h" #define GHOST_KEY_SWITCH(mac, ghost) { case (mac): ghostKey = (ghost); break; } @@ -1121,12 +1121,15 @@ GHOST_TUns8* GHOST_SystemCarbon::getClipboard(int flag) const OSStatus err = noErr; GHOST_TUns8 * temp_buff; CFRange range; + OSStatus syncFlags; err = PasteboardCreate(kPasteboardClipboard, &inPasteboard); if(err != noErr) { return NULL;} - err = PasteboardSynchronize( inPasteboard ); - if(err != noErr) { return NULL;} + syncFlags = PasteboardSynchronize( inPasteboard ); + /* as we always get in a new string, we can safely ignore sync flags if not an error*/ + if(syncFlags <0) { return NULL;} + err = PasteboardGetItemIdentifier( inPasteboard, 1, &itemID ); if(err != noErr) { return NULL;} @@ -1152,15 +1155,18 @@ GHOST_TUns8* GHOST_SystemCarbon::getClipboard(int flag) const void GHOST_SystemCarbon::putClipboard(GHOST_TInt8 *buffer, int flag) const { if(flag == 1) {return;} //If Flag is 1 means the selection and is used on X11 + PasteboardRef inPasteboard; CFDataRef textData = NULL; OSStatus err = noErr; /*For error checking*/ + OSStatus syncFlags; err = PasteboardCreate(kPasteboardClipboard, &inPasteboard); if(err != noErr) { return;} - err = PasteboardSynchronize( inPasteboard ); - if(err != noErr) { return;} + syncFlags = PasteboardSynchronize( inPasteboard ); + /* as we always put in a new string, we can safely ignore sync flags */ + if(syncFlags <0) { return;} err = PasteboardClear( inPasteboard ); if(err != noErr) { return;} diff --git a/projectfiles_vc7/gameengine/blenderhook/KX_blenderhook.vcproj b/projectfiles_vc7/gameengine/blenderhook/KX_blenderhook.vcproj index 1721062b75c..bc4204eaa44 100644 --- a/projectfiles_vc7/gameengine/blenderhook/KX_blenderhook.vcproj +++ b/projectfiles_vc7/gameengine/blenderhook/KX_blenderhook.vcproj @@ -22,7 +22,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\ketsji;..\..\..\source\gameengine\network;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Physics\Sumo;..\..\..\source\gameengine\Physics\common;..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include" - PreprocessorDefinitions="WIN32,_LIB,_DEBUG" + PreprocessorDefinitions="WIN32;_LIB;_DEBUG;WITH_GLEXT" BasicRuntimeChecks="3" RuntimeLibrary="1" DefaultCharIsUnsigned="TRUE" diff --git a/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj b/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj index e73e72316c1..d85fb6c3482 100644 --- a/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj +++ b/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj @@ -127,7 +127,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet" - PreprocessorDefinitions="JANCODEPANCO;WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG;USE_SUMO_SOLID" + PreprocessorDefinitions="JANCODEPANCO;WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG;USE_SUMO_SOLID;WITH_GLEXT" BasicRuntimeChecks="3" RuntimeLibrary="1" DefaultCharIsUnsigned="TRUE" diff --git a/projectfiles_vc7/gameengine/rasterizer/RAS_rasterizer.vcproj b/projectfiles_vc7/gameengine/rasterizer/RAS_rasterizer.vcproj index 75a2a852011..f4801b58bc8 100644 --- a/projectfiles_vc7/gameengine/rasterizer/RAS_rasterizer.vcproj +++ b/projectfiles_vc7/gameengine/rasterizer/RAS_rasterizer.vcproj @@ -22,7 +22,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\source\kernel\gen_system" - PreprocessorDefinitions="_DEBUG,WIN32,_LIB" + PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_GLEXT" BasicRuntimeChecks="3" RuntimeLibrary="1" DefaultCharIsUnsigned="TRUE" diff --git a/projectfiles_vc7/gameengine/rasterizer/openglrasterizer/RAS_openglrasterizer.vcproj b/projectfiles_vc7/gameengine/rasterizer/openglrasterizer/RAS_openglrasterizer.vcproj index 6046cc5cac5..b96cf78daf5 100644 --- a/projectfiles_vc7/gameengine/rasterizer/openglrasterizer/RAS_openglrasterizer.vcproj +++ b/projectfiles_vc7/gameengine/rasterizer/openglrasterizer/RAS_openglrasterizer.vcproj @@ -74,7 +74,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer" - PreprocessorDefinitions="_DEBUG,WIN32,_LIB" + PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_GLEXT" BasicRuntimeChecks="3" RuntimeLibrary="1" DefaultCharIsUnsigned="TRUE" diff --git a/release/scripts/console.py b/release/scripts/console.py index 6860af4442e..9a18c724d47 100644 --- a/release/scripts/console.py +++ b/release/scripts/console.py @@ -61,7 +61,7 @@ __LINE_HISTORY__ = 500 global __FONT_SIZE__ -__FONT_SIZES__ = ( ('tiny', 10), ('small', 12), ('normal', 14), ('large', 16) ) +__FONT_SIZES__ = ( ('tiny', 10), ('small', 12), ('normalfix', 14), ('large', 16) ) __FONT_SIZE__ = 2 # index for the list above, normal default. global __CONSOLE_LINE_OFFSET__ @@ -420,9 +420,13 @@ def handle_event(evt, val): global histIndex, cmdBuffer if abs(histIndex)+1 >= len(cmdBuffer): histIndex = -1 + histIndex_orig = histIndex histIndex -= 1 - while cmdBuffer[histIndex].type != 0 and abs(histIndex) < len(cmdBuffer): + + while (cmdBuffer[histIndex].type != 0 and abs(histIndex) < len(cmdBuffer)) or \ + ( cmdBuffer[histIndex].cmd == cmdBuffer[histIndex_orig].cmd): histIndex -= 1 + if cmdBuffer[histIndex].type == 0: # we found one cmdBuffer[-1].cmd = cmdBuffer[histIndex].cmd @@ -430,9 +434,13 @@ def handle_event(evt, val): global histIndex, cmdBuffer if histIndex >= -2: histIndex = -len(cmdBuffer) + histIndex_orig = histIndex histIndex += 1 - while cmdBuffer[histIndex].type != 0 and histIndex != -2: + while (cmdBuffer[histIndex].type != 0 and histIndex != -2) or \ + ( cmdBuffer[histIndex].cmd == cmdBuffer[histIndex_orig].cmd): + histIndex += 1 + if cmdBuffer[histIndex].type == 0: # we found one cmdBuffer[-1].cmd = cmdBuffer[histIndex].cmd diff --git a/release/scripts/wizard_curve2tree.py b/release/scripts/wizard_curve2tree.py index 2dcda953a89..eb27f1ca0f5 100644 --- a/release/scripts/wizard_curve2tree.py +++ b/release/scripts/wizard_curve2tree.py @@ -3405,7 +3405,7 @@ def buildTree(ob_curve, single=False): if leaf_object: ob_leaf_dupliface.enableDupFaces = True ob_leaf_dupliface.enableDupFacesScale = True - ob_leaf_dupliface.makeParent([leaf_object]) + ob_leaf_dupliface.makeParent([leaf_object], 1) else: ob_leaf_dupliface.enableDupFaces = False @@ -3637,7 +3637,7 @@ def do_tree_generate(e,v): GLOBALS['non_bez_error'] = 0 def do_tree_help(e,v): - url = 'http://wiki.blender.org/index.php/Scripts/Manual/Export/autodesk_fbx' + url = 'http://wiki.blender.org/index.php/Scripts/Manual/Wizards/TreeFromCurves' print 'Trying to open web browser with documentation at this address...' print '\t' + url diff --git a/release/scripts/x3d_export.py b/release/scripts/x3d_export.py index eb9d5d35d6c..ac4a8e9ca5b 100644 --- a/release/scripts/x3d_export.py +++ b/release/scripts/x3d_export.py @@ -1,15 +1,12 @@ #!BPY """ Registration info for Blender menus: Name: 'X3D Extensible 3D (.x3d)...' -Blender: 235 +Blender: 245 Group: 'Export' -Submenu: 'All Objects...' all -Submenu: 'All Objects compressed...' comp -Submenu: 'Selected Objects...' selected -Tooltip: 'Export to Extensible 3D file (.x3d)' +Tooltip: 'Export selection to Extensible 3D file (.x3d)' """ -__author__ = ("Bart") +__author__ = ("Bart", "Campbell Barton") __email__ = ["Bart, bart:neeneenee*de"] __url__ = ["Author's (Bart) homepage, http://www.neeneenee.de/vrml"] __version__ = "2006/01/17" @@ -22,10 +19,9 @@ Run this script from "File->Export" menu. A pop-up will ask whether you want to export only selected or all relevant objects. Known issues:
- Doesn't handle multiple materials (don't use material indices);
- Doesn't handle multiple UV textures on a single mesh (create a mesh -for each texture);
- Can't get the texture array associated with material * not the UV ones; + Doesn't handle multiple materials (don't use material indices);
+ Doesn't handle multiple UV textures on a single mesh (create a mesh for each texture);
+ Can't get the texture array associated with material * not the UV ones; """ @@ -58,953 +54,903 @@ for each texture);
#################################### import Blender -from Blender import Object, NMesh, Lamp, Draw, Image, Text, sys +from Blender import Object, Lamp, Draw, Image, Text, sys, Mesh from Blender.Scene import Render import math +# +DEG2RAD=0.017453292519943295 +MATWORLD= Blender.Mathutils.RotationMatrix(-90, 4, 'x') + #################################### # Global Variables #################################### -scene = Blender.Scene.GetCurrent() -world = Blender.World.GetCurrent() -worldmat = Blender.Texture.Get() filename = Blender.Get('filename') _safeOverwrite = True ARG='' extension = '' -class DrawTypes: - """Object DrawTypes enum values - BOUNDS - draw only the bounding box of the object - WIRE - draw object as a wire frame - SOLID - draw object with flat shading - SHADED - draw object with OpenGL shading -""" - BOUNDBOX = 1 - WIRE = 2 - SOLID = 3 - SHADED = 4 - TEXTURE = 5 - -if not hasattr(Blender.Object,'DrawTypes'): - Blender.Object.DrawTypes = DrawTypes() - ########################################################## # Functions for writing output file ########################################################## class VRML2Export: - def __init__(self, filename): - #--- public you can change these --- - self.writingcolor = 0 - self.writingtexture = 0 - self.writingcoords = 0 - self.wire = 0 - self.proto = 1 - self.matonly = 0 - self.share = 0 - self.billnode = 0 - self.halonode = 0 - self.collnode = 0 - self.tilenode = 0 - self.verbose=2 # level of verbosity in console 0-none, 1-some, 2-most - self.cp=3 # decimals for material color values 0.000 - 1.000 - self.vp=3 # decimals for vertex coordinate values 0.000 - n.000 - self.tp=3 # decimals for texture coordinate values 0.000 - 1.000 - self.it=3 - - #--- class private don't touch --- - self.texNames={} # dictionary of textureNames - self.matNames={} # dictionary of materiaNames - self.meshNames={} # dictionary of meshNames - self.indentLevel=0 # keeps track of current indenting - self.filename=filename - self.file = open(filename, "w") - self.bNav=0 - self.nodeID=0 - self.namesReserved=[ "Anchor","Appearance","Arc2D","ArcClose2D","AudioClip","Background","Billboard", - "BooleanFilter","BooleanSequencer","BooleanToggle","BooleanTrigger","Box","Circle2D", - "Collision","Color","ColorInterpolator","ColorRGBA","component","Cone","connect", - "Contour2D","ContourPolyline2D","Coordinate","CoordinateDouble","CoordinateInterpolator", - "CoordinateInterpolator2D","Cylinder","CylinderSensor","DirectionalLight","Disk2D", - "ElevationGrid","EspduTransform","EXPORT","ExternProtoDeclare","Extrusion","field", - "fieldValue","FillProperties","Fog","FontStyle","GeoCoordinate","GeoElevationGrid", - "GeoLocationLocation","GeoLOD","GeoMetadata","GeoOrigin","GeoPositionInterpolator", - "GeoTouchSensor","GeoViewpoint","Group","HAnimDisplacer","HAnimHumanoid","HAnimJoint", - "HAnimSegment","HAnimSite","head","ImageTexture","IMPORT","IndexedFaceSet", - "IndexedLineSet","IndexedTriangleFanSet","IndexedTriangleSet","IndexedTriangleStripSet", - "Inline","IntegerSequencer","IntegerTrigger","IS","KeySensor","LineProperties","LineSet", - "LoadSensor","LOD","Material","meta","MetadataDouble","MetadataFloat","MetadataInteger", - "MetadataSet","MetadataString","MovieTexture","MultiTexture","MultiTextureCoordinate", - "MultiTextureTransform","NavigationInfo","Normal","NormalInterpolator","NurbsCurve", - "NurbsCurve2D","NurbsOrientationInterpolator","NurbsPatchSurface", - "NurbsPositionInterpolator","NurbsSet","NurbsSurfaceInterpolator","NurbsSweptSurface", - "NurbsSwungSurface","NurbsTextureCoordinate","NurbsTrimmedSurface","OrientationInterpolator", - "PixelTexture","PlaneSensor","PointLight","PointSet","Polyline2D","Polypoint2D", - "PositionInterpolator","PositionInterpolator2D","ProtoBody","ProtoDeclare","ProtoInstance", - "ProtoInterface","ProximitySensor","ReceiverPdu","Rectangle2D","ROUTE","ScalarInterpolator", - "Scene","Script","Shape","SignalPdu","Sound","Sphere","SphereSensor","SpotLight","StaticGroup", - "StringSensor","Switch","Text","TextureBackground","TextureCoordinate","TextureCoordinateGenerator", - "TextureTransform","TimeSensor","TimeTrigger","TouchSensor","Transform","TransmitterPdu", - "TriangleFanSet","TriangleSet","TriangleSet2D","TriangleStripSet","Viewpoint","VisibilitySensor", - "WorldInfo","X3D","XvlShell","VertexShader","FragmentShader","MultiShaderAppearance","ShaderAppearance" ] - self.namesStandard=[ "Empty","Empty.000","Empty.001","Empty.002","Empty.003","Empty.004","Empty.005", - "Empty.006","Empty.007","Empty.008","Empty.009","Empty.010","Empty.011","Empty.012", - "Scene.001","Scene.002","Scene.003","Scene.004","Scene.005","Scene.06","Scene.013", - "Scene.006","Scene.007","Scene.008","Scene.009","Scene.010","Scene.011","Scene.012", - "World","World.000","World.001","World.002","World.003","World.004","World.005" ] - self.namesFog=[ "","LINEAR","EXPONENTIAL","" ] + def __init__(self, filename): + #--- public you can change these --- + self.writingcolor = 0 + self.writingtexture = 0 + self.writingcoords = 0 + self.proto = 1 + self.matonly = 0 + self.share = 0 + self.billnode = 0 + self.halonode = 0 + self.collnode = 0 + self.tilenode = 0 + self.verbose=2 # level of verbosity in console 0-none, 1-some, 2-most + self.cp=3 # decimals for material color values 0.000 - 1.000 + self.vp=3 # decimals for vertex coordinate values 0.000 - n.000 + self.tp=3 # decimals for texture coordinate values 0.000 - 1.000 + self.it=3 + + #--- class private don't touch --- + self.texNames={} # dictionary of textureNames + self.matNames={} # dictionary of materiaNames + self.meshNames={} # dictionary of meshNames + self.indentLevel=0 # keeps track of current indenting + self.filename=filename + self.file = open(filename, "w") + self.bNav=0 + self.nodeID=0 + self.namesReserved=[ "Anchor","Appearance","Arc2D","ArcClose2D","AudioClip","Background","Billboard", + "BooleanFilter","BooleanSequencer","BooleanToggle","BooleanTrigger","Box","Circle2D", + "Collision","Color","ColorInterpolator","ColorRGBA","component","Cone","connect", + "Contour2D","ContourPolyline2D","Coordinate","CoordinateDouble","CoordinateInterpolator", + "CoordinateInterpolator2D","Cylinder","CylinderSensor","DirectionalLight","Disk2D", + "ElevationGrid","EspduTransform","EXPORT","ExternProtoDeclare","Extrusion","field", + "fieldValue","FillProperties","Fog","FontStyle","GeoCoordinate","GeoElevationGrid", + "GeoLocationLocation","GeoLOD","GeoMetadata","GeoOrigin","GeoPositionInterpolator", + "GeoTouchSensor","GeoViewpoint","Group","HAnimDisplacer","HAnimHumanoid","HAnimJoint", + "HAnimSegment","HAnimSite","head","ImageTexture","IMPORT","IndexedFaceSet", + "IndexedLineSet","IndexedTriangleFanSet","IndexedTriangleSet","IndexedTriangleStripSet", + "Inline","IntegerSequencer","IntegerTrigger","IS","KeySensor","LineProperties","LineSet", + "LoadSensor","LOD","Material","meta","MetadataDouble","MetadataFloat","MetadataInteger", + "MetadataSet","MetadataString","MovieTexture","MultiTexture","MultiTextureCoordinate", + "MultiTextureTransform","NavigationInfo","Normal","NormalInterpolator","NurbsCurve", + "NurbsCurve2D","NurbsOrientationInterpolator","NurbsPatchSurface", + "NurbsPositionInterpolator","NurbsSet","NurbsSurfaceInterpolator","NurbsSweptSurface", + "NurbsSwungSurface","NurbsTextureCoordinate","NurbsTrimmedSurface","OrientationInterpolator", + "PixelTexture","PlaneSensor","PointLight","PointSet","Polyline2D","Polypoint2D", + "PositionInterpolator","PositionInterpolator2D","ProtoBody","ProtoDeclare","ProtoInstance", + "ProtoInterface","ProximitySensor","ReceiverPdu","Rectangle2D","ROUTE","ScalarInterpolator", + "Scene","Script","Shape","SignalPdu","Sound","Sphere","SphereSensor","SpotLight","StaticGroup", + "StringSensor","Switch","Text","TextureBackground","TextureCoordinate","TextureCoordinateGenerator", + "TextureTransform","TimeSensor","TimeTrigger","TouchSensor","Transform","TransmitterPdu", + "TriangleFanSet","TriangleSet","TriangleSet2D","TriangleStripSet","Viewpoint","VisibilitySensor", + "WorldInfo","X3D","XvlShell","VertexShader","FragmentShader","MultiShaderAppearance","ShaderAppearance" ] + self.namesStandard=[ "Empty","Empty.000","Empty.001","Empty.002","Empty.003","Empty.004","Empty.005", + "Empty.006","Empty.007","Empty.008","Empty.009","Empty.010","Empty.011","Empty.012", + "Scene.001","Scene.002","Scene.003","Scene.004","Scene.005","Scene.06","Scene.013", + "Scene.006","Scene.007","Scene.008","Scene.009","Scene.010","Scene.011","Scene.012", + "World","World.000","World.001","World.002","World.003","World.004","World.005" ] + self.namesFog=[ "","LINEAR","EXPONENTIAL","" ] ########################################################## # Writing nodes routines ########################################################## - def writeHeader(self): - #bfile = sys.expandpath( Blender.Get('filename') ).replace('<', '<').replace('>', '>') - bfile = self.filename.replace('<', '<').replace('>', '>') # use outfile name - self.file.write("\n") - self.file.write("\n") - self.file.write("\n") - self.file.write("\n") - self.file.write("\t\n" % sys.basename(bfile)) - self.file.write("\t\n" % Blender.Get('version')) - self.file.write("\t\n") - self.file.write("\n") - self.file.write("\n") + def writeHeader(self): + #bfile = sys.expandpath( Blender.Get('filename') ).replace('<', '<').replace('>', '>') + bfile = self.filename.replace('<', '<').replace('>', '>') # use outfile name + self.file.write("\n") + self.file.write("\n") + self.file.write("\n") + self.file.write("\n") + self.file.write("\t\n" % sys.basename(bfile)) + self.file.write("\t\n" % Blender.Get('version')) + self.file.write("\t\n") + self.file.write("\n") + self.file.write("\n") + + # This functionality is poorly defined, disabling for now - campbell + ''' + def writeInline(self): + inlines = Blender.Scene.Get() + allinlines = len(inlines) + if scene != inlines[0]: + return + else: + for i in xrange(allinlines): + nameinline=inlines[i].name + if (nameinline not in self.namesStandard) and (i > 0): + self.file.write("" % nameinline) + self.file.write("\n\n") + ''' + + def writeScript(self): + textEditor = Blender.Text.Get() + alltext = len(textEditor) + for i in xrange(alltext): + nametext = textEditor[i].name + nlines = textEditor[i].getNLines() + if (self.proto == 1): + if (nametext == "proto" or nametext == "proto.js" or nametext == "proto.txt") and (nlines != None): + nalllines = len(textEditor[i].asLines()) + alllines = textEditor[i].asLines() + for j in xrange(nalllines): + self.writeIndented(alllines[j] + "\n") + elif (self.proto == 0): + if (nametext == "route" or nametext == "route.js" or nametext == "route.txt") and (nlines != None): + nalllines = len(textEditor[i].asLines()) + alllines = textEditor[i].asLines() + for j in xrange(nalllines): + self.writeIndented(alllines[j] + "\n") + self.writeIndented("\n") - def writeInline(self): - inlines = Blender.Scene.Get() - allinlines = len(inlines) - if scene != inlines[0]: - return - else: - for i in xrange(allinlines): - nameinline=inlines[i].name - if (nameinline not in self.namesStandard) and (i > 0): - self.file.write("" % nameinline) - self.file.write("\n\n") + def writeViewpoint(self, ob, scene): + context = scene.render + ratio = float(context.imageSizeY())/float(context.imageSizeX()) + lens = (360* (math.atan(ratio *16 / ob.data.getLens()) / math.pi))*(math.pi/180) + lens = min(lens, math.pi) + + # get the camera location, subtract 90 degress from X to orient like X3D does + mat = ob.matrixWorld + loc = self.rotatePointForVRML(mat.translationPart()) + rot = mat.toEuler() + rot = (((rot[0]-90)*DEG2RAD), rot[1]*DEG2RAD, rot[2]*DEG2RAD) + nRot = self.rotatePointForVRML( rot ) + # convert to Quaternion and to Angle Axis + Q = self.eulerToQuaternions(nRot[0], nRot[1], nRot[2]) + Q1 = self.multiplyQuaternions(Q[0], Q[1]) + Qf = self.multiplyQuaternions(Q1, Q[2]) + angleAxis = self.quaternionToAngleAxis(Qf) + self.file.write("\n\n" % (lens)) - def writeScript(self): - textEditor = Blender.Text.Get() - alltext = len(textEditor) - for i in xrange(alltext): - nametext = textEditor[i].getName() - nlines = textEditor[i].getNLines() - if (self.proto == 1): - if (nametext == "proto" or nametext == "proto.js" or nametext == "proto.txt") and (nlines != None): - nalllines = len(textEditor[i].asLines()) - alllines = textEditor[i].asLines() - for j in xrange(nalllines): - self.writeIndented(alllines[j] + "\n") - elif (self.proto == 0): - if (nametext == "route" or nametext == "route.js" or nametext == "route.txt") and (nlines != None): - nalllines = len(textEditor[i].asLines()) - alllines = textEditor[i].asLines() - for j in xrange(nalllines): - self.writeIndented(alllines[j] + "\n") - self.writeIndented("\n") + def writeFog(self, world): + if world: + mtype = world.getMistype() + mparam = world.getMist() + grd = world.getHor() + grd0, grd1, grd2 = grd[0], grd[1], grd[2] + else: + return + if (mtype == 1 or mtype == 2): + self.file.write("\n\n" % round(mparam[2],self.cp)) + else: + return + ''' + def writeNavigationInfo(self, scene): + allObj = [] + allObj = list(scene.objects) + headlight = "true" + vislimit = 0.0 + for ob in allObj: + objType=ob.type + if objType == "Camera": + vislimit = ob.data.clipEnd + elif objType == "Lamp": + headlight = "false" + self.file.write("\n\n") + ''' + def writeSpotLight(self, ob, lamp, world): + safeName = self.cleanStr(ob.name) + if world: + ambi = world.amb + ambientIntensity = ((float(ambi[0] + ambi[1] + ambi[2]))/3)/2.5 + else: + ambi = 0 + ambientIntensity = 0 - def writeViewpoint(self, thisObj): - context = scene.getRenderingContext() - ratio = float(context.imageSizeY())/float(context.imageSizeX()) - lens = (360* (math.atan(ratio *16 / thisObj.data.getLens()) / math.pi))*(math.pi/180) - lens = min(lens, math.pi) - # get the camera location, subtract 90 degress from X to orient like X3D does - loc = self.rotatePointForVRML(thisObj.loc) - rot = [thisObj.RotX - 1.57, thisObj.RotY, thisObj.RotZ] - nRot = self.rotatePointForVRML(rot) - # convert to Quaternion and to Angle Axis - Q = self.eulerToQuaternions(nRot[0], nRot[1], nRot[2]) - Q1 = self.multiplyQuaternions(Q[0], Q[1]) - Qf = self.multiplyQuaternions(Q1, Q[2]) - angleAxis = self.quaternionToAngleAxis(Qf) - self.file.write("\n\n" % (lens)) + # compute cutoff and beamwidth + intensity=min(lamp.energy/1.75,1.0) + beamWidth=((lamp.spotSize*math.pi)/180.0)*.37; + cutOffAngle=beamWidth*1.3 - def writeFog(self): - if world: - mtype = world.getMistype() - mparam = world.getMist() - grd = world.getHor() - grd0, grd1, grd2 = grd[0], grd[1], grd[2] - else: - return - if (mtype == 1 or mtype == 2): - self.file.write("\n\n" % round(mparam[2],self.cp)) - else: - return + dx,dy,dz=self.computeDirection(ob) + # note -dx seems to equal om[3][0] + # note -dz seems to equal om[3][1] + # note dy seems to equal om[3][2] - def writeNavigationInfo(self, scene): - allObj = [] - allObj = list(scene.objects) - headlight = "true" - vislimit = 0.0 - for thisObj in allObj: - objType=thisObj.type - if objType == "Camera": - vislimit = thisObj.data.clipEnd - elif objType == "Lamp": - headlight = "false" - self.file.write("\n\n") + location=(ob.matrixWorld*MATWORLD).translationPart() + radius = lamp.dist*math.cos(beamWidth) + self.file.write("\n\n" % (round(location[0],3), round(location[1],3), round(location[2],3))) + + + def writeDirectionalLight(self, ob, lamp, world): + safeName = self.cleanStr(ob.name) + if world: + ambi = world.amb + ambientIntensity = ((float(ambi[0] + ambi[1] + ambi[2]))/3)/2.5 + else: + ambi = 0 + ambientIntensity = 0 - def writeSpotLight(self, ob, lamp): - safeName = self.cleanStr(ob.name) - if world: - ambi = world.amb - ambientIntensity = ((float(ambi[0] + ambi[1] + ambi[2]))/3)/2.5 - else: - ambi = 0 - ambientIntensity = 0 + intensity=min(lamp.energy/1.75,1.0) + (dx,dy,dz)=self.computeDirection(ob) + self.file.write("\n\n" % (round(dx,4),round(dy,4),round(dz,4))) - # compute cutoff and beamwidth - intensity=min(lamp.energy/1.75,1.0) - beamWidth=((lamp.spotSize*math.pi)/180.0)*.37; - cutOffAngle=beamWidth*1.3 + def writePointLight(self, ob, lamp, world): + safeName = self.cleanStr(ob.name) + if world: + ambi = world.amb + ambientIntensity = ((float(ambi[0] + ambi[1] + ambi[2]))/3)/2.5 + else: + ambi = 0 + ambientIntensity = 0 + + location=(ob.matrixWorld*MATWORLD).translationPart() + intensity=min(lamp.energy/1.75,1.0) + radius = lamp.dist + self.file.write("\n\n" % (round(location[0],3), round(location[1],3), round(location[2],3))) - dx,dy,dz=self.computeDirection(ob) - # note -dx seems to equal om[3][0] - # note -dz seems to equal om[3][1] - # note dy seems to equal om[3][2] + def writeNode(self, ob): + obname=str(ob.name) + if obname in self.namesStandard: + return + else: + dx,dy,dz = self.computeDirection(ob) + location=(ob.matrixWorld*MATWORLD).translationPart() + self.writeIndented("<%s\n" % obname,1) + self.writeIndented("# direction %s %s %s\n" % (round(dx,3),round(dy,3),round(dz,3))) + self.writeIndented("# location %s %s %s\n" % (round(location[0],3), round(location[1],3), round(location[2],3))) + self.writeIndented("/>\n",-1) + self.writeIndented("\n") - location=ob.getLocation('worldspace') - radius = lamp.dist*math.cos(beamWidth) - self.file.write("\n\n" % (round(location[0],3), round(location[1],3), round(location[2],3))) - - def writeDirectionalLight(self, ob, lamp): - safeName = self.cleanStr(ob.name) - if world: - ambi = world.amb - ambientIntensity = ((float(ambi[0] + ambi[1] + ambi[2]))/3)/2.5 - else: - ambi = 0 - ambientIntensity = 0 + def secureName(self, name): + name = name + str(self.nodeID) + self.nodeID=self.nodeID+1 + if len(name) <= 3: + newname = "_" + str(self.nodeID) + return "%s" % (newname) + else: + for bad in ['"','#',"'",',','.','[','\\',']','{','}']: + name=name.replace(bad,'_') + if name in self.namesReserved: + newname = name[0:3] + "_" + str(self.nodeID) + return "%s" % (newname) + elif name[0].isdigit(): + newname = "_" + name + str(self.nodeID) + return "%s" % (newname) + else: + newname = name + return "%s" % (newname) - intensity=min(lamp.energy/1.75,1.0) - (dx,dy,dz)=self.computeDirection(ob) - self.file.write("\n\n" % (round(dx,4),round(dy,4),round(dz,4))) + def writeIndexedFaceSet(self, ob, world, normals = 0): + imageMap={} # set of used images + sided={} # 'one':cnt , 'two':cnt + vColors={} # 'multi':1 + meshName = self.cleanStr(ob.name) + mesh=ob.getData(mesh=1) + meshME = self.cleanStr(mesh.name) + if len(mesh.faces) == 0: return + mode = 0 + if mesh.faceUV: + for face in mesh.faces: + mode |= face.mode + + if mode & Mesh.FaceModes.HALO and self.halonode == 0: + self.writeIndented("\n",1) + self.halonode = 1 + elif mode & Mesh.FaceModes.BILLBOARD and self.billnode == 0: + self.writeIndented("\n",1) + self.billnode = 1 + elif mode & Mesh.FaceModes.OBCOL and self.matonly == 0: + self.matonly = 1 + elif mode & Mesh.FaceModes.TILES and self.tilenode == 0: + self.tilenode = 1 + elif not mode & Mesh.FaceModes.DYNAMIC and self.collnode == 0: + self.writeIndented("\n",1) + self.collnode = 1 - def writePointLight(self, ob, lamp): - safeName = self.cleanStr(ob.name) - if world: - ambi = world.amb - ambientIntensity = ((float(ambi[0] + ambi[1] + ambi[2]))/3)/2.5 - else: - ambi = 0 - ambientIntensity = 0 - - location=ob.getLocation('worldspace') - intensity=min(lamp.energy/1.75,1.0) - radius = lamp.dist - self.file.write("\n\n" % (round(location[0],3), round(location[1],3), round(location[2],3))) + nIFSCnt=self.countIFSSetsNeeded(mesh, imageMap, sided, vColors) + + if nIFSCnt > 1: + self.writeIndented("\n" % ("G_", meshName),1) + + if sided.has_key('two') and sided['two'] > 0: + bTwoSided=1 + else: + bTwoSided=0 - def writeNode(self, thisObj): - obname=str(thisObj.getName()) - if obname in self.namesStandard: - return - else: - dx,dy,dz = self.computeDirection(thisObj) - location = thisObj.getLocation('worldspace') - self.writeIndented("<%s\n" % obname,1) - self.writeIndented("# direction %s %s %s\n" % (round(dx,3),round(dy,3),round(dz,3))) - self.writeIndented("# location %s %s %s\n" % (round(location[0],3), round(location[1],3), round(location[2],3))) - self.writeIndented("/>\n",-1) - self.writeIndented("\n") + mtx = ob.matrixWorld * MATWORLD + + loc= mtx.translationPart() + sca= mtx.scalePart() + quat = mtx.toQuat() + rot= quat.axis - def secureName(self, name): - name = name + str(self.nodeID) - self.nodeID=self.nodeID+1 - if len(name) <= 3: - newname = "_" + str(self.nodeID) - return "%s" % (newname) - else: - for bad in ['"','#',"'",',','.','[','\\',']','{','}']: - name=name.replace(bad,'_') - if name in self.namesReserved: - newname = name[0:3] + "_" + str(self.nodeID) - return "%s" % (newname) - elif name[0].isdigit(): - newname = "_" + name + str(self.nodeID) - return "%s" % (newname) - else: - newname = name - return "%s" % (newname) + # self.writeIndented('\n' % (rot[0], rot[1], rot[2], rot[3])) + self.writeIndented('\n' % \ + (meshName, loc[0], loc[1], loc[2], sca[0], sca[1], sca[2], rot[0], rot[1], rot[2], quat.angle*DEG2RAD) ) - def writeIndexedFaceSet(self, ob, normals = 0): - imageMap={} # set of used images - sided={} # 'one':cnt , 'two':cnt - vColors={} # 'multi':1 - meshName = self.cleanStr(ob.name) - mesh=ob.data - meshME = self.cleanStr(mesh.name) - if len(mesh.faces) == 0: return - for face in mesh.faces: - if face.mode & Blender.NMesh.FaceModes['HALO'] and self.halonode == 0: - self.writeIndented("\n",1) - self.halonode = 1 - elif face.mode & Blender.NMesh.FaceModes['BILLBOARD'] and self.billnode == 0: - self.writeIndented("\n",1) - self.billnode = 1 - elif face.mode & Blender.NMesh.FaceModes['OBCOL'] and self.matonly == 0: - self.matonly = 1 - elif face.mode & Blender.NMesh.FaceModes['SHAREDCOL'] and self.share == 0: - self.share = 1 - elif face.mode & Blender.NMesh.FaceModes['TILES'] and self.tilenode == 0: - self.tilenode = 1 - elif not face.mode & Blender.NMesh.FaceModes['DYNAMIC'] and self.collnode == 0: - self.writeIndented("\n",1) - self.collnode = 1 + self.writeIndented("\n",1) + maters=mesh.materials + hasImageTexture=0 + issmooth=0 - nIFSCnt=self.countIFSSetsNeeded(mesh, imageMap, sided, vColors) - - if nIFSCnt > 1: - self.writeIndented("\n" % ("G_", meshName),1) - - if sided.has_key('two') and sided['two'] > 0: - bTwoSided=1 - else: - bTwoSided=0 - - location= ob.getLocation('worldspace') - self.writeIndented("\n" % (meshName, round(location[0],3), round(location[1],3), round(location[2],3)),1) - self.writeIndented("\n",1) - - maters=mesh.materials - hasImageTexture=0 - issmooth=0 + if len(maters) > 0 or mesh.faceUV: + self.writeIndented("\n", 1) + # right now this script can only handle a single material per mesh. + if len(maters) >= 1: + mat=maters[0] + matFlags = mat.getMode() + if not matFlags & Blender.Material.Modes['TEXFACE']: + self.writeMaterial(mat, self.cleanStr(maters[0].name,''), world) + if len(maters) > 1: + print "Warning: mesh named %s has multiple materials" % meshName + print "Warning: only one material per object handled" + + #-- textures + if mesh.faceUV: + for face in mesh.faces: + if (hasImageTexture == 0) and (face.image): + self.writeImageTexture(face.image) + hasImageTexture=1 # keep track of face texture + if self.tilenode == 1: + self.writeIndented("\n" % (face.image.xrep, face.image.yrep)) + self.tilenode = 0 + self.writeIndented("\n", -1) - if len(maters) > 0 or mesh.hasFaceUV(): - self.writeIndented("\n", 1) - # right now this script can only handle a single material per mesh. - if len(maters) >= 1: - mat=maters[0] - matFlags = mat.getMode() - if not matFlags & Blender.Material.Modes['TEXFACE']: - self.writeMaterial(mat, self.cleanStr(maters[0].name,'')) - if len(maters) > 1: - print "Warning: mesh named %s has multiple materials" % meshName - print "Warning: only one material per object handled" - - #-- textures - if mesh.hasFaceUV(): - for face in mesh.faces: - if (hasImageTexture == 0) and (face.image): - self.writeImageTexture(face.image) - hasImageTexture=1 # keep track of face texture - if self.tilenode == 1: - self.writeIndented("\n" % (face.image.xrep, face.image.yrep)) - self.tilenode = 0 - self.writeIndented("\n", -1) + #-- IndexedFaceSet or IndexedLineSet - #-- IndexedFaceSet or IndexedLineSet + # user selected BOUNDS=1, SOLID=3, SHARED=4, or TEXTURE=5 + ifStyle="IndexedFaceSet" + # look up mesh name, use it if available + if self.meshNames.has_key(meshME): + self.writeIndented("<%s USE=\"ME_%s\">" % (ifStyle, meshME), 1) + self.meshNames[meshME]+=1 + else: + if int(mesh.users) > 1: + self.writeIndented("<%s DEF=\"ME_%s\" " % (ifStyle, meshME), 1) + self.meshNames[meshME]=1 + else: + self.writeIndented("<%s " % ifStyle, 1) + + if bTwoSided == 1: + self.file.write("solid=\"false\" ") + else: + self.file.write("solid=\"true\" ") - # check if object is wireframe only - if ob.drawType == Blender.Object.DrawTypes.WIRE: - # user selected WIRE=2 on the Drawtype=Wire on (F9) Edit page - ifStyle="IndexedLineSet" - self.wire = 1 - else: - # user selected BOUNDS=1, SOLID=3, SHARED=4, or TEXTURE=5 - ifStyle="IndexedFaceSet" - # look up mesh name, use it if available - if self.meshNames.has_key(meshME): - self.writeIndented("<%s USE=\"ME_%s\">" % (ifStyle, meshME), 1) - self.meshNames[meshME]+=1 - else: - if int(mesh.users) > 1: - self.writeIndented("<%s DEF=\"ME_%s\" " % (ifStyle, meshME), 1) - self.meshNames[meshME]=1 - else: - self.writeIndented("<%s " % ifStyle, 1) - if ob.drawType != Blender.Object.DrawTypes.WIRE: - if bTwoSided == 1: - self.file.write("solid=\"false\" ") - else: - self.file.write("solid=\"true\" ") + for face in mesh.faces: + if face.smooth: + issmooth=1 + break + if issmooth==1: + creaseAngle=(mesh.degr)*(math.pi/180.0) + self.file.write("creaseAngle=\"%s\" " % (round(creaseAngle,self.cp))) - for face in mesh.faces: - if face.smooth: - issmooth=1 - break - if issmooth==1 and self.wire == 0: - creaseAngle=(mesh.getMaxSmoothAngle())*(math.pi/180.0) - self.file.write("creaseAngle=\"%s\" " % (round(creaseAngle,self.cp))) + #--- output textureCoordinates if UV texture used + if mesh.faceUV: + if self.matonly == 1 and self.share == 1: + self.writeFaceColors(mesh) + elif hasImageTexture == 1: + self.writeTextureCoordinates(mesh) + #--- output coordinates + self.writeCoordinates(ob, mesh, meshName) - #--- output vertexColors - if self.share == 1 and self.matonly == 0: - self.writeVertexColors(mesh) - if ob.drawType != Blender.Object.DrawTypes.WIRE: - #--- output textureCoordinates if UV texture used - if mesh.hasFaceUV(): - if self.matonly == 1 and self.share == 1: - self.writeFaceColors(mesh) - elif hasImageTexture == 1: - self.writeTextureCoordinates(mesh) - #--- output coordinates - self.writeCoordinates(ob, mesh, meshName) + self.writingcoords = 1 + self.writingtexture = 1 + self.writingcolor = 1 + self.writeCoordinates(ob, mesh, meshName) + + #--- output textureCoordinates if UV texture used + if mesh.faceUV: + if hasImageTexture == 1: + self.writeTextureCoordinates(mesh) + elif self.matonly == 1 and self.share == 1: + self.writeFaceColors(mesh) + #--- output vertexColors + self.matonly = 0 + self.share = 0 + + self.writingcoords = 0 + self.writingtexture = 0 + self.writingcolor = 0 + #--- output closing braces + self.writeIndented("\n" % ifStyle, -1) + self.writeIndented("\n", -1) + self.writeIndented("\n", -1) - self.writingcoords = 1 - self.writingtexture = 1 - self.writingcolor = 1 - self.writeCoordinates(ob, mesh, meshName) - - if ob.drawType != Blender.Object.DrawTypes.WIRE: - #--- output textureCoordinates if UV texture used - if mesh.hasFaceUV(): - if hasImageTexture == 1: - self.writeTextureCoordinates(mesh) - elif self.matonly == 1 and self.share == 1: - self.writeFaceColors(mesh) - #--- output vertexColors - if self.share == 1 and self.matonly == 0: - self.writeVertexColors(mesh) - self.matonly = 0 - self.share = 0 - self.wire = 0 - self.writingcoords = 0 - self.writingtexture = 0 - self.writingcolor = 0 - #--- output closing braces - self.writeIndented("\n" % ifStyle, -1) - self.writeIndented("\n", -1) - self.writeIndented("\n", -1) + if self.halonode == 1: + self.writeIndented("\n", -1) + self.halonode = 0 - if self.halonode == 1: - self.writeIndented("\n", -1) - self.halonode = 0 + if self.billnode == 1: + self.writeIndented("\n", -1) + self.billnode = 0 - if self.billnode == 1: - self.writeIndented("\n", -1) - self.billnode = 0 + if self.collnode == 1: + self.writeIndented("\n", -1) + self.collnode = 0 - if self.collnode == 1: - self.writeIndented("\n", -1) - self.collnode = 0 + if nIFSCnt > 1: + self.writeIndented("\n", -1) - if nIFSCnt > 1: - self.writeIndented("\n", -1) + self.file.write("\n") - self.file.write("\n") + def writeCoordinates(self, ob, mesh, meshName): + # create vertex list and pre rotate -90 degrees X for VRML + + if self.writingcoords == 0: + self.file.write('coordIndex="') + for face in mesh.faces: + fv = face.v + if len(face)==4: + self.file.write("%i %i %i %i -1, " % (fv[0].index, fv[1].index, fv[2].index, fv[3].index)) + else: + self.file.write("%i %i %i -1, " % (fv[0].index, fv[1].index, fv[2].index)) + self.file.write("\">\n") + else: + #-- vertices + # mesh.transform(ob.matrixWorld) + self.writeIndented("") + self.writeIndented("\n", -1) - def writeCoordinates(self, ob, mesh, meshName): - meshVertexList = mesh.verts + def writeTextureCoordinates(self, mesh): + texCoordList=[] + texIndexList=[] + j=0 - # create vertex list and pre rotate -90 degrees X for VRML - location= ob.getLocation('worldspace') - if self.writingcoords == 0: - self.file.write('coordIndex="') - for face in mesh.faces: - for i in xrange(len(face)): - indx=face[i].index - self.file.write("%s " % indx) - self.file.write("-1, ") - self.file.write("\">\n") - else: - #-- vertices - mesh.transform(ob.matrixWorld) - self.writeIndented("") - self.writeIndented("\n", -1) + for face in mesh.faces: + for uv in face.uv: + texIndexList.append(j) + texCoordList.append(uv) + j=j+1 + texIndexList.append(-1) + if self.writingtexture == 0: + self.file.write("\n\t\t\ttexCoordIndex=\"") + texIndxStr="" + for i in xrange(len(texIndexList)): + texIndxStr = texIndxStr + "%d, " % texIndexList[i] + if texIndexList[i]==-1: + self.file.write(texIndxStr) + texIndxStr="" + self.file.write("\"\n\t\t\t") + else: + self.writeIndented("") + self.writeIndented("\n", -1) - def writeTextureCoordinates(self, mesh): - texCoordList=[] - texIndexList=[] - j=0 + def writeFaceColors(self, mesh): + if self.writingcolor == 0: + self.file.write("colorPerVertex=\"false\" ") + else: + self.writeIndented(" 2: + print "Debug: face.col r=%d g=%d b=%d" % (c.r, c.g, c.b) + aColor = self.rgbToFS(c) + self.file.write("%s, " % aColor) + self.file.write("\" />") + self.writeIndented("\n",-1) + + def writeMaterial(self, mat, matName, world): + # look up material name, use it if available + if self.matNames.has_key(matName): + self.writeIndented("\n" % matName) + self.matNames[matName]+=1 + return; - for face in mesh.faces: - for i in xrange(len(face)): - texIndexList.append(j) - texCoordList.append(face.uv[i]) - j=j+1 - texIndexList.append(-1) - if self.writingtexture == 0: - self.file.write("\n\t\t\ttexCoordIndex=\"") - texIndxStr="" - for i in xrange(len(texIndexList)): - texIndxStr = texIndxStr + "%d, " % texIndexList[i] - if texIndexList[i]==-1: - self.file.write(texIndxStr) - texIndxStr="" - self.file.write("\"\n\t\t\t") - else: - self.writeIndented("") - self.writeIndented("\n", -1) + self.matNames[matName]=1 - def writeFaceColors(self, mesh): - if self.writingcolor == 0: - self.file.write("colorPerVertex=\"false\" ") - else: - self.writeIndented(" 2: - print "Debug: face.col r=%d g=%d b=%d" % (c.r, c.g, c.b) - aColor = self.rgbToFS(c) - self.file.write("%s, " % aColor) - self.file.write("\" />") - self.writeIndented("\n",-1) + ambient = mat.amb/3 + diffuseR, diffuseG, diffuseB = mat.rgbCol[0], mat.rgbCol[1],mat.rgbCol[2] + if world: + ambi = world.getAmb() + ambi0, ambi1, ambi2 = (ambi[0]*mat.amb)*2, (ambi[1]*mat.amb)*2, (ambi[2]*mat.amb)*2 + else: + ambi0, ambi1, ambi2 = 0, 0, 0 + emisR, emisG, emisB = (diffuseR*mat.emit+ambi0)/2, (diffuseG*mat.emit+ambi1)/2, (diffuseB*mat.emit+ambi2)/2 - def writeVertexColors(self, mesh): - if self.writingcolor == 0: - self.file.write("colorPerVertex=\"false\" ") - else: - self.writeIndented(" 2: - print "Debug: vertex[%d].col r=%d g=%d b=%d" % (i, c.r, c.g, c.b) + shininess = mat.hard/512.0 + specR = (mat.specCol[0]+0.001)/(1.25/(mat.spec+0.001)) + specG = (mat.specCol[1]+0.001)/(1.25/(mat.spec+0.001)) + specB = (mat.specCol[2]+0.001)/(1.25/(mat.spec+0.001)) + transp = 1-mat.alpha + matFlags = mat.getMode() + if matFlags & Blender.Material.Modes['SHADELESS']: + ambient = 1 + shine = 1 + specR = emitR = diffuseR + specG = emitG = diffuseG + specB = emitB = diffuseB + self.writeIndented("" % (round(transp,self.cp))) + self.writeIndented("\n",-1) - aColor = self.rgbToFS(c) - self.file.write("%s, " % aColor) - self.file.write("\" />") - self.writeIndented("\n",-1) + def writeImageTexture(self, image): + name = image.name + filename = image.filename.split('/')[-1].split('\\')[-1] + if self.texNames.has_key(name): + self.writeIndented("\n" % self.cleanStr(name)) + self.texNames[name] += 1 + return + else: + self.writeIndented("" % name) + self.writeIndented("\n",-1) + self.texNames[name] = 1 - def writeMaterial(self, mat, matName): - # look up material name, use it if available - if self.matNames.has_key(matName): - self.writeIndented("\n" % matName) - self.matNames[matName]+=1 - return; - - self.matNames[matName]=1 - - ambient = mat.amb/3 - diffuseR, diffuseG, diffuseB = mat.rgbCol[0], mat.rgbCol[1],mat.rgbCol[2] - if world: - ambi = world.getAmb() - ambi0, ambi1, ambi2 = (ambi[0]*mat.amb)*2, (ambi[1]*mat.amb)*2, (ambi[2]*mat.amb)*2 - else: - ambi0, ambi1, ambi2 = 0, 0, 0 - emisR, emisG, emisB = (diffuseR*mat.emit+ambi0)/2, (diffuseG*mat.emit+ambi1)/2, (diffuseB*mat.emit+ambi2)/2 - - shininess = mat.hard/512.0 - specR = (mat.specCol[0]+0.001)/(1.25/(mat.getSpec()+0.001)) - specG = (mat.specCol[1]+0.001)/(1.25/(mat.getSpec()+0.001)) - specB = (mat.specCol[2]+0.001)/(1.25/(mat.getSpec()+0.001)) - transp = 1-mat.alpha - matFlags = mat.getMode() - if matFlags & Blender.Material.Modes['SHADELESS']: - ambient = 1 - shine = 1 - specR = emitR = diffuseR - specG = emitG = diffuseG - specB = emitB = diffuseB - self.writeIndented("" % (round(transp,self.cp))) - self.writeIndented("\n",-1) - - def writeImageTexture(self, image): - name = image.name - filename = image.filename.split('/')[-1].split('\\')[-1] - if self.texNames.has_key(name): - self.writeIndented("\n" % self.cleanStr(name)) - self.texNames[name] += 1 - return - else: - self.writeIndented("" % name) - self.writeIndented("\n",-1) - self.texNames[name] = 1 - - def writeBackground(self): - if world: worldname = world.name - else: return - blending = world.getSkytype() - grd = world.getHor() - grd0, grd1, grd2 = grd[0], grd[1], grd[2] - sky = world.getZen() - sky0, sky1, sky2 = sky[0], sky[1], sky[2] - mix0, mix1, mix2 = grd[0]+sky[0], grd[1]+sky[1], grd[2]+sky[2] - mix0, mix1, mix2 = mix0/2, mix1/2, mix2/2 - self.file.write("\n\n") + def writeBackground(self, world, alltextures): + if world: worldname = world.name + else: return + blending = world.getSkytype() + grd = world.getHor() + grd0, grd1, grd2 = grd[0], grd[1], grd[2] + sky = world.getZen() + sky0, sky1, sky2 = sky[0], sky[1], sky[2] + mix0, mix1, mix2 = grd[0]+sky[0], grd[1]+sky[1], grd[2]+sky[2] + mix0, mix1, mix2 = mix0/2, mix1/2, mix2/2 + self.file.write("\n\n") ########################################################## # export routine ########################################################## - def export(self, scene, world, worldmat): - print "Info: starting X3D export to " + self.filename + "..." - self.writeHeader() - self.writeScript() - self.writeNavigationInfo(scene) - self.writeBackground() - self.writeFog() - self.proto = 0 - allObj = [] - if ARG == 'selected': - allObj = list(scene.objects.context) - else: - allObj = list(scene.objects) - self.writeInline() - for thisObj in allObj: - try: - objType=thisObj.type - objName=thisObj.name - self.matonly = 0 - if objType == "Camera": - self.writeViewpoint(thisObj) - elif objType == "Mesh": - self.writeIndexedFaceSet(thisObj, normals = 0) - elif objType == "Lamp": - lmpName= thisObj.data - lmpType=lmpName.getType() - if lmpType == Lamp.Types.Lamp: - self.writePointLight(thisObj, lmpName) - elif lmpType == Lamp.Types.Spot: - self.writeSpotLight(thisObj, lmpName) - elif lmpType == Lamp.Types.Sun: - self.writeDirectionalLight(thisObj, lmpName) - else: - self.writeDirectionalLight(thisObj, lmpName) - elif objType == "Empty" and objName != "Empty": - self.writeNode(thisObj) - else: - #print "Info: Ignoring [%s], object type [%s] not handle yet" % (object.name,object.getType()) - print "" - except AttributeError: - print "Error: Unable to get type info for %s" % thisObj.getName() - if ARG != 'selected': - self.writeScript() - self.file.write("\n\n") - self.cleanup() - + def export(self, scene, world, alltextures): + print "Info: starting X3D export to " + self.filename + "..." + self.writeHeader() + self.writeScript() + # self.writeNavigationInfo(scene) # This seems to position me in some strange area I cant see the model (with BS Contact) - Campbell + self.writeBackground(world, alltextures) + self.writeFog(world) + self.proto = 0 + + for ob in scene.objects.context: + objType=ob.type + objName=ob.name + self.matonly = 0 + if objType == "Camera": + self.writeViewpoint(ob, scene) + elif objType == "Mesh": + self.writeIndexedFaceSet(ob, world, normals = 0) + elif objType == "Lamp": + data= ob.data + datatype=data.type + if datatype == Lamp.Types.Lamp: + self.writePointLight(ob, data, world) + elif datatype == Lamp.Types.Spot: + self.writeSpotLight(ob, data, world) + elif datatype == Lamp.Types.Sun: + self.writeDirectionalLight(ob, data, world) + else: + self.writeDirectionalLight(ob, data, world) + elif objType == "Empty" and objName != "Empty": + self.writeNode(ob) + else: + #print "Info: Ignoring [%s], object type [%s] not handle yet" % (object.name,object.getType) + print "" + + if ARG != 'selected': + self.writeScript() + self.file.write("\n\n") + self.cleanup() + ########################################################## # Utility methods ########################################################## - def cleanup(self): - self.file.close() - self.texNames={} - self.matNames={} - self.indentLevel=0 - print "Info: finished X3D export to %s\n" % self.filename + def cleanup(self): + self.file.close() + self.texNames={} + self.matNames={} + self.indentLevel=0 + print "Info: finished X3D export to %s\n" % self.filename - def cleanStr(self, name, prefix='rsvd_'): - """cleanStr(name,prefix) - try to create a valid VRML DEF name from object name""" + def cleanStr(self, name, prefix='rsvd_'): + """cleanStr(name,prefix) - try to create a valid VRML DEF name from object name""" - newName=name[:] - if len(newName) == 0: - self.nNodeID+=1 - return "%s%d" % (prefix, self.nNodeID) - - if newName in self.namesReserved: - newName='%s%s' % (prefix,newName) - - if newName[0].isdigit(): - newName='%s%s' % ('_',newName) + newName=name[:] + if len(newName) == 0: + self.nNodeID+=1 + return "%s%d" % (prefix, self.nNodeID) + + if newName in self.namesReserved: + newName='%s%s' % (prefix,newName) + + if newName[0].isdigit(): + newName='%s%s' % ('_',newName) - for bad in [' ','"','#',"'",',','.','[','\\',']','{','}']: - newName=newName.replace(bad,'_') - return newName + for bad in [' ','"','#',"'",',','.','[','\\',']','{','}']: + newName=newName.replace(bad,'_') + return newName - def countIFSSetsNeeded(self, mesh, imageMap, sided, vColors): - """ - countIFFSetsNeeded() - should look at a blender mesh to determine - how many VRML IndexFaceSets or IndexLineSets are needed. A - new mesh created under the following conditions: - - o - split by UV Textures / one per mesh - o - split by face, one sided and two sided - o - split by smooth and flat faces - o - split when faces only have 2 vertices * needs to be an IndexLineSet - """ - - imageNameMap={} - faceMap={} - nFaceIndx=0 - - for face in mesh.faces: - sidename=''; - if (face.mode & NMesh.FaceModes.TWOSIDE) == NMesh.FaceModes.TWOSIDE: - sidename='two' - else: - sidename='one' - - if sided.has_key(sidename): - sided[sidename]+=1 - else: - sided[sidename]=1 + def countIFSSetsNeeded(self, mesh, imageMap, sided, vColors): + """ + countIFFSetsNeeded() - should look at a blender mesh to determine + how many VRML IndexFaceSets or IndexLineSets are needed. A + new mesh created under the following conditions: + + o - split by UV Textures / one per mesh + o - split by face, one sided and two sided + o - split by smooth and flat faces + o - split when faces only have 2 vertices * needs to be an IndexLineSet + """ + + imageNameMap={} + faceMap={} + nFaceIndx=0 + + if mesh.faceUV: + for face in mesh.faces: + sidename=''; + if face.mode & Mesh.FaceModes.TWOSIDE: + sidename='two' + else: + sidename='one' + + if sided.has_key(sidename): + sided[sidename]+=1 + else: + sided[sidename]=1 + + image = face.image + if image: + faceName="%s_%s" % (face.image.name, sidename); + try: + imageMap[faceName].append(face) + except: + imageMap[faceName]=[face.image.name,sidename,face] - if face.image: - faceName="%s_%s" % (face.image.name, sidename); + if self.verbose > 2: + for faceName in imageMap.iterkeys(): + ifs=imageMap[faceName] + print "Debug: faceName=%s image=%s, solid=%s facecnt=%d" % \ + (faceName, ifs[0], ifs[1], len(ifs)-2) - try: - imageMap[faceName].append(face) - except: - imageMap[faceName]=[face.image.name,sidename,face] + return len(imageMap) + + def faceToString(self,face): - if self.verbose > 2: - for faceName in imageMap.iterkeys(): - ifs=imageMap[faceName] - print "Debug: faceName=%s image=%s, solid=%s facecnt=%d" % \ - (faceName, ifs[0], ifs[1], len(ifs)-2) + print "Debug: face.flag=0x%x (bitflags)" % face.flag + if face.sel: + print "Debug: face.sel=true" - return len(imageMap) - - def faceToString(self,face): + print "Debug: face.mode=0x%x (bitflags)" % face.mode + if face.mode & Mesh.FaceModes.TWOSIDE: + print "Debug: face.mode twosided" - print "Debug: face.flag=0x%x (bitflags)" % face.flag - if face.sel: - print "Debug: face.sel=true" + print "Debug: face.transp=0x%x (enum)" % face.transp + if face.transp == Mesh.FaceTranspModes.SOLID: + print "Debug: face.transp.SOLID" - print "Debug: face.mode=0x%x (bitflags)" % face.mode - if (face.mode & NMesh.FaceModes.TWOSIDE) == NMesh.FaceModes.TWOSIDE: - print "Debug: face.mode twosided" + if face.image: + print "Debug: face.image=%s" % face.image.name + print "Debug: face.materialIndex=%d" % face.materialIndex - print "Debug: face.transp=0x%x (enum)" % face.transp - if face.transp == NMesh.FaceTranspModes.SOLID: - print "Debug: face.transp.SOLID" + def getVertexColorByIndx(self, mesh, indx): + c = None + for face in mesh.faces: + j=0 + for vertex in face.v: + if vertex.index == indx: + c=face.col[j] + break + j=j+1 + if c: break + return c - if face.image: - print "Debug: face.image=%s" % face.image.name - print "Debug: face.materialIndex=%d" % face.materialIndex + def meshToString(self,mesh): + print "Debug: mesh.hasVertexUV=%d" % mesh.vertexColors + print "Debug: mesh.faceUV=%d" % mesh.faceUV + print "Debug: mesh.hasVertexColours=%d" % mesh.hasVertexColours() + print "Debug: mesh.verts=%d" % len(mesh.verts) + print "Debug: mesh.faces=%d" % len(mesh.faces) + print "Debug: mesh.materials=%d" % len(mesh.materials) - def getVertexColorByIndx(self, mesh, indx): - c = None - for face in mesh.faces: - j=0 - for vertex in face.v: - if vertex.index == indx: - c=face.col[j] - break - j=j+1 - if c: break - return c + def rgbToFS(self, c): + s="%s %s %s" % ( + round(c.r/255.0,self.cp), + round(c.g/255.0,self.cp), + round(c.b/255.0,self.cp)) + return s - def meshToString(self,mesh): - print "Debug: mesh.hasVertexUV=%d" % mesh.hasVertexUV() - print "Debug: mesh.hasFaceUV=%d" % mesh.hasFaceUV() - print "Debug: mesh.hasVertexColours=%d" % mesh.hasVertexColours() - print "Debug: mesh.verts=%d" % len(mesh.verts) - print "Debug: mesh.faces=%d" % len(mesh.faces) - print "Debug: mesh.materials=%d" % len(mesh.materials) + def computeDirection(self, ob): + x,y,z=(0,-1.0,0) # point down + + ax,ay,az = (ob.matrixWorld*MATWORLD).toEuler() + + ax *= DEG2RAD + ay *= DEG2RAD + az *= DEG2RAD + # rot X + x1=x + y1=y*math.cos(ax)-z*math.sin(ax) + z1=y*math.sin(ax)+z*math.cos(ax) - def rgbToFS(self, c): - s="%s %s %s" % ( - round(c.r/255.0,self.cp), - round(c.g/255.0,self.cp), - round(c.b/255.0,self.cp)) - return s + # rot Y + x2=x1*math.cos(ay)+z1*math.sin(ay) + y2=y1 + z2=z1*math.cos(ay)-x1*math.sin(ay) - def computeDirection(self, ob): - x,y,z=(0,-1.0,0) # point down - ax,ay,az = (ob.RotX,ob.RotZ,ob.RotY) + # rot Z + x3=x2*math.cos(az)-y2*math.sin(az) + y3=x2*math.sin(az)+y2*math.cos(az) + z3=z2 - # rot X - x1=x - y1=y*math.cos(ax)-z*math.sin(ax) - z1=y*math.sin(ax)+z*math.cos(ax) + return [x3,y3,z3] + - # rot Y - x2=x1*math.cos(ay)+z1*math.sin(ay) - y2=y1 - z2=z1*math.cos(ay)-x1*math.sin(ay) + # swap Y and Z to handle axis difference between Blender and VRML + #------------------------------------------------------------------------ + def rotatePointForVRML(self, v): + x = v[0] + y = v[2] + z = -v[1] + + vrmlPoint=[x, y, z] + return vrmlPoint - # rot Z - x3=x2*math.cos(az)-y2*math.sin(az) - y3=x2*math.sin(az)+y2*math.cos(az) - z3=z2 + # For writing well formed VRML code + #------------------------------------------------------------------------ + def writeIndented(self, s, inc=0): + if inc < 1: + self.indentLevel = self.indentLevel + inc - return [x3,y3,z3] - + spaces="" + for x in xrange(self.indentLevel): + spaces = spaces + "\t" + self.file.write(spaces + s) - # swap Y and Z to handle axis difference between Blender and VRML - #------------------------------------------------------------------------ - def rotatePointForVRML(self, v): - x = v[0] - y = v[2] - z = -v[1] - - vrmlPoint=[x, y, z] - return vrmlPoint + if inc > 0: + self.indentLevel = self.indentLevel + inc - # For writing well formed VRML code - #------------------------------------------------------------------------ - def writeIndented(self, s, inc=0): - if inc < 1: - self.indentLevel = self.indentLevel + inc + # Converts a Euler to three new Quaternions + # Angles of Euler are passed in as radians + #------------------------------------------------------------------------ + def eulerToQuaternions(self, x, y, z): + Qx = [math.cos(x/2), math.sin(x/2), 0, 0] + Qy = [math.cos(y/2), 0, math.sin(y/2), 0] + Qz = [math.cos(z/2), 0, 0, math.sin(z/2)] + + quaternionVec=[Qx,Qy,Qz] + return quaternionVec + + # Multiply two Quaternions together to get a new Quaternion + #------------------------------------------------------------------------ + def multiplyQuaternions(self, Q1, Q2): + result = [((Q1[0] * Q2[0]) - (Q1[1] * Q2[1]) - (Q1[2] * Q2[2]) - (Q1[3] * Q2[3])), + ((Q1[0] * Q2[1]) + (Q1[1] * Q2[0]) + (Q1[2] * Q2[3]) - (Q1[3] * Q2[2])), + ((Q1[0] * Q2[2]) + (Q1[2] * Q2[0]) + (Q1[3] * Q2[1]) - (Q1[1] * Q2[3])), + ((Q1[0] * Q2[3]) + (Q1[3] * Q2[0]) + (Q1[1] * Q2[2]) - (Q1[2] * Q2[1]))] + + return result + + # Convert a Quaternion to an Angle Axis (ax, ay, az, angle) + # angle is in radians + #------------------------------------------------------------------------ + def quaternionToAngleAxis(self, Qf): + scale = math.pow(Qf[1],2) + math.pow(Qf[2],2) + math.pow(Qf[3],2) + ax = Qf[1] + ay = Qf[2] + az = Qf[3] - spaces="" - for x in xrange(self.indentLevel): - spaces = spaces + "\t" - self.file.write(spaces + s) - - if inc > 0: - self.indentLevel = self.indentLevel + inc - - # Converts a Euler to three new Quaternions - # Angles of Euler are passed in as radians - #------------------------------------------------------------------------ - def eulerToQuaternions(self, x, y, z): - Qx = [math.cos(x/2), math.sin(x/2), 0, 0] - Qy = [math.cos(y/2), 0, math.sin(y/2), 0] - Qz = [math.cos(z/2), 0, 0, math.sin(z/2)] - - quaternionVec=[Qx,Qy,Qz] - return quaternionVec - - # Multiply two Quaternions together to get a new Quaternion - #------------------------------------------------------------------------ - def multiplyQuaternions(self, Q1, Q2): - result = [((Q1[0] * Q2[0]) - (Q1[1] * Q2[1]) - (Q1[2] * Q2[2]) - (Q1[3] * Q2[3])), - ((Q1[0] * Q2[1]) + (Q1[1] * Q2[0]) + (Q1[2] * Q2[3]) - (Q1[3] * Q2[2])), - ((Q1[0] * Q2[2]) + (Q1[2] * Q2[0]) + (Q1[3] * Q2[1]) - (Q1[1] * Q2[3])), - ((Q1[0] * Q2[3]) + (Q1[3] * Q2[0]) + (Q1[1] * Q2[2]) - (Q1[2] * Q2[1]))] - - return result - - # Convert a Quaternion to an Angle Axis (ax, ay, az, angle) - # angle is in radians - #------------------------------------------------------------------------ - def quaternionToAngleAxis(self, Qf): - scale = math.pow(Qf[1],2) + math.pow(Qf[2],2) + math.pow(Qf[3],2) - ax = Qf[1] - ay = Qf[2] - az = Qf[3] - - if scale > .0001: - ax/=scale - ay/=scale - az/=scale - - angle = 2 * math.acos(Qf[0]) - - result = [ax, ay, az, angle] - return result + if scale > .0001: + ax/=scale + ay/=scale + az/=scale + + angle = 2 * math.acos(Qf[0]) + + result = [ax, ay, az, angle] + return result ########################################################## # Callbacks, needed before Main ########################################################## def select_file(filename): - if not filename.endswith(extension): - filename += extension - if _safeOverwrite and sys.exists(filename): - result = Draw.PupMenu("File Already Exists, Overwrite?%t|Yes%x1|No%x0") - if(result != 1): - return + if not filename.endswith(extension): + filename += extension + #if _safeOverwrite and sys.exists(filename): + # result = Draw.PupMenu("File Already Exists, Overwrite?%t|Yes%x1|No%x0") + #if(result != 1): + # return + + scene = Blender.Scene.GetCurrent() + world = scene.world + alltextures = Blender.Texture.Get() - wrlexport=VRML2Export(filename) - wrlexport.export(scene, world, worldmat) + wrlexport=VRML2Export(filename) + wrlexport.export(scene, world, alltextures) -def createWRLPath(): - filename = Blender.Get('filename') - print filename - - if filename.find('.') != -1: - filename = filename.split('.')[0] - filename += extension - print filename - - return filename ######################################################### # main routine ######################################################### -try: - ARG = __script__['arg'] # user selected argument -except: - print "older version" - -if Blender.Get('version') < 235: - print "Warning: X3D export failed, wrong blender version!" - print " You aren't running blender version 2.35 or greater" - print " download a newer version from http://blender3d.org/" -else: - if ARG == 'comp': - from gzip import * - extension=".x3dz" - else: - extension=".x3d" - Blender.Window.FileSelector(select_file,"Export X3D",createWRLPath()) - +if __name__ == '__main__': + Blender.Window.FileSelector(select_file,"Export X3D", Blender.Get('filename').replace('.blend', '.x3d')) + # select_file('/shared/bed1.x3d') diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 76581e4f34f..b3b68a9b3ff 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -33,7 +33,8 @@ #ifndef BKE_NODE_H #define BKE_NODE_H - +/* not very important, but the stack solver likes to know a maximum */ +#define MAX_SOCKET 64 struct ID; struct bNodeTree; diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index f31c5a0d672..654cf0991cc 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -3304,7 +3304,9 @@ void loadFluidsimMesh(Object *srcob, int useRenderParams) } else { // 3 strcat(targetDir,"fluidsurface_final_####"); } - BLI_convertstringcode(targetDir, G.sce, curFrame); // fixed #frame-no + BLI_convertstringcode(targetDir, G.sce); + BLI_convertstringframe(targetDir, curFrame); // fixed #frame-no + strcpy(targetFile,targetDir); strcat(targetFile, ".bobj.gz"); diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 88ae02cd418..f60e39769a2 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -1104,9 +1104,9 @@ static void vectomat (float *vec, float *target_up, short axis, short upflag, sh /* identity matrix - don't do anything if the two axes are the same */ else { m[0][0]= m[1][1]= m[2][2]= 1.0; - m[0][1]= m[0][2]= m[0][3]= 0.0; - m[1][0]= m[1][2]= m[1][3]= 0.0; - m[2][0]= m[2][1]= m[2][3]= 0.0; + m[0][1]= m[0][2]= 0.0; + m[1][0]= m[1][2]= 0.0; + m[2][0]= m[2][1]= 0.0; } } diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 8a982b15df7..ff0b2e6db0a 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -351,7 +351,8 @@ Image *BKE_add_image_file(const char *name) } BLI_strncpy(str, name, sizeof(str)); - BLI_convertstringcode(str, G.sce, G.scene->r.cfra); + BLI_convertstringcode(str, G.sce); + BLI_convertstringframe(str, G.scene->r.cfra); /* TODO - should this realy be here? */ /* exists? */ file= open(str, O_BINARY|O_RDONLY); @@ -362,7 +363,8 @@ Image *BKE_add_image_file(const char *name) for(ima= G.main->image.first; ima; ima= ima->id.next) { if(ima->source!=IMA_SRC_VIEWER && ima->source!=IMA_SRC_GENERATED) { BLI_strncpy(strtest, ima->name, sizeof(ima->name)); - BLI_convertstringcode(strtest, G.sce, G.scene->r.cfra); + BLI_convertstringcode(strtest, G.sce); + BLI_convertstringframe(strtest, G.scene->r.cfra); /* TODO - should this be here? */ if( strcmp(strtest, str)==0 ) { if(ima->anim==NULL || ima->id.us==0) { @@ -1243,7 +1245,8 @@ void BKE_makepicstring(char *string, char *base, int frame, int imtype) if (strchr(string, '#')==NULL) strcat(string, "####"); /* 4 numbers */ - BLI_convertstringcode(string, G.sce, frame); + BLI_convertstringcode(string, G.sce); + BLI_convertstringframe(string, frame); if(G.scene->r.scemode & R_EXTENSION) BKE_add_image_extension(string, imtype); @@ -1479,9 +1482,11 @@ static ImBuf *image_load_sequence_file(Image *ima, ImageUser *iuser, int frame) BLI_strncpy(name, ima->name, sizeof(name)); if(ima->id.lib) - BLI_convertstringcode(name, ima->id.lib->filename, frame); + BLI_convertstringcode(name, ima->id.lib->filename); else - BLI_convertstringcode(name, G.sce, frame); + BLI_convertstringcode(name, G.sce); + + BLI_convertstringframe(name, frame); /* TODO - should this be here? */ /* read ibuf */ ibuf = IMB_loadiffname(name, IB_rect|IB_multilayer); @@ -1582,9 +1587,9 @@ static ImBuf *image_load_movie_file(Image *ima, ImageUser *iuser, int frame) BLI_strncpy(str, ima->name, FILE_MAX); if(ima->id.lib) - BLI_convertstringcode(str, ima->id.lib->filename, 0); + BLI_convertstringcode(str, ima->id.lib->filename); else - BLI_convertstringcode(str, G.sce, 0); + BLI_convertstringcode(str, G.sce); ima->anim = openanim(str, IB_cmap | IB_rect); @@ -1636,9 +1641,11 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra) /* get the right string */ BLI_strncpy(str, ima->name, sizeof(str)); if(ima->id.lib) - BLI_convertstringcode(str, ima->id.lib->filename, cfra); + BLI_convertstringcode(str, ima->id.lib->filename); else - BLI_convertstringcode(str, G.sce, cfra); + BLI_convertstringcode(str, G.sce); + + BLI_convertstringframe(str, cfra); /* read ibuf */ ibuf = IMB_loadiffname(str, IB_rect|IB_multilayer|IB_imginfo); diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 8740a3d1ed4..cc3f3f211a4 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -974,7 +974,7 @@ static void image_fix_relative_path(Image *ima) { if(ima->id.lib==NULL) return; if(strncmp(ima->name, "//", 2)==0) { - BLI_convertstringcode(ima->name, ima->id.lib->filename, 0); + BLI_convertstringcode(ima->name, ima->id.lib->filename); BLI_makestringcode(G.sce, ima->name); } } diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index 14e70075e32..16916381c95 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -1214,8 +1214,8 @@ void converge (MB_POINT *p1, MB_POINT *p2, float v1, float v2, p->y = neg.y; p->z = neg.z; while (1) { - p->x = 0.5f*(pos.x + neg.x); if (i++ == RES) return; + p->x = 0.5f*(pos.x + neg.x); if ((function(p->x,p->y,p->z)) > 0.0) pos.x = p->x; else neg.x = p->x; } } @@ -1224,8 +1224,8 @@ void converge (MB_POINT *p1, MB_POINT *p2, float v1, float v2, p->x = neg.x; p->z = neg.z; while (1) { - p->y = 0.5f*(pos.y + neg.y); if (i++ == RES) return; + p->y = 0.5f*(pos.y + neg.y); if ((function(p->x,p->y,p->z)) > 0.0) pos.y = p->y; else neg.y = p->y; } } @@ -1234,8 +1234,8 @@ void converge (MB_POINT *p1, MB_POINT *p2, float v1, float v2, p->x = neg.x; p->y = neg.y; while (1) { - p->z = 0.5f*(pos.z + neg.z); if (i++ == RES) return; + p->z = 0.5f*(pos.z + neg.z); if ((function(p->x,p->y,p->z)) > 0.0) pos.z = p->z; else neg.z = p->z; } } @@ -1300,6 +1300,8 @@ void find_first_points(PROCESS *mbproc, MetaBall *mb, int a) int index[3]={1,0,-1}; float f =0.0f; float in_v, out_v; + MB_POINT workp; + float tmp_v, workp_v, max_len, len, dx, dy, dz, nx, ny, nz, MAXN; ml = mainb[a]; @@ -1360,23 +1362,49 @@ void find_first_points(PROCESS *mbproc, MetaBall *mb, int a) out_v = mbproc->function(out.x, out.y, out.z); - /* find "first point" on Implicit Surface of MetaElemnt ml */ - converge(&in, &out, in_v, out_v, mbproc->function, &mbproc->start, mb, 0); - - /* indexes of CUBE, which includes "first point" */ - c_i= (int)floor(mbproc->start.x/mbproc->size ); - c_j= (int)floor(mbproc->start.y/mbproc->size ); - c_k= (int)floor(mbproc->start.z/mbproc->size ); - - mbproc->start.x= mbproc->start.y= mbproc->start.z= 0.0; + /* find "first points" on Implicit Surface of MetaElemnt ml */ + //converge(&in, &out, in_v, out_v, mbproc->function, &mbproc->start, mb, 0); + workp = in; + workp_v = in_v; + max_len = sqrt((out.x-in.x)*(out.x-in.x) + (out.y-in.y)*(out.y-in.y) + (out.z-in.z)*(out.z-in.z)); - /* add CUBE (with indexes c_i, c_j, c_k) to the stack, - * this cube includes found point of Implicit Surface */ - if (ml->flag & MB_NEGATIVE) - add_cube(mbproc, c_i, c_j, c_k, 2); - else - add_cube(mbproc, c_i, c_j, c_k, 1); + nx = abs((out.x - in.x)/mbproc->size); + ny = abs((out.y - in.y)/mbproc->size); + nz = abs((out.z - in.z)/mbproc->size); + + MAXN = MAX3(nx,ny,nz); + + dx = (out.x - in.x)/MAXN; + dy = (out.y - in.y)/MAXN; + dz = (out.z - in.z)/MAXN; + + len = 0.0; + while(len<=max_len) { + workp.x += dx; + workp.y += dy; + workp.z += dz; + /* compute value of implicite function */ + tmp_v = mbproc->function(workp.x, workp.y, workp.z); + /* add cube to the stack, when value of implicite function crosses zero value */ + if((tmp_v<0.0 && workp_v>=0.0)||(tmp_v>0.0 && workp_v<=0.0)) { + + /* indexes of CUBE, which includes "first point" */ + c_i= (int)floor(workp.x/mbproc->size); + c_j= (int)floor(workp.y/mbproc->size); + c_k= (int)floor(workp.z/mbproc->size); + + /* add CUBE (with indexes c_i, c_j, c_k) to the stack, + * this cube includes found point of Implicit Surface */ + if (ml->flag & MB_NEGATIVE) + add_cube(mbproc, c_i, c_j, c_k, 2); + else + add_cube(mbproc, c_i, c_j, c_k, 1); + } + len = sqrt((workp.x-in.x)*(workp.x-in.x) + (workp.y-in.y)*(workp.y-in.y) + (workp.z-in.z)*(workp.z-in.z)); + workp_v = tmp_v; + } + mbproc->start.x= mbproc->start.y= mbproc->start.z= 0.0; } } diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 6c3775bcbaa..28c3e1c64e6 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -68,9 +68,6 @@ #include "SHD_node.h" -/* not very important, but the stack solver likes to know a maximum */ -#define MAX_SOCKET 64 - static ListBase empty_list = {NULL, NULL}; ListBase node_all_composit = {NULL, NULL}; ListBase node_all_shaders = {NULL, NULL}; diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index 109f8bd9113..f6a65bd72a5 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -185,7 +185,7 @@ PackedFile * newPackedFile(char * filename) // convert relative filenames to absolute filenames strcpy(name, filename); - BLI_convertstringcode(name, G.sce, G.scene->r.cfra); + BLI_convertstringcode(name, G.sce); // open the file // and create a PackedFile structure @@ -286,7 +286,7 @@ int writePackedFile(char * filename, PackedFile *pf, int guimode) if (guimode) waitcursor(1); strcpy(name, filename); - BLI_convertstringcode(name, G.sce, G.scene->r.cfra); + BLI_convertstringcode(name, G.sce); if (BLI_exists(name)) { for (number = 1; number <= 999; number++) { @@ -351,7 +351,7 @@ int checkPackedFile(char * filename, PackedFile * pf) char name[FILE_MAXDIR + FILE_MAXFILE]; strcpy(name, filename); - BLI_convertstringcode(name, G.sce, G.scene->r.cfra); + BLI_convertstringcode(name, G.sce); if (stat(name, &st)) { ret_val = PF_NOFILE; diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 069dac60412..9dd21cdda4e 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -4565,7 +4565,8 @@ static void particles_fluid_step(Object *ob, ParticleSystem *psys, int cfra) // ok, start loading strcpy(filename, ob->fluidsimSettings->surfdataPath); strcat(filename, suffix); - BLI_convertstringcode(filename, G.sce, curFrame); // fixed #frame-no + BLI_convertstringcode(filename, G.sce); + BLI_convertstringframe(filename, curFrame); // fixed #frame-no strcat(filename, suffix2); gzf = gzopen(filename, "rb"); diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 3d73ba1e93f..7b727528b3d 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -186,7 +186,7 @@ static int ptcache_path(PTCacheID *pid, char *filename) sprintf(filename, "//"PTCACHE_PATH"%s", file); /* add blend file name to pointcache dir */ BLI_add_slash(filename); - BLI_convertstringcode(filename, blendfilename, 0); + BLI_convertstringcode(filename, blendfilename); return strlen(filename); } diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 3b14cb8adac..2c5b49246fb 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -109,13 +109,13 @@ PackedFile* sound_find_packedfile(bSound *sound) // convert sound->name to abolute filename strcpy(soundname, sound->name); - BLI_convertstringcode(soundname, G.sce, G.scene->r.cfra); + BLI_convertstringcode(soundname, G.sce); search = G.main->sound.first; while (search) { if (search->sample && search->sample->packedfile) { strcpy(searchname, search->sample->name); - BLI_convertstringcode(searchname, G.sce, G.scene->r.cfra); + BLI_convertstringcode(searchname, G.sce); if (BLI_streq(searchname, soundname)) { pf = search->sample->packedfile; @@ -125,7 +125,7 @@ PackedFile* sound_find_packedfile(bSound *sound) if (search->newpackedfile) { strcpy(searchname, search->name); - BLI_convertstringcode(searchname, G.sce, G.scene->r.cfra); + BLI_convertstringcode(searchname, G.sce); if (BLI_streq(searchname, soundname)) { pf = search->newpackedfile; break; diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index b6552be93a9..872f81ead63 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -218,7 +218,7 @@ int reopen_text(Text *text) if (!text || !text->name) return 0; BLI_strncpy(str, text->name, FILE_MAXDIR+FILE_MAXFILE); - BLI_convertstringcode(str, G.sce, G.scene->r.cfra); + BLI_convertstringcode(str, G.sce); BLI_split_dirfile_basic(str, NULL, sfile); fp= fopen(str, "r"); @@ -316,7 +316,7 @@ Text *add_text(char *file) BLI_strncpy(str, file, FILE_MAXDIR+FILE_MAXFILE); if (G.scene) /* can be NULL (bg mode) */ - BLI_convertstringcode(str, G.sce, G.scene->r.cfra); + BLI_convertstringcode(str, G.sce); BLI_split_dirfile_basic(str, NULL, sfile); fp= fopen(str, "r"); @@ -2037,6 +2037,7 @@ void txt_delete_char (Text *text) if (txt_has_sel(text)) { /* deleting a selection */ txt_delete_sel(text); + return; } else if (text->curc== text->curl->len) { /* Appending two lines */ if (text->curl->next) { @@ -2071,6 +2072,7 @@ void txt_backspace_char (Text *text) if (txt_has_sel(text)) { /* deleting a selection */ txt_delete_sel(text); + return; } else if (text->curc==0) { /* Appending two lines */ if (text->curl->prev) { diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c index 3d85fe32193..44004eeee80 100644 --- a/source/blender/blenkernel/intern/writeavi.c +++ b/source/blender/blenkernel/intern/writeavi.c @@ -120,7 +120,7 @@ void makeavistring (RenderData *rd, char *string) if (string==0) return; strcpy(string, rd->pic); - BLI_convertstringcode(string, G.sce, rd->cfra); + BLI_convertstringcode(string, G.sce); BLI_make_existing_file(string); diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 493620a8dce..e79e36a1498 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -695,7 +695,8 @@ void makeffmpegstring(char* string) { if (!string || !exts) return; strcpy(string, G.scene->r.pic); - BLI_convertstringcode(string, G.sce, G.scene->r.cfra); + BLI_convertstringcode(string, G.sce); + BLI_convertstringframe(string, G.scene->r.cfra); BLI_make_existing_file(string); diff --git a/source/blender/blenlib/BLI_blenlib.h b/source/blender/blenlib/BLI_blenlib.h index 33567d92c99..e24ccad12fb 100644 --- a/source/blender/blenlib/BLI_blenlib.h +++ b/source/blender/blenlib/BLI_blenlib.h @@ -150,7 +150,8 @@ void BLI_cleanup_dir(const char *relabase, char *dir); /* same as above but adds * @a framenum The framenumber to replace the frame code with. * @retval Returns true if the path was relative (started with "//"). */ -int BLI_convertstringcode(char *path, const char *basepath, int framenum); +int BLI_convertstringcode(char *path, const char *basepath); +int BLI_convertstringframe(char *path, int frame); void BLI_makestringcode(const char *relfile, char *file); diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index 66eb63c8dfd..79d3e487712 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -130,9 +130,9 @@ void BLI_bpathIterator_getPathExpanded( struct BPathIterator *bpi, char *path_ex libpath = BLI_bpathIterator_getLib(bpi); if (libpath) { /* check the files location relative to its library path */ - BLI_convertstringcode(path_expanded, libpath, G.scene->r.cfra); + BLI_convertstringcode(path_expanded, libpath); } else { /* local data, use the blend files path */ - BLI_convertstringcode(path_expanded, G.sce, G.scene->r.cfra); + BLI_convertstringcode(path_expanded, G.sce); } } char* BLI_bpathIterator_getLib( struct BPathIterator *bpi) { diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index cdac1ba7061..c85849b5ed4 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -877,7 +877,7 @@ void BLI_cleanup_file(const char *relabase, char *dir) short a; char *start, *eind; if (relabase) { - BLI_convertstringcode(dir, relabase, 0); + BLI_convertstringcode(dir, relabase); } #ifdef WIN32 if(dir[0]=='.') { /* happens for example in FILE_MAIN */ @@ -1037,10 +1037,78 @@ void BLI_makestringcode(const char *relfile, char *file) } } -int BLI_convertstringcode(char *path, const char *basepath, int framenum) + +int BLI_convertstringframe(char *path, int frame) +{ + int ch_sta, ch_end, i; + /* Insert current frame: file### -> file001 */ + ch_sta = ch_end = 0; + for (i = 0; path[i] != '\0'; i++) { + if (path[i] == '\\' || path[i] == '/') { + ch_end = 0; /* this is a directory name, dont use any hashes we found */ + } else if (path[i] == '#') { + ch_sta = i; + ch_end = ch_sta+1; + while (path[ch_end] == '#') { + ch_end++; + } + i = ch_end-1; /* keep searching */ + + /* dont break, there may be a slash after this that invalidates the previous #'s */ + } + } + if (ch_end) { /* warning, ch_end is the last # +1 */ + /* Add the frame number? */ + short numlen, hashlen; + char tmp[FILE_MAX]; + + char format[16]; /* 6 is realistically the maxframe (300000), so 8 should be enough, but 16 to be safe. */ + if (((ch_end-1)-ch_sta) >= 16) { + ch_end = ch_sta+15; /* disallow values longer then 'format' can hold */ + } + + strcpy(tmp, path); + + numlen = 1 + (int)log10((double)frame); /* this is the number of chars in the number */ + hashlen = ch_end - ch_sta; + + sprintf(format, "%d", frame); + + if (numlen==hashlen) { /* simple case */ + memcpy(tmp+ch_sta, format, numlen); + } else if (numlen < hashlen) { + memcpy(tmp+ch_sta + (hashlen-numlen), format, numlen); /*dont copy the string terminator */ + memset(tmp+ch_sta, '0', hashlen-numlen); + } else { + /* number is longer then number of #'s */ + if (tmp[ch_end] == '\0') { /* hashes are last, no need to move any string*/ + /* bad juju - not testing string length here :/ */ + memcpy(tmp+ch_sta, format, numlen+1); /* add 1 to get the string terminator \0 */ + } else { + /* we need to move the end characters, reuse i */ + int j; + + i = strlen(tmp); /* +1 to copy the string terminator */ + j = i + (numlen-hashlen); /* from/to */ + + while (i >= ch_end) { + tmp[j] = tmp[i]; + i--; + j--; + } + memcpy(tmp + ch_sta, format, numlen); + } + } + strcpy(path, tmp); + return 1; + } + return 0; +} + + +int BLI_convertstringcode(char *path, const char *basepath) { int wasrelative; - int ch_sta, ch_end; char tmp[FILE_MAX]; char base[FILE_MAX]; char vol[3] = {'\0', '\0', '\0'}; @@ -1098,54 +1166,8 @@ int BLI_convertstringcode(char *path, const char *basepath, int framenum) MEM_freeN(filepart); } - - /* Insert current frame: file### -> file001 */ - ch_end = 0; - for (ch_sta = 0; tmp[ch_sta] != '\0'; ch_sta++) { - if (tmp[ch_sta] == '#') { - ch_end = ch_sta+1; - while (tmp[ch_end] == '#') { - ch_end++; - } - break; - } - } - if (ch_end) { /* warning, ch_end is the last # +1 */ - /* Add the frame number? */ - short numlen, hashlen; - char format[16]; /* 6 is realistically the maxframe (300000), so 8 should be enough, but 16 to be safe. */ - - numlen = 1 + (int)log10((double)framenum); /* this is the number of chars in the number */ - hashlen = ch_end - ch_sta; - - sprintf(format, "%d", framenum); - - if (numlen==hashlen) { /* simple case */ - memcpy(tmp+ch_sta, format, numlen); - } else if (numlen < hashlen) { - memcpy(tmp+ch_sta + (hashlen-numlen), format, numlen); /*dont copy the string terminator */ - memset(tmp+ch_sta, '0', hashlen-numlen); - } else { - /* number is longer then number of #'s */ - if (tmp[ch_end] == '\0') { /* hashes are last, no need to move any string*/ - /* bad juju - not testing string length here :/ */ - memcpy(tmp+ch_sta, format, numlen+1); /* add 1 to get the string terminator \0 */ - } else { - /* we need to move the end characters */ - int i = strlen(tmp); /* +1 to copy the string terminator */ - int j = i + (numlen-hashlen); /* from/to */ - while (i >= ch_end) { - tmp[j] = tmp[i]; - i--; - j--; - } - memcpy(tmp + ch_sta, format, numlen); - } - } - } - /* done with file### stuff */ - strcpy(path, tmp); + #ifdef WIN32 /* skip first two chars, which in case of absolute path will be drive:/blabla and diff --git a/source/blender/blenloader/intern/genfile.c b/source/blender/blenloader/intern/genfile.c index 7eb6220066e..87c859de839 100644 --- a/source/blender/blenloader/intern/genfile.c +++ b/source/blender/blenloader/intern/genfile.c @@ -213,6 +213,12 @@ void dna_freestructDNA(struct SDNA *sdna) MEM_freeN(sdna); } +static int ispointer(char *name) +{ + /* check if pointer or function pointer */ + return (name[0]=='*' || (name[0]=='(' && name[1]=='*')); +} + static int elementsize(struct SDNA *sdna, short type, short name) /* call with numbers from struct-array */ { @@ -224,7 +230,7 @@ static int elementsize(struct SDNA *sdna, short type, short name) namelen= strlen(cp); /* is it a pointer or function pointer? */ - if(cp[0]=='*' || cp[1]=='*') { + if(ispointer(cp)) { /* has the naam an extra length? (array) */ mul= 1; if( cp[namelen-1]==']') mul= arraysize(cp, namelen); @@ -508,7 +514,7 @@ static void recurs_test_compflags(struct SDNA *sdna, char *compflags, int struct for(b=0; bnames[ sp[1] ]; - if(cp[0]!= '*') { + if(!ispointer(cp)) { compflags[a]= 2; recurs_test_compflags(sdna, compflags, a); } @@ -579,7 +585,7 @@ char *dna_get_structDNA_compareflags(struct SDNA *sdna, struct SDNA *newsdna) if(strcmp(str1, str2)!=0) break; /* same type and same name, now pointersize */ - if(str1[0]=='*') { + if(ispointer(str1)) { if(sdna->pointerlen!=newsdna->pointerlen) break; } @@ -834,7 +840,7 @@ static void reconstruct_elem(struct SDNA *newsdna, struct SDNA *oldsdna, char *t if( strcmp(name, oname)==0 ) { /* name equal */ - if( name[0]=='*') { /* pointer afhandelen */ + if(ispointer(name)) { /* pointer of functionpointer afhandelen */ cast_pointer(newsdna->pointerlen, oldsdna->pointerlen, name, curdata, olddata); } else if( strcmp(type, otype)==0 ) { /* type equal */ @@ -851,11 +857,11 @@ static void reconstruct_elem(struct SDNA *newsdna, struct SDNA *oldsdna, char *t cursize= arraysize(name, strlen(name)); oldsize= arraysize(oname, strlen(oname)); - if( name[0]=='*') { /* handle pointer */ + if(ispointer(name)) { /* handle pointer or functionpointer */ if(cursize>oldsize) cast_pointer(newsdna->pointerlen, oldsdna->pointerlen, oname, curdata, olddata); else cast_pointer(newsdna->pointerlen, oldsdna->pointerlen, name, curdata, olddata); } - else if(name[0]=='*' || strcmp(type, otype)==0 ) { /* type equal */ + else if(strcmp(type, otype)==0 ) { /* type equal */ mul= len/oldsize; mul*= MIN2(cursize, oldsize); memcpy(curdata, olddata, mul); @@ -909,7 +915,7 @@ static void reconstruct_struct(struct SDNA *newsdna, struct SDNA *oldsdna, char elen= elementsize(newsdna, spc[0], spc[1]); /* test: is type a struct? */ - if(spc[0]>=firststructtypenr && name[0]!='*') { + if(spc[0]>=firststructtypenr && !ispointer(name)) { /* where does the old struct data start (and is there an old one?) */ cpo= find_elem(oldsdna, type, name, spo, data, &sppo); @@ -976,7 +982,7 @@ void dna_switch_endian_struct(struct SDNA *oldsdna, int oldSDNAnr, char *data) elen= elementsize(oldsdna, spc[0], spc[1]); /* test: is type a struct? */ - if(spc[0]>=firststructtypenr && name[0]!='*') { + if(spc[0]>=firststructtypenr && !ispointer(name)) { /* where does the old data start (is there one?) */ cpo= find_elem(oldsdna, type, name, spo, data, 0); if(cpo) { @@ -993,7 +999,7 @@ void dna_switch_endian_struct(struct SDNA *oldsdna, int oldSDNAnr, char *data) } else { - if( name[0]=='*' ) { + if(ispointer(name)) { if(oldsdna->pointerlen==8) { mul= arraysize(name, strlen(name)); diff --git a/source/blender/include/BIF_screen.h b/source/blender/include/BIF_screen.h index aa3fe6a9279..6f9c0ae194f 100644 --- a/source/blender/include/BIF_screen.h +++ b/source/blender/include/BIF_screen.h @@ -82,7 +82,6 @@ void winqdelete(struct ScrArea *sa); void winqclear(struct ScrArea *sa); void addqueue(short win, unsigned short event, short val); void addafterqueue(short win, unsigned short event, short val); -void add_readfile_event(char *filename); short ext_qtest(void); unsigned short extern_qread(short *val); unsigned short extern_qread_ext(short *val, char *ascii); diff --git a/source/blender/include/butspace.h b/source/blender/include/butspace.h index 8556d47e4ab..242965a820c 100644 --- a/source/blender/include/butspace.h +++ b/source/blender/include/butspace.h @@ -367,7 +367,7 @@ void curvemap_buttons(struct uiBlock *block, struct CurveMapping *cumap, char la #define B_SEQ_BUT_TRANSFORM 1695 #define B_SEQ_BUT_RELOAD_FILE 1696 #define B_SEQ_BUT_REBUILD_PROXY 1697 - +#define B_SEQ_SEL_PROXY_DIR 1698 /* *********************** */ #define B_ARMATUREBUTS 1800 #define B_POSE 1701 diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c b/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c index 37bbb68ba03..78f780c43b1 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c @@ -160,11 +160,11 @@ static void node_dynamic_free_storage_cb(bNode *node) } /* Disable pynode when its script fails */ -/*static void node_dynamic_disable(bNode *node) +static void node_dynamic_disable(bNode *node) { node->custom1 = 0; node->custom1 = BSET(node->custom1, NODE_DYNAMIC_ERROR); -}*/ +} /* Disable all pynodes using the given text (script) id */ static void node_dynamic_disable_all_by_id(ID *id) @@ -401,7 +401,11 @@ static int node_dynamic_parse(struct bNode *node) MEM_freeN(buf); if (!pyresult) { + if (BTST(node->custom1, NODE_DYNAMIC_LOADED)) { + node_dynamic_disable(node); + } else { node_dynamic_disable_all_by_id(node->id); + } node_dynamic_pyerror_print(node); PyGILState_Release(gilstate); return -1; diff --git a/source/blender/python/BPY_interface.c b/source/blender/python/BPY_interface.c index 86bcd51e914..ffdb593767a 100644 --- a/source/blender/python/BPY_interface.c +++ b/source/blender/python/BPY_interface.c @@ -444,7 +444,7 @@ void BPY_rebuild_syspath( void ) } BLI_strncpy(dirpath, U.pythondir, FILE_MAX); - BLI_convertstringcode(dirpath, G.sce, 0); + BLI_convertstringcode(dirpath, G.sce); syspath_append(dirpath); /* append to module search path */ BLI_make_file_string("/", modpath, dirpath, "bpymodules"); @@ -1019,7 +1019,7 @@ int BPY_menu_do_python( short menutype, int event ) /* dirs in Blender can be "//", which has a special meaning */ BLI_strncpy(upythondir, U.pythondir, FILE_MAX); - BLI_convertstringcode(upythondir, G.sce, 0); /* if so, this expands it */ + BLI_convertstringcode(upythondir, G.sce); /* if so, this expands it */ BLI_make_file_string( "/", filestr, upythondir, pym->filename ); } else { /* script is in default scripts dir */ diff --git a/source/blender/python/BPY_menus.c b/source/blender/python/BPY_menus.c index ce1b964b689..82da9edbee6 100644 --- a/source/blender/python/BPY_menus.c +++ b/source/blender/python/BPY_menus.c @@ -492,7 +492,7 @@ static int bpymenu_CreateFromFile( void ) fscanf( fp, "# User defined scripts dir: %[^\n]\n", w1 ); BLI_strncpy(upythondir, U.pythondir, FILE_MAX); - BLI_convertstringcode(upythondir, G.sce, 0); + BLI_convertstringcode(upythondir, G.sce); if( strcmp( w1, upythondir ) != 0 ) return -1; @@ -604,7 +604,7 @@ static void bpymenu_WriteDataFile( void ) char upythondir[FILE_MAX]; BLI_strncpy(upythondir, U.pythondir, FILE_MAX); - BLI_convertstringcode(upythondir, G.sce, 0); + BLI_convertstringcode(upythondir, G.sce); fprintf( fp, "# User defined scripts dir: %s\n", upythondir ); } @@ -1003,7 +1003,7 @@ int BPyMenu_Init( int usedir ) } else { BLI_strncpy(upythondir, upydir, FILE_MAX); - BLI_convertstringcode(upythondir, G.sce, 0); + BLI_convertstringcode(upythondir, G.sce); } sdir = bpy_gethome(1); @@ -1096,7 +1096,7 @@ the user defined Python scripts dir.\n", dirname ); } if( stat_dir2 == 0 ) { BLI_strncpy(dirname, U.pythondir, FILE_MAX); - BLI_convertstringcode(dirname, G.sce, 0); + BLI_convertstringcode(dirname, G.sce); i = bpymenu_ParseDir( dirname, NULL, 1 ); if (i == -1 && DEBUG) fprintf(stderr, "User defined scripts dir does not seem valid.\n\n"); diff --git a/source/blender/python/api2_2x/Blender.c b/source/blender/python/api2_2x/Blender.c index fe5ae25ccb1..daba0c36fdf 100644 --- a/source/blender/python/api2_2x/Blender.c +++ b/source/blender/python/api2_2x/Blender.c @@ -371,7 +371,7 @@ static PyObject *Blender_Get( PyObject * self, PyObject * value ) char upydir[FILE_MAX]; BLI_strncpy(upydir, U.pythondir, FILE_MAX); - BLI_convertstringcode(upydir, G.sce, 0); + BLI_convertstringcode(upydir, G.sce); if (BLI_exists(upydir)) { char udatadir[FILE_MAXDIR]; @@ -397,7 +397,7 @@ static PyObject *Blender_Get( PyObject * self, PyObject * value ) char upydir[FILE_MAX]; BLI_strncpy(upydir, U.pythondir, FILE_MAX); - BLI_convertstringcode(upydir, G.sce, 0); + BLI_convertstringcode(upydir, G.sce); if( BLI_exists( upydir ) ) ret = PyString_FromString( upydir ); @@ -410,7 +410,7 @@ static PyObject *Blender_Get( PyObject * self, PyObject * value ) char yfexportdir[FILE_MAX]; BLI_strncpy(yfexportdir, U.yfexportdir, FILE_MAX); - BLI_convertstringcode(yfexportdir, G.sce, 0); + BLI_convertstringcode(yfexportdir, G.sce); if( BLI_exists( yfexportdir ) ) ret = PyString_FromString( yfexportdir ); @@ -423,7 +423,7 @@ static PyObject *Blender_Get( PyObject * self, PyObject * value ) char fontdir[FILE_MAX]; BLI_strncpy(fontdir, U.fontdir, FILE_MAX); - BLI_convertstringcode(fontdir, G.sce, 0); + BLI_convertstringcode(fontdir, G.sce); if( BLI_exists( fontdir ) ) ret = PyString_FromString( fontdir ); @@ -436,7 +436,7 @@ static PyObject *Blender_Get( PyObject * self, PyObject * value ) char textudir[FILE_MAX]; BLI_strncpy(textudir, U.textudir, FILE_MAX); - BLI_convertstringcode(textudir, G.sce, 0); + BLI_convertstringcode(textudir, G.sce); if( BLI_exists( textudir ) ) ret = PyString_FromString( textudir ); @@ -449,7 +449,7 @@ static PyObject *Blender_Get( PyObject * self, PyObject * value ) char plugtexdir[FILE_MAX]; BLI_strncpy(plugtexdir, U.plugtexdir, FILE_MAX); - BLI_convertstringcode(plugtexdir, G.sce, 0); + BLI_convertstringcode(plugtexdir, G.sce); if( BLI_exists( plugtexdir ) ) ret = PyString_FromString( plugtexdir ); @@ -462,7 +462,7 @@ static PyObject *Blender_Get( PyObject * self, PyObject * value ) char plugseqdir[FILE_MAX]; BLI_strncpy(plugseqdir, U.plugseqdir, FILE_MAX); - BLI_convertstringcode(plugseqdir, G.sce, 0); + BLI_convertstringcode(plugseqdir, G.sce); if( BLI_exists( plugseqdir ) ) ret = PyString_FromString( plugseqdir ); @@ -475,7 +475,7 @@ static PyObject *Blender_Get( PyObject * self, PyObject * value ) char renderdir[FILE_MAX]; BLI_strncpy(renderdir, U.renderdir, FILE_MAX); - BLI_convertstringcode(renderdir, G.sce, 0); + BLI_convertstringcode(renderdir, G.sce); if( BLI_exists( renderdir ) ) ret = PyString_FromString( renderdir ); @@ -488,7 +488,7 @@ static PyObject *Blender_Get( PyObject * self, PyObject * value ) char sounddir[FILE_MAX]; BLI_strncpy(sounddir, U.sounddir, FILE_MAX); - BLI_convertstringcode(sounddir, G.sce, 0); + BLI_convertstringcode(sounddir, G.sce); if( BLI_exists( sounddir ) ) ret = PyString_FromString( sounddir ); @@ -501,7 +501,7 @@ static PyObject *Blender_Get( PyObject * self, PyObject * value ) char tempdir[FILE_MAX]; BLI_strncpy(tempdir, U.tempdir, FILE_MAX); - BLI_convertstringcode(tempdir, G.sce, 0); + BLI_convertstringcode(tempdir, G.sce); if( BLI_exists( tempdir ) ) ret = PyString_FromString( tempdir ); @@ -776,7 +776,7 @@ static PyObject *Blender_ShowHelp(PyObject *self, PyObject *script) char upydir[FILE_MAX]; BLI_strncpy(upydir, U.pythondir, FILE_MAX); - BLI_convertstringcode(upydir, G.sce, 0); + BLI_convertstringcode(upydir, G.sce); BLI_make_file_string("/", hspath, upydir, "help_browser.py"); if (!BLI_exists(hspath)) diff --git a/source/blender/python/api2_2x/Library.c b/source/blender/python/api2_2x/Library.c index 667db8a1dfd..799735c2062 100644 --- a/source/blender/python/api2_2x/Library.c +++ b/source/blender/python/api2_2x/Library.c @@ -166,7 +166,7 @@ static PyObject *M_Library_Open( PyObject * self, PyObject * value ) /* copy the name to make it absolute so BLO_blendhandle_from_file doesn't complain */ BLI_strncpy(fname1, fname, sizeof(fname1)); - BLI_convertstringcode(fname1, G.sce, 0); /* make absolute */ + BLI_convertstringcode(fname1, G.sce); /* make absolute */ /* G.sce = last file loaded, save for UI and restore after opening file */ BLI_strncpy(filename, G.sce, sizeof(filename)); @@ -483,7 +483,7 @@ static BlendHandle *open_library( char *filename, char *longFilename ) /* get complete file name if necessary */ BLI_strncpy( longFilename, filename, FILE_MAX ); - BLI_convertstringcode( longFilename, G.sce, 0 ); + BLI_convertstringcode( longFilename, G.sce ); /* throw exceptions for wrong file type, cyclic reference */ if( !BLO_has_bfile_extension(longFilename) ) { @@ -515,11 +515,12 @@ static BlendHandle *open_library( char *filename, char *longFilename ) */ static PyObject *CreatePyObject_LibData( int idtype, int kind, - void *name, void *iter, char *filename ) + void *name, void *iter, char *filename, int rel ) { BPy_LibraryData *seq = PyObject_NEW( BPy_LibraryData, &LibraryData_Type); seq->iter = iter; /* the name list (for iterators) */ seq->type = idtype; /* the Blender ID type */ + seq->rel = rel; /* relative or absolute library */ seq->kind = kind; /* used by Blender Objects */ seq->name = name; /* object name, iterator name list, or NULL */ /* save the library name */ @@ -560,7 +561,8 @@ static PyObject *lib_link_or_append( BPy_LibraryData *self, PyObject * value, /* otherwise, create a pseudo object ready for appending or linking */ return CreatePyObject_LibData( ID_OB, mode, - BLI_strdupn( name, strlen( name ) ), NULL, self->filename ); + BLI_strdupn( name, strlen( name ) ), NULL, self->filename, + self->rel ); } } @@ -586,6 +588,9 @@ PyObject *LibraryData_importLibData( BPy_LibraryData *self, char *name, if( !openlib ) return NULL; + /* fix any /foo/../foo/ */ + BLI_cleanup_file(NULL, longFilename); + /* find all datablocks for the specified type */ names = BLO_blendhandle_get_datablock_names ( openlib, self->type ); @@ -616,15 +621,15 @@ PyObject *LibraryData_importLibData( BPy_LibraryData *self, char *name, } /* import from the libary */ - BLO_script_library_append( &openlib, longFilename, name, self->type, mode, - scene ); + BLO_script_library_append( &openlib, longFilename, name, self->type, + mode | self->rel, scene ); /* * locate the library. If this is an append, make the data local. If it * is link, we need the library for later */ for( lib = G.main->library.first; lib; lib = lib->id.next ) - if( strcmp( longFilename, lib->name ) == 0 ) { + if( strcmp( longFilename, lib->filename ) == 0) { if( mode != FILE_LINK ) { all_local( lib, 1 ); /* important we unset, otherwise these object wont @@ -717,7 +722,7 @@ static PyObject *LibraryData_getIter( BPy_LibraryData * self ) /* build an iterator object for the name list */ return CreatePyObject_LibData( self->type, OTHER, names, - names, self->filename ); + names, self->filename, self->rel ); } /* Return next name. */ @@ -942,7 +947,7 @@ PyTypeObject LibraryData_Type = { static PyObject *LibraryData_CreatePyObject( BPy_Library *self, void *mode ) { return CreatePyObject_LibData( GET_INT_FROM_POINTER(mode), OTHER, NULL, NULL, - self->filename ); + self->filename, self->rel); } /************************************************************ @@ -972,6 +977,39 @@ static int Library_setFilename( BPy_Library * self, PyObject * args ) return 0; } +/* + * Return the library's name. The format depends on whether the library is + * accessed as relative or absolute. + */ + +static PyObject *Library_getName( BPy_Library * self ) +{ + Library *lib; + BlendHandle *openlib; + char longFilename[FILE_MAX]; + + /* try to open the library */ + openlib = open_library( self->filename, longFilename ); + if( openlib ) { + BLO_blendhandle_close( openlib ); + /* remove any /../ or /./ junk */ + BLI_cleanup_file(NULL, longFilename); + + /* search the loaded libraries for a match */ + for( lib = G.main->library.first; lib; lib = lib->id.next ) + if( strcmp( longFilename, lib->filename ) == 0) { + return PyString_FromString( lib->name ); + } + + /* library not found in memory */ + return EXPP_ReturnPyObjError( PyExc_RuntimeError, + "library not loaded" ); + } + /* could not load library */ + return EXPP_ReturnPyObjError( PyExc_IOError, "library not found" ); +} + + /************************************************************************ * Python Library_type attributes get/set structure ************************************************************************/ @@ -981,6 +1019,10 @@ static PyGetSetDef Library_getseters[] = { (getter)Library_getFilename, (setter)Library_setFilename, "library filename", NULL}, + {"name", + (getter)Library_getName, (setter)NULL, + "library name (as used by Blender)", + NULL}, {"objects", (getter)LibraryData_CreatePyObject, (setter)NULL, "objects from the library", @@ -1066,20 +1108,27 @@ static PyGetSetDef Library_getseters[] = { * actually accessed later. */ -static PyObject *M_Library_Load(PyObject *self, PyObject * value) +static PyObject *M_Library_Load(PyObject *self, PyObject * args) { - char *filename = PyString_AsString(value); + char *filename = NULL; + PyObject *relative = NULL; BPy_Library *lib; - if( !filename ) + if( !PyArg_ParseTuple( args, "s|O", &filename, &relative ) ) return EXPP_ReturnPyObjError( PyExc_TypeError, - "expected a string" ); + "expected strings and optional bool as arguments." ); /* try to create a new object */ lib = (BPy_Library *)PyObject_NEW( BPy_Library, &Library_Type ); if( !lib ) return NULL; + /* save relative flag value */ + if( relative && PyObject_IsTrue(relative) ) + lib->rel = FILE_STRINGCODE; + else + lib->rel = 0; + /* assign the library filename for future use, then return */ BLI_strncpy( lib->filename, filename, sizeof(lib->filename) ); @@ -1087,7 +1136,7 @@ static PyObject *M_Library_Load(PyObject *self, PyObject * value) } static struct PyMethodDef M_Library_methods[] = { - {"load", (PyCFunction)M_Library_Load, METH_O, + {"load", (PyCFunction)M_Library_Load, METH_VARARGS, "(string) - declare a .blend file for use as a library"}, {NULL, NULL, 0, NULL} }; diff --git a/source/blender/python/api2_2x/Library.h b/source/blender/python/api2_2x/Library.h index 326040edb35..b75e61d55ff 100644 --- a/source/blender/python/api2_2x/Library.h +++ b/source/blender/python/api2_2x/Library.h @@ -42,6 +42,7 @@ typedef struct { PyObject_HEAD char filename[FILE_MAXDIR + FILE_MAXFILE]; + int rel; } BPy_Library; typedef struct { @@ -50,6 +51,7 @@ typedef struct { int type; char filename[FILE_MAXDIR + FILE_MAXFILE]; char *name; + int rel; enum { OBJECT_IS_LINK, OBJECT_IS_APPEND, diff --git a/source/blender/python/api2_2x/Node.c b/source/blender/python/api2_2x/Node.c index 80b45bb2297..24df6de66cc 100644 --- a/source/blender/python/api2_2x/Node.c +++ b/source/blender/python/api2_2x/Node.c @@ -361,6 +361,15 @@ static int pysockets_to_blendersockets(PyObject *tuple, bNodeSocketType **socks, len = PyTuple_Size(tuple); + if (len >= MAX_SOCKET) { + char error_msg[70]; + PyOS_snprintf(error_msg, sizeof(error_msg), + "limit exceeded: each node can't have more than %d i/o sockets", MAX_SOCKET - 1); + PyErr_SetString(PyExc_AttributeError, error_msg); + len = 0; + retval = -1; + } + nsocks = MEM_callocN(sizeof(bNodeSocketType)*(len+1), "bNodeSocketType in Node.c"); for (pos = 0, a = 0; pos< len; pos++, a++) { @@ -437,6 +446,7 @@ static int Map_socketdef(BPy_NodeSocketLists *self, PyObject *args, void *closur { bNode *node = NULL; PyObject *tuple = NULL; + int ret = 0; node = self->node; @@ -453,7 +463,7 @@ static int Map_socketdef(BPy_NodeSocketLists *self, PyObject *args, void *closur if (args) { if(PySequence_Check(args)) { tuple = PySequence_Tuple(args); - pysockets_to_blendersockets(tuple, + ret = pysockets_to_blendersockets(tuple, &(node->typeinfo->inputs), node->custom1, 1); Py_DECREF(self->input); self->input = tuple; @@ -466,7 +476,7 @@ static int Map_socketdef(BPy_NodeSocketLists *self, PyObject *args, void *closur if (args) { if(PyList_Check(args)) { tuple = PySequence_Tuple(args); - pysockets_to_blendersockets(tuple, + ret = pysockets_to_blendersockets(tuple, &(node->typeinfo->outputs), node->custom1, 0); Py_DECREF(self->output); self->output = tuple; @@ -479,6 +489,11 @@ static int Map_socketdef(BPy_NodeSocketLists *self, PyObject *args, void *closur fprintf(stderr,"DEBUG pynodes: got no list in Map_socketdef\n"); break; } + + if (ret == -1) { + node->custom1 = BSET(node->custom1, NODE_DYNAMIC_ERROR); + } + return 0; } diff --git a/source/blender/python/api2_2x/Sys.c b/source/blender/python/api2_2x/Sys.c index 337f8b6bb14..9de4e344e8c 100644 --- a/source/blender/python/api2_2x/Sys.c +++ b/source/blender/python/api2_2x/Sys.c @@ -391,7 +391,8 @@ static PyObject *M_sys_expandpath( PyObject * self, PyObject * value ) "expected string argument" ); BLI_strncpy(expanded, path, FILE_MAXDIR + FILE_MAXFILE); - BLI_convertstringcode(expanded, G.sce, G.scene->r.cfra); + BLI_convertstringcode(expanded, G.sce); + BLI_convertstringframe(expanded, G.scene->r.cfra); return PyString_FromString(expanded); } diff --git a/source/blender/python/api2_2x/doc/LibData.py b/source/blender/python/api2_2x/doc/LibData.py index 7b6f4950c76..47bd7fdb763 100644 --- a/source/blender/python/api2_2x/doc/LibData.py +++ b/source/blender/python/api2_2x/doc/LibData.py @@ -26,13 +26,15 @@ Example:: me.materials[0] = mat # assign linked material to mesh """ -def load(filename): +def load(filename,relative=False): """ Select an existing .blend file for use as a library. Unlike the Library module, multiple libraries can be defined at the same time. @type filename: string @param filename: The filename of a Blender file. Filenames starting with "//" will be loaded relative to the blend file's location. + @type relative: boolean + @param relative: Convert relative paths to absolute paths (default). Setting this parameter to True will leave paths relative. @rtype: Library @return: return a L{Library} object. """ @@ -46,8 +48,10 @@ class Libraries: It provides access to scenes, objects, meshes, curves, metaballs, materials, textures, images, lattices, lamps, cameras, ipos, worlds, fonts, texts, sounds, groups, armatures, and actions. - @ivar filename: The path to the library + @ivar filename: The filename of the library, as supplied by user. @type filename: string + @ivar name: The path to the library, as used by Blender. If the filename supplied by the user is relative, but the relative option to L{library.load()} is False, the name will be the absolute path. + @type name: string @ivar scenes: library L{scene} data @type scenes: L{LibData} @ivar objects: library L{object} data diff --git a/source/blender/python/api2_2x/sceneRender.c b/source/blender/python/api2_2x/sceneRender.c index 7cae5f6144f..db5ad669255 100644 --- a/source/blender/python/api2_2x/sceneRender.c +++ b/source/blender/python/api2_2x/sceneRender.c @@ -598,8 +598,7 @@ PyObject *RenderData_Play( BPy_RenderData * self ) if( self->renderContext->imtype == R_QUICKTIME ) { strcpy( file, self->renderContext->pic ); - BLI_convertstringcode( file, (char *) self->scene, - self->renderContext->cfra ); + BLI_convertstringcode( file, G.sce ); BLI_make_existing_file( file ); if( BLI_strcasecmp( file + strlen( file ) - 4, ".mov" ) ) { sprintf( txt, "%04d_%04d.mov", @@ -612,8 +611,8 @@ PyObject *RenderData_Play( BPy_RenderData * self ) { strcpy( file, self->renderContext->pic ); - BLI_convertstringcode( file, G.sce, - self->renderContext->cfra ); + BLI_convertstringcode( file, G.sce ); + BLI_make_existing_file( file ); if( BLI_strcasecmp( file + strlen( file ) - 4, ".avi" ) ) { sprintf( txt, "%04d_%04d.avi", diff --git a/source/blender/quicktime/apple/quicktime_export.c b/source/blender/quicktime/apple/quicktime_export.c index a49a9a2fdc8..736bb4dd584 100644 --- a/source/blender/quicktime/apple/quicktime_export.c +++ b/source/blender/quicktime/apple/quicktime_export.c @@ -428,7 +428,7 @@ void makeqtstring (char *string) { if (string==0) return; strcpy(string, G.scene->r.pic); - BLI_convertstringcode(string, G.sce, G.scene->r.cfra); + BLI_convertstringcode(string, G.sce); BLI_make_existing_file(string); diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 09c850b6252..93282e641d3 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -1835,7 +1835,8 @@ static void load_backbuffer(Render *re) char name[256]; strcpy(name, re->r.backbuf); - BLI_convertstringcode(name, G.sce, re->r.cfra); + BLI_convertstringcode(name, G.sce); + BLI_convertstringframe(name, re->r.cfra); if(re->backbuf) { re->backbuf->id.us--; diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index d007ffad020..47a2c6d613d 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -4606,16 +4606,21 @@ void do_vgroupbuts(unsigned short event) switch(event) { case B_NEWVGROUP: add_defgroup (ob); + DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); scrarea_queue_winredraw(curarea); allqueue(REDRAWOOPS, 0); + break; case B_DELVGROUP: - if ((G.obedit) && (G.obedit == ob)) + if ((G.obedit) && (G.obedit == ob)) { del_defgroup (ob); - else + } else { del_defgroup_in_object_mode (ob); + DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); + } allqueue (REDRAWVIEW3D, 1); allqueue(REDRAWOOPS, 0); + allqueue(REDRAWBUTSEDIT, 1); BIF_undo_push("Delete vertex group"); break; case B_ASSIGNVGROUP: @@ -4637,6 +4642,7 @@ void do_vgroupbuts(unsigned short event) break; case B_DESELVGROUP: sel_verts_defgroup(0); + DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); allqueue (REDRAWVIEW3D, 1); allqueue(REDRAWOOPS, 0); countall(); diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index d58a283b6d1..37becdc8912 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -3130,9 +3130,13 @@ void do_effects_panels(unsigned short event) } } else { - psys->flag |= PSYS_EDITED; - if(G.f & G_PARTICLEEDIT) - PE_create_particle_edit(ob, psys); + if(psys_check_enabled(ob, psys)) { + psys->flag |= PSYS_EDITED; + if(G.f & G_PARTICLEEDIT) + PE_create_particle_edit(ob, psys); + } + else + error("Particle system not enabled, skipping set editable"); } } case B_FIELD_DEP: diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index 5fd23af591e..b295cdd8481 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -1175,9 +1175,14 @@ static void seq_panel_proxy() } if (last_seq->flag & SEQ_USE_PROXY_CUSTOM_DIR) { + uiDefIconBut(block, BUT, B_SEQ_SEL_PROXY_DIR, + ICON_FILESEL, 10, 120, 20, 20, 0, 0, 0, 0, 0, + "Select the directory/name for " + "the proxy storage"); + uiDefBut(block, TEX, B_SEQ_BUT_RELOAD, "Dir: ", - 10,120,240,19, last_seq->strip->proxy->dir, + 30,120,220,20, last_seq->strip->proxy->dir, 0.0, 160.0, 100, 0, ""); } @@ -1264,10 +1269,20 @@ void sequencer_panels() } } +static void sel_proxy_dir(char *name) +{ + Sequence *last_seq = get_last_seq(); + strcpy(last_seq->strip->proxy->dir, name); + + allqueue(REDRAWBUTSSCENE, 0); + + BIF_undo_push("Change proxy directory"); +} void do_sequencer_panels(unsigned short event) { Sequence *last_seq = get_last_seq(); + ScrArea * sa; switch(event) { case B_SEQ_BUT_PLUGIN: @@ -1280,6 +1295,13 @@ void do_sequencer_panels(unsigned short event) case B_SEQ_BUT_REBUILD_PROXY: seq_proxy_rebuild(last_seq); break; + case B_SEQ_SEL_PROXY_DIR: + sa= closest_bigger_area(); + areawinset(sa->win); + activate_fileselect(FILE_SPECIAL, "SELECT PROXY DIR", + last_seq->strip->proxy->dir, + sel_proxy_dir); + break; case B_SEQ_BUT_RELOAD: case B_SEQ_BUT_RELOAD_ALL: update_seq_ipo_rect(last_seq); diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 5e420ade204..b46679898b4 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -238,7 +238,7 @@ static void save_env(char *name) char str[FILE_MAX]; strcpy(str, name); - BLI_convertstringcode(str, G.sce, G.scene->r.cfra); + BLI_convertstringcode(str, G.sce); tex= G.buts->lockpoin; if(tex && GS(tex->id.name)==ID_TE) { @@ -2338,9 +2338,9 @@ static void world_panel_preview(World *wrld) uiBlockBeginAlign(block); uiDefButBitS(block, TOG, WO_SKYBLEND, B_WORLDPRV,"Blend", 220,175,100,25, &wrld->skytype, 0, 0, 0, 0, "Renders background with natural progression from horizon to zenith"); uiDefButBitS(block, TOG,WO_SKYPAPER, B_WORLDPRV,"Paper", 220,150,100,25, &wrld->skytype, 0, 0, 0, 0, "Flattens blend or texture coordinates"); - if (wrld->skytype & WO_SKYBLEND) { + /*if (wrld->skytype & WO_SKYBLEND) {*/ /* In some (rare?) cases its possible to use this, leave this out for now */ uiDefButBitS(block, TOG, WO_SKYREAL, B_WORLDPRV,"Real", 220,125,100,25, &wrld->skytype, 0, 0, 0, 0, "Renders background with a real horizon"); - } + /*}*/ uiBlockEndAlign(block); } diff --git a/source/blender/src/drawimage.c b/source/blender/src/drawimage.c index ac2b92d0815..6d1cd244b84 100644 --- a/source/blender/src/drawimage.c +++ b/source/blender/src/drawimage.c @@ -533,7 +533,7 @@ void draw_uvs_sima(void) if (G.sima->flag & SI_DRAW_STRETCH) { - float col[3]; + float col[4]; float aspx, aspy; float tface_uv[4][2]; diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index 808320bb9de..aec0e112b32 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -3474,6 +3474,8 @@ static void draw_particle_edit(Object *ob, ParticleSystem *psys) PE_hide_keys_time(psys,CFRA); psys_cache_paths(ob,psys,CFRA,0); } + if(psys->pathcache==0) + return; if(pset->flag & PE_SHOW_CHILD && psys->part->draw_as == PART_DRAW_PATH) { if(psys->childcache==0) diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index d97701e8c1e..b01b7bc151c 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -3394,8 +3394,12 @@ static double swaptime; static int curmode; /* used for fps display */ +#define REDRAW_FRAME_AVERAGE 8 static double redrawtime; static double lredrawtime; +static float redrawtimes_fps[REDRAW_FRAME_AVERAGE]; +static short redrawtime_index; + int update_time(void) { @@ -3418,13 +3422,33 @@ static void draw_viewport_fps(ScrArea *sa) { float fps; char printable[16]; - + int i, tot; if (lredrawtime == redrawtime) return; printable[0] = '\0'; - fps = (float)(1.0/(lredrawtime-redrawtime)); + +#if 0 + /* this is too simple, better do an average */ + fps = (float)(1.0/(lredrawtime-redrawtime)) +#else + redrawtimes_fps[redrawtime_index] = (float)(1.0/(lredrawtime-redrawtime)); + + for (i=0, tot=0, fps=0.0f ; i < REDRAW_FRAME_AVERAGE ; i++) { + if (redrawtimes_fps[i]) { + fps += redrawtimes_fps[i]; + tot++; + } + } + if (tot) { + redrawtime_index++; + if (redrawtime_index >= REDRAW_FRAME_AVERAGE) + redrawtime_index = 0; + + fps = fps / tot; + } +#endif /* is this more then half a frame behind? */ if (fps+0.5 < FPS) { @@ -3549,6 +3573,12 @@ void inner_play_anim_loop(int init, int mode) cached = cached_dynamics(PSFRA,PEFRA); redrawtime = 1.0/FPS; + + redrawtime_index = REDRAW_FRAME_AVERAGE; + while(redrawtime_index--) { + redrawtimes_fps[redrawtime_index] = 0.0; + } + redrawtime_index = 0; lredrawtime = 0.0; return; } diff --git a/source/blender/src/editcurve.c b/source/blender/src/editcurve.c index d9bc55fa8bf..34dcab09c2a 100644 --- a/source/blender/src/editcurve.c +++ b/source/blender/src/editcurve.c @@ -4316,8 +4316,10 @@ Nurb *addNurbprim(int type, int stype, int newname) makeknots(nu, 1, nu->flagu>>1); BLI_addtail(&editNurb, nu); /* temporal for spin */ - if(newname) spin_nurb(0, 2); - else spin_nurb(0, 0); + if(newname && (U.flag & USER_ADD_VIEWALIGNED) == 0) + spin_nurb(0, 2); + else + spin_nurb(0, 0); makeknots(nu, 2, nu->flagv>>1); @@ -4344,8 +4346,10 @@ Nurb *addNurbprim(int type, int stype, int newname) nu->resolv= 32; nu->flag= CU_SMOOTH; BLI_addtail(&editNurb, nu); /* temporal for extrude and translate */ - if(newname) spin_nurb(0, 2); - else spin_nurb(0, 0); + if(newname && (U.flag & USER_ADD_VIEWALIGNED) == 0) + spin_nurb(0, 2); + else + spin_nurb(0, 0); BLI_remlink(&editNurb, nu); diff --git a/source/blender/src/editdeform.c b/source/blender/src/editdeform.c index 6d6a53fc59e..a072898327f 100644 --- a/source/blender/src/editdeform.c +++ b/source/blender/src/editdeform.c @@ -217,19 +217,25 @@ void duplicate_defgroup ( Object *ob ) dg = BLI_findlink (&ob->defbase, (ob->actdef-1)); if (!dg) return; - - BLI_snprintf (name, 32, "%s_copy", dg->name); - while (get_named_vertexgroup (ob, name)) { - if ((strlen (name) + 6) > 32) { - error ("Error: the name for the new group is > 32 characters"); - return; + + if (strstr(dg->name, "_copy")) { + BLI_strncpy (name, dg->name, 32); /* will be renamed _copy.001... etc */ + } else { + BLI_snprintf (name, 32, "%s_copy", dg->name); + while (get_named_vertexgroup (ob, name)) { + if ((strlen (name) + 6) > 32) { + error ("Error: the name for the new group is > 32 characters"); + return; + } + strcpy (s, name); + BLI_snprintf (name, 32, "%s_copy", s); } - strcpy (s, name); - BLI_snprintf (name, 32, "%s_copy", s); - } + } cdg = copy_defgroup (dg); strcpy (cdg->name, name); + unique_vertexgroup_name(cdg, ob); + BLI_addtail (&ob->defbase, cdg); idg = (ob->actdef-1); diff --git a/source/blender/src/editimasel.c b/source/blender/src/editimasel.c index 2ee583788e5..67e10d771e0 100644 --- a/source/blender/src/editimasel.c +++ b/source/blender/src/editimasel.c @@ -166,8 +166,7 @@ static void activate_imageselect_(int type, char *title, char *file, short *menu name[2]= 0; BLI_strncpy(name, file, sizeof(name)); - BLI_convertstringcode(name, G.sce, G.scene->r.cfra); - + BLI_convertstringcode(name, G.sce); simasel= curarea->spacedata.first; diff --git a/source/blender/src/editipo.c b/source/blender/src/editipo.c index d72bdc6fc80..a8b2ff761e5 100644 --- a/source/blender/src/editipo.c +++ b/source/blender/src/editipo.c @@ -3793,6 +3793,12 @@ void clean_ipo_curve(IpoCurve *icu) MEM_freeN(old_bezts); } + +/* temp struct used for smooth_ipo */ +typedef struct tSmooth_Bezt { + float *h1, *h2, *h3; /* bezt->vec[0,1,2][1] */ +} tSmooth_Bezt; + void smooth_ipo(void) { EditIpo *ei; @@ -3804,7 +3810,6 @@ void smooth_ipo(void) ei= G.sipo->editipo; for(b=0; btotipo; b++, ei++) { if (ISPOIN3(ei, flag & IPO_VISIBLE, icu, icu->bezt)) { - ok= 0; if(G.sipo->showkey) ok= 1; else if(totipo_vert && (ei->flag & IPO_EDIT)) ok= 2; @@ -3813,52 +3818,94 @@ void smooth_ipo(void) if(ok) { IpoCurve *icu= ei->icu; BezTriple *bezt; - float meanValSum = 0.0f, meanVal; - float valDiff; - int i, totSel = 0; + int i, x, totSel = 0; /* check if enough points */ if (icu->totvert >= 3) { - /* first loop through - obtain average value */ + /* first loop through - count how many verts are selected, and fix up handles */ bezt= icu->bezt; - for (i=1; i < icu->totvert; i++, bezt++) { + for (i=0; i < icu->totvert; i++, bezt++) { if (BEZSELECTED(bezt)) { /* line point's handles up with point's vertical position */ bezt->vec[0][1]= bezt->vec[2][1]= bezt->vec[1][1]; - if(bezt->h1==HD_AUTO || bezt->h1==HD_VECT) bezt->h1= HD_ALIGN; - if(bezt->h2==HD_AUTO || bezt->h2==HD_VECT) bezt->h2= HD_ALIGN; + if ((bezt->h1==HD_AUTO) || (bezt->h1==HD_VECT)) bezt->h1= HD_ALIGN; + if ((bezt->h2==HD_AUTO) || (bezt->h2==HD_VECT)) bezt->h2= HD_ALIGN; /* add value to total */ - meanValSum += bezt->vec[1][1]; totSel++; } } - /* calculate mean value */ - meanVal= meanValSum / totSel; - - /* second loop through - update point positions */ - bezt= icu->bezt; - for (i=0; i < icu->totvert; i++, bezt++) { - if (BEZSELECTED(bezt)) { - /* 1. calculate difference between the points - * 2. move point half-way along that distance - */ - if (bezt->vec[1][1] > meanVal) { - /* bezt val above mean */ - valDiff= bezt->vec[1][1] - meanVal; - bezt->vec[1][1]= meanVal + (valDiff / 2); - } - else { - /* bezt val below mean */ - valDiff= meanVal - bezt->vec[1][1]; - bezt->vec[1][1] = bezt->vec[1][1] + (valDiff / 2); + /* if any points were selected, allocate tSmooth_Bezt points to work on */ + if (totSel >= 3) { + tSmooth_Bezt *tarray, *tsb; + + /* allocate memory in one go */ + tsb= tarray= MEM_callocN(totSel*sizeof(tSmooth_Bezt), "tSmooth_Bezt Array"); + + /* populate tarray with data of selected points */ + bezt= icu->bezt; + for (i=0, x=0; (i < icu->totvert) && (x < totSel); i++, bezt++) { + if (BEZSELECTED(bezt)) { + /* tsb simply needs pointer to vec, and index */ + tsb->h1 = &bezt->vec[0][1]; + tsb->h2 = &bezt->vec[1][1]; + tsb->h3 = &bezt->vec[2][1]; + + /* advance to the next tsb to populate */ + if (x < totSel- 1) + tsb++; + else + break; } } + + /* calculate the new smoothed ipo's with weighted averages: + * - this is done with two passes + * - uses 5 points for each operation (which stores in the relevant handles) + * - previous: w/a ratio = 3:5:2:1:1 + * - next: w/a ratio = 1:1:2:5:3 + */ + + /* round 1: calculate previous and next */ + tsb= tarray; + for (i=0; i < totSel; i++, tsb++) { + /* don't touch end points (otherwise, curves slowly explode) */ + if (ELEM(i, 0, (totSel-1)) == 0) { + tSmooth_Bezt *tP1 = tsb - 1; + tSmooth_Bezt *tP2 = (i-2 > 0) ? (tsb - 2) : (NULL); + tSmooth_Bezt *tN1 = tsb + 1; + tSmooth_Bezt *tN2 = (i+2 < totSel) ? (tsb + 2) : (NULL); + + float p1 = *tP1->h2; + float p2 = (tP2) ? (*tP2->h2) : (*tP1->h2); + float c1 = *tsb->h2; + float n1 = *tN1->h2; + float n2 = (tN2) ? (*tN2->h2) : (*tN1->h2); + + /* calculate previous and next */ + *tsb->h1= (3*p2 + 5*p1 + 2*c1 + n1 + n2) / 12; + *tsb->h3= (p2 + p1 + 2*c1 + 5*n1 + 3*n2) / 12; + } + } + + /* round 2: calculate new values and reset handles */ + tsb= tarray; + for (i=0; i < totSel; i++, tsb++) { + /* calculate new position by averaging handles */ + *tsb->h2 = (*tsb->h1 + *tsb->h3) / 2; + + /* reset handles now */ + *tsb->h1 = *tsb->h2; + *tsb->h3 = *tsb->h2; + } + + /* free memory required for tarray */ + MEM_freeN(tarray); } } - - /* recalc handles */ + + /* recalculate handles */ calchandles_ipocurve(icu); } } diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index 512a29edbc2..cdc38ab1d2c 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -555,6 +555,20 @@ static int return_editcurve_indexar(int *tot, int **indexar, float *cent) return totvert; } +/* use this when the loc/size/rot of the parent has changed but the children should stay in the same place + * apply-size-rot or object center for eg */ +static void ignore_parent_tx( Object *ob ) { + Object *ob_child; + /* a change was made, adjust the children to compensate */ + for (ob_child=G.main->object.first; ob_child; ob_child=ob_child->id.next) { + if (ob_child->parent == ob) { + apply_obmat(ob_child); + what_does_parent(ob_child); + Mat4Invert(ob_child->parentinv, workob.obmat); + } + } +} + static void select_editcurve_hook(HookModifierData *hmd) { extern ListBase editNurb; @@ -1936,6 +1950,9 @@ void docenter(int centermode) base->object->loc[1]+= centn[1]; base->object->loc[2]+= centn[2]; + where_is_object(base->object); + ignore_parent_tx(base->object); + /* other users? */ ob= G.main->object.first; while(ob) { @@ -1954,6 +1971,9 @@ void docenter(int centermode) ob->loc[1]+= centn[1]; ob->loc[2]+= centn[2]; + where_is_object(ob); + ignore_parent_tx(ob); + if(tme && (tme->flag & ME_ISDONE)==0) { mvert= tme->mvert; for(a=0; atotvert; a++, mvert++) { @@ -2033,6 +2053,9 @@ void docenter(int centermode) base->object->loc[0]+= cent[0]; base->object->loc[1]+= cent[1]; base->object->loc[2]+= cent[2]; + + where_is_object(base->object); + ignore_parent_tx(base->object); } tot_change++; @@ -2080,6 +2103,10 @@ void docenter(int centermode) */ docenter_armature(base->object, centermode); tot_change++; + + where_is_object(base->object); + ignore_parent_tx(base->object); + if(G.obedit) break; } @@ -3869,7 +3896,7 @@ void make_links(short event) void apply_objects_locrot( void ) { Base *base, *basact; - Object *ob, *ob_child; + Object *ob; bArmature *arm; Mesh *me; Curve *cu; @@ -4018,14 +4045,7 @@ void apply_objects_locrot( void ) continue; } - /* a change was made, adjust the children to compensate */ - for (ob_child=G.main->object.first; ob_child; ob_child=ob_child->id.next) { - if (ob_child->parent == ob) { - apply_obmat(ob_child); - what_does_parent(ob_child); - Mat4Invert(ob_child->parentinv, workob.obmat); - } - } + ignore_parent_tx(ob); } } if (change) { diff --git a/source/blender/src/editscreen.c b/source/blender/src/editscreen.c index 2df92af5bca..1cd8733a7ea 100644 --- a/source/blender/src/editscreen.c +++ b/source/blender/src/editscreen.c @@ -890,12 +890,6 @@ int afterqtest(short win, unsigned short evt) static char ext_load_str[256]= {0, 0}; -void add_readfile_event(char *filename) -{ - mainqenter(LOAD_FILE, 1); - strcpy(ext_load_str, filename); - BLI_convertstringcode(ext_load_str, G.sce, G.scene->r.cfra); -} static short ext_reshape= 0, ext_redraw=0, ext_inputchange=0, ext_mousemove=0, ext_undopush=0; @@ -1396,7 +1390,7 @@ void screenmain(void) else if (event==QKEY) { /* Temp place to print mem debugging info ctrl+alt+shift + qkey */ if ( G.qual == (LR_SHIFTKEY | LR_ALTKEY | LR_CTRLKEY) ) { - MEM_printmemlist_pydict(); + MEM_printmemlist_stats(); } else if((G.obedit && G.obedit->type==OB_FONT && g_activearea->spacetype==SPACE_VIEW3D)||g_activearea->spacetype==SPACE_TEXT||g_activearea->spacetype==SPACE_SCRIPT); diff --git a/source/blender/src/editsima.c b/source/blender/src/editsima.c index c0efbf8b40b..f5cf29528f3 100644 --- a/source/blender/src/editsima.c +++ b/source/blender/src/editsima.c @@ -2288,7 +2288,9 @@ static void save_image_doit(char *name) if (ibuf) { BLI_strncpy(str, name, sizeof(str)); - BLI_convertstringcode(str, G.sce, G.scene->r.cfra); + BLI_convertstringcode(str, G.sce); + BLI_convertstringframe(str, G.scene->r.cfra); + if(G.scene->r.scemode & R_EXTENSION) { BKE_add_image_extension(str, G.sima->imtypenr); @@ -2499,7 +2501,7 @@ void save_image_sequence_sima(void) char name[FILE_MAX]; BLI_strncpy(name, ibuf->name, sizeof(name)); - BLI_convertstringcode(name, G.sce, 0); + BLI_convertstringcode(name, G.sce); if(0 == IMB_saveiff(ibuf, name, IB_rect | IB_zbuf | IB_zbuffloat)) { error("Could not write image", name); diff --git a/source/blender/src/editsound.c b/source/blender/src/editsound.c index 3ea9a0fb056..1cb7ec276cb 100644 --- a/source/blender/src/editsound.c +++ b/source/blender/src/editsound.c @@ -713,7 +713,7 @@ bSound *sound_new_sound(char *name) if (!G.scene->audio.mixrate) G.scene->audio.mixrate = 44100; /* convert the name to absolute path */ strcpy(str, name); - BLI_convertstringcode(str, G.sce, G.scene->r.cfra); + BLI_convertstringcode(str, G.sce); /* check if the sample on disk can be opened */ file = open(str, O_BINARY|O_RDONLY); @@ -825,7 +825,7 @@ bSample *sound_new_sample(bSound *sound) /* TODO: increase sound->name, sample->name and strip->name to FILE_MAX, to avoid cutting off sample name here - elubie */ BLI_strncpy(samplename, sound->name, FILE_MAX); - BLI_convertstringcode(samplename, G.sce, G.scene->r.cfra); + BLI_convertstringcode(samplename, G.sce); BLI_strncpy(sample->name, samplename, FILE_MAXDIR); /* connect the pf to the sample */ @@ -849,13 +849,13 @@ bSample *sound_find_sample(bSound *sound) // convert sound->name to abolute filename strcpy(name, sound->name); - BLI_convertstringcode(name, G.sce, G.scene->r.cfra); + BLI_convertstringcode(name, G.sce); /* search through the list of loaded samples */ sample = samples->first; while (sample) { strcpy(samplename, sample->name); - BLI_convertstringcode(samplename, G.sce, G.scene->r.cfra); + BLI_convertstringcode(samplename, G.sce); if (strcmp(name, samplename) == 0) { break; diff --git a/source/blender/src/filesel.c b/source/blender/src/filesel.c index c297edda905..19372dcbee6 100644 --- a/source/blender/src/filesel.c +++ b/source/blender/src/filesel.c @@ -1172,7 +1172,7 @@ static void activate_fileselect_(int type, char *title, char *file, short *menup name[2]= 0; BLI_strncpy(name, file, sizeof(name)); - BLI_convertstringcode(name, G.sce, G.scene->r.cfra); + BLI_convertstringcode(name, G.sce); sfile= curarea->spacedata.first; diff --git a/source/blender/src/fluidsim.c b/source/blender/src/fluidsim.c index b51f5bba4d6..a7361a9ffca 100644 --- a/source/blender/src/fluidsim.c +++ b/source/blender/src/fluidsim.c @@ -622,7 +622,7 @@ void fluidsimBake(struct Object *ob) // prepare names... strncpy(targetDir, domainSettings->surfdataPath, FILE_MAXDIR); strncpy(newSurfdataPath, domainSettings->surfdataPath, FILE_MAXDIR); - BLI_convertstringcode(targetDir, G.sce, 0); // fixed #frame-no + BLI_convertstringcode(targetDir, G.sce); // fixed #frame-no strcpy(targetFile, targetDir); strcat(targetFile, suffixConfig); @@ -674,7 +674,7 @@ void fluidsimBake(struct Object *ob) if(selection<1) return; // 0 from menu, or -1 aborted strcpy(targetDir, newSurfdataPath); strncpy(domainSettings->surfdataPath, newSurfdataPath, FILE_MAXDIR); - BLI_convertstringcode(targetDir, G.sce, 0); // fixed #frame-no + BLI_convertstringcode(targetDir, G.sce); // fixed #frame-no } // -------------------------------------------------------------------------------------------- diff --git a/source/blender/src/ghostwinlay.c b/source/blender/src/ghostwinlay.c index 90a9ae9e406..7179f2fae57 100644 --- a/source/blender/src/ghostwinlay.c +++ b/source/blender/src/ghostwinlay.c @@ -927,6 +927,42 @@ void window_open_ndof(Window* win) } ndofLib = PIL_dynlib_open(plug_path); + + /* On systems where blender is installed in /usr/bin/blender, ~/.blender/plugins/ is a better place to look */ + if (ndofLib==NULL) { + + if (plug_path) { + MEM_freeN(plug_path); + } + + inst_path = BLI_gethome(); + if (inst_path) { + size_t len = strlen(inst_path) + strlen(plug_dir) + strlen(PATH_SEP)*2 + + strlen(plug_name) + 1; + + if (!strstr(inst_path, ".blender")) { + len += strlen(".blender") + strlen(PATH_SEP); + } + + plug_path = MEM_mallocN(len, "ndofpluginpath"); + if (plug_path) { + strncpy(plug_path, inst_path, len); + strcat(plug_path, PATH_SEP); + if (!strstr(inst_path, ".blender")) { + strcat(plug_path, ".blender"); + strcat(plug_path, PATH_SEP); + } + strcat(plug_path, plug_dir); + strcat(plug_path, PATH_SEP); + strcat(plug_path, plug_name); + } + } + + ndofLib = PIL_dynlib_open(plug_path); + } + + + #if 0 fprintf(stderr, "plugin path=%s; ndofLib=%p\n", plug_path, (void*)ndofLib); #endif diff --git a/source/blender/src/header_action.c b/source/blender/src/header_action.c index 2ed5107da29..9c7046c5111 100644 --- a/source/blender/src/header_action.c +++ b/source/blender/src/header_action.c @@ -95,7 +95,10 @@ enum { ACTMENU_VIEW_NOHIDE, ACTMENU_VIEW_TRANSDELDUPS, ACTMENU_VIEW_HORIZOPTIMISE, - ACTMENU_VIEW_GCOLORS + ACTMENU_VIEW_GCOLORS, + ACTMENU_VIEW_PREVRANGESET, + ACTMENU_VIEW_PREVRANGECLEAR, + ACTMENU_VIEW_PREVRANGEAUTO }; enum { @@ -350,6 +353,15 @@ static void do_action_viewmenu(void *arg, int event) case ACTMENU_VIEW_GCOLORS: /* Draw grouped-action channels using its group's color */ G.saction->flag ^= SACTION_NODRAWGCOLORS; break; + case ACTMENU_VIEW_PREVRANGESET: /* Set preview range */ + anim_previewrange_set(); + break; + case ACTMENU_VIEW_PREVRANGECLEAR: /* Clear preview range */ + anim_previewrange_clear(); + break; + case ACTMENU_VIEW_PREVRANGEAUTO: /* Auto preview-range length */ + action_previewrange_set(G.saction->action); + break; } allqueue(REDRAWVIEW3D, 0); } @@ -447,11 +459,30 @@ static uiBlock *action_viewmenu(void *arg_unused) "Play Back Animation|Alt A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_VIEW_PLAY3D, ""); + //uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, + // "Play Back Animation in 3D View|Alt Shift A", 0, yco-=20, + // menuwidth, 19, NULL, 0.0, 0.0, 1, + // ACTMENU_VIEW_PLAYALL, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, + menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Play Back Animation in 3D View|Alt Shift A", 0, yco-=20, + "Set Preview Range|Ctrl P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_PLAYALL, ""); - + ACTMENU_VIEW_PREVRANGESET, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, + "Clear Preview Range|Alt P", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 1, + ACTMENU_VIEW_PREVRANGECLEAR, ""); + + if (G.saction->action) { + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, + "Preview Range from Action Length|Ctrl Alt P", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 1, + ACTMENU_VIEW_PREVRANGEAUTO, ""); + } + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); diff --git a/source/blender/src/header_ipo.c b/source/blender/src/header_ipo.c index 54a3790574b..81d94725a90 100644 --- a/source/blender/src/header_ipo.c +++ b/source/blender/src/header_ipo.c @@ -745,6 +745,12 @@ static void do_ipo_viewmenu(void *arg, int event) case 12: G.sipo->flag ^= SIPO_LOCK_VIEW; break; + case 13: /* Set Preview Range */ + anim_previewrange_set(); + break; + case 14: /* Clear Preview Range */ + anim_previewrange_clear(); + break; } } @@ -775,10 +781,17 @@ static uiBlock *ipo_viewmenu(void *arg_unused) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Animation|Alt A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Animation in 3D View|Alt Shift A", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); + //uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Animation in 3D View|Alt Shift A", 0, yco-=20, + // menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Preview Range|Ctrl P", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Preview Range|Alt P", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 1, 14, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center on Current Frame|Shift C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, ""); diff --git a/source/blender/src/header_nla.c b/source/blender/src/header_nla.c index 41e7bc32365..ef4b79c0537 100644 --- a/source/blender/src/header_nla.c +++ b/source/blender/src/header_nla.c @@ -122,6 +122,12 @@ static void do_nla_viewmenu(void *arg, int event) case 7: /* Show timing in Frames or Seconds */ G.snla->flag ^= SNLA_DRAWTIME; break; + case 8: /* Set Preview Range */ + anim_previewrange_set(); + break; + case 9: /* Clear Preview Range */ + anim_previewrange_clear(); + break; } } @@ -154,7 +160,12 @@ static uiBlock *nla_viewmenu(void *arg_unused) uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation|Alt A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation in 3D View|Alt Shift A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + //uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation in 3D View|Alt Shift A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Preview Range|Ctrl P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Preview Range|Alt P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); diff --git a/source/blender/src/interface_draw.c b/source/blender/src/interface_draw.c index fdb5fea658c..83a3c12bae7 100644 --- a/source/blender/src/interface_draw.c +++ b/source/blender/src/interface_draw.c @@ -1839,7 +1839,7 @@ static void ui_draw_but_CHARTAB(uiBut *but) int err; strcpy(tmpStr, G.selfont->name); - BLI_convertstringcode(tmpStr, G.sce, 0); + BLI_convertstringcode(tmpStr, G.sce); err = FTF_SetFont((unsigned char *)tmpStr, 0, 14.0); } } diff --git a/source/blender/src/outliner.c b/source/blender/src/outliner.c index a887a6f1751..683b06aafc4 100644 --- a/source/blender/src/outliner.c +++ b/source/blender/src/outliner.c @@ -3539,7 +3539,7 @@ static void namebutton_cb(void *tep, void *oldnamep) if (te->idcode == ID_LI) { char expanded[FILE_MAXDIR + FILE_MAXFILE]; BLI_strncpy(expanded, ((Library *)tselem->id)->name, FILE_MAXDIR + FILE_MAXFILE); - BLI_convertstringcode(expanded, G.sce, G.scene->r.cfra); + BLI_convertstringcode(expanded, G.sce); if (!BLI_exists(expanded)) { error("This path does not exist, correct this before saving"); } diff --git a/source/blender/src/screendump.c b/source/blender/src/screendump.c index b5240a94241..e793c224fcb 100644 --- a/source/blender/src/screendump.c +++ b/source/blender/src/screendump.c @@ -69,7 +69,8 @@ void write_screendump(char *name) if(dumprect) { strcpy(G.ima, name); - BLI_convertstringcode(name, G.sce, G.scene->r.cfra); + BLI_convertstringcode(name, G.sce); + BLI_convertstringframe(name, G.scene->r.cfra); /* TODO - is this ever used? */ /* BKE_add_image_extension() checks for if extension was already set */ if(G.scene->r.scemode & R_EXTENSION) diff --git a/source/blender/src/seqaudio.c b/source/blender/src/seqaudio.c index 3e784019274..7c27f32c242 100644 --- a/source/blender/src/seqaudio.c +++ b/source/blender/src/seqaudio.c @@ -106,7 +106,7 @@ void makewavstring (char *string) if (string==0) return; strcpy(string, G.scene->r.pic); - BLI_convertstringcode(string, G.sce, G.scene->r.cfra); + BLI_convertstringcode(string, G.sce); BLI_make_existing_file(string); @@ -394,8 +394,7 @@ static void audio_fill_seq(Sequence * seq, void * mixdown, strncat(name, seq->strip->stripdata->name, FILE_MAXFILE-1); - BLI_convertstringcode(name, G.sce, - G.scene->r.cfra); + BLI_convertstringcode(name, G.sce); seq->hdaudio= sound_open_hdaudio(name); } diff --git a/source/blender/src/sequence.c b/source/blender/src/sequence.c index 22bedab6bee..b4d3a6c3ce2 100644 --- a/source/blender/src/sequence.c +++ b/source/blender/src/sequence.c @@ -429,7 +429,9 @@ void reload_sequence_new_file(Sequence * seq) strncpy(str, seq->strip->dir, FILE_MAXDIR-1); strncat(str, seq->strip->stripdata->name, FILE_MAXFILE-1); - BLI_convertstringcode(str, G.sce, G.scene->r.cfra); + BLI_convertstringcode(str, G.sce); + BLI_convertstringframe(str, G.scene->r.cfra); /* TODO - is this needed? */ + } if (seq->type == SEQ_IMAGE) { @@ -1068,7 +1070,9 @@ static int seq_proxy_get_fname(Sequence * seq, int cfra, char * name) G.scene->r.size); } - BLI_convertstringcode(name, G.sce, frameno); + BLI_convertstringcode(name, G.sce); + BLI_convertstringframe(name, frameno); + strcat(name, ".jpg"); @@ -1269,8 +1273,8 @@ static void make_cb_table_byte(float lift, float gain, float gamma, for (y = 0; y < 256; y++) { float v = 1.0 * y / 255; - v += lift; v *= gain; + v += lift; v = pow(v, gamma); v *= mul; if ( v > 1.0) { @@ -1290,8 +1294,8 @@ static void make_cb_table_float(float lift, float gain, float gamma, for (y = 0; y < 256; y++) { float v = (float) y * 1.0 / 255.0; - v += lift; v *= gain; + v += lift; v = pow(v, gamma); v *= mul; table[y] = v; @@ -1367,7 +1371,7 @@ static void color_balance_float_float(Sequence * seq, TStripElem* se, while (p < e) { int c; for (c = 0; c < 3; c++) { - p[c] = pow((p[c] + cb.lift[c]) * cb.gain[c], + p[c] = pow(p[c] * cb.gain[c] + cb.lift[c], cb.gamma[c]) * mul; } p += 4; @@ -1705,8 +1709,9 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra, StripElem * s_elem = give_stripelem(seq, cfra); strncpy(name, seq->strip->dir, FILE_MAXDIR-1); - strncat(name, s_elem->name, FILE_MAXFILE); - BLI_convertstringcode(name, G.sce, G.scene->r.cfra); + strncat(name, s_elem->name, FILE_MAXFILE-1); + BLI_convertstringcode(name, G.sce); + BLI_convertstringframe(name, G.scene->r.cfra); if (!build_proxy_run) { se->ibuf = seq_proxy_fetch(seq, cfra); } @@ -1735,7 +1740,8 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra, if(seq->anim==0) { strncpy(name, seq->strip->dir, FILE_MAXDIR-1); strncat(name, seq->strip->stripdata->name, FILE_MAXFILE-1); - BLI_convertstringcode(name, G.sce, G.scene->r.cfra); + BLI_convertstringcode(name, G.sce); + BLI_convertstringframe(name, G.scene->r.cfra); seq->anim = openanim(name, IB_rect); } diff --git a/source/blender/src/space.c b/source/blender/src/space.c index 72fb442fda0..41e539c3d1a 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -1005,6 +1005,8 @@ void BIF_undo_push(char *str) undo_push_armature(str); } else if(G.f & G_PARTICLEEDIT) { + if (U.undosteps == 0) return; + PE_undo_push(str); } else { diff --git a/source/blender/src/view.c b/source/blender/src/view.c index 8498917b54e..163a116371d 100644 --- a/source/blender/src/view.c +++ b/source/blender/src/view.c @@ -974,8 +974,10 @@ void viewmove(int mode) /* these limits are in toets.c too */ if(G.vd->dist<0.001*G.vd->grid) G.vd->dist= 0.001*G.vd->grid; if(G.vd->dist>10.0*G.vd->far) G.vd->dist=10.0*G.vd->far; + + if(G.vd->persp==V3D_ORTHO || G.vd->persp==V3D_CAMOB) preview3d_event= 0; } - if(G.vd->persp==V3D_ORTHO || G.vd->persp==V3D_CAMOB) preview3d_event= 0; + mvalo[0]= mval[0]; diff --git a/source/blender/src/writeimage.c b/source/blender/src/writeimage.c index d7e40dabd43..1ef32fc33e8 100644 --- a/source/blender/src/writeimage.c +++ b/source/blender/src/writeimage.c @@ -99,7 +99,8 @@ static void save_rendered_image_cb_real(char *name, int confirm) BKE_add_image_extension(name, G.scene->r.imtype); strcpy(str, name); - BLI_convertstringcode(str, G.sce, G.scene->r.cfra); + BLI_convertstringcode(str, G.sce); + BLI_convertstringframe(str, G.scene->r.cfra); /* TODO - is this even used? */ if (confirm) overwrite = saveover(str); diff --git a/source/blender/src/writemovie.c b/source/blender/src/writemovie.c index 83c3b64eabd..dea7fbd9ddb 100644 --- a/source/blender/src/writemovie.c +++ b/source/blender/src/writemovie.c @@ -97,7 +97,7 @@ static void make_movie_name(char *string) if (string==0) return; strcpy(string, G.scene->r.pic); - BLI_convertstringcode(string, G.sce, G.scene->r.cfra); + BLI_convertstringcode(string, G.sce); len= strlen(string); BLI_make_existing_file(string); diff --git a/source/blender/yafray/intern/export_File.cpp b/source/blender/yafray/intern/export_File.cpp index ac7d2703eb8..f8bbdad5f65 100644 --- a/source/blender/yafray/intern/export_File.cpp +++ b/source/blender/yafray/intern/export_File.cpp @@ -126,7 +126,7 @@ static void adjustPath(string &path) // if relative, expand to full path char cpath[MAXPATHLEN]; strcpy(cpath, path.c_str()); - BLI_convertstringcode(cpath, G.sce, 0); + BLI_convertstringcode(cpath, G.sce); path = cpath; #ifdef WIN32 // add drive char if not there diff --git a/source/blender/yafray/intern/export_Plugin.cpp b/source/blender/yafray/intern/export_Plugin.cpp index 361939df9c4..6ae4a31bf50 100644 --- a/source/blender/yafray/intern/export_Plugin.cpp +++ b/source/blender/yafray/intern/export_Plugin.cpp @@ -278,7 +278,7 @@ static void adjustPath(string &path) // if relative, expand to full path char cpath[MAXPATHLEN]; strcpy(cpath, path.c_str()); - BLI_convertstringcode(cpath, G.sce, 0); + BLI_convertstringcode(cpath, G.sce); path = cpath; #ifdef WIN32 // add drive char if not there diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index 200c04bbfd3..fa8409b123e 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -264,7 +264,7 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, if (exitstring != "") strcpy(basedpath, exitstring.Ptr()); - BLI_convertstringcode(basedpath, pathname, 0); + BLI_convertstringcode(basedpath, pathname); bfd = load_game_data(basedpath); // if it wasn't loaded, try it forced relative @@ -275,7 +275,7 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, strcpy(temppath, "//"); strcat(temppath, basedpath); - BLI_convertstringcode(temppath, pathname, 0); + BLI_convertstringcode(temppath, pathname); bfd = load_game_data(temppath); } diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp index 6b0df44cb16..a656c5e5523 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp @@ -91,6 +91,10 @@ int KX_BlenderRenderTools::ProcessLighting(int layer) { if (m_clientobject) { + if (layer == RAS_LIGHT_OBJECT_LAYER) + { + layer = static_cast(m_clientobject)->GetLayer(); + } if (applyLights(layer)) { EnableOpenGLLights(); diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 3e83ed20840..08e9e36c048 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1680,8 +1680,11 @@ static KX_GameObject *gameobject_from_blenderobject( break; } } - if (gameobj) + if (gameobj) + { gameobj->SetPhysicsEnvironment(kxscene->GetPhysicsEnvironment()); + gameobj->SetLayer(ob->lay); + } return gameobj; } diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index a575415ab05..6b594e2e70b 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -351,7 +351,7 @@ void BL_ConvertActuators(char* maggiename, else { /* but we need to convert the samplename into absolute pathname first */ - BLI_convertstringcode(soundact->sound->name, maggiename, 0); + BLI_convertstringcode(soundact->sound->name, maggiename); samplename = soundact->sound->name; /* and now we can load it */ diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index f8fc256b371..f13b1bcf4c9 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -163,6 +163,25 @@ bool SCA_KeyboardSensor::Evaluate(CValue* eventval) { m_val=(active)?1:0; result = true; + } else + { + if (active) + { + if (m_val == 0) + { + //see comment below + //m_val = 1; + //result = true; + ; + } + } else + { + if (m_val == 1) + { + m_val = 0; + result = true; + } + } } } @@ -178,6 +197,13 @@ bool SCA_KeyboardSensor::Evaluate(CValue* eventval) if (inevent.m_status == SCA_InputEvent::KX_NO_INPUTSTATUS) { + if (m_val == 1) + { + // this situation may occur after a scene suspend: the keyboard release + // event was not captured, produce now the event off + m_val = 0; + result = true; + } } else { if (inevent.m_status == SCA_InputEvent::KX_JUSTACTIVATED) @@ -190,6 +216,23 @@ bool SCA_KeyboardSensor::Evaluate(CValue* eventval) { m_val = 0; result = true; + } else + { + if (inevent.m_status == SCA_InputEvent::KX_ACTIVE) + { + if (m_val == 0) + { + //hmm, this abnormal situation may occur in the following cases: + //- the key was pressed while the scene was suspended + //- this is a new scene and the key is active from the start + //In the second case, it's dangerous to activate the sensor + //(think of a key to go to next scene) + //What we really need is a edge/level flag in the key sensor + //m_val = 1; + //result = true; + ; + } + } } } } diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.cpp b/source/gameengine/GameLogic/SCA_MouseSensor.cpp index a91cf3e0439..8810b7470ed 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.cpp +++ b/source/gameengine/GameLogic/SCA_MouseSensor.cpp @@ -158,6 +158,25 @@ bool SCA_MouseSensor::Evaluate(CValue* event) { m_val = 0; result = true; + } else + { + if (event.m_status == SCA_InputEvent::KX_ACTIVE) + { + if (m_val == 0) + { + //dangerous + //m_val = 1; + //result = true; + ; + } + } else + { + if (m_val == 1) + { + m_val = 0; + result = true; + } + } } } break; @@ -183,6 +202,13 @@ bool SCA_MouseSensor::Evaluate(CValue* event) { m_val = 0; result = true; + } else + { + if (m_val == 1) + { + m_val = 0; + result = true; + } } } break; diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp index a5b8d8aacdf..edda7657ef9 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp @@ -137,6 +137,10 @@ int GPC_RenderTools::ProcessLighting(int layer) { if (m_clientobject) { + if (layer == RAS_LIGHT_OBJECT_LAYER) + { + layer = static_cast(m_clientobject)->GetLayer(); + } if (applyLights(layer)) { EnableOpenGLLights(); diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index 1496f7c6ad3..8817bc98886 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -579,7 +579,7 @@ int main(int argc, char** argv) // base the actuator filename with respect // to the original file working directory strcpy(basedpath, exitstring.Ptr()); - BLI_convertstringcode(basedpath, pathname, 0); + BLI_convertstringcode(basedpath, pathname); bfd = load_game_data(basedpath); } diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index cfdcba8a5d6..44727588106 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -84,6 +84,7 @@ KX_BlenderMaterial::KX_BlenderMaterial( mScene(scene), mUserDefBlend(0), mModified(0), + mConstructed(false), mPass(0) { @@ -119,7 +120,9 @@ KX_BlenderMaterial::KX_BlenderMaterial( KX_BlenderMaterial::~KX_BlenderMaterial() { // cleanup work - OnExit(); + if (mConstructed) + // clean only if material was actually used + OnExit(); } @@ -138,6 +141,10 @@ unsigned int* KX_BlenderMaterial::GetMCol(void) const void KX_BlenderMaterial::OnConstruction() { + if (mConstructed) + // when material are reused between objects + return; + // for each unique material... int i; for(i=0; inum_enabled; i++) { @@ -148,19 +155,20 @@ void KX_BlenderMaterial::OnConstruction() } if(!mTextures[i].InitCubeMap(i, mMaterial->cubemap[i] ) ) spit("unable to initialize image("<matname<< ", image will not be available"); + mMaterial->matname<< ", image will not be available"); } else { if( mMaterial->img[i] ) { if( ! mTextures[i].InitFromImage(i, mMaterial->img[i], (mMaterial->flag[i] &MIPMAP)!=0 )) spit("unable to initialize image("<matname<< ", image will not be available"); + mMaterial->matname<< ", image will not be available"); } } } mBlendFunc[0] =0; mBlendFunc[1] =0; + mConstructed = true; } void KX_BlenderMaterial::OnExit() diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h index 2b1264154d0..b9d48199520 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.h +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h @@ -93,6 +93,7 @@ private: bool mUserDefBlend; unsigned int mBlendFunc[2]; bool mModified; + bool mConstructed; // if false, don't clean on exit void ActivatGLMaterials( RAS_IRasterizer* rasty )const; void ActivateTexGen( RAS_IRasterizer *ras ) const; diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index 4a61c37be06..e0cd5a3bc9e 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -1123,7 +1123,7 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, ci.m_inertiaFactor = shapeprops->m_inertia/0.4f;//defaults to 0.4, don't want to change behaviour ci.m_collisionFilterGroup = (isbulletdyna) ? short(CcdConstructionInfo::DefaultFilter) : short(CcdConstructionInfo::StaticFilter); ci.m_collisionFilterMask = (isbulletdyna) ? short(CcdConstructionInfo::AllFilter) : short(CcdConstructionInfo::AllFilter ^ CcdConstructionInfo::StaticFilter); - + ci.m_bRigid = objprop->m_dyna && objprop->m_angular_rigidbody; KX_BulletPhysicsController* physicscontroller = new KX_BulletPhysicsController(ci,isbulletdyna); //remember that we created a shape so that we can delete it when the scene is removed (bullet will not delete it) kxscene->AddShape(bm); @@ -1147,6 +1147,7 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, //{ // rbody->setCollisionFlags(rbody->getCollisionFlags() | btCollisionObject::CF_NO_CONTACT_RESPONSE); //} + if (objprop->m_dyna && !objprop->m_angular_rigidbody) { /* @@ -1161,8 +1162,10 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, */ //env->createConstraint(physicscontroller,0,PHY_ANGULAR_CONSTRAINT,0,0,0,0,0,1); - physicscontroller->GetRigidBody()->setAngularFactor(0.f); - + + //Now done directly in ci.m_bRigid so that it propagates to replica + //physicscontroller->GetRigidBody()->setAngularFactor(0.f); + ; } bool isActor = objprop->m_isactor; diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index cf621e04f99..4c6ba448ebf 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -74,6 +74,7 @@ KX_GameObject::KX_GameObject( ) : SCA_IObject(T), m_bDyna(false), + m_layer(0), m_bSuspendDynamics(false), m_bUseObjectColor(false), m_bVisible(true), @@ -228,7 +229,7 @@ void KX_GameObject::SetParent(KX_Scene *scene, KX_GameObject* obj) NodeSetLocalScale(scale1); NodeSetLocalPosition(MT_Point3(newpos[0],newpos[1],newpos[2])); - NodeSetLocalOrientation(NodeGetWorldOrientation()*invori); + NodeSetLocalOrientation(invori*NodeGetWorldOrientation()); NodeUpdateGS(0.f,true); // object will now be a child, it must be removed from the parent list CListValue* rootlist = scene->GetRootParentList(); @@ -479,6 +480,22 @@ KX_GameObject::SetVisible( m_bVisible = v; } +void +KX_GameObject::SetLayer( + int l + ) +{ + m_layer = l; +} + +int +KX_GameObject::GetLayer( + void + ) +{ + return m_layer; +} + // used by Python, and the actuatorshould _not_ be misused by the // scene! void diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 87775e81216..da0cd69e129 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -70,6 +70,7 @@ protected: KX_ClientObjectInfo* m_pClient_info; STR_String m_name; STR_String m_text; + int m_layer; std::vector m_meshes; bool m_bSuspendDynamics; @@ -571,6 +572,22 @@ public: bool b ); + /** + * Change the layer of the object (when it is added in another layer + * than the original layer) + */ + void + SetLayer( + int l + ); + + /** + * Get the object layer + */ + int + GetLayer( + void + ); /** * @section Logic bubbling methods. diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 54003284e03..e4054e07475 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -650,6 +650,8 @@ SCA_IObject* KX_Scene::AddReplicaObject(class CValue* originalobject, for (git = m_logicHierarchicalGameObjects.begin();!(git==m_logicHierarchicalGameObjects.end());++git) { (*git)->Relink(&m_map_gameobject_to_replica); + // add the object in the layer of the parent + (*git)->SetLayer(parentobj->GetLayer()); } // now replicate logic diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index d99b75482b9..e444c4c73be 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -137,6 +137,10 @@ void CcdPhysicsController::CreateRigidbody() m_body->setGravity( m_cci.m_gravity); m_body->setDamping(m_cci.m_linearDamping, m_cci.m_angularDamping); + if (!m_cci.m_bRigid) + { + m_body->setAngularFactor(0.f); + } } CcdPhysicsController::~CcdPhysicsController() diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h index 54b4bcc40ee..37fa465351f 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h @@ -60,6 +60,7 @@ struct CcdConstructionInfo m_linearDamping(0.1f), m_angularDamping(0.1f), m_collisionFlags(0), + m_bRigid(false), m_collisionFilterGroup(DefaultFilter), m_collisionFilterMask(AllFilter), m_collisionShape(0), @@ -78,6 +79,7 @@ struct CcdConstructionInfo btScalar m_linearDamping; btScalar m_angularDamping; int m_collisionFlags; + bool m_bRigid; ///optional use of collision group/mask: ///only collision with object goups that match the collision mask. diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.cpp b/source/gameengine/Rasterizer/RAS_BucketManager.cpp index 6c3e89fa69d..50df1a1e2ea 100644 --- a/source/gameengine/Rasterizer/RAS_BucketManager.cpp +++ b/source/gameengine/Rasterizer/RAS_BucketManager.cpp @@ -113,6 +113,7 @@ void RAS_BucketManager::RenderAlphaBuckets( std::multiset< alphamesh, backtofront>::iterator msit = alphameshset.begin(); for (; msit != alphameshset.end(); ++msit) { + rendertools->SetClientObject((*(*msit).m_ms).m_clientObj); while ((*msit).m_bucket->ActivateMaterial(cameratrans, rasty, rendertools, drawingmode)) (*msit).m_bucket->RenderMeshSlot(cameratrans, rasty, rendertools, *(*msit).m_ms, drawingmode); } diff --git a/source/gameengine/Rasterizer/RAS_IRenderTools.h b/source/gameengine/Rasterizer/RAS_IRenderTools.h index 30c96d02847..16e15653c82 100644 --- a/source/gameengine/Rasterizer/RAS_IRenderTools.h +++ b/source/gameengine/Rasterizer/RAS_IRenderTools.h @@ -61,6 +61,10 @@ public: RAS_TEXT_PADDED, RAS_TEXT_MAX }; + enum RAS_LIGHT_MODE { + RAS_LIGHT_NONE = -1, + RAS_LIGHT_OBJECT_LAYER = 0 + }; RAS_IRenderTools( ) : diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp index 4642ffbaeb8..02e84f8a243 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp @@ -189,7 +189,7 @@ bool RAS_MaterialBucket::ActivateMaterial(const MT_Transform& cameratrans, RAS_I } else { - rendertools->ProcessLighting(m_material->GetLightLayer()); + rendertools->ProcessLighting(RAS_IRenderTools::RAS_LIGHT_OBJECT_LAYER/*m_material->GetLightLayer()*/); } drawmode = (rasty->GetDrawingMode() < RAS_IRasterizer::KX_SOLID ? @@ -204,7 +204,6 @@ void RAS_MaterialBucket::RenderMeshSlot(const MT_Transform& cameratrans, RAS_IRa if (!ms.m_bVisible) return; - rendertools->SetClientObject(ms.m_clientObj); m_material->ActivateMeshSlot(ms, rasty); /* __NLA Do the deformation */ @@ -317,15 +316,12 @@ void RAS_MaterialBucket::Render(const MT_Transform& cameratrans, //rasty->SetMaterial(*m_material); - if (m_meshSlots.size() >0) - { - rendertools->SetClientObject((*m_meshSlots.begin()).m_clientObj); - } int drawmode; for (T_MeshSlotList::const_iterator it = m_meshSlots.begin(); ! (it == m_meshSlots.end()); ++it) { + rendertools->SetClientObject((*it).m_clientObj); while (ActivateMaterial(cameratrans, rasty, rendertools, drawmode)) RenderMeshSlot(cameratrans, rasty, rendertools, *it, drawmode); } From 50acbe29d1c486b3f7fe1fb31b7be0963e7f7748 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Wed, 7 May 2008 12:45:02 +0000 Subject: [PATCH 10/76] Normal projection: +added option to remove faces where all vertices got unprojected Nearest surface point +15% faster closest point on point-tri function (archived by projecting the point on tri-plane and solving the problem on 2D) (its still using bruteforce on triangles.. I'll add the right data structure later) --- source/blender/blenkernel/BKE_shrinkwrap.h | 17 +- source/blender/blenkernel/intern/shrinkwrap.c | 327 +++++++++++++++--- source/blender/makesdna/DNA_modifier_types.h | 1 + source/blender/src/buttons_editing.c | 3 +- 4 files changed, 289 insertions(+), 59 deletions(-) diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h index 03c3f897dd4..babdcd78261 100644 --- a/source/blender/blenkernel/BKE_shrinkwrap.h +++ b/source/blender/blenkernel/BKE_shrinkwrap.h @@ -1,5 +1,5 @@ /** - * shrinkwrap.c + * BKE_shrinkwrap.h * * ***** BEGIN GPL LICENSE BLOCK ***** * @@ -29,11 +29,24 @@ #ifndef BKE_SHRINKWRAP_H #define BKE_SHRINKWRAP_H +/* bitset stuff */ +//TODO: should move this to other generic lib files? +typedef char* BitSet; +#define bitset_memsize(size) (sizeof(char)*((size+7)>>3)) + +#define bitset_new(size,name) ((BitSet)MEM_callocN( bitset_memsize(size) , name)) +#define bitset_free(set) (MEM_freeN((void*)set)) + +#define bitset_get(set,index) ((set)[(index)>>3] & (1 << ((index)&0x7))) +#define bitset_set(set,index) ((set)[(index)>>3] |= (1 << ((index)&0x7))) + + struct Object; struct DerivedMesh; struct ShrinkwrapModifierData; + typedef struct ShrinkwrapCalcData { ShrinkwrapModifierData *smd; //shrinkwrap modifier data @@ -50,7 +63,7 @@ typedef struct ShrinkwrapCalcData float keptDist; //Distance to kept from target (units are in local space) //float *weights; //weights of vertexs - unsigned char *moved; //boolean indicating if vertex has moved (TODO use bitmaps) + BitSet moved; //BitSet indicating if vertex has moved } ShrinkwrapCalcData; diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 122256aef6f..5337a932e79 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -22,7 +22,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): André Pinto * * ***** END GPL LICENSE BLOCK ***** */ @@ -49,7 +49,10 @@ #include "BLI_kdtree.h" #include "RE_raytrace.h" +#include "MEM_guardedalloc.h" + +/* Util macros */ #define TO_STR(a) #a #define JOIN(a,b) a##b @@ -82,7 +85,6 @@ #endif -#define CONST typedef void ( *Shrinkwrap_ForeachVertexCallback) (DerivedMesh *target, float *co, float *normal); @@ -189,7 +191,7 @@ static RayTree* raytree_create_from_mesh(DerivedMesh *mesh) //Theres some nasty thing with non-coplanar quads (that I can't find the issue) //so we split quads (an odd numbered face represents the second triangle of the quad) if(face[i-1].v4) - RE_ray_tree_add_face(tree, 0, i*2+1); + RE_ray_tree_add_face(tree, 0, (RayFace*)(i*2+1)); } RE_ray_tree_done(tree); @@ -228,7 +230,7 @@ static float raytree_cast_ray(RayTree *tree, const float *coord, const float *di isec.labda = ABS(isec.labda); VECADDFAC(isec.end, isec.start, isec.vec, isec.labda); - return VecLenf(coord, isec.end); + return VecLenf((float*)coord, (float*)isec.end); } /* @@ -239,7 +241,7 @@ static float raytree_cast_ray(RayTree *tree, const float *coord, const float *di * * Returns FLT_MIN in parallel case */ -static float ray_intersect_plane(CONST float *point, CONST float *dir, CONST float *plane_point, CONST float *plane_normal) +static float ray_intersect_plane(const float *point, const float *dir, const float *plane_point, const float *plane_normal) { float pp[3]; float a, pp_dist; @@ -248,62 +250,171 @@ static float ray_intersect_plane(CONST float *point, CONST float *dir, CONST flo if(fabs(a) < 1e-5f) return FLT_MIN; - VecSubf(pp, point, plane_point); + VECSUB(pp, point, plane_point); pp_dist = INPR(pp, plane_normal); return -pp_dist/a; } /* - * Returns the minimum distance between the point and a triangle surface - * Writes the nearest surface point in the given nearest + * This calculates the distance from point to the plane + * Distance is negative if point is on the back side of plane */ -static float nearest_point_in_tri_surface(CONST float *co, CONST float *v0, CONST float *v1, CONST float *v2, float *nearest) +static float point_plane_distance(const float *point, const float *plane_point, const float *plane_normal) { - //TODO: make this efficient (probably this can be made with something like 3 point_in_slice()) - if(point_in_tri_prism(co, v0, v1, v2)) + float pp[3]; + VECSUB(pp, point, plane_point); + return INPR(pp, plane_normal); +} +static float choose_nearest(const float v0[2], const float v1[2], const float point[2], float closest[2]) +{ + float d[2][2], sdist[2]; + VECSUB2D(d[0], v0, point); + VECSUB2D(d[1], v1, point); + + sdist[0] = d[0][0]*d[0][0] + d[0][1]*d[0][1]; + sdist[1] = d[1][0]*d[1][0] + d[1][1]*d[1][1]; + + if(sdist[0] < sdist[1]) { - float normal[3]; - float dist; - - CalcNormFloat(v0, v1, v2, normal); - dist = ray_intersect_plane(co, normal, v0, normal); - - VECADDFAC(nearest, co, normal, dist); - return fabs(dist); + if(closest) + VECCOPY2D(closest, v0); + return sdist[0]; } else { - float dist = FLT_MAX, tdist; - float closest[3]; - - PclosestVL3Dfl(closest, co, v0, v1); - tdist = VecLenf(co, closest); - if(tdist < dist) - { - dist = tdist; - VECCOPY(nearest, closest); - } - - PclosestVL3Dfl(closest, co, v1, v2); - tdist = VecLenf(co, closest); - if(tdist < dist) - { - dist = tdist; - VECCOPY(nearest, closest); - } - - PclosestVL3Dfl(closest, co, v2, v0); - tdist = VecLenf(co, closest); - if(tdist < dist) - { - dist = tdist; - VECCOPY(nearest, closest); - } - - return dist; + if(closest) + VECCOPY2D(closest, v1); + return sdist[1]; } } +/* + * calculates the closest point between point-tri (2D) + * returns that tri must be right-handed + * Returns square distance + */ +static float closest_point_in_tri2D(const float point[2], const float tri[3][2], float closest[2]) +{ + float edge_di[2]; + float v_point[2]; + float proj[2]; //point projected over edge-dir, edge-normal (witouth normalized edge) + const float *v0 = tri[2], *v1; + float edge_slen, d; //edge squared length + int i; + const float *nearest_vertex = NULL; + + + //for each edge + for(i=0, v0=tri[2], v1=tri[0]; i < 3; v0=tri[i++], v1=tri[i]) + { + VECSUB2D(edge_di, v1, v0); + VECSUB2D(v_point, point, v0); + + proj[1] = v_point[0]*edge_di[1] - v_point[1]*edge_di[0]; //dot product with edge normal + + //point inside this edge + if(proj[1] < 0) + continue; + + proj[0] = v_point[0]*edge_di[0] + v_point[1]*edge_di[1]; + + //closest to this edge is v0 + if(proj[0] < 0) + { + if(nearest_vertex == NULL || nearest_vertex == v0) + nearest_vertex = v0; + else + { + //choose nearest + return choose_nearest(nearest_vertex, v0, point, closest); + } + i++; //We can skip next edge + continue; + } + + edge_slen = edge_di[0]*edge_di[0] + edge_di[1]*edge_di[1]; //squared edge len + //closest to this edge is v1 + if(proj[0] > edge_slen) + { + if(nearest_vertex == NULL || nearest_vertex == v1) + nearest_vertex = v1; + else + { + return choose_nearest(nearest_vertex, v1, point, closest); + } + continue; + } + + //nearest is on this edge + d= proj[1] / edge_slen; + closest[0] = point[0] - edge_di[1] * d; + closest[1] = point[1] + edge_di[0] * d; + + return proj[1]*proj[1]/edge_slen; + } + + if(nearest_vertex) + { + VECSUB2D(v_point, nearest_vertex, point); + VECCOPY2D(closest, nearest_vertex); + return v_point[0]*v_point[0] + v_point[1]*v_point[1]; + } + else + { + VECCOPY(closest, point); //point is already inside + return 0.0f; + } +} + +/* + * Returns the square of the minimum distance between the point and a triangle surface + * If nearest is not NULL the nearest surface point is written on it + */ +static float nearest_point_in_tri_surface(const float *point, const float *v0, const float *v1, const float *v2, float *nearest) +{ + //Lets solve the 2D problem (closest point-tri) + float normal_dist, plane_sdist, plane_offset; + float du[3], dv[3], dw[3]; //orthogonal axis (du=(v0->v1), dw=plane normal) + + float p_2d[2], tri_2d[3][2], nearest_2d[2]; + + CalcNormFloat((float*)v0, (float*)v1, (float*)v2, dw); + + //point-plane distance and calculate axis + normal_dist = point_plane_distance(point, v0, dw); + + VECSUB(du, v1, v0); + Normalize(du); + Crossf(dv, dw, du); + plane_offset = INPR(v0, dw); + + //project stuff to 2d + tri_2d[0][0] = INPR(du, v0); + tri_2d[0][1] = INPR(dv, v0); + + tri_2d[1][0] = INPR(du, v1); + tri_2d[1][1] = INPR(dv, v1); + + tri_2d[2][0] = INPR(du, v2); + tri_2d[2][1] = INPR(dv, v2); + + p_2d[0] = INPR(du, point); + p_2d[1] = INPR(dv, point); + + //we always have a right-handed tri + //this should always happen because of the way normal is calculated + plane_sdist = closest_point_in_tri2D(p_2d, tri_2d, nearest_2d); + + //project back to 3d + if(nearest) + { + nearest[0] = du[0]*nearest_2d[0] + dv[0] * nearest_2d[1] + dw[0] * plane_offset; + nearest[1] = du[1]*nearest_2d[0] + dv[1] * nearest_2d[1] + dw[1] * plane_offset; + nearest[2] = du[2]*nearest_2d[0] + dv[2] * nearest_2d[1] + dw[2] * plane_offset; + } + + return sasqrt(plane_sdist + normal_dist*normal_dist); +} @@ -321,7 +432,7 @@ static void bruteforce_shrinkwrap_calc_nearest_surface_point(DerivedMesh *target MVert *vert = target->getVertDataArray(target, CD_MVERT); MFace *face = target->getFaceDataArray(target, CD_MFACE); - VECCOPY(orig_co, co); + VECCOPY(orig_co, co); for (i = 0; i < numFaces; i++) { @@ -476,6 +587,112 @@ static void shrinkwrap_calc_foreach_vertex(ShrinkwrapCalcData *calc, Shrinkwrap_ } } + +/* + * This function removes Unused faces, vertexs and edges from calc->target + * + * This function may modify calc->final. As so no data retrieved from + * it before the call to this function can be considered valid + * In case it creates a new DerivedMesh, the old calc->final is freed + */ +//TODO memory checks on allocs +static void shrinkwrap_removeUnused(ShrinkwrapCalcData *calc) +{ + int i, t; + + DerivedMesh *old = calc->final, *new = NULL; + MFace *new_face = NULL; + MVert *new_vert = NULL; + + int numVerts= old->getNumVerts(old); + MVert *vert = old->getVertDataArray(old, CD_MVERT); + + int numFaces= old->getNumFaces(old); + MFace *face = old->getFaceDataArray(old, CD_MFACE); + + BitSet moved_verts = calc->moved; + + //Arrays to translate to new vertexs indexs + int *vert_index = (int*)MEM_callocN(sizeof(int)*(numVerts), "shrinkwrap used verts"); + BitSet used_faces = bitset_new(numFaces, "shrinkwrap used faces"); + int numUsedFaces = 0; + + //calc real number of faces, and vertices + //Count used faces + for(i=0; igetVertDataArray(new, CD_MVERT); + for(i=0, t=0; igetFaceDataArray(new, CD_MFACE); + for(i=0, t=0; iv1 = vert_index[new_face->v1]-1; + new_face->v2 = vert_index[new_face->v2]-1; + new_face->v3 = vert_index[new_face->v3]-1; + if(new_face->v4) + { + new_face->v4 = vert_index[new_face->v4]-1; + + //Ups translated vertex ended on 0 .. TODO fix this + if(new_face->v4 == 0) + { + } + } + new_face++; + } + } + + //Free memory + bitset_free(used_faces); + MEM_freeN(vert_index); + old->release(old); + + //Update edges + CDDM_calc_edges(new); + CDDM_calc_normals(new); + + calc->final = new; +} + /* Main shrinkwrap function */ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, DerivedMesh *dm, int useRenderParams, int isFinalCalc) { @@ -514,9 +731,6 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri calc.keptDist = smd->keptDist; //TODO: smd->keptDist is in global units.. must change to local } - calc.moved = NULL; - - //Projecting target defined - lets work! if(calc.target) { @@ -547,7 +761,8 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri //Destroy faces, edges and stuff if(calc.moved) { - //TODO + shrinkwrap_removeUnused(&calc); + bitset_free(calc.moved); } CDDM_calc_normals(calc.final); @@ -621,9 +836,6 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) dist = VecLenf(vert[i].co, tmp_co); if(dist > 1e-5) weight *= (dist - calc->keptDist)/dist; VecLerpf(vert[i].co, vert[i].co, nearest.co, weight); //linear interpolation - - if(calc->moved) - calc->moved[i] = TRUE; } } @@ -668,6 +880,9 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) vert = calc->final->getVertDataArray(calc->final, CD_MVERT); dvert = calc->final->getVertDataArray(calc->final, CD_MDEFORMVERT); + if(calc->smd->shrinkOpts & MOD_SHRINKWRAP_REMOVE_UNPROJECTED_FACES) + calc->moved = bitset_new(numVerts, "shrinkwrap bitset data"); + for(i=0; imoved) - calc->moved[i] = TRUE; + bitset_set(calc->moved, i); } } diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 2a38358c383..5178022ffad 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -507,5 +507,6 @@ typedef struct ShrinkwrapModifierData { /* Shrinkwrap->shrinkOpts */ #define MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL (1<<0) #define MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL (1<<1) +#define MOD_SHRINKWRAP_REMOVE_UNPROJECTED_FACES (1<<2) #endif diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 47a2c6d613d..68712da0b61 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -1824,7 +1824,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; height = 86; if (smd->shrinkType == MOD_SHRINKWRAP_NORMAL) - height += 19*2; + height += 19*3; } /* roundbox 4 free variables: corner-rounding, nop, roundbox type, shade */ uiDefBut(block, ROUNDBOX, 0, "", x-10, y-height-2, width, height-2, NULL, 5.0, 0.0, 12, 40, ""); @@ -2446,6 +2446,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco if (smd->shrinkType == MOD_SHRINKWRAP_NORMAL){ uiDefButBitS(block, TOG, MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL, B_MODIFIER_RECALC, "Default normal", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Allows vertices to move in the normal direction"); uiDefButBitS(block, TOG, MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL, B_MODIFIER_RECALC, "Invert normal", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Allows vertices to move in the inverse direction of their normal"); + uiDefButBitS(block, TOG, MOD_SHRINKWRAP_REMOVE_UNPROJECTED_FACES, B_MODIFIER_RECALC, "Remove faces", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Remove faces where all vertices haven't been projected"); } but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &smd->vgroup_name, 0.0, 31.0, 0, 0, "Vertex Group name"); From 859a05864cb1c16130175bc304ed1beb1589eb4e Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Wed, 14 May 2008 18:25:23 +0000 Subject: [PATCH 11/76] I'm considering using bvhtree for shrinkwrap but the build was considerable slower than kdtree as so i've made some improvements So basicly theres no shrinkwrap improvements for now... --- source/blender/blenkernel/intern/shrinkwrap.c | 65 +- source/blender/blenlib/BLI_kdopbvh.h | 63 ++ source/blender/blenlib/intern/BLI_kdopbvh.c | 725 ++++++++++++++++++ 3 files changed, 833 insertions(+), 20 deletions(-) create mode 100644 source/blender/blenlib/BLI_kdopbvh.h create mode 100644 source/blender/blenlib/intern/BLI_kdopbvh.c diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index d2da0cce4e3..dca210afb27 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -47,6 +47,7 @@ #include "BLI_arithb.h" #include "BLI_kdtree.h" +#include "BLI_kdopbvh.h" #include "RE_raytrace.h" #include "MEM_guardedalloc.h" @@ -785,29 +786,45 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) KDTreeNearest nearest; float tmp_co[3]; + BVHTree *tree = NULL; + BENCH_VAR(build); BENCH_VAR(query); int numVerts; - MVert *vert = NULL; + MVert *vert = NULL, *tvert = NULL; MDeformVert *dvert = NULL; - //Generate kd-tree with target vertexs + numVerts= calc->target->getNumVerts(calc->target); + vert = tvert = calc->target->getVertDataArray(calc->target, CD_MVERT); + + BENCH_RESET(build); BENCH_BEGIN(build); - target = BLI_kdtree_new(calc->target->getNumVerts(calc->target)); + tree = BLI_bvhtree_new(numVerts, 0, 8, 6); + if(tree == NULL) return OUT_OF_MEMORY(); + + for(i = 0; i < numVerts; i++) + BLI_bvhtree_insert(tree, i, vert[i].co, 1); + BLI_bvhtree_balance(tree); + BENCH_END(build); + BENCH_REPORT(build); + + + //Generate kd-tree with target vertexs + BENCH_RESET(build); + BENCH_BEGIN(build); + + target = BLI_kdtree_new(numVerts); if(target == NULL) return OUT_OF_MEMORY(); - numVerts= calc->target->getNumVerts(calc->target); - vert = calc->target->getVertDataArray(calc->target, CD_MVERT); - - - for( ;numVerts--; vert++) - BLI_kdtree_insert(target, 0, vert->co, NULL); + for(i = 0; i < numVerts; i++) + BLI_kdtree_insert(target, 0, vert[i].co, NULL); BLI_kdtree_balance(target); BENCH_END(build); + BENCH_REPORT(build); //Find the nearest vertex @@ -815,17 +832,27 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) vert = calc->final->getVertDataArray(calc->final, CD_MVERT); dvert = calc->final->getVertDataArray(calc->final, CD_MDEFORMVERT); + BENCH_BEGIN(query); for(i=0; ilocal2target, vert[i].co); +/* VecMat4MulVecfl(tmp_co, calc->local2target, vert[i].co); - BENCH_BEGIN(query); + index = BLI_bvhtree_find_nearest(tree, tmp_co); + if(index != -1) + { + float dist; + VecMat4MulVecfl(tmp_co, calc->target2local, tvert[index].co); + dist = VecLenf(vert[i].co, tmp_co); + if(dist > 1e-5) weight *= (dist - calc->keptDist)/dist; + VecLerpf(vert[i].co, vert[i].co, nearest.co, weight); //linear interpolation + } + + */ t = BLI_kdtree_find_nearest(target, tmp_co, 0, &nearest); - BENCH_END(query); if(t != -1) { @@ -836,15 +863,13 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) if(dist > 1e-5) weight *= (dist - calc->keptDist)/dist; VecLerpf(vert[i].co, vert[i].co, nearest.co, weight); //linear interpolation } + } - - BENCH_BEGIN(build); - BLI_kdtree_free(target); - BENCH_END(build); - - - BENCH_REPORT(build); + BENCH_END(query); BENCH_REPORT(query); + + BLI_kdtree_free(target); + BLI_bvhtree_free(tree); } /* diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h new file mode 100644 index 00000000000..c1240da6c3a --- /dev/null +++ b/source/blender/blenlib/BLI_kdopbvh.h @@ -0,0 +1,63 @@ +/** + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2006 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Daniel Genrich, Andre Pinto + * + * ***** END GPL LICENSE BLOCK ***** + */ + + +#ifndef BLI_KDOPBVH_H +#define BLI_KDOPBVH_H + +#include + +struct BVHTree; +typedef struct BVHTree BVHTree; + +typedef struct BVHTreeOverlap { + int indexA; + int indexB; +} BVHTreeOverlap; + +BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis); +void BLI_bvhtree_free(BVHTree *tree); + +/* construct: first insert points, then call balance */ +int BLI_bvhtree_insert(BVHTree *tree, int index, float *co, int numpoints); +void BLI_bvhtree_balance(BVHTree *tree); + +/* update: first update points/nodes, then call update_tree to refit the bounding volumes */ +int BLI_bvhtree_update_node(BVHTree *tree, int index, float *co, float *co_moving, int numpoints); +void BLI_bvhtree_update_tree(BVHTree *tree); + +/* collision/overlap: check two trees if they overlap, alloc's *overlap with length of the int return value */ +BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, int *result); + +float BLI_bvhtree_getepsilon(BVHTree *tree); + +#endif // BLI_KDOPBVH_H + + + + diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c new file mode 100644 index 00000000000..6a16efc060f --- /dev/null +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -0,0 +1,725 @@ +/* kdop.c +* +* +* ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. The Blender +* Foundation also sells licenses for use in proprietary software under +* the Blender License. See http://www.blender.org/BL/ for information +* about this. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +* +* The Original Code is Copyright (C) Blender Foundation +* All rights reserved. +* +* The Original Code is: all of this file. +* +* Contributor(s): Daniel Genrich, Andre Pinto +* +* ***** END GPL/BL DUAL LICENSE BLOCK ***** +*/ + +#include "math.h" +#include +#include +#include + +#include "MEM_guardedalloc.h" + +#include "BKE_utildefines.h" + +#include "BLI_kdopbvh.h" +#include "BLI_arithb.h" + +#ifdef _OPENMP +#include +#endif + +#define node_get_bv(tree, node) ((node)->bv) +#define node_get_child(tree,node,i) ((node)->children[i]) + +typedef struct BVHNode +{ + struct BVHNode **children;// max 8 children + struct BVHNode *parent; // needed for bottom - top update + float *bv; // Bounding volume of all nodes, max 13 axis + int index; // face, edge, vertex index + char totnode; // how many nodes are used, used for speedup + char traversed; // how many nodes already traversed until this level? + char main_axis; // axis that was used to split childs +} BVHNode; + +struct BVHTree +{ + BVHNode **nodes; + float *nodebv; // pre-alloc bounding-volumes for nodes + BVHNode **nodechild; // pre-alloc childs for nodes + BVHNode *nodearray; // pre-alloc branchs + float epsilon; // epslion is used for inflation of the k-dop + int totleaf; // leafs + int totbranch; + char tree_type; // type of tree (4 => quadtree) + char axis; // kdop type (6 => OBB, 7 => AABB, ...) + char start_axis, stop_axis; // KDOP_AXES array indices according to axis +}; + +typedef struct BVHOverlapData +{ + BVHTree *tree1, *tree2; + BVHTreeOverlap *overlap; + int i, max_overlap; /* i is number of overlaps */ +} BVHOverlapData; +//////////////////////////////////////// + + +//////////////////////////////////////////////////////////////////////// +// Bounding Volume Hierarchy Definition +// +// Notes: From OBB until 26-DOP --> all bounding volumes possible, just choose type below +// Notes: You have to choose the type at compile time ITM +// Notes: You can choose the tree type --> binary, quad, octree, choose below +//////////////////////////////////////////////////////////////////////// + +static float KDOP_AXES[13][3] = +{ {1.0, 0, 0}, {0, 1.0, 0}, {0, 0, 1.0}, {1.0, 1.0, 1.0}, {1.0, -1.0, 1.0}, {1.0, 1.0, -1.0}, +{1.0, -1.0, -1.0}, {1.0, 1.0, 0}, {1.0, 0, 1.0}, {0, 1.0, 1.0}, {1.0, -1.0, 0}, {1.0, 0, -1.0}, +{0, 1.0, -1.0} +}; + +////////////////////////////////////////////////////////////////////////////////////////////////////// +// Introsort +// with permission deriven from the following Java code: +// http://ralphunden.net/content/tutorials/a-guide-to-introsort/ +// and he derived it from the SUN STL +////////////////////////////////////////////////////////////////////////////////////////////////////// + +static int bvh_partition(BVHNode **a, int lo, int hi, BVHNode * x, int axis) +{ + int i=lo, j=hi; + while (1) + { + while ((a[i])->bv[axis] < x->bv[axis]) i++; + j--; + while (x->bv[axis] < (a[j])->bv[axis]) j--; + if(!(i < j)) + return i; + SWAP( BVHNode* , a[i], a[j]); + i++; + } +} + +static BVHNode *bvh_medianof3(BVHNode **a, int lo, int mid, int hi, int axis) // returns Sortable +{ + if ((a[mid])->bv[axis] < (a[lo])->bv[axis]) + { + if ((a[hi])->bv[axis] < (a[mid])->bv[axis]) + return a[mid]; + else + { + if ((a[hi])->bv[axis] < (a[lo])->bv[axis]) + return a[hi]; + else + return a[lo]; + } + } + else + { + if ((a[hi])->bv[axis] < (a[mid])->bv[axis]) + { + if ((a[hi])->bv[axis] < (a[lo])->bv[axis]) + return a[lo]; + else + return a[hi]; + } + else + return a[mid]; + } +} + +//after a call to this function you can expect one of: +// every node to left of a[n] are smaller than it +// every node to the right of a[n-1] are greater than it +void partition_nth_element(BVHNode **a, int _begin, int _end, int n, int axis) +{ + int begin = _begin, end = _end; + while(begin < n && end >= n) + { + int mid = bvh_partition(a, begin, end, bvh_medianof3(a, begin, (begin+end-1)/2, end-1, axis), axis ); + + if(mid >= n) + end = n-1; + else + begin = n+1; + } + +} + +////////////////////////////////////////////////////////////////////////////////////////////////////// + +void BLI_bvhtree_free(BVHTree *tree) +{ + if(tree) + { + MEM_freeN(tree->nodes); + MEM_freeN(tree->nodearray); + MEM_freeN(tree->nodebv); + MEM_freeN(tree->nodechild); + MEM_freeN(tree); + } +} + +BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis) +{ + BVHTree *tree; + int numbranches=0, i; + + // only support up to octree + if(tree_type > 8) + return NULL; + + tree = (BVHTree *)MEM_callocN(sizeof(BVHTree), "BVHTree"); + + if(tree) + { + tree->epsilon = epsilon; + tree->tree_type = tree_type; + tree->axis = axis; + + if(axis == 26) + { + tree->start_axis = 0; + tree->stop_axis = 13; + } + else if(axis == 18) + { + tree->start_axis = 7; + tree->stop_axis = 13; + } + else if(axis == 14) + { + tree->start_axis = 0; + tree->stop_axis = 7; + } + else if(axis == 8) // AABB + { + tree->start_axis = 0; + tree->stop_axis = 4; + } + else if(axis == 6) // OBB + { + tree->start_axis = 0; + tree->stop_axis = 3; + } + else + { + MEM_freeN(tree); + return NULL; + } + + + // calculate max number of branches, our bvh kdop is "almost perfect" + for(i = 1; i <= (int)ceil((float)((float)log(maxsize)/(float)log(tree_type))); i++) + numbranches += (pow(tree_type, i) / tree_type); + + tree->nodes = (BVHNode **)MEM_callocN(sizeof(BVHNode *)*(numbranches+maxsize + tree_type), "BVHNodes"); + + if(!tree->nodes) + { + MEM_freeN(tree); + return NULL; + } + + tree->nodebv = (float*)MEM_callocN(sizeof(float)* axis * (numbranches+maxsize + tree_type), "BVHNodeBV"); + if(!tree->nodebv) + { + MEM_freeN(tree->nodes); + MEM_freeN(tree); + } + + tree->nodechild = (BVHNode**)MEM_callocN(sizeof(BVHNode*) * tree_type * (numbranches+maxsize + tree_type), "BVHNodeBV"); + if(!tree->nodechild) + { + MEM_freeN(tree->nodebv); + MEM_freeN(tree->nodes); + MEM_freeN(tree); + } + + tree->nodearray = (BVHNode *)MEM_callocN(sizeof(BVHNode)*(numbranches+maxsize + tree_type), "BVHNodeArray"); + + if(!tree->nodearray) + { + MEM_freeN(tree->nodechild); + MEM_freeN(tree->nodebv); + MEM_freeN(tree->nodes); + MEM_freeN(tree); + return NULL; + } + + //link the dynamic bv and child links + for(i=0; i< numbranches+maxsize + tree_type; i++) + { + tree->nodearray[i].bv = tree->nodebv + i * axis; + tree->nodearray[i].children = tree->nodechild + i * tree_type; + } + + } + + return tree; +} + +static void create_kdop_hull(BVHTree *tree, BVHNode *node, float *co, int numpoints, int moving) +{ + float newminmax; + float *bv = node_get_bv(tree, node); + int i, k; + + // don't init boudings for the moving case + if(!moving) + { + for (i = tree->start_axis; i < tree->stop_axis; i++) + { + bv[2*i] = FLT_MAX; + bv[2*i + 1] = -FLT_MAX; + } + } + + for(k = 0; k < numpoints; k++) + { + // for all Axes. + for (i = tree->start_axis; i < tree->stop_axis; i++) + { + newminmax = INPR(&co[k * 3], KDOP_AXES[i]); + if (newminmax < bv[2 * i]) + bv[2 * i] = newminmax; + if (newminmax > bv[(2 * i) + 1]) + bv[(2 * i) + 1] = newminmax; + } + } +} + +// depends on the fact that the BVH's for each face is already build +static void refit_kdop_hull(BVHTree *tree, BVHNode *node, int start, int end) +{ + float newmin,newmax; + int i, j; + float *bv = node_get_bv(tree, node); + + for (i = tree->start_axis; i < tree->stop_axis; i++) + { + bv[2*i] = FLT_MAX; + bv[2*i + 1] = -FLT_MAX; + } + + for (j = start; j < end; j++) + { + // for all Axes. + for (i = tree->start_axis; i < tree->stop_axis; i++) + { + newmin = tree->nodes[j]->bv[(2 * i)]; + if ((newmin < bv[(2 * i)])) + bv[(2 * i)] = newmin; + + newmax = tree->nodes[j]->bv[(2 * i) + 1]; + if ((newmax > bv[(2 * i) + 1])) + bv[(2 * i) + 1] = newmax; + } + } +} + +static inline void inflate_kdop_hull(BVHTree *tree, BVHNode *node) +{ + int i; + float *bv = node_get_bv(tree, node); + + for(i= tree->axis; i; i--) + { + *bv++ -= tree->epsilon; // minimum + *bv++ += tree->epsilon; // maximum + } +} + +// only supports x,y,z axis in the moment +// but we should use a plain and simple function here for speed sake +static char kdop_hull_get_largest_axis(BVHTree *tree, BVHNode *node) +{ + float *bv = node_get_bv(tree, node); + float middle_point[3]; + + middle_point[0] = (bv[1]) - (bv[0]); // x axis + middle_point[1] = (bv[3]) - (bv[2]); // y axis + middle_point[2] = (bv[5]) - (bv[4]); // z axis + if (middle_point[0] > middle_point[1]) + { + if (middle_point[0] > middle_point[2]) + return 1; // max x axis + else + return 5; // max z axis + } + else + { + if (middle_point[1] > middle_point[2]) + return 3; // max y axis + else + return 5; // max z axis + } +} + + +int BLI_bvhtree_insert(BVHTree *tree, int index, float *co, int numpoints) +{ + BVHNode *node= NULL; + + // insert should only possible as long as tree->totbranch is 0 + if(tree->totbranch > 0) + return 0; + + if(tree->totleaf+1 >= MEM_allocN_len(tree->nodes)) + return 0; + + // TODO check if have enough nodes in array + + node = tree->nodes[tree->totleaf] = &(tree->nodearray[tree->totleaf]); + tree->totleaf++; + + //create and inflate hull + create_kdop_hull(tree, node, co, numpoints, 0); + inflate_kdop_hull(tree, node); + + node->index= index; + + return 1; +} + + +static void bvh_div_nodes(BVHTree *tree, BVHNode *node, int start, int end, char lastaxis) +{ + char laxis; + int i, tend; + BVHNode *tnode; + int slice = (end-start+tree->tree_type-1)/tree->tree_type; //division rounded up + + // Determine which axis to split along + laxis = kdop_hull_get_largest_axis(tree, node); + + // split nodes along longest axis + for (i=0; start < end; start += slice, i++) //i counts the current child + { + tend = start + slice; + + + if(tend > end) tend = end; + + if(tend-start == 1) // ok, we have 1 left for this node + { + node->children[i] = tree->nodes[start]; + node->children[i]->parent = node; + } + else + { + partition_nth_element(tree->nodes, start, end, tend, laxis); + + tnode = node->children[i] = tree->nodes[tree->totleaf + tree->totbranch] = &(tree->nodearray[tree->totbranch + tree->totleaf]); + tree->totbranch++; + tnode->parent = node; + + refit_kdop_hull(tree, tnode, start, tend); + bvh_div_nodes(tree, tnode, start, tend, laxis); + } + node->totnode++; + } + + return; +} + +static void verify_tree(BVHTree *tree) +{ + int i, j, check = 0; + + // check the pointer list + for(i = 0; i < tree->totleaf; i++) + { + if(tree->nodes[i]->parent == NULL) + printf("Leaf has no parent: %d\n", i); + else + { + for(j = 0; j < tree->tree_type; j++) + { + if(tree->nodes[i]->parent->children[j] == tree->nodes[i]) + check = 1; + } + if(!check) + { + printf("Parent child relationship doesn't match: %d\n", i); + } + check = 0; + } + } + + // check the leaf list + for(i = 0; i < tree->totleaf; i++) + { + if(tree->nodearray[i].parent == NULL) + printf("Leaf has no parent: %d\n", i); + else + { + for(j = 0; j < tree->tree_type; j++) + { + if(tree->nodearray[i].parent->children[j] == &tree->nodearray[i]) + check = 1; + } + if(!check) + { + printf("Parent child relationship doesn't match: %d\n", i); + } + check = 0; + } + } + + printf("branches: %d, leafs: %d, total: %d\n", tree->totbranch, tree->totleaf, tree->totbranch + tree->totleaf); +} + +void BLI_bvhtree_balance(BVHTree *tree) +{ + BVHNode *node; + + if(tree->totleaf == 0) + return; + + // create root node + node = tree->nodes[tree->totleaf] = &(tree->nodearray[tree->totleaf]); + tree->totbranch++; + + // refit root bvh node + refit_kdop_hull(tree, tree->nodes[tree->totleaf], 0, tree->totleaf); + // create + balance tree + bvh_div_nodes(tree, tree->nodes[tree->totleaf], 0, tree->totleaf, 0); + + // verify_tree(tree); +} + +// overlap - is it possbile for 2 bv's to collide ? +static int tree_overlap(BVHNode *node1, BVHNode *node2, int start_axis, int stop_axis) +{ + float *bv1 = node1->bv; + float *bv2 = node2->bv; + + float *bv1_end = bv1 + (stop_axis<<1); + + bv1 += start_axis<<1; + bv2 += start_axis<<1; + + // test all axis if min + max overlap + for (; bv1 != bv1_end; bv1+=2, bv2+=2) + { + if ((*(bv1) > *(bv2 + 1)) || (*(bv2) > *(bv1 + 1))) + return 0; + } + + return 1; +} + +static void traverse(BVHOverlapData *data, BVHNode *node1, BVHNode *node2) +{ + int j; + + if(tree_overlap(node1, node2, MIN2(data->tree1->start_axis, data->tree2->start_axis), MIN2(data->tree1->stop_axis, data->tree2->stop_axis))) + { + // check if node1 is a leaf + if(node1->index) + { + // check if node2 is a leaf + if(node2->index) + { + + if(node1 == node2) + { + return; + } + + if(data->i >= data->max_overlap) + { + // try to make alloc'ed memory bigger + data->overlap = realloc(data->overlap, sizeof(BVHTreeOverlap)*data->max_overlap*2); + + if(!data->overlap) + { + printf("Out of Memory in traverse\n"); + return; + } + data->max_overlap *= 2; + } + + // both leafs, insert overlap! + data->overlap[data->i].indexA = node1->index; + data->overlap[data->i].indexB = node2->index; + + data->i++; + } + else + { + for(j = 0; j < data->tree2->tree_type; j++) + { + if(node2->children[j]) + traverse(data, node1, node2->children[j]); + } + } + } + else + { + + for(j = 0; j < data->tree2->tree_type; j++) + { + if(node1->children[j]) + traverse(data, node1->children[j], node2); + } + } + } + return; +} + +BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, int *result) +{ + int j, total = 0; + BVHTreeOverlap *overlap = NULL, *to = NULL; + BVHOverlapData *data[tree1->tree_type]; + + // check for compatibility of both trees (can't compare 14-DOP with 18-DOP) + if((tree1->axis != tree2->axis) && ((tree1->axis == 14) || tree2->axis == 14)) + return 0; + + // fast check root nodes for collision before doing big splitting + traversal + if(!tree_overlap(tree1->nodes[tree1->totleaf], tree2->nodes[tree2->totleaf], MIN2(tree1->start_axis, tree2->start_axis), MIN2(tree1->stop_axis, tree2->stop_axis))) + return 0; + + for(j = 0; j < tree1->tree_type; j++) + { + data[j] = (BVHOverlapData *)MEM_callocN(sizeof(BVHOverlapData), "BVHOverlapData"); + + // init BVHOverlapData + data[j]->overlap = (BVHTreeOverlap *)malloc(sizeof(BVHTreeOverlap)*MAX2(tree1->totleaf, tree2->totleaf)); + data[j]->tree1 = tree1; + data[j]->tree2 = tree2; + data[j]->max_overlap = MAX2(tree1->totleaf, tree2->totleaf); + data[j]->i = 0; + } + +#pragma omp parallel for private(j) schedule(static) + for(j = 0; j < tree1->tree_type; j++) + { + traverse(data[j], tree1->nodes[tree1->totleaf]->children[j], tree2->nodes[tree2->totleaf]); + } + + for(j = 0; j < tree1->tree_type; j++) + total += data[j]->i; + + to = overlap = (BVHTreeOverlap *)MEM_callocN(sizeof(BVHTreeOverlap)*total, "BVHTreeOverlap"); + + for(j = 0; j < tree1->tree_type; j++) + { + memcpy(to, data[j]->overlap, data[j]->i*sizeof(BVHTreeOverlap)); + to+=data[j]->i; + } + + for(j = 0; j < tree1->tree_type; j++) + { + free(data[j]->overlap); + MEM_freeN(data[j]); + } + + (*result) = total; + return overlap; +} + + +// bottom up update of bvh tree: +// join the 4 children here +static void node_join(BVHTree *tree, BVHNode *node) +{ + int i, j; + + for (i = tree->start_axis; i < tree->stop_axis; i++) + { + node->bv[2*i] = FLT_MAX; + node->bv[2*i + 1] = -FLT_MAX; + } + + for (i = 0; i < tree->tree_type; i++) + { + if (node->children[i]) + { + for (j = tree->start_axis; j < tree->stop_axis; j++) + { + // update minimum + if (node->children[i]->bv[(2 * j)] < node->bv[(2 * j)]) + node->bv[(2 * j)] = node->children[i]->bv[(2 * j)]; + + // update maximum + if (node->children[i]->bv[(2 * j) + 1] > node->bv[(2 * j) + 1]) + node->bv[(2 * j) + 1] = node->children[i]->bv[(2 * j) + 1]; + } + } + else + break; + } +} + +// call before BLI_bvhtree_update_tree() +int BLI_bvhtree_update_node(BVHTree *tree, int index, float *co, float *co_moving, int numpoints) +{ + BVHNode *node= NULL; + + // check if index exists + if(index > tree->totleaf) + return 0; + + node = tree->nodearray + index; + + create_kdop_hull(tree, node, co, numpoints, 0); + + if(co_moving) + create_kdop_hull(tree, node, co_moving, numpoints, 1); + + // inflate the bv with some epsilon + inflate_kdop_hull(tree, node); + + return 1; +} + +// call BLI_bvhtree_update_node() first for every node/point/triangle +void BLI_bvhtree_update_tree(BVHTree *tree) +{ + BVHNode *leaf, *parent; + + // reset tree traversing flag + for (leaf = tree->nodearray + tree->totleaf; leaf != tree->nodearray + tree->totleaf + tree->totbranch; leaf++) + leaf->traversed = 0; + + for (leaf = tree->nodearray; leaf != tree->nodearray + tree->totleaf; leaf++) + { + for (parent = leaf->parent; parent; parent = parent->parent) + { + parent->traversed++; // we tried to go up in hierarchy + if (parent->traversed < parent->totnode) + break; // we do not need to check further + else + node_join(tree, parent); + } + } +} + +float BLI_bvhtree_getepsilon(BVHTree *tree) +{ + return tree->epsilon; +} + From fd53876faf4dbf50946729deef20c5e6264b5d20 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Sun, 25 May 2008 13:44:55 +0000 Subject: [PATCH 12/76] Merge bvh tree from cloth branch --- source/blender/blenlib/intern/BLI_kdopbvh.c | 174 +++++++++++++++++--- 1 file changed, 154 insertions(+), 20 deletions(-) diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index 6a16efc060f..4b72085a2b1 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -49,6 +49,38 @@ #define node_get_bv(tree, node) ((node)->bv) #define node_get_child(tree,node,i) ((node)->children[i]) +/* Util macros */ +#define TO_STR(a) #a +#define JOIN(a,b) a##b + +/* Benchmark macros */ +#if 1 + +#define BENCH(a) \ + do { \ + clock_t _clock_init = clock(); \ + (a); \ + printf("%s: %fms\n", #a, (float)(clock()-_clock_init)*1000/CLOCKS_PER_SEC); \ +} while(0) + +#define BENCH_VAR(name) clock_t JOIN(_bench_step,name) = 0, JOIN(_bench_total,name) = 0 +#define BENCH_BEGIN(name) JOIN(_bench_step, name) = clock() +#define BENCH_END(name) JOIN(_bench_total,name) += clock() - JOIN(_bench_step,name) +#define BENCH_RESET(name) JOIN(_bench_total, name) = 0 +#define BENCH_REPORT(name) printf("%s: %fms\n", TO_STR(name), JOIN(_bench_total,name)*1000.0f/CLOCKS_PER_SEC) + +#else + +#define BENCH(a) (a) +#define BENCH_VAR(name) +#define BENCH_BEGIN(name) +#define BENCH_END(name) +#define BENCH_RESET(name) +#define BENCH_REPORT(name) + +#endif + + typedef struct BVHNode { struct BVHNode **children;// max 8 children @@ -63,15 +95,15 @@ typedef struct BVHNode struct BVHTree { BVHNode **nodes; - float *nodebv; // pre-alloc bounding-volumes for nodes - BVHNode **nodechild; // pre-alloc childs for nodes BVHNode *nodearray; // pre-alloc branchs + BVHNode **nodechild; // pre-alloc childs for nodes + float *nodebv; // pre-alloc bounding-volumes for nodes float epsilon; // epslion is used for inflation of the k-dop int totleaf; // leafs int totbranch; char tree_type; // type of tree (4 => quadtree) char axis; // kdop type (6 => OBB, 7 => AABB, ...) - char start_axis, stop_axis; // KDOP_AXES array indices according to axis + char start_axis, stop_axis; // KDOP_AXES array indices according to axis char start_axis, stop_axis; // KDOP_AXES array indices according to axis }; typedef struct BVHOverlapData @@ -103,6 +135,34 @@ static float KDOP_AXES[13][3] = // http://ralphunden.net/content/tutorials/a-guide-to-introsort/ // and he derived it from the SUN STL ////////////////////////////////////////////////////////////////////////////////////////////////////// +static int size_threshold = 16; +/* +* Common methods for all algorithms +*/ +static int floor_lg(int a) +{ + return (int)(floor(log(a)/log(2))); +} + +/* +* Insertion sort algorithm +*/ +static void bvh_insertionsort(BVHNode **a, int lo, int hi, int axis) +{ + int i,j; + BVHNode *t; + for (i=lo; i < hi; i++) + { + j=i; + t = a[i]; + while((j!=lo) && (t->bv[axis] < (a[j-1])->bv[axis])) + { + a[j] = a[j-1]; + j--; + } + a[j] = t; + } +} static int bvh_partition(BVHNode **a, int lo, int hi, BVHNode * x, int axis) { @@ -119,6 +179,41 @@ static int bvh_partition(BVHNode **a, int lo, int hi, BVHNode * x, int axis) } } +/* +* Heapsort algorithm +*/ +static void bvh_downheap(BVHNode **a, int i, int n, int lo, int axis) +{ + BVHNode * d = a[lo+i-1]; + int child; + while (i<=n/2) + { + child = 2*i; + if ((child < n) && ((a[lo+child-1])->bv[axis] < (a[lo+child])->bv[axis])) + { + child++; + } + if (!(d->bv[axis] < (a[lo+child-1])->bv[axis])) break; + a[lo+i-1] = a[lo+child-1]; + i = child; + } + a[lo+i-1] = d; +} + +static void bvh_heapsort(BVHNode **a, int lo, int hi, int axis) +{ + int n = hi-lo, i; + for (i=n/2; i>=1; i=i-1) + { + bvh_downheap(a, i,n,lo, axis); + } + for (i=n; i>1; i=i-1) + { + SWAP(BVHNode*, a[lo],a[lo+i-1]); + bvh_downheap(a, 1,i-1,lo, axis); + } +} + static BVHNode *bvh_medianof3(BVHNode **a, int lo, int mid, int hi, int axis) // returns Sortable { if ((a[mid])->bv[axis] < (a[lo])->bv[axis]) @@ -146,23 +241,57 @@ static BVHNode *bvh_medianof3(BVHNode **a, int lo, int mid, int hi, int axis) // return a[mid]; } } +/* +* Quicksort algorithm modified for Introsort +*/ +static void bvh_introsort_loop (BVHNode **a, int lo, int hi, int depth_limit, int axis) +{ + int p; + + while (hi-lo > size_threshold) + { + if (depth_limit == 0) + { + bvh_heapsort(a, lo, hi, axis); + return; + } + depth_limit=depth_limit-1; + p=bvh_partition(a, lo, hi, bvh_medianof3(a, lo, lo+((hi-lo)/2)+1, hi-1, axis), axis); + bvh_introsort_loop(a, p, hi, depth_limit, axis); + hi=p; + } +} + +static void sort(BVHNode **a0, int begin, int end, int axis) +{ + if (begin < end) + { + BVHNode **a=a0; + bvh_introsort_loop(a, begin, end, 2*floor_lg(end-begin), axis); + bvh_insertionsort(a, begin, end, axis); + } +} +void sort_along_axis(BVHTree *tree, int start, int end, int axis) +{ + sort(tree->nodes, start, end, axis); +} //after a call to this function you can expect one of: -// every node to left of a[n] are smaller than it -// every node to the right of a[n-1] are greater than it -void partition_nth_element(BVHNode **a, int _begin, int _end, int n, int axis) -{ - int begin = _begin, end = _end; - while(begin < n && end >= n) - { - int mid = bvh_partition(a, begin, end, bvh_medianof3(a, begin, (begin+end-1)/2, end-1, axis), axis ); - - if(mid >= n) - end = n-1; - else - begin = n+1; - } +// every node to left of a[n] are smaller or equal to it +// every node to the right of a[n] are greater or equal to it +int partition_nth_element(BVHNode **a, int _begin, int _end, int n, int axis){ + int begin = _begin, end = _end, cut; + while(end-begin > 3) + { + cut = bvh_partition(a, begin, end, bvh_medianof3(a, begin, (begin+end)/2, end-1, axis), axis ); + if(cut <= n) + begin = cut; + else + end = cut; + } + bvh_insertionsort(a, begin, end, axis); + return n; } ////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -278,6 +407,7 @@ BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis) return tree; } + static void create_kdop_hull(BVHTree *tree, BVHNode *node, float *co, int numpoints, int moving) { float newminmax; @@ -417,7 +547,6 @@ static void bvh_div_nodes(BVHTree *tree, BVHNode *node, int start, int end, char { tend = start + slice; - if(tend > end) tend = end; if(tend-start == 1) // ok, we have 1 left for this node @@ -432,7 +561,9 @@ static void bvh_div_nodes(BVHTree *tree, BVHNode *node, int start, int end, char tnode = node->children[i] = tree->nodes[tree->totleaf + tree->totbranch] = &(tree->nodearray[tree->totbranch + tree->totleaf]); tree->totbranch++; tnode->parent = node; - + + if(tend != end) + partition_nth_element(tree->nodes, start, end, tend, laxis); refit_kdop_hull(tree, tnode, start, tend); bvh_div_nodes(tree, tnode, start, tend, laxis); } @@ -592,7 +723,7 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, int *result) { int j, total = 0; BVHTreeOverlap *overlap = NULL, *to = NULL; - BVHOverlapData *data[tree1->tree_type]; + BVHOverlapData **data; // check for compatibility of both trees (can't compare 14-DOP with 18-DOP) if((tree1->axis != tree2->axis) && ((tree1->axis == 14) || tree2->axis == 14)) @@ -601,6 +732,8 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, int *result) // fast check root nodes for collision before doing big splitting + traversal if(!tree_overlap(tree1->nodes[tree1->totleaf], tree2->nodes[tree2->totleaf], MIN2(tree1->start_axis, tree2->start_axis), MIN2(tree1->stop_axis, tree2->stop_axis))) return 0; + + *data = MEM_callocN(sizeof(BVHOverlapData *)* tree1->tree_type, "BVHOverlapData_star"); for(j = 0; j < tree1->tree_type; j++) { @@ -636,6 +769,7 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, int *result) free(data[j]->overlap); MEM_freeN(data[j]); } + MEM_freeN(*data); (*result) = total; return overlap; From ad2fecf2660e9da7748ab6cce37569e1bc2a11e1 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Sun, 25 May 2008 15:43:18 +0000 Subject: [PATCH 13/76] Added BVH nearest neighbour code, for now only works in 6-dop and finds the node with the nearest bounding volume. I'll work on making it more generic. So far it querys faster than kdtree, but building the tree is slower. And bvhtree NN uses an heuristic based on the last match. Shrinkwrap (OBCube)24578 over (OBSuzanne)31658 kdtree build: 30.000000ms query: 1360.000000ms bvhtree build: 140.000000ms query: 490.000000ms Shrinkwrap now uses bvhtree (binary tree, 6dop) for nearest vertex. --- source/blender/blenkernel/intern/shrinkwrap.c | 67 +++++++--- source/blender/blenlib/BLI_kdopbvh.h | 9 ++ source/blender/blenlib/intern/BLI_kdopbvh.c | 120 +++++++++++++++++- 3 files changed, 178 insertions(+), 18 deletions(-) diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index dca210afb27..c24f6e8cd8a 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -234,6 +234,16 @@ static float raytree_cast_ray(RayTree *tree, const float *coord, const float *di return VecLenf((float*)coord, (float*)isec.end); } +/* + * Returns the squared distance between two given points + */ +static float squared_dist(const float *a, const float *b) +{ + float tmp[3]; + VECSUB(tmp, a, b); + return INPR(tmp, tmp); +} + /* * This calculates the distance (in dir units) that the ray must travel to intersect plane * It can return negative values @@ -782,11 +792,14 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) int i; int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); +/* KDTree* target = NULL; - KDTreeNearest nearest; + KDTreeNearest knearest; +*/ float tmp_co[3]; BVHTree *tree = NULL; + BVHTreeNearest nearest; BENCH_VAR(build); BENCH_VAR(query); @@ -798,19 +811,26 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) numVerts= calc->target->getNumVerts(calc->target); vert = tvert = calc->target->getVertDataArray(calc->target, CD_MVERT); + BENCH_RESET(build); BENCH_BEGIN(build); - tree = BLI_bvhtree_new(numVerts, 0, 8, 6); + //Create a bvh-tree of the given target + tree = BLI_bvhtree_new(numVerts, 0, 2, 6); if(tree == NULL) return OUT_OF_MEMORY(); for(i = 0; i < numVerts; i++) BLI_bvhtree_insert(tree, i, vert[i].co, 1); + BLI_bvhtree_balance(tree); + + nearest.index = -1; + nearest.dist = FLT_MAX; BENCH_END(build); BENCH_REPORT(build); +/* //Generate kd-tree with target vertexs BENCH_RESET(build); BENCH_BEGIN(build); @@ -825,7 +845,7 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) BENCH_END(build); BENCH_REPORT(build); - +*/ //Find the nearest vertex numVerts= calc->final->getNumVerts(calc->final); @@ -835,40 +855,55 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) BENCH_BEGIN(query); for(i=0; ilocal2target, vert[i].co); + VecMat4MulVecfl(tmp_co, calc->local2target, vert[i].co); - index = BLI_bvhtree_find_nearest(tree, tmp_co); + if(nearest.index != -1) + { + nearest.dist = squared_dist(tmp_co, tvert[nearest.index].co); + } + else nearest.dist = FLT_MAX; + + index = BLI_bvhtree_find_nearest(tree, tmp_co, &nearest); + +/* + t = BLI_kdtree_find_nearest(target, tmp_co, 0, &knearest); + + + if(VecLenf(knearest.co, tvert[index].co) > 1e-5) + { + printf("Nearest failed: {%f,%f,%f} - ", knearest.co[0], knearest.co[1], knearest.co[2]); + printf("{%f,%f,%f}\n", tvert[index].co[0], tvert[index].co[1], tvert[index].co[2]); + } +*/ if(index != -1) { float dist; + VecMat4MulVecfl(tmp_co, calc->target2local, tvert[index].co); dist = VecLenf(vert[i].co, tmp_co); if(dist > 1e-5) weight *= (dist - calc->keptDist)/dist; - VecLerpf(vert[i].co, vert[i].co, nearest.co, weight); //linear interpolation + VecLerpf(vert[i].co, vert[i].co, tmp_co, weight); //linear interpolation } - */ - t = BLI_kdtree_find_nearest(target, tmp_co, 0, &nearest); - - if(t != -1) +/* if(t != -1) { float dist; - VecMat4MulVecfl(nearest.co, calc->target2local, nearest.co); - dist = VecLenf(vert[i].co, tmp_co); + VecMat4MulVecfl(knearest.co, calc->target2local, knearest.co); + dist = VecLenf(vert[i].co, knearest.co); if(dist > 1e-5) weight *= (dist - calc->keptDist)/dist; - VecLerpf(vert[i].co, vert[i].co, nearest.co, weight); //linear interpolation + VecLerpf(vert[i].co, vert[i].co, knearest.co, weight); //linear interpolation } - +*/ } BENCH_END(query); BENCH_REPORT(query); - BLI_kdtree_free(target); +// BLI_kdtree_free(target); BLI_bvhtree_free(tree); } diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h index c1240da6c3a..18ecfe7a2e9 100644 --- a/source/blender/blenlib/BLI_kdopbvh.h +++ b/source/blender/blenlib/BLI_kdopbvh.h @@ -40,6 +40,12 @@ typedef struct BVHTreeOverlap { int indexB; } BVHTreeOverlap; +typedef struct BVHTreeNearest +{ + int index; /* the index of the nearest found (untouched if none is found within a dist radius from the given coordinates) */ + float dist; /* squared distance to search arround */ +} BVHTreeNearest; + BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis); void BLI_bvhtree_free(BVHTree *tree); @@ -56,6 +62,9 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, int *result) float BLI_bvhtree_getepsilon(BVHTree *tree); +/* find nearest node to the given coordinates (if nearest is given it will only search nodes where square distance is smaller than nearest->dist) */ +int BLI_bvhtree_find_nearest(BVHTree *tree, float *co, BVHTreeNearest *nearest); + #endif // BLI_KDOPBVH_H diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index 4b72085a2b1..c510f9afb00 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -112,6 +112,14 @@ typedef struct BVHOverlapData BVHTreeOverlap *overlap; int i, max_overlap; /* i is number of overlaps */ } BVHOverlapData; + +typedef struct BVHNearestData +{ + BVHTree *tree; + float *co; + float proj[13]; //coordinates projection over axis + BVHTreeNearest nearest; +} BVHNearestData; //////////////////////////////////////// @@ -340,12 +348,12 @@ BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis) tree->start_axis = 0; tree->stop_axis = 7; } - else if(axis == 8) // AABB + else if(axis == 8) { tree->start_axis = 0; tree->stop_axis = 4; } - else if(axis == 6) // OBB + else if(axis == 6) // AABB { tree->start_axis = 0; tree->stop_axis = 3; @@ -857,3 +865,111 @@ float BLI_bvhtree_getepsilon(BVHTree *tree) return tree->epsilon; } + +//Nearest neighbour +static float squared_dist(const float *a, const float *b) +{ + float tmp[3]; + VECSUB(tmp, a, b); + return INPR(tmp, tmp); +} + +static float calc_nearest_point(BVHNearestData *data, BVHNode *node, float *nearest) +{ + int i; + const float *bv = node_get_bv(data->tree, node); + + //nearest on AABB hull + for(i=0; i != 3; i++, bv += 2) + { + if(bv[0] > data->proj[i]) + nearest[i] = bv[0]; + else if(bv[1] < data->proj[i]) + nearest[i] = bv[1]; + else + nearest[i] = data->proj[i]; + } + +/* + //nearest on a general hull + VECCOPY(nearest, data->co); + for(i = data->tree->start_axis; i != data->tree->stop_axis; i++, bv+=2) + { + float proj = INPR( nearest, KDOP_AXES[i]); + float dl = bv[0] - proj; + float du = bv[1] - proj; + + if(dl > 0) + { + VECADDFAC(nearest, nearest, KDOP_AXES[i], dl); + } + else if(du < 0) + { + VECADDFAC(nearest, nearest, KDOP_AXES[i], du); + } + } +*/ + return squared_dist(data->co, nearest); +} + + +static void dfs_find_nearest(BVHNearestData *data, BVHNode *node) +{ + int i; + float nearest[3], sdist; + + sdist = calc_nearest_point(data, node, nearest); + + if(sdist >= data->nearest.dist) return; + + if(node->totnode == 0) + { + data->nearest.dist = sdist; + data->nearest.index = node->index; + } + else + { + for(i=0; i != node->totnode; i++) + { + dfs_find_nearest(data, node->children[i]); + } + } +} + +int BLI_bvhtree_find_nearest(BVHTree *tree, float *co, BVHTreeNearest *nearest) +{ + int i; + + BVHNearestData data; + + //init data to search + data.tree = tree; + data.co = co; + + for(i = data.tree->start_axis; i != data.tree->stop_axis; i++) + { + data.proj[i] = INPR(data.co, KDOP_AXES[i]); + } + + if(nearest) + { + memcpy( &data.nearest , nearest, sizeof(*nearest) ); + } + else + { + data.nearest.index = -1; + data.nearest.dist = FLT_MAX; + } + + //dfs search + dfs_find_nearest(&data, tree->nodes[tree->totleaf] ); + + //copy back results + if(nearest) + { + memcpy(nearest, &data.nearest, sizeof(*nearest)); + } + + return data.nearest.index; +} + From ad3f4c89aa3386f7be71444f882ba7e68711459e Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Sun, 25 May 2008 15:47:54 +0000 Subject: [PATCH 14/76] Merge BVH tree fixes from cloth branch svn merge -r 14954:14963 https://svn.blender.org/svnroot/bf-blender/branches/cloth/blender/source/blender/blenlib/BLI_kdopbvh.h svn merge -r 14954:14963 https://svn.blender.org/svnroot/bf-blender/branches/cloth/blender/source/blender/blenlib/intern/BLI_kdopbvh.c --- source/blender/blenlib/intern/BLI_kdopbvh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index c510f9afb00..97a0e305e89 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -741,7 +741,7 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, int *result) if(!tree_overlap(tree1->nodes[tree1->totleaf], tree2->nodes[tree2->totleaf], MIN2(tree1->start_axis, tree2->start_axis), MIN2(tree1->stop_axis, tree2->stop_axis))) return 0; - *data = MEM_callocN(sizeof(BVHOverlapData *)* tree1->tree_type, "BVHOverlapData_star"); + data = MEM_callocN(sizeof(BVHOverlapData *)* tree1->tree_type, "BVHOverlapData_star"); for(j = 0; j < tree1->tree_type; j++) { @@ -777,7 +777,7 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, int *result) free(data[j]->overlap); MEM_freeN(data[j]); } - MEM_freeN(*data); + MEM_freeN(data); (*result) = total; return overlap; From 4383743acea4d30625b3a4a8cb9e77ad883fd79e Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Mon, 26 May 2008 21:57:53 +0000 Subject: [PATCH 15/76] Fixed some compile erros under msvc (thanks lguillaume) Fixed object dependency (thanks ZanQdo for pointing it out) Make some code cleaner (preparing for adding bvh trees on nearest surface) --- source/blender/blenkernel/intern/modifier.c | 2 +- source/blender/blenkernel/intern/shrinkwrap.c | 225 +++++++++++------- source/blender/blenlib/BLI_kdopbvh.h | 5 +- source/blender/blenlib/intern/BLI_kdopbvh.c | 7 +- 4 files changed, 151 insertions(+), 88 deletions(-) diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 35219afdd6e..5a7779b9711 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -7049,7 +7049,7 @@ static void shrinkwrapModifier_updateDepgraph(ModifierData *md, DagForest *fores if (smd->target) { DagNode *curNode = dag_get_node(forest, smd->target); - dag_add_relation(forest, curNode, obNode, DAG_RL_OB_DATA, + dag_add_relation(forest, curNode, obNode, DAG_RL_OB_DATA | DAG_RL_DATA_DATA, "Shrinkwrap Modifier"); } } diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index c24f6e8cd8a..68e0d21b379 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -31,8 +31,6 @@ #include #include #include -#include -//TODO: its late and I don't fill like adding ifs() printfs (I'll remove them on end) #include "DNA_object_types.h" #include "DNA_modifier_types.h" @@ -108,12 +106,73 @@ static float vertexgroup_get_weight(MDeformVert *dvert, int index, int vgroup) return 1.0; } +/* + * BVH tree from mesh vertices + */ +static BVHTree* bvhtree_from_mesh_verts(DerivedMesh *mesh) +{ + int i; + int numVerts= mesh->getNumVerts(mesh); + MVert *vert = mesh->getVertDataArray(mesh, CD_MVERT); + + BVHTree *tree = BLI_bvhtree_new(numVerts, 0, 2, 6); + if(tree != NULL) + { + for(i = 0; i < numVerts; i++) + BLI_bvhtree_insert(tree, i, vert[i].co, 1); + + BLI_bvhtree_balance(tree); + } + + return tree; +} + +static BVHTree* bvhtree_from_mesh_tri(DerivedMesh *mesh) +{ + int i; + int numFaces= mesh->getNumFaces(mesh), totFaces; + MVert *vert = mesh->getVertDataArray(mesh, CD_MVERT); + MFace *face = mesh->getFaceDataArray(mesh, CD_MFACE); + BVHTree *tree= NULL; + + /* Count needed faces */ + for(totFaces=numFaces, i=0; iv4); *v1= raytree_from_mesh_verts[mface->v1].co; *v2= raytree_from_mesh_verts[mface->v4].co; *v3= raytree_from_mesh_verts[mface->v3].co; @@ -189,8 +247,8 @@ static RayTree* raytree_create_from_mesh(DerivedMesh *mesh) { RE_ray_tree_add_face(tree, 0, (RayFace*)(i*2) ); - //Theres some nasty thing with non-coplanar quads (that I can't find the issue) - //so we split quads (an odd numbered face represents the second triangle of the quad) + //Theres some nasty thing with non-coplanar quads (that I can't find the issue) + //so we split quads (an odd numbered face represents the second triangle of the quad) if(face[i-1].v4) RE_ray_tree_add_face(tree, 0, (RayFace*)(i*2+1)); } @@ -213,10 +271,10 @@ static void free_raytree_from_mesh(RayTree *tree) */ static float raytree_cast_ray(RayTree *tree, const float *coord, const float *direction) { - Isect isec = {}; + Isect isec; - //Setup intersection - isec.mode = RE_RAY_MIRROR; //We want closest intersection + /* Setup intersection */ + isec.mode = RE_RAY_MIRROR; /* We want closest intersection */ isec.lay = -1; isec.face_last = NULL; isec.faceorig = (RayFace*)(-1); @@ -304,7 +362,7 @@ static float choose_nearest(const float v0[2], const float v1[2], const float po * returns that tri must be right-handed * Returns square distance */ -static float closest_point_in_tri2D(const float point[2], const float tri[3][2], float closest[2]) +static float closest_point_in_tri2D(const float point[2], /*const*/ float tri[3][2], float closest[2]) { float edge_di[2]; float v_point[2]; @@ -540,9 +598,7 @@ static void bruteforce_shrinkwrap_calc_nearest_vertex(DerivedMesh *target, float for (i = 0; i < numVerts; i++) { - float diff[3], sdist; - VECSUB(diff, orig_co, vert[i].co); - sdist = INPR(diff, diff); + float sdist = squared_dist( orig_co, vert[i].co); if(sdist < minDist) { @@ -707,8 +763,8 @@ static void shrinkwrap_removeUnused(ShrinkwrapCalcData *calc) DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, DerivedMesh *dm, int useRenderParams, int isFinalCalc) { - ShrinkwrapCalcData calc = {}; - + ShrinkwrapCalcData calc; + memset(&calc, 0, sizeof(calc)); //Init Shrinkwrap calc data calc.smd = smd; @@ -752,6 +808,7 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri switch(smd->shrinkType) { case MOD_SHRINKWRAP_NEAREST_SURFACE: +// BENCH(shrinkwrap_calc_nearest_surface_point(&calc)); BENCH(shrinkwrap_calc_foreach_vertex(&calc, bruteforce_shrinkwrap_calc_nearest_surface_point)); break; @@ -791,62 +848,26 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) { int i; int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); - -/* - KDTree* target = NULL; - KDTreeNearest knearest; -*/ float tmp_co[3]; BVHTree *tree = NULL; - BVHTreeNearest nearest; + BVHTreeNearest nearest = {}; - BENCH_VAR(build); BENCH_VAR(query); int numVerts; - MVert *vert = NULL, *tvert = NULL; + MVert *vert = NULL; MDeformVert *dvert = NULL; - numVerts= calc->target->getNumVerts(calc->target); - vert = tvert = calc->target->getVertDataArray(calc->target, CD_MVERT); - BENCH_RESET(build); - BENCH_BEGIN(build); - - //Create a bvh-tree of the given target - tree = BLI_bvhtree_new(numVerts, 0, 2, 6); + BENCH(tree = bvhtree_from_mesh_verts(calc->target)); if(tree == NULL) return OUT_OF_MEMORY(); - for(i = 0; i < numVerts; i++) - BLI_bvhtree_insert(tree, i, vert[i].co, 1); - - BLI_bvhtree_balance(tree); - nearest.index = -1; nearest.dist = FLT_MAX; - BENCH_END(build); - BENCH_REPORT(build); -/* - //Generate kd-tree with target vertexs - BENCH_RESET(build); - BENCH_BEGIN(build); - - target = BLI_kdtree_new(numVerts); - if(target == NULL) return OUT_OF_MEMORY(); - - for(i = 0; i < numVerts; i++) - BLI_kdtree_insert(target, 0, vert[i].co, NULL); - - BLI_kdtree_balance(target); - - BENCH_END(build); - BENCH_REPORT(build); -*/ - //Find the nearest vertex numVerts= calc->final->getNumVerts(calc->final); vert = calc->final->getVertDataArray(calc->final, CD_MVERT); @@ -863,47 +884,25 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) if(nearest.index != -1) { - nearest.dist = squared_dist(tmp_co, tvert[nearest.index].co); + nearest.dist = squared_dist(tmp_co, nearest.nearest); } else nearest.dist = FLT_MAX; index = BLI_bvhtree_find_nearest(tree, tmp_co, &nearest); -/* - t = BLI_kdtree_find_nearest(target, tmp_co, 0, &knearest); - - - if(VecLenf(knearest.co, tvert[index].co) > 1e-5) - { - printf("Nearest failed: {%f,%f,%f} - ", knearest.co[0], knearest.co[1], knearest.co[2]); - printf("{%f,%f,%f}\n", tvert[index].co[0], tvert[index].co[1], tvert[index].co[2]); - } -*/ if(index != -1) { float dist; - VecMat4MulVecfl(tmp_co, calc->target2local, tvert[index].co); + VecMat4MulVecfl(tmp_co, calc->target2local, nearest.nearest); dist = VecLenf(vert[i].co, tmp_co); if(dist > 1e-5) weight *= (dist - calc->keptDist)/dist; VecLerpf(vert[i].co, vert[i].co, tmp_co, weight); //linear interpolation } - -/* if(t != -1) - { - float dist; - - VecMat4MulVecfl(knearest.co, calc->target2local, knearest.co); - dist = VecLenf(vert[i].co, knearest.co); - if(dist > 1e-5) weight *= (dist - calc->keptDist)/dist; - VecLerpf(vert[i].co, vert[i].co, knearest.co, weight); //linear interpolation - } -*/ } BENCH_END(query); BENCH_REPORT(query); -// BLI_kdtree_free(target); BLI_bvhtree_free(tree); } @@ -1000,4 +999,66 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) free_raytree_from_mesh(target); } +/* + * Shrinkwrap moving vertexs to the nearest surface point on the target + * + * it builds a BVHTree from the target mesh and then performs a + * NN matchs for each vertex + */ +void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) +{ + int i; + int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); + float tmp_co[3]; + + BVHTree *tree = NULL; + BVHTreeNearest nearest = {}; + + int numVerts; + MVert *vert = NULL; + MDeformVert *dvert = NULL; + + + //Create a bvh-tree of the given target + tree = bvhtree_from_mesh_tri(calc->target); + if(tree == NULL) return OUT_OF_MEMORY(); + + nearest.index = -1; + nearest.dist = FLT_MAX; + + + //Find the nearest vertex + numVerts= calc->final->getNumVerts(calc->final); + vert = calc->final->getVertDataArray(calc->final, CD_MVERT); + dvert = calc->final->getVertDataArray(calc->final, CD_MDEFORMVERT); + + for(i=0; ilocal2target, vert[i].co); + + if(nearest.index != -1) + { + nearest.dist = squared_dist(tmp_co, nearest.nearest); + } + else nearest.dist = FLT_MAX; + + index = BLI_bvhtree_find_nearest(tree, tmp_co, &nearest); + + if(index != -1) + { + float dist; + + VecMat4MulVecfl(tmp_co, calc->target2local, nearest.nearest); + dist = VecLenf(vert[i].co, tmp_co); + if(dist > 1e-5) weight *= (dist - calc->keptDist)/dist; + VecLerpf(vert[i].co, vert[i].co, tmp_co, weight); //linear interpolation + } + } + + BLI_bvhtree_free(tree); +} diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h index 18ecfe7a2e9..6a91e0e283b 100644 --- a/source/blender/blenlib/BLI_kdopbvh.h +++ b/source/blender/blenlib/BLI_kdopbvh.h @@ -42,8 +42,9 @@ typedef struct BVHTreeOverlap { typedef struct BVHTreeNearest { - int index; /* the index of the nearest found (untouched if none is found within a dist radius from the given coordinates) */ - float dist; /* squared distance to search arround */ + int index; /* the index of the nearest found (untouched if none is found within a dist radius from the given coordinates) */ + float nearest[3]; /* nearest coordinates (untouched it none is found within a dist radius from the given coordinates) */ + float dist; /* squared distance to search arround */ } BVHTreeNearest; BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis); diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index 97a0e305e89..b3cd00c0042 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -7,7 +7,7 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. The Blender -* Foundation also sells licenses for use in proprietary software under +* Foundation also sells licenses for usinle in proprietary software under * the Blender License. See http://www.blender.org/BL/ for information * about this. * @@ -475,7 +475,7 @@ static void refit_kdop_hull(BVHTree *tree, BVHNode *node, int start, int end) } } -static inline void inflate_kdop_hull(BVHTree *tree, BVHNode *node) +static void inflate_kdop_hull(BVHTree *tree, BVHNode *node) { int i; float *bv = node_get_bv(tree, node); @@ -924,8 +924,9 @@ static void dfs_find_nearest(BVHNearestData *data, BVHNode *node) if(node->totnode == 0) { - data->nearest.dist = sdist; data->nearest.index = node->index; + VECCOPY(data->nearest.nearest, nearest); + data->nearest.dist = sdist; } else { From 2a0a999a7146ff2a3a2726e62b976f5e49da1872 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Tue, 27 May 2008 18:32:23 +0000 Subject: [PATCH 16/76] Added bvh nearest neighbour for nearest surface shrinkwrap --- source/blender/blenkernel/intern/shrinkwrap.c | 34 +++++++++++++------ source/blender/blenlib/BLI_kdopbvh.h | 6 +++- source/blender/blenlib/intern/BLI_kdopbvh.c | 20 ++++++++--- 3 files changed, 44 insertions(+), 16 deletions(-) diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 68e0d21b379..3b0aae8be2b 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -86,6 +86,7 @@ typedef void ( *Shrinkwrap_ForeachVertexCallback) (DerivedMesh *target, float *co, float *normal); +static float nearest_point_in_tri_surface(const float *point, const float *v0, const float *v1, const float *v2, float *nearest); static void normal_short2float(const short *ns, float *nf) { @@ -145,18 +146,19 @@ static BVHTree* bvhtree_from_mesh_tri(DerivedMesh *mesh) { for(i = 0; i < numFaces; i++) { - float co[4][3]; + float co[3][3]; VECCOPY(co[0], vert[ face[i].v1 ].co); VECCOPY(co[1], vert[ face[i].v2 ].co); VECCOPY(co[2], vert[ face[i].v3 ].co); - if(face[i].v4) - VECCOPY(co[3], vert[ face[i].v4 ].co); - - BLI_bvhtree_insert(tree, 2*i, co[0], 3); if(face[i].v4) - BLI_bvhtree_insert(tree, 2*i+1, co[1], 3); + { + /* second face is v1,v3,v4 */ + VECCOPY(co[1], vert[ face[i].v3 ].co); + VECCOPY(co[2], vert[ face[i].v4 ].co); + BLI_bvhtree_insert(tree, 2*i+1, co[0], 3); + } } BLI_bvhtree_balance(tree); @@ -165,7 +167,17 @@ static BVHTree* bvhtree_from_mesh_tri(DerivedMesh *mesh) return tree; } +static float mesh_tri_nearest_point(void *userdata, int index, const float *co, float *nearest) +{ + DerivedMesh *mesh = (DerivedMesh*)(userdata); + MVert *vert = (MVert*)mesh->getVertDataArray(mesh, CD_MVERT); + MFace *face = (MFace*)mesh->getFaceDataArray(mesh, CD_MFACE) + index/2; + if(index & 1) + return nearest_point_in_tri_surface(co, vert[ face->v1 ].co, vert[ face->v3 ].co, vert[ face->v4 ].co, nearest); + else + return nearest_point_in_tri_surface(co, vert[ face->v1 ].co, vert[ face->v2 ].co, vert[ face->v3 ].co, nearest); +} /* * Raytree from mesh @@ -482,7 +494,7 @@ static float nearest_point_in_tri_surface(const float *point, const float *v0, c nearest[2] = du[2]*nearest_2d[0] + dv[2] * nearest_2d[1] + dw[2] * plane_offset; } - return sasqrt(plane_sdist + normal_dist*normal_dist); + return plane_sdist + normal_dist*normal_dist; } @@ -808,8 +820,8 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri switch(smd->shrinkType) { case MOD_SHRINKWRAP_NEAREST_SURFACE: -// BENCH(shrinkwrap_calc_nearest_surface_point(&calc)); - BENCH(shrinkwrap_calc_foreach_vertex(&calc, bruteforce_shrinkwrap_calc_nearest_surface_point)); + BENCH(shrinkwrap_calc_nearest_surface_point(&calc)); +// BENCH(shrinkwrap_calc_foreach_vertex(&calc, bruteforce_shrinkwrap_calc_nearest_surface_point)); break; case MOD_SHRINKWRAP_NORMAL: @@ -888,7 +900,7 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) } else nearest.dist = FLT_MAX; - index = BLI_bvhtree_find_nearest(tree, tmp_co, &nearest); + index = BLI_bvhtree_find_nearest(tree, tmp_co, &nearest, NULL, NULL); if(index != -1) { @@ -1046,7 +1058,7 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) } else nearest.dist = FLT_MAX; - index = BLI_bvhtree_find_nearest(tree, tmp_co, &nearest); + index = BLI_bvhtree_find_nearest(tree, tmp_co, &nearest, mesh_tri_nearest_point, calc->target); if(index != -1) { diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h index 6a91e0e283b..055c2754a21 100644 --- a/source/blender/blenlib/BLI_kdopbvh.h +++ b/source/blender/blenlib/BLI_kdopbvh.h @@ -47,6 +47,10 @@ typedef struct BVHTreeNearest float dist; /* squared distance to search arround */ } BVHTreeNearest; +/* returns square of the minimum distance from given co to the node, nearest point is stored on nearest */ +typedef float (*BVHTree_NearestPointCallback) (void *userdata, int index, const float *co, float *nearest); + + BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis); void BLI_bvhtree_free(BVHTree *tree); @@ -64,7 +68,7 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, int *result) float BLI_bvhtree_getepsilon(BVHTree *tree); /* find nearest node to the given coordinates (if nearest is given it will only search nodes where square distance is smaller than nearest->dist) */ -int BLI_bvhtree_find_nearest(BVHTree *tree, float *co, BVHTreeNearest *nearest); +int BLI_bvhtree_find_nearest(BVHTree *tree, float *co, BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata); #endif // BLI_KDOPBVH_H diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index b3cd00c0042..ef7c13a8918 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -117,6 +117,8 @@ typedef struct BVHNearestData { BVHTree *tree; float *co; + BVHTree_NearestPointCallback callback; + void *userdata; float proj[13]; //coordinates projection over axis BVHTreeNearest nearest; } BVHNearestData; @@ -919,25 +921,32 @@ static void dfs_find_nearest(BVHNearestData *data, BVHNode *node) float nearest[3], sdist; sdist = calc_nearest_point(data, node, nearest); - if(sdist >= data->nearest.dist) return; if(node->totnode == 0) { + if(data->callback) + sdist = data->callback(data->userdata , node->index, data->co, nearest); + + if(sdist >= data->nearest.dist) return; + data->nearest.index = node->index; VECCOPY(data->nearest.nearest, nearest); data->nearest.dist = sdist; } else { - for(i=0; i != node->totnode; i++) + if(sdist < data->nearest.dist) { - dfs_find_nearest(data, node->children[i]); + for(i=0; i != node->totnode; i++) + { + dfs_find_nearest(data, node->children[i]); + } } } } -int BLI_bvhtree_find_nearest(BVHTree *tree, float *co, BVHTreeNearest *nearest) +int BLI_bvhtree_find_nearest(BVHTree *tree, float *co, BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata) { int i; @@ -947,6 +956,9 @@ int BLI_bvhtree_find_nearest(BVHTree *tree, float *co, BVHTreeNearest *nearest) data.tree = tree; data.co = co; + data.callback = callback; + data.userdata = userdata; + for(i = data.tree->start_axis; i != data.tree->stop_axis; i++) { data.proj[i] = INPR(data.co, KDOP_AXES[i]); From 40b0de45069635411e7052a5af73444d504a18ae Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Tue, 27 May 2008 18:40:33 +0000 Subject: [PATCH 17/76] Fixed a compile error under msvc. --- source/blender/blenkernel/intern/shrinkwrap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 3b0aae8be2b..e54b7a8472f 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -863,7 +863,7 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) float tmp_co[3]; BVHTree *tree = NULL; - BVHTreeNearest nearest = {}; + BVHTreeNearest nearest; BENCH_VAR(query); @@ -876,6 +876,7 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) BENCH(tree = bvhtree_from_mesh_verts(calc->target)); if(tree == NULL) return OUT_OF_MEMORY(); + //Setup nearest nearest.index = -1; nearest.dist = FLT_MAX; @@ -1024,7 +1025,7 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) float tmp_co[3]; BVHTree *tree = NULL; - BVHTreeNearest nearest = {}; + BVHTreeNearest nearest; int numVerts; MVert *vert = NULL; @@ -1035,6 +1036,7 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) tree = bvhtree_from_mesh_tri(calc->target); if(tree == NULL) return OUT_OF_MEMORY(); + //Setup nearest nearest.index = -1; nearest.dist = FLT_MAX; From 07e80dc2658fcdb54a40701164665123d14f8f44 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Tue, 27 May 2008 22:39:00 +0000 Subject: [PATCH 18/76] Enabled EditMode on shrinkwrap modifier --- source/blender/blenkernel/intern/modifier.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 5a7779b9711..3b1b01758ed 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -7042,6 +7042,11 @@ static DerivedMesh *shrinkwrapModifier_applyModifier(ModifierData *md, Object *o return shrinkwrapModifier_do((ShrinkwrapModifierData*)md,ob,derivedData,useRenderParams,isFinalCalc); } +static DerivedMesh *shrinkwrapModifier_applyModifierEM(ModifierData *md, Object *ob, EditMesh *editData, DerivedMesh *derivedData) +{ + return shrinkwrapModifier_do((ShrinkwrapModifierData*)md,ob,derivedData,0,0); +} + static void shrinkwrapModifier_updateDepgraph(ModifierData *md, DagForest *forest, Object *ob, DagNode *obNode) { ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; @@ -7377,12 +7382,16 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type) mti = INIT_TYPE(Shrinkwrap); mti->type = eModifierTypeType_Nonconstructive; - mti->flags = eModifierTypeFlag_AcceptsMesh; + mti->flags = eModifierTypeFlag_AcceptsMesh + | eModifierTypeFlag_SupportsEditmode + | eModifierTypeFlag_EnableInEditmode; + mti->initData = shrinkwrapModifier_initData; mti->copyData = shrinkwrapModifier_copyData; mti->requiredDataMask = shrinkwrapModifier_requiredDataMask; mti->foreachObjectLink = shrinkwrapModifier_foreachObjectLink; mti->applyModifier = shrinkwrapModifier_applyModifier; + mti->applyModifierEM = shrinkwrapModifier_applyModifierEM; mti->updateDepgraph = shrinkwrapModifier_updateDepgraph; typeArrInit = 0; From 7f3928652e80eb0390b871a76e55737f76818aac Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Sat, 31 May 2008 01:25:24 +0000 Subject: [PATCH 19/76] Added culling on normal projection. Now renderdemon is happy ;) and now shrinkwrap can be used for bulging :) --- source/blender/blenkernel/intern/shrinkwrap.c | 29 +++++++++++++++---- source/blender/makesdna/DNA_modifier_types.h | 3 ++ source/blender/src/buttons_editing.c | 5 +++- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index e54b7a8472f..14ed29d0583 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -207,8 +207,8 @@ static void raytree_from_mesh_get_coords(RayFace *face, float **v1, float **v2, if(((int)face) & 1) // we want the 2 triangle of the quad { *v1= raytree_from_mesh_verts[mface->v1].co; - *v2= raytree_from_mesh_verts[mface->v4].co; - *v3= raytree_from_mesh_verts[mface->v3].co; + *v2= raytree_from_mesh_verts[mface->v3].co; + *v3= raytree_from_mesh_verts[mface->v4].co; *v4= NULL; } else @@ -280,10 +280,12 @@ static void free_raytree_from_mesh(RayTree *tree) * Cast a ray on the specified direction * Returns the distance the ray must travel until intersect something * Returns FLT_MAX in case of nothing intersection + * if facenormal is given, it will be overwritted with the normal of the face the ray collided with */ -static float raytree_cast_ray(RayTree *tree, const float *coord, const float *direction) +static float raytree_cast_ray(RayTree *tree, const float *coord, const float *direction, float *facenormal) { Isect isec; + float *v1, *v2, *v3, *v4; /* Setup intersection */ isec.mode = RE_RAY_MIRROR; /* We want closest intersection */ @@ -299,6 +301,12 @@ static float raytree_cast_ray(RayTree *tree, const float *coord, const float *di if(!RE_ray_tree_intersect(tree, &isec)) return FLT_MAX; + if(facenormal) + { + raytree_from_mesh_get_coords( isec.face, &v1, &v2, &v3, &v4); + CalcNormFloat(v1, v2, v3, facenormal); + } + isec.labda = ABS(isec.labda); VECADDFAC(isec.end, isec.start, isec.vec, isec.labda); return VecLenf((float*)coord, (float*)isec.end); @@ -958,6 +966,7 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) { float dist = FLT_MAX; float weight = vertexgroup_get_weight(dvert, i, vgroup); + float face_normal[3]; if(weight == 0.0f) continue; //Transform coordinates local->target @@ -970,7 +979,12 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) if(use_normal & MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL) { - dist = raytree_cast_ray(target, tmp_co, tmp_no); + dist = raytree_cast_ray(target, tmp_co, tmp_no, face_normal); + + if((calc->smd->shrinkOpts & MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE) && INPR(tmp_no, face_normal) < 0) + dist = FLT_MAX; + if((calc->smd->shrinkOpts & MOD_SHRINKWRAP_CULL_TARGET_BACKFACE) && INPR(tmp_no, face_normal) > 0) + dist = FLT_MAX; } normal_short2float(vert[i].no, tmp_no); @@ -986,7 +1000,12 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) inv[1] = -tmp_no[1]; inv[2] = -tmp_no[2]; - tdist = raytree_cast_ray(target, tmp_co, inv); + tdist = raytree_cast_ray(target, tmp_co, inv, 0); + + if((calc->smd->shrinkOpts & MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE) && INPR(tmp_no, face_normal) < 0) + tdist = FLT_MAX; + if((calc->smd->shrinkOpts & MOD_SHRINKWRAP_CULL_TARGET_BACKFACE) && INPR(tmp_no, face_normal) > 0) + tdist = FLT_MAX; if(ABS(tdist) < ABS(dist)) dist = -tdist; diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 5178022ffad..40958f9c68f 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -509,4 +509,7 @@ typedef struct ShrinkwrapModifierData { #define MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL (1<<1) #define MOD_SHRINKWRAP_REMOVE_UNPROJECTED_FACES (1<<2) +#define MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE (1<<3) +#define MOD_SHRINKWRAP_CULL_TARGET_BACKFACE (1<<4) + #endif diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index b1d2d26bc46..e29588d7cb2 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -1830,7 +1830,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; height = 86; if (smd->shrinkType == MOD_SHRINKWRAP_NORMAL) - height += 19*3; + height += 19*5; } /* roundbox 4 free variables: corner-rounding, nop, roundbox type, shade */ uiDefBut(block, ROUNDBOX, 0, "", x-10, y-height-2, width, height-2, NULL, 5.0, 0.0, 12, 40, ""); @@ -2458,6 +2458,9 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco uiDefButBitS(block, TOG, MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL, B_MODIFIER_RECALC, "Default normal", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Allows vertices to move in the normal direction"); uiDefButBitS(block, TOG, MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL, B_MODIFIER_RECALC, "Invert normal", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Allows vertices to move in the inverse direction of their normal"); uiDefButBitS(block, TOG, MOD_SHRINKWRAP_REMOVE_UNPROJECTED_FACES, B_MODIFIER_RECALC, "Remove faces", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Remove faces where all vertices haven't been projected"); + + uiDefButBitS(block, TOG, MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE, B_MODIFIER_RECALC, "Cull frontfaces", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Controls whether a vertex can be projected to a front face on target"); + uiDefButBitS(block, TOG, MOD_SHRINKWRAP_CULL_TARGET_BACKFACE, B_MODIFIER_RECALC, "Cull backfaces", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Controls whether a vertex can be projected to a back face on target"); } but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &smd->vgroup_name, 0.0, 31.0, 0, 0, "Vertex Group name"); From db650f1be9d73b9c4d2e200a91a87fd5b2bb24d8 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Tue, 3 Jun 2008 19:20:57 +0000 Subject: [PATCH 20/76] Removed BLI_kdopbvh --- source/blender/blenlib/BLI_kdopbvh.h | 77 -- source/blender/blenlib/intern/BLI_kdopbvh.c | 988 -------------------- 2 files changed, 1065 deletions(-) delete mode 100644 source/blender/blenlib/BLI_kdopbvh.h delete mode 100644 source/blender/blenlib/intern/BLI_kdopbvh.c diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h deleted file mode 100644 index 055c2754a21..00000000000 --- a/source/blender/blenlib/BLI_kdopbvh.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2006 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): Daniel Genrich, Andre Pinto - * - * ***** END GPL LICENSE BLOCK ***** - */ - - -#ifndef BLI_KDOPBVH_H -#define BLI_KDOPBVH_H - -#include - -struct BVHTree; -typedef struct BVHTree BVHTree; - -typedef struct BVHTreeOverlap { - int indexA; - int indexB; -} BVHTreeOverlap; - -typedef struct BVHTreeNearest -{ - int index; /* the index of the nearest found (untouched if none is found within a dist radius from the given coordinates) */ - float nearest[3]; /* nearest coordinates (untouched it none is found within a dist radius from the given coordinates) */ - float dist; /* squared distance to search arround */ -} BVHTreeNearest; - -/* returns square of the minimum distance from given co to the node, nearest point is stored on nearest */ -typedef float (*BVHTree_NearestPointCallback) (void *userdata, int index, const float *co, float *nearest); - - -BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis); -void BLI_bvhtree_free(BVHTree *tree); - -/* construct: first insert points, then call balance */ -int BLI_bvhtree_insert(BVHTree *tree, int index, float *co, int numpoints); -void BLI_bvhtree_balance(BVHTree *tree); - -/* update: first update points/nodes, then call update_tree to refit the bounding volumes */ -int BLI_bvhtree_update_node(BVHTree *tree, int index, float *co, float *co_moving, int numpoints); -void BLI_bvhtree_update_tree(BVHTree *tree); - -/* collision/overlap: check two trees if they overlap, alloc's *overlap with length of the int return value */ -BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, int *result); - -float BLI_bvhtree_getepsilon(BVHTree *tree); - -/* find nearest node to the given coordinates (if nearest is given it will only search nodes where square distance is smaller than nearest->dist) */ -int BLI_bvhtree_find_nearest(BVHTree *tree, float *co, BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata); - -#endif // BLI_KDOPBVH_H - - - - diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c deleted file mode 100644 index ef7c13a8918..00000000000 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ /dev/null @@ -1,988 +0,0 @@ -/* kdop.c -* -* -* ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. The Blender -* Foundation also sells licenses for usinle in proprietary software under -* the Blender License. See http://www.blender.org/BL/ for information -* about this. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software Foundation, -* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -* -* The Original Code is Copyright (C) Blender Foundation -* All rights reserved. -* -* The Original Code is: all of this file. -* -* Contributor(s): Daniel Genrich, Andre Pinto -* -* ***** END GPL/BL DUAL LICENSE BLOCK ***** -*/ - -#include "math.h" -#include -#include -#include - -#include "MEM_guardedalloc.h" - -#include "BKE_utildefines.h" - -#include "BLI_kdopbvh.h" -#include "BLI_arithb.h" - -#ifdef _OPENMP -#include -#endif - -#define node_get_bv(tree, node) ((node)->bv) -#define node_get_child(tree,node,i) ((node)->children[i]) - -/* Util macros */ -#define TO_STR(a) #a -#define JOIN(a,b) a##b - -/* Benchmark macros */ -#if 1 - -#define BENCH(a) \ - do { \ - clock_t _clock_init = clock(); \ - (a); \ - printf("%s: %fms\n", #a, (float)(clock()-_clock_init)*1000/CLOCKS_PER_SEC); \ -} while(0) - -#define BENCH_VAR(name) clock_t JOIN(_bench_step,name) = 0, JOIN(_bench_total,name) = 0 -#define BENCH_BEGIN(name) JOIN(_bench_step, name) = clock() -#define BENCH_END(name) JOIN(_bench_total,name) += clock() - JOIN(_bench_step,name) -#define BENCH_RESET(name) JOIN(_bench_total, name) = 0 -#define BENCH_REPORT(name) printf("%s: %fms\n", TO_STR(name), JOIN(_bench_total,name)*1000.0f/CLOCKS_PER_SEC) - -#else - -#define BENCH(a) (a) -#define BENCH_VAR(name) -#define BENCH_BEGIN(name) -#define BENCH_END(name) -#define BENCH_RESET(name) -#define BENCH_REPORT(name) - -#endif - - -typedef struct BVHNode -{ - struct BVHNode **children;// max 8 children - struct BVHNode *parent; // needed for bottom - top update - float *bv; // Bounding volume of all nodes, max 13 axis - int index; // face, edge, vertex index - char totnode; // how many nodes are used, used for speedup - char traversed; // how many nodes already traversed until this level? - char main_axis; // axis that was used to split childs -} BVHNode; - -struct BVHTree -{ - BVHNode **nodes; - BVHNode *nodearray; // pre-alloc branchs - BVHNode **nodechild; // pre-alloc childs for nodes - float *nodebv; // pre-alloc bounding-volumes for nodes - float epsilon; // epslion is used for inflation of the k-dop - int totleaf; // leafs - int totbranch; - char tree_type; // type of tree (4 => quadtree) - char axis; // kdop type (6 => OBB, 7 => AABB, ...) - char start_axis, stop_axis; // KDOP_AXES array indices according to axis char start_axis, stop_axis; // KDOP_AXES array indices according to axis -}; - -typedef struct BVHOverlapData -{ - BVHTree *tree1, *tree2; - BVHTreeOverlap *overlap; - int i, max_overlap; /* i is number of overlaps */ -} BVHOverlapData; - -typedef struct BVHNearestData -{ - BVHTree *tree; - float *co; - BVHTree_NearestPointCallback callback; - void *userdata; - float proj[13]; //coordinates projection over axis - BVHTreeNearest nearest; -} BVHNearestData; -//////////////////////////////////////// - - -//////////////////////////////////////////////////////////////////////// -// Bounding Volume Hierarchy Definition -// -// Notes: From OBB until 26-DOP --> all bounding volumes possible, just choose type below -// Notes: You have to choose the type at compile time ITM -// Notes: You can choose the tree type --> binary, quad, octree, choose below -//////////////////////////////////////////////////////////////////////// - -static float KDOP_AXES[13][3] = -{ {1.0, 0, 0}, {0, 1.0, 0}, {0, 0, 1.0}, {1.0, 1.0, 1.0}, {1.0, -1.0, 1.0}, {1.0, 1.0, -1.0}, -{1.0, -1.0, -1.0}, {1.0, 1.0, 0}, {1.0, 0, 1.0}, {0, 1.0, 1.0}, {1.0, -1.0, 0}, {1.0, 0, -1.0}, -{0, 1.0, -1.0} -}; - -////////////////////////////////////////////////////////////////////////////////////////////////////// -// Introsort -// with permission deriven from the following Java code: -// http://ralphunden.net/content/tutorials/a-guide-to-introsort/ -// and he derived it from the SUN STL -////////////////////////////////////////////////////////////////////////////////////////////////////// -static int size_threshold = 16; -/* -* Common methods for all algorithms -*/ -static int floor_lg(int a) -{ - return (int)(floor(log(a)/log(2))); -} - -/* -* Insertion sort algorithm -*/ -static void bvh_insertionsort(BVHNode **a, int lo, int hi, int axis) -{ - int i,j; - BVHNode *t; - for (i=lo; i < hi; i++) - { - j=i; - t = a[i]; - while((j!=lo) && (t->bv[axis] < (a[j-1])->bv[axis])) - { - a[j] = a[j-1]; - j--; - } - a[j] = t; - } -} - -static int bvh_partition(BVHNode **a, int lo, int hi, BVHNode * x, int axis) -{ - int i=lo, j=hi; - while (1) - { - while ((a[i])->bv[axis] < x->bv[axis]) i++; - j--; - while (x->bv[axis] < (a[j])->bv[axis]) j--; - if(!(i < j)) - return i; - SWAP( BVHNode* , a[i], a[j]); - i++; - } -} - -/* -* Heapsort algorithm -*/ -static void bvh_downheap(BVHNode **a, int i, int n, int lo, int axis) -{ - BVHNode * d = a[lo+i-1]; - int child; - while (i<=n/2) - { - child = 2*i; - if ((child < n) && ((a[lo+child-1])->bv[axis] < (a[lo+child])->bv[axis])) - { - child++; - } - if (!(d->bv[axis] < (a[lo+child-1])->bv[axis])) break; - a[lo+i-1] = a[lo+child-1]; - i = child; - } - a[lo+i-1] = d; -} - -static void bvh_heapsort(BVHNode **a, int lo, int hi, int axis) -{ - int n = hi-lo, i; - for (i=n/2; i>=1; i=i-1) - { - bvh_downheap(a, i,n,lo, axis); - } - for (i=n; i>1; i=i-1) - { - SWAP(BVHNode*, a[lo],a[lo+i-1]); - bvh_downheap(a, 1,i-1,lo, axis); - } -} - -static BVHNode *bvh_medianof3(BVHNode **a, int lo, int mid, int hi, int axis) // returns Sortable -{ - if ((a[mid])->bv[axis] < (a[lo])->bv[axis]) - { - if ((a[hi])->bv[axis] < (a[mid])->bv[axis]) - return a[mid]; - else - { - if ((a[hi])->bv[axis] < (a[lo])->bv[axis]) - return a[hi]; - else - return a[lo]; - } - } - else - { - if ((a[hi])->bv[axis] < (a[mid])->bv[axis]) - { - if ((a[hi])->bv[axis] < (a[lo])->bv[axis]) - return a[lo]; - else - return a[hi]; - } - else - return a[mid]; - } -} -/* -* Quicksort algorithm modified for Introsort -*/ -static void bvh_introsort_loop (BVHNode **a, int lo, int hi, int depth_limit, int axis) -{ - int p; - - while (hi-lo > size_threshold) - { - if (depth_limit == 0) - { - bvh_heapsort(a, lo, hi, axis); - return; - } - depth_limit=depth_limit-1; - p=bvh_partition(a, lo, hi, bvh_medianof3(a, lo, lo+((hi-lo)/2)+1, hi-1, axis), axis); - bvh_introsort_loop(a, p, hi, depth_limit, axis); - hi=p; - } -} - -static void sort(BVHNode **a0, int begin, int end, int axis) -{ - if (begin < end) - { - BVHNode **a=a0; - bvh_introsort_loop(a, begin, end, 2*floor_lg(end-begin), axis); - bvh_insertionsort(a, begin, end, axis); - } -} -void sort_along_axis(BVHTree *tree, int start, int end, int axis) -{ - sort(tree->nodes, start, end, axis); -} - -//after a call to this function you can expect one of: -// every node to left of a[n] are smaller or equal to it -// every node to the right of a[n] are greater or equal to it -int partition_nth_element(BVHNode **a, int _begin, int _end, int n, int axis){ - int begin = _begin, end = _end, cut; - while(end-begin > 3) - { - cut = bvh_partition(a, begin, end, bvh_medianof3(a, begin, (begin+end)/2, end-1, axis), axis ); - if(cut <= n) - begin = cut; - else - end = cut; - } - bvh_insertionsort(a, begin, end, axis); - - return n; -} - -////////////////////////////////////////////////////////////////////////////////////////////////////// - -void BLI_bvhtree_free(BVHTree *tree) -{ - if(tree) - { - MEM_freeN(tree->nodes); - MEM_freeN(tree->nodearray); - MEM_freeN(tree->nodebv); - MEM_freeN(tree->nodechild); - MEM_freeN(tree); - } -} - -BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis) -{ - BVHTree *tree; - int numbranches=0, i; - - // only support up to octree - if(tree_type > 8) - return NULL; - - tree = (BVHTree *)MEM_callocN(sizeof(BVHTree), "BVHTree"); - - if(tree) - { - tree->epsilon = epsilon; - tree->tree_type = tree_type; - tree->axis = axis; - - if(axis == 26) - { - tree->start_axis = 0; - tree->stop_axis = 13; - } - else if(axis == 18) - { - tree->start_axis = 7; - tree->stop_axis = 13; - } - else if(axis == 14) - { - tree->start_axis = 0; - tree->stop_axis = 7; - } - else if(axis == 8) - { - tree->start_axis = 0; - tree->stop_axis = 4; - } - else if(axis == 6) // AABB - { - tree->start_axis = 0; - tree->stop_axis = 3; - } - else - { - MEM_freeN(tree); - return NULL; - } - - - // calculate max number of branches, our bvh kdop is "almost perfect" - for(i = 1; i <= (int)ceil((float)((float)log(maxsize)/(float)log(tree_type))); i++) - numbranches += (pow(tree_type, i) / tree_type); - - tree->nodes = (BVHNode **)MEM_callocN(sizeof(BVHNode *)*(numbranches+maxsize + tree_type), "BVHNodes"); - - if(!tree->nodes) - { - MEM_freeN(tree); - return NULL; - } - - tree->nodebv = (float*)MEM_callocN(sizeof(float)* axis * (numbranches+maxsize + tree_type), "BVHNodeBV"); - if(!tree->nodebv) - { - MEM_freeN(tree->nodes); - MEM_freeN(tree); - } - - tree->nodechild = (BVHNode**)MEM_callocN(sizeof(BVHNode*) * tree_type * (numbranches+maxsize + tree_type), "BVHNodeBV"); - if(!tree->nodechild) - { - MEM_freeN(tree->nodebv); - MEM_freeN(tree->nodes); - MEM_freeN(tree); - } - - tree->nodearray = (BVHNode *)MEM_callocN(sizeof(BVHNode)*(numbranches+maxsize + tree_type), "BVHNodeArray"); - - if(!tree->nodearray) - { - MEM_freeN(tree->nodechild); - MEM_freeN(tree->nodebv); - MEM_freeN(tree->nodes); - MEM_freeN(tree); - return NULL; - } - - //link the dynamic bv and child links - for(i=0; i< numbranches+maxsize + tree_type; i++) - { - tree->nodearray[i].bv = tree->nodebv + i * axis; - tree->nodearray[i].children = tree->nodechild + i * tree_type; - } - - } - - return tree; -} - - -static void create_kdop_hull(BVHTree *tree, BVHNode *node, float *co, int numpoints, int moving) -{ - float newminmax; - float *bv = node_get_bv(tree, node); - int i, k; - - // don't init boudings for the moving case - if(!moving) - { - for (i = tree->start_axis; i < tree->stop_axis; i++) - { - bv[2*i] = FLT_MAX; - bv[2*i + 1] = -FLT_MAX; - } - } - - for(k = 0; k < numpoints; k++) - { - // for all Axes. - for (i = tree->start_axis; i < tree->stop_axis; i++) - { - newminmax = INPR(&co[k * 3], KDOP_AXES[i]); - if (newminmax < bv[2 * i]) - bv[2 * i] = newminmax; - if (newminmax > bv[(2 * i) + 1]) - bv[(2 * i) + 1] = newminmax; - } - } -} - -// depends on the fact that the BVH's for each face is already build -static void refit_kdop_hull(BVHTree *tree, BVHNode *node, int start, int end) -{ - float newmin,newmax; - int i, j; - float *bv = node_get_bv(tree, node); - - for (i = tree->start_axis; i < tree->stop_axis; i++) - { - bv[2*i] = FLT_MAX; - bv[2*i + 1] = -FLT_MAX; - } - - for (j = start; j < end; j++) - { - // for all Axes. - for (i = tree->start_axis; i < tree->stop_axis; i++) - { - newmin = tree->nodes[j]->bv[(2 * i)]; - if ((newmin < bv[(2 * i)])) - bv[(2 * i)] = newmin; - - newmax = tree->nodes[j]->bv[(2 * i) + 1]; - if ((newmax > bv[(2 * i) + 1])) - bv[(2 * i) + 1] = newmax; - } - } -} - -static void inflate_kdop_hull(BVHTree *tree, BVHNode *node) -{ - int i; - float *bv = node_get_bv(tree, node); - - for(i= tree->axis; i; i--) - { - *bv++ -= tree->epsilon; // minimum - *bv++ += tree->epsilon; // maximum - } -} - -// only supports x,y,z axis in the moment -// but we should use a plain and simple function here for speed sake -static char kdop_hull_get_largest_axis(BVHTree *tree, BVHNode *node) -{ - float *bv = node_get_bv(tree, node); - float middle_point[3]; - - middle_point[0] = (bv[1]) - (bv[0]); // x axis - middle_point[1] = (bv[3]) - (bv[2]); // y axis - middle_point[2] = (bv[5]) - (bv[4]); // z axis - if (middle_point[0] > middle_point[1]) - { - if (middle_point[0] > middle_point[2]) - return 1; // max x axis - else - return 5; // max z axis - } - else - { - if (middle_point[1] > middle_point[2]) - return 3; // max y axis - else - return 5; // max z axis - } -} - - -int BLI_bvhtree_insert(BVHTree *tree, int index, float *co, int numpoints) -{ - BVHNode *node= NULL; - - // insert should only possible as long as tree->totbranch is 0 - if(tree->totbranch > 0) - return 0; - - if(tree->totleaf+1 >= MEM_allocN_len(tree->nodes)) - return 0; - - // TODO check if have enough nodes in array - - node = tree->nodes[tree->totleaf] = &(tree->nodearray[tree->totleaf]); - tree->totleaf++; - - //create and inflate hull - create_kdop_hull(tree, node, co, numpoints, 0); - inflate_kdop_hull(tree, node); - - node->index= index; - - return 1; -} - - -static void bvh_div_nodes(BVHTree *tree, BVHNode *node, int start, int end, char lastaxis) -{ - char laxis; - int i, tend; - BVHNode *tnode; - int slice = (end-start+tree->tree_type-1)/tree->tree_type; //division rounded up - - // Determine which axis to split along - laxis = kdop_hull_get_largest_axis(tree, node); - - // split nodes along longest axis - for (i=0; start < end; start += slice, i++) //i counts the current child - { - tend = start + slice; - - if(tend > end) tend = end; - - if(tend-start == 1) // ok, we have 1 left for this node - { - node->children[i] = tree->nodes[start]; - node->children[i]->parent = node; - } - else - { - partition_nth_element(tree->nodes, start, end, tend, laxis); - - tnode = node->children[i] = tree->nodes[tree->totleaf + tree->totbranch] = &(tree->nodearray[tree->totbranch + tree->totleaf]); - tree->totbranch++; - tnode->parent = node; - - if(tend != end) - partition_nth_element(tree->nodes, start, end, tend, laxis); - refit_kdop_hull(tree, tnode, start, tend); - bvh_div_nodes(tree, tnode, start, tend, laxis); - } - node->totnode++; - } - - return; -} - -static void verify_tree(BVHTree *tree) -{ - int i, j, check = 0; - - // check the pointer list - for(i = 0; i < tree->totleaf; i++) - { - if(tree->nodes[i]->parent == NULL) - printf("Leaf has no parent: %d\n", i); - else - { - for(j = 0; j < tree->tree_type; j++) - { - if(tree->nodes[i]->parent->children[j] == tree->nodes[i]) - check = 1; - } - if(!check) - { - printf("Parent child relationship doesn't match: %d\n", i); - } - check = 0; - } - } - - // check the leaf list - for(i = 0; i < tree->totleaf; i++) - { - if(tree->nodearray[i].parent == NULL) - printf("Leaf has no parent: %d\n", i); - else - { - for(j = 0; j < tree->tree_type; j++) - { - if(tree->nodearray[i].parent->children[j] == &tree->nodearray[i]) - check = 1; - } - if(!check) - { - printf("Parent child relationship doesn't match: %d\n", i); - } - check = 0; - } - } - - printf("branches: %d, leafs: %d, total: %d\n", tree->totbranch, tree->totleaf, tree->totbranch + tree->totleaf); -} - -void BLI_bvhtree_balance(BVHTree *tree) -{ - BVHNode *node; - - if(tree->totleaf == 0) - return; - - // create root node - node = tree->nodes[tree->totleaf] = &(tree->nodearray[tree->totleaf]); - tree->totbranch++; - - // refit root bvh node - refit_kdop_hull(tree, tree->nodes[tree->totleaf], 0, tree->totleaf); - // create + balance tree - bvh_div_nodes(tree, tree->nodes[tree->totleaf], 0, tree->totleaf, 0); - - // verify_tree(tree); -} - -// overlap - is it possbile for 2 bv's to collide ? -static int tree_overlap(BVHNode *node1, BVHNode *node2, int start_axis, int stop_axis) -{ - float *bv1 = node1->bv; - float *bv2 = node2->bv; - - float *bv1_end = bv1 + (stop_axis<<1); - - bv1 += start_axis<<1; - bv2 += start_axis<<1; - - // test all axis if min + max overlap - for (; bv1 != bv1_end; bv1+=2, bv2+=2) - { - if ((*(bv1) > *(bv2 + 1)) || (*(bv2) > *(bv1 + 1))) - return 0; - } - - return 1; -} - -static void traverse(BVHOverlapData *data, BVHNode *node1, BVHNode *node2) -{ - int j; - - if(tree_overlap(node1, node2, MIN2(data->tree1->start_axis, data->tree2->start_axis), MIN2(data->tree1->stop_axis, data->tree2->stop_axis))) - { - // check if node1 is a leaf - if(node1->index) - { - // check if node2 is a leaf - if(node2->index) - { - - if(node1 == node2) - { - return; - } - - if(data->i >= data->max_overlap) - { - // try to make alloc'ed memory bigger - data->overlap = realloc(data->overlap, sizeof(BVHTreeOverlap)*data->max_overlap*2); - - if(!data->overlap) - { - printf("Out of Memory in traverse\n"); - return; - } - data->max_overlap *= 2; - } - - // both leafs, insert overlap! - data->overlap[data->i].indexA = node1->index; - data->overlap[data->i].indexB = node2->index; - - data->i++; - } - else - { - for(j = 0; j < data->tree2->tree_type; j++) - { - if(node2->children[j]) - traverse(data, node1, node2->children[j]); - } - } - } - else - { - - for(j = 0; j < data->tree2->tree_type; j++) - { - if(node1->children[j]) - traverse(data, node1->children[j], node2); - } - } - } - return; -} - -BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, int *result) -{ - int j, total = 0; - BVHTreeOverlap *overlap = NULL, *to = NULL; - BVHOverlapData **data; - - // check for compatibility of both trees (can't compare 14-DOP with 18-DOP) - if((tree1->axis != tree2->axis) && ((tree1->axis == 14) || tree2->axis == 14)) - return 0; - - // fast check root nodes for collision before doing big splitting + traversal - if(!tree_overlap(tree1->nodes[tree1->totleaf], tree2->nodes[tree2->totleaf], MIN2(tree1->start_axis, tree2->start_axis), MIN2(tree1->stop_axis, tree2->stop_axis))) - return 0; - - data = MEM_callocN(sizeof(BVHOverlapData *)* tree1->tree_type, "BVHOverlapData_star"); - - for(j = 0; j < tree1->tree_type; j++) - { - data[j] = (BVHOverlapData *)MEM_callocN(sizeof(BVHOverlapData), "BVHOverlapData"); - - // init BVHOverlapData - data[j]->overlap = (BVHTreeOverlap *)malloc(sizeof(BVHTreeOverlap)*MAX2(tree1->totleaf, tree2->totleaf)); - data[j]->tree1 = tree1; - data[j]->tree2 = tree2; - data[j]->max_overlap = MAX2(tree1->totleaf, tree2->totleaf); - data[j]->i = 0; - } - -#pragma omp parallel for private(j) schedule(static) - for(j = 0; j < tree1->tree_type; j++) - { - traverse(data[j], tree1->nodes[tree1->totleaf]->children[j], tree2->nodes[tree2->totleaf]); - } - - for(j = 0; j < tree1->tree_type; j++) - total += data[j]->i; - - to = overlap = (BVHTreeOverlap *)MEM_callocN(sizeof(BVHTreeOverlap)*total, "BVHTreeOverlap"); - - for(j = 0; j < tree1->tree_type; j++) - { - memcpy(to, data[j]->overlap, data[j]->i*sizeof(BVHTreeOverlap)); - to+=data[j]->i; - } - - for(j = 0; j < tree1->tree_type; j++) - { - free(data[j]->overlap); - MEM_freeN(data[j]); - } - MEM_freeN(data); - - (*result) = total; - return overlap; -} - - -// bottom up update of bvh tree: -// join the 4 children here -static void node_join(BVHTree *tree, BVHNode *node) -{ - int i, j; - - for (i = tree->start_axis; i < tree->stop_axis; i++) - { - node->bv[2*i] = FLT_MAX; - node->bv[2*i + 1] = -FLT_MAX; - } - - for (i = 0; i < tree->tree_type; i++) - { - if (node->children[i]) - { - for (j = tree->start_axis; j < tree->stop_axis; j++) - { - // update minimum - if (node->children[i]->bv[(2 * j)] < node->bv[(2 * j)]) - node->bv[(2 * j)] = node->children[i]->bv[(2 * j)]; - - // update maximum - if (node->children[i]->bv[(2 * j) + 1] > node->bv[(2 * j) + 1]) - node->bv[(2 * j) + 1] = node->children[i]->bv[(2 * j) + 1]; - } - } - else - break; - } -} - -// call before BLI_bvhtree_update_tree() -int BLI_bvhtree_update_node(BVHTree *tree, int index, float *co, float *co_moving, int numpoints) -{ - BVHNode *node= NULL; - - // check if index exists - if(index > tree->totleaf) - return 0; - - node = tree->nodearray + index; - - create_kdop_hull(tree, node, co, numpoints, 0); - - if(co_moving) - create_kdop_hull(tree, node, co_moving, numpoints, 1); - - // inflate the bv with some epsilon - inflate_kdop_hull(tree, node); - - return 1; -} - -// call BLI_bvhtree_update_node() first for every node/point/triangle -void BLI_bvhtree_update_tree(BVHTree *tree) -{ - BVHNode *leaf, *parent; - - // reset tree traversing flag - for (leaf = tree->nodearray + tree->totleaf; leaf != tree->nodearray + tree->totleaf + tree->totbranch; leaf++) - leaf->traversed = 0; - - for (leaf = tree->nodearray; leaf != tree->nodearray + tree->totleaf; leaf++) - { - for (parent = leaf->parent; parent; parent = parent->parent) - { - parent->traversed++; // we tried to go up in hierarchy - if (parent->traversed < parent->totnode) - break; // we do not need to check further - else - node_join(tree, parent); - } - } -} - -float BLI_bvhtree_getepsilon(BVHTree *tree) -{ - return tree->epsilon; -} - - -//Nearest neighbour -static float squared_dist(const float *a, const float *b) -{ - float tmp[3]; - VECSUB(tmp, a, b); - return INPR(tmp, tmp); -} - -static float calc_nearest_point(BVHNearestData *data, BVHNode *node, float *nearest) -{ - int i; - const float *bv = node_get_bv(data->tree, node); - - //nearest on AABB hull - for(i=0; i != 3; i++, bv += 2) - { - if(bv[0] > data->proj[i]) - nearest[i] = bv[0]; - else if(bv[1] < data->proj[i]) - nearest[i] = bv[1]; - else - nearest[i] = data->proj[i]; - } - -/* - //nearest on a general hull - VECCOPY(nearest, data->co); - for(i = data->tree->start_axis; i != data->tree->stop_axis; i++, bv+=2) - { - float proj = INPR( nearest, KDOP_AXES[i]); - float dl = bv[0] - proj; - float du = bv[1] - proj; - - if(dl > 0) - { - VECADDFAC(nearest, nearest, KDOP_AXES[i], dl); - } - else if(du < 0) - { - VECADDFAC(nearest, nearest, KDOP_AXES[i], du); - } - } -*/ - return squared_dist(data->co, nearest); -} - - -static void dfs_find_nearest(BVHNearestData *data, BVHNode *node) -{ - int i; - float nearest[3], sdist; - - sdist = calc_nearest_point(data, node, nearest); - if(sdist >= data->nearest.dist) return; - - if(node->totnode == 0) - { - if(data->callback) - sdist = data->callback(data->userdata , node->index, data->co, nearest); - - if(sdist >= data->nearest.dist) return; - - data->nearest.index = node->index; - VECCOPY(data->nearest.nearest, nearest); - data->nearest.dist = sdist; - } - else - { - if(sdist < data->nearest.dist) - { - for(i=0; i != node->totnode; i++) - { - dfs_find_nearest(data, node->children[i]); - } - } - } -} - -int BLI_bvhtree_find_nearest(BVHTree *tree, float *co, BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata) -{ - int i; - - BVHNearestData data; - - //init data to search - data.tree = tree; - data.co = co; - - data.callback = callback; - data.userdata = userdata; - - for(i = data.tree->start_axis; i != data.tree->stop_axis; i++) - { - data.proj[i] = INPR(data.co, KDOP_AXES[i]); - } - - if(nearest) - { - memcpy( &data.nearest , nearest, sizeof(*nearest) ); - } - else - { - data.nearest.index = -1; - data.nearest.dist = FLT_MAX; - } - - //dfs search - dfs_find_nearest(&data, tree->nodes[tree->totleaf] ); - - //copy back results - if(nearest) - { - memcpy(nearest, &data.nearest, sizeof(*nearest)); - } - - return data.nearest.index; -} - From a39c8de24be8511f121f61ab2c8bd424901a0e5c Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Tue, 3 Jun 2008 19:56:19 +0000 Subject: [PATCH 21/76] Reason of last commits kdopbvh tree is now on trunk. Added those files to the branch and added code for NearestNeighbour, needed for shrinkwrap --- source/blender/blenlib/BLI_kdopbvh.h | 14 ++ source/blender/blenlib/intern/BLI_kdopbvh.c | 154 ++++++++++++++++++-- 2 files changed, 157 insertions(+), 11 deletions(-) diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h index b81ff0ee66f..41ff97d111d 100644 --- a/source/blender/blenlib/BLI_kdopbvh.h +++ b/source/blender/blenlib/BLI_kdopbvh.h @@ -40,6 +40,17 @@ typedef struct BVHTreeOverlap { int indexB; } BVHTreeOverlap; +typedef struct BVHTreeNearest +{ + int index; /* the index of the nearest found (untouched if none is found within a dist radius from the given coordinates) */ + float nearest[3]; /* nearest coordinates (untouched it none is found within a dist radius from the given coordinates) */ + float dist; /* squared distance to search arround */ +} BVHTreeNearest; + +/* returns square of the minimum distance from given co to the node, nearest point is stored on nearest */ +typedef float (*BVHTree_NearestPointCallback) (void *userdata, int index, const float *co, float *nearest); + + BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis); void BLI_bvhtree_free(BVHTree *tree); @@ -56,5 +67,8 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, int *result) float BLI_bvhtree_getepsilon(BVHTree *tree); +/* find nearest node to the given coordinates (if nearest is given it will only search nodes where square distance is smaller than nearest->dist) */ +int BLI_bvhtree_find_nearest(BVHTree *tree, float *co, BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata); + #endif // BLI_KDOPBVH_H diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index 9c4238431dc..2dc345e894e 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -73,6 +73,16 @@ typedef struct BVHOverlapData BVHTreeOverlap *overlap; int i, max_overlap; /* i is number of overlaps */ } BVHOverlapData; + +typedef struct BVHNearestData +{ + BVHTree *tree; + float *co; + BVHTree_NearestPointCallback callback; + void *userdata; + float proj[13]; //coordinates projection over axis + BVHTreeNearest nearest; +} BVHNearestData; //////////////////////////////////////// @@ -242,7 +252,6 @@ void sort_along_axis(BVHTree *tree, int start, int end, int axis) // every node to the right of a[n] are greater or equal to it int partition_nth_element(BVHNode **a, int _begin, int _end, int n, int axis){ int begin = _begin, end = _end, cut; - int i; while(end-begin > 3) { cut = bvh_partition(a, begin, end, bvh_medianof3(a, begin, (begin+end)/2, end-1, axis), axis ); @@ -256,7 +265,6 @@ int partition_nth_element(BVHNode **a, int _begin, int _end, int n, int axis){ return n; } - ////////////////////////////////////////////////////////////////////////////////////////////////////// void BLI_bvhtree_free(BVHTree *tree) @@ -374,6 +382,7 @@ BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis) static void create_kdop_hull(BVHTree *tree, BVHNode *node, float *co, int numpoints, int moving) { float newminmax; + float *bv = node->bv; int i, k; // don't init boudings for the moving case @@ -381,8 +390,8 @@ static void create_kdop_hull(BVHTree *tree, BVHNode *node, float *co, int numpoi { for (i = tree->start_axis; i < tree->stop_axis; i++) { - node->bv[2*i] = FLT_MAX; - node->bv[2*i + 1] = -FLT_MAX; + bv[2*i] = FLT_MAX; + bv[2*i + 1] = -FLT_MAX; } } @@ -392,10 +401,10 @@ static void create_kdop_hull(BVHTree *tree, BVHNode *node, float *co, int numpoi for (i = tree->start_axis; i < tree->stop_axis; i++) { newminmax = INPR(&co[k * 3], KDOP_AXES[i]); - if (newminmax < node->bv[2 * i]) - node->bv[2 * i] = newminmax; - if (newminmax > node->bv[(2 * i) + 1]) - node->bv[(2 * i) + 1] = newminmax; + if (newminmax < bv[2 * i]) + bv[2 * i] = newminmax; + if (newminmax > bv[(2 * i) + 1]) + bv[(2 * i) + 1] = newminmax; } } } @@ -591,8 +600,11 @@ void BLI_bvhtree_balance(BVHTree *tree) } // overlap - is it possbile for 2 bv's to collide ? -static int tree_overlap(float *bv1, float *bv2, int start_axis, int stop_axis) +static int tree_overlap(BVHNode *node1, BVHNode *node2, int start_axis, int stop_axis) { + float *bv1 = node1->bv; + float *bv2 = node2->bv; + float *bv1_end = bv1 + (stop_axis<<1); bv1 += start_axis<<1; @@ -612,7 +624,7 @@ static void traverse(BVHOverlapData *data, BVHNode *node1, BVHNode *node2) { int j; - if(tree_overlap(node1->bv, node2->bv, MIN2(data->tree1->start_axis, data->tree2->start_axis), MIN2(data->tree1->stop_axis, data->tree2->stop_axis))) + if(tree_overlap(node1, node2, MIN2(data->tree1->start_axis, data->tree2->start_axis), MIN2(data->tree1->stop_axis, data->tree2->stop_axis))) { // check if node1 is a leaf if(!node1->totnode) @@ -678,7 +690,7 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, int *result) return 0; // fast check root nodes for collision before doing big splitting + traversal - if(!tree_overlap(tree1->nodes[tree1->totleaf]->bv, tree2->nodes[tree2->totleaf]->bv, MIN2(tree1->start_axis, tree2->start_axis), MIN2(tree1->stop_axis, tree2->stop_axis))) + if(!tree_overlap(tree1->nodes[tree1->totleaf], tree2->nodes[tree2->totleaf], MIN2(tree1->start_axis, tree2->start_axis), MIN2(tree1->stop_axis, tree2->stop_axis))) return 0; data = MEM_callocN(sizeof(BVHOverlapData *)* tree1->tree_type, "BVHOverlapData_star"); @@ -809,3 +821,123 @@ float BLI_bvhtree_getepsilon(BVHTree *tree) { return tree->epsilon; } + + +//Nearest neighbour +static float squared_dist(const float *a, const float *b) +{ + float tmp[3]; + VECSUB(tmp, a, b); + return INPR(tmp, tmp); +} + +static float calc_nearest_point(BVHNearestData *data, BVHNode *node, float *nearest) +{ + int i; + const float *bv = node->bv; + + //nearest on AABB hull + for(i=0; i != 3; i++, bv += 2) + { + if(bv[0] > data->proj[i]) + nearest[i] = bv[0]; + else if(bv[1] < data->proj[i]) + nearest[i] = bv[1]; + else + nearest[i] = data->proj[i]; + } + +/* + //nearest on a general hull + VECCOPY(nearest, data->co); + for(i = data->tree->start_axis; i != data->tree->stop_axis; i++, bv+=2) + { + float proj = INPR( nearest, KDOP_AXES[i]); + float dl = bv[0] - proj; + float du = bv[1] - proj; + + if(dl > 0) + { + VECADDFAC(nearest, nearest, KDOP_AXES[i], dl); + } + else if(du < 0) + { + VECADDFAC(nearest, nearest, KDOP_AXES[i], du); + } + } +*/ + return squared_dist(data->co, nearest); +} + + +static void dfs_find_nearest(BVHNearestData *data, BVHNode *node) +{ + int i; + float nearest[3], sdist; + + sdist = calc_nearest_point(data, node, nearest); + if(sdist >= data->nearest.dist) return; + + if(node->totnode == 0) + { + if(data->callback) + sdist = data->callback(data->userdata , node->index, data->co, nearest); + + if(sdist >= data->nearest.dist) return; + + data->nearest.index = node->index; + VECCOPY(data->nearest.nearest, nearest); + data->nearest.dist = sdist; + } + else + { + if(sdist < data->nearest.dist) + { + for(i=0; i != node->totnode; i++) + { + dfs_find_nearest(data, node->children[i]); + } + } + } +} + +int BLI_bvhtree_find_nearest(BVHTree *tree, float *co, BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata) +{ + int i; + + BVHNearestData data; + + //init data to search + data.tree = tree; + data.co = co; + + data.callback = callback; + data.userdata = userdata; + + for(i = data.tree->start_axis; i != data.tree->stop_axis; i++) + { + data.proj[i] = INPR(data.co, KDOP_AXES[i]); + } + + if(nearest) + { + memcpy( &data.nearest , nearest, sizeof(*nearest) ); + } + else + { + data.nearest.index = -1; + data.nearest.dist = FLT_MAX; + } + + //dfs search + dfs_find_nearest(&data, tree->nodes[tree->totleaf] ); + + //copy back results + if(nearest) + { + memcpy(nearest, &data.nearest, sizeof(*nearest)); + } + + return data.nearest.index; +} + From b5432c6780d41302155f8aad382be173341bdea2 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Wed, 11 Jun 2008 22:35:27 +0000 Subject: [PATCH 22/76] Added sample "CreatePlane" .. it simple projects a grid over the selected image and determines which squares are to be used. --- release/scripts/CreatePlane.py | 154 +++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 release/scripts/CreatePlane.py diff --git a/release/scripts/CreatePlane.py b/release/scripts/CreatePlane.py new file mode 100644 index 00000000000..5b72c60f541 --- /dev/null +++ b/release/scripts/CreatePlane.py @@ -0,0 +1,154 @@ +#!BPY + +""" +Name: 'Import Plane from Image' +Blender: 245 +Group: 'Add' +Tooltip: 'Import a plane topology from a 2d Image' +""" + +__author__ = "André Pinto" +__url__ = ["www.blender.org"] +__version__ = "2008-06-06" + +__bpydoc__ = """\ +This script extracts a plane from an image. +""" + +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# The Original Code is Copyright (C) Blender Foundation. +# All rights reserved. +# +# The Original Code is: all of this file. +# +# Contributor(s): André Pinto +# +# ***** END GPL LICENSE BLOCK ***** + +import Blender, bpy + +def matrix(dima, dimb): + return [[0 for b in range(dimb)] for a in range(dima)] + +def makelist(a): + res = [] + for i in a: + res.append(i) + return res + +def dotProduct(a): + sum = 0.0 + for i in a: + sum += i*i + return sum + +# For now simply decompose in a triangle fan +def DecomposePolygon(poly): + for i in range(2, len(poly), 1): + yield [ poly[0], poly[i-1], poly[i] ] + + +def Expand3dCoordsFrom2d(coords): + for c in coords: + yield ( c[0] , c[1], 0 ) + + +# For now return the full image +def ExtractSections(image): + x_samples = 250 + y_samples = 250 + + mdim = max( image.size ) + dx = float(image.size[0]) / x_samples + dy = float(image.size[1]) / y_samples + ox = -float(x_samples)*0.5 + oy = -float(y_samples)*0.5 + + def scale(a): + return ( (a[0] + ox)*dx , (a[1] + oy)*dy ) + + used = matrix(x_samples, y_samples) + for a in range(x_samples): + for b in range(y_samples): + if dotProduct(image.getPixelHDR( (int)(a*dx), (int)(b*dy))) <= 1: + used[a][b] = 1 + + for a in range(x_samples-1): + for b in range(y_samples-1): + sum = used[a][b] + used[a+1][b] + used[a][b+1] + used[a+1][b+1] + + if sum == 4: + yield map( scale, [ (a,b) , (a+1,b), (a+1,b+1), (a,b+1) ] ) + elif sum == 3: + if not used[a][b]: + yield map( scale, [ (a+1,b), (a+1,b+1) , (a,b+1) ] ) + if not used[a+1][b]: + yield map( scale, [ (a,b), (a+1,b+1) , (a,b+1) ] ) + if not used[a][b+1]: + yield map( scale, [ (a,b), (a+1,b) , (a+1,b+1) ] ) + if not used[a+1][b+1]: + yield map( scale, [ (a,b), (a+1,b) , (a,b+1) ] ) + + +def ImportPlaneFromImage(image, mesh): + + new_verts = [] + new_faces = [] + + vert_dict = {} + + def getVertex(vert): + if vert not in vert_dict: + new_verts.append( (vert[0], vert[1], 0) ) + vert_dict[ vert ] = len( new_verts )-1 + + return vert_dict[ vert ] + + for poly in ExtractSections(image): + offset = len(new_verts) + + poly = map( getVertex, poly ) + if len(poly) == 4: + new_faces.append( [poly[0], poly[1], poly[2],poly[3]] ) + if len(poly) == 3: + new_faces.append( [ poly[0], poly[1], poly[2] ] ) + + # perform a single extend, extend is O( N ) + mesh.verts.extend( new_verts ) + mesh.faces.extend( new_faces ) + + + +#use the current image on the image editor? or ask the user what image to load +#image = Blender.Image.GetCurrent() + +def load_image(filename): + print "Loading ",filename + #for now create a new mesh + mesh = bpy.data.meshes.new('Plane') + Blender.Scene.GetCurrent().objects.new(mesh) + + image = Blender.Image.Load(filename) + print image + ImportPlaneFromImage(image, mesh) + Blender.Redraw() + + +image = Blender.Window.FileSelector(load_image, "Load Image") + + From 39d35edbe680424f88ddc2cff8ecd86fb77fae89 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Wed, 11 Jun 2008 22:53:52 +0000 Subject: [PATCH 23/76] Merge from trunk svn merge -r 15104:15202 https://svn.blender.org/svnroot/bf-blender/trunk/blender --- extern/bFTGL/SConscript | 2 +- extern/libopenjpeg/opj_malloc.h | 6 +- extern/libopenjpeg/patches/osx.patch | 17 + release/datafiles/blenderbuttons | Bin 69070 -> 69599 bytes release/scripts/import_dxf.py | 1031 ++-- source/blender/blenkernel/BKE_object.h | 1 + .../blender/blenkernel/intern/DerivedMesh.c | 4 - .../blender/blenkernel/intern/cdderivedmesh.c | 9 + source/blender/blenkernel/intern/collision.c | 150 +- source/blender/blenkernel/intern/customdata.c | 2 +- source/blender/blenkernel/intern/library.c | 2 +- source/blender/blenkernel/intern/object.c | 28 + .../blenkernel/intern/particle_system.c | 17 +- source/blender/blenkernel/intern/pointcache.c | 2 +- source/blender/blenkernel/intern/text.c | 14 +- source/blender/blenlib/BLI_arithb.h | 4 + source/blender/blenlib/intern/BLI_kdopbvh.c | 24 +- source/blender/blenlib/intern/arithb.c | 67 + source/blender/blenlib/intern/bpath.c | 3 - source/blender/blenlib/intern/util.c | 62 +- source/blender/include/BIF_resources.h | 2 +- source/blender/include/BSE_view.h | 4 + source/blender/include/transform.h | 5 + source/blender/makesdna/DNA_meshdata_types.h | 4 +- source/blender/makesdna/DNA_scene_types.h | 11 +- source/blender/python/BPY_interface.c | 33 +- source/blender/python/api2_2x/Blender.c | 8 +- source/blender/python/api2_2x/Object.c | 94 + source/blender/python/api2_2x/Particle.c | 14 +- source/blender/python/api2_2x/Sys.c | 5 +- source/blender/python/api2_2x/doc/Object.py | 2 + source/blender/python/api2_2x/sceneRender.c | 3 +- .../render/extern/include/RE_pipeline.h | 2 + .../render/intern/include/render_types.h | 1 + .../render/intern/source/convertblender.c | 74 +- .../blender/render/intern/source/rendercore.c | 16 +- source/blender/src/blenderbuttons.c | 4338 +++++++++-------- source/blender/src/buttons_editing.c | 3 +- source/blender/src/buttons_object.c | 4 +- source/blender/src/buttons_scene.c | 15 +- source/blender/src/drawipo.c | 8 +- source/blender/src/drawmesh.c | 12 +- source/blender/src/drawview.c | 1 + source/blender/src/editmesh_lib.c | 13 +- source/blender/src/editnode.c | 16 +- source/blender/src/editparticle.c | 36 +- source/blender/src/header_view3d.c | 16 + source/blender/src/meshtools.c | 5 +- source/blender/src/space.c | 25 +- source/blender/src/transform.c | 166 +- source/blender/src/transform_generics.c | 1 - source/blender/src/transform_snap.c | 516 +- source/blender/src/view.c | 89 +- .../Converter/BL_ArmatureObject.cpp | 13 +- .../GamePlayer/common/GPC_PolygonMaterial.cpp | 11 +- .../gameengine/Ketsji/KX_BlenderMaterial.cpp | 9 +- source/gameengine/Ketsji/KX_RayCast.cpp | 1 + .../Rasterizer/RAS_2DFilterManager.cpp | 4 + .../RAS_GLExtensionManager.h | 4 +- 59 files changed, 3998 insertions(+), 3031 deletions(-) create mode 100644 extern/libopenjpeg/patches/osx.patch diff --git a/extern/bFTGL/SConscript b/extern/bFTGL/SConscript index bd20db5a459..c03992631e6 100644 --- a/extern/bFTGL/SConscript +++ b/extern/bFTGL/SConscript @@ -22,7 +22,7 @@ Import('env') #ftgl_env.Append (CPPDEFINES = defines) -incs = 'include src ' + env['BF_FREETYPE_INC'] +incs = 'include src ' + env['BF_FREETYPE_INC'] + ' ' + env['BF_OPENGL_INC'] defs = '' sources = env.Glob('src/*.cpp') diff --git a/extern/libopenjpeg/opj_malloc.h b/extern/libopenjpeg/opj_malloc.h index 79698f8ff1b..4e9727af0f3 100644 --- a/extern/libopenjpeg/opj_malloc.h +++ b/extern/libopenjpeg/opj_malloc.h @@ -76,8 +76,10 @@ Allocate memory aligned to a 16 byte boundry #if defined(__sun) #define HAVE_MEMALIGN #elif defined(__GNUC__) - #define HAVE_MEMALIGN - #include + #ifndef __APPLE__ + #define HAVE_MEMALIGN + #include + #endif /* Linux x86_64 and OSX always align allocations to 16 bytes */ #elif !defined(__amd64__) && !defined(__APPLE__) /* FIXME: Yes, this is a big assumption */ diff --git a/extern/libopenjpeg/patches/osx.patch b/extern/libopenjpeg/patches/osx.patch new file mode 100644 index 00000000000..c518978eed6 --- /dev/null +++ b/extern/libopenjpeg/patches/osx.patch @@ -0,0 +1,17 @@ +Index: opj_malloc.h +=================================================================== +--- opj_malloc.h (revision 15089) ++++ opj_malloc.h (working copy) +@@ -76,8 +76,10 @@ + #if defined(__sun) + #define HAVE_MEMALIGN + #elif defined(__GNUC__) +- #define HAVE_MEMALIGN +- #include ++ #ifndef __APPLE__ ++ #define HAVE_MEMALIGN ++ #include ++ #endif + /* Linux x86_64 and OSX always align allocations to 16 bytes */ + #elif !defined(__amd64__) && !defined(__APPLE__) + /* FIXME: Yes, this is a big assumption */ diff --git a/release/datafiles/blenderbuttons b/release/datafiles/blenderbuttons index ebd0ec82ebda124f306c90764fe75abfb055b279..a4834091692c0cc61b50ad4c1604350d12622b2e 100644 GIT binary patch literal 69599 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μ9qM%fZ^TAnH2G&6r-1c{ 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 literal 69070 zcmagGWmFt(&@I}7ySux)1eX8-f?IG6!QCAuSa1mr!9uX$!IIz-+}+*XT~5E>J>U6z zVS0vXX3b*ysi$i1UAu@>Q;|bQAwdBE0R6qZj0OO}fImV2Bn0r`U&4qL_<-h1w~c zsX9X(cQt8O9X3L|cW`eT%q-KNN5tABEW^XG)8Y9leA?0p-AUV_m9zPO?hyXp z3(nJk)fdy9p^R?Lw`JNDe=XQP>*VMd^X7q19wrCUl9Hrxad09U#ZQcUidA!OexIWg zaRDn2X9JI{gKmq!orp9`${TMePe#nr@U~%#FFz7>w}D&E^!e5PWMW2!UeLF1-=5OE zQ=2?4XfS}6;oK5Uu!z-0t50Fs*`{nyb zVE}MExHk1b80^=_2dL=j;orZ1ubk?nJV8QYKyWy7%J`DAC)Fa4_0*}i*XR@?#Z8O? zxO^@2mUD$6@0KiV#X8;7SbkVOIywrCi9!4G{3kg%x%$^q2a!-DUs6t~-uk5{Mn`d~Y$%!W7x`Du6jt@7{`)JxN6_atn9cIB|IQ1GXJ0S5 z6$fz-?|N7DV5R*%Fa{~0XPzVUhj|MiFeCg~3M5ZVOr##|>-)`ml~NH?kq>(k_UPbH zZt^Eelmfpii244#vCJq_xGGJAcIj4k1RwA5Le{lFWu}q8r@+$K`mtexKrgz_pi>#7 zI^fasekZ6cZ0eS<9}EUn{fTz_ZcO0Af-MzZdfTa3NhK3iz{v^CuOi{@Tq9XO+O_;I z6jI=o0x#IZrKLgM(8*#|Ic;riSlB%Ng(${r=Z$XUui#GTjU)FPwDP+>`B$Wzbr7FL+UOj8 zz7n+$ElI~<`oL6keP4=1f6nx@dblV0hxgYKRS@aK!~_#iu2)<1&*6=&8%N#jff`G! z&CTE14STjdKiqw*RY&!J288{FqL`ToxTTXv2llOUmv(XKR@TM92j>I z?$NctipdhxD~G;k!#cZXX-UUM@gU=DPvcimVhFrP4@qa7I2=Z()ncKKjU}#;b8t8g zayUgrLHX$)5I`I&+cj^(>%KP@Z^%wtIK^CpE45R1m2r{n^Sb=kL%Q4q(8qzVW_)FF z;GcLsH-5HyU3!7Rf+!h(J&iXKu!kSse&F)R}=a_b!e1ot@GSxDRGgYa}mXI2_;BuFGY_P78PyWoo`{RD(wCn|sbhVoAA5*gg0R6JV2tc#Vp zeG*LVUtzG$48Km3fHANsNWjli6^q+c5B9kHv)y+6-kcXAuAr1aT&Bp=S+A{|;d(ttyr$Os=pY~W;&wWoRsz;Zbj>2>`k#4pmY$krl zfT@5%IWzgU=frMm-^bf(gxRLxKdh)+UKS8bc9Hnvl~;7lom|IrSY~Esmwv9_np-AX zT2pk~a&mHApZGq`jpehykQ=1?U+xSi3~pan?Vwc@^>J}?k0(AIqFd=DSfiEe8YvX^mp}J_=8$b(&h}WUEI@u3rDY*I+fH0 z<#bjYxpQ&p&J4D>+Kyu*k5U)#A+qi{Wcs6lCj4iYaz&x%aIFy?F*x|7M6RTiC6vRQ zoT*UI?}kk_o&r5mW&(N_5)zU>xt}+=ucogb)$7i=9=)cMnQSxoS>V>+K38aG(1`wI z##P&X)q^g`3PZ!~HY+9N9WO60m~lQI9oa8TJO&V}C4=E-=#y10F5viM}}ZVBF!Kai^Fm-b#~`Nl_#&ggwhe9a9j ziUEKzQuMLIYl^{!#0GXb3JMCx)8Wn!78`rW0{9B<@Aiq65u$gUxH_$E6%|tmuDd*OxZx8D7WY@3VY`9#3-aPpR?F zO_Pk_fV*v@o{Uc0=#JDY8YL@2;KQ_I3L`sv?7{>jr=9Qv0QESW`L6`){&i=LqYy(0 z>3~K>p=9Z32L)(p;kg6ezaNV0(ux*Z3It9|-;V3*w;TD~Bv!}7#1Jgk#y&yXHEF2? z1R7&go+evg9uD13n=eObNd+8b8XcDbAY0fYSfdn=UAKCz`{ntuZFqP%)=>)!(yk5@ zho3cUACbY|D3GCS6M|Mih#G;NdwwlYVQ-k0Xdym*^~ ziK%45n$OVO>;-%?6F!pIikZ}h+tXFsUw6aUx33d9&ms1Tm7CWqV%7GKo{haQbIn1d z`vPYgJ@KRStpOqcRh<)QBZ^5euXKe){zSFfOijs$T1N?JkL=5$-~G*LmEoV@g@px? zB0lXZp6ty`Q3*?4Q3+{@LUOJ_aZ>GSPJcCE8o4hVTKc>pjoW5k$ic*>y=2z z%slw&`nCTP9XEH)XY4hierJ#J;BnK?aZ_mjC%D1P!~RuMF3Ga#@0FDpw)Kw)&;XQn z1XZ!uVd5+Zik4nvxIPIsQXv5?6)kKjGqYncELpz^6_z9&&RaGDX*L2s_f_-<4_s!5 z6>|l1StC>>rehe}1?inAou&k=fi^N6Jk+EGSt7t6X6<~5MNv@`LXz{Y_(ySZ!LMI9 zAjXpdcfk3}<0&l%2ZnI=$hdTE#*|m`oe{mY>Lf&&7$>I>#6qQvfvOL(=36GJZ~Vn| zQ#}O8*K%`nU-ySHcrkB|7X<)d#qU%M4-XFj!Z9i1DhwJwZuKR$#*5wPnyIL$yovAi zJJNoK85$bytW$~iOXwn?smU{TIC38^Aa0klbPYQ{92>bVW=_sw>oO*ffr9bPeVJm} zbKHr97$2LUYni6`6vu9x!(u}*gKExGJ^N9WMk!Ig+T2FNl)hO|F*cBuCh=R5?J6Z@ zELm6Hxo%p-T>!;-yK%6w&++K@gZ&?aFem2wMO=wOJaS=o>$8mhPd|gEXJ(`d#`B7b zcH)>Z7e!yi{BHOn;O6?;Oxgm+4n3};;ugw@3GpWfMs+$r@#F_+;VD_V6>Ocx(bSMY z8olWoN~4G0@i=k=F-5)?5}sE?b;9IRw*1Ko^tN_(q~4wF2xzxCz0mzh!+w%bsTFxlD%tR>w5jI z?d|mtOmXWgS4v6)xb0tyTgRn34zK>?xn7#R?A$ygim1P78JU?QL4ZmnBt&f96LT)e zbH1Hsf|Ke{lBAa!)?^OZ*xckS{PE*z^|#CBp7a-tdq#SC^7_QKY4tF9y6>}nv?}}HnSxrc zkKSVJR4j91NSqtA!gJHr{Y%j6giIw{H1g&7LAq*Ix_DB$YI1$isrB=*u#WJ<#rEKM znH6Wc5`*DicjWT^h>5Qg+5trk=7*W^5pi*z@43PBTWzU0_u7|el0R;vR;>NDR7*e5?lmZ7-Hz^}u5E6@ zN=QiDJ>GYWjw13$Wy%0TjUrR4cq4e)UGAQcpNXhEfyDApL2BUAI9!5appc+9U~zaF?;p05iFy{UDBxpD_~MAu~eH0mko zto)oFhde77SN@dkLv;FAHAmZO9+edoXuwscX8&U%N865j(MZk4#`c;hN8!UJCf4$p z!E3cakAv*A(H$v6hx2(;kSFlz?kUYA@Q+EZc!1~Ap~TgqZlr56xbv$v+*e1Uk0zz8L-?|q+ ze$bJLc-prgOqUUYq1*9z+V;90M=ny7mYTYvw_$CALUm<}ZCjonb%=)|evc1Lr+RMZHE>%qf7;9wvu ztgPJNM-VZ7-=O|lrc>1eV%U5EqP)q&yhaSiiG6k(C_byU;0FefIdbUzg0rk8W>onW z3UxwW?CI&*uvN!aP*kk3ne<8*e^x(QY>Z!!gUQsC1bG({G)1A%(3~PcL=)d3C&<{C zg3n{Y7gniI`)#3yRN>D{K|IIHmkL&h?W*bs3tHfD)nh8;%5H@ zW8cO?<(YzIXg=$*h0D`P`S|=9+&X2OI^8FMXo~AbR{#_WuM%T1vu`!hHbG7%FVDr1 zR>HQ@mcgrdTy=;JNOx820%Q^PAl#bW9_T-*pkJET151 z+(eqImCL*|G@V}Ocb!hJk0T#98xLpn-Tal!K>|TZPfrg4z*R}i&L%&b)-hp+ftvTm zp&u_d-RAgp0@XgduXmp2m&W0wnlKJCPD@McNXLssIakNhuZ(F=2dUc&`feHy7Kih- zj3YT>i%?xK`ZH`28DqEH&T!nL9Z?c^7XAjM|NKE-iYCiSj2+{_T3XY)FbYlu< zQ|yjr!jLct1#a2Cn?XwU zUw!rzpI=%3?iH!Z1?$w-@|90;(e$Vprq$J$?U3 zfzLqeM(VZ@IXVPL*cC>7vm&!9CeHM#j{2`tVkA?EA%=t>1;D~*>)`x_q5II`;UB0m zTh8YfPg#u?TFdO&`_|<|CAyZfZBk>jjXQfSvV75}?M7D8uC8sR#V_cmcBvO8F`svd zej$q4a5*&(&o3SpmY;@&8rh}gp;Hprmc@XJ1PHvyPw>WLVSx;4Zt~S#L^@EiasX_iAS7%GY1l z$BTp@bC$NS2#Bag1+;VwXcSaM&%1N=_2Nb&G!!Uz%qKCV8P z8-6WH8Cax(8Ef*{tmSLPD+D%D5zN;k9gz^#^h(}>wGIO0a-j8uNOxjintoPnJ08($ z1Z5r{w?PV#Nr8&|OMR9@l_e*;k9QI4X@KEh`j6x!2Z_z<1z!mA$JO)I_ZBMRMZ&ep zR;=vUE;bV(&P~Yn;JYF(rY!~dLFR-f5~!uC?PfVzQm%vm@kZKy6D8i?IK09xsjT+Hs07G8X?Ed|{xYO9%}OB}f~bUwEnbocaT9XE^H% zt4?K|zMi4p%B;~hf9cOj)o5ts*)$!aa(}5OdNJE5+agamzP8ogcr|i-StPMTUQ)dE zBNTu2tYCAx&t`cfUqwIjd`F}|i9{q3*nCG}2i;PAaacs*FCPZZSmK)y*_DyqPnI&k z_(5X*?C6>gNO_2OBwQiHOQxyc5lkh|0_tM1OHcoJnOUr z{-2C#4BP&{(&U|DUI!Z#tUwK6 zDt(tl&BPS(*}|8>q*Ti_S>tk9OMJ2Qa(;fkj-MdYrXuC0`FFrvjk#QBcO&RG|qfiHS@soW=F^^$pL&OZp$jR&+&MJ>DTxr_(QHw;2gnt_mbe)my5* zl>2Cg<8UQcsU7aGm2&=Vp||q%^bB_B*E}J^LU6hxzHR7Av4KxvcXG+${oTCqC@Qj22$)xkd4xvxz4WpbT z2Qn5M_TOND-Uff|c9)31PBOafU#eo37OPCg>h+?(ybuD8EcLI9Ye|$4R}OaeipHkV z9v9|?R5k%S)t3r0IKFFg)&5`nTOb^zqNVLB^mAqWKJl%2CTeIdNut+9x7HHFpB?h~c>t7%O$W6`3IkEYIQSJMZxj6o1w#x7ys65gJg36;As62}2%5doy ze#NJq=&Q4Hnp*vBYrpSwW~A<@QOZZwZVL2T@aSzD?d-z=@-SS)?Qf*y-xO+1qqw#e zB#R#~cdW3R5*6vuhGFsGK@+fW-ZEEMAN<`x!;?Y^0JWp>8uMO*22`U~f1i&oE;Zk< zq>T7set>lG_B&?|na|-4&(dv&?rSu*YSTV{eUWIPM#kArmeYWyreR=e*6uj88BttX2L)HH53${EoTaq`tZ6woTRF8p4v*rk-KmXW$<;C;T0 zszL+g7aPo;E-q{>+o3&PGh{e50ynbBs%lRG>w}0GDA?r&UP8j6N*dSWta7P@Mx@ph zx2B8D!HNeP#kog3D>IHu`>;2pTXo&2V378{>_f3)R=(a_L18Wo^&c#I7Y zBGcC!+_YMj^MIHBb$_0+D4$3^DH#zD2S^Axwr+PeX7NTdqXV%huJ^l>>#p z0E#3!)EX#ub8{1c+>uE}wD<$LJ-xk6&AY*IljpG?5OQ5`84+1bQSgxNXi|)a2vI!P zINN7UlhfUwE=X;;Rkg|lNMkfg>-t|7H;@48AF$9@2owC-FD;gUI1S%t6`yJqd11VE zUqApLLpZ~NS|L-bYABQ$Fa?rOe+sYl-_J&?S!F;&bjFrMgQ9%2u+>4&1Xq{=u$Fvr z+Zjq+l!GnL?FVaI)*2gm0=WBuJcu6eBwqFHN-i05_hhcke<#=2{8tw)fVI9vTGtxg znC9kYghz5Nw2;Qtz^u9C<&kWW?f+I-AL0=AElINmcxDN^h>~dd2ye#p(BeP`#kRsU zR{ULK5lkkyP>!Q=gd;72LhpSXMjS3Lkzaja&v9;X=WV0KwgCU$nf(-NoR~Qy=_ZuB zMiK3JeKVd%{~ZDb*<49;HP`yH6g925|L-GA+0&Ma1hQnHLQ<+>Fb1iiu3vz2t4cAC%hpZ=;*%N+7}p)mVMuoOc>VM$ZA( z)_YUnBC|UN>L3mVavy+#t2odALhLHiUY8p(c#8O2BM>AY0F3ir4AgjL`4moxMYW51lOx(GcYhes_Kx4fvy(=1%|efwcG9 z&6H;xP@5sbdK0%}0h^E`7-zJ0#$=5!L>f%}!TKnT0c0;yS(cPP9Q~u z!V?!8j~dztuz?DW?2-`?3>BdysZ<|>UAF(G^%$Q;-X{x-{^PFyqM%fwA*jv&{z9hA zY|K7>bYS4?;+Opl8x+F@i}|ob;#Xxc8@E-&kc?D%uZDb8^9%cdm<)!(lYxR{1~PGf zuu(PC{vUErVpL`5{`YTN(3qAWdK=U{Jm|G^$8OG?ehbn<0!_ZbGfy&%HHd5bbo(OX zz&*rWBs2^=S!98!x9Hg}lY2skiOWcw0}bPr@q!1x2xAXQq5c+Y#yHflLK^Wi(%VqR z^w%RaeMUTdI?u>_BqUp{qVL+|Jnki{uJ|JMIYG{a@}qaII1&ZabZp7z$T*ky{1!AR zU&ADAsBRpJghFOAZ_`9*M?e}NW3>q(xqJdqs#grKXf>Qz^Xy~Qy~h;qh|&6C^#{w^ z&*q)ZXLf1_xdIqKO6r$E*pt=BH=FluE@Z|*&mR6y=e^fkZMM@ajTT_E6pVW-FyZ~G zz(Ov8Ko1TM*z@!ABlq|BT?JYP5uwGof%?f=Sy?IB*~^yeonc2Jr_Ga49cgLlnxNMg zIDipbMs}{B_ z$+Y8#ZKoC>gU^F4oRYm$M5dN2)Ud%TteYaoOvSngO(~avP`8O|+^S0wHdV z0E}S=*a!i+3%B)HUbji${X1hVExP#VTKm#L7qW@TNgE?0a*)~teeAx4)d@yDxl>n^UVc$o`@+r3DHIfkR#kanZ=APcY6(M6lPQ`< z3quDcXd^_E@c60Ecm5{xaF={4Uc zUxAMC%f*5IBRb%i`opGA%vaRv|Mdc74i6S5laO)v;IyBHCRikER4}dw0VaB{O%{M4 zPLUSNGb2=Q#_G>EtdC%~%k9vj^_ACt zj_c{H3)6cmQ4VLJ&W6^C2;p*flu_H_YqiZJ!=Db*c9274YPr)^t|X*k9wK9Xz4ZGb zRCBwJ^(ROAJ3TybmE}Yy$AtiY#%@M(uV5hktJCs4pxDKUSolD@he1QJ0(j=XDvUY z?mhzvJNCxXOk~B&x2h8 z2INKY<`W`h=j{hSd{ANTUO8<15`ff3Z;dYG;o;#5tX49MM0TN?iy62GmM&g2zuS4TDvdP zlFuX5`Xk^JWREn>wl3@P7$A&q-jyhpb%BcXv!|}}mPn3xpCv7zQR>bHMaM8c4g`3? zMsKU@zYzM+v-0)R_sZMb%!SjT30lA+GWBW`m+Cz?;Ky7zz_7)POzl@O8?es6EDliN zwc7((NYt2W3b%eZ5UNl*SY4Dn+(IpBBw~!UOf8lVnhLx|v4A{#Q7fxLbf3K=)Q$+U z##ES$6TRq;4h_ee=y)^Im5l@~=v~D*Z4+mcc*%NTlC(!{ewFBa3JP^9)VOU9O6r%1 zr2n?HW^jMHOlJcmj@#1VXf~otRy^Yvy`xfll<;o@ z`D6JWr7J#~ikl#YzFA6K5J(>07rc|%$YGz{YCn-pSuQ-BU5z*%gOp6PU;yyK_?}S; ztbWT9!p&*ilx;?urn~!DPn`pQ0f0&1Af$>^i8-vW&;T*?i-0Y#Bte~WjvaSAXdB3S zGRIq*b@4#3xxMJv^>6$HvAO zfvKTfiPv1P7>$teZ-WA*!tK%g<%f?SH+aQ-uOu}zaE3=lDmi;Wahe(@()oCSAJoRP z>g;CYV&mgqx1a7WV^Lya_qB^A_a`wZM1M2zv1#EGVX2|zkF}Ge3#VF@OkaNZ(28Jk z9vd~#{_N*jwLjf7s!?EUFw62^Ux{9$bV~c~&CD$1kgw^1i3utcn&4R-;|vFtWp`&S zZH5~JTFNk7$y}y=mlZ=3;N!S;Y5#K@`WhVd z4^$|PA88l7PdtqGjKVKrJ3Wt?&FN4qYUpWZl2t`CBQWGX4J0TOmI3~g$)aUL7Qhpz zq|TYKXA!0PY_vg$WRWt^*9ZZTEEY=B47pXAO3FBM*q#{T%_*Y)JU2AF$MMZA!${RF zjhMTBY)%UmnlMI*UJq9`?jWP7YJIQ`$kJ;I6dN8K>e*1W zoshp~mz8&aXmJtC#o|ZeHsWCJhl3U&KpLV?xCz_821|1iM$#5DDGdHQ9#o8rq(<7; zcONGEU=&C$l~48E>&K~iz3pTpP$_b02%!^Hd9~|=RlfS94DGpi4MMDQ|Cw|A2!>N# z;l&%rB}q3|S4kfB@beX~CvMMtk^;H-aFNLulK&!!23Yc14Oq~Y*JP5CmbL<_g^I&L zjGN67mxXLLiaej5wM1Qr|sjb~yE}lc|-|p@HQt4$HB!8Vg*qK|b+AqjC_Pei^mi%24 z=;shwBiwKLY4!NF=jrK5I}$iE%{U>%Tnhj=^&@*{TO~Sp)dd>QOktiZHwk>f3f|cG_{V_(S}<#3Xvo%Rba;dS`fc36zDD&6q4{%P zfE;JQGiT3(-RTdIHi^cNOgoqOxx2gnPuj{B@lx3mRB5#yr?JgKkVonO<-jaHmcP5( z>rG=3-9VF@m{ok3<-W%nC3YTJLYutgp`gUn9!wq;?0C>rT=!09iw8n40buagGwJ|i z?L$b0v}GW+>^uF5>`;yROpDbvpUWL(!i6afpcS6bmZD0mMyULIIRd`G^x9=vz#$%9 zJqvFv5+TC5kkSnC&?>t>zc|zPUCnxx2!>wbKXrm%vg_tABt)i_G4F0hV5mw_>ST;H zDIW9QhMbT{{|Kxuh<&=$D^D?a&{gbToq6-0S9jRfN&P52C#Q9S z1U}s|8=H$=OzhcDCpZc?0JPr8$=y;4xqjN;e|l;V&W`Kbex$~UZvP*}p0UOEdZOsZ z5418+*In2x0tNdQP_Q3;xTTz%?<45}1^X*D9j!YwAfjWe)u@RwIs$2Q{XER+={EbH z$7m0>|Mu!k_O{ZJ6U5Gs3ONe z)2Eg|JKl>4KootAjg1$tQn)YGpygFh+sT`JY%2maXWBdnrya1v%dc_$S)NCM}^E+x)g^< zu%}EEOHA_pa*pqG2)1VT;cU5@V4sbl5EHh#+8c)hD7@Dojmcw`X~r~=IFiC7lekas zRAGP?3z(0{19P&LCT=yvx`+RiqT3O@JwU5QS+u_<8$pvWX&B&rs&>Pi+jo;qv9pG2 zpkX+|yKiTcg(R`D%Su%q8S;Im4+lAsY1)1^qKG_Lw!icIIroqM>2VJHn1+wC57_AP zYPIXjeH171yJR=NnCXwbJE_J_p3pAU$wI50H$(?qTwK`ovHE0Rw6#D$xF8U!-Frj_ zT%9b7C{$>SlJZ!e;o7FKB=FZ3_4V~-sjI7}X|YUq4h#&y=nV3kEx{4AM}NVfASae^ z-GYmh!I7054#jdNtC+FDW98f-Obcjobcoi5bLRtwfR}l+&vTpU*A@+}Bq7A9*w>0P@OU20!I7>nepwUKL(yeON*o#*g0s{=WLsWbxHy5wOI_mX_S~y> z+?kkGT^u2XA3|tJUDPx-EcYzsuF#V%Qz@s9ZhLh&8NtW27jdmSx<8Y2q`}3(l3|ua z;wRFr{093o27#lbPRT09qaX%!Fh$<%L;v$rHf`T8$Ff3JSiPO|9~xE)lo&RDXxJFk z=o%6b65htoBxHbFgp-f&Y9GwD9*#snIln6kKqUV0?jsOQ&go7@yTu|KOYwlpR;r6A zlW*53&fdD)g9fx9x?1y6PEIs3;TlJw76QI`=Fv`KM246F)uV8SyB*D z|K}{JKx&#!PJZ%VQ3n?LF^T<~_@2b9*7%)z%E;!UDsg{)IvKwBQQEq4{h*qmzRENt zqMFdr%?w?YBb9r5p}@s4N+5 zka5r~TRuy@+54}42Jhd+%#?sOt!XxC8lnL@Fx>K!@(u$t`R~so^6@z)&#LCO22swF zKrI~|P2CAY_D<#1emnrf;VzU;>~cX)wP-u&X5*@>C58kCmuBtDXRM0cP?Py$ImypW zzmh=9o2+bj@8R$&$3?Ra4d9h~ZW@XHjQ&?AdD`rzSL`n-6)~4-`>J_FIVj*m#4*pX zv7NuYlbhXdUS37zd}(-Se?)3N+c<@tK`W_yGjaR1jnMchyW{^?@DF;&M+D2|wxbj; z=lG_f!PERA@aZK8IpDz~rO|;hrDVot3vtUQvVYRJ?_6sos;YqwZBIZcu(l4b701Mo zlUd3CB;!5BpxyDKn4hU-=b2gdHjW9!ohX8gl3I~(hBwRU)^H%QbU1n<;=?&0uIA>8 z?o#hxgW2Qj-K@&kFa5=r?R0Ovpm8Ajy4hcjb6LODZ27Mb+o}B94l%~l4$A|t z^9?j%Cu4=A+}9=f=N|E^yxn7q(b2|+T|_Y_&gj~oHh|9DnxXDd0mWe1->YTzZISC4 z{&@WT_IKHiLbvL=rM(x%6;YkJ`Bg6`7ohyxR+9~X`tQ+W5wJ#iP@d2Qvd#1u^VCF* zJg28A=Prgf;9xM;-%|I9IBUFI&*oBzGgFkyvYt+x^9f>HteUr~kO@{(a+tItSX3Yc z$PM+`D6C{UZ6o8sW&ia|RWvb(I8bd|%X$sKkc=_1QfTK&2)bAiVPg6nvA3s!_5SX+ zy2jYn28~Wbph}n&H60Ez3M%S22Mu86FHv_$6l(gO%0H4AtqbaEY5mTh$%#dsd+y%Q z)nZ-YfK&ZrcLK-R<+e1FS^F*|CL#Vr{k4E$peu!R^ta(UtLGu^_wV1af=vAWs5k+% zUjYWHHV%%r#nYy`-T%Hx3`QA(D!sCz;-kTERhz+j%$|XF3n!G?flmCDot^!d8Y{Z} z{>~p597y-@8sueq3h?Tjc0+WWx1(a-4rx;$rC%*K33^M1ryv-IdUbty>F2#6L#eA> z-DDu=x$u41P!axp;RLk3ySx$~L+V4gr=+e?bZO!O#+U3|NEjE5Bc*oUV<#UKN!>uqfU23|8baOhY$TrUZ zK|Pu&^fQ$>M9`;_$ZF&n*CgQ9?Rl3BQIzi^oSF_sJ7t*Fs5BNq=-qn2R{esdJwYcB z+5ru8vEF2rY2xCBk&?z@yO66+M})*9Ce6p_r*_r+#8siRz0U~aqr*ZvJAdn~%LD`C zFGk9Ngzfv*rRG~wa3!L8wN zLL-ym$mdccqU^^B!~N|Ae~rOY2#g;9Rig=4FGegL=MeHgYxlcV&0fHjtl_0b$Vuq@ z<&9!T4?ptr3(54m=TpirsE>_JALMjK$rHSelM;xQFR5>1HNCi@tVvxTsw)u9VGZGtmV~2MtOLkE<>6C!l%O(Rpbu-0_J)z6}=2QO!ndH$yac z=#$1GPJvB&egWIE&^pVYHlfn`{x5R-yK{HFq^v2T1KY8pLy79MSY}gM1rC_Vo$_nnc$Xz!NkuoPq%w0LS|vu%Su|qX9V4ZTU-Y3w71q-!@r)FVqTgT6bNNm-JM*F zk{H&Rjzkl5ouOXC;FkbW`LN44Iw_Cyz9DMO} z=mk3o6o&)1Q??$RU|V_{bPOB)b?+!qFTf%qidb0CU;6C=t5aqC4^&Y1zo`Eee)ixJ-a(W~S_}v^0>D5|t zgKjB+8V=OquB*WOi~0qV^5u^fi`Yg~b5q8X!!Frr$STtP7mPUM09VQ41maLENa0ks zp0RB0`zl->!=_e;Zl_Rq_x-=ebJM3+SwFsXPg+UJOAFsF5k!c`CI3r3QW^5nR-{WT+`i8JAV2eeeA2ycf%`|n1OR~82 z?z`1n^bb&DI9l^y**>{!8K6}X$+?wEG*~#6AnL-7Ni;D!bK|2k8DjW_s4bsK#Y2~K zpydwl$n_5o6EB0w{=UBSTQIMPffRTMORCd?XWpyY{$y)1xPeXgkLz|%mVgrtFE4IL zlh-ahIFqn}@m1W5Lmfa)*0_(tXWas*l$AZ^S-DAK%jEP$lGK>~^IBJ1yuPs6@wHnB zHQJRefSFj{^9J8{Bb5H5#qH}Y=(uZhUujO3)Daq-?RMN>Z1Mu)&CWVEdGjVotDgor z*J%?aL91ldWd3VAq(;JNj_a_4m{;7Bz{8Mh_ZYEwZUB zY`IYzsfBl#NNw6?N4ZRPbk(eh$`TQ8=V3`kgp1KJ$Wvn34W%SoC%8Wa8-1dG9hyjA zeb?_XoLYqmS!XK61^75BFAqkwADek@J?x3N(Lmq0|3*zOg~6)ShU#2{gF#EzC-ky5 zxIyiGl^U;8V;^sCK`>JLc+k2UWvqmd;9x*gOrCPqo8P|IEH@|1thvG-KNSPsv7{6! zrE{%!fh8eerp52}LnszT`z}BM=Zw`3qhNzgz2yO*8YVW{-yEIF75zvc7x9FS?n-l{ zZGuMUJ#a*8CFnH(?93yAYK`dYapS77C+F9og=WkbXLo|O`4a50IW{1C)clT3Zdw@E zF9eI`0{8p@9*J9b;_-z;-XCL+8^s}De~WR$d<6~pjJRNx&OtWAdF|Xj6c5M~gDGH; zw3;zbv1f0cPmipLJO_XZg0=H30{ZiP41g=^__l}{F#$20u`@|kEP887>#1&1>XUdY zw5YOt{)+`nRnC)gIWa;C@`66Qt+MQtb*viERLO_gx9a(_$`us+9?G2gfwHaXI8yDK z*jTb~wHd+F1k##*$c5VqQ%nbWT3PA^V+B8cknM7OldZVm3;&01>+0lA0mxQ-Ik`aB zdiA83{x_SaF(X-6-cj$y=q$L&y5(RTKQNeP_Qo|etj5QS0X;o6RkqwL$Q)!)qhY9o ztux?qDT7l!ZJ_8+2|=sV{@aVHf=o-h3$&k!2XKM8Im(=n<5RA%-m! zqxo7~h$I&Fda7X(|IjasK>`^WnYH2hT5iyWVxKa28YNmDdj%Rao>2h|GC?f(H8aA0 zXvioSCmrTQPrO3J^$Pe31CEkZYayeJ&0w2M28Yr;GVW#X;vAR5VF!#_q*cfJniq?% zra_7SIXLbim?yf~0I>WRH~K#F&i>;}9Ow2tvC|5^N8;;sZ;3Yt#;w(d?>bnN%}}iB zC=|36BZx_B7_5)V&L^W5|3AL5M?uSNFRQb6SA(Nf0j)<}UM7C$g0ZIuGVM#CHUfs6`H!47D21LBFe64A_#aZjPKO=O8r6j=; z>&oQ#4KH#tizONMUbO`+4i-wHo2vXKU-MQl;+=oG9&E|D)X$ffmy$|#J|A4lpeqsx z)U7QLIoxKC&iU_ZzCe0AZp7QrRI*I{!p;cn;aT!r-r!BaYBp4G;6yksY{EMDrxN@& zI=$95e~J3^cf+bM1Jq(0`|JE9XgK%>%(*Mbqk8+n2@B5Z7{sEtC z$srmO>xYe_Q=P;#FBE!I4S5NydZO_le7dn-O89Cp+fvOoYW_=PIEWr`ggp`!9rzd}KECKAWkb&cs|Ni~^9r!H#Uy~N(ik92M--Isv z!DfuRjg(aIDrl#Hsnb7hqr-WR0UiCsGw+|FR8&U-NFz~8DU>1)D>>zYFg;0PD5I8I zoF=&1ZTDm7c!ar#=NQ;{vjS^n6Hi7tPWxYQ{l_`$1ckFe5c7aaLn=%J+?d71 zS{$c4(sec@31d$jfw7Bm^YgsPTb&Q6#!!i^T+vANmcV!Nfiu>VdI+y;jGj ztAgy2jVww7{mkDXA8V>CE7|v%8o+i@I~ZcBnvya%CH449{IOC1K)Mf6Rq`cI=I1v> z!t@u1XQC9{@Yy)ssE_VB$^MIKg#0Lgl!OBlDFXut1G3_|@t_;j^nBwVChTu&yXCt<|WC`#<20SwO%H z^lYosBBBB3x4j$xqW_yC25W3O9ts=+!UmX?4}0N%^9YV{_nz7-NowjI^{kEHGODbB ze#Glpfs{?Hsi~{8%Uih=Dad^y?HaErkrIQohp;o5j)ZO^Kd~7fkzuJh24JoX>+Fec z;v^RDl@`PR2c6s7iz?dblj%y_g)#nyBmM07S)hV}2N zb}#BD58jmSn?&5$bm&K3)LeYI%#?hM(qI`J?!P_V5ml*%P6kGLu{QCe38xEbVXES~ zIe#2x}n1wct@u1~VR z&*ixw2QvXF{FkLlNAV5-SHGPyeUM+K0V5?oRBxNi6eDRZ$MsEp$uQ#fmqM81TZk!o z`}Q}dasKrVU&N75eBcPThwmUpJtlqkTO5*U`_GgIiq(f`VUlP_BH~Eq=lQ<9Z>jJ) z;KZKjQpw+Y9W8{e#_iCJ5Q&u7ICQ&Uk$7;uMG7~Aw7jdyP+}muf;qc`k;GIR`AV~g zM?U$3ts)0DUe5HR@))UL$yBPR^#)T60>&DwCh$rh+PUfz`I#|FJVu5xMV z%*Oj4+VX3|A;3}u-mOPXL`C&}_xFFZ6!~i&^PqP0RUjPv7XsAGrEbsHu@$fYP~H)t zZ;pQDD;5j`OHB}E%2S({+-d)&%bE`?*q_aZD`z;pK!h9_8`t0iw^aC@W@nLIBI=kH zre=J+-ny{EUTov5n*vIF;{flCJ6ij*UP?*CNNBaWKtg)pUfm7e&nq(jd$=Bx!1jNv zI@u?=#pbbsiC%b=oR3Ji^fBEcucu;9&5u_0y07T6F%%g~)c=R3vjB@KTD$O>p@!~| z7L_igJ4FPf8ze*!X#}KUNRf~ZX+#{DreH?j^k~y=_-rru| zTJQdL=S&*DCGmxrt`&uC5;zqMx)G!3%U1NAfjDlDy8(1|_Hzr1>J|ET`1$t`NXr{x zL(rDQOHwtxR;Ngv6@R%$%ZXhEYc%}v1AwSg!hZRiRwH}KAZI@lr}NKf#@z_4R%Di_>7dyWHsv2i%w||#BL@suAl;j6wR`vn_O4PW^QF!hY>^<};feGq!?(D#YM4Mr8U)^%;nCx;D%v zd_U)4D{6m1&1V*kASO1rx~0O*Q6gZaXZsGXwS8Tkun9urXHFC7#lZFS^ol>}$>xvC zgU3??oEU8^4@aIOah_-&Dba~7-SrNoN59>%aoTKih#;hM-Bkpbrl~NQN9Qi310M*q z-`_PqyW9ztG2uvk5~WmBTO|AJqTPj=d=e!_(&87aVD-J7lk2{h23F>CC@wQoE!)?d zmDju}qA61WaYWp4^zs)e1#NKRqu3uB?BSJ_d^1XQKMHq+{|wYE$Um)EZyf9D>}ukN679i5AJwMk ziwiVFmzI$@`@^D^#zk8!*rgwrhwKv9Ak)dlwDyh4R>v_>G~-*^G%Y(DR(xdD3*}IN2@TXIr?Aou5B8P*AF|~`CIcMPCBeH^@xYEmY$UW>N zOg=YibIs$pWA1{DZR={8crQ*jCB@jql9Zi-J*i;$qshri_5xEc;mgN~8D9{#*+Xn` zjYk6wAYPSy>ObT=Z$P_1{5F4!AqFp$|M!{s^U=k5FErXeG^@LGq};?@^5XB^t(jB8 zue%pH*Gmpmm{F3kZb`N6T{9K8M9Xi13MPL95z-E2%|jt(IN;ITi>T?Hs=DkSrq`<# z)}=E9kIPe9s#ct%d`5Qw8W+0IG*$!|DuY#@A*D6x^!M$TVu>kI?+&9&z=U`_X&t5 z#X5wCO7-Koo#P)Rn1xh5iaHQ=zD^Ews*z?7dovw_7#Q`H$QMuNN|=Mx@7hGL5nbx& zj2buJosR+Yomd6Rtl6jC_2<>`&Ro6MK8rdv<*laPCi43bWGgTK{qWPrp=%~Oy8iww ze5kW%kkY6^KW%{3_EYL|*SLMX_qMo`StHStb3$Ex-L{Xvrk7uUA#TWe_?oyPN6}zd`%9*W!jYkWfhlw3 zucr9r?cu}L4+Ew72orBigQC|8TZ6AiwD?0YNgm8o4!1V%!MzXjPxqIC&#S70Grws@ z-_p={6lWN{+cF0?bl|`BWXjwffvvzZs-trV3h`nb`MW?0OnFBqLKI2@w$|&ysVJ_> zy;yR)>Cg8*nKrlQ>9SKWr46i& z;DtTQ$2XFZvKuS@3A!hb06XI??rj33GsLaQPBGcsbJ=YfWo_&4{fjD~`CrMuz&qq? z&*l8j?miF@m$1AJk8QSN#d1n!BAW z9r3kdChtS(%nld7iEFL)8)-(~Qk_&UQ{Dm3ruXu93BPnhTaq^IpBx+N0}kDzKm!>ox>E7Z#)m z!(x}=Lvo!r{+6y^w(zXfArq!kW4#%vmta`);_$PJhJ zB~jyb>%~TyfFSLYY@F3!(`?kh-RjjIj5XEZ#^yfh9GKcz=M)3Xd>F_`jc2*x38;vf zFY$ihCg4=z2tV1l$MC=cIg?Qi^S>y@{Shs5yc|0RVPc%6-V>!^NyL@#^n?1m~@y#0}ls`8qY{V9`fFemdQ|6qG+lHKxhIVtC@!LBwQYZ~~6!UekV4nJL zj#VU5ME&}zcBQX@g%Wb#oS|G8KZJkTd7$Vcg0q~rkedIO)IzhIU^S2~=(Rch_ggVU z@p71yv^=4qUdND2nwXnSmH<#TRoK-0Fn@n__yJHndnX@6s!f`y;du~)goj#j=|Pjb z7zfAWEZ|aqy)(;kOT@`E%Mb}Rkc(jaD}~9AWNZ8e1xro4e`fGFg13M3RFK2Av%&=i}n|N%)xJ&>g z{0L9B6R-ZIG;C1cywim5qgoj9;LgCUHeTXL{;{n_}HYLKhK(d@%M8#YRXol=+d` zJRu>OOT+uiUO+#(qT0V3cs+rPg@j>zQhM}Aqs8Tq{1A|2DdAp{A|j`*lZi4HfA1WZ zRkm=B+X~JjzI!WxU=Xe3zmgX@Sc@jln0YtN{0TOHJrYmDId}WJP&VmgprK@Av-Tp9 z^~vXKX@6s{{iTQQ_R|kqt!&vVp-zc-oLt5R^P&EJx0rp=HBHPj8-lU0FV3f9CC!%y zcfNl&*0txdtTmQn*bO@I5i6}V)>Jt+M4zM{>;J@EHYDmHU^-xCRVL4T8x+ZBx>$+% zH!$9mm)G6+d|}nE1df~-xl@2)#a6OAzo+7C0I$Lec`*N7D5bMaD2!drE-K*nCk18X z8VlO4=1IEX+bx~ld@Hir=`}3o*RaK>UN!Hb_%Qi{L$x?V083wVXbPplu24^9F zq?LAj8ym|8=GweRfPq8%;5nk}9Roga>GD4P)&`_Mko`*1J^?aIwDR2pu{*h@yt{Oa zj4gf}VvM9Hnw(c>u0G{L-TY==weyy^y zua%cCPwoZKiE1{|Hvn-@($7Y8h zQDlfjhFoonL9nT_fhQjeTjf5>_-7dN&>|S{fe*UMh$EUR_gfbpK6`mmkfvhQ%G?lb z)6R6www$s3WM)CfvpN(9q=GBUK!rhxL>N|;lkoA;bZ;^a1~`8``rd$_jWEQ#)F#x} z>VN}`O0a&}c=($)cZ7vcQh{S03s5UC)(5j{_=v5HdV#Z9kLaFkrvh%($Gi6m-0Aq+ zPBeGt#UC*Vj(c=9T^l2 z(6N7KTtA97^c67=5c&8iDkjDw=IiTER>yLJRP;PHvf=D|7_$=!y*FZhUoO236bWM{ubA1M&Dj4d`Bn7s z^0mJ~cc+Za)v|WsL%;lNdj(j)>QL6_^?^7Fri)0~Q-iRFP%e!mYn0lpcip>0ON9 zS!QM3_S$)Ggu_TLy7-4@!SNw#=usT-L-|`{V5d_*w3rZC@H^afZaHV=1&%7uqzY zp~4xRJC&#dL9A5rY?$FQ&(k6Ey<&}+^3n?JM_*$c9MI38OHRNtf-(leL4zNNSW^zd zz^F|`6@`TtCa*U{o_nA#V6lgUH9*4@x6lxCB#98DNJ#JX=x0+vvyZiqQd@r%^`z0g z>c#E4O)qS}_m`duYvLMZFh6A+zm4kYnhOk)%)b5_nq%xLVY-WsE|uTiM-S_Q{Lh=+ zlGNsouV1gPMYN0z?l!h81OT4R@R@+Y9o%0mj8@&`|9W-SU5=OTQ$kz6kF!c0Q{6^k zKhR4xWc=2B6ldx4lS-gB&6_n#v|xUJejgSHpp6R{7NEkLYR2-moi4pctCMqwgX3R6 z0J~H!N;SJN2s+Q3f{cttJP=}ic4oyWsHi>^7P1y{*ug}VFVVfLue1UJP*BbERrsc9 zOU?mR?`j}v*y)*Fz<9%)04>+9Q-}%HqEo9m9OsN{pu5-wpnjJ&6;*N z)rqxRzl{0Lq;uiG=Sc#?>s_6s0(jHO#0>Ry5G+qv^xk(yp6t7C7UeE$E(aV zN_>fX_&toHorpNHBK|WwWWO64D(<*5(Zb*iYcGF%y>&N-P-ct|%d{KiL|U{X!cBA? zo;PwjYGRplAzqb?`J>ItEZ*l+S7h3nUw9AeKRf`!%X>0ibTx=1XJXQ5y7$Z;^JO6D zx3qf15ZZoh3hY@uIQ~=(J8dLu!+AcOD@Ost99BNsnkEM-b`Tw@ECj=J$wA`I21Ds^ z*a0y!5`rVx!3RlhK0_ia3q$p>ub==J#Pv@S* z{#D&PTd(PtizuuWtd;BPmGg4Q1tY9dUXqae2@fCAmwX<MLuhl1h}NeX)0 z`e9*VSt=?jK5%5Wb^-|P9Q87bdhO*>Na{$r^?>JA@bROv^@H~_lk4#y;jMECjPlACO)XVnnnGeTxo5U6>1qo{_D`$>D73QsGH>@1s4ZsFb0e9d;9tE=2r6SeM z)B5`I7q-BQ!BG7&Yrv|jv#p(Z34nFd)}(hr7eOQ5(+MD!EWxV9Sl67_LI%d-O9uz; z&own1scF3i2bHCzeY+$1kMJSDbwl9d%6WT>0fGuCBjdY+1K{%W+~HPJQQ5#+OlPwM zFY+T56}%7m&eqo^-`rnjxl!?&_85IGz4>LXnyzmL5^?F5+y0HK(GO|`+R2aJL^hCI z0m61Q$WBpEQ!m#}`jv_LHk-wlcQg8`L9!=5h-J3al$GmI9poBc^f;4A5SSHrSXeMy zdh8I?yrzh_4u2KYtaN29v||8pkj4oqDTPkunU|f(bFP0c>&iiaewC0nZU>kwSyale zUw1ksRkmETDD7?MB zOMy2lhaw4F#2a8OH^d4!4sYMSl>=2FHbe(tpKOH%1>1{vz;nP@N~4L&AZS5L1Nio;#x%f@`QVy3PA z>UT?_tcptHm}{1HAZ1XhnNRPz|M|h{tU=*?z&svoUC4VmMudclDjc)|?%ut7_7HV^ zA0(dJvJ3Vrha?XPd_b@4HF!abi;EXkcG8=h@Sn_G-vyl!UB`u%xvW#A2cXG7c^eb( zL<#GCclpnY_^uF8T=S7$ol4v82M7Qw8-0hr$4yN;%<0nHtjBk>>y`B+{39k^tsOJ$uqL?Bsy5B%-C zINrQ>b16Y1`0}nn*|_nYJ9k2ao#zSOh_nI2+k4>V-ZrjyZTkHAN_OM9pV+A9cK@q} z%vUP38j`xErnA1FqE8dDrz$Ni)zs30#VcdxX(GTQUO6-_j^w7>m)!RcXvVwqp(#m8 zV_HOFSja=nj;^kYQ6a@iTLG&(aBBCFfevx0X2zLJu?El)E@v-qX#5{ z>?@nsj#_Xr;W>1|;EHk^e?b5M%*&jV6yamA2UB|Xj0KWqCi&?w{drYCOx|)|m%#S= z;<%{^vbMHP6LzGP!6>kL1R!^1U>?cU>h~WbcAbdhSv= z3fxF#foFekzP$XU6vnEOIoJz=ObTXZ*#@39>O~nK405938I-4}# zKK=|u5Klnil!;GCS*w-y255w=v^2oo`uOezGWPdE%;=N3W4@h+dUYJH?|=u8+R@Pg zK>%@tufn08BfVXI$xMMKhX@+52{Ehe1|=QFd$qONjRdaqqK_Zz^~_9*5La4o5Fn24 zU;R=&k1V8NCRSI@h5If+d*M)zx4^?*jQ!u>W{eKz|OLwXzlZhi|oRVJ~7qfqLu| z!o=%OFo#LoMDW6vl#myJ-R}l)T3?V@=&-{;7Rf$|4N3QWvchEjX6UO<=KcUSC6bh%=<{K8*xsHc+i%;@~U;F~bXeeF|n8z@9#@&@W>kzjdqR zK>o8w&%6m}PO@h|dPiU47N8*a4D^TZfTf~bp9{Ram_f3j3?cxfVTyIuZguCgpx)<8 z^Diqcmk1lKz##p51Xq0YC?A+SMmdtFQFk29RPq$rS`_gGg$Ag7?xjjgWB7yglV|nAkX%1o!^l($UwhS z2AOU>0NU#WVQ4+b1q9^)$8X=CNCpD|tCHhQ)o?4q1Vsro!0ziw#E|C~%4f>8pjCcHav7=@;7($4|0>J?IkZ^w-(yMZe~#R=SO@S>h1@Jk(gW zvTJwUXzT=V**az88?2}Bvn8?jVs3?uvbKhXH1mFkPr&6|-ya*(g=C*UzYAcqp%^$s zTN%K(x;v^qdATi)-X#J9!-G>u_{%#`Lo4KuwAl)R9Rz)QdwZ2}1!#lW)PN%H$Fu4- zo0$L^Dqw-&kaCYSlv$S9h2_*5J4wCEbD+YXaa4dG*MTU8&L*CzLoFZ z@C?C9D_1uDY#?38f@Wa}|4|I>I0tZxe{b?WtOA}ONz~agH0%TbmXp^F8bo36*|g3W zy_SU5GByja!5J;lDJq5j^ImBwXD#vdG*R}no9kMy(oW0_=osC zt_uiTjTRyhN0Ta^3~_)DJ!*Tf&i{Omd26od`-Oj=dO_}@--6OpE3hboNd-){QQ!u( z+McNmFnp@}-M_!5$Cm71y&MfD-j~-_AP|_cwzeid^b!xejwNS4Il$cDTs4GW1I%n4 z=|c7p1X8I06Hm&9tc^ZPYGGE@-GAOy`PP#U>ozuP$W8Jn2+ z@a-Ed*rD;$5P%(j)wBZ?xBJ+}|CJ}TvT>juWX_(f^7z_bpEJ4TByqSffD!OW!xUNM zY;D=qvn6rC6i`*g-vp?`qArV&neVnx4h2#xU#V7ARkcyjaYoSZ`goH5+!Jz{OT0Jq z2-ooQ^T#@IGLW+90S@x!T9T2G6~|f?--7DYT|-QHE1B3`CsutqkXEo6&s#WD0lI8d zxzZ?pIpmWksCUPoV!qDS|3lsqusM5z(rB*2SHNC)HRpi3pmRXYp!|2GDfyM~+Ul&4 zuNvsVP=dDFk>J*B&z3q#s|5=c&^+34UMdpK;$7K0d_>(WTRY|G3tLV;s7M(MkCHmK z{QUfGYa5%LY{8dgV0MfFb;08G=|UZx1Y9kEDgN%NcB2tV9{vnhvTB z0f4EfML|jV_!pQPK$b5Upf`Dgf&zTuz`|t;k;Cp{*kbq+wB^iP6VDoBE%GAvK9$4I znuDQTp@YgwOu?>$(=W}QIej_QM=1^Dw2{*O7h_@pXM2`8EBDygBq))fasjp0gc0Rp z|8eEhMtv*@6q4?$*?@m;0RBw{wcb-Bym$SFf>4D6y!;=*jBz;Q30k-(wu0%^AX7a{ zM@}9BE<6C(;(u6W53+LNK|!E|c!_iWAY6?#M2)qqhI@FD12XuK+WUOt z!YZmvdpLAaD&UpswOPQqH7Hw@3$#Jmnh$!R>^wZH6%YWbq^EdC2qZmH zF;CM}0eUhSlp#)+(}>I|P)!xCM>{2;0kddFxo^0ur^$WV7fpn_KVbjwWxy0u&+`W_ zpFR8Fvpe7H4lbAnMbO2^4g(t{C8dyb!qlXW)DBrfj!Zzpp+0wuh>UzSxS1pAeZU6@ zLFhk{aL}sVy6B>FR>r;Ev@-Wr5<1?kX*_pkO45D`I#Nr(H`ruVYpi8t^e-9)A;D~t z3qZa}+JkndFF$8xpetLqDg!bh^8-)+!P6OSGj-e>j6!^B>YK-jtbag(-4Tq152}dU zR8h@R2J#%%F9y=X(4ZM<2uQ||`+RF4n(|HOj=_sp@4wnT0BU9X6Gq4b6zuNc%mB{7 z6iM-N)Jy0qEDfKTR~AM1<0%OVy8t(0W?oZYFFIOjE^`5}lv33|OxzXyJXd9j;TLnU?y}lP`9fuhHP{D`u?dek zj$8aM{Yv%z{MpmFNgvesl#eo z2=@zM)hSea`8RIZx{2T$-EyRSo&_L5ywi}mPJ$Mblh$_wPcsu=PE}c^NqRrn74}M` zZfh>W6jVexQG%z?E*n-4%^t%7`wdXHb_S%b=)SowcMXKiU2jkWkb!ccMoz#Z3gbWl z98`ASGpi9Wc3643evKWV2$ZI;KVo{-e!wQArJ#wx_^%qWsDaJuf)D?HX(Si=pIQRJ zu>M~yxg^nt92SK!7jeJ0@%;DeqPJmJy%N2E=yCO~-ko}U`*C*Nad%6f{l>|E#FFXN z>!XW@tvD&|OzxdoDV{4r=+({uuf`^TXoN$dByT&PwVxlZ>w#%rK93}o&%Eo`pSh~C zVnjHO1b|+vbCMurIrK1O0ePPxkkRzgR1WbEKX(9#pkF=z4hN0c3NC^Au!)I`>@!&# zW%ny>RxYmoH90f4H+8Zah&;&U-&vqR@1x|x3cg4&J_iBbPezASwGexOE`s?17uTlt zqJLxE>YNr&yz^Hc^P1N4#0Pb+1}4cYb?Y}~-`9-d1ZUjd+7%c(O-LEnls;%9OKpth zG5M+tVzzmGese9?+bFG@nyzyFvkW>e^tPhM#TW;`Ji7zgWFTGSk@k}4{E!FOLwlG3 zdX{NyEd}7&U+;*R<`tHgmvrfKHg0bJavN41ia!|5Ed4B2N8?wuF{(HhXwWDt5BMU>m zmZ{0x6NYak+~tHt(k4*{pDGG|us&HVK+tRTzT9P;O@S7+Y^u?ZB9C6m?lQJr-HW;7 z^hx%yRZU`p4r{uKlNAub)vMExO~3cVlC&-Ew#eznA?URWN~8NT39s1s`{hjDq9uoIvZaMF|vw?P=ovb&@iGm zhoUrl{x?BGrp%0B%xJ$3)>2ovw`@7!uq6D+(h-w8U^zZwhH;FF;} z9R6u2uS~dgA6re~`lnEJa$UffZI~cZyf_CcmcHV|UJ*wUq>DjrN-b^37ppB7Do9h_ zB2b9|nXvGawW>eMMAMywe<90ya>7)?nxVSkOEWQa_4+ztJM9A&oGl;3n>^mQixS_< z^(0;#6T?o5w7k>q#WE7yyG&3|sqpJe7dPhK%XepB^ArIVS*YzqhlPfRD*38X!CxEG zPiu*u!%Rvhwe#c$_&*8Poz1rvBwDtk$`UGCo3?emScwd|{kOu1Vi;ZO9HvQl|#BSLTZam@X@o`o95w*Q2zi zDuEAkt@mJE`$40bxl(xG%EI%Ar`V8T^|MYMEDL2;m!s9j(M?^YIab z#<4sYBA@{LT?r0EY39%=lw1#iGmBQ82BJ?_nEij>5rV6kn?}9C2@IxQdqNq|RQ37t zd+g+sSVqaGLD-|rjbz_8)3W2^<>t1XH-cSYvoK=hrh;*++f(aU93RD=1^;(h0tZ;; zrDE~_(YEfb{!iNyDf3ys-Fuc6P|BQ7d7G&fUN%p#->*u-csE?@Idafe7CfueKCpGr z8{OM;i4EB+ag#m4rb2=?f|68+#epb%Qg#O1LMPZVl7$=`+T9)())j6mL!>egJCUIU z|0V=kQSZnNjw(_@^9Muz?nErwer0#!9>nQ4KmFQ2a#4Au9h%^|y|P={t*YEHGUDog5X z;vIBoC?@E(4M|^?_nNshnC{#~e^Uv{w6XRMSWn}a5#Qi*z4}pDFBU7Re)ohA17}{k zdr)m$y!ilX`&^PH;+%bWcC({=)``b2^(SAWKPEHkd`0+eWs{;$J3~^3MP|V8n19m76vxb)f!yFKHB5 zr1)7lIq`rPfZhLDG!P{@QEn6hs_xNS=iWcT0ZX6Q_aecciDz`?H^XnjkWo#vWCjBgp$F& zM?jYF+aDC4+1hiudMw=5J6m}qN#wqx?2nEuSAan&JS@4GRd2e_=Gz%Qat{FMeHG~3 zLSc(4C=xu)SL4!W$z~!SR88*t6goW|On=PTvg1L@5gwN$C+qZG$>erDq1@CLE(;^V z=q~!HNYtMUw$w+f!saSXoL`%ABV&Cqa{MLm2hw;UfL4rYCm>KjxoG8WMZza5qPAI-= ztCU z(M!P!M^#1l`$_2~07{fLXQC|iH{f6+ph3BL;7b~zEkj9Cv}yIc&lh8NugqVLr5=jQ=Htu9#mN;Z-~Tix zsDRSo!X}C#++6BRi~}=@*u%D3KH(!Nqy+K1t4%JP=sLO3veT#C1MdZYtYZVESx4f$ z(lep;tQ&uL*C%(-wKApbS@T^}9SmV*#9=%+|Fu4RdFLA09?GmjiU$j2=C9VbRa5e- zevx7DzMpEk!q;G`PRuQA>BuPZT=i6lxEXD_QYS#yeAQEjOc?_`@NIk>4^7e!Fj2##2H`KcTtCd&mhWu2Qv-!;eoIrj|Xnt4OE#wh*;jPhy&!k*h*?y(=z$7Ms#OPs(_0Qc`#85 zdDXNE1W^Y%c}|LN6=vm>+QjONfi9J6yt9R3>+_CBS#5<`yJcPKYcdh#CUx&npi@*_ zOcRyDbNa!k43(P{Y)NAlq+C!S`?%NDi3LV7DW8uKPFSQ=8;<#BosF8tQ4gH;jJ0SPJ+3 z_Y0j0&p+POAZJTaXOpd{RnJSM_bjs0#y?ROq}X@a6!zP3EYeIQi`bze+mf z4ro@?^m&TV#AdC*qMiA?u zr8b65$6idF<%mi!Q9(-aE>ivDGr23f#uA*GYDnk*3$$j_xt{jn;Ja;|`oC29n7Ehq z$jiB3d+K3JN<8^WIkm9+{7+Q%ju}#W&euM?a!*8`Av#@}Z@dbOKS zJMf>zSHw*=!pn&o(l7TI!Jdr(v@t?S9xH@OeRHNRM;*9zsOP-%ocHd|ALVzRm*fUt z0hr#}mp;3PhlhHmRlrzS1bXwOKxcmiL^;q3EGa4309h8{vs0gD>1Q|RS4zC*j*N;@ z0F4fADtwyoplJss(Ass4YYd9D>VN(Ki(y)lAwS2Dy76G}&y^mm)Pn$1K39!8nA-d) z1@Yno^PTl2btvE$3^vQK$+R;onrW}Z5--aVzX+(?t^q0mO%a?5l*UAd{&RefcJlHB zm{I$1MQSctT)E-$Nb&AwGJ`ls7|(P<@52|B5V~<=-CHrk>4f!`4;D+cVjo!X2vU)M zDaW#z@D={4Mci;}&vXfHqv41h$*j51hm?4Fb}S)be%ku$pvkFY{?3ee$54DAzb|R~ z*25+#vxw1AZ2|N58ACO;S?^at_qgWILBoSgX)pLBukJj6m!t3-;l@wZN$vjP_j2FP zHsyX5@Id4V4(yKjL*jyH1AZeS!SpIjLlOl2r{Q8}<4Q{ZuE3+=&sw5LqGL{prTaQ&D zrTj$QuZ%QdAtJ345*2|hi0vsYJ4Y%!p4vYj)uWd6C`GmW$=OPUL`!}xmYYT4C6d
YuOV3a=+3XpVXx)f4CQ3p57ro9J$+AYb( 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ℜ_lm1f)YP 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 z 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 LwUo*ftit{Wv>>__ diff --git a/release/scripts/import_dxf.py b/release/scripts/import_dxf.py index 88b42e3e564..ce7df610d98 100644 --- a/release/scripts/import_dxf.py +++ b/release/scripts/import_dxf.py @@ -1,5 +1,5 @@ #!BPY -# coding: utf-8 + """ Name: 'Autodesk DXF (.dxf)' Blender: 244 @@ -7,14 +7,15 @@ Group: 'Import' Tooltip: 'Import for DXF geometry data (Drawing eXchange Format).' """ __author__ = 'Kitsu(Ed Blake) & migius(Remigiusz Fiedler)' -__version__ = '1.0.12 - 2008.02.08 by migius' +__version__ = '1.0.12 - 2008.06.05 by migius' __url__ = ["http://blenderartists.org/forum/showthread.php?t=84319", "http://wiki.blender.org/index.php/Scripts/Manual/Import/DXF-3D"] __email__ = ["Kitsune_e(at)yahoo.com", "migius(at)4d-vectors.de"] __bpydoc__ = """\ This script imports objects from DXF (2d/3d) into Blender. -This script imports 2d and 3d geometery from DXFr12 format files. +This script imports 2d and 3d geometery from DXF files. +Supported DXF format versions: from (r2.5) r12 up to 2008. Enhanced features are: - configurable object filtering and geometry manipulation, - configurable material pre-processing, @@ -40,22 +41,23 @@ XREF (External Reference). Supported DXF>r12 objects: ELLIPSE, -(wip v1.0.12 partly supported) LWPOLYLINE (LightWeight), -(wip v1.0.12) MLINE, -(wip v1.0.12) MTEXT +LWPOLYLINE (LightWeight Polylines), +(wip v1.0.12) SPLINE, +(wip v1.0.13) MLINE, +(wip v1.0.13) MTEXT -Unsupported Objects: +Unsupported objects: DXF r12: DIMENSION. -DXF>r12: SPLINE, GROUP, RAY/XLINE, LEADER, 3DSOLID, BODY, REGION, dynamic BLOCK +DXF>r12: GROUP, RAY/XLINE, LEADER, 3DSOLID, BODY, REGION, dynamic BLOCK -Supported Geometry: 2d and 3d DXF-objects. -Curves imported as curves or meshes optionally. +Supported geometry: 2d and 3d DXF-objects. +Curves imported as Blender curves or meshes optionally. Supported layout modes: "model space" is default, "paper space" as option (= "layout views") -Scene definitions produced with AVE_RENDER: +Supported scene definition objescts produced with AVE_RENDER: scene: selection of lights assigned to the camera, lights: DIRECT, OVERHEAD, SH_SPOT, (wip v1.0.13 import of AVE_RENDER material definitions) @@ -77,14 +79,10 @@ It is recommended to use DXF-object properties for assign Blender materials. Notes: - Recommend that you run 'RemoveDoubles' on each imported mesh after using this script - Blocks are created on layer 19 then referenced at each insert point. -- Big DXF-files (over 1500 objects) decrease import performance. +- support for DXF-files up to 160MB on systems with 1GB RAM +- DXF-files with over 1500 objects decrease import performance. The problem is not the inefficiency of python-scripting but Blenders performance -in creating new objects in his database - probably a database management problem. - -TODO: -- the new style object visibility -- support for real 3d-solids (ACIS) -- (to see more, search for "--todo--" in script code) +in creating new objects in scene database - probably a database management problem. """ @@ -92,6 +90,7 @@ TODO: History: v1.0 - 2008.01. by migius planned tasks: + -- (to see more, search for "--todo--" in script code) -- command-line-mode/batch-mode -- in-place-editing for dupliGroups -- support for MLINE (is exported to r12 as BLOCK*Unnamed with LINEs) @@ -102,17 +101,23 @@ History: -- added f_layerFilter -- to-check: obj/mat/group/_mapping-idea from ideasman42: -- curves: added "fill/non-fill" option for closed curves: CIRCLEs,ELLIPSEs,POLYLINEs - -- bug:? object = Object.Get(obname) -> = SCENE.getChildren(obname) -- "normalize Z" option to correct non-planar figures -- LINEs need "width" in 3d-space incl vGroups -- support width_force for LINEs/ELLIPSEs = "solidify" -- add better support for color_index BYLAYER=256, BYBLOCK=0 - -- bug: "oneMesh" produces sometimes errors + -- bug: "oneMesh" produces irregularly errors -- bug: Registry recall from hd_cache ?? only win32 bug?? - - v1.0.12: 2008.02.08 by migius -- support DXF-definitions of scene, lights and cameras -- support ortho mode for VIEWs and VPORTs as cameras + -- add support for SPLINEs + + v1.0.12: 2008.06.05 by migius + b3 bugfix: ob.name conflict with existing meshes (different ob.name/mesh.name) + v1.0.12: 2008.05.24 by migius + b2 added support for LWPOLYLINEs + b2 added support for ProE in readerDXF.py + v1.0.12: 2008.02.08 by migius + b1 update: object = Object.Get(obname) -> f_getSceChild().getChildren() a9 bugfix by non-existing tables views, vports, layers (Kai reported) v1.0.12: 2008.01.17 by migius a8 lately used INI-dir/filename persistently stored in Registry @@ -279,9 +284,9 @@ History: # -------------------------------------------------------------------------- import Blender -#import bpy from Blender import * #from Blender.Mathutils import Vector, Matrix +import bpy #import BPyMessages from dxfReader import readDXF @@ -313,6 +318,8 @@ WORLDX = Mathutils.Vector((1,0,0)) WORLDY = Mathutils.Vector((1,1,0)) WORLDZ = Mathutils.Vector((0,0,1)) +oblist = [] #to be sure, it is an empty list + G_SCALE = 1.0 #(0.0001-1000) global scaling factor for all dxf data G_ORIGIN_X = 0.0 #global translation-vector (x,y,z) in DXF units G_ORIGIN_Y = 0.0 @@ -330,6 +337,10 @@ ELEVATION = 0.0 #standard elevation = coordinate Z TARGET_LAYER = 3 #target blender_layer GROUP_BYLAYER = 0 #(0/1) all entities from same layer import into one blender-group +cur_COUNTER = 0 #counter for progress_bar +M_OBJ = False +BYBLOCK = 0 +BYLAYER = 256 FILENAME_MAX = 180 #max length of path+file_name string (FILE_MAXDIR + FILE_MAXFILE) MAX_NAMELENGTH = 17 #max_effective_obnamelength in blender =21=17+(.001) @@ -342,75 +353,6 @@ AUTO = BezTriple.HandleTypes.AUTO FREE = BezTriple.HandleTypes.FREE VECT = BezTriple.HandleTypes.VECT ALIGN = BezTriple.HandleTypes.ALIGN -cur_COUNTER = 0 #counter for progress_bar - - -"""This module provides wrapper objects for dxf entities. - - The wrappers expect a "dxf object" as input. The dxf object is - an object with a type and a data attribute. Type is a lowercase - string matching the 0 code of a dxf entity. Data is a list containing - dxf objects or lists of [code, data] pairs. - - This module is not general, and is only for dxf import. -""" - -# from Stani's dxf writer v1.1 (c)www.stani.be (GPL) -#---color values -BYBLOCK = 0 -BYLAYER = 256 - -#---block-type flags (bit coded values, may be combined): -ANONYMOUS =1 # This is an anonymous block generated by hatching, associative dimensioning, other internal operations, or an application -NON_CONSTANT_ATTRIBUTES =2 # This block has non-constant attribute definitions (this bit is not set if the block has any attribute definitions that are constant, or has no attribute definitions at all) -XREF =4 # This block is an external reference (xref) -XREF_OVERLAY =8 # This block is an xref overlay -EXTERNAL =16 # This block is externally dependent -RESOLVED =32 # This is a resolved external reference, or dependent of an external reference (ignored on input) -REFERENCED =64 # This definition is a referenced external reference (ignored on input) - -#---polyline flags -CLOSED =1 # This is a closed polyline (or a polygon mesh closed in the M direction) -CURVE_FIT =2 # Curve-fit vertices have been added -SPLINE_FIT =4 # Spline-fit vertices have been added -POLYLINE_3D =8 # This is a 3D polyline -POLYGON_MESH =16 # This is a 3D polygon mesh -CLOSED_N =32 # The polygon mesh is closed in the N direction -POLYFACE_MESH =64 # The polyline is a polyface mesh -CONTINOUS_LINETYPE_PATTERN =128 # The linetype pattern is generated continuously around the vertices of this polyline - -#---text flags -#horizontal -LEFT = 0 -CENTER = 1 -RIGHT = 2 -ALIGNED = 3 #if vertical alignment = 0 -MIDDLE = 4 #if vertical alignment = 0 -FIT = 5 #if vertical alignment = 0 -#vertical -BASELINE = 0 -BOTTOM = 1 -MIDDLE = 2 -TOP = 3 - -#---mtext flags -#attachment point -TOP_LEFT = 1 -TOP_CENTER = 2 -TOP_RIGHT = 3 -MIDDLE_LEFT = 4 -MIDDLE_CENTER = 5 -MIDDLE_RIGHT = 6 -BOTTOM_LEFT = 7 -BOTTOM_CENTER = 8 -BOTTOM_RIGHT = 9 -#drawing direction -LEFT_RIGHT = 1 -TOP_BOTTOM = 3 -BY_STYLE = 5 #the flow direction is inherited from the associated text style -#line spacing style (optional): -AT_LEAST = 1 #taller characters will override -EXACT = 2 #taller characters will not override class View: #----------------------------------------------------------------- @@ -652,6 +594,14 @@ def get_extrusion(data): #------------------------------------------------- return vec +#------------------------------------------ +def getSceneChild(name): + dudu = [i for i in SCENE.objects if i.name==name] +# dudu = [i for i in SCENE.getChildren() if i.name==name] + #print 'deb:getSceneChild %s -result: %s:' %(name,dudu) #----------------- + if dudu!=[]: return dudu[0] + return None + class Solid: #----------------------------------------------------------------- """Class for objects representing dxf SOLID or TRACE. @@ -754,16 +704,16 @@ class Solid: #----------------------------------------------------------------- if l == 4: faces = [[0,1,3,2]] elif l == 3: faces = [[0,1,2]] elif l == 2: edges = [[0,1]] - - - - me = Mesh.New(obname) # create a new mesh + + if M_OBJ: obname, me, ob = makeNewObject() + else: + me = Mesh.New(obname) # create a new mesh + ob = SCENE.objects.new(me) # create a new mesh_object me.verts.extend(points) # add vertices to mesh if faces: me.faces.extend(faces) # add faces to the mesh if edges: me.edges.extend(edges) # add faces to the mesh - ob = SCENE.objects.new(me) # create a new mesh_object - if settings.var['vGroup_on']: + if settings.var['vGroup_on'] and not M_OBJ: # each MeshSide becomes vertexGroup for easier material assignment --------------------- replace = Blender.Mesh.AssignModes.ADD #or .AssignModes.ADD/REPLACE if vg_left: me.addVertGroup('side.left') ; me.assignVertsToGroup('side.left', vg_left, 1.0, replace) @@ -777,9 +727,6 @@ class Solid: #----------------------------------------------------------------- return ob - - - class Line: #----------------------------------------------------------------- """Class for objects representing dxf LINEs. """ @@ -838,7 +785,7 @@ class Line: #----------------------------------------------------------------- elif settings.var['lines_as'] == 3: # as thin cylinder cyl_rad = 0.5 * settings.var['width_min'] - if settings.var['lines_as'] == 5: # LINE curve representation------------------------- + elif settings.var['lines_as'] == 5: # LINE curve representation------------------------- obname = 'li_%s' %self.layer # create object name from layer name obname = obname[:MAX_NAMELENGTH] @@ -872,20 +819,23 @@ class Line: #----------------------------------------------------------------- global activObjectName #print 'deb:draw:line.ob IN activObjectName: ', activObjectName #--------------------- - if activObjectLayer == self.layer and settings.var['one_mesh_on']: - obname = activObjectName - #print 'deb:line.draw obname from activObjectName: ', obname #--------------------- - ob = Object.Get(obname) # open an existing mesh_object - #ob = SCENE.getChildren(obname) # open an existing mesh_object - me = Mesh.Get(ob.name) # open objects mesh data - else: - obname = 'li_%s' %self.layer # create object name from layer name - obname = obname[:MAX_NAMELENGTH] - me = Mesh.New(obname) # create a new mesh - ob = SCENE.objects.new(me) # create a new mesh_object - activObjectName = ob.name - activObjectLayer = self.layer - #print ('deb:line.draw new line.ob+mesh:"%s" created!' %ob.name) #--------------------- + if M_OBJ: obname, me, ob = makeNewObject() + else: + if activObjectLayer == self.layer and settings.var['one_mesh_on']: + obname = activObjectName + #print 'deb:line.draw obname from activObjectName: ', obname #--------------------- + ob = getSceneChild(obname) # open an existing mesh_object + #ob = SCENE.getChildren(obname) # open an existing mesh_object + #me = Mesh.Get(ob.name) # open objects mesh data + me = ob.getData(name_only=False, mesh=True) + else: + obname = 'li_%s' %self.layer # create object name from layer name + obname = obname[:MAX_NAMELENGTH] + me = Mesh.New(obname) # create a new mesh + ob = SCENE.objects.new(me) # create a new mesh_object + activObjectName = ob.name + activObjectLayer = self.layer + #print ('deb:line.draw new line.ob+mesh:"%s" created!' %ob.name) #--------------------- faces, edges = [], [] n = len(me.verts) @@ -904,7 +854,7 @@ class Line: #----------------------------------------------------------------- if faces: me.faces.extend(faces) # add faces to the mesh if edges: me.edges.extend(edges) # add faces to the mesh - if settings.var['vGroup_on']: + if settings.var['vGroup_on'] and not M_OBJ: # entities with the same color build one vertexGroup for easier material assignment ---- ob.link(me) # link mesh to that object vG_name = 'color_%s' %self.color_index @@ -988,155 +938,23 @@ class Point: #----------------------------------------------------------------- global activObjectLayer global activObjectName #print 'deb:draw:point.ob IN activObjectName: ', activObjectName #--------------------- - if activObjectLayer == self.layer and settings.var['one_mesh_on']: - obname = activObjectName - #print 'deb:draw:point.ob obname from activObjectName: ', obname #--------------------- - ob = Object.Get(obname) # open an existing mesh_object - #ob = SCENE.getChildren(obname) # open an existing mesh_object - me = Mesh.Get(ob.name) # open objects mesh data - else: - me = Mesh.New(obname) # create a new mesh - ob = SCENE.objects.new(me) # create a new mesh_object - activObjectName = ob.name - activObjectLayer = self.layer - #print ('deb:draw:point new point.ob+mesh:"%s" created!' %ob.name) #--------------------- - me.verts.extend(points) # add vertices to mesh - - return ob - - - -class LWpolyline: #----------------------------------------------------------------- - """Class for objects representing dxf LWPOLYLINEs. - """ - def __init__(self, obj): - """Expects an entity object of type lwpolyline as input. - """ - #print 'deb:LWpolyline.START:----------------' #------------------------ - if not obj.type == 'lwpolyline': - raise TypeError, "Wrong type %s for polyline object!" %obj.type - self.type = obj.type - self.data = obj.data[:] - - # required data - self.num_points = obj.get_type(90)[0] - - # optional data (with defaults) - self.space = getit(obj, 67, 0) - - self.color_index = getit(obj, 62, BYLAYER) - - self.elevation = getit(obj, 30, 0) - self.thic = getit(obj, 39, 0) - self.flags = getit(obj, 70, 0) - - self.closed = self.flags&1 # byte coded, 1 = closed, 128 = plinegen - - self.layer = getit(obj.data, 8, None) - self.points = self.get_points(obj.data) - self.extrusion = get_extrusion(obj.data) - - #print 'deb:LWpolyline.obj.data:\n', obj.data #------------------------ - #print 'deb:LWpolyline.ENDinit:----------------' #------------------------ - - - def get_points(self, data): - """Gets points for a polyline type object. - - LW-Polylines have no fixed number of verts, and - each vert can have a number of properties. - Verts should be coded as - 10:xvalue - 20:yvalue - 40:startwidth or 0 - 41:endwidth or 0 - 42:bulge or 0 - for each vert - """ - num = self.num_points - point = None - points = [] - for item in data: - if item[0] == 10: # 10 = x - if point: - points.append(point) - point = Vertex() - point.x = item[1] - elif item[0] == 20: # 20 = y - point.y = item[1] - elif item[0] == 40: # 40 = start width - point.swidth = item[1] - elif item[0] == 41: # 41 = end width - point.ewidth = item[1] - elif item[0] == 42: # 42 = bulge - point.bulge = item[1] - points.append(point) - return points - - - - def __repr__(self): - return "%s: layer - %s, points - %s" %(self.__class__.__name__, self.layer, self.points) - - - def draw(self, settings): - """for LWPOLYLINE: generate Blender_geometry. - """ - #print 'deb:LWpolyline.draw.START:----------------' #------------------------ - points = [] - obname = 'lw_%s' %self.layer # create object name from layer name - obname = obname[:MAX_NAMELENGTH] - #settings.var['curves_on'] == True - #print 'deb:index_len: ', len(self.points) #------------------ - for i, point in enumerate(self.points): - #print 'deb:index: ', i #------------------ - if not point.bulge: - points.append(point.loc) - elif point.bulge and not self.closed and i == len(self.points)-1: - points.append(point.loc) - elif point.bulge: # - if i == len(self.points)-1: - point2 = self.points[0] + if M_OBJ: obname, me, ob = makeNewObject() + else: + if activObjectLayer == self.layer and settings.var['one_mesh_on']: + obname = activObjectName + #print 'deb:draw:point.ob obname from activObjectName: ', obname #--------------------- + ob = getSceneChild(obname) # open an existing mesh_object + #ob = SCENE.getChildren(obname) # open an existing mesh_object + me = ob.getData(name_only=False, mesh=True) + #me = Mesh.Get(ob.name) # open objects mesh data else: - point2 = self.points[i+1] - arc_res = settings.var['arc_res']/sqrt(settings.var['arc_rad']) - verts, center = calcBulge(point, point2, arc_res) -# if i == len(self.points)-1: -# if self.closed: -# verts.pop() #remove last(=first) vertex -# else: -# verts.pop() #remove last vertex, because this point will be writen as the next vertex - points.extend(verts) - - thic = self.thic - if settings.var['thick_force'] and thic == 0: thic = settings.var['thick_min'] - if settings.var['thick_on'] and thic != 0: - len1 = len(points) - points.extend([[point[0], point[1], point[2]+thic] for point in points]) - faces = [] - #print 'deb:len1:', len1 #----------------------- - faces = [[num, num+1, num+len1+1, num+len1] for num in xrange(len1 - 1)] - if self.closed: - faces.append([len1-1, 0, len1, 2*len1-1]) - #print 'deb:faces_list:\n', faces #----------------------- - me = Mesh.New(obname) # create a new mesh - ob = SCENE.objects.new(me) # create a new mesh_object + me = Mesh.New(obname) # create a new mesh + ob = SCENE.objects.new(me) # create a new mesh_object + activObjectName = ob.name + activObjectLayer = self.layer + #print ('deb:draw:point new point.ob+mesh:"%s" created!' %ob.name) #--------------------- me.verts.extend(points) # add vertices to mesh - me.faces.extend(faces) # add faces to the mesh - else: - edges = [[num, num+1] for num in xrange(len(points)-1)] - if self.closed: - edges.append([len(points)-1, 0]) - #print 'deb:edges_list:\n', edges #----------------------- - me = Mesh.New(obname) # create a new mesh - ob = SCENE.objects.new(me) # create a new mesh_object - me.verts.extend(points) # add vertices to mesh - me.edges.extend(edges) # add edges to the mesh - ob.LocZ = self.elevation - transform(self.extrusion, 0, ob) - - #print 'deb:LWpolyline.draw.END:----------------' #------------------------ return ob @@ -1172,10 +990,10 @@ class Polyline: #-------------------------------------------------------------- self.plface = self.flags & 64 # 3D-polyface mesh self.contin = self.flags & 128 # the linetype pattern is generated continuously - if self.poly3d or self.plface or self.plmesh: - self.poly2d = False # its not a 2D-polyline - else: - self.poly2d = True # it is a 2D-polyline + self.pltype='poly2d' # default is a 2D-polyline + if self.poly3d: self.pltype='poly3d' + elif self.plface: self.pltype='plface' + elif self.plmesh: self.pltype='plmesh' self.swidth = getit(obj, 40, 0) # default start width self.ewidth = getit(obj, 41, 0) # default end width @@ -1213,19 +1031,19 @@ class Polyline: #-------------------------------------------------------------- """ ob = [] #---- 3dPolyFace - mesh with free topology - if self.plface and settings.drawTypes['plmesh']: + if self.pltype=='plface' and settings.drawTypes['plmesh']: ob = self.drawPlFace(settings) #---- 3dPolyMesh - mesh with ortogonal topology - elif self.plmesh and settings.drawTypes['plmesh']: + elif self.pltype=='plmesh' and settings.drawTypes['plmesh']: ob = self.drawPlMesh(settings) #---- 2dPolyline - plane polyline with arc/wide/thic segments - elif (self.poly2d and settings.drawTypes['polyline']): + elif self.pltype=='poly2d' and settings.drawTypes['polyline']: if settings.var['plines_as'] == 5: # and self.spline: ob = self.drawPolyCurve(settings) else: ob = self.drawPoly2d(settings) #---- 3dPolyline - non-plane polyline (thin segments = without arc/wide/thic) - elif (self.poly3d and settings.drawTypes['pline3']): + elif self.pltype=='poly3d' and settings.drawTypes['pline3']: if settings.var['plines3_as'] == 5: # and self.spline: ob = self.drawPolyCurve(settings) else: @@ -1355,21 +1173,7 @@ class Polyline: #-------------------------------------------------------------- pline = Curve.New(obname) # create new curve data #pline.setResolu(24) #--todo----- - if False: #self.spline: # NURBSplines-----FAKE(with Bezier)----- - #print 'deb:polyline2dCurve.draw self.spline!' #--------------- - curve = pline.appendNurb(BezTriple.New(d_points[0])) - for p in d_points[1:]: - curve.append(BezTriple.New(p)) - for point in curve: - point.handleTypes = [AUTO, AUTO] - if self.closed: - curve.flagU = 1 # Set curve cyclic=close - else: - curve.flagU = 0 # Set curve not cyclic=open - curve[0].handleTypes = [FREE, ALIGN] #remi--todo----- - curve[-1].handleTypes = [ALIGN, FREE] #remi--todo----- - - elif self.spline: # NURBSplines-----OK----- + if self.spline: # NURBSplines-----OK----- #print 'deb:polyline2dCurve.draw self.spline!' #--------------- weight1 = 0.5 weight2 = 1.0 @@ -1562,6 +1366,7 @@ class Polyline: #-------------------------------------------------------------- ewidths = [] swidth_default = self.swidth #default start width of POLYLINEs segments ewidth_default = self.ewidth #default end width of POLYLINEs segments + #print 'deb:drawPoly2d self.swidth=', self.swidth #------------------------ thic = set_thick(self.thic, settings) if self.spline: pline_typ = 'ps' elif self.curved: pline_typ = 'pc' @@ -1633,9 +1438,11 @@ class Polyline: #-------------------------------------------------------------- swidth = point1.swidth ewidth = point1.ewidth + #print 'deb:drawPoly2d point1.swidth=', swidth #------------------------ if swidth == None: swidth = swidth_default if ewidth == None: ewidth = ewidth_default if swidth != 0.0 or ewidth != 0.0: wide_segment_exist = True + #print 'deb:drawPoly2d vertex_swidth=', swidth #------------------------ if settings.var['width_force']: # force minimal width for thin segments width_min = settings.var['width_min'] @@ -1819,14 +1626,14 @@ class Polyline: #-------------------------------------------------------------- left_angle = False limit_dist = settings.var['dist_min'] if left_angle: # if left turning angle - print 'deb:drawPoly2d it is left turning angle' #------------- + #print 'deb:drawPoly2d it is left turning angle' #------------- # to avoid triangelface/doubleVertex delta1 = (cornerpointL - vecL1).normalize() * limit_dist delta4 = (cornerpointL - vecL4).normalize() * limit_dist pointsLc.extend((cornerpointL - delta1, cornerpointL - delta4)) pointsRc.extend((pointsRe[i],pointsRs[i+1])) else: # if right turning angle - print 'deb:drawPoly2d right turning angle' #------------- + #print 'deb:drawPoly2d right turning angle' #------------- delta1 = (cornerpointR - vecR1).normalize() * limit_dist delta4 = (cornerpointR - vecR4).normalize() * limit_dist pointsRc.extend((cornerpointR - delta1, cornerpointR - delta4)) @@ -1917,8 +1724,10 @@ class Polyline: #-------------------------------------------------------------- #faces = f_bottom + f_top #faces = f_left + f_right + f_start + f_end #print 'deb:faces_list:\n', faces #----------------------- - me = Mesh.New(obname) # create a new mesh - ob = SCENE.objects.new(me) # create a new mesh_object + if M_OBJ: obname, me, ob = makeNewObject() + else: + me = Mesh.New(obname) # create a new mesh + ob = SCENE.objects.new(me) # create a new mesh_object me.verts.extend(pointsW) # add vertices to mesh me.faces.extend(faces) # add faces to the mesh @@ -1926,7 +1735,7 @@ class Polyline: #-------------------------------------------------------------- # The mesh must first be linked to an object so the method knows which object to update. # This is because vertex groups in Blender are stored in the object -- not in the mesh, # which may be linked to more than one object. - if settings.var['vGroup_on']: + if settings.var['vGroup_on'] and not M_OBJ: # each MeshSide becomes vertexGroup for easier material assignment --------------------- replace = Blender.Mesh.AssignModes.REPLACE #or .AssignModes.ADD vg_left, vg_right, vg_top, vg_bottom = [], [], [], [] @@ -1956,8 +1765,10 @@ class Polyline: #-------------------------------------------------------------- faces = [[num, len1+num, len1+num+1, num+1] for num in xrange(len1 - 1)] if self.closed: faces.append([len1, 0, len1-1, len1+len1-1]) - me = Mesh.New(obname) # create a new mesh - ob = SCENE.objects.new(me) # create a new mesh_object + if M_OBJ: obname, me, ob = makeNewObject() + else: + me = Mesh.New(obname) # create a new mesh + ob = SCENE.objects.new(me) # create a new mesh_object me.verts.extend(pointsW) # add vertices to mesh me.faces.extend(faces) # add faces to the mesh @@ -1976,8 +1787,10 @@ class Polyline: #-------------------------------------------------------------- faces = [[num, num+1, num+len1+1, num+len1] for num in xrange(len1 - 1)] if self.closed: faces.append([len1-1, 0, len1, 2*len1-1]) - me = Mesh.New(obname) # create a new mesh - ob = SCENE.objects.new(me) # create a new mesh_object + if M_OBJ: obname, me, ob = makeNewObject() + else: + me = Mesh.New(obname) # create a new mesh + ob = SCENE.objects.new(me) # create a new mesh_object me.verts.extend(points) # add vertices to mesh me.faces.extend(faces) # add faces to the mesh @@ -1993,8 +1806,10 @@ class Polyline: #-------------------------------------------------------------- edges = [[num, num+1] for num in xrange(len(points)-1)] if self.closed: edges.append([len(points)-1, 0]) - me = Mesh.New(obname) # create a new mesh - ob = SCENE.objects.new(me) # create a new mesh_object + if M_OBJ: obname, me, ob = makeNewObject() + else: + me = Mesh.New(obname) # create a new mesh + ob = SCENE.objects.new(me) # create a new mesh_object me.verts.extend(points) # add vertices to mesh me.edges.extend(edges) # add edges to the mesh @@ -2006,7 +1821,8 @@ class Polyline: #-------------------------------------------------------------- class Vertex(object): #----------------------------------------------------------------- - """Generic vertex object used by POLYLINEs (and maybe others). + """Generic vertex object used by POLYLINEs, (and maybe others). + also used by class_LWPOLYLINEs but without obj-parameter """ def __init__(self, obj=None): @@ -2017,8 +1833,8 @@ class Vertex(object): #-------------------------------------------------------- #print 'deb:Vertex.init.START:----------------' #----------------------- self.loc = [0,0,0] self.face = [] - self.swidth = 0 - self.ewidth = 0 + self.swidth = None #0 + self.ewidth = None #0 self.bulge = 0 if obj is not None: if not obj.type == 'vertex': @@ -2058,14 +1874,14 @@ class Vertex(object): #-------------------------------------------------------- self.curv_tangent = getit(data, 50, None) # curve_tangent if self.plface and not self.plmesh: - v1 = getit(data, 71, 0) # polyface:Face.vertex 1. - v2 = getit(data, 72, 0) # polyface:Face.vertex 2. - v3 = getit(data, 73, 0) # polyface:Face.vertex 3. - v4 = getit(data, 74, None) # polyface:Face.vertex 4. - self.face = [abs(v1)-1,abs(v2)-1,abs(v3)-1] - if v4 != None: - if abs(v4) != abs(v1): - self.face.append(abs(v4)-1) + v1 = getit(data, 71, 0) # polyface:Face.vertex 1. + v2 = getit(data, 72, 0) # polyface:Face.vertex 2. + v3 = getit(data, 73, 0) # polyface:Face.vertex 3. + v4 = getit(data, 74, None) # polyface:Face.vertex 4. + self.face = [abs(v1)-1,abs(v2)-1,abs(v3)-1] + if v4 != None: + if abs(v4) != abs(v1): + self.face.append(abs(v4)-1) else: #--parameter for polyline2d self.swidth = getit(data, 40, None) # start width self.ewidth = getit(data, 41, None) # end width @@ -2119,6 +1935,304 @@ class Vertex(object): #-------------------------------------------------------- +class Spline(Polyline): #----------------------------------------------------------------- + """Class for objects representing dxf SPLINEs. + """ + def __init__(self, obj): + """Expects an entity object of type spline as input. +100 - Subclass marker (AcDbSpline) +210,220, 230 - Normal vector (omitted if the spline is nonplanar) X,Y,Z values of normal vector +70 - Spline flag (bit coded): + 1 = Closed spline + 2 = Periodic spline + 4 = Rational spline + 8 = Planar + 16 = Linear (planar bit is also set) +71 - Degree of the spline curve +72 - Number of knots +73 - Number of control points +74 - Number of fit points (if any) +42 - Knot tolerance (default = 0.0000001) +43 - Control-point tolerance (default = 0.0000001) +44 - Fit tolerance (default = 0.0000000001) +12,22,32 - Start tangent--may be omitted (in WCS). X,Y,Z values of start tangent--may be omitted (in WCS). +13,23, 33 - End tangent--may be omitted (in WCS). X,Y,Z values of end tangent--may be omitted (in WCS) +40 - Knot value (one entry per knot) +41 - Weight (if not 1); with multiple group pairs, are present if all are not 1 +10,20, 30 - Control points (in WCS) one entry per control point. +DXF: X value; APP: 3D point, Y and Z values of control points (in WCS) (one entry per control point) +11,21, 31 - Fit points (in WCS) one entry per fit point. + X,Y,Z values of fit points (in WCS) (one entry per fit point) + """ + #print 'deb:Spline.START:----------------' #------------------------ + if not obj.type == 'spline': + raise TypeError, "Wrong type %s for spline object!" %obj.type + self.type = obj.type + self.data = obj.data[:] + + # required data + self.num_points = obj.get_type(73)[0] + + # optional data (with defaults) + self.space = getit(obj, 67, 0) + + self.color_index = getit(obj, 62, BYLAYER) + + #self.elevation = getit(obj, 30, 0) + self.thic = 0 # getit(obj, 39, 0) + + width = 0 + self.swidth = width # default start width + self.ewidth = width # default end width + + self.flags = getit(obj, 70, 0) + self.closed = self.flags & 1 # closed spline + self.period = self.flags & 2 # Periodic spline + self.ration = self.flags & 4 # Rational spline + self.planar = self.flags & 8 # Planar + self.linear = self.flags & 16 # Linear (and Planar) + + self.degree = getit(obj, 71, 0) # Degree of the spline curve + self.curvNormal = False + self.curvQBspline = False + self.curvCBspline = False + self.curvBezier = False + if self.degree == 0: self.curvNormal = True + elif self.degree == 1: self.curvQBspline = True + elif self.degree == 2: self.curvCBspline = True + #elif self.degree == 3: self.curvBezier = True + elif self.degree == 3: self.spline = True + + self.num_knots = getit(obj, 72, 0) # Number of knots + self.num_contr = getit(obj, 73, 0) # Number of control points + self.num_fitpk = getit(obj, 74, 0) # Number of fit points (if any) + + self.layer = getit(obj.data, 8, None) + self.extrusion = get_extrusion(obj.data) + + self.points = self.get_points(obj.data) + + if self.planar: self.pltype = 'poly2d' + else: self.pltype = 'poly3d' + self.curved = False + #self.curved = False + + #print 'deb:Spline obj.data:\n', obj.data #------------------------ + #print 'deb:Spline self.points:\n', self.points #------------------------ + #print 'deb:Spline.ENDinit:----------------' #------------------------ + + + def get_points(self, data): + """Gets points for a spline type object. + + Splines have fixed number of verts, and + each vert can have a number of properties. + Verts should be coded as + 10:xvalue + 20:yvalue + for each vert + """ + num = self.num_contr + point = None + points = [] + #point = Vertex() + for item in data: + #print 'deb:Spline item:', item #------------------------ + if item[0] == 10: # control point + if point: points.append(point) + point = Vertex() + point.curved = True + point.x = item[1] + elif item[0] == 20: # 20 = y + point.y = item[1] + elif item[0] == 30: # 30 = z + point.z = item[1] + + elif item[0] == 11: # fit point + if point: points.append(point) + point = Vertex() + point.curved = True + point.x = item[1] + elif item[0] == 21: # 20 = y + point.y = item[1] + elif item[0] == 31: # 30 = z + point.z = item[1] + + elif item[0] == 12: # start tangent + if point: points.append(point) + point = Vertex() + point.curved = True + point.x = item[1] + elif item[0] == 22: # = y + point.y = item[1] + elif item[0] == 32: # = z + point.z = item[1] + + elif item[0] == 13: # end tangent + if point: points.append(point) + point = Vertex() + point.curved = True + point.x = item[1] + elif item[0] == 23: # 20 = y + point.y = item[1] + elif item[0] == 33: # 30 = z + point.z = item[1] + points.append(point) + #print 'deb:Spline points:\n', points #------------------------ + return points + + + + def __repr__(self): + return "%s: layer - %s, points - %s" %(self.__class__.__name__, self.layer, self.points) + + + + +class LWpolyline(Polyline): #------------------------------------------------------------- + """Class for objects representing dxf LWPOLYLINEs. + """ + def __init__(self, obj): + """Expects an entity object of type lwpolyline as input. + """ + #print 'deb:LWpolyline.START:----------------' #------------------------ + if not obj.type == 'lwpolyline': + raise TypeError, "Wrong type %s for polyline object!" %obj.type + self.type = obj.type + self.data = obj.data[:] + + # required data + self.num_points = obj.get_type(90)[0] + + # optional data (with defaults) + self.space = getit(obj, 67, 0) + self.elevation = getit(obj, 38, 0) + self.thic = getit(obj, 39, 0) + self.color_index = getit(obj, 62, BYLAYER) + width = getit(obj, 43, 0) + self.swidth = width # default start width + self.ewidth = width # default end width + #print 'deb:LWpolyline width=', width #------------------------ + #print 'deb:LWpolyline elevation=', self.elevation #------------------------ + + self.flags = getit(obj, 70, 0) + self.closed = self.flags&1 # byte coded, 1 = closed, 128 = plinegen + + self.layer = getit(obj.data, 8, None) + self.extrusion = get_extrusion(obj.data) + + self.points = self.get_points(obj.data) + + self.pltype = 'poly2d' # LW-polyline is a 2D-polyline + self.spline = False + self.curved = False + + + #print 'deb:LWpolyline.obj.data:\n', obj.data #------------------------ + #print 'deb:LWpolyline.ENDinit:----------------' #------------------------ + + + def get_points(self, data): + """Gets points for a polyline type object. + + LW-Polylines have no fixed number of verts, and + each vert can have a number of properties. + Verts should be coded as + 10:xvalue + 20:yvalue + 40:startwidth or 0 + 41:endwidth or 0 + 42:bulge or 0 + for each vert + """ + num = self.num_points + point = None + points = [] + for item in data: + if item[0] == 10: # 10 = x + if point: + points.append(point) + point = Vertex() + point.x = item[1] + point.z = self.elevation + elif item[0] == 20: # 20 = y + point.y = item[1] + elif item[0] == 40: # 40 = start width + point.swidth = item[1] + elif item[0] == 41: # 41 = end width + point.ewidth = item[1] + elif item[0] == 42: # 42 = bulge + point.bulge = item[1] + points.append(point) + return points + + + + def __repr__(self): + return "%s: layer - %s, points - %s" %(self.__class__.__name__, self.layer, self.points) + + + def draw_old(self, settings): + """for LWPOLYLINE: generate Blender_geometry. + """ + #print 'deb:LWpolyline.draw.START:----------------' #------------------------ + points = [] + obname = 'lw_%s' %self.layer # create object name from layer name + obname = obname[:MAX_NAMELENGTH] + #settings.var['curves_on'] == True + #print 'deb:index_len: ', len(self.points) #------------------ + for i, point in enumerate(self.points): + #print 'deb:index: ', i #------------------ + if not point.bulge: + points.append(point.loc) + elif point.bulge and not self.closed and i == len(self.points)-1: + points.append(point.loc) + elif point.bulge: # + if i == len(self.points)-1: + point2 = self.points[0] + else: + point2 = self.points[i+1] + arc_res = settings.var['arc_res']/sqrt(settings.var['arc_rad']) + verts, center = calcBulge(point, point2, arc_res) +# if i == len(self.points)-1: +# if self.closed: +# verts.pop() #remove last(=first) vertex +# else: +# verts.pop() #remove last vertex, because this point will be writen as the next vertex + points.extend(verts) + + thic = self.thic + if settings.var['thick_force'] and thic == 0: thic = settings.var['thick_min'] + if settings.var['thick_on'] and thic != 0: + len1 = len(points) + points.extend([[point[0], point[1], point[2]+thic] for point in points]) + faces = [] + #print 'deb:len1:', len1 #----------------------- + faces = [[num, num+1, num+len1+1, num+len1] for num in xrange(len1 - 1)] + if self.closed: + faces.append([len1-1, 0, len1, 2*len1-1]) + #print 'deb:faces_list:\n', faces #----------------------- + me = Mesh.New(obname) # create a new mesh + ob = SCENE.objects.new(me) # create a new mesh_object + me.verts.extend(points) # add vertices to mesh + me.faces.extend(faces) # add faces to the mesh + else: + edges = [[num, num+1] for num in xrange(len(points)-1)] + if self.closed: + edges.append([len(points)-1, 0]) + #print 'deb:edges_list:\n', edges #----------------------- + me = Mesh.New(obname) # create a new mesh + ob = SCENE.objects.new(me) # create a new mesh_object + me.verts.extend(points) # add vertices to mesh + me.edges.extend(edges) # add edges to the mesh + + ob.LocZ = self.elevation + transform(self.extrusion, 0, ob) + + #print 'deb:LWpolyline.draw.END:----------------' #------------------------ + return ob + + class Text: #----------------------------------------------------------------- """Class for objects representing dxf TEXT. """ @@ -2363,8 +2477,6 @@ class Mtext: #----------------------------------------------------------------- return ob - - class Circle: #----------------------------------------------------------------- """Class for objects representing dxf CIRCLEs. """ @@ -2494,8 +2606,10 @@ class Circle: #---------------------------------------------------------------- return ob else: # draw CIRCLE as mesh ----------------------------------------------- - cir = Mesh.New(obname) # create a new mesh - ob = SCENE.objects.new(cir) # create a new circle_object + if M_OBJ: obname, me, ob = makeNewObject() + else: + me = Mesh.New(obname) # create a new mesh + ob = SCENE.objects.new(me) # create a new mesh_object # set a number of segments in entire circle arc_res = settings.var['arc_res'] * sqrt(radius) / sqrt(settings.var['arc_rad']) start, end = 0.0 , 360.0 @@ -2534,24 +2648,24 @@ class Circle: #---------------------------------------------------------------- #print 'deb:circleDraw:verts:', verts #--------------- faces = f_band + f_bottom + f_top #print 'deb:circleDraw:faces:', faces #--------------- - cir.verts.extend(verts) # add vertices to mesh - cir.faces.extend(faces) # add faces to the mesh + me.verts.extend(verts) # add vertices to mesh + me.faces.extend(faces) # add faces to the mesh if settings.var['meshSmooth_on']: # left and right side become smooth ---------------------- for i in xrange(smooth_len): - cir.faces[i].smooth = True + me.faces[i].smooth = True # each MeshSide becomes vertexGroup for easier material assignment --------------------- - if settings.var['vGroup_on']: + if settings.var['vGroup_on'] and not M_OBJ: # each MeshSide becomes vertexGroup for easier material assignment --------------------- replace = Blender.Mesh.AssignModes.REPLACE #or .AssignModes.ADD vg_band, vg_top, vg_bottom = [], [], [] for v in f_band: vg_band.extend(v) - cir.addVertGroup('side.band') ; cir.assignVertsToGroup('side.band', list(set(vg_band)), 1.0, replace) + me.addVertGroup('side.band') ; me.assignVertsToGroup('side.band', list(set(vg_band)), 1.0, replace) if settings.var['fill_on']: for v in f_top: vg_top.extend(v) for v in f_bottom: vg_bottom.extend(v) - cir.addVertGroup('side.top') ; cir.assignVertsToGroup('side.top', list(set(vg_top)), 1.0, replace) - cir.addVertGroup('side.bottom'); cir.assignVertsToGroup('side.bottom',list(set(vg_bottom)), 1.0, replace) + me.addVertGroup('side.top') ; me.assignVertsToGroup('side.top', list(set(vg_top)), 1.0, replace) + me.addVertGroup('side.bottom'); me.assignVertsToGroup('side.bottom',list(set(vg_bottom)), 1.0, replace) else: # if thic == 0 if settings.var['fill_on']: @@ -2563,20 +2677,18 @@ class Circle: #---------------------------------------------------------------- faces.append([len1-1, 0, center1]) #print 'deb:circleDraw:verts:', verts #--------------- #print 'deb:circleDraw:faces:', faces #--------------- - cir.verts.extend(verts) # add vertices to mesh - cir.faces.extend(faces) # add faces to the mesh + me.verts.extend(verts) # add vertices to mesh + me.faces.extend(faces) # add faces to the mesh else: - cir.verts.extend(verts) # add vertices to mesh + me.verts.extend(verts) # add vertices to mesh edges = [[num, num+1] for num in xrange(len(verts))] edges[-1][1] = 0 # it points the "new" last edge to the first vertex - cir.edges.extend(edges) # add edges to the mesh + me.edges.extend(edges) # add edges to the mesh ob.loc = tuple(self.loc) transform(self.extrusion, 0, ob) return ob - - class Arc: #----------------------------------------------------------------- """Class for objects representing dxf ARCs. @@ -2670,8 +2782,10 @@ class Arc: #----------------------------------------------------------------- return ob else: # draw ARC as mesh -------------------- - me = Mesh.New(obname) # create a new mesh - ob = SCENE.objects.new(me) # create a new mesh_object + if M_OBJ: obname, me, ob = makeNewObject() + else: + me = Mesh.New(obname) # create a new mesh + ob = SCENE.objects.new(me) # create a new mesh_object # set a number of segments in entire circle arc_res = settings.var['arc_res'] * sqrt(radius) / sqrt(settings.var['arc_rad']) @@ -2719,7 +2833,7 @@ class Arc: #----------------------------------------------------------------- for i in xrange(smooth_len): me.faces[i].smooth = True # each MeshSide becomes vertexGroup for easier material assignment --------------------- - if settings.var['vGroup_on']: + if settings.var['vGroup_on'] and not M_OBJ: # each MeshSide becomes vertexGroup for easier material assignment --------------------- replace = Blender.Mesh.AssignModes.REPLACE #or .AssignModes.ADD vg_left, vg_right, vg_top, vg_bottom = [], [], [], [] @@ -2792,8 +2906,8 @@ class BlockRecord: #----------------------------------------------------------- # optional data (with defaults) self.insertion_units = getit(obj, 70, None) self.insert_units = getit(obj, 1070, None) - """code 1070 Einfügeeinheiten: - 0 = Keine Einheiten; 1 = Zoll; 2 = Fuß; 3 = Meilen; 4 = Millimeter; + """code 1070 Einfuegeeinheiten: + 0 = Keine Einheiten; 1 = Zoll; 2 = Fuss; 3 = Meilen; 4 = Millimeter; 5 = Zentimeter; 6 = Meter; 7 = Kilometer; 8 = Mikrozoll; 9 = Mils; 10 = Yard; 11 = Angstrom; 12 = Nanometer; 13 = Mikrons; 14 = Dezimeter; 15 = Dekameter; @@ -3048,7 +3162,7 @@ class Insert: #---------------------------------------------------------------- return ob elif settings.drawTypes['insert']: #if insert_drawType activated - print 'deb:draw. settings.blocknamesmap:', settings.blocknamesmap #-------------------- + #print 'deb:draw. settings.blocknamesmap:', settings.blocknamesmap #-------------------- obname = settings.blocknamesmap[self.name] obname = 'in_%s' %obname # create object name from block name #obname = obname[:MAX_NAMELENGTH] @@ -3193,10 +3307,10 @@ class Ellipse: #--------------------------------------------------------------- if settings.var['lines_as'] == 4: # as thin_box thic = settings.var['thick_min'] width = settings.var['width_min'] - if settings.var['lines_as'] == 3: # as thin cylinder + elif settings.var['lines_as'] == 3: # as thin cylinder cyl_rad = 0.5 * settings.var['width_min'] - if settings.var['lines_as'] == 5: # draw ELLIPSE as curve ------------- + elif settings.var['lines_as'] == 5: # draw ELLIPSE as curve ------------- arc_res = settings.var['curve_arc'] triples = True VectorTriples = calcArc(None, radius, start, end, arc_res, triples) @@ -3236,12 +3350,13 @@ class Ellipse: #--------------------------------------------------------------- else: # draw ELLIPSE as mesh -------------------------------------- - me = Mesh.New(obname) # create a new mesh - ob = SCENE.objects.new(me) # create a new mesh_object + if M_OBJ: obname, me, ob = makeNewObject() + else: + me = Mesh.New(obname) # create a new mesh + ob = SCENE.objects.new(me) # create a new mesh_object # set a number of segments in entire circle arc_res = settings.var['arc_res'] * sqrt(radius) / sqrt(settings.var['arc_rad']) - verts = calcArc(None, radius, start, end, arc_res, False) #verts = [list(point) for point in verts] if False: #--todo--: if ellipse_closed: @@ -3287,8 +3402,7 @@ class Ellipse: #--------------------------------------------------------------- smooth_len = len(f_left) + len(f_right) for i in xrange(smooth_len): me.faces[i].smooth = True - - if settings.var['vGroup_on']: + if settings.var['vGroup_on'] and not M_OBJ: # each MeshSide becomes vertexGroup for easier material assignment --------------------- replace = Blender.Mesh.AssignModes.REPLACE #or .AssignModes.ADD vg_left, vg_right, vg_top, vg_bottom = [], [], [], [] @@ -3408,21 +3522,24 @@ class Face: #----------------------------------------------------------------- global activObjectName #print 'deb:draw:face.ob IN activObjectName: ', activObjectName #--------------------- - if activObjectLayer == self.layer and settings.var['one_mesh_on']: - obname = activObjectName - #print 'deb:face.draw obname from activObjectName: ', obname #--------------------- - ob = Object.Get(obname) # open an existing mesh_object - #ob = SCENE.getChildren(obname) # open an existing mesh_object - else: - obname = 'fa_%s' %self.layer # create object name from layer name - obname = obname[:MAX_NAMELENGTH] - me = Mesh.New(obname) # create a new mesh - ob = SCENE.objects.new(me) # create a new mesh_object - activObjectName = ob.name - activObjectLayer = self.layer - #print ('deb:except. new face.ob+mesh:"%s" created!' %ob.name) #--------------------- - - me = Mesh.Get(ob.name) # open objects mesh data + if M_OBJ: obname, me, ob = makeNewObject() + else: + if activObjectLayer == self.layer and settings.var['one_mesh_on']: + obname = activObjectName + #print 'deb:face.draw obname from activObjectName: ', obname #--------------------- + ob = getSceneChild(obname) # open an existing mesh_object + #ob = SCENE.getChildren(obname) # open an existing mesh_object + me = ob.getData(name_only=False, mesh=True) + else: + obname = 'fa_%s' %self.layer # create object name from layer name + obname = obname[:MAX_NAMELENGTH] + me = Mesh.New(obname) # create a new mesh + ob = SCENE.objects.new(me) # create a new mesh_object + activObjectName = ob.name + activObjectLayer = self.layer + #print ('deb:except. new face.ob+mesh:"%s" created!' %ob.name) #--------------------- + + #me = Mesh.Get(ob.name) # open objects mesh data faces, edges = [], [] n = len(me.verts) if len(self.points) == 4: @@ -3435,7 +3552,7 @@ class Face: #----------------------------------------------------------------- me.verts.extend(points) # add vertices to mesh if faces: me.faces.extend(faces) # add faces to the mesh if edges: me.edges.extend(edges) # add faces to the mesh - if settings.var['vGroup_on']: + if settings.var['vGroup_on'] and not M_OBJ: # entities with the same color build one vertexGroup for easier material assignment --------------------- ob.link(me) # link mesh to that object vG_name = 'color_%s' %self.color_index @@ -3468,6 +3585,7 @@ type_map = { # 'mline':MLine, 'polyline':Polyline, 'lwpolyline':LWpolyline, + 'spline':Spline, # 'region':Region, 'trace':Solid, 'solid':Solid, @@ -3738,7 +3856,11 @@ class Blocks: #---------------------------------------------------------------- global oblist oblist.append((ob, insertFlag, blockFlag)) else: + if M_OBJ: + car_end() + car_start() drawEntities(block.entities, self.settings, block_def) + if M_OBJ: car_end() self.settings.write("Drawing block:\'%s\' done!" %name) self.blocks[name] = blender_group @@ -3809,7 +3931,8 @@ class Settings: #-------------------------------------------------------------- """Given the drawing, build dictionaries of Layers, Colors and Blocks. """ - #de: paßt die distance parameter an globalScale + global oblist + #adjust the distance parameter to globalScale if self.var['g_scale'] != 1.0: self.var['dist_min'] = self.var['dist_min'] / self.var['g_scale'] self.var['thick_min'] = self.var['thick_min'] / self.var['g_scale'] @@ -3859,7 +3982,6 @@ class Settings: #-------------------------------------------------------------- if views: #---------------------------------- if self.var['views_on']: - global oblist for item in views.data: if type(item) != list and item.type == 'view': #print 'deb:settings_valid views dir(item)=', dir(item) #------------- @@ -3876,7 +3998,6 @@ class Settings: #-------------------------------------------------------------- if vports: #---------------------------------- if self.var['views_on']: - global oblist for item in vports.data: if type(item) != list and item.type == 'vport': #print 'deb:settings_valid views dir(item)=', dir(item) #------------- @@ -3901,7 +4022,8 @@ class Settings: #-------------------------------------------------------------- # Read the block definitions and build our block object if self.drawTypes['insert']: #if support for entity type 'Insert' is activated #Build a dictionary of blockname:block_data pairs - blocksmap, self.obj_number = getBlocksmap(drawing, layersmap, self.var['layFrozen_on']) + blocksmap, obj_number = getBlocksmap(drawing, layersmap, self.var['layFrozen_on']) + self.obj_number += obj_number self.blocknamesmap = getBlocknamesmap(blocksmap) self.blocks = Blocks(blocksmap, self) # initiates container for blocks_data self.usedBlocks = blocksmap.keys() @@ -3916,9 +4038,7 @@ class Settings: #-------------------------------------------------------------- # The section:entities if 'entities' in sections.keys(): self.write("found section:entities") - self.obj_number += len(drawing.entities.data) - #print 'deb:settings_valid self.obj_number', self.obj_number #---------- self.obj_number = 1.0 / self.obj_number @@ -4152,6 +4272,7 @@ def analyzeDXF(dxfFile): #--------------------------------------- def main(dxfFile): #---------------#############################----------- #print 'deb:filename:', filename #-------------- global SCENE + global oblist editmode = Window.EditMode() # are we in edit mode? If so ... if editmode: Window.EditMode(0) # leave edit mode before @@ -4206,7 +4327,6 @@ def main(dxfFile): #---------------#############################----------- return None # Draw all the know entity types in the current scene - global oblist oblist = [] # a list of all created AND linked objects for final f_globalScale time2 = Blender.sys.time() #time marker2 @@ -4218,9 +4338,12 @@ def main(dxfFile): #---------------#############################----------- global activObjectLayer, activObjectName activObjectLayer, activObjectName = None, None + if M_OBJ: car_init() + drawEntities(drawing.entities, settings) #print 'deb:drawEntities after: oblist:', oblist #----------------------- + if M_OBJ: car_end() if oblist: # and settings.var['g_scale'] != 1: globalScale(oblist, settings.var['g_scale']) @@ -4357,7 +4480,7 @@ def getBlocksmap(drawing, layersmap, layFrozen_on=False): #-------------------- try: usedblocks[item.name] = [used, childList] except KeyError: print 'Cannot map "%s" - "%s" as Block!' %(item.name, item) #print 'deb:getBlocksmap: usedblocks=' , usedblocks #------------- - print 'deb:getBlocksmap: layersmap=' , layersmap #------------- + #print 'deb:getBlocksmap: layersmap=' , layersmap #------------- for item in drawing.entities.data: if type(item) != list and item.type == 'insert': @@ -4527,19 +4650,27 @@ def drawer(_type, entities, settings, block_def): #---------------------------- insertFlag = False alt_obname = activObjectName ob = entity.draw(settings) - if ob and ob.name != alt_obname: - if block_def: - blockFlag = True - bl_loc = block_def[1] - ob.loc = [ob.loc[0]-bl_loc[0],ob.loc[1]-bl_loc[1],ob.loc[2]-bl_loc[2]] - else: blockFlag = False - setObjectProperties(ob, group, entity, settings, block_def) - if settings.var['optimization'] <= settings.MIN: - #if settings.var['g_origin_on'] and not block_def: ob.loc = Mathutils.Vector(ob.loc) + settings.g_origin - if settings.var['g_scale_on']: globalScaleOne(ob, insertFlag, blockFlag, settings.var['g_scale']) - settings.redraw() - else: oblist.append((ob, insertFlag, blockFlag)) - + if ob: + if M_OBJ and ob.type=='Mesh': #'Curve', 'Text' + if block_def: + blockFlag = True + bl_loc = block_def[1] + ob.loc = [ob.loc[0]-bl_loc[0],ob.loc[1]-bl_loc[1],ob.loc[2]-bl_loc[2]] + car_nr() + + elif ob.name != alt_obname: + if block_def: + blockFlag = True + bl_loc = block_def[1] + ob.loc = [ob.loc[0]-bl_loc[0],ob.loc[1]-bl_loc[1],ob.loc[2]-bl_loc[2]] + else: blockFlag = False + setObjectProperties(ob, group, entity, settings, block_def) + if settings.var['optimization'] <= settings.MIN: + #if settings.var['g_origin_on'] and not block_def: ob.loc = Mathutils.Vector(ob.loc) + settings.g_origin + if settings.var['g_scale_on']: globalScaleOne(ob, insertFlag, blockFlag, settings.var['g_scale']) + settings.redraw() + else: oblist.append((ob, insertFlag, blockFlag)) + #print 'deb:Finished drawing:', entities[0].type #------------------------ message = "\nDrawing dxf\'%ss\' done!" % _type settings.write(message, True) @@ -4569,7 +4700,8 @@ def globalScaleOne(ob, insertFlag, blockFlag, SCALE): #------------------------ ob.loc = Mathutils.Vector(ob.loc) * SCALE_MAT else: # entire scaling for all other imported objects ------------ if ob.type == 'Mesh': - me = Mesh.Get(ob.name) + me = ob.getData(name_only=False, mesh=True) + #me = Mesh.Get(ob.name) # set centers of all objects in (0,0,0) #me.transform(ob.matrixWorld*SCALE_MAT) #ob.loc = Mathutils.Vector([0,0,0]) @@ -4990,6 +5122,7 @@ points_as_menu = "convert to: %t|empty %x1|mesh.vertex %x2|thin sphere %x3|thin lines_as_menu = "convert to: %t|*edge %x1|mesh %x2|*thin cylinder %x3|thin box %x4|curve %x5" mlines_as_menu = "convert to: %t|*edge %x1|*mesh %x2|*thin cylinder %x3|*thin box %x|*curve %x5" plines_as_menu = "convert to: %t|*edge %x1|mesh %x2|*thin cylinder %x3|*thin box %x4|curve %x5" +splines_as_menu = "convert to: %t|*edge %x1|mesh %x2|*thin cylinder %x3|*thin box %x4|curve %x5" plines3_as_menu = "convert to: %t|*edge %x1|mesh %x2|*thin cylinder %x3|*thin box %x4|curve %x5" plmesh_as_menu = "convert to: %t|*edge %x1|mesh %x2" solids_as_menu = "convert to: %t|*edge %x1|mesh %x2" @@ -5072,6 +5205,7 @@ keywords_org = { 'lines_as' : 2, 'mlines_as' : 2, 'plines_as' : 2, + 'splines_as' : 2, 'plines3_as': 2, 'plmesh_as' : 2, 'solids_as' : 2, @@ -5087,6 +5221,7 @@ drawTypes_org = { 'ellipse': 1, 'mline' : 0, 'polyline': 1, + 'spline': 0, 'plmesh': 1, 'pline3': 1, 'lwpolyline': 1, @@ -5272,12 +5407,14 @@ def presetConfig_curv(): #----------------------------------------------- GUI_A['lines_as'].val = 5 GUI_A['mlines_as'].val = 5 GUI_A['plines_as'].val = 5 + GUI_A['splines_as'].val = 5 GUI_A['plines3_as'].val = 5 else: GUI_A['points_as'].val = 2 GUI_A['lines_as'].val = 2 GUI_A['mlines_as'].val = 2 GUI_A['plines_as'].val = 2 + GUI_A['splines_as'].val = 2 GUI_A['plines3_as'].val = 2 @@ -5315,6 +5452,7 @@ def resetDefaultConfig_2D(): #----------------------------------------------- 'ellipse': 1, 'mline' : 0, 'polyline': 1, + 'spline': 0, 'plmesh': 0, 'pline3': 0, 'lwpolyline': 1, @@ -5361,6 +5499,7 @@ def resetDefaultConfig_3D(): #----------------------------------------------- 'ellipse': 1, 'mline' : 0, 'polyline': 1, + 'spline': 0, 'plmesh': 1, 'pline3': 1, 'lwpolyline': 1, @@ -5429,7 +5568,7 @@ def draw_UI(): #--------------------------------------------------------------- menu_w = (3 * butt_margin) + but_0c + but_1c + but_2c + but_3c #menu width simple_menu_h = 80 - extend_menu_h = 350 + extend_menu_h = 370 y = simple_menu_h # y is menu upper.y if config_UI.val: y += extend_menu_h x = 20 #menu left.x @@ -5450,8 +5589,9 @@ def draw_UI(): #--------------------------------------------------------------- if config_UI.val: b0, b0_ = but0c, but_0c + butt_margin b1, b1_ = but1c, but_1c - y -= 10 + y_top = y + y -= 10 y -= 20 Draw.BeginAlign() GUI_B['point'] = Draw.Toggle('POINT', EVENT_REDRAW, b0, y, b0_, 20, GUI_B['point'].val, "support dxf-POINT on/off") @@ -5476,7 +5616,14 @@ def draw_UI(): #--------------------------------------------------------------- y -= 20 Draw.BeginAlign() - GUI_B['polyline'] = Draw.Toggle('2D-PLINE', EVENT_REDRAW, b0, y, b0_, 20, GUI_B['polyline'].val, "support dxf-2D-POLYLINE on/off") + GUI_B['spline'] = Draw.Toggle('SPLINE', EVENT_REDRAW, b0, y, b0_, 20, GUI_B['spline'].val, "support dxf-SPLINE on/off") + if GUI_B['spline'].val: + GUI_A['splines_as'] = Draw.Menu(splines_as_menu, EVENT_NONE, but1c, y, but_1c, 20, GUI_A['splines_as'].val, "select target Blender-object") + Draw.EndAlign() + + y -= 20 + Draw.BeginAlign() + GUI_B['polyline'] = Draw.Toggle('2D/LWPLINE', EVENT_REDRAW, b0, y, b0_, 20, GUI_B['polyline'].val, "support dxf-2D-POLYLINE on/off") if GUI_B['polyline'].val: GUI_A['plines_as'] = Draw.Menu(plines_as_menu, EVENT_NONE, but1c, y, but_1c, 20, GUI_A['plines_as'].val, "select target Blender-object") Draw.EndAlign() @@ -5488,6 +5635,64 @@ def draw_UI(): #--------------------------------------------------------------- GUI_A['plines3_as'] = Draw.Menu(plines3_as_menu, EVENT_NONE, but1c, y, but_1c, 20, GUI_A['plines3_as'].val, "select target Blender-object") Draw.EndAlign() + y_down = y + # ----------------------------------------------- + + y = y_top + b0, b0_ = but2c, but_2c + butt_margin + b1, b1_ = but3c, but_3c + + y -= 10 + y -= 20 + Draw.BeginAlign() + GUI_B['plmesh'] = Draw.Toggle('POLY-MESH/FACE', EVENT_NONE, b0, y, b0_+b1_, 20, GUI_B['plmesh'].val, "support dxf-POLYMESH/POLYFACE on/off") +# GUI_A['plmesh_as'] = Draw.Menu(plmesh_as_menu, EVENT_NONE, but1c, y, but_1c, 20, GUI_A['plmesh_as'].val, "select target Blender-object") + Draw.EndAlign() + + y -= 20 + Draw.BeginAlign() + GUI_B['solid'] = Draw.Toggle('SOLID', EVENT_NONE, b0, y, b0_, 20, GUI_B['solid'].val, "support dxf-SOLID and TRACE on/off") + GUI_B['face'] = Draw.Toggle('3DFACE', EVENT_NONE, b1, y, b1_, 20, GUI_B['face'].val, "support dxf-3DFACE on/off") +# GUI_A['solids_as'] = Draw.Menu(solids_as_menu, EVENT_NONE, but3c, y, but_3c, 20, GUI_A['solids_as'].val, "select target Blender-object") + Draw.EndAlign() + #print 'deb:support solid, trace', GUI_B['trace'].val, GUI_B['solid'].val # ------------ + + + y -= 20 + Draw.BeginAlign() + GUI_B['text'] = Draw.Toggle('TEXT', EVENT_NONE, b0, y, b0_, 20, GUI_B['text'].val, "support dxf-TEXT on/off") + GUI_B['mtext'] = Draw.Toggle('*MTEXT', EVENT_NONE, b1, y, b1_, 20, GUI_B['mtext'].val, "(*wip)support dxf-MTEXT on/off") +# GUI_A['texts_as'] = Draw.Menu(texts_as_menu, EVENT_NONE, but3c, y, but_3c, 20, GUI_A['texts_as'].val, "select target Blender-object") + Draw.EndAlign() + + y -= 20 + Draw.BeginAlign() + GUI_B['block'] = Draw.Toggle('BLOCK', EVENT_REDRAW, b0, y, b0_-30, 20, GUI_B['block'].val, "support dxf-BLOCK and ARRAY on/off") + GUI_B['insert'].val = GUI_B['block'].val + if GUI_B['block'].val: + GUI_A['block_nn'] = Draw.Toggle('n', EVENT_NONE, b1-30, y, 15, 20, GUI_A['block_nn'].val, "support hatch/noname BLOCKs *X... on/off") + GUI_A['blockFilter_on'] = Draw.Toggle('F', EVENT_NONE, b1-15, y, 15, 20, GUI_A['blockFilter_on'].val, "(*wip) support name filtering of BLOCKs on/off") + GUI_A['xref_on'] = Draw.Toggle('Xref', EVENT_NONE, b1, y, 20, 20, GUI_A['xref_on'].val, "support place holder for XREF-BLOCKs on/off") + GUI_A['blocks_as'] = Draw.Menu(blocks_as_menu, EVENT_NONE, b1+20, y, b1_-20, 20, GUI_A['blocks_as'].val, "select target representation for imported BLOCKs") + Draw.EndAlign() + + + y -= 20 + Draw.BeginAlign() + GUI_A['views_on'] = Draw.Toggle('views', EVENT_NONE, b0, y, b0_-25, 20, GUI_A['views_on'].val, "imports VIEWs and VIEWPORTs as cameras on/off") + GUI_A['cams_on'] = Draw.Toggle('*cams', EVENT_NONE, b1-25, y, b1_-25, 20, GUI_A['cams_on'].val, "(*wip) support ASHADE cameras on/off") + GUI_A['lights_on'] = Draw.Toggle('*lights', EVENT_NONE, b1+25, y, b1_-25, 20, GUI_A['lights_on'].val, "(*wip) support AVE_RENDER lights on/off") + Draw.EndAlign() + + + if y < y_down: y_down = y + # -----end supported objects-------------------------------------- + + b0, b0_ = but0c, but_0c + butt_margin + b1, b1_ = but1c, but_1c + + y_top = y_down + y = y_top y -= 10 y -= 20 Draw.BeginAlign() @@ -5534,6 +5739,14 @@ def draw_UI(): #--------------------------------------------------------------- Draw.Label(scale_str, b1+45, y, 200, 20) Draw.EndAlign() + y_down = y + # -----end material,translate,scale------------------------------------------ + + b0, b0_ = but0c, but_0c + butt_margin + b1, b1_ = but1c, but_1c + + y_top = y_down + y = y_top y -= 10 y -= 20 Draw.BeginAlign() @@ -5571,56 +5784,11 @@ def draw_UI(): #--------------------------------------------------------------- y_down = y # ----------------------------------------------- - y = simple_menu_h + extend_menu_h +20 + b0, b0_ = but2c, but_2c + butt_margin b1, b1_ = but3c, but_3c - y -= 20 - Draw.BeginAlign() - GUI_B['plmesh'] = Draw.Toggle('POLY-MESH/FACE', EVENT_NONE, b0, y, b0_+b1_, 20, GUI_B['plmesh'].val, "support dxf-POLYMESH/POLYFACE on/off") -# GUI_A['plmesh_as'] = Draw.Menu(plmesh_as_menu, EVENT_NONE, but1c, y, but_1c, 20, GUI_A['plmesh_as'].val, "select target Blender-object") - Draw.EndAlign() - - y -= 20 - Draw.BeginAlign() - GUI_B['solid'] = Draw.Toggle('SOLID', EVENT_NONE, b0, y, b0_, 20, GUI_B['solid'].val, "support dxf-SOLID and TRACE on/off") - GUI_B['face'] = Draw.Toggle('3DFACE', EVENT_NONE, b1, y, b1_, 20, GUI_B['face'].val, "support dxf-3DFACE on/off") -# GUI_A['solids_as'] = Draw.Menu(solids_as_menu, EVENT_NONE, but3c, y, but_3c, 20, GUI_A['solids_as'].val, "select target Blender-object") - Draw.EndAlign() - #print 'deb:support solid, trace', GUI_B['trace'].val, GUI_B['solid'].val # ------------ - - - y -= 20 - Draw.BeginAlign() - GUI_B['text'] = Draw.Toggle('TEXT', EVENT_NONE, b0, y, b0_, 20, GUI_B['text'].val, "support dxf-TEXT on/off") - GUI_B['mtext'] = Draw.Toggle('*MTEXT', EVENT_NONE, b1, y, b1_, 20, GUI_B['mtext'].val, "(*wip)support dxf-MTEXT on/off") -# GUI_A['texts_as'] = Draw.Menu(texts_as_menu, EVENT_NONE, but3c, y, but_3c, 20, GUI_A['texts_as'].val, "select target Blender-object") - Draw.EndAlign() - - y -= 20 - Draw.BeginAlign() - GUI_B['block'] = Draw.Toggle('BLOCK', EVENT_REDRAW, b0, y, b0_-30, 20, GUI_B['block'].val, "support dxf-BLOCK and ARRAY on/off") - GUI_B['insert'].val = GUI_B['block'].val - if GUI_B['block'].val: - GUI_A['block_nn'] = Draw.Toggle('n', EVENT_NONE, b1-30, y, 15, 20, GUI_A['block_nn'].val, "support hatch/noname BLOCKs *X... on/off") - GUI_A['blockFilter_on'] = Draw.Toggle('F', EVENT_NONE, b1-15, y, 15, 20, GUI_A['blockFilter_on'].val, "(*wip) support name filtering of BLOCKs on/off") - GUI_A['xref_on'] = Draw.Toggle('Xref', EVENT_NONE, b1, y, 20, 20, GUI_A['xref_on'].val, "support place holder for XREF-BLOCKs on/off") - GUI_A['blocks_as'] = Draw.Menu(blocks_as_menu, EVENT_NONE, b1+20, y, b1_-20, 20, GUI_A['blocks_as'].val, "select target representation for imported BLOCKs") - Draw.EndAlign() - - - y -= 20 - Draw.BeginAlign() - GUI_A['views_on'] = Draw.Toggle('views', EVENT_NONE, b0, y, b0_-25, 20, GUI_A['views_on'].val, "imports VIEWs and VIEWPORTs as cameras on/off") - GUI_A['cams_on'] = Draw.Toggle('*cams', EVENT_NONE, b1-25, y, b1_-25, 20, GUI_A['cams_on'].val, "(*wip) support ASHADE cameras on/off") - GUI_A['lights_on'] = Draw.Toggle('*lights', EVENT_NONE, b1+25, y, b1_-25, 20, GUI_A['lights_on'].val, "(*wip) support AVE_RENDER lights on/off") - Draw.EndAlign() - - y -= 10 - y -= 20 - y -= 20 - y -= 20 - + y = y_top y -= 10 y -= 20 Draw.BeginAlign() @@ -5656,8 +5824,13 @@ def draw_UI(): #--------------------------------------------------------------- GUI_A['newScene_on'] = Draw.Toggle('newScene', EVENT_NONE, b0, y, b0_, 20, GUI_A['newScene_on'].val, "creates new Blender-Scene for each import on/off") GUI_A['target_layer'] = Draw.Number('layer', EVENT_NONE, b1, y, b1_, 20, GUI_A['target_layer'].val, 1, 18, "imports into this Blender-layer (<19> reserved for block_definitions)") + if y < y_down: y_down = y + # -----end options -------------------------------------- + + #-------------------------------------- - if y > y_down: y = y_down + y_top = y_down + y = y_top #GUI_A['dummy_on'] = Draw.Toggle(' - ', EVENT_NONE, but0c, y, but_0c, 20, GUI_A['dummy_on'].val, "reserved") y -= 30 Draw.BeginAlign() @@ -5891,6 +6064,7 @@ def multi_import(DIR): +UI_MODE = True if __name__ == "__main__": UI_MODE = True @@ -5942,5 +6116,4 @@ if 1: main(_dxf) print 'TOTAL TIME: %.6f' % (Blender.sys.time() - TIME) -""" - +""" \ No newline at end of file diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index a940ac62876..116a59fa97e 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -108,6 +108,7 @@ void object_boundbox_flag(struct Object *ob, int flag, int set); void minmax_object(struct Object *ob, float *min, float *max); void minmax_object_duplis(struct Object *ob, float *min, float *max); void solve_tracking (struct Object *ob, float targetmat[][4]); +int ray_hit_boundbox(struct BoundBox *bb, float ray_start[3], float ray_normal[3]); void object_handle_update(struct Object *ob); diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 654cf0991cc..30405660658 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -186,10 +186,6 @@ void DM_init_funcs(DerivedMesh *dm) void DM_init(DerivedMesh *dm, int numVerts, int numEdges, int numFaces) { - CustomData_add_layer(&dm->vertData, CD_ORIGINDEX, CD_CALLOC, NULL, numVerts); - CustomData_add_layer(&dm->edgeData, CD_ORIGINDEX, CD_CALLOC, NULL, numEdges); - CustomData_add_layer(&dm->faceData, CD_ORIGINDEX, CD_CALLOC, NULL, numFaces); - dm->numVertData = numVerts; dm->numEdgeData = numEdges; dm->numFaceData = numFaces; diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index c2946bb666f..472df3d0f26 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -732,6 +732,10 @@ DerivedMesh *CDDM_new(int numVerts, int numEdges, int numFaces) DM_init(dm, numVerts, numEdges, numFaces); + CustomData_add_layer(&dm->vertData, CD_ORIGINDEX, CD_CALLOC, NULL, numVerts); + CustomData_add_layer(&dm->edgeData, CD_ORIGINDEX, CD_CALLOC, NULL, numEdges); + CustomData_add_layer(&dm->faceData, CD_ORIGINDEX, CD_CALLOC, NULL, numFaces); + CustomData_add_layer(&dm->vertData, CD_MVERT, CD_CALLOC, NULL, numVerts); CustomData_add_layer(&dm->edgeData, CD_MEDGE, CD_CALLOC, NULL, numEdges); CustomData_add_layer(&dm->faceData, CD_MFACE, CD_CALLOC, NULL, numFaces); @@ -753,6 +757,11 @@ DerivedMesh *CDDM_from_mesh(Mesh *mesh, Object *ob) * with an exception for fluidsim */ DM_init(dm, mesh->totvert, mesh->totedge, mesh->totface); + + CustomData_add_layer(&dm->vertData, CD_ORIGINDEX, CD_CALLOC, NULL, mesh->totvert); + CustomData_add_layer(&dm->edgeData, CD_ORIGINDEX, CD_CALLOC, NULL, mesh->totedge); + CustomData_add_layer(&dm->faceData, CD_ORIGINDEX, CD_CALLOC, NULL, mesh->totface); + dm->deformedOnly = 1; if(ob && ob->fluidsimSettings && ob->fluidsimSettings->meshSurface) diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index fc9a8132aaf..7f41ca033d3 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -683,7 +683,8 @@ CollPair* cloth_collision ( ModifierData *md1, ModifierData *md2, BVHTreeOverlap collpair->distance = distance; collpair->flag = 0; - } + collpair++; + }/* else { float w1, w2, w3, u1, u2, u3; @@ -716,9 +717,9 @@ CollPair* cloth_collision ( ModifierData *md1, ModifierData *md2, BVHTreeOverlap { // check for collision in the future collpair->flag |= COLLISION_IN_FUTURE; + collpair++; } - } - collpair++; + }*/ } return collpair; } @@ -1398,7 +1399,7 @@ int cloth_bvh_objcollision ( ClothModifierData * clmd, float step, float dt ) Cloth *cloth=NULL; Object *coll_ob=NULL; BVHTree *cloth_bvh=NULL; - long i=0, j = 0, k = 0, numfaces = 0, numverts = 0; + long i=0, j = 0, k = 0, l = 0, numfaces = 0, numverts = 0; int result = 0, rounds = 0; // result counts applied collisions; ic is for debug output; ClothVertex *verts = NULL; int ret = 0, ret2 = 0; @@ -1498,88 +1499,91 @@ int cloth_bvh_objcollision ( ClothModifierData * clmd, float step, float dt ) //////////////////////////////////////////////////////////// if ( clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_SELF ) { - // TODO: add coll quality rounds again - BVHTreeOverlap *overlap = NULL; - - collisions = 1; - verts = cloth->verts; // needed for openMP - - numfaces = clmd->clothObject->numfaces; - numverts = clmd->clothObject->numverts; - - verts = cloth->verts; - - if ( cloth->bvhselftree ) + for(l = 0; l < clmd->coll_parms->self_loop_count; l++) { - // search for overlapping collision pairs - overlap = BLI_bvhtree_overlap ( cloth->bvhselftree, cloth->bvhselftree, &result ); - -// #pragma omp parallel for private(k, i, j) schedule(static) - for ( k = 0; k < result; k++ ) + // TODO: add coll quality rounds again + BVHTreeOverlap *overlap = NULL; + + collisions = 1; + verts = cloth->verts; // needed for openMP + + numfaces = clmd->clothObject->numfaces; + numverts = clmd->clothObject->numverts; + + verts = cloth->verts; + + if ( cloth->bvhselftree ) { - float temp[3]; - float length = 0; - float mindistance; - - i = overlap[k].indexA; - j = overlap[k].indexB; - - mindistance = clmd->coll_parms->selfepsilon* ( cloth->verts[i].avg_spring_len + cloth->verts[j].avg_spring_len ); - - if ( clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL ) + // search for overlapping collision pairs + overlap = BLI_bvhtree_overlap ( cloth->bvhselftree, cloth->bvhselftree, &result ); + + // #pragma omp parallel for private(k, i, j) schedule(static) + for ( k = 0; k < result; k++ ) { - if ( ( cloth->verts [i].flags & CLOTH_VERT_FLAG_PINNED ) - && ( cloth->verts [j].flags & CLOTH_VERT_FLAG_PINNED ) ) + float temp[3]; + float length = 0; + float mindistance; + + i = overlap[k].indexA; + j = overlap[k].indexB; + + mindistance = clmd->coll_parms->selfepsilon* ( cloth->verts[i].avg_spring_len + cloth->verts[j].avg_spring_len ); + + if ( clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL ) + { + if ( ( cloth->verts [i].flags & CLOTH_VERT_FLAG_PINNED ) + && ( cloth->verts [j].flags & CLOTH_VERT_FLAG_PINNED ) ) + { + continue; + } + } + + VECSUB ( temp, verts[i].tx, verts[j].tx ); + + if ( ( ABS ( temp[0] ) > mindistance ) || ( ABS ( temp[1] ) > mindistance ) || ( ABS ( temp[2] ) > mindistance ) ) continue; + + // check for adjacent points (i must be smaller j) + if ( BLI_edgehash_haskey ( cloth->edgehash, MIN2(i, j), MAX2(i, j) ) ) { continue; } - } - - VECSUB ( temp, verts[i].tx, verts[j].tx ); - - if ( ( ABS ( temp[0] ) > mindistance ) || ( ABS ( temp[1] ) > mindistance ) || ( ABS ( temp[2] ) > mindistance ) ) continue; - - // check for adjacent points (i must be smaller j) - if ( BLI_edgehash_haskey ( cloth->edgehash, MIN2(i, j), MAX2(i, j) ) ) - { - continue; - } - - length = Normalize ( temp ); - - if ( length < mindistance ) - { - float correction = mindistance - length; - - if ( cloth->verts [i].flags & CLOTH_VERT_FLAG_PINNED ) + + length = Normalize ( temp ); + + if ( length < mindistance ) { - VecMulf ( temp, -correction ); - VECADD ( verts[j].tx, verts[j].tx, temp ); - } - else if ( cloth->verts [j].flags & CLOTH_VERT_FLAG_PINNED ) - { - VecMulf ( temp, correction ); - VECADD ( verts[i].tx, verts[i].tx, temp ); + float correction = mindistance - length; + + if ( cloth->verts [i].flags & CLOTH_VERT_FLAG_PINNED ) + { + VecMulf ( temp, -correction ); + VECADD ( verts[j].tx, verts[j].tx, temp ); + } + else if ( cloth->verts [j].flags & CLOTH_VERT_FLAG_PINNED ) + { + VecMulf ( temp, correction ); + VECADD ( verts[i].tx, verts[i].tx, temp ); + } + else + { + VecMulf ( temp, -correction*0.5 ); + VECADD ( verts[j].tx, verts[j].tx, temp ); + + VECSUB ( verts[i].tx, verts[i].tx, temp ); + } + ret = 1; + ret2 += ret; } else { - VecMulf ( temp, -correction*0.5 ); - VECADD ( verts[j].tx, verts[j].tx, temp ); - - VECSUB ( verts[i].tx, verts[i].tx, temp ); + // check for approximated time collisions } - ret = 1; - ret2 += ret; - } - else - { - // check for approximated time collisions } + + if ( overlap ) + MEM_freeN ( overlap ); + } - - if ( overlap ) - MEM_freeN ( overlap ); - } //////////////////////////////////////////////////////////// diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 3644a50b799..77068d8ed66 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -1278,7 +1278,7 @@ void *CustomData_em_get_n(const CustomData *data, void *block, int type, int n) int layer_index; /* get the layer index of the first layer of type */ - layer_index = CustomData_get_active_layer_index(data, type); + layer_index = CustomData_get_layer_index(data, type); if(layer_index < 0) return NULL; return (char *)block + data->layers[layer_index+n].offset; diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index cc3f3f211a4..7c50b409693 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -934,7 +934,7 @@ int new_id(ListBase *lb, ID *id, const char *tname) } /* if result > 21, strncpy don't put the final '\0' to name. */ - if( result > 21 ) name[21]= 0; + if( result >= 21 ) name[21]= 0; result = check_for_dupid( lb, id, name ); strcpy( id->name+2, name ); diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 4f901ba7216..125243bc56f 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -2380,3 +2380,31 @@ int give_obdata_texspace(Object *ob, int **texflag, float **loc, float **size, f } return 1; } + +/* + * Test a bounding box for ray intersection + * assumes the ray is already local to the boundbox space + */ +int ray_hit_boundbox(struct BoundBox *bb, float ray_start[3], float ray_normal[3]) +{ + static int triangle_indexes[12][3] = {{0, 1, 2}, {0, 2, 3}, + {3, 2, 6}, {3, 6, 7}, + {1, 2, 6}, {1, 6, 5}, + {5, 6, 7}, {4, 5, 7}, + {0, 3, 7}, {0, 4, 7}, + {0, 1, 5}, {0, 4, 5}}; + int result = 0; + int i; + + for (i = 0; i < 12 && result == 0; i++) + { + float lambda; + int v1, v2, v3; + v1 = triangle_indexes[i][0]; + v2 = triangle_indexes[i][1]; + v3 = triangle_indexes[i][2]; + result = RayIntersectsTriangle(ray_start, ray_normal, bb->vec[v1], bb->vec[v2], bb->vec[v3], &lambda, NULL); + } + + return result; +} diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 5112fb08fe6..f06ef221795 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -4814,9 +4814,20 @@ static void system_step(Object *ob, ParticleSystem *psys, ParticleSystemModifier pa->flag &= ~PARS_NO_DISP; } - /* ok now we're all set so let's go */ - if(psys->totpart) - dynamics_step(ob,psys,psmd,cfra,vg_vel,vg_tan,vg_rot,vg_size); + if(psys->totpart) { + int dframe, totframesback = 0; + + /* handle negative frame start at the first frame by doing + * all the steps before the first frame */ + if(framenr == startframe && part->sta < startframe) + totframesback = (startframe - (int)part->sta); + + for(dframe=-totframesback; dframe<=0; dframe++) { + /* ok now we're all set so let's go */ + dynamics_step(ob,psys,psmd,cfra+dframe,vg_vel,vg_tan,vg_rot,vg_size); + psys->cfra = cfra+dframe; + } + } cache->simframe= framenr; cache->flag |= PTCACHE_SIMULATION_VALID; diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 7b727528b3d..57ecffbb796 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -185,8 +185,8 @@ static int ptcache_path(PTCacheID *pid, char *filename) file[i-6] = '\0'; sprintf(filename, "//"PTCACHE_PATH"%s", file); /* add blend file name to pointcache dir */ - BLI_add_slash(filename); BLI_convertstringcode(filename, blendfilename); + BLI_add_slash(filename); return strlen(filename); } diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 872f81ead63..876547042dc 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -2075,13 +2075,13 @@ void txt_backspace_char (Text *text) return; } else if (text->curc==0) { /* Appending two lines */ - if (text->curl->prev) { - text->curl= text->curl->prev; - text->curc= text->curl->len; - - txt_combine_lines(text, text->curl, text->curl->next); - txt_pop_sel(text); - } + if (!text->curl->prev) return; + + text->curl= text->curl->prev; + text->curc= text->curl->len; + + txt_combine_lines(text, text->curl, text->curl->next); + txt_pop_sel(text); } else { /* Just backspacing a char */ int i= text->curc-1; diff --git a/source/blender/blenlib/BLI_arithb.h b/source/blender/blenlib/BLI_arithb.h index 9ed23bc32b6..4d277cf98e1 100644 --- a/source/blender/blenlib/BLI_arithb.h +++ b/source/blender/blenlib/BLI_arithb.h @@ -258,6 +258,7 @@ void Vec2Addf(float *v, float *v1, float *v2); void Vec2Subf(float *v, float *v1, float *v2); void Vec2Copyf(float *v1, float *v2); +void AxisAngleToQuat(float *q, float *axis, float angle); void vectoquat(float *vec, short axis, short upflag, float *q); float VecAngle2(float *v1, float *v2); @@ -269,6 +270,8 @@ float NormalizedVecAngle2_2D(float *v1, float *v2); void euler_rot(float *beul, float ang, char axis); +void NormalShortToFloat(float *out, short *in); +void NormalFloatToShort(short *out, float *in); float DistVL2Dfl(float *v1, float *v2, float *v3); float PdistVL2Dfl(float *v1, float *v2, float *v3); @@ -372,6 +375,7 @@ void tubemap(float x, float y, float z, float *u, float *v); void spheremap(float x, float y, float z, float *u, float *v); int LineIntersectsTriangle(float p1[3], float p2[3], float v0[3], float v1[3], float v2[3], float *lambda, float *uv); +int RayIntersectsTriangle(float p1[3], float d[3], float v0[3], float v1[3], float v2[3], float *lambda, float *uv); int SweepingSphereIntersectsTriangleUV(float p1[3], float p2[3], float radius, float v0[3], float v1[3], float v2[3], float *lambda, float *ipoint); int AxialLineIntersectsTriangle(int axis, float co1[3], float co2[3], float v0[3], float v1[3], float v2[3], float *lambda); int AabbIntersectAabb(float min1[3], float max1[3], float min2[3], float max2[3]); diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index 2dc345e894e..e69332be295 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -250,16 +250,16 @@ void sort_along_axis(BVHTree *tree, int start, int end, int axis) //after a call to this function you can expect one of: // every node to left of a[n] are smaller or equal to it // every node to the right of a[n] are greater or equal to it -int partition_nth_element(BVHNode **a, int _begin, int _end, int n, int axis){ - int begin = _begin, end = _end, cut; - while(end-begin > 3) - { - cut = bvh_partition(a, begin, end, bvh_medianof3(a, begin, (begin+end)/2, end-1, axis), axis ); - if(cut <= n) - begin = cut; - else - end = cut; - } +int partition_nth_element(BVHNode **a, int _begin, int _end, int n, int axis){ + int begin = _begin, end = _end, cut; + while(end-begin > 3) + { + cut = bvh_partition(a, begin, end, bvh_medianof3(a, begin, (begin+end)/2, end-1, axis), axis ); + if(cut <= n) + begin = cut; + else + end = cut; + } bvh_insertionsort(a, begin, end, axis); return n; @@ -424,7 +424,7 @@ static void refit_kdop_hull(BVHTree *tree, BVHNode *node, int start, int end) for (j = start; j < end; j++) { - // for all Axes. +// for all Axes. for (i = tree->start_axis; i < tree->stop_axis; i++) { newmin = tree->nodes[j]->bv[(2 * i)]; @@ -708,7 +708,7 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, int *result) } #pragma omp parallel for private(j) schedule(static) - for(j = 0; j < tree1->tree_type; j++) + for(j = 0; j < MIN2(tree1->tree_type, tree1->nodes[tree1->totleaf]->totnode); j++) { traverse(data[j], tree1->nodes[tree1->totleaf]->children[j], tree2->nodes[tree2->totleaf]); } diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index 48a149f4b3a..322a9e6fd02 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -1335,6 +1335,22 @@ void NormalQuat(float *q) } } +void AxisAngleToQuat(float *q, float *axis, float angle) +{ + float nor[3]; + float si; + + VecCopyf(nor, axis); + Normalize(nor); + + angle /= 2; + si = (float)sin(angle); + q[0] = (float)cos(angle); + q[1] = nor[0] * si; + q[2] = nor[1] * si; + q[3] = nor[2] * si; +} + void vectoquat(float *vec, short axis, short upflag, float *q) { float q2[4], nor[3], *fp, mat[3][3], angle, si, co, x2, y2, z2, len1; @@ -2258,6 +2274,20 @@ double Sqrt3d(double d) else return exp(log(d)/3); } +void NormalShortToFloat(float *out, short *in) +{ + out[0] = in[0] / 32767.0; + out[1] = in[1] / 32767.0; + out[2] = in[2] / 32767.0; +} + +void NormalFloatToShort(short *out, float *in) +{ + out[0] = (short)(in[0] * 32767.0); + out[1] = (short)(in[1] * 32767.0); + out[2] = (short)(in[2] * 32767.0); +} + /* distance v1 to line v2-v3 */ /* using Hesse formula, NO LINE PIECE! */ float DistVL2Dfl( float *v1, float *v2, float *v3) { @@ -3671,6 +3701,43 @@ int LineIntersectsTriangle(float p1[3], float p2[3], float v0[3], float v1[3], f return 1; } +/* moved from effect.c + test if the ray starting at p1 going in d direction intersects the triangle v0..v2 + return non zero if it does +*/ +int RayIntersectsTriangle(float p1[3], float d[3], float v0[3], float v1[3], float v2[3], float *lambda, float *uv) +{ + float p[3], s[3], e1[3], e2[3], q[3]; + float a, f, u, v; + + VecSubf(e1, v1, v0); + VecSubf(e2, v2, v0); + + Crossf(p, d, e2); + a = Inpf(e1, p); + if ((a > -0.000001) && (a < 0.000001)) return 0; + f = 1.0f/a; + + VecSubf(s, p1, v0); + + Crossf(q, s, e1); + *lambda = f * Inpf(e2, q); + if ((*lambda < 0.0)) return 0; + + u = f * Inpf(s, p); + if ((u < 0.0)||(u > 1.0)) return 0; + + v = f * Inpf(d, q); + if ((v < 0.0)||((u + v) > 1.0)) return 0; + + if(uv) { + uv[0]= u; + uv[1]= v; + } + + return 1; +} + /* Adapted from the paper by Kasper Fauerby */ /* "Improved Collision detection and Response" */ int SweepingSphereIntersectsTriangleUV(float p1[3], float p2[3], float radius, float v0[3], float v1[3], float v2[3], float *lambda, float *ipoint) diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index 79d3e487712..898ad6ddd67 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -456,13 +456,10 @@ void checkMissingFiles( char *txtname ) { /* be sure there is low chance of the path being too short */ char filepath_expanded[FILE_MAXDIR*2]; - char *libpath; int files_missing = 0; BLI_bpathIterator_init(&bpi); while (!BLI_bpathIterator_isDone(&bpi)) { - libpath = BLI_bpathIterator_getLib(&bpi); - BLI_bpathIterator_getPathExpanded( &bpi, filepath_expanded ); if (!BLI_exists(filepath_expanded)) { diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index 3610813f2da..a353015052c 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -865,11 +865,8 @@ int BLI_strcaseeq(char *a, char *b) { void BLI_cleanup_dir(const char *relabase, char *dir) { BLI_cleanup_file(relabase, dir); -#ifdef WIN32 - strcat(dir, "\\"); -#else - strcat(dir, "/"); -#endif + BLI_add_slash(dir); + } void BLI_cleanup_file(const char *relabase, char *dir) @@ -878,7 +875,23 @@ void BLI_cleanup_file(const char *relabase, char *dir) char *start, *eind; if (relabase) { BLI_convertstringcode(dir, relabase); + } else { + if (dir[0]=='/' && dir[1]=='/') { + if (dir[2]== '\0') { + return; /* path is "//" - cant clean it */ + } + dir = dir+2; /* skip the first // */ + } } + + /* Note + * memmove( start, eind, strlen(eind)+1 ); + * is the same as + * strcpy( start, eind ); + * except strcpy should not be used because there is overlap, + * so use memmove's slightly more obscure syntax - Campbell + */ + #ifdef WIN32 if(dir[0]=='.') { /* happens for example in FILE_MAIN */ get_default_root(dir); @@ -892,17 +905,18 @@ void BLI_cleanup_file(const char *relabase, char *dir) if (dir[a] == '\\') break; a--; } - strcpy(dir+a,eind); + memmove( dir+a, eind, strlen(eind)+1 ); + } while ( (start = strstr(dir,"\\.\\")) ){ eind = start + strlen("\\.\\") - 1; - strcpy(start,eind); + memmove( start, eind, strlen(eind)+1 ); } while ( (start = strstr(dir,"\\\\" )) ){ eind = start + strlen("\\\\") - 1; - strcpy(start,eind); + memmove( start, eind, strlen(eind)+1 ); } if((a = strlen(dir))){ /* remove the '\\' at the end */ @@ -925,17 +939,17 @@ void BLI_cleanup_file(const char *relabase, char *dir) if (dir[a] == '/') break; a--; } - strcpy(dir+a,eind); + memmove( dir+a, eind, strlen(eind)+1 ); } while ( (start = strstr(dir,"/./")) ){ eind = start + strlen("/./") - 1; - strcpy(start,eind); + memmove( start, eind, strlen(eind)+1 ); } while ( (start = strstr(dir,"//" )) ){ eind = start + strlen("//") - 1; - strcpy(start,eind); + memmove( start, eind, strlen(eind)+1 ); } if( (a = strlen(dir)) ){ /* remove all '/' at the end */ @@ -1150,24 +1164,32 @@ int BLI_convertstringcode(char *path, const char *basepath) BLI_char_switch(tmp, '\\', '/'); BLI_char_switch(base, '\\', '/'); + /* Paths starting with // will get the blend file as their base, + * this isnt standard in any os but is uesed in blender all over the place */ if (tmp[0] == '/' && tmp[1] == '/') { - char *filepart= BLI_strdup(tmp+2); /* skip code */ char *lslash= BLI_last_slash(base); - if (lslash) { int baselen= (int) (lslash-base) + 1; - + /* use path for for temp storage here, we copy back over it right away */ + BLI_strncpy(path, tmp+2, FILE_MAX); + memcpy(tmp, base, baselen); - strcpy(tmp+baselen, filepart); + strcpy(tmp+baselen, path); + strcpy(path, tmp); } else { - strcpy(tmp, filepart); + strcpy(path, tmp+2); } - - MEM_freeN(filepart); + } else { + strcpy(path, tmp); } - BLI_cleanup_file(NULL, tmp); - strcpy(path, tmp); + if (path[0]!='\0') { + if ( path[strlen(path)-1]=='/') { + BLI_cleanup_dir(NULL, path); + } else { + BLI_cleanup_file(NULL, path); + } + } #ifdef WIN32 /* skip first two chars, which in case of diff --git a/source/blender/include/BIF_resources.h b/source/blender/include/BIF_resources.h index adddb0d1347..e6cbe7bb69a 100644 --- a/source/blender/include/BIF_resources.h +++ b/source/blender/include/BIF_resources.h @@ -293,7 +293,7 @@ typedef enum { ICON_ARMATURE_DEHLT, ICON_SNAP_GEAR, ICON_SNAP_GEO, - ICON_BLANK41, + ICON_SNAP_NORMAL, ICON_BLANK42, ICON_SMOOTHCURVE, diff --git a/source/blender/include/BSE_view.h b/source/blender/include/BSE_view.h index 236f35f17c6..f7afce958f5 100644 --- a/source/blender/include/BSE_view.h +++ b/source/blender/include/BSE_view.h @@ -63,7 +63,11 @@ void window_to_3d(float *vec, short mx, short my); void project_short(float *vec, short *adr); void project_short_noclip(float *vec, short *adr); void project_int(float *vec, int *adr); +void project_int_noclip(float *vec, int *adr); void project_float(float *vec, float *adr); +void project_float_noclip(float *vec, float *adr); +void viewray(short mval[2], float ray_start[3], float ray_normal[3]); +void viewline(short mval[2], float ray_start[3], float ray_end[3]); int boundbox_clip(float obmat[][4], struct BoundBox *bb); void fdrawline(float x1, float y1, float x2, float y2); diff --git a/source/blender/include/transform.h b/source/blender/include/transform.h index 82adb1ac12a..7d497dc05ec 100644 --- a/source/blender/include/transform.h +++ b/source/blender/include/transform.h @@ -75,6 +75,8 @@ typedef struct TransSnap { int status; float snapPoint[3]; float snapTarget[3]; + float snapNormal[3]; + float snapTangent[3]; float dist; // Distance from snapPoint to snapTarget double last; void (*applySnap)(struct TransInfo *, float *); @@ -457,6 +459,8 @@ void applySnapping(TransInfo *t, float *vec); void resetSnapping(TransInfo *t); int handleSnapping(TransInfo *t, int event); void drawSnapping(TransInfo *t); +int usingSnappingNormal(TransInfo *t); +int validSnappingNormal(TransInfo *t); /*********************** Generics ********************************/ @@ -487,6 +491,7 @@ void calculateCenterCursor2D(TransInfo *t); void calculatePropRatio(TransInfo *t); void getViewVector(float coord[3], float vec[3]); +void getViewRay(short mval[2], float p[3], float d[3]); TransInfo * BIF_GetTransInfo(void); diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h index 79c1710a897..a717df640f1 100644 --- a/source/blender/makesdna/DNA_meshdata_types.h +++ b/source/blender/makesdna/DNA_meshdata_types.h @@ -229,14 +229,16 @@ typedef struct PartialVisibility { #define TF_SHADOW 8192 #define TF_BMFONT 16384 -/* mtface->transp */ +/* mtface->transp, values 1-4 are used as flags in the GL, WARNING, TF_SUB cant work with this */ #define TF_SOLID 0 #define TF_ADD 1 #define TF_ALPHA 2 +#define TF_CLIP 4 /* clipmap alpha/binary alpha all or nothing! */ /* sub is not available in the user interface anymore */ #define TF_SUB 3 + /* mtface->unwrap */ #define TF_DEPRECATED1 1 #define TF_DEPRECATED2 2 diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 7b1b979b777..75affbfa7f5 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -274,7 +274,7 @@ typedef struct RenderData { /* Bake Render options */ short bake_osa, bake_filter, bake_mode, bake_flag; - short bake_normal_space, bpad; + short bake_normal_space, bake_quad_split; float bake_maxdist, bake_biasdist, bake_pad; /* yafray: global panel params. TODO: move elsewhere */ @@ -543,8 +543,8 @@ typedef struct Scene { ListBase markers; ListBase transform_spaces; - short jumpframe, pad1; - short snap_flag, snap_target; + short jumpframe; + short snap_mode, snap_flag, snap_target; /* none of the dependancy graph vars is mean to be saved */ struct DagForest *theDag; @@ -707,11 +707,16 @@ typedef struct Scene { /* scene->snap_flag */ #define SCE_SNAP 1 +#define SCE_SNAP_ROTATE 2 /* scene->snap_target */ #define SCE_SNAP_TARGET_CLOSEST 0 #define SCE_SNAP_TARGET_CENTER 1 #define SCE_SNAP_TARGET_MEDIAN 2 #define SCE_SNAP_TARGET_ACTIVE 3 +/* scene->snap_mode */ +#define SCE_SNAP_MODE_VERTEX 0 +#define SCE_SNAP_MODE_EDGE 1 +#define SCE_SNAP_MODE_FACE 2 /* sce->selectmode */ #define SCE_SELECT_VERTEX 1 /* for mesh */ diff --git a/source/blender/python/BPY_interface.c b/source/blender/python/BPY_interface.c index c63fa28c46e..2f94e0eeebc 100644 --- a/source/blender/python/BPY_interface.c +++ b/source/blender/python/BPY_interface.c @@ -1154,13 +1154,17 @@ static void unlink_script( Script * script ) if( sl->spacetype == SPACE_SCRIPT ) { SpaceScript *sc = ( SpaceScript * ) sl; - if( sc->script == script ) { + if( sc->script == script ) { sc->script = NULL; - if( sc == - area->spacedata.first ) { - scrarea_queue_redraw - ( area ); + if( sc == area->spacedata.first ) { + scrarea_queue_redraw( area ); + } + + if (sc->but_refs) { + BPy_Set_DrawButtonsList(sc->but_refs); + BPy_Free_DrawButtonsList(); + sc->but_refs = NULL; } } } @@ -1222,7 +1226,7 @@ static int bpy_pydriver_create_dict(void) { PyObject *d, *mod; - if (bpy_pydriver_Dict || (G.f&G_DOSCRIPTLINKS)==0) return -1; + if (bpy_pydriver_Dict) return -1; d = PyDict_New(); if (!d) return -1; @@ -1259,15 +1263,16 @@ static int bpy_pydriver_create_dict(void) /* If there's a Blender text called pydrivers.py, import it. * Users can add their own functions to this module. */ - mod = importText("pydrivers"); /* can also use PyImport_Import() */ - if (mod) { - PyDict_SetItemString(d, "pydrivers", mod); - PyDict_SetItemString(d, "p", mod); - Py_DECREF(mod); + if (G.f&G_DOSCRIPTLINKS) { + mod = importText("pydrivers"); /* can also use PyImport_Import() */ + if (mod) { + PyDict_SetItemString(d, "pydrivers", mod); + PyDict_SetItemString(d, "p", mod); + Py_DECREF(mod); + } else { + PyErr_Clear(); + } } - else - PyErr_Clear(); - /* short aliases for some Get() functions: */ /* ob(obname) == Blender.Object.Get(obname) */ diff --git a/source/blender/python/api2_2x/Blender.c b/source/blender/python/api2_2x/Blender.c index 6fce0864189..d8385c1d660 100644 --- a/source/blender/python/api2_2x/Blender.c +++ b/source/blender/python/api2_2x/Blender.c @@ -936,6 +936,7 @@ static PyObject *Blender_GetPaths( PyObject * self, PyObject *args, PyObject *ke PyObject *list = PyList_New(0), *st; /* stupidly big string to be safe */ /* be sure there is low chance of the path being too short */ char filepath_expanded[FILE_MAXDIR*2]; + char *lib; int absolute = 0; static char *kwlist[] = {"absolute", NULL}; @@ -952,7 +953,12 @@ static PyObject *Blender_GetPaths( PyObject * self, PyObject *args, PyObject *ke if (absolute) { BLI_bpathIterator_getPathExpanded( &bpi, filepath_expanded ); } else { - BLI_bpathIterator_getPathExpanded( &bpi, filepath_expanded ); + lib = BLI_bpathIterator_getLib( &bpi ); + if ( lib && ( strcmp(lib, G.sce) ) ) { /* relative path to the library is NOT the same as our blendfile path, return an absolute path */ + BLI_bpathIterator_getPathExpanded( &bpi, filepath_expanded ); + } else { + BLI_bpathIterator_getPath( &bpi, filepath_expanded ); + } } st = PyString_FromString(filepath_expanded); diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c index 1a806932bdb..45cce46d389 100644 --- a/source/blender/python/api2_2x/Object.c +++ b/source/blender/python/api2_2x/Object.c @@ -360,6 +360,8 @@ static PyObject *Object_getMatrix( BPy_Object * self, PyObject * args ); static PyObject *Object_getParent( BPy_Object * self ); static PyObject *Object_getParentBoneName( BPy_Object * self ); static int Object_setParentBoneName( BPy_Object * self, PyObject * value ); +static PyObject *Object_getParentVertexIndex( BPy_Object * self ); +static int Object_setParentVertexIndex( BPy_Object * self, PyObject * value ); static PyObject *Object_getSize( BPy_Object * self, PyObject * args ); static PyObject *Object_getTimeOffset( BPy_Object * self ); static PyObject *Object_getTracked( BPy_Object * self ); @@ -1054,10 +1056,12 @@ PyObject *Object_getParticleSys( BPy_Object * self ){ /* fixme: for(;;) */ current = ParticleSys_CreatePyObject( blparticlesys, ob ); PyList_Append(partsyslist,current); + Py_DECREF(current); while((blparticlesys = blparticlesys->next)){ current = ParticleSys_CreatePyObject( blparticlesys, ob ); PyList_Append(partsyslist,current); + Py_DECREF(current); } return partsyslist; @@ -1491,6 +1495,92 @@ static int Object_setParentBoneName( BPy_Object * self, PyObject *value ) return 0; } +static PyObject *Object_getParentVertexIndex( BPy_Object * self ) +{ + PyObject *pyls = NULL; + + if( self->object->parent) { + if (self->object->partype==PARVERT1) { + pyls = PyList_New(1); + PyList_SET_ITEM( pyls, 0, PyInt_FromLong( self->object->par1 )); + return pyls; + } else if (self->object->partype==PARVERT3) { + pyls = PyList_New(3); + PyList_SET_ITEM( pyls, 0, PyInt_FromLong( self->object->par1 )); + PyList_SET_ITEM( pyls, 1, PyInt_FromLong( self->object->par2 )); + PyList_SET_ITEM( pyls, 2, PyInt_FromLong( self->object->par3 )); + return pyls; + } + } + return PyList_New(0); +} + +static int Object_setParentVertexIndex( BPy_Object * self, PyObject *value ) +{ + PyObject *item; + int val[3] = {0,0,0}; + if( !self->object->parent) { + return EXPP_ReturnIntError( PyExc_RuntimeError, + "This object has no vertex parent, cant set the vertex parent indicies" ); + } + if (self->object->partype==PARVERT1) { + if (PySequence_Length(value) != 1) + return EXPP_ReturnIntError( PyExc_RuntimeError, + "Vertex parented to 1 vertex, can only assign a sequence with 1 vertex parent index" ); + item = PySequence_GetItem(value, 0); + if (item) { + val[0] = PyInt_AsLong(item); + Py_DECREF(item); + } + } else if (self->object->partype==PARVERT3) { + int i; + if (PySequence_Length(value) != 3) + return EXPP_ReturnIntError( PyExc_RuntimeError, + "Vertex parented to 3 verts, can only assign a sequence with 3 verts parent index" ); + + for (i=0; i<3; i++) { + item = PySequence_GetItem(value, i); + if (item) { + val[i] = PyInt_AsLong(item); + Py_DECREF(item); + } + } + } else { + return EXPP_ReturnIntError( PyExc_RuntimeError, + "This object has no vertex parent, cant set the vertex parent indicies" ); + } + + if (PyErr_Occurred()) { + return EXPP_ReturnIntError( PyExc_RuntimeError, + "This object has no vertex parent, cant set the vertex parent indicies" ); + } else { + if (self->object->partype==PARVERT1) { + if (val[0] < 0) { + return EXPP_ReturnIntError( PyExc_RuntimeError, + "vertex index less then zero" ); + } + + self->object->par1 = val[0]; + } else if (self->object->partype==PARVERT3) { + if (val[0]==val[1] || val[0]==val[2] || val[1]==val[2]) { + return EXPP_ReturnIntError( PyExc_RuntimeError, + "duplicate indicies in vertex parent assignment" ); + } + if (val[0] < 0 || val[1] < 0 || val[2] < 0) { + return EXPP_ReturnIntError( PyExc_RuntimeError, + "vertex index less then zero" ); + } + + self->object->par1 = val[0]; + self->object->par2 = val[1]; + self->object->par3 = val[2]; + } + } + + return 0; +} + + static PyObject *Object_getSize( BPy_Object * self, PyObject * args ) { char *space = "localspace"; /* default to local */ @@ -4916,6 +5006,10 @@ static PyGetSetDef BPy_Object_getseters[] = { (getter)Object_getParentBoneName, (setter)Object_setParentBoneName, "The object's parent object's sub name", NULL}, + {"parentVertexIndex", + (getter)Object_getParentVertexIndex, (setter)Object_setParentVertexIndex, + "Indicies used for vertex parents", + NULL}, {"track", (getter)Object_getTracked, (setter)Object_setTracked, "The object's tracked object", diff --git a/source/blender/python/api2_2x/Particle.c b/source/blender/python/api2_2x/Particle.c index f0a32db0623..95de9757b87 100644 --- a/source/blender/python/api2_2x/Particle.c +++ b/source/blender/python/api2_2x/Particle.c @@ -854,7 +854,7 @@ static PyObject *Part_GetLoc( BPy_PartSys * self, PyObject * args ){ return EXPP_ReturnPyObjError( PyExc_RuntimeError, "Couldn't append item to PyList" ); } - + Py_DECREF(loc); /* PyList_Append increfs */ path++; } @@ -864,6 +864,7 @@ static PyObject *Part_GetLoc( BPy_PartSys * self, PyObject * args ){ return EXPP_ReturnPyObjError( PyExc_RuntimeError, "Couldn't append item to PyList" ); } + Py_DECREF(seglist); /* PyList_Append increfs */ } cache=psys->childcache; @@ -885,7 +886,7 @@ static PyObject *Part_GetLoc( BPy_PartSys * self, PyObject * args ){ return EXPP_ReturnPyObjError( PyExc_RuntimeError, "Couldn't append item to PyList" ); } - + Py_DECREF(loc);/* PyList_Append increfs */ path++; } @@ -895,6 +896,7 @@ static PyObject *Part_GetLoc( BPy_PartSys * self, PyObject * args ){ return EXPP_ReturnPyObjError( PyExc_RuntimeError, "Couldn't append item to PyList" ); } + Py_DECREF(seglist); /* PyList_Append increfs */ } } else { @@ -933,6 +935,7 @@ static PyObject *Part_GetLoc( BPy_PartSys * self, PyObject * args ){ return EXPP_ReturnPyObjError( PyExc_RuntimeError, "Couldn't append item to PyList" ); } + Py_DECREF(loc);/* PyList_Append increfs */ } else { if ( all ){ @@ -941,6 +944,7 @@ static PyObject *Part_GetLoc( BPy_PartSys * self, PyObject * args ){ return EXPP_ReturnPyObjError( PyExc_RuntimeError, "Couldn't append item to PyList" ); } + Py_DECREF(Py_None); /* PyList_Append increfs */ } } } @@ -985,6 +989,7 @@ static PyObject *Part_GetRot( BPy_PartSys * self, PyObject * args ){ if(psys_get_particle_state(ob,psys,i,&state,0)==0){ if ( all ){ PyList_Append(partlist,Py_None); + Py_DECREF(Py_None); /* PyList_Append increfs */ continue; } else { continue; @@ -1001,6 +1006,7 @@ static PyObject *Part_GetRot( BPy_PartSys * self, PyObject * args ){ if (id) PyTuple_SetItem(loc,4,PyInt_FromLong(i)); PyList_Append(partlist,loc); + Py_DECREF(loc); /* PyList_Append increfs */ } } return partlist; @@ -1060,9 +1066,11 @@ static PyObject *Part_GetSize( BPy_PartSys * self, PyObject * args ){ PyTuple_SetItem(tuple,0,PyFloat_FromDouble((double)size)); PyTuple_SetItem(tuple,1,PyInt_FromLong(i)); PyList_Append(partlist,tuple); + Py_DECREF(tuple); } else { siz = PyFloat_FromDouble((double)size); PyList_Append(partlist,siz); + Py_DECREF(siz); } } } @@ -1125,9 +1133,11 @@ static PyObject *Part_GetAge( BPy_PartSys * self, PyObject * args ){ PyTuple_SetItem(tuple,0,PyFloat_FromDouble((double)life)); PyTuple_SetItem(tuple,1,PyInt_FromLong(i)); PyList_Append(partlist,tuple); + Py_DECREF(tuple); } else { lif = PyFloat_FromDouble((double)life); PyList_Append(partlist,lif); + Py_DECREF(lif); } } } diff --git a/source/blender/python/api2_2x/Sys.c b/source/blender/python/api2_2x/Sys.c index 3863cc12227..baae2220143 100644 --- a/source/blender/python/api2_2x/Sys.c +++ b/source/blender/python/api2_2x/Sys.c @@ -406,11 +406,12 @@ static PyObject *M_sys_cleanpath( PyObject * self, PyObject * value ) { char *path = PyString_AsString(value); char cleaned[FILE_MAXDIR + FILE_MAXFILE]; - int trailing_slash = 0; + int trailing_slash = 0, last; if (!path) return EXPP_ReturnPyObjError( PyExc_TypeError, "expected string argument" ); - if (strstr(path, "/") || strstr(path, "\\")) { + last = strlen(path)-1; + if ((last >= 0) && ((path[last]=='/') || (path[last]=='\\'))) { trailing_slash = 1; } BLI_strncpy(cleaned, path, FILE_MAXDIR + FILE_MAXFILE); diff --git a/source/blender/python/api2_2x/doc/Object.py b/source/blender/python/api2_2x/doc/Object.py index 09167c0e117..2e4850aeb14 100644 --- a/source/blender/python/api2_2x/doc/Object.py +++ b/source/blender/python/api2_2x/doc/Object.py @@ -389,6 +389,8 @@ class Object: @ivar parentbonename: The string name of the parent bone (if defined). This can be set to another bone in the armature if the object already has a bone parent. @type parentbonename: string or None + @ivar parentVertexIndex: A list of vertex parent indicies, with a length of 0, 1 or 3. When there are 1 or 3 vertex parents, the indicies can be assigned to a sequence of the same length. + @type parentVertexIndex: list @ivar protectFlags: The "transform locking" bitfield flags for the object. See L{ProtectFlags} const dict for values. @type protectFlags: int diff --git a/source/blender/python/api2_2x/sceneRender.c b/source/blender/python/api2_2x/sceneRender.c index bfad069f943..b446af7efd4 100644 --- a/source/blender/python/api2_2x/sceneRender.c +++ b/source/blender/python/api2_2x/sceneRender.c @@ -2048,7 +2048,7 @@ static int RenderData_setIValueAttrClamp( BPy_RenderData *self, PyObject *value, break; case EXPP_RENDER_ATTR_BAKEMODE: min = RE_BAKE_LIGHT; - max = RE_BAKE_DISPLACEMENT; + max = RE_BAKE_SHADOW; size = 'h'; param = &self->renderContext->bake_mode; break; @@ -3781,6 +3781,7 @@ static PyObject *M_Render_BakeModesDict( void ) PyConstant_Insert( d, "NORMALS", PyInt_FromLong( RE_BAKE_NORMALS ) ); PyConstant_Insert( d, "TEXTURE", PyInt_FromLong( RE_BAKE_TEXTURE ) ); PyConstant_Insert( d, "DISPLACEMENT", PyInt_FromLong( RE_BAKE_DISPLACEMENT ) ); + PyConstant_Insert( d, "SHADOW", PyInt_FromLong( RE_BAKE_SHADOW ) ); } return M; } diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h index 66dc1dd5fef..64cf7fcb37b 100644 --- a/source/blender/render/extern/include/RE_pipeline.h +++ b/source/blender/render/extern/include/RE_pipeline.h @@ -220,6 +220,8 @@ void RE_zbuf_accumulate_vecblur(struct NodeBlurData *nbd, int xsize, int ysize, #define RE_BAKE_NORMALS 3 #define RE_BAKE_TEXTURE 4 #define RE_BAKE_DISPLACEMENT 5 +#define RE_BAKE_SHADOW 6 + void RE_Database_Baking(struct Render *re, struct Scene *scene, int type, struct Object *actob); void RE_DataBase_GetView(struct Render *re, float mat[][4]); diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index d7e71b3e531..8414b6aefe3 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -499,6 +499,7 @@ typedef struct LampRen { #define R_NEED_TANGENT 32 #define R_SKIP_MULTIRES 64 #define R_BAKE_TRACE 128 +#define R_BAKING 256 /* vlakren->flag (vlak = face in dutch) char!!! */ #define R_SMOOTH 1 diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index dbade68ba1d..89a0a5ba7cb 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -3935,6 +3935,57 @@ static void set_fullsample_flag(Render *re, ObjectRen *obr) } } +/* split quads for pradictable baking + * dir 1 == (0,1,2) (0,2,3), 2 == (1,3,0) (1,2,3) + */ +static void split_quads(ObjectRen *obr, int dir) +{ + VlakRen *vlr, *vlr1; + int a; + + for(a=obr->totvlak-1; a>=0; a--) { + vlr= RE_findOrAddVlak(obr, a); + + /* test if rendering as a quad or triangle, skip wire */ + if(vlr->v4 && (vlr->flag & R_STRAND)==0 && (vlr->mat->mode & MA_WIRE)==0) { + + if(vlr->v4) { + + vlr1= RE_vlakren_copy(obr, vlr); + vlr1->flag |= R_FACE_SPLIT; + + if( dir==2 ) vlr->flag |= R_DIVIDE_24; + else vlr->flag &= ~R_DIVIDE_24; + + /* new vertex pointers */ + if (vlr->flag & R_DIVIDE_24) { + vlr1->v1= vlr->v2; + vlr1->v2= vlr->v3; + vlr1->v3= vlr->v4; + + vlr->v3 = vlr->v4; + + vlr1->flag |= R_DIVIDE_24; + } + else { + vlr1->v1= vlr->v1; + vlr1->v2= vlr->v3; + vlr1->v3= vlr->v4; + + vlr1->flag &= ~R_DIVIDE_24; + } + vlr->v4 = vlr1->v4 = NULL; + + /* new normals */ + CalcNormFloat(vlr->v3->co, vlr->v2->co, vlr->v1->co, vlr->n); + CalcNormFloat(vlr1->v3->co, vlr1->v2->co, vlr1->v1->co, vlr1->n); + } + /* clear the flag when not divided */ + else vlr->flag &= ~R_DIVIDE_24; + } + } +} + static void check_non_flat_quads(ObjectRen *obr) { VlakRen *vlr, *vlr1; @@ -3997,6 +4048,7 @@ static void check_non_flat_quads(ObjectRen *obr) xn= nor[0]*vlr->n[0] + nor[1]*vlr->n[1] + nor[2]*vlr->n[2]; if(ABS(xn) < 0.999995 ) { // checked on noisy fractal grid + float d1, d2; vlr1= RE_vlakren_copy(obr, vlr); @@ -4008,10 +4060,10 @@ static void check_non_flat_quads(ObjectRen *obr) CalcNormFloat(vlr->v2->co, vlr->v3->co, vlr->v4->co, nor); d2= nor[0]*vlr->v2->n[0] + nor[1]*vlr->v2->n[1] + nor[2]*vlr->v2->n[2]; - + if( fabs(d1) < fabs(d2) ) vlr->flag |= R_DIVIDE_24; else vlr->flag &= ~R_DIVIDE_24; - + /* new vertex pointers */ if (vlr->flag & R_DIVIDE_24) { vlr1->v1= vlr->v2; @@ -4064,8 +4116,14 @@ static void finalize_render_object(Render *re, ObjectRen *obr, int timeoffset) ob->smoothresh= 0.0; if((re->r.mode & R_RAYTRACE) && (re->r.mode & R_SHADOW)) set_phong_threshold(obr); - - check_non_flat_quads(obr); + + if (re->flag & R_BAKING && re->r.bake_quad_split != 0) { + /* Baking lets us define a quad split order */ + split_quads(obr, re->r.bake_quad_split); + } else { + check_non_flat_quads(obr); + } + set_fullsample_flag(re, obr); /* compute bounding boxes for clipping */ @@ -5406,6 +5464,7 @@ void RE_Database_FromScene_Vectors(Render *re, Scene *sce) RE_BAKE_AO: for baking, no lamps, but all objects RE_BAKE_TEXTURE:for baking, no lamps, only selected objects RE_BAKE_DISPLACEMENT:for baking, no lamps, only selected objects + RE_BAKE_SHADOW: for baking, only shadows, but all objects */ void RE_Database_Baking(Render *re, Scene *scene, int type, Object *actob) { @@ -5421,6 +5480,7 @@ void RE_Database_Baking(Render *re, Scene *scene, int type, Object *actob) RE_init_threadcount(re); re->flag |= R_GLOB_NOPUNOFLIP; + re->flag |= R_BAKING; re->excludeob= actob; if(type == RE_BAKE_LIGHT) re->flag |= R_SKIP_MULTIRES; @@ -5435,6 +5495,10 @@ void RE_Database_Baking(Render *re, Scene *scene, int type, Object *actob) re->r.mode &= ~R_RAYTRACE; } + if(!actob && (type==RE_BAKE_SHADOW)) { + re->r.mode |= R_SHADOW; + } + /* setup render stuff */ re->memArena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE); @@ -5472,7 +5536,7 @@ void RE_Database_Baking(Render *re, Scene *scene, int type, Object *actob) set_node_shader_lamp_loop(shade_material_loop); /* MAKE RENDER DATA */ - nolamps= !ELEM(type, RE_BAKE_LIGHT, RE_BAKE_ALL); + nolamps= !ELEM3(type, RE_BAKE_LIGHT, RE_BAKE_ALL, RE_BAKE_SHADOW); onlyselected= ELEM3(type, RE_BAKE_NORMALS, RE_BAKE_TEXTURE, RE_BAKE_DISPLACEMENT); database_init_objects(re, lay, nolamps, onlyselected, actob, 0); diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index ff31ba8a6ee..dae7b0dcd88 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -2017,9 +2017,12 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int quad, int ambient_occlusion_to_diffuse(shi, shr.combined); } else { + if (bs->type==RE_BAKE_SHADOW) /* Why do shadows set the color anyhow?, ignore material color for baking */ + shi->r = shi->g = shi->b = 1.0f; + shade_input_set_shade_texco(shi); - if(!ELEM(bs->type, RE_BAKE_NORMALS, RE_BAKE_TEXTURE)) + if(!ELEM3(bs->type, RE_BAKE_NORMALS, RE_BAKE_TEXTURE, RE_BAKE_SHADOW)) shade_samples_do_AO(ssamp); if(shi->mat->nodetree && shi->mat->use_nodes) { @@ -2070,6 +2073,10 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int quad, int shr.combined[2]= shi->b; shr.alpha = shi->alpha; } + else if(bs->type==RE_BAKE_SHADOW) { + VECCOPY(shr.combined, shr.shad); + shr.alpha = shi->alpha; + } } if(bs->rect_float) { @@ -2505,7 +2512,12 @@ int RE_bake_shade_all_selected(Render *re, int type, Object *actob) memset(&handles[a], 0, sizeof(BakeShade)); handles[a].ssamp.shi[0].lay= re->scene->lay; - handles[a].ssamp.shi[0].passflag= SCE_PASS_COMBINED; + + if (type==RE_BAKE_SHADOW) { + handles[a].ssamp.shi[0].passflag= SCE_PASS_SHADOW; + } else { + handles[a].ssamp.shi[0].passflag= SCE_PASS_COMBINED; + } handles[a].ssamp.shi[0].combinedflag= ~(SCE_PASS_SPEC); handles[a].ssamp.shi[0].thread= a; handles[a].ssamp.tot= 1; diff --git a/source/blender/src/blenderbuttons.c b/source/blender/src/blenderbuttons.c index 6c6afdef68c..e15ef3fd898 100644 --- a/source/blender/src/blenderbuttons.c +++ b/source/blender/src/blenderbuttons.c @@ -1,2165 +1,2181 @@ /* DataToC output of file */ -int datatoc_blenderbuttons_size= 69070; +int datatoc_blenderbuttons_size= 69599; char datatoc_blenderbuttons[]= { -137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, - 68, 82, 0, 0, 2, 0, 0, 0, 1, 0, 8, 6, 0, 0, 0,197,144,206,103, 0, 0, 0, 6, 98, 75, 71, 68, 0,255, 0,255, 0, -255,160,189,167,147, 0, 0, 0, 9,112, 72, 89,115, 0, 0, 11, 19, 0, 0, 11, 19, 1, 0,154,156, 24, 0, 0, 0, 7,116, 73, - 77, 69, 7,216, 3, 21, 16, 3, 34,240,181, 88,200, 0, 0, 32, 0, 73, 68, 65, 84,120,218,236,125,121, 92, 84, 85,255,255,251, -220,217,217,119, 84, 92, 64,197,125,197, 61,212,160, 7, 45,253,154,166, 2,102,182, 61,245,196,100,218,106,105, 86,207, 83,254, -242,145,220, 90, 53, 29,159, 74,179,212, 18,212,180, 92, 18,116, 80, 67,114, 87, 44, 23, 20, 69, 4, 65,182, 97,102,152,253,206, - 61,191, 63,102,134,134, 17,152, 5, 52,173,121,191,152, 23,115,239,220,249,204,185,247,156,243,121,127,150,179,144, 1, 3, 6, - 80,120,225,133, 23, 94,120,225,133, 23,127, 43, 48,222, 71,224,133, 23, 94,120,225,133, 23,127, 31,156, 60,149, 13, 0, 32,222, - 8,128, 23, 94,120,225,133, 23, 94,120, 35, 0, 94,120,225,133, 23, 94,120,225,133,215, 0,240,194, 11, 47,188,240,194, 11, 47, -188, 6,128, 23, 94,120,225,133, 23, 94,120,241,151, 0,223,254, 96,230,204,153,196, 83, 65,171, 86,173,186,101, 44,129, 87,158, - 87, 94, 51,160,171, 86,173,250,211,202,151,147,147, 67, 19, 18, 18,136,183, 62,238, 93,121,167, 79,159,246,184,241, 13, 24, 48, - 0,222,250,240,202,251, 43,203,115,219, 0,248, 59, 67, 42,149, 54,120,128, 50,153,140,220,205,229, 92,189,122, 53, 8, 33,196, - 91,115,158,213,241,244,233,211,145,153,153, 89,127,156,156,156,252,151,120,150,187,118,159,108, 86, 17,140, 31, 23,247,151,110, - 51,146,224,109, 16,235,187, 34, 6, 70,212, 97, 55, 10,116,239,220,181,109,241,110,213, 49, 94,252, 77, 35, 0,119,162,177,238, -218,181, 43, 97,251,246,237,114,219,241,164, 73,147, 18,199,143, 31,159,115, 55, 60, 12, 74, 45,186,243,110,229, 85,169, 84, 74, -139,138,138, 0, 0,209,209,209, 0,112, 79, 40, 17, 71,227,202,106, 96, 53,233,153,187, 42,119,211,166, 77, 46, 27,106, 82,169, -148,110,222,188,185,254,120,219,182,109, 24, 51,102, 76,253,113,102,102, 38,253,179,140,128, 65,131, 6, 81, 0, 56,113,226, 4, -105,141,235,182,255, 32,107,198, 0,144,181,184,254,162, 98, 58, 0, 0,110,234,245, 96,117, 6,203,201, 90, 21, 0, 32, 37, 37, - 5, 73, 73, 73, 77,150,111, 77,210, 26, 26, 91, 22,235,214,239, 39,254,158,232, 66,189, 72, 16,252,194, 89,232,183,111,131, 66, - 49, 25, 10, 0,113,146,165,120, 71,114, 2, 29,196, 64,165,190, 16,239,232, 82,221,250,221,236,236,236,132,140,140, 12,185,253, -185,148,148,148,196,164,164,164,156,187,169,111,181,150, 14,184, 23,238,247,118,224,189,183, 94, 34,126,130, 64, 98, 16, 11,169, -161, 86,199,212,233, 84,220,135,159,174,248, 91,204,142,115,106, 0,236,218,181, 43,193,246,191,165, 68,109, 83, 36, 11, 54, 47, -132, 95,135, 64,212, 93, 87,226,221,212,119,228,219,183,111,135,215, 26,118, 14,153, 76, 70,162,163,163,105, 81, 81, 17,138,138, -138,176,103,207,158,187,214,147,176,213,181, 76, 38, 35, 50,153, 76, 32,149, 74, 77, 75,150, 44, 57, 6, 0,115,231,206, 29,210, -220,119, 39, 79,158, 92,255,158,101,205, 48,154, 12, 48, 26,140, 48, 26, 45, 47,150,101, 49,119,238, 92,183,202, 98, 79,254,141, - 97,204,152, 49,127,170, 17,224,138,241, 51,104,208, 32,167, 50,198,143,139, 35,158,144,188,203, 8, 10, 64,254,149,239, 32, 65, -123,152,145,139,138, 47, 78,226, 76, 97, 53,166,124,176,214,165,175,199,150,197,186, 72,232, 22,200,123,203,157, 42, 98,201,248, -119, 16, 50,233, 89,148,190, 18, 7,232, 20,245,231, 79,234,222,192, 73, 0,208, 1,163, 37, 41,216, 23,124, 2, 65, 0, 6, 41, - 6,185,220,126, 29,145,145,145, 33,207,200,200,184, 43,244,149,173,140,173,161, 3,238,133,251,109,109,172, 95,185,138, 60, 30, - 21,195,127, 41,249, 73, 94, 68,207, 40,134, 79, 34,136, 86,169,228,196,136, 52, 51,237,218,155,245, 55,174,154, 93,124,118, 55, -220,208,225,237, 92,144, 55,199, 13,121,203,111,171, 1,176,125,251,118,249,230,127,191,133,212,247, 23,201,199,143, 31, 79, 90, -210,192,108,196, 15, 0, 85,218,106, 32, 20,152,191,239, 61,168,174, 40, 32,125,238,238, 34,178,166, 58,196,159, 93, 70,123, 35, -224,161,135, 30, 66, 81, 81, 17,162,163,163,239,186,103, 39,151, 91, 28,137,196,196, 68, 42,147,201, 24,153, 76, 22, 37,149, 74, - 75,151, 44, 89,114,194, 85, 57, 44,203,194,104, 52,213, 19,191, 61,249, 31, 63,126, 28,131, 7, 15,118,171, 92,169,169,127,120, -128,211,167, 79, 71, 86, 86, 86, 3, 3,160, 53,218,138, 39,245,112,226,196, 9,146,147,147, 67,199,142, 29,123,203,103,123,247, -238,197,166, 77,155,234,143,155, 27,183,112,139,241,222,138,233,128,168,152, 14, 40, 85, 40,177,245,249,169, 8, 37,241, 40,252, -223,235,232, 60,185, 51,178,220, 32,127, 27,210,210,210, 40, 0,172, 89,179,166,197,109, 54,106,115, 46,180,215,234, 80, 42,141, -105,246,186,179,226,108, 44,232,123, 19,233,103,223,110, 81,125,182, 6,233,182,166,140,214,136, 4,220,238,251,109, 45,228,230, -230,250, 0,184, 15,128,159,221,233, 90, 0,249,241,241,241, 53,174,202,209,113, 58,198, 88,101, 16,140,155, 56, 89,172,128, 73, - 44, 16,240,249, 42,189,152, 17, 10,117, 28, 47,192,151, 53, 74, 76, 38,126,249, 13,131,152, 39,210,235,205, 6,179, 84, 42, 37, -141,141, 25,177, 71,109,109,237,127,109,239, 11, 10, 10,170,124,125,125, 25,141, 70,195,217, 95, 51,116,232,208,143, 92, 45, 35, -165,212, 41,177, 19, 66,230,180,244,153,242,157,121,255,221,186,117, 67,172, 95, 0, 90, 18, 5,176, 39,255, 42,109, 53,210,255, -241, 94,253,103,255,220,254, 2, 16, 1, 76, 94,146,234, 86, 35,107,138,160, 91,139,164,175, 95,191, 14, 0,232,208,161, 67,131, -247,182,223,117,214, 32,110,103,136,207,222, 8, 48,153, 88,172, 94,189,250,182,121, 1,238,202,116, 32,127,251,239,223,144,201, -100,193, 82,169, 84,225, 50,249,155, 76, 48, 26, 13, 48, 24,141, 48, 57,144, 63,229,220,139,208,165,166,166,226,248,241,227,245, -199,203,151, 47, 71,114,114,114,253,113,102,102,102,139,141, 29, 59,131,167,197,237,207,158,248,167, 79,159,142,129, 3, 7,122, - 36,167,181,210, 1, 37, 87,138,161,217,246, 31,248, 61,243, 9,162, 98, 58, 32, 50, 84,130, 43,219,174, 88,200, 63, 40,192,146, - 2, 16,240, 92,146,213, 26,196, 15, 0,221,206, 93,198,245,119, 23, 66,151,177,174,249, 8,129, 68, 2,189, 94,143,194,194, 66, - 84,232, 47,162, 27,162,154,188, 54, 59, 59, 59,161,185,182, 47,147,201,136,173,159,100,103,103, 39,184, 19, 30,183,143,138,217, -250,171,253, 57,119, 29,129,166,136,219, 29, 93,208,216,253,102,101,101, 81, 66, 8,146,146,146, 72, 75,238,215,134,103,159,125, -150,126,249,229,151, 45,170,243,220,220,220, 64, 0,147,247,237,219,247, 31,142,227, 12,118, 36,200,231,241,120,190, 0,254, 21, - 31, 31,191,203,153,156,130, 43, 5,124,137, 80, 44, 22, 8, 68,190, 12,159, 4, 80,158,200,135,227,241,248, 28, 97,192, 17,190, -153,242,120, 6, 30, 71,244, 26,158, 89,235, 43, 20, 16, 94,151, 14,122,241,196, 8, 14,197,206,203,168, 80, 40, 84, 90,173,150, - 5, 0,141, 70,195,189,245,214, 91,245,132,191,104,209,162, 87, 91,218,222,199,140, 25,243,188,237,125, 86, 86,214,234,214,232, - 67,140, 51,239,127,225,180,100,232, 43, 43,241,122,239, 30,176,207,221,187,236,133, 88, 83, 8,246,228, 63,105,210,164, 68,153, - 76, 70, 38, 77,154,148,184,118,210,231,150,200, 98,247,176, 6,215,187,130,185, 43, 11, 48,119,101, 1,102, 45, 59,143,167,222, -255, 13, 83,230,159,110,241, 3, 41, 41, 41,113,201, 48,184, 83,228, 95, 84, 84,212, 36, 49, 71, 71, 71,195,100, 52, 98,216,208, -161, 45,254, 29, 91,152,124,243,230,205,144,203,229,245,175,230, 12,173,166,200, 48, 49, 49,209,145,252,235, 13,101, 87, 20, 19, -203,154, 45,158,191,193, 18,250,119, 36,127,179,217, 12,141, 78,227,214, 61,218, 34, 6,142, 81,131,204,204, 76,100,102,102, 54, - 48, 6,220,186,223,156,134,250, 80,158,147,227,214, 51,107,142,252,167, 79,159,142, 37, 75,150,212,147,191,128, 47,112, 75,206, -248,113,113,196,154,130,105,244,229,142, 44, 29,138, 81, 55,121, 24,104,198,235, 40,185, 82, 12, 58,185,231, 31,222, 74,198,235, -224,183, 13, 7,130,130,238,168, 71,168,169, 42,132, 46, 99, 29, 40,165, 56,123,246, 44, 70,143, 30, 13,137, 68,210,128,248,131, -131,131,161,211,233,160,211,233, 80, 90, 90,138,199,116, 47,225,139,224, 87,154,148,105,203,129, 55,247,124,108,159, 57,230,203, - 93, 37,238,214,114, 86,108,223,117, 36,127,103, 14, 82,115,247,155,149,149, 69, 51, 51, 51,145,145,145,129,236,236,108,218,210, -251,125,246,217,103, 41,159,207,199,179,207, 62,235,113,159,200,205,205, 21, 3,120, 46, 59, 59,251,173,247,223,127,255, 8, 33, - 36,218,246, 2,208, 62, 52, 52,212,103,255,254,253,171,114,115,115, 71, 55, 39,199, 76, 57, 30,143, 8, 68, 70,150, 6, 24, 12, -166, 8, 51,199,181, 55,115, 92,140,153,144,142,224,241, 66, 9, 33, 65, 32,188, 0,142, 34,132, 26,185, 32,149,206,228, 27, 17, -192,242,152,161,106,151,234, 72,171,213,178,142, 94,255,221, 14,198, 21,239, 95, 91, 94,134,113, 3,227,220, 38,104,155, 17,177, - 96,243, 66, 0,168, 39,127, 91, 20, 97,252,248,241, 57, 54, 35,160, 68,117, 3,113,115,135,187,101,100,104,116,102,104,116,102, -148, 85, 27, 80, 90,169,199,245,155,122,143,136,207,214, 89,156,145,255,159,133,166,140, 0, 0,208, 27, 13,208,235,245, 30,203, -182,145,182, 45, 71, 30, 30, 30,110,239,205,194, 85,101,226,232, 9, 55, 21, 74,116, 69,233, 25, 77, 6,139,231,111, 48,194,104, -106, 72,254, 38,147, 9, 26,141, 6,106,149,250, 79,173, 19,139,193,148, 97, 31,144,179,253, 97,243,230, 12,143,141, 0,123,242, -183, 17, 63,195, 48, 16,139,197,240,245,243,105, 81,153,119,237, 62, 73,155,122, 57,251,238,158,249,239, 33, 20,241, 96,147, 94, - 4, 0,248,229, 93,198,153,194,106,139,193,150,244, 34, 76,103, 23, 0, 85,213,110,149, 39, 45, 45,141,218,210, 1,158,192, 23, - 85, 0,128,117,235,214, 97,251,246,237, 88,186,116, 41,142, 30, 61, 10,131,193,128,138,138, 10,155, 87, 86,127,125, 84, 84, 20, -116, 0,120,184,250,167,180,151,166,218,189,163, 55,239,169, 65,209, 88, 90,192, 93,121,246,145,176,140,140,140, 22,221,179,141, -252, 1,192, 83, 35, 32, 55, 55,183,141,149,252,211,190,254,250,235,115,239,188,243,206, 35, 27, 55,110, 68,183,110,221, 0, 0, -157, 58,117,130, 82,169, 20, 45, 88,176,224,196,254,253,251,191,205,205,205,141,110, 84, 16, 1,192, 81, 2,142, 21,155,205,108, -136,153, 53,183, 55,153, 77, 93,121, 12,105, 39,228, 51, 2,177,128,167,227,251, 8,107,125,253,121, 42,158,152,178, 98, 30,207, -151,207, 26, 3,174,158, 60, 37,122, 34,252, 99,167,229, 46, 40, 40,168,210,104, 52, 92, 99, 97,254,254,253,251, 95, 52, 26,141, -173,214,150,250,247,239,223,106,178,248,205, 17,247,255,210,158,253,131,108, 75,174,227,245,222, 61,176,108,251,118,183,199, 2, -216,188,127, 27,233, 55,240, 82,198,143,207,217,190,125, 59, 0, 32,180,111, 27,183, 10, 95,167, 51, 67,173,101,161,210,176, 80, -214,177,168, 85,179,110, 63,128,198, 70,254,219,123,249,246,239,175, 92,185,130,218,218,218, 59,166, 52, 86,175, 94,141,232,232, -104,216, 6,253,217,231,250,165, 82, 41, 93,189,122, 53,244, 58,157,199, 6,128, 84, 42,165,107,215,174, 69, 73,105, 41, 4, 60, - 30, 34,219,180,105, 64,254,255,248,199, 63,144,154,154,234,146,114,146,201,100, 36, 49, 49,177,129, 17,224, 24,201,112,117,172, -130,209, 96,132,209, 96,128,201,100, 4,203,154,235,201,223, 96, 48, 64,171,213,162,174,174, 14,106,181,251, 6,128,125, 10,192, - 6, 79, 61,255,205, 25,155, 1, 10, 84, 89,137,134, 90, 26, 17, 8,165, 22, 35, 32, 35, 3,169, 41, 41,110,167, 3, 28,201, 95, - 32, 16, 64, 36, 18, 65, 44, 22, 67, 44, 22,123,116,223, 13,250,117, 19, 41, 1,103, 41,173, 41,171,183,128, 78,140,193,205, 17, -113, 8, 69, 60, 36, 83, 63, 3, 91, 86, 9, 4, 5,128, 95,189, 9, 63,125,124, 2,224,241,220, 42, 75, 75, 83, 1, 26,158, 69, -167,164,167,167,163,178,178, 18,171, 86,173, 66,255,254,253,241,254,251,239, 35, 46, 46, 14, 58,157,206,209, 67,179,153,212,119, -148,248, 93, 37,104, 79,211, 1, 77, 25, 18,158,200, 73, 73, 73,169, 39,126, 79,250, 70, 99,228, 95, 79, 54,124, 62, 88,150,117, - 55, 29,224,159,159,159,255,233,204,153, 51, 15,246,237,219, 55, 0, 0,222,123,239, 61, 20, 20, 20, 0, 0,134, 15, 31,142,173, - 91,183, 98,228,200,145,190,143, 61,246, 88, 97, 78, 78, 78, 54,143,199,123,236, 86, 69, 15,132,132,134,112, 87,174, 20,178, 57, -242,125,187,187,118,141,205,137,233, 20,125,142,231, 47,169,224, 17,161,134, 17, 9,180,140,216, 71,109,228,243,140,160, 38, 30, - 39, 54,249,171, 75,171,253,142,238, 63, 61, 52, 44, 56,114,171, 83, 99,212, 46,231,191,109,219,182,167, 38, 79,158,252,181, 45, -236,175, 82,169, 24,161, 80,216,226,182,212, 90, 97,127,167, 17, 0,155,151, 63,184, 75, 44,244,149,149,208,148, 88, 72,112,180, -213, 59,116, 55, 10,112,229,183,203,183,200,110,236,184,250,108,185, 91,133,111, 41,249,219, 19, 63,165, 20, 29, 58,116,104,240, -153,201,100,170,127,213,214,214, 66,163,209,160,166,166,230,142, 41, 15,219, 60,255, 61,123,246, 52,136, 4,216,200,191, 95,191, -126,208,235,117,245,138,142,218,172, 25, 23, 21,211,202,207, 87,194,100, 50,161,125, 84, 20, 76,102,115,163,228,239,142, 34,177, - 26, 1,183,120, 37,182,169,139,205, 69, 50,110, 49, 0,140,166,122,242, 63,118,244, 24,180, 58, 29,212,106, 53,148, 74, 37,106, -107,107, 27,120,118,238,194,150, 6,240, 52,239, 15, 0,213, 85,213,168,174,174, 66, 85,117, 13,170,170,171, 81, 93, 93,141,234, - 42,139, 71,218,163,103, 79,212, 88,223,187,235,253, 3,192,192,129, 3,255,240,250,125,125,225,231,231, 15,127, 63,127,168,213, -234,196,150,180,167,230, 82, 2,206,190, 91,184, 52, 13,130,169,159, 33, 20,241,224,231,125, 6,211,150, 23,129,160, 0,236,120, - 33, 25,215,118, 92,197,195, 75,214, 3,252, 59,188,172,136,254, 26, 36, 81, 18,104, 52, 26,232,245,122,104,181, 90,228,229,229, -225,131, 15, 62,104,244,114, 31, 31, 91, 4,229,178,219,228,237,169, 87,109,255,124, 29,159,119, 83,199, 45, 49, 50, 26, 75, 11, -184, 35, 39, 41, 41,137,164,164,164, 32, 57, 57, 25, 99,198,140,241, 56, 50,241,229,151, 95, 18,150,109,168,147, 89,150,133,187, - 99, 1,226,227,227, 47,165,164,164,244,223,184,113,227,232, 67,135, 14,249, 39, 37, 37, 29,181,145,191,213, 81,133, 72, 36,162, -215,174, 93, 19,236,222,189,187,123,112,112,240,177,248,248,248,194,198,100, 41,107,149, 92,108, 76, 55,245,240,225,195,147,207, -157,251,253, 1,149, 70,221,134,178, 38, 22, 12, 76,172,129, 49, 24, 12, 6,157, 10,229, 42,206,160, 87,151, 22,151,179, 63,237, -220,181, 56, 44, 52,188,194,104,212, 58,117,223, 27,243,254, 21, 10, 5, 31, 0, 2, 2, 2,238,218,180, 0,211,148,247,191,249, -223,111, 89,172,230,242,178, 6,159,185, 59, 22, 96,210,164, 73,137, 43,159,251, 4,128,101,192,223,246,237,219,229,246, 83, 11, -183,111,223, 46, 31,243,205, 35, 0,128,147, 75,126,197,164, 73,147, 18,239,212,205,219,119,146,146,146,146,122,111,223, 70,250, -118,149, 11,181, 90, 13,189, 94,111,167, 68,238, 92, 25,159,127,222, 50,246,195,196,178, 56,119,238, 28, 78,157, 60,137,254,253, -250, 67,175,215, 67,167,211, 67,175,211,225,219,111,190,129,237, 58, 87, 58,250,242,229,203,209,171,103, 47,152, 76, 38, 92,186, -116, 9,172,201,136,210,146,210, 86,125,166,182, 99,235,154, 5,136,142,142,118, 73, 49, 25, 77, 6,176,102, 75,216,255,200,145, - 95,161,209,105, 80,167, 86, 65,169, 84, 66, 81, 91, 11,133,162,166, 69,134,152, 45, 18,208, 18, 15,231,224,193,131, 80,171,213, - 80,171, 85,214,255,106,132,133,134,162, 71,207,158,184,112,254, 60, 14, 28, 60,232,182, 76,155,247,207,231, 11,224,227,227, 3, - 63, 63, 63,248,251,249,193,207,207, 7, 53,138,154, 68, 0, 57,183, 59,212,223, 20,206, 20, 86,195,116,118, 1,170,145, 11, 50, -126, 25, 72,252,127, 80,184, 52, 13, 19,151,124, 13,177,128, 1, 4,124,203,203, 3,120,154, 10, 40,157,240, 57, 66, 54, 77,128, - 86,171, 69, 72, 72, 8, 20, 10, 5, 20, 10, 5, 14, 31, 62,140,178,178,178,250, 48,113,253,245,165,165,120, 33, 88,130, 48,159, -202,230, 60,224, 68,123, 82,181, 31, 36,103,123,111,251,204,118,173, 39,222,185,171,233, 1, 87,201,223, 83,207,191,177,251, 77, - 74, 74, 34, 99,198,140, 33, 45,185, 95, 71, 35,192, 19,242,183, 33, 44, 44, 44,255,145, 71, 30,121, 44, 61, 61,189,251,153, 51, -103,226, 37, 18, 9,111,226,196,137, 68, 36, 18,129,227, 56, 50,126,252,248,252,151, 95,126,185, 95,159, 62,125,118,252,235, 95, -255,122,202,108, 54, 87, 55, 19,243,230,126, 63,127,233, 88,159,190,253, 30, 63,118,244,232,148, 29, 59,127, 92,116,252,232,209, - 54,231, 10, 46,136, 47,149, 22,210,111, 63,249, 94,146,190,124,105,175,236,157, 59,151,119,237,210,245, 39,191, 72,223,131,241, -241,241,102,184, 88,242,164,164, 36, 28, 59,118,108,192,234,213,171, 23,232,245,122,193,251,239,191,255,225,142, 29, 59,166,151, -150,150,222, 89,226,104,105, 10, 32,244,106, 17,106,172,161,127,123,140, 14, 15,199, 50, 92,112,221,235,176,134,248, 47,156, 56, -135,160,238, 97, 24,243,205, 35,216,254,196, 15,114, 91,216,223, 70,254, 54,239,223,157, 89, 6, 91,211, 91,103, 36, 62, 33, 4, -231,207,159,135,173,177, 58,134, 89, 5, 2, 1, 4, 2, 1, 42, 43, 43, 49,126,252,248, 59, 94, 73,182, 81,255,171, 87,175,198, -208,161, 67,161, 55, 24,160,211,235,160,183, 14,110,210,233, 45,105,128, 21, 43, 86, 56, 85, 38, 82,169,148, 46, 89,178, 4,102, -179, 25, 39, 78,156,132,128,111, 9,219,198,198,198,226,106, 81, 17, 74, 75, 75,177,105,211,119,152, 62,253, 81,236,219,183,143, -218, 71, 2,154, 83, 64, 50,153, 76, 8,128,149, 74,165, 92, 99, 30,144, 59, 83, 21,109,158,127, 94, 94, 30, 52,117,218,122, 3, - 76,165, 86, 65,165, 82, 66,165,170,243, 56, 20,110,243,254,173, 43, 1,122,100, 8, 76,159, 62,189,193,113, 76,116, 52,122,244, -180, 12,138,187,112,254, 60,174, 90, 35, 30,142,215,185,130, 17,247,141,128, 72, 40,130, 68, 34,129, 88, 44,134, 72, 36, 66,121, -121,185,203,228,239, 44,212,239,233, 26, 1, 83, 62, 88,139,173, 0, 30, 74,255, 63,208,140,215, 65, 82,151,227, 76, 97, 53, 72, - 72, 48, 46,151,168, 44,222,191,155, 41, 0,199, 84,128,219,211, 3,117, 58,128, 87,232, 16,222,183, 16,189,201,100,194, 23, 95, -124,129,209,163,255, 24, 23,182,239,233, 40,160, 66,139,238,187, 20, 24, 16,222,169, 41, 5,158,227,144,251,150, 3,245,234, 95, -238,120,173, 39,132,221, 92,222,222, 83,207,223, 83, 67,226,118,223,175,213, 8,104,241, 44,128,232,232,232, 77, 35, 71,142, 12, - 63,157,159,159,170,211,233,250,201,229,251, 37, 34,177,136,207, 16, 6,251,247,239,247,239,213,171,215,250,148,148,148,255, 84, - 86, 86, 58,245,214,167, 79,155,202,253,180,251,167, 3,253,251, 15,156,107,100, 13, 15, 93, 46,184,180,136, 43, 42,100, 1, 80, - 49, 24, 83,223,174,221, 51, 34, 34,194,119,241,248,194,111,255,251,206, 98,227,183,235,214, 90,115,124, 77, 99,232,208,161, 31, - 37, 37, 37, 1, 0, 42, 43, 43,145,157,157, 29,240,213, 87, 95, 45, 2,128, 99,199,142, 13,237,221,187,247,158,123,194, 0,176, -121,231,255,248,118, 99,243, 94,134, 27, 83, 2,109,214,111,220,220,225, 8,237,219,166,158,244,237, 67,255, 39,151,252,234,150, -229,218, 90,115, 82,109,101,235,217,179, 39,206,158, 61,219,128, 88,106,107,107, 11, 1,116,105,236, 59,158,174,189,220,210,114, - 58,158,255,246,155,111,161,215,235, 97, 48, 26, 96, 52, 26,177,100,201, 18, 56, 35,127, 27, 56,206, 12,177,196, 15, 58,157, 30, -231,207,157, 3, 95, 32,128,201,104,132,143,175, 15, 54,109,218, 4, 30,143,103,155, 59,223,236,189, 46, 89,178,100,143, 84, 42, - 53,202,100,178, 8, 91, 57, 29,214, 1,112, 43,180, 57,119,238, 92,228,230,230,162,174,174, 14,117, 26, 13,212, 42,149,149,252, - 85, 80,171,212,168, 83,215, 65, 99,167,240, 93,121,118,131, 7, 15,166,199,143, 31,175,247,254, 27,155, 6,232,234, 34, 64, 9, - 9, 9,183,212,133,141,244, 79,157, 58, 85,239,205,187,122,207,131, 6, 13,162,182, 69,126,252,124,252, 32,150,136,161, 86,171, - 19,237,114,216,110, 41,222,219,181, 24,144,205, 8,152,156,254, 21,232, 22, 32,236,105, 25,114, 94, 73,198,200,197, 27, 0,129, - 0,190,226,150,229, 57, 29, 13, 1, 0,144,231, 58, 11, 54,222, 68,223, 61, 62, 40,255, 81, 11,197,194, 63,206,154, 76, 38,140, - 26, 53, 10, 0, 16, 21, 44,193, 47,178, 14, 88,250,193,117,124,126, 82,215,172, 52,123,143, 31,176, 12,132,179, 41,118,199, 65, -113,238, 78,139,179, 31,191,211, 82,207,191, 49,157,224,137,172,219,121,191,246, 70, 64,107,180,191,222,189,123,127,170, 86,169, -119, 15, 25, 52,120,168, 90,165, 10, 97,205,172, 33, 50, 50,178, 50, 42, 42,170, 92,165, 82,157,169,172,172,116, 89, 41, 76, 24, - 55,129, 3,176,233,208,193,163,121,241, 35, 71,254, 32,145, 72, 2, 9, 40, 71, 8, 1,199, 81,165, 78,163,144, 95,204, 47, 86, -127,187,110,173, 75,122,222,246,204, 0,203, 64,106,199,129,122, 31,124,240,193,127,238, 9, 3, 96,252,248,241, 57, 45, 89,240, -199,149,198,106, 51, 4,108,196,223,154,132,222,146,178,245,237,219, 23,199,142, 29, 67,101,101,125,136,176, 11, 0, 84, 87, 91, - 34, 74, 79, 60,241,196,159, 90, 89,142,207,136, 82, 74, 31,127,226,113,172, 88,177,210,154, 51,103, 17, 24, 24, 72, 92,253,190, - 13, 18,137,216, 38,207,226, 77,105,180,246,223, 1,224,116,179,137,158, 75,150, 44,185, 36,149, 74, 43,100, 50, 25,207,126, 64, -160,117, 90,160,203,138,206, 54,247, 61, 62, 62,190,213,159,221,224,193,131, 29,247, 2,168,255,220,221, 21, 0,101, 50, 25,201, -201,201,161,155, 54,109,106,176, 80,143, 77,182, 39,237, 57, 33, 33,129,152, 88, 19, 76,106, 83,171,222,123,115,161,127,119,247, - 6,152,242,193, 90,192,110,225,159,251,223,250, 99, 92,146,166,149,202,219, 32, 2,208,187,121,227,179, 52,190, 20,165, 0,226, -150, 6, 99,225,137,110, 8, 7, 80, 89,168, 65,215,174, 93, 1, 0,159, 46, 12,198,131, 67,194, 17,243, 96,129, 75,191,237,206, - 84,183,140,140, 12,121,115,203, 30, 59,211, 55,173,161,243, 90, 42,235, 78,220,111,107, 98,248,136,225,151, 0, 92,186, 37, 98, - 29, 26,234,145,188, 81,163,135, 22,161,209, 81,161, 81,232,218,173,143, 59,134, 84,171,222,103,107, 44,242,227,145, 1,112,187, - 9,108,215,174, 93, 9,219,151,220,125,123, 1,216, 58,210,144, 33, 67,176,107,215, 46,189,149,244, 57, 0, 62,183, 35,242,208, - 74,141,132,200,100,178,122,207,190, 57,242,191,157,152, 59,119,174,125, 60,181, 94, 97,219,166, 17,186,227,237,220,206,231,107, - 47, 59, 39, 39,167,197,203,254, 38, 36, 36,144,132,132,132, 22,151,203,217,218,254,173,129,150,164, 4,230,205,155,135, 43, 87, -174,180, 90, 89, 92, 89,222,215, 93,156,124, 67,129,147,176, 12, 12, 29,157, 34,193,207, 71,186, 33,210,199, 15,191, 31,191,137, -238, 46,146,191,179,246,119,183, 46,135,219, 26,107, 9,220, 75,247,123, 23, 62,255,118,173, 44,111,249,157, 42,251, 29,223, 13, -240,118, 69, 24, 90,211, 8, 24, 63,126,188,248, 30,107,128,228, 79,254,109,219, 10, 53,172,205, 0,240, 42,143,187, 7, 45, 77, - 9,116,238,220,153,116,238,220,185, 85,244,141, 59,251, 0,120,138,131, 25, 58, 28,204, 40,240,246, 89, 47,188,112,230, 68, 14, - 24, 48,128,122, 31,131, 23, 94,120,225,133, 23, 94,252,189,192,120, 31,129, 23, 94,120,225,133, 23, 94,120, 13, 0, 47,188,240, -194, 11, 47,188,240,194,107, 0,120,225,133, 23, 94,120,225,133, 23, 94, 3,192, 11, 47,188,240,194, 11, 47,188,248, 75,160,193, - 44,128,153, 51,103,122, 60, 50,181,177,121,226, 94,121,119,159,188,180,180, 52,143,228, 13, 28, 56,240, 22,121,167, 78,157,242, -184,124,141,201,187, 87,234,195,221,103,184,102,205,154, 59, 82,190,214,174,143, 59, 89,191,206,166,137,186,251,252, 90, 91,158, - 87,191,120,229, 53, 34,175, 61, 0, 5, 0, 33,128,218,187,173,124,110, 27, 0, 94,252,245,177,102,205, 26,239, 67,248,155, 33, - 40, 40,136,129,101,122, 38, 95,169, 84,114,148, 82,243,221, 84, 62,219,190,243,217,217,217,180, 53, 22,154,105,173,149,246,188, -184,125,216,177, 99, 71,194,196,137, 19,115,238,241,219,176,173,125, 37,113,215, 0,184, 43, 35, 0, 94,252,245, 64, 41,109,176, -213,177,167, 17,128, 85,171, 86, 57,189,102,236,216,177, 9, 89, 89, 89, 13, 86, 22, 27, 51,102, 76,226,222,189,123, 61,234,232, -153,153,153,141,202, 75, 78, 78,190, 43,228,221,205, 32,132,144, 78,145,145, 40, 42, 47,167,181,181,181,182,253, 25,220, 90, 98, -208,222, 88, 60,190,117, 69, 9, 33,152, 37,219,157,191, 93, 58,174,223, 55,148, 66,181,102, 79,254,172,121, 83,134, 18, 48,148, -175, 80,235,233,224,169, 47,186,189, 37,103,118,118,118,130,109,201, 89,235,127,143,150,155,117, 36,127, 91,187,111,233, 70, 59, -141,125,215, 83,153,173, 33,175,165, 91, 6,123, 18, 45,185, 29,228,191,107,215, 46,249,196,137, 19,239,117,227,204,182, 15,251, -109, 77,165,191,247,214, 75,140,159, 32,144, 49,136,133,156,161, 86,199,175,211,169,216, 15, 63, 93,209, 42, 59, 12,222, 98, 0, -180, 38, 65,120, 42,203, 93,121,132, 16,198,106,133,233, 40,165,220,221, 86,190,214, 34,216,214, 48, 0,108, 74,221,190,172,132, - 16, 3,165, 84,212,146, 72, 1, 33,132, 2,192,242,229,203, 27,236, 24, 54,103,206, 28, 57, 33, 4,148, 82,226,174, 82, 2, 0, -238,251,224, 6,231,153,105, 89,242,172,172, 44,183, 21, 96,107,202,187, 23,162, 40,148, 82,154,216, 37,134, 38,118,137, 1, 0, -148, 27,217, 25,109,132,252, 13,182,207, 47,168,234, 68,101, 46,108,156, 2, 0,199,182,124, 86,192,113,136,186,111, 68, 88,192, -135,175,140,220,219,175, 95,208,181, 89,139,135,254, 23, 0,110, 42,181,255, 39,224,147, 31, 1,114, 46, 45, 45,173,183,187,207, -198,113, 41,218,150, 44, 55,107, 79,254,173, 97, 4, 52,245, 29, 79,201,178, 53,228,165,164,164, 32, 35, 35,195,165,123,114, 39, -162,210,156,188,214,138,204,216,147, 63,199,113, 88,179,102, 13, 54,108,216, 64,103,204,152, 65,220,172, 99,161, 76, 38,107,149, -245,178,231,207,159,159,150,158,158,238,105,135, 14,176,122,254,154,219,209,135,215,175, 92,197, 60, 30, 21, 35,126, 41,249, 73, - 97, 68,207, 40, 62,159, 68, 48, 90,165,146, 21, 35,210,200,180,107,111,212,223,184,106,108,233,111,240, 93, 81,110, 82,169, 52, - 28,192, 96, 0,199,101, 50, 89,229, 93,230,233, 4, 0, 72, 2, 48, 25,192, 54, 66, 72, 54,165, 84,213, 10,114,191,163,148, 62, -234, 41,193,222, 45, 96, 24,166, 89, 35,133, 16, 50, 20,128,144, 16, 18, 65, 41,173,104,234,186,230, 12, 20, 66, 8,125,249,229, -151,209,177, 99,199, 91,182, 11, 93,190,124,121, 98,113,113,177,156, 16, 66, 93, 53, 2,164, 82, 41, 93,247,162, 47,158, 28,121, -235,230, 50,220,247,193, 88,255,139, 17, 79,187,233, 53,181,166, 60,165, 82,153,240,230,155,111,202, 83, 83, 83,145,152,104, 89, -217,238,244,233,211, 9,171, 86,173,146,119,236,216, 17, 28,199, 65,167,211, 33, 33, 33, 1, 99,199,142,117, 42, 83,168,212, 36, -116,127,115,179, 60, 43,174,125, 98,155,231,198,228, 0, 0, 91,206, 38, 92,124,151,149,155, 59, 6, 64,197,249, 66,161, 11, 64, - 69,224,177,196,103,231, 69, 56,245,142,187,116,104,211,166,163, 80, 82,246,226,172, 39, 12,145, 18,161, 80, 85,163, 35, 75,190, -218,184,225,173,231, 31, 71,176, 68, 66,245, 38, 51,253,247,138,175, 12, 0, 72,219,182, 97,252,242,242,106,102,192,128,198,119, -214, 28, 18,177, 55,246, 70,148, 79, 80,252,125,225,203, 7, 14, 10, 17,172, 91,119, 57, 58, 60, 76, 82,245,209, 43, 71,150, 23, - 93, 27,104, 30,247, 96,219,188,130, 75,234,226,167,159,236, 50,222,214,110,220,233, 3,246, 27,228,180,196, 11,117, 36,127,199, -254,233,137,252,187, 49, 2, 96, 37, 98,106, 51, 2, 82, 82, 82,236,207, 55, 32,109,251,141,125, 60, 53, 42,108,114, 50, 50, 50, - 90, 28, 37,176, 39,255, 57,115,230,224,248,241,227,244,151, 95,126,193,140, 25, 51,220, 21,101,148, 74,165, 2,153, 76,198,182, -130,138, 44,159, 63,127,254,228,244,244,244,109, 30,124, 55, 10, 64, 13,128,104, 0,167,115,115,115, 59, 1,248, 28, 64,136,189, -124, 0,159,198,199,199,187,188,231,130,142,211,241,141, 85, 6,159,113, 19, 39, 7, 42, 96, 10, 20, 8,248, 34,149, 94,204, 23, - 10,117, 44, 47,192,215, 96,148,152,116,252,242, 27,106, 49, 79, 84,171, 55, 27,140, 82,169,180,201,254,219,226, 8, 0, 33,164, - 3,128,255, 1, 40, 5,240,178, 84, 42,125,142, 82,122,253, 78,121,176, 78, 72, 58, 20,192,122, 0, 55, 0, 28, 6,240, 16,128, -103, 9, 33, 79, 82, 74,171, 91, 40,126, 26, 33,100,134,179,124,233,157, 12,177,223, 38, 12, 7,112, 17, 64, 12,128, 10, 98,101, -106, 87, 13,154,177, 99,199, 38, 0,104, 64,254,115,230,204,145,219, 71, 3,172,159,201,199,142, 29,155,224, 44, 29,144,153,153, -153, 0,160, 1, 89, 51,211, 20,176,247,222,159, 28, 41,196,211,159,105,144,153,153,153,224, 44,124,223,218,242, 0,224,200,145, - 35,114,177, 88,140,188,188,188, 6,251, 29, 48, 12,131,183,223,126,155,216,148,221,206,157, 59,229, 99,199,142,117, 90, 1,109, -142,156,147, 83,177, 0,253, 42,133,242,138, 63,182, 98, 5, 97, 40,250,189,109, 36,128, 17,103, 15, 94, 75,184,177,101,130, 28, - 56,218,172, 18, 78,236, 18, 67, 59, 10, 37,120,237,133, 25,134, 72, 63,161,176,234,108, 46,241,101,248,120,105, 84, 44,218, 5, - 73,112, 45,239, 16,209, 25, 41,153,147,246,132, 49,177, 75, 12,237,225,227,143, 50, 90, 69, 6, 14, 28,216,168,188,176, 48,225, -253, 66, 33, 35, 62,124,184,236,101,214,172,255, 56,178,125,103, 83, 80,152,128,168, 84,151,125, 58,199,248,132,133,132,136, 42, - 57,170, 50,252,116,180, 66, 51,115,212,159,211,128, 29,195,254,246,125,211, 93, 35,192,118,141,253, 56, 2,103,215, 57,219,126, -187, 53,229,217, 27, 1, 50,153, 2,128, 2, 82,105, 48, 26, 35,109, 87,209,148, 81, 97,141,200,180, 40,234, 97, 79,254, 59,119, -238,148, 51, 12, 3,134, 97, 48,106,212, 40, 28, 58,116,168, 65,125,185, 10,179,217,156,207,227,241, 76, 82,169,148, 47,147,201, - 90, 58,158, 69, 82, 93, 93,253,125,104,104,232,212,244,244,244, 45,110,126, 87, 7,203,126, 49,234,220,220,220, 62, 0,182,236, -219,183,175, 27,199,113,246, 28, 5, 30,143,247, 8,128,156,248,248,248, 68,103, 2, 11,174, 20,136, 37, 66,113,160, 64, 32, 10, -103,248,164, 45,229,137,130, 56, 30, 79,196, 17, 6, 28,225,155, 40,143, 87,199,227,136, 90,195, 51,215,248, 10, 5,132,215,165, -131, 82, 60, 49,130, 69,241,237,139, 0,124, 12, 96,159,213,178,121, 1,192,199,107,214,172,153,234, 33, 97, 7, 3,120, 25,192, - 16, 0,227, 1,236, 2,112, 12,192, 39,148, 82,133, 7, 34, 15, 90,203,181,138, 82,202, 17, 66,124, 1, 60,101, 61,223,187, 5, -134, 69,160,245,173, 47, 0,149, 59, 30,118, 19, 17, 20, 33,128,183, 0, 44,146,201,100, 70,220, 93, 24, 2, 32, 23, 64, 27, 66, -200, 38,107,157,124,227,104,208, 52,101,160,100,101,101,201,237,195,254,115,230,204,169, 63,182,127,191,124,249,242, 68,171, 97, -208,108,143,207,202,202,146,219,135,233,153,105, 10, 92,218,101,217,133,145, 25,255, 77, 61,105,115,223, 7,131,153,150, 37,119, -182,161, 79, 99,242,108,202,140,153, 38,165,238,202,163,148, 38, 28, 62,124, 24, 51,102,204,192, 23, 95,124,129,147, 39, 79, 38, -196,197,197,229, 56, 94, 35, 22,139,229,109,219,182,117, 37, 86,159,208,246,240,111,184, 56, 35, 1,126, 95,156, 5, 41,211, 38, -208,182, 62, 86,121,196,122, 9, 18, 4,250,142,242,144,182,205,111,101,155,216, 37,134,166,253,107,154, 49,210, 87, 40, 48, 93, - 62, 46, 12, 14,247, 39,242, 50, 21,166, 14,232,128, 30, 81, 65, 16,214, 94,132, 92,173, 67, 7,129, 8, 65,132, 39,152,255,236, - 12, 90, 39, 20, 21, 36,118,137,161, 8, 8,106, 84,166,162, 86, 29, 50,116,168,223,114, 21, 59,108,158,127,112,165, 72,207,248, -114, 18, 63,163, 33, 36, 44,148,241, 9, 18,243, 21, 53,101, 34,149,146,133, 64,105, 32,246,109,166, 57,131,214,154,247,151, 59, - 35,206,148,148,148, 68,103,227, 1, 26,243,252, 29, 13, 1,119,140, 0,219,103,205,145,177,253,121,103,196,232, 40,143,110, 14, -190, 85,223,164, 42,224,170,188,230,194,253, 45, 33,109, 71,163, 2, 0, 66, 66,178, 91,133,252,103,206,156,105, 73,191,113, 28, - 94,127,253,117,124,252,241,199,245,228,191,106,213, 42,183,101, 51, 12, 3,163,209,120, 74, 40, 20,178,173, 16, 9,168, 1,128, -234,234,234, 45,161,161,161,137,233,233,233,114, 55,190,203, 7,128,167,159,126, 90,148,155,155,155,149,157,157,221,102,225,194, -133,236, 59,239,188,211,128, 87, 67, 67, 67,177,127,255,254, 4, 0, 25,241,241,241, 41,205, 9,228, 17, 65,128,145,165,237, 56, -206, 20, 35,228,241, 58, 81, 66, 34, 8,159, 79,248, 60,158,146, 16,162, 3,225,169, 56,138, 96,106,228,124, 84,102, 19,186, 4, -176, 58,102,168,154,107, 53, 3,192, 33, 55, 28, 5,160, 3,165,212, 70,248, 75, 9, 33, 71,165, 82,105, 20,165,180,212, 29, 15, -150, 16,242,132,149,172, 63, 4, 48, 15,192,227,214, 16, 74, 10,128, 98, 66,200, 11,148,210,111,220, 32,233,255, 0,184, 76, 41, - 93, 73, 8, 17, 89, 59, 60, 75, 41,253,156, 16,242, 32, 33,228, 63,148,210,255,231, 97,163, 24, 13,160, 18,192,253, 0,126,116, -231,139,141, 69, 0,164, 82,233, 51, 0,222, 5, 80,158,150,150,182,250, 46,139, 0,244,182,150,109, 12,128,113, 0,174, 57, 51, -104,154,130, 61,225,219,147,190,227,184, 0,151, 59,186, 29,249, 3,192,165, 93, 79, 52, 48, 2, 60,145,103,175,204,100, 50, 25, -177, 55, 2, 92,193,129, 3, 7, 96, 52, 26, 49,104,208,160,196, 95,126,249, 69, 94, 84, 84, 36,143,139,179,108,169,203,113, 28, -210,211,211,105, 93, 93, 29, 4, 2, 1,166, 76,153,226,244,190,245,121,199,192, 24, 89,212, 14,138, 78, 20,252,114, 67,126,121, -237, 1,116,121,107,156,133,180, 56,138,252,116, 33,173,169,243,135, 78,224,135, 49, 51, 47, 57,127,142, 12,175,174,242,108, 94, -160,222, 96,102, 2, 37, 34,154, 60,160, 35, 2, 36, 2, 82, 82, 93, 7, 95,134,143,212,129, 29,233,145,223, 43,240,235,143,123, -208,201,215,143,158, 81,171,174, 1,232,222,148,184,188, 83,237,102, 13, 31, 88,117,192,143, 31,195, 10,217,155, 93, 70,143, 72, -245,211, 27,125, 39,240,252,142, 49,170,218, 26,159,162,243,199, 98, 76,198,243,149, 87, 10, 53, 1,214, 62,227,148,168, 92,245, - 78,109,227, 3,154,202, 63, 55,229, 77, 59,243, 42,165, 82, 41,245, 52,100,122, 55,193,209,243,183,144, 55,144,145,209,122,131, - 4, 91,195,243,167,148,130,101,255,224,232,145, 35, 71,226,208,161, 67, 30,145,191, 21, 38,129, 64, 96,230, 56,238, 48,195, 48, -166, 22, 26, 1, 17,182, 55,213,213,213,242,208,208, 80,105,122,122,186,171, 59,103, 21,165,166,166, 6, 28, 56,112, 32, 61, 59, - 59,187,205,215, 95,127,205, 61,245,212, 83,252,141, 27, 55,226,189,247,222, 67, 65, 65, 1, 58,117,234,132,242,242,114, 44, 88, -176,192,252,238,187,239, 38, 3,120, 33, 62, 62,254,243, 38, 37,114,108,160, 25, 76, 39,194,161,183, 9, 92,172,143, 64, 36, 20, -242,153, 50,177,128,167,226, 73,132, 85, 34, 17,175,206, 96,230,124,248, 38,126,136,145, 53,152,175,158, 60,165,120, 34,252, 99, -237, 17,120,198, 31,206, 34, 0, 15, 2,200,117, 24, 56,150, 11,224,193, 53,107,214,124,229, 6, 89, 63, 6,224, 21, 0,209, 14, -161,121, 5,128,223, 8, 33,159, 2,216, 75, 8, 49, 83, 74, 55,186, 32,207, 7, 64,154,255, 11,176, 0, 0, 32, 0, 73, 68, 65, - 84,154,205,203,167,148, 26, 28, 46,121, 18,192,239,132,144,101,148, 82,173, 39,225,127, 0, 95, 89,255,187,101, 0, 56, 18,166, - 84, 42,253, 39,128, 89,214,103,185,156, 16, 98,144,201,100,107,239, 6, 5, 66, 8,233,106, 13, 97,253, 4, 96, 59, 0, 91, 61, -193,213, 8,192,223, 13,165,165,165,242, 97,195,134,129, 16,146, 51,108,216, 48,252,240,195, 15,120,228,145, 71, 18,218,180,105, - 35,103, 24, 6,243,231,207, 39, 86,101,146,176,105,211, 38,185,193, 96,192,144, 33, 67,154, 84,116, 35,174,222,144,151, 15,235, - 9, 16,146,243,123,164, 57,177,247,233, 16,185,158, 67,162, 37, 5, 0,244,155,111, 36, 64, 53, 52,213,202,132,253,155,186,202, - 53,254, 71, 19, 31,125, 42,160, 81,175,184,196,200, 46, 91,179,102,227,235,225, 97,146, 34,165,198, 24, 24, 29,236, 43, 72,233, -223,217,103, 96,180,136,232,181,102,104,117, 28, 46, 19,157,121,123, 81,169,182,176,188,206,220, 70, 40, 46, 43, 55,234,199, 94, - 55,152, 62,244, 7, 94,107, 76,102, 64,112, 84,123, 93,221,165,118,189,146, 30, 96,206, 29, 41, 27, 93,122,225,135,235, 93, 7, -167, 69,240,122, 14, 40, 57,117,232,123, 37,225, 5, 12,225, 56,174,230,230, 77,157, 83, 43,202,145,176,157, 29,219,188,217,140, -140,140, 38, 9,219, 62,188,238, 24, 9,112,229,250,123, 21, 73, 73, 73,196,222,235,183,135,125, 8,191, 37,104, 13, 57,117,117, -117,114, 0,224,243,249,120,245,213, 87,113,252,248,113,252,242,203, 47, 45, 21,107, 0, 96, 54, 24, 12,108,105,105,105, 86, 84, - 84,148,201, 89,100,177, 25,168,237, 15,170,171,171,101,161,161,161, 15,167,167,167,187,162,247, 3,245,122,125,183,185,115,231, - 78,156, 57,115, 38,237,219,183, 47, 1, 80, 79,254, 0, 48,124,248,112,108,221,186, 21, 35, 71,142,100, 30,123,236, 49,154,147, -147,179,146,199,227,233,124,124,124,160,213,222, 74, 77, 28, 71,245, 57,242,125,153, 93,187,198, 22,199,116,138,190,196,243,151, -148,241,136, 80,201,136, 4, 74, 70,236, 83, 97,228,243,180,160, 38, 1, 39, 54, 69,168, 75,171,195,142,238, 63,253,118, 88,112, -228, 59,158, 62,200,102, 35, 0, 82,169,116, 44,128, 13, 14, 94,237,126, 0, 51,210,210,210,190,114,197,131, 37,132,240,172,225, -239, 73, 77,229,229, 41,165,213,132,144, 84, 0,219, 9, 33,223,187, 48, 79,249, 49, 0,123, 41,165,202, 38,228, 41, 9, 33,123, -173,215,125,225, 38, 41, 62, 0, 32, 20,192,108, 0,155, 8, 33, 15, 80, 74,247,123, 18, 1, 32,132, 36, 3, 88, 10,160, 19,165, - 84, 67, 8, 25, 14,224,154, 84, 42, 85, 83, 74, 51, 93,141, 0, 72, 45,166,190, 43, 74,139,200,108,110,128,107, 24, 1,224, 40, -165,148, 18,139,219,116, 13,128,134, 16,210,193, 54,206,195,157, 8,128,163,199,223, 18,239,191, 62, 44, 63,254,155,250, 40, 64, -108, 11,188,255, 63,194,252,127,132,111,165, 82,247,188,127,147,201, 68,143, 31, 63, 14,127,127,127,228,231,231, 83,179,217, 12, -149, 74,133,243,231,207,203, 67, 67, 67,225, 16,246,203,233,213,171, 87,226,230,205,155,229, 67,134, 12,105, 60,220,103, 50,209, - 14,199,207, 66,232, 31, 5, 65,126, 53,141, 52,251, 67,173, 98, 96, 62, 95, 7,132, 54,220,145,218, 55,148,205,233, 56,248, 68, -226,158, 45,211,228,192,238, 70,149,221,165,235,215,223,136,237,208, 1,168,210,189, 14, 0, 5, 58, 21,118,138, 74, 43,123,221, - 63, 58,188,151, 49, 31,191, 93, 83, 96,231,233,155,252,194,202,186, 0, 0, 40, 55,234,131,175, 27, 76, 41,133,165,165, 91, 7, -132,135, 55,106, 0,220, 63, 33,149,241, 17,142,237,203,106,126, 43,238,216, 51,169,155,242,250, 22,227,229,223,178,106, 77,156, -223,205,138,226, 95, 43, 84, 53,190, 67,192, 48,164, 70,173, 15,148, 78,139,235, 32,251,254,228,245,166,218,140, 76, 38, 35,246, - 17, 0,123,239,210, 49,220,110, 35,233,148,148, 20, 36, 37, 37,145,198, 22, 58,105,201,104,124, 79, 23, 78,185,219, 96,235,238, - 82,105,240, 45, 17, 1, 79,163, 10, 25, 25, 25,173, 66,254, 27, 54,108,160, 7, 15, 30, 4,221, 28, 12,146,170,192, 71, 31,125, - 4, 74, 41, 24,134,193,234,213,171, 61,142, 44, 40, 20, 10, 67, 72, 72, 72,226,193,131, 7,119,143, 30, 61,122, 92, 99,237,199, - 13, 4, 89,251,107, 90,117,117,245,154,208,208,208, 39, 0,212,204,159, 63,255,159,233,233,233,206, 28, 53,229,142, 29, 59, 74, -247,236,217,243, 85, 98, 98,226, 51, 61,122,244, 64, 82, 82, 18,205,206,206,174, 47,199,246,237,219, 33, 18,137,112,237,218, 53, -236,222,189,155,180,107,215,142,141,143,143,255,229,252,249,243,141, 10,140,141,233, 86,166,211,233,211, 14, 30, 60,184, 38, 52, - 44, 84, 21, 24, 16, 80, 12,161,208,192, 26,152, 58,150,103,168,213,243, 85, 85,190, 6, 95,241,141,138,202,192,253,123,118,175, -233,213,187,207, 82,163, 94, 91,215, 42, 6,128, 84, 42, 37, 82,169,212, 86,248, 54,214,215, 1,235, 52,187,250, 40, 40,128, 57, -132,144,118,176,140,112, 4,128, 70, 45,116, 43,169,188, 4,203, 0,189,171, 14,114, 28,113,213,122,221, 75,132,144,143,155,145, - 71, 0, 76, 1,176,216,137,188,175, 1,204, 35,132,124,229,164,124,246,141, 38, 26,150,241, 14,131, 96,201,253,191, 13,224, 4, - 33,164, 11,128, 34,123, 27,195, 5,121,143, 2,120,214, 74,178, 58,107, 89,117,214,227,213,132, 16, 33,128,239,154,147,103,173, -139, 39, 0,204,116,213, 0,144, 74,165,171, 0,124,211,148, 60,171,204,101, 0,252, 1, 4, 2,216, 97, 45,155, 24,150,121,226, -191, 1, 24, 70, 8,153, 13,224, 23, 0, 59,155, 42, 31, 96,153, 71,223, 68,174, 31,142, 99, 3,198,140, 25,227,212, 24, 24, 51, -102, 76, 34, 51,237,143,188,189,205, 8,176,189,183, 15,231,123, 44,111,218,173, 83, 2, 93,145,119,250,244,105,116,236,216, 17, -175,190,250,106,125,155, 89,191,126, 61,205,203,203,195,132, 9, 19,110,185,222,199,199, 71, 46, 22,139,155,148, 23,125,250, 52, -106, 59,182,197,145, 87,159,169,151,119,241,141,173, 9, 49,121, 74, 57, 51, 65,124, 75, 89,138, 11,140, 16,137,155,159,253,116, -185,164,100, 46,218,183,255, 21,192,112, 10,202,195,213,202, 87,181, 44, 11, 86,111, 9,146,157,171,172,196, 85,189,113, 61,159, - 16, 53, 8, 49, 93, 46, 41,201, 4,128,166, 6, 1,182,139,238, 49, 23,192,146,130, 67, 47, 23,137, 35,167, 40, 74,203,197,237, -203, 75,142,137, 33, 8,233, 90,116,205, 28, 85, 93,126, 29, 66,161, 32,162,119,164,239, 99,181,106,211,183, 0,174, 59,243, 92, - 1, 36, 56, 78,255,107,194, 3, 77,244,100, 77,128,198,242,255,127, 7,180,116,170,158,237,251, 25, 25, 25,180,165,242, 54,110, -220, 64,115,114,114, 64, 50, 45,134,241,222,119,252, 49,118,161, 26,163, 71,143,134, 59,211,254, 26, 67, 72, 72, 72, 34, 0,220, -119,223,125,218, 86, 72, 83, 40, 66, 67, 67,103, 0,176, 57,167,134,244,244,244,157, 46,126,151, 5, 80,177,125,251,118,249, 35, -143, 60, 50, 56, 61, 61,189,159,217,108, 38, 18,137, 4, 99,198,140,193,207, 63,255, 12,142,227, 48,126,252,120,250,242,203, 47, -147, 1, 3, 6, 24,166, 76,153,210,169,166,166,230,166, 94,175,111,138,145,217,223,207, 95, 90,223,167,111,191,192, 99, 71,143, - 46, 61,197,231,247,233,220,169,243,151, 1,161,225, 37,130,112, 49, 61,176,123,127,112,141,162,122, 84, 84, 72,248,187,221,186, -117, 59,224, 23,233,187,170,103,251, 65,198,252,252,252, 86,137, 0,240, 96,153,238, 23, 15,224,125, 0, 47, 90,137,199,215,190, - 63,193, 50, 72,236, 50,128,127, 91, 83, 2,199,155,144,207,192, 50,200,108, 47, 0, 31, 23,202,115, 24,192, 88, 52,189,176, 2, - 3, 32, 28, 64, 39, 0, 39,156,200, 60, 97,189, 46, 2, 77,231, 38, 25, 88,150,113, 12,182,166, 13, 30,177, 18,119,129, 85,118, -129,245,120, 35,128, 31, 96,153,113,160, 0, 96,116, 34,111,154, 53,242,208,195,106, 36,217,151,179, 12,128, 20,192, 5,235,181, -223, 59,145,247, 10, 44,179, 27, 92, 73,101,248, 0,216, 3, 96,131,147,250,152, 10,224,191,214,255,167,236,202, 39,176,214,101, - 6,128,207, 0, 44,180,126, 94,214,212, 15,238,221,187, 55,135, 16,130,226,226, 98,185,109, 38,128,163,215, 95, 92, 92, 44,183, - 93,235,236, 6,146,147,147,115,178,178,178,176,254, 23, 99,253,200,125, 71, 47,125,253, 47,198,250,107,239,164,188,188,188, 60, -140, 26,213,112,168,123,116,116,116,226,230,205,155,229,157, 59,119, 78,228, 56, 78,190,104,209, 34,106,155, 6, 72, 8,193,224, -193,131,155, 52, 42,186,231,229,225,187,208,136,196, 0,187,115, 61,103,143,133,102,233,117,224, 31, 17,160, 28,144,191, 72, 64, -235, 56, 63,212,232, 2,160, 32, 3,209,127,212,142,196,230,154,189,117, 6,199, 22, 0, 91,186,118,138,234, 14,224, 85,131,153, - 67,102,126, 17, 70, 69, 90,210,157,132, 82,181,154,101,223,191,121,243,230, 77, 23,218,212, 82, 0,190, 5, 23,106, 30,175, 61, -177, 57,172,162,172, 6, 21, 55,213,224,243,171,125,235, 20, 20,181, 42, 51,141, 8, 23, 6,241, 57, 76,214, 25,204,223, 45,124, - 53, 62, 40,162,231, 83,181, 78,136, 38,199, 25,185,180, 56,135,157,180,217,242, 63, 59,213, 77, 15,248,246,206, 2, 32,169, 10, -180, 68, 94, 83, 30,251,160, 65,131,238, 26, 67,164,126,176,163,141,252,243, 89,172,149, 91,250, 88, 75,201,223,214, 54, 94,120, -225,133,112, 62,159, 95,113,248,240,225, 47,239,187,239,190,150, 76, 81,236,152,158,158,190,210, 26, 5,152,102,157, 17, 48, 45, - 61, 61,253,123, 87,130,138, 0,234, 0, 84, 69, 71, 71,247, 31, 57,114,100,233,233,252,252,182, 58,157,142,200,229,251, 33, 18, -139,192, 16, 6,251,247,239, 39,189,122,245,210,166,164,164, 12,171,172,172,116,218,231,166, 79,155,202,254,180,251,167,207,250, -247, 31,216,217,200, 26,198, 93, 46,184,244, 44, 87, 84,248, 12, 0,136,193,208,190, 93,187, 31,139,136, 8,207,225,241,133,111, -252,247,157,197,117,223,174,243, 60,163,220,152, 1,240,170,213, 26,154, 0,224, 60, 0,191, 70,190,183,203,234,177, 39, 3, 24, -106, 37,207, 70,163,156, 0, 98, 1,108,114,209, 0,168,182, 94,207,107, 70, 94, 2,128, 75, 46,202,187,100,189,126,107, 51,242, -210, 0, 60, 13,224, 44, 44, 51, 20,174, 58,200,150, 91,189,255, 89, 86,111,120, 29,208,228,136, 11,158,213, 99,127, 18,192, 0, -107, 20,161,177,114,170,172,159,175,182, 26, 1,235,154,145,247,181,213,232,114,229,126,169,245,250,230,158,223,135,214,200,198, - 94,171, 81, 3, 7,217, 63, 3,232,101,173,139, 2,171, 33,213,161,217, 31,181,100, 16, 40, 0,121, 99, 11, 1,217,174,113,167, -131, 63, 45,149,210,167, 63,211, 52,178,112,143,194,109,130,104, 45,121, 47,189,244,210, 45,215,140, 30, 61, 58,103,244,232,209, - 4, 0, 30,120,224, 1,183,148,208,174,151, 94, 34, 1,142, 26,165,147, 95,142,100, 69, 79, 2, 0,189,101, 2, 98, 9,202,216, - 70,102, 95,115,177, 25, 88,235,197, 76,139,192, 7,120,117,168, 39,127,171,139,124, 83, 44, 22,187, 58, 27,133, 0,120,239, 80, -246, 41,159,200,246,157, 30,230,224, 19, 91, 82, 92,206, 51,233,107,105,155, 8, 63,226,231, 43, 32,172,137,131,162,214,200, 18, - 9,145, 40,213,108,215,136,166, 29,130, 70,201,194,241,253,159,185,124,239,237,158, 5,208, 82,121, 77,121,236,157, 59,119,190, -107,200,159,251, 62, 24,123,243, 45, 99,242,214,201,141,248,238,176, 17,148,210, 86,169, 87,155, 12,179,217, 92, 13, 0,113,113, -113, 45, 90, 16,200, 70,254, 86, 84, 89,255,187,218, 55,132, 86,199,236, 36, 0,244,238,221, 59, 74,173, 82,207, 27, 50,104,240, - 19,106,149, 42,144, 53,179,166,200,200,200,155, 81, 81, 81,151, 84, 42,213,194,202,202,202, 2, 87,203, 53, 97,220, 4, 22,192, -139,135, 14, 30, 29, 25, 63,114,228, 4,137, 68, 18, 70, 64,205,132, 16,112, 28,173,214,105, 20, 43, 47,230, 23,151,125,187,110, -109,139, 86, 4,116, 52, 0,204, 0,254,217, 12,129,216,227,152,245,101,182,190, 26,131, 25,150, 17,245, 60, 23,203, 35, 7,144, -237, 68,222,118, 88, 6,173,185,130,199, 93, 40,223, 26, 0, 95, 58,145,243, 59, 44, 83, 32,225,130,188,111,172, 17, 3,103, 40, -178,122,246,174,148,143,231, 70,157,174,113, 34,239, 31, 46,200,179, 69, 27,214, 89,159,141,211,185,182,148, 82, 50,118,236,216, - 4, 27,225,219,135,224, 61, 89, 10, 88, 38,147,145,204,204,204, 4,102, 90,235, 44,221,219,218,242,238, 5, 20,150,220, 48,196, -118,232,176,110,230,210,213, 79,219,206, 25, 5,204, 6,189,150,219, 83, 94, 92,172,118,169, 49,173, 89, 67,171, 78,172, 37,139, -191,255,109,238,206, 21, 15,108, 59,114,180,236,249,240, 64,110, 34, 19, 18, 16, 68, 41, 64, 8, 53, 24, 88,174,156, 3,170,140, - 6, 46,168,180, 76,103,140,117,163,140, 41, 41, 41,137,246,233,128,148,148,148,196,187,229,249,221,141, 43, 1,222, 43,120,112, -161,250,182,222,163, 76, 38,227,164, 82,105, 91,177, 88, 92, 22, 23, 23,247,143,214,144,153,158,158,190, 47, 52, 52,244,233,244, -244,244,117,110, 24, 0,172, 53,114, 10, 0, 24, 62, 98,248, 98, 0,139, 29, 47,116, 28, 35,228, 42, 70,141, 30,250, 11, 44,169, - 88, 7, 68,161,107,183, 62, 45,190,231,198, 12, 0,189, 7,114,104, 51, 33, 18,131, 87,222, 95, 86, 94, 3, 88,137,190,213, 58, -122,114,114,114,142,179,121,249,127,166,188,123, 1, 53, 90,237, 51,128,143, 9, 64, 56, 7, 90,170,215, 27, 55,150,151, 87,158, -161,148,186, 60,109, 42,108,208, 63,233,246,143,198,145,155,190,143,230,181, 31,137,188,236,175, 62,124, 53, 36, 68, 52,143,207, - 35,180,172, 90,127,177,204,200,174,151, 8, 24,177,132,207,227,153, 88, 78,236, 78,249,108, 57,126,219,192, 51, 79,247, 1,184, -101,234,159, 93,232,223,147,197,102, 28, 61,115, 87,206,223,105,121,119,218,240,113, 21,204, 52, 5, 8, 33,152, 56,233,143, 1, -209,187,118,159,172,215, 33,227,199,197,181,214, 20,197,242,214,212, 55, 86, 35, 96,157, 27,151, 7, 91, 13, 0,205,189,170, 31, -248, 14, 15,148,186,170,236, 29,209,216, 40,118,175,188,191,182, 60, 47,238,126, 84, 87, 87, 83, 88,210, 92, 45,194, 77,223,201, - 20, 0, 14,109,248,132, 36, 61,243,218, 71, 79,166,229,127,246,226,244,195,189,140, 26, 18, 19, 34,224,135,129, 16,173,159,132, - 95,217,167, 71, 64,129,187,178,147,146,146, 72, 70, 70,134,199,235,205,223, 46,242,188, 87, 34, 0,119,159,241, 96,137, 13,253, - 13,186, 87,148,213, 97,246,199, 61,186, 27, 32, 25, 48, 96,192,223, 99,136,172, 23, 94,120, 1, 62, 15,240, 17, 17,112,156, 69, - 71,215,233,188,221,223, 11, 47,254,182,250,192,251, 8,188,240,226,239, 3,214, 12,168,180, 54,210,247,146,191, 23, 94,252,157, -193,120, 31,129, 23, 94,120,225,133, 23, 94,120, 13, 0, 47,188,240,194, 11, 47,188,240,194,107, 0,120,225,133, 23, 94,120,225, -133, 23,127, 69, 52, 24, 3, 48,115,230, 76,143, 71,110, 54,182,182,118, 99,242,126,252,254,127, 9,125,250,117,149,183,109, 31, -149,168,214,105,228, 7,228,121,137,201,211, 94,200,241, 84,222,138,175,182, 36, 12,232, 55, 76,126,179,180, 20,190, 18, 95, 92, - 47, 41, 76,124,238,153, 73, 30,203,107,237,251, 61,123, 96,102,194,240, 97,157,229, 18, 95, 30,248, 60, 6, 68, 76, 80,166,122, -153,120, 42,239,228,205,126, 9, 67,134, 13,145, 7,250,241, 0, 62, 80,115,122, 13,113,181,124,177, 15,198,122,124,191,151,126, -190,116,139,188,161, 67,135,122, 44,239,232,209,163,183,202,139,245,188,124, 71, 47,221, 90,190, 97,221,186,121, 44,239, 72, 65, -193, 61, 39,239,193,102,234,119,241,226, 12, 58,111, 94, 74,147,159,255,220, 72,253,198, 62,244,160,231,237,101,207,207,183,182, -231, 7, 61,111, 47,139,179,170,105, 0, 87,216,224, 92, 88,236,163, 30,203,171,186,244,221, 45,229, 59,245,214, 53,143, 21,233, -192, 69,157,110, 57,247, 81, 88,169,199,242, 94,173,138,194,159,161,175,254,238,242,164, 82, 41,191,177,157, 5,239,197,251,117, -219, 0,104, 10,250, 77,210, 88, 0,157, 97, 89, 39,160, 80, 60, 93,118,213,213, 31,216,242,205,226, 4, 2, 14,225, 65, 33,200, - 59,112, 82,254,245,215,159, 32, 62, 41, 30,172, 70, 43,239,213, 99, 52, 56, 14,242,223, 99,190, 78, 28, 56,176, 31, 46, 95,190, - 6,101,173, 6,125, 71,204,200,105, 74,222,154,111,229, 9, 20, 4,157,186,118,150, 75, 95, 91,136,234, 79,183,224,155,255,125, - 14, 64,140, 93,103, 74,192, 48,144,127,242,222, 59, 40, 40,184,136,232,232, 78, 16, 73,248,184, 81, 82,208,228,226, 34, 87,182, -126, 78,133, 66, 33, 36, 18, 9, 10, 11, 11,209, 46, 34, 0, 97,124, 63,180,235, 24,132, 96, 73, 32,124,137, 25, 12,195,128,114, -102,104, 69,124, 40,111, 42, 81, 49,216,249, 92,114,101,225, 74,234, 47, 81, 98,196,144, 46,240,243,229, 67, 40, 97,192,231, 1, -140,144,143,238, 81,255,163, 38,202,195,149, 27,207,184, 92,225, 43,118,235, 19,162,162,162, 16,127, 95,123,185, 78,111, 0, 35, -146, 0, 38, 32,191, 46, 46, 65,167,213, 96, 88,196,197,156, 63,203,138, 92,179,102, 13, 77, 75, 75,251, 91,205,175,191, 91,225, -140,232, 91,120,189, 47,128, 33,109, 36, 62,255, 45, 45, 45,237, 33, 16,139,192,249,248,124, 0,203,202,152,117,119,203, 51, 40, -252,125,119,194,213,115, 7,110,217,107, 32, 41,229,131,191, 74, 27, 37,223,172, 95,127, 65, 36, 20, 74, 56,142, 11,244,245,243, -243,123,120,226, 68, 31, 88, 86,176,187, 91, 71,118,218,162,205, 92, 75, 5, 73,165,210,128,192,192,192, 57,221,187,119,159, 34, - 18,137,218,151,148,148,148,148,150,150, 30, 53, 26,141,139,100, 50, 89,161, 7,242,130,130,131,131, 23, 62,240,192, 3,227, 94, -120,225,133,232, 47,190,248,226,230,217,179,103, 15,235,245,250, 5, 50,153,236,236,223, 38, 2,208, 4,249,243,124, 69,252, 33, - 79,140,236,178,140,163, 84,127,232,226,205, 79,207,111,146,238, 21, 79,151,157,115,246,221,148,137, 93,233,196, 7, 22,195, 84, - 87, 11,190,153,193,111,231, 46,226,169,167, 94,254,163, 69, 48,192,175,121,235, 16,214, 49, 74,206,213,169, 96,228, 8,246,239, -207, 75, 44,209, 53, 85, 81,139, 40,132,129, 32, 62, 1, 56,121,174, 24,103,206,253, 19, 95,125,247,115,253,231, 28, 7, 60, 52, - 98, 4, 80, 87, 14,192, 31,133,103,207, 67, 16, 22,132,248,225,125,228,181,218,102,108, 22,194, 0,132,193,128,126,113,104,227, - 43, 68,187, 48, 49, 2, 66, 67, 16, 44,242, 71,176,152, 7, 1,143, 7,147,217,140, 90,150,195,177,170, 19, 78, 31,106,249,153, -133, 52, 36, 16, 8,240,241, 65,120, 88, 40, 2, 2,124, 64, 25, 51, 88,174, 14,102,152,225,231,231,131,176, 54,237,209, 57,246, - 23,154,125, 96,100,179, 74,105,117,150,145, 6,250,251,162,115, 76, 4,194,195, 66,161,209,104, 32, 20,137, 33,208, 91, 22,231, -139,137,238, 36,175, 81,212,226,251,188,162,196,226,146, 27, 80,148, 95,195,162, 23,226,154, 53, 6, 50, 22,103,184,172, 36,146, -158, 78, 74, 12,142, 12,206,105,142,252,239,132, 17,240,214,210,165, 20, 0, 22,189,241, 70,171,252,198,252, 37, 75, 40, 0,164, -207,157,235,177,188,159,114,115,159, 50, 26,141,235, 0, 96, 74, 98, 34,227,137,242,149,109,222,108, 89, 35,222,110,218, 52,165, - 20,132,144,250,255,182,115,182,235,210, 82,154, 38,236,121,243, 82,136,171,164,238, 38,249,247,242, 53,177, 91,252,131, 2,123, - 0,128, 80, 34,134, 81,167, 7,167,209, 46, 57,124,240,192,123,247, 79,157,218, 19, 64,177, 51, 33, 6,158,144,194,178,120, 10, -107, 37, 5,206,170,135, 26,213, 69,253,239, 31,135, 11,251,183,187, 85, 71, 87,207, 29,144,119,237,147,144, 24,221,243, 33,247, -141,226,148, 26,183, 46, 79, 77, 77,197,230,148,236,102,175, 73,204,110,184, 21, 73,175, 32,203,173, 86,232, 57,232, 88, 75,189, -106,172,255,101,195,130,208,205, 95,208,172,188,101,203,150,229,188,245,202,235, 17,147,166, 76,246,211,235,117,248,228,163, 15, -153, 21, 43, 86,232,103,207,158, 29, 5,224, 70,107,247,189, 61,123,246, 36,109,219,182, 45, 11,112,111,205,129,188,188, 60, 90, - 84, 84,132,234,234,106,168,213,106,248,251,251, 35, 52, 52, 20,209,209,209, 24, 49, 98,132, 71,253, 78, 42,149,142,142,139,139, - 91,255,218,107,175, 93,238,222,189,251,186,129, 3, 7,158,191,121,243,102,251,188,188,188,184,103,158,121,102,167, 84, 42, 93, - 34,147,201,190,114, 67, 94,226,148, 41, 83, 50, 22, 47, 94, 28,106, 50,153, 32,145, 72,224,235,235,219, 86,163,209, 76,157, 52, -105,210,195, 82,169,116,182, 76, 38,251,223,189, 72,238,167, 79,159,110,112,220,216,134,110,252, 38, 72,191, 3,128, 46,176, 44, - 25,107,214, 24,216,235,121,151, 42, 62, 30, 17, 27,241,242, 3,189,218,190,215, 38, 80,210, 78,190, 73,186, 9,192, 69,241,116, - 89,147,155,212, 24,234,106,208,166,235, 63,176,240,141, 41, 88, 39,251,163, 47, 30, 56,188, 26, 26,173, 1,227,147, 94,198,125, -241, 79,227,209,212, 7, 32,145,136, 96, 52,179, 80,107,141,242,110,195,187, 54,209, 56,174, 1, 70, 96,202,140, 85,120,238,181, -231,235,207, 62,116, 95, 2,196, 98, 17,126,216,255, 51,118,229,230, 97,253,218,207,161,215, 25, 32,228,241,225,231, 35,132,166, -186, 36,177,182, 4,141,238, 62, 70, 41, 5, 40,103,121, 49, 28, 40,165, 48, 24, 69, 22,245, 36, 2,168,209, 12, 51, 15, 48,195, - 12,179,145, 3,107,110,222,128, 45, 60,154, 78,219,135, 83, 4,248,251, 34,170,125, 12,122,244,237, 10,127, 63, 9,148,117,149, - 40,175, 44,135, 66,121, 19, 38, 61,129,143,143, 15,194,195,227, 49,117,242, 89,186,101, 91,247,198,195,248, 27,174, 83,179,191, - 63,116,124, 64, 40, 22, 66,167, 21,194,168, 21, 66, 47, 22,129, 79, 88, 80,240,160,215,213, 65,167, 85,163,125,251,118,114, 33, -143,143, 26,168,240,241,199, 7, 33, 18, 53,223, 56,150,174, 95,234,180, 1,189,241,228, 27,205,126,174, 80, 40,168,195,241,160, -144,144,144, 2, 66,136,158, 82,202, 15, 14, 14,246, 41, 44, 44, 12,205,200,200,200, 73, 75, 75,107,231,105, 67, 22, 70, 70, 78, -175,255, 13, 32, 33, 24,104,181,104,199,154,140, 12, 58,107,214,172, 68, 83, 69,133, 91, 50,127,202,205,149, 14, 29, 58,116,209, -200, 1, 3, 96, 18,137,176,124,249,114,110,234, 3, 15,140,161,148,102,187,229,202, 17,130,101,239,189, 87,127, 60,231,221,119, -177,124,193,130,102,143,157,193,209, 8, 88,188, 56,131, 14, 26, 52, 8,217,217, 87,104, 82, 82,231,222, 0,174, 44, 94,156,161, -115,147,252,243,250,246,238, 29, 96,235, 51,190, 98, 9,202, 42, 43,160, 82,212, 34,110,232, 48,159,159,190, 90,155, 61,225,153, -127,246,134,101,243,130,230,192,190,180,104, 5,255,241,169, 15,243, 99,163,163, 57,155,103,248,238,242,207, 26, 92,180, 96,206, -139, 22,195,239,149,217,137, 79, 78, 28,227,118,189,122, 68,254,245, 22,114,136, 27, 23, 39,185, 37,218,151, 79,112,102,193,179, - 32, 1, 97, 48, 95, 57, 3,195,149,223, 81, 80,163,193,224,221, 21, 46,125,127,181, 76,118,232, 53,233,172, 78, 79,254,235,153, -160,140, 13,223,113,209,209,209,204,194,197, 75,224,255,222, 66,252,240,195, 15,165,143, 60,242,136, 71,134,104, 19,196, 63,102, -219,182,109,123,109,199,147, 39, 79, 30,235,202,247,212,106,117,194,222,189,123,229, 38,147, 9, 93,186,116,193,168, 81,163, 16, - 24, 24,136,218,218, 90,220,184,113, 3, 87,175, 94,197,141, 27, 55,232,216,177, 99, 19,253,253,253, 93,174, 39,169, 84, 58,249, -129, 7, 30,248,100,217,178,101,155, 6, 14, 28,248,137,205,216,105,215,174, 29,166, 78,157, 74,146,147,147,253, 0,228, 73,165, -210,188,166,118, 47,117,148, 55,123,246,236,204, 89,179,102, 49, 39, 78,156, 0, 33, 4,161,161,161,245,175,221,187,119, 11,135, - 15, 31,254,185, 84, 42, 61,226,138,188,187,153,252,109,231, 28,239,131,223, 8,249,135, 14,142, 9,125,114, 64,167,144, 25,132, - 16, 1,165,212,196, 89, 94, 70,179, 73,175, 19, 50, 92,187,190,109,196,111,132, 5,116,233,186,237,216,213,239,244,155,164,135, -196,211,101,101,205,168,111,244,234,217, 29, 12,147,131,130,218,106, 0,231,161, 44,189, 4,129, 88,132,237, 59, 63,133,182,202, -140, 25,255,124, 21, 28, 7, 76,124,120, 4,204,124, 63,167, 55, 87, 80,112, 30, 28, 7,140,239, 79, 0,180, 3,208, 9,122,131, - 17,201, 15,141,133, 56,136,193,250,141,123,192, 48, 64,230,119,235, 80,122,229,247,196, 71, 18, 98,115, 46,158,106, 92, 22, 71, - 1,142,227,192,113, 28,204,102, 51, 12, 2, 10, 19, 49,193,104, 52, 66,235,163, 7, 56, 49, 24,106,134, 89, 72, 81,103,212, 67, -163, 82, 54, 91,182,112, 63, 3,248,124, 9, 66, 67, 67,209,181,107, 87, 68,182, 25, 6,240, 24,152,205, 39,192,208, 90,232, 53, - 44,204,156, 6,229, 55,106, 16, 30, 90,133,208,160,120, 40,212,243, 19, 26,219,228, 69,162,103, 65, 13, 85,128, 94, 4, 35, 99, -130, 70,200, 71,157, 68, 0,190, 64, 8,112,190, 32, 60,130, 58,141, 22,138,242,107, 40, 60,145,139,154,226, 98,112, 28, 7,134, -242, 60,106, 52, 95,173,250,195,112,126,102,230, 51,206,245,164,117, 95,119, 91,211,201,200,200,152,247,218,107,175, 61, 95, 92, - 92,204, 16, 66,194,101, 50,217,119,176,108,238,228,211,130,182, 44, 88,185,114,229,198,155, 55,111, 34, 51, 51, 19,131,187,119, -231, 5,247,237,219,226, 14,146, 62,119, 46, 81, 0, 9,148, 82,249,138, 21, 43,228, 0, 32, 77, 77,117,217, 43, 49, 26,141,171, - 71, 90, 59,147, 80, 40, 68,183,110,221,176,101,255,254, 44,107, 52,192,101, 57,183,107,171,218,121,243, 82, 72,118,246, 21,122, -226,132, 37, 98,101,247,255,247,251,239,191,191,116,222,188,148, 64, 87, 57,203,215,196,110,233,219,187,119, 0,143, 97,240,194, -227, 51,160,211, 27,176,252,203, 47,225, 35,145, 64,175,215, 67,175,211,161,255,192, 1,177, 63,111,216, 48,235,193, 25, 51, 62, -118, 22,117, 92, 48,231, 69, 14, 0,115,169,168,136,113, 36,124,199,238,233,201,189,119,232, 49, 58, 49, 59,227, 77, 58,102,226, -179,137, 84, 20,235,145, 33, 96,191,107, 31,221, 28,236,244,188, 83, 11, 42,136,143,107,117,102, 28, 24, 19, 14,193,203, 50,168, -102,196,128, 31, 28,225, 22,249,239,219,183,175, 60,186,109,187, 27,255,122,225,249, 14,111,190, 58, 23, 43,214,174, 62, 55, 52, - 46,174,243,234,207, 86,251,188, 50,247,117,108, 24, 49, 12, 27, 55,110,124,226,177,199, 30, 91,223, 66,226, 79,216,182,109, 91, -189,195,100, 13,171,191, 4,203, 86,233, 78,177,119,239, 94,121,120,120, 56, 6, 14, 28,200, 50, 12,195,183, 68,103, 57, 8, 4, - 2,132,132,132,160, 77,155, 54,184,122,245, 42,246,238,221, 43,159, 58,117,170, 75,125, 69, 42,149,166, 76,152, 48,225,195,101, -203,150,125,214,189,123,247, 85,132, 16, 14,192,231, 0, 30, 4,112, 16,192, 2, 74,105, 17, 33,228,117, 0, 11, 92,145,183,108, -246,236,239, 71,166,164,144, 29, 59,118,128,207,231, 67, 46,151,227,204,153, 51,232,218,181, 43,222,127,255,125,244,233,211, 7, -207, 63,255, 60,255,237,183,223, 94,118, 47,146,127,218,188, 15,254,112,116, 22,191,217,168, 17,208,216, 44, 0,134,207, 99,248, - 44, 71,213, 58, 19,123,131, 16, 34,242, 19,241,250, 5, 8, 49, 88,210,251,254, 46, 72,124, 14,232, 49, 10,109,125,233,228, 39, -226, 99,222, 12, 9,240, 25,163,223, 36,109, 70,153,112,224,241,108,132, 20, 0,160, 61, 2,163, 38, 64,103,214, 99,149,108, 45, -190,217,152,137,177,137,241, 0, 0,173, 22,224,241,155, 22, 37,241,233, 14, 0, 48,155,237,247,166, 41, 7,144, 7,134, 39,194, -147, 79, 61,139,228,212, 84,252,180,211, 66,100, 62,190,128,166,174,172,217,135,101, 2,175,158,252, 77,172, 25, 6,149, 9,218, - 90, 45,106, 77, 70,212,104,141, 80, 24,212,168, 85,215, 65, 81,161, 70, 77,173, 30, 53,117, 77, 47,161,126, 70,190,152, 18, 66, -192,227, 17, 16, 70, 4,179,153,130,213, 22, 67, 83,123, 9,165,229, 74,212, 40,234,160, 84,155, 81,163,208,163,164,164, 28,231, - 46,156, 70,173,242, 52,134,197, 13,106,114,111,116, 30, 0, 70,173,135,238,242, 13, 84,255,118, 30,213,197,215,160, 82,214, 64, -165,172,193,181,115, 39,112, 56,227, 43,228,109, 94,143,202,203,151, 97, 54,114,150,133,177,121,119, 38, 13,152,150,150, 70,172, - 97,127, 99,114,114,114,207,133, 11, 23,190,214,182,109, 91, 77,102,102,102,191,140,140,140, 31, 1, 12,180, 86,186,199, 11, 78, - 9, 35, 35,231, 0,192,240, 62,125, 48,107,214,172,138, 99, 23, 46,100,159, 58,123, 54,161, 53,202, 31, 12,228, 72, 83, 83,201, -236,217,179, 19, 1, 64, 16, 17,225,150, 92,147, 53,204,178,101,203, 22, 68, 68, 68,224,205,217,179, 49,103,206, 28,108,149,203, -239,138, 60,172,141,244,101, 50, 89,253, 11, 0, 14, 28, 56, 16, 5,224, 97, 23,197, 12, 9, 10, 14,238,193, 99, 24,252, 51, 57, - 25,181, 74, 21, 74,202,110, 64, 32,224,131,207,183,188, 4, 2, 1, 68, 18, 31,116,137,142,254,232,242,241, 19, 46,109,230,115, -169,168, 8,223,110,249,177,254,101,195,187,203, 63,195,187,203, 63,195, 46,249, 1, 15,238, 88,157, 0, 0,221,251,142,207, 73, -154,248,108, 98,214,142, 47,229,217, 25,111,222, 21,117,145,255,245,199,168,120, 46, 14,247,103, 85,162, 87, 16, 31,188,128, 16, -176,138, 10, 12,222, 93, 1, 95,190,133, 3,121, 78,230,100, 93,189,124,185,122,141,236,127,221,191,254,223,215,248,244,203,207, -175,125,190,236,195,119, 95,123,241,165,135, 23, 46, 90, 8,137,191, 47, 70, 13,143,199,177,163,199,190, 62,148,123,200,227,123, -118, 36,255, 29, 59,118, 96,200,144, 33, 93, 0,204,112, 53,236,111, 50,153, 16, 23, 23,199,153,205,102,190, 82,169,132,193, 96, -128,193, 96,192,133, 11, 23, 32,151,203,145,155,155,139,182,109,219,194,100, 50, 33, 47, 47,207,105, 89,165, 82,233,244,212,212, -212,143,167, 76,153, 18,176,106,213,170, 0, 66,136, 16,192, 1, 0, 74, 0,113, 0,126, 4, 96, 51, 60,247, 1,232,227, 76,222, -182,215, 94,251,254,225,254,253,201,134,228,100,148,158, 58,133, 15, 63,252,144,251,233,167,159,254,223,245,235,215, 35,228,114, -249,115,243,230,205,131,201,100, 66,124,124, 60,124,125,125, 71,224, 30,135,189, 49,208,128,236, 29, 79,136,167,203, 42,127,189, - 92,185,122,221,193,203,175, 94, 40, 85,238,101, 64,249, 0, 5, 38,188,143, 95, 7,125,136,255, 42,146,177,191,247, 18,224,193, -249,240, 23,112, 3, 31, 26, 16, 61,195,154, 46,184, 5, 59,246,215, 16, 64,133, 73, 79,189, 12,142, 3,128, 26, 88,150, 77, 54, -161, 83,247, 56,136, 69,124,152, 89, 3,168,209, 66,170,254,254,254,168,174, 81, 52,121, 19, 31,127,244, 26, 1,128,115,191,126, - 9,134,105,232, 36,112,186,223,161, 55,152,192, 19,136, 65,132,150, 28,154, 90,165,194,136, 17,205,215, 29,159, 51,130,227, 56, -176, 44, 11,131,193,128, 58,142,133,210,104,130,170, 76, 5,229, 13, 37, 84,229, 53,168, 81,213,162, 92,175,133, 74, 83,139, 90, - 67,211, 99,157,252,253, 52, 96, 89, 14, 6,163, 25,181, 74, 21, 10, 46, 23,227,232,137,124,252,122, 52, 31,231, 47, 20,162,228, -122, 21,234, 52, 70,168,235, 12, 40, 43, 85,226,236,239, 87,145,151,119, 10, 37,101,229, 77,202,180, 55,117, 88,165, 6, 37,167, -207,227,183,221,251,145,181,246, 35,236,223,180, 22, 37,133,151,193, 81, 19, 56, 66,234,137,223,157,228,154,179, 48,191, 51,240, -249,124, 0,184, 9,224,102,112,112,112,137,191,191,191, 97,222,188,121,199, 96, 25, 48,198,192,178, 86,118,129,167,242, 87,174, - 92,153,158,156,156, 12, 0,136, 9, 15,143,176,230,196,121,173,217, 57,108,225,127, 91, 36,192,133,240,127, 18, 0, 44, 95,190, - 28,151,202,202, 48,101,236, 88,216,162, 1,249,249,249, 0, 96, 51, 2, 92,170,138, 57,239,190,139,215,223,123,175, 62,188,111, -123,111, 59,182,189,119, 37,252,111, 67,118,246, 21,219,214,186, 13,206,219,142,179,179,175,124,235,138,156, 32, 62,255,191,122, -163, 1, 60, 30, 15, 23,174, 20,226, 74,201,117, 28, 57,125, 6, 70,163, 9, 12, 8,248,124, 62, 8, 33,224,204,102,232, 52, 90, -228, 31,200,217,239,130, 88,198,158,244, 31,159,250,240, 45, 30,255,145,147,249,176,143, 16,184, 6,187,112,178, 40, 54,199, 54, -232, 47, 59,227, 77, 42, 96, 47, 37,252,169, 26,184,166, 12,194,142,221, 80, 49,235, 62,228,127,253, 49,248, 97,109,235, 63,170, -152,117, 31,194,196, 12, 2,248,205, 55,151,238,177,221,219,249,248,248,250,124,250,197, 74,125,226,253,247, 11,135,141, 24,190, -225,234,229,171,220,133,203, 5, 0, 71, 33, 22,137, 16, 63, 40, 30, 59,119,236,196,182,109,219,220, 50, 2,246,236,217,147, 32, -149, 74,169,141,252,247,238,221,139,213,171, 87, 27, 1,224,232,209,163, 70,169, 84,250,152, 43,169,133,162,162, 34, 88,183, 38, -102,138,138,138,144,149,149,133,252,252,124,104, 52, 26, 40, 20, 10, 28, 63,126, 28,197,197,197,184,126,253, 58, 58,117,234,132, -162,162,162,102,229,205,156, 57,243,201, 71, 31,125,116,105, 66, 66,130,223,177, 99,199, 2,180, 90,237,191, 36, 18, 73, 14,128, -207,100, 50,217,124,153, 76,166,180, 26, 0, 67, 8, 33, 66, 74,169, 9,205, 76,111,159, 61,123,246,147, 63,204,153,179, 33, 62, - 34,130,176,115,231, 98,132,209,136, 99, 59,118,208,210,210,210,103,101, 50,217,187, 50,153,172, 18,192,186,115,231,206,177, 44, -203,194,207,207, 15, 81, 81, 81,126, 38,147, 9,127, 69, 52,150, 2,136, 4,208,101,242,224,142, 47,116, 8,245,157, 1,147, 14, -232, 62, 6, 39,195, 39,227,129,217, 95, 65, 87, 85, 11, 94,128, 63,228,159, 60,137, 81,189,126, 69, 72,126,214,104, 0, 29,155, -250,129,174, 1,237,241, 91,254, 86, 59,123, 67, 3, 75,154,208, 4,152, 12,224,115, 60, 48,214,126,191,237, 7, 75,186, 41,126, - 92,106,211, 13,245, 44,197, 67, 3,237, 13, 60, 98,189, 13, 1, 32, 16,131, 37,102, 88,253, 96, 76,155,241, 18, 0,200,175, 29, - 94,211,100,207, 50,115, 20, 44,199,128, 97, 89, 48, 70, 3,180, 86,203, 66,199,227,193,151,213, 65,165,163, 32, 2, 2,179,217, - 12,173, 25,168,208, 24,209, 84, 50,155, 53,114,208, 11,120,224,180, 44, 88, 78, 9,117,157, 9, 60, 34,128,129, 53,193, 72,141, - 96, 77, 70, 64,200,129, 33, 0, 17,113, 80,234,204, 40,175,212, 66, 99, 96, 27,117,146, 25, 98,174, 55, 0, 8,249,131, 79, 76, -122, 29,148, 53, 53, 96, 8, 15,124, 62, 5, 40, 31, 60,226,121,226,239,226,181,139,198,238,157,186, 11, 93, 9,251, 55, 8,147, - 18, 2,137, 68, 2, 0, 58, 0, 70, 62,159,143, 43, 87,174, 96,241,226,197, 15, 3,184, 62,111,222,188,129,129,129,129, 65, 74, -165,242, 90,109,109,173,219,225,110, 97,100,228, 51, 0,208,166, 77, 27,251, 14, 92,251,217,103,159,101, 3, 72, 26,216,183,239, -190,214,234, 8,179,103,207, 78,116,197, 0,248, 41, 55, 55, 97,232,208,161, 81, 35, 7, 12, 0,241,247,199,226,197,139, 49,119, -238, 92, 8, 4, 2,152, 20, 10, 4, 6, 6,226,205,217,179,235,199, 5,184, 50, 56,208, 49,199,239,108, 76, 64, 83, 88,236,198, -224,206, 19, 39, 78,224,196,137, 19,245,215, 55,149,227, 84,212,212,244,240,243,247, 71,149, 66, 1,249,145, 35,224, 51, 60, 24, - 76, 38,104,117, 58,112, 28, 87, 63, 88,145, 53, 25, 97, 52, 24, 92,169, 99, 14, 0, 99, 77, 3,112,118, 13, 95,111, 61,143,119, -151,127, 38, 4,128,216,232,232,138,171,231,126,107, 81,189, 38,165,124, 64, 46,156,204, 76,216,189,237, 75,121,107,204, 2,112, - 39,236,223, 32, 44,187,249,127, 24,240,212,171, 16,197,244,179,232,138,170, 50, 20,212, 88, 54,145, 19,141,152,128, 98, 51, 11, -159, 21, 71,154,149,161, 82,169,130, 68, 18, 49,186,198,196,136,175,150, 92,111, 91, 93, 89,141,105,143,207,144,239,218,151,133, - 79, 62, 88,158,185,109,215,142,228,216,152, 88, 60, 57,245, 9,228,157,204,197,182, 45, 91,232,100, 23, 66,236,246, 94,255,222, -189,123, 49,102,204, 24,155,177, 40,188,113,227, 6,158,127,254,121,161,237,246,157,201,170,174,174,198,168, 81,163, 96, 54,155, - 81, 84, 84,132,220,220, 92,244,234,213, 11,129,129,129,232,208,161, 3, 6, 12, 24, 0,134, 97,192, 48, 12,218,182,109, 91, 31, -165,220, 29,174, 51, 0, 0, 32, 0, 73, 68, 65, 84,106,194, 83,239,213,175, 95,191,143, 71,140, 24,193,203,207,207, 15, 48,155, -205,229, 91,182,108, 81,233,116,186,197, 50,153,204,222,128,125, 97,220,184,113,197,187,118,237,138, 33,132,148,161,137, 29,109, -165, 82,233,192,217,137,137,235,134,241,249,164,114,209, 34, 80,147, 9,114, 30,143,203,211,106,159,150,201,100,223,216,219, 29, -239,188,243, 14,159, 97, 24,212,212,212,224,202,149, 43, 21,125,250,244,137,248,203, 27, 0,250, 77,210,216,200, 64,201,200,113, -253,163,158, 15,144, 8,134,178,102, 78,193,167,230, 0, 4,181,229,149,213,234,161,171, 82, 2, 66, 62,204,181,106,148, 40,140, - 64,104, 71, 48,156, 81,220, 92,136,247,178, 74,133,110, 65, 1, 96, 13,192,229,156,111,209, 53,225,193,122, 7,206,100, 52, 65, - 0, 6,117,122,203, 14,181, 15, 37,196, 65, 18, 26,213,108,129, 31,234, 75,176,235, 12,133, 64, 12, 8, 59, 62, 8, 99,241,161, -122,199, 65, 32, 20,193, 4, 61,252, 36,150, 29, 73,119,236,218,132,223,142,230, 36,206, 24, 59,168,105,109,196,113, 16, 26,117, - 48, 65, 8,134, 97, 1,189, 69,177,153, 76, 38, 24,244, 2,240,248, 2, 64, 15, 80,206,146, 34,232, 20, 29,211,164, 44,173,158, - 3,143, 71, 96, 98, 77,208, 27, 56,168,212,150,118,104,226, 40,140, 6, 14,224, 3, 60, 1, 15,124, 49, 64,116,102,112,132, 5, - 7, 29,212, 58,107, 64,218, 9,204, 0, 24, 14,160, 4, 96, 24, 14,132,240,192, 81, 2,134,177,142,165,226, 24,112, 12, 3,194, -185,230, 32,219,121,255, 66, 79, 27,144,143,143, 15,172,222,126,248,149, 43, 87, 42, 22, 47, 94,156, 8,224,145,121,243,230,141, -237,220,185,179, 70,173, 86, 87,179, 44, 91, 79, 20,238,240,255,202,149, 43,191, 76, 78, 78, 70,116, 88, 88,253,201,232,176,176, - 32,107, 20, 32,252,207,232, 48, 70,163, 81,110,243,246,169, 90,141,127,255,251,223, 48, 84, 87,215,143,124,235,106, 53, 86, 4, - 6, 3, 30,126,248,225,138,210,138,138,199,162,124,124, 54,220,137,178,217, 15,234,179,207,255, 55,134, 65,131, 6, 33, 41,169, -115,253,245,141,173, 3, 0, 0,172,193,136, 90, 99, 13,244,122, 61,130, 2, 3, 33, 22,138, 96, 50,179,160,148,194,108, 54,195, -104, 52,194,100, 50,129, 99,205,174,214, 47,119,169,168,136,137,141,142,182,121, 4,220,165,162, 34,230,219, 45, 63,138,237, 35, - 2,177,209,209,181,104,165,193,108, 61,226,146,115, 74, 10,143,183,202, 51,246,116, 12,192,253, 89,149,168,136,206,132,176, 99, - 55,144,152,126,232,180,246, 20,170,244, 28,124,249, 4,198, 95,126,192,197, 43, 87,157,238,159,167, 99,141, 56,145,119, 20, 31, - 47,251, 8,247, 37,140,196, 59,255,239, 61,252,188,251,103,108, 88,255, 13, 70,140, 30,153,220, 33,186, 35,248, 62, 2,236, 59, -180, 15, 27,191,254, 6, 91,127,216,130,157, 59,119,210,255,251,191,255, 35,205,144, 44,117, 36,126, 27,106,107,221,223,224, 78, -173, 86, 35, 48, 48,240, 8,128, 97,209,209,209, 24, 52,104, 16,120, 60, 75,154,181, 83,167, 78, 16,137, 68, 80, 42,149,136,142, -142,134,191,191,255, 53,181, 90,221,169, 41, 89, 50,153,236,156, 84, 42, 77,223,186,117,235,248,216,216,216, 30, 91,182,108,169, - 83, 40, 20, 11,100, 50,217, 70,187,242, 79,190,255,254,251, 95, 91,187,118,237,102, 0, 21, 0, 82, 0,252, 10,160,127, 35,242, - 78, 73,165,210,244,160,227,199,223,122,148,101,241, 17,192,125, 89, 87,247,132,131,188, 71, 94,122,233,165,143,210,210,210,112, -245,234, 85,236,220,185, 19, 44,203,238, 7,240,232,189, 66,234, 3, 6, 12,192,233,211,167,235,243,254,205,134,226, 28,142, 59, - 79, 30,220,113, 97,128, 68, 48,180, 82,165,255,249,240,165,202,197,224,137,128,139,135,240,143,104,138,249, 47, 62,140, 65,189, -163,241,146,116, 28, 38,118, 49, 2,103,247,130, 10, 36, 44,154, 29,172, 83,139,130,218, 98,240, 69,192, 67, 19, 95,197,198, 79, - 63, 0, 96, 4,180, 6,152,117,192, 15,242,211,200, 62,102,153, 81,216,190, 99, 12, 24,190,115,242, 26,223,159,192,164, 7,118, -236,220,131,193, 99, 95,180,120,255, 16,128, 39, 1, 82, 39,164, 96,252,232, 73, 0,128,146,107,133, 96,245,198,230, 45,122, 74, -193, 18, 11,193, 27,140,150,193,127, 6,189, 14, 90,173, 22,117,117,117, 80,171,148, 80,171,213, 80,169,235,160,175,171,131, 78, -167,107,186,241,215, 17,232,244,102,232,244,102,104,180, 38,168,235, 12, 80,168, 13,168, 85, 25,161, 84,155, 80, 91,107,249, 95, - 83,205,162, 70,193,162, 70,201,162,170,198,136,155, 85, 77,151,145,161, 20,102, 0,196, 76, 64, 24, 14,148, 80,128, 82, 80,202, -131,153,251,163,250, 56,171,246,112, 55, 54,222,115, 68, 79,228,238,202,197,207,251,127,174, 55, 10, 46, 94,187,232,210,119,121, - 60, 30,248,150,250,138, 2,208,101,201,146, 37,103, 0,172,120,243,205, 55, 95,233,220,185, 51,107, 9, 18, 88, 10,230, 38,249, - 19, 97,100,228, 54, 0,136,140,140,188,229,195, 89,179,102,177,199, 47, 94,220,212, 90, 99, 1,108,225,127, 87,247,141, 55,217, - 77,177,248,254,251,239,113,185,220,146,194,249, 41, 39,167,193,103, 23, 47, 94,140, 8, 15, 15, 87,252, 25, 74, 32, 41,169, 51, - 99, 85,104,142, 10,191,193,231, 78, 13,188, 0,255, 11,156,217, 12, 85,141, 2, 85, 85, 85,168,174, 85, 64,163,213, 66,163,213, - 66, 93, 87, 7,141, 82, 5,117,109, 45,244, 58, 45,140,122, 61, 56,214,236, 84,231,196, 70, 71,219,116, 6, 7,192,104,159, 14, - 0,128,111,183,252,136,119,151,127, 22, 4, 32,210,221,251, 62,127, 50, 51,193, 49,239, 95,248,251,238,132, 63, 91, 41,151, 77, -139, 70,167,181,167, 64, 98,250,193,112, 32, 19,215,254, 57, 16,190,124,130, 67, 99,194,193, 42, 43, 49,120, 79, 5,156,100, 0, -144,156,156, 76,158,123,121, 38, 46, 95,188,136,188,156, 67, 8,244, 15,196,244,105,211, 17, 20, 26,130,147, 71,143,195, 79, 40, -134,175,175, 47,218, 70,183,195,166,239, 54,225,205,183,223, 66, 93,173,231,187,212,198,197,197,185,253, 29,127,127,127, 40,149, -202, 97, 12,195, 24, 59,116,232,128,161, 67,135,162,119,239,222, 8, 11, 11,131, 88, 44, 70,116,116, 52,250,247,239,143,160,160, - 32,168,213,234, 78,254,254,254,205,202,147,201,100, 75, 15, 28, 56,144,181,126,253,122,129, 66,161,120,199,129,172, 83, 70,141, - 26,245,241,218,181,107,191,138,140,140, 92, 68, 8,241, 3,240, 38,128,119,155,145,247,246, 66,181,122,233,179, 44,107,254, 82, -167,123,204, 65, 94,242,163,210,255,108,125,241,149, 57,188,139, 23, 47,226,200,145, 35, 88,187,118,109, 29,128,249,247,154,103, -239, 24,209,107, 42,194,231,168, 4, 68, 60,134,248, 23, 87,107, 54,108,202,187, 58,255,244,181,154,163, 58, 51,185,140,170,171, - 16,111,125, 1,139,226,213, 56,190, 96, 40, 62, 73,172,131,239, 15,179,128,154, 18,212, 81,241, 89,171,229,213, 4,254, 24,213, -127, 38,255, 71,252,231, 63,235,209, 53,160, 47,126, 63,124, 6,123,229,231,241,255,217,251,242,248,166,170,244,253,231,220, 36, -109,218, 2, 93,216,119, 40, 82,118, 89,138,208,130,208, 4, 82,168, 32, 42,218, 2,194,136,157,130, 77,113, 28, 65,196, 65, 69, -197, 13,149,249, 89,192,113,161, 41, 35, 95,112, 6, 6,104,113, 97,147, 37,144, 84,150,150, 90,112, 97, 17, 40, 20, 40,148,165, -208,164, 91,246,228,158,223, 31,201, 13,105, 73,147,155,180, 8,104,158,207, 39,144,187,244,205,185,247,158,123,158,247,125,207, -123,222, 87, 26,223, 15,137,163,236, 29,141, 10,132, 48,219,248, 95,100,210,224,222,120,255,255,125,132,157,199,170,209,172, 91, - 95, 60,250,232, 36,236,218,247, 13,182,239,250,159,253,226,108, 22, 4,139, 60,143,115,148,181,193,198,218,173, 25, 56,172, 25, -179,217, 12,163,209, 8,131,193, 0,157,222, 0,131, 94, 7,131, 94, 7,189,201, 8,179,201,216,176,251,203,208, 28, 85,181, 54, - 84, 27, 88, 84, 27, 88,251,247, 26, 22,181, 58, 43,106,245, 86,104, 53, 54, 84,104, 44,168,208, 90, 80, 81, 97,193,205,155,102, - 92,191,105,241,168, 0,220,114,255,187,180,153,115,223, 8, 40, 4,132,128,214,139,250,167,196, 59,217,190, 50,243, 21,244,137, -239,227,220, 86,174, 81, 58, 61, 2, 7,119, 28,196,233,139,167,121, 37,123, 98, 89,251,111,229,230,230, 30,160,148,246, 79, 78, - 78,158,217,189,123,247,214, 0, 24,150,101,131, 45, 22, 75,164,213,106,109,225, 70, 1, 96, 61,184,254, 23,127,254,249,231, 19, -146,147,147,209,189,117,107, 94, 83, 87,141, 1, 23,252, 55,180,119,111,175, 1,108, 61,219,181,147,102,102,102,226,196,197,139, -213, 95,239,222,141, 83,167, 78, 57,173,254, 94,189,122,193,113,204,252,245,238,221,184,120,241, 34, 78, 23, 21, 25,188,201,188, - 19, 49, 0, 0,104, 66, 66,194,243,174,164,207,253, 31, 27, 27,203,203,157, 11, 0,197,167,206, 21, 89,173, 86,152,205, 38,104, -174,151,227,198,213,107,184,121,237, 58,110, 94,187, 14, 77,249, 13, 84, 86, 84,192,164,211,217,227,103, 42, 43, 49, 88, 38,243, -118, 15,173,139, 51, 63, 21, 46,206,252, 84, 8,160, 26, 0, 59,124,200,131,183,157,228, 18, 23,192, 27, 39,143,230, 74,202,206, - 21,169, 6, 14,187,213,134,243,103, 15, 73, 42,111,148,168, 26,211, 63,200, 20,109, 29,203,223, 31,156,209,232, 80, 58,251, 33, -208,243,191,162,205,170,163, 8, 91,121, 4, 87,167,118, 67,236,206,114, 16, 81, 48,132, 4, 16, 50,222, 21,208,191,189,240, 2, -121,243,163,247,241,226,130,249,176,176, 54,156,186, 80,140, 25, 79, 79, 71,144, 88,140,239,190,221, 2, 88,108, 48, 25, 77,216, - 95,116, 8, 6, 67, 45,210, 83, 83,243,138,138,138,168, 7, 66, 36,147, 39, 79,150,142, 27, 55, 14,132, 16,236,217,179,231, 54, -151,254, 43,175,240,143, 19,106,217,178, 37,174, 92,185, 2, 0,194,172,172, 44,220,184,113, 3, 3, 6, 12, 64, 68, 68, 4, 24, -134, 65, 97, 97, 33, 24,134, 1, 33, 4, 87,174, 92, 65,203,150, 45,189,202, 84, 40, 20, 31,152,205,230,209, 10,133, 98,163, 11, - 89, 63, 61,106,212,168,204,217,179,103, 71,102,101,101,137, 9, 33, 12,128,111, 0, 44, 80, 40, 20,215,189,200,251,199, 97,139, -101,104,125,121,211, 22,126,189,233,169,233,127, 35, 19,230,100, 65,125,248, 36, 50, 51, 51,217,234,234,234, 52,133, 66,113,225, -126,116,239, 15, 26, 52,200,249,225, 53, 5, 0,224,220,255, 14,157,127, 65,163, 51, 29,129, 61,112,171,125,126,241,141,236,209, -189,219, 46, 18,158, 63, 28,133,255,123, 6, 8, 14, 3, 76, 58,128, 82, 88, 4,226,235,251, 79, 92,253, 18, 64,131,217,151,214, -175,251, 66, 58,125,198, 76, 21, 0,232, 88, 11,206, 86,150, 2,176,225,129, 22,221, 33,149, 62,136,182,173,218,161,162,170,218, -238, 43, 48, 91,113,181, 82,135, 62, 30, 46,170, 83,151,120, 92, 46,205,119,188,153, 66, 36, 13,180,199, 0,236, 60,102,193,174, -109,185,184,126,243, 10, 90, 70,216, 87, 18, 68, 4,137,240,224, 80,207,235, 55,205, 16, 34,136,181,194, 6, 1, 88, 66,192,216, - 88,192, 98,133, 77, 36, 4, 8, 3,238,157,100, 41,236,185, 2, 60,224,137,105,175,146,111,255,179,128,134, 6, 81, 8, 69, 46, - 30, 6, 11, 96,165,128,209, 12,216, 76, 54, 16, 66, 64,130, 8,172, 54, 64,103, 2,102,165,254,147,184, 75,229,104,115,209,208, - 88,134, 5,113,184,255,237, 74, 1,129,141,101,192, 8, 28, 43, 5, 0, 80, 1, 5, 40, 63, 47,128, 43,249,187,219, 62,184,227, - 96,119,175, 83, 18, 54, 27, 76, 38, 19,146,147,147,251,229,230,230, 46, 7, 48, 40, 55, 55,119,103,110,110,238,254,228,228,228, - 23,122,244,232, 97, 33,132,180,252,228,147, 79,118,191,250,234,171, 51, 52, 26, 77,158, 7,229,211,217, 39, 23, 44, 88,176,120, -193,130, 5,216,185,115, 39,116,215,111,127,151,187,183,110,141,243,231,207, 3,128,138, 79, 98,160,134,146,254,136,218,180,145, -124,254,249,231, 42, 74, 41,134,246,234, 37, 29, 50, 96,128,218,155,172, 1,125,250,168, 9,195,140, 63,245,227,143,221, 0, 4, - 3,248,151, 37, 56, 24, 34,147, 9, 61,219,183,199,252,249,243,113,240,224,193,165, 49, 49, 49,121,253, 59,118,244, 26,163,224, - 46, 15,128,191, 49, 0,174,224,242, 0,196,197,165,252, 88, 80, 80,126, 80, 46,151, 7, 57,166, 9, 70, 0,200,231,155, 4,168, -219,192,190,175, 27,174, 94, 27,199, 90,109,189,117, 85, 85,168,186,121, 3,132, 48,160,148,133,209,104, 4,165, 20,148, 82,156, - 63,249, 27, 44,102, 19, 30, 24, 26,235,237, 30,186,142, 57, 17, 0,152, 9,210, 4,118,130, 52,161, 78,208,159, 99,138,128, 55, - 78,253,252,181,228,202,185, 34, 21, 0,116,235,218, 21,223,213,243, 2,180,238, 50, 68,122, 55, 7,227,161,223,151,163,232, 17, - 96, 80,172, 12,229,127, 27,129,118, 95, 28,194, 25,141, 14,145, 65, 4, 21, 26, 45,132,132,120,245, 0,112,152, 57,115,102,157, - 51,183,110,221, 74, 39, 76,124, 4,219,182,108,195,166, 77,155,240,246,162, 55,177, 91,189, 23, 2,161, 0, 29, 59,117, 76,168, -170,242,188,116, 57, 41, 41, 73,157,148,148, 68,118,238,220, 41, 25, 55,110, 92,157, 88,128, 61,123,246,224,236,217,179, 70,133, - 66,209,158, 79,219,186,117,235,134,146,146, 18,244,237,219,215, 58,111,222,188,160, 13, 27, 54, 32, 60, 60, 28,167, 78,157,186, -205,243, 90, 82, 82,130,110, 60,159,179, 66,113, 43,241,156, 92, 46,127,230,161,135, 30,122,247,233,167,159, 14, 47, 42, 42,106, -110, 52, 26,255, 26, 18, 18,242,168,193, 96,248, 88,161, 80,124,199, 83,222,207,174,242, 30,253,251,134,181, 15,143,157, 76,254, -169, 4, 72,135,199,240,193,138,215,169,166,248, 84,154, 66,161,200,193, 31, 24,117, 20, 0,241,211,138, 19,154,255,201,207,136, -159, 86,112, 83,154,165,199,255, 39,255,190,198,104,213, 13,127,160,213,132,168, 80,193, 67, 2,147, 49,204, 74,153,154,138, 26, -115, 65,254,217,107,187,202, 52,250, 60,241,211,138,171, 88,185,210,237, 15,212,234, 90,171, 51,254, 54, 71, 10, 64,197, 10,184, -105, 62, 1,206, 86, 95,197, 91, 47,164, 65,175, 55,161,218, 96,143, 1, 48, 51,193, 24,147,228, 57,205,238,155,139, 82,201,206, -237, 67,237, 47,183,141,179,156,173, 72, 26, 64, 48,237,249,101, 8, 13, 13, 70,139, 16,177, 20,128,170,248,248, 81,105,124,127, -207, 9, 65,132,212, 10, 51,177, 43, 1, 32, 4, 54, 74,237,138,128,213,177,220,143, 48, 16,178, 44,172,220,178, 3, 47, 74, 64, -165, 33, 2, 6, 83, 5,130,132,140, 51,205,153,149, 5, 44, 22, 10,139,149,162,214,192,130, 8, 8,108, 32,176,176,183, 92,247, -110, 9,150,101,192, 16, 27,136,141,128, 50,212,233,254, 39, 13, 24,207,156,164, 23, 95,146,146,149, 43, 79,121,180,240,126,203, -255,173,177,125,199, 76, 41,133,193, 96,192,128, 1, 3,174, 70, 71, 71, 79,190,112,225, 66,207, 77,155, 54, 21, 2,120, 60, 55, - 55,247,113,215,147, 63,250,232, 35,245,171,175,190, 42,213,104, 52,222, 8,194,121, 67, 50, 50, 50, 26, 60,233,169,103,159, 5, -224, 91, 98, 32, 46,235, 94,125, 12,235,211, 71, 58,152, 7,249,115,232,223,171,215,110, 87, 79, 70,102,102,230,103,147, 38, 77, -178,158, 62,125, 90,120,241,226, 69,116,107,217, 50,191, 99,104, 40,175, 0,197, 59,145, 7,160, 30,185, 95,207,203,203,115,141, -241, 56,230, 80, 4,248,102, 12,212,133,180,111,247,212,169,189,251,242, 35,194,194, 90, 84,107, 43, 97,181, 90, 65, 29,239,129, -246,122, 57,170,181, 90, 80, 74,249, 88,255,246,151,245, 86,204, 9,227, 88, 14,200, 12, 31,242, 32, 38, 72, 19,156,137,129,138, - 47, 92,224,175, 4,232,127,145, 92, 46, 46,116, 90,249,223,229,124,169, 2,128,214,209, 35,165, 3, 99, 39,169,239,222,240, 74, -111, 87, 2,176, 10,131, 50,222,194, 53,150,197,192, 53,133, 40, 76,106,139,126,219,174, 67, 72,128,230, 34,255,106,179, 77,154, - 52,137,236, 83,239,163, 99, 18,199, 98,203,230,111,241,222,210,143,176,176,170, 10,148,101,177,113,227,102,148,149,149, 61, 10, - 96,155, 87,143,170, 27, 69, 0, 0, 38, 79,158,252, 51,128, 26, 62,109,137,143,143, 39, 87,174, 92,161, 71,143, 30, 13, 26, 50, -100, 8,198,142, 29, 11,149, 74,133, 46, 93,186,192,100, 50, 33, 33, 33, 1,148, 82,246,232,209,163,140, 72, 36,242, 57, 35,160, - 92, 46,239, 27, 30, 30,190,124,234,212,169,162,147, 39, 79,182, 48,153, 76, 13, 5, 6,242,149, 55,184,227,160, 41,107, 7,141, -158, 74,190,204, 3,170, 13,128,249,252, 78, 86, 83,172,170, 31, 24,120,223,128,203, 3,224,106,249,187,219,231,214,149,234, 66, -254,220,246,111, 23,255, 39, 47,189,120,179, 54, 31, 64,123,199,203,107, 2, 80, 6,160, 68,252,180,194,171,139,115,200,192,199, -212, 39,126, 45,149,218,104, 51,149,235,203, 81,171,171,182,175,251,103, 66,241,143,143,249,167,152, 76,154,216,159,188, 63,231, - 81, 9, 24,189,202,149, 11,155, 53, 11,135,205,162, 5,168, 14, 23, 15,101,147,153,211,146,188,202,178, 64, 0, 80,106, 39,106, - 8, 16, 68, 29,138,128,131,252,237, 57, 0, 1,216,248,205, 77,164,166,191, 65,178, 63,125,155, 90, 45, 26, 8, 29, 11,123, 41, -165,176, 89, 41,140, 22,160,186,198, 10, 11, 40,172,148,129, 80, 68,176,228,221,207, 26,188,238,217,179,237, 65, 90,107,215,156, -165,196, 98,183,254, 41, 0, 74, 9, 64, 29, 22, 3, 21,128, 8, 88,176,172, 16, 47, 47, 24,199,235, 30,206,126,111,182,244,194, -185, 11,158, 8, 88, 4,251, 82, 13, 79,236,196, 2,128,201,100,130, 86,171,213,134,135,135, 35, 54, 54,246,151, 97,195,134, 5, -223,184,113, 3,231,206,157,179, 47, 15, 99, 89,201,230,205,155, 85, 14, 37, 64,197, 67, 9,176,164, 36, 37,165,116, 27, 48,192, -246, 80,239,222, 58, 71, 31, 53,161,238,138, 72,164, 36,217,159,109, 55, 30, 73,129, 94,121,229, 21, 41, 0, 12,237,213,235,182, - 99,177, 3, 7, 54,138, 32, 6,244,233,243, 5,195, 48,182, 83, 63,254, 24,214,182,109,219,155,253, 71,140, 88,123, 55, 95,126, - 55,164,174,139,141,141,117,141,182,118,174, 99,245, 65, 9, 56, 57,120,236,152,225, 91,254,253,229,230,232,238,221,250,154, 76, - 70,216, 44, 86,176, 44,139,230,145,145,168,210,104, 48, 88, 38,147,242,176,254, 1,160,242,157,151,255,222, 6,128,185,248,194, -133, 32,110,254,255,240,209, 95, 49, 65,154,192, 46,206,252,212, 91,114, 32, 39, 98,218,107,233,169,211,167,164,251,118,125, 87, -199,197, 63,102,252,227, 82,166, 69,124,163,158,107, 67, 1,126,238,247,243,231,176,161,223,151, 3,223,191,224,220,126,224,187, - 91, 75,128,171, 44, 54,191,219, 59, 70, 50,134,124, 85,250,213, 35,227, 38, 38,237,120,238,153, 89, 7, 30, 28, 56,224,225, 45, -223,109, 69,254,207, 71,144,158,158,190,125,101, 3, 6,154, 23, 69, 96,214, 55,223,124,243,239,111,190,249, 38, 46, 41, 41,137, -119,227,198,141, 27, 55,102,247,238,221,251,182,109,219,134,232,232,104, 36, 38, 38, 34, 60, 60,252, 76, 85, 85, 85,204,137, 19, - 39, 80, 82, 82,194,136, 68, 34,140, 27, 55, 78,230,235,117, 58, 2, 3,151,110,221,186,181,193,192, 64, 31,229,253, 36,151,203, - 63,252, 54,247,177,215, 13, 29,103,192,240,227, 27,236,149,253, 75,158,241, 87,222,189,168, 8,240,246, 0, 52, 4,241,211, 10, - 29,128, 95, 29, 31,191,240,204, 51, 47,168, 51, 50, 94,149,102, 41,222, 83,117,236,218, 19,128, 9,162, 96, 49, 46, 95,173, 70, -194,164,153,196,119,121,143,169, 31,232, 29,131, 53,171,191, 6,216,139, 0,132,176, 26, 13,232,216, 62, 92,218,165,133,149,255, -203,111, 99, 33,100, 88, 88,136, 16, 34,106,189,165, 8,192, 10, 80, 27,248, 6,134,185, 34,253,239,111, 19, 0, 88,252,218, 28, - 42, 18,218,173,125, 43,107,119,153, 87,214, 80,216,172,128, 64,200,226,139,207,249, 41, 61,207,166,218, 83, 35,175,254,242, 52, - 5,151, 19,158, 1, 88, 98,119,247,207, 95,240,168, 79,141,172,170,173, 82, 71,182,141,108,108,255, 98, 0,251, 42, 10,131,193, - 0,155,205,134,234,234,106, 8, 4, 2,216,108, 54,180,107,215, 14, 22,139, 5, 10,133, 66, 85,207, 19,160,242, 86, 51, 96,240, -128, 1,185, 0,208, 20, 25,255, 0, 32,138, 16, 53, 0, 68, 13, 28,120, 71,204,188,126,189,122,101, 53, 70,192,203,139, 23,215, - 89, 37,177,224,237,183,235,120, 6,124,153,251,119, 67,230, 58, 79,171, 1,124, 72, 7,124,234,177,217,179,250, 3, 16,156,202, -203,179, 24,245, 6,176, 54, 27,250,196,198, 74,219,199,244, 69,183,129,125,249,189,115,148, 76,221,245,253,118,231,230,136,190, -209,206,239,187,190,223,126,219,182,167,208,248, 51, 87, 35, 9,211, 34, 30, 99,199, 19,233,201, 83,231,112,245,226, 49, 21, 0, -236,219,245,157,170,109,151,115,210, 1,195,255,226,179, 18, 48,101,202, 20,248,154,222,215, 70, 60,231,221, 46,157,220, 14,223, - 95, 49,222,241, 1,127,230,204,153,223, 3, 96,138,138,138,216,189, 5,121,104,217,170, 37, 26, 83,159, 35, 41, 41,233,203,164, -164,164,175,224, 61,189,115, 29, 52,111,222, 92,245,212, 83, 79,145,252,252,124,122,238,220, 57, 20, 22, 22,162,166,166, 38,166, - 41,106, 1, 56, 72,251,255,201,229,114, 81,126,126,254, 0,179,217,252,134,235, 92,190,159,242, 22,201,229,127, 17,133,247,248, -106,126,213,185,221, 51, 26, 43,239,110,131, 91, 5,224,110,191, 95, 10,128,175, 83, 9, 13,186,170,158,124, 86,189,125,215, 89, -242,196,196, 80,218,166, 99,103,104,106,172, 72,152,248,140,223, 29, 33,254,161,222, 36,254,161,215, 33,151,191, 69,129,235,136, -108, 46, 68,151, 40,214,167,151,126,232, 95, 23,220,177, 2, 54,239,124,184,146, 0,192,220,121, 47, 80,179,193, 2, 22,246,101, -115,203, 63, 95,238,215,111,166,205,178,215, 12, 88,253,239, 83,148,165, 2,188,246,234,227,119,179,186, 89,144,171, 27,219,100, - 50,193,108, 54, 59,137,140, 35,176, 64,149, 64, 47, 46, 72, 31,210, 15,251, 9,243,194,133, 41,193, 14, 15,138,173,145,178, 40, - 0,107,239,132,132, 58,109,238,214,190, 29,111, 1,193,172, 73,253,236, 36,159, 13, 63,212, 47, 5, 92,199,254,110, 17,167,238, - 55, 44, 14,253,134,161,209,247,210, 91, 97,159,250, 58,176,149, 4,195,192,120, 94,145,122,174,198,138,152,230,124,134,200, 38, -233, 10,116,232,208,161, 77,217,167,252,206,128, 19, 31, 31, 79,188, 37, 98,107, 4,105,127, 32,151,203,191,117,141, 13,104,164, -188,127,200,229,242,245,174,177, 1,247,187, 18,192, 7,100,208,160, 65, 20, 1, 4,208, 72,244,236,217, 19,197,197,197,129, 27, - 17, 64, 0, 1, 4,112,159,128, 9,220,130, 0,154, 2, 1,242, 15, 32,128, 0, 2, 8, 40, 0, 1, 4, 16, 64, 0, 1, 4, 16, - 64, 64, 1, 8, 32,128, 0, 2, 8, 32,128, 0, 2, 10, 64, 0, 1, 4, 16, 64, 0, 1, 4,112,215, 81, 39, 52,117,206,156, 57, -126, 71,143,186,203,100, 23,144, 23,144, 23,144,119,111,200,147,203,229, 84,161,104,120,217,105,224,254, 5,228, 5,228,253,177, -228,249,172, 0,112, 3,133,175, 66, 60, 13, 44, 77, 45, 47,128,123, 19,222, 8, 38,128,123,243, 57,248,120,126, 24,128,135, 14, - 28, 56,176, 68, 32, 16,140, 8, 14, 14,134, 94,175, 63,244,240,195, 15, 47, 2, 80, 8, 64,127, 47,220, 3,165, 82, 41,201,201, -201, 81,253, 17,199,149,227,199,143,163,176,176,208,235,121, 5, 5, 5,244,248,241,227,200,206,206, 38,253,251,247,111,180, 60, - 14,195,134, 13,131, 39,121, 1,220,199, 30, 0, 14,190,164, 39,229,147, 40,199,157,188,134,202,195,250,147,120,231,143, 62,160, -243, 61,119,252,248,241,210, 39,159,124, 82,205, 87,102,199,142,183,151, 94, 46, 43, 43,171,179,157,146,146, 2,153, 76, 70,248, -200,187,147, 74,192,248,241,227, 41, 0,236,218,181,139,220, 11,242,116, 58,221,216,205,155, 55, 43,207,156, 57, 3, 0,136,142, -142,126, 44, 45, 45,109,171,191,207,215,181,223, 83, 74,157,239, 7,183,159,123, 87, 8, 33,200,202,202, 34,158,148,103,190,207, -193,199,231,213,247,248,241,227,155,171,171,171,123,119,237,218, 21, 55,111,222,132,209,104, 4,128, 17,155, 55,111, 86,133,133, -133,157, 74, 74, 74,122, 2,128,199, 82,146, 35, 71,142,244,201, 32, 56,120,240,160, 20, 60, 83, 61,115,200,201,201, 81,165,164, -164, 72,101, 50,153,218,215,231,145,158,158,238, 83,251,166, 76,153,194,251,253,224,208,181,171,189, 2,110, 77, 77, 13, 76, 38, - 19,215,159,120,189,111,133,133,133,248,207,127, 60,103,168, 53,153, 76,116,196,136, 17,232,211,167, 15,214,173, 91, 87,110, 50, -153,186, 52,180, 46,188,176,176, 16, 51,102,204,224,117,173,215,175, 95,199,146, 37, 75,160, 80, 40, 2, 3,243,125,128,250,201, -128,238,100, 34,160,128, 21,123, 7,241, 93,150,247,148,198, 79,204,217,233,147, 76,149,234,150,129,116,230,204, 25,132,133,133, - 57, 7, 33,151,251,193,199,218,162,245,183,235, 15, 96, 74,165,146,230,228,228,248,109,129,173, 95,191, 94, 50,126,252,248, 6, -229, 55, 6, 25, 25, 25,116,244,232,209,210,233,211,167,251, 68, 22,155, 55,111, 86,182,105,211, 6, 51,103,206,132, 86,171,101, - 51, 51, 51,183,104,181,218,105,145,145,145, 62,101, 17, 35,132,224,251,239,191,119,110, 39, 37, 37, 97,231,206,157, 30,183,189, -161,190, 18, 32,151,203,105,108,108, 44,178,179,179, 41,151,152,201, 87,242,175,170,170,202,239,209,163, 71, 11, 0, 16,139,197, - 8, 9, 9, 65,121,121, 57, 42, 43, 43, 17, 30, 30,142,242,242,242,222, 59,119,238, 44, 76, 74, 74,234, 5,224,154, 39, 97,253, -251,247, 71, 74, 74, 10,162,163,111,101,253, 91,186,116,105,157,115, 22, 46, 92,200, 89,178,170,233,211,167,251,252,188,253, 33, -127, 14, 43, 86,172,104,232,144,179, 86,129,191, 8, 11, 11,195,201,147, 39, 33, 18,137, 96, 54,155,177,115,231, 78, 20, 23, 23, -227,181,215,124,171, 56,123,189, 94,145,172,199, 30,123, 76, 0, 64,246,195, 15, 63,236, 76, 72, 72,184,254,196, 19, 79,180, 85, - 42,149, 16, 8, 4,173, 35, 34, 34, 4,190,200,106, 8, 23, 46, 92, 8,144,196,125, 74,254,220, 62,175,181, 0,238, 87,172, 94, -189, 90,146,150,150,166,110,172,156,251,197,149,221,113,232,251,183,172,246,162, 55,252,146,161,213,106,161,215,235,157, 22, 72, -118,118,182,171, 37,196,215,218,186,109, 91, 38,147, 97,207,158, 61,148, 16,114,219,113,127,240,195, 15, 63,168, 94,121,229, 21, -228,230,230, 34, 57, 57,185, 73,238,223,174, 93,187,200,222,189,123, 41,165, 20,121,121,121,170,188,188, 60,159, 20,148, 51,103, -206, 96,230,204,153, 44, 0, 38, 40, 40,136,137,137,137, 65,102,102,230, 6, 0, 27,162,163,163, 39,166,165,165,237,224, 35,231, - 78, 20, 3,226,148,128,236,236,108,202,165, 1,230,254,151,203,229, 52, 37, 37,197,151,107, 13,211,106,181,155,197, 98,113, 11, - 0,248,219,223,254, 6,163,209,136,172,172, 44,132,132,132, 56,203,102, 11, 4, 2, 84, 85, 85,181, 0,144, 9,224, 47,158, 4, -114,228, 94, 82, 82,114,219,190,166, 64, 74, 74,138,212,113,157, 82,127, 21,129,151, 94,122,201,249,125,249,242,229,220, 87,166, -222,126,222, 10, 1,231, 53,121,227,141, 55, 16, 22, 22,134,220,220, 92, 36, 36, 36,248, 69,254,245, 49,106,212, 40,192,158,165, -241,175,207, 60,243, 12,122,246,236,217,118,231,206,157,168,168,168,224, 74,238,154,189,188, 11, 77,221,253, 36, 19, 39, 78, 84, -109,223,190,221,157,247, 70, 50,102,204, 24, 21, 33, 4,123,247,238, 13,184,123,239, 48,249,167, 47,252, 8, 0,144,189,244, 85, -183, 74,192,239,162, 0,100,103,103,187,123,208,180,161,253,254,252,198,225,195,135, 85, 0,164,141, 85, 2,102,204,152,241,167, -153,207,214,235,245,183, 89,253,254, 16, 13, 71, 44,201,201,201, 72, 76, 76, 36, 0,144,155,155,219, 36,109, 92,191,126,189,196, - 97,209,145,242,242,114, 73, 78, 78,142,170,188,188, 92,226,171,197,238, 14, 99,199,142, 37, 99,199,142,197,250,245,235, 37,121, -121,121,170,245,235,215,251, 36, 87,171,213, 90, 35, 35, 35,131, 54,111,222, 12,135, 55,192,168,213,106,153,204,204,204,237, 90, -173,118, 92,100,100,228,158,187,249,124, 57,210,119,237,203,114,185,156,114, 74, 26, 79, 60, 84, 92, 92,220,123,192,128, 1,152, - 53,107, 22,170,170,170, 80, 81, 81, 1,145, 72, 4,161, 80, 8,161, 80, 8,145, 72,132,144,144, 16,104, 52, 26, 40,149,202,233, - 50,153,236,239,222,132,150,148,148,212, 81, 14, 57, 5,128,243, 4,196,198,198,250,210, 70,119,214,191, 52, 39, 39, 71,213, 24, -207,147, 11,172, 13,140,149,188,189, 1, 23, 46, 92, 64, 94, 94, 30, 38, 78,156,136,174, 93,187,162, 85,171, 86,200,203,203,195, -107,175,189,230,244,190, 9, 4, 2,159, 27, 54,106,212, 40, 44, 90,180, 8, 75,150, 44,105,159,150,150, 54,245,233,167,159, 70, - 98, 98, 34, 0, 64, 32, 16,204,108,217,178,229, 86,133, 66, 97,241, 84, 12,104,253,250,245,188,188, 0,101,101,101,152, 54,109, - 26, 63, 3,165, 99, 71,164,167,167,171, 74, 74, 74,160, 84, 42,185,251, 47, 73, 79, 79, 87,113, 10,116, 0,119, 22, 28,249,115, -223, 57, 37,224,119,247, 0, 52, 52,143,237, 79,128,224,157, 86, 2, 38, 76,152,208,104, 79,128, 47,215,229,203,111, 60,245,194, - 46,108,254,108,124,147,220, 43,238, 5,148,203,229,110,231,244, 14, 29, 58,212,104,197,160, 41,158,239, 15, 63,252,160,226,172, -254,233,211,167,171,127,248,225, 7,180,105,211, 70,133, 38, 74,156,206,201,205,203,203, 67, 94, 94,158, 87,119,179, 78,167,155, -176,121,243,230,237, 0,144,153,153, 25, 20, 29, 29,141,180,180, 52,238,176,248,215, 95,237,245,178, 50, 51, 51,119, 71, 71, 71, - 63,145,150,150,230,181, 62,121, 82, 82, 82,157,152,152, 71, 30,121,164,142,103,128,143,219,223,141,210, 77,221,245, 47,238,185, -184, 78, 7,120,194,206,157, 59,151,196,196,196, 0, 0,206,158, 61, 11, 74, 41, 78,159, 62,237,172,251, 32, 20, 10, 65, 8,129, -205,102,131, 94,175,199, 55,223,124, 3,153, 76,230,181,234,146, 43,249,167,164,164,184, 85, 94, 92,167, 8,252, 81, 2,100, 50, - 25,145,203,229,180,177,222,128,166, 24, 39, 45, 22, 11,134, 12, 25, 2,181, 90,141,161, 67,135, 66,167,211, 57,167,118,212,106, - 53,198,143, 31, 15, 43, 87,130,220, 55,203, 31, 75,150, 44,233,144,150,150,118,249,203, 47,191,116, 30,235,208,161, 3,150, 45, - 91,246, 31,190,132,221,196, 80, 31, 57,114, 4,177,177,177,136,142,142,198,144, 33, 67,232,209,163, 71,165, 28,249,151,148,148, - 64,173, 86,243,137, 81, 25, 6,224, 5, 0,127, 85, 40, 20, 54, 15,231, 77, 4,208, 17,192, 55, 10,133,226, 70,128,250,127,199, -142,205, 7,191,103, 16, 96, 83, 40, 1,221,186,117,107,148, 39,128, 27,100,215,173, 91,231,246,248,142, 29, 59,176,110,221, 58, -191, 44,147,130,243,125, 17,215,253,164,223,110,127, 14,174,115,254, 74,165, 18, 50,153,204,233,246, 63,116,232, 16, 58,119,238, -220, 36, 74, 95, 99,172, 47,206,250,191,121,243,166,179,206,188, 68, 34,145, 54,165, 23,128, 67, 66, 66,130, 52, 47, 47, 79,229, -237,188,205,155, 55,111,231,230,254,117, 58, 29,150, 46, 93,138,218,218, 90,136, 68, 34, 4, 7, 7,227,252,249,243,120,255,253, -247,161,213,106,145,153,153,249,173, 86,171, 29, 19, 25, 25,169,242, 66,178,117,200,222, 91, 76, 64, 83, 40,158, 71,142, 28,169, -115,126, 67, 65, 98, 81, 81, 81, 35, 76, 38, 19,172, 86, 43, 14, 29, 58, 4,129, 64, 0,179,217, 12,131,193, 0,150,101,157,239, -177,197, 98,129,201,100,226,222,105,175, 97,226, 13,185,252, 23, 46, 92,232,244, 2, 68, 71, 71,163,188,188,188,209,138, 40,183, - 42,192,135,216, 17, 13,128, 40,119, 7, 92,166, 3,124, 66,102,102, 38, 94,121,229, 21, 12, 30, 60,216,233, 1,225,210,103, 15, - 30, 60, 24,167, 79,159, 70,155, 54,109,124,146,185,127,255,126,140, 26, 53,170,107, 90, 90,218, 5,142,252, 29,227,103,199,141, - 27, 55, 94,169, 31,208,203, 87,161,104,232,183,124,244, 62,145, 35, 71,142, 72,210,211,211, 85, 67,135, 14,197,208,161, 67, 85, - 0,112,250,244,105,228,229,229,241,125, 14, 63, 3, 8, 1,176, 65, 46,151, 79,115,167, 4,200,229,242, 23, 0,124,234,216, 92, - 36,151,203,123, 43, 20,222, 75,212,255,145,193, 85, 3,204, 94,250,234,109, 83, 0,127,216, 24,128,123, 81, 9,152, 49, 99, 6, - 93,180,104,209,109,174, 64,127,200,255,169, 23,154,118,158, 78,167,211,221, 22,228,199, 89,253, 34,145, 8,215,174, 93,187,171, -228,239,106,253,187, 90,110,211,166, 77, 83,171,213,234, 38,247, 2,248,226, 57,153, 57,115,166, 30, 64,104, 88, 88, 24,222,124, -243, 77,136, 68, 34,231,241,212,212, 84, 0, 64,100,100, 36, 38, 77,154,132, 3, 7, 14,236,155, 52,105,210,239,210, 78,215,251, -237, 58,255,239, 14,177,177,177,117, 42, 53, 54,180,142,216,108, 54, 67,163,209,192,104, 52, 34, 60, 60, 28,193,193,193,176, 90, -173,160,148,194,102,179,193,108, 54,195, 98,177,192,102,179,185, 42,244, 55, 61,181,179,164,164,164,142,117, 95,127, 58,160,126, -128, 96, 99, 33,147,201,212, 62,198,162,136, 27, 58,208, 64,108,128, 87,188,255,254,251,152, 56,113, 34,186,117,235,134,208,208, - 80, 72, 36, 18,104, 52, 26,132,133,133, 65,171,213, 98,205,154, 53, 96, 24,223,226, 11, 71,141, 26,213, 41, 45, 45,237,194,188, -121,243,176,101,203, 22, 60,254,248,227, 0,208,110,255,254,253,215,253,185, 79, 14,133, 2,220,152,197,141, 85,190,146,191,171, - 39, 96,227,198,141,210,169, 83,167,170, 0, 96,227,198,141,210,170,170, 42,181, 15,253,217, 44,151,203,103, 0, 88,231, 65, 9, - 72,116,249,222, 5,192, 0,216,151,164, 6,224, 66,252, 13,225, 15,153, 9,112,248,240,225,210,166, 8, 8,244,215, 74,119, 29, -144,151, 44, 89,210,104,242,231, 48,100,240, 32,236,221,167,194,250,125,161, 78,165,160,224,124,223, 70, 93, 99,108,108, 44, 74, - 74, 74,144,155,155,139,206,157, 59, 99,237,218,181,126, 88, 93, 84,194,125,203,200,200,104, 18,242,231,172,255,242,242,114,105, -253, 99,163, 71,143,150,230,230,230, 58,207,105, 10,228,229,229,169,248,122,159,180, 90,237,111,176,207, 11,179, 27, 55,110,196, -154, 53,107, 0, 0, 27, 54,108,128, 86,171,229, 78,179,158, 62,125, 26,173, 91,183,190, 43,239,128,107,180,191, 59,229,140,111, -153,230,146,146,146, 67, 54,155, 13, 90,173, 22, 55,111,222,116, 6,142,234,245,122,212,214,214,162,186,186, 26, 85, 85, 85, 48, - 24, 12, 48,153, 76,176,217,108, 0,144,239, 73,102,125,114,119, 23, 72, 90,127, 85, 0, 95, 40,149, 74, 73,253,107, 86, 42,149, -190,246,147,208,166,126, 30,107,215,174,133, 68, 34, 65,104,104, 40, 78,158, 60, 9,181, 90,141,176,176, 48,188,245,214, 91, 56, -112,224, 0, 94,123,237, 53,159, 20,128, 81,163, 70,181, 75, 75, 75,187, 52,109,218, 52,124,253,245,215, 28,249,119, 0,112,221, -147, 37,207, 71, 9, 88,178,100, 73, 83,144, 63, 0, 72, 56,242, 7,128,169, 83,167,170, 18, 18, 18,168,143, 99,168, 25, 0,183, - 78,113,131, 92, 46,175, 31, 40,113,214,229,123, 41,128, 99, 1,218,119, 25, 7, 22,126, 84, 39, 22,160, 62,254, 48, 65,128, 77, - 77,254,142,245,174,141,182,220,184,233,128, 25, 51,102,248, 77,254, 79,189,176, 11, 67, 6,223,114,221,108,254,250, 27,108,254, -218,254,125,239, 62, 21, 48, 70, 10,192,183,101,128,114,185, 28,177,177,177, 0,236,193,128, 71,142, 28,193,158, 61,246,152,181, - 99,199,142, 33, 33, 33,193, 7,105, 68, 13,220, 10,252,107,108,164,254,250,245,235, 37,238,172,255,250,104, 42, 47, 0,167, 72, - 72, 36, 18,169,183,115,163,163,163,199,101,102,102,238,158, 52,105, 18, 78,159, 62,141, 51,103,206,224,253,247,223,183, 2, 16, -234,245,122,100,102,102,194,113, 76,120,241,226, 69, 60,243,204, 51, 94,101,222,137, 24, 0,206,146,206,201,201,113,122,177, 56, - 98,228,158, 59, 31,196,196,196, 20,233,245,250, 17,102,179, 25, 55,110,220, 64,112,112, 48,132, 66,161,211, 3,160,211,233,160, -215,235, 97, 50,153, 80, 85, 85,197,205,231, 95,246, 36,147, 35,119,110, 26, 32, 54, 54, 22,245,189, 21,238,226, 2,248,144, 63, -151, 3,160,254,190,198,244, 15,206,234,119, 99,241, 91,249,142,161,197,197,197, 56,125,250, 52,244,122, 61,226,227,227,161,215, -235,145,147,147,131,169, 83,167, 98,203,150, 45, 16, 20,150, 5, 38, 0, 0, 32, 0, 73, 68, 65, 84, 8, 4,188, 21,128,152,152, -152, 78, 28,249, 23, 22, 22,226,237,183,223, 6,128, 46, 51,102,204,184,186,110,221, 58,178,127,255,254, 70,141,161,156, 39,160, - 49,228, 31, 27, 27, 75,185,126,118,244,232, 81, 20, 21, 21, 73,211,211,211, 85,189,122,245,130, 72, 36,162, 46,129,129,126,123, - 2,228,114,249, 92, 0, 19, 1, 36, 3,104, 3,123, 12,192,159,218,253, 15,220, 90, 5,224, 46, 8,240,174,172, 2,248,189,130, - 0,239, 53,242,175,175, 4, 52,198,242,247,180,189,119,159,202,159, 23,244,150,185, 19, 26,138, 62,125,250,212, 57,126,248,240, - 97,159,228, 37, 39, 39, 59, 21,128,220,220, 92,228,230,230,214, 89, 21,224,203,245,175, 93,187, 86, 5, 0, 59,119,238,116, 75, -158,211,167, 79, 87,175, 93,187, 22, 0,191, 37, 76, 13, 37,253,225, 20, 13, 74, 41, 18, 18, 18,164,211,166, 77,243,218,119,210, -210,210,246,104, 52,154,177, 7, 15, 30,220, 27, 19, 19,131, 51,103,206, 64,171,213, 10, 35, 35, 35,145,150,150, 6,141, 70,115, -241,224,193,131, 93, 99, 98, 98, 48,115,230, 76,175,215,235, 46, 15,128,191, 49, 0,245,223, 45,133, 66, 65,100, 50, 25,148, 74, - 37,173, 63, 45,195,247,121,196,197,197,189,174, 86,171, 95,180,217,108,168,174,174,134,197, 98,113, 42, 43, 70,163, 17,148,210, - 58,129,129, 50,153,236,105, 7, 49,242,134, 76, 38,131, 76, 38,171,179, 44,208,215, 41, 0, 87,162,151,201,100,234,250, 99,139, -171, 82,208,132,224, 61,126,114, 75,253, 94,126,249,101,168,213,106, 72,165, 82, 20, 23, 23,163, 89,179,102, 40, 45, 45,229,173, - 0, 28, 62,124,152,164,165,165, 93,122,230,153,103,176,127,255,126,188,245,214, 91, 0,208,113,198,140, 25, 87,154,130,252, 93, -149,128,198, 88,254,220,248, 82, 82, 82,130,162,162, 34,226, 48, 4,165,233,233,233,170,232,232,104, 72, 36, 18,202, 39, 16,176, -158, 18, 48, 13,192, 6,135, 18,112, 8,128, 28,128, 68,161, 80, 92, 67, 0, 77,215,129,155, 58, 27,159,187,128,159,165, 75,151, - 54,184,255,110,146,255,140, 25, 51,238, 72,202,208,198,200,188,116,217,123,255, 14, 9,241,205,107,233,105,126,216, 31,200,100, - 50,105, 98, 98,162,122,239,222,189,116,211,166, 77,117, 20,129,250,164,196, 87,102, 70, 70, 70,131,154, 13,151,148,196,151,196, - 64, 13, 41,156, 82,169,148, 23,249,115,136,138,138,114,206,235,159, 60,121,242, 47,153,153,153,255,225, 60, 2, 23, 47, 94,236, -250,198, 27,111, 72, 9, 33,188,228,221,137, 60, 0,245,239,179,187,249,111, 31,148, 82, 93, 66, 66,194,226, 29, 59,118,188, 99, -181, 90, 81, 89, 89,233,140, 1, 0,128, 27, 55,110,160,178,178, 18,148, 82,206,106,247,105,178,157,155,255,175,191,236,175,126, -156, 0, 95,242,119,125,206,247,218, 82, 94, 78, 9,120,245,213, 87,145,151,151,135, 73,147, 38,225,195, 15, 63,196,130, 5, 11, - 32, 20, 10, 33, 22,139,189, 61, 87, 66, 41,101,103,205,154,133,255,252,231, 63, 88,189,122, 53, 0,116,222,191,127,255, 21,135, -197,238, 87,103,114,153,182,106, 50,148,149,149,193, 77, 30, 0,117,118,118,182,116,204,152, 49, 42,127,150, 60, 58,172,254,105, - 0,182, 1,152, 11, 32, 46, 64,254, 13,195, 93, 16, 32, 47, 5,192,151,164, 28,254, 18,118, 83,163, 41,200,255, 94, 28, 52,230, -206,157, 43, 61,117,234, 84,147,202,116, 88, 67,170,166,148,201, 17, 30,183,182, 30,128, 51, 25, 16,203,178,216,188,121, 51,111, - 37,224,149, 87, 94,225,218,121, 91, 12, 0,195, 48, 96, 89, 22,255,248,199, 63, 84,124,201,211,147,188,198,174, 36, 72, 75, 75, -251,175, 70,163,185,113,240,224,193,157,124,173,254, 59,237,109,171,127,127,221,185,216,125, 81, 2, 8, 33,239, 78,156, 56, 49, -119,221,186,117, 39,130,130,130,192,173, 10, 96, 89, 22, 17, 17, 17,208,106,181, 92, 10,219, 80, 0, 54,190, 6,129,107,240,223, -145, 35, 71, 32,147,201,234,140, 39,222,198,161,146,146, 18, 90, 82, 82, 34,173,239,226,111,228,146, 63, 0, 13,186,251,173,203, -151, 47, 23, 3, 48,195, 30, 63,197,125,124, 82, 2, 92, 19,255, 60,255,252,243,206,239,213,213,213, 94, 95,179,184,184, 56,210, -175, 95, 63,250,213, 87, 95, 61,177, 97,195,134,239, 56,178,221,176, 97, 3,124,141,250,231,112,229,202, 21,103, 74,226, 38,130, -122,251,246,237, 13,245, 41,245,190,125,251,124,170, 85,225,225,240, 85,119,217, 74,255,236, 53, 73,184, 85, 0,238,136,159,215, - 42,128,166, 38,245,134,228,221, 43,202,195,189,220,113,250,246,237,171,238,219,183,111,147,202,116, 12,142,119,252, 90, 93,221, -255,245, 95,234,134,150,157, 57,218,199,167,109,196,135,235,189,163,215, 26, 21, 21,181,171, 49,145,254, 77, 25, 3,224,174, 15, -123,242,246,248,208,231, 79,206,152, 49,163,217,238,221,187, 63, 40, 45, 45,125,209, 96, 48,192,102,179, 97,208,160, 65, 24, 58, -116,104,166, 76, 38, 91,200,135,252, 1,160,160,160,192,249,221, 53,214,164,160,160,224,182,109, 79,136,142,142, 38, 14, 47,129, - 20,128,138, 83, 38, 92,166, 2,124,126, 38, 83,166, 76,105,232,144,208,101,188, 12,186, 27,227,138, 66,161, 96,143, 31, 63,142, - 79, 63,253,148, 0,224,149,148,231,239,127,247,156,147,105,216,176, 97,152, 60,121, 50,239, 54,120,147, 23,192,189,167, 4, 52, - 68,254,110, 21,128,166, 38,193, 64,133,184, 0,220,245, 1,127,203, 87,254, 25,238,205, 61,252, 27,186,113,227,198,205,133,221, -253,234, 23, 14, 30, 60, 72,166, 79,159,126, 71, 20, 90,127, 51, 7,254,158,202, 98, 99,209,191,127,255, 38, 45,198,211,212,242, -254, 12, 70,217,253,164, 4,120,181,162, 6, 13, 26, 20, 24,136, 3, 8, 32,128, 0, 2, 8,224, 79, 6, 38,112, 11, 2, 8, 32, -128, 0, 2, 8, 32,160, 0, 4, 16, 64, 0, 1, 4, 16, 64, 0, 1, 5, 32,128, 0, 2, 8, 32,128,251, 16, 86, 0,108,224, 54, - 4,224, 9,194,192, 45, 8, 32,128, 0, 2, 8,140,237, 1,252,201, 59,201,156, 57,115,252,142,184,116, 23,213,237, 73,158,183, -245,199,190,202,107,234,246, 5,228, 5,228,253,217,229,253,244,250, 69,191, 7,150,193, 31,116,197,157,150,119,228, 53,255,229, -197,126,120,187,188,140,140, 12, 2, 0,132, 16,137,197, 98,193,249,243,231, 85,102,179, 25, 66,161, 16,151, 47, 95,198,211,225, -221,176,171,168, 8,134, 7, 59, 35, 46, 46, 78, 42, 16, 8, 64, 41, 85, 3, 64, 86, 86,214, 29,127, 30, 92,251, 92, 65, 8,233, - 11,160,205,137, 19, 39,182,119,232,208,129,209,104, 52,226, 14, 29, 58,188, 31, 18, 18,178, 18,192, 21,199,114, 82, 38, 43, 43, -203,230, 65, 94,115,135,183, 64, 79, 8,161, 0,112,233,248,127, 87,201, 71,149,166,173, 47,138, 57, 47,108, 51, 46,174, 89,243, - 22,181, 0, 40,165, 84, 8, 32, 50, 43, 43,235, 82,224,125,187,183,229,221, 81, 45,145,111,182, 45, 95,179,191,249,147, 50,183, -114,205,215, 18, 97, 84,184,234,220,153,179,210, 7,130,155, 33,236,239, 51,212,247,146,150,213, 80, 62,242,192, 18,151,187,143, - 45, 91,182, 72,118,236,216,161,202,124,221,190,253,237,254, 81,152, 49, 99, 6,175,231,178, 63,255,144,132, 33, 68,117,250,212, - 41,104,181, 90,116,237,218, 21,205,154, 55, 71, 82,226, 56,222,207,117,207,158, 61,117, 94,220,220,220, 92,143,181, 20,114,115, -115,253,238, 55, 92,161,166,172,172,172,198,245,187, 20,141,227, 11, 5, 64,128,156, 40,255,101,197, 46, 7,162,159,181,127, 47, - 89, 3, 28,153,223,248,135,154,124,179,110,251,114, 91,241,250, 51, 66, 8,213,233,116,210,221,187,119,171, 74, 74, 74,144, 34, -106,137,118,157, 91,195,168, 51, 32, 68,111,197,200, 5,207, 97,244,164,169,216,246,101, 22,182,238,221,171, 26, 55,110,156,244, - 30,232,194,103,108, 54, 91,251,146,146, 18,118,224,192,129, 65, 49, 49, 49, 56,122,244,232,235, 70,163,113, 98,207,158, 61,101, -132, 16, 13,165,212,219, 84, 64,141,235,134,213,106,101,126, 41,250,169,103,167, 89,131,241,143, 97,253, 90, 23,236,254,120,211, -230, 99,146,159,123,246, 31,243,161, 67,222,101,135,194,192, 6, 60, 13,127, 50, 55,145,175,249,251,125,201,131,239, 43,249,219, -214,111,151,196,183,238,164, 34, 29,163, 81, 92, 91,137,246, 29,186,169, 44,172, 13,167, 62, 91,139,242,174,173,165,195, 38, 77, -224,165, 8, 28, 81,201,105,239, 30,220,150, 0,223,236,102,177,255, 71,138,244,105, 64,239, 30,192,252, 37,141, 35,110,174, 64, - 73, 99,179,147,185, 83, 38,154, 74,110, 99,144,158,158, 78,177,152,128,188,219,240, 57,148, 82, 96, 49,193,148,223, 82,238,153, -181,214,183,200,159, 58,200,127, 52, 14, 28, 56,128, 25, 51,102,120,253,219, 7, 7,238,166,125,251, 14, 69, 78,206, 85, 28,206, -183, 39,172, 57,115,234, 52, 0, 96,246, 95,191,166,167,207, 38, 75,195,196,252,158, 75, 98, 98, 34,187,103,207, 30, 38, 55, 55, - 23,251,246,237,243, 88,136,201,159, 20,170,158,222,219, 12,185,156,102,249,161, 80,112,233,194, 27,157,202, 56,250,217,186,197, -118,154, 66, 1,112,185, 79,142,234,132,188,112,238,220, 57,168, 55,109, 82,189, 43,155,130, 65, 51,158, 71, 80,219, 72, 64,232, - 72,246,199, 82,128, 21,129, 53, 81, 76,120, 54, 29,165,255,250, 8,135, 14, 29, 82,141, 24, 49, 66,202,121, 1,238, 18,108, 12, -195,180,105,213,170, 21,212,106,181,112,224,192,129, 24, 54,108, 24,115,237,218,181,193,191,252,242,203,241, 7, 31,124,112, 8, - 33,228,154,131,172, 25,158,247,174,217,216, 49,137,209, 31, 46,219,194, 44, 76, 61,214, 34, 46,105,142, 52,110,184,114,212,130, - 79, 47, 63, 26,243,208,204, 88, 66, 72, 13,236, 49, 6, 76, 67,253,204, 53,177,149,183,126,212,104,133, 52,128, 58,168,159, 0, -168, 62,252, 42, 6,228, 58,128, 12,154, 57, 0,115, 70,190,192,128,103,229,190,250, 74,128, 92, 46,167,177,177,177,200,206,206, -166,174,101, 75,125, 34,214,188, 35,146,233,131,227, 85, 65, 54, 22, 54, 80,132, 84,134,226,218,141, 27,184, 86, 83,133,238,193, -205, 96, 42,190,162, 58,188,117,135,116, 56, 15, 37,160,119, 15,224,212, 57, 6,148,138, 97, 35,193,120, 34,209,130,201,227, 12, -184, 21, 67,211,248, 84, 9,141, 37,105,142,248, 23, 46, 92,136,162,162, 34, 0,192,246, 83, 34, 24, 45, 22,149,252,175, 67,125, - 82, 4,124, 81,226, 28, 41, 94, 61, 63,151,197,246,195,177,177,177, 13,231,111, 95,236,223, 59,190,237,139,171,146,173,191,188, -237, 84,120, 38, 14, 88, 44,125,236,133, 14,141, 30,112,183,108,217, 34,217,190,125,187,138, 97, 24,188,252, 1,156,213,207,248, -212,193,136,140,252, 65, 18, 55, 60, 3,192, 86,140, 26,245,175, 58,199,166, 79, 7, 38, 76, 0, 38, 32, 87,181,252, 95,224,165, - 4,112,228,175, 86,219, 79,157, 58,117,170,179,176,146, 47, 4,230,201,242,231, 82, 50,187, 94, 95, 70,134,127,228,223,100,136, - 93, 6, 0, 88,177, 98,197, 45, 5, 96, 72, 38,112,244,229,187,210,156,125,251,246, 97,229,228,116,116, 31,147, 8, 8, 76, 32, - 34, 6, 68,200,128, 8, 68,160,148,128,213, 89, 65,109, 54, 80,179, 13,207, 61,251, 60,158,127,107, 46,206,181,109,171,234,209, -163,199,221,244, 4,144,162,162,162,248,206,157, 59, 7,149,148,148, 32, 47, 47, 15,167, 78,157, 66, 98, 98, 34,226,227,227,219, -175, 94,189,250,189, 41, 83,166, 60,231,131, 2, 32, 56,176,247,127,255,247,228, 32,125,219, 35, 53, 2, 76, 95, 92,139,135, 7, -127,130, 23,230, 77, 21,126,188,176,178,251,194,143,215, 77,143, 30, 60, 93,129, 6,210, 32,187, 18,186,235,152,158,145,145, 65, -221,237,111,234,130,112, 1,220, 1, 15,128,235, 67, 90,191,115, 93,101,143, 7,122, 68,200,223,125,142,157, 51,242, 5, 95,170, - 57,145,236,236,108,202,165, 37,229,254,151,203,229, 52, 37, 37,197, 55,171,122,231, 33,201,248,152,126,170, 32,163, 21, 33, 31, -191, 2,171,222, 12,241,203, 75, 16, 30, 36,134, 81,100,128,206,104, 64, 8, 8, 76,151,202, 85, 85, 85, 85,210,240,240,112,143, -131,240,169,115, 64,246, 6, 22,128,222,241, 1, 70, 61,196, 96,242, 56, 2,215, 64,218,244,105, 64,246, 6, 63, 60,166, 41, 41, - 82,199,117,250,101,173,115,228,207, 17, 63, 0, 40, 14, 88, 96, 48,235, 0, 0, 99, 23,238, 65,206,210, 68, 21, 0,222,242,207, -125,116, 14, 34, 82,124,171, 35,144, 50,144, 86,189, 93,182,203,209,250,175,252, 82,132,146,119,237,228,239,169,198, 60,145,231, - 80,251, 57,252,172,255,163,219, 45,146,236, 45,127, 87, 81, 80,124, 56,239, 91, 12,151,196, 96,253, 23,251,241,239,221, 25,170, -237,114,138, 57,127,121, 91, 58,104, 84,123,191, 20,129,218,139,114, 58,102, 32,144,243,213, 9, 80, 74,209,188,205,131, 78,242, - 95,185,114,165,199,246,233,140, 74, 73,122, 74,123, 21,240, 57,128,111,113,248, 48, 48,124,248,173,227,239,189,119,235,251, 75, - 47,230,170,178,254,221, 75,202,176,157, 61,182,147, 35,255,132,132, 4,176, 44,139,207, 62,251,172,201, 94,112,185, 92,238, 36, -255,186, 74,129,156,102,101,121,126,231,152, 41,218, 58,234, 47,113,252,195,166,184, 57,143, 56, 78, 36,246, 47, 3, 7,222, 62, -199,206, 76,213, 58,189,242, 0,192,178,169,152, 55,111,158,243,248,188,121,243,176, 98,197, 10, 48, 61,103,221,250, 85,199,249, -238,228, 9,167,186,111,159,213,234,230, 60, 30,237, 51, 26,141,104,215,181, 27,192,154,193, 4, 3, 68, 40,128,181,166, 10,198, -146,243,184,113,185, 12,157, 70, 72, 64,130, 34, 64, 44,102, 64,192, 96,233,156, 5, 72,204,126, 27,243,231,207,111,210, 65,217, - 91,170,108, 23,178, 37,148,210, 8,131,193, 48, 34, 42, 42, 10,167, 79,159, 6,203,178, 56,127,254, 60,214,172, 89,131, 62,125, -250,160, 99,199,142, 51, 1, 60, 87,143,172,217,134,200,155, 82,218,170, 43,115, 88,210,190, 75, 82, 80,101,222, 49, 84,105,131, -241,159,109, 86,236, 40,248, 47, 94, 76, 9, 17, 10,245,108, 44, 48,189,193, 58, 8,119,162,184, 85, 0,190,161,161,190,227,206, - 51, 32,228, 75,252,148, 82, 72, 95, 79, 64,118,158, 34, 34, 29,114,252,252,213, 49, 96,164,243,181,226, 5,142,244,245,250,117, - 0, 8,140,198,213,136,138, 82, 34, 39, 39, 7,190,164,241, 28, 22,220, 66,213,198,104,131,120,241,243,176,221,212,192,122,229, - 38,132, 65, 34,132, 18, 1,194,136, 0, 97, 2, 33,162, 68, 98,104,107, 42,113,117,223, 33, 85,248,228, 71, 60, 14,116,238, 72, -125,255,143,172, 67, 1, 0,150, 45, 34,160, 4,176,135,199,248,222,193, 29,164, 44,205,201,201, 81,229,228,228,248, 53,133,224, - 74,254, 16, 10, 80,114,213, 62,248,149, 94, 55,162, 75, 91, 49,122,166,110, 69,206,154, 73, 42,190,238,117, 17, 41,134,144,148, - 65, 64,110,194, 70, 91, 33,184, 13, 65,216,180, 43, 96, 89, 13,140,198, 28,216,138,254,225,155, 39,151, 71,229, 54, 95, 74,188, - 42,182,188,160,138,143,122, 3,159,125, 59, 11,205,152, 46, 0,128,231,255,222, 11, 3,135, 69, 99,221,231,121, 88,249,223,119, - 84,138, 81,254,185, 14, 9, 1,228, 47, 29,119, 14,122, 15, 63,252, 48,246,239,223,239,149,252, 1, 96,198, 52,145, 10,216, 7, -224, 56, 42,175, 55, 67,207, 46,192,170, 85,181, 80,169,128,158, 61,129,232,104,187,136,202,235,205,236, 47,227,128,223, 84,191, -254,210,153,120, 34,255,125,251,246,129,101, 89, 39, 73,111,220,184,177,209, 4,226,186, 93,159,252, 1,192, 27,249, 3, 64,150, - 66, 65, 40, 32, 33,128, 58, 61, 61,189,193,142,207,186, 12,250,138,236,108, 41, 33,192,202, 47, 86,222, 22,243,178, 50, 75,225, -234, 95,145, 80, 74, 85,159,124,242,137,115,199, 39,159,124,130, 21, 43, 86, 32, 43, 43,171,110, 21, 57, 2,137, 59,121, 89,246, - 20,182, 82, 74,169,250,185,231,158,107,176,125, 86, 23, 47, 74,246,170, 85, 82, 66,128,172,149, 89, 42,119,228, 37,108,222, 28, - 16, 9, 96,211, 87,226,183, 29,123,177,110, 83, 46,190,184,114, 30, 0, 80,248, 78, 11,244, 28, 61, 1,166,210, 75, 56,241,203, - 17, 28, 59,127, 6, 85,215,174,225,248,241,227, 77, 86, 88,107,205,154, 53, 18,126,125,152,132, 83, 74,123, 23, 21, 21,125,252, -230,155,111,246,251,248,227,143,131,204,102, 51, 4, 2, 1,154, 55,111, 14,157, 78,135,194,194, 66, 68, 71, 71,115,117, 11, 60, - 89,255, 97,132, 16,150, 82, 26, 85,121,249,224,143,239,252, 95,105,212,151,243, 58, 64,163, 11, 66,144,144, 65,167, 72, 49,174, -221, 52, 67,254, 79, 43, 6, 14,141, 13,235,226,197,147,144,145,145, 65, 57, 69,192,181, 47, 54,244, 61,128, 59, 15,142,252,235, - 43, 7,140,183, 65,132,171,247, 93,199,205,153, 52,195,231, 6,100,103,103, 83, 59,249,175,119,146,191,248,199, 11,208,239,122, -160,206,113,175,150,171, 98,189, 36, 92, 83, 3, 54, 72, 8,243,145, 19, 48,253, 86, 2,227,238,253,128,193,132, 32, 74, 17, 10, - 1,132, 32, 48,177, 86,104, 76, 70,124,177,103,155, 87,153,203, 22,217,173,123, 87,216,183, 57,115,133,226,244, 89,138,249, 75, -252,239,179, 50,153, 76,237,234,246, 82, 42,149,188, 94,116,165, 82,233,172,173,205,225,233, 21,151,177,247,136, 22,165,215,141, - 78, 37,160,248,178, 1,144,109,130, 82,169,228,229,142, 20, 18,123,229, 48, 81,205, 49,132,133,157, 69,176,184, 6, 44,171,129, -197,114, 4, 2, 65, 52,204,186,138,187,214, 89,247,126,115, 92, 2,144, 58,228,127,245, 52,197,144, 73, 2,252,253,253, 68, 60, -156,216, 15, 0,117,156,231, 27,214,175, 95, 79, 95,254,128,160, 89,235, 1,160, 0,146, 38,207,193,129, 3, 7,120,253, 45,203, - 92,162,109,218,252,234, 36,255,154, 10,123, 9,230,129, 3,237,228,207, 21, 2,180, 31, 11, 65, 77, 69, 8,162, 66,175,122,148, -153,156,156, 12,169, 84,138, 49, 99,198, 96,234,212,169, 16, 8, 4,183,125, 92,247,243,133,187,247,214, 47,101,201,133,136, 9, - 33,206, 79, 67,251, 8,160, 6,133,186, 1, 89,183,222,175,244,116,149, 59,203,121,222,188,121, 72, 79, 79,175, 75,168, 13,200, -251, 86,161,192,241,227,199, 85,132, 16, 9,128, 58,247,204,233,207,174,183,207, 83,251,130, 40, 5, 19, 26, 12,203,181,139, 80, -188,241, 6,214,232, 42,161, 77,136,115, 30,255,242,191,107,240,246,130,217,136,153,255, 52,222, 61,182, 15,155,180,231,145,248, -216, 99,136,142,142,246,121, 10, 96,205,154, 53, 18,185, 92, 78, 87,175, 94, 93,167, 15, 23, 20, 20,168, 60, 77, 67, 17, 66, 68, -132,144,161,199,142, 29, 43,205,203,203, 83,191,252,242,203,113,159,125,246,153,184,182,182,214, 89,166,217,104, 52,162, 89,179, -102,197, 83,166, 76,233, 53,114,228,200, 46, 94, 20, 9,134, 16,210,245, 88,254,230,242, 51,187,230, 95,152,255, 90,102,251,173, -139, 59,224,183, 50, 33,170,106, 5, 96, 9, 80, 81,107, 6,109,217,195,248,210,235, 75,250, 61,250,196, 95,188, 78, 39,100,101, -101, 17,110,172, 83, 40, 20, 94,191, 7,112,119,200,223,173, 7,192,149,248,249,140, 51,190, 88, 34,183, 92,109,171,221,122, 7, -234,196, 25, 52,224,198,232,215,170,173, 74, 67, 45, 8,170,208, 64,252,237, 62, 16, 33, 3, 24,205,160, 53, 58, 16,171, 21, 34, - 0, 54,202,194,104,179,162,198,106, 6, 88,239,115,168, 92,144,223,178, 69, 13, 15,131,246, 32,193,198, 15,168, 10,133,130,112, - 46,125, 62,214,250,109,214, 63,128,255,189,208,190,206,246,208, 87, 75, 32,162, 55, 97, 33,173,144,147,147,179,143,175, 23, 64, - 92,171, 66,212,187,255,197,141,151, 51,112, 83, 19,130, 14,150, 19,176,217, 74, 0, 0, 23,127,110,119,215, 58,236,166,157,159, -170,102,143, 83,212, 33,127, 14,113,145,111, 96, 68,191,100,196, 71,157,192,166,157,239,171,198, 78,230, 63,136,172, 91,183,142, -254,240,195, 15,168,168, 24,139,150, 45,247,162, 89,171,254,160,148,130, 97, 24, 94,129, 72,165,165, 64, 73,201,113,110, 34, 1, - 16,215, 66,163, 3,134, 13,179,239, 41, 46, 6, 62,255, 28,168,169, 6,116,181, 64,173, 14, 8,139,172,230,213,182,134,230,250, -207,157, 59, 7, 0,248,224,131, 15, 0, 0, 49, 49, 49, 77,230,102,118,237,147,124,254,102,238,220,185,112,181,216,235, 19,183, - 15,144, 0,183,230,254, 93,193,121, 1, 28,231,168, 61, 9,153,213, 49, 6,103, 78,156, 68, 89,100,164,138, 97, 24,188,248,226, -139,248,215,191,254,229,119,251, 70,153, 34, 64,217, 90,204,254, 96, 17, 6, 36, 39, 67,241,193, 7, 96,152, 91, 60,167, 40, 62, -126,203, 67,184,127, 63,246,236,217,131,243,231,207,251, 28, 4,184,102,205, 26, 73,126,126,190, 10, 0, 10, 11, 11, 85, 12,195, - 72, 83, 83, 83,213,171, 87,175,150, 80, 74, 17, 31, 31, 47, 53, 24, 12,170, 6, 20, 59, 75, 65, 65,193,128, 25, 51,102,180,232, -222,189, 59,118,236,216,161,175,170,170, 18, 26, 12, 6,187,183,195, 49,255, 49,126,252,248, 24, 66, 72, 8,165,212,224, 70, 12, -227, 34,143, 41, 57,253,243,138,183,255,145,214,172,101,207, 28,252,148,243, 44,126,189, 68, 80,122, 93, 8, 80, 6, 38,179, 5, - 26,218,178,236,111,179,158,143, 35,132,148,209, 38,208, 42,249,196,217, 4,240,251,160,193, 41,128,188,188,188,219,246, 85,150, -105,125, 38, 59, 87, 15,128,125, 10,192,222,127,196, 63, 94, 64,240,241, 50,216, 34,236, 86, 84,253, 57,228,134,214, 53,158,188, - 92, 10,125,112, 8,162,173, 86,116, 10,105,134, 80, 81, 16,136,197, 2,176, 20, 86,155, 13, 53, 54, 51,244, 54, 43, 76,212, 6, - 27, 40,168, 15,157,109,254,146, 91, 74,128, 61, 46,224, 22,233, 47, 91, 36, 64,230, 34,130,151,151, 88, 27,125,211,101, 50,153, -154, 43, 93,202, 7, 11,115,236,247,125,105, 74,164,147,240,157,174,124,122, 19, 34, 0, 66,170,197, 87,179, 35,173, 79, 43,249, -197,117,136,174,255, 8, 27,236,110,234,143,133,225,120,250,250, 69, 20,253,179, 19,194,218,245, 65, 85, 89, 25,174, 93,184,114, - 87, 59,230,192, 97,209,208, 57,186,155, 62,228, 36, 66, 13,125,241,245, 59, 22,231,241,145,178,126,200,223,228,155,229, 63,121, -244, 15,248,246, 91, 25, 34,242,149, 88,190, 8,120,105, 9,197,232,209,163,121, 47,251,235,214,169, 51,233,209,163,174, 22,184, -109,155, 61,240,111,253,122,160,103, 79,138, 21, 43, 8,222,125,183,214,174, 32, 0,232,217, 43, 18, 47,191,196,175,141,156,149, -154,156,156,140,141, 27, 55,214,177,100,147,146,146, 26, 36, 55,127, 21, 81, 31, 61,120,210, 21, 43, 86,168, 26, 82, 0,150, 45, - 91,134,236,236,108, 94,150,240,115,207, 61,167,226, 34,255,221,225,165,151, 94,194,242,229,203, 85,217,217,217, 30,219,248,195, -201, 82,188,254,238, 2,204, 90,252, 15,188,102, 54,227,147, 79, 62,105,240, 30, 45, 91,182, 12, 74,165, 18,132, 16, 73, 67,132, - 61,186,111, 23,172,254,242,115,196, 78,159,142,119,222,121,199,163,210, 48,111,222, 60, 44, 91,182, 12,171, 86,173, 82,251,122, -239,243,243,243, 85, 92,176,156, 92, 46,167, 5, 5, 5,170,212,212, 84,114,248,240, 97, 21, 33, 4,169,169,169,234,149, 43, 87, - 54,248,247,122,189, 62, 98,219,182,109, 24, 59,118, 44,138,139,139, 67,117, 58, 29, 44, 22, 11, 24,134,129,217,108, 70, 74, 74, - 10,113,144,187,129,143, 99,203,100, 50, 5, 29,217, 60, 29,163,159,124, 23,187,242,206,225,252, 85, 1,170,117, 12, 4, 66,160, - 76, 23,130, 23, 95, 93, 20, 15,224, 50, 95,238,231,226, 78, 0,126,211, 1, 1,220, 29,235, 31,238,220, 56,156,107, 70, 34,145, - 64, 34,145,224,151, 95,126,113,126, 74,126,188,136, 42, 67, 21, 90, 14,243,125,221, 47, 71,238,161,161, 51, 32,254,241, 2, 68, - 23, 43, 64, 9, 65,208,172,138, 58,199,189, 18, 87,144, 0, 54, 10, 92,214, 85,162,180, 74,131, 27,213, 90, 84, 25,141,208,154, - 13,184, 97, 50,224,170, 81,143, 50, 99, 45, 52, 22, 19,180,172, 5,102,214,123, 54,204, 81, 15,185, 25,240, 92,226, 2,102, 79, -109, 6,138, 32, 80,223,202,128, 59, 93,248,245, 59, 59, 95,247,191,211,242,188,110,196,222, 35,218, 58,196,207,145,127, 48,123, - 17,193,236, 69,188, 61, 94,136,210,210, 82, 51, 95,153,155,207,179,104,157,153,229,220, 62,175,179,225,242,185, 50,156, 62,120, - 2,215, 46, 84,222,245,142,187,254, 11,187, 2, 90, 93, 78, 17,106,232, 11,201, 44, 33,158, 92, 44,114,126, 50, 55, 77, 7, 1, -225, 61, 32, 61,254,112, 30,158,157, 47, 67,100,193, 94, 16, 66,240,221, 65,251, 35,224, 75,254, 28, 98,122,247,170,167, 88, 0, -159,125, 6,156, 61,107,247, 4,188,243, 14,117,186,223, 41,165,136,140,140,244, 62, 2, 59,250,168,205,102,131,205,102,195, 7, - 31,124,128,115,231,206,225,204,153, 51, 56,115,230, 12,148, 74, 37, 22, 44, 88,128,210,210,210,187,249, 72,212, 13, 89,210,115, -231,206,229,172, 58, 94,100, 72, 8,113,107,253,115,240,116,204, 21,251,131, 43, 65,152,102,248,247,235, 75,208,108,155, 18,233, -233,233,112, 45, 53, 44,239,217, 31,115, 99, 71, 32, 52, 52, 20,163, 71,143,198,155,111,190, 9,165, 82,169,210,106,181,110,223, -191, 47,203,206,224,106,191,190,232,216,177,163,148,101,217, 6,189, 29,156,167,194, 95,207,139,107,164,124,124,124,188,148, 35, - 74, 0,136,139,139,147,122,185,119, 99, 70,143, 30,221,162,180,180, 20,251,247,239,199, 3, 15, 60, 0,161, 80,232, 84, 22, 59, -118,236,200,119, 58,130,117,200, 35, 61,122, 15, 94,152,189, 59, 2,191,238, 88,140, 81,241,125, 16, 38,102, 16, 22,106, 67, 72, -176, 9,143, 60, 62,133, 5,160,169,175,171,122, 83, 46,185,235,227, 51, 29, 16,192,221, 3,227,233, 33, 42, 20,138,230,115,231, -206,197,220,185,115, 1,192,252, 94,198,123,176,148, 91, 17, 18, 34,246, 43, 25, 73, 74,138, 61,124, 56,116,252, 89, 80, 1,131, - 55,191,214, 59,173,127,190, 8,237,216, 81,106,109, 22, 10, 45,181,225,164, 78,139,227, 85, 21, 56, 81,125, 19, 39,170, 53, 56, -169,211,224,172, 94,139, 10,147, 17,181, 86, 43,174,232,117,206,223,244,132,201,227, 8,150, 45, 18, 96,217, 34, 1, 40, 4,160, -132, 65,250, 52,130,231,166, 5, 97,214,212,214,232,209,163, 45, 88,136, 0,248,118,201,156,171, 63, 37, 37, 69, 90,127,159, 15, -247, 76, 90,124,217,174,200, 23,125,100, 15,162,219,245, 74,184,221,125, 67,181, 16, 80, 29, 76,140, 61,162, 89,163,209,132,166, -164,164,248, 84, 20, 61, 54, 54, 22, 74,165, 18,235,107,117, 48,152, 25, 60,187,225,223, 40, 23,135,192, 96,190,123,101, 34, 38, - 13,124, 91,154,175, 89,130,245,255,185,101,226,127,253,142, 5,113,145,111,220, 82, 40, 31,253, 92,154,165,200,226,149, 91, 98, -249, 27, 64,234,252,177,136, 40, 80, 66,250,207, 4, 48, 19, 1,181, 90,237, 87, 31,238,218,181,110,244,248,152, 49, 64, 68, 4, - 16, 29, 13, 12, 31,216, 28,226, 32, 1, 4,204, 45,177,226,144, 16,175, 3, 50,195, 48,206,185,254,115,231,206, 33, 38, 38,166, -206,231,221,119,223,197,187,239,190,139, 43, 87,248,123,101,220,205,215,187, 34, 35,195,119, 11, 44, 59, 59, 91,186,124,249,114, -183,132,205,215,250,119,113, 61,223, 22,167,192,109,179, 44,191, 20,246,102, 66,192,234, 77, 16,181,235, 10,249,251,239, 35, 53, - 44, 2, 17,234,124,231,241, 89,127, 73,197,219, 31,255, 27,197,203,254,135,183, 6,140,193,148,200,238,216,179,101, 11, 74, 74, - 74,220,190,127, 79,100,200,209,175,127,127, 41, 23,212,200, 41,100,174,211, 51,238,246,121,176,190,104, 70, 70, 6,229, 2,251, -184,249,126, 87,146, 79, 77, 77, 85,199,197,197, 73, 57,215,127,106,106,170,218,203,125,203, 19,137, 68, 15, 60,241,196, 19,231, -170,170,170,160,213,106, 17, 18, 18,130,214,173, 91, 35, 34, 34, 2, 17, 17, 17,222,110, 30, 91, 79,158, 45, 56, 56, 88,255, 84, -198,191,164,107,126, 28,138, 11,151,170,209, 54, 92,128,248, 94, 4, 15,118,167, 8,107,209,162, 18,128,205, 3,111, 4,234, 13, -220,167,214, 63,224,125, 25, 96,173, 66,161, 8, 6, 16, 38,151,203,157, 90, 96,167,132, 14,126,105,190, 10,133,130,200,100, 50, - 40,149, 74, 26, 52, 43,167,142, 43,146,111, 30,128,150,143,141, 85, 87,228,236,128,222,106, 66,181, 78,143,115, 22, 11, 68,172, -221, 81, 95,101, 49,130,165, 20, 20,192,142,235,231,161,179, 90, 0,128,199,192, 68, 48,127, 73,221, 62,110,159, 10, 96, 97,131, - 9,191,157,173,193,234,141,213, 62, 93,175, 43,209,203,100, 50,117,125, 47,128,171, 82,224, 9, 50,153, 76,157, 35,159, 2,209, -216, 47, 0, 68,163,162,226, 86,112, 94, 16,123, 21,102,166, 61,254, 54,224, 12,174, 94,181, 15,196, 10,133, 98, 47, 31,185, 25, - 95,103,215, 81,188,114,114,114,192, 77, 74,108, 56,118,200,167, 85, 25, 77,141, 71,159,111,175,222, 42,167, 56,168, 60, 1, 0, - 24,209,207,158, 25,239, 31,243, 22,227,208,137,126,248,120,211,116, 40,182, 61,175, 82, 76,226, 71,224,207,206,151, 33, 42, 74, -233,106,200, 66,163,145,129,210, 28,135,171,146, 34, 39, 39,133,151,172,228, 39,159, 34,123,118,237,166,128,221,245, 47,149, 18, -220,188, 20, 14,157, 86, 12, 67,117, 16, 54,172, 37,152, 59,151,226, 98,121, 13,134,199,199, 97,250,212,105,188,172, 98,155,205, -230,156,239, 87, 42,237,109,117, 37,252,242,242,114,148,151,151,251,236,222,151,203,229,148, 97,152,219, 72, 53, 43, 75, 65,252, - 72, 2,164,166,148,214,137, 5,112,241, 8,240,118,133,187,186,246,235, 71,239,123,115,251,215, 87,114,172, 53, 53, 16,181,138, -130, 32,180, 25,250, 61,149,140,119,199, 37,226,117,110,217,222,224, 33,176, 25,140, 16,181,108,139, 1,113, 18,116,235,212, 29, -255,250, 45, 31,253,251,247,151,254,248,227,143,183, 41, 1, 25,114, 57, 0,162, 2,128,231, 51, 50,156, 75, 7,173,245,200, 94, - 40, 20, 0,244,214, 66, 69, 2, 96,160,155, 65,118,208,160, 65,132, 82,234,116,241, 23, 22, 22, 58, 93,252,174,231, 57,182,189, -146,191,195, 96,127, 35, 34, 34,162, 95, 92, 92, 92,143, 83,167, 78,225,232,209,163,176,217,108, 8, 11, 11,131, 94,175, 47,143, -138,138,186,224,139,209, 71, 8, 97,218,182,109,187,231,241,199, 31,111, 91,112,160, 16, 43,114,246,160, 5, 9, 66,175,182, 38, -156,189, 25,134,135,123, 89,206, 3,176,112, 10,154, 67,161,180,121,122, 38,174, 99, 93, 96, 10,224,222, 6,159,249, 98, 51, 0, -179, 43, 81, 95,206,187, 2, 76,247,157,252, 93,201,198,221,160,197, 87, 9,168,214,104,165,150, 80,177,170,138, 97,113,205, 88, - 11, 88, 44,176, 81, 10, 2,224,183,218, 74,148,233,171, 65, 41,229,146,216,240, 24,152, 40,210,167, 17,100,111,184,213, 39, 79, -157, 3,122,247,176, 66, 0, 93,163,200,223,181,179,251,235,242, 74, 73, 73,145,230,228, 60,175, 2,138,160,209,104,204,165,165, -165,194,165,137, 96, 22,238, 25,141,121,253, 15, 57,173, 48,190, 74,133, 59,175, 75,253,109,142,132,248, 90,115, 88, 76, 48, 52, -187,132, 2,238,151,251, 57, 51, 1, 42, 65,249, 4, 41,102, 76,250, 66,170,216,250, 55, 85,254, 38,138,248,168, 19, 24, 41,235, -135, 3,123, 78,160, 64,251, 62, 8, 8,228,147, 62,231,125,173, 81, 81, 74, 16, 66, 48,121,242,100,172, 90, 85, 13,206, 40,182, -255, 79, 29,247, 56,167,206,128,228, 97, 10, 22, 9, 99,164,210,188,125, 42,213,152, 49,128,249, 90,103, 92,170, 12, 6,235,152, -109,109,175,107,139, 87,210,107,176,167,160, 23,154,119,234,197,171,141, 28,241, 95,190,124, 25, 0,112,237,218, 53,167,103,224, -250,245,235,206,129,213, 31, 40, 20, 10,194, 37, 2,170, 63,135,155,165, 80, 16, 62,249, 0, 92,177,106,213,170, 58,177, 0,203, -151, 47,247,217,250,175, 79, 24,254, 66, 44, 22,227,218,197, 11,232,222,163, 39, 88,171, 9,196,106,131,176,121, 11, 52, 31, 50, - 20,205, 6, 63, 4, 86,103,133, 77,111, 2,181,218, 0, 27,139,133, 43, 63,198,212,233, 83, 33, 22,139,221,202,179,110,136,228, -245,187,238,206,139,253,208,253,185,241,241,241,210,130,130, 2, 21, 55, 6,140, 28, 57,210,237,189,226, 65,254, 32,132,176, 0, -118,246,234,213,107,240,167,159,126,106,190,113,227,134, 49, 49, 49,241,241,162,162,162,183,244,122,125, 69,171, 86,173,228,125, -251,246,213,248,112,239, 69, 0,186,196, 13, 31,222, 58, 99, 86, 6,206, 95, 62,175,121,102, 86,198,168,195,123,214,102, 94,173, -209,140, 24,154,144,200,182,237, 20,243,164, 27,175, 1,235,105, 44,112,229,138,134,146,255, 4, 18, 1,221, 63, 10, 64,131,214, -133, 63,228,207,145, 13,151, 19,192, 31, 37,160,187,124,134, 26, 0, 41, 83,172,161, 8, 17, 67, 75,173, 48, 91,173, 96, 41,139, -150,225,225,184,172,171,226,151,193,206, 1,119,203,251,110,197, 0,248,150,137,205,157,139,191,177,233,122, 29,127, 59,105,232, -208,161, 91, 23, 46, 92, 24, 20, 21, 21,197, 94,189,122, 21,243,250, 95,173, 67,254,190,252,134,187,251,239, 55, 28, 89,254,234, - 39,121,114,119, 14, 95, 12,126, 84,160,206,122, 52,139,108,249,236,138,100,251,177,119, 84,249,155, 0, 2,130, 73, 3,223,150, - 62,250, 60,255, 4, 64, 92, 95,178, 19,124,181, 99,144, 2,220,241,206,154, 76,187,243, 36,172, 75, 22, 1, 26, 46,174, 49,125, -234, 52,245,244,169,211, 72,133,246, 83,137,173,166, 70, 69, 4,128,222, 24, 2, 82, 99,133,144, 17, 66,207,136,165,227,166,204, -134,144, 18,175,237, 76, 76, 76, 36, 15, 60,240, 0,189, 83,239,159,221,218,207, 34, 25, 25, 25,212, 53,162,221,213, 19,224,163, - 56, 53,103,249,187, 40, 20,234,187, 49,120,141, 25, 51, 6,127,219,148,141,119,107, 42, 49, 40,225, 97, 48,109, 35,237,109,178, - 80,123,234, 94,136, 64, 4, 66,144, 32, 1, 86,101, 45, 67,139,177, 67,209,163, 71,143,223, 53,117, 47,103,221,231,231,231,171, -134, 15, 31, 46,157, 57,115,102,163,126,251,220,185,115,178,189,123,247, 94, 20, 8, 4, 91, 70,141, 26,245, 30,195, 48, 55,226, -226,226,242,156,150,140,139, 71,137, 16, 2,119,207,220,197, 19,160, 60,122,244,232,176,175,214,172,101,130, 4,193,151,146,159, - 78, 30,200, 48,140,246,225, 9,179, 39, 2, 8,119, 16,127, 13, 0,106,181, 90,157,242,234, 41,109,129,146,242,247, 32,248,184, -255,253, 82, 0,154, 66, 97,240, 68, 62,190, 12,112, 82,121, 42, 81,238, 81, 74,216,211,197, 42,157,201, 12,171,205,134, 30,195, -134, 32,198, 58,220, 39, 50,108,202, 96, 20, 46,233, 15, 0, 21,231,233,112,153, 10, 32,141,144,187, 77, 38,147, 9,149, 74,229, -252,165, 75,151,254,211, 69,185, 24,163, 80, 40,124, 74, 68,226,240, 20, 52, 89,242,146, 41,191,165, 56,238, 99,195,215, 55, 69, -169,244, 75,211,127,236,133, 14,234,199,208,248,231, 99, 39,119,130,103,231,143,113,230, 41,231,198,177, 53,153,123, 17,214, 37, -139,132,117, 73,241, 73,102, 68,139,191,171, 15, 94, 4, 97,153, 75, 18,131,222, 94, 7, 32, 76, 44, 83,135,119,132, 79, 43, 70, - 93,250,159,200,161,113, 54,249,188, 42,167, 4, 52,133, 44, 71, 44,128,138,251,222, 88,121,254,174, 44,235,209,163, 7,218,189, -248,162,116,197,238,221,170,146,247,190, 69,138,168, 37, 34, 28,197,123, 12,122, 43,230, 46,120, 13,130,208, 40,236, 88,171,192, - 47,173, 8,198, 53, 34,111,191,205,102,133,175, 49, 64,245,149, 0, 62, 86,190,151,251, 68,206,156, 57,115,131, 82,154,217,187, -119,239,255,171,168,168,208, 9,133, 66, 88,173, 86,218,178,101, 75,167, 71, 69,167,211, 33, 40, 40,200,233, 69,242, 32,111,116, - 97, 97, 33, 88, 43,193,136,145, 3,223,190,124,249,178, 86,163,209, 32, 42, 42,138,237,212,169,147,150,123, 54, 85, 85, 85, 16, -139,197, 32,132, 32, 56, 56,152,151,209,199, 41, 9,245,191,215,247,138, 6,112,159,121, 0,238,148, 82,224, 55, 49, 38,202,212, - 72,148,221, 83,209,164, 14, 37,128,220,129,121,116,155, 76, 38,251,127, 50,153,236,255, 53, 69,251,154,240,122, 73, 83,156,115, - 39, 97,183,234, 1, 71,138,253,122,199, 82, 26, 37,155, 97, 59,171,195,196,157,155,162,153,150, 59,121, 15,154,176,232,138,218, -151,185,122, 47,202,132,223,114, 40,165, 36, 52, 52, 20,147, 39, 79,134,163,124, 47, 74, 93,202,247, 30,220,187,199, 89,190,119, -108,220, 88, 56,148,222, 6,127,111,149,246, 67,242, 92,228,107,183, 19, 19,207,106,130, 60,148,128, 70,227,161,135, 30, 50, 89, -173,214, 60, 0, 58,150,101,169,217,108, 95,248,115,227,198, 13, 0, 64,179,102,246,165,189,220,126,145, 72,228,241,254, 61,250, -232,163,156,140,221, 44,203, 34, 34, 34, 2, 44,203, 58, 87,156, 56, 86,177, 16,163,209, 72, 1, 32, 65,144,246, 25, 0, 0, 32, - 0, 73, 68, 65, 84, 40, 40, 8,132, 16,230,247, 24,219, 3,240, 31,124, 82, 73, 3, 0, 25, 52,104, 80, 64, 19, 11, 32,128, 0, - 2,184,127, 96, 5, 96, 4, 32,110, 98, 35,206, 91,193, 32,222, 21, 5, 3,184, 63, 16,120,152, 1, 4, 16, 64, 0,247, 23,132, - 0,154,241, 32,127, 61,236, 65,220, 77,197, 7, 44, 2,203,254,254,112, 29, 41,128, 0, 2, 8, 32,128, 63, 30, 66, 3,124, 17, - 64,192, 3, 16, 64, 0, 1, 4, 16, 64, 0, 1, 4, 20,128, 0, 2, 8, 32,128, 0, 2,248,179,163,142, 75,103,206,156, 57,126, - 71,112,186, 43,222,115,175,203,139, 30, 18,140,144,224,107, 16, 5, 85,130,101,237,203,194, 4, 2, 6, 12, 17,216,255,103, 8, - 8, 97, 64,137,208,190, 6, 22, 86,108,221, 46, 2,165, 20, 81, 76, 75,248,216,190, 96, 0,173, 96, 15,224,169,129,125,185,151, - 5,142, 57,181,251,241,254, 5,228, 5,228, 5,228, 5,228, 5,228,221,155,242,124, 86, 0,254,108,248,225,192, 89, 12, 27,106, - 65,100, 4,160,209, 18,252,244,139, 24, 66, 70,136, 9,227,109,216,163,106, 13, 66, 24, 16,134,129,184, 57, 48,102, 88, 37, 0, - 33, 30,142,167, 40, 44, 18,218,105,156, 7, 84,135, 14, 80, 0, 16, 81, 11,134,143, 26,115,241,204,175, 63,154,202,171,141, 49, - 54,189, 17, 50,153, 44, 2, 64, 85, 64, 15,189,191,145,251,245,127, 36, 61,123,116, 87,221,184, 97,108, 84,194,167,251, 8,146, -244,244,116,215, 60, 0,141,186,230,244,244,116,191,211, 1, 7, 16, 64, 0, 77,228, 1,224,176,246,171, 47,121,107, 19,207,206, -156,229,245,101,109,106,121, 77,137,194, 34, 17,146, 18,109,248,229,215, 16, 4,137,132, 16, 10,132, 16,137, 40,130, 5, 22, 64, -216, 28, 66, 24, 48,172,159, 21,226,160, 96, 80, 0,237,219, 2,143, 77, 96,177,119, 11, 63,242, 63,251,219, 25, 60,208,183, 7, - 58,116,140,192,229,139,167,186,134,183,235,142, 86, 29,108,248,254,187,239,160, 84, 42, 43,239,246,250,120,165, 82, 57, 33, 39, - 39,103, 59,183,157,146,146,242,168, 76, 38,219, 30,120, 53,188,227,215, 95,148,212,106, 60, 33,157,246, 88, 15, 21,203, 86,160, -170,131, 65,117,234,248, 38,212,154,218, 99,104,236,168, 63, 44,137,165,167,167,171,230,205,155, 7, 66, 8,175,178,189,124,192, - 37,139,105,130,114,243, 1, 52, 82, 1,243, 8, 74,145,189,106, 85,131,207,155, 75,240,227,154, 45,144,171, 33,224, 82, 75,192, -249,156, 93, 43, 35, 6,208,180,224,178, 1,114,112,151, 27,224,158,242, 0, 48,248,125,251,193,132,113, 22, 80, 8, 32, 20,136, - 48, 98, 56, 65,155,214, 12,132, 66, 6,193, 34, 1,122,199, 48,184,120,201,138, 97,177, 12, 90, 70,137,241,253,190, 22, 0, 0, - 1, 53,192,158, 10,219,230,149,252,127, 45, 42, 66,183, 14,157,240,107,126, 1, 14,155, 45,208,222,212, 34, 40,184, 57,250, 12, - 30,137,129, 35,199, 65,181, 53, 7, 0,191,220,248,119,128,248,199,228,228,228,236, 93,184,112, 33,138,138,138,184, 14, 83, 9, -224,197,217,179,103,111, 75, 73, 73,145,201,100,178,189,127,184,151,226, 39, 37, 13, 22,106, 32,100,204, 48, 26,109,168,210,133, -224,225,209, 83,124,186,255,155,114,191,146,180, 8,209,224, 47, 83,135,160, 91,215,199, 84, 45, 90,132,195, 98,181,226,198,141, -155,104, 91,122, 9,197,231, 74,112,232,160,134,142, 24,249,184, 95,207, 53, 59, 59,155,186, 12,206,247,218,224, 40, 1,110,149, -195,117, 84, 7,148,224, 46,165, 3,254, 29,223, 23,186,121,243,230,219,235, 41,220, 53,242,162, 18, 2, 2,218, 4,247,157,150, -126, 13,114,120,182, 43,199, 59,178,100, 58,170, 33,185, 96,118,150, 14,195,166,126,234, 81,145,251,254,251,239,157,219, 73, 73, - 73,216,185,115,167,199,237, 0,238, 60,249,187,238,115, 85, 4, 60, 42, 0, 7, 15, 28,198,200,135,135,255,110,141,102,125,200, -159,234,154, 74,210,223,236, 83,140, 80, 0,173, 70,136,118,109, 68,104,215, 38, 8,181,181, 34,136, 69, 66,216,132,193, 24, 50, -128, 96,208,131, 2, 48, 68,100, 79,129, 41, 10,130,136, 49,129,136,131, 96,213, 3, 86,232, 60,146,255,129,125,123,209,189,125, -107, 28,255,229, 56, 22,189,247,118,157,246, 45,121,231, 3,202, 8, 8,134,196, 14,193,247, 59,247,250, 84,121,143,101, 89, 73, - 81, 81,145,234,236,217,179, 8, 9, 9, 65, 72, 72,136, 52, 41, 41, 73,237,227, 96, 38,205,201,201,217,203, 17,191, 75,231,136, - 0, 48,238,223,255,254,247,205,217,179,103, 43, 1, 36,202,100, 50,229,189,216,193, 87,175, 94, 45, 73, 75, 75,227,125,221,255, -219,184, 86,210, 63,166,185,170,107,123, 35,194, 91, 4,131, 97, 66, 97, 48, 88, 81,161, 49, 32, 79,185,130,138, 91, 12,193,240, - 97,163,121,245, 35, 17,174, 97,242,163, 15,170,250,245,235,131,171,215,180, 56,242,211, 81,212,214,234, 16, 30,222, 28,209,209, - 93,193, 8, 68,176,217, 74,241,211,207, 7,232,224, 65, 15,255,161,172,155,244,244,116,213, 75, 47,189,228,220,158, 55,111, 30, -150, 47, 95,174, 90,229,193, 42,244,137,140,238, 81, 15,128, 67, 73,167,185,185,185,112, 87, 88,233,247,132,171,149,173, 80,100, - 73, 41,109,156, 18,192,116,125,202, 73,222,133, 31, 54,115,107,134,181,139, 96,208, 49,138,185,111,159,223,159, 21,174,100,239, - 78, 41,240,234, 1, 56,120,224, 48, 0, 52, 90, 17, 56,240, 98,177,199,227, 15,255,171,167,223,131, 5, 33,196,175,106,123, 74, -117, 27,136,132, 34,116,238, 80,139,154, 26, 17,142, 28,239, 12,129, 64, 0, 1, 17, 32, 72,100, 69,191,158,122,244,234, 41, 0, - 1,131, 32, 81, 48,130, 4, 4,177, 15,154, 17, 21,201, 98,253,255,121,150,221,167,123, 91, 92, 60, 87,126, 27,249, 3,192,162, -197,175,147, 15,222,251, 39,109, 31,255, 32, 34, 35,154,243,110,175,193, 96,144, 44, 95,190, 92,117,241,226,197, 58,250,134,201, -100,194,227,143,243,183, 54,115,114,114,246,185,146,191, 27,180,202,204,204,172,124,249,229,151,247,220,237, 41,138,134,200,255, -240,225,195,170,180,180, 52,222,109,139,137,142, 82,117,108, 91,141, 86, 45,195,208,169, 99, 59,132,134,133,226,226,197, 50,216, -108, 44, 58,118,104,142, 19,191,229, 99,205,233, 98, 73,234, 51,179, 60, 14,166,199,142, 29,160, 79, 78,234,131, 46, 93, 58,225, -228,111, 23,113,228,200,111,184,113,179, 6,148, 2,145,145, 33,208,235,107, 49,120,112, 63, 84, 86, 86,161,236,200, 79,248,234, -191,103, 36, 51,255,194, 95, 81,185,199, 33, 1,236,197,167, 56,124,242,201, 39,220,182, 79, 94,128,244,244,116,234,234, 18,118, -181, 32, 93, 93,210, 77, 49,189,240,222,123,239,209,206,157, 59, 55, 58, 23,191, 76, 38, 35,132, 16,186,105,211, 38,143, 57,246, - 57,100,100,100, 80,119, 30,130, 53,107,214, 72,184,226, 64,238,148, 88,185, 92, 78, 27, 74,229,234, 90,207,129, 82, 10,185, 60, - 67,213, 24, 47, 68,125,121,195, 94,171,197,143, 31, 54,171, 67,252, 1,220,159,214,127,253, 62,212,168, 41,128,198, 42, 2, 15, -255,171,103,131, 74,128, 63,228,207, 33, 47, 47, 15,101,101,101, 0,128,142, 29, 59, 82, 95,148, 0, 1, 53, 64, 72,108, 8, 18, -137,240,211,241,214, 16, 8,133,104, 46,210,217,227, 0,154, 49, 40, 43,107,142, 7,251,177, 32,132, 32,229, 49, 43, 40,203, 0, - 36,216,238,120, 67, 77,131,114,245,149,151,112, 77, 83,139,151,223,122,171,193,182, 84, 86,105,160,189,113,205, 33,139, 55,113, -215, 39,127, 0,192,142, 29, 59, 96,179,217, 36, 79, 62,249,164,215, 1, 78,169, 84,142,169, 95,250,151,235, 48, 85, 85,117,226, - 17, 35, 22, 47, 94, 12,165, 82, 57,246, 94,154, 10,224,200,223,151,191,249,223,198,181,146, 7, 99, 76, 8, 9,137,128, 56, 56, - 8,221,187,119, 67,231,110,221, 80, 93,173,134, 70, 83,139,160, 32, 1,162, 34,197, 16,134, 68,120,204, 21, 15, 0, 66, 90,134, -230,205, 90, 66,111,176,226,248,241, 98, 92,185, 86,133,171,215,106, 97, 48,137,209,165,163, 21,226, 96, 1,138,207,148,224,129, - 30, 61,112,229,106, 53, 12,214, 22, 94,101, 58,136,142,122,219,239,235,116, 64, 67, 50,253,145,197, 89,255,243,230,205,187,109, -255, 75, 47,189,228, 87, 44,128, 59, 18,173, 63,119,220, 84, 94,133,252,252,124, 21, 26, 89,144,103,239,222,189, 52, 39, 39, 7, - 41, 41, 41,112, 55, 29,192,199, 83,197,145, 63, 0, 20, 22, 22,170, 24,134,169,211,166, 53,107,214, 72,248, 24, 61,241,241,241, - 82, 78, 78, 83,120, 92, 54,189, 20,134, 41,203,117,110,137,191, 99, 20,227, 24,165,248, 61,222,164,164,164, 58, 94,146, 71, 30, -121,164,206,189, 10,184,253,239, 29,248, 28, 3,208, 84, 30,129,166, 68,113,177, 93,177, 40, 43, 43,243, 73, 9, 16, 10,133, 16, - 9, 68, 16,137, 8, 70,143, 4,244, 58, 19,206,159, 11,130, 72, 40,130,208, 38, 68,220,112,138, 32,145, 8, 2, 1, 3, 80, 2, -141, 22,248,241,168, 16, 44,203, 2,184,209,160,220,163, 63,157, 67,109,109,195, 25, 56, 63, 90,188,152, 6, 7,139, 97, 48, 84, -193,198, 90,121, 95,231,209,163, 71, 27, 86, 58,244,122, 94, 68, 83,223,245,239, 78, 51,220,186,117,171,235,249,202,187,225, 5, -112,231,226,119, 37,255,248,248,120,222, 85,232, 58,117,108,171, 98,152, 75,176,218, 88,152, 45, 86,220,184,169,129, 40, 72, 12, -147,201, 2,139,213, 6,171,149,133,213, 70, 81,169,189,233, 85, 86,144, 72, 7,113, 72, 39, 84, 84, 84,161,186, 70, 15,141,214, -128, 22, 45, 7, 98,196,131, 15,162,240,224, 78,116, 48, 91, 81, 85, 93,133, 94,189,122, 32, 56, 72, 8, 93,141,230,143, 50, 86, - 72, 40,165,206,185,127, 87,172, 88,177,194,175, 88,128,121,243,230,213,241, 38,212, 63,198, 87, 1,176,151,122,230, 44,218, 40, -140, 29, 59,182, 78,127,229, 12,132,210,210, 82,149, 82,169,244,171, 48,149, 82,169,116,146, 63, 55, 29,176,121,243,102,175,228, - 90,223, 83,149,159,159,175,226, 2,223,228,114, 57, 45, 40, 40, 80,165,166,166, 58,143, 23, 20, 20,168, 8,241,220,188,248,248, -120,169,107,153,225,140,140, 12,234,233, 94,121, 27, 15, 83, 82, 82,144, 28,175,196, 70, 0, 83,151,235,240,208,107,181, 30,239, -253,176,169,158,239, 85,253, 57,126,111, 49, 1, 1,220,121,111, 64, 67, 30,128,223,213,191,227,206,210,111,140,245, 95,207, 98, - 69,113,113, 49, 86,172, 88,193,187,212,164, 64, 32, 68,220, 48, 22, 2, 70,136, 31,139,196, 56, 93, 44,198,196,241,192,163,143, - 0,147,146, 8,218,183, 13,130, 56, 40, 24,226,160, 96,132,136,131,209,177,125, 48,196, 65, 98,136,131, 60,151,196,124,115,209, - 27,100,233,135,239,146,134, 6,146, 30,221,187, 34, 60, 34, 12, 98,214,140, 90,189,229,119,239, 20, 7, 14, 28,216,123,224,192, -129, 58,132,239,250, 1,128,138,138, 10, 76,154, 52,233,174, 89,249,133,133,133, 42, 87,107,136,219, 7, 0,195,135, 15,247,201, -146,179,217, 0,157,222, 2,157,206,140,234,106, 19,174, 95,215,226,202,149,155,168,169, 49,161,182,214,130,218, 90, 51,116, 58, - 11,170, 42,189,175,200, 52,153,172, 48, 26,109,176, 88,204,104,222, 60, 8,157, 59,182, 64,104, 88, 24, 0, 32,186, 71, 55,116, -234,208, 2,225, 45,196,160,212, 6,139,149,133,201,164,251, 67, 12, 36,233,233,233,170,249,243,231,123, 36,115,110,105, 32, 79, -239,132,212,161, 52,184,197,242,229,203,177,106,213, 42,159, 75, 13,219,221,226,114,234,250,225, 8,181,172,172, 12, 57, 57, 57, - 62,151,162,221,187,119, 47,205,205,205,117, 37,127,200,100, 50,146,156,156,236,241,239,230,204,153, 3, 66,136,211,170, 95,189, -122,181, 4, 0,226,226,226,164,174, 74,172,235,113, 74,169,243, 56,143,171,173, 99,197,187, 83, 28,188, 41, 19, 0,208,170, 85, - 43, 16, 23,235,161,177,242, 2,184,247,200,223,221,182, 95, 30,128,123,201,242,191, 53,192,219, 32, 16, 8,124,254,187,145,195, - 88,180,105, 29,140,234,106, 33,130,133, 86, 4, 7, 9,160, 62, 28,132,137, 82, 17,130, 68, 34, 84, 87,139,112,176, 40, 12, 45, -196, 4, 12,195, 32, 73,102,198,227, 19, 41, 24,134,226,253,159,125,111,167, 82,169,164,130, 80, 49, 52,162, 86, 8,181, 92,198, -217, 50,138, 49,146,209,188,255,126,240,224,193, 56,116,232,144,219, 99,161,161,161,188, 7, 75,173, 86, 59,214, 49,240, 32, 53, - 53,213,185,191,162,162,194,249, 61, 53, 53, 21,229,229,229,119,229,121,166,165,165,169, 11, 11, 11,145,159,159,175, 98, 89, 86, -202, 48, 12, 56,203,191,161,121, 83, 79, 40,189,116, 69,218,186,133, 94, 21, 28, 36,128,217,194,194,104,186,140, 75,151, 43,160, -209, 86, 67,163,209,163, 66, 99, 64,133,198,128,136,168,110, 94,101, 93,191, 73,113,237,250, 77,244,233,211, 3,149, 90, 45, 68, - 66, 6,213, 53,151,161,171,100,209,247, 1, 29,218,182,110,141,208,208, 80, 4, 7,135,224,234,181, 26, 16, 65, 36, 95,130, 37, - 46,228,216, 36,171, 0,154,122, 5, 65, 67,214, 58, 80, 39, 22,128, 47,212, 0, 48,119,238,220,219,188, 10, 46,211, 12,106,127, -218, 57,101,202,148, 58, 22,108, 78, 78,142,147,188,158,122,234, 41, 36, 38, 38, 18,190,137, 83,220, 88,254, 78,212,247, 52,212, -199,160, 65,131, 8,165,212,105,229, 23, 22, 22,170, 8, 33,206,210,192,169,169,169,234,252,252,124,228,231,231,171, 82, 83, 83, -201,225,195,135,157,199, 87,174, 92,217,160,220,252,252,124, 21,195, 16,105, 65,129,253,157,152, 51,103, 14,126,254,249, 39, 41, - 71,225, 5, 5, 5, 42,238,250,249, 40, 19, 43, 87,174,196,231,210, 72, 76, 93,161, 7, 96,159, 14,112,197,212, 21,122,231,253, - 76,147,138, 2,204,122,191, 40,237, 11, 63,170,171,116, 47,125, 21, 63,255,252, 51,255, 85, 0,119,130,248, 93, 99, 1, 26, 99, -253,215,181,228,235,146,127, 82, 82, 18,228,114,185,215,169,128, 86,173, 4, 96,136, 0,173, 91, 9,208,179, 7,197,149, 43, 66, - 48, 2, 2,145, 80, 8,145, 80,132, 95,143,133, 33, 42, 76, 4,129, 64,128,145,195,109, 8, 9, 9, 6,203, 82,128,218,252, 34, -255,102,109, 59,227,122, 45,133,238,172, 26, 66, 34,192, 43,139, 23, 17, 31, 7, 54,233,165, 75,151, 84,151, 46, 93,186,237,122, - 39, 79,158,204,107,176, 76, 73, 73, 73,172,168,168,216,195,145, 60, 0, 76,154, 52, 9,107,214,172,113,158, 83, 93, 93,141,242, -242,114,108,219,182, 13, 41, 41, 41, 99,238, 70,231,141,139,139,147,230,231,231,171, 10, 11, 11, 85, 92,176, 88, 92, 92,156, 95, -115,184, 51,255,146,166,222,240,191,108,208,178,106,232, 13, 22,104,131,141,160,208,194,104,180,162,186,218,132,242,155,122, 92, -185, 90,139, 81,210,174, 94,101, 25,204,173, 80,114,254, 6,162,187,119, 65,247,238,157, 80, 81,113, 19,145, 17, 54,244,236, 25, -142, 54,173,163, 33, 14, 9, 65,101,101, 45,142, 28, 61,133,203,101,213,104,215,169,223,125, 59,128, 80,128, 18, 2, 41,199,165, -174,164,234,105,221, 62,117, 4, 11,222,110, 62,162,206,170,178,236,236,108,233,138, 21, 43, 84,245, 21,128,101,203,150,113, 9, -134, 60,202,163,148, 82, 66, 8,145,203, 35, 93,218, 68,111, 35,230,156, 28,251, 20, 65,114,114, 50, 47,247,127,221, 41,133,189, -110,201,159, 47,226,227,227,165, 5, 5, 5, 42,206,235, 48,114,228, 72,169,187,227, 92, 48,158, 55,194,230,230,214, 15, 30, 60, -164, 34,132,128, 16,130, 65,131, 6, 74, 7, 13, 26,164,118, 81, 16, 28,231, 2,222,222, 23, 78, 30, 51, 69, 11, 78, 94,202,152, -110,117, 30,212,148,229, 39,157,242,248, 32, 16, 3,112,255,192,171, 2,112, 47, 90,252, 28,166, 77,155,214,168,191,103, 24, 6, - 2,129,253,211, 39,134,193,224, 1, 54, 4, 7,137,237, 10,128, 72,132, 17,195,129,224, 96, 64, 36, 8, 70,171, 86, 98, 8, 4, - 58,216,108, 44, 88,214,119,183,189, 94,115, 13,226, 78,189,113, 94,249, 95,180, 22, 50,120,102,209,235, 62, 15, 40, 33, 33, 33, -234,215, 95,127, 93,218,152,101,128, 50,153, 76, 41,151,203,241,194, 11, 47, 56,247,113,150,126,117,117, 53,244,122, 61,210,210, -210, 0, 0, 95,124,241, 5, 20, 10,133,234,110, 60,219,212,212, 84, 53,203,178, 82,206,242, 31, 54,108, 88,163, 2,184, 58,117, -237,133,162,130, 93,104,211, 42, 20,161,161,246,110,111, 50,217, 80, 93, 99,134, 70,107, 64,231,238,253,240,240,136, 4,175,207, -100,194,132,167,200,238,239,255,143, 22, 20,158,192,168,145, 3,209,181,107, 87, 88,204, 70, 12, 30,244, 32,194,194,195,113,177, -164, 20,101, 87, 42,113, 48,255, 55,104,107,194, 49, 57, 62,225,190,245,153,206,201,144, 3,128, 10, 32,152, 35,151, 59, 9,156, -173, 71,250, 12, 67,236,218,130,131,151, 9,128,129,110,230, 27, 51,228,114, 10, 10,151, 72, 21,130,244,244,244, 58, 94,128,185, -115,231,130, 16,130,140, 12,185,138, 99,127, 16, 96,224,192, 65,238,200,203,233,142,247, 70,114,124,201,191, 62,146,147,147, 49, -118,236, 88,105, 99,250, 49, 28,115,245,195,255, 63,123, 95, 30,222, 68,181,191,255,206,100,239, 74, 91, 74,203, 94, 40, 84,144, -173, 64, 69, 68,150, 4,202, 34, 75, 69,160, 40,139,124,145,235,109,192,237,178, 92, 69,209,251,243,222,171,160,184, 0, 94,185, - 66,203, 85, 81,161, 98, 91, 5, 11, 22, 10,133,132, 69,212, 74,169,236, 88,160,172, 45,116, 77,211,166,217, 51,231,247, 71, 58, - 49, 13,105, 51, 73,195,234,188,207,147, 39,201,204,228,147,153, 51,115,206,251,217,206,231, 60,252,176, 98,206,156, 57,234,166, -246, 59,197,246,155, 4,155, 59,192, 42, 95,246, 48, 2,165,118, 85, 42,184,158,159,171,188,140, 69, 65,246, 70,151, 70, 57,142, -201, 88,116,197,161, 16,228, 30,107,126,236,115, 87, 7,128,207, 1,184, 71, 21,128, 33,143, 14,186, 37, 49, 31,127, 89,254,206, - 15,146, 47,168,214, 80,104, 27, 69, 59, 74,254,238,222,107,143,239, 75, 36, 82, 72,196, 18, 76,122,140,130, 84, 34,134, 76, 74, -161,186, 74,128,252,130, 96,216, 24, 27, 58,118,240, 46,174,155,151,151, 71,106,244, 6,104,142,228,160,123, 71, 17, 78,150,248, - 30, 23,166,105, 90, 61,104,208, 32,106,208,160, 65, 62,203, 72, 78, 78, 86,172, 93,187, 86,197,186,249,171,170,170,158,124,248, -225,135,117,123,246,236,249,225,241,199, 31, 31, 83, 85, 85, 69, 61,253,244,211,185,201,201,201,138, 59,249,112, 54,184,250, 21, - 78,159,125,127,230,236,228, 78,138,206,158, 70,105,241,101,208, 52, 5,155,141, 64, 42, 11, 71, 92,207,222,120, 98,114, 50,231, - 7,189,180,130, 81, 84, 87,149,170,140, 70, 43,250,244,238,138,246,237, 90,227,202,213, 50,104, 78, 92,192,239, 69, 87,176,119, -223,113, 92, 46, 33,120,246,175, 47,250,212,121,238,150,226, 63,204, 55, 97, 62, 31,215,127, 5, 71,121, 23, 62,199,154, 53,107, - 28, 10,192,154, 53,107,128,226,141, 55, 29,235, 78, 94, 19, 94,129,155,198,172,150, 22,235,161, 40,170, 69,207, 30, 75,242, 77, -145,187,167,253,238,188, 10, 46,191,117, 39,143,251,125,190,252, 45,178,214,204,177,143, 13, 35, 59, 53, 34,127, 0, 72, 30,255, -144,253,131,230, 55,143, 10, 0, 95, 7,224,238, 65,218,202, 87,111, 10, 3,120,165, 0,220,205, 9, 31,190, 22,255,113,198,145, -163, 18, 72,197, 98, 76, 26, 79,129,166, 40, 12, 74,176,226,196, 73, 25,104,202, 30,243,175,169,161,209, 46, 90, 0,154, 18,227, -216, 9, 49,164, 18,192,108, 49,227,242, 21,153, 87,228,127,161,168, 16, 15,143,154, 8, 97,235,135,113,161, 40, 31,194, 27, 89, -120,229,229,215,200,123,239,191,115, 71, 26,184,161, 94,189, 34, 33, 33, 65,181,116,233, 82,244,238,221,187, 92,163,209, 32, 33, - 33, 65,161,209,104,240,210, 75, 47,169,146,147,147,239,138,186,246, 45, 37,126, 87, 37, 96,232,144, 17,216,248,213,167,242,182, -209,109, 85,129,129,129,156,172,254,155, 6,216, 57,127, 81, 3,160, 54,111, 74, 37,167,127,255, 5,109,163,130, 32,149,138,160, -211,153, 81,114,189, 22,148,176, 35,158,253,235, 28, 62, 91,138, 11,142, 46, 1, 98,159, 65,163,233,133, 5,139, 91, 66,214, 45, - 62,165,249,243,195,157, 20, 9,255, 16,154, 39, 82,246,134,180, 91, 90,207,192, 93,155, 37, 63, 34,177, 95,171,225,186,253,197, -227,158, 69,124,124,188, 35,225, 47,109,229,171, 55,237,243,168, 0,248,187, 30,255,237,174,239,239,213,195, 15, 10, 26, 13,133, -128,104, 10, 17,225, 20, 18, 6, 88, 32, 21, 11, 32, 17, 91, 16, 17, 46,109, 24, 4, 40, 12, 78,176, 33,255,168,200,238, 45,224, - 56,200,228,229,229,145, 94, 15,132, 96,201,223,254, 13,131,184, 3,190,203, 43, 65,108,156,221,114, 15,250,117, 7,150,252,253, - 53,242,225, 7,119, 78, 9, 72, 76, 76,164,242,242,242,228, 43, 87,174, 84, 57,123, 7,252,161, 92,221,205,104, 40,246,211,226, -107,156, 53, 91, 73, 29, 58,188,159, 84, 84, 85,192,112, 67, 15,169, 52, 2, 29,186,244,245, 73,169,184,215, 96, 47,135,237,167, -203, 44,222, 8,199,140,128,226, 47,238,248,181,121, 74,238,187,223, 48,102,226,147, 94, 89,238,158,124,143,124, 14,192,221,165, - 4, 52, 69,254, 30, 61, 0,127, 6, 16,216,179,250, 41,154,128,128, 32,188, 21,193,254, 67, 66, 72,197, 34, 72,196, 66, 36,141, - 39, 32,132, 65, 88,132, 21, 86, 27, 5,134,177, 53, 12,126,158,209, 55, 70,135, 9, 83,147,161, 19,118, 71,155,160, 64,204,124, - 34, 28,233, 91, 79, 56,148, 0,139,237,187, 59,126,253,172, 34,192,119, 25,223,189, 10,247,235,181,165,105,222,165, 82,194, 94, -189,153, 25, 50,195,125,149,135,148,176, 87,111,222, 81,176,184, 69, 86, 63,143,150, 97,218,243,107,253,246, 12,223,239,198,195, -189,166, 4,120, 52,128,227,227,227,249,160, 13, 15, 30, 60,120,240,224,241, 39, 3, 95,232,153, 7, 15, 30, 60,120,240,224, 21, - 0, 30, 60,120,240,224,193,131, 7,175, 0,240,224,193,131, 7, 15, 30, 60,120, 5,128, 7, 15, 30, 60,120,240,224,113,127,160, -209, 44,128, 5, 11, 22,248,156,193,233,174,182,182,191,229,205,154, 55,223,227,239,234,171,111, 56, 62, 7,134, 71, 59, 62,111, -254,108,253, 77,199, 70, 42,158,245, 40,111,207,234, 63, 42,230,141, 94,180,214,241,185, 66,245, 63,248,114,126, 77,193,215,243, -107, 10,238,206,111,242,211, 74,143,191, 59,162,250, 1, 49, 49, 49,184,116,233, 18, 18, 20, 19, 28,219,183,125,149,122,203,219, -239,217,235,215,155,125, 94, 76, 66,161,124, 73, 73,137, 99,202,226,218,168, 40,199,241,255,107,219,246,150, 63,127,174,242,178, -179,179,229, 57, 57, 57,141, 42, 37,142, 31, 63, 94,145,148,148,164,190, 19,253,163,176,176,208,103,121,253,251,247,191,213,231, - 71, 45, 88,176, 0,119,243,248,114, 39,228,165,167,167,207,232,211,167, 79,250,137, 19, 39,166,206,156, 57,243,187,150,202,115, - 94,232,200, 57, 35,255,126,109, 63, 94, 94,211,242,188, 86, 0, 92, 97,181, 90,229, 70,163, 17,148, 64, 4,138,162, 96,179, 90, - 32, 22, 9, 33,145, 72,212, 45,213, 60,172, 86,171, 28, 0,132, 66, 97,139,100,213, 87,223, 64, 96,120,180,131,248,163, 59,198, - 0, 0,110, 92,189,228,147,188, 61,171, 95,192,232, 69,107, 29,196,245,223,236,124, 0,192,243, 73,131,112, 63,226,136,234, 7, - 36, 40, 38,224,136,234, 7, 0,192,132,105,179, 0, 0,151, 46,221,249,246,251, 79, 89,153,188, 8, 80,197, 1,138, 34,192,190, -134,250,210, 87, 0, 0,131, 86,190,119, 71,219, 77,173, 86,147,156,156, 28, 24,141,198, 70,219,165, 82,169, 42, 36, 36, 4,114, -185,252,174,156, 14, 69, 81,212,208, 7,186,180,255,130,216,108,250,162, 43, 55, 94, 35,132,236,224,237,160,102,148, 78,147,105, -100, 97, 97, 97, 72,105,105,105,116,120,120,120,171,129, 3, 7,150, 4, 7, 7,127,229,171,188,244,244,244, 81, 51,103,206,220, -159,158,158,254, 44,128,208,167,158,153, 63, 15, 0,115,226,196,137, 57, 0,182, 1, 96,188,145,199,174,121,194, 18,127, 75,250, -155,235, 42,137,254,154,210,215,148, 82,194,227, 46,243, 0, 56,163,182, 78, 39,111, 27,247,144,106, 68,159, 30, 8,144,136, 64, - 8,129,205, 70,112,242,220,101, 92, 60,126, 80, 33,147,136, 32, 16, 8,124, 34,239, 32,233, 37,121,175,238,197,170,147, 69, 93, - 21,245,166, 24,159,137, 31, 0,100,161, 17,168,175,190,225, 32,254,230, 60, 2, 92, 44,213, 65,179, 94,197,158,213, 47, 56, 58, - 82, 83,199, 53, 55,199,210,245, 63,197, 98, 49, 0,123,153, 76,134,177,247,111,155,205,230, 56,127, 90, 32,226,108, 69, 3, 64, -219, 54,246, 82,157,230,218, 26,152,172, 86, 0,128,206,106,151,215,101,204, 95,208,173, 87,127, 78,196, 15, 0,253,134,140,194, - 17,213, 15, 14,226,111,234,184,219,217,126, 0,240, 66, 89, 25, 1,128,177,129,129,200,173,175, 87,177,196, 15, 0,191,239,222, -115,211,113,241,109,219,114, 58, 79,109, 96,165,188,160,242, 87,148, 92, 57,134,238,157, 7, 99,176, 84,238,245, 51,156,157,157, -253,248,206,157, 59, 89,242,183, 2, 48, 2, 8, 0,192, 24,141, 70,161, 76, 38, 67,109,109,173,220,157, 39,224, 14,147,127,212, - 67,241,125,118,230,126,189, 62,168,190,228, 12,134, 38, 47, 72,167, 40,106, 14, 33,100,219,221, 54, 48,229,229,229,145,150,212, -167,224,178, 24, 88,115,176, 88, 44,242,252,252,124,213,169, 83,167, 28,219, 42, 43, 43, 81, 84, 84,132,182,109,219,126, 41,151, -203, 21,193,193,193, 92,239, 47,157,158,158,254, 47, 0,143, 12, 29, 59, 89,150,158,158, 30,245,212, 51,243,131, 1,216, 0,176, - 15,238, 3, 13,199, 13,231,122,125,108,127, 83, 42,149,164,169,254,198, 30,231,169,191, 41,149, 74,114,224,167,124, 8, 4, 66, -216,108, 86,104,235,116,152, 57,245,113,242,193, 7, 31,180,136,176, 93,149,138,150,222, 23, 30,158,225,110,217, 95, 22,156, 42, - 1,214, 27,204,242, 81, 73, 51, 85, 29,219,132, 34, 64, 42, 4,195, 48,176, 49,128, 80, 64, 33, 60,180, 7,122,117,239,164,202, -203,253, 65, 97,179,212,203,189, 85, 2,204,102,179,188,103,175,139,170,126, 61, 46, 66, 64,219, 84,234, 35,237, 21, 98,145,200, - 43, 25,245,213, 55, 32, 11,141, 64,104, 72, 48, 0, 56,222,221, 29, 23,221, 49,198,163, 55, 96,207,234, 23, 48,104,214,171,248, -191, 39,167, 0,128,227,221,221,113,255,205,206,247, 74,187, 22, 8, 4,232,208,161, 3, 4, 2, 1,204,102, 51,234,235,235, 97, -179,217,160,209,104,124,186,185, 65, 66, 1, 62, 91,179, 21,146, 80,160,236, 18,240,171,174, 4, 21, 55,206,227,171,213,175,121, -101,245,247, 27, 50, 10, 29,218,217, 67, 36, 29,220,144,127, 76, 76,140, 35, 28, 0, 0,215,174, 93,243, 75,251,113, 41,174,250, - 66, 89, 25, 25, 27, 24,136,183, 94,120, 30, 0,240,150, 19,241,111, 42, 42,106, 76,254, 94, 84,107,221,127,105,147,188,243, 51, - 66,213,171,157,102,195,196, 36, 66,194, 16,156,169,220,139,207,223,207, 80, 76,235,155,202,245, 25, 20,230,228,228,108, 51, 24, - 12,216,184,113,163,113,238,220,185, 82, 0, 65, 0,152,141, 27, 55,154,231,206,157, 43, 52, 24, 12,144, 74,165,170,164,164,164, - 22, 13,116,223,125,247,157,124,247,238,221,170,150,214,178,119, 60, 59, 98,250,255,125,252,214, 43,178, 86,167,191,134,236,247, -125,248,231,200,176,224,151,182, 87,252,187,193,242,188,171,200, 63, 35, 35, 3, 26,205,104,146,153,153,236,245,181,127,246,217, -103,242,150,144, 77,125,125,189, 60, 59, 59, 91, 85, 87, 87,231,118,255,245,235,215,145,149,149,165,234,217,179,167, 98,240,224, -193,158,158, 27, 42, 61, 61,253,171,161, 99, 39, 79, 47, 42, 60, 44,236,208, 46,218,250,212, 51,243, 27,141,187,251,126,248, 14, -125,250,244,233,145,158,158,254, 88,159, 62,125,178, 1,224,208,161, 67,205,146, 42,151,254,166, 84, 42, 9, 40, 10,240, 80,229, -111,253,250,245,228, 70,121, 37, 10, 79,158,118,108, 51, 26, 77,120,239,227, 52,157,114,238, 12,158,176,239, 99,220,148, 4, 88, - 87, 87, 39, 31, 58,230, 9, 85,143, 78, 17,144,136,104, 48, 12,131, 27, 55,110,224,196,177, 66,152,173, 12, 24,134, 32, 34, 52, - 0, 99, 30,155,168, 50,152,172, 94,255,161, 68, 84,142,216, 78, 55, 0, 1,133, 7,187, 95,133, 68, 88,230,181,229,239, 76,254, - 55, 89,120,181,117,184,113,245, 18,100,161, 17, 77,122, 5,154, 35, 47, 87,124,241,205,119,120, 62,105, 16, 6,205,122,181, 73, -171,214, 29,196, 98, 49, 4, 2, 1, 66, 66, 66, 80, 92, 92, 12,141, 70, 99, 87,164,124, 36,255,182,109,162, 16, 36, 20,224,137, - 23,223,198, 99, 51,135, 96,199,201, 18,220, 48,160,197,228,239,138,107,165, 55,112,234,200,143,136, 12, 11,177,147,191, 80,224, -151,246, 27, 55,245,255, 0, 0, 97, 66,145, 87,228, 15, 0,255, 88,251, 95,252, 99,237,127, 29,228,159, 91, 95,143,151,199, 76, -180,239,140, 20,115,186,238, 47, 46,191, 43,255,235,146, 71, 84,207,116,126, 14, 34, 58, 8,129, 8, 0, 13, 1,218, 71, 61,138, - 23,222, 90,172, 42,110,183,154,147, 26,161, 86,171, 45, 0,240,197, 23, 95,232, 1, 72,217,101,148, 55,110,220,200, 0, 8,112, - 94, 86, 89,173, 86,251, 20,151,211,235,245,114,111,182,115,176,252,135, 62, 52, 32, 94,159,249,221, 86,101,255,222,113,130,250, -211,123,113,169,188, 14,215,107,244, 96, 8,241, 41, 17, 56, 37, 37,133, 36, 39,103,146,205,155, 55,251,181,144,152, 19,249, 35, - 60, 60,207, 39, 25,249,249,249,170,212,212, 84,138,162, 40,135, 50,224,229, 57,220, 68,254, 71,142, 28,193,204,153, 51,157, 61, - 4, 56,123,246,172, 74,175,215, 55,187, 96, 86,122,122,250, 11, 67,199, 78,158,184,124,217, 34, 97,102,102, 38,254,247,241, 7, -194, 6,143,145,131,252, 51, 51, 51,177,118,237, 90,244,233,211, 39,219, 83,127,115, 37,255,166,250,219, 99,143, 54,120, 1,131, - 3, 61,202,251,240,227,117, 14,242, 47,175,172, 66,121,101, 21,180,117, 58,136, 68,194,160,117, 27,191, 54,186, 90,241, 60,238, - 13,196,199,199,223,244,106, 86, 1,176,217,108, 36, 34,166, 47, 98,162, 91,193,104,177,129,162,128,220,220, 93,248,242,139,141, - 56,126,236, 24, 94, 94,188, 16, 2, 1, 13,198,198, 32, 36, 64,130,152,190, 67, 85, 6,131,129,115, 7,179, 88, 44,242, 94,221, - 47,171, 66,130,244,248,236,139,114,208, 20,193,160, 62,191,171, 44, 22,139, 87,157,212, 29,249,179,196,111,208, 86, 53, 82, 16, -180,181,117, 30,229,185,235, 76,108, 71,202,223,252,110, 35,130,251,226, 27,110,229,123, 99, 99, 99, 17, 17, 17,129,218,218, 90, -136,197, 98,208, 52, 13,131,193, 0,141, 70, 3,129, 64,192, 14,204,156,175,249,219,109, 91,177,112,205,110,108,253,248, 13,180, -109, 19,133,128,192,112, 92,181,149,224,171,213,175, 33,168, 97,208, 16,112,148,231,142,252, 89,226,215,150, 94, 64,143, 14,109, - 80,167, 55, 66, 18, 32, 1,108, 54,143,249, 0,158,218,239,181, 13, 59,112,234,232, 79,232,221,245, 65,104,109,158,149, 70,150, -252,127,223,189, 7,255, 88,251, 95,199,246,220,250,122,228,214,215,163, 88,249, 47,236, 62,125, 28,189, 6,117, 5,170, 60, 47, -205,156,126,110,165,124,193, 75,163, 84,145,129, 61, 97, 32,117,128,169, 28, 98, 83, 53, 76,182, 58, 24, 25, 3, 24,113, 16,218, - 15, 75, 64,214,111, 43, 60, 13,116,212,150, 45, 91, 96, 52, 26,161, 84, 42, 3,148, 74, 37, 96, 15, 1, 64,169, 84,162,225,123, -131, 5,101,196,150, 45, 91,188,238,180,103,207,158,149, 47, 94,188, 88,245,209, 71, 31, 17,138,162, 84, 0,112,240,224, 65,178, - 98,197, 10,242,198, 27,111,248,180, 52,115,176,132,222,248,223, 87,159,145,141,109,111, 18, 28, 62,123, 3, 59, 46,209,120,117, -103,153,233, 95,106,157,182,222,130,255,243, 69,166, 70, 51,250, 86, 90,254, 8, 15,207,195,172, 89,179,188, 94,141,210,153,240, -215,175, 95, 79,177,203, 73,115,197,225,195,135,229,101,101,220,140, 18,179,217,140, 19, 39, 78,236,107,238,121, 1, 32,239,208, - 46, 90,156,156,156, 12, 0, 40, 40, 40,192,190, 31,190,147, 94, 43,189,193,176,228, 15, 0,201,201,201,142,254,118,226,196,137, -213, 45,233,111,239,205,157,136,147, 23,174, 34,186,107, 91,160, 94,207,249,218,203, 43,171, 96,177, 88, 27,198,106, 43, 44, 22, - 43,174, 94,190, 36,109,201, 61,117,245, 30,240,222,132,187, 11,141, 92, 81, 38,147, 9,253,123,244, 80, 5,200, 68, 96, 24, 2, - 27, 3,252,120,240, 16,254,245,214,219, 96, 8,112,238,252,121, 28, 63,246, 27,122,247,238, 7,129,128,194, 3, 93, 59,160,248, -168, 21, 50,142,139,227,137,133,229,136,139, 41, 5,132, 20,174, 94,183, 0, 66, 10,125,123, 92, 70,254,137,114, 16,180,247,233, - 2,156,221,251,238, 60, 3, 6,109, 85,163,217, 0,158,224,236,222,119,167,105,231,111,126, 23,163, 23,173,117,155,197,238, 12, -171,213,138,128,128, 0,208, 52,141,176,176, 48,232,245,122,212,215,219,151, 1,142,140,140, 68, 85, 85,149, 87, 11,112, 24, 53, -192, 32,153, 12, 47,127,124, 16,163,251, 1,151, 11,129, 95, 27,246,189,252,241, 65,252,103,145, 2, 54,198,230,117,251,157, 58, -242,163,227,243,168,129, 61, 32, 12,166,145,171, 62,141,254, 61, 58, 34, 36, 72,130, 47,178,242,144,160,152,128,107,110,102, 1, -120,106,191,236,211, 4,184, 14, 36,141,162,176, 97, 71, 49, 34,194,186, 96,202,163, 20,167,246, 99,221,253,185,245,127, 44,157, - 76,254,185, 26,104,175, 5,245,215, 55, 65,254,245, 22, 64, 27, 64,229,175,192,218,168, 40,234,127,205, 4, 2, 98,167, 6,169, - 58,183, 26,136, 90,155, 14, 38,205,121,124,117, 37, 29,135,146, 52,120,240, 89, 5,198,188, 24, 4, 89,216, 3,144, 10,195, 32, - 76,210,226,215,239,126, 37, 15, 37, 60,212,212, 32,229,248, 15,154,166, 65, 8, 49, 55, 40,209, 70,154,166,245,132,144,112,216, -147,184,124,158, 94,219,163, 71, 15,245,152, 49, 99, 20, 85, 85, 85,170,220,220, 92,187,226,147,155,139,158, 61,123,162, 71,143, - 30, 62, 45,207, 92,103, 98, 94,154,247,143,255,108,127,127, 66, 52, 77,140, 90,252,117,115,145,197,106,177,172, 53,217,176,130, - 16, 82,237,139,204,201,147,205,183,156,252,135, 15, 31,174,246, 86, 78,126,126,126,163,144, 9,235, 5,224,186,170,164,205,102, -243, 74, 97,184,120,241, 34, 30,126,248,225,166,158, 23, 41,128, 7, 1, 8, 71, 78,152, 82, 83, 92, 92,220,170,160,160, 0,153, -153,153, 24, 88, 92, 76, 23, 20, 20, 0, 0, 6, 14, 28,136,113, 35, 18, 16, 18, 36,193,218,207,183,150,207,156, 57,115,217,186, -117,235, 22,121,219,223,174,111,123, 23,193,189,164, 8,234,190, 16, 25,239, 62,139,126,189,163,241,192,196,183,145,154,154, 74, - 53,151, 37,174,173,173,131, 84, 42, 1, 0,136, 68, 66,232,245, 70,191,222, 91,158,244,239, 12,188, 94, 12,136, 97, 24, 4, 72, -196, 48, 91, 9,104, 10,160, 41,224,205,127,191, 13, 27, 3,212,215,235,112,227,198,117, 68, 69, 69,131, 16, 6, 86, 43, 32, 21, - 9, 33, 16,113,115,193, 90,173, 86,249,131,177,215, 84,173,195,106, 1,138,178,235,198, 20, 64, 81, 4, 3,122,157, 83,253,114, - 60, 74,225,237,140, 0,214,186,111, 42, 36,192,197,250,119,213,162,155, 34,126,111,172,127,192,158, 48,212,166, 77, 27, 72, 36, - 18,135,203,144, 77,252, 11, 13, 13,133, 72, 36,194,213,171, 87, 33,226, 40,239,243,188,253,120,118,226, 8,176,230, 77,145,213, -238,254, 7, 0,121, 28, 16,242,182, 10,139,254, 62, 4, 97, 94, 92,239,181, 82,123,178, 98,167, 54,225,208,152, 76, 16,134, 8, - 96,172,208, 3, 52,141,182,157, 59, 96,247,190, 95,125,106,191,255, 91,178, 28, 23,127,220, 11,225, 13,160, 38, 10, 8,160,105, - 12,142,233,130,145, 35,162, 56,201,113,141,245,111,122,242, 89,124,107,250, 29,232,102, 4,126, 17, 2, 65, 66, 96,210, 64,116, -152,196,205,120,141,109, 31, 14,179,185, 26, 34,171, 5, 95, 93, 73,199, 79,115, 67, 49,252,137,199,209,163, 77, 79,197,201,221, -106, 85,255,228,122,136,204,245,176,246, 96, 80, 81,198, 45,105,180, 65,121, 51,206,157, 59, 55, 8,128,134, 16, 34, 2,128,185, -115,231,182,184,182,198,148, 41, 83,212,135, 14, 29, 82,156, 57,115, 70, 21, 16, 16,128,128,128, 0,204,154, 53,203,167, 65,148, -162,168,232,137, 19, 39,110,248,251,223,255, 78,191,188,232, 37,166, 55,115,158, 54,153, 45,245,102, 27,249,187, 55,114, 82, 82, - 82,136, 70, 51, 26,147, 39,155, 49,107,214, 44,202,215,243,185,149,228,239,206,221,191,126,253,122, 74,169, 84,146,121,243,230, -113, 58, 95,157, 78,215,200,237,239,140,197,139, 23, 99,241, 98,251,162, 69, 9, 9, 9,206,199, 75,154, 16,215, 14, 64, 76,131, - 82, 24, 48,110,234,190,156,179,102, 0, 0, 32, 0, 73, 68, 65, 84,108, 99,215,174, 93,165,153,153,153, 96,201, 63, 57, 57, 25, - 81,109,219, 58,247,183, 29,112, 10, 17,112,233,111, 41,147,134,227,231,210,114, 4,247, 11, 70, 73,238, 5, 64, 42,193,212, 23, -231, 32,188,195, 68,142, 99,179, 13, 37,215,203,172, 34,145, 80,200,122, 0, 0,224,234,229, 75, 45,186,175, 77,133, 14,120,133, -224,206, 41, 4,174, 74, 0,237,206,196, 33,132,128, 33,128,141,177, 43, 1, 20, 5,124,247,109, 22,158,152, 50, 13,173, 35,219, - 56, 6, 64,226,197, 90,217, 2,186, 28,189,186, 93,117,124,239,219, 59,192,225, 36, 27,240, 96, 49, 4,116,185,215, 23,228,234, -238,119,183,223, 27,235,223,213,221,239,110,191,243, 92,246,230, 80, 91, 91,139,186,186, 58,152, 76, 38, 48, 12,131,138,138, 10, -135,251, 95,175,215, 67,167,211,121, 21, 2,216,250,241, 27, 80,159, 4,180,151, 0,139, 1,248,207, 82,133,195,253,127,180, 16, -248,237,250,143, 16,120,217,126,218,210, 11, 8, 15, 13, 68, 68,120, 32, 30,136,235,137,226,139, 21, 40, 42,169, 66,167,136, 80, -152,202,202,113,254,220,249, 70,181, 0,184,180,223, 16,249,227, 24,170,152,129,173,219, 51,160, 58,144,129,244, 85, 75, 48,117, -201, 10, 28,183, 0, 21, 85,229,156,218,207, 57,214,255,204,144,135, 49,235,193,206,200,216,186, 15,199,143, 95,194,170, 19, 5, -216, 50,122, 14,240,233, 97,148,148, 84, 52,170, 5,208, 20, 58, 24, 37,176,153, 43, 97, 54,107, 1, 0, 81,237, 59,162, 71,207, -158,138, 90,153, 61, 23,195,192,232, 65,155,234, 33,171, 23,160,236,250, 13, 79,132,106,247,200, 24,141, 48, 26,141, 82, 0,102, - 0,193, 70,163, 49,196,117, 74,160,175,208,235,245,242, 3, 7, 14,168,122,246,236,137,217,179,103, 43, 42, 43, 43,145,155,155, -203,185,179, 81, 20, 53, 84, 34,145,232,130,131,131,173,163, 71,143,190,190,116,233,210,118,203,150, 45, 43,254,181,240,248,248, - 45,167, 76,103, 45, 12,188, 94,143,245, 86,184,252,253, 73,254,174,214, 63,155,163,224,236, 5,224, 34, 67, 36,250, 67, 37, 95, -181,106,149,227,229,238, 59,224,152,225,211,212,189, 17, 55,188,104, 0, 66,109,233, 5,183,238,116,182,191, 21, 30, 45,188, 56, -115,230,204, 20,111,250,219,176,135, 30, 64,226,163,113, 88,254,239, 15,240,225,154, 28,252,191, 77,251, 48,127,100, 2,110,124, -159, 3,173,166,214, 35,217,166,166,166, 82,201, 73,227, 96,177, 88, 11, 45, 22,171,213, 89, 1, 0,128, 21,111,190,230, 51, 97, -243, 68,127,103,225, 46,246,239,234, 21,104,164, 0,208, 52, 13,173, 78, 15, 1, 77,193,106,181,129, 33, 4, 86,198,158, 68,122, -236,183, 66,140, 28, 53,214,238, 38, 35, 4, 2, 90,128, 58,189, 25, 86,179,201,179,134,105,179,201,187,180,191,174,138, 12,215, - 58,180,140, 33,131,130,236,221,134,162, 64, 81, 4,253,123,158, 87, 89,109, 54, 57,215,139, 99,173,251,230,146, 1,125,178, 94, -155, 73,174,241, 6, 97, 97, 97,168,168,168,128, 68, 34, 65, 93, 93, 29, 34, 35, 35, 29, 73,129, 70,163, 17, 53, 53, 53, 94, 41, - 0, 41,203,183,224, 63, 75, 21, 8,141, 1,212, 39,129,151, 86,170, 16, 36, 20, 96,202,223,222,193, 53,230, 6, 54,175,122, 5, - 2,154,187, 60,214,250, 31, 56, 48, 14,145, 93, 99,208, 38,178, 53,196, 52, 5, 43, 69, 80, 81,111,128,166,206,232, 83,251,125, -248,238, 54, 76,238,217, 5, 33, 33, 17, 8,136,108, 7, 75,181, 6,133, 59,190, 70, 77,245, 21,159, 30,226,207,222,125, 1, 88, -148, 8,161,213,140,152,122,160, 92, 80,139,255, 92,255, 21, 16,135,112,150,113,116,251,207,138, 74,218,128, 43, 98, 61, 18,186, - 41,240,224,156, 32, 20,135,169, 85,145,145,133,170,142,131,139,161,165,235, 96, 34, 6,232, 55, 49,144, 6, 5,115,177,252,157, - 7,120,118, 22,128,216, 95, 29,119,215,174, 93, 0,128, 89,179,102, 41,122,244,232,161,126,226,137, 39, 28, 22, 35, 23,242,143, -140,140,220,185, 97,195,134,192,212,212, 84,193,162, 69,139,176,112,225, 66,114,248,240,225,193,132,144, 92,189,133,244, 36,132, -252,226,189, 53, 23,214,164,219,223,215,132, 64,127,146,191, 43,193, 59, 43, 44,235,215,175,167,242,243,243, 57,185,246,175, 93, -187,118,152,253,156,158,158,238,120,185,110, 99, 17, 30, 30, 14, 0, 77, 13,130,215, 0,212, 0,160,175,149,222,192, 79, 63,253, -228,136,249, 15, 28, 56, 16, 0,144,153,153,137,111,178,115,160,169, 51,234, 1,172,128,125,106, 32,231,254,246,253,214,127, 98, -236,210, 23, 49,126,252, 40,180,150, 8, 80, 71, 17,228, 22, 93,197, 79, 39, 75,188, 34,234, 5,115,103, 60, 84,124,254,188,240, -234,229, 75, 96, 95, 43,222,124,173, 89, 75,158,199,221, 77,252,174,219,220,161, 81, 8, 64, 34,145,224,220,233,227,138,152,118, -225, 42,153, 72, 8,155,141, 1, 69, 81,160, 40, 32, 69,249, 60, 8, 97, 96,107,168, 7,160, 55, 26,113,166,168, 24, 98,177,103, - 39,182,213, 82,141,254, 15, 94,116, 30, 69,241,220,162,139,248,118, 83,119,135,238,156,208,251, 2,126, 62,214, 19, 66, 65,164, - 87,214,191, 59,226, 55,104,171, 0,192, 39,235,223, 93, 71,203,223,252, 46, 0,112,182,254, 1,251, 60,255,232,232,104,152, 76, - 38,148,149,149,193,102,179,161,117,235,214,168,170,170, 66,235,214,173, 27,218,149, 59, 97, 87,220, 56,143, 55,222, 86, 65,123, - 9,120,127,201, 48,232,172, 54, 44, 94,153,137,143,150, 38, 99,201,170, 29, 16, 82, 20,188,224,127,104, 75, 47,160,109,235, 86, - 16, 65, 4, 27, 40, 92,191,120, 10,151,203,181,136,141, 12,199,247, 71, 15,227,204,105,120,109,253, 79,157,183, 24,162,112,128, - 22, 0, 27,115, 46,226,219, 79, 94,198,188,119, 83,177,120, 82, 63, 60, 63,170,179, 87,237,151, 91, 95,143, 15,147,166, 3, 53, - 82,128, 18, 1, 31,126,128,105,191, 30,196,238, 81, 11, 64,189,243, 34,168,159, 95,225,100,253, 3,192,111,215, 35,240,176, 65, - 11,157, 76, 0,189, 84,138,216,169, 34,152,136, 1, 90, 90, 4, 43,226, 64,108,122, 88, 42,175,227,199,143,181,152, 53, 51,246, -142,116,218,130,130, 2,210, 64, 12,212,148, 41, 83,212,118,223,152, 29,195,134, 13,163,134, 13, 27,198,133,252, 31,109,215,174, -221,174,119,222,121, 39,240,220,185,115, 16,137, 68, 8, 9, 9,193,241,227,199, 45,132,144,138,150,156, 95,115,115,242,125,241, - 14,248,147,252, 93,173,127, 59,177,222, 60,125,144, 75, 46, 64,114,114,242,185,111,190,249,102,136,213,202,109,134,147, 84, 42, -157,215,204,238, 58, 0, 23, 1, 12, 44, 42, 60, 12,231,152,255,115,243,166, 99, 87,215,174, 96,195, 1, 59,187,118, 13,152, 57, -115,230,231,222,244,183, 39, 19, 31, 70, 40, 19, 6, 61, 68,248,118,245,139,248,100,199,111,120,121,220, 80,204, 93,149,142,105, - 43,190,242,202, 2,119, 46, 38,228,110, 27, 63,127,255,254, 68, 35, 15,128, 64, 32,160,106,174,159,199,133,171, 85, 16,138, 4, -176,218, 24, 88,172, 54, 28, 61, 90,128, 47,191,252, 28,102, 27,129,197,198, 64, 44,164, 81,174,209,161,228,204, 79, 10,153, 76, -166,246, 64,132,242,158,177,151,255,176,254,237, 67, 21,190,221, 20,103, 31,227,104, 2,208, 4, 52,205, 96,112,191, 51, 42, 27, - 7, 47,128, 59,235,223,121, 22, 64, 96,120,180, 87,228,239,206,250,119,206,170, 29,189,104,173, 87,228,101, 31, 20, 53,208,233, -116, 16,137, 68, 14,235,159, 97, 24,199,187,183, 10,192, 87,171, 95,195,209,146,253, 8,138,182, 39,253, 5, 11, 5,168,184,113, - 30, 33, 18, 17,106,170,175, 65, 64, 83, 16,210,220,194,207,172,245,223, 49, 60, 24,167,139, 47,194,106, 54, 67, 34, 20, 67,167, - 51,226,123,213, 97, 36, 40, 38,120, 69,254,108,251, 61,254,194, 91,216,252,159,143,160,103,128,142,177, 29,112,242,212,207, 88, - 60,169,159, 79,237, 7, 0,139, 99, 19,176,253,220, 62, 64,107, 5,164,173,177, 39,255, 52,168,119, 94,196,218,168, 40,138, 43, -249, 3,192,204,238, 75,213, 63,238,201, 7,204,117,208, 81,117,208,208, 58,104,133, 22, 88,108,181,144, 24,245,144,150, 94,196, -150,101,231, 16, 19, 31,135,102, 18, 0, 27, 65,230,148,249, 42,149, 74, 33,149, 74,221,238,227,138, 13, 27, 54, 96,195,134, 13, - 45,234,204,193,193,193, 47,157, 63,127, 62, 48, 36, 36, 4, 50,153, 12,225,225,225,168,168,168, 0, 69, 81,122,127, 14, 26,172, -197,159,151,151, 71, 0,123, 66,160, 55, 73,129,254, 38,255,207, 62,251, 76, 78, 60,207,117,231, 52, 35, 32, 48, 48, 48, 69, 40, - 20, 94,112,221,190,106,213,170, 70,150, 63, 0,116,238,220, 25,137,137,137, 27, 61,217, 63,215, 74,111, 52,202,246,127,227, 31, -139, 32, 17,138, 17, 21, 21, 5,118,118, 64,195,254, 64,111,250,219,179,242,190, 88,248,193, 71,168, 43, 43, 71,100, 72, 27,156, - 58,125, 5,115, 87,165, 35, 53, 53,149,242,133,172,217,223, 57,255,222, 89, 14,239, 9,184, 55,240,219,111,191, 53, 91, 12,168, - 73, 15, 64,195, 32,162, 46, 80,111, 83, 16,146,164,138,105, 23,129,224, 0, 9, 30,236, 29,143, 7,123,245,131,144, 6,116, 6, - 27,174, 92,175, 70,190,250, 7, 69, 80, 96,128,199, 63,168,215,235, 17,215,249, 58,140, 38, 41, 8,107,212, 16, 64, 38, 53,130, - 16,160,186, 70, 2, 80, 64,112,160, 21,125,226, 46,225,224,145,254, 8, 14, 14,230,108,253, 59, 91,252,178,208, 8,136,136, 5, -176,254, 49,222,217,132,158,207,209,217,250,119,182,248,217,109,231, 79, 21, 58,142,229, 82,101,207, 89, 9, 0,128,232,104,187, - 50, 82, 93, 93,141,144,144, 16,135,251,223, 27, 5,128, 85, 2,128,119,176, 32,121, 4,240,159,131,248,228,245, 9,152,182,228, - 35,164,191,251, 60,132, 20, 5,177,132,219,140, 29,214,250, 63,125,165, 28,221, 58,182,198,167,255,219,130,152,152, 24,132,182, -139, 69,191,118,177,176,152,254,112,255,139, 56,200,100,173,255,183,231,141,194, 75,111,110, 68,199,174, 84,139,218,143,181,254, -199,108,253, 12,187,103,205, 0,213, 97, 48, 0,123, 85, 64,192, 94, 34,152, 61,246,165,168, 40, 78,196,209,215,244, 10,149,254, -193, 74,121,236,148, 58, 85, 76,247,222,168,149, 1, 23,113, 25,117,151, 42, 80,177,194, 6,157,166, 3, 22,205, 89,194,249,134, -172, 91,183,142,146,201,100,196, 96, 48,192,201,242, 36, 50,153, 12,235,214,173,243,162, 60,145,255, 80, 87, 87,247,254,243,207, - 63,159,180, 97,195, 6,105,104,104, 40, 84, 42, 21,214,172, 89, 83,107, 54,155,199,249,243,127, 88,139,159,157, 46,231,109, 66, - 96, 98, 98, 34,165,209,140, 38,254, 32,127, 0, 96,137,157, 11, 65,113,168, 48,104,158, 51,103,206,224,140,140,140,227,245,245, -245,109, 45, 22,251, 52, 83, 87,242,127,240,193, 7, 49,120,240,224,137, 28,238,179, 80, 91,122, 1,203,255,249, 6,190,219,190, - 19, 99,135, 14,192,222,188,159,237, 6, 76,187, 88,132,182,139,197,192,226, 98,140,155, 58,187,242, 74,149,126, 76,167,136,128, - 44,174,214,255,194,180,237, 88,246,151, 49,104, 23, 45,119, 40, 23,236, 53,114,241,220,248,226, 29,224, 61, 1,247,174, 82,192, - 73, 1, 0,128,144,224, 32,245, 81,245, 54,197,197, 14, 15,160,107,247,158,170,144, 64, 25, 24, 2, 24, 76,102, 20, 23, 23,163, -162,248, 55, 69,112, 80, 32,104,154,246,216,113,101, 82, 41, 50,118,141, 80,176, 25,240,205,186, 35,104, 26,129,129,220,173, 39, -118, 10, 96, 96,120, 52, 24,155,197, 78,254, 13,176, 80, 34,143, 37,118, 93,193, 78,169, 25,189,104,109, 35,210,242,133,252,157, -149, 0,231,194, 63,213,213,213,158,111,128, 7, 37,224, 43,167, 89,194, 27, 86, 60,247,199, 23,139, 14, 65, 28,229,116, 12, 15, - 70,198,145,223,112,242,236,239, 72, 80, 76,104, 68,250,222,144, 63,139,199, 95,120, 11,223, 14, 8,196, 11, 79,244,240, 75,251, - 45,142, 77,192,146,236, 12, 80,203,223,196,206,168,135,177, 70,119,178,209,254, 41,161,173,208, 65,234,221,154, 20, 51,187, 47, - 85,239,204,206,194, 53,205, 5, 84, 84, 93, 71, 89, 81, 16, 4,182, 16, 60,218,119, 24, 20,115, 20,119,116, 80,243, 71,181, 63, - 66,200, 17,138,162, 70, 83, 20,181,231,163,143, 62,146, 78,158, 60,185, 86,175,215,143,241, 37,230,223, 28,252, 49, 5, 80,169, - 12,243, 11,249,187, 90,169,126, 66,229,244,233,211, 99,235,234,234,150, 23, 20, 20, 44, 42, 41, 41, 65,125,125, 61,196, 98, 49, -218,182,109,139,200,200,200,201, 3, 6, 12,248,158,163,172, 51, 0, 6,118, 12, 15,198, 35,143, 60,130,223,206,149,160,117,151, - 94,141,250,219,184,169,179,245, 0, 62,230, 66,254, 44,158,149,247,197,232,188, 95, 48,235,205, 47, 49,124,248,112, 68, 69, 69, -185, 85,180,252,213, 32,172, 18,224, 77, 91, 55,165,144,241, 74,196,157, 35,125, 78,165,128, 1, 32, 36, 36, 68,109,170,190, 42, - 63,170, 46, 82, 0,246, 76, 90, 66, 8, 36, 18, 9, 66, 67, 56,215,192,134, 72, 36, 82,135,138, 68,126,191, 56,214,213, 47,176, -234, 1,171,222,145, 1,207, 18,191,183,115,177, 88, 87,255,249, 83,133, 56,127,170, 16,145,145,145,168,168,168,240,137,248, 67, - 35,219,193,204, 33, 57,146, 43,102,189,245, 21, 14, 31, 84,251, 77,222,165, 75,151, 28,171,253, 89, 76,198,155,200,223, 27,226, -103, 49,103, 64,160,223,218, 15, 0,168,213,175, 56,136,159, 37,255,139,245,245,138, 41,161,173, 48,137,163,213,239, 14,143,117, -153, 70,161, 75,195, 23, 31, 18,219,215,175, 95, 79,177,213,254,214,173, 91, 71, 57, 87,254,219,184,113, 35,181,110,221, 58,199, -231,245,235,215,223,246, 78, 79, 8, 57, 68, 81,212,240,172,172,172,197,181,181,181,171, 9, 33,249,254,254, 15,127, 76, 1,244, - 39, 57,221, 34, 24,130,131,131, 23,203,229,242,197, 45,148,115,232,196,137, 19,143, 2,232,210,186, 75, 47,189,197,100, 12,104, -232,111,181, 0,180, 0,206,116,138, 8,120, 18,246,100, 65,206, 24,253,198,134,219, 66,252, 45, 81,180,120,146,191, 51,136,143, -143,231, 68,254, 30, 13, 80,161, 80,168,246,228,142,191,221, 96, 99,251, 44,241,163,133,196,207,198,166,181,229,215,160, 45,191, -134,200,200,200, 22, 89,252, 0, 96,181, 49, 94,123, 31,154, 67,121,181,214,231,115,113, 5, 27,219,247, 23,241,251,187,253,216, -216,254,118,157,142, 56, 91,253,253,133,162, 22, 17,255,159, 9,132,144, 95, 1,204,224, 91,226,206, 99,230,204,153,169, 0,190, -188, 82,165,215, 91, 76, 70,231,120,100, 72,167,136,128, 48,120,185,250, 31, 75,170,206,110,254,123, 72,169,226,113, 27,149, 0, - 78,134, 86,124,124, 60,159,216,193,131, 7, 15, 30, 60,120,252,201, 64,243, 77,192,131, 7, 15, 30, 60,120,240, 10, 0, 15, 30, - 60,120,240,224,193,131, 87, 0,120,240,224,193,131, 7, 15, 30,188, 2,192,131, 7, 15, 30, 60,120,240,184, 47,208,104, 22,192, -130, 5, 11,124,206, 34,117,183,220,228,221, 46,175,176,176,208,103,121,253,251,247,191,229,242,252,125,189,173, 91,199,251, 44, -175,178,242,183, 59,125,127,169, 6,133,149,129,155,226, 43,247,226,243,119,187,228, 53, 20, 38,162, 27,218,144, 0, 32, 11, 22, - 44, 96,248,246,227,229,221, 75,242,210,210,210,132, 41, 41, 41, 86, 0,248,244,211, 79, 73,247,238,221, 49,124,248,112,138,111, - 63,247,242,188, 86, 0,238, 7,180,180,200,196,244,233,211,229, 0,156, 75,134, 42, 50, 50, 50,212,188,174,120,103,160,213,106, -159, 62,113,226, 68, 63,129, 64,176, 68, 34,145, 64,175,215,191, 50,116,232,208, 15,224,135, 74,123,132, 16,175,171, 49,222,139, - 88,176, 96, 1, 1,199, 69,102,120,220, 57,100,103,103,203,147,146,146,212, 62,254, 86,145,147,147,179,207, 31, 5,165, 26,228, - 61,153,147,147,179,101,253,250,245,225,176,175,105, 96,195, 29,168,110,233, 12,150,252, 15, 28, 56, 64,126,249,229, 23, 36, 36, - 36, 96,248,240,225,252,131,227, 47, 15,192,189,142,188,188, 60,121, 75,126, 63,125,250,116,121, 70, 70,134,106,250,244,233,206, -155, 85,211,167, 79,247, 89, 9, 96, 21,138,204,204, 76,182, 84,167, 87,178, 82, 82, 82,136,151,255,215,236,124,224, 61,123, 62, -247, 86,158, 66,163, 9,188, 19, 10, 16,117,242,228,201,247,107,107,107,255,210,185,115,231, 86,149,149,149,104, 88,110,247,189, -111,191,253,246,189,192,192,192,145,227,198,141, 83,181,232, 15,124, 32,127,165,114,129,215,131, 96,106,234, 58,234,246,201,107, -190, 28,110, 83,139,190,112,237, 95, 25, 25, 25, 42,188, 73,129,250,183,123,133, 10,111, 82,152,126, 38,217,235,118, 29, 59,118, - 44, 1,128,220,220, 92,191, 16, 24,187, 20,176, 82, 25,230,247,249,241,217,217,217,242,156,156, 28,149, 55,100,251,215,191,166, - 16, 66,236, 75,171,187,195,164, 73, 19, 21, 57, 57, 57,170,164,164, 36,202,135,231,120,228,206,157, 59,247,142, 24, 49, 2,243, -231,207, 39,233,233,233,163,107,107,107,243,188, 57, 55, 55, 74, 35,158, 26, 34,134,114,190,178,250,149, 77, 75,191,127,119,198, -187,143,179,251, 54,108, 72,107,246, 28,103,207,158, 77, 0, 32, 48,176,233,165, 13,234,235,235, 1, 0,115,231,206,245,233,254, -156, 61,162, 64, 94,218, 49, 36,166,164,145,148,148, 20,190,254, 1, 7,176,197,129,156,107, 4, 8, 61,116,120,183,117,179, 57, -212,211,190, 83,104, 17, 33, 56,147,127, 70, 70, 6, 53,125,250,116,226, 36,215,235,235,101, 21, 10,150,104, 26, 22,252,240, 94, -161,200, 12,247,226, 95, 19, 61, 30, 81, 63,233, 57,238,226,188, 92,215,166, 41, 2,242,210, 43, 67,105,181,218,111,122,247,238, - 61, 21, 0, 77, 8,129, 76, 38, 67,121,121, 57,106,106,106, 16, 26, 26,138,242,242,242,125,187,118,237, 82,140, 27, 55,206, 43, -229, 36, 47, 47,143,176, 11,179, 80, 20,133,169, 83,167, 34, 49, 49, 81, 65, 81, 20,103, 57,217,217,219, 28,159,147,146, 38,123, -252,238, 9,134,195, 47,252,209,220, 67,214, 54,250,238,186, 77, 54,196,243,162, 74,236,114,194,206, 56,112,224, 0, 86,172, 88, -113,211,189,216,180,105, 19,225,216,110,242,204,204, 76, 21,222,164, 26, 8, 54,249,230,129,251, 77,170,197, 22,226, 93, 60,182, - 52,178,180, 83, 83, 83, 21,132, 16,108,222,188,153, 28, 58,116, 8,125,251,246,245,248,219,195, 77,212,100,220,154,185, 4, 57, - 57, 57, 42,134, 97,144,150,150, 6, 79,203, 42, 83, 20, 37, 39,132, 56,158,215,239,191,255, 62,128,162, 40,204,152, 49,163, 12, - 64,212,204,153, 51,247,172, 95,191,158,246,198, 98,255, 96,207, 7,142,207, 55,114,175,131,162, 40,164,255, 45, 0, 0,133,247, -103,191,247,120,235,214,173, 1, 0, 95,127,145,142,249, 35,230,115,146, 57,112,224, 64,116,237,218,213, 47,237,158,150,150, 70, -167,164,164, 48,159,126,250, 41,249,229,151, 95, 80, 86, 20, 3, 84,134,241,172,238, 37,249,187,130,110,110, 32,207,204,204, 68, - 90, 90, 26,113, 55,128,250,178, 50, 84, 75, 45,116, 79,242,156,172,108,159,141,194,140,140, 12, 42, 35, 35,131, 98,149, 0, 0, -138,150, 40, 20, 20, 69, 33, 57, 57, 25,132, 16,202,233,220,188, 86, 84,168,233, 26,199,139,203,118, 79, 8,218,177,206,241,226, -178,221, 27,242, 39,132,128, 93,157,205,211, 42,109,238,158, 73,141, 70,243,101,104,104,232, 84, 0,244,188,121,243, 48,107,214, - 44,136,197, 98,200,100, 50, 72,165, 82, 80, 20, 5,129, 64, 0,173, 86,203,185, 29,179,178,178,228, 74,165,146,100,101,101,193, -233,158,224,219,111,191,197,252,249,243, 85, 89, 89, 89,242,187,177,227,186, 83, 8,238,132,103, 45, 51, 51, 83,149,154,154, 74, - 61,121,118,186, 91, 11, 95,169, 84,146,233,103,146, 21,238, 60, 3,158, 48,127,254,124,242,242,203, 47,163, 75,151, 46,126, 57, -223,249,243,231, 19,165, 50, 12, 17, 17,123,253,218, 14,219,182,109, 27,149,151,151,183,175, 95,191,126,212, 39,159,124,162,102, -201,191, 37,216,154,185, 4,171, 87,175, 6,195, 48, 88,178,100, 9,184,200,116, 38,127, 0,216,185,115,231,246, 6, 87,120,216, -140, 25, 51,172, 35, 70,140,128, 82,169,100,184, 26, 45,174,125,116,205,154, 53,120,242, 17,187,109,152,254, 55, 25,158, 26, 34, -198, 43, 99, 95,230,124, 77,129,129,129, 24, 62,124, 56, 82, 82, 82,168,196,196, 68,183, 47,246, 24,174,202, 94, 74, 74, 10, 3, -216,151, 89, 7,128,144,128, 74,158,213, 91, 72,254,205, 42, 0, 44, 89, 21, 20, 20, 56,202, 78, 58, 91, 79,222, 18,173,195,130, -240,243,160,228, 70, 25, 80,248,179,241, 50, 50, 50, 84,126,144,225, 80, 40,146,147,147, 21,108, 27,222, 79,112, 38,127, 0, 40, - 41, 41,113,236,187,118,237, 26,103,133, 81,171,213,190,163,215,235,103,211, 52, 77,207,156, 57, 19, 90,173, 22,165,165,165, 16, -137, 68, 16, 10,133, 16, 10,133, 16,137, 68,144,201,100, 48, 24, 12,110, 75,162,186, 25,224,228,123,246,236, 81, 81, 20,133,105, -211,166, 97,253,250,245, 84, 98, 98, 34,149,154,154, 74, 77,155, 54,141,125,126, 84,252, 80,209, 60,249, 55,180,165,130, 29,196, -157,239,125,114,114,178, 34, 49, 49, 81, 13,248, 86,146, 54, 49, 49,145, 90,191,126, 61,149,153,153, 9, 66,136, 95,148,177,215, - 94,123, 13,153,153,153,156,158, 17, 79,248,238,187,239, 70, 31, 57,114, 36, 47, 38, 38, 6, 58,157,142, 4, 6, 6,146,131, 7, - 15, 2,112, 36, 89,250, 68,254,171, 86,173, 2, 69, 81,160,105, 26, 71,142, 28, 1, 43,211, 11,143,196,227, 20, 69,225,169,167, -158,178, 54,108, 50,207,152, 49,163, 86, 46,151, 99,254,252,249,204,247,223,127,239,241,218,157, 67, 97, 55,114,175, 3, 20,176, -249,165, 63,170, 22,167,255, 45, 0, 51, 30,149, 96,233,184, 87, 56,159, 23, 23,203,159,203, 49, 7, 14, 28, 32,105,105,105,142, -215,145, 35, 71,160,187, 50, 16, 48, 27, 64, 5, 89,145,247,246, 25, 56,239,103, 95,124,207,109, 76,254, 41, 75,223,117,187, 95, -216, 92,135, 44, 46, 46, 38, 5, 5, 5,200,204,204, 4,251,153,117,237,120,211,201,111, 53,249, 59, 91,213,236, 32,116,183,194, - 57, 36,112,191,129, 16,130,146,146, 18,220,184,113,195,177,205,245,187, 7, 8,126,250,233,167,241,113,113,113, 16, 8, 4, 56, -127,254, 60, 8, 33,248,253,247,223, 97, 54,155, 65, 81, 20,132, 66, 33, 40,138,130,205,102,131, 94,175,199,214,173, 91,145,152, -216,124,216, 99,239,222,189, 42, 0,152, 54,109,218, 77,207,109,195,119,194, 18, 5,151,231,218,213,173,239,233, 59, 23, 43,159, - 69, 83,225, 0, 46,174,127, 55,131,103,139,147,164, 28, 49,127, 39, 5,142, 85, 96,217,152,127,158, 19,249,251, 98,173,179, 74, - 24, 75, 70,123,247,238, 85,249, 26, 6, 96,229,117,239,222,253, 38,114,243, 5,235,214,173,195,153, 51,103, 72,100,100, 36,218, -183,111,239, 88,246,249,210,165, 75, 16, 8, 4,248,239,127,255,235,211, 31,140,120,212,190,124, 25,195, 48,248,251,223,255,142, - 53,107,214,224,224,193,131,160, 40, 10,147,146,254,138,203,151,184, 45,224,184,115,231,206,109, 13,247,216, 8,251, 12, 25, 6, - 0,102,204,152, 81, 3,160, 85, 78, 78, 14, 40,138,226,172, 80,217,173,255,155,215, 49,177,135, 3,128,175,211, 11,145,173,205, -190,109,222,178,179,103,207,226,200,145, 35,141,182,217,106, 46,194,106, 97, 0,170, 14,173,198, 89,112,196,101,177,235,132,132, - 4,158,249, 57,144,127,179, 10, 64,131,219,133, 98,173,126,150,252,221,198,254,188, 32,235,230, 44, 65, 46,113, 98, 79,242, 92, -247,223,169, 21,169,166, 79,159,238, 28,107, 38,238,246,179,158,129, 22,145,110,134,127,227, 96,186,137, 11,124,178,252,155, 26, -108, 59,116,232,112,211,177,205,220,147, 86,225,225,225,189, 77, 38, 19,170,171,171,113,248,240, 97, 8, 4, 2,152,205,102, 24, - 12, 6, 48, 12,227, 88,149,210, 98,177,192,100, 50,113, 10, 49,176,247,161,169,231, 54, 49, 49,145,202,202,202, 34,153,153,153, - 30,149, 9,187,213,117,107,114, 0,100, 67,214,222, 68,244,236,119, 95, 20,129,225,195,135,183, 92, 9,112,137,249,231,229,229, -201, 29,100,255, 71,204,223,167, 28, 25, 23, 37, 12,128,125,181, 69,165, 82, 73,184,220, 7,174, 94,128,134,220, 7,175,115, 11, -216,149, 29,219,183,111,143,144,144, 16,202, 85,217,237,221,187,183,207,150, 63, 33, 4, 86,171,213,177,109,232,208,161, 56,120, -240, 32,246,255,104,195, 7, 43,185,197,216,179,179,179,199, 54,196,254, 79, 3,104, 13,192,121,177,161, 82, 0,173, 0, 32, 39, - 39, 71,213,175, 95, 63,143,242, 26,199,254,221,120, 10, 26,222,185,202,243, 7, 82, 82, 82,168,132,132, 4,162,250, 50, 18,214, -154,223, 64, 49, 53,128,205,190,210, 42, 45,176,162,246, 32, 13,145, 88, 8,147,173, 21,126,190,212, 15,111,172,210,224,200,145, - 35,148,187,105,213, 60,188, 84, 0, 92, 61, 1,222, 90,254,197,197,197,196,159,238,110, 79,242, 26,194, 18,126,243, 52,164,165, -165, 81, 41, 41, 41, 62,253,214,245, 60, 83, 83, 83,117, 74,165, 50,168,169,253,190,194, 57,246,239, 15,101,192, 57,246,207, 85, - 25,152, 53,107, 22, 2, 3, 3, 17, 20, 20,132,224,224, 96,132,134,134, 50, 97, 97, 97,116, 78, 78, 14,158,126,250,105,199,113, - 82,169, 20, 99,198,140,129, 82,169, 36, 77,172, 86, 21, 97, 54,155, 81, 93, 93, 13,163,209,136,208,208, 80, 72, 36, 18, 88,173, - 86, 16, 66, 96,179,217, 96, 54,155, 97,177, 88, 96,179,217,188,202, 47,240, 20,178,154, 54,109, 26,238,134,208,140,167,132, 64, -111,193, 42, 1, 62, 63, 95,255,110,186,237,166,159, 73,110,200,187,241, 77,182,171,245,239,172, 72,250,146, 12,232,106,253, 55, -167,152,114, 37,127,129, 64, 64, 66, 66, 66, 0,123, 66, 29, 5,128, 88, 44, 22,104,181, 90,180,105,211,198,167,235,102,141, 41, -161, 80,136, 69,139, 22,225,200,145, 35,248, 35,238,207,253,153,222,181,107,215,174, 97,195,134, 1, 64, 48,236,225, 92, 61, 0, -108,217,178,165,205,254,253,251, 67, 8, 33, 14,101,155,203, 60,241, 53, 31,173,193, 83,131,111,182,254,103,253, 71,143, 45,135, - 45, 32,132,160,255,204,254,152, 63, 98, 62,229,235,188,115, 95,149, 0,197,156, 52,178,107, 77,103, 8,117,181,128,213,254,215, - 12, 0,177, 16, 40,185,209, 10,251,174, 12,180,165,125, 93, 33, 56,114,228, 8,149,144,144, 32,197,159, 28, 92,172,127,128, 67, - 37,192,188,188, 60,135,235,223, 57, 31,128, 11,186,118,237, 74, 37, 39, 39,251, 45, 38,207, 65,158,207,241,245,233,211,167, 19, -215, 87, 94, 94, 30,195,206, 10,112,154, 17,224,235, 67, 28,116, 63, 63,112,105,105,105, 88,181,106, 85,163,231,138, 37,255,164, -164, 36, 36, 37, 37, 1, 0,246,239,223,223,156,152,240,226,226, 98,163,205,102,131, 70,163, 65,101,101, 37, 52, 26, 13,244,122, - 61,244,122, 61,116, 58, 29,106,107,107,161,213,106, 97, 48, 24, 96, 50,153, 28, 73, 65,205,146, 24, 69, 33, 43, 43,203, 43,133, -237, 94,198,129, 3, 7, 26,189,156,113,246,236, 89,185,243,119, 46, 49,103,215,152,191,171,229,222,146,172,125,119,191, 93,191, -126, 61,149,149,149,229,215, 92,128,172,172, 44,206, 99, 23, 75,254, 52, 77,147,134,231,203,225,250,103, 24, 6,101,101,101,232, -222,189, 59,181, 96,193, 2,175,207,229,245,165, 35,176,127,255,126, 48,223,180, 2, 33, 4,171, 87,175,118,220,163, 3,135, 57, -231,237, 33, 59, 59,123, 50, 0,204,152, 49,163,164, 65, 1, 48,125,253,245,230, 54, 11, 22, 44,104,179,127,255,126, 60,246,216, - 99,163,189,153,166,120, 35,247, 58, 40, 80,216,236,100,253,207,252, 72, 15,193, 83, 90,124,125,216,140,133, 11, 23, 98,229,174, -247,238,196,184, 34, 96,149,128,113, 11,173, 32,134, 80,160, 22, 64, 45, 32,168, 3,106,203,128,157,133,109,145,246,117,133,160, -193, 91, 32, 76, 73, 73, 49,242,228,239,153,252, 61,122, 0,210,210,210, 26,197,253,157,243, 1,184,206,189,108,112, 23, 42, 88, -183,124, 75, 93,242,238,228,177,110,255,196,196, 68,181,191,166, 16, 37, 38, 38,158,204,203,203,235,125, 55,222, 96,214,234,247, -151,251,159,181,250,189,117,255,179,216,188,121,179,227,243,191,254,245, 47,124,254,249,231, 0, 96, 6, 32,102,137, 31, 0,198, -140, 25,227, 73, 1, 48,196,197,197, 65,175,215,195,108, 54,163,162,162, 2, 18,137, 4, 66,161,208,225, 1,168,175,175,135, 94, -175,135,201,100,130, 86,171,197,212,169, 83, 61, 42,152,172,117,223,220,180, 86,246, 56, 46,184,149, 57, 0,190,236,119, 5, 59, -221,207, 29, 86,175, 94,173, 90,180,104,145,162, 71,143, 30,234, 59,249, 12, 55,101,253, 59,195,155, 92,128,166,172,127, 95, 45, -127,154,166, 9,195, 48, 20,128,127,178,143,182,205,102,123, 51, 48, 48, 16, 29, 58,116,240,105,140,121,227,213, 17, 80,171,213, -160,178, 34, 0, 0,187,223, 8,198,152,183,235, 48,124,248,112, 44, 95,185,223,171,194, 84, 59,119,238,220, 58, 98,196, 8, 0, -168,216,178, 37,189,253,254,253, 7, 91, 17,138, 96,252, 99,227,147,146,146,146,182,123, 51,156, 0,246,216,255, 83, 67, 68,141, - 45,126, 16, 44, 90,184, 8, 81, 99,162,239, 88,193,172,148,148,148, 70, 26, 62,169, 3, 36,102,128, 33, 20,172, 54, 2, 9, 1, -162,100,180,243,241, 86,240,176,243,247,202, 87,155, 84, 16, 88, 15,172,144,139,229, 63,112,224,192,155,242, 1,188,113,209,185, -146,182, 31,200,217, 85,158,234, 22, 60,120,189,243,242,242,252, 38,239,126, 77,252, 99, 11,203,176,110,226,204,204, 76, 60,243, -204, 51, 0, 32,102,143,113,222,215, 48,104, 53,133, 83,131, 7, 15,126, 90,173, 86,103,218,108, 54,212,214,214,194, 98,177, 56, -226,254, 70,163,209, 49,197,144, 77, 12, 28, 51,102,140,154,195,243, 66,101,102,102,146, 6, 47, 64,163,231, 54, 47, 47,143,221, -142,196,196, 68, 78,222,170,219,157, 3,224, 26, 22,240,116, 63,154,219,175, 84, 42,201,234,213,171, 85, 79, 62,249, 36,190,249, -230, 27,159,238,185,235,244, 91,246,123, 70, 70,134, 42,165, 68,137,233, 30, 44,237,177, 99,199,146,139, 23, 47, 98,215,174, 93, - 77,182,247,197,139, 23, 1, 0,185,185,185, 30,207, 39, 57, 57,147, 36, 39,143,194,232,209,197, 40, 46, 46,118,155, 93, 94, 85, - 53, 10,128, 6, 74,101,211,227, 22, 75,254,102,179,153,136,197, 98,246,152,127, 54, 40, 4,111, 94,190,124, 25,157, 59,119,246, -201,242,167,105,202,174,176,179,228,127,220,138,207, 85,102, 0,192,242,149,251,189, 30, 35,216, 62,177, 96,193,130,120, 66, 8, - 38, 76,156, 48,117,210,196, 73,223,249, 50, 52, 77,126,226,241,211, 20, 69, 61, 72, 8, 32,120, 74, 11, 66, 8, 22, 45, 94,132, -232, 49,109,255, 8,124,248, 14,150,157, 9, 90, 80, 73, 48, 45, 45,141,100,188,218, 14, 65, 85, 23,113,161,182, 3,186, 72, 42, -128,192, 40, 8,235,203, 16, 82, 95, 5,160,141,195, 99,224,170, 52,240,240,193, 3,224, 60,221,207,197,213, 71, 50, 51, 51,193, - 53, 97,202,149,180,253,117,226,206,242,252, 48,255,159, 71, 11,225,236, 66,119, 38, 33,182,158,132,235,190, 38, 98,136, 86, 0, -223,142, 24, 49,226,197,156,156,156,143,173, 86, 43,106,106,106, 28, 57, 0, 0, 80, 81, 81,129,154,154, 26, 16, 66,224, 77,120, -105,244,232,209,138, 61,123,246,168, 50, 51, 51,145,149,149, 69, 92, 99,254,163, 71,143,246,170, 24,208,173,128,225,240, 11, 94, - 19,190, 59,130,111, 78, 9, 72, 77, 77,165,230,207,159, 79,124, 33,255, 70, 9,128, 78,247,221, 41, 41,208, 91, 47, 64,147,138, -251,165, 75,151, 28, 10, 26, 87, 67,195, 57, 84,121,243,117,115, 27,171,180, 90, 45, 9, 13, 13,117, 38,255, 55, 77, 38, 19, 74, - 75, 75,209,165, 75, 23,159,200, 95,169, 84, 18,230,155, 48,236, 62,110, 55, 78, 55,170,204,216,114,216, 12, 66, 8, 14,254,228, -123,100,241,192,129, 3,120,236,177,199, 20,190,150, 15,102, 9,154, 97, 24, 17, 0,124,243,147, 5, 11, 23, 46, 68,244,216,182, - 46,254, 1,239,192, 86,249, 27, 62,124, 56, 1,220, 79,247,115,170, 4,200,249,254,118,166,235,129,200,120, 60,189, 65, 11, 32, -202,222, 6,207,183, 70, 39,225, 85,188,157, 88,142, 47, 84, 42,190, 42, 32, 26, 87,250,115,181,252, 93,247, 11,155, 27, 40,210, -210,210,136,187,105, 83,222,132, 0,220,144,182,223,224, 34,207,175,243,255, 93,202, 1,123,141,228,228,100,112, 72, 88,228,140, -166,220,253,190,134, 1,154,114,247,251, 18, 6,112, 46, 47,235, 74, 62,205,237,107,234, 82, 41,138, 90, 59, 97,194,132,245,155, - 55,111,182,136,197, 98,152, 76, 38, 88,173, 86, 48, 12,131, 86,173, 90, 65,163,209, 32,217,203,169,103,211,166, 77, 83, 79,155, - 54,141,218,179,103, 15,201,202,202, 66,102,102, 38,216,186, 0,119,115,229, 57,127, 99,223,190,125,100,194,132, 9,216,177, 99, - 71,139,201,223,149,228,242,236, 10,153, 71,111,220,203, 47,191,124,147,113,225,138, 87, 94,121,133,112, 77,242, 84, 42,195, 60, -202, 83, 42,185,197,255,101, 50, 71,233, 75, 66, 8,129, 94,175, 71,105,105,169,207, 49,255, 70,158,143,183,235, 26,125,111, 9, -249,127,242,201, 39,254,122,102,153,236,239,183,119,119,174, 4,232, 47, 52,167,144,109,220,184,209, 43,235, 95, 57, 45,182,244, -179, 34,180, 75,205,186, 0,103,238, 25,254,223, 52,178,111,254, 3, 56, 87, 38,195,185,115,231,160, 80, 40,192,195, 15, 30, 0, - 0,104,138,228,239, 70, 45,235,110,155,255,239,143, 41,126,127, 40, 34,137,126, 59,175,233,211,167, 43,188, 45,239,235,129, 24, -136,179, 66,227, 46,209,202,117, 31, 71,194,181,206,154, 53,139,218,189,123,183,252,202,149, 43, 42,131,193, 0,155,205,134, 7, - 31,124, 80,145,144,144,224,243,253, 30, 61,122, 52, 53,122,244,104,118,132,247, 41, 52,115,171,115, 0, 60,125,231, 98,113, 54, -100,135, 55, 38, 28, 47,139,204,176,109,132, 55, 41,146,135,228,155,236,193,148,148, 20,146, 82,162, 4,213,184, 16, 16, 5, 0, -231,206,157, 35,205,244, 85,143,141, 62,106,212, 40,202,139,190, 79,249,227, 24, 0,168,174,174,134, 76, 38, 35, 20, 69,161,115, -231,206,160, 40,138,234,222,189, 59, 90, 74,254,244,147, 26, 80, 20,133,164,199,237,179,138, 40,138,114, 76,247, 99,221,249,119, - 8,204,192,217, 3,252, 42,112,238,220,185,172,242, 31,212,224,213,179,194,238,254,103,156,142,241,234,130, 83,179, 46,180,115, -230, 30,214,213,159,146,146, 66, 41,247,170,200,185,115,231,120, 54,247,183, 2,112,175,192, 31,115,253,253, 69,216,183, 64,177, -241,235,121,249,123, 97,159, 91,109, 61, 55,196,248,221,254,135,217,108,134, 64, 32,128, 64, 32,184,141,207,218, 58,234,238,150, -215,116, 95,152, 61,123,182,247, 2,223,252, 99, 29,139,204,204,204, 70,131,118, 74,137,210,217,242, 86,223, 15, 99, 73,116,116, - 52,245, 71, 95,177, 39,219,182,148,252,237,247,164,185,165,128,110,198,186,117,191,220, 54,141, 96,254,136,249,212,237, 30, 19, -188, 28, 55, 2, 97,207, 41,178, 56, 41,159,142, 56,191, 66,161,160,120,203,223, 51,220,133, 6,168,248,248,120,190, 96, 2, 15, - 30, 60,120,240,224,241, 39, 3,205, 55, 1, 15, 30, 60,120,240,224,193, 43, 0, 60,120,240,224,193,131, 7, 15, 94, 1,224,193, -131, 7, 15, 30, 60,120,240, 10, 0, 15, 30, 60,120,240,224,193,227,190, 64,163, 89, 0, 11, 22, 44,240, 57, 27,212, 93, 97, 23, - 94, 30, 47,143,151,119,251,228, 45, 91,182,172,177,118, 79,211,142,105,142,206, 83,205,216,106,138,206, 83,207,220,149, 15, 14, - 10, 10,130, 84, 42,117,252,158,166,105,199,140, 11,103,121,236,194, 76, 12, 99,159,229,197, 46,150,195,223, 95,111,228, 81,114, -129, 80, 2,194, 88,193, 48, 86,181, 47,242, 8, 33,138, 99,199,142, 9,227,227,227,243,224, 82,117,207, 71,121,242, 99,199,142, - 33, 62, 62, 94,205,247,183,123, 79,158,215, 10,192,159, 17,175,191,158,223,168,225,150, 47, 31, 68,221, 85,242,242, 95, 39, 0, -176,124,208,114,202,249,179,175,242,216, 74,113, 74,165, 18,169,169,169,205, 29,215,236,126,103,121,112,154,166,199,254,198,249, -247, 74,165,210,177,143,171,220, 63, 35,104,115,189,188,226,228, 97, 12, 15,171, 80,181,183, 94, 69, 17,233,130, 35,245,225,138, -144,184,135, 33, 14, 12, 86,123,250,253,161, 67,135, 48,116,232, 80, 7,241,179,132, 77, 81,212, 77,132,205, 48,140,227,117,249, -242,101,183,242,142, 30, 61,138,129, 3, 7, 66, 38,147, 65, 40, 20, 66, 32, 16, 52,146,201,146,190,205,102,115,188, 76, 38, 19, - 10, 10, 10,208,173, 91,183,251,241, 22, 81,118, 94, 36,242,223,127,255, 29,231,206,157, 83,181,106,213, 10,195,134, 13,107, 81, - 31,167, 40, 90, 46,145,134,163, 85,216, 3,170,122, 93,137, 66, 87, 92,229, 80,150, 0, 0, 32, 0, 73, 68, 65, 84,119, 85,238, -173, 12,134, 97,228, 89, 89, 89,251,138,138,138,176, 99,199, 14,200,100, 50, 44, 89,178, 68, 0,167,185,247, 62,200, 83, 21, 95, - 56,143, 61,187,115, 33,150, 72,176,112,225,162,145,132, 16, 21,223, 83,239, 83, 15,192,189,132,172,172, 44,143, 26,207,180,105, -211, 60,118, 76,150,160, 93,137,219, 87,248, 91,158,191,225, 84,153,143,211,160,197,165,180, 44, 87,121, 13,138, 64,139,170,139, -179, 85, 5,157,255,255,158,239,133,132,200, 79, 31,218,141,144,139, 63,169,244,122, 19, 44, 15,211,144,117,160,208,253,202,113, - 60, 20, 76, 84,154,138, 95,241, 91,192, 28, 69, 37,213,190, 89, 37,224,244,233,211, 16, 8, 4, 24, 54,108, 24,132, 66,161,227, -197, 42, 4,172,213,111,181, 90, 97,179,217, 96,177, 88,112,249,242,101,236,219,183,207,173, 60,189, 94,143,194,194, 66, 12, 30, - 60, 24, 98,177, 24, 34,145,168,145, 76,134, 97, 96,181, 90, 97,181, 90, 97,177, 88, 96, 48, 24, 80, 88, 88, 8,157, 78,119, 87, -232, 83, 13,207, 25,141, 63, 10,209,248,204,209,203,150, 45, 99, 92,198, 22,212,213,213, 33, 34, 34,194,167, 9,232,203,150, 45, -107,116, 62, 95,165, 23, 64, 38,107, 3,129, 64,172,210,213, 93,245, 90,102,126,126, 62,116, 58, 29, 6, 15, 30,124, 57, 49, 49, -177,109, 85, 85, 21,118,239,222,109, 11, 15, 15, 71, 66, 66, 66,179,125,100,238,216, 81, 55,181,205,137,179,103,161, 14, 14,192, -226,213,255,190,218,127, 64,239,142,215,175,149, 99,119,142,122, 95, 76,239,254,137,181,181,218,189, 60,117,222,253, 96, 75,255, - 58,195,181, 22,128,176,185, 65,150, 29, 92, 61,125,191, 19,228,255,220,115,207, 53,123,140, 70,163,193,215, 95,127, 77,184, 40, - 1, 44, 89,183,212, 90,191, 21,242,156, 45,255,150, 90,255, 78, 36, 76, 1, 32, 74,165,210,227,194, 49, 28,201,154, 98,137,157, -181,246,157, 45,127,103,170,227,250,204, 56,121, 42,136,115, 57, 97, 0,168,174,182, 87, 70, 12, 15,207,187, 47, 58,234,165, 95, -242,208,237,170, 74,117, 85,207, 96, 74, 55, 1, 30,136,180,130, 9, 39, 16,133, 11, 80, 87, 37,134,172,206,128,158,199,214,170, - 10,226,230, 43,244, 1,157,213, 77, 91,146, 20,206,156, 57, 3,177, 88,140,145, 35, 71, 58, 72, 91, 36, 18,129,166,105, 16, 66, - 96,177, 88, 96,181, 90, 97, 50,153,112,245,234, 85,168, 84,170, 38,151, 84,166,105, 26, 22,139, 5,199,142, 29,195,176, 97,195, - 32,147,201, 32,145, 72, 28,242, 88, 5,192,100, 50, 65,167,211,225,196,137, 19, 48, 26,141, 94, 21,102, 82,171,213,114,129, 64, -160,170,171,171,131, 88, 44, 70,121,121,249, 11, 83,166, 76,169,147, 74,165, 95,249, 66,218,106,181,122,186, 64, 32,248,198, 73, - 94,209,148, 41, 83,126,151, 74,165,211, 96, 95,161,210,107, 75,248,141, 55,222, 80,173, 88,177,162, 28, 13, 43,206, 44, 91,182, - 12,167, 79,159, 70,155, 54,109,154,172,187,238,137,252, 63,155, 55, 15,227,251,247, 7, 0, 68,191,248, 34,100, 1, 81,208,213, - 94, 65,173,246,130,130, 16,155,218, 91,153,125,251,246, 69,121,121, 57, 14, 29, 58,212,153,166,105,156, 56,113, 2,225,225,225, - 56,112,224, 0,204,102,179,199,118,172,122,103,113,163,239, 65,102, 11,218, 89,141, 88,248,242,155, 29, 87,127,240, 47,188,255, -193, 39,104, 79,219,240,201, 7,171,242, 70, 62, 53,147,103,215,123,144,252,217,237,156,214, 2, 0,110,174,255,237,233,251,237, -132, 63, 87,234,187, 23,224,172, 4,180,208, 3,192, 18, 44, 5,128,124,254,196,151,110, 9,249,153,173,115, 56,147,117,131,107, -159,114, 51, 96, 59,255,222,161, 32,112, 9, 1,176,255,237,250,238,234, 1,184,215, 97,172,169,148, 15, 55, 21,170,202, 5, 54, -116, 11, 5, 58,119, 34, 16,244, 21, 67,216,181, 43,196, 38, 35, 76, 63, 94,133, 73, 43,132,128, 17,193,152,247,149,138, 30,255, - 55, 5, 35,116, 31, 14, 96,221,243,231,207,159, 71, 88, 88, 24, 20, 10, 5,164, 82, 41,196, 98, 49,132, 66,161,195,234, 55, 26, -141, 40, 45, 45,197,254,253,251, 65,211, 52,104,154, 70,115,242,108, 54, 27, 78,157, 58,133,161, 67,135, 34, 36, 36, 4, 82,169, - 20, 2,129, 0, 86,171, 21,102,179, 25,181,181,181,248,245,215, 95, 97, 50,153, 32, 20, 10, 29,185, 0,158,176,105,211, 38,185, - 78,167, 83, 93,188,120, 17,181,181,181, 16,139,197,136,142,142, 94,123,240,224, 65, 12, 25, 50, 68, 24, 24, 24,248,185, 55, 74, -192,166, 77,155,158,208,233,116,223,184,200,139, 59,120,240, 96,220,144, 33, 67,190, 14, 12, 12,156,198, 85, 30,195, 48,114,179, -217,140,234,234,106,149,147, 71, 1, 0,176, 98,197,138,146,101,203,150,181,159, 54,109,218, 72,169, 84,234,213,248, 71, 11,196, -114,215,109, 55, 62,254, 24,209,147, 59,224,253,247, 63, 82, 88, 44,245, 62,141,167,135, 14, 29, 82,253,242,203, 47,120,245,213, - 87,107, 5, 2, 65,136, 84, 42,197,144, 33, 67,160, 82,169,144,147,147,131,246,237,219,123,225,239,160,176,233,252,117,124,123, -174, 4,217,223,127, 1,129,128,194,226, 23,159,102,250, 69,183,166,211, 22,190,137, 13,222,202,227,113, 71,200,223, 85, 57,117, -167, 20,248, 60, 11,224, 78, 47,111,219,181,107, 87,133,167,215,237,182,214,111,133, 60,127, 88,253, 77,225,243, 39,190,164,158, -217, 58,135,184, 35,127,112, 15, 17, 52,178,244,171,171, 19, 29, 22, 58,254, 88, 2,212,107,183,127,115, 68, 31, 30,158,231,147, -245,111,181, 90,229,191,254,250, 43,105,106,155,235,190,166,224,124,188,213,106,149,187,238,115,221,214, 28,170, 79, 29, 85,149, -150,212,162, 77,176, 16, 93,131, 9,132,173, 25, 8, 31, 25,135,192,126, 95, 65, 54,224, 67, 72, 66,101, 16,235, 12,208,235,109, -232, 36,208,227,192,230,166,149, 39,154,166, 33, 20, 10, 33, 18,137,112,238,220, 57,156, 56,113, 2, 33, 33, 33,136,136,136, 64, - 68, 68, 4, 90,183,110,141, 86,173, 90, 65,171,213,226,192,129, 3, 16, 8, 4,142,216,190, 59,176,251,197, 98, 49,108, 54, 27, -138,138,138, 16, 16, 16,128,214,173, 91,163, 77,155, 54,136,140,140, 68, 80, 80, 16,138,138,138, 96,177, 88, 28, 33,130,166, 20, - 10, 87,203,191,172,172, 76,117,225,194, 5,116,233,210, 5, 99,199,142,197,160, 65,131,160,215,235,177,111,223, 62, 28, 59,118, -236, 83,163,209,200,185,118,177, 90,173, 86,148,149, 87,124, 87,124, 93,139,224,110,131, 17, 55,246, 47,104, 63, 40, 9, 26, 19, -141, 61,121,123,113,236,216,177, 41, 70,163,241,175, 92,201,191,182,182, 22,199,143, 31, 87, 29, 58,116, 8,125,251,246,197,178, -101,203, 90,163, 33,158,190,108,217,178,246, 0,224, 13,249,211, 2,177, 60, 48,168,157, 60, 60,162,183,106,243,150,227,152,247, -217,103,200, 41, 44, 68, 78, 97, 33,162, 95,124, 17, 0, 96,177,212,239,247,165, 31,231,228,228,144,236,236,108, 76,157, 58,245, -114,112,112, 48, 29, 16, 16, 80,144,159,159,143, 67,135, 14,161,178,178, 18,113,113,113, 94,201,251,168,240, 28, 62,248,249, 36, - 54,124,240,218,113,161,192, 0,218, 86,135,247,214,124, 70,127,115,160, 0,165,180, 16, 15, 60,240, 0,207,178,247, 9,104, 95, - 9,254, 14, 46, 94,113,107, 44,236,215,243,137, 63,227,246,254,150,119, 43, 21,129,103,182,206, 33,206,175,166,188, 2,158,188, - 10, 55,145, 91, 99,101,192, 91, 79, 5,213,212,118, 87,175, 0, 23,212,213,213,201,247,238,221,171,202,207,207,111,114,155,243, -190,230,224,124,252,222,189,123, 85,117,117,117,114,231,125,174,219,154, 67,136,177, 10, 57, 87,140,216,121,145,193, 85, 13,133, -178, 10,128, 22,134,130,166, 34, 64, 25, 37,168, 47,163,112,252, 10,131, 19, 87,140,168,170,179,160, 79,184, 68,197, 69, 1,144, - 72, 36,184,112,225, 2,206,158, 61,139,240,240,112,132,133,133, 33, 44, 44, 12,122,189, 30,135, 14, 29,130, 72, 36,130, 88, 44, -110,118, 45, 5,214, 59,192, 42, 1,132, 16, 20, 23, 23, 35, 60, 60, 28, 29, 58,116, 64,100,100, 36,138,139,139, 97,179,217, 32, -145, 72, 32, 22,139, 27,205, 60,112, 55,172,176, 31, 42, 42, 42, 84,215,174, 93, 67,175, 94,189, 48,110,220, 56, 76,156, 56, 81, - 49,113,226, 68,197,176, 97,195, 96,179,217,240,211, 79, 63,161,184,184,120, 48, 0, 78,241,132,138,138,138,125,101,213, 90,132, -199,246, 67, 92,226, 92,244,154,176, 0, 61, 39,204, 71,231, 71,158,128,153, 8, 88,121,156,238,111, 67,238,131,234,220,185,115, -236,181, 42, 26,136,159, 94,182,108, 25, 86,172, 88,129, 21, 43, 86,156,117,205, 11,104, 10, 2,161, 84, 30, 22,222, 83, 21,221, -126,168, 42, 44,162, 39, 40, 90,136, 79, 63, 87, 97,222,103,159, 97,222,103,159, 97,197,138, 21,168,168,168, 0, 87,121, 46,150, - 63,217,190,125, 59,134, 12, 25,130, 1, 3, 6,116, 6, 32,221,187,119,239,192, 75,151, 46,225,212,169, 83, 48, 24, 12,152, 48, - 97,194, 72,174,242,210,127,191,138, 15,127, 61,139,245,203, 95,174,238,240, 64,231,190,122,157, 6,233,223,237,197,241, 19,191, -227,192, 15,123,160,189, 81,134, 9, 19,198, 39,130,199, 93,139,248,248,248, 38,173,127, 78, 57, 0,169,169,169, 84, 94, 94,158, -156,235,247,123, 25,254,180,212,111,133, 60,192,127,238,255, 38,173, 80,167,152,186,183,228,207,122, 1,156,173,115,127,192, 83, -242,161, 55, 80,171,213,242,210,210, 82, 21,187,184, 75, 83,219,124,193,249,243,231, 81, 85, 85,165,106,215,174,157, 66, 46,151, -171,155,218,214, 36,113, 85, 94,197,225,235, 6, 76, 8, 8,192,193,171, 12,218, 13,144,160,139,169, 0,154,211,207, 97,235,123, -199,193, 92,210, 66,103, 38, 40,169,179, 65, 38,164, 97,213,222, 64,104, 51, 74,187,179, 18, 32,149, 74,113,249,242,101,156, 61, -123, 22,189,122,245,130, 70,163,193,207, 63,255,236,136,229,123,138,215, 83, 20,229,240, 2,176,242, 8, 33,184,122,245, 42,250, -244,233,131,188,188, 60, 48, 12, 3,169, 84, 10,145, 72,228,152, 37,192,197, 3,112,229,202, 21, 24,141, 70, 12, 28, 56, 16, 29, - 58,116, 80, 8, 4, 2,132,132,132,224,225,135, 31, 86,252,252,243,207,170, 43, 87,174,160,182,182,246, 4, 56,186,236,175, 92, -185, 2,134, 22,163,125,124, 34, 90,117,136, 3, 45, 16, 65, 22, 18,137, 78, 15, 79,192,229,159,179,209, 32,239,146, 39, 57,132, - 16,121, 77, 77,141,170,164,164, 4,157, 58,117,194,163,143, 62,170, 16, 8, 4,234,161, 67,135, 82,203,150, 45, 35,131, 7, 15, -182, 54,140,155,113,161,161,161,104, 80, 80,108,205,201,148, 74, 35, 16, 17,217, 15,102,147, 22,149, 85,133, 48,153, 52,163, 44, - 22,221, 32, 0,239, 12, 30, 60, 24, 0, 80,118,227, 6, 26,228,137,224,180,232, 77,115, 56,122,244,232,180,205,155, 55, 99,214, -172, 89, 24, 58,116, 40, 0, 48,187,119,239, 22,230,228,228, 96,222,188,121, 99,250,246,237,187,199,155,103,185,168, 86,143,165, -251,127,195,187,127, 87, 98,216,196,196,240,122, 93, 37, 50,190,219,143,212, 79,191,197,206,197,115,209,181,252, 26, 86,214,222, - 64,120,120, 4,159, 4,120,143,192,217,237,239, 46, 95,165,201, 28, 0,215,216,190,167,239,247, 35,252, 61, 5,207, 87,188,253, -208,219, 10,138,162,238,202,246,118,153,234,215, 40, 15,192, 85, 25,240,231,244, 63,174,202, 65,118,118,182,188,172,172, 76,101, - 54,155,155,221,214, 18,104, 52, 26,212,215,215,171,106,107,107, 21,238,182, 37, 37, 37, 53,121,239,142, 85, 27,160, 53, 51, 56, - 86, 97, 69,105,141, 21, 81, 63, 11,209, 55,227, 60, 46, 95, 58,133,223,127, 49,195, 42, 20,192,204, 0, 70, 51,129,134, 48,136, - 12, 35,205, 18,182,243,244, 63, 54, 99,191,172,172, 12,157, 59,119,198,165, 75,151, 28, 46,127,161, 80,232, 56,222,219,112,158, -115, 13, 1,246,253, 22,133, 4,107,208,178,236,253,155,140,113, 79, 7, 48, 12,131,250,250,122,251,224, 40, 20, 42, 4, 2,129, -218,197,147, 36,204,206,206, 70, 82, 82, 18,189,116,233,210,178,149, 43, 87, 90,151, 46, 93,218,236,197, 83,148, 93, 33, 50,232, -203,160,171,187,170,176,217,140,106, 0, 7, 0,188, 83, 87, 87,135,236,236,108,135, 50,217,173, 91, 55,179, 39,121, 13,207, 87, - 82, 86, 86, 86,230,132, 9, 19, 28,228,255,227,143, 63,210,219,182,109,131, 92, 46,159,232, 45,249, 95,215,155,240,116,206,207, - 88, 56,125, 2,166, 61, 61, 21,122, 99, 45,182,102,171,177,230,147,116,124, 57,230, 33,116, 45,191,198,179,233,125,160, 12,184, - 42, 1,183,165, 18,160, 82,169, 36,206, 49, 93, 79,223,121,220, 52,176,223, 82,242,247, 53,166,206, 18,191,107,182,191,139,235, -159,106,120,185, 61,182,169,231,197,211,115,193,245,121, 73, 74, 74, 82,119,239,222, 93, 17, 22, 22,214,236,182,150, 32, 44, 44, - 12,221,187,119,111, 68,244,238,182,185,131,193, 22, 2, 11, 5, 28,169, 52,161,220,102,195,222, 98, 35, 50, 50,141,216,119, 45, - 18,231,197,161,184,166,181,224,106, 29,131,122, 43,160,183, 18, 72, 34,162, 61, 18, 51, 59,191,223,102,179,193,106,181, 34, 34, - 34, 2, 65, 65, 65,232,220,185, 51, 44, 22,139, 99,187,187,130, 64,174,242,216,249,253, 86,171, 21, 6,131, 1,132, 16,116,236, -216, 17, 37, 37, 37,104,219,182, 45,132, 66, 33, 76, 38, 19,204,102,179,227,127,185,132, 7, 59,117,234, 4,169, 84,138,130,130, - 2, 92,187,118, 77,101,179,217, 80, 91, 91, 75,253,242,203, 47, 42,157, 78,135, 78,157, 58, 33, 36, 36,100, 28,215, 49,170, 83, -167, 78,160, 25, 51, 74, 10,243, 80,115,173, 8,140,205, 2, 67,109, 5,174,252,242, 3,204,245, 26, 86, 94, 12, 23,229,134, 69, - 68, 68,132,138, 97, 24,135,167,115,197,138, 21,212,169, 83,167,208, 64,218, 12,128, 40,119, 5,143, 92, 97,181, 26, 96,181,232, - 32, 11,140,134, 84, 22, 14,128,146, 3,176,174, 88,177, 34,194, 73, 30, 54,108,216,192, 22, 80,114,123,205, 85, 85, 85,228,203, - 47,191, 36,169,169,169,228,223,255,254,247,247, 73, 73, 73,152, 56,113, 34,235, 13,168,221,190,125, 59,166, 77,155,150, 52,125, -250,244, 31,184,180, 89, 85, 85, 21,249,234,171,175,200, 83,207,189,128,145, 89,251,241,247, 57, 83,240,210, 43, 11, 96, 52,235, -112,241,194, 85,164,166,102, 96,219,164, 33,144,119,108,227,115,223,216,182,109, 27, 63,174,223, 65,184,134, 3, 92, 19, 1,111, -107, 41, 96,215,176,129,167,239,183,205,210,111, 34, 86,239,106,237,115,181,254,155,146,151,255,250,235, 36,255,245, 63,220,249, -174,223, 61,121, 34,252, 37,207, 25,172,203,255,243, 39,190,164,124,113,255,167,166,166, 58, 44,251,166,226,253,236,118,231, 99, - 61,193, 83,254,128, 55,225, 1,185, 92,174,158, 52,105,146,194,185, 56,141,187,109,190,160, 91,183,110,152, 52,105, 82, 35, 87, -191,187,109, 77,254,190,123, 55,116, 15, 20, 32,152, 2, 44,132,224,140,198,140,205,231, 77,248,250,112, 41,126,189, 80,141, 82, - 3, 80,101,180,225,130,142,224,186,137, 64,103,182, 40,154, 35, 47,118,106,158,217,108,134,193, 96, 64,219,182,109,209,187,119, -239, 6, 69, 47, 28,131, 6, 13,114, 16, 54, 75,218, 77, 17, 54, 75,232, 22,139, 5,102,179, 25, 20, 69, 33, 54, 54, 22, 53, 53, - 53,184,122,245, 42,170,171,171, 17, 19, 19, 3,154,166, 97, 54,155, 97, 50,153, 28,191,241,132,200,200, 72, 69,135, 14, 29,112, -234,212, 41,236,218,181, 11, 59,118,236, 80,237,216,177, 99,223,193,131, 7, 33, 16, 8,240,200, 35,143,160,107,215,174, 6,112, - 44,100, 19, 25, 25,153, 20, 21, 30,138,170,226,223,240,251,158,207,113,234,135,117, 56,243, 67, 42, 46,255,180, 13, 18,154, 97, -229,149,120,146, 35, 20, 10,213, 81, 81, 81,138,144,144, 16, 28, 59,118, 12,215,174, 93, 83,233,245,122,185,179, 34,208,224, 9, -160, 55,111,222,140, 94,189,122,121, 60, 55,179, 73, 11,109,205,121,136, 68,129,104, 21,222, 67, 21, 24,212, 30, 34, 81,160,156, -162,232,193,236, 49,193, 53,121, 80,125,249, 18, 70,247,208,177, 74,243, 77,248,225,135, 31, 32,147,201,208,171, 87, 47,196,196, -196,160, 33,124, 96,213,104, 52,186,172,172,172, 86,241,241,241, 73, 35, 71,142,220,206,245,217,205,201,249, 1, 33, 33, 65, 24, - 62,226, 97,125,252,128,190,120,226,185,121,208, 83, 86, 84,148, 87, 99,254,139,111, 97,101, 66, 55, 12,104,227,187,146,188,109, -219, 54,242,222,123,239,241, 74,192, 93,162, 8,184,195, 93,179, 22,192,157,158, 85,224, 11, 1,123,139, 65,203,237, 10,132, 51, - 81,179,219,110,151, 60,103, 43,252,153,173,115,240,204,214, 57,141, 62, 59,111,227,106,177, 59,123, 18,220,121, 20, 90,154, 23, -224,236, 9,112,125,231,138,224,224, 96,245,168, 81,163, 20,131, 6, 13,106,114,155,243,190,102,219,221,233,248, 81,163, 70, 41, -130,131,255,152,150,231,110, 91,179,214,161, 36, 80,209,167,109,107, 60, 26, 33,193, 67, 97, 98,180,147,210,144, 16, 2,169,201, -138, 78, 65, 66,104, 8,193, 73,157, 21, 69,245, 86,180,111, 19,129,152,135, 70, 52, 41,139,181,250,217,169,126,157, 58,117, 66, -191,126,253,160,209,104, 80, 83, 83,131,154,154, 26, 4, 7, 7, 99,240,224,193, 48,155,205,142,154, 0, 77, 17, 54,171, 76, 88, - 44, 22, 80, 20,133,184,184, 56, 24, 12, 6, 84, 84, 84,160,188,188, 28, 21, 21, 21,168,175,175, 71, 92, 92, 28,132, 66,161, 67, - 94, 83,117, 5, 92,149,178,168,168, 40, 69,108,108, 44, 46, 94,188,136,220,220, 92,228,231,231, 35, 32, 32, 0, 35, 71,142, 68, -191,126,253,126,144, 74,165,139,193, 49, 4, 32,151,203,183, 71,181,137,156, 29,219,182, 21,116, 23,126, 65, 81,238,167, 40,201, -255, 30, 97, 18, 27, 18, 71,141, 68,191,126,253,230, 74,165,210,108, 46,178, 66, 66, 66, 48, 96,192, 0, 16, 66,112,248,240, 97, - 20, 20, 20,168, 74, 74, 74, 84,213,213,213,242,101,203,150, 41,216,202,137, 9, 9, 9, 56,112,224,128, 71,121, 12, 99, 81,107, - 53,231, 21,213, 21, 39, 32,145,134, 35,186,221, 35,170,200,232, 65,170,224,144,152, 31,222,255,224, 63,147, 88,121, 95,255, 45, - 0, 91,126, 52,161, 41,165,167,168,168, 8,173, 91,183,198,208,161, 67,153,135, 30,122, 8,122,189, 30,245,245,245, 88,187,118, -109, 80,143, 30, 61, 38, 63,245,212, 83,219,189,233, 19,191,255, 94,132,206,157, 58,224,169,167,146, 2,222,120,125, 33,170,234, -180,168,172,170, 68,202, 75,111,225,173, 39, 70, 97, 84,167,168, 22,145,255,154, 53,107,208,187,119,111,124,252,241,199,188, 18, -112, 27,241,219,111,191, 53, 89, 7,224, 38,133,247,110, 33,120,111,102, 21, 76,155, 54,141,242, 87, 37, 64, 79,112, 45,196,227, - 15, 37,192, 31,228,239,171,188,166, 74,245,186, 90,230,222,148,236,117, 81, 18, 28, 69,129, 90,114, 93,206, 74,131,179,181,239, -203, 12, 0,103,235,238,161,135, 30,162,154,218,230,186,175, 41, 52,119, 60, 87, 25, 44, 30,145,143, 84, 23, 11, 9,172,249, 57, -184,164, 5,130, 40, 17, 58, 7,209, 40,177, 81, 16, 72,132, 56, 80,110,131,145, 1, 34, 37, 2,196, 38, 12,135,180,123,130,186, - 57, 5,192, 98,177, 64, 32, 16,160, 75,151, 46, 24, 48, 96, 0,106,107,107, 97, 52, 26, 29,243,243,205,102, 51,194,195,195, 49, -116,232, 80,108,223,190,221, 17, 18,112, 7,155,205,230,200,234,239,217,179, 39, 26,220,244, 48, 26,141,142,254,204,122, 18,122, -246,236,137,234,234,106,232,116,186,230,250,114,163, 29,179,103,207, 86,171,213,234,145,189,122,245,218,231, 84,184,167,102,216, -176, 97,251,164, 82,233, 44, 0, 70,111,218,114,246,236,217,155,213,106,117,109,175, 94,189,178,157,228, 85, 14, 27, 54,108,173, - 84, 42,253,130,171, 28,154,166,213,237,218,181, 83,140, 29, 59, 22, 23, 47, 94, 84,157, 61,123, 22, 87,174, 92, 65,112,112,176, -170, 85,171, 86, 24, 61,122, 52,254,247,191,255, 33, 33, 33,129,243,185, 89,173,122,117,141,230,119,133,209, 88,141, 86, 97,113, -170,160,224,142, 8, 14,233,132,250,186,146,237,239,174,252, 20, 51,158, 74,196,215,127, 11,112,219, 78, 44,198,143, 31,143,156, -156, 28, 92,187,118,141,174,174,174,134,209,104,196,129, 3, 7,132, 13, 74,103,173,183,253, 97,194,132,241,216,186,117, 59,106, -107,170,112,173,244, 58,254,246,252, 28,243,203,175,174, 16, 63, 49,114, 8,134,154,106, 1,145,111,244,176,109,219, 54,242,207, -127,254,211, 81, 14, 58, 54, 54, 22,239,189,247, 30, 94,121,229, 21, 50,121,242,228,123,191,114,231, 61,170, 20,220, 49, 5,224, - 86,204, 42,240, 7,185,179,168,172,252, 20,175,231,127,223,108,181, 61,111,146,255, 42, 43, 63, 69,254,235,127,200,115, 38,102, - 87,151, 61, 23,210,174,252,180, 18,249,223,191,238, 55,121,254, 4, 23, 15, 1,187, 6,128, 55,207,203,159,169,115,198, 12, 81, - 40,142,155,172,170,138,125,123, 33,178, 26,112,188,142, 32,175,206, 10, 49, 69, 33,130, 16, 40,218,182, 66, 88,116,164,162,195, -195,114, 15,150,166,221, 3, 16, 19, 19,131, 65,131, 6,193, 96, 48,192, 98,177, 64, 44, 22, 59, 8,155,181,210, 35, 35, 35,241, -232,163,143, 34, 55, 55,183, 89, 15,128, 80, 40, 68,191,126,253, 64, 81, 20,244,122,189,195,187,192, 42,237,108,117, 65,134, 97, -208,167, 79, 31,252,252,243,207,240, 38,185, 82, 46,151,171,240, 71,158, 72, 16,236,213,246,174,128, 99, 38,188, 59, 79,128,147, -172,112, 0,213, 0,188,174, 77, 76,211,180,186, 85,171, 86,232,211,167,143, 66, 36, 18,177,211, 31, 85, 0, 80, 82, 82,130,199, - 30,123, 12,171, 86,173,242, 74,166,205,102, 82,215,235, 74,228,102,179, 86, 33,171,189,164, 10,105, 21,139,128,160,118, 8, 8, -106,135,221,123,203, 64,141,106,222,226, 30, 50,100, 8, 37, 22,139, 73,117,117, 53,198,143, 31,111,142,136,136, 16, 51, 12,131, - 43, 87,174, 0, 62, 36, 75, 62,242,200, 16, 74, 34,145,144,144,211, 5,120,254,249,191,160, 67, 92,119,241,123, 11,255,194,108, -252,228, 11,122,173,192,232,211,179,188,109,219, 54,178,116,233, 82,180,106,213, 10,165,165,165,144,201,100, 96, 24, 6,129,129, -129, 88,190,124, 57, 94,127,253,117, 94, 9,184,197,136,143,143,111,210, 11,192,105, 26,224,173,192,221, 60,171,160, 57,194,241, -197,250,111, 74,158,171,165,206,186,238, 61,145,182,191,229, 57,123, 2,124,221,223,156, 87,193,117,241, 31,111,229,253,217, 64, -211,180, 58,126,212, 88,170,186,222, 32, 15,181,154, 84,130,203,197,232,102,185,142,224,136, 40, 12,233,211, 3, 17,237, 91, 43, - 66,227, 71,120,236, 31,132, 16,116,233,210, 5, 67,135, 14,117,196,227, 5, 2, 1, 76, 38,147,163,116,175,115,152,160, 99,199, -142,120,244,209, 71,161, 86,187, 23, 45,147,201, 16, 31, 31, 15,161, 80, 8,179,217,236,248,157,243,212, 65,231,133,128,104,154, - 70,255,254,253, 81, 80, 80,224, 75, 51, 16, 0,117, 13, 47,127, 64,231, 11,241,187,243, 26,245,238,221,155,205,163,160, 24,134, -145,235,245,122,152, 76, 38,244,232,209, 3,171, 87,175,246,114,113, 28,162,182,152,235, 96, 49,235, 20, 6, 67, 5, 36,146, 48, -136,196,193, 42,154, 22, 98,211,230, 31, 20,179,103, 77,104, 86, 94, 67, 93,127,234,195, 15, 63,100, 12, 6, 3, 0, 32, 46, 46, -206,171,242,203,206, 24, 48, 96, 32, 37,120,232,161,199,230,253,243,195, 28,187, 60, 66,199,197, 61,128,184,201,147,103, 11,133, -194,205,190,200, 92,185,114, 37,223,169,239, 18, 37,160, 57,242,191,173, 10,192,189, 10,127, 78,251,115, 37,230,150, 90,235,254, -146,215, 18,139,219,153,216,217,207, 46, 46,123,254, 33,226,136,145, 73,147,213, 13,214, 43,134,251,240,251,228,228,100,132,133, -133, 57, 50,252, 25,134,113,184,240, 89, 15, 0,155,244,199,174, 8, 24, 27, 27, 11,138,162,176,101,203,150,155,228,173, 89,179, - 6,153,153,153,142, 99,109, 54,155,199,229,128,197, 98, 49, 18, 18, 18,192, 37, 59,254, 94, 85,214,130,130,130, 16, 20, 20,132, -136,136,136, 22,244, 29, 86, 17,168, 3, 77, 11, 97, 79,199, 98, 84, 28,229,145, 37, 75,150, 80, 13,247,147,208, 52,221,162,113, -196,102, 99,118, 46, 90,180,136, 2, 64, 51, 12, 99,163,105, 90, 6, 47,195, 47, 44,120,235,254,238, 82, 2, 60,129,138,143,143, -231,147, 51,120,240,224,193,131, 7,143, 63, 25,104,190, 9,120,240,224,193,131, 7, 15, 94, 1,224,193,131, 7, 15, 30, 60,120, -240, 10, 0, 15, 30, 60,120,240,224,193,131, 87, 0,120,240,224,193,131, 7, 15, 30,247, 5, 26,205, 2, 88,176, 96,129,207, 25, -156,235,214,173,187, 41,153,144,151,199,203,227,229,221,127,242,148, 74, 37,121,124,178, 18,223,111, 75, 69,106,106, 42, 13, 55, -115,208,249,246,227,229, 45, 95,190,220,113,204,235,175,191, 78,241,237,119,123,229,121,173, 0,176,157,187,169,131,125,153,242, -114, 47,203,243, 69,230,221,126,189,110, 32, 6, 16, 2, 32,160,225,121, 96, 0, 84,194, 15,115,168,253, 9,182, 29,252,113,205, -238,218,244, 78, 21, 31,170,171,171,147, 31, 62,124, 88,181,127,255,126, 0,192,136, 17, 35, 48,100,200, 16,206,165,132,239,196, -125,120,124,178, 18,227, 31, 27, 96, 5,148, 66,165, 82,201,252,217, 10, 55,241,240,140,229,203,151,147, 73,147, 98, 27,125,247, -164, 4,240,184,195, 30, 0, 22, 36,227,230, 5, 32,168,233,190,175,155,238,110,128,104,201,234,127,254,150,231,238,122, 91,114, -205,119,251,245,178,196,127,234,248,193,207, 79,157, 58, 54, 42,186,125,108,148, 86,107, 65,104,168, 8, 55, 74, 46, 48,189,122, -245,171,238,213,119,216, 32, 0, 23,189, 17,120,244,167, 79, 72,241,133, 34, 92,184,100,196,213,235, 4, 29,219, 82,136,141,145, -162,107,108, 28, 6, 60,242,220, 93,209,249,221, 41, 18,236, 90, 3,119,130,200, 78,156, 56,161,138,143,223,133,245,235,245, 80, -171,129, 55,223,220,141,171, 87,175,170,162,163,163, 33,149, 74, 81, 90, 90,170,120,226,137, 39,224, 15,133,224,224,193,131, 68, -171,213, 42, 70,143, 30, 13,137, 68,226,139, 60, 26, 0,198, 63, 54,128, 73, 73, 73, 17, 2,105,248,126,155,189,171,192,191,203, -246,242,184, 15, 96, 54, 47, 69,110,110, 10,198,142, 77,195,164, 73, 43, 29, 30, 1, 94, 17,184, 61,224, 11, 1,121, 1,103,178, -167, 40,128,249, 38,236,190,189, 86,139,185,254,233,220, 93,223, 44,235,214,173,123,143, 41,147, 71,160, 99,251, 16,180, 10,149, - 64, 83, 99, 68,201,245,142,244,185, 98, 77,235, 29,217,159,169,198,142,123,242, 67,145, 56,240, 99, 79,242, 78,159,216, 47,191, - 88,180, 67, 37, 64, 45,158,156, 0, 60, 58, 16,136,237, 12,156,191, 68,112,232,136, 1, 57,170, 99,248,225,219,151, 73,151,184, -137,138, 7,251,120,174,104,119,171,188, 29, 77,121, 17, 82, 83, 83,169, 59,165, 4, 84, 87, 87,227,165,151,244,136,140, 4,146, -147,129,119,223,213,161,176,176, 16, 86,171, 21, 82,169, 20,109,218,180, 81,237,216,177, 3,221,187,119, 87, 36, 36, 36,168,189, - 28, 0,228, 39, 79,158, 68, 84, 84,148,106,244,232,209,212,166, 77,155, 0, 64,149,151,151,135,153, 51,103, 98,208,160, 65,222, - 94,171, 24, 0,114,118, 30,165,129, 52,198,254,110,215,161,249, 17,132,135,179,181, 15, 0, 83,167,126,139,220, 92,251,123, 74, -202, 5,176, 30, 1,222, 27,112,123,137,223,121,251, 29, 43, 5,124,183,131,100,132, 57,148,128,251,153,252, 1, 8,247,228,102, -188,161, 24, 62, 32,238,161,254,109, 65, 81,246,170,110, 12, 67, 16, 18, 36, 65, 96,172, 24, 49,255,191,189, 43,143,107,226,218, -254,223, 73, 66, 8, 8,178,136,136,168, 84, 1, 23, 4, 21,113,215,170,196,162, 20, 4,220,138,246, 87,219, 87,237, 66,244,245, - 89, 95,139, 21, 43, 93,180, 45, 85,124,218,218,250,218, 26,124,173,218,214,247, 90,169, 10,238, 84,106,112,169, 90, 21,183,138, - 86, 5,220, 42, 42, 85,217, 73, 8,201,220,223, 31, 97, 48,132, 44, 51,147, 32,218,206,247,243,225, 67,114, 51, 57,153,185,119, -230,126,207, 57,247,156,115,187,120,160,147,159,219, 99,123,114, 54,190, 21, 27, 63, 51, 19,192, 45,107, 2, 47, 95,220,174, 26, - 57,160, 18,255,156, 9,136,197, 6, 5,170, 94, 7,180,113, 5, 66,130,129,161,225,192,118, 85, 37,142,156,222,174,234,221,103, - 52,175, 7,223, 81, 75, 0,150,190,207, 40, 1, 15,122, 48,188,189,189,177,125,187, 11,186,116, 81, 35, 47, 15, 40, 43,147, 32, - 56, 56, 24,193,193,193,168,174,174, 70,113,113, 49,242,242,242, 80, 89, 89,169,234,217,179, 39,235,165,129,205,155, 55, 71,170, -213,106,149, 84, 42, 69, 89, 89, 83, 79,150, 90,173,198,151, 95,126,137,226,226, 98,242,244,211, 79,115,233, 79, 26, 0,178,179, -148, 0, 20, 34,195,127,254, 56,118,236, 88, 99,127, 51,155, 40,153,107, 99,115, 95, 24,143, 45,219, 54,155, 70, 1, 33,145,184, -112, 1,131,171,171, 85,237,110,220,192,239,190,190, 56,209,182,173,220,169,119,111, 16,138,202,227,123,205, 92, 55,140, 98, 35, -131,109, 91, 75,203, 51,118,253, 39, 37,229, 32, 62, 62,168,241, 63,131,248,248, 32, 65, 9,120, 0, 48, 37,123,102,127, 0,227, -118, 33, 11,192,244,161,255,147, 95, 95,193,153, 3, 75,131,131,131,123, 12,142,232,216,164, 93, 36,162, 32,149,138,225, 34,147, -192,201, 73,132,160,110, 94, 8, 10, 10,246, 45, 56,115, 96,187, 53, 69,241,196,225,207,137, 24,149,120,237, 5, 64, 83, 7, 92, -190, 14,148, 85, 0,229,149,192,127,183, 2,115, 22, 1, 11,151, 3,195, 35, 0, 17,169,196,137,195,159, 11,214,162, 17,250,244, -233, 35,207,206, 14,129,175, 47,240,204, 51, 18,248,249, 13,194,232,209,163,229,241,241,241, 84, 92, 92,156, 60, 58, 58, 26, 29, - 58,116,192,137, 19, 39,240,253,247,223,171,126,252,241,199,200,186,186,186, 72,107, 50,191,253,246,219,200,186,186, 58,149,147, -147,147,213,223, 86,169, 84,216,184,113, 99, 36, 27,146,221,191,127, 63, 1,160, 85, 42,149,210,251, 74,192,125, 50,221,191,127, - 63,225,170, 64, 29, 61,122,180,241,207, 90, 27, 31,165,142,109,155, 53,242, 15,252,237, 55,213,164, 83,167, 84, 93, 46, 22, 66, - 90, 89,137,142, 23,127, 67,228,145,195,170,246,167, 79,171, 64, 72, 36,159,241, 62,122,244, 40,142, 29, 59, 70,206,158, 61, 27, -201,247,158, 97,100,176,105, 99, 43,207,148,232,217,180,217, 2, 67,250,204,127,109,124,176,240,192, 63, 32,226,103, 83, 6,248, -145,245, 0,180,164,165, 70, 90,240,252, 28,229, 98,102,228, 91,250, 29,107,191, 81,112,238,116,204,212,201,242, 70,210, 55, 7, -153,179, 4,229, 21,117,232, 17,228,141,204, 45,170,160,208,190, 35, 61, 44,201, 43, 46,186,136,105,227, 13,175,119,239, 7, 62, -251, 6, 24, 55, 18,136,141, 4,126, 43, 4, 78, 22, 16,184,200, 40,244, 15, 5,162, 71, 3,155,115, 46, 34, 98,152,227, 44,119, - 62,125,215, 66, 49, 21,188,224,238,238,158, 87, 93,109,136,183,124,230,153,103, 48, 98,196, 8,202,248,179,123,247,238,201, 67, - 66, 36,170,132, 4,128,162,142,163,180,180, 86,245,251,239, 65,214,220,127,145, 20, 69,169,216,110, 14, 83, 90, 90,170,178,165, -247, 78,159, 62, 29, 27, 54,108,192,134, 13, 27,200,244,233,211,155,140,197,254,253,251,201,134, 13, 27, 26,143,123, 88,230, 3, -182,109,150, 80,119,246, 44,186,229,231, 67, 43, 18,193,137, 2,116, 52, 1, 93,175, 7,173,211,161,253,129,253, 40, 36, 4,109, -251,247,231, 77,224,174,174,174,170,227,199,143,203,103,204,152,145,199, 87, 6,128, 38, 22,185,185, 54, 62,222, 5,123,201,223, - 18,209,231,152,120, 2, 4,180, 62,204, 42, 0,150,130,223,248, 16,142, 45, 66,228, 42,239, 65,175,209,242,137, 24,183, 22, 84, -200, 71,158,185,239,240, 12, 92,148,248,249, 7,245,246,247,115, 3, 33,192,129,195,215, 81,171, 54,236,186, 26,209,207, 15,237, -219,185,224,250,141, 42,186,240,114,153, 72, 34, 17,161,123,160, 23,252,253,131, 61, 97,216,162,213, 44,138,174,104, 48, 98, 0, - 80, 87, 15,236,218, 7,168, 14, 19,248,119,160, 16, 24, 0, 60,241, 56,208, 43,136,130, 68,108,216, 90,124,104, 56,240, 47,165, -134, 85,127, 27,187,228,217,188,102,163,241, 26,175,245, 27,247,187, 35, 51, 12,248,160, 97, 59, 87,244,237,219, 87,110,250,153, - 88, 44, 86,245,238, 93,138,133, 11, 13,234,233,135, 31, 94,196,149, 43,161, 22,101,105, 52, 26,155,150,191, 49,174, 92,185, 98, -243,152, 81,163, 70, 81,163, 70,141,106, 36,251, 13, 27, 54, 16, 83, 5, 97,212,168, 81,173,210,119, 45, 97,253, 3, 64,247, 59, -119, 85,218,250,122,136, 68, 34, 16,177, 24, 52, 77,163,158,166, 65,235,245,208,235,105,116,190,121, 83, 85,217,191, 63,239,107, -174,173,173, 5, 0,213,177, 99,199, 64, 81, 20,231,248,142,150, 80, 2, 28,101,249,231, 36,229, 32, 58, 35, 26, 83, 54, 1, 73, - 57,134,215, 57, 73, 57,141,202,129,116, 91,161,192,188, 15, 16,198, 49, 1,172, 98, 0, 44,101, 1,240,205, 14,176,100,113,241, -177,196,172, 41, 13,124, 21, 20,107,215,109,250, 93,182, 86,132,165,160, 66, 62,242,172,125,135,249, 29, 10, 0,189,209,102,236, - 2,109,136,246,119, 6, 0, 92, 47,169,132, 90,173, 3, 0, 4, 7,122,161,125, 59, 23,156, 46, 40, 21, 93,184,116, 15, 50,153, - 24, 65,221, 60, 81, 86,161, 5, 0,139,130,175,223, 36, 8,122,204,240,251, 79,142, 2,194,123, 83,112,150, 2, 58,157,193, 19, -224,233, 14, 20, 95, 3,162, 71, 1,143,117, 54, 28,223,154, 48, 38,125, 62,235,194, 15, 59, 74, 75, 75, 91,204,139,210, 64,242, -141, 22,127,107,147,191, 49,210,211,211, 73, 74, 74, 10,197,247,115, 83, 56, 21, 21,162,174, 94, 11, 74, 44,129,158, 16, 80, 0, -116,122, 26,245, 58, 26, 68,175, 7,117,233, 2,128, 88,187,207,251,236,217,179,240,241,241, 81, 85, 84, 84,200, 61, 60, 60,120, - 43, 1,182,218, 30, 20,249,167,166,166, 82,105,105,105,100,202,166,166, 10, 1, 0, 68,103, 68, 67,186,173, 16,219,182, 21, 53, -102, 2, 48, 1,131,222,222,222, 2, 83, 63, 96,242,183,168, 0, 60,236,176, 70,136,124, 8,214,158, 20, 71,171,114, 91, 56,155, -128,154, 90,198,245, 55, 40, 15, 15, 39,148,149,107,224,227,237,138,196,132, 94,208,233,105, 56, 59,139, 33, 22,137, 64, 8, 65, -220,184, 32,140, 31, 27, 4,138, 2,238,150,169,225,225,225, 4, 0,247, 44, 9,236,210,145, 66,209, 85,130, 94, 65,192,152, 97, -134, 89,231,183, 66,160,111, 47,192,171, 45, 16, 19, 9,208, 52, 32, 17, 3, 23, 47, 27,142,103, 59,182, 92, 94,243, 45,132, 97, - 75, 33,109,105,208, 52, 29,217,169, 83, 39, 20, 21, 21, 97,255,254,253,170,145, 35, 71,202,221,220,220, 32, 18,137,242, 0, 64, -175,215,203,207,157,243, 85, 45, 94,124, 3, 20, 69,161,180,180, 7,122,244,232,138,139, 23, 47, 90,146,103,182,125,227,198,141, -205,189, 72,132, 96,218,180,105,156,174,217, 88, 9,120,152,200,223, 17, 74,130, 49,238,117,238, 4,233,111, 23, 64,156, 0, 41, - 77, 12,129,173,122, 29,180, 68,143, 90,157, 14,234,224, 94, 14, 57,247,176,176, 48, 80, 20,197,139,252, 1, 96,240,224,193, 24, - 52,104, 16,117,244,232, 81, 98,173,205, 22, 26, 60, 6, 77, 8,223, 92, 27, 23, 36,229,220, 39,126, 0,205, 44,127, 38, 96,112, -219,182, 34,129,169, 91,129,252, 31, 89, 5,160,165, 21, 10, 71, 17, 2, 33,128,104, 90, 89,139, 41, 1, 76,230,130,104,106, 25, - 27,235, 31, 0, 36,183,110, 20,221,185,126,163,179,143,143,183, 43, 62,250,226, 24, 70, 13,239,130,136,190, 29, 64, 57, 81,141, - 25, 1, 13, 91,199,227,250,141, 42,220,186, 81,116, 25,128, 69,179, 50,168,171, 12, 63,231,171,209, 43, 8,240, 25, 0, 44,152, - 13,204,157, 1,120,184, 27,220,254,139, 63, 5, 22,205, 53, 28,251,115,190,225,120,190, 4,237, 40, 75,253, 97,170, 5,112,238, -220, 57,200,100,134, 62,217,177, 99, 7,174, 93,187,166,234,217,179,167,124,204,152, 49,168,170,170,138,244,246,246, 86, 29, 60, -168, 67, 94, 30, 48,104,208, 64, 4, 4, 4,200, 59,119,238, 12, 0, 42,115,242,218,180,105, 3,173, 86,203,234,183,117, 58,221, - 35,255,236, 26,147, 63, 27, 69,128,173, 18, 80,212,222, 87,238,124,230,140,138, 38, 4,109, 68, 18,136,197, 20,116, 68,143,218, -250,122, 84,105,181, 40,241,247,151,251,216,113,222,174,174,174,160, 40, 74, 62,104,208,160, 60,190, 50, 24,162,183,213,246,160, -149,128,212,212, 84, 42,169,193,178, 55, 37,127, 99,235, 95, 64,235,146,191,160, 0, 60, 8, 11,175,133, 83, 10, 27,149, 0,118, -138,134, 46, 52,180, 95, 73,225,229, 50,159,126,161,190, 88, 48,119, 40,214,253,239, 87,184,200, 36, 8, 15,243, 5,164, 78, 4, -153, 0, 0, 32, 0, 73, 68, 65, 84, 69, 81, 70,150, 36, 65,225,229, 50,132,134,246, 59, 11,160,202,146,192,192,160, 30,216,177, -247, 52,102, 76, 1, 72, 49, 48,116, 50, 16,216, 5,216,144,109,116,208, 92, 64,175, 7,118,236, 53, 28,223, 90,176,230, 41,106, -173, 52,192,123,247,238,169, 66, 66, 46, 99,237, 90, 0,208,227,189,247,206,224,228,201, 90, 85,109,109, 45,170,170,170, 80, 92, - 92,140,219,183,111, 35, 34, 34, 2,211,166, 77,179,153, 6, 72, 8,145,211, 52,173, 18,137,108, 39,248, 48,138, 7, 87, 48, 75, - 0, 27, 54,108,192,168, 81,163, 90,245,249, 74, 73, 73,161, 24,226,183,181, 4, 96,235, 24, 99,120,245,239,143,187, 90, 45,244, -170, 60,104,165, 78,112, 35, 18,104,104, 26, 21, 90, 45,170,198, 60, 1,159, 1, 3,120,122, 5, 41, 12, 26, 52,136,247,186,191, -177, 12, 99,162, 55,215,102,143, 18,112,236,216, 49,171,109,108, 96,142,252, 25,203, 31,128, 16, 16,216,202,228, 47, 40, 0,143, - 56, 26,215,255,217, 47, 3,232, 67,251,142, 28,179,125,235, 87, 7,127,201,119,239, 53,100,128, 63, 98,162, 2,177,251,167, 98, -236,248,209,240,112,190,149, 60, 28, 52, 77,240, 75,126, 9,138,138, 10,175,198, 37,188,240, 15, 0,245,150, 4, 70, 12,251, 59, -181, 99,211, 27,228,227,175, 12,169,128,171, 63, 48,164,254, 69,141, 48,164, 2,126,252,182,129,252, 63,254, 10,208,163, 45,239, -138,128,246, 90,230,182, 60, 8,173,149, 5, 80, 83, 83,131,254,253, 53, 24, 52,200,240,126,224, 64,130,221,187,139,113,241,226, - 69,166, 16, 16, 34, 35, 35,209,189,123,119, 86, 53, 0,198,141, 27,151,151,149,149,101,211, 11,160,211,233,224,233,233, 41,231, -122,190, 13,233,128,141,153, 1,251,247,239, 39,124,151, 1, 6, 15, 30,204,170,141,139, 18, 96,235, 56,214, 66, 69,162, 60,237, -144, 33,242,243, 78, 78,232,114,243,166,202,237,218, 53,104,186,117,195, 21, 95, 95,185,119, 68, 4,208,176, 68,195,131, 96, 29, - 65,210,205,100,152,107, 99,219,151,166,199, 49,132,111,171,141, 15, 76, 73,159,241, 8,216,187,132, 39,160, 57,216, 4, 70, 11, - 10, 64, 11, 90,230, 15,233,111,220,141,126,114,218,202,156,221,223,191,241,251,205,170,160,224,110, 94, 24, 63, 46, 8, 94,158, - 50,148,149,107,112,242,215,219, 40,188, 92,134,162,162,194, 67,209, 79, 78,219, 12,224,186, 45,129,221,122,196,201, 15,228,111, - 87, 29,202,175,196,248, 49,192,154, 37,134, 74,128, 69, 87,129, 47, 55, 26, 44,127, 61,218,162, 91,143, 56, 57,223,107,181,103, - 9,128, 45,249,183, 70, 12,192,205,155, 55,229, 94, 94, 62,170,227,199,255, 0, 0, 92,188,216, 22,131, 6,245, 70,187,118,237, - 32,147,201,112,243,230, 77,121, 92, 92, 28,167, 82,192, 93,187,118,149, 95,184,112, 65,101,236,209, 49, 37,255,224,224, 96, 12, - 30, 60,152, 19,137, 49, 89, 0, 70,107,255, 76, 64, 32, 47, 37,192, 28, 17,242, 37, 71, 91,228,206,137,252,141,148,128,118, 3, - 7,162, 22,160,106, 27,154,236, 13, 85,179,151,252,185,244, 27,219,223,114,180, 60,182,228,175,141, 15, 6,132,245,255, 7,226, - 9,176,164, 24,112, 74, 3,228, 27, 44,199, 53, 13,144,175, 60,190, 50, 29,125,126,214,250,201, 81,231,103, 79,224,162,147,180, -141, 50, 46,225,133,239, 10,206, 28,248,124, 75,246,190, 64,191, 78, 65, 67,141,246, 2, 56, 18, 26,218,239,104, 92,194, 11, 11, - 1,212,176,145,215,187,207,232,188,222,125, 70, 83, 39, 14,127, 78,190,223,113, 17, 31,126,246,240,237, 5,240, 48,146, 63, 0, - 60,253,244,211, 56,125,250, 52,102,206, 60,222,224, 1, 24,136,169, 83,251,201, 93, 93, 93,243,248,202, 12, 15, 15,207, 11, 15, - 15,167,182,110,221, 26, 89, 85, 85,165, 18,139,197, 16,137, 68,208,233,116,144, 74,165,112,115,115,147, 59,128,252, 29,162, 4, - 8,248,115, 34, 53, 53,149, 74, 75, 74, 35,254,115,252,229,232,106,254,152,146,164, 28,149, 16, 15,208,186,144,176,157, 40, 29, - 61,241,182,132, 60, 62,191,245, 40, 95,175,157,168, 8,237, 59,242,217,208,190, 35,153,138, 49,110, 0,124, 0,220, 4,160, 70, - 67,217, 87, 46,136, 24,246,119,138, 79,145,159,150,238,135,135,169,174,132, 41, 92, 93, 93,243,134, 13, 27, 70, 13, 27,230,248, -142, 75, 72, 72,200,131,131,138, 91, 50,235,254,166, 36, 63,106,212, 40,106,195,134, 13,228, 97,136, 7, 16,240,240, 41, 1,214, - 15,128, 64,254, 45, 0,182, 85, 0, 1,128, 10, 15, 15, 23,214, 94, 4, 8, 16, 32, 64,128,128,191, 24,132,189, 0, 4, 8, 16, - 32, 64,128, 0, 65, 1, 16, 32, 64,128, 0, 1, 2, 4, 8, 10,128, 0, 1, 2, 4, 8, 16, 32, 64, 80, 0, 4, 8, 16, 32, 64, -128, 0, 1,127, 14, 52,201, 2,152, 61,123, 54,239,168, 76,115,133, 28, 4,121, 45, 35,143,205, 38, 54,173, 41, 47, 55, 55, 55, - 18,128, 42, 51, 51,211, 33,242,246,238,221, 27, 73,211,180,195,228, 9,247, 95,171,201,155, 6, 96, 99, 11,159,159, 19, 0, 25, - 12, 69,107, 52, 48,100,179, 16,152, 20,177, 17,198, 67,144,247,103,151,199, 89, 1,176, 69, 14,150,192, 37,149,202,209,242, 30, - 36,146, 18, 43, 8,164, 82,100,108,112, 97,117,126,185,185,185,145,153,153,153, 42, 71, 93,175,177,188, 21, 43, 86,200,147,147, -147, 85,124,182, 23, 54, 39,239,236,103,109, 17,246, 74, 37,236,145,199, 96,226,160,157,170,211, 23,244, 0,128,140,140, 12,146, -148,148,100,215,120,246,232,240, 61,212, 58,111,184,184,184, 32, 51, 51,147, 36, 38, 38, 62, 44,247, 71,251, 89,175, 39,127,179, -250,163, 21,207, 1,248,195, 1,242, 2,102,191,250,218,154, 47, 62,253,248, 89, 11,242,156, 0,232, 96,189, 34,155, 19, 12,149, - 27,219,207,157,251,218, 55,159,124,242,241,115, 48,108,230, 68,195, 1,149,220, 76,159, 99,142,247,198,225,150, 26, 8,138,162, - 98, 69, 34, 81,111,145, 72, 20, 73, 81, 84, 15, 0,174, 90,173, 54, 71, 44, 22,123,210, 52, 93, 74, 8,121, 27,192, 93, 71,246, -129, 0, 1,230,240, 92, 81, 17,249, 38, 40,200, 97,115, 84,146, 66, 65, 50, 90,136, 19, 37,182, 30,114, 66,136,181,135,142,243, -132,225, 40,121, 92, 45, 88, 71, 98,207,158, 61, 54, 39, 17,134, 92, 83, 82, 82,224,235,235,107,182, 2, 94,114,114,178,138,237, -111, 50,242, 24,226, 63,114,228, 72,163, 34, 96,143, 60,250,220, 59, 16,245,126, 15, 95,239, 53,148,142,165,207,189,211,120,140, -168,247,123,156,250,165,109,229,235,132, 38,192,119,187, 13,178, 98, 70, 59, 33, 52,184, 0, 25, 25, 25, 4, 0,184, 42, 2, 21, -186,239, 34,203,175,220,133,154, 26,173,170,169,107,131,152,232,114,116,242,163,112,252,248, 33, 82, 89,169,193,152, 49, 99, 90, - 85, 17,152, 61,119,238,171,160,233,113,179,231,206,125,245,139, 79, 62,121,219,110,121,115,230,190, 76,104,122,236,236, 57,115, - 95,253, 98,149, 89,121,245, 44,196,212, 3,160,230,204,153,251, 42, 77,235,199,205,153, 51,247,213, 85,230,101,137,192,163,214, -131,157,208, 26,223,127, 63,252,240,131,106,242,228,201,242,113,227,198,229,217, 35, 84, 44, 22,199, 72, 36,146, 81, 18,137,228, -105,177, 88,236, 37, 18,137,220,210,211,211, 69,111,188,241,198, 11,122,189, 30, 58, 3,158,214,235,245,241, 0,126,110, 80, 2, -180, 13,243, 95,139, 47,131,238,216,177,131,176,157,239, 98, 99, 99, 57,221,211, 59,119,238, 36,246,124, 95,128,227,225,178,108, - 25,160, 84, 58, 76,158,122,254,124,187,190,207, 84, 4,228,180, 29, 48, 27,242, 31, 48, 96, 0,242,243,243, 57, 89,252,214, 72, -158,141, 60,115,242, 83, 82, 82, 80, 92, 92,140,204,204, 76,135,110,235,154, 20,159, 65,224,210, 3, 25, 27, 35, 41, 0,200,200, -244,160,184,144,255,138, 21, 43,228,165,165,165, 42, 75,228,159,146,146,130,244,244,116, 78,228, 15, 0,137,137,137, 24, 58,116, -168,124,232,208,161,118,201, 99,200,158,249,191,244,125, 52, 33,255,249, 83,100, 88,182, 73,195,170,175, 60,212,201, 36,172,135, - 24, 53,106,130,215,159,147,225, 72,129, 14,234, 26,130, 90, 45, 32, 15, 47, 64,193, 69, 61, 39,111, 64,241,245,143, 73,249,173, - 54,112,111, 43,133, 95, 71, 55,180,239, 16,140,171, 69, 90,116,237, 93, 15, 39, 89, 41,114,183,220,193,150, 45, 91,200,164, 73, -147, 90,101,194, 83, 40, 20,206, 62,157, 58,205,253,246,200, 81, 42,166,103,247, 87, 21, 10,197, 7, 74,165,178,206, 30,121,237, -253, 58,205,253,110,239, 17,106,108,120, 79,187,228, 41, 20, 10,169,159, 95,199,185, 63,170, 14, 80, 3,251,133, 90,146, 69,183, - 66,183, 53,110, 63,152,153,153,169,138,143,143,199,166, 77,155, 84,227,198,141,107, 54,134, 17, 17, 17,100,241,226,197,136,143, -143,183, 58,190, 18,137,100,140, 84, 42, 13,147, 74,165,115,164, 82,169,235,245,235,215,209,189,123,119,136,197, 98,184,187,187, -163,176,176, 16,110,110,110,146, 99,199,142,121, 30, 62,124,248,192, 43,175,188,210, 21,192, 85, 0, 82, 75,125,144,148,148,212, -204, 88, 49,158,183,152,118,138,162,144,145,145, 97,243,254,219,186,117,171, 69, 25,198,237,132, 16,196,198,198,114,234,208,236, -236,108,187,190,223,146, 56,117,234, 84,100,120,120,120,158, 35,100,221,190,125,155,208, 52, 13,136,202,161,173,211, 64,234, 44, - 3,104, 79,136, 68, 34,116,232,208,129,234,107,234,185,180, 82, 12,231,241,199, 31, 39,155, 54,109,130, 37,121, 83,166, 76,193, -193,131, 7, 41,190,231, 7, 0, 55,111,159, 39,198,231,103,207,181,243,241, 38, 88, 42, 3,204, 74, 1, 96, 75,254,108,145,146, -146, 98,243, 24, 54,196,101,137,252,151, 46, 93,138, 5, 11, 22, 52,105,231,171, 4, 36, 13,200, 32,104,215, 3, 25, 63, 70, 82, -198, 22,255,216,177, 99, 41, 0, 96,254, 23, 22, 22, 18, 54,100,109,141,252, 27, 60, 3, 54,173,118,198, 77,111,108,225,155, 46, - 45,240,145,103,205,194,159, 63,133,253, 78,113, 62,234,215, 73,247,199,196,112,113,166,240,152,191, 24,119,202,104,212,235,196, -184, 91, 78, 80, 81, 77, 80,248, 59, 13,136, 0, 31,215, 51,200,205,205,141,140,138,138,178, 58, 41, 92,189,246, 81,100, 72,112, - 16, 14,223,186,141,110, 1,237, 17,214, 55, 16, 98,103,111, 60,214,173, 12,101,106, 13, 74,111,233,241,251,109, 13, 92, 37,197, -200,205,117,183, 41,175,133, 48,253,185, 55,222,144, 22,119,244,135,243,128,129, 34,205,129,253,211, 1,124,197, 67, 14, 99,137, - 79,127,254,213,121,210,223,165,126,112,235, 17, 33,170, 60,123,144,175, 60, 0,152,254,202,220,215,164,112,118, 71,183,158,161, -162, 11,191,158,176, 71,150, 35, 65, 51,207, 8, 69, 81,144,201,100,114, 0, 42,211,123, 98,192,128, 1,172,200, 31, 0,156,156, -156, 60,101, 50,217,140, 59,119,238,184,246,232,209, 3,253,251,247,135, 68, 34,193,167,159,126, 10,189, 94,143, 62,125,250, 96, -243,230,205, 56,118,236, 24,206,156, 57, 3,177, 88,252,185, 94,175,159, 96, 77,230,132, 9, 19, 26,231, 57, 91,243, 32, 27,194, - 85, 42,149,114, 63, 63, 63, 21, 33,196,170, 1,116,235,214, 45,206,123,101, 48,178,249,126,159, 33,234,243,231,207, 91,157, 55, - 66, 66, 66,228, 92,201,252,252,249,243,170,138,138, 10,120,120,120,200,237, 81, 4, 78,156, 60, 68, 22,191, 63, 27,109,218,184, - 52,251,172,166, 70,141,236,205,167,113, 70,169,164,198,119,236, 72,174, 39, 36, 88,158,219, 15,172, 48, 12,230,129, 21,232, 56, - 38, 14,178,136,129,208,247, 8,109,234, 62,251,110, 61,188,150, 76, 66,111,163,165, 34,245,147, 47,225, 11, 27,231,183, 48,117, - 22,188,219,185, 26, 26,222, 89,137,228,121, 51, 1, 0,247,238,214,226,195,180,213, 36,162,255,112,222, 74,128,163,151, 20,172, - 42, 0,140,197,110,203, 82,127, 88, 80, 92, 92,140, 5, 11, 22,240, 82, 32,172,193, 96,233, 39, 81,123,246,236, 33,153, 25,131, - 1,169,154,176, 89,251, 55, 71,214,166,164,108,109, 89,192, 18,140, 21,138, 35, 71,142,168,134, 14, 29,218,196,245,207, 85,222, -127,223,112,179, 56,185, 77, 95, 94,195, 90, 14, 77,211,145,206,174, 20, 68, 34,192,213, 5, 40,175,164, 81, 71, 8,218,184, 80, -208,208,128,186,142,160,115,123, 17,104, 29,112,233,186, 30,197,197,197, 42, 88, 41, 79,123,174,224,135,200,176,176, 94, 42,169, -148,224,229, 25, 67,160,215, 19,220, 42,213,226,218,141,114,192,233, 58, 92,188,234,112,179,244, 10, 68,210, 10,156, 59, 87, 14, - 15, 47,235,242, 90, 10,206,222,222,239, 60,253,183,191, 57,191, 69, 3, 94, 11, 82,221,110,159, 62,245, 54, 79,146, 37, 0, 32, -243,240,126,231,255,158,253,155,243,242,203,122,116,158,150,226,118,161,248,140, 57,121, 54,119,100, 83, 40, 20,104,235,225,249, -206,244,103,159,115, 62,115,173, 12, 9,207, 36,185,253,251,253,100,190,231,102,209,147,103,169,221,134,226,173,103,158,145,184, -184, 56, 68, 69, 69,229,101,102,102, 66,173, 86, 55,142, 33, 99,249,199,197,197,177, 26, 83,103,103,231,225, 53, 53, 53,189, 66, - 66, 66, 32,151,203,145,156,156,140, 23, 95,124,209, 48,153,215,215, 99,221,186,117,200,207,207,199,137, 19, 39,240,253,247,223, - 67,173, 86, 7,211, 52, 29, 99, 77,230,248,241,227, 29,122, 63,237,216,177,131,213,210, 28, 69, 81, 42,174, 46,124, 99,217,124, -190,223,224, 26,206,171,168,168, 64, 73, 73,137,217,207,253,253,253,193,151,192, 75, 74, 74, 80, 82, 82, 98,151, 34,112,230,244, - 69,124,179,126, 59, 70,142, 28,142,208, 62,157, 26,219, 11,126,189,129, 3, 7, 14, 97,243,166,159, 72,230,155,111,226,122, 66, - 2, 92, 70,140,128,250,231,159,205,202,201, 24,153, 76, 1,192,165,245,171, 72,223,210,221,120,110,239,118,232,123,132, 66, 61, -111, 17, 0,192,101,249, 34,184, 93, 44,192, 27,197, 82,116,127,126,206,253,126,172,185,255,156, 90, 59,191,168,177, 35,154,157, - 95,238,158,159,113,230,244, 69, 68,244, 31,206,251,254,225,179,164, 96,236,238,183,230, 13,144,112,181,216, 29, 77,180,246, 34, - 51, 51,211,174,239, 39,101, 40, 8, 58, 2, 25,241,134,137, 43, 35, 63,169,137,155,223, 96,241, 87, 16, 83, 79, 0, 91,178, 46, - 45, 45,109, 66,206,124,200,154, 45, 24,165, 67,161, 80, 16, 91,245,160,173, 89, 54, 12, 24,247,191, 37,121,132, 16,114,231,220, -235,232,216,224,250,111,212,152,245, 4, 26, 45, 80,223,208, 86,175, 35, 32, 34,195,235, 95,207,228, 51, 89, 2,102,225,238, 94, -161,170, 81,139,224,227,237,137,242,123,181, 40,175, 40,199,145,227,183,112,227, 54,129,180, 77, 45, 58, 5, 87, 67, 93,123, 7, -221,251,214,163,107, 72, 29,190, 95,147,143,221,187,119, 71, 62,192, 91, 78,164, 80, 40,162,166,188,156,212,161,196,195, 11, 69, - 58,192, 37,106, 28, 68, 94,237,124, 20, 10,197, 56,165, 82,249,163, 17, 89, 59,193,104,221,219,210,188,175, 80, 40,198, 38,206, -120,185,195, 31, 34, 15, 92,173,174,135,103, 68, 20, 36,238, 94,166,242, 0,118, 1,108,209, 19, 39, 77,238, 64,196,206,168,168, -169, 67,216,128, 97,112,107,235, 97, 78, 86,171,128,177,254, 41,138,194,182,109,219, 72, 92, 92, 28,182,111,223, 14, 23, 23,151, -200,148,148, 20, 21, 23,242, 7,224, 92, 94, 94,254,124,125,125,189,200,213,213, 21,163, 70,141,194,242,229,203,225,228,228, 4, -133, 66,129,245,235,215, 35, 63, 63, 31, 71,142, 28,193, 79, 63,253,132, 95,127,253, 21, 62, 62, 62, 62, 58,157,238, 49,216, 88, - 2, 73, 74, 74, 34,182,150, 0,214,172, 89,195,234, 60, 91,114, 9, 96,235,214,173, 14, 89, 2,240,240,240,144,151,148,148,168, - 44,125,102,239,184,243, 81, 4,228, 69, 69,228,238,178,101,248, 8, 0, 14, 31,198,189, 41,177, 88,209,175, 71,163,203, 62,180, -119,111, 76,157, 54, 30, 93,203,238,224,122, 66, 2,218,205,159, 15, 85, 80, 16,213,247,231,159,173, 62, 39, 82,249,227,232, 17, - 19,137, 55,230,127,128,127,161, 0, 43,134,142, 65,216,160, 33, 8,190, 87,140,117,158,253, 81,236,113, 27,125,100, 50,162,209, -104, 88,141,175,124, 76, 63, 60,247,124, 28,142,254,242, 43,118,231,252,136,119, 1,172, 88,190, 22,161,189,123,227,185,231,227, - 80,171,190, 11, 25, 7,121,166,176, 55, 6,128,147, 7,224, 81,130, 82,169,164, 28, 17,181,206,144,123,230,130,203,128, 88,138, -164,113, 93, 1,207,174,200,104, 72, 88, 98,187,246,239,104, 24, 95, 27, 19,244,103,108,249,155,130,137, 13,176, 20, 12,200,103, - 39,194, 13,243,218, 88,244, 8,184, 87, 38,227,138,150,224,214, 29, 26,128, 8,110,174, 6, 23,103,189,142, 64, 83, 7,104,180, -128,166, 14,208,214, 3, 26, 53,160,173,187,239, 37, 49,167, 80,184,233, 94, 39, 55,174, 5,160, 75, 55, 55, 16, 39, 9,238,168, -213, 80,237,187,142,115,133, 55,112,239, 94, 53, 66, 7,232, 81,163,209, 65, 83,167,135,186,150,198,173,107,128,186, 6,216,178, -101,139,138,203, 6, 24,118,142, 9, 45,246,244,124,103,230,155,111,202,190, 55,162, 16,175, 55, 83,221,238, 45,152,247, 54,128, - 31,141,200, 90,203, 66, 36,145,184,121,190,243,226,107, 11,100,187,110,232, 27, 27, 59, 63,189,192,237,234,151,111, 26,203, 99, -229, 5,112,117,115,127,251,213,215,231,201,138, 74,238,239, 22, 25,255, 76,146,219,119, 25, 43,204,201,226,244,172,153,187,151, - 56, 62,107,132,177,254,101, 50,153, 60, 42, 42, 42,143, 73, 25, 85,171,213,170,252,252,124, 42, 46, 46,142,173, 44, 29,128, 96, - 0,116,120,120, 56, 45,147,201, 68,235,215,175,199, 11, 47,188,128, 37, 75,150,128, 16,130, 95,126,249, 5,251,246,237,195,153, - 51,103, 80, 81, 81,129,238,221,187,163,178,178,210, 85, 36, 18,249,218, 18, 62,113,226, 68,139, 74, 50,179, 52, 48,126,252,120, - 78,110,250,135,117, 9,192,154, 23,192, 30,235,223, 94, 69,160,172,188,188,241,181,111,234, 44,132,165,206,198, 72,147, 99, 46, - 63,249, 34, 58,239, 63,142,162,121, 47,227, 23,127,127,184, 0, 56,163, 84, 82, 48,147, 22,167, 86,171, 73,231,206,109,113,245, - 26, 16, 26, 17, 2, 44,123, 11,175,125,185, 5, 51,130, 78,163, 95, 93, 33,222,184, 45,197,251, 27, 22, 98, 73,218, 23, 56,243, -235, 65,116,233, 28, 74, 92, 92, 44,123,125,141,229,121,183,115,197,147,177, 67,240,100,236, 16, 44,166, 87, 66, 91,183, 0, 39, - 79, 2, 39, 79, 2, 7, 14,196,225,223,171, 46, 34, 54, 54,134, 4, 4, 60,134,160,160,111, 56,241, 83,238,227,111,161,232,160, -196,198,220,253,197, 95, 67, 1, 80, 40, 20, 36, 49, 49, 81,206,172, 25,154, 42, 1,198, 19, 18,179, 30,207, 55, 30,128, 33,253, -177, 99,199, 82,134,101, 0, 41, 50, 54, 60,216,235,101,162,254,163,162,162,168,220,220, 92, 98,203, 27, 98, 43,237,208, 26,161, -115, 93, 14,120,254,205, 26,248,119, 16,225,153,120, 41, 52,117,128,135, 59, 5, 17,213, 96,245,131, 64, 83, 11,212,104, 9,106, -212, 4, 53, 26, 2,154, 0, 34, 43, 49,215,207,207,173, 65,159,126,197,240,235,117, 15,123,118,149,226,222, 61, 13,194,135, 85, -162,175,119, 53,224, 84, 7, 77, 45,141,210, 27, 4, 53, 53, 20,116, 58, 10,222, 62, 20, 64, 61,240, 88,182,208,254,253,250, 13, -244, 10, 8,192, 33,189,145,242,242,204,179,184,151,146, 60, 64,161, 80,244, 86, 42,149,231, 56,220,207, 33,131, 70,140, 30,216, -206, 63, 0,199,143, 54,198,200,161,189,252,255,112,117,205, 2,115,242,172,109,133,221,123,196,136,145, 3,253,253, 59,227,220, -137,203,141,237, 35,158, 24,143,255, 41,151,115, 62,183, 22, 64,227,185, 51,207, 47,179, 12,192, 96,251,246,237,205,226,143,204, -196, 2, 48,131, 30, 12,224,212,252,249,243,135, 75, 36, 18,183,175,191,254, 26,107,215,174,197,204,153, 51,177,116,233, 82, 80, - 20,133, 43, 87,174, 64,173, 86, 35, 37, 37, 5, 58,157, 14,179,102,205,162, 41,138,178,249, 0, 56, 50,154,254, 97, 95, 2,176, -230, 5,112,132,245,207, 23,235,215,175,199,223,146,166,162,162,188, 14, 72, 91,141,154, 3,199,209,102,228,192,198,207, 75,211, - 86,163,192,217, 25,212, 63, 94, 66,216,180, 39,113,120,221, 46,244,237, 59,200,162,188, 75,151,206, 98,216,136, 24,156, 45,240, -194,234,207, 51, 49,114,228,112,188,255,217, 66, 44,142,154,142,111, 1,244,122,238, 5,172,254, 60, 19, 82,169, 23, 38, 76, 28, -136,175, 57,200,251,228,163,141, 24, 20,215, 7, 31,244, 89,142,179,227,221,224, 21,191,185,201,177, 62,174, 50, 28,205, 83, 33, -224,111, 51, 56,247,195,193,131, 18, 44, 91,230, 98, 67,129,251, 11,121, 0, 76,215,145, 45, 17,124,195,113,172,145,145,111,136, - 80, 55, 16,255, 37,100,126,122, 25,134, 44,128,166, 74, 1,155,101, 0, 71,187,245,115,115,115,137,177,245,207,120, 4,140,223, - 39, 38, 38,130, 41,150, 99,169, 48, 4, 23,242,103,178, 0, 44,201,211,233,129,154, 90,130, 58,173, 33,216,175, 78, 75, 32,113, -190,255,153,166, 22, 80,215, 19,220,189, 71,240, 71, 25,193,137,115, 58,208, 52,144,152,152, 40,191,116,233, 82,179,177,209,233, -128,146,235, 90, 92, 47, 42,195,193,195,101, 32,132,194,185,223,104,196, 61,163,131, 84, 66,240,199,109,224,224,143, 64,101, 37, - 1,161,129,199,199, 80,144,201,128,152,152, 9,184,122,245, 42,171,107,202, 90,167, 32, 19,103,240,207, 18, 17,185,181,125,243, -229,165,233, 78,217, 68,212,132,137,125,156,157,225,244,143,185, 78, 87, 86,173, 92, 8,224, 89,182,242,196, 46,110, 11,103,191, -189,212,233,199, 18,210, 68, 94,187, 54,206, 8,155,246,138,211,185,141,159,154,202,179,232, 1,144,185,180, 89,184,224,157, 69, - 78,151,111, 85, 52, 57,160,173,123, 27, 76,122,102,166, 83,246,127,191,226,116,110, 45,229,181, 51,215, 22, 17, 17, 65, 78,156, - 56,129,109,219,182, 53,251, 78,124,124,188,217,161, 0,112, 22,192,169, 21, 43, 86,244,243,244,244,116, 99,220,224, 95,125,245, - 21, 94,120,225, 5,172, 93,187,182,209,138, 95,177, 98, 5,202,203,203, 81, 89, 89, 89, 93, 91, 91, 91,220,224, 65,144, 90, 59, -215,151, 95,126,153,152,186,232, 25,235,159,173,251,255, 81, 89, 2, 48,231, 5,112,180,245,207,200,100,187, 4,112,110,216, 48, - 80, 47, 79,131, 39, 0, 50,102, 0,106, 79,156, 69, 77,218,234,251,253,150, 52, 21,221,159,155, 10,153,204,112,253, 5, 5,133, - 86, 9,187,160,160, 16, 0, 16, 19,107, 80, 34,242,143,159,193,183,223,124, 7,215, 33,131, 81, 91,175,131, 22, 90,140, 26,221, -191,201,241,108,229, 93,215,107,241, 76,135, 87, 64,159,168, 67,226,191,198, 64,250,212, 17,244, 14,237,141,208,176,224,198,243, - 75,121, 99, 21,130,130,196,172,239,155, 39,254,239,137,168,115, 56,183, 7,255,251,134,178, 21, 2,240,197, 23,104,153, 66, 64, - 15, 35,242,243,243,109, 70,147,231,230,230, 70,178, 78, 41,116,110,131,204,174,251, 1, 93, 62, 65,183, 54, 72, 74,235,134,140, -188, 56, 10,200, 32,247, 21,130,177,188,151, 1, 76, 83, 1, 45,165, 6, 90,154, 44, 21, 10, 69, 35,249,155, 6, 0, 50, 46,117, -166,205,154, 7,192, 88,158,163, 38,243,157, 59,119, 70,222,184,185, 75, 69,183,167, 33,146, 0, 78, 34,195,253, 93, 79, 19,232, -116, 64, 85, 21,129,182, 30,208,213, 27,148,130, 9, 19, 13,222,155, 75,151, 46, 89,148, 87,119,103,167, 42, 52,148,198,129,125, -122, 80, 34,224,143, 91, 20,100, 46,192,190,221,128, 86, 77,129, 34, 64,223, 8, 39,148, 92,163, 49,122,244,120,196,198,198, 82, -108, 42, 97,101,173, 83,144,101,175, 0,243, 63,227,175, 4, 16, 90, 31,173,111,231, 35,218, 69,223,103,161, 14, 0,252, 40, 64, - 61, 96,128,228,178, 78, 31,205, 73, 30,161,163,225,238, 45, 82,221,210, 55,202,107, 47, 3,124,100, 20, 92,251, 12,144, 20,124, - 71, 71, 91,178,162,205,201,106,227,238, 41,186,122,187,188,129, 88, 0,119, 23,103,184,187, 74, 17, 17,222, 95,178,229, 91, 18, -221,202,143,174,217, 62,103,162,254,227,226,226, 26,239, 81,198,123, 55,101,202, 20,107, 22,104, 53,128,203, 39, 79,158,172, 30, - 57,114,100,123, 24,229,244,127,245,213, 87,141, 36, 91, 95, 95, 15,189, 94,143, 75,151, 46,161,125,251,246,119,104,154,102,165, - 45, 78,156, 56,209,226, 18, 0, 23,162,125, 20,150, 0,204,121, 1, 28,105,253,115, 33,126, 6, 29,253, 61,177,102,205, 94, 36, -196, 15, 67,135, 1,161,192,128, 80, 80, 47, 79,107,170,244, 2,184,125, 75,141,173,219, 14,163,163,191, 39,123,121,126, 46, 24, - 48,176, 59, 6, 12,236,222,236, 56,174,242, 70, 77, 14, 65,234,232, 79, 65,159, 53,144,255,139,111, 60,207, 75,158, 41,222,116, -127,115,207,146,170, 37, 99,111,226,102,139, 61,144,118, 41, 0,249,249,249, 15,188,106, 31, 99,229, 50, 68, 23, 21, 21, 69,153, - 33,127,194,184, 21, 19, 19, 19,121,253,142,113, 22, 0,211,198,213,242, 55, 13, 0,108, 64, 99, 91,114,114,178, 42, 49, 49,145, -245, 67,102, 76,254,230, 98, 2,184,202,179,133,101,155, 52,176, 37, 47, 54, 54, 54,111, 97,202, 86, 60, 49,212, 9, 52,128,122, - 45, 13,103,169,161,155,170,106, 8,234,234, 9,116,122, 32,255,172, 30,122,154,192, 86,202, 94,108,108,108,222, 59,111,109,197, -232, 72, 49, 38, 77, 23,163,186,138,160,170, 2,168,169,162,208,173, 59,129,190,158,130, 68, 36, 67,249, 61, 26, 37,191,107, 49, -239, 53,118, 1, 99, 89,235, 20,100,229, 92,160, 71, 0,176,234,117, 96,206, 71,252,148, 0, 82, 91, 51,249, 31, 3,250,239,244, -203,222,233,230, 53,226,113,116, 0,208,129, 2,244,135, 14, 34,247,249,103,171,235,107,107, 38,113,145, 71,107,106, 39,189, 28, - 53,112, 87,200,226, 44, 55,223,190,195,225,227, 76,161,189,140,130,250,252,207,216,250,214,140,234,122,117, 45,107,121,117, 26, -245,164,216, 39, 70,238, 74, 78,251,220,173,119,191, 1,112,119,149,194,221,197, 25, 69,231, 78,225,157,148, 87,171,213, 28,100, -241,177,228,217, 92,174, 57,242, 95,180,104, 81, 51, 55,255, 15, 63,252,160,138,143,143,135,133, 34, 65, 12,209,107, 1,156,234, -217,179,103,145, 70,163,233, 36, 22,139,101,174,174,134, 84,172, 77,155, 54, 97,202,148, 41, 80,171,213,208,104, 52,168,171,171, -131,155,155,155, 70,175,215,103, 19, 66,110,177, 57, 89, 71,101, 3, 60, 42, 75, 0,198, 94, 0,230,117,107, 16, 63,131,110,221, -252,240,102,106, 18,118,239,250, 5, 89, 91, 78,192, 89,218, 22,191,151,220, 95,193,234,236,223, 27,117,218, 74, 68, 12,232,133, -143, 87, 38, 97, 73,218, 23,156,228,249,250,122,160,224, 92, 65,227,231,161,189, 67, 81, 90, 90,193, 73,222,248,185,147, 48, 69, -244, 44,234,206, 86, 99,232,156, 48,208,125,101, 88,179,230,251,198,243,171,168,168,192,240,199, 67, 88,201, 51, 69, 84, 70, 20, -245, 19,126,106, 81, 62,229,173, 0,180, 4,249,179,145, 25, 21, 21, 69,101,102,102,146, 6,107, 23,153,153,153,196, 56, 45,209, -212,234, 55,167, 32, 52,247,195, 82,128, 84, 4,184,136, 1, 55, 9, 80, 87,133,204, 37, 78,128,203, 81,146,244, 84, 55,192,197, - 27, 25,223,112,183,250,173, 69,251, 51,100,205, 54,135,221,148,252, 77, 99, 2,184,202, 99, 75,254,108,228,125,152,190,154,122, -125,238, 44, 34,147, 1, 52, 13,244,233, 41,190, 63, 30,191,234, 81,175, 39,208,211, 98, 76,158, 60,153,149,114,242,222, 7,171, -169,121,243,102, 17,157, 14,208,214, 19,232,117,128,136, 2, 34,199, 3, 85,229, 20,126, 59,173,134, 90, 35, 66, 66,252,100,214, -110,255, 69, 47, 2,193,157, 13,239,131, 58, 1,124, 61, 1, 74,165,242,136, 66,161,136,185, 53, 33,118, 87,192,214,157,110, 1, - 35, 30, 71,253,161,131,216, 28, 31, 91,173,173,170,138, 81, 42,149, 7, 57,202, 59,168, 80, 40, 98,206,191, 59,113,151,255,191, -178,221, 58, 13, 26,129,154,243,135,176,225, 31, 19,170,235,106,185,201, 99,100,173, 72,253,251,174,247, 63,249,210,109,232,176, -225, 40, 44, 56,133, 87,147,158,173,174,173,174,230,124,110, 45, 13, 75,197,126, 20, 10, 5,137,139,139, 99,147, 13, 32,246,244, -244, 60,165, 86,171,191, 45, 46, 46,238,218,175, 95,191, 64,157, 78, 39,113,114,114, 66,118,118, 54,198,142, 29, 11,141, 70,131, -218,218, 90, 92,186,116,169,210,203,203,107,175, 90,173,254,154,166,233, 26,176,172, 0,200, 20, 5, 98, 92,236, 92, 92,255,143, -218, 18,128,177, 23,192, 17,227,203,167,118,128, 57, 60, 25, 51, 4, 79,198, 12,105,120,103,191, 14,219, 84,222, 68,251,148, 59, -207, 31, 80,119,186, 26,207,127, 62, 30,239,239, 93,104,247,185,169,103,170,137,151,206, 11,154,111, 52, 15,196,176,230,165, 0, -180,134,229,111,106,125, 24,187,177, 45,185,250, 29,121,142, 92,214,254, 29, 77,254, 70,202,142,113, 33, 32, 70, 9, 82, 53,120, - 58, 56,201,179, 21, 11,192, 85,222, 71,159,172,166, 20, 10, 5, 17,137,128,131,249,134,181,126, 38,224,207,176,238, 63,153,147, -188,229,203, 87, 83,179,102, 55,212,164, 16, 25,100, 28,221, 15,212, 84,211, 32, 52,144,144, 48, 30,209,209,209, 54,199, 35,107, -157,130,164, 60, 11,120,186, 1, 37,119, 0, 23,103,128, 38, 64, 27, 25,144,166, 0, 82,149,188,148,128,131, 10,133, 34, 38, 63, - 33,118,151,199,162,247,220,242, 22,189, 83, 93,199,131,252, 77,229,229,205,159,176,203,229, 31,239,186,229,252,123, 49,103,242, - 55,150,245,202, 43,175,196,190,243,207,151,119,206, 73, 78,113,251,252,227,116,134,252, 79,155,121,246,117, 92,100,219, 90, 58, -226,250,188,153, 35,255, 89,179,102, 17, 38, 19, 96,219,182,109,132,162, 40,107,138,128,155, 86,171,173, 22,137, 68,185,254,254, -254,157,171,170,170, 94, 57,126,252,120,199,254,253,251,211, 58,157,174,182,162,162,226,246,233,211,167,175,116,235,214,173,168, - 93,187,118,197,106,181,122,147, 78,167,187, 77, 8, 97,173, 0, 48, 69,129,140,188, 2,124,198, 87,222,130,115,161,195,101, 59, -106,221,223, 94, 57, 26,181,216,161,199, 59, 90, 94,121,153, 8,233, 58, 5, 2, 15,251, 97,218,103,182, 21,147,242, 50, 17, 30, - 11,176,126,204,131, 36,127,139, 10,128,173, 92,127,174, 15, 58,219,218, 1, 92,228, 42,149, 74,202,210,102, 59, 92,200, 43, 35, - 73,105,112,243, 95, 4,112,209,244,211,138,134,191,203,224,113,189, 42, 71,145,171,113,191, 40, 20, 10,194,212, 25, 72, 78, 78, -230,149,225, 96, 42,111,195,188, 54,141, 74,129, 61, 74,147,233,152, 48, 1,127,124,189, 18,171,191,104, 42,175,186,210, 48, 1, - 39, 36, 36,112,187,255,190,117,232, 51, 83,111, 76,218,251, 22,189,187,190,174,170,234,121,123,173,107, 70,222,143,159, 47, 94, -175,169,173,154,161, 84, 42, 15,241,149,245,217,103,159, 29, 80, 40, 20, 49,159,175, 92,182,190,186,186,218,210,185,233,240,224, -209,100, 70, 53, 37,255,220,220,220, 72, 66, 8,182,111,223,110,124,140, 53,121,215,180, 90,173, 51, 33,164,138,166,105,165, 86, -171,253, 37, 32, 32,192,167,188,188,156,122,251,237,183, 43, 43, 42, 42,238,118,234,212,169,170,186,186,186, 70,171,213, 86,214, -215,215,215,233,245,122, 53,151, 19,118,208, 50, 64, 94, 11,246,105, 30,254,164,232,217,179, 47,245,238, 91, 25,100,234,211, 99, - 17, 26,214,205,226,113, 5,103, 47, 99,227,119,123,208,179,103, 95,234, 65,202,235,215,175, 31,149, 50, 79, 73,166, 62, 61,214, -186,193,124,188, 24, 27,191,219,131,126,253,250,217,188,151, 30, 36,249,155, 85, 0, 28,109,217,183,164,167, 32, 42, 42, 42,143, -149,139,223, 6, 28, 25,213,255, 32, 60, 35, 92, 54,253,113,132, 55,128,235,152, 24,167,117,217,187, 36, 97, 42,143, 43,249,219, - 19,241,207,134,180, 1, 4, 61,140,242, 28,125,110, 14,186,183, 41, 0,160, 40,138,136, 68, 34, 48,127,140, 11,123,252,248,241, -136,137,137, 1, 77,211,160,105, 26,132, 16, 91,191, 71,233,116, 58, 87, 66,136,158,166,233,186,250,250,250,253, 98,177,152, 18, -137, 68,206, 0,156,105,154,134, 94,175, 23,235,116, 58,169, 78,167,235,168,215,235,207, 27,125,183,197, 55, 1, 18,224, 24, 37, -224, 74,177,134,236,222,185, 5,215, 74, 43,225,231, 85,219,248,217,173, 50, 87, 4,248,182, 69,175, 94,189,108,146,117, 75,201, -235,215,175, 31,117,171,164,142,172, 90,185, 3,133,191,223,105, 38, 47,184,179, 15, 2, 3, 3, 89,145,127, 75,193, 90,141, 20, - 42, 60, 60, 92,216, 30, 83,128, 0, 1,143, 42,106,141, 8,157, 54, 50,108, 36, 70,237, 55, 1,120,192, 16, 52, 46, 16,191, 0, - 1,150, 60, 0, 2, 4, 8, 16,240, 8, 65,214,160, 4,208, 70,196, 47,194,253, 37, 14, 9,128,142, 13,175,105,161,187, 4, 8, - 16, 20, 0, 1, 2, 4,252, 57, 32, 2,224,102,244,158, 33,126,169, 17,233,211, 13,199, 9,214,191, 0, 1,130, 2, 32, 64,128, -128,191,200,156, 38,144,190, 0, 1, 86,180,103, 1, 2, 4, 8, 16, 32, 64,192, 95, 89, 91,158, 61,123,182,241, 70, 58,196, 56, -194, 94,161, 80, 16,147,141,118,174, 69, 69, 69, 53,102, 53,154, 43,197,106, 44,143, 43,254,140,242, 76,211, 22,141,251, 83,232, - 63, 97, 60, 30,118,121,105,105,105,141,199,164,166,166, 82, 60,228, 1, 22,202, 1, 11,247,179,109,153,194,243, 43,200,227, 34, -143,179, 2,192, 17,237,217, 28,196,236,222,231, 40,141,197,180, 24,137,185,221, 0,205, 29,211, 26,218, 21, 67, 48,137,137,137, -114,134,104,152, 10, 96,214,106,130, 63, 72,108,223,190, 61,114,219,182,109,141, 36, 56,126,252,120,121, 66, 66, 66,222,159, 81, -219, 53, 55, 30,231,207, 27, 50,195, 66, 66, 66, 90,245,220, 20, 10, 5,153, 48, 81,129,236, 44,165,217,123,118,231,174, 19, 36, - 59, 75,105,245, 94,222,185,235,132,213, 73, 32, 54, 38,130,247, 77,151,150,150, 70,226,227,131,154,188,183,165, 4,216, 66, 85, -117, 85,228,214, 31,183, 34, 48, 52, 80, 5, 10, 56,127,242,156,124, 88,248,112,132,244, 12,225,116,255, 29, 58,116,168,217,117, - 15, 31, 62,156,130, 0, 1, 2, 90, 76, 1,144,178, 61,112,232,208,161,156,133,155,219, 44,134,129, 57, 18, 53,221,104,131, 45, -209,242,217, 24,135,141, 66,193,200, 77, 73, 73, 65,122,122,186,202,210,222,226,204,113,214,114, 53, 77,207,177, 83,183, 46, 0, -128,219, 26, 13,116,234, 58, 67, 99,121, 37, 0,195,222, 7, 92,106, 35, 24,147, 63, 96,168, 45,206, 37,215, 94,161, 80, 16, 17, -101,168,174,199,252, 7,172,191,254, 98,245,131, 87,200, 76,199,131, 33,126,190,227,225, 72,165,146, 33,255,216,152, 8, 13,160, -144,101,103, 41,121,255, 6,163, 64,152, 87, 0,148,118,157,167, 86,155,130,156,156, 36, 68, 71,103, 32, 62, 62,189,209, 35,192, - 71, 17, 56, 88,112,144, 60,214,191, 11, 62, 86, 46,135,151,171, 23,104,157, 30, 26, 82,167,218,253,203,143,209,123,247,253, 68, -134, 7,142,144,203,100, 50,155,138,192,161, 67,135, 72,131,103,161,153, 69, 36, 40, 1, 2,254,202, 56,117,234, 84,147,247,230, -230, 52,123, 20, 0, 78,241, 3,230,118,177,115, 4, 8, 16,105,183, 12,194, 94, 7, 96, 99,185, 43, 20, 10,146,146,146,130,165, - 75,151, 2, 64,227,127,115,199,217,218, 33,172, 25, 60,219,226, 76,241,119,112, 65,103,232,241, 51, 74,255,115, 2,167,139,238, - 98,242,210,181,173,118,163,157,249,245, 44,250,246, 9, 3, 77,128,179,103, 13,175,129,251,175,141,219,105,150, 93,109, 92,131, -221, 26, 50, 50, 50, 40,182,227, 49, 99,198, 12, 0,104,252,111,150,252, 41, 10,176,114, 63, 40, 20, 10,242,196, 19,187,160, 80, -196, 56, 84, 9,136,141,137,168, 77, 74, 74,114, 5, 50,144,157,197,141,216,141, 45,124,123, 73,222,146,245, 15, 0, 83,166,108, - 66, 78,142,225,127, 82, 82, 17, 24,143, 0, 23,111, 0, 33, 36, 82,117, 97,175,234,149,127,204,198,192,246,253,225,226,225, 1, -162,213,129, 38,122,136, 37, 82, 4, 71, 5,231,252, 54,224, 2,150,102,164,171,134,248, 12,149,187,186,186,218, 84, 2,238,220, -185,211,228,253,248,145,109, 48,100,238,207,120, 58, 93,211,100, 32,199,140, 25,195,123,188,178,178,178,200,196,137, 19, 29, 54, -222,142,150,215,194, 68, 18,105,111, 89,223, 83,167, 78, 69, 54,144, 16, 95, 57,125, 95,127,253,245,155, 53, 53, 53, 1, 0,198, -193,176, 9,103, 8,128, 83, 48,108, 10, 5, 0, 27,148, 74,229,111, 2,245, 55, 39,127,166,205, 84, 9,104,162, 0, 20, 23, 23, -147,226,226, 98, 0, 64, 96, 96, 32,140, 55,155, 1,208,228,189,185,207, 45,161,180,180, 84,149,153,153,201,218, 19, 96,186,215, -189, 53, 18,166, 26, 74, 97,154,146, 40, 87, 23,123, 70, 70,134,205, 99,114,115,115, 89,145,127, 98, 98,162, 69,210, 95,176, 96, - 1,210,211,211, 97,172, 32,176, 65,241,156,149,240, 0, 0, 12,251, 73, 68, 65, 84,167,110, 93,112,163,172, 2,155,103, 77, 65, - 59,106, 4,138,214,204, 67,224,164, 64,236,105,101,242, 7,208, 72,248, 0, 16, 22, 22,214,164,157,241, 12, 24,183, 59,218,178, -183, 70,196,204,120, 88, 34,253,117,235,214, 33, 61, 61, 29, 49, 35,250, 99,215,207, 39, 1,247, 54, 64,101,245, 3,239,195,157, -187, 78,184, 2, 25,216,185,235,132, 67,228, 77,172, 92,104,245,217,204,106,251, 33,171, 7,196,216,245,159,148,148,131,248,248, -160,198,255, 12,226,227,131, 88, 43, 1,107,254,183, 6, 75, 62,251, 0, 35,187, 71, 66, 95, 87, 7,157, 94, 7, 74, 66, 1, 16, -131,128,198,237, 63, 74, 16,210,190, 23, 22,206, 90,136, 15,150,125,160,122, 34,204,182, 55,203,116,178, 27,239,191,206, 44,225, -239,221,187,151,240, 81, 2,178,178,178,200,206,183,119, 33,246,125, 56,132,180,179,178,178,200,178,101,203, 48,127,254,252,135, - 90, 9, 56,117,234, 84,100, 69, 69,133,170,164,164, 4,225,225,225,118,157,103, 69, 69,133,234,254,148,205,235, 57, 47, 6, 48, - 3,192, 73, 0, 95, 3, 24, 11,224, 73, 0,127, 55, 82, 0,238,252, 73,249,156,130,149,109,192,173, 26, 82, 41, 6,142,201, 72, - 95, 96,246,243, 38, 10, 64, 96, 96, 32, 21, 24, 24,216, 72,246,198,174,228,204,204,204, 38,239, 77, 63,191,116,233,146,197, 19, -100,148,138,228,228,100, 85, 74, 74, 10, 76, 55,202, 49,221, 60, 39, 51, 51,211,162, 11,214,220,100,111,218,214,154, 27, 21, 1, -192,198,141, 27, 45, 18, 63,128, 38,228,191, 96,193, 2, 86, 50,127, 47,190,134,154, 45,239,192,237,133, 79,208,169, 91, 23,116, -104,231,130,226, 45,197, 6,242,247,108,107, 88, 2,112, 18,115, 62,215,248,248,120,185,241, 50, 64,124,124, 60,103, 47, 13, 77, -128,128, 54,192,191,159, 5, 94, 90, 7,180,119, 5,206,151,155,111, 47, 40,227,120,231, 91, 80,228,184,120,109,222,123,239, 61, -139,196, 15, 0,203,102,196, 97,213,238, 35,240, 11,236,136, 91, 87,111,219,180,254, 1,128,141, 23,128,139, 27,223, 96,225, 43, -204, 90,250,204,218, 62,215,251,122,217,127, 45,247, 81,143, 89,224,113,175, 4, 53,249,175,141, 15,134,116, 91, 33,235,239,215, -170,107, 49, 98,218,112,213,208,142, 67, 80, 87, 83, 3,137,179, 51, 36,146,251, 83, 80,113, 97, 33,182,102,103,223,120, 97,230, -140, 78, 93,157, 3,208,127,116,120,212, 47, 57,191, 68, 14, 25, 56,132,147,213,152,182,115, 6,246,237,219,135,167,158,106,218, - 62,102,204, 24,138,171, 18,192,144, 63,186,126,140,157,111,191,102,183, 18,144,149,149, 69, 86,174, 92,137, 30, 61,122, 96,213, -170, 85,152, 51,103,206, 67,167, 4, 24, 19,191,163,228, 49,178,236,240, 38,200, 1,140, 6,176,142, 16, 82, 77, 81,148, 31,128, - 11, 0,174, 42,149, 74, 29,254,220, 32, 28,251,187, 9,249, 51,175, 51,210, 23, 52,243, 2, 60,144, 58, 0,153,153,153,204,218, - 43,138,139,139,225,235,235,219, 76, 65, 96,218, 74, 75, 75, 89,213,185,183, 21, 12,200,101,194,156, 58,117,106,203,169,110, 70, - 4,102,206,234, 79, 79, 79,135, 82,169,164,108, 69,113,170,113, 13,213,147,134,128,184,207, 3,162,222, 70, 53,254, 7,252,199, - 96, 45,146,204,121,112,250,219, 42,232,116,220, 11,157,197,197,197,229,177,216,118,213,186,135,231, 43, 96,241,106,160, 75,103, -224,246,118, 41,214,127,169,197,140,239, 44,183,115,186,243,137, 99, 43, 85, 27, 7,251,221,204, 90, 10,247, 80, 25,220,186,255, - 19, 27,151,190,132,126, 97,126,232, 25,247, 1,171,241, 96,115,127,178, 93, 42, 96,238, 93, 99,242, 87, 42,149, 20, 19,248,199, -139,104,218,126, 72,241, 33,121,115,208,198, 7,155,109,207, 49,241, 4,216,194,205,210,155, 24,151, 56, 14,238,109,189,160,167, -116, 56,176,111, 63,170,170,171, 17,159,144,128, 63, 74, 75,241,195,166,205,120,113,230,140, 78,206, 50,103,136,136, 19,162, 35, -162,115, 47,168, 86,241,178, 26,203,202,202,236,190,110, 99,242, 7, 96,183, 18,144,149,149, 69, 22, 45, 90,132,224, 96, 67,127, - 6, 5, 5,225, 97,242, 4, 56,154,248,205, 88,255,204,107, 62,215,218,187,129, 8,157, 40,138,114, 5, 16, 10,224, 28,128, 78, - 10,133,162, 18, 64,185, 82,169, 20,202,218,115,196, 3, 43, 4,228,235,235, 43, 79, 76, 76,108,182, 20,112,228,200, 17, 85,195, -102, 47,156, 99, 4, 44, 5, 3, 90,179, 28, 45, 41, 40, 45, 1,198,186,183,228,238,103,107,253, 3,192,238, 55, 23, 33,126,201, - 71,208, 69,141,128, 4,128,219,225, 66,236, 41,186, 11, 0,208, 69,205, 65,253,175, 62,160,218,255,157, 51, 73,177,245,178, 88, -195,221,137,255,195,156,153,215,113,113,214,124,212,252,164,133,159,143,245,118, 71,120, 0,248, 40, 7,235,214,173, 51,104,195, -241,163,112,164,164, 20,238,253,220,113, 35,167, 8,144, 57, 99,202,156,191,193,187,115, 92,171, 61,136,150,162,254, 29,229,213, -178,150, 33, 96, 43, 59, 32, 39, 41, 7,209, 25,209,152,178, 9, 72,202, 49,188,206, 73,202,225,236, 5,168,214, 84,193,199,165, - 29,116,154, 90, 16, 17,193,160,193,131,177,101,203, 22,205,202,143, 62,146,209,132, 96,250,179,211,225,221,206, 27,181,213,213, -208,233,117,112,119,106,139,122, 81, 61,175,235, 45, 47, 47,111,146, 29,192, 53, 32,176, 25,249, 51,224,169, 4,100,101,101,145, -148,148, 20, 12, 30, 60,184, 73,123, 88, 88, 24,210,210,210,144,154,154,218,106, 74, 64, 75, 17,191,169,245, 15, 0, 37, 37, 37, -124,189, 0,191,192,176,222, 95, 9,131,235,127, 28,128, 75, 0,250, 2,200, 6,176, 22, 13, 59,117, 90,155, 78,192,211,149,254, -151, 80, 0, 76, 9,129,217,115,158,205,231,214,162,166, 25, 48,203, 11, 76, 64, 32, 19, 27,192,120, 7, 2, 3, 3, 85,204,114, - 65,107, 77,188,142,132,173,181,126,198,250,103, 35,107,242,234, 77, 32, 9,221,112,123, 88, 4,218, 97, 4, 92,166,172,130,238, -230, 31,128,103, 91, 72,238,254, 15,219, 87,230, 3, 98, 49,231,107,231,147, 5, 97,138,211,175,255, 31, 6,134, 3,129,115,206, - 34,212,109, 38, 46, 60,150, 8,252,123,190,197,246,214,242, 0,164,167,167, 99,228,160,158,136, 26,209, 3,241,125,230, 99,197, -202, 47,112, 46,255, 6,102,141, 25,136, 91,217, 59, 81, 81, 86,233,144,251,193,220, 82,129,173,231,195,154,181,239,168,123,212, -146,124,107,129,131,169,169,169, 84, 90, 90, 26,153,178,169,169, 66, 0, 0,209, 25,209,144,110, 43,196,182,109, 69,141,153, 0, - 76,192,160,183,183,183,217,249,151,166,105,232,105,128,208, 58, 56,187,200,240,236,115,207,201, 22,191,251, 46, 58,116,232, 64, -119,242,243, 19,105,106,170,161, 39, 0,161,245,160,105,219, 30,173,225,195,135, 83, 63,252,240, 3,185,123,247, 46, 42, 43, 43, -155, 40,142,198,217, 1, 92,178, 2,178,178,178,200,138,151, 10, 0, 89, 48,112,235,179,230, 7,200,130,177,226,165, 2, 36,255, -135,157, 18,144,149,149, 69, 38, 76,152, 32, 15, 11, 11, 83,221,189,123,183,217,231, 1, 1, 1,152, 48, 97,130,252, 81, 10, 12, -228, 99,253,219,227, 5, 80, 42,149,121, 70,207, 87, 71, 0,167, 1, 76, 82, 42,149, 92,182, 50, 21,200,223,154, 2, 96, 82,232, -199, 86, 33,160, 38,159, 91,115,153, 38, 38, 38,154,245, 2, 48,100,239,235,235, 43, 79, 73, 73, 81, 49,107,178,137,137,137, 86, -211, 0,173, 89,135, 92,131,255, 90, 42, 13,144,177,238,173, 5, 3,114, 65,209,191,146,224, 52,101, 21,212, 37, 23, 33, 57,188, - 10,245,155,230,128,138, 93,142,173,127,127, 10, 87,183, 94, 70,252,178,175, 1, 73,235, 84,118,158,159, 9,228, 44,219,130,208, -171,209,192,157, 26,188, 49,118,190,213,118, 71,120, 0,248, 90,255,217, 91, 22, 65,220,169, 55,220,208, 3,215,246,101,160,138, - 34, 56,122,241, 58,162,206,222, 96, 57,238,215, 26,223, 79,157,170,108, 66,246, 0,240,211, 79, 49,102,143,179,246,124,216,114, -245, 59, 34,237,208, 17, 25, 2, 73, 57,247,137, 31, 64, 51,203,159, 9, 24,220,182,173,200,236,247,221, 93,220, 81, 82, 81,130, -193, 93,135, 64, 93,167, 1,212, 26,232,180,245, 88,152,146, 2, 74, 4, 81,109, 77, 53,104, 90, 15,157,158,192, 89,226,132, 63, -170,255,128,147,222,118,182,241, 83, 79, 61,213,216, 55,135, 14, 29, 34,204,124, 99,156, 29,112,243,230, 77,214,215, 57,113,226, - 68, 42,249, 63, 32, 43, 94, 42, 64, 72,183,230,191,127,254,178, 22,201,255, 9, 5, 91,178,158, 56,113, 34,149,149,149, 69, 6, - 15, 30,140,128,128,128,102,159,159, 61,123, 22,217,217,217,170,214, 34,255, 6,107,156,106,201,181,127, 99,216,225, 5, 96, 48, - 14,134,224,239, 58,129,194, 29,168, 0,180, 20, 24,203, 31, 0,134, 14, 29, 42,207,204,204, 84, 49,174,127, 11,202,129,252,210, -165, 75, 42,174, 36,204,119,146,116,116, 26,160,177,245,111,142,248, 25, 69,135,203,249,158, 46,186,139,250, 95, 23,227, 54,126, -134, 95,236,114,160,162, 18, 69, 25,243, 16, 52,251, 99,220, 90, 59, 15,112,146, 0,162,214,169,236,124,173, 6, 8,241,157,196, -186,189, 53, 60, 0,233,233,233,213,211,162,134,220,244,160,189,186,212,194, 73,182,233,227, 57,248,124,251, 41,188,241,228,227, -152,241,209,127,241,212,135,223,180, 74,240, 40,163,128, 54,212, 1,160,236, 85, 78,237,113,245, 91,243, 2, 36, 53, 88,246,166, -228,111,108,253,219,130,191,175, 63,118, 31,200,193,240, 46,195,225,218,198, 13, 52, 77, 32, 34, 58,208, 20, 5, 66, 8,244, 4, -208,209, 4, 58,157, 14,234,138, 26,236, 56,182, 3, 82,189,148,115, 80,170,105, 86, 64,234,156, 17, 24,239, 95,140,140, 99,236, -101, 88, 82, 2,184,146,191,177,188,212,212, 84,178,108,217, 50,116,236,216,241,190, 98, 95, 84,132,244,244,116, 60, 12,150,191, -163, 21, 1,115,214,191, 61, 94,128,134,103, 34, 18,192, 99, 0,222,250, 11, 4,255, 1,128, 24,128,254,145, 86, 0, 76,163,254, - 19, 19, 19, 27,215,221,141,149, 3,227,215,246, 88,240,124, 38,114, 71,165, 1, 90,178,254,249, 18, 63,131,201, 75,215, 98, 51, -128, 39,151,140, 7,201,156, 7,106,234, 10,156, 46,186, 11,202,219, 11,133,191, 87, 26,172,127,177,184, 85,238, 80, 75,249,254, -246,212, 1, 96,163,112,177, 85, 14,214,173, 91,167, 5, 80,245, 82,100,223,202,127, 46,255, 68,251,230,194, 20, 77,251,182,190, -119, 11,206, 93,235, 48,227,220,127,221, 90, 59,107,196, 18, 57, 27, 47,209,112,207, 40, 48,247, 27,246,121, 0,204,145, 63, 99, -249, 3,176, 25, 16, 40,147,201,168,115, 91,207, 39,168, 70,228,101, 39,246,121, 10,149,154, 74, 80, 34,192, 80, 82,132,134, 94, - 79, 64,235,116,104,227,236,142, 67, 21, 39,113,233,112, 33,198, 70,140,205,179,187,115,139, 94, 6,192, 61, 13,176,137, 18,208, -241, 26,206,223, 12,224, 69,254,198,242,230,207,159, 79, 86,173, 90, 5, 79, 79, 79,220,189,123, 23,139, 22, 45,194,195,230,246, -119,132, 34, 96,201,250,231,227, 5, 80, 40, 20, 29, 0,248, 53,220, 40,253, 1, 36, 3, 40,250,139, 24,233,250,150, 20,254, 64, -234, 0, 88,242, 8,172, 88,177, 66,110,170, 40, 36, 38, 38,170,184,202, 51, 38,130,135,161,196,174,177,245,111,154,254, 87, 92, - 92,220,164,223,184, 84,237, 99,148,128, 73, 75,190, 2,217, 4,248,204, 80, 34,239,159, 79,225,241,244, 13,128,147, 19,218,200, -164,173,114,189,198, 57,254,230, 94,243,172, 3,160, 3, 32,106, 24, 91,145,157,227,113,123, 90,212,144,146,127,102,108,235,182, -240,197,113,109,253,253, 34,181, 0,206, 36, 38, 38,122, 0,112,227, 59, 30,247, 73, 58,134, 60,241,196, 46, 35,247, 63,183,239, - 91,179,224,141,203, 3,179, 85, 36, 90,162, 24,144, 37,152,146, 62,227, 17,176,180,228,241,252,212,231,183,110,251,239, 54,232, -167,233,206,140,238, 50,186,111, 59,247,118,208,212,107, 64, 8,129, 84, 34, 69,185,186, 22, 71,126,255, 9,235,190, 93, 15,121, -111,185, 67, 10,135,165,237,156,129,245,235,215, 99,222, 60,238, 53, 0,238, 43, 1,176,139,252,141,229,205,153, 51,135,169, 3, -128,135,121,205,223, 88, 17,224,243, 93,123,107, 7, 24, 63, 6, 48,228,251,107, 0,188, 14,224,152, 82,169,212, 67,128,165,190, -199,169, 83,167,144,145,190,160, 89, 29, 0,171,133,128, 90,170, 14,128, 57,143,128, 37,162,231,227, 5,176, 23, 45,149, 6,200, - 40, 35, 74,165, 18,185,185,185,116,113,113,177, 49,145,201,163,162,162, 56, 91, 55,147,151,174, 5,140, 10,255,140, 94,184,186, -241,117, 77, 43,220,108, 45,101, 61, 83, 20,181, 18,192, 61, 24,210,127,158,181, 83,220,173,151, 34,251,214,141,205,253,165,237, -244,119,191,134, 82,169,148,230,230,230,118, 68,211,114,214,188,198,163,165, 61, 1,182,234,251,219, 66, 75, 44, 9, 88, 34,127, -109,124, 48,176,205,182, 97, 38,239, 59,134,218,247,195, 1,114, 56,224, 8, 70, 12, 25,129, 78,238,157, 0,154,224, 15,205, 93, - 28, 58,113, 8,183, 10,110, 97, 76,200, 24,185,179,179,115,171,143,135,177, 18,224, 40,178,102, 60, 1,143, 74,192,159,189, 85, - 0, 29, 48,199,100, 0,200,128, 0,206,176, 84, 0,200,172, 2,208, 82, 72, 78, 78, 54, 75,246,198, 59,177,153, 64,197, 38,171, -192, 81, 86,127, 75,164, 1, 54, 68,248,235,114,115,115, 37, 13, 75, 7, 12,249,143,137,138,138,226,228,229,104,216, 76, 73,229, -232,115,180,180,198,236,232, 90,247, 28,225, 12, 64,162, 84, 42,223, 54,114,129, 61,103,175,204,177,111,173,201, 87, 42,149,163, -114,115,115,145,155,155,171, 1, 32,107,248,179,155,248, 25, 47, 0,223, 62,179, 69,242, 19, 38, 42,154, 28,199,149,184, 29,177, - 36,144,154,154, 74,165, 37,165, 17,255, 57,254,114,116, 53,127, 76, 73, 82,142,138,109, 60,192,224,208,193, 84,109,109,109,228, -218, 37,107, 17, 16,252,152, 10, 0, 46,156,253, 77, 30, 55, 54, 30, 33,225, 33,188,199, 99,248,240,225,212,166, 77,155,154,101, - 5,212,215,215,219,117, 3, 57,154,172,255,108,209,254, 15, 1,132, 20, 63, 51, 94, 0,211, 54,214, 10,128, 45, 75,156,173,165, -206,119, 82,100, 91,136,197, 94,162,114, 52,209, 49,242,114,115,115, 73,110,110,174,196,184,191, 2, 3, 3,121,253, 86, 3, 65, - 57,124,194,120, 24,214,190,205,192, 29, 64,181,161, 32, 63, 69, 1,112,129,237,252, 94, 54,227,113, 37, 55, 55,151,201, 43,171, - 12, 12, 12,108, 31, 24, 24,232,252, 48,244,165,189,150,184, 45,217,142, 90, 18,176, 73,238,169,220,238, 81, 87, 87,215,188,169, - 19,166, 49,147, 55,134,134, 14,117,200,121, 78,153, 50, 69, 32,215, 63, 63,217, 27,115, 88,189,131,201, 95, 6,195,114,195, 35, -175, 4,216,236,200,240,240,112, 65,107, 18, 32, 64,128, 0, 1, 2,254, 98, 16, 9, 93, 32, 64,128, 0, 1, 2, 4, 8, 10,128, - 0, 1, 2, 4, 8, 16, 32,224, 47,128,255, 7,201, 67, 6,106,228, 94,183, 75, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130, -}; +137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 2, 0, 0, 0, 1, 0, 8, 6, 0, 0, 0,197,144, +206,103, 0, 0, 0, 1,115, 82, 71, 66, 0,174,206, 28,233, 0, 0, 0, 6, 98, 75, 71, 68, 0,255, 0,255, 0,255,160,189,167, +147, 0, 0, 0, 9,112, 72, 89,115, 0, 0, 11, 19, 0, 0, 11, 19, 1, 0,154,156, 24, 0, 0, 0, 7,116, 73, 77, 69, 7,216, + 5, 19, 11, 8, 1, 11,126, 22,156, 0, 0, 32, 0, 73, 68, 65, 84,120,218,236,125,121, 92, 84,229,254,255,251, 57,179,179,239, +168,184,128,138,251,130,224, 26,106, 80,168,201,215, 52, 21, 48,179,237,214,189, 78,150,173,150,102,117,111,245,203, 43,106,218, +170,233,216,162, 89,106, 9,106,120,115, 5, 29,212,144,220, 21, 75, 19, 5, 17, 65,144,109, 96,134,217,207,156,231,247,199,204, +208,128,192, 44,160, 81,205,251,197,188,152,115,230,204,123,158,115,158,229,253,249,124,158,141, 68, 69, 69, 81,184,225,134, 27, +110,184,225,134, 27,127, 43, 48,238, 71,224,134, 27,110,184,225,134, 27,127, 31,156, 57,155, 5, 0, 32,238, 8,128, 27,110,184, +225,134, 27,110,184, 35, 0,110,184,225,134, 27,110,184,225,134,219, 0,112,195, 13, 55,220,112,195, 13, 55,220, 6,128, 27,110, +184,225,134, 27,110,184,241,151, 0,223,246, 96,222,188,121,196, 85,162,181,107,215,222, 54,150,192,205,231,230,107, 5,116,237, +218,181,127, 88,250,178,179,179,105, 92, 92, 28,113,231,199,159,151,239,220,185,115, 46, 23,190,168,168, 40,184,243,195,205,247, + 87,230,115,218, 0,248, 59, 67, 42,149, 54,122,128, 50,153,140,116,228,116,174, 91,183, 14,132, 16,226,206, 57,215,242,120,246, +236,217, 72, 79, 79,111, 56, 78, 74, 74,250, 75, 60,203, 61,123,207,180,218, 16, 36, 78,142,254, 75,151, 25,137,255, 78,136,117, +189, 17, 1, 3,234,177, 23,249,218,183, 58,108, 89,236,168,109,140, 27,127,211, 8,192,221, 40,172,123,246,236,137,203,200,200, +144, 91,143,167, 77,155, 22,159,152,152,152,221, 17, 30, 6,165,230,182,179,163,234,170, 84, 42,165, 69, 69, 69, 0,128,240,240, +112, 0,248, 83, 52, 34, 77,141, 43,139,129,213,162,103,238, 40,239,214,173, 91, 29, 54,212,164, 82, 41,221,182,109, 91,195,241, +206,157, 59, 49, 97,194,132,134,227,244,244,116,250, 71, 25, 1, 49, 49, 49, 20, 0, 78,159, 62, 77,218,227,186,140, 31,100,173, + 24, 0,178, 54,231, 95, 88, 68, 55, 0,192, 45,157, 14,172, 86,111, 62, 89,171, 4, 0, 36, 39, 39, 35, 33, 33,161,197,244,173, + 79, 88, 79, 35,203, 34,157,250,253,248, 95,227, 29,200, 23, 9,252,159,189, 0, 93,198, 78, 40, 20,211,161, 0, 16, 45,121, 31, +111, 73, 78,163,155, 24,168,212, 21,224, 45,109,138, 83,191,155,149,149, 21,151,150,150, 38,183, 61,151,156,156, 28,159,144,144, +144,221,145,234, 86,123,181, 1,127,134,251,189, 19,120,231,141, 23,136,151,192,151,232,197, 66,170,175,213, 50,245, 90, 37,247, +193, 39,171,255, 22,179,227,236, 26, 0,123,246,236,137,179,254,111,171, 80, 91, 27,146,119,183, 45,129, 87, 55, 95,212,223,168, +195,219, 41,111,201, 51, 50, 50,224,182,134,237, 67, 38,147,145,240,240,112, 90, 84, 84,132,162,162, 34,236,219,183,175,195,122, + 18,214,188,150,201,100, 68, 38,147, 9,164, 82,169,113,197,138, 21, 39, 1, 96,225,194,133, 35, 90,251,238,244,233,211, 27,222, +179,172, 9, 6,163, 30, 6,189, 1, 6,131,249,197,178, 44, 22, 46, 92,232, 84, 90,108,197,191, 57, 76,152, 48,225, 15, 53, 2, + 28, 49,126, 98, 98, 98,236,114, 36, 78,142, 38,174,136,188,195,240,243, 65, 94,225,119,144,160, 43, 76,200, 65,197, 23,103,112, +190,160, 26, 51,150,109,112,232,235,145,101,145, 14, 10,186, 25,242,129,114,187, 13,177, 36,241, 45, 4, 76,123, 26,165, 47, 69, + 3, 90, 69,195,249, 51,218,215,112, 6, 0,180,192,120, 73, 50, 14,250,159,134, 31,128, 24, 69,140,195,229,183, 41,210,210,210, +228,105,105,105, 29,162,189,178,166,177, 61,218,128, 63,195,253,182, 55, 54,173, 89, 75, 30, 13,139,224,191,144,244, 56, 47,164, +127, 24,195, 39, 33, 68, 83, 87,199,137, 17,106, 98,186,116, 53,233,110, 94, 51, 57,248,236,110, 58,209,134,119,113,128,111,129, + 19,124,171,238,168, 1,144,145,145, 33,223,246,239, 55,144,242,222, 82,121, 98, 98, 34,105, 75, 1,179, 10, 63, 0, 84,105,170, +129, 64, 96,241,193,119,160, 44, 84, 64,250,175,142, 37,100, 45, 85,136, 63, 58,141,182, 70,192, 3, 15, 60,128,162,162, 34,132, +135,135,119,184,103, 39,151,155, 29,137,248,248,120, 42,147,201, 24,153, 76, 22, 38,149, 74, 75, 87,172, 88,113,218, 81, 30,150, +101, 97, 48, 24, 27,132,223, 86,252, 79,157, 58,133,225,195,135, 59,149,174,148,148,223, 61,192,217,179,103, 35, 51, 51,179,145, + 1,208, 30,101,197,149,124, 56,125,250, 52,201,206,206,166, 19, 39, 78,188,237,179, 3, 7, 14, 96,235,214,173, 13,199,173,141, + 91,184,205,120,111,199,238,128,176,136,110, 40, 85,212, 97,199, 51, 51, 17, 72, 98, 81,240,249,171,232, 57,189, 39, 50,157, 16, +127, 43,230,206,157, 75, 1, 96,253,250,245,109, 46,179, 97,219,114,160,185, 94,143, 82,105, 68,171,215, 93, 16,103,225,221,193, +183,144,122,225,205, 54,229,103,123,136,110,123,114,180, 71, 36,224, 78,223,111,123, 33, 39, 39,199, 3,192, 61, 0,188,108, 78, +215, 2,200,139,141,141,173,113,148, 71,203,105, 25, 67,149, 94, 48,121,234,116,177, 2, 70,177, 64,192,231, 43,117, 98, 70, 40, +212,114, 60, 31, 79,214, 32, 49, 26,249,229, 55,245, 98,158, 72,167, 51,233, 77, 82,169,148, 52, 55,102,196, 22,181,181,181,255, +181,190,207,207,207,175,242,244,244,100,212,106, 53,103,123,205,200,145, 35, 63,116, 52,141,148, 82,187,194, 78, 8, 89,208,214, +103,202,183,231,253,247,233,211, 7,145, 94, 62,104, 75, 20,192, 86,252,171, 52,213, 72,189,255,157,134,207,254,145,241, 44, 16, + 2, 76, 95,145,226, 84, 33,107, 73,160,219, 75,164,111,220,184, 1, 0,232,214,173, 91,163,247,214,223,181, 87, 32,238,100,136, +207,214, 8, 48, 26, 89,172, 91,183,238,142,121, 1,206,114, 54, 17,127,219,239,223,148,201,100,254, 82,169, 84,225,176,248, 27, +141, 48, 24,244,208, 27, 12, 48, 54, 17,127,202, 57, 23,161, 75, 73, 73,193,169, 83,167, 26,142, 87,173, 90,133,164,164,164,134, +227,244,244,244, 54, 27, 59, 54, 6, 79,155,203,159,173,240,207,158, 61, 27,195,134, 13,115,137,167,189,186, 3, 74, 10,139,161, +222,249, 31,120, 61,245, 49,194, 34,186, 33, 52, 80,130,194,157,133,102,241,247,243, 49,119, 1, 8,120, 14,113,181,135,240, 3, + 64,159,139, 87,113,227,237, 37,208,166,109,108, 61, 66, 32,145, 64,167,211,161,160,160, 0, 21,186,203,232,131,176, 22,175,205, +202,202,138,107,173,236,203,100, 50, 98,173, 39, 89, 89, 89,113,206,132,199,109,163, 98,214,250,106,123,206, 89, 71,160, 37,225, +118,166, 45,104,238,126, 51, 51, 51, 41, 33, 4, 9, 9, 9,164, 45,247,107,197,211, 79, 63, 77,191,252,242,203, 54,229,121, 78, + 78,142, 47,128,233, 7, 15, 30,252, 15,199,113,122, 27, 17,228,243,120, 60, 79, 0,255,140,141,141,221, 99,143, 39,191, 48,159, + 47, 17,138,197, 2,129,200,147,225, 19, 31,202, 19,121,112, 60, 30,159, 35, 12, 56,194, 55, 81, 30, 79,207,227,136, 78,205, 51, +105, 60,133, 2,194,235,213, 77, 39,158, 26,194,161,216,126, 26, 21, 10,133, 82,163,209,176, 0,160, 86,171,185, 55,222,120,163, + 65,240,151, 46, 93,250,114, 91,203,251,132, 9, 19,158,177,190,207,204,204, 92,215, 30,117,136,177,231,253, 47,153,149, 4, 93, +101, 37, 94, 29,216, 15,182,125,247, 14,123, 33,150, 46, 4, 91,241,159, 54,109, 90,188, 76, 38, 35,211,166, 77,139,223, 48,237, + 51,115,100,177,111, 80,163,235, 29,193,194, 53,249, 88,184, 38, 31,207,173,188,132, 39,222,251, 5, 51, 22,159,107,243, 3, 41, + 41, 41,113,200, 48,184, 91,226, 95, 84, 84,212,162, 48,135,135,135,195,104, 48, 96,212,200,145,109,254, 29,107,152,124,219,182, +109,144,203,229, 13,175,214, 12,173,150,196, 48, 62, 62,190,169,248, 55, 24,202,142, 52, 76, 44,107, 50,123,254,122,115,232,191, +169,248,155, 76, 38,168,181,106,167,238,209, 26, 49,104, 26, 53, 72, 79, 79, 71,122,122,122, 35, 99,192,169,251,205,110,220, 30, +202,179,179,157,122,102,173,137,255,236,217,179,177, 98,197,138, 6,241, 23,240, 5, 78,241, 36, 78,142, 38,150, 46,152,102, 95, +206,112,105, 81,140,250,233,163, 64,211, 94, 69, 73, 97, 49,232,244,254,191,123, 43,105,175,130,223, 57, 24,240,243,187,171, 30, +161,186,170, 0,218,180,141,160,148,226,194,133, 11, 24, 63,126, 60, 36, 18, 73, 35,225,247,247,247,135, 86,171,133, 86,171, 69, +105,105, 41, 30,209,190,128, 47,252, 95,106,145,211,218, 7,222,218,243,177,126,214,180,191,220, 81,225,110, 47,103,197,250,221, +166,226,111,207, 65,106,237,126, 51, 51, 51,105,122,122, 58,210,210,210,144,149,149, 69,219,122,191, 79, 63,253, 52,229,243,249, +120,250,233,167, 93,174, 19, 57, 57, 57, 98, 0,255,202,202,202,122,227,189,247,222, 59, 78, 8, 9,183,190, 0,116, 13, 12, 12, +244, 56,116,232,208,218,156,156,156,241,173,241,152, 40,199,227, 17,129,200,192, 82, 31,189,222, 24, 98,226,184,174, 38,142,139, + 48, 17,210, 29, 60, 94, 32, 33,196, 15,132,231,195, 81, 4, 80, 3,231,167,212, 26, 61, 67,124, 88, 30, 51, 82,229, 80, 30,105, + 52, 26,182,169,215,223,209,193, 56,226,253,107,202,203, 48,121, 88,180,211, 2,109, 53, 34,222,221,182, 4, 0, 26,196,223, 26, + 69, 72, 76, 76,204,182, 26, 1, 37,202,155,136, 94, 56,218, 41, 35, 67,173, 53, 65,173, 53,161,172, 90,143,210, 74, 29,110,220, +210,185, 36,124,214,202, 98, 79,252,255, 40,180,100, 4, 0,128,206,160,135, 78,167,115,153,219, 42,218,214, 62,242,224,224, 96, + 91,111, 22,142, 54, 38, 77, 61,225,150, 66,137,142, 52,122, 6,163,222,236,249,235, 13, 48, 24, 27,139,191,209,104,132, 90,173, +134, 74,169,250, 67,243,196,108, 48,165,217, 6,228,172,127,216,182, 45,205,101, 35,192, 86,252,173,194,207, 48, 12,196, 98, 49, + 60,189, 60,218,148,230, 61,123,207,208,150, 94,246,190,187,111,241, 59, 8, 68, 44,216,132,231, 1, 0, 94,185, 87,113,190,160, +218,108,176, 37, 60, 15,227,133,119,129,170,106,167,210, 51,119,238, 92,106,237, 14,112, 5,158,168, 2, 0,108,220,184, 17, 25, + 25, 25,120,255,253,247,113,226,196, 9,232,245,122, 84, 84, 84, 88,189,178,134,235,195,194,194,160, 5,192,195,181, 63,164,188, +180, 84,238,155,122,243,174, 26, 20,205,117, 11, 56,203,103, 27, 9, 75, 75, 75,107,211, 61, 91,197, 31, 0, 92, 53, 2,114,114, +114, 58, 89,196,127,238,215, 95,127,125,241,173,183,222,122,104,203,150, 45,232,211,167, 15, 0,160, 71,143, 30,168,171,171, 19, +189,251,238,187,167, 15, 29, 58,244,109, 78, 78, 78,120,179, 68, 4, 0, 71, 9, 56, 86,108, 50,177, 1, 38,214,212,213,104, 50, +246,230, 49,164,139,144,207, 8,196, 2,158,150,239, 33,172,245,244,230, 41,121, 98,202,138,121, 60, 79, 62,107,240,185,118,230, +172,232,177,224,143,236,166, 59, 63, 63,191, 74,173, 86,115,205,133,249,135, 14, 29,122,217, 96, 48,180, 91, 89, 26, 58,116,104, +187,113,241, 91, 19,238,207,231, 62,253,187,216,150,220,192,171, 3,251, 97,101, 70,134,211, 99, 1,172,222,191, 85,244, 27,121, + 41,137,137,217, 25, 25, 25, 0,128,192,193,157,156, 74,124,189,214, 4,149,134,133, 82,205,162,174,158, 69,173,138,117,250, 1, + 52, 55,242,223,214,203,183,125, 95, 88, 88,136,218,218,218,187,214,104,172, 91,183, 14,225,225,225,176, 14,250,179,237,235,151, + 74,165,116,221,186,117,208,105,181, 46, 27, 0, 82,169,148,110,216,176, 1, 37,165,165, 16,240,120, 8,237,212,169,145,248,223, +127,255,253, 72, 73, 73,113,168,113,146,201,100, 36, 62, 62,190,145, 17,208, 52,146,225,232, 88, 5,131,222, 0,131, 94, 15,163, +209, 0,150, 53, 53,136,191, 94,175,135, 70,163, 65,125,125, 61, 84, 42,231, 13, 0,219, 46, 0, 43, 92,245,252,183,165,109, 3, + 40, 80,101, 17, 26,106, 46, 68, 32,148,154,141,128,180, 52,164, 36, 39, 59,221, 29,208, 84,252, 5, 2, 1, 68, 34, 17,196, 98, + 49,196, 98,177, 75,247,221,168, 94,183,208, 37, 96,175, 75,107,198,186,237,160, 83, 35,112,107, 76, 52, 2, 17, 11,201,204, 79, +193,150, 85, 2,126, 62,224, 87,111,197,143, 31,157, 6,120, 60,167,210,210,214,174, 0, 53,207,220,166,164,166,166,162,178,178, + 18,107,215,174,197,208,161, 67,241,222,123,239, 33, 58, 58, 26, 90,173,182,169,135,102, 53,169,239,170,240, 59, 42,208,174,118, + 7,180,100, 72,184,194,147,156,156,220, 32,252,174,212,141,230,196,191, 65,108,248,124,176, 44,235,108,119,128,119, 94, 94,222, + 39,243,230,205, 59, 50,120,240, 96, 31, 0,120,231,157,119,144,159,159, 15, 0, 24, 61,122, 52,118,236,216,129,177, 99,199,122, + 62,242,200, 35, 5,217,217,217, 89, 60, 30,239,145,219, 27,122, 32, 32, 48,128, 43, 44, 44, 96,179,229, 7,247,246,238, 29,153, + 29,209, 35,252, 34,207, 91, 82,193, 35, 66, 53, 35, 18,104, 24,177,135,202,192,231, 25, 64,141, 60, 78,108,244, 86,149, 86,123, +157, 56,116,110,100,144,127,232, 14,187,198,168, 77,159,255,206,157, 59,159,152, 62,125,250,215,214,176,191, 82,169,100,132, 66, + 97,155,203, 82,123,133,253,237, 70, 0,172, 94,254,240, 94,145,208, 85, 86, 66, 93, 98, 22,193,241, 22,239,208,217, 40, 64,225, + 47, 87,111,227,110,238,184,250, 66,185, 83,137,111,171,248,219, 10, 63,165, 20,221,186,117,107,244,153,209,104,108,120,213,214, +214, 66,173, 86,163,166,166,230,174, 53, 30,214,121,254,251,246,237,107, 20, 9,176,138,255,144, 33, 67,160,211,105, 27, 26, 58, +106,181,102, 28,108,152,214,124,182, 6, 70,163, 17, 93,195,194, 96, 52,153,154, 21,127,103, 26, 18,139, 17,112,155, 87, 98,157, +186,216, 90, 36,227, 54, 3,192, 96,108, 16,255,147, 39, 78, 66,163,213, 66,165, 82,161,174,174, 14,181,181,181,141, 60, 59,103, + 97,237, 6,112,181,223, 31, 0,170,171,170, 81, 93, 93,133,170,234, 26, 84, 85, 87,163,186,186, 26,213, 85,102,143,180, 95,255, +254,168,177,188,119,214,251, 7,128, 97,195,134,253,238,245,123,122,194,203,203, 27,222, 94,222, 80,169, 84,241,109, 41, 79,173, +117, 9,216,251,110,193,251,115, 33,152,249, 41, 2, 17, 11,126,238,167, 48,110,127, 30,240,243,193,174,103,147,112,125,215, 53, + 60,184, 98, 19,192,191,203,203,138,232,174, 67, 18, 38,129, 90,173,134, 78,167,131, 70,163, 65,110,110, 46,150, 45, 91,214,236, +229, 30, 30,214, 8,202, 85,167,197,219, 85,175,218,246,249, 54,125,222, 45, 29,183,197,200,104,174, 91,192, 25,158,132,132, 4, +146,156,156,140,164,164, 36, 76,152, 48,193,229,200,196,151, 95,126, 73, 88,182,113,155,204,178, 44,156, 29, 11, 16, 27, 27,123, + 37, 57, 57,121,232,150, 45, 91,198, 31, 61,122,212, 59, 33, 33,225,132, 85,252, 45,142, 42, 68, 34, 17,189,126,253,186, 96,239, +222,189,125,253,253,253, 79,198,198,198, 22, 52,199, 85, 87, 91,199, 69, 70,244, 81,141, 30, 61, 58,233,226,197, 95,239, 83,170, + 85,157, 40,107,100,193,192,200,234, 25,189, 94,175,215, 42, 81,174,228,244, 58, 85,105,113, 57,251,227,238, 61,203,131, 2,131, + 43, 12, 6,141, 93,247,189, 57,239, 95,161, 80,240, 1,192,199,199,167,195,118, 11, 48, 45,121,255,219,254,253,134,217,106, 46, + 47,107,244,153,179, 99, 1,166, 77,155, 22,191,230, 95, 31, 3, 48, 15,248,203,200,200,144,219, 78, 45,204,200,200,144, 79,248, +230, 33, 0,192,153, 21, 63, 99,218,180,105,241,119,235,230,109, 43, 73, 73, 73, 73,131,183,111, 21,125,155,204,133, 74,165,130, + 78,167,179,105, 68,238, 94, 26,159,121,198, 60,246,195,200,178,184,120,241, 34,206,158, 57,131,161, 67,134, 66,167,211, 65,171, +213, 65,167,213,226,219,111,190,129,245, 58, 71, 42,250,170, 85,171, 48,160,255, 0, 24,141, 70, 92,185,114, 5,172,209,128,210, +146,210,118,125,166,214, 99,203,154, 5, 8, 15, 15,119,168, 97, 50, 24,245, 96, 77,230,176,255,241,227, 63, 67,173, 85,163, 94, +165, 68, 93, 93, 29, 20,181,181, 80, 40,106,218,100,136, 89, 35, 1,109,241,112,142, 28, 57, 2,149, 74, 5,149, 74,105,249,175, + 66, 80, 96, 32,250,245,239,143,223, 46, 93,194,225, 35, 71,156,230,180,122,255,124,190, 0, 30, 30, 30,240,242,242,130,183,151, + 23,188,188, 60, 80,163,168,137, 7,144,125,167, 67,253, 45,225,124, 65, 53,140, 23,222, 69, 53,114, 64, 18, 87,130,196,254, 7, + 5,239,207,197,212, 21, 95, 67, 44, 96, 0, 1,223,252,114, 1,174,118, 5,148, 78,249, 12, 1, 91,167, 64,163,209, 32, 32, 32, + 0, 10,133, 2, 10,133, 2,199,142, 29, 67, 89, 89, 89, 67,152,184,225,250,210, 82, 60,235, 47, 65,144, 71,101,107, 30,112,188, +173,168,218, 14,146,179,190,183,126,102,189,214, 21,239,220,209,238, 1, 71,197,223, 85,207,191,185,251, 77, 72, 72, 32, 19, 38, + 76, 32,109,185,223,166, 70,128, 43,226,111, 69, 80, 80, 80,222, 67, 15, 61,244, 72,106,106,106,223,243,231,207,199, 74, 36, 18, +222,212,169, 83,137, 72, 36, 2,199,113, 36, 49, 49, 49,239,197, 23, 95, 28, 50,104,208,160, 93,255,252,231, 63,159, 48,153, 76, +213,173,196,188,185, 95, 47, 93, 57, 57,104,240,144, 71, 79,158, 56, 49, 99,215,238,255, 45, 61,117,226, 68,167,139,249,191,137, +175,148, 22,208,111, 63,254, 94,146,186,234,253, 1, 89,187,119,175,234,221,171,247,143, 94,161,158, 71, 98, 99, 99, 77,112, 48, +229, 9, 9, 9, 56,121,242,100,212,186,117,235,222,213,233,116,130,247,222,123,239,131, 93,187,118,205, 46, 45, 45,189,187,194, +209,214, 46,128,192,107, 69,168,177,132,254,109, 49, 62, 56, 24, 43,241,155,227, 94,135, 37,196,255,219,233,139,240,235, 27,132, + 9,223, 60,132,140,199,126,144, 91,195,254, 86,241,183,122,255,206,204, 50,216,145,218, 62, 35,241, 9, 33,184,116,233, 18,172, +133,181,105,152, 85, 32, 16, 64, 32, 16,160,178,178, 18,137,137,137,119, 61,147,172,163,254,215,173, 91,135,145, 35, 71, 66,167, +215, 67,171,211, 66,103, 25,220,164,213,153,187, 1, 86,175, 94,109,183, 49,145, 74,165,116,197,138, 21, 48,153, 76, 56,125,250, + 12, 4,124,115,216, 54, 50, 50, 18,215,138,138, 80, 90, 90,138,173, 91,191,195,236,217, 15,227,224,193,131,212, 54, 18,208, 90, + 3, 36,147,201,132, 0, 88,169, 84,202, 53,231, 1, 57, 51, 85,209,234,249,231,230,230, 66, 93,175,105, 48,192,148, 42, 37,148, +202, 58, 40,149,245, 46,135,194,173,222,191,101, 37, 64,151, 12,129,217,179,103, 55, 58,142, 8, 15, 71,191,254,230, 65,113,191, + 93,186,132,107,150,136, 71,211,235, 28,193,152,123,198, 64, 36, 20, 65, 34,145, 64, 44, 22, 67, 36, 18,161,188,188,220, 97,241, +183, 23,234,119,117,141,128, 25,203, 54, 96, 7,128, 7, 82,255, 15, 52,237, 85,144,148, 85, 56, 95, 80, 13, 18,224,143,171, 37, + 74,179,247,239,100, 23, 64,211,174, 0,167,167, 7,106,181, 0,175,160, 73,120,223, 44,244, 70,163, 17, 95,124,241, 5,198,143, +255,125, 92,216,193, 39,195,128, 10, 13,250,238, 81, 32, 42,184, 71, 75, 13,120,118,147,190,111, 57,208,208,252,203,155, 94,235, +138, 96,183,214,111,239,170,231,239,170, 33,113,167,239,215, 98, 4,180,121, 22, 64,120,120,248,214,177, 99,199, 6,159,203,203, + 75,209,106,181, 67,228,242, 67, 18,145, 88,196,103, 8,131, 67,135, 14,121, 15, 24, 48, 96, 83,114,114,242,127, 42, 43, 43,237, +122,235,179,103,205,228,126,220,251,227,225,161, 67,135, 45, 52,176,250, 7,174,230, 95, 89,202, 21, 21,176, 0,168, 24,140,113, +112,239,190,105, 33, 33,193,123,120,124,225,183,255,125,107,185,225,219,141, 27, 44,125,124, 45, 99,228,200,145, 31, 38, 36, 36, + 0, 0, 42, 43, 43,145,149,149,229,243,213, 87, 95, 45, 5,128,147, 39, 79,142, 28, 56,112,224,190, 63,133, 1, 96,245,206,239, +255,118, 75,235, 94,134, 19, 83, 2,173,214,111,244,194,209, 8, 28,220,169, 65,244,109, 67,255,103, 86,252,236,148,229,218, 94, +115, 82,173,105,235,223,191, 63, 46, 92,184,208, 72, 88,106,107,107, 11, 0,244,106,238, 59,174,174,189,220,214,116, 54, 61,255, +237, 55,223, 66,167,211, 65,111,208,195, 96, 48, 96,197,138, 21,176, 39,254, 86,112,156, 9, 98,137, 23,180, 90, 29, 46, 93,188, + 8,190, 64, 0,163,193, 0, 15, 79, 15,108,221,186, 21, 60, 30,207, 58,119,190,213,123, 93,177, 98,197, 62,169, 84,106,144,201, +100, 33,214,116, 54, 89, 7,192,169,208,230,194,133, 11,145,147,147,131,250,250,122,212,171,213, 80, 41,149, 22,241, 87, 66,165, + 84,161, 94, 85, 15,181, 77,131,239,200,179, 27, 62,124, 56, 61,117,234, 84,131,247,223,220, 52, 64, 71, 23, 1,138,139,139,187, + 45, 47,172,162,127,246,236,217, 6,111,222,209,123,142,137,137,161,214, 69,126,188, 60,188, 32,150,136,161, 82,169,226,109,250, +176,157,106,120,239,212, 98, 64, 86, 35, 96,122,234, 87,160,219,129,160, 39,101,200,126, 41, 9, 99,151,111, 6, 4, 2,120,138, +219,214,207,217,212, 16, 0, 0,121,142,189, 96,227, 45, 12,222,231,129,242,255,105,160, 88,242,251, 89,163,209,136,113,227,198, + 1, 0,194,252, 37,248, 73,214, 13,239, 47,187,129,207,206,104, 91,101,179,245,248, 1,243, 64, 56,107,195,222,116, 80,156,179, +211,226,108,199,239,180,213,243,111,174, 77,112,133,235, 78,222,175,173, 17,208, 30,229,111,224,192,129,159,168,148,170,189, 35, + 98,134,143, 84, 41,149, 1,172,137,213,135,134,134, 86,134,133,133,149, 43,149,202,243,149,149,149, 14, 55, 10, 83, 38, 79,225, + 0,108, 61,122,228, 68,110,236,216,177, 63, 72, 36, 18, 95, 2,202, 17, 66,192,113,180, 78,171, 86,200, 47,231, 21,171,190,221, +184,193,161,118,222,250,204, 0,243, 64,234,166, 3,245,150, 45, 91,246,159, 63,133, 1,144,152,152,152,221,150, 5,127, 28, 41, +172, 86, 67,192, 42,252,237, 41,232,109, 73,219,224,193,131,113,242,228, 73, 84, 86, 54,132, 8,123, 1, 64,117,181, 57,162,244, +216, 99,143,253,161,153,213,244, 25, 81, 74,233,163,143, 61,138,213,171,215, 88,250,204, 89,248,250,250, 18, 71,191,111,133, 68, + 34,182,242,153,189, 41,181,198,246, 59, 0,236,110, 54,209,127,197,138, 21, 87,164, 82,105,133, 76, 38,227,217, 14, 8,180, 76, + 11,116,184,161,179,206,125,143,141,141,109,247,103, 55,124,248,240,166,123, 1, 52,124,238,236, 10,128, 50,153,140,100,103,103, +211,173, 91,183, 54, 90,168,199,202,237, 74,121,142,139,139, 35, 70,214, 8,163,202,216,174,247,222, 90,232,223,217,189, 1,102, + 44,219, 0,216, 44,252,115,239, 27,191,143, 75, 82,183, 83,122, 27, 69, 0, 6,182,110,124,150,198,150,162, 20, 64,244,251,254, + 88,114,186, 15,130, 1, 84, 22,168,209,187,119,111, 0,192, 39, 75,252, 49,105, 68, 48, 34, 38,229, 59,244,219,206, 76,117, 75, + 75, 75,147,183,182,236,177,189,246,166, 61,218,188,182,114,221,141,251,109, 79,140, 30, 51,250, 10,128, 43,183, 69,172, 3, 3, + 93,226, 27, 55,126,100, 17,154, 29, 21, 26,134,222,125, 6, 57, 99, 72,181,235,125,182,199, 34, 63, 46, 25, 0,119, 90,192,246, +236,217, 19,151,177,162,227,237, 5, 96,173, 72, 35, 70,140,192,158, 61,123,116, 22,209,231, 0,120,220,137,200, 67, 59, 21, 18, + 34,147,201, 26, 60,251,214,196,255, 78, 98,225,194,133,182,241,212,134, 6,219, 58,141,208, 25,111,231, 78, 62, 95, 91,238,236, +236,236, 54, 47,251, 27, 23, 23, 71,226,226,226,218,156, 46,123,107,251,183, 7,218,210, 37,176,104,209, 34, 20, 22, 22,182, 91, + 90, 28, 89,222,215, 89,156,121, 77,129, 51, 48, 15, 12, 29,159, 44,193,254,227,125, 16,234,225,133, 95, 79,221, 66, 95, 7,197, +223, 94,249,235,168,203,225,182,199, 90, 2,127,166,251,237,128,207,191, 75, 59,243,173,186, 91,105,191,235,187, 1,222,169, 8, + 67,123, 26, 1,137,137,137,226, 63, 89, 1, 36,127,240,111, 91, 87,168, 97,173, 6,128,187,241,232, 56,104,107,151, 64,207,158, + 61, 73,207,158, 61,219,165,189,113,102, 31, 0, 87,113, 36, 77,139, 35,105,249,238, 58,235,134, 27,246,156,200,168,168, 40,234, +126, 12,110,184,225,134, 27,110,184,241,247, 2,227,126, 4,110,184,225,134, 27,110,184,225, 54, 0,220,112,195, 13, 55,220,112, +195, 13,183, 1,224,134, 27,110,184,225,134, 27,110,184, 13, 0, 55,220,112,195, 13, 55,220,112,227, 47,129, 70,179, 0,230,205, +155,231,242,200,212,230,230,137,187,249, 58, 30,223,220,185,115, 93,226, 27, 54,108,216,109,124,103,207,158,117, 57,125,205,241, +253, 89,242,195,217,103,184,126,253,250,187,146,190,246,206,143,187,153,191,246,166,137, 58,251,252,218,155,207,221,190,184,249, +154,225,235, 10, 64, 1, 64, 8,160,182,163,165,207,105, 3,192,141,191, 62,214,175, 95,239,126, 8,127, 51,248,249,249, 49, 48, + 79,207,228,215,213,213,113,148, 82, 83, 71, 74,159,117,223,249,172,172, 44,218, 30, 11,205,180,215, 74,123,110,220, 57,236,218, +181, 43,110,234,212,169,217,127,242,219,176,174,125, 37,113,214, 0,232,144, 17, 0, 55,254,122,160,148, 54,218,234,216,213, 8, +192,218,181,107,237, 94, 51,113,226,196,184,204,204,204, 70, 43,139, 77,152, 48, 33,254,192,129, 3, 46, 85,244,244,244,244,102, +249,146,146,146, 58, 4, 95, 71, 6, 33,132,244, 8, 13, 69, 81,121, 57,173,173,173,181,238,207,224,212, 18,131,182,198,226,169, + 29,171, 75, 8,193,115,178,189,121, 25,210,201, 67,190,161, 20,202,245,251,242,158, 91, 52, 99, 36, 1, 67,249, 10,149,142, 14, +159,249,188,211, 91,114,102,101,101,197, 89,151,156,181,252,119,105,185,217,166,226,111, 45,247,109,221,104,167,185,239,186,202, +217, 30,124,109,221, 50,216,149,104,201,157, 16,255, 61,123,246,200,167, 78,157,250,103, 55,206,172,251,176,223,209,174,244,119, +222,120,129,241, 18,248, 50,122,177,144,211,215,106,249,245, 90, 37,251,193, 39,171,219,101,135,193,219, 12,128,246, 20, 8, 87, +185,156,229, 35,132, 48, 22, 43, 76, 75, 41,229, 58, 90,250,218, 75, 96,219,195, 0,176, 54,234,182,105, 37,132,232, 41,165,162, +182, 68, 10, 8, 33, 20, 0, 86,173, 90,213,104,199,176, 5, 11, 22,200, 9, 33,160,148, 18,103, 27, 37, 0,224,190,247,111,116, +158,153,149, 41,207,204,204,116,186, 1,108, 79,190, 63, 67, 20,133, 82, 74,227,123, 69,208,248, 94, 17, 0,128,114, 3, 59,167, +147,144,191,217,250,249,111,202,122, 81,153, 3, 27,167, 0,192,201,237,159,230,115, 28,194,238, 25, 19,228,243,193, 75, 99, 15, + 12, 25,226,119,253,185,229, 35,255, 11, 0,183,234, 52,255, 39,224,147,255, 1,228,226,220,185,115, 7, 58,251,108,154, 46, 69, +219,150,229,102,109,197,191, 61,140,128,150,190,227,170, 88,182, 7, 95,114,114, 50,210,210,210, 28,186, 39,103, 34, 42,173,241, +181, 87,100,198, 86,252, 57,142,195,250,245,235,177,121,243,102, 58,103,206, 28,226,100, 30, 11,101, 50, 89,187,172,151,189,120, +241,226,185,169,169,169,174, 86,104, 31,139,231,175,190, 19,117,120,211,154,181,204,163, 97, 17,226, 23,146, 30, 23,134,244, 15, +227,243, 73, 8,163,169,171, 99,197, 8, 53, 48, 93,186, 26,116, 55,175, 25,218,250, 27,124, 71, 26, 55,169, 84, 26, 12, 96, 56, +128, 83, 50,153,172,178,131,121, 58, 62, 0, 18, 0, 76, 7,176,147, 16,146, 69, 41, 85,182, 3,239,119,148,210,135, 93, 21,216, +142, 2,134, 97, 90, 53, 82, 8, 33, 35, 1, 8, 9, 33, 33,148,210,138,150,174,107,205, 64, 33,132,208, 23, 95,124, 17,221,187, +119,191,109,187,208, 85,171, 86,197, 23, 23, 23,203, 9, 33,212, 81, 35, 64, 42,149,210,141,207,123,226,241,177,183,111, 46,195, +125,239,143, 77, 63, 25,240,164,147, 94, 83,123,242,213,213,213,197,189,254,250,235,242,148,148, 20,196,199,155, 87,182, 59,119, +238, 92,220,218,181,107,229,221,187,119, 7,199,113,208,106,181,136,139,139,195,196,137, 19,237,114, 10,235,212,113,125, 95,223, + 38,207,140,238, 26,223,233, 95, 19,178, 1,128, 45,103,227, 46,191,205,202, 77,221,125,160,228, 60,161,208,250,160,194,247,100, +252,211,139, 66,236,122,199,189,186,117,234,212, 93, 40, 41,123,254,185,199,244,161, 18,161, 80, 89,163, 37, 43,190,218,178,249, +141,103, 30,133,191, 68, 66,117, 70, 19,253,247,234,175,244, 0, 72,231,206, 65,252,242,242,106, 38, 42,170,249,157, 53, 71,132, + 28,136,188, 25,230,225, 23,123, 79,240,170, 97, 49, 1,130,141, 27,175,134, 7, 7, 73,170, 62,124,233,248,170,162,235,195, 76, +147, 39,117,206,205,191,162, 42,126,242,241, 94,137,214,114,227, 76, 29,176,221, 32,167, 45, 94,104, 83,241,111, 90, 63, 93,225, +239,136, 17, 0,139, 16, 83,171, 17,144,156,156,108,123,190,145,104,219,110,236,227,170, 81, 97,229, 73, 75, 75,107,115,148,192, + 86,252, 23, 44, 88,128, 83,167, 78,209,159,126,250, 9,115,230,204,113,150,202, 32,149, 74, 5, 50,153,140,109,135, 38,178,124, +241,226,197,211, 83, 83, 83,119,186,240,221, 48, 0, 53, 0,194, 1,156,203,201,201,233, 1,224, 51, 0, 1,182,252, 0, 62,137, +141,141,117,120,207, 5, 45,167,229, 27,170,244, 30,147,167, 78,247, 85,192,232, 43, 16,240, 69, 74,157,152, 47, 20,106, 89,158, +143,167,222, 32, 49,106,249,229, 55, 85, 98,158,168, 86,103,210, 27,164, 82,105,139,245,183,205, 17, 0, 66, 72, 55, 0,159, 3, + 40, 5,240,162, 84, 42,253, 23,165,244,198,221,242, 96,237,136,116, 32,128, 77, 0,110, 2, 56, 6,224, 1, 0, 79, 19, 66, 30, +167,148, 86,183,145,126, 22, 33,100,142,189,254,210,187, 25, 98,191, 67, 24, 13,224, 50,128, 8, 0, 21,196,162,212,142, 26, 52, + 19, 39, 78,140, 3,208, 72,252, 23, 44, 88, 32,183,141, 6, 88, 62,147, 79,156, 56, 49,206, 94,119, 64,122,122,122, 28,128, 70, + 98,205,204, 82,192,214,123,127,124,172, 16, 79,126,170, 70,122,122,122,156,189,240,125,123,243, 1,192,241,227,199,229, 98,177, + 24,185,185,185,141,246, 59, 96, 24, 6,111,190,249, 38,177, 54,118,187,119,239,150, 79,156, 56,209,110, 6,116, 58,126, 81, 78, +197, 2, 12,169, 20,202, 43,126,223,138, 21,132,161, 24,242,166,129, 0, 6, 92, 56,114, 61,238,230,246, 41,114,224, 68,171,141, +112,124,175, 8,218, 93, 40,193, 43,207,206,209,135,122, 9,133, 85, 23,114,136, 39,195,199, 11,227, 34,209,197, 79,130,235,185, + 71,137,214, 64,201,130,185,143, 25,226,123, 69,208,126, 30,222, 40,163, 85,100,216,176, 97,205,242, 5, 5, 9,239, 21, 10, 25, +241,177, 99,101, 47,178, 38,221, 71,161, 93,123, 26,253,130, 4, 68,169,188,234,209, 51,194, 35, 40, 32, 64, 84,201, 81,165,254, +199, 19, 21,234,121,227,254,152, 2,220, 52,236,111, 91, 55,157, 53, 2,172,215,216,142, 35,176,119,157,189,237,183,219,147,207, +214, 8,144,201, 20, 0, 20,144, 74,253,209,156,104, 59,138,150,140, 10, 75, 68,166, 77, 81, 15, 91,241,223,189,123,183,156, 97, + 24, 48, 12,131,113,227,198,225,232,209,163,141,242,203, 81,152, 76,166, 60, 30,143,103,148, 74,165,124,153, 76,214,214,241, 44, +146,234,234,234,239, 3, 3, 3,103,166,166,166,110,119,242,187, 90,152,247,139, 81,229,228,228, 12, 2,176,253,224,193,131,125, + 56,142,179,213, 40,240,120,188,135, 0,100,199,198,198,198,219, 35,204, 47,204, 23, 75,132, 98, 95,129, 64, 20,204,240, 73,103, +202, 19,249,113, 60,158,136, 35, 12, 56,194, 55, 82, 30,175,158,199, 17,149,154,103,170,241, 20, 10, 8,175, 87,183, 58,241,212, + 16, 22,197,119, 46, 2,240, 17,128,131, 22,203,230, 89, 0, 31,173, 95,191,126,166,139,130,237, 15,224, 69, 0, 35, 0, 36, 2, +216, 3,224, 36,128,143, 41,165, 10, 23, 40,143, 88,210,181,150, 82,202, 17, 66, 60, 1, 60, 97, 57, 63,176, 13,134,133,175,229, +173, 39, 0,165, 51, 30,118, 11, 17, 20, 33,128, 55, 0, 44,149,201,100, 6,116, 44,140, 0,144, 3,160, 19, 33,100,171, 37, 79, +190,105,106,208,180,100,160,100,102,102,202,109,195,254, 11, 22, 44,104, 56,182,125,191,106,213,170,120,139, 97,208,106,141,207, +204,204,148,219,134,233,153, 89, 10, 92,217, 99,222,133,145, 73,252,166, 65,180,185,239,253,193,204,202,148,219,219,208,167, 57, + 62,107, 99,198,204,146, 82,103,249, 40,165,113,199,142, 29,195,156, 57,115,240,197, 23, 95,224,204,153, 51,113,209,209,209,217, + 77,175, 17,139,197,242,206,157, 59, 59, 18,171,143,235,124,236, 23, 92,158, 19, 7,175, 47, 46,128,148,105,226,104,103, 15, 11, + 31,177, 92,130, 56,129,174,187, 60,160,115,235, 91,217,198,247,138,160,115,255, 57,203, 16,234, 41, 20, 24,175,158, 18,250, 7, +123, 19,121,153, 18, 51,163,186,161, 95,152, 31,132,181,151, 33, 87,105,209, 77, 32,130, 31,225, 9, 22, 63, 61,135,214, 11, 69, +249,241,189, 34, 40,124,252,154,229, 84,212,170, 2, 70,142,244, 90,165,100, 71, 45,242,246,175, 20,233, 24, 79, 78,226,101,208, + 7, 4, 5, 50, 30,126, 98,190,162,166, 76,164,172, 99, 33,168,211, 19,219, 50,211,154, 65,107,233,247,151,219, 19,206,228,228, +228,120,123,227, 1,154,243,252,155, 26, 2,206, 24, 1,214,207, 90, 19, 99,219,243,246,132,177, 41, 31,221,230,127,123,123,147, +162,128,163,124,173,133,251,219, 34,218, 77,141, 10, 0, 8, 8,200,106, 23,241,159, 55,111,158,185,251,141,227,240,234,171,175, +226,163,143, 62,106, 16,255,181,107,215, 58,205,205, 48, 12, 12, 6,195, 89,161, 80,200,182, 67, 36,160, 6, 0,170,171,171,183, + 7, 6, 6,198,167,166,166,202,157,248, 46, 31, 0,158,124,242, 73, 81, 78, 78, 78,102, 86, 86, 86,167, 37, 75,150,176,111,189, +245, 86, 35, 93, 13, 12, 12,196,161, 67,135,226, 0,164,197,198,198, 38,183, 70,200, 35, 2, 31, 3, 75,187,112,156, 49, 66,200, +227,245,160,132,132, 16, 62,159,240,121,188, 58, 66,136, 22,132,167,228, 40,252,169,129,243, 80,154,140,232,229,195,106,153,145, + 42,174,221, 12,128, 38,125,195, 97, 0,186, 81, 74,173,130,255, 62, 33,228,132, 84, 42, 13,163,148,150, 58,227,193, 18, 66, 30, +179,136,245, 7, 0, 22, 1,120,212, 18, 66, 73, 6, 80, 76, 8,121,150, 82,250,141, 19, 34,253, 31, 0, 87, 41,165,107, 8, 33, + 34, 75,133,103, 41,165,159, 17, 66, 38, 17, 66,254, 67, 41,253,127, 46, 22,138,241, 0, 42, 1,220, 11,224,127,206,124,177,185, + 8,128, 84, 42,125, 10,192,219, 0,202,231,206,157,187,174,131, 69, 0, 6, 90,210, 54, 1,192,100, 0,215,237, 25, 52, 45,193, + 86,240,109, 69,191,233,184, 0,135, 43,186,141,248, 3,192,149, 61,143, 53, 50, 2, 92,225,179,109,204,100, 50, 25,177, 53, 2, + 28,193,225,195,135, 97, 48, 24, 16, 19, 19, 19,255,211, 79, 63,201,139,138,138,228,209,209,230, 45,117, 57,142, 67,106,106, 42, +173,175,175,135, 64, 32,192,140, 25, 51,236,222,183, 46,247, 36, 24, 3,139,218,152,240,120,193, 79, 55,229, 87, 55, 28, 70,175, + 55, 38,155, 69,139,163,200, 75, 21,210,154,122,111,104, 5, 94,152, 48,239,138,253,231,200,240,234, 43, 47,228,250,234,244, 38, +198, 87, 34,162, 73, 81,221,225, 35, 17,144,146,234,122,120, 50,124,164, 12,235, 78,143,255, 90,129,159,255,183, 15, 61, 60,189, +232,121,149,242, 58,128,190, 45,209,229,158,237,242,220,232, 97, 85,135,189,248, 17,172,144,189,213,107,252,152, 20, 47,157,193, +115, 10,207,235, 36,163,172,173,241, 40,186,116, 50,194,104,184, 84, 89, 88,160,246,177,212, 25,187, 66,229,168,119,106, 29, 31, +208, 82,255,115, 75,222,180, 61,175, 82, 42,149, 82, 87, 67,166, 29, 9, 77, 61,127,179,120, 3,105,105,237, 55, 72,176, 61, 60, +127, 74, 41, 88,246,119,141, 30, 59,118, 44,142, 30, 61,234,146,248, 91, 96, 20, 8, 4, 38,142,227,142, 49, 12, 99,108,163, 17, + 16, 98,125, 83, 93, 93, 45, 15, 12, 12,148,166,166,166, 58,186,115, 86, 81, 74, 74,138,207,225,195,135, 83,179,178,178, 58,125, +253,245,215,220, 19, 79, 60,193,223,178,101, 11,222,121,231, 29,228,231,231,163, 71,143, 30, 40, 47, 47,199,187,239,190,107,122, +251,237,183,147, 0, 60, 27, 27, 27,251, 89,139,140, 28,235,107, 2,211,131,112, 24,104, 4, 23,233, 33, 16, 9,133,124,166, 76, + 44,224, 41,121, 18, 97,149, 72,196,171,215,155, 56, 15,190,145, 31, 96, 96,245,166,107,103,206, 42, 30, 11,254, 72,115, 28,174, +233,135,189, 8,192, 36, 0, 57, 77, 6,142,229, 0,152,180,126,253,250,175,156, 16,235, 71, 0,188, 4, 32,188, 73,104, 94, 1, +224, 23, 66,200, 39, 0, 14, 16, 66, 76,148,210, 45, 14,240,121, 0, 19, 92,166, 19, 0, 0, 32, 0, 73, 68, 65, 84,152,107,245, +242, 41,165,250, 38,151, 60, 14,224, 87, 66,200, 74, 74,169,198,149,240, 63,128,175, 44,255,157, 50, 0,154, 10,166, 84, 42,253, + 7,128,231, 44,207,114, 21, 33, 68, 47,147,201, 54,116,132, 6,132, 16,210,219, 18,194,250, 17, 64, 6, 0,107, 62,193,209, 8, +192,223, 13,165,165,165,242, 81,163, 70,129, 16,146, 61,106,212, 40,252,240,195, 15,120,232,161,135,226, 58,117,234, 36,103, 24, + 6,139, 23, 47, 38,150,198, 36,110,235,214,173,114,189, 94,143, 17, 35, 70,180,216,208,141,185,118, 83, 94, 62,170, 63, 64, 72, +246,175,161,166,248,129,231, 2,228, 58, 14,241,230, 46, 0, 96,200, 98, 3, 1,170,161,174,174,139, 59,180,181,183, 92,237,125, + 34,254,225, 39,124,154,245,138, 75, 12,236,202,245,235,183,188, 26, 28, 36, 41,170, 83, 27,124,195,253, 61, 5,201, 67,123,122, + 12, 11, 23, 17,157,198, 4,141,150,195, 85,162, 53,101, 20,149,106, 10,202,235, 77,157,132,226,178,114,131,110,226, 13,189,241, + 3,111,224,149,230, 56,125,252,195,186,106,235,175,116, 25,144,112, 31,115,241,120,217,248,210,223,126,184,209,123,248,220, 16, + 94,255,168,146,179, 71,191,175, 35, 60,159, 17, 28,199,213,220,186,165,181,107, 69, 53, 21,108,123,199, 86,111, 54, 45, 45,173, + 69,193,182, 13,175, 55,141, 4, 56,114,253,159, 21, 9, 9, 9,196,214,235,183,133,109, 8,191, 45,104, 15,158,250,250,122, 57, + 0,240,249,124,188,252,242,203, 56,117,234, 20,126,250,233,167,182,210,234, 1,152,244,122, 61, 91, 90, 90,154, 25, 22, 22,102, +180, 23, 89,108, 5, 42,219,131,234,234,106, 89, 96, 96,224,131,169,169,169,142,180,251,190, 58,157,174,207,194,133, 11,167,206, +155, 55,143, 14, 30, 60,152, 0,104, 16,127, 0, 24, 61,122, 52,118,236,216,129,177, 99,199, 50,143, 60,242, 8,205,206,206, 94, +195,227,241,180, 30, 30, 30,208,104,110,151, 38,142,163,186,108,249,193,244,222,189, 35,139, 35,122,132, 95,225,121, 75,202,120, + 68, 88,199,136, 4,117,140,216,163,194,192,231,105, 64,141, 2, 78,108, 12, 81,149, 86, 7,157, 56,116,238,205, 32,255,208,183, + 92,125,144,173, 70, 0,164, 82,233, 68, 0,155,155,120,181,135, 0,204,153, 59,119,238, 87,142,120,176,132, 16,158, 37,252, 61, +173,165,126,121, 74,105, 53, 33, 36, 5, 64, 6, 33,228,123, 7,230, 41, 63, 2,224, 0,165,180,174, 5,190, 58, 66,200, 1,203, +117, 95, 56, 41,138,247, 1, 8, 4, 48, 31,192, 86, 66,200,125,148,210, 67,174, 68, 0, 8, 33, 73, 0,222, 7,208,131, 82,170, + 38,132,140, 6,112, 93, 42,149,170, 40,165,233,142, 70, 0,164,102, 83,223,145, 70,139,200,172,110,128, 99, 24, 3,224, 4,165, +148, 18,179,219,116, 29,128,154, 16,210,205, 58,206,195,153, 8, 64, 83,143,191, 45,222,127, 67, 88, 62,241,155,134, 40, 64,100, + 27,188,255,223,195,252,191,135,111,165, 82,231,188,127,163,209, 72, 79,157, 58, 5,111,111,111,228,229,229, 81,147,201, 4,165, + 82,137, 75,151, 46,201, 3, 3, 3,209, 36,236,151, 61, 96,192,128,248,109,219,182,201, 71,140, 24,209,124,184,207,104,164,221, + 78, 93,128,208, 59, 12,130,188,106, 26,106,242,134, 74,201,192,116,169, 30, 8,108,188, 35,181,103, 32,155,221,125,248,233,248, +125,219,103,201,129,189,205, 54,118, 87,110,220,120, 45,178, 91, 55,160, 74,251, 42, 0,228,107,149,216, 45, 42,173, 28,112,239, +248,224, 1,134, 60,252,114, 93,129,221,231,110,241, 11, 42,235,125, 0,160,220,160,243,191,161, 55, 38, 23,148,150,238,136, 10, + 14,110,214, 0,184,119, 74, 10,227, 33,156, 56,152, 85,255, 82,220,189,127, 66,159,186, 27,219, 13, 87,127,201,172, 53,114, 94, +183, 42,138,127,174, 80,214,120,142, 0,195,144, 26,149,206, 87, 58, 43,186,155,236,251, 51, 55, 90, 42, 51, 50,153,140,216, 70, + 0,108,189,203,166,225,118,171, 72, 39, 39, 39, 35, 33, 33,129, 52,183,208, 73, 91, 70,227,187,186,112, 74, 71,131,181,186, 75, +165,254,183, 69, 4, 92,141, 42,164,165,165,181,139,248,111,222,188,153, 30, 57,114, 4,116,155, 63, 72,138, 2, 31,126,248, 33, + 40,165, 96, 24, 6,235,214,173,115, 57,178,160, 80, 40,244, 1, 1, 1,241, 71,142, 28,217, 59,126,252,248,201,205,149, 31, 39, +224,103,169,175,115,171,171,171,215, 7, 6, 6, 62, 6,160,102,241,226,197,255, 72, 77, 77,181,231,168,213,237,218,181,171,116, +223,190,125, 95,197,199,199, 63,213,175, 95, 63, 36, 36, 36,208,172,172,172,134,116,100,100,100, 64, 36, 18,225,250,245,235,216, +187,119, 47,233,210,165, 11, 27, 27, 27,251,211,165, 75,151,154, 37,140,140,232, 83,166,213,234,230, 30, 57,114,100,125, 96, 80, +160,210,215,199,167, 24, 66,161,158,213, 51,245, 44, 79, 95,171,227, 43,171, 60,245,158,226,155, 21,149,190,135,246,237, 93, 63, + 96,224,160,247, 13, 58, 77,125,187, 24, 0, 82,169,148, 72,165, 82,107,226, 59, 89, 94,135, 45,211,236, 26,162,160, 0, 22, 16, + 66,186,192, 60,194, 17, 0,154,181,208, 45,162,242, 2,204, 3,244,174, 53,225,105,138,107,150,235, 94, 32,132,124,212, 10, 31, + 1, 48, 3,192,114, 59,124, 95, 3, 88, 68, 8,249,202, 78,250,108, 11, 77, 56,204,227, 29, 98, 96,238,251,127, 19,192,105, 66, + 72, 47, 0, 69,182, 54,134, 3,124, 15, 3,120,218, 34,178, 90, 75, 90,181,150,227,117,132, 16, 33,128,239, 90,227,179,228,197, + 99, 0,230, 57,106, 0, 72,165,210,181, 0,190,105,137,207,194,185, 18,128, 55, 0, 95, 0,187, 44,105, 19,195, 60, 79,252, 23, + 0,163, 8, 33,243, 1,252, 4, 96,119, 75,233, 3,204,243,232, 91,232,235, 71,211,177, 1, 19, 38, 76,176,107, 12, 76,152, 48, + 33,158,153,245,123,191,189,213, 8,176,190,183, 13,231,187,204, 55,235,246, 41,129,142,240,157, 59,119, 14,221,187,119,199,203, + 47,191,220, 80,102, 54,109,218, 68,115,115,115, 49,101,202,148,219,174,247,240,240,144,139,197,226, 22,249,194,207,157, 67,109, +247,206, 56,254,242, 83, 13,124,151, 95,219, 17, 23,145, 91, 39,103,166,136,111, 75, 75,113,190, 1, 34,113,235,179,159,174,150, +148, 44, 68,215,174, 63, 3, 24, 77, 65,121,184, 86,249,178,134,101,193,234,204, 65,178,139,149,149,184,166, 51,108,226, 19,162, + 2, 33,198,171, 37, 37,233, 0,208,210, 32,192, 46,225,253, 22, 2, 88,145,127,244,197, 34,113,232, 12, 69,105,185,184,107,121, +201, 73, 49, 4, 1,189,139,174,155,194,170,203,111, 64, 40, 20,132, 12, 12,245,124,164, 86,101,252, 22,192, 13,123,158, 43,128, +184,166,211,255, 90,240, 64,227, 93, 89, 19,160,185,254,255,191, 3,218, 58, 85,207,250,253,180,180, 52,218, 86,190, 45, 91, 54, +211,236,236,108,144,116,179, 97,124,224, 45,111, 76, 92,162,194,248,241,227,225,204,180,191,230, 16, 16, 16, 16, 15, 0,247,220, +115,143,166, 29,186, 41, 20,129,129,129,115, 0, 88,157, 83,125,106,106,234,110, 7,191,203, 2,168,200,200,200,144, 63,244,208, + 67,195, 83, 83, 83,135,152, 76, 38, 34,145, 72, 48, 97,194, 4,236,223,191, 31, 28,199, 33, 49, 49,145,190,248,226,139, 36, 42, + 42, 74, 63, 99,198,140, 30, 53, 53, 53,183,116, 58, 93, 75,138,204,254,122,233,202,166, 65,131,135,248,158, 60,113,226,253,179, +124,254,160,158, 61,122,126,233, 19, 24, 92, 34, 8, 22,211,195,123, 15,249,215, 40,170,199,133, 5, 4,191,221,167, 79,159,195, + 94,161,158,107,251,119,141, 49,228,229,229,181, 75, 4,128, 7,243,116,191, 88, 0,239, 1,120,222, 34, 60,158,182,245, 9,230, + 65, 98, 87, 1,252,219,210, 37,112,170, 5,126, 6,230, 65,102, 7, 0,120, 56,144,158, 99, 0, 38,162,229,133, 21, 24, 0,193, + 0,122, 0, 56,109,135,243,180,229,186, 16,180,220, 55,201,192,188,140,163,191,165,219,224, 33,139,112,231, 91,184,243, 45,199, + 91, 0,252, 0,243,140, 3, 5, 0,131, 29,190, 89,150,200, 67, 63,139,145,100,155,206, 50, 0, 82, 0,191, 89,174,253,222, 14, +223, 75, 48,207,110,112,164, 43,195, 3,192, 62, 0,155,237,228,199, 76, 0,255,181,252, 63,107,147, 62,129, 37, 47,211, 0,124, + 10, 96,137,229,243,178,150,126,240,192,129, 3,217,132, 16, 20, 23, 23,203,173, 51, 1,154,122,253,197,197,197,114,235,181,246, +110, 32, 41, 41, 41, 59, 51, 51, 19,155,126, 50, 52,140,220,111,234,165,111,250,201,208,112,237,221,228,203,205,205,197,184,113, +141,135,186,135,135,135,199,111,219,182, 77,222,179,103,207,120,142,227,228, 75,151, 46,165,214,105,128,132, 16, 12, 31, 62,188, + 69,163,162,111,110, 46,190, 11, 12,137,247,177, 57,215,127,254, 68,168,223,191, 1,220, 31, 2,202, 1,121, 75, 5,180,158,243, + 66,141,214, 7, 10, 50, 12, 67,199,237,138,111,173,216, 91,102,112,108, 7,176,189,119,143,176,190, 0, 94,214,155, 56,164,231, + 21, 97, 92,168,185,187,147, 80,170, 82,177,236,123,183,110,221,186,229, 64,153,122, 31,128,103,254,111, 53,143,214,158,222, 22, + 84, 81, 86,131,138, 91, 42,240,249,213,158,245, 10,138, 90,165,137,134, 4, 11,253,248, 28,166,107,245,166,239,150,188, 28,235, + 23,210,255,137, 90, 59, 66,147,109, 79, 92,218,220,135,157,176,205,252, 63, 43,197, 73, 15,248,206,206, 2, 32, 41, 10,180,133, +175, 37,143, 61, 38, 38,166,195, 24, 34, 13,131, 29,173,226,159,199, 98,131,220, 92,199,218, 42,254,214,178,241,236,179,207, 6, +243,249,252,138, 99,199,142,125,121,207, 61,247,180,101,138, 98,247,212,212,212, 53,150, 40,192, 44,203,140,128, 89,169,169,169, +223, 59, 18, 84, 4, 80, 15,160, 42, 60, 60,124,232,216,177, 99, 75,207,229,229,117,214,106,181, 68, 46, 63, 4,145, 88, 4,134, + 48, 56,116,232, 16, 25, 48, 96,128, 38, 57, 57,121, 84,101,101,165,221, 58, 55,123,214, 76,246,199,189, 63,126, 58,116,232,176, +158, 6, 86, 63,249,106,254,149,167,185,162,130,167, 0, 64, 12,134, 14,238,221,247,100, 72, 72,112, 54,143, 47,124,237,191,111, + 45,175,255,118,163,235, 61,202,205, 25, 0, 47, 91,172,161, 41, 0, 46, 1,240,106,230,123,123, 44, 30,123, 18,128,145, 22,241, +108, 54,202, 9, 32, 18,192, 86, 7, 13,128,106,203,245,188, 86,248,226, 0, 92,113,144,239,138,229,250, 29,173,240,205, 5,240, + 36,128, 11, 48,207, 80,184,214,132, 91,110,241,254,159,179,120,195, 27,129, 22, 71, 92,240, 44, 30,251,227, 0,162, 44, 81,132, +230,210,169,180,124,190,206, 98, 4,108,108,133,239,107,139,209,229,200,253, 82,203,245,173, 61,191, 15, 44,145,141, 3, 22,163, + 6, 77,184,247, 3, 24, 96,201,139,124,139, 33,213,173,213, 31, 53,247, 32, 80, 0,242,230, 22, 2,178, 94,227, 76, 5,127, 82, + 42,165, 79,126,170,110,102,225, 30,133,211, 2,209, 94,124, 47,188,240,194,109,215,140, 31, 63, 62,123,252,248,241, 4, 0,238, +187,239, 62,167, 26,161, 61, 47,188, 64,124,154,182, 40, 61,188,178, 37,171,251, 19, 0, 24, 40, 19, 16,115, 80,198, 58, 50,251, +186,131,197,192,146, 47, 38, 90, 4, 62,192,171, 71,131,248, 91, 92,228, 91, 98,177,216,209,217, 40, 4,192, 59, 71,179,206,122, +132,118,237,241, 32, 7,143,200,146,226,114,158, 81, 87, 75, 59,133,120, 17, 47, 79, 1, 97,141, 28, 20,181, 6,150, 72,136,164, + 78,197,246, 14,105,217, 33,104, 86, 44,154,190,255, 35,151,239,189,211,179, 0,218,202,215,146,199,222,179,103,207, 14, 35,254, +220,247,254, 56,144,103, 30,147,183, 81,110,192,119,199, 12,160,148,182, 75,190, 90, 57, 76, 38, 83, 53, 0, 68, 71, 71,183,105, + 65, 32,171,248, 91, 80,101,249,239,104,221, 16, 90, 28,179, 51, 0, 48,112,224,192, 48,149, 82,181,104, 68,204,240,199, 84, 74, +165, 47,107, 98,141,161,161,161,183,194,194,194,174, 40,149,202, 37,149,149,149,249,142,166,107,202,228, 41, 44,128,231,143, 30, + 57, 49, 54,118,236,216, 41, 18,137, 36,136,128,154, 8, 33,224, 56, 90,173, 85, 43,214, 92,206, 43, 46,251,118,227,134, 54,173, + 8,216,212, 0, 48, 1,248, 71, 43, 2, 98,139,147,150,151,201,242,106, 14, 38,152, 71,212,243, 28, 76,143, 28, 64,150, 29,190, + 12,152, 7,173, 57,130, 71, 29, 72,223,122, 0, 95,218,225,249, 21,230, 41,144,112,128,239, 27, 75,196,192, 30,138, 44,158,189, + 35,233,227, 57,145,167,235,237,240,221,239, 0,159, 53,218,176,209,242,108,236,206,181,165,148,146,137, 19, 39,198, 89, 5,223, + 54, 4,239,202, 82,192, 50,153,140,164,167,167,199, 49,179,218,103,233,222,246,230,251, 51,160,160,228,166, 62,178, 91,183,141, +243,222, 95,247,164,245,156, 65,192,108,214,105,184,125,229,197,197, 42,135, 10,211,250,245,180,234,244, 6,178,252,251, 95, 22, +238, 94,125,223,206,227, 39,202,158, 9,246,229,166, 50, 1, 62,126,148, 2,132, 80,189,158,229,202, 57,160,202,160,231,252, 74, +203,180,134, 72, 39,210,152,156,156, 28,111,219, 29,144,156,156, 28,223, 81,158, 95, 71, 92, 9,240,207,130, 73, 75, 84,119,244, + 30,101, 50, 25, 39,149, 74, 59,139,197,226,178,232,232,232,251,219,131, 51, 53, 53,245, 96, 96, 96,224,147,169,169,169, 27,157, + 48, 0, 88, 75,228, 20, 0, 48,122,204,232,229, 0,150, 55,189,176,233, 24, 33, 71, 49,110,252,200,159, 96,238,138,109,130, 48, +244,238, 51,168,205,247,220,156, 1,160,115,129,135,182, 18, 34,209,187,249,254,178,124,141, 96, 17,250,118,171,232, 73, 73, 73, +217,246,230,229,255,145,124,127, 6,212,104, 52, 79, 1, 30, 70, 0,193, 28,104,169, 78,103,216, 82, 94, 94,121,158, 82,234,240, +180,169,160,152,127,208,140, 15, 39,147, 91,158, 15,231,118, 29,139,220,172,175, 62,120, 57, 32, 64,180,136,207, 35,180,172, 90, +119,185,204,192,110,146, 8, 24,177,132,207,227, 25, 89, 78,236, 76,250,172,125,252,214,129,103,174,238, 3,112,219,212, 63,155, +208,191, 43,139,205, 52,245,204, 29, 57,127,183,249,238,182,225,227, 40,152, 89, 10, 16, 66, 48,117,218,239, 3,162,247,236, 61, +211,208,134, 36, 78,142,110,175, 41,138,229,237,217,222, 88,140,128,141, 78, 92,238,111, 49, 0,212,127,214,246,129,223,228,129, + 82, 71, 27,251,166,104,110, 20,187,155,239,175,205,231, 70,199, 71,117,117, 53,133,185,155,171, 77,184,229, 57,157, 2,192,209, +205, 31,147,132,167, 94,249,240,241,185,121,159, 62, 63,251,216, 0,131,154, 68, 4, 8,248, 65, 32, 68,227, 37,225, 87, 14,234, +231,147,239, 44,119, 66, 66, 2, 73, 75, 75,115,121,189,249, 59, 37,158,127,150, 8, 64,199, 51, 30,204,177,161,191, 65,245, 10, +179, 56,204,222,248,147,238, 6, 72,162,162,162,254, 30, 67,100,221,112,195, 13,240,121,128,135,136,128,227,204,109,116,189,214, + 93,253,221,112,227,111,219, 30,184, 31,129, 27,110,252,125,192,154, 0,165,198, 42,250,110,241,119,195,141,191, 51, 24,247, 35, +112,195, 13, 55,220,112,195, 13,183, 1,224,134, 27,110,184,225,134, 27,110,184, 13, 0, 55,220,112,195, 13, 55,220,112,227,175, +136, 70, 99, 0,230,205,155,231,242,200,205,230,214,214,110,142,239,127,223,127, 30, 55,104, 72,111,121,231,174, 97,241, 42,173, + 90,126, 88,158, 27,159, 52,235,217,108, 87,249, 86,127,181, 61, 46,106,200, 40,249,173,210, 82,120, 74, 60,113,163,164, 32,254, + 95, 79, 77,115,153,175,189,239,247,194,225,121,113,163, 71,245,148, 75, 60,121,224,243, 24, 16, 49, 65,153,242, 69,226, 42,223, +153, 91, 67,226, 70,140, 26, 33,247,245,226, 1,124,160,230,220,122,226,104,250, 34, 39, 69,186,124,191, 87,246, 95,185,141,111, +228,200,145, 46,243,157, 56,113,226,118,190, 72,215,211,119,226,202,237,233, 27,213,167,143,203,124,199,243,243,255,116,124,147, + 90,201,223,229,203,211,232,162, 69,201, 45,126,190,191,153,252,141,124, 96,146,235,229,101,223,254,219,203,243, 36,215,203,203, +242,204,106,234,195, 21, 52, 58, 23, 20,249,176,203,124, 85, 87,190,187, 45,125,103,223,184,238,114, 67, 58,108,105,143,219,206, +125, 24, 84,234, 50,223,203, 85, 97,248, 35,218,171,191, 59,159, 84, 42,229, 55,183,179,160, 35,124,251,247,239, 7, 0, 40, 20, +138, 8,157, 78,167,120,242,201, 39,107,255,200,251,117,218, 0,104, 9,186,173,210, 72, 0, 61, 97, 94, 39,160, 64, 60, 91,118, +205,209, 31,216,254,205,242, 56, 2, 14,193,126, 1,200, 61,124, 70,254,245,215, 31, 35, 54, 33, 22,172, 90, 35, 31,208,111, 60, + 56, 14,242, 95, 35,190,142, 31, 54,108, 8,174, 94,189,142,186, 90, 53, 6,143,153,147,221, 18,223,250,111,229,113, 20, 4, 61, +122,247,148, 75, 95, 89,130,234, 79,182,227,155,207, 63, 3, 32,198,158,243, 37, 96, 24,200, 63,126,231, 45,228,231, 95, 70,120, +120, 15,136, 36,124,220, 44,201,111,113,113,145,194, 29,159, 81,161, 80, 8,137, 68,130,130,130, 2,116, 9,241, 65, 16,223, 11, + 93,186,251,193, 95,226, 11, 79, 98, 2,195, 48,160,156, 9, 26, 17, 31,117,183,234, 80, 49,220,254, 92,242,186,130, 53,212, 91, + 82,135, 49, 35,122,193,203,147, 15,161,132, 1,159, 7, 48, 66, 62,250,134,125, 78,141,148,135,194,155, 79, 57,156,225,171,247, +234,226,194,194,194, 16,123, 79, 87,185, 86,167, 7, 35,146, 0, 70, 32,175, 62, 58, 78,171, 81, 99, 84,200,229,236, 63,202,138, + 92,191,126, 61,157, 59,119,238,223,106,126,125, 71,133, 61,161,111,227,245,158, 0, 70,116,146,120,252,183,180,180,180,159, 64, + 44, 2,231,225,177, 12,230,149, 49,235, 59,202, 51, 40,248,117,111,220,181,139,135,111,219,107, 32, 33,121,217, 95,165,140,146, +111, 54,109,250, 77, 36, 20, 74, 56,142,243,245,244,242,242,122,112,234, 84, 15,152, 87,176,235,168, 35, 59,173,209,102,174,173, + 68, 82,169,212,199,215,215,119, 65,223,190,125,103,136, 68,162,174, 37, 37, 37, 37,165,165,165, 39, 12, 6,195, 82,153, 76, 86, +224, 2,159,159,191,191,255,146,251,238,187,111,242,179,207, 62, 27,254,197, 23, 95,220,186,112,225,194, 49,157, 78,247,174, 76, + 38,187,224, 8,199,254,253,251,241,227,200, 29, 24,179,247,222, 21,225,225,225,175,121,122,122, 98,251,246,237,167,103,206,156, + 57,252, 79, 19, 1,104, 65,252,121,158, 34,254,136,199,198,246, 90,201, 81,170, 59,122,249,214, 39,151,182, 74, 15,136,103,203, + 46,218,251,110,242,212,222,116,234,125,203, 97,172,175, 5,223,196,224,151,139,151,241,196, 19, 47,254, 94, 34, 24,224,231,220, +141, 8,234, 30, 38,231,234,149, 48,112, 4,135, 14,229,198,151,104, 91,202,168,165, 20, 66, 95, 16, 15, 31,156,185, 88,140,243, + 23,255,129,175,190,219,223,240, 57,199, 1, 15,140, 25, 3,212,151, 3,240, 70,193,133, 75, 16, 4,249, 33,118,244, 32,121,173, +166, 21,155,133, 48, 0, 97, 16, 53, 36, 26,157, 60,133,232, 18, 36,134, 79, 96, 0,252, 69,222,240, 23,243, 32,224,241, 96, 52, +153, 80,203,114, 56, 89,117,218,238, 67, 45, 63,191,132, 6,248, 2, 62, 30, 30, 8, 14, 10,132,143,143, 7, 40, 99, 2,203,213, +195, 4, 19,188,188, 60, 16,212,169, 43,122, 70,254, 68,179, 14,143,109,181, 81, 90,151,105,160,190,222,158,232, 25, 17,130,224, +160, 64,168,213,106, 8, 69, 98, 8,116,230,197,249, 34,194,123,200,107, 20,181,248, 62,183, 40,190,184,228, 38, 20,229,215,177, +244,217,232, 86,141,129,180,229,105, 14, 55, 18, 9, 79, 38,196,251,135,250,103,183, 38,254,119,195, 8,120,227,253,247, 41, 0, + 44,125,237,181,118,249,141,197, 43, 86, 80, 0, 72, 93,184,208,101,190, 31,115,114,158, 48, 24, 12, 27, 1, 96, 70,124, 60,227, + 74,227, 43,219,182,205,188, 70,188,205,180,105, 74, 41, 8, 33, 13,255,173,231,172,215,205, 77,110, 89,176, 23, 45, 74, 38,142, +138,186,147,226, 63,192,211,200,110,247,246,243,237, 7, 0, 66,137, 24, 6,173, 14,156, 90,179,226,216,145,195,239,220, 59,115, +102,127, 0,197,246, 72,244, 60, 33,133,121,241, 20,214, 34, 10,156,165, 29,106,182, 45, 26,122,239,100,252,118, 40,195,169, 60, +186,118,241,176,188,247,160,184,248,240,254, 15, 56,111, 20, 39,215, 56,117,121, 74, 74, 10,182, 37,103,181,122, 77,124, 86,227, +173, 72, 6,248,153,111,181, 66,199, 65,203,154,243, 85,109,249, 47, 27,229,135, 62,222,130, 86,249, 86,174, 92,153,253,198, 75, +175,134, 76,155, 49,221, 75,167,211,226,227, 15, 63, 96, 86,175, 94,173,155, 63,127,126, 24,128,155,237, 93,247,246,237,219,151, +176,115,231,206, 76,192,185, 53, 7,114,115,115,105, 81, 81, 17,170,171,171,161, 82,169,224,237,237,141,192,192, 64,132,135,135, + 99,204,152, 49, 46,213, 59,169, 84, 58, 62, 58, 58,122,211, 43,175,188,114,181,111,223,190, 27,135, 13, 27,118,233,214,173, 91, + 93,115,115,115,163,159,122,234,169,221, 82,169,116,133, 76, 38,251,202, 9,190,248, 25, 51,102,164, 45, 95,190, 60,208,104, 52, + 66, 34,145,192,211,211,179,179, 90,173,158, 57,109,218,180, 7,165, 82,233,124,153, 76,246,121,107, 28,207, 43,164,192, 72, 96, +202,137, 25,240,236,238,217,101,209,162, 69, 56,117,234, 20, 85,169, 84,126, 54,191, 3, 0,188,153, 51,103,154, 38, 78,156,120, + 87,196,253,220,185,115,141,142,155,219,208,141,223,130,232,119, 3,208, 11,230, 37, 99, 77,106, 61,123, 35,247, 74,197, 71, 99, + 34, 67, 94,188,111, 64,231,119, 58,249, 74,186,200,183, 74,183, 2,184, 44,158, 45,107,113,147, 26,125,125, 13, 58,245,190, 31, + 75, 94,155,129,141,178,223,235,226,225, 99,235,160,214,232,145,152,240, 34,238,137,125, 18, 15,167,220, 7,137, 68, 4,131,137, +133, 74, 99,144,247, 25,221,187,133,194,113, 29, 48, 0, 51,230,172,197,191, 94,121,166,225,236, 3,247,196, 65, 44, 22,225,135, + 67,251,177, 39, 39, 23,155, 54,124, 6,157, 86, 15, 33,143, 15, 47, 15, 33,212,213, 37,241,181, 37,104,118,247, 49, 74, 41, 64, + 57,243,139,225, 64, 41,133,222, 32, 50, 55, 79, 34,128, 26, 76, 48,241, 0, 19, 76, 48, 25, 56,176,166,214, 13,216,130, 19,169, +180,107, 48,133,143,183, 39,194,186, 70,160,223,224,222,240,246,146,160,174,190, 18,229,149,229, 80,212,221,130, 81, 71,224,225, +225,129,224,224, 88,204,156,126,129,110,223,217,183,249, 48,254,230, 27,212,228,237, 13, 45, 31, 16,138,133,208,106,132, 48,104, +132,208,137, 69,224, 19, 22, 20, 60,232,180,245,208,106, 84,232,218,181,139, 92,200,227,163, 6, 74,124,244,209, 17,136, 68,173, + 23,142,247, 55,189,111,183, 0,189,246,248,107,173,126,174, 80, 40,104,147,227,152,128,128,128,124, 66,136,142, 82,202,247,247, +247,247, 40, 40, 40, 8, 76, 75, 75,203,158, 59,119,110, 23, 87, 11,178, 48, 52,116,118,195,111, 0,113,254, 64,187, 69, 59,214, +167,165,209,231,158,123, 46,222, 88, 81,225, 20,231,143, 57, 57,210,145, 35, 71, 46, 29, 27, 21, 5,163, 72,132, 85,171, 86,113, + 51,239,187,111, 2,165, 52,203, 41, 87,142, 16,172,124,231,157,134,227, 5,111,191,141, 85,239,190,219,234,177, 61, 52, 53, 2, +150, 47, 79,163, 49, 49, 49,200,202, 42,164, 9, 9, 61, 7, 2, 40, 92,190, 60, 77,235,164,248,231, 14, 30, 56,208,199, 90,103, + 60,197, 18,148, 85, 86, 64,169,168, 69,244,200, 81, 30, 63,126,181, 33,107,202, 83,255, 24, 8,243,230, 5,173,129,125, 97,233, +106,254,163, 51, 31,228, 71,134,135,115, 86,207,240,237, 85,159, 54,186,232,221, 5,207,155, 13,191,151,230,199, 63, 62,117,130, +211,249,234,146,248, 55, 88,200, 1, 78, 92,156,224, 20,181, 39,159,224,252,187, 79,131,248, 4,193, 84,120, 30,250,194, 95,145, + 95,163,198,240,189, 21, 14,125,127,157, 76,118,244, 21,233,115, 61, 30,255,231, 83,126,105,155,191,227,194,195,195,153, 37,203, + 87,192,251,157, 37,248,225,135, 31, 74, 31,122,232, 33,151, 12,209, 22,132,127,194,206,157, 59, 15, 88,143,167, 79,159,238,144, +114,169, 84,170,184, 3, 7, 14,200,141, 70, 35,122,245,234,133,113,227,198,193,215,215, 23,181,181,181,184,121,243, 38,174, 93, +187,134,155, 55,111,210,137, 19, 39,198,123,123,123, 59,156, 79, 82,169,116,250,125,247,221,247,241,202,149, 43,183, 14, 27, 54, +236, 99,171,177,211,165, 75, 23,204,156, 57,147, 36, 37, 37,121, 1,200,149, 74,165,185, 45,237, 94,218,148,111,254,252,249,233, +207, 61,247, 28,115,250,244,105, 16, 66, 16, 24, 24,216,240,218,187,119,175,112,244,232,209,159, 73,165,210,227, 45,241, 61,175, +144, 98,202,137, 25, 0, 64,182,167,236,160,247,126, 54,190,123,126,126, 62, 10, 11, 11, 73, 93, 93, 93, 47,169, 84,202,159, 54, +109,154, 9, 0,157, 54,109,154,137,101, 89,220, 13, 52, 21,127,235,185,166,247,193,111, 70,252, 3,135, 71, 4, 62, 30,213, 35, + 96, 14, 33, 68, 64, 41, 53,114,230,151,193,100,212,105,133, 12,215,101,112, 39,241,107, 65, 62,189,122,239, 60,121,237, 59,221, + 86,233, 81,241,108, 89, 89, 43,205, 55, 6,244,239, 11,134,201, 70,126,109, 53,128, 75,168, 43,189, 2,129, 88,132,140,221,159, + 64, 83,101,194,156,127,188, 12,142, 3,166, 62, 56, 6, 38,190,151,221,155,203,207,191, 4,142, 3, 18,135, 18, 0, 93, 0,244, +128, 78,111, 64,210, 3, 19, 33,246, 99,176,105,203, 62, 48, 12,144,254,221, 70,148, 22,254, 26,255, 80, 92,100,246,229,179,205, +115,113, 20,224, 56, 14, 28,199,193,100, 50, 65, 47,160, 48, 18, 35, 12, 6, 3, 52, 30, 58,128, 19,131,161, 38,152,132, 20,245, + 6, 29,212,202,186, 86,211, 22,236,165, 7,159, 47, 65, 96, 96, 32,122,247,238,141,208, 78,163, 0, 30, 3,147,233, 52, 24, 90, + 11,157,154,133,137, 83,163,252,102, 13,130, 3,171, 16,232, 23, 11,133,106,113, 92,115,155,188, 72,116, 44,168,190, 10,208,137, + 96, 96,140, 80, 11,249,168,151, 8,192, 23, 8, 1,206, 19,132, 71, 80,175,214, 64, 81,126, 29, 5,167,115, 80, 83, 92, 12,142, +227,192, 80,158, 75,133,230,171,181,191, 27,206, 79,205,123,202,126, 59,105,217,215,221, 90,116,210,210,210, 22,189,242,202, 43, +207, 20, 23, 23, 51,132,144, 96,153, 76,246, 29,204,155, 59,121,180,161, 44, 11,214,172, 89,179,229,214,173, 91, 72, 79, 79,199, +240,190,125,121,254,131, 7,183,185,130,164, 46, 92, 72, 20, 64, 28,165, 84,190,122,245,106, 57, 0, 72, 83, 82, 28,246, 74, 12, + 6,195,186,177,150,202, 36, 20, 10,209,167, 79, 31,108, 63,116, 40,211, 18, 13,112,152,231, 78,109, 85,187,104, 81, 50,201,202, + 42,164,167, 79,155, 35, 86, 54,255,127,189,247,222,123, 75, 23, 45, 74,246,117, 84,179, 60,141,236,246,193, 3, 7,250,240, 24, + 6,207, 62, 58, 7, 90,157, 30,171,190,252, 18, 30, 18, 9,116, 58, 29,116, 90, 45,134, 14,139,138,220,191,121,243,115,147,230, +204,249,200, 94,212,241,221, 5,207,115, 0,152, 43, 69, 69, 76, 83,193,111, 90, 61, 93,185,247,110,253,198,199,103,165,189, 78, + 39, 76,125, 58,158,138, 34, 93, 50, 4,108,119,237,163,219,252,237,158,183,107, 65,249,241,113,189,222,132,195, 19,130, 33,120, + 81, 6,229,156, 8,240,253, 67,156, 18,255,131, 7, 15,150,135,119,238,114,243,159,207, 62,211,237,245,151, 23, 98,245,134,117, + 23, 71, 70, 71,247, 92,247,233, 58,143,151, 22,190,138,205, 99, 70, 97,203,150, 45,143, 61,242,200, 35,155,218, 40,252,113, 59, +119,238,108,112,152, 44, 97,245, 23, 96,222, 42,221, 46, 14, 28, 56, 32, 15, 14, 14,198,176, 97,195, 88,134, 97,248,230,232, 44, + 7,129, 64,128,128,128, 0,116,234,212, 9,215,174, 93,195,129, 3, 7,228, 51,103,206,116,168,174, 72,165,210,228, 41, 83,166, +124,176,114,229,202, 79,251,246,237,187,150, 16,194, 1,248, 12,192, 36, 0, 71, 0,188, 75, 41, 45, 34,132,188, 10,224, 93, 71, +248, 86,206,159,255,253,216,228,100,178,107,215, 46,240,249,124,200,229,114,156, 63,127, 30,189,123,247,198,123,239,189,135, 65, +131, 6,225,153,103,158,225,191,249,230,155, 43, 91,244,252, 45,216,158,178,131, 2,128,135,135, 71,153,159,159, 31,196, 98, 49, +132, 66, 97,189,112, 25, 88,122,140,146,105,211,166, 97,217,178,101, 56,127,254, 60,182,110,221,122, 87,196,127,238,162,101,191, + 59, 58,203, 95,111,214, 8,104, 46, 2,192,240,121, 12,159,229,168,138,229, 76, 58,137,128,223,213, 75,200,244, 7,199, 2,145, +247, 2,157,122, 3,183,174,160,243,229,156,233,143,197, 70,132,103,156, 43, 19,215,108,149,102,152, 55,183,107,190, 14,243,120, + 86, 65,242, 1,208, 21,190, 97,125,113,253,114, 58,214,202, 54,128,209,123, 96, 98,124, 44,246, 29,204,129, 70, 3,120, 4,180, +220, 46, 73, 60,250, 66,171,185, 12,147,201,118,111,154,114, 0, 55,193,240,226,240,248, 19, 79,131, 19,169,241,227,238,175, 48, +245,193,167,224,225, 9,168,235,203, 44, 26,212, 60,140,224, 65, 96, 17,127, 35,107,130, 94,105,132,198,168, 65,173,132, 15,163, + 70, 0, 61,223, 8,158,145,128, 53,113, 80,106, 89,212,212,179, 45,170,217,121,249,114,218,179, 19, 1,143, 71, 64, 24, 17, 76, + 38, 10, 86, 83, 12,189,201,136,210,242, 58,212, 40,234, 81,167, 50,129,209,233,192,162, 28, 60,193, 57,116,233,174,196,168,232, + 24,249,119,223, 94,106,150,147, 7,128,170,116,208,170,110,194,116,171, 14,188, 94, 93,193, 48, 12, 76,172, 30,181,229, 69,184, +124, 34, 23,149,215,139, 45, 66,194, 7,195, 7,192,187, 59,221,128,214,144,255,250,245,235,245, 73, 73, 73,253,163,162,162, 88, +145, 72,164,254,224,131, 15, 70,194,188, 41, 81, 31,180,113,166,137, 48, 52,116, 1, 0,140, 30, 52, 8,161,161,161, 21,171, 87, +175,206, 2, 16, 63,108,240,224, 54, 71, 1,252,129,108,105, 74, 10, 17,132,132,196,173, 94,189, 90, 46, 8, 9,137,115, 38, 18, + 96, 20,137, 32,208,235,177,125,251,118,132,132,132, 96,198,196,137,214,104, 0,117,198, 8,184, 83,176,138,190, 76, 38,179,109, +248,112,248,240,225,176,209,163,147, 31, 68,203,219, 70,219, 98,132,159,191,127, 63, 30,195,224, 31, 73, 73,168,173, 83,162,178, +166, 26, 2, 1, 31,124,190,249, 37, 16, 8, 32,146,120,160, 87,120,248,135, 87, 79,157, 62,223,123,120,140,220, 30,233,149,162, + 34,124,187,253,127,183,121,252,214, 72,192,168,232, 33, 72,140,191,215,201, 59, 86,197, 1,222,217,125, 7, 39,102,247,237, 19, + 25,159,185,235, 75, 57,208, 49,250,254,243,190,254, 8,250,125, 27, 16,242,249, 25, 12,240,227,131,231, 19, 0, 86, 81,129,225, +123, 43,224,201, 39, 80,179, 20, 60, 59, 53,229,218,213,171,213,123,118,237,238,251,245,231, 95,227,147, 47, 63,187,190,238,131, +143,222, 14, 8, 12,168, 93,178,116,201,193, 77, 91, 54, 99,220,232, 88,124,155,182,245,235,110, 61,186,125, 61, 46,118,156, 75, +247,220, 84,252,119,237,218,133,174, 93,187,246, 58,121,242,228, 28,152,183, 26,183, 27,246, 55, 26,141,136,142,142,230, 88,150, +229,171, 84, 42,136,197, 98,112, 28,135,223,126,251, 13,249,249,249,240,242,242, 66, 76, 76, 12,202,203,203,145,155,155, 75,237, +117, 7, 72,165,210,217, 41, 41, 41, 43, 31,120,224, 1,175,181,107,215,250,124,252,241,199, 66,152,119, 45,205, 4, 16, 13,243, + 6,103, 31,193,188,157,251, 65,152,119, 60,109,149,111,231, 43,175,108, 30,208,191, 63, 89,157,148, 4,114,255,253,216,126,244, + 40, 87, 90, 90,186, 4,192,234, 27, 55,110, 76, 91,180,104,209,231, 63,252,240, 3, 98, 99, 99,225,233,233, 57,166, 37,174, 41, + 39,102, 96,199,142, 29, 88, 63,201, 92,199,252,252,228, 85,157, 58,117,130,151,151, 23,245,244,244,188, 97,120, 29, 32,211, 8, + 93,182,108, 25,172,134, 70, 99,253,186, 59,152,187,104, 89,131, 17,208, 72,236,155,158, 16,207,150, 85,254,124,181,114,221,198, + 35, 87, 95,254,173,180,238, 0, 3,202, 7, 40, 48,229, 61,252, 28,243, 1,254,171, 72,194,161,129, 43,128, 73,139,225, 45,224, +134, 61, 16, 21, 62,199,210, 93,112, 27,118, 29,170, 33,128, 18,211,158,120, 17, 28, 7, 0, 53, 48, 47,155,108, 68,143,190,209, + 16,139,248, 48,177,122, 80,131, 57, 44,226,237,237,141,234, 26, 69,139, 55,241,209,135,175, 16, 0,184,248,243,151, 96,152,198, + 78, 2,167,253, 21, 58,189, 17, 60,129, 24, 68,104,238, 67, 83, 41,149, 24, 51,102, 76,235,238, 8,103, 0,199,113, 96, 89, 22, +122,189, 30,245, 28,139, 58,131, 17,202, 50, 37,234,110,214, 65, 89, 94,131, 26,101, 45,202,117, 26, 40,213,181,168,213,183, 60, +214,201,219, 75, 13,150,229,160, 55,152, 80, 91,167, 68,254,213, 98,156, 56,157,135,159, 79,228,225,210,111, 5, 40,185, 81,133, +122,181, 1,170,122, 61,202, 74,235,112,225,215,107,200,205, 61,139,146,178,242, 22, 57,109,139, 10, 91,167, 70,201,185, 75,248, +101,239, 33,100,110,248, 16,135,182,110, 64, 73,193, 85,112,212, 8,142,144, 6,225,119,166,230,219, 11,243,219, 3,159,207, 7, +128, 91, 0,110,249,251,251,151,120,123,123,235, 23, 45, 90,116, 18,230, 1, 99, 12,204,107,101,231,187,202,191,102,205,154,212, +164,164, 36, 0, 64, 68,112,112,136,165, 79,156,215,158,149,195, 42,250,214, 72,128, 3,225,255, 4, 0, 88,181,106, 21,174,148, +149, 97,198,196,137,176, 70, 3,242,242,242, 0, 0, 59,228,114,234,104, 86, 44,120,251,109,188,250,206, 59, 13,225,125,235,123, +235,177,245,189, 35,225,127, 43,178,178, 10,105, 83,241,183, 61,206,202, 42,252,214, 17, 30, 63, 62,255,191, 58,131, 30, 60, 30, + 15,191, 21, 22,160,176,228, 6,142,159, 59, 15,131,193, 8, 6, 4,124, 62, 31,132, 16,112, 38, 19,180,106, 13,242, 14,103, 31, +114,128,150,177, 21,255, 71,103, 62,120,155,199,127,252, 76, 30,108, 35, 4,142,193, 38,156, 44,138,204,182, 10,127, 86,218,235, + 84,192, 94,137,251, 67, 45,128,154, 50, 8,187,247, 65,197,115,247, 32,239,235,143,192, 15,234,220,240, 81,197,115,247, 32, 72, +204,192,135,223,122,113,233, 27,217,183,139,135,135,167,199, 39, 95,172,209,197,223,123,175,112,212,152,209,155,175, 93,189,198, +253,118, 53, 31,224, 40,196, 34, 17, 98, 99, 98,177,123,215,110,236,220,185,211, 41, 47, 96,223,190,125,113, 82,169,148, 90,197, +255,192,129, 3, 88,183,110,157, 1, 0, 78,156, 56, 97,144, 74,165,143, 56,210,181, 80, 84, 84, 4,203,214,196, 76, 81, 81, 17, + 50, 51, 51,145,151,151, 7,181, 90, 13,133, 66,129, 83,167, 78,161,184,184, 24, 55,110,220, 64,143, 30, 61, 80, 84, 84,212, 42, +223,188,121,243, 30,127,248,225,135,223,143,139,139,243, 58,121,242,164,143, 70,163,249,167, 68, 34,201, 6,240,169, 76, 38, 91, + 44,147,201,234, 0,252, 15,192, 8, 66,136,144, 82,106,108,205,233,152, 63,127,254,227, 63, 44, 88,176, 57, 54, 36,132,176, 11, + 23, 98,140,193,128,147,187,118,209,210,210,210,167,101, 50,217,219, 50,153,172, 18,192,198,139, 23, 47,178, 44,203,194,203,203, + 11, 97, 97, 97, 94, 70,163,177, 89,241,159, 52,105, 18,100, 50, 25,164, 82, 41,164, 82,169, 71,105,105,105,223, 27, 55,110, 64, +173, 86, 19,133, 66,209,159,207,231, 79,176, 21,127,185, 92,142, 7, 31,124, 16, 29, 5,205,117, 1,132, 2,232, 53,125,120,247, +103,187, 5,122,206,129, 81, 11,244,157,128, 51,193,211,113,223,252,175,160,173,170, 5,207,199, 27,242,143, 31,199,184, 1, 63, + 35, 32, 47,115, 60,128,238, 45,253, 64,111,159,174,248, 37,111,135,141,189,161,182,116, 19, 26, 1,163, 30,124,142, 7,198, 82, +239,119,254, 96,238,110,138,157,156,210,114, 65,189, 64,241,192, 48,219,109, 16,137,229, 54, 4,128, 64, 12,150,152,192, 89,218, +221, 89,115, 94, 0, 0,249,245, 99,235, 91,172, 89, 38,142,130,229, 24, 48, 44, 11,198,160,135,198, 98, 89,104,121, 60,120,178, + 90, 40,181, 20, 68, 64, 96, 50,153,160, 49, 1, 21,106, 3, 90,234,204,102, 13, 28,116, 2, 30, 56, 13, 11,150,171,131,170,222, + 8, 30, 17, 64,207, 26, 97,160, 6,176, 70, 3, 32,228,192, 16,128,136, 56,212,105, 77, 40,175,212, 64,173,103,155, 13,198, 48, +196,212, 96, 0, 16,242,187,158, 24,117, 90,212,213,212,128, 33, 60,240,249, 20,160,124,240,136,235, 29,127,151,175, 95, 54,244, +237,209, 87,232, 72,216,191, 81,152,148, 16, 72, 36, 18, 0,208, 2, 48,240,249,124, 20, 22, 22, 98,249,242,229, 15, 2,184,177, +104,209,162, 97,190,190,190,126,117,117,117,215,107,107,107,157, 14,119, 11, 67, 67,159, 2,128, 78,157, 58,217, 86,224,218, 79, + 63,253, 52, 11, 64,194,176,193,131, 15,182, 87, 69,152, 63,127,126,188, 35, 6,192,143, 57, 57,113, 35, 71,142, 12,150, 42,201, +129, 0, 0, 32, 0, 73, 68, 65, 84, 27, 27, 21, 5,226,237,141,229,203,151, 99,225,194,133, 16, 8, 4, 48, 42, 20,240,245,245, +197,235,243,231, 55,140, 11,112,100,112, 96,211, 62,126,123, 99, 2, 90,194,114, 39, 6,119,158, 62,125, 26,167, 79,159,110,184, +190,165, 62, 78, 69, 77, 77, 63, 47,111,111, 84, 41, 20,144, 31, 63, 14, 62,195,131,222,104,132, 70,171, 5,199,113, 13,131, 21, + 89,163, 1, 6,189,222,145, 60,230, 0, 48,150,110, 0,206,166,224,235, 44,231,241,246,170, 79,133, 0, 16, 25, 30, 94,113,237, +226, 47,109,202,215,132,228,101,228,183, 51,233,113,123,119,126, 41,111,143, 72,128, 51, 97,255, 70, 97,217,109,159, 35,234,137, +151, 33,138, 24, 98,110, 43,170,202,144, 95, 99,222, 68, 78, 52,102, 10,138, 77, 44, 60, 86, 31,111,149, 67,169, 84,250,137, 36, + 98,244,142,136, 16, 95, 43,185,209,185,186,178, 26,179, 30,157, 35,223,115, 48, 19, 31, 47, 91,149,190,115,207,174,164,200,136, + 72, 60, 62,243, 49,228,158,201,193,206,237,219,233,116, 7, 66,236,182, 94,255,129, 3, 7, 48, 97,194, 4,171,177, 40,188,121, +243, 38,158,121,230, 25,161,245,246,237,113, 85, 87, 87, 99,220,184,113, 48,153, 76, 40, 42, 42, 66, 78, 78, 14, 6, 12, 24, 0, + 95, 95, 95,116,235,214, 13, 81, 81, 81, 96, 24, 6, 12,195,160,115,231,206, 13, 81,170, 22, 60,245, 1, 67,134, 12,249,104,204, +152, 49,188,188,188, 60, 31,147,201, 84,190,125,251,118,165, 86,171, 93, 46,147,201,108, 13,216,103, 39, 79,158, 92,188,103,207, +158, 8, 66, 72, 25, 90,216,209, 86, 42,149, 14,155, 31, 31,191,113, 20,159, 79, 42,151, 46, 5, 53, 26, 33,231,241,184, 92,141, +230, 73,153, 76,246,141,173,221,241,214, 91,111,241, 25,134, 65, 77, 77, 13, 10, 11, 11, 43, 6, 13, 26, 20,210,148,111,210,164, + 73,183,253, 70, 88, 88, 88,128,137, 82,104, 53, 26, 92,188,120, 17, 44,203,146,142, 42,254,183, 25, 0,186,173,210,200, 80, 95, +201,216,201, 67,195,158,241,145, 8, 70,178, 38, 78,193,167, 38, 31,248,117,230,149,213,234,160,173,170, 3,132,124,152,106, 85, + 40, 81, 24,128,192,238, 96, 56,131, 24,173,204, 38,184,170, 84,162,143,159, 15, 88, 61,112, 53,251, 91,244,142,155,212,224,192, + 25, 13, 70, 8,192,160, 94,103,222,161,246,129,184,104, 72, 2,195, 90, 77,240, 3,131, 9,246,156,167, 16,136, 1, 97,247, 73, + 48, 20, 31,109,112, 28, 4, 66, 17,140,208,193, 75, 98,222,145,116,215,158,173,248,229, 68,118,252,156,137, 49, 45,183, 70, 28, + 7,161, 65, 11, 35,132, 96, 24, 22,208,153, 27, 54,163,209, 8,189, 78, 0, 30, 95, 0,232, 0,202,153,187, 8,122,132, 71,180, +200,165,209,113,224,241, 8,140,172, 17, 58, 61, 7,165,202, 92, 14,141, 28,133, 65,207, 1,124,128, 39,224,129, 47, 6,136,214, + 4,142,176,224,160,133, 74,107, 9, 72,219,129, 9, 0,195, 1,148, 0, 12,195,129, 16, 30, 56, 74,192, 48,150,177, 84, 28, 3, +142, 97, 64, 56,199, 28,100, 27,239, 95,232,106, 1,242,240,240,128,197,219, 15, 46, 44, 44,172, 88,190,124,121, 60,128,135, 22, + 45, 90, 52,177,103,207,158,106,149, 74, 85,205,178,108,131, 80, 56,163,255,107,214,172,249, 50, 41, 41, 9,225, 65, 65, 13, 39, +195,131,130,252, 44, 81,128,224, 63,162,194, 24, 12, 6,185,213,219,167, 42, 21,254,253,239,127, 67, 95, 93,221, 48,242,173,183, +197, 88, 17,232,245,120,240,193, 7, 43, 74, 43, 42, 30, 9,243,240,216,124, 55,210,102, 59,168,207,182,255,191, 57,196,196,196, + 32, 33,161,103,195,245,205,173, 3, 0, 0,172,222,128, 90, 67, 13,116, 58, 29,252,124,125, 33, 22,138, 96, 52,177,160,148,194, +100, 50,193, 96, 48,192,104, 52,130, 99, 77,142,230, 47,119,165,168,136,137, 12, 15,183,122, 4,220,149,162, 34,230,219,237,255, + 19,219, 70, 4, 34,195,195,107,209, 78,131,217,250, 69, 39,101,151, 20,156,106,151,103,236,234, 24,128,123, 51, 43, 81, 17,158, + 14, 97,247, 62, 32, 17, 67,208, 99,195, 89, 84,233, 56,120,242, 9, 12, 63,253,128,203,133,215,236,238,159,167,101, 13, 56,157, +123, 2, 31,173,252, 16,247,196,141,197, 91,255,239, 29,236,223,187, 31,155, 55,125,131, 49,227,199, 38,117, 11,239, 14,190,135, + 0, 7,143, 30,196,150,175,191,193,142, 31,182, 99,247,238,221,244,255,254,239,255, 72, 43, 34, 75,155, 10,191, 21,181,181,206, +111,112,167, 82,169,224,235,235,123, 28,192,168,240,240,112,196,196,196,128,199,227,129,227, 56,244,232,209, 3, 34,145, 8,117, +117,117, 8, 15, 15,135,183,183,247,117,149, 74,213,163, 37, 46,153, 76,118, 81, 42,149,166,238,216,177, 35, 49, 50, 50,178,223, +246,237,219,235, 21, 10,197,187, 50,153,108,139, 77,250,167,223,123,239,189,175,108,216,176, 97, 27,128, 10, 0,201, 0,126, 6, + 48,180, 25,190,179, 82,169, 52,213,239,212,169, 55, 30,102, 89,124, 8,112, 95,214,215, 63,214,132,239,161, 23, 94,120,225,195, +185,115,231,226,218,181,107,216,189,123, 55, 88,150, 61, 4,224,225,214,238,219, 18, 5, 96,252,120,188,106, 47,131, 1,234,179, +103,105, 48,199,169,174, 2,170,187, 45,254, 81, 81, 81, 56,119,238, 92,179, 33,127,123, 93, 0, 61,167, 15,239,190,196, 71, 34, + 24, 89,169,212,237, 63,118,165,114, 57,120, 34,224,242, 81,220, 31, 78,177,248,249, 7, 17, 51, 48, 28, 47, 72, 39, 99,106, 47, + 3,112,225, 0,168, 64,194,162,213,193, 58,181,200,175, 45, 6, 95, 4, 60, 48,245,101,108,249,100, 25, 0, 3,160,209,195,164, + 5,126,144,159, 67,214, 73,243,140,194,174,221, 35,192,240,237,139, 87,226, 80, 2,163, 14,216,181,123, 31,134, 79,124,222,236, +253, 67, 0,158, 4, 72,153,146,140,196,241,211, 0, 0, 37,215, 11,192,234, 12,173, 91,244,148,130, 37,102,129,215, 27,204,131, +255,244, 58, 45, 52, 26, 13,234,235,235,161, 82,214, 65,165, 82, 65,169,170,135,174,190, 30, 90,173,182,229,194, 95, 79,160,213, +153,160,213,153,160,214, 24,161,170,215, 67,161,210,163, 86,105, 64,157,202,136,218, 90,243,255,154,106, 22, 53, 10, 22, 53,117, + 44,170,106, 12,184, 85,213,114, 26, 25, 74, 97, 2, 64, 76, 4,132,225, 64, 9, 5, 40, 5,165, 60,152,184,223,179,143,179,180, + 30,206,198,198,251,143,233,143,156, 61, 57,216,127,104,127,131, 81,112,249,250,101,135,190,203,227,241,192, 55,231, 87, 24,128, + 94, 43, 86,172, 56, 15, 96,245,235,175,191,254, 82,207,158, 61, 89,115,144,192,156, 48, 39,197,159, 8, 67, 67,119, 2, 64,104, +104,232,109, 31, 62,247,220,115,236,169,203,151,183,158,189,112,161,221,194,186,171, 87,175,150, 59,186,111,188,209,102,138,197, +247,223,127,143,171,229,230, 46,156, 31,179,179, 27,125,118,249,242,229,144,224,224, 96,197, 31, 97,168, 36, 36,244,100, 44, 13, + 90,211, 6,191,209,231,118, 13, 60, 31,239,223, 56,147, 9,202, 26, 5,170,170,170, 80, 93,171,128, 90,163,129, 90,163,129,170, +190, 30,234, 58, 37, 84,181,255,159,189, 43,143,111,162,218,254,223, 59, 89,154,182, 64, 23,118,202, 90,164,236,178, 20,161, 5, +129, 4, 82,168, 34, 42, 74, 1,225,137,125, 5,155,226, 6, 34, 62, 84, 84,220, 80,121, 63, 11,184,210,212, 39,130,239,129, 64, +139, 11,155, 44,129,164,178,180,212,130, 11,139, 64,161,208, 66, 89, 10, 77,186, 37,105,182,185,191, 63,146, 9,105, 73,147, 73, + 90, 4, 53,223,207,167,144, 89,114, 50,115,231,206,253,158,115,238,185,231, 84,160,214,104,128,185,182, 22,172,213,235,252, 38, +211,163,107, 87,110,204, 96, 1,152, 93,167, 3, 0,224,127,155,182, 96,113,250,199,225, 0,218,250,122,223,191, 31,201,150,170, +178, 94,170,211,217,206, 30,255,225,246,186,255, 1, 92,158,218, 21, 93,190,252, 25,164,219,221, 48,229,100,163,248,159,131, 16, + 42, 36,216,151,208, 26,214,202,107, 24,178,163, 12, 94,102, 0, 48,121,242,100,242,228,220, 57, 56,115,234, 20,114, 53,251, 16, +214, 60, 12,143, 77,125, 12,225, 45, 35,113, 36,191, 0,205,196, 18,132,134,134,162,125,215, 14,248,122,253,215,120,105,209, 43, +168,169,240,191, 74,237,224,193,131,125,254, 78,243,230,205, 81, 89, 89, 57,140, 97, 24,115,167, 78,157, 48,116,232, 80,244,237, +219, 23,173, 90,181,130, 68, 34, 65,215,174, 93, 49, 96,192, 0,132,135,135,163,186,186,186, 75,243,230,205,225,133, 88,255, 47, + 39, 39,103,247, 87, 95,125, 37,210,233,116,175,214, 35,235,164,145, 35, 71,174,248,242,203, 47, 87,181,109,219,246, 93, 66, 72, + 51, 0, 47, 1, 88,236, 65,222,162,119,170,171,255,111,150,213,106,251,194,104,156, 94, 79,222,228,105,138,215,191,121,118,222, + 11,130, 83,167, 78,225,208,161, 67,248,242,203, 47,107, 0,188,204,243,246,153, 16,147, 73, 66,127,255, 29,157, 84, 42, 18, 85, + 90, 42, 0, 64,151, 45, 91,134,173, 91,183,254,161,253,173,190, 71,175, 33, 15, 95,253, 65, 32, 72,192,144,230, 37,229,250,181, + 95,231,158,123,249,151, 98,109,190,209, 70,206,224,250, 57, 72,190,121, 10,239,142,168, 70,193,155, 67,241,161,172, 6,161,223, + 61, 13,104, 47,162,134, 74,142, 58, 52,175, 6,112, 35,170,255,215,223,182,224,245,215,191,194, 93, 45,250,227,248,193, 95,177, + 75,253, 59,100,241,125,145, 48,210,222,209,168, 64, 8,179, 15,241, 17,137,131,122,225,157,255,123, 31, 59,142, 86,161, 89,215, + 62,120,224,129,137,216,185,247, 91,108,219,105,143,178,100,108, 22, 4,137, 60,143,115,148,181,193,198,218,173, 25, 56,172, 25, +179,217,140,218,218, 90, 24,141, 70,232, 13, 70, 24, 13,122, 24, 13,122, 24, 76,181, 48,155,106, 27,118,127, 25,155,163,178,198, +134, 42, 35,139, 42, 35,107,255, 92,205,162, 70,111, 69,141,193, 10,157,214,134,114,173, 5,229, 58, 11,202,203, 45,184,126,221, +140,171,215, 45, 30, 21,128, 27,238,127,151,107,230,220, 55, 2, 10, 1, 33,160,245,162,254, 41,241, 78,182, 47,206,124, 17,189, +227,123, 59,183, 85,171, 85, 78,143,192,129,237, 7,112,170,248, 20,175,100, 79, 44,107,255,173,236,236,236,253,148,210,126,147, + 39, 79,158,217,173, 91,183,214, 0, 24,150,101,131, 44, 22, 75,132,213,106,109,225, 70, 1, 96, 61,184,254, 23,127,250,233,167, +247, 79,158, 60, 25,221, 90,183,230, 53,117,213, 24,136,218,180,145, 2,192,144, 94,189,100,222,206,237,209,174,157, 44, 61, 61, + 29,199,139,139,171,190,217,181, 11, 39, 79,158,116, 90,253, 61,123,246,132,227,152,249,155, 93,187, 80, 92, 92,140, 83, 5, 5, + 70,111, 50,111, 69, 12, 0, 0, 58,122,244,232,167, 92, 73,159,251, 63, 54, 54,150,151, 59, 23, 0, 10, 79,158, 45,176, 90,173, + 48,155, 77,208, 94, 45,195,181,203, 87,112,253,202, 85, 92,191,114, 21,218,178,107,168, 40, 47,135, 73,175,183,199,207, 84, 84, + 96,144, 92,238,173, 13,173,139,211, 63, 22, 46, 78,255, 88, 8,160, 10, 0, 59,108,240,221, 55,157,228, 18, 23,192, 27, 39,142, +100, 75, 75,207, 22,168, 7, 12,189,113, 13,231,206, 28,148, 86, 92, 43, 82, 55,166,127,144, 41,186, 58,150,191, 63, 56,173,213, +163,100,246, 61,160,231,126, 67,155,207,143, 32,116,229, 97, 92,158,218, 21,177, 59,202, 64, 68, 65, 16, 18, 64,200,120, 87, 64, +159,126,230, 25,242,218,251,239,224,185, 5,243, 97, 97,109, 56,121,190, 16, 51, 30,155, 14,177, 68,130,239,191,219, 12, 88,108, + 48,213,154,176,175,224, 32,140,198, 26,164, 38, 39,231, 20, 20, 20, 80, 15,132, 72, 38, 77,154, 36, 27, 55,110, 28, 8, 33,216, +189,123,247, 77, 46,253, 23, 95,228, 31, 39,212,178,101, 75, 92,186,116, 9, 0,132, 25, 25, 25,184,118,237, 26,250,247,239,143, +240,240,112, 48, 12,131,252,252,124, 48, 12, 3, 66, 8, 46, 93,186,132,150, 45, 91,122,149,169, 84, 42,223, 53,155,205,163,148, + 74,229, 6, 23,178,126,108,228,200,145,233,179,103,207,142,200,200,200,144, 16, 66, 24, 0,223, 2, 88,160, 84, 42,175,122,145, +247,175, 67, 22,203,144,250,242,166, 45,252,102,227,163,211,159, 38,247,207,201,128,230,208, 9,164,167,167,179, 85, 85, 85, 41, + 74,165,242, 60,143, 41, 68, 0, 96,239,106,222, 60,188,211,149, 43,184,215, 96, 64,123,145, 40, 52, 84, 32, 96, 74, 75, 75,111, +138,197,249,163,148, 0,238,143,215, 20, 0,128,179, 95, 31, 60,247,140, 86,111, 58, 12,123,224, 86,251,220,194,107,153,163,122, +181, 93, 36, 60,119, 40, 18, 95, 62, 14, 4,133, 2, 38, 61, 64, 41, 44, 2,201,213,125,199, 47,127, 1,160,193,236, 75,235,214, +126, 38,155, 62, 99,166, 26, 0,244,172, 5,103, 42, 74, 0,216,112, 87,139,110,144,201,238, 70,219, 86,237, 80, 94, 89,101,247, + 21,152,173,184, 92,161, 71,111, 15, 55,213,177,115, 60, 46,150,228, 58,222, 76, 33, 18, 7,216, 99, 0,118, 28,181, 96,231,214, +108, 92,189,126, 9, 45,195,237, 43, 9,194,197, 34,220, 61,196,243,122, 80, 51,132, 16,179, 86,216, 32, 0, 75, 8, 24, 27, 11, + 88,172,176,137,132, 0, 97,192,189,147, 44,133, 61, 87,128, 7, 60, 60,237, 37,242,221,127, 23,208, 16, 49,133, 80,228,226, 97, +176, 0, 86, 10,212,154, 1,155,201, 6, 66, 8,136,152,192,106, 3,244, 38, 96, 86,242,191,137,187, 84,142, 54, 23, 13,141,101, + 88, 16,135,251,223,174, 20, 16,216, 88, 6,140,192,110,245, 51, 0,168,128, 2,148,159, 23,192,149,252,221,109, 31,216,126,160, +155,215, 41, 9,155, 13, 38,147, 9,147, 39, 79,238,155,157,157,189, 28,192,192,236,236,236, 29,217,217,217,251, 38, 79,158,252, + 76,247,238,221, 45,132,144,150, 31,126,248,225,174,151, 94,122,105,134, 86,171,205,241,160,124, 58,251,228,130, 5, 11, 22, 47, + 88,176, 0, 59,118,236,128,254,234,205,239,114,183,214,173,113,238,220, 57, 0, 80,243, 73, 12,212, 80,210, 31, 81,155, 54,210, + 79, 63,253, 84, 77, 41,197,144,158, 61,101,131,121,172, 44,232,223,187,183,134, 48,204,248,147, 63,253,212, 21, 64, 16,128,143, +184,213, 0, 61,218,183,199,252,249,243,113,224,192,129,165, 49, 49, 49, 57,253,162,162,188,198, 40,184,203, 3,224,111, 12,128, + 43,184, 60, 0,113,113, 73, 63,229,229,149, 29, 80, 40, 20, 98,199, 52,193,112, 0,185,124,147, 0,117, 29,208,231, 21,227,229, + 43,227, 88,171,173,151,190,178, 18,149,215,175,129, 16, 6,148,178,168,173,173, 5,165, 20,148, 82,156, 59,241, 59, 44,102, 19, +238, 26, 18,235,173, 13, 93,199,156,112, 0,204,253,178,209,236,253,178,209,117,130,254, 28, 83, 4,188,113,242,151,111,164,151, +206, 22,168, 1,160,107,151, 46,248,190,158, 23,160,117,231,193, 50,220, 70, 12,249,161, 12, 5,247, 1, 3, 99,229, 40,123,122, + 56,218,125,118, 16,167,181,122, 68,136, 9,202,181, 58, 8, 9,241,234, 1,224, 48,115,230,204, 58,103,110,217,178,133,222, 63, +225, 62,108,221,188, 21, 27, 55,110,196, 27,139, 94,195, 46,205, 30, 8,132, 2, 68,117,140, 26, 93, 89,233,121,233,114, 98, 98, +162, 38, 49, 49,145,236,216,177, 67, 58,110,220,184, 58,177, 0,187,119,239,198,153, 51,103,106,149, 74,101,123, 62,215,214,181, +107, 87, 20, 21, 21,161, 79,159, 62,214,121,243,230,137,215,175, 95,143,176,176, 48,156, 60,121,242, 38,207,107, 81, 81, 17,186, +242,124,206, 74,229,141,196,115, 10,133,226,241,123,238,185,231,173,199, 30,123, 44,172,160,160,160,121,109,109,237, 63,131,131, +131, 31, 48, 26,141, 31, 40,149,202,239,121,202,251,197, 85,222, 3,207,174, 95,115,239,216, 73,228,223, 42,128,116,120, 16,239, +174,120,133,106, 11, 79,166, 40,149,202, 44,111,178, 92,188,108,164,218, 98,169, 16, 7, 5,161,133, 88,140, 96,155,205,164,183, +217,108,183,131,252,249,162,142, 2, 32,121, 76,121, 92,251,181,226,180,228, 49, 37, 55,165, 89,114,236,107,197, 15,213,181, 86, +253,176,187, 90,221, 31, 25, 34,184, 71, 96,170, 13,181, 82,166,186,188,218,156,151,123,230,202,206, 82,173, 33, 71,242,152,242, + 50, 86,174,116,251, 3, 53,250,214,154,180,167,231,200, 0,168, 89, 1, 55,205, 39,192,153,170,203,120,253,153, 20, 24, 12, 38, + 84, 25,237, 49, 0,102, 38, 8, 99, 18, 61,167,217,125,109, 81, 50,217,177,109,136,253,229,182,113,150,179, 21,137,253, 9,166, + 61,181, 12, 33, 33, 65,104, 17, 44,145, 1, 80, 23, 30, 59, 34,139,239,231, 57, 33,136,144, 90, 97, 38,118, 37, 0,132,192, 70, +169, 93, 17,224, 18, 54, 16, 6, 66,150,133,149, 91,118,224, 69, 9,168, 48,134,195,104, 42,135, 88,200, 56,211,156, 89, 89,192, + 98,161,176, 88, 41,106,140, 44,136,128,192, 6, 2, 11,123,195,117,239,150, 96, 89, 6, 12,177,129,216, 8, 40, 67,157,238,127, +210,128,241,204, 73,122,238,121, 25, 89,185,242,164, 71, 11,239,247,220,223, 27,219,119,204,148, 82, 24,141, 70,244,239,223,255, +114,116,116,244,164,243,231,207,247,216,184,113, 99, 62,128,135,178,179,179, 31,114, 61,249,253,247,223,215,188,244,210, 75, 50, +173, 86,235,141, 32,156, 13,146,150,150,214,224, 73,143, 62,241, 4, 0,223, 18, 3,113, 89,247,234, 99,104,239,222, 62, 45, 43, +236,215,179,231, 46, 87, 79, 70,122,122,250, 39, 19, 39, 78,180,158, 58,117, 74, 88, 92, 92,140,174, 45, 91,230, 70,133,132,240, + 10, 80,188, 21,121, 0,234,145,251,213,156,156, 28,215, 24,143,163, 14, 69,128,111,198, 64,125,112,251,118,143,158,220,179, 55, + 55, 60, 52,180, 69,149,174, 2, 86,171, 21,212,241, 30,232,174,150,161, 74,167, 3,165,148,143,245,111,127, 89,111,196,156, 48, +142,229,128,140, 99,217,159, 51, 49, 80,225,249,243,252,149, 0,195,175,210,139,133,249, 78, 43,255,251, 44,251,242,191,214,209, + 35,100, 3, 98, 39,106,110,223,240, 74,111, 86, 2,240, 57, 6,166,189,142, 43, 44,139, 1,171,243,145,159,216, 22,125,183, 94, +133,144, 0,205, 69,254,173,152,157, 56,113, 34,217,171,217, 75,199, 36,140,197,230, 77,223,225,237,165,239, 99, 97,101, 37, 40, +203, 98,195,134, 77, 40, 45, 45,125, 0,128, 87, 31,180, 59, 69, 0, 0, 38, 77,154,244, 11,128,106, 62,215, 18, 31, 31, 79, 46, + 93,186, 68,143, 28, 57, 34, 30, 60,120, 48,198,142, 29, 11,181, 90,141,206,157, 59,195,100, 50, 97,244,232,209,160,148,178, 71, +142, 28, 97, 68, 34,145,207, 25, 1, 21, 10, 69,159,176,176,176,229, 83,167, 78, 21,157, 56,113,162,133,201,100,106, 40, 48,144, +175,188, 65, 81, 3,167,172, 25, 56,106, 42,249, 34, 7,168, 50, 2,230,115, 59, 88,109,161,186,126, 96,160, 39,101,130, 83, 2, +132,218,202, 74,171,216, 98,129, 65, 44,134,208,158,245,135,253,163,123, 29,151, 7,192,213,242,119,183,207,173, 43,213,133,252, +185,237,223,139,191, 86,148, 20, 95,175,201, 5,208,222,241,242,154, 0,148, 2, 40,146, 60,166,244,234,226, 28, 60,224, 65,205, +241,223, 74,100, 54,218, 76,237,250,114,212,232,171, 32, 16,134, 1, 76, 8,254,245, 1,255, 20,147,137, 19,250,145,119,230, 60, + 32, 5, 99, 80,187, 54,111,179,102, 97,176, 89,116, 0,213,163,248, 96, 38,153, 57, 45,209,171, 44, 11, 4, 0,165,118,162,134, + 0, 98,234, 80, 4, 28,228,111,207, 1, 8,128,231,218,205,228,212, 87, 73,230,199,111, 80,171, 69, 11,161, 99, 97, 47,165, 20, + 54, 43, 69,173, 5,168,170,182,194, 2, 10, 43,101, 32, 20, 17, 44,121,235,147, 6,239,123,246,108,123,144,214,154,213,103, 40, +177,216,173,127, 10,128, 82, 2, 80,135,197, 64, 5, 32, 2, 22, 44, 43,196, 11, 11,198,241,106,195,217,111,207,150,157, 63,123, +222, 19, 1,139, 96, 95,170,225,137,157, 88, 0, 48,153, 76,208,233,116,186,176,176, 48,196,198,198,254, 58,116,232,208,160,107, +215,174,225,236,217,179,246,229, 97, 44, 43,221,180,105,147,218,161, 4,168,121, 40, 1,150,164,196,196,164,174,253,251,219,238, +233,213, 75,239,232,163, 38,212, 93, 17,137,164, 68,251,179,237,202, 35, 41,208,139, 47,190, 40, 3,128, 33, 61,123,222,116, 44, +118,192,128, 70, 17, 68,255,222,189, 63, 99, 24,198,118,242,167,159, 66,219,182,109,123,189,223,240,225,107,110,167, 70,239,134, +212,245,177,177,177,174,209,214,206,117,172, 62, 40, 1, 39, 6,141, 29, 51,108,243,127,190,216, 20,221,173,107, 31,147,169, 22, + 54,139, 21, 44,203,162,121, 68, 4, 42,181, 90, 12,146,203,101, 60,172,127, 0,168,120,243,133,103,219, 0, 48, 23,158, 63, 47, +230,230,255, 15, 29,249, 13,247,203, 70,179,139,211, 63,246,150, 28,200,137,152,246, 58,122,242,212, 73,217,222,157,223,215,113, +241,143, 25,255,144,140,105, 17,223,168,231,218, 80,128,159,251,253,252, 57,108,200, 15,101,192, 15,207, 56,183,239,250,254,198, + 18,224, 74,139,255,235,195,199, 72,199,144,175, 74,190,186,111,220,132,196,237, 79, 62, 62,107,255,221, 3,250,223,187,249,251, + 45,200,253,229, 48, 82, 83, 83,183,173,108,192, 64,243,162, 8,204,250,246,219,111,255,243,237,183,223,198, 37, 38, 38,242,190, +184,113,227,198,141,217,181,107,215,222,173, 91,183, 34, 58, 58, 26, 9, 9, 9, 8, 11, 11, 59, 93, 89, 89, 25,115,252,248,113, + 20, 21, 21, 49, 34,145, 8,227,198,141,147,251,122,159,142,192,192,165, 91,182,108,105, 48, 48,208, 71,121, 63, 43, 20,138,247, +190,203,126,240, 21, 99,212, 12, 24,127,122,149,189,180,111,201,227,190,202,115, 40, 1,181,197,101,101,162, 23, 78,159,190,104, + 51, 24,152, 95, 25, 70,212, 78, 32,184,162, 80, 40,110,203, 20,128,187,108,128,222,166, 0,220, 66,242,152, 82, 15,224, 55,199, +159, 95,120,252,241,103, 52,105,105, 47,201, 50,148,111,171,163,186,244, 0, 96,130, 40, 72,130,139,151,171, 48,122,226, 76,226, +187,188, 7, 53,119,245,138,193,234, 85,223, 0,108, 49, 0, 33,172,181, 70, 68,181, 15,147,117,110, 97,229,255,242,219, 88, 8, + 25, 22, 22, 34,132,136, 90,111, 40, 2,176, 2,212, 6,190,129, 97,174, 72,125,246, 13, 2, 0,139, 95,158, 67, 69, 66,187,181, +111,101,237, 46,243,138,106, 10,155, 21, 16, 8, 89,124,246, 41, 63,165,231,137,100,123,106,228, 85, 95,156,162,224,114,194, 51, + 0, 75,236,238,254,249, 11, 30,240,233, 34, 43,107, 42, 53, 17,109, 35, 26,219,191, 24,192,190,138,194,104, 52,194,102,179,161, +170,170, 10, 2,129, 0, 54,155, 13,237,218,181,131,197, 98,129, 82,169, 84,215,243, 4,168,189,213, 12, 24,212,191,127, 54, 0, + 52, 69,198, 63, 0,136, 36, 68, 3, 0,145, 3, 6,220, 18, 51,175,111,207,158, 25,141, 17,240,194,226,197,117, 86, 73, 44,120, +227,141, 58,158, 1, 95,230,254,221,144,185,222,211,106, 0, 31,210, 1,159,124,112,246,172,126, 0, 4, 39,115,114, 44,181, 6, + 35, 88,155, 13,189, 99, 99,101,237, 99,250,160,235,128, 62,252,222, 57, 74,166,238,252, 97,155,115,115,120,159,104,231,231,157, + 63,108,187,105,219, 83,104,252,233,203, 17,132,105, 17,143,177,227,137,236,196,201,179,184, 92,124, 84, 13, 0,123,119,126,175, +110,219,249,172,172,255,176,127,248,172, 4, 76,153, 50, 5,190,166,247,181, 17,207,121,183, 75, 38,181,195, 15,151,106,111,249, +128, 63,115,230,204, 31, 0, 48, 5, 5, 5,236,158,188, 28,180,108,213, 18,141,169,207,145,152,152,248, 69, 98, 98,226, 87,240, +158,222,185, 14,154, 55,111,174,126,244,209, 71, 73,110,110, 46, 61,123,246, 44,242,243,243, 81, 93, 93, 29,211, 20,181, 0, 28, +100,251,127, 10,133, 66,148,155,155,219,223,108, 54,191,234, 58,151,239,167,188, 69, 10,197, 63, 68, 97,221,191,154, 95,121,118, +215,140, 70,200,179,174, 63,116,232, 1, 0, 9, 0,126, 6,203, 86, 3,184, 58,109,225, 55, 72, 13,123, 4,153,149,127,140, 18, +192,173, 2,112,183,223, 47, 5,192,215,169,132, 6, 93, 85,143, 60,161,217,182,243, 12,121,120, 66, 8,109, 19,213, 9,218,106, + 43, 70, 79,120,220,239,142, 16,127, 79, 47, 18,127,207, 43, 80, 40, 94,167,192, 85, 68, 52, 23,162,115, 36,235,211, 75, 63,228, +159, 11,110, 89,150,176, 55,223, 91, 73, 0, 96,238,188,103,168,217,104, 1, 11,251,178,185,229,159, 46,247,235, 55, 83,102,217, +107, 6,172,250,207, 73,202, 82, 1, 94,126,233,161,219,153,225, 76,236,234,198, 54,153, 76, 48,155,205, 78, 34,227, 8, 44, 80, + 37,208,139, 11,210,135,244,195,126,194,188,112, 97, 82,144,195,131,210,216, 20,100, 20,128,181,215,232,209,117,174,185,107,251, +118,188, 5, 4,177, 38,205, 19, 19,125, 54,252, 80,191, 20,112, 29,251,187, 69,156,166,239,208, 56,244, 29,138, 70,183,165,183, +194, 62,245,117, 96, 43, 9,130,145,241,188, 34,245,108,181, 21, 49,205,249, 12,145, 77,210, 21,232,144, 33, 67,154,178, 79, 89, +252,253, 98,124,124, 60,241,150,136,173, 17,164,253,174, 66,161,248,206, 53, 54,160,145,242,254,165, 80, 40,214,185,198, 6,248, + 33,195, 2,160, 2, 64,189,184,129,107,127, 24,249,123, 34,123,183, 61,110,224,192,129,119,106,249,200, 0,254, 68,232,209,163, + 7, 10, 11, 11, 3, 13, 17, 64, 0, 1, 4,240, 39, 1, 19,104,130, 0,154, 2, 1,242, 15, 32,128, 0, 2, 8, 40, 0, 1, 4, + 16, 64, 0, 1, 4, 16, 64, 64, 1, 8, 32,128, 0, 2, 8, 32,128, 0, 2, 10, 64, 0, 1, 4, 16, 64, 0, 1, 4,112,219, 81, + 39, 52,117,206,156, 57,126, 71,143,186,203,100, 23,144, 23,144, 23,144,119,103,200, 83, 40, 20, 84,169,108,120,217,105,160,253, + 2,242, 2,242,254, 90,242,124, 86, 0,184,129,194, 87, 33,158, 6,150,166,150, 23,192,157, 9,111, 4, 19,192,157,249, 28,124, + 60, 63, 20,192, 61,251,247,239, 95, 34, 16, 8,134, 7, 5, 5,193, 96, 48, 28,188,247,222,123, 23, 1,200, 7, 96,184, 19,218, + 64,165, 82, 73,179,178,178,212,127,197,113,229,216,177, 99,200,207,207,247,122, 94, 94, 94, 30, 61,118,236, 24, 50, 51, 51, 73, +191,126,253, 26, 45,143,195,208,161, 67,225, 73, 94, 0,127, 98, 15, 0, 7, 95,210,147,242, 73,148,227, 78, 94, 67,229, 97,253, + 73,188,243, 87, 31,208,249,158, 59,126,252,120,217, 35,143, 60,162,225, 43, 51, 42,234,230,210,203,165,165,165,117,182,147,146, +146, 32,151,203, 9, 31,121,183, 82, 9, 24, 63,126, 60, 5,128,157, 59,119,146, 59, 65,158, 94,175, 31,187,105,211, 38,213,233, +211,167, 1, 0,209,209,209, 15,166,164,164,108,241,247,249,186,246,123, 74,169,243,253,224,246,115,239, 10, 33, 4, 25, 25, 25, +196,147,242,204,247, 57,248,248,188,250, 28, 59,118,108, 83, 85, 85, 85,175, 46, 93,186,224,250,245,235,168,173,173, 5,128,225, +155, 54,109, 82,135,134,134,158, 76, 76, 76,124, 24,128,199, 82,146, 35, 70,140,240,201, 32, 56,112,224,128, 12, 60, 83, 61,115, +200,202,202, 82, 39, 37, 37,201,228,114,185,198,215,231,145,154,154,234,211,245, 77,153, 50,133,247,251,193,161, 75, 23,123, 5, +220,234,234,106,152, 76, 38,174, 63,241,122,223,242,243,243,241,223,255,122,206, 80,107, 50,153,232,240,225,195,209,187,119,111, +172, 93,187,182,204,100, 50,117,110,104, 93,120,126,126, 62,102,204,152,193,235, 94,175, 94,189,138, 37, 75,150,224, 78,206,109, + 31,192, 13,212, 79, 6,116, 43, 19, 1, 5,172,216, 91,136,239, 51,188,167, 52,126,120,206, 14,159,100,170,213, 55, 12,164,211, +167, 79, 35, 52, 52,212, 57, 8,185,180, 7, 31,107,139,214,223,174, 63,128,169, 84, 42,154,149,149,229,183, 5,182,110,221, 58, +233,248,241,227, 27,148,223, 24,164,165,165,209, 81,163, 70,201,166, 79,159,238, 19, 89,108,218,180, 73,213,166, 77, 27,204,156, + 57, 19, 58,157,142, 77, 79, 79,223,172,211,233,166, 69, 68, 68,248,148, 69,140, 16,130, 31,126,248,193,185,157,152,152,136, 29, + 59,118,120,220,246,134,250, 74,128, 66,161,160,177,177,177,200,204,204,164, 92, 98, 38, 95,201,191,178,178, 50,183,123,247,238, + 45, 0, 64, 34,145, 32, 56, 56, 24,101,101,101,168,168,168, 64, 88, 88, 24,202,202,202,122,237,216,177, 35, 63, 49, 49,177, 39, +128, 43,158,132,245,235,215, 15, 73, 73, 73,136,142,190,145,245,111,233,210,165,117,206, 89,184,112, 33,103,201,170,167, 79,159, +238,243,243,246,135,252, 57,172, 88,177,162,161, 67,206, 90, 5,254, 34, 52, 52, 20, 39, 78,156,128, 72, 36,130,217,108,198,142, + 29, 59, 80, 88, 88,136,151, 95,126,217, 39, 57, 87,235, 21,201,122,240,193, 7, 5, 0,228, 63,254,248,227,142,209,163, 71, 95, +125,248,225,135,219,170, 84, 42, 8, 4,130,214,225,225,225, 2, 95,100, 53,132,243,231,207, 7, 72,226, 79, 74,254,220, 62,175, +181, 0,254,172, 88,181,106,149, 52, 37, 37, 69,211, 88, 57,127, 22, 87,118,212,144,119,110, 88,237, 5,175,250, 37, 67,167,211, +193, 96, 48, 56, 45,144,204,204, 76, 87, 75,136,175,181,117,211,182, 92, 46,199,238,221,187, 41, 33,228,166,227,254,224,199, 31, +127, 84,191,248,226,139,200,206,206,198,228,201,147,155,164,253,118,238,220, 73,246,236,217, 67, 41,165,200,201,201, 81,231,228, +228,248,164,160,156, 62,125, 26, 51,103,206,100, 1, 48, 98,177,152,137,137,137, 65,122,122,250,122, 0,235,163,163,163, 39,164, +164,164,108,231, 35,231, 86, 20, 3,226,148,128,204,204, 76,202,165, 1,230,254, 87, 40, 20, 52, 41, 41,201,151,123, 13,213,233, +116,155, 36, 18, 73, 11, 0,120,250,233,167, 81, 91, 91,139,140,140, 12, 4, 7, 7, 59,203,102, 11, 4, 2, 84, 86, 86,182, 0, +144, 14,224, 31,158, 4,114,228, 94, 84, 84,116,211,190,166, 64, 82, 82,146,204,113,159, 50,127, 21,129,231,159,127,222,249,121, +249,242,229,220, 71,166,222,126,222, 10, 1,231, 53,121,245,213, 87, 17, 26, 26,138,236,236,108,140, 30, 61,218, 47,242,175,143, +145, 35, 71, 2,246, 44,141,255,124,252,241,199,209,163, 71,143,182, 59,118,236, 64,121,121, 57, 87,114,215,236,229, 93,104,234, +238, 39,157, 48, 97,130,122,219,182,109,238,188, 55,210, 49, 99,198,168, 9, 33,216,179,103, 79,192,221,123,139,201, 63,117,225, +251, 0,128,204,165, 47,185, 85, 2,254, 16, 5, 32, 51, 51,211,221,131,166, 13,237,247,231, 55, 14, 29, 58,164, 6, 32,107,172, + 18, 48, 99,198,140,191,205,124,182,193, 96,184,201,234,247,135,104, 56, 98,153, 60,121, 50, 18, 18, 18, 8, 0,100,103,103, 55, +201, 53,174, 91,183, 78,234,176,232, 72, 89, 89,153, 52, 43, 43, 75, 93, 86, 86, 38,245,213, 98,119,135,177, 99,199,146,177, 99, +199, 98,221,186,117,210,156,156, 28,245,186,117,235,124,146,171,211,233,172, 17, 17, 17,226, 77,155, 54,193,225, 13,168,213,233, +116, 76,122,122,250, 54,157, 78, 55, 46, 34, 34, 98,247,237,124,190, 28,233,187,246,101,133, 66, 65, 57, 37,141, 39,238, 41, 44, + 44,236,213,191,127,127,204,154, 53, 11,149,149,149, 40, 47, 47,135, 72, 36,130, 80, 40,132, 80, 40,132, 72, 36, 66,112,112, 48, +180, 90, 45, 84, 42,213,116,185, 92,254,172, 55,161, 69, 69, 69,117,148, 67, 78, 1,224, 60, 1,177,177,177,190, 92,163, 59,235, + 95,150,149,149,165,110,140,231,201, 5,214, 6,198, 74,222,222,128,243,231,207, 35, 39, 39, 7, 19, 38, 76, 64,151, 46, 93,208, +170, 85, 43,228,228,228,224,229,151, 95,118,122,223, 4, 2,129,207, 23, 54,114,228, 72, 44, 90,180, 8, 75,150, 44,105,159,146, +146, 50,245,177,199, 30, 67, 66, 66, 2, 0, 64, 32, 16,204,108,217,178,229, 22,165, 82,105,241, 84, 12,104,221,186,117,188,188, + 0,165,165,165,152, 54,109, 26, 63, 3, 37, 42, 10,169,169,169,234,162,162, 34,168, 84, 42,174,253,165,169,169,169,106, 78,129, + 14,224,214,130, 35,127,238, 51,167, 4,252,225, 30,128,134,230,177,253, 9, 16,188,213, 74,192,253,247,223,223,104, 79,128, 47, +247,229,203,111, 60,250,204, 78,108,250,100,124,147,180, 21,247, 2, 54, 84,169,234,224,193,131,141, 86, 12,154,226,249,254,248, +227,143,106,206,234,159, 62,125,186,230,199, 31,127, 68,155, 54,109,212,104,162,196,233,156,220,156,156, 28,228,228,228,120,117, + 55,235,245,250,251, 55,109,218,180, 13, 0,210,211,211,197,209,209,209, 72, 73, 73,225, 14, 75,126,251,205, 94, 47, 43, 61, 61, +125, 87,116,116,244,195, 41, 41, 41, 94,235,147, 39, 38, 38,214,137,137,185,239,190,251,234,120, 6,248,184,253,221, 40,221,212, + 93,255,226,158,139,235,116,128, 39,236,216,177, 99, 73, 76, 76, 12, 0,224,204,153, 51,160,148,226,212,169, 83,206,186, 15, 66, +161, 16,132, 16,216,108, 54, 24, 12, 6,124,251,237,183,144,203,229, 94,171, 46,185,146,127, 82, 82,146, 91,229,197,117,138,192, + 31, 37, 64, 46,151, 19,133, 66, 65, 27,235, 13,104,138,113,210, 98,177, 96,240,224,193,208,104, 52, 24, 50,100, 8,244,122,189, +115,106, 71,163,209, 96,252,248,241,176,114, 37,200,125,179,252,177,100,201,146, 14, 41, 41, 41, 23,191,248,226, 11,231,177, 14, + 29, 58, 96,217,178,101,255,229, 75,216, 77, 12,205,225,195,135, 17, 27, 27,139,232,232,104, 12, 30, 60,152, 30, 57,114, 68,198, +145,127, 81, 81, 17, 52, 26, 13,159, 24,149,161, 0,158, 1,240, 79,165, 82,105,243,112,222, 4, 0, 81, 0,190, 85, 42,149,215, + 2,212,255, 7,118,108, 62,248, 35,131, 0,155, 66, 9,232,218,181,107,163, 60, 1,220, 32,187,118,237, 90,183,199,183,111,223, +142,181,107,215,250,101,153,228,157,235,131,184,110, 39,252,118,251,115,112,157,243, 87,169, 84,144,203,229, 78,183,255,193,131, + 7,209,169, 83,167, 38, 81,250, 26, 99,125,113,214,255,245,235,215,157,117,230,165, 82,169,172, 41,189, 0, 28, 70,143, 30, 45, +203,201,201, 81,123, 59,111,211,166, 77,219,184,185,127,189, 94,143,165, 75,151,162,166,166, 6, 34,145, 8, 65, 65, 65, 56,119, +238, 28,222,121,231, 29,232,116, 58,164,167,167,127,167,211,233,198, 68, 68, 68,168,189,144,108, 29,178,247, 22, 19,208, 20,138, +231,225,195,135,235,156,223, 80,144, 88,100,100,228,112,147,201, 4,171,213,138,131, 7, 15, 66, 32, 16,192,108, 54,195,104, 52, +130,101, 89,231,123,108,177, 88, 96, 50,153,184,119,218,107,152,120, 67, 46,255,133, 11, 23, 58,189, 0,209,209,209, 40, 43, 43, +107,180, 34,202,173, 10,240, 33,118, 68, 11, 32,210,221, 1,151,233, 0,159,144,158,158,142, 23, 95,124, 17,131, 6, 13,114,122, + 64,184,244,217,131, 6, 13,194,169, 83,167,208,166, 77, 27,159,100,238,219,183, 15, 35, 71,142,236,146,146,146,114,158, 35,127, +199,248, 25,181, 97,195,134, 75,245, 3,122,249, 42, 20, 13,253,150,143,222, 39,114,248,240, 97,105,106,106,170,122,200,144, 33, + 24, 50,100,136, 26, 0, 78,157, 58,133,156,156, 28,190,207,225, 23, 0,193, 0,214, 43, 20,138,105,238,148, 0,133, 66,241, 12, +128,143, 29,155,139, 20, 10, 69, 47,165,210,123,137,250,191, 50,184,106,128,153, 75, 95,186,105, 10,224, 47, 27, 3,112, 39, 42, + 1, 51,102,204,160,139, 22, 45,186,201, 21,232, 15,249, 63,250, 76,211,206,211,233,245,250,155,130,252, 56,171, 95, 36, 18,225, +202,149, 43,183,149,252, 93,173,127, 87,203,109,218,180,105, 26,141, 70,211,228, 94, 0, 95, 60, 39, 51,103,206, 52, 0, 8, 9, + 13, 13,197,107,175,189, 6,145, 72,228, 60,158,156,156, 12, 0,136,136,136,192,196,137, 19,177,127,255,254,189, 19, 39, 78,252, + 67,174,211,181,189, 93,231,255,221, 33, 54, 54,182, 78,165,198,134,214, 17,155,205,102,104,181, 90,212,214,214, 34, 44, 44, 12, + 65, 65, 65,176, 90,173,160,148,194,102,179,193,108, 54,195, 98,177,192,102,179,185, 42,244,215, 61, 93,103, 81, 81, 81, 29,235, +190,254,116, 64,253, 0,193,198, 66, 46,151,107,124,140, 69,145, 52,116,160,129,216, 0,175,120,231,157,119, 48, 97,194, 4,116, +237,218, 21, 33, 33, 33,144, 74,165,208,106,181, 8, 13, 13,133, 78,167,195,234,213,171,193, 48,190,197, 23,142, 28, 57,178, 99, + 74, 74,202,249,121,243,230, 97,243,230,205,120,232,161,135, 0,160,221,190,125,251,174,250,211, 78, 14,133, 2,220,152,197,141, + 85,190,146,191,171, 39, 96,195,134, 13,178,169, 83,167,170, 1, 96,195,134, 13,178,202,202, 74,141, 15,253,217,172, 80, 40,102, + 0, 88,235, 65, 9, 72,112,249,220, 25, 64,127,216,151,164, 6,224, 66,252, 13,225, 47,153, 9,112,216,176, 97,178,166, 8, 8, +244,215, 74,119, 29,144,151, 44, 89,210,104,242,231, 48,120,208, 64,236,217,171,198,186,189, 33, 78,165, 32,239, 92,159, 70,221, + 99,108,108, 44,138,138,138,144,157,157,141, 78,157, 58, 97,205,154, 53,126, 88, 93, 84,202,125, 74, 75, 75,107, 18,242,231,172, +255,178,178, 50, 89,253, 99,163, 70, 43, 88,140, 99, 0, 0, 32, 0, 73, 68, 65, 84,141,146,101,103,103, 59,207,105, 10,228,228, +228,168,249,122,159,116, 58,221,239,176,207, 11,179, 27, 54,108,192,234,213,171, 1, 0,235,215,175,135, 78,167,227, 78,179,158, + 58,117, 10,173, 91,183,190, 45,239,128,107,180,191, 59,229,140,111,153,230,162,162,162,131, 54,155, 13, 58,157, 14,215,175, 95, +119, 6,142, 26, 12, 6,212,212,212,160,170,170, 10,149,149,149, 48, 26,141, 48,153, 76,176,217,108, 0,144,235, 73,102,125,114, +119, 23, 72, 90,127, 85, 0, 95,168, 84, 42,105,253,123, 86,169, 84,190,246,147,144,166,126, 30,107,214,172,129, 84, 42, 69, 72, + 72, 8, 78,156, 56, 1,141, 70,131,208,208, 80,188,254,250,235,216,191,127, 63, 94,126,249,101,159, 20,128,145, 35, 71,182, 75, + 73, 73,185, 48,109,218, 52,124,243,205, 55, 28,249,119, 0,112,213,147, 37,207, 71, 9, 88,178,100, 73, 83,144, 63, 0, 72, 57, +242, 7,128,169, 83,167,170, 71,143, 30, 77,125, 28, 67,205, 0,184,117,138,235, 21, 10, 69,253, 64,137, 51, 46,159, 75, 0, 28, + 13,208,190,203, 56,176,240,253, 58,177, 0,245,241,151, 9, 2,108,106,242,119,172,119,109,180,229,198, 77, 7,204,152, 49,195, +111,242,127,244,153,157, 24, 60,232,134,235,102,211, 55,223, 98,211, 55,246,207,123,246,170,129, 49, 50, 0,190, 45, 3, 84, 40, + 20,136,141,141, 5, 96, 15, 6, 60,124,248, 48,118,239,182,199,172, 29, 61,122, 20,163, 71,143,246, 65, 26,209, 0, 55, 2,255, + 26, 27,169,191,110,221, 58,169, 59,235,191, 62,154,202, 11,192, 41, 18, 82,169, 84,230,237,220,232,232,232,113,233,233,233,187, + 38, 78,156,136, 83,167, 78,225,244,233,211,120,231,157,119,172, 0,132, 6,131, 1,233,233,233,112, 28, 19, 22, 23, 23,227,241, +199, 31,247, 42,243, 86,196, 0,112,150,116, 86, 86,150,211,139,197, 17, 35,247,220,249, 32, 38, 38,166,192, 96, 48, 12, 55,155, +205,184,118,237, 26,130,130,130, 32, 20, 10,157, 30, 0,189, 94, 15,131,193, 0,147,201,132,202,202, 74,110, 62,255,162, 39,153, + 28,185,115,211, 0,177,177,177,168,239,173,112, 23, 23,192,135,252,185, 28, 0,245,247, 53,166,127,112, 86,191, 27,139,223,202, +119, 12, 45, 44, 44,196,169, 83,167, 96, 48, 24, 16, 31, 31, 15,131,193,128,172,172, 44, 76,157, 58, 21,155, 55,111,134, 64, 32, +224,173, 0,196,196,196,116,228,200, 63, 63, 63, 31,111,188,241, 6, 0,116,158, 49, 99,198,229,181,107,215,146,125,251,246, 53, +106, 12,229, 60, 1,141, 33,255,216,216, 88,202,245,179, 35, 71,142,160,160,160, 64,150,154,154,170,238,217,179, 39, 68, 34, 17, +117, 9, 12,244,219, 19,160, 80, 40,230, 2,152, 0, 96, 50,128, 54,176,199, 0,252,173,221,255,192,141, 85, 0,238,130, 0,111, +203, 42,128, 63, 42, 8,240, 78, 35,255,250, 74, 64, 99, 44,127, 79,219,123,246,170,253,121, 65,111,152, 59, 33, 33,232,221,187, +119,157,227,135, 14, 29,242, 73,222,228,201,147,157, 10, 64,118,118, 54,178,179,179,235,172, 10,240,229,254,215,172, 89,163, 6, +128, 29, 59,118,184, 37,207,233,211,167,107,214,172, 89, 3,128,223, 18,166,134,146,254,112,138, 6,165, 20,163, 71,143,150, 77, +155, 54,205,107,223, 73, 73, 73,217,173,213,106,199, 30, 56,112, 96, 79, 76, 76, 12, 78,159, 62, 13,157, 78, 39,140,136,136, 64, + 74, 74, 10,180, 90,109,241,129, 3, 7,186,196,196,196, 96,230,204,153, 94,239,215, 93, 30, 0,127, 99, 0,234,191, 91, 74,165, +146,200,229,114,168, 84, 42, 90,127, 90,134,239,243,136,139,139,123, 69,163,209, 60,103,179,217, 80, 85, 85, 5,139,197,226, 84, + 86,106,107,107, 65, 41,173, 19, 24, 40,151,203, 31,115, 16, 35,111,200,229,114,200,229,242, 58,203, 2,125,157, 2,112, 37,122, +185, 92,174,169, 63,182,184, 42, 5, 77, 8,222,227, 39,183,212,239,133, 23, 94,128, 70,163,129, 76, 38, 67, 97, 97, 33,154, 53, +107,134,146,146, 18,222, 10,192,161, 67,135, 72, 74, 74,202,133,199, 31,127, 28,251,246,237,195,235,175,191, 14, 0, 81, 51,102, +204,184,212, 20,228,239,170, 4, 52,198,242,231,198,151,162,162, 34, 20, 20, 20, 16,135, 33, 40, 75, 77, 77, 85, 71, 71, 71, 67, + 42,149, 82, 62,129,128,245,148,128,105, 0,214, 59,148,128,131, 0, 20, 0,164, 74,165,242, 10, 2,104,186, 14,220,212,217,248, +220, 5,252, 44, 93,186,180,193,253,183,147,252,103,204,152,113, 75, 82,134, 54, 70,230,133,139,222,251,119,112,176,111, 94, 75, + 79,243,195,254, 64, 46,151,203, 18, 18, 18, 52,123,246,236,161, 27, 55,110,172,163, 8,212, 39, 37,190, 50,211,210,210, 26,212, +108,184,164, 36,190, 36, 6,106, 72,225,148,201,100,188,200,159, 67,100,100,164,115, 94,255,196,137, 19,255, 72, 79, 79,255, 47, +231, 17, 40, 46, 46,238,242,234,171,175,202, 8, 33,188,228,221,138, 60, 0,245,219,217,221,252,183, 15, 74,169,126,244,232,209, +139,183,111,223,254,166,213,106, 69, 69, 69,133, 51, 6, 0, 0,174, 93,187,134,138,138, 10, 80, 74, 57,171,221,167,201,118,110, +254,191,254,178,191,250,113, 2,124,201,223,245, 57,223,105, 75,121, 57, 37,224,165,151, 94, 66, 78, 78, 14, 38, 78,156,136,247, +222,123, 15, 11, 22, 44,128, 80, 40,132, 68, 34,241,246, 92, 9,165,148,157, 53,107, 22,254,251,223,255, 98,213,170, 85, 0,208, +105,223,190,125,151, 28, 22,187, 95,157,201,101,218,170,201, 80, 90, 90, 10, 55,121, 0, 52,153,153,153,178, 49, 99,198,168,253, + 89,242,232,176,250,167, 1,216, 10, 96, 46,128,184, 0,249, 55, 12,119, 65,128,188, 20, 0, 95,146,114,248, 75,216, 77,141,166, + 32,255, 59,113,208,152, 59,119,174,236,228,201,147, 77, 42,211, 97, 13,169,155, 82, 38, 71,120,220,218,122, 0,206,100, 64, 44, +203, 98,211,166, 77,188,149,128, 23, 95,124,145,187,206,155, 98, 0, 24,134, 1,203,178,248,215,191,254,165,230, 75,158,158,228, + 53,118, 37, 65, 74, 74,202,255,180, 90,237,181, 3, 7, 14,236,224,107,245,223,106,111, 91,253,246,117,231, 98,247, 69, 9, 32, +132,188, 53, 97,194,132,236,181,107,215, 30, 23,139,197,224, 86, 5,176, 44,139,240,240,112,232,116, 58, 46,133,109, 8, 0, 27, + 95,131,192, 53,248,239,240,225,195,144,203,229,117,198, 19,111,227, 80, 81, 81, 17, 45, 42, 42,146,213,119,241, 55,114,201, 31, +128, 6,221,253,214,229,203,151, 75, 0,152, 97,143,159,226,254,124, 82, 2, 92, 19,255, 60,245,212, 83,206,207, 85, 85, 85, 94, + 95,179,184,184, 56,210,183,111, 95,250,213, 87, 95, 61,188,126,253,250,239, 57,178, 93,191,126, 61,124,141,250,231,112,233,210, + 37,103, 74,226, 38,130,102,219,182,109, 13,245, 41,205,222,189,123,125,170, 85,225,225,240,101,119,217, 74,255,238, 53, 73,184, + 85, 0,238,136,159,215, 42,128,166, 38,245,134,228,221, 41,202,195,157,220,113,250,244,233,163,233,211,167, 79,147,202,116, 12, +142,183,252, 94, 93,221,255,245, 95,234,134,150,157, 57,174,143,207,181, 17, 31,238,247,150,222,107,100,100,228,206,198, 68,250, + 55,101, 12,128,187, 62,236,201,219,227, 67,159, 63, 49, 99,198,140,102,187,118,237,122,183,164,164,228, 57,163,209, 8,155,205, +134,129, 3, 7, 98,200,144, 33,233,114,185,124, 33, 31,242, 7,128,188,188, 60,231,103,215, 88,147,188,188,188,155,182, 61, 33, + 58, 58,154, 56,188, 4, 50, 0,106, 78,153,112,153, 10,240,249,153, 76,153, 50,165,161, 67, 66,151,241, 82,124, 59,198, 21,165, + 82,201, 30, 59,118, 12, 31,127,252, 49, 1,192, 43, 41,207,179,207,122,206,201, 52,116,232, 80, 76,154, 52,137,247, 53,120,147, + 23,192,157,167, 4, 52, 68,254,110, 21,128,166, 38,193, 64,133,184, 0,220,245, 1,127,203, 87,254, 29,218,230, 14,254, 13,253, +184,113,227,230,194,238,126,245, 11, 7, 14, 28, 32,211,167, 79,191, 37, 10,173,191,153, 3,255, 72,101,177,177,232,215,175, 95, +147, 22,227,105,106,121,127, 7,163,236,207,164, 4,120,181,162, 6, 14, 28, 24, 24,136, 3, 8, 32,128, 0, 2, 8,224,111, 6, + 38,208, 4, 1, 4, 16, 64, 0, 1, 4, 16, 80, 0, 2, 8, 32,128, 0, 2, 8, 32,128,128, 2, 16, 64, 0, 1, 4, 16,192,159, + 16, 86, 0,108,160, 25, 2,240, 4, 97,160, 9, 2, 8, 32,128, 0, 2, 99,123, 0,127,243, 78, 50,103,206, 28,191, 35, 46,221, + 69,117,123,146,231,109,253,177,175,242,154,250,250, 2,242, 2,242,254,238,242,126,126,165,216,239,129,101,208,187, 93,112,171, +229, 29,126,217,127,121,177,239,221, 44, 47, 45, 45,141, 0, 0, 33, 68,106,177, 88,112,238,220, 57,181,217,108,134, 80, 40,196, +197,139, 23,241, 88, 88, 87,236, 44, 40,128,241,238, 78,136,139,139,147, 9, 4, 2, 80, 74, 53, 0,144,145,145,113,203,159, 7, +119,125,174, 32,132,244, 1,208,230,248,241,227,219, 58,116,232,192,104,181, 90, 73,135, 14, 29,222, 9, 14, 14, 94, 9,224,146, + 99, 57, 41,147,145,145, 97,243, 32,175,185,195, 91, 96, 32,132, 80, 0,184,112,236,127,159, 43, 70,150,164,172, 43,136, 57, 39, +108, 51, 46,174, 89,243, 22, 53, 0, 40,165, 84, 8, 32, 34, 35, 35,227, 66,224,125,187,179,229,221, 82, 45,145,111,182, 45, 95, +179,191,249,147, 50,183, 98,245, 55, 82, 97,100,152,250,236,233, 51,178,187,130,154, 33,244,217, 25,154, 59, 73,203,106, 40, 31, +121, 96,137,203,237,199,230,205,155,165,219,183,111, 87,167,191, 98,223,254,110,223, 72,204,152, 49,131,215,115,217,151,123, 80, +202, 16,162, 62,117,242, 36,116, 58, 29,186,116,233,130,102,205,155, 35, 49, 97, 28,239,231,186,123,247,238, 58, 47,110,118,118, +182,199, 90, 10,217,217,217,126,247, 27,174, 80, 83, 70, 70, 70,227,250, 93,146,214,241,129, 2, 32, 64, 86,164,255,178, 98,151, + 3,209, 79,216, 63, 23,173, 6, 14,207,111,252, 67,157,124,189,238,245,101,183,226,245, 53, 66, 8,213,235,245,178, 93,187,118, +169,139,138,138,144, 36,106,137,118,157, 90,163, 86,111, 68,176,193,138, 17, 11,158,196,168,137, 83,177,245,139, 12,108,217,179, + 71, 61,110,220, 56,217, 29,208,133, 79,219,108,182,246, 69, 69, 69,236,128, 1, 3,196, 49, 49, 49, 56,114,228,200, 43,181,181, +181, 19,122,244,232, 33, 39,132,104, 41,165,222,166, 2,170, 93, 55,172, 86, 43,243,107,193,207, 61, 58,206, 26,132,127, 13,237, +219, 58,111,215, 7, 27, 55, 29,149,254,210,163,223,152,247, 28,242, 46, 58, 20, 6, 54,224,105,248,155,185,137,124,205,223,239, + 75, 30,124, 95,201,223,182,110,155, 52,190,117, 71, 53,137,138, 70, 97, 77, 5,218,119,232,170,182,176, 54,156,252,100, 13,202, +186,180,150, 13,157,120, 63, 47, 69,224,176, 90, 65,123,117,231,182, 4,248,118, 23,139,125, 63, 81,164, 78, 3,122,117, 7,230, + 47,105, 28,113,115, 5, 74, 26,155,157,204,157, 50,209, 84,114, 27,131,212,212, 84,138,197, 4,228,173,134,207,161,148, 2,139, + 9,166,252,158,116,199,172,181,190, 65,254,212, 65,254,163,176,127,255,126,204,152, 49,195,235,119,239, 30,176,139,246,233, 51, + 4, 89, 89,151,113, 40,215,158,176,230,244,201, 83, 0,128,217,255,252,134,158, 58, 51, 89, 22, 42,225,247, 92, 18, 18, 18,216, +221,187,119, 51,217,217,217,216,187,119,175,199, 66, 76,254,164, 80,245,244,222,166, 41, 20, 52,195, 15,133,130, 75, 23,222,232, + 84,198,209, 79,212, 45,182,211, 20, 10,128, 75, 59, 57,170, 19,242,194,217,179,103,161,217,184, 81,253,150,124, 10, 6,206,120, + 10,226,182, 17,128,208,145,236,143,165, 0, 43, 2,107,162,184,255,137, 84,148,124,244, 62, 14, 30, 60,168, 30, 62,124,184,140, +243, 2,220, 38,216, 24,134,105,211,170, 85, 43,104, 52, 26,225,128, 1, 3, 48,116,232, 80,230,202,149, 43,131,126,253,245,215, + 99,119,223,125,247, 96, 66,200, 21, 7, 89, 51, 60,219,174,217,216, 49, 9,209,239, 45,219,204, 44, 76, 62,218, 34, 46,113,142, + 44,110,152,106,228,130,143, 47, 62, 16,115,207,204, 88, 66, 72, 53,236, 49, 6, 76, 67,253,204, 53,177,149,183,126,212,104,133, + 52,128, 58,168,159, 0,168, 62,252, 42, 6,228, 58,128, 12,156,217, 31,115, 70, 60,195,128,103,229,190,250, 74,128, 66,161,160, +177,177,177,200,204,204,164,174,101, 75,125, 34,214,156,195,210,233,131,226,213, 98, 27, 11, 27, 40,130, 43, 66,112,229,218, 53, + 92,169,174, 68,183,160,102, 48, 21, 94, 82, 31,218,178, 93, 54,140,135, 18,208,171, 59,112,242, 44, 3, 74, 37,176,145, 32, 60, +156, 96,193,164,113, 70,220,136,161,105,124,170,132,198,146, 52, 71,252, 11, 23, 46, 68, 65, 65, 1, 0, 96,219, 73, 17,106, 45, + 22,181,226,159, 67,124, 82, 4,124, 81,226, 28, 41, 94, 61, 63,151,197,246,195,177,177,177, 13,231,111, 95,236,223, 59,190,245, +179,203,210, 45,191,190,225, 84,120, 38,244, 95, 44,123,240,153, 14,141, 30,112, 55,111,222, 44,221,182,109,155,154, 97, 24,188, +240, 46,156,213,207,248,212,193,136,136,248, 81, 26, 55, 44, 13,192, 22,140, 28,249, 81,157, 99,211,167, 3,247,223, 15,220,143, +108,245,242,143,192, 75, 9,224,200, 95,163,177,159, 58,117,234, 84,103, 97, 37, 95, 8,204,147,229,207,165,100,118,189,191,180, + 52,255,200,191,201, 16,187, 12, 0,176, 98,197,138, 27, 10,192,224,116,224,200, 11,183,229,114,246,238,221,139,149,147, 82,209, +109, 76, 2, 32, 48,129,136, 24, 16, 33, 3, 34, 16,129, 82, 2, 86,111, 5,181,217, 64,205, 54, 60,249,196, 83,120,234,245,185, + 56,219,182,173,186,123,247,238,183,211, 19, 64, 10, 10, 10,226, 59,117,234, 36, 46, 42, 42, 66, 78, 78, 14, 78,158, 60,137,132, +132, 4,196,199,199,183, 95,181,106,213,219, 83,166, 76,121,210, 7, 5, 64,176,127,207,215, 95, 62, 50,208,208,246,112,181, 0, +211, 23,215,224,222, 65, 31,226,153,121, 83,133, 31, 44,172,232,182,240,131,181,211,163, 7, 77, 87,162,129, 52,200,174,132,238, + 58,166,167,165,165, 81,119,251,155,186, 32, 92, 0,183,192, 3,224,250,144,214,237, 88, 91,209,253,174,238,225,138,183,158,100, +231,140,120,198,151,106, 78, 36, 51, 51,147,114,105, 73,185,255, 21, 10, 5, 77, 74, 74,242,205,170,222,113, 80, 58, 62,166,175, + 90, 92,107, 69,240, 7, 47,194,106, 48, 67,242,194, 18,132,137, 37,168, 21, 25,161,175, 53, 34, 24, 4,166, 11,101,234,202,202, + 74, 89, 88, 88,152,199, 65,248,228, 89, 32,115, 61, 11,192,224,248, 3, 70,222,195, 96,210, 56, 2,215, 64,218,212,105, 64,230, +122, 63, 60,166, 73, 73, 50,199,125,250,101,173,115,228,207, 17, 63, 0, 40,247, 91, 96, 52,235, 1, 0, 99, 23,238, 70,214,210, + 4, 53, 0,222,242,207,190,127, 22, 34, 82,120,163, 35,144, 82,144, 86,189, 92,182,203,208,250,159,252, 82,132,146,183,236,228, +239,169,198, 60, 81,100, 81,251, 57,252,172,255, 35,219, 44,210,204,205,207,170, 41, 40,222,155,247, 29,134, 73, 99,176,238,179, +125,248,207,174, 52,245, 54, 5,197,156,127,188, 33, 27, 56,178,189, 95,138, 64, 77,177,130,142, 25, 0,100,125,117, 28,148, 82, + 52,111,115,183,147,252, 87,174, 92,233,241,250,244,181, 42,105,106, 82,123, 53,240, 41,128,239,112,232, 16, 48,108,216,141,227, +111,191,125,227,243,243,207,101,171, 51,254,211, 83,198,176,157, 60, 94, 39, 71,254,163, 71,143, 6,203,178,248,228,147, 79,154, +236, 5, 87, 40, 20, 78,242,175,171, 20, 40,104, 70,134,231,119,142,153,162,171,163,254, 18,199, 63,108,146,155,243,136,227, 68, + 98,255, 48, 96,192,205,115,236,204, 84,157,211, 43, 15, 0, 44,155,140,121,243,230, 57,143,207,155, 55, 15, 43, 86,172, 0,211, + 99,214,141, 95,117,156,239, 78,158,112,170,251,235,179, 90,221,156,199,227,250,106,107,107,209,174, 75, 87,128, 53,131, 9, 2, +136, 80, 0,107,117, 37,106,139,206,225,218,197, 82,116, 28, 46, 5, 17,135,131, 88,204,128,128,193,210, 57, 11,144,144,249, 6, +230,207,159,223,164,131,178,183, 84,217, 46,100, 75, 40,165,225, 70,163,113,120,100,100, 36, 78,157, 58, 5,150,101,113,238,220, + 57,172, 94,189, 26,189,123,247, 70, 84, 84,212, 76, 0, 79,214, 35,107,182, 33,242,166,148,182,234,194, 28,146,182,239,156, 40, +174,200, 57,138, 74, 93, 16,254,187,213,138,237,121,255,195,115, 73,193, 66,161,129,141, 5,166, 55, 88, 7,225, 86, 20,183, 10, +192, 55, 52,212,119,220,121, 6,132,124,137,159, 82, 10,217, 43,163,145,153,163, 12, 79,133, 2,191,124,117, 20, 24,225,124,173, +120,129, 35,125,131, 97, 45, 0,130,218,218, 85,136,140, 84, 33, 43, 43, 11,190,164,241, 28, 26,212, 66,221,166,214, 6,201,226, +167, 96,187,174,133,245,210,117, 8,197, 34,132, 16, 1, 66,137, 0,161, 2, 33, 34, 69, 18,232,170, 43,112,121,239, 65,117,216, +164,251, 60, 14,116,238, 72,125,223, 79,172, 67, 1, 0,150, 45, 34,160, 4,176,135,199,248,222,193, 29,164, 44,203,202,202, 82, +103,101,101,249, 53,133,224, 74,254, 16, 10, 80,116,217, 62,248,149, 92,173, 69,231,182, 18,244, 72,222,130,172,213, 19,213,124, +221,235, 34, 82, 8, 33, 41,133,128, 92,135,141,182, 66, 80, 27,130,208,105,151,192,178, 90,212,214,102,193, 86,240, 47,223, 60, +185, 60, 42,183,249, 82,226, 85,185,249, 25,117,124,228,171,248,228,187, 89,104,198,116, 6, 0, 60,245,108, 79, 12, 24, 26,141, +181,159,230, 96,229,255,222, 84, 43, 71,250,231, 58, 36, 4, 80, 60,127,204, 57,232,221,123,239,189,216,183,111,159, 87,242, 7, +128, 25,211, 68,106, 96, 47,128, 99,168,184,218, 12, 61, 58, 3,159,127, 94, 3,181, 26,232,209, 3,136,142,182,139,168,184,218, +204,254, 50,246,255, 93,253,219,175,157,136, 39,242,223,187,119, 47, 88,150,117,146,244,134, 13, 27, 26, 77, 32,174,219,245,201, + 31, 0,188,145, 63, 0,100, 40,149,132, 2, 82, 2,104, 82, 83, 83, 27,236,248,172,203,160,175,204,204,148, 17, 2,172,252,108, +229, 77, 49, 47, 43, 51,148,174,254, 21, 41,165, 84,253,225,135, 31, 58,119,124,248,225,135, 88,177, 98, 5, 50, 50, 50,234, 86, +145, 35,144,186,147,151, 97, 79, 97, 43,163,148,106,158,124,242,201, 6,175,207,234,226, 69,201,252,252,115, 25, 33, 64,198,202, + 12,181, 59,242, 18, 54,111, 14,136, 4,176, 25, 42,240,251,246, 61, 88,187, 49, 27,159, 93, 58, 7, 0,200,127,179, 5,122,140, +186, 31,166,146, 11, 56,254,235, 97, 28, 61,119, 26,149, 87,174,224,216,177, 99, 77, 86, 88,107,245,234,213, 82,126,125,152,132, + 81, 74,123, 21, 20, 20,124,240,218,107,175,245,253,224,131, 15,196,102,179, 25, 2,129, 0,205,155, 55,135, 94,175, 71,126,126, + 62,162,163,163,185,186, 5,158,172,255, 80, 66, 8, 75, 41,141,172,184,120,224,167, 55,191, 44,137,252, 98, 94, 7,104,245, 98, +136,133, 12, 58, 70, 72,112,229,186, 25,138,127, 91, 49, 96, 72,108,104,103, 47,158,132,180,180, 52,202, 41, 2,174,125,177,161, +207, 1,220,122,112,228, 95, 95, 57, 96,188, 13, 34, 92,189,239, 58,110,206,196, 25, 62, 95, 64,102,102, 38,181,147,255, 58, 39, +249, 75,126, 58, 15,195,206,187,234, 28,247,106,185, 42,215, 73,195,180,213, 96,197, 66,152, 15, 31,135,233,247, 34,212,238,218, + 7, 24, 77, 16, 83,138, 16, 8, 32, 4,129,137,181, 66,107,170,197,103,187,183,122,149,185,108,145,221,186,119,133,125,155, 51, + 87, 40, 78,157,161,152,191,196,255, 62, 43,151,203, 53,174,110, 47,149, 74,197,235, 69, 87,169, 84,206,218,218, 28, 30, 91,113, + 17,123, 14,235, 80,114,181,214,169, 4, 20, 94, 52, 2,242,141, 80,169, 84,188,220,145, 66, 98,175, 28, 38,170, 62,138,208,208, + 51, 8,146, 84,131,101,181,176, 88, 14, 67, 32,136,134, 89, 95,126,219, 58,235,158,111,143, 73, 1, 82,135,252, 47,159,162, 24, + 60, 81,128,103,223, 73,192,189, 9,125, 1, 80,199,121,190, 97,221,186,117,244,133,119, 9,154,181,238, 15, 10, 32,113,210, 28, +236,223,191,159,215,119, 89,230, 2,109,211,230, 55, 39,249, 87,151,219, 75, 48, 15, 24, 96, 39,127,174, 16,160,253, 88, 48,170, +203,131, 17, 25,114,217,163,204,201,147, 39, 67, 38,147, 97,204,152, 49,152, 58,117, 42, 4, 2,193, 77,127,174,251,249,194,221, +123,235,151,178,228, 66,196,132, 16,231, 95, 67,251, 8,160, 1,133,166, 1, 89, 55,222,175,212, 84,181, 59,203,121,222,188,121, + 72, 77, 77,173, 75,168, 13,200,251, 78,169,196,177, 99,199,212,132, 16, 41,128, 58,109,230,244,103,215,219,231,233,250,196,148, +130, 9, 9,130,229, 74, 49,148,175,190,138,213,250, 10,232, 70,199, 57,143,127,241,191,213,120, 99,193,108,196,204,127, 12,111, + 29,221,139,141,186,115, 72,120,240, 65, 68, 71, 71,251, 60, 5,176,122,245,106,169, 66,161,160,171, 86,173,170,211,135,243,242, +242,212,158,166,161, 8, 33, 34, 66,200,144,163, 71,143,150,228,228,228,104, 94,120,225,133,184, 79, 62,249, 68, 82, 83, 83,227, + 44,211, 92, 91, 91,139,102,205,154, 21, 78,153, 50,165,231,136, 17, 35, 58,123, 81, 36, 24, 66, 72,151,163,185,155,202, 78,239, +156,127,126,254,203,233,237,183, 44,238,128,223, 75,133,168,172, 17,128, 37, 64,121,141, 25,180,101,247,218,231, 95, 89,210,247, +129,135,255,225,117, 58, 33, 35, 35,131,112, 99,157, 82,169,244,250, 57,128,219, 67,254,110, 61, 0,174,196,207,103,156,241,197, + 18,185,225,106, 91,229,214, 59, 80, 39,206,160, 1, 55, 70,223, 86,109,213, 90,106,129,184, 92, 11,201,119,123, 65,132, 12, 80, +107, 6,173,214,131, 88,173, 16, 1,176, 81, 22,181, 54, 43,170,173,102,128,245, 62,135,202, 5,249, 45, 91,212,240, 48,104, 15, + 18,108,252,128,170, 84, 42, 9,231,210,231, 99,173,223,100,253, 3,248,250,153,246,117,182,135,188, 84, 4, 17,189, 14, 11,105, +133,172,172,172,189,124,189, 0,146, 26, 53, 34,223,250, 31,174,189,144,134,235,218, 96,116,176, 28,135,205, 86, 4, 0, 40,254, +165,221,109,235,176, 27,119,124,172,158, 61, 78, 89,135,252, 57,196, 69,188,138,225,125, 39, 35, 62,242, 56, 54,238,120, 71, 61, +118, 18,255, 65,100,237,218,181,244,199, 31,127, 68,121,249, 88,180,108,185, 7,205, 90,245, 3,165, 20, 12,195,240, 10, 68, 42, + 41, 1,138,138,142,113, 19, 9,128,164, 6, 90, 61, 48,116,168,125, 79, 97, 33,240,233,167, 64,117, 21,160,175, 1,106,244, 64, +104, 68, 21,175,107,107,104,174,255,236,217,179, 0,128,119,223,125, 23, 0, 16, 19, 19,211,100,110,102,215, 62,201,231, 59,115, +231,206,133,171,197, 94,159,184,125,128, 20,184, 49,247,239, 10,206, 11,224, 56, 71,227, 73,200,172,168, 24,156, 62,126, 2,165, + 17, 17,106,134, 97,240,220,115,207,225,163,143, 62,242,251,250, 70,154,194, 65,217, 26,204,126,119, 17,250, 79,158, 12,229,187, +239,130, 97,110,240,156,178,240,216, 13, 15,225,190,125,216,189,123, 55,206,157, 59,231,115, 16,224,234,213,171,165,185,185,185, +106, 0,200,207,207, 87, 51, 12, 35, 75, 78, 78,214,172, 90,181, 74, 74, 41, 69,124,124,188,204,104, 52,170, 27, 80,236, 44,121, +121,121,253,103,204,152,209,162, 91,183,110,216,190,125,187,161,178,178, 82,104, 52, 26,237,222, 14,199,252,199,248,241,227, 99, + 8, 33,193,148, 82,163, 27, 49,140,139, 60,166,232,212, 47, 43,222,248, 87, 74,179,150, 61,178,240,115,214, 19,248,237, 2, 65, +201, 85, 33, 64, 25,152,204, 22,104,105,203,210,167,103, 61, 21, 71, 8, 41,165, 77,160, 85,242,137,179, 9,224,143, 65,131, 83, + 0, 57, 57, 57, 55,237,171, 40,213,249, 76,118,174, 30, 0,251, 20,128,189,255, 72,126, 58,143,160, 99,165,176,133,219,173,168, +250,115,200, 13,173,107, 60,113,177, 4,134,160, 96, 68, 91,173,232, 24,220, 12, 33, 34, 49,136,197, 2,176, 20, 86,155, 13,213, + 54, 51, 12, 54, 43, 76,212, 6, 27, 40,168, 15,157,109,254,146, 27, 74,128, 61, 46,224, 6,233, 47, 91, 36, 64,250, 34,130, 23, +150, 88, 27,221,232,114,185, 92,195,149, 46,229,131,133, 89,246,118, 95,154, 20,225, 36,124,167, 43,159, 94,135, 8,128,144,234, +240,213,236, 8,235, 99, 42,126,113, 29,162,171, 63,193, 6,187,155,250, 3, 97, 24, 30,187, 90,140,130,127,119, 68,104,187,222, +168, 44, 45,197,149,243,151,110,107,199, 28, 48, 52, 26,122, 71,119, 51, 4,159, 64,136,177, 15,190,121,211,226, 60, 62, 66,222, + 23,185, 27,125,179,252, 39,141,250, 17,223,125, 39, 71,120,174, 10,203, 23, 1,207, 47,161, 24, 53,106, 20,239,101,127, 93, 59, +118, 34,221,187,215,213, 2,183,110,181, 7,254,173, 91, 7,244,232, 65,177, 98, 5,193, 91,111,213,216, 21, 4, 0, 61,122, 70, +224,133,231,249, 93, 35,103,165, 78,158, 60, 25, 27, 54,108,168, 99,201, 38, 38, 38, 54, 72,110,254, 42,162, 62,122,240,100, 43, + 86,172, 80, 55,164, 0, 44, 91,182, 12,153,153,153,188, 44,225, 39,159,124, 82,205, 69,254,187,195,243,207, 63,143,229,203,151, +171, 51, 51, 51, 61, 94,227,143, 39, 74,240,202, 91, 11, 48,107,241,191,240,178,217,140, 15, 63,252,176,193, 54, 90,182,108, 25, + 84, 42, 21, 8, 33,210,134, 8,123, 84,159,206, 88,245,197,167,136,157, 62, 29,111,190,249,166, 71,165, 97,222,188,121, 88,182, +108, 25, 62,255,252,115,141,175,109,159,155,155,171,230,130,229, 20, 10, 5,205,203,203, 83, 39, 39, 39,147, 67,135, 14,169, 9, + 33, 72, 78, 78,214,172, 92,185,178,193,239, 27, 12,134,240,173, 91,183, 98,236,216,177, 40, 44, 44, 12,209,235,245,176, 88, 44, + 96, 24, 6,102,179, 25, 73, 73, 73,196, 65,238, 70, 62,142, 45,147,201, 36, 62,188,105, 58, 70, 61,242, 22,118,230,156,197,185, +203, 2, 84,233, 25, 8,132, 64,169, 62, 24,207,189,180, 40, 30,192, 69,190,220,207,197,157, 0,252,166, 3, 2,184, 61,214, 63, +220,185,113, 56,215,140, 84, 42,133, 84, 42,197,175,191,254,234,252, 43,250,169, 24,149,198, 74,180, 28,234,251,186, 95,142,220, + 67, 66,102, 64,242,211,121,136,138,203, 65, 9,129,120, 86,121,157,227, 94,137, 75, 44,128,141, 2, 23,245, 21, 40,169,212,226, + 90,149, 14,149,181,181,208,153,141,184,102, 50,226,114,173, 1,165,181, 53,208, 90, 76,208,177, 22,152, 89,239,217, 48, 71,222, +227,102,192,115,137, 11,152, 61,181, 25, 40,196,160,190,149, 1,119,186,240,235,119,118,190,238,127,167,229,121,181, 22,123, 14, +235,234, 16, 63, 71,254, 65,108, 49,130,216, 98,188, 49, 94,136,146,146, 18, 51, 95,153,155,206,177,104,157,158,225,220, 62,167, +183,225,226,217, 82,156, 58,112, 28, 87,206, 87,220,246,142,187,238, 51,187, 2, 90, 85, 70, 17, 98,236, 3,233, 44, 33, 30, 89, + 44,114,254,165,111,156, 14, 2,194,123, 64,122,232,222, 28, 60, 49, 95,142,136,188, 61, 32,132,224,251, 3,246, 71,192,151,252, + 57,196,244,234, 89, 79,177, 0, 62,249, 4, 56,115,198,238, 9,120,243, 77,234,116,191, 83, 74, 17, 17, 17,225,125, 4,118,244, + 81,155,205, 6,155,205,134,119,223,125, 23,103,207,158,197,233,211,167,113,250,244,105,168, 84, 42, 44, 88,176, 0, 37, 37, 37, +183,243,145,104, 26,178,164,231,206,157,203, 89,117,188,200,144, 16,226,214,250,231,224,233,152, 43,246, 5, 85,128, 48,205,240, +159, 87,150,160,217, 86, 21, 82, 83, 83,225, 90,106, 88,209,163, 31,230,198, 14, 71, 72, 72, 8, 70,141, 26,133,215, 94,123, 13, + 42,149, 74,173,211,233,220,190,127, 95,148,158,198,229,190,125, 16, 21, 21, 37, 99, 89,182, 65,111, 7,231,169,240,215,243,226, + 26, 41, 31, 31, 31, 47,227,136, 18, 0,226,226,226,100, 94,218,110,204,168, 81,163, 90,148,148,148, 96,223,190,125,184,235,174, +187, 32, 20, 10,157,202, 98, 84, 84, 20,223,233, 8,214, 33,143,116,239, 53,104, 97,230,174,112,252,182,125, 49, 70,198,247, 70, +168,132, 65,104,136, 13,193, 65, 38,220,247,208, 20, 22,128,182,190,174,234, 77,185,228,238,143,207,116, 64, 0,183, 15,140,167, +135,168, 84, 42,155,207,157, 59, 23,115,231,206, 5, 0,243,219,105,111,195, 82,102, 69,112,176,196,175,100, 36, 73, 73,246,240, +225,144,241,103, 64, 5, 12, 94,251,198,224,180,254,249, 34, 36, 42, 74,102,109, 22, 2, 29,181,225,132, 94,135, 99,149,229, 56, + 94,117, 29,199,171,180, 56,161,215,226,140, 65,135,114, 83, 45,106,172, 86, 92, 50,232,157,191,233, 9,147,198, 17, 44, 91, 36, +192,178, 69, 2, 80, 8, 64, 9,131,212,105, 4, 79, 78, 19, 99,214,212,214,232,222,189, 45, 88,136, 0,248,118,203,156,171, 63, + 41, 41, 73, 86,127,159, 15,109, 38, 43,188,104, 87,228, 11,222,183, 7,209,237,124, 49,204,238,190,161, 58, 8,168, 30, 38,198, + 30,209,172,213,106, 67,146,146,146,124, 42,138, 30, 27, 27, 11,149, 74,133,117, 53,122, 24,205, 12,158, 88,255, 31,148, 73,130, + 97, 52,223,190, 50, 17, 19, 7,188, 33,203,213, 46,193,186,255,222, 48,241,191,121,211,130,184,136, 87,111, 40,148, 15,124, 42, +203, 80,102,240,202, 45,177,252, 85, 32,121,254, 88,132,231,169, 32,251,247,104, 48, 19, 0,141, 70,227, 87, 31,238,210,165,110, +244,248,152, 49, 64,120, 56, 16, 29, 13, 12, 27,208, 28, 18,177, 0, 2,230,134, 88, 73,112,176,215, 1,153, 97, 24,231, 92,255, +217,179,103, 17, 19, 19, 83,231,239,173,183,222,194, 91,111,189,133, 75,151,248,123,101,220,205,215,187, 34, 45,205,119, 11, 44, + 51, 51, 83,182,124,249,114,183,132,205,215,250,119,113, 61,223, 20,167,192,109,179, 44,191, 20,246,102, 66,192, 26, 76, 16,181, +235, 2,197, 59,239, 32, 57, 52, 28,225,154, 92,231,241, 89,255, 72,198, 27, 31,252, 7,133,203,190,198,235,253,199, 96, 74, 68, + 55,236,222,188, 25, 69, 69, 69,110,223,191,135,211, 20,232,219,175,159,140, 11,106,228, 20, 50,215,233, 25,119,251, 60, 88, 95, + 52, 45, 45,141,114,129,125,220,124,191, 43,201, 39, 39, 39,107,226,226,226,100,156,235, 63, 57, 57, 89,227,165,221,114, 68, 34, +209, 93, 15, 63,252,240,217,202,202, 74,232,116, 58, 4, 7, 7,163,117,235,214, 8, 15, 15, 71,120,120,184,183,198, 99,235,201, +179, 5, 5, 5, 25, 30, 77,251, 72,182,250,167, 33, 56,127,161, 10,109,195, 4,136,239, 73,112,119, 55,138,208, 22, 45, 42, 0, +216, 60,240, 70,160,222,192,159,212,250, 7,188, 47, 3,172, 81, 42,149, 65, 0, 66, 21, 10,133, 83, 11,236, 56,186,131, 95,154, +175, 82,169, 36,114,185, 28, 42,149,138,138,103,101,213,113, 69,242,205, 3,208,242,193,177,154,242,172,237, 48, 88, 77,168,210, + 27,112,214, 98,129,136,181, 59,234, 43, 45,181, 96, 41, 5, 5,176,253,234, 57,232,173, 22, 0,224, 49, 48, 17,204, 95, 82,183, +143,219,167, 2, 88,216, 96,194,239,103,170,177,106, 67,149, 79,247,235, 74,244,114,185, 92, 83,223, 11,224,170, 20,120,130, 92, + 46,215,100, 41,166, 64, 52,246, 51, 0,209, 40, 47,191, 17,156, 39,102, 47,195,204,180,199,211,253, 79,227,242,101,251, 64,172, + 84, 42,247,240,145,155,246, 77,102, 29,197, 43, 43, 43, 11,220,164,196,250,163, 7,125, 90,149,209,212,120,224,169,246,154, 45, + 10,138, 3,170,227, 0,128,225,125,237,153,241,254, 53,111, 49, 14, 30,239,139, 15, 54, 78,135,114,235, 83,106,229, 68,126, 4, +254,196,124, 57, 34, 35, 85,174,134, 44,180, 90, 57, 40,205,114,184, 42, 41,178,178,146,120,201,154,252,200,163,100,247,206, 93, + 20,176,187,254,101, 50,130,235, 23,194,160,215, 73, 96,172, 18, 99,253, 26,130,185,115, 41,138,203,170, 49, 44, 62, 14,211,167, + 78,227,101, 21,219,108, 54,231,124,191, 74,101,191, 86, 87,194, 47, 43, 43, 67, 89, 89,153,207,238,125,133, 66, 65, 25,134,185, +137, 84, 51, 50,148,196,143, 36, 64, 26, 74,105,157, 88, 0, 23,143, 0,111, 87,184,171,107,191,126,244,190, 55,183,127,125, 37, +199, 90, 93, 13, 81,171, 72, 8, 66,154,161,239,163,147,241,214,184, 4,188,194, 45,219, 27, 52, 24, 54, 99, 45, 68, 45,219,162, +127,156, 20, 93, 59,118,195, 71,191,231,162, 95,191,126,178,159,126,250,233, 38, 37, 32, 77,161, 0, 64,212, 0,240, 84, 90,154, +115,233,160,181, 30,217, 11,133, 2,128,222, 88,168, 72, 0, 12,112, 51,200, 14, 28, 56,144, 80, 74,157, 46,254,252,252,124,167, +139,223,245, 60,199,182, 87,242,119, 24,236,175,134,135,135,247,141,139,139,235,126,242,228, 73, 28, 57,114, 4, 54,155, 13,161, +161,161, 48, 24, 12,101,145,145,145,231,125, 49,250, 8, 33, 76,219,182,109,119, 63,244,208, 67,109,243,246,231, 99, 69,214,110, +180, 32, 98,244,108,107,194,153,235,161,184,183,167,229, 28, 0, 11,167,160, 57, 20, 74,155,167,103,226, 58,214, 5,166, 0,238, +108,240,153, 47, 54, 3, 48,187, 18,245,197,156, 75,192,116,223,201,223,149,108,220, 13, 90,124,149,128, 42,173, 78,102, 9,145, +168, 43, 25, 22, 87,106,107, 0,139, 5, 54, 74, 65, 0,252, 94, 83,129, 82, 67, 21, 40,165, 92, 18, 27, 30, 3, 19, 69,234, 52, +130,204,245, 55,250,228,201,179, 64,175,238, 86, 8,160,111, 20,249,187,118,118,127, 93, 94, 73, 73, 73,178,172,172,167,212, 64, + 1,180, 90,173,185,164,164, 68,184, 52, 1,204,194,221,163, 48,175,223, 65,167, 21,198, 87,169,112,231,117,169,191,205,145, 16, + 95,107, 14,139, 9,134,100, 22, 81,192,253,114, 63,103, 38, 64, 21, 40,159, 32,197,180,137,159,201,148, 91,158, 86,231,110,164, +136,143, 60,142, 17,242,190,216,191,251, 56,242,116,239,128,128, 64, 49,241, 83,222,247, 26, 25,169, 2, 33, 4,147, 38, 77,194, +231,159, 87,129, 51,138,237,255, 83, 71, 27,103,213, 25,144, 60, 76,193, 98,244, 24,153, 44,103,175, 90, 61,102, 12, 96,190,210, + 9, 23, 42,130,192, 58,102, 91,219,235,219,226,197,212,106,236,206,235,137,230, 29,123,242,186, 70,142,248, 47, 94,188, 8, 0, +184,114,229,138,211, 51,112,245,234, 85,231,192,234, 15,148, 74, 37,225, 18, 1,213,159,195,205, 80, 42, 9,159,124, 0,174,248, +252,243,207,235,196, 2, 44, 95,190,220,103,235,191, 62, 97,248, 11,137, 68,130, 43,197,231,209,173,123, 15,176, 86, 19,136,213, + 6, 97,243, 22,104, 62,120, 8,154, 13,186, 7,172,222, 10,155,193, 4,106,181, 1, 54, 22, 11, 87,126,128,169,211,167, 66, 34, +145,184,149,103, 93, 31,193,235,119,221,157, 23,251,158,251,115,227,227,227,101,121,121,121,106,110, 12, 24, 49, 98,132,219,182, +226, 65,254, 32,132,176, 0,118,244,236,217,115,208,199, 31,127,108,190,118,237, 90,109, 66, 66,194, 67, 5, 5, 5,175, 27, 12, +134,242, 86,173, 90, 41,250,244,233,163,245,161,237, 69, 0, 58,199, 13, 27,214, 58,109, 86, 26,206, 93, 60,167,125,124, 86,218, +200, 67,187,215,164, 95,174,214, 14, 31, 50, 58,129,109,219, 49,230, 17, 55, 94, 3,214,211, 88,224,202, 21, 13, 37,255, 9, 36, + 2,250,243, 40, 0, 13, 90, 23,254,144, 63, 71, 54, 92, 78, 0,127,148,128,110,138, 25, 26, 0,164, 84,185,154, 34, 88, 2, 29, +181,194,108,181,130,165, 44, 90,134,133,225,162,190,146, 95, 6, 59, 7,220, 45,239,187, 17, 3,224, 91, 38, 54,119, 46,254,198, +166,235,117,124,119,226,144, 33, 67,182, 44, 92,184, 80, 28, 25, 25,201, 94,190,124, 25,243,250, 93,174, 67,254,190,252,134,187, +246,247, 27,142, 44,127,245,147, 60,185, 59,135, 47, 6, 61, 32,208,100, 60,144, 65, 54,127,114, 73,186,237,232,155,234,220,141, + 0, 1,193,196, 1,111,200, 30,120,138,127, 2, 32,174, 47,217, 9,190,202, 49, 72, 1,238,120,103,117,186,221,121, 18,218, 57, +131, 0, 13, 23,215,152, 62,117,154,102,250,212,105,164, 92,247,177,212, 86, 93,173, 38, 2,192, 80, 27, 12, 82,109,133,144, 17, +194,192, 72,100,227,166,204,134,144, 18,175,215,153,144,144, 64,238,186,235, 46,122,171,222, 63,187,181,159, 65,210,210,210,168, +107, 68,187,171, 39,192, 71,113, 26,206,242,119, 81, 40, 52,183, 99,240, 26, 51,102, 12,158,222,152,137,183,170, 43, 48,112,244, +189, 96,218, 70,216,175,201, 66,237,169,123, 33, 2, 17, 8, 65,196, 2,124,158,177, 12, 45,198, 14, 65,247,238,221,255,208,212, +189,156,117,159,155,155,171, 30, 54,108,152,108,230,204,153,141,250,237,179,103,207,202,247,236,217, 83, 44, 16, 8, 54,143, 28, + 57,242,109,134, 97,174,197,197,197,229, 56, 45, 25, 23,143, 18, 33, 4,238,158,185,139, 39, 64,117,228,200,145,161, 95,173, 94, +195,136, 5, 65, 23, 38, 63, 54,121, 0,195, 48,186,123,239,159, 61, 1, 64,152,131,248,171, 1, 80,171,213,234,148, 87, 79,105, + 11,148,148,191, 3,193,199,253,239,151, 2,208, 20, 10,131, 39,242,241,101,128,147, 10,122,251,182, 0, 0, 32, 0, 73, 68, 65, + 84, 41,146,137,106,183, 74,202,158, 42, 84,235, 77,102, 88,109, 54,116, 31, 58, 24, 49,214, 97, 62,145, 97, 83, 6,163,112, 73, +127, 0,168, 57, 79,135,203, 84, 0,105,132,220,173,114,185, 92,168, 82,169,230, 47, 93,186,244,223, 46,202,197, 24,165, 82,233, + 83, 34, 18,135,167,160,201,146,151, 76,249, 61,201,209,142, 13,223,223, 20,149,202, 47, 77,255,193,103, 58,104, 30, 68,227,159, +143,157,220, 9,158,152, 63,198,153,167,156, 27,199, 86,167,239, 65,104,231, 12, 18,218, 57,201, 39,153,225, 45,158,213, 28, 40, + 6, 97,153, 11, 82,163,193, 94, 7, 32, 84, 34,215,132, 69,193,167, 21,163, 46,253, 79,228,208, 56,155,124, 94,149, 83, 2,154, + 66,150, 35, 22, 64,205,125,110,172, 60,127, 87,150,117,239,222, 29,237,158,123, 78,182, 98,215, 46,117,209,219,223, 33, 73,212, + 18,225,142,226, 61, 70,131, 21,115, 23,188, 12, 65, 72, 36,182,175, 81,226,215, 86, 4,227, 26,145,183,223,102,179,194,215, 24, +160,250, 74, 0, 31, 43,223, 75, 59,145,211,167, 79, 95,163,148,166,247,234,213,235,203,242,242,114,189, 80, 40,132,213,106,165, + 45, 91,182,116,122, 84,244,122, 61,196, 98,177,211,139,228, 65,222,168,252,252,124,176, 86,130,225, 35, 6,188,113,241,226, 69, +157, 86,171, 69,100,100, 36,219,177, 99, 71, 29,247,108, 42, 43, 43, 33,145, 72, 64, 8, 65, 80, 80, 16, 47,163,143, 83, 18,234, +127,174,239, 21, 13,224, 79,230, 1,184, 85, 74,129,223,196,152, 32,215, 32, 65,126, 71, 69,147, 58,148, 0,114, 11,230,209,109, +114,185,252,255,228,114,249,255, 53,197,245, 53,225,253,146,166, 56,231, 86,194,110,213, 3,142, 20,251,245,142, 37, 53, 74, 54, +195,118,210,132, 74, 58, 53,197,101, 90,110,101, 27, 52, 97,209, 21,141, 47,115,245, 94,148, 9,191,229, 80, 74, 73, 72, 72, 8, + 38, 77,154, 4, 71,249, 94,148,184,148,239, 61,176,103,183,179,124,239,216,184,177,112, 40,189, 13,254,222,231,186,247,200,147, + 17, 47,223, 76, 76, 60,171, 9,242, 80, 2, 26,141,123,238,185,199,100,181, 90,115, 0,232, 89,150,165,102,179,125,225,207,181, +107,215, 0, 0,205,154,217,151,246,114,251, 69, 34,145,199,246,123,224,129, 7, 56, 25,187, 88,150, 69,120,120, 56, 88,150,117, +174, 56,113,172, 98, 33,181,181,181, 20, 0,196, 98, 49, 8, 33,204, 31, 49,182, 7,224, 63,248,164,146, 6, 0, 50,112,224,192, +128, 38, 22, 64, 0, 1, 4,240,231,129, 21, 64, 45, 0, 73, 19, 27,113,222, 10, 6,241,174, 40, 24,192,159, 3,129,135, 25, 64, + 0, 1, 4,240,231,130, 16, 64, 51, 30,228,111,128, 61,136,187,169,248,128, 69, 96,217,223, 95,174, 35, 5, 16, 64, 0, 1, 4, +240,215, 67, 72,128, 47, 2, 8,120, 0, 2, 8, 32,128, 0, 2, 8, 32,128,128, 2, 16, 64, 0, 1, 4, 16, 64, 0,127,119,212, +113,233,204,153, 51,199,239, 8, 78,119,197,123,238,116,121,209,131,131, 16, 28,116, 5, 34,113, 5, 88,214,190, 44, 76, 32, 96, +192, 16,129,253,127,134,128, 16, 6,148, 8,237,107, 96, 97,197,150,109, 34, 80, 74, 17,201,180,132,143,215, 23, 4,160, 21,236, + 1, 60,213,176, 47,247,178,192, 49,167,246,103,108,191,128,188,128,188,128,188,128,188,128,188, 59, 83,158,207, 10,192,223, 13, + 63,238, 63,131,161, 67, 44,136, 8, 7,180, 58,130,159,127,149, 64,200, 8,113,255,120, 27,118,171, 91,131, 16, 6,132, 97, 32, +105, 14,140, 25, 90, 1, 64,136,123,227, 41,242, 11,132,118, 26,231, 1,245,193,253, 20, 0, 68,212,130, 97, 35,199, 20,159,254, +237, 39, 83, 89, 85,109,140,205, 80, 11,185, 92, 30, 14,160, 50,160,135,254,185,145,253,205,127,165, 61,186,119, 83, 95,187, 86, +219,168,132, 79,127, 34, 72, 83, 83, 83, 93,243, 0, 52,234,158, 83, 83, 83,253, 78, 7, 28, 64, 0, 1, 52,145, 7,128,195,154, +175,190,224,173, 77, 60, 49,115,150,215,151,181,169,229, 53, 37,242, 11, 68, 72, 76,176,225,215,223,130, 33, 22, 9, 33, 20, 8, + 33, 18, 81, 4, 9, 44,128,176, 57,132, 48, 98,104, 95, 43, 36,226, 32, 80, 0,237,219, 2, 15,222,207, 98,207,102,126,228,127, +230,247,211,184,171, 79,119,116,136, 10,199,197,226,147, 93,194,218,117, 67,171, 14, 54,252,240,253,247, 80,169, 84, 21,183,123, +125,188, 74,165,186, 63, 43, 43,107, 27,183,157,148,148,244,128, 92, 46,223, 22,120, 53,188,227,183, 95, 85,212, 90,123, 92, 54, +237,193,238,106,150, 45, 71,101, 7,163,250,228,177,141,168, 49,181,199,144,216,145,127, 89, 18, 75, 77, 77, 85,207,155, 55, 15, +132, 16, 94,101,123,249,128, 75, 22,211, 4,229,230, 3,104,164, 2,230, 17,148, 34,243,243,207, 27,124,222, 92,130, 31,215,108, +129, 92, 13, 1,151, 90, 2,206,231,236, 90, 25, 49,128,166, 5,151, 13,144,131,187,220, 0,119,148, 7,128,193, 31,219, 15,238, + 31,103, 1,133, 0, 66,129, 8,195,135, 17,180,105,205, 64, 40,100, 16, 36, 18,160, 87, 12,131,226, 11, 86, 12,141,101,208, 50, + 82,130, 31,246,182, 0, 0, 8,168, 17,246, 84,216, 54,175,228,255, 91, 65, 1,186,118,232,136,223,114,243,112,200,108,129,238, +186, 14,226,160,230,232, 61,104, 4, 6,140, 24, 7,245,150, 44, 0,252,114,227,223, 2,226, 31,147,149,149,181,103,225,194,133, + 40, 40, 40,224, 58, 76, 5,128,231,102,207,158,189, 53, 41, 41, 73, 46,151,203,247,252,229, 94,138,159, 85, 52, 72,168,133,144, + 49,163,182,214,134, 74,125, 48,238, 29, 53,197,167,246,223,152,253,149,180, 69,176, 22,255,152, 58, 24, 93,187, 60,168,110,209, + 34, 12, 22,171, 21,215,174, 93, 71,219,146, 11, 40, 60, 91,132,131, 7,180,116,248,136,135,252,122,174,153,153,153,212,101,112, +190,211, 6, 71, 41,112,163, 28,174,163, 58,160, 20,183, 41, 29,240, 31,248,190,208, 77,155, 54,221, 92, 79,225,182,145, 23,149, + 18, 16,208, 38,104,119, 90,242, 13,200,161,217,174, 28,239,200,146,233,168,134,228,130,217, 25,122, 12,157,250,177, 71, 69,238, +135, 31,126,112,110, 39, 38, 38, 98,199,142, 29, 30,183, 3,184,245,228,239,186,207, 85, 17,240,168, 0, 28,216,127, 8, 35,238, + 29,246,135, 93, 52,235, 67,254, 84,215, 84,146,254,102,159, 98,132, 2,232,180, 66,180,107, 35, 66,187, 54, 98,212,212,136, 32, + 17, 9, 97, 19, 6, 97,112,127,130,129,119, 11,192, 16,145, 61, 5,166, 72, 12, 17, 99, 2,145,136, 97, 53, 0, 86,232, 61,146, +255,254,189,123,208,173,125,107, 28,251,245, 24, 22,189,253, 70,157,235, 91,242,230,187,148, 17, 16, 12,142, 29,140, 31,118,236, +241,169,242, 30,203,178,210,130,130, 2,245,153, 51,103, 16, 28, 28,140,224,224, 96, 89, 98, 98,162,198,199,193, 76,150,149,149, +181,135, 35,126,151,206, 17, 14, 96,220,127,254,243,159,235,179,103,207, 86, 1, 72,144,203,229,170, 59,177,131,175, 90,181, 74, +154,146,146,194,251,190,191,222,176, 70,218, 47,166,185,186, 75,251, 90,132,181, 8, 2,195,132,192,104,180,162, 92,107, 68,142, +106, 5,149,180, 24,140, 97, 67, 71,241,234, 71, 34, 92,193,164, 7,238, 86,247,237,219, 27,151,175,232,112,248,231, 35,168,169, +209, 35, 44,172, 57,162,163,187,128, 17,136, 96,179,149,224,231, 95,246,211, 65, 3,239,253, 75, 89, 55,169,169,169,234,231,159, +127,222,185, 61,111,222, 60, 44, 95,190, 92,253,185, 7,171,208, 39, 50,186, 67, 61, 0, 14, 37,157,102,103,103,195, 93, 97,165, + 63, 18,174, 86,182, 82,153, 33,163,180,113, 74, 0,211,229, 81, 39,121,231,191,215,204,173, 25,214, 46,156, 65, 84, 36,243,167, +125,126,127, 87,184,146,189, 59,165,192,171, 7,224,192,254, 67, 0,208,104, 69, 96,255,115,133, 30,143,223,251, 81, 15,191, 7, + 11, 66,136, 95,213,246, 84,154, 54, 16, 9, 69,232,212,161, 6,213,213, 34, 28, 62,214, 9, 2,129, 0, 2, 34,128, 88,100, 69, +223, 30, 6,244,236, 33, 0, 1, 3,177, 40, 8, 98, 1, 65,236,221,102, 68, 70,176, 88,247,165,103,217,189,187,181, 69,241,217, +178,155,200, 31, 0, 22, 45,126,133,188,251,246,191,105,251,248,187, 17, 17,222,156,247,245, 26,141, 70,233,242,229,203,213,197, +197,197,117,244, 13,147,201,132,135, 30,226,111,109,102,101,101,237,117, 37,127, 55,104,149,158,158, 94,241,194, 11, 47,236,190, +221, 83, 20, 13,145,255,161, 67,135,212, 41, 41, 41,188,175, 45, 38, 58, 82, 29,213,182, 10,173, 90,134,162, 99, 84, 59,132,132, +134,160,184,184, 20, 54, 27,139,168, 14,205,113,252,247, 92,172, 62, 85, 40, 77,126,124,150,199,193,244,232,209,253,244,145,137, +189,209,185,115, 71,156,248,189, 24,135, 15,255,142,107,215,171, 65, 41, 16, 17, 17, 12,131,161, 6,131, 6,245, 69, 69, 69, 37, + 74, 15,255,140,175,254,119, 90, 58,243, 31,252, 21,149, 59, 28, 82,192, 94,124,138,195,135, 31,126,200,109,251,228, 5, 72, 77, + 77,165,174, 46, 97, 87, 11,210,213, 37,221, 20,211, 11,111,191,253, 54,237,212,169, 83,163,115,241,203,229,114, 66, 8,161, 27, + 55,110,244,152, 99,159, 67, 90, 90, 26,117,231, 33, 88,189,122,181,148, 43, 14,228, 78,137, 85, 40, 20,180,161, 84,174,174,245, + 28, 40,165, 80, 40,210,212,141,241, 66,212,151, 55,244,229, 26,252,244, 94,179, 58,196, 31,192,159,211,250,175,223,135, 26, 53, + 5,208, 88, 69,224,222,143,122, 52,168, 4,248, 67,254, 28,114,114,114, 80, 90, 90, 10, 0,136,138,138,162,190, 40, 1, 2,106, +132,144,216, 32, 22,137,240,243,177,214, 16, 8,133,104, 46,210,219,227, 0,154, 49, 40, 45,109,142,187,251,178, 32,132, 32,233, + 65, 43, 40,203, 0, 36,200,238,120, 67,117,131,114, 13, 21, 23,112, 69, 91,131, 23, 94,127,189,193,107,169,168,212, 66,119,237, +138, 67, 22,111,226,174, 79,254, 0,128,237,219,183,195,102,179, 73, 31,121,228, 17,175, 3,156, 74,165, 26, 83,191,244, 47,215, + 97, 42, 43,235,196, 35,134, 47, 94,188, 24, 42,149,106,236,157, 52, 21,192,145,191, 47,223,249,122,195, 26,233,221, 49, 38, 4, + 7,135, 67, 18, 36, 70,183,110, 93,209,169,107, 87, 84, 85,105,160,213,214, 64, 44, 22, 32, 50, 66, 2, 97,112,184,199, 92,241, + 0, 32,164,165,104,222,172, 37, 12, 70, 43,142, 29, 43,196,165, 43,149,184,124,165, 6, 70,147, 4,157,163,172,144, 4, 9, 80, +120,186, 8,119,117,239,142, 75,151,171, 96,180,182,240, 42,211, 65,116,212,219,126, 95,167, 3, 26,146,233,143, 44,206,250,159, + 55,111,222, 77,251,159,127,254,121,191, 98, 1,220,145,104,253,185,227,166,242, 42,228,230,230,170,209,200,130, 60,123,246,236, +161, 89, 89, 89, 72, 74, 74,130,187,233, 0, 62,158, 42,142,252, 1, 32, 63, 63, 95,205, 48, 76,157,107, 90,189,122,181,148,143, +209, 19, 31, 31, 47,227,228, 52,133,199,101,227,243,161,152,178, 92,239,150,248,163, 34, 25,199, 40,197,239,241, 38, 38, 38,214, +241,146,220,119,223,125,117,218, 42,224,246,191,115,224,115, 12, 64, 83,121, 4,154, 18,133,133,118,197,162,180,180,212, 39, 37, + 64, 40, 20, 66, 36, 16, 65, 36, 34, 24, 53, 2, 48,232, 77, 56,119, 86, 12,145, 80, 4,161, 77,136,184, 97, 20, 98,145, 8, 2, + 1, 3, 80, 2,173, 14,248,233,136, 16, 44,203, 2,184,214,160,220, 35, 63,159, 69, 77, 77,195, 25, 56,223, 95,188,152, 6, 5, + 73, 96, 52, 86,194,198, 90,121,223,231,145, 35, 71, 26, 86, 58, 12, 6, 94, 68, 83,223,245,239, 78, 51,220,178,101,139,235,249, +170,219,225, 5,112,231,226,119, 37,255,248,248,120,222, 85,232, 58, 70,181, 85, 51,204, 5, 88,109, 44,204, 22, 43,174, 93,215, + 66, 36,150,192,100,178,192, 98,181,193,106,101, 97,181, 81, 84,232,174,123,149, 37, 22,233, 33, 9,238,136,242,242, 74, 84, 85, + 27,160,213, 25,209,162,229, 0, 12,191,251,110,228, 31,216,129, 14,102, 43, 42,171, 42,209,179,103,119, 4,137,133,208, 87,107, +255, 42, 99,133,148, 82,234,156,251,119,197,138, 21, 43,252,138, 5,152, 55,111, 94, 29,111, 66,253, 99,124, 21, 0,123,169,103, +206,162,141,196,216,177, 99,235,244, 87,206, 64, 40, 41, 41, 81,171, 84, 42,191, 10, 83,169, 84, 42, 39,249,115,211, 1,155, 54, +109,242, 74,174,245, 61, 85,185,185,185,106, 46,240, 77,161, 80,208,188,188, 60,117,114,114,178,243,120, 94, 94,158,154, 16,207, +151, 23, 31, 31, 47,115, 45, 51,156,150,150, 70, 61,181,149,183,241, 48, 41, 41, 9,147,227, 85,216, 0, 96,234,114, 61,238,121, +185,198, 99,219, 15,157,234,185,173,234,207,241,123,139, 9, 8,224,214,123, 3, 26,242, 0,252,161,254, 29,119,150,126, 99,172, +255,122, 22, 43, 10, 11, 11,177, 98,197, 10,222,165, 38, 5, 2, 33,226,134,178, 16, 48, 66,252, 84, 32,193,169, 66, 9, 38,140, + 7, 30,184, 15,152,152, 72,208,190,173, 24, 18,113, 16, 36,226, 32, 4, 75,130, 16,213, 62, 8, 18,177, 4, 18,177,231,146,152, +175, 45,122,149, 44,125,239, 45,210,208, 64,210,189, 91, 23,132,133,135, 66,194,154, 81, 99,176,252,225,157, 98,255,254,253,123, +246,239,223, 95,135,240, 93,255, 0,160,188,188, 28, 19, 39, 78,188,109, 86,126,126,126,190,218,213, 26,226,246, 1,192,176, 97, +195,124,178,228,108, 54, 64,111,176, 64,175, 55,163,170,202,132,171, 87,117,184,116,233, 58,170,171, 77,168,169,177,160,166,198, + 12,189,222,130,202, 10,239, 43, 50, 77, 38, 43,106,107,109,176, 88,204,104,222, 92,140, 78, 81, 45, 16, 18, 26, 10, 0,136,238, +222, 21, 29, 59,180, 64, 88, 11, 9, 40,181,193, 98,101, 97, 50,233,255, 18, 3, 73,106,106,170,122,254,252,249, 30,201,156, 91, + 26,200,211, 59, 33,115, 40, 13,110,177,124,249,114,124,254,249,231, 62,151, 26,182,187,197, 21,212,245,143, 35,212,210,210, 82, +100,101,101,249, 92,138,118,207,158, 61, 52, 59, 59,219,149,252, 33,151,203,201,228,201,147, 61,126,111,206,156, 57, 32,132, 56, +173,250, 85,171, 86, 73, 1, 32, 46, 46, 78,230,170,196,186, 30,167,148, 58,143,243,184,219, 58, 86,188, 59,197,193,155, 50, 1, + 0,173, 90,181, 2,113,177, 30, 26, 43, 47,128, 59,143,252,221,109,251,229, 1,184,147, 44,255, 27, 3,188, 13, 2,129,192,231, +239,141, 24,202,162, 77,235, 32, 84, 85, 9, 17, 36,180, 34, 72, 44,128,230,144, 24, 19,100, 34,136, 69, 34, 84, 85,137,112,160, + 32, 20, 45, 36, 4, 12,195, 32, 81,110,198, 67, 19, 40, 24,134,226,157, 95,124,191, 78,149, 74, 69, 5, 33, 18,104, 69,173, 16, + 98,185,136, 51,165, 20, 99,164,163,120,127,127,208,160, 65, 56,120,240,160,219, 99, 33, 33, 33,188, 7, 75,157, 78, 55,214, 49, +240, 32, 57, 57,217,185,191,188,188,220,249, 57, 57, 57, 25,101,101,101,183,229,121,166,164,164,104,242,243,243,145,155,155,171, +102, 89, 86,198, 48, 12, 56,203,191,161,121, 83, 79, 40,185,112, 73,214,186,133, 65, 29, 36, 22,192,108, 97, 81,107,186,136, 11, + 23,203,161,213, 85, 65,171, 53,160, 92,107, 68,185,214,136,240,200,174, 94,101, 93,189, 78,113,229,234,117,244,238,221, 29, 21, + 58, 29, 68, 66, 6, 85,213, 23,161,175, 96,209,231, 46, 61,218,182,110,141,144,144, 16, 4, 5, 5,227,242,149,106, 16, 65, 4, + 95,130, 37, 46,228,216, 36,171, 0,154,122, 5, 65, 67,214, 58, 80, 39, 22,128, 47, 52, 0, 48,119,238,220,155,188, 10, 46,211, + 12, 26,127,174,115,202,148, 41,117, 44,216,172,172, 44, 39,121, 61,250,232,163, 72, 72, 72, 32,124, 19,167,184,177,252,157,168, +239,105,168,143,129, 3, 7, 18, 74,169,211,202,207,207,207, 87, 19, 66,156,165,129,147,147,147, 53,185,185,185,200,205,205, 85, + 39, 39, 39,147, 67,135, 14, 57,143,175, 92,185,178, 65,185,185,185,185,106,134, 33,178,188, 60,251, 59, 49,103,206, 28,252,242, +203,207, 50,142,194,243,242,242,212,220,253,243, 81, 38, 86,174, 92,137, 79,101, 17,152,186,194, 0,192, 62, 29,224,138,169, 43, + 12,206,246, 76,145,137, 2,204,250,103, 81,218, 23,190, 95, 87,233, 94,250, 18,126,249,229, 23,254,171, 0,110, 5,241,187,198, + 2, 52,198,250,175,107,201,215, 37,255,196,196, 68, 40, 20, 10,175, 83, 1,173, 90, 9,192, 16, 1, 90,183, 18,160, 71,119,138, + 75,151,132, 96, 4, 4, 34,161, 16, 34,161, 8,191, 29, 13, 69,100,168, 8, 2,129, 0, 35,134,217, 16, 28, 28, 4,150,165, 0, +181,249, 69,254,205,218,118,194,213, 26, 10,253, 25, 13,132, 68,128, 23, 23, 47, 34, 62, 14,108,178, 11, 23, 46,168, 47, 92,184, +112,211,253, 78,154, 52,137,215, 96,153,148,148,148, 80, 94, 94,190,155, 35,121, 0,152, 56,113, 34, 86,175, 94,237, 60,167,170, +170, 10,101,101,101,216,186,117, 43,146,146,146,198,220,142,206, 27, 23, 23, 39,203,205,205, 85,231,231,231,171,185, 96,177,184, +184, 56,191,230,112,103,254, 35,229,255,217,251,242,240,166,170,252,253,247,220,236, 93,105, 75, 41, 75,217,165,130,108, 5, 42, + 32,107, 2, 5, 20,176, 34,180,200, 38, 95,100,102, 26, 24, 87, 96, 20, 69,231,231,204,168, 40, 46,128, 35, 35,180,140,138, 11, + 21,105, 21, 44, 88, 4, 10, 9,139,136,149,138,128, 44,178,148,181,133,174,105,211, 52,123,238,249,253,145,222,152,134,180,185, + 73,195, 58,247,125,158, 60, 77,238,189,249, 52,247,220,115,206,251,217,206,231,104, 55,124,153, 9, 90,172,135,209,100,131, 78, +102, 6,133, 14,102,179, 29,122,189, 5,101, 21, 70,148, 92, 53, 96,184,170,163, 79, 89, 38,107, 75, 20,157, 47, 71,151,206, 29, +208,185,115, 60, 42, 43, 43, 16,213,194,129,110,221, 34,209, 42,182, 11,228, 10, 5,170,171, 13, 40,252,229, 20,174, 20,235,209, + 58,190,231, 29, 59,129, 80,128, 18, 2, 21,199,165,238,164,218,212,186,125, 90,159, 44,120,189,249,136, 6,171,202, 50, 51, 51, + 85, 43, 87,174,212,120, 42, 0,203,151, 47,231, 10, 12, 53, 41,143, 82, 74, 9, 33, 68,173,142,114,251, 77,244, 58, 98,206,206, +118,134, 8, 82, 83, 83,121,185,255, 27,134, 20,118,121, 37,127,190,120,224,129, 7, 84, 7, 15, 30,212,112, 94,135,161, 67,135, +170,188,157,231,146,241,124, 17, 54, 23, 91,255,225,135, 3, 26, 66, 8, 8, 33, 72, 76,236,171, 74, 76, 76,212,186, 41, 8,245, +215, 2,190,198, 11, 39,143,153,170, 3, 39, 47,109, 84,167, 6, 15,106,234,138, 19, 46,121,124, 32,228, 0,220, 57,240,169, 0, +220,142, 22, 63,135,105,211,166, 53,235,251, 12,195, 64, 36,114,190,122, 36, 48,232,215,219, 1,153, 84,238, 84, 0, 36, 18, 12, + 25, 4,200,100,128, 68, 36, 67,203,150,114,136, 68,117,112, 56, 88,176,172,255,110,123, 99,213, 53,200,227,187,227,124,254, 23, +136, 21, 51,120,252,229, 37,126, 79, 40, 10,133, 66,187,100,201, 18, 85,115,150, 1, 38, 39, 39,231,171,213,106, 60,245,212, 83, +174, 99,156,165,175,215,235, 97, 52, 26, 49,119,238, 92, 0,192,135, 31,126,136,140,140, 12,205,173,120,182,115,230,204,209,178, + 44,171,226, 44,255,129, 3, 7, 54, 43,129, 43,190,227,189, 56,116,112, 59, 90,181, 12, 65, 72,136,179,219, 91, 44, 14,232,107, +173,168,210,153,208,190,115, 79, 12, 27, 50,210,231, 51, 25, 63,126, 10,217,177,237, 19,122,176,224, 56,134, 15,237,139,142, 29, + 59,194,102, 53,163, 95, 98, 31,132, 70, 70,226, 98,209, 37, 20,151, 84,227,135, 31, 79, 66, 87, 27,137, 71, 31, 24,121,199,250, + 76,231,207, 83, 3,128, 6, 32,152,175, 86,187, 8,156,245, 32,125,134, 33, 78,109,161,158,151, 9,128,190, 94,226,141,243,212, +106, 10, 10,183, 76, 21,130,244,244,244, 6, 94,128,103,159,125, 22,132, 16,204,155,167,214,112,236, 15, 2,244,237,155,232,141, +188, 92,238,120, 95, 36,199,151,252, 61,145,154,154,138,209,163, 71,171,154,211,143, 81, 31,171, 31, 52,104,144,106,246,236,217, +218,198,206,187,197,246, 27, 5,151, 59,192, 41, 95,206, 48, 2,209,122, 42, 21,124,127,159,167,188,141, 11,194,156,141, 46,143, +115, 93,179,113,193, 37,151, 66,176,253, 72,211,115,159,183, 58, 0, 66, 14,192, 29,170, 0, 12, 25, 58,240,134,196,124,130,101, +249,187,119,164, 64, 80,165, 35,104, 19,199,184, 74,254,238,216,229,140,239,203,100,114,200,164, 50, 60,252, 16,129, 92, 38,133, + 66, 78, 80, 85, 41, 66, 65, 97, 56, 28,172, 3,237,227,253,139,235,230,231,231,211,106,163, 9,186, 67,121,232,214, 94,130,223, +138, 3,143, 11, 51, 12,163, 29, 56,112, 32, 25, 56,112, 96,192, 50,210,210,210, 84,171, 86,173,210,112,110,254,202,202,202,199, + 6, 13, 26,100,216,185,115,231,119,143, 60,242,200,216,202,202, 74,242,248,227,143,111, 79, 75, 75, 83,221,202,206, 89,239,234, + 87,185,189, 15,188,207, 57,201,157,158, 62,117, 2, 37, 69, 23,193, 48, 4, 14, 7,133, 92, 17,141,132, 30,189,240,232,164, 52, +222, 29,189,164,156, 85, 85, 85,150,104,204,102, 59,122,247,234,130,118,109, 91,226,210,229, 82,232,142,157,195,239,167, 47, 97, +215,238,163,184, 88, 76,241,231,191, 60, 29,208,224,185, 93,138,255,176, 95, 69, 5,124, 93,191,165, 60,229,157,251, 4, 43, 87, +174,116, 41, 0, 43, 87,174, 4,138,214, 93,119,173, 55,121,141,120, 5,174,155,179,154, 91,172,135, 16,210,172,190,199,145,124, + 99,228,238,235,188, 55,175,130,199,119,189,201,227,255,156, 47,126,141,156,149,179,157,115,195,168, 14, 13,200, 31, 0,210,198, +223,239,124,163,251,213,167, 2, 32,212, 1,184,125,144,185,236,197,235,194, 0,126, 41, 0,183,115,194, 71,160,197,127,220,113, +232, 23, 25,228, 82, 41, 30, 30, 79,192, 16,130,129, 73,118, 28,251, 77, 1,134, 56, 99,254,213,213, 12,218,182, 22,129, 33, 82, + 28, 57, 38,133, 92, 6, 88,109, 86, 92,188,164,240,139,252,207,157, 62,140, 65,163, 39, 66,220,114, 16,206,157, 46,128,248, 90, + 14, 94,120,254, 37,250,246, 59,111,222,146, 6,174,175, 87,175, 74, 74, 74,210, 44, 94,188, 24,189,122,245, 42,211,233,116, 72, + 74, 74, 82,233,116, 58, 60,243,204, 51,154,180,180,180,219,162,174,125,115,137,223, 83, 9, 24, 54,100, 36,214,125,254,145,178, + 77,235, 54,154,208,208, 80, 94, 86,255,117, 19,236,236, 63,105, 1,144,245, 95,100,208, 19,191,255,132, 54,113, 97,144,203, 37, + 48, 24,172, 40,190,170, 7, 17,183,199,159,255, 50, 91,200,150,226,131, 95, 22, 1, 93,159, 64,131,229,133,133, 11,155, 67,214, +205,254, 73,243,230, 69,187, 41, 18,193, 33, 52, 95,164,236, 15,105, 55,183,158,129,183, 54, 75,123, 64,230,188, 87,211, 85,231, + 75,192, 29,139,196,196, 68, 87,194, 95,230,178, 23,175, 59,231, 83, 1, 8,118, 61,254,155, 93,223,223,175,206, 15, 2,157,142, + 32,164, 53, 65, 76, 52, 65, 82,127, 27,228, 82, 17,100, 82, 27, 98,162,229,245,147, 0,193,224, 36, 7, 10,126,145, 56,189, 5, + 60, 39,153,252,252,124,218,243,222, 8, 44,122,246, 95, 48, 73,227,241, 77,126, 49,186, 38, 56, 45,247,176,159,183, 98,209,223, + 94,162,239,189,123,235,148,128,228,228,100,146,159,159,175, 92,182,108,153,198,221, 59, 16, 12,229,234,118, 70,125,177,159,102, +223,227,204, 89,106,178,255,192, 30, 90, 94, 89, 14,211, 53, 35,228,242, 24,196,119,238, 19,144, 82,113,167,193, 89, 14, 59, 72, +183, 89,180, 14,174, 21, 1, 69,159,222,242,123,243,149,220,119,183, 97,236,196,199,252,178,220,125,249, 30,133, 28,128,219, 75, + 9,104,140,252,125,122, 0,254, 23, 64,225,204,234, 39, 12, 5, 5, 69,116, 11,138, 61,251,197,144, 75, 37,144, 73,197, 72, 25, + 79, 65, 41,139,168, 24, 59,236, 14, 2,150,117,212, 79,126,190,209,167,147, 1, 19,166,164,193, 32,238,134, 86, 97,161,152,241, +104, 52,178, 54, 29,115, 41, 1, 54,199, 55,183,252,254, 57, 69, 64, 24, 50,129,123, 21,238,214,123,203,212,189, 69,210,163, 94, +188,158, 25,178,163, 3,149,135,244,168, 23,175, 63, 81,184,176, 89, 86,191,128,230, 33,245,201, 85, 65,235,195,119,187,241,112, +167, 41, 1, 62, 13,224,196,196, 68, 33,104, 35, 64,128, 0, 1, 2, 4,252,143, 65, 40,244, 44, 64,128, 0, 1, 2, 4, 8, 10, +128, 0, 1, 2, 4, 8, 16, 32, 64, 80, 0, 4, 8, 16, 32, 64,128, 0, 1,130, 2, 32, 64,128, 0, 1, 2, 4, 8,184, 59,208, + 96, 21,192,252,249,243, 3,206,224,244, 86, 91, 59,216,242,102,206,157,231,243,123,117, 85,215, 92,239, 67,163, 91,187,222,175, +255,120,205,117,215,198,170,254,236, 83,222,206, 21,127, 84,204, 27,179, 96,149,235,125,185,230,191, 8,228,247, 53,134, 64,127, + 95, 99,240,246,251, 38, 61,174,246,249,189, 67,154,239,208,169, 83, 39, 92,184,112, 1, 73,170, 9,174,227,155, 63,207,184,225, +237,247,231,171, 87,155,236, 47, 22,177, 88,185,168,184,216,181,100,113, 85, 92,156,235,250,255,182,105,115,195,251,159,167,188, +220,220, 92,101, 94, 94, 94,131, 74,137,227,199,143, 87,165,164,164,104,111,197,248, 56,124,248,112,192,242,250,245,235,119,163, +127, 31,153, 63,127, 62,110,231,249,229, 86,200,203,202,202,154,222,187,119,239,172, 99,199,142, 77,153, 49, 99,198, 55,205,149, +231,190,209,145,123, 70,254,221,218,126,130,188,198,229,249,173, 0,120,194,110,183, 43,205,102, 51,136, 72, 2, 66, 8, 28,118, + 27,164, 18, 49,100, 50,153,182,185,154,135,221,110, 87, 2,128, 88, 44,110,150,172,186,170,107, 8,141,110,237, 34,254,214,237, + 59, 1, 0,174, 93,190, 16,144,188,157, 43,158,194,152, 5,171, 92,196,245,159,220, 2, 0,192,147, 41, 3,113, 55,226,144,230, + 59, 36,169, 38,224,144,230, 59, 0,192,132,212,153, 0,128, 11, 23,110,125,251,253,187,180, 84,121, 26,208, 36, 0,170,211,128, +115, 15,245,197, 47, 0, 0, 6, 46,123,251,150,182,155, 86,171,165,121,121,121, 48,155,205, 13,142,203,229,114, 77, 68, 68, 4, +148, 74,229,109,185, 28,138, 16, 50,236,222,206,237, 62,165, 14,135,241,244,165,107, 47, 81, 74,183, 10,118, 80, 19, 74,167,197, + 50,234,240,225,195, 17, 37, 37, 37,173,163,163,163, 91, 12, 24, 48,160, 56, 60, 60,252,243, 64,229,101,101,101,141,158, 49, 99, +198,158,172,172,172, 63, 3,136,156,246,196,188,185, 0,216, 99,199,142,205, 6,176, 25, 0,235,143, 60,110,207, 19,142,248,155, + 51,222, 60,119, 73, 12,214,146,190,198,148, 18, 1,183,153, 7,192, 29,250, 90,131,178, 77,194,253,154,145,189,187, 35, 68, 38, + 1,165, 20, 14, 7,197,111,103, 46,226,252,209,125, 42,133, 76, 2,145, 72, 20, 16,121,135,201, 47, 40,123,118, 43,210,252,118, +186,139,170,206,210, 41, 96,226, 7, 0, 69,100, 12,234,170,174,185,136,191, 41,143, 0, 31, 75,117,224,204, 23,177,115,197, 83, +174,129,212,216,117, 77,173,177,244,252,159, 82,169, 20,128,179, 76, 38,203, 58,199,183,195,225,112,253,126, 70, 36,225,109, 69, + 3, 64,155, 86,206, 82,157, 86,125, 53, 44,118, 59, 0,192, 96,119,202,235, 60,246, 79,184,167,103, 63, 94,196, 15, 0,125,135, +140,198, 33,205,119, 46,226,111,236,186,155,217,126, 0,240, 84,105, 41, 5,128,113,161,161,216, 94, 87,167,225,136, 31, 0,126, +223,177,243,186,235, 18,219,180,225,245, 59,107, 66, 43,148,133, 21, 63,163,248,210, 17,116,235, 56, 24,131,229, 74,191,251,112, +110,110,238, 35,219,182,109,227,200,223, 14,192, 12, 32, 4, 0,107, 54,155,197, 10,133, 2,122,189, 94,233,205, 19,112,139,201, + 63,238,254,196,222,219,182,127,185, 38,172,174,248, 36,134,165,205,207, 34,132,204,166,148,110,190,221, 38,166,252,252,124,218, +156,250, 20,124, 54, 3,107, 10, 54,155, 77, 89, 80, 80,160, 57,126,252,184,235, 88, 69, 69, 5, 78,159, 62,141, 54,109,218,124, +166, 84, 42, 85,225,225,225,124,159, 47,147,149,149,245, 79, 0, 15, 12, 27, 55, 73,145,149,149, 21, 55,237,137,121,225, 0, 28, + 0,184,142,123,111,253,117, 35,248,222, 31, 55,222,212,106, 53,109,108,188,113,215,249, 26,111,106,181,154,238,253,177, 0, 34, +145, 24, 14,135, 29, 53,181, 6,204,152,242, 8,125,247,221,119,155, 69,216,158, 74, 69,115,159,139, 0,223,240,182,237, 47, 7, + 94,149, 0,235, 76, 86,229,232,148, 25,154,246,173, 34, 17, 34, 23,131,101, 89, 56, 88, 64, 44, 34,136,142,236,142,158,221, 58, +104,242,183,127,167,114,216,234,148,254, 42, 1, 86,171, 85,217,163,231,121, 77,223,238,231, 33, 98, 28, 26,237,161,118, 42,169, + 68,226,151,140,186,170,107, 80, 68,198, 32, 50, 34, 28, 0, 92,127,189, 93,215,186,125, 39,159,222,128,157, 43,158,194,192,153, + 47,226,255, 30,155, 12, 0,174,191,222,174,251, 79,110,129, 95,218,181, 72, 36, 66,124,124, 60, 68, 34, 17,172, 86, 43,234,234, +234,224,112, 56,160,211,233, 2,122,184, 97, 98, 17, 62, 94,185, 9,178, 72,160,244, 2,240,179,161, 24,229,215,206,226,243, 21, + 47,249,101,245,247, 29, 50, 26,241,109,157, 33,146,120, 47,228,223,169, 83, 39, 87, 56, 0, 0,174, 92,185, 18,148,246,227, 83, + 92,245,169,210, 82, 58, 46, 52, 20,175, 61,245, 36, 0,224, 53, 55,226,255,226,244,233,134,228,239, 71,181,214, 61, 23,190, 80, +118,124, 66,172,121,177,195, 44, 88,216,100,200, 88,138,147, 21,187,240,201, 59, 27, 85,169,125, 50,248,246, 65,113, 94, 94,222, +102,147,201,132,117,235,214,153,231,204,153, 35, 7, 16, 6,128, 93,183,110,157,117,206,156, 57, 98,147,201, 4,185, 92,174, 73, + 73, 73,105,214, 68,247,205, 55,223, 40,119,236,216,161,105,110, 45,123, 87,223,145, 50,255,239,131,215, 94, 80,180, 56,241, 37, + 20,191,239,198, 63, 70, 69,133, 63,179,165,252, 95,245,150,231,109, 69,254, 27, 55,110,132, 78, 55,134,102,103,167,249,125,239, + 31,127,252,177,178, 57,100, 83, 87, 87,167,204,205,205,213,212,214,214,122, 61,127,245,234, 85,228,228,228,104,122,244,232,161, + 26, 60,120,176,175,126, 67,178,178,178, 62, 31, 54,110,210,212,211,135, 15,136,227,219,182,182, 79,123, 98, 94,131,121,119,247, +119,223,160,119,239,222,221,179,178,178, 30,234,221,187,119, 46, 0,236,223,191,191, 73, 82,229, 51,222,212,106, 53, 5, 33,128, +143, 42,127,107,214,172,161,215,202, 42,112,248,183, 19,174, 99,102,179, 5,111,127,144,105, 80,207,153, 46, 16,246, 93,140,235, +146, 0,107,107,107,149,195,198, 62,170,233,222, 33, 6, 50, 9, 3,150,101,113,237,218, 53, 28, 59,114, 24, 86, 59, 11,150,165, +136,137, 12,193,216,135, 38,106, 76, 22,187,223,255, 80, 38, 41, 67,215, 14,215, 0, 17,193,125,221, 46, 67, 38, 46,245,219,242, +119, 39,255,235, 44, 60,125, 45,174, 93,190, 0, 69,100, 76,163, 94,129,166,200,203, 19,159,126,245, 13,158, 76, 25,136,129, 51, + 95,108,212,170,245, 6,169, 84, 10,145, 72,132,136,136, 8, 20, 21, 21, 65,167,211, 57, 21,169, 0,201,191, 77,171, 56,132,137, + 69,120,244,233,215,241,208,140, 33,216,250, 91, 49,174,153,208,108,242,247,196,149,146,107, 56,126,232, 7,196, 70, 69, 56,201, + 95, 44, 10, 74,251, 61, 56,229,255, 0, 0, 81, 98,137, 95,228, 15, 0,127, 95,245, 31,252,125,213,127, 92,228,191,189,174, 14, +207,143,157,232, 60, 25, 43,229,117,223,159, 94,124, 75,249,151, 69, 15,104,158,232,248, 87, 72,152, 48,132, 34, 4, 12, 68,104, + 23, 55, 20, 79,189,182, 80, 83,212,118, 5, 47, 53, 66,171,213,218, 0,224,211, 79, 63, 53, 2,144,115,219, 40,175, 91,183,142, + 5, 16,226,190,173,178, 86,171, 13, 40, 46,103, 52, 26,149,254, 28,231, 97,249, 15,187,191,127,162, 49,251,155, 77,234,126,189, + 18, 68,117, 39,118,225, 66, 89, 45,174, 86, 27,193, 82, 26, 80, 34,112,122,122, 58, 77, 75,203,166,235,215,175, 15,106, 33, 49, + 55,242, 71,116,116,126, 64, 50, 10, 10, 10, 52, 25, 25, 25,132, 16,226, 82, 6,252,252, 13,215,145,255,161, 67,135, 48, 99,198, + 12,119, 15, 1, 78,157, 58,165, 49, 26,141, 77,110,152,149,149,149,245,212,176,113,147, 38,190,177,100,129, 56, 59, 59, 27,255, +253,224, 93,113,189,199,200, 69,254,217,217,217, 88,181,106, 21,122,247,238,157,235,107,188,121,146,127, 99,227,237,161,161,245, + 94,192,240, 80,159,242,222,251, 96,181,139,252,203, 42, 42, 81, 86, 81,137,154, 90, 3, 36, 18,113,216,234,117, 95,154, 61,173, +120, 1,119, 6, 18, 19, 19,175,123, 53,169, 0, 56, 28, 14, 26,211,169, 15, 58,181,110, 1,179,205, 1, 66,128,237,219,191,199, +103,159,174,195,209, 35, 71,240,252,194,231, 32, 18, 49, 96, 29, 44, 34, 66,100,232,212,103,152,198,100, 50,241, 30, 96, 54,155, + 77,217,179,219, 69, 77, 68,152, 17, 31,127, 90, 6,134, 80, 12,236,253,187,198,102,179,249, 53, 72,189,145, 63, 71,252,166,154, +202, 6, 10, 66,141,190,214,167, 60,111,131,137, 27, 72, 5,235,223,106, 64,112,159,126,197,175,124,111,215,174, 93, 17, 19, 19, + 3,189, 94, 15,169, 84, 10,134, 97, 96, 50,153,160,211,233, 32, 18,137,184,137,153,247, 61,127,189,121, 19,158, 91,185, 3,155, + 62,120, 5,109, 90,197, 33, 36, 52, 26,151, 29,197,248,124,197, 75, 8,171,159, 52, 68, 60,229,121, 35,127,142,248,107, 74,206, +161,123,124, 43,212, 26,205,144,133,200, 0,135,195,103, 62,128,175,246,123,105,237, 86, 28,255,229, 71,244,234,114, 31,106, 28, +190,149, 70,142,252,127,223,177, 19,127, 95,245, 31,215,241,237,117,117,216, 94, 87,135, 34,245, 63,177,227,196, 81,244, 28,216, + 5,168,244,189, 53,115,214,153,101,202,249,207,140,214,196,134,246,128,137,214, 2,150, 50, 72, 45, 85,176, 56,106, 97,102, 77, + 96,165, 97,104, 55, 60, 9, 57,191, 46,245, 53,209,145, 13, 27, 54,192,108, 54, 67,173, 86,135,168,213,106,192, 25, 2,128, 90, +173, 70,253,231,122, 11,202,140, 13, 27, 54,248, 61,104, 79,157, 58,165, 92,184,112,161,230,253,247,223,167,132, 16, 13, 0,236, +219,183,143, 46, 93,186,148,190,242,202, 43, 1,109,205, 28, 46, 99,214,253,231,197, 39, 20,227,218, 89, 68, 7, 78, 93,195,214, + 11, 12, 94,220, 86,106,249,167,214, 80, 83,103,195,255, 5, 34, 83,167, 27,115, 35, 45,127, 68, 71,231, 99,230,204,153,126,239, + 70,233, 78,248,107,214,172, 33,220,118,210,124,113,224,192, 1,101,105, 41, 63,163,196,106,181,226,216,177, 99,187,155,234, 47, + 0,148,241,109, 91, 75,211,210,210, 0, 0,133,133,133,216,253,221, 55,242, 43, 37,215, 88,142,252, 1, 32, 45, 45,205, 53,222, +142, 29, 59,182,162, 57,227,237,237, 57, 19,241,219,185,203,104,221,165, 13, 80,103,228,125,239,101, 21,149,176,217,236,245,115, +181, 29, 54,155, 29,151, 47, 94,144, 55,231,153,122,122, 15, 4,111,194,237,133, 6,174, 40,139,197,130,126,221,187,107, 66, 20, + 18,176, 44,133,131, 5,126,216,183, 31,255,124,237,117,176, 20, 56,115,246, 44,142, 30,249, 21,189,122,245,133, 72, 68,112,111, +151,120, 20,253, 98,135,130,231,230,120, 82,113, 25, 18, 58,149, 0, 98,130,203, 87,109,128,152,160, 79,247,139, 40, 56, 86, 6, +138,118, 1,221,128,187,123,223,155,103,192, 84, 83,217, 96, 53,128, 47,184,187,247,189,105,218, 5,235,223,194,152, 5,171,188, +102,177,187,195,110,183, 35, 36, 36, 4, 12,195, 32, 42, 42, 10, 70,163, 17,117,117,206,109,128, 99, 99, 99, 81, 89, 89,233,215, + 6, 28,102, 29, 48, 80,161,192,243, 31,236,195,152,190,192,197,195,192,207,245,231,158,255, 96, 31,254,189, 64, 5, 7,235,240, +187,253,142, 31,250,193,245,126,244,128,238, 16,135, 51,216,174, 61,129,126,221,219, 35, 34, 76,134, 79,115,242,145,164,154,128, + 43, 94, 86, 1,248,106,191,220, 19, 20,184, 10,164,140, 38, 88,187,181, 8, 49, 81,157, 49,121, 40,225,213,126,156,187,127,123, +221, 31, 91, 39,211,127,172, 0,218,213,128,252,229, 85,208,127,190, 6, 48, 38,144,130,165, 88, 21, 23, 71,254,219, 68, 32,160, +235,148, 48, 77,199, 22, 3,160,119, 24, 96,209,157,197,231,151,178,176, 63, 69,135,251,254,172,194,216,167,195,160,136,186, 23, +114,113, 20,196, 41, 53,248,249,155,159,233,253, 73,247, 55, 54, 73,185,254, 7,195, 48,160,148, 90,235,149,104, 51,195, 48, 70, + 74,105, 52,156, 73, 92, 1, 47,175,237,222,189,187,118,236,216,177,170,202,202, 74,205,246,237,219,157,138,207,246,237,232,209, +163, 7,186,119,239, 30,208,246,204,181, 22,246,153,185,127,255,247,150,119, 38,180,102,168,185, 6,127, 89,127,218,102,183,217, + 86, 89, 28, 88, 74, 41,173, 10, 68,230,164, 73,214, 27, 78,254, 35, 70,140,208,250, 43,167,160,160,160, 65,200,132,243, 2,240, +221, 85,210,225,112,248,165, 48,156, 63,127, 30,131, 6, 13,106,172,191,200, 1,220, 7, 64, 60,106,194,228,234,162,162,162, 22, +133,102, 28,210,109, 0, 0, 32, 0, 73, 68, 65, 84,133,133,200,206,206,198,128,162, 34,166,176,176, 16, 0, 48, 96,192, 0, 60, + 56, 50, 9, 17, 97, 50,172,250,100, 83,217,140, 25, 51,150,172, 94,189,122,129,191,227,237,234,230,183, 16,222, 83,142,176,110, +207, 97,227, 91,127, 70,223, 94,173,113,239,196,215,145,145,145, 65,154,202, 18,175,209,215, 66, 46,151, 1, 0, 36, 18, 49,140, + 70,115, 80,159,173, 64,250,183, 6,126,111, 6,196,178, 44, 66,100, 82, 88,237, 20, 12, 1, 24, 2,188,250,175,215,225, 96,129, +186, 58, 3,174, 93,187,138,184,184,214,160,148,133,221, 14,200, 37, 98,136, 36,252, 92,176,118,187, 93,121, 95,215, 43,154,150, + 81,122,128, 16,167,110, 76, 0, 66, 40,250,247, 60,163,249,233,104,156,202,223, 21, 1,156,117,223, 88, 72,128,143,245,239,169, + 69, 55, 70,252,254, 88,255,128, 51, 97,168, 85,171, 86,144,201,100, 46,151, 33,151,248, 23, 25, 25, 9,137, 68,130,203,151, 47, + 67,194, 83,222, 39,249,123,240,231,137, 35,193,153, 55,167,237, 78,247, 63, 0, 40, 19,128,136,215, 53, 88,240,183, 33,136,242, +227,126,175,148, 56,147, 21, 59,180,138,134,206, 98,129, 56, 66, 4,115,185, 17, 96, 24,180,233, 24,143, 29,187,127, 14,168,253, +254,111,209, 27, 56,255,195, 46,136,175, 1,213,113, 64, 8,195, 96,112,167,206, 24, 53, 50,142,151, 28,207, 88,255, 23,143,253, + 25, 95, 91,126, 7,238, 49, 3, 63,137,129, 48, 49,240,240, 0,196, 63,204,207,120,237,218, 46, 26, 86,107, 21, 36,118, 27, 62, +191,148,133, 31,231, 68, 98,196,163,143,160,123,171, 30,170,223,118,104, 53,253,210,234, 32,177,214,193,222,157, 69,121, 41,191, +164,209,122,229,205, 60,103,206,156, 48, 0, 58, 74,169, 4, 0,230,204,153,211,236,218, 26,147, 39, 79,214,238,223,191, 95,117, +242,228, 73, 77, 72, 72, 8, 66, 66, 66, 48,115,230,204,128, 38, 81, 66, 72,235,137, 19, 39,174,253,219,223,254,198, 60,191,224, + 25,182, 23,123,150,177, 88,109,117, 86, 7,253,155, 63,114,210,211,211,169, 78, 55, 6,147, 38, 89, 49,115,230, 76, 18,232,239, +185,145,228,239,205,221,191,102,205, 26,162, 86,171,233,220,185,115,121,253, 94,131,193,208,192,237,239,142,133, 11, 23, 98,225, + 66,231,166, 69, 73, 73, 73,238,215,203, 26, 17,215, 22, 64,167,122,165, 48,228,193, 41,179,204, 93,186,116,145,103,103,103,131, + 35,255,180,180, 52,196,181,105,227, 62,222,182,194, 45, 68,192,103,188,165, 63, 60, 2, 7, 75,202, 16,222, 55, 28,197,219,207, + 1,114, 25,166, 60, 61, 27,209,241, 19,121,206,205, 14, 20, 95, 45,181, 75, 36, 98, 49,231, 1, 0,128,203, 23, 47, 52,235,185, + 54, 22, 58, 16, 20,130, 91,167, 16,120, 42, 1,140, 55, 19,135, 82, 10,150, 2, 14,214,169, 4, 16, 2,124,243,117, 14, 30,157, +156,138,150,177,173, 92, 19, 32,245, 99,175,108, 17, 83,134,158,247, 92,118,125,238,211, 43,196,229, 36,235,127, 95, 17, 68, 76, +153,223, 55,228,233,238,247,118,222, 31,235,223,211,221,239,237,188,251, 90,246,166,160,215,235, 81, 91, 91, 11,139,197, 2,150, +101, 81, 94, 94,238,114,255, 27,141, 70, 24, 12, 6,191, 66, 0,155, 62,120, 5,218,223,128,154, 11,128,205, 4,252,123,177,202, +229,254,255,229, 48,240,235,213, 31, 32,242,179,253,106, 74,206, 33, 58, 50, 20, 49,209,161,184, 55,161, 7,138,206,151,227,116, +113, 37, 58,196, 68,194, 82, 90,134,179,103,206, 54,168, 5,192,167,253,134, 40, 31,193, 48,213,116,108,218,178, 17,154,189, 27, +145,181,124, 17,166, 44, 90,138,163, 54,160,188,178,140, 87,251,185,199,250,159, 24, 50, 8, 51,239,235,136,141,155,118,227,232, +209, 11, 88,126,172, 16, 27,198,204, 6, 62, 58,128,226,226,242, 6,181, 0, 26, 67,188, 89, 6,135,181, 2, 86,107, 13, 0, 32, +174, 93,123,116,239,209, 67,165, 87, 56,115, 49, 76,172, 17,140,165, 14,138, 58, 17, 74,175, 94,243, 69,168, 78,143,140,217, 12, +179,217, 44, 7, 96, 5, 16,110, 54,155, 35, 60,151, 4, 6, 10,163,209,168,220,187,119,175,166, 71,143, 30,152, 53,107,150,170, +162,162, 2,219,183,111,231, 61,216, 8, 33,195,100, 50,153, 33, 60, 60,220, 62,102,204,152,171,139, 23, 47,110,187,100,201,146, +162,159, 15, 31, 29,191,225,184,229,148,141,133,223,251,177,222, 8,151,127, 48,201,223,211,250,231,114, 20,220,189, 0,124,100, + 72, 36,127,168,228,203,151, 47,119,189,188,125, 6, 92, 43,124, 26,123, 54,210,250, 23, 3, 64, 92, 83,114,206,171, 59,157, 27, +111,135,127, 57,124,126,198,140, 25,233,254,140,183,225,247,223,139,228,161, 9,120,227, 95,239,226,189,149,121,248,127, 95,236, +198,188, 81, 73,184,246,109, 30,106,116,122,159,100,155,145,145, 65,210, 82, 30,132,205,102, 63,108,179,217,237,238, 10, 0, 0, + 44,125,245,165,128, 9, 91, 32,250, 91, 11,111,177,127, 79,175, 64, 3, 5,128, 97, 24,212, 24,140, 16, 49, 4,118,187, 3, 44, +165,176,179,206, 36,210, 35,191, 30,198,168,209,227,156,110, 50, 74, 33, 98, 68,168, 53, 90, 97,183, 90,124,107,152, 14,135,178, +115,187,171,154,216,232, 26,151,150, 49,100, 96,152,115,216, 16, 2, 66, 40,250,245, 56,171,177, 59, 28, 74,190, 55,199, 89,247, + 77, 37, 3, 6,100,189, 54,145, 92,227, 15,162,162,162, 80, 94, 94, 14,153, 76,134,218,218, 90,196,198,198,186,146, 2,205,102, + 51,170,171,171,253, 82, 0,210,223,216,128,127, 47, 86, 33,178, 19,160,253, 13,120,102,153, 6, 97, 98, 17, 38, 63,251, 38,174, +176,215,176,126,249, 11, 16, 49,252,229,113,214,255,128, 1, 9,136,237,210, 9,173, 98, 91, 66,202, 16,216, 9, 69,121,157, 9, +186, 90,115, 64,237,247,222, 91,155, 49,169, 71,103, 68, 68,196, 32, 36,182, 45,108, 85, 58, 28,222,250, 37,170,171, 46, 5,212, +137, 63,126,235, 41, 96, 65, 50,196,118, 43, 58,213, 1,101, 34, 61,254,125,245,103, 64, 26,193, 91,198, 47, 91, 14,170, 42, 24, + 19, 46, 73,141, 72,186, 71,133,251,102,135,161, 40, 74,171,137,141, 61,172,105, 63,184, 8, 53, 76, 45, 44,212, 4,227, 23, 44, +228, 97,225,124, 44,127,247, 9,158, 91, 5, 32, 13,214,192,253,254,251,239, 1, 0, 51,103,206, 84,117,239,222, 93,251,232,163, +143,186, 44, 70, 62,228, 31, 27, 27,187,109,237,218,181,161, 25, 25, 25,162, 5, 11, 22,224,185,231,158,163, 7, 14, 28, 24, 76, + 41,221,110,180,209, 30,148,210,159,252,183,230,162, 26,117,251, 7,154, 16, 24, 76,242,247, 36,120,119,133,101,205,154, 53,164, +160,160,128,151,107,255,202,149, 43, 7,184,247, 89, 89, 89,174,151,231, 49, 14,209,209,209, 0,208,216, 36,120, 5, 64, 53, 0, +230, 74,201, 53,252,248,227,143,174,152,255,128, 1, 3, 0, 0,217,217,217,248, 42, 55, 15,186, 90,179, 17,192, 82, 56,151, 6, +242, 30,111,223,110,250, 7,198, 45,126, 26,227,199,143, 70, 75,153, 8,181,132, 98,251,233,203,248,241,183, 98,191,136,122,254, +156,233,247, 23,157, 61, 43,190,124,241, 2,184,215,210, 87, 95,106,210,146, 23,112,123, 19,191,231, 49,111,104, 16, 2,144,201, +100, 56,115,226,168,170, 83,219,104,141, 66, 34,134,195,193,130, 16, 2, 66,128,116,245,147,160,148,133,163,190, 30,128,209,108, +198,201,211, 69,144, 74,125, 59,177,237,182, 42,244,187,239,188,251, 44,138,191, 46, 56,143,175,191,232,230,210,157,147,122,157, +195,193, 35, 61, 32, 22,197,250,101,253,123, 35,126, 83, 77, 37, 0, 4,100,253,123, 27,104, 5,235,223, 2, 0,222,214, 63,224, + 92,231,223,186,117,107, 88, 44, 22,148,150,150,194,225,112,160,101,203,150,168,172,172, 68,203,150, 45,235,219,149, 63, 97,151, + 95, 59,139, 87, 94,215,160,230, 2,240,206,162,225, 48,216, 29, 88,184, 44, 27,239, 47, 78,195,162,229, 91, 33, 38, 4,126,240, + 63,106, 74,206,161, 77,203, 22,144, 64, 2, 7, 8,174,158, 63,142,139,101, 53,232, 26, 27,141,111,127, 57,128,147, 39,224,183, +245, 63,101,238, 66, 72,162, 1, 70, 4,172,203, 59,143,175, 63,124, 30,115,223,202,192,194,135,251,226,201,209, 29,253,106,191, +237,117,117,120, 47,101, 42, 80, 45, 7,136, 4,120,239, 93,164,254,188, 15, 59, 70,207, 7,121,243,105,144,131, 47,240,178,254, + 1,224,215,171, 49, 24,100,170,129, 65, 33,130, 81, 46, 71,215, 41, 18, 88,168, 9, 53,140, 4,118, 36,128, 58,140,176, 85, 92, +197, 15, 31,212, 96,230,140,174,183,100,208, 22, 22, 22,210,122, 98, 32,147, 39, 79,214, 58,125, 99, 78, 12, 31, 62,156, 12, 31, + 62,156, 15,249, 15,109,219,182,237,247,111,190,249,102,232,153, 51,103, 32,145, 72, 16, 17, 17,129,163, 71,143,218, 40,165,229, +205,249,125, 77,173,201, 15,196, 59, 16, 76,242,247,180,254,157,196,122,253,242, 65, 62,185, 0,105,105,105,103,190,250,234,171, + 33,118, 59,191, 21, 78,114,185,124,110, 19,167,107, 1,156, 7, 48,224,244,225, 3,112,143,249,255,117,238, 84,124,223,165, 11, +184,112,192,182, 46, 93, 66,102,204,152,241,137, 63,227,237,177,228, 65,136,100,163, 96,132, 4, 95,175,120, 26, 31,110,253, 21, +207, 63, 56, 12,115,150,103, 33,117,233,231,126, 89,224,238,197,132,188, 29, 19,214,239,223,157,104,224, 1, 16,137, 68,164,250, +234, 89,156,187, 92, 9,177, 68, 4,187,131,133,205,238,192, 47,191, 20,226,179,207, 62,129,213, 65, 97,115,176,144,138, 25,148, +233, 12, 40, 62,249,163, 74,161, 80,104,125, 16,161,178, 71,215,139,127, 88,255,206,169, 10, 95,127,145,224,156,227, 24, 10, 48, + 20, 12,195, 98,112,223,147, 26, 7, 15, 47,128, 55,235,223,125, 21, 64,104,116,107,191,200,223,155,245,239,158, 85, 59,102,193, + 42,191,200,203, 57, 41,234, 96, 48, 24, 32,145, 72, 92,214, 63,203,178,174,191,254, 42, 0,159,175,120, 9,191, 20,239, 65, 88, +107,103,210, 95,184, 88,132,242,107,103, 17, 33,147,160,186,234, 10, 68, 12,129,152,225, 23,126,230,172,255,246,209,225, 56, 81, +116, 30,118,171, 21, 50,177, 20, 6,131, 25,223,106, 14, 32, 73, 53,193, 47,242,231,218,239,145,167, 94,195,250,127,191, 15, 35, + 11,180,239, 26,143,223,142, 31,196,194,135,251, 6,212,126, 0,176,176,107, 18,182,156,217, 13,212,216, 1,121, 75,236, 44, 56, + 1,242,230,211, 88, 21, 23, 71,248,146, 63, 0,204,232,182, 88,251,195,206, 2,192, 90, 11, 3,169,133,142, 49,160, 70,108,131, +205,161,135,204,108,132,188,228, 60, 54, 44, 57,131, 78,137, 9,104, 34, 1,176, 1, 20,110,153,175,114,185, 28,114,185,220,235, + 57,190, 88,187,118, 45,214,174, 93,219,172,193, 28, 30, 30,254,204,217,179,103, 67, 35, 34, 34,160, 80, 40, 16, 29, 29,141,242, +242,114, 16, 66,140,193,156, 52, 56,139, 63, 63, 63,159, 2,206,132, 64,127,146, 2,131, 77,254, 31,127,252,177,146,250, 94,235, +206,107, 69, 64,104,104,104,186, 88, 44, 62,231,121,124,249,242,229, 13, 44,127, 0,232,216,177, 35,146,147,147,215,249,178,127, +174,148, 92,107,144,237,255,202,223, 23, 64, 38,150, 34, 46, 46, 14,220,234,128,250,243,161,254,140,183, 63, 43,251,224,185,119, +223, 71,109,105, 25, 98, 35, 90,225,248,137, 75,152,179, 60, 11, 25, 25, 25, 36, 16,178,230,190,231,254,125,119, 57,130, 39,224, +206,192,175,191,254,218,100, 49,160, 70, 61, 0,245,147,136,182, 80,187, 89, 69,105,138,166, 83,219, 24,132,135,200,112, 95,175, + 68,220,215,179, 47,196, 12, 96, 48, 57,112,233,106, 21, 10,180,223,169,194, 66, 67,124,254,131, 58,163, 17, 9, 29,175,194,108, +145,131,114, 70, 13, 5, 20,114, 51, 40, 5,170,170,101, 0, 1,194, 67,237,232,157,112, 1,251, 14,245, 67,120,120, 56,111,235, +223,221,226, 87, 68,198, 64, 66,109,128,253,143,249,206, 33,246,253, 27,221,173,127,119,139,159, 59,118,246,248, 97,215,181,124, +170,236,185, 43, 1, 0,208,186,181, 83, 25,169,170,170, 66, 68, 68,132,203,253,239,143, 2,192, 41, 1,192,155,152,159, 54, 18, +248,247, 62,124,248,242, 4,164, 46,122, 31, 89,111, 61, 9, 49, 33,144,202,248,173,216,225,172,255, 19,151,202,112, 79,251,150, +248,232,191, 27,208,169, 83, 39, 68,182,237,138,190,109,187,194,102,249,195,253, 47,225, 33,147,179,254, 95,159, 59, 26,207,188, +186, 14,237,187,144,102,181, 31,103,253,143,221,244, 49,118,204,156, 14, 18, 63, 24,128,179, 42, 32,224, 44, 17,204, 93,251, 76, + 92, 28, 47,226,232, 99,121,129,100,189,187, 76,217,117,114,173,166, 83,183, 94,208, 43,128,243,184,136,218, 11,229, 40, 95,234, +128, 65, 23,143, 5,179, 23,241,126, 32,171, 87,175, 38, 10,133,130,154, 76, 38,184, 89,158, 84,161, 80, 96,245,234,213,126,148, + 39, 10, 30,106,107,107,223,121,242,201, 39, 83,214,174, 93, 43,143,140,140,132, 70,163,193,202,149, 43,245, 86,171,245,193, 96, +254, 31,206,226,231,150,203,249,155, 16,152,156,156, 76,116,186, 49, 52, 24,228, 15, 0, 28,177,243, 33, 40, 30, 21, 6,173,179, +103,207, 30,188,113,227,198,163,117,117,117,109,108, 54,231, 50, 83, 79,242,191,239,190,251, 48,120,240,224,137, 60,158,179,184, +166,228, 28,222,248,199, 43,248,102,203, 54,140, 27,214, 31,187,242, 15, 58, 13,152,182, 93, 17,217,182, 43, 6, 20, 21,225,193, + 41,179, 42, 46, 85, 26,199,118,136, 9,201,225,107,253, 63,151,185, 5, 75,254, 52, 22,109, 91, 43, 93,202, 5,119,143,124, 60, + 55,129,120, 7, 4, 79,192,157,171, 20,240, 82, 0, 0, 32, 34, 60, 76,251,139,118,179,234,124,252,189,232,210,173,135, 38, 34, + 84, 1,150, 2, 38,139, 21, 69, 69, 69, 40, 47,250, 85, 21, 30, 22, 10,134, 97,124, 14, 92,133, 92,142,141,223,143, 84,113, 25, +240, 77,186, 35, 24, 6,161,161,252,173, 39,110, 9, 96,104,116,107,176, 14,155,147,252,235, 97, 35, 18,159, 37,118, 61,193, 45, +169, 25,179, 96, 85, 3,210, 10,132,252,221,149, 0,247,194, 63, 85, 85, 85,190, 31,128, 15, 37,224,115,183, 85,194,107,151,254, +245,143, 15, 54, 3,194,120,202,105, 31, 29,142,141,135,126,197,111,167,126, 71,146,106, 66, 3,210,247,135,252, 57, 60,242,212, +107,248,186,127, 40,158,122,180,123, 80,218,111, 97,215, 36, 44,202,221, 8,242,198,171,216, 22, 55, 8, 43, 13,191, 53, 56, 63, + 57,178, 5,226,229,254,237, 73, 49,163,219, 98,237,182,220, 28, 92,209,157, 67,121,229, 85,148,158, 14,131,200, 17,129,161,125, +134, 67, 53, 91,117, 75, 39,181, 96, 84,251,163,148, 30, 34,132,140, 33,132,236,124,255,253,247,229,147, 38, 77,210, 27,141,198, +177,129,196,252,155, 66, 48,150, 0,170,213, 81, 65, 33,127, 79, 43, 53, 72,168,152, 58,117,106,215,218,218,218, 55, 10, 11, 11, + 23, 20, 23, 23,163,174,174, 14, 82,169, 20,109,218,180, 65,108,108,236,164,254,253,251,127,203, 83,214, 73, 0, 3,218, 71,135, +227,129, 7, 30,192,175,103,138,209,178,115,207, 6,227,237,193, 41,179,140, 0, 62,224, 67,254, 28,254,172,236,131, 49,249, 63, + 97,230,171,159, 97,196,136, 17,136,139,139,243,170,104, 5,171, 65, 56, 37,192,159,182,110, 76, 33, 19,148,136, 91, 71,250,188, + 74, 1, 3, 64, 68, 68,132,214, 82,117, 89,249,139,246,180, 10,112,102,210, 82, 74, 33,147,201, 16, 25,193,187, 6, 54, 36, 18, +137, 54, 82, 34, 9,250,205,113,174,126,145,221, 8,216,141,174, 12,120,142,248,253, 93,139,197,185,250,207, 30, 63,140,179,199, + 15, 35, 54, 54, 22,229,229,229, 1, 17,127,100,108, 91, 88,121, 36, 71,242,197,204,215, 62,199,129,125,218,160,201,187,112,225, +130,107,183, 63,155,197,124, 29,249,251, 67,252, 28,102,247, 15, 13, 90,251, 1, 0, 89,241,130,139,248, 57,242, 63, 95, 87,167, +154, 28,217, 2, 15,243,180,250,189,225,161,206,169, 4,157,235, 63, 4,144,216,190,102,205, 26,194, 85,251, 91,189,122, 53,113, +175,252,183,110,221, 58,178,122,245,106,215,251, 53,107,214,220,244, 65, 79, 41,221, 79, 8, 25,145,147,147,179, 80,175,215,175, +160,148, 22, 4,251,127, 4, 99, 9, 96, 48,201,233, 6,193, 20, 30, 30,190, 80,169, 84, 46,108,166,156,253,199,142, 29, 27, 10, +160,115,203,206, 61,141, 54,139, 57,164,126,188,233, 1,212, 0, 56,217, 33, 38,228, 49, 56,147, 5,121, 99,204, 43,107,111, 10, +241, 55, 71,209, 18, 72,254,214, 32, 49, 49,145, 23,249,251, 52, 64,197, 98,177,214,151, 59,254,102,131,139,237,115,196,143,102, + 18, 63, 23,155,174, 41,187,130,154,178, 43,136,141,141,109,150,197, 15, 0,118, 7,235,183,247,161, 41,148, 85,213, 4,252, 91, + 60,193,197,246,131, 69,252,193,110, 63, 46,182,191,197, 96,160,238, 86,127, 63,177,164, 89,196,255,191, 4, 74,233,207, 0,166, + 11, 45,113,235, 49, 99,198,140, 12, 0,159, 93,170, 52, 26,109, 22,179,123, 60, 50,162, 67, 76, 72, 20,252,220,253,143, 35, 85, +119, 55,255, 29,164, 84, 9,184,137, 74, 0, 47, 67, 43, 49, 49, 81, 72,236, 16, 32, 64,128, 0, 1, 2,254,199,192, 8, 77, 32, + 64,128, 0, 1, 2, 4, 8, 10,128, 0, 1, 2, 4, 8, 16, 32, 64, 80, 0, 4, 8, 16, 32, 64,128, 0, 1,130, 2, 32, 64,128, + 0, 1, 2, 4, 8,184, 43,208, 96, 21,192,252,249,243, 3,206, 34,245,182,221,228,237, 46,239,240,225,195, 1,203,235,215,175, +223, 13,151, 23,236,251,109,217, 50, 49, 96,121, 21, 21,191,222,234,231, 75,234, 21, 86, 22, 94,138,175,220,137,253,239,102,201, +171, 47, 76,196,212,183, 33, 5, 64,231,207,159,207, 10,237, 39,200,187,147,228,101,102,102,138,211,211,211,237, 0,240,209, 71, + 31,209,110,221,186, 97,196,136, 17, 68,104, 63,239,242,252, 86, 0,238, 6, 52,183,200,196,212,169, 83,149, 0,220, 75,134,170, + 54,110,220,168, 21,116,197, 91,131,154,154,154,199,143, 29, 59,214, 87, 36, 18, 45,146,201,100, 48, 26,141, 47, 12, 27, 54,236, + 93, 4,161,210, 30,165,212,239,106,140,119, 34,230,207,159, 79,193,115,147, 25, 1,183, 14,185,185,185,202,148,148, 20,109,128, +223, 85,229,229,229,237, 14, 70, 65,169,122,121,143,229,229,229,109, 88,179,102, 77, 52,156,123, 26, 56,112, 11,170, 91,186,131, + 35,255,189,123,247,210,159,126,250, 9, 73, 73, 73, 24, 49, 98,132,208,113,130,229, 1,184,211,145,159,159,175,108,206,247,167, + 78,157,170,220,184,113,163,102,234,212,169,238,135, 53, 83,167, 78, 13, 88, 9,224, 20,138,236,236,108,174, 84,167, 95,178,210, +211,211,169,159,255,175,201,245,192, 59,119,126,226,175, 60,149, 78, 23,122, 43, 20, 32,242,219,111,191,189,163,215,235,255,212, +177, 99,199, 22, 21, 21, 21,168,223,110,247,237,175,191,254,250,237,208,208,208, 81, 15, 62,248,160,166, 89,255, 32, 0,242, 87, +171,231,251, 61, 9,102,100,172, 38, 55, 79, 94,211,229,112, 27,219,244,133,239,248,218,184,113,163, 6,175, 18,144,127,121, 87, +168,240, 42,193,212,147,105,126,183,235,184,113,227, 40, 0,108,223,190, 61, 40, 4,198,109, 5,172, 86, 71, 5,125,125,124,110, +110,174, 50, 47, 47, 79,227, 15,217,254,229, 47,233,148, 82,231,214,234,222,240,240,195, 19, 85,121,121,121,154,148,148, 20, 18, + 64, 63, 30,181,109,219,182, 93, 35, 71,142,196,188,121,243,104, 86, 86,214, 24,189, 94,159,239,207,111,243,162, 52, 98,218, 16, + 41,212,243,212, 85, 47,124,177,248,219,183,166,191,245, 8,119,110,237,218,204, 38,127,227,172, 89,179, 40, 0,132,134, 54,190, +181, 65, 93, 93, 29, 0, 96,206,156, 57, 1, 61,159, 83,135, 84,200,207, 60,130,228,244, 76,154,158,158, 46,212, 63,224, 1,174, + 56,144,123,141, 0,177,143, 1,239,181,110, 54,143,122,218,183, 10,205, 34, 4,119,242,223,184,113, 35,153, 58,117, 42,117,147, +235,247,253,114, 10, 5, 71, 52,245, 27,126,248,175, 80,100, 71,251,241, 95,147,125, 94, 81,247,240, 95,249,139,243,115, 95,155, +198, 8,200, 79,175, 12,169,169,169,249,170, 87,175, 94, 83, 0, 48,148, 82, 40, 20, 10,148,149,149,161,186,186, 26,145,145,145, + 40, 43, 43,219,253,253,247,223,171, 30,124,240, 65,191,148,147,252,252,124,202,109,204, 66, 8,193,148, 41, 83,144,156,156,172, + 34,132,240,150,147,155,187,217,245, 62, 37,101,146,207,207,190, 96, 58,240,212, 31,205, 61,100, 85,131,207,158,199, 20, 67,124, +111,170,196,109, 39,236,142,189,123,247, 98,233,210,165,215, 61,139, 47,190,248,130,242,108, 55,101,118,118,182, 6,175,146,122, +130, 77,187,126,226,126,149, 52,219, 66,188,141,231,150, 6,150,118, 70, 70,134,138, 82,138,245,235,215,211,253,251,247,163, 79, +159, 62, 62,191,123,160,145,154,140,155,178, 23, 33, 47, 47, 79,195,178, 44, 50, 51, 51,225,107, 91,101, 66,136,146, 82,234,234, +175,223,126,251,109, 8, 33, 4,211,167, 79, 47, 5, 16, 55, 99,198,140,157,107,214,172, 97,252,177,216,223,221,249,174,235,253, +181,237, 87, 65, 8, 65,214,179, 33, 0, 8,222,153,245,246, 35, 45, 91,182, 4, 0,124,249,105, 22,230,141,156,199, 75,230,128, + 1, 3,208,165, 75,151,160,180,123,102,102, 38,147,158,158,206,126,244,209, 71,244,167,159,126, 66,233,233, 78, 64, 69,148,192, +234,126,146,191, 39,152,166, 38,242,236,236,108,100,102,102, 82,111, 19,104, 32, 59, 67, 53,215, 66,247, 37,207,205,202, 14,216, + 40,220,184,113, 35,217,184,113, 35,225,148, 0, 0,170,230, 40, 20,132, 16,164,165,165,129, 82, 74,220,126,155,223,138, 10,153, +170,115,189,248, 28,247,133,176,173,171, 93, 47, 62,199,253, 33,127, 74, 41,184,221,217,124,237,210,230,173, 79,234,116,186,207, + 34, 35, 35,167, 0, 96,230,206,157,139,153, 51,103, 66, 42,149, 66,161, 80, 64, 46,151,131, 16, 2,145, 72,132,154,154, 26,222, +237,152,147,147,163, 84,171,213, 52, 39, 39, 7,110,207, 4, 95,127,253, 53,230,205,155,167,201,201,201, 81,222,142, 3,215,155, + 66,112, 43, 60,107,217,217,217,154,140,140, 12,242,216,169,169, 94, 45,124,181, 90, 77,167,158, 76, 83,121,243, 12,248,194,188, +121,243,232,243,207, 63,143,206,157, 59, 7,229,247,206,155, 55,143,170,213, 81,136,137,217, 21,212,118,216,188,121,243,232,252, +252,252,221,125,251,246, 37, 31,126,248,161,150, 35,255,230, 96, 83,246, 34,172, 88,177, 2, 44,203, 98,209,162, 69,224, 35,211, +157,252, 1, 96,219,182,109, 91,234, 93,225, 81,211,167, 79,183,143, 28, 57, 18,106,181,154,229,107,180,120,142,209,149, 43, 87, +226,177, 7,156,182, 97,214,179, 10, 76, 27, 34,197, 11,227,158,231,125, 79,161,161,161, 24, 49, 98, 4,210,211,211, 73,114,114, +178,215, 23,119, 13, 95,101, 47, 61, 61,157, 5,156,219,172, 3, 64, 68, 72,133,192,234,205, 36,255, 38, 21, 0,142,172, 10, 11, + 11, 93,101, 39,221,173, 39,127,137,214,101, 65, 4,121, 82,242,162, 12,168,130,217,120, 27, 55,110,212, 4, 65,134, 75,161, 72, + 75, 75, 83,113,109,120, 55,193,157,252, 1,160,184,184,216,117,238,202,149, 43,188, 21,198,154,154,154, 55,141, 70,227, 44,134, + 97,152, 25, 51,102,160,166,166, 6, 37, 37, 37,144, 72, 36, 16,139,197, 16,139,197,144, 72, 36, 80, 40, 20, 48,153, 76, 94, 75, +162,122,153,224,148, 59,119,238,212, 16, 66,144,154,154,138, 53,107,214,144,228,228,100,146,145,145, 65, 82, 83, 83,185,254,163, + 17,166,138,166,201,191,190, 45, 85,220, 36,238,254,236,211,210,210, 84,201,201,201, 90, 32,176,146,180,201,201,201,100,205,154, + 53, 36, 59, 59, 27,148,210,160, 40, 99, 47,189,244, 18,178,179,179,121,245, 17, 95,248,230,155,111,198, 28, 58,116, 40,191, 83, +167, 78, 48, 24, 12, 52, 52, 52,148,238,219,183, 15,128, 43,201, 50, 32,242, 95,190,124, 57, 8, 33, 96, 24, 6,135, 14, 29, 2, + 39,211, 15,143,196, 35,132, 16, 76,155, 54,205, 94,127,200, 58,125,250,116,189, 82,169,196,188,121,243,216,111,191,253,214,231, +189,187,135,194,174,109,191, 10, 16, 96,253, 51,127, 84, 45,206,122, 54, 4,211,135,202,176,248,193, 23,120,255, 46, 62,150, 63, +159,107,246,238,221, 75, 51, 51, 51, 93,175, 67,135, 14,193,112,105, 0, 96, 53,129,132,217,145,255,250, 73,184,159,231, 94,194, +200,109, 72,254,233,139,223,242,122, 94,220,212,128, 44, 42, 42,162,133,133,133,200,206,206, 6,247,158,115,237,248, 51,200,111, + 52,249,187, 91,213,220, 36,116,187,194, 61, 36,112,183,129, 82,138,226,226, 98, 92,187,118,205,117,204,243,179, 15,136,126,252, +241,199,241, 9, 9, 9, 16,137, 68, 56,123,246, 44, 40,165,248,253,247,223, 97,181, 90, 65, 8,129, 88, 44, 6, 33, 4, 14,135, + 3, 70,163, 17,155, 54,109, 66,114,114,211, 97,143, 93,187,118,105, 0, 32, 53, 53,245,186,126, 91,255,153,114, 68,193,167, 95, +123,186,245,125,125,230, 99,229,115,104, 44, 28,192,199,245,239,101,242,108,118,146,148, 43,230,239,166,192,113, 10, 44, 23,243, +207,119, 35,255, 64,172,117, 78, 9,227,200,104,215,174, 93,154, 64,195, 0,156,188,110,221,186, 93, 71,110,129, 96,245,234,213, + 56,121,242, 36,141,141,141, 69,187,118,237, 92,219, 62, 95,184,112, 1, 34,145, 8,255,249,207,127, 2,250, 7, 35,135, 58,183, + 47, 99, 89, 22,127,251,219,223,176,114,229, 74,236,219,183, 15,132, 16, 60,156,242, 23, 92,188,192,111, 3,199,109,219,182,109, +174,127,198,102, 56, 87,200,176, 0, 48,125,250,244,106, 0, 45,242,242,242, 64, 8,225,173, 80, 57,173,255,235,247, 49,113,134, + 3,128, 47,179, 14, 35,183, 38,247,166,121,203, 78,157, 58,133, 67,135, 14, 53, 56,230,168, 62, 15,187,141, 5, 72, 45, 90, 60, +104,195, 33,143,205,174,147,146,146, 4,230,231, 65,254, 77, 42, 0,245,110, 23,194, 89,253, 28,249,123,141,253,249, 65,214, 77, + 89,130,124,226,196,190,228,121,158,191, 85, 59, 82, 77,157, 58,213, 61,214, 76,189,157,231, 60, 3,205, 34,221,141,193,141,131, + 25, 38,206, 15,200,242,111,108,178,141,143,143,191,238,218, 38,158, 73,139,232,232,232, 94, 22,139, 5, 85, 85, 85, 56,112,224, + 0, 68, 34, 17,172, 86, 43, 76, 38, 19, 88,150,117,237, 74,105,179,217, 96,177, 88,120,133, 24,184,231,208, 88,191, 77, 78, 78, + 38, 57, 57, 57, 52, 59, 59,219,167, 50,225,180,186,110, 76, 14,128, 98,200,170,235,136,158,251, 28,136, 34, 48, 98,196,136,230, + 43, 1, 30, 49,255,252,252,124,165,139,236,255,136,249, 7,148, 35,227,161,132, 1,112,238,182,168, 86,171, 41,159,231,192,215, + 11, 80,159,251,224,119,110, 1,183,179, 99,187,118,237, 16, 17, 17, 65, 60,149,221, 94,189,122, 5,108,249, 83, 74, 97,183,219, + 93,199,134, 13, 27,134,125,251,246, 97,207, 15, 14,188,187,140, 95,140, 61, 55, 55,119, 92,125,236,255, 4,128,150, 0,220, 55, + 27, 42, 1,208, 2, 0,242,242,242, 52,125,251,246,245, 41,175, 97,236,223,139,167,160,254, 47, 95,121,193, 64,122,122, 58, 73, + 74, 74,162,154,207, 98, 97,175,254, 21,132,173, 6, 28,206,157, 86, 25,145, 29,250,125, 12, 36, 82, 49, 44,142, 22, 56,120,161, + 47, 94, 89,174,195,161, 67,135,136,183,101,213, 2,252, 84, 0, 60, 61, 1,254, 90,254, 69, 69, 69, 52,152,238,110, 95,242,234, +195, 18, 65,243, 52,100,102,102,146,244,244,244,128,190,235,249, 59, 51, 50, 50, 12,106,181, 58,172,177,243,129,194, 61,246, 31, + 12,101,192, 61,246,207, 87, 25,152, 57,115, 38, 66, 67, 67, 17, 22, 22,134,240,240,112, 68, 70, 70,178, 81, 81, 81, 76, 94, 94, + 30, 30,127,252,113,215,117,114,185, 28, 99,199,142,133, 90,173,166,141,236, 86, 21, 99,181, 90, 81, 85, 85, 5,179,217,140,200, +200, 72,200,100, 50,216,237,118, 80, 74,225,112, 56, 96,181, 90, 97,179,217,224,112, 56,252,202, 47,240, 21,178, 74, 77, 77,197, +237, 16,154,241,149, 16,232, 47, 56, 37, 32,224,254,245,175,198,219,110,234,201,180,250,188,155,192,100,123, 90,255,238,138,100, + 32,201,128,158,214,127, 83,138, 41, 95,242, 23,137, 68, 52, 34, 34, 2,112, 38,212, 17, 0,212,102,179,161,166,166, 6,173, 90, +181, 10,232,190, 57, 99, 74, 44, 22, 99,193,130, 5, 56,116,232, 16,254,136,251,243,239,211,223,127,255,253,247,195,135, 15, 7, +128,112, 56,195,185, 70, 0,216,176, 97, 67,171, 61,123,246, 68, 80, 74, 93,202, 54,159,117,226, 43,223, 95,137,105,131,175,183, +254,103,254,219,136, 13, 7,108,160,148,162,223,140,126,152, 55,114, 30, 9,116,221,121,160, 74,128,106,118, 38,253,126,101, 71, +136, 13,122,192,238,252,215, 44, 0,169, 24, 40,190,214, 2,187, 47, 13,112,100,126, 89, 46, 58,116,232, 16, 73, 74, 74,146,227, +127, 28,124,172,127,128, 71, 37,192,252,252,124,151,235,223, 61, 31,128, 15,186,116,233, 66,210,210,210,130, 22,147,231, 33, 47, +224,248,250,212,169, 83,169,231, 43, 63, 63,159,229, 86, 5,184,173, 8, 8,180, 19,135,221,205, 29, 46, 51, 51, 19,203,151, 47, +111,208,175, 56,242, 79, 73, 73, 65, 74, 74, 10, 0, 96,207,158, 61, 77,137,137, 46, 42, 42, 50, 59, 28, 14,232,116, 58, 84, 84, + 84, 64,167,211,193,104, 52,194,104, 52,194, 96, 48, 64,175,215,163,166,166, 6, 38,147, 9, 22,139,197,149, 20,212, 36,137, 17, +130,156,156, 28,191, 20,182, 59, 25,123,247,238,109,240,114,199,169, 83,167,148,238,159,249,196,156, 61, 99,254,158,150,123,115, +178,246,189,125,119,205,154, 53, 36, 39, 39, 39,168,185, 0, 57, 57, 57,188,231, 46,142,252, 25,134,161,245,253,203,229,250,103, + 89, 22,165,165,165,232,214,173, 27,153, 63,127,190,223,191,229,229,197, 35,177,103,207, 30,176, 95,181, 0,165, 20, 43, 86,172, +112, 61,163,189, 7,120,231,237, 33, 55, 55,119, 18, 0, 76,159, 62,189,184, 94, 1,176,124,249,229,250, 86,243,231,207,111,181, +103,207, 30, 60,244,208, 67, 99,252, 89,166,120,109,251, 85, 16, 16,172,119,179,254,103,188,111,132,104, 90, 13,190, 60, 96,197, +115,207, 61,135,101,223,191,125, 43,230, 21, 17,167, 4, 60,248,156, 29,212, 20, 9,232, 1,232, 1, 81, 45,160, 47, 5,182, 29, +110,131,204, 47,203, 69,245,222, 2,113,122,122,186, 89, 32,127,223,228,239,211, 3,144,153,153,217, 32,238,239,158, 15,192,119, +237,101,189,187, 80,197,185,229,155,235,146,247, 38,143,115,251, 39, 39, 39,107,131,181,132, 40, 57, 57,249,183,252,252,252, 94, +183,227, 3,230,172,254, 96,185,255, 57,171,223, 95,247, 63,135,245,235,215,187,222,255,243,159,255,196, 39,159,124, 2, 0, 86, + 0, 82,142,248, 1, 96,236,216,177,190, 20, 0, 83, 66, 66, 2,140, 70, 35,172, 86, 43,202,203,203, 33,147,201, 32, 22,139, 93, + 30,128,186,186, 58, 24,141, 70, 88, 44, 22,212,212,212, 96,202,148, 41, 62, 21, 76,206,186,111,106, 89, 43,119, 29, 31,220,200, + 28,128, 64,206,123,130, 91,238,231, 13, 43, 86,172,208, 44, 88,176, 64,213,189,123,119,237,173,236,195,141, 89,255,238,240, 39, + 23,160, 49,235, 63, 80,203,159, 97, 24,202,178, 44, 1,240, 15,174,107, 59, 28,142, 87, 67, 67, 67, 17, 31, 31, 31,208, 28,243, +202,139, 35,161,213,106, 65,114, 98, 0, 0, 59, 94, 9,199,216,215,107, 49, 98,196, 8,188,177,108,143, 95,133,169,182,109,219, +182,105,228,200,145, 0, 80,190, 97, 67, 86,187, 61,123,246,181,160,132, 98,252, 67,227, 83, 82, 82, 82,182,248, 51,157, 0,206, +216,255,180, 33,146,134, 22, 63, 40, 22, 60,183, 0,113, 99, 91,223,178,130, 89,233,233,233, 13, 52,124, 90, 11,200,172, 0, 75, + 9,236, 14, 10, 25, 5,226, 20,140,251,245,118, 8,112,242,247,178, 23, 27, 85, 16, 56, 15,172,152,143,229, 63, 96,192,128,235, +242, 1,252,113,209,121,146,118, 16,200,217, 83,158,230, 6,116,188, 94,249,249,249, 65,147,119,183, 38,254,113,133,101, 56, 55, +113,118,118, 54,158,120,226, 9, 0,144,114,215,184,159,171,159,180, 26,195,241,193,131, 7, 63,174,213,106,179, 29, 14, 7,244, +122, 61,108, 54,155, 43,238,111, 54,155, 93, 75, 12,185,196,192,177, 99,199,106,121,244, 23,146,157,157, 77,235,189, 0, 13,250, +109,126,126, 62,119, 28,201,201,201,188,188, 85, 55, 59, 7,192, 51, 44,224,235,121, 52,117, 94,173, 86,211, 21, 43, 86,104, 30, +123,236, 49,124,245,213, 87, 1, 61,115,207,229,183,220,231,141, 27, 55,106,210,139,213,152,234,195,210, 30, 55,110, 28, 61,127, +254, 60,190,255,254,251, 70,219,251,252,249,243, 0,128,237,219,183,251,252, 61,105,105,217, 52, 45,109, 52,198,140, 41, 66, 81, + 81,145,215,236,242,202,202,209, 0,116, 80,171, 27,159,183, 56,242,183, 90,173, 84, 42,149,114,215,252,163, 94, 33,120,245,226, +197,139,232,216,177, 99, 64,150, 63,195, 16,167,194,206,145,255, 81, 59, 62,209, 88, 1, 0,111, 44,219,227,247, 28,193,141,137, +249,243,231, 39, 82, 74, 49, 97,226,132, 41, 15, 79,124,248,155, 64,166,166, 73,143, 62,114,130, 16,114, 31,165,128,104, 90, 13, + 40,165, 88,176,112, 1, 90,143,109,243, 71,224, 35,112,112,236, 76,209,140, 74,130,153,153,153,116,227,139,109, 17, 86,121, 30, +231,244,241,232, 44, 43, 7, 66,227, 32,174, 43, 69, 68, 93, 37,128, 86, 46,143,129,167,210, 32, 32, 0, 15,128,251,114, 63, 15, + 87, 31,205,206,206, 6,223,132, 41, 79,210, 14,214, 15,119,151, 23,132,245,255, 2,154, 9,119, 23,186, 59, 9,113,245, 36, 60, +207, 53, 18, 67,180, 3,248,122,228,200,145, 79,231,229,229,125, 96,183,219, 81, 93, 93,237,202, 1, 0,128,242,242,114, 84, 87, + 87,131, 82, 10,127,194, 75, 99,198,140, 81,237,220,185, 83,147,157,157,141,156,156, 28,234, 25,243, 31, 51,102,140, 95,197,128, +110, 4, 76, 7,158,242,155,240,189, 17,124, 83, 74, 64, 70, 70, 6,153, 55,111, 30, 13,132,252, 27, 36, 0,186, 61,119,183,164, + 64,127,189, 0,141, 42,238, 23, 46, 92,112, 41,104,124, 13, 13,247, 80,229,245,247,205,111,174,170,169,169,161,145,145,145,238, +228,255,170,197, 98, 65, 73, 73, 9, 58,119,238, 28, 16,249,171,213,106,202,126, 21,133, 29, 71,157,198,233, 58,141, 21, 27, 14, + 88, 65, 41,197,190, 31, 3,143, 44,238,221,187, 23, 15, 61,244,144, 42,208,242,193, 28, 65,179, 44, 43, 1,128,175,126,180,225, +185,231,158, 67,235,113,109, 60,252, 3,254,129,171,242, 55, 98,196, 8, 10,120, 95,238,231, 86, 9,144,247,243,237,200,212, 1, +177,137,120,124,109, 13,128, 56,103, 27, 60,217, 18, 29,196,151,241,122,114, 25, 62,213,104,132,170,128,104, 88,233,207,211,242, +247, 60, 47,110,106,162,200,204,204,164,222,150, 77,249, 19, 2,240, 66,218, 65,131,135,188,160,174,255,247, 40, 7,236, 55,210, +210,210,192, 35, 97,145, 55, 26,115,247, 7, 26, 6,104,204,221, 31, 72, 24,192,189,188,172, 39,249, 52,117,174,177, 91, 37,132, +172,154, 48, 97,194,154,245,235,215,219,164, 82, 41, 44, 22, 11,236,118, 59, 88,150, 69,139, 22, 45,160,211,233,144,230,231,210, +179,212,212, 84,109,106,106, 42,217,185,115, 39,205,201,201, 65,118,118, 54,184,186, 0,183,115,229,185, 96, 99,247,238,221,116, +194,132, 9,216,186,117,107,179,201,223,147,228,242,157, 10,153, 79,111,220,243,207, 63,127,157,113,225,137, 23, 94,120,129,242, + 77,242, 84,171,163,124,202, 83,171,249,197,255, 21, 10, 87,233, 75, 74, 41,133,209,104, 68, 73, 73, 73,192, 49,255, 6,158,143, +215,107, 27,124,110, 14,249,127,248,225,135,193,234,179,108,238,183, 91,186,185, 87, 2, 12, 22,154, 82,200,214,173, 91,231,151, +245,175, 78,237, 90,242,241,105,180,205,200, 57, 7,119,238, 25,241,159, 76,186,123,222,189, 56, 83,170,192,153, 51,103,160, 82, +169, 32, 32, 8, 30, 0, 0,104,140,228,111, 71, 45,235,118, 91,255, 31,140, 37,126,127, 40, 34,201, 65,251, 93, 83,167, 78, 85, +249, 91,222,215, 7, 49, 80,119,133,198, 91,162,149,231, 57,158,132,107,159, 57,115, 38,217,177, 99,135,242,210,165, 75, 26,147, +201, 4,135,195,129,251,238,187, 79,149,148,148, 20,240,243, 30, 51,102, 12, 25, 51,102, 12, 55,195, 7, 20,154,185,209, 57, 0, +190, 62,243,177, 56,235,179,195, 27, 18,142,159, 69,102,184, 54,194,171,132,230, 35,237, 58,123, 48, 61, 61,157,166, 23,171, 65, + 26, 22, 2, 34, 0,112,230,204, 25,218,196, 88,245,217,232,163, 71,143, 38,126,140,125, 18,140,107, 0,160,170,170, 10, 10,133, +130, 18, 66,208,177, 99, 71, 16, 66, 72,183,110,221,208, 92,242,103, 30,211,129, 16,130,148, 71,156,171,138, 8, 33,174,229,126, +156, 59,255, 22,129, 29, 48,171,127, 80, 5,206,153, 51,135, 83,254,195,234,189,122,118, 56,221,255,172,219, 53,126,221,112, 70, +206,185,182,238,220,195,185,250,211,211,211,137,122,195, 61,135,103, 0, 0, 32, 0, 73, 68, 65, 84,151,134,158, 57,115, 70, 96, +243, 96, 43, 0,119, 10,130,177,214, 63, 88,132,125, 3, 20,155,160,254,174, 96,111,236,115,163,173,231,250, 24,191,215,255, 97, +181, 90, 33, 18,137, 32, 18,137,110, 98, 95, 91, 77,110,111,121,141,143,133, 89,179,102,249, 47,240,213, 63,246,177,200,206,206, +110, 48,105,167, 23,171,221, 45,111,237,221, 48,151,180,110,221,154,252, 49, 86,156,201,182,205, 37,127,231, 51,105,106, 43,160, +235,177,122,245, 79, 55, 77, 35,152, 55,114, 30,185,217,115,130,159,243, 70, 40,156, 57, 69, 54, 55,229,211, 21,231, 87,169, 84, + 68,176,252,125,195, 91,104,128, 36, 38, 38, 10, 5, 19, 4, 8, 16, 32, 64,128,128,255, 49, 48, 66, 19, 8, 16, 32, 64,128, 0, + 1,130, 2, 32, 64,128, 0, 1, 2, 4, 8, 16, 20, 0, 1, 2, 4, 8, 16, 32, 64,128,160, 0, 8, 16, 32, 64,128, 0, 1, 2, +238, 10, 52, 88, 5, 48,127,254,252,128,179, 65,189, 21,118, 17,228, 9,242, 4,121, 55, 79,222,146, 37, 75, 26,106,247, 12,227, + 90,230,232,190,212,140,171,166,232,190,244,204, 91,249,224,176,176, 48,200,229,114,215,247, 25,134,113,173,184,112,151,199,109, +204,196,178,206, 85, 94,220,102, 57,194,243,245, 71, 30, 81,138,196, 50, 80,214, 14,150,181,107, 3,145, 71, 41, 85, 29, 57,114, + 68,156,152,152,152, 15,143,170,123, 1,202, 83, 30, 57,114, 4,137,137,137, 90, 97,188,221,121,242,252, 86, 0,254, 23,241,242, +203, 5, 13, 26,238,141, 55, 6,146,219, 74, 94,193,203, 20, 0,222, 24,248, 6,113,127, 31,168, 60,174, 82,156, 90,173, 70, 70, + 70, 70, 83,215, 53,121,222, 93, 30,220,150,233,113,223,113,255,190, 90,173,118,157,227, 43,247,127, 17,140,181, 78, 89,254,219, + 1,140,136, 42,215,180,179, 95,198,105,218, 25,135,234,162, 85, 17, 9,131, 32, 13, 13,215,250,250,254,254,253,251, 49,108,216, + 48, 23,241,115,132, 77, 8,185,142,176, 89,150,117,189, 46, 94,188,232, 85,222, 47,191,252,130, 1, 3, 6, 64,161, 80, 64, 44, + 22, 67, 36, 18, 53,144,201,145,190,195,225,112,189, 44, 22, 11, 10, 11, 11,113,207, 61,247,220,141,143,136, 56,121,145, 42,127, +255,253,119,156, 57,115, 70,211,162, 69, 11, 12, 31, 62,188, 89, 99,156, 16, 70, 41,147, 71,163, 69,212,189,154, 58, 67,177,202, + 80,123, 89,233,175, 12,150,101,149, 57, 57, 57,187, 79,159, 62,141,173, 91,183, 66,161, 80, 96,209,162, 69, 34,184,173,189, 15, + 64,158,166,232,220, 89,236,220,177, 29, 82,153, 12,207, 61,183, 96, 20,165, 84, 35,140,212,187,212, 3,112, 39, 33, 39, 39,199, +167,198,147,154,154,234,115, 96,114, 4,237, 73,220,129, 34,216,242,130, 13,183,202,124,188, 38, 45, 62,165,101,249,202,171, 87, + 4,154, 85, 93,156,171, 42,232,254,255,239,248, 81, 72,169,242,196,254, 29,136, 56,255,163,198,104,180,192, 54,136,129, 34,158, +160,219,165,163,184, 63,156,106,116,229, 63,227,215,144,217,170, 10,210,174, 73, 37,224,196,137, 19, 16,137, 68, 24, 62,124, 56, +196, 98,177,235,197, 41, 4,156,213,111,183,219,225,112, 56, 96,179,217,112,241,226, 69,236,222,189,219,171, 60,163,209,136,195, +135, 15, 99,240,224,193,144, 74,165,144, 72, 36, 13,100,178, 44, 11,187,221, 14,187,221, 14,155,205, 6,147,201,132,195,135, 15, +195, 96, 48,220, 22,250, 84,125, 63, 99,240, 71, 33,154,128, 57,122,201,146, 37,172,199,220,130,218,218, 90,196,196,196, 4,180, + 0,125,201,146, 37, 13,126,207,231, 89,133, 80, 40, 90, 65, 36,146,106, 12,181,151,253,150, 89, 80, 80, 0,131,193,128,193,131, + 7, 95, 76, 78, 78,110, 83, 89, 89,137, 29, 59,118, 56,162,163,163,145,148,148,212,228, 24,153, 51,110,244,117,109,115,236,212, + 41,104,195, 67,176,112,197,191, 46,247,235,223,171,253,213, 43,101,216,145,167,221,221,169, 87,191,100,189,190,102,151, 64,157, +183, 63,184,210,191,238,240,172, 5, 32,110,106,146,229, 38, 87, 95,159,111, 5,249,255,245,175,127,109,242, 26,157, 78,135, 47, +191,252,146,242, 81, 2, 56,178,110,174,181,126, 35,228,185, 91,254,205,181,254,221, 72,152, 0,160,106,181,218,231,198, 49, 60, +201,154,112,196,206, 89,251,238,150,191, 59,213,241,237, 51,110,158, 10,234, 94, 78, 24, 0,170,170,156,149, 17,163,163,243,239, +138,129,122,225,167,124,220,115, 89,163,185,108,100, 49,249, 30, 17,238,141,181,131,141,166,144, 68,139, 80, 91, 41,133,162,214, +132, 30, 71, 86,105, 10, 19,230,169,140, 33, 29,181,141, 91,146, 4, 39, 79,158,132, 84, 42,197,168, 81,163, 92,164, 45,145, 72, +192, 48, 12, 40,165,176,217,108,176,219,237,176, 88, 44,184,124,249, 50, 52, 26, 77,163, 91, 42, 51, 12, 3,155,205,134, 35, 71, +142, 96,248,240,225, 80, 40, 20,144,201,100, 46,121,156, 2, 96,177, 88, 96, 48, 24,112,236,216, 49,152,205,102,191, 10, 51,105, +181, 90,165, 72, 36,210,212,214,214, 66, 42,149,162,172,172,236,169,201,147, 39,215,202,229,242,207, 3, 33,109,173, 86, 59, 85, + 36, 18,125,229, 38,239,244,228,201,147,127,151,203,229,169,112,238, 80,233,183, 37,252,202, 43,175,104,150, 46, 93, 90,134,250, + 29,103,150, 44, 89,130, 19, 39, 78,160, 85,171, 86,141,214, 93,247, 69,254, 31,207,157,139,241,253,250, 1, 0, 90, 63,253, 52, + 20, 33,113, 48,232, 47, 65, 95,115, 78, 69,169, 67,235,175,204, 62,125,250,160,172,172, 12,251,247,239,239,200, 48, 12,142, 29, + 59,134,232,232,104,236,221,187, 23, 86,171,213,103, 59, 86,190,185,176,193,231, 48,171, 13,109,237,102, 60,247,252,171,237, 87, +188,251, 79,188,243,238,135,104,199, 56,240,225,187,203,243, 71, 77,155, 33,176,235, 29, 72,254,220,113, 94,123, 1, 0,215,215, +255,246,245,249,102, 34,152, 59,245,221, 9,112, 87, 2,154,233, 1,224, 8,150, 0,160,159, 60,250,153, 87, 66,126, 98,211,108, +222,100, 93,239,218, 39, 94, 38,108,247,239,187, 20, 4, 62, 33, 0,238,127,123,254,245,244, 0,220,233, 48, 87, 87, 40, 71, 88, + 14,107,202, 68, 14,220, 19, 9,116,236, 64, 33,234, 35,133,184, 75, 23, 72, 45,102, 88,126,184, 12, 75,141, 24, 34, 86, 2,115, +254,231, 26,102,252,179, 42, 86,236, 61, 28,192,185,231,207,158, 61,139,168,168, 40,168, 84, 42,200,229,114, 72,165, 82,136,197, + 98,151,213,111, 54,155, 81, 82, 82,130, 61,123,246,128, 97, 24, 48, 12,131,166,228, 57, 28, 14, 28, 63,126, 28,195,134, 13, 67, + 68, 68, 4,228,114, 57, 68, 34, 17,236,118, 59,172, 86, 43,244,122, 61,126,254,249,103, 88, 44, 22,136,197, 98, 87, 46,128, 47, +124,241,197, 23, 74,131,193,160, 57,127,254, 60,244,122, 61,164, 82, 41, 90,183,110,189,106,223,190,125, 24, 50,100,136, 56, 52, + 52,244, 19,127,148,128, 47,190,248,226, 81,131,193,240,149,135,188,132,125,251,246, 37, 12, 25, 50,228,203,208,208,208, 84,190, +242, 88,150, 85, 90,173, 86, 84, 85, 85,105,220, 60, 10, 0,128,165, 75,151, 22, 47, 89,178,164, 93,106,106,234, 40,185, 92,238, +215,252,199,136,164, 74,207, 99,215, 62,248, 0,173, 39,197,227,157,119,222, 87,217,108,117, 1,205,167,251,247,239,215,252,244, +211, 79,120,241,197, 23,245, 34,145, 40, 66, 46,151, 99,200,144, 33,208,104, 52,200,203,203, 67,187,118,237,252,240,119, 16,124, +113,246, 42,190, 62, 83,140,220,111, 63,133, 72, 68,176,240,233,199,217,190,173, 91, 50,153,207,189,138,181,254,202, 19,112, 75, +200,223, 83, 57,245,166, 20, 4,188, 10,224, 86,111,111,219,165, 75, 23,149,175,215,205,182,214,111,132,188, 96, 88,253,141,225, +147, 71, 63, 35, 79,108,154, 77,189,145, 63,248,135, 8, 26, 88,250, 85, 85,201, 46, 11, 29,127,108, 1,234,183,219,191, 41,162, +143,142,206, 15,200,250,183,219,237,202,159,127,254,153, 54,118,204,243, 92, 99,112,191,222,110,183, 43, 61,207,121, 30,107, 10, + 85,199,127,209,148, 20,235,209, 42, 92,140, 46,225, 20,226,150, 44,196, 15, 60,136,208,190,159, 67,209,255, 61,200, 34, 21,144, + 26, 76, 48, 26, 29,232, 32, 50, 98,239,250,198,149, 39,134, 97, 32, 22,139, 33,145, 72,112,230,204, 25, 28, 59,118, 12, 17, 17, + 17,136,137,137, 65, 76, 76, 12, 90,182,108,137, 22, 45, 90,160,166,166, 6,123,247,238,133, 72, 36,114,197,246,189,129, 59, 47, +149, 74,225,112, 56,112,250,244,105,132,132,132,160,101,203,150,104,213,170, 21, 98, 99, 99, 17, 22, 22,134,211,167, 79,195,102, +179,185, 66, 4,141, 41, 20,158,150,127,105,105,169,230,220,185,115,232,220,185, 51,198,141, 27,135,129, 3, 7,194,104, 52, 98, +247,238,221, 56,114,228,200, 71,102,179,153,119,237, 98,173, 86,171, 42, 45, 43,255,166,232,106, 13,194,239, 25,140,132,113,127, + 66,187,129, 41,208, 89, 24,236,204,223,133, 35, 71,142, 76, 54,155,205,127,225, 75,254,122,189, 30, 71,143, 30,213,236,223,191, + 31,125,250,244,193,146, 37, 75, 90,162, 62,158,190,100,201,146,118, 0,224, 15,249, 51, 34,169, 50, 52,172,173, 50, 58,166,151, +102,253,134,163,152,251,241,199,200, 59,124, 24,121,135, 15,163,245,211, 79, 3, 0,108,182,186, 61,129,140,227,188,188, 60,154, +155,155,139, 41, 83,166, 92, 12, 15, 15,103, 66, 66, 66, 10, 11, 10, 10,176,127,255,126, 84, 84, 84, 32, 33, 33,193, 47,121,239, + 31, 62,131,119, 15,254,134,181,239,190,116, 84, 44, 50,129,113,212,226,237,149, 31, 51, 95,237, 45, 68, 9, 35,198,189,247,222, + 43,176,236, 93, 2, 38, 80,130,191,133,155, 87,220, 24, 11,251,229, 2, 26,204,184,125,176,229,221, 72, 69,224,137, 77,179,169, +251,171, 49,175,128, 47,175,194,117,228,214, 80, 25,240,215, 83, 65, 26, 59,238,233, 21,224,131,218,218, 90,229,174, 93,187, 52, + 5, 5, 5,141, 30,115, 63,215, 20,220,175,223,181,107,151,166,182,182, 86,233,126,206,243, 88, 83,136, 48, 87, 34,239,146, 25, +219,206,179,184,172, 35, 40, 45, 7, 24,113, 36, 24, 18, 3, 98,150,161,174,148,224,232, 37, 22,199, 46,153, 81, 89,107, 67,239, +104,153,134,143, 2, 32,147,201,112,238,220, 57,156, 58,117, 10,209,209,209,136,138,138, 66, 84, 84, 20,140, 70, 35,246,239,223, + 15,137, 68, 2,169, 84,218,228, 94, 10,156,119,128, 83, 2, 40,165, 40, 42, 42, 66,116,116, 52,226,227,227, 17, 27, 27,139,162, +162, 34, 56, 28, 14,200,100, 50, 72,165,210, 6, 43, 15,188, 77, 43,220,155,242,242,114,205,149, 43, 87,208,179,103, 79, 60,248, +224,131,152, 56,113,162,106,226,196,137,170,225,195,135,195,225,112,224,199, 31,127, 68, 81, 81,209, 96, 0,188,226, 9,229,229, +229,187, 75,171,106, 16,221,181, 47, 18,146,231,160,231,132,249,232, 49, 97, 30, 58, 62,240, 40,172, 84,196,201,227,245,124,235, +115, 31, 52,103,206,156,225,238, 85, 85, 79,252,204,146, 37, 75,176,116,233, 82, 44, 93,186,244,148,103, 94, 64, 99, 16,137,229, +202,168,232, 30,154,214,237,134,105,162, 98,122,128, 48, 98,124,244,137, 6,115, 63,254, 24,115, 63,254, 24, 75,151, 46, 69,121, +121, 57,248,202,243,176,252,233,150, 45, 91, 48,100,200, 16,244,239,223,191, 35, 0,249,174, 93,187, 6, 92,184,112, 1,199,143, + 31,135,201,100,194,132, 9, 19, 70,241,149,151,245,251,101,188,247,243, 41,172,121,227,249,170,248,123, 59,246, 49, 26,116,200, +250,102, 23,142, 30,251, 29,123,191,219,137,154,107,165,152, 48, 97,124, 50, 4,220,182, 72, 76, 76,108,212,250,231,149, 3,144, +145,145, 65,242,243,243,149,124, 63,223,201, 8,166,165,126, 35,228, 1,193,115,255, 55,106,133,186,197,212,253, 37,127,206, 11, +224,110,157, 7, 3,190,146, 15,253,129, 86,171, 85,150,148,148,104,184,205, 93, 26, 59, 22, 8,206,158, 61,139,202,202, 74, 77, +219,182,109, 85, 74,165, 82,219,216,177, 70,137,171,226, 50, 14, 92, 53, 97, 66, 72, 8,246, 93,102,209,182,191, 12,157, 45,133, +208,157,248, 43, 54,189,125, 20,236,133, 26, 24,172, 20,197,181, 14, 40,196, 12,236, 53,215, 16,217,132,210,238,174, 4,200,229, +114, 92,188,120, 17,167, 78,157, 66,207,158, 61,161,211,233,112,240,224, 65, 87, 44,223, 87,188,158, 16,226,242, 2,112,242, 40, +165,184,124,249, 50,122,247,238,141,252,252,124,176, 44, 11,185, 92, 14,137, 68,226, 90, 37,192,199, 3,112,233,210, 37,152,205, +102, 12, 24, 48, 0,241,241,241, 42,145, 72,132,136,136, 8, 12, 26, 52, 72,117,240,224, 65,205,165, 75,151,160,215,235,143,129, +167,203,254,210,165, 75, 96, 25, 41,218, 37, 38,163, 69,124, 2, 24,145, 4,138,136, 88,116, 24, 52, 1, 23, 15,230,162, 94,222, + 5, 95,114, 40,165,202,234,234,106, 77,113,113, 49, 58,116,232,128,161, 67,135,170, 68, 34,145,118,216,176, 97,100,201,146, 37, +116,240,224,193,246,250,121, 51, 33, 50, 50, 18,245, 10,138,163, 41,153,114,121, 12, 98, 98,251,194,106,169, 65, 69,229, 97, 88, + 44,186,209, 54,155, 97, 32,128, 55, 7, 15, 30, 12, 0, 40,189,118, 13,245,242, 36,112,219,244,166, 41,252,242,203, 47,169,235, +215,175,199,204,153, 51, 49,108,216, 48, 0, 96,119,236,216, 33,206,203,203,195,220,185,115,199,246,233,211,103,167, 63,125,249, +180,222,136,197,123,126,197, 91,127, 83, 99,248,196,228,232, 58, 67, 5, 54,126,179, 7, 25, 31,125,141,109, 11,231,160, 75,217, + 21, 44,211, 95, 67,116,116,140,144, 4,120,135,192,221,237,239, 45, 95,165,209, 28, 0,207,216,190,175,207,119, 35,130,189, 4, + 47, 80,188,126,255,235, 42, 66,200,109,217,222, 30, 75,253, 26,228, 1,120, 42, 3,193, 92,254,199, 87, 57,200,205,205, 85,150, +150,150,106,172, 86,107,147,199,154, 3,157, 78,135,186,186, 58,141, 94,175, 87,121, 59,150,146,146,210,232,179, 59, 82,101, 66, +141,149,197,145,114, 59, 74,170,237,136, 59, 40, 70,159,141,103,113,241,194,113,252,254,147, 21,118,177, 8, 86, 22, 48, 91, 41, +116,148, 69,108, 20,109,146,176,221,151,255,113, 25,251,165,165,165,232,216,177, 35, 46, 92,184,224,114,249,139,197, 98,215,245, +254,134,243,220,107, 8,112,127,111, 80, 72,176, 26,205,203,222,191,206, 24,247,117, 1,203,178,168,171,171,115, 78,142, 98,177, + 74, 36, 18,105, 61, 60, 73,226,220,220, 92,164,164,164, 48,139, 23, 47, 46, 93,182,108,153,125,241,226,197, 77,222, 60, 33, 78, +133,200,100, 44,133,161,246,178,202,225, 48,107, 1,236, 5,240,102,109,109, 45,114,115,115, 93,202,228, 61,247,220, 99,245, 37, +175,190,127,165,228,228,228,100, 79,152, 48,193, 69,254, 63,252,240, 3,179,121,243,102, 40,149,202,137,254,146,255, 85,163, 5, +143,231, 29,196,115, 83, 39, 32,245,241, 41, 48,154,245,216,148,171,197,202, 15,179,240,217,216,251,209,165,236,138,192,166,119, +129, 50,224,169, 4,220,148, 74,128,106,181,154,186,199,116,125,125, 22,112,221,196,126, 67,201, 63,208,152, 58, 71,252,158,217, +254, 30,174,127, 82,255,242,122,109, 99,253,197, 87,191,224,219, 95, 82, 82, 82,180,221,186,117, 83, 69, 69, 69, 53,121,172, 57, +136,138,138, 66,183,110,221, 26, 16,189,183, 99,222, 96,114, 68,192, 70,128, 67, 21, 22,148, 57, 28,216, 85,100,198,198,108, 51, +118, 95,137,197, 89,105, 36,174,212,216,112,185,150, 69,157, 29, 48,218, 41,100, 49,173,125, 18, 51,183,190,223,225,112,192,110, +183, 35, 38, 38, 6, 97, 97, 97,232,216,177, 35,108, 54,155,235,184,183,130, 64,158,242,184,245,253,118,187, 29, 38,147, 9,148, + 82,180,111,223, 30,197,197,197,104,211,166, 13,196, 98, 49, 44, 22, 11,172, 86,171,235,255,242, 9, 15,118,232,208, 1,114,185, + 28,133,133,133,184,114,229,138,198,225,112, 64,175,215,147,159,126,250, 73, 99, 48, 24,208,161, 67, 7, 68, 68, 68, 60,200,119, +142,234,208,161, 3, 24,214,138,226,195,249,168,190,114, 26,172,195, 6,147,190, 28,151,126,250, 14,214, 58, 29, 39,175, 19, 31, +229,134, 67, 76, 76,140,134,101, 89,151,167,115,233,210,165,228,248,241,227,168, 39,109, 22, 64,156,183,130, 71,158,176,219, 77, +176,219, 12, 80,132,182,134, 92, 17, 13,128, 40, 1,216,151, 46, 93, 26,227, 38, 15,107,215,174,229, 10, 40,121,189,231,202,202, + 74,250,217,103,159,209,140,140, 12,250,175,127,253,235,219,148,148, 20, 76,156, 56,145,243, 6,232,183,108,217,130,212,212,212, +148,169, 83,167,126,199,167,205, 42, 43, 43,233,231,159,127, 78,167,253,245, 41,140,202,217,131,191,205,158,140,103, 94,152, 15, +179,213,128,243,231, 46, 35, 35, 99, 35, 54, 63, 60, 4,202,246,173, 2, 30, 27,155, 55,111, 22,230,245, 91, 8,207,112,128,103, + 34,224, 77, 45, 5,236, 25, 54,240,245,249,166, 89,250,141,196,234, 61,173,125,190,214,127, 99,242, 10, 94,126,153, 22,188,252, +135, 59,223,243,179, 47, 79, 68,176,228,185,131,115,249,127,242,232,103, 36, 16,247,127, 70, 70,134,203,178,111, 44,222,207, 29, +119,191,214, 23,124,229, 15,248, 19, 30, 80, 42,149,218,135, 31,126, 88,229, 94,156,198,219,177, 64,112,207, 61,247,224,225,135, + 31,110,224,234,247,118,172,209,239,119,187, 7,221, 66, 69, 8, 39,128,141, 82,156,212, 89,177,254,172, 5, 95, 30, 40,193,207, +231,170, 80, 98, 2, 42,205, 14,156, 51, 80, 92,181, 80, 24,172, 54, 85, 83,228,197, 45,205,179, 90,173, 48,153, 76,104,211,166, + 13,122,245,234, 85,175,232, 69, 99,224,192,129, 46,194,230, 72,187, 49,194,230, 8,221,102,179,193,106,181,130, 16,130,174, 93, +187,162,186,186, 26,151, 47, 95, 70, 85, 85, 21, 58,117,234, 4,134, 97, 96,181, 90, 97,177, 88, 92,223,241,133,216,216, 88, 85, +124,124, 60,142, 31, 63,142,239,191,255, 30, 91,183,110,213,108,221,186,117,247,190,125,251, 32, 18,137,240,192, 3, 15,160, 75, +151, 46, 38,240, 44,100, 19, 27, 27,155, 18, 23, 29,137,202,162, 95,241,251,206, 79,112,252,187,213, 56,249, 93, 6, 46,254,184, + 25, 50,134,229,228, 21,251,146, 35, 22,139,181,113,113,113,170,136,136, 8, 28, 57,114, 4, 87,174, 92,209, 24,141, 70,165,187, + 34, 80,239, 9, 96,214,175, 95,143,158, 61,123,250,252,109, 86, 75, 13,106,170,207, 66, 34, 9, 69,139,232,238,154,208,176,118, +144, 72, 66,149,132, 48,131,185,107,194,171,243,161,249,236, 25,140,233,110,224,148,230,235,240,221,119,223, 65,161, 80,160,103, +207,158,232,212,169, 19,234,195, 7,118,157, 78,103,200,201,201,105,145,152,152,152, 50,106,212,168, 45,124,251,110, 94,222,119, +136,136, 8,195,136,145,131,140,137,253,251,224,209,191,206,133,145,216, 81, 94, 86,133,121, 79,191,134,101, 73,247,160,127,171, +192,149,228,205,155, 55,211,183,223,126, 91, 80, 2,110, 19, 69,192, 27,110,155,189, 0,110,245,170,130, 64, 8,216, 95, 12,124, +195,169, 64,184, 19, 53,119,236,102,201,115,183,194,159,216, 52, 27, 79,108,154,221,224,189,251, 49,190, 22,187,187, 39,193,155, + 71,161,185,121, 1,238,158, 0,207,191,124, 17, 30, 30,174, 29, 61,122,180,106,224,192,129,141, 30,115, 63,215,100,187,187, 93, + 63,122,244,104, 85,120,248, 31,203,242,188, 29,107,210, 58,148,133,170,122,183,105,137,161, 49, 50,220, 31, 37, 69, 91, 57, 3, + 25,165,144, 91,236,232, 16, 38,134,142, 82,252,102,176,227,116,157, 29,237, 90,197,160,211,253, 35, 27,149,197, 89,253,220, 82, +191, 14, 29, 58,160,111,223,190,208,233,116,168,174,174, 70,117,117, 53,194,195,195, 49,120,240, 96, 88,173, 86, 87, 77,128,198, + 8,155, 83, 38,108, 54, 27, 8, 33, 72, 72, 72,128,201,100, 66,121,121, 57,202,202,202, 80, 94, 94,142,186,186, 58, 36, 36, 36, + 64, 44, 22,187,228, 53, 86, 87,192, 83, 41,139,139,139, 83,117,237,218, 21,231,207,159,199,246,237,219, 81, 80, 80,128,144,144, + 16,140, 26, 53, 10,125,251,246,253, 78, 46,151, 47, 4,207, 16,128, 82,169,220, 18,215, 42,118, 86,215, 54, 45, 96, 56,247, 19, + 78,111,255, 8,197, 5,223, 34, 74,230, 64,242,232, 81,232,219,183,239, 28,185, 92,158,203, 71, 86, 68, 68, 4,250,247,239, 15, + 74, 41, 14, 28, 56,128,194,194, 66, 77,113,113,177,166,170,170, 74,185,100,201, 18, 21, 87, 57, 49, 41, 41, 9,123,247,238,245, + 41,143,101,109,218, 26,221, 89, 85, 85,249, 49,200,228,209,104,221,246, 1, 77,108,235,129,154,240,136, 78,223,189,243,238,191, + 31,230,228,125,249,108, 8, 54,252, 96, 65, 99, 74,207,233,211,167,209,178,101, 75, 12, 27, 54,140,189,255,254,251, 97, 52, 26, + 81, 87, 87,135, 85,171, 86,133,117,239,222,125,210,180,105,211,182,248, 51, 38,126,255,253, 52, 58,118,136,199,180,105, 41, 33, +175,188,252, 28, 42,107,107, 80, 81, 89,129,244,103, 94,195,107,143,142,198,232, 14,113,205, 34,255,149, 43, 87,162, 87,175, 94, +248,224,131, 15, 4, 37,224, 38,226,215, 95,127,109,180, 14,192,117, 10,239,237, 66,240,254,172, 42, 72, 77, 77, 37,193,170, 4, +232, 11,158,133,120,130,161, 4, 4,131,252, 3,149,215, 88,169, 94, 79,203,220,159,146,189, 30, 74,130,171, 40, 80,115,238,203, + 93,105,112,183,246, 3, 89, 1,224,110,221,221,127,255,253,164,177, 99,158,231, 26, 67, 83,215,243,149,193,225, 1,229, 40,109, +145,152,194, 94,144,135, 11, 53, 64, 24,145,160, 99, 24,131, 98, 7,129, 72, 38,198,222, 50, 7,204, 44, 16, 43, 19,161,107,210, + 8,200,187, 37,105,155, 82, 0,108, 54, 27, 68, 34, 17, 58,119,238,140,254,253,251, 67,175,215,195,108, 54,187,214,231, 91,173, + 86, 68, 71, 71, 99,216,176, 97,216,178,101,139, 43, 36,224, 13, 14,135,195,149,213,223,163, 71, 15,212,187,233, 97, 54,155, 93, +227,153,243, 36,244,232,209, 3, 85, 85, 85, 48, 24, 12, 77,141,229, 6, 39,102,205,154,165,213,106,181,163,122,246,236,185,219, +173,112, 79,245,240,225,195,119,203,229,242,153, 0,204,254,180,229,172, 89,179,214,107,181, 90,125,207,158, 61,115,221,228, 85, + 12, 31, 62,124,149, 92, 46,255,148,175, 28,134, 97,180,109,219,182, 85,141, 27, 55, 14,231,207,159,215,156, 58,117, 10,151, 46, + 93, 66,120,120,184,166, 69,139, 22, 24, 51,102, 12,254,251,223,255, 34, 41, 41,137,247,111,179,219,141,218,106,221,239, 42,179, +185, 10, 45,162, 18, 52, 97,225,237, 17, 30,209, 1,117,181,197, 91,222, 90,246, 17,166, 79, 75,198,151,207,134,120,109, 39, 14, +227,199,143, 71, 94, 94, 30,174, 92,185,194, 84, 85, 85,193,108, 54, 99,239,222,189,226,122,165, 83,239,239,120,152, 48, 97, 60, + 54,109,218, 2,125,117, 37,174,148, 92,197,179, 79,206,182, 62,255,226, 82,233,163,163,134, 96,152, 69, 15, 72, 2,163,135,205, +155, 55,211,127,252,227, 31,174,114,208, 93,187,118,197,219,111,191,141, 23, 94,120,129, 78,154, 52,233,206,175,220,121,135, 42, + 5,183, 76, 1,184, 17,171, 10,130, 65,238, 28, 42, 42, 62,194,203, 5,223, 54, 89,109,207,159,228,191,138,138,143, 80,240,242, + 31,242,220,137,217,211,101,207,135,180, 43, 62,170, 64,193,183, 47, 7, 77, 94, 48,193,199, 67,192,237, 1,224, 79,127,249, 95, + 26,156,157,134,168, 84, 71, 45,118, 77,249,238, 93,144,216, 77, 56, 90, 75,145, 95,107,135,148, 16,196, 80, 10, 85,155, 22,136, +106, 29,171,138, 31,164,244, 97,105, 58, 61, 0,157, 58,117,194,192,129, 3, 97, 50,153, 96,179,217, 32,149, 74, 93,132,205, 89, +233,177,177,177, 24, 58,116, 40,182,111,223,222,164, 7, 64, 44, 22,163,111,223,190, 32,132,192,104, 52,186,188, 11,156,210,206, + 85, 23,100, 89, 22,189,123,247,198,193,131, 7,225, 79,114,165, 82,169,212,224,143, 60,145, 48, 56,171,237, 93, 2,207, 76,120, +111,158, 0, 55, 89,209, 0,170, 0,248, 93,155,152, 97, 24,109,139, 22, 45,208,187,119,111,149, 68, 34,225,150, 63,106, 0,160, +184,184, 24, 15, 61,244, 16,150, 47, 95,238,151, 76,135,195,162,173, 51, 20, 43,173,214, 26,149, 66,127, 65, 19,209,162, 43, 66, +194,218, 34, 36,172, 45,118,236, 42, 5, 25,221,180,197, 61,100,200, 16, 34,149, 74,105, 85, 85, 21,198,143, 31,111,141,137,137, +145,178, 44,139, 75,151, 46, 1, 1, 36, 75, 62,240,192, 16, 34,147,201,104,196,137, 66, 60,249,228,159, 16,159,208, 77,250,246, +115,127, 98,215,125,248, 41,179, 74,100, 14,168, 47,111,222,188,153, 46, 94,188, 24, 45, 90,180, 64, 73, 73, 9, 20, 10, 5, 88, +150, 69,104,104, 40,222,120,227, 13,188,252,242,203,130, 18,112,131,145,152,152,216,168, 23,128,215, 50,192, 27,129,219,121, 85, + 65, 83,132, 19,136,245,223,152, 60, 79, 75,157,115,221,251, 34,237, 96,203,115,247, 4, 4,122,190, 41,175,130,231,230, 63,254, +202,251, 95, 3,195, 48,218,196,209,227, 72, 85,157, 73, 25,105,183,104, 68, 23,139,112,143,237, 42,194, 99,226, 48,164,119,119, +196,180,107,169,138, 76, 28,233,115,124, 80, 74,209,185,115,103, 12, 27, 54,204, 21,143, 23,137, 68,176, 88, 44,174,210,189,238, + 97,130,246,237,219, 99,232,208,161,208,106,189,139, 86, 40, 20, 72, 76, 76,132, 88, 44,134,213,106,117,125,207,125,233,160,251, + 70, 64, 12,195,160, 95,191,126, 40, 44, 44, 12,164, 25, 40,128,218,250, 87, 48, 96, 8,132,248,189,121,141,122,245,234,197,229, + 81, 16,150,101,149, 70,163, 17, 22,139, 5,221,187,119,199,138, 21, 43,252,220, 28,135,106,109,214, 90,216,172, 6,149,201, 84, + 14,153, 44, 10, 18,105,184,134, 97,196,248, 98,253,119,170, 89, 51, 39, 52, 41,175,190,174, 63,121,239,189,247, 88,147,201, 4, + 0, 72, 72, 72,240,171,252,178, 59,250,247, 31, 64, 68,247,223,255,208,220,127,188,151,231,148, 71,153,132,132,123,145, 48,105, +210, 44,177, 88,188, 62, 16,153,203,150, 45, 19, 6,245,109,162, 4, 52, 69,254, 55, 85, 1,184, 83, 17,204,101,127,158,196,220, + 92,107, 61, 88,242,154, 99,113,187, 19, 59,247,222,195,101, 47,116, 34,158, 24,149, 50, 73, 91,111,189, 98, 68, 0,223, 79, 75, + 75, 67, 84, 84,148, 43,195,159,101, 89,151, 11,159,243, 0,112, 73,127,220,142,128, 93,187,118, 5, 33, 4, 27, 54,108,184, 78, +222,202,149, 43,145,157,157,237,186,214,225,112,248,220, 14, 88, 42,149, 34, 41, 41, 9,124,178,227,239, 84,101, 45, 44, 44, 12, + 97, 97, 97,136,137,137,105,198,216,225, 20,129, 90, 48,140, 24,206,116, 44, 86,195, 83, 30, 93,180,104, 17,169,127,158,148, 97, +152,102,205, 35, 14, 7,187,109,193,130, 5, 4, 0,195,178,172,131, 97, 24, 5,252, 12,191,112, 16,172,251,219, 75, 9,240, 5, +146,152,152, 40, 36,103, 8, 16, 32, 64,128, 0, 1,255, 99, 96,132, 38, 16, 32, 64,128, 0, 1, 2, 4, 5, 64,128, 0, 1, 2, + 4, 8, 16, 32, 40, 0, 2, 4, 8, 16, 32, 64,128, 0, 65, 1, 16, 32, 64,128, 0, 1, 2, 4,220, 21,104,176, 10, 96,254,252, +249, 1,103,112,174, 94,189,250,186,100, 66, 65,158, 32, 79,144,119,247,201, 83,171,213,244,145, 73,106,124,187, 57, 3, 25, 25, + 25, 12,188,172, 65, 23,218, 79,144,247,198, 27,111,184,174,121,249,229,151,137,208,126, 55, 87,158,223, 10, 0, 55,184, 27,187, + 56,144, 37, 47,119,178,188, 64,100,222,238,247,235, 5, 82, 0, 17, 0, 66,234,251, 3, 11,160, 2, 65, 88, 67, 29, 76,112,237, + 16,140,123,246,214,166,183,170,248, 80,109,237,255,111,239,202,195,154,184,214,247, 59, 73, 8, 1, 65, 22, 17, 17,149, 42, 32, +138,184, 32,238, 90,149, 88,144,130,128, 91,209,254,106,123,107, 55,162,183,215,122, 91, 84,172,116,177, 11,173,120,181,155,183, +173,161,183, 85,219,122,111, 43,181,130, 59,149, 26, 92,170, 86,197, 21,180, 42,224, 86, 65,169,202, 78, 66,150, 57,191, 63,194, + 96, 8, 89,102,146, 32,216,206,251, 60, 60, 9, 39,147, 47, 51,231,204,156,247,253,190,115,206,119,106, 35, 15, 29, 58,164,216, +183,111, 31, 0, 96,226,196,137, 24, 59,118, 44,235, 84,194,237,209, 14, 83,167,201, 16, 23, 27,161, 5,100, 34,153, 76, 70,255, +213, 18, 55,241,176,142,244,244,116,146,144, 16,212,226,127,107, 34,128, 71, 59, 71, 0, 24,144, 77,173, 55,128,160,102,217,190, +111,186,169, 14,194,158,221,255, 28,109,207,212,245,218,115,205, 29,253,122, 25,226, 47, 58,115, 96, 93, 81,209,233, 71,252,122, + 4,117,171,174,214,192,195,195, 9, 55,111,148,208, 97, 97, 67,238,134, 13, 30, 63, 18,192,101, 46, 6, 79, 28,254,140,148,150, + 92, 68,201, 21, 21,174,151, 19,244,234, 78, 33,168,183, 4,129, 65, 33,136, 24,243,247, 14,241,240,155, 18, 18,204, 94, 3,237, + 65,100,103,207,158, 85,132,135,239,198,218,181, 13,200,207, 7,222,124,243, 39, 92,191,126, 93,225,231,231, 7,137, 68,130,178, +178, 50,233,244,233,211,225, 8, 65,112,224,192, 1, 82, 93, 93, 45,141,142,142,134,179,179,179, 45,246, 4, 0, 16, 23, 27, 65, + 39, 39, 39,139,128, 76,228,100,235, 31, 21, 56,118,219, 94, 30,127, 2,168,213,169,200,205, 77, 70, 76, 76, 38, 18, 18, 50,154, + 35, 2,188, 16,184, 63,224, 19, 1,113,128, 33,217, 83, 20, 64,127,239,245,167,189, 86,141,186,254,169,220,221,223, 47, 11, 14, +238,219,127,198,180,137,232,213,163, 51, 60, 61,156, 81, 89,165,194,141,242, 94,130, 75,165,149, 62,219,183,126,165,136,121,116, +246,106, 39,113,167, 53,214,236,157, 59,187, 47,242,242,197,237, 10, 33,106, 48,123, 10, 48,110, 24, 16,244, 16, 80,124,133,224, +224,113, 37,118, 42, 78, 99,199,230,197,164, 79, 72,188,116,192, 32,235, 25,237,218, 42,218, 97, 46,138, 32,151,203,169,246, 18, + 1,119,239,222,197, 75, 47, 53,160,107, 87, 32, 41, 9, 88,177,162, 14, 39, 79,158,132, 86,171,133, 68, 34,129,175,175,175, 98, +251,246,237,232,219,183,175,116,248,240,225,249, 28, 59,128,200,194,194, 66,116,235,214, 77, 17, 29, 29, 77,125,251,237,183, 0, +160,200,203,203,195, 19, 79, 60,129,145, 35, 71,114,189, 86, 49, 0,236,220,117, 66, 0,100,210,250, 87,189,134,230,123, 16, 30, +134,222, 62, 0,204,156,185, 25,185,185,250,215,228,228, 18, 48, 17, 1, 62, 26,112,127,137,223,176,188,221, 82, 1,119,116,144, + 77, 94,205, 34,224,207, 76,254, 0, 68,123,114, 55,189, 38,157, 16, 17, 50, 98,104,119, 80,148, 62,171, 27, 77, 19,116,118,115, + 70,167, 32, 49,122,247,242, 64, 15, 63,183,135,246,228,110,122, 45, 46,225,153, 44, 0, 55, 45, 25,188,124,113,187, 98,252,176, + 26,252,243, 25, 64, 40,212, 11, 40,141, 22,232,228, 10,132, 6, 3,163,195,129,237,138, 26, 28, 57,189, 93, 49, 96,208, 68,155, + 30,124, 71, 13, 1,152,251, 62, 35, 2,238,119, 99,120,123,123, 99,251,118, 23,244,234,165, 68,126, 62, 80, 89, 41, 66,112,112, + 48,130,131,131, 81, 87, 87,135,210,210, 82,228,231,231,163,166,166, 70,209,175, 95, 63,214, 67, 3, 63,254,248, 99,164, 82,169, + 84,136,197, 98, 84, 86,182,140,100, 41,149, 74,124,249,229,151, 40, 45, 45, 37,143, 63,254, 56,151,250,164, 1, 32, 39, 91, 14, + 64, 38,208,191,218,142, 99,199,142, 53,215, 55,179,137,146,169, 50, 54,247,133, 97,219,178, 45,179,234, 20, 16, 18,137, 11, 23, + 48,178,174, 78,209,229,198, 13,252,238,235,139, 19,157, 59, 75,157, 6, 12, 0,161,168,124, 91,175,153,235,134, 81,108,108,176, + 45,107,107,123,134,161,255,228,228, 92, 36, 36, 4, 53,191, 50, 72, 72, 8,226, 69,192,125,128, 49,217, 51,251, 3, 24,150,243, +171, 0,140, 31,250, 63,249,245, 21,157, 57,176, 34, 56, 56, 56,100,100, 68,247, 22,229, 2, 1, 5,177, 88, 8, 23,137, 8, 78, + 78, 2, 4,245,241, 66, 80, 80,176,111,209,153, 3,219, 45, 9,197, 19,135, 63, 35, 66,212,224,229,103, 1, 85, 35,112,249, 58, + 80, 89, 13, 84,213, 0,255,221, 10, 44, 88, 14, 44, 91, 5,140,141, 0, 4,164, 6, 39, 14,127,198,123,139, 6, 24, 52,104,144, + 52, 39, 39, 20,190,190,192, 19, 79,136,224,231, 55, 2, 19, 39, 78,148, 38, 36, 36, 80,241,241,241,210,152,152, 24,116,235,214, + 13, 39, 78,156,192,247,223,127,175,248,233,167,159, 34, 27, 27, 27, 35, 45,217,252,246,219,111, 35, 27, 27, 27, 21, 78, 78, 78, + 22,127, 91,161, 80, 96,211,166, 77,145,108, 72,118,255,254,253, 4,128, 90, 46,151,139,239,137,128,123,100,186,127,255,126,194, + 85, 64, 29, 61,122,180,249,207, 82,153, 45,162,142,109,153, 37,242, 15,252,237, 55,197,244, 83,167, 20,189, 46, 22, 67, 92, 83, +131,238, 23,127, 67,228,145,195,138,174,167, 79, 43, 64, 72,164, 45,237,125,244,232, 81, 28, 59,118,140, 20, 22, 22, 70,218,122, +207, 48, 54,216,148,177,181,103, 76,244,108,202,172,129, 33,125,230, 85,157, 16,204, 63,240,247,137,248,217,164, 1,126, 96, 35, + 0,109,233,169,145, 54, 60, 63, 71,133,152, 25,251,230,126,199,210,111, 20,157, 59, 29, 59,107,134,180,153,244, 77, 65,226, 44, + 66, 85,117, 35, 66,130,188,145,181, 69, 17, 20, 54,120,188,135, 57,123,165, 37, 23, 49,123,138,254,253,238,253,192,167,223, 0, +147,199, 3,113,145,192,111,197,192,201, 34, 2, 23, 9,133,161, 97, 64,204, 68,224,199,220,139,136, 24,227, 56,207,221,150,186, +107,163, 57, 21, 54,193,221,221, 61,191,174, 78, 63,223,242,137, 39,158,192,184,113,227, 40,195,207,238,222,189, 43, 13, 13, 21, + 41, 18, 19, 1,138, 58,142,138,138, 6,197,239,191, 7, 89, 10,255, 69, 82, 20,165, 96,187, 57, 76, 69, 69,133,194,154,238,157, + 51,103, 14, 54,110,220,136,141, 27, 55,146, 57,115,230,180,104,139,253,251,247,147,141, 27, 55, 54, 31,215, 81,250, 3,182,101, +230,208, 88, 88,136, 62, 5, 5, 80, 11, 4,112,162, 0, 45, 77, 64,107,116,160,181, 90,116, 61,176, 31,197,132,160,243,208,161, + 54, 19,184,171,171,171,226,248,241,227,210,185,115,231,230,219,106, 3, 64, 11,143,220, 84,153, 45,209, 5,123,201,223, 28,209, +231, 26, 69, 2,120,180, 63, 76, 10, 0,115,147,223,108, 33, 28,107,132,200,213,222,253, 30,163,181,101,198,184,165, 73,133,182, +216, 51,245, 29, 27, 39, 46,138,252,252,131, 6,248,251,185,129, 16,224,192,225,235,104, 80,234,119, 93,141, 24,226,135,174, 93, + 92,112,253, 70, 45, 93,124,185, 82, 32, 18, 9,208, 55,208, 11,254,254,193,158,208,111,209,106, 18, 37, 87, 84, 24, 55, 12,104, +212, 0,187,246, 1,138,195, 4,254,221, 40, 4, 6, 0,143, 60, 12,244, 15,162, 32, 18,234,183, 22, 31, 29, 14,252, 75,174, 98, + 85,223,134, 33,121, 54,239,217, 40, 94,195,177,126,195,122,119,228, 10, 3, 91,208,180,157, 43, 6, 15, 30, 44, 53,254, 76, 40, + 20, 42, 6, 12,168,192,178,101,122,121,250,222,123, 23,113,229, 74,152, 89, 91, 42,149,202,170,231,111,136, 43, 87,174, 88, 61, +102,194,132, 9,212,132, 9, 19,154,201,126,227,198,141,196, 88, 32, 76,152, 48,161, 93,234,174, 45,188,127, 0,232,123,251,142, + 66,173,209, 64, 32, 16,128, 8,133,160,105, 26, 26,154, 6,173,211, 65,167,163,209,179,188, 92, 81, 51,116,168,205,215,220,208, +208, 0, 0,138, 99,199,142,129,162, 40,206,243, 59,218, 66, 4, 56,202,243,207, 77,206, 69, 76,102, 12,102,110, 6,146,115,245, +239,115,147,115,155,197,129,120, 91, 49,207,188,247, 17,134,115, 2, 88,205, 1, 48,183, 10,192,214,213, 1,230, 60, 46, 91, 60, + 49, 75,162,193, 86,129, 98,233,186,141,191,203,214,139, 48, 55,169,208, 22,123,150,190,195,252, 14, 5,128,222,100,117,238, 2, +173,159,237,239, 12, 0,184, 94, 86, 3,165, 82, 11, 0, 8, 14,244, 66,215, 46, 46, 56, 93, 84, 33,184,112,233, 46, 36, 18, 33, +130,250,120,162,178, 90, 13, 0,102, 13, 95, 47, 39, 8,122, 72,255,251,143, 78, 0,194, 7, 80,112, 22, 3, 90,173, 62, 18,224, +233, 14,148, 94, 3, 98, 38, 0, 15,245,212, 31,223,158, 48, 36,125, 91,198,133, 59, 58, 42, 42, 42,218, 44,138,210, 68,242,205, + 30,127,123,147,191, 33, 50, 50, 50, 72,106,106, 42,101,235,231,198,112, 42, 41, 70,163, 70, 13, 74, 40,130,142, 16, 80, 0,180, + 58, 26, 26, 45, 13,162,211,129,186,116, 1, 64,156,221,231, 93, 88, 88, 8, 31, 31, 31, 69,117,117,181,212,195,195,195,102, 17, + 96,173,236,126,145,127, 90, 90, 26,149,158,158, 78,102,110,110, 41, 8, 0, 32, 38, 51, 6,226,109,197,216,182,173,164,121, 37, + 0, 51, 97,208,219,219,155,103,234,251, 76,254,102, 5, 64, 71,135, 37, 66,180,133, 96,237, 89,226,104,209,110, 27,175, 38,160, +102, 85,114,253, 13,202,195,195, 9,149, 85, 42,248,120,187, 34, 41,177, 63,180, 58, 26,206,206, 66, 8, 5, 2, 16, 66, 16, 63, + 57, 8, 83,162,131, 64, 81,192,157, 74, 37, 60, 60,156, 0,224,174, 57,131,189,186, 83, 40,185, 74,189,136,105, 47, 0, 0, 32, + 0, 73, 68, 65, 84,208, 63, 8,152, 52, 70,223,235,252, 86, 12, 12,238, 15,120,117, 6, 98, 35, 1,154, 6, 68, 66,224,226,101, +253,241,108,219,150,203,123, 91, 19, 97, 88, 19,164,109, 13,154,166, 35,123,244,232,129,146,146, 18,236,223,191, 95, 49,126,252, +120,169,155,155, 27, 4, 2, 65, 62, 0,232,116, 58,233,185,115,190,138,183,222,186, 1,138,162, 80, 81, 17,130,144,144,222,184, +120,241,162, 57,123, 38,203, 55,109,218,212, 58,138, 68, 8,102,207,158,205,233,154, 13, 69, 64, 71, 34,127, 71,136, 4, 67,220, +237,217, 3,226,223, 46,128, 56, 1, 98,154,232, 39,182,234,180, 80, 19, 29, 26,180, 90, 40,131,251, 59,228,220, 7, 14, 28, 8, +138,162,108, 34,127, 0, 24, 57,114, 36, 70,140, 24, 65, 29, 61,122,148, 88, 42,179,134,166,136, 65, 11,194, 55, 85,198, 5,201, +185,247,136, 31, 64, 43,207,159,153, 48,184,109, 91, 9,207,212,237, 64,254, 15,172, 0,104,107, 65,225, 40, 66, 32, 4, 16,204, +174,108, 51, 17,192,172, 92, 16,204,170,100,227,253, 3,128,232,230,141,146,219,215,111,244,244,241,241,118,197, 7,159, 31,195, +132,177,189, 16, 49,184, 27, 40, 39,170,121, 69, 64,211,214,241,184,126,163, 22, 55,111,148, 92, 6, 96,214,173, 12,234, 45,193, + 47, 5, 74,244, 15, 2,124,134, 1, 75,231, 3, 11,231, 2, 30,238,250,176,255, 91,159, 0,203, 23,234,143,253,165, 64,127,188, +173, 4,237, 40, 79,189, 35,229, 2, 56,119,238, 28, 36, 18,125,157,236,216,177, 3,215,174, 93, 83,244,235,215, 79, 58,105,210, + 36,212,214,214, 70,122,123,123, 43, 14, 30,212, 34, 63, 31, 24, 49, 98, 56, 2, 2, 2,164, 61,123,246, 4, 0,133, 41,123,157, + 58,117,130, 90,173,102,245,219, 90,173,246,129,127,118, 13,201,159,141, 16, 96, 43, 2, 74,186,250, 74,157,207,156, 81,208,132, +160,147, 64, 4,161,144,130,150,232,208,160,209,160, 86,173, 70,153,191,191,212,199,142,243,118,117,117, 5, 69, 81,210, 17, 35, + 70,228,219,106,131, 33,122,107,101,247, 91, 4,164,165,165, 81,201, 77,158,189, 49,249, 27,122,255, 60,218,151,252,121, 1,112, + 63, 60,188, 54, 94, 82,216, 44, 2,216, 9, 13,109, 88,216,144,178,226,203,149, 62, 67,194,124,177,116,225,104,172,255,223, 89, +184, 72, 68, 8, 31,232, 11,138,162, 12, 60, 73,130,226,203,149, 8, 11, 27, 82, 8,160,214,156,193,192,160, 16,236,216,123, 26, +115,103, 2,164, 20, 24, 61, 3, 8,236, 5,108,204, 49, 56,104, 33,160,211, 1, 59,246,234,143,111, 47, 88,138, 20,181,215, 50, +192,187,119,239, 42, 66, 67, 47, 99,221, 58, 0,208,225,237,183,207,224,228,201, 6, 69, 67, 67, 3,106,107,107, 81, 90, 90,138, + 91,183,110, 33, 34, 34, 2,179,103,207,182,186, 12,144, 16, 34,165,105, 90, 33, 16, 88, 95,224,195, 8, 15,174, 96,134, 0, 54, +110,220,136, 9, 19, 38,180,235,243,149,154,154, 74, 49,196,111,109, 8,192,218, 49,134,240, 26, 58, 20,119,212,106,232, 20,249, + 80,139,157,224, 70, 68, 80,209, 52,170,213,106,212, 78,122, 4, 62,195,134,217, 24, 21,164, 48, 98,196, 8,155,199,253, 13,109, + 24, 18,189,169, 50,123, 68,192,177, 99,199, 44,150,177,129, 41,242,103, 60,127, 0,252,132,192,118, 38,127, 94, 0, 60,224,104, + 30,255,103, 63, 12,160, 11, 27, 60,126,210,246,173, 95, 29,252,181,192,189,255,168, 97,254,136,141, 10,196,238,159, 75,177,227, + 39,253,195,249, 90,202, 88,208, 52,193,175, 5,101, 40, 41, 41,190, 26,159,248,236, 63, 0,104,204, 25,140, 24,243,119,106,199, +230,197,228,195,175,244, 75, 1,215,190,171, 95,250, 23, 53, 78,191, 20,240,195,215,245,228,255,225, 87,128, 14,157,109,206, 8, +104,175,103,110, 45,130,208, 94,171, 0,234,235,235, 49,116,168, 10, 35, 70,232,255, 31, 62,156, 96,247,238, 82, 92,188,120,145, + 73, 4,132,200,200, 72,244,237,219,151, 85, 14,128,201,147, 39,231,103,103,103, 91,141, 2,104,181, 90,120,122,122, 74,185,158, +111,211,114,192,230,149, 1,251,247,239, 39,182, 14, 3,140, 28, 57,146, 85, 25, 23, 17, 96,237, 56,214, 70, 5,130,124,245,168, + 81,210,243, 78, 78,232, 85, 94,174,112,187,118, 13,170, 62,125,112,197,215, 87,234, 29, 17, 1, 52, 13,209,216, 64,176,142, 32, +233, 86, 54, 76,149,177,173, 75,227,227, 24,194,183, 86,102, 11,140, 73,159,137, 8,216, 59,132,199,163, 53,216, 76,140,230, 5, + 64, 27,122,230, 29,244, 55,238,196, 60, 58,251,163,220,221,223, 47,254,189,188, 54, 40,184,143, 23,166, 76, 14,130,151,167, 4, +149, 85, 42,156, 60,123, 11,197,151, 43, 81, 82, 82,124, 40,230,209,217, 63, 2,184,110,205, 96,159,144,120,233,129,130,237,138, + 67, 5, 53,152, 50, 9,248,226,125,125, 38,192,146,171,192,151,155,244,158,191, 14,157,209, 39, 36, 94,106,235,181,218, 51, 4, +192,150,252,219, 99, 14, 64,121,121,185,212,203,203, 71,113,252,248, 31, 0,128,139, 23, 59, 99,196,136, 1,232,210,165, 11, 36, + 18, 9,202,203,203,165,241,241,241,156, 82, 1,247,238,221, 91,122,225,194, 5,133, 97, 68,199,152,252,131,131,131, 49,114,228, + 72, 78, 36,198,172, 2, 48, 24,251,103, 38, 4,218, 36, 2, 76, 17,161,173,228,104,141,220, 57,145,191,129, 8,232, 50,124, 56, + 26, 0,170,161,169,200,222,169,106,246,146, 63,151,122, 99,251, 91,142,182,199,150,252,213, 9,193, 0, 63,254,127, 95, 34, 1, +230,132, 1,167,101,128,182, 78,150,227,186, 12,208, 86,123,182,218,116,244,249, 89,170, 39, 71,157,159, 61, 19, 23,157,196,157, +228,241,137,207,126, 87,116,230,192,103, 91,114,246, 5,250,245, 8, 26,109,176, 23,192,145,176,176, 33, 71,227, 19,159, 93, 6, +160,158,141,189, 1,131, 38,230, 15, 24, 52,145, 58,113,248, 51,242,253,142,139,120,239,211,142,183, 23, 64, 71, 36,127, 0,120, +252,241,199,113,250,244,105, 60,243,204,241,166, 8,192,112,204,154, 53, 68,234,234,234,154,111,171,205,240,240,240,252,240,240, +112,106,235,214,173,145,181,181,181, 10,161, 80, 8,129, 64, 0,173, 86, 11,177, 88, 12, 55, 55, 55,169, 3,200,223, 33, 34,128, +199,159, 19,105,105,105, 84,122,114, 58,241, 95,224, 47, 69,111,211,199,148, 37,231, 42,248,249, 0,237, 11, 17,219,142,210,209, + 29,111, 91,216,179,229,183, 30,228,235,181, 19,213, 97,131,199, 63, 25, 54,120, 60,147, 49,198, 13,128, 15,128,114, 0, 74, 52, +165,125,229,130,136, 49,127,167,108, 73,242,211,214,245,208,145,242, 74, 24,195,213,213, 53,127,204,152, 49,212,152, 49,142,175, +184,196,196,196,124, 56, 40,185, 37, 51,238,111, 76,242, 19, 38, 76,160, 54,110,220, 72, 58,194,124, 0, 30, 29, 79, 4, 88, 62, + 0, 60,249,183, 1,216,102, 1, 4, 0, 42, 60, 60,156, 31,123,225,193,131, 7, 15, 30, 60,254, 98,224,247, 2,224,193,131, 7, + 15, 30, 60,120, 1,192,131, 7, 15, 30, 60,120,240,224, 5, 0, 15, 30, 60,120,240,224,193,131, 23, 0, 60,120,240,224,193,131, + 7,143, 63, 7, 90,172, 2,152, 63,127,190,205,179, 50, 77, 37,114,224,237,181,141, 61, 54,155,216,180,167,189,188,188,188, 72, + 0,138,172,172, 44,135,216,219,187,119,111, 36, 77,211, 14,179,199,223,127,237,102,111, 54,128, 77,109,124,126, 78, 0, 36,208, + 39,173, 81, 65,191,154,133,192, 40,137, 13,223, 30,188,189, 63,187, 61,206, 2,192, 26, 57,152, 3,151,165, 84,142,182,119, 63, +145,156, 84, 77, 32, 22, 35,115,163, 11,171,243,203,203,203,139,204,202,202, 82, 56,234,122, 13,237,173, 94,189, 90,154,146,146, +162,176,101,123, 97, 83,246, 10, 63,237,140,129, 47,214,192, 30,123, 12,166,141,216,169, 56,125, 65, 7, 0,200,204,204, 36,201, +201,201,118,181,103, 72,183,239,161,212,122,195,197,197, 5, 89, 89, 89, 36, 41, 41,169,163,220, 31, 93,231,189,146,242,205,218, + 15, 86, 63, 5,224, 15, 7,216, 11,152,255,210,203, 95,124,254,201,135, 79,154,177,231, 4, 64, 11,203, 25,217,156,160,207,220, +216,117,225,194,151,191,249,248,227, 15,159,130,126, 51, 39, 26, 14,200,228,102,252, 28,115,188, 55, 14,183, 85, 67, 80, 20, 21, + 39, 16, 8, 6, 8, 4,130, 72,138,162, 66, 0,184,170,213,234, 92,161, 80,232, 73,211,116, 5, 33,228,117, 0,119, 28, 89, 7, + 60,120,152,194, 83, 37, 37,228,155,160, 32,135,245, 81,201, 50, 25,201,108, 35, 78, 20, 89,123,200, 9, 33,150, 30, 58,206, 29, +134,163,236,113,245, 96, 29,137, 61,123,246, 88,237, 68, 24,114, 77, 77, 77,133,175,175,175,201, 12,120, 41, 41, 41, 10,182,191, +201,216, 99,136,255,200,145, 35,205, 66,192, 30,123,244,185, 55, 32, 24,240, 54,190,222,171, 79, 29, 75,159,123,163,249, 24,193, +128,183, 57,213, 75,231,154, 87, 8, 77,128,239,118,235,109,197, 78,116, 66, 88,112, 17, 50, 51, 51, 9, 0,112, 21, 2,213,218, +239, 34,171,174,220,129,146,154,168,168,111,236,132,216,152, 42,244,240,163,112,252,248, 33, 82, 83,163,194,164, 73,147,218, 85, + 8,204, 95,184,240, 37,208,244,228,249, 11, 23,190,244,249,199, 31,191,110,183,189, 5, 11, 95, 32, 52, 29, 61,127,193,194,151, + 62, 95, 99,210,158,134,133, 25, 13, 0,106,193,130,133, 47,209,180,110,242,130, 5, 11, 95, 90, 99,218,150, 0, 54,228,122,176, + 19,106,195,251,239,135, 31,126, 80,204,152, 49, 67, 58,121,242,228,124,123,140, 10,133,194, 88,145, 72, 52, 65, 36, 18, 61, 46, + 20, 10,189, 4, 2,129, 91, 70, 70,134, 96,241,226,197,207,234,116, 58,104,245,120, 92,167,211, 37, 0,248,165, 73, 4,168,155, +250,191, 54, 31, 6,221,177, 99, 7, 97,219,223,197,197,197,113,186,167,119,238,220, 73,236,249, 62, 15,199,195,101,229, 74, 64, + 46,119,152, 61,229,146, 37,118,125,159,201, 8,200,105, 59, 96, 54,228, 63,108,216, 48, 20, 20, 20,112,242,248, 45,145, 60, 27, +123,166,236,167,166,166,162,180,180, 20, 89, 89, 89, 14,221,214, 53, 57, 33,147,192, 37, 4,153,155, 34, 41, 0,200,204,242,160, +184,144,255,234,213,171,165, 21, 21, 21, 10,115,228,159,154,154,138,140,140, 12, 78,228, 15, 0, 73, 73, 73, 24, 61,122,180,116, +244,232,209,118,217, 99,200,158,121, 93,241, 14, 90,144,255,146,153, 18,172,220,172, 98, 85, 87, 30,202, 20, 50, 48, 68,136,122, + 37,193, 43, 79, 73,112,164, 72, 11,101, 61, 65,131, 26,144,134, 23,161,232,162,142, 83, 52,160,244,250,135,164,234,102, 39,184, +119, 22,195,175,187, 27,186,118, 11,198,213, 18, 53,122, 15,208,192, 73, 82,129,188, 45,183,177,101,203, 22, 50,125,250,244,118, +233,240,100, 50,153,179, 79,143, 30, 11,191, 61,114,148,138,237,215,247, 37,153, 76,246,174, 92, 46,111,180,199, 94, 87,191, 30, + 11,191,219,123,132,138, 14,239,103,151, 61,153, 76, 38,246,243,235,190,240, 39,197, 1,106,248,144, 48,115,182,232,118,168,182, +230,237, 7,179,178,178, 20, 9, 9, 9,216,188,121,179, 98,242,228,201,173,218, 48, 34, 34,130,188,245,214, 91, 72, 72, 72,176, +216,190, 34,145,104,146, 88, 44, 30, 40, 22,139, 23,136,197, 98,215,235,215,175,163,111,223,190, 16, 10,133,112,119,119, 71,113, +113, 49,220,220,220, 68,199,142, 29,243, 60,124,248,240,129, 23, 95,124,177, 55,128,171, 0,196,230,234, 32, 57, 57,185,149,179, + 98,216,111, 49,229, 20, 69, 33, 51, 51,211,234,253,183,117,235, 86,179, 54, 12,203, 9, 33,136,139,139,227, 84,161, 57, 57, 57, +118,125,191, 45,113,234,212,169,200,240,240,240,124, 71,216,186,117,235, 22,161,105, 26, 16, 84, 65,221,168,130,216, 89, 2,208, +158, 16, 8, 4,232,214,173, 27, 53,216, 56,114,105, 33, 25,206,195, 15, 63, 76, 54,111,222, 12,115,246,102,206,156,137,131, 7, + 15, 82,182,158, 31, 0,148,223, 58, 79, 12,207,207,158,107,183, 37,154, 96, 46, 13, 48, 43, 1,192,150,252,217, 34, 53, 53,213, +234, 49,108,136,203, 28,249,175, 88,177, 2, 75,151, 46,109, 81,110,171, 8, 72, 30,150, 73,208, 37, 4,153, 63, 69, 82,134, 30, +127,116,116, 52, 5, 0,204,107,113,113, 49, 97, 67,214,150,200,191, 41, 50, 96,213,107,103,194,244,134, 30,190,241,208,130, 45, +246, 44,121,248, 75,102,178,223, 41,206, 71,249, 10,233,251,144, 16, 46,206, 20, 30,242, 23,226,118, 37, 13,141, 86,136, 59, 85, + 4,213,117, 4,197,191,211,128, 0,240,113, 61,131,188,188,188,200,168,168, 40,139,157,194,213,107, 31, 68,134, 6, 7,225,240, +205, 91,232, 19,208, 21, 3, 7, 7, 66,232,236,141,135,250, 84,162, 82,169, 66,197, 77, 29,126,191,165,130,171,168, 20,121,121, +238, 86,237,181, 17,230, 60,181,120,177,184,180,187, 63,156,135, 13, 23,168, 14,236,159, 3,224, 43, 27,236, 48,158,248,156,167, + 95, 90, 36,254, 93,236, 7,183,144, 8, 65, 77,225, 65, 91,237, 1,192,156, 23, 23,190, 44,134,179, 59,250,244, 11, 19, 92, 56, +123,194, 30, 91,142, 4,205, 60, 35, 20, 69, 65, 34,145, 72, 1, 40,140,239,137, 97,195,134,177, 34,127, 0,112,114,114,242,148, + 72, 36,115,111,223,190,237, 26, 18, 18,130,161, 67,135, 66, 36, 18,225,147, 79, 62,129, 78,167,195,160, 65,131,240,227,143, 63, +226,216,177, 99, 56,115,230, 12,132, 66,225,103, 58,157,110,170, 37,155, 83,167, 78,109,238,231,172,245,131,108, 8, 87, 46,151, + 75,253,252,252, 20,132, 16,139, 14,208,205,155, 55, 57,239,149,193,216,182,245,251, 12, 81,159, 63,127,222, 98,191, 17, 26, 26, + 42,229, 74,230,231,207,159, 87, 84, 87, 87,195,195,195, 67,106,143, 16, 56,113,242, 16,121,235,157,249,232,212,201,165,213,103, +245,245, 74,228,252,120, 26,103,228,114,106, 74,247,238,228,122, 98,162,249,190,253,192,106,125, 99, 30, 88,141,238,147,226, 33, +137, 24, 14, 93, 72, 88,203,240,217,119, 27,224,245,254,116, 12, 48, 24, 42, 82, 62,250, 60, 62,183,114,126,203,210,230,193,187, +139,171,190,224,141,143,144,178,232, 25, 0,192,221, 59, 13,120, 47,125, 45,137, 24, 58,214,102, 17,224,232, 33, 5,139, 2,128, +241,216,173,121,234, 29, 5,165,165,165, 88,186,116,169, 77, 2,194, 18,244,158,126, 50,181,103,207, 30,146,149, 57, 18, 16, 43, + 9,155,177,127, 83,100,109, 76,202,150,134, 5,204,193, 80, 80, 28, 57,114, 68, 49,122,244,232, 22,161,127,174,246,254,187,216, +205,108,231, 54,103, 85, 61,107, 59, 52, 77, 71, 58,187, 82, 16, 8, 0, 87, 23,160,170,134, 70, 35, 33,232,228, 66, 65, 69, 3, +202, 70,130,158, 93, 5,160,181,192,165,235, 58,148,150,150, 42, 96, 33, 61,237,185,162, 31, 34, 7, 14,236,175, 16,139, 9, 94, +152, 59, 10, 58, 29,193,205, 10, 53,174,221,168, 2,156,174,195,197,171, 17,229, 21, 87, 32, 16, 87,227,220,185, 42,120,120, 89, +182,215, 86,112,246,246,126,227,241,191,253,205,249, 53, 26,240, 90,154,230,118,235,244,169,215,109, 36, 89, 2, 0, 18, 15,239, + 55,254,239,201,191, 57,175,186,172, 67,207,217,169,110, 23, 74,207,152,178,103,117, 71, 54,153, 76,134,206, 30,158,111,204,121, +242, 41,231, 51,215, 42,145,248, 68,178,219,191,223, 73,177,245,220,204, 70,242,204,149, 91, 17,222, 58,230, 25,137,143,143, 71, + 84, 84, 84,126, 86, 86, 22,148, 74,101,115, 27, 50,158,127,124,124, 60,171, 54,117,118,118, 30, 91, 95, 95,223, 63, 52, 52, 20, + 82,169, 20, 41, 41, 41,120,238,185,231,244,157,185, 70,131,245,235,215,163,160,160, 0, 39, 78,156,192,247,223,127, 15,165, 82, + 25, 76,211,116,172, 37,155, 83,166, 76,113,232,253,180, 99,199, 14, 86, 67,115, 20, 69, 41,184,134,240, 13,109,219,242,253,166, +208,112,126,117,117, 53,202,202,202, 76,126,238,239,239, 15, 91, 9,188,172,172, 12,101,101,101,118, 9,129, 51,167, 47,226,155, + 13,219, 49,126,252, 88,132, 13,234,209, 92, 94,116,246, 6, 14, 28, 56,132, 31, 55,255, 76,178, 94,125, 21,215, 19, 19,225, 50, +110, 28,148,191,252, 98,210, 78,230,248, 20, 10, 0, 46,109, 88, 67, 6, 87,236,198, 83,123,183, 67, 23, 18, 6,229,162,229, 0, + 0,151, 85,203,225,118,177, 8,139, 75,197,232,251,244,130,123,245, 88,127,239, 57,181,116,126, 81,209,227, 90,157, 95,222,158, + 95,112,230,244, 69, 68, 12, 29,107,243,253, 99,203,144,130, 97,184,223, 82, 52, 64,196,213, 99,119, 52,209,218,139,172,172, 44, +187,190,159,156, 41, 35,232, 14,100, 38,232, 59,174,204,130,228, 22, 97,126,189,199, 95, 77,140, 35, 1,108,201,186,162,162,162, + 5, 57,219, 66,214,108,193,136, 14,153, 76, 70,172,229,131,182,228,217, 48, 96,194,255,230,236, 17, 66,200,237,115,175,160,123, + 83,232,191, 89, 49,235, 8, 84,106, 64,211, 84,166,209, 18, 16,129,254,253,217, 51, 5,204, 42, 1,147,112,119,175, 86,212, 43, + 5,240,241,246, 68,213,221, 6, 84, 85, 87,225,200,241,155,184,113,139, 64,220,169, 1, 61,130,235,160,108,184,141,190,131, 53, +232, 29,218,136,239,191, 40,192,238,221,187, 35,239,227, 45, 39,144,201,100, 81, 51, 95, 72,238, 86,230,225,133, 18, 45,224, 18, + 53, 25, 2,175, 46, 62, 50,153,108,178, 92, 46,255,201,128,172,157, 96, 48,238,109,174,223,151,201,100,209, 73,115, 95,232,246, +135,192, 3, 87,235, 52,240,140,136,130,200,221,203,216, 30,192,110, 2, 91,204,180,233, 51,186, 17,161, 51,170,235, 27, 49,112, +216, 24,184,117,246, 48,101,171, 93,192,120,255, 20, 69, 97,219,182,109, 36, 62, 62, 30,219,183,111,135,139,139, 75,100,106,106, +170,130, 11,249, 3,112,174,170,170,122, 90,163,209, 8, 92, 93, 93, 49, 97,194, 4,172, 90,181, 10, 78, 78, 78,144,201,100,216, +176, 97, 3, 10, 10, 10,112,228,200, 17,252,252,243,207, 56,123,246, 44,124,124,124,124,180, 90,237, 67,176, 50, 4,146,156,156, + 76,172, 13, 1,124,241,197, 23,172,206,179, 45,135, 0,182,110,221,234,144, 33, 0, 15, 15, 15,105, 89, 89,153,194,220,103,246, +182,187, 45, 66, 64, 90, 82, 66,238,172, 92,137, 15, 0,224,240, 97,220,157, 25,135,213, 67, 66,154, 67,246, 97, 3, 6, 96,214, +236, 41,232, 93,121, 27,215, 19, 19,209,101,201, 18, 40,130,130,168,193,191,252, 98,241, 57, 17, 75, 31, 70, 72,108, 36, 22, 47, +121, 23,255, 66, 17, 86,143,158,132,129, 35, 70, 33,248,110, 41,214,123, 14, 69,169,199, 45, 12,146, 72,136, 74,165, 98,213,190, +210, 73, 67,240,212,211,241, 56,250,235, 89,236,206,253, 9,111, 2, 88,189,106, 29,194, 6, 12,192, 83, 79,199,163, 65,121, 7, + 18, 14,246,140, 97,239, 28, 0, 78, 17,128, 7, 9,114,185,156,114,196,172,117,134,220,179,150, 94, 6,132, 98, 36, 79,238, 13, +120,246, 70,102,211,130, 37,182, 99,255,142,134,225,181, 49,147,254, 12, 61,127, 99, 48,115, 3,204, 77, 6,180,101, 39,194,141, +139, 58,153,141, 8,184,215,164,224,138,154,224,230,109, 26,128, 0,110,174,250, 16,167, 70, 75,160,106, 4, 84,106, 64,213, 8, +168, 53,128, 74, 9,168, 27,239, 69, 73, 76, 9, 10, 55,237, 43,228,198,181, 0,244,234,227, 6,226, 36,194,109,165, 18,138,125, +215,113,174,248, 6,238,222,173, 67,216, 48, 29,234, 85, 90,168, 26,117, 80, 54,208,184,121, 13, 80,214, 3, 91,182,108, 81,112, +217, 0,195,206, 54,161,133,158,158,111, 60,243,234,171,146,239, 13, 40,196,235,213, 52,183,187, 75, 23,189, 14,224, 39, 3,178, + 86,179, 48, 73, 68,110,158,111, 60,247,242, 82,201,174, 27,186,230,194,158,143, 47,117,187,250,229,171,134,246, 88, 69, 1, 92, +221,220, 95,127,233,149, 69,146,146,178,123,187, 69, 38, 60,145,236,246, 93,230,106, 83,182, 56, 61,107,166,238, 37,142,207, 26, + 97,188,127,137, 68, 34,141,138,138,202,103,150,140, 42,149, 74, 69, 65, 65, 1, 21, 31, 31,207,214,150, 22, 64, 48, 0, 58, 60, + 60,156,150, 72, 36,130, 13, 27, 54,224,217,103,159,197,251,239,191, 15, 66, 8,126,253,245, 87,236,219,183, 15,103,206,156, 65, +117,117, 53,250,246,237,139,154,154, 26, 87,129, 64,224,107,205,248,180,105,211,204,138,100,102,104, 96,202,148, 41,156,194,244, + 29,117, 8,192, 82, 20,192, 30,239,223, 94, 33, 80, 89, 85,213,252,222, 55,109, 30, 6,166,205,199,120,163, 99, 46, 63,250, 28, +122,238, 63,142,146, 69, 47,224, 87,127,127,184, 0, 56, 35,151, 83, 48,177, 44, 78,169, 84,146,158, 61, 59,227,234, 53, 32, 44, + 34, 20, 88,249, 26, 94,254,114, 11,230, 6,157,198,144,198, 98, 44,190, 37,198, 59, 27,151,225,253,244,207,113,230,236, 65,244, +234, 25, 70, 92, 92,204, 71,125, 13,237,121,119,113,197,163,113,163,240,104,220, 40,188, 69,127, 4,117,227, 82,156, 60, 9,156, + 60, 9, 28, 56, 16,143,127,175,185,136,184,184, 88, 18, 16,240, 16,130,130,190,225,196, 79,121, 15,191,134,146,131, 34, 43,125, +247,231,127, 13, 1, 32,147,201, 72, 82, 82,146,148, 25, 51, 52, 22, 1,134, 29, 18, 51, 30,111,235,124, 0,134,244,163,163,163, + 41,253, 48,128, 24,153, 27,239,239,245, 50,179,254,163,162,162,168,188,188, 60, 98, 45, 26, 98,109,217,161, 37, 66,231, 58, 28, +240,244,171,245,240,239, 38,192, 19, 9, 98,168, 26, 1, 15,119, 10, 2,170,201,235, 7,129,170, 1,168, 87, 19,212, 43, 9,234, + 85, 4, 52, 1, 4, 22,230, 92, 63,189,176, 30,131,134,148,194,175,255, 93,236,217, 85,129,187,119, 85, 8, 31, 83,131,193,222, +117,128, 83, 35, 84, 13, 52, 42,110, 16,212,215, 83,208,106, 41,120,251, 80, 0,117,223,231,178,133, 13, 29, 50,100,184, 87, 64, + 0, 14,233, 12,196,203, 19, 79,226,110,106,202, 48,153, 76, 54, 64, 46,151,159,227,112, 63,135,142, 24, 55,113,120, 23,255, 0, + 28, 63,218, 60, 71, 14, 93,165,255,135,171, 95, 44, 53,101,207,210, 86,216, 3,198,141, 27, 63,220,223,191, 39,206,157,184,220, + 92, 62,238,145, 41,248,159,124, 21,231,115,107, 3, 52,159, 59,243,252, 50,195, 0, 12,182,111,223,222,106,254,145,137,185, 0, + 76,163, 7, 3, 56,181,100,201,146,177, 34,145,200,237,235,175,191,198,186,117,235,240,204, 51,207, 96,197,138, 21,160, 40, 10, + 87,174, 92,129, 82,169, 68,106,106, 42,180, 90, 45,230,205,155, 71, 83, 20,101,245, 1,112,228,108,250,142, 62, 4, 96, 41, 10, +224, 8,239,223, 86,108,216,176, 1,127, 75,158,133,234,170, 70, 32,125, 45,234, 15, 28, 71,167,241,195,155, 63,175, 72, 95,139, + 34,103,103, 80,255,120, 30, 3,103, 63,138,195,235,119, 97,240,224, 17,102,237, 93,186, 84,136, 49,227, 98, 81, 88,228,133,181, +159,101, 97,252,248,177,120,231,211,101,120, 43,106, 14,190, 5,208,255,169,103,177,246,179, 44,136,197, 94,152, 58,109, 56,190, +230, 96,239,227, 15, 54, 97, 68,252, 32,188, 59,104, 21, 10,167,184,193, 43,225,199, 22,199,250,184, 74,112, 52, 95,129,128,191, +205,229, 92, 15, 7, 15,138,176,114,165,139, 21, 1,247, 23,138, 0, 24,143, 35,155, 35,248,166,227, 88, 35,179, 64, 63, 67, 93, + 79,252,151,144,245,201,101,232, 87, 1,180, 20, 5,108,134, 1, 28, 29,214,207,203,203, 35,134,222, 63, 19, 17, 48,252, 63, 41, + 41, 9, 76,178, 28,115,137, 33,184,144, 63,179, 10,192,156, 61,173, 14,168,111, 32,104, 84,235, 39,251, 53,170, 9, 68,206,247, + 62, 83, 53, 0, 74, 13,193,157,187, 4,127, 84, 18,156, 56,167, 5, 77, 3, 73, 73, 73,210, 75,151, 46,181,106, 27,173, 22, 40, +187,174,198,245,146, 74, 28, 60, 92, 9, 66, 40,156,251,141, 70,252, 19, 90,136, 69, 4,127,220, 2, 14,254, 4,212,212, 16, 16, + 26,120,120, 18, 5,137, 4,136,141,157,138,171, 87,175,178,186,166,236,245, 50, 50,109,174,237,171, 68, 4,110,157, 95,125, 97, + 69,134, 83, 14, 17,180, 96, 98, 31,103,103, 56,253, 99,161,211,149, 53, 31, 45, 3,240, 36, 91,123, 66, 23,183,101,243, 95, 95, +225,244, 83, 25,105, 97,175, 75, 39,103, 12,156,253,162,211,185, 77,159, 24,219, 51, 27, 1,144,184,116, 90,182,244,141,229, 78, +151,111, 86,183, 56,160,179,123, 39, 76,127,226, 25,167,156,255,126,197,233,220,218, 42,106,103,170, 44, 34, 34,130,156, 56,113, + 2,219,182,109,107,245,157,132,132, 4,147, 77, 1,160, 16,192,169,213,171, 87, 15,241,244,244,116, 99,194,224, 95,125,245, 21, +158,125,246, 89,172, 91,183,174,217,139, 95,189,122, 53,170,170,170, 80, 83, 83, 83,215,208,208, 80,218, 20, 65, 16, 91, 58,215, + 23, 94,120,129, 24,135,232, 25,239,159,109,248,255, 65, 25, 2, 48, 21, 5,112,180,247,207,216,100, 59, 4,112,110,204, 24, 80, + 47,204,134, 39, 0, 50,105, 24, 26, 78, 20,162, 62,125,237,189,122, 75,158,133,190, 79,205,130, 68,162,191,254,162,162, 98,139, +132, 93, 84, 84, 12, 0,136,141,211,139,136,130,227,103,240,237, 55,223,193,117,212, 72, 52,104,180, 80, 67,141, 9, 19,135,182, + 56,158,173,189,235, 58, 53,158,232,246, 34,232, 19,141, 72,250,215, 36,136, 31, 59,130, 1, 97, 3, 16, 54, 48,184,249,252, 82, + 23,175, 65, 80,144,144,245,125,243,200,255, 61, 18,117, 14,231,246,224,127,223, 80,214,166, 0,124,254, 57,218, 38, 17, 80, 71, + 68, 65, 65,129,213,217,228,121,121,121,145,172,151, 20, 58,119, 66, 86,239,253,128,182,128,160, 79, 39, 36,167,247, 65,102,126, + 60, 5,100,146,123,130, 32,218,230, 97, 0,227,165,128,230,150, 6,154,235, 44,101, 50, 89, 51,249, 27, 79, 0,100, 66,234, 76, +153,165, 8,128,161, 61, 71,117,230, 59,119,238,140,188, 81,190, 75, 65,119,165, 33, 16, 1, 78, 2,253,253,173,161, 9,180, 90, +160,182,150, 64,173, 1,180, 26,189, 40,152, 58, 77, 31,189,185,116,233,146, 89,123,141,183,119, 42,194,194,104, 28,216,167, 3, + 37, 0,254,184, 73, 65,226, 2,236,219, 13,168,149, 20, 40, 2, 12,142,112, 66,217, 53, 26, 19, 39, 78, 65, 92, 92, 28,197, 38, + 19, 86,246,122, 25, 89,249, 34,176,228, 83,219, 69, 0,161,117, 49,186, 46, 62,130, 93,244, 61, 22,234, 6,192,143, 2,148,195, +134,137, 46,107,117, 49,156,236, 17, 58, 6,238,222, 2,197, 77, 93,179,189,174, 18,192, 71, 66,193,117,208, 48, 81,209,119,116, +140, 57, 47,218,148,173, 78,238,158,130,171,183,170,154,136, 5,112,119,113,134,187,171, 24, 17,225, 67, 69, 91,190, 37, 49,237, +252,232,154,172,115,102,214,127,124,124,124,243, 61,202, 68,239,102,206,156,105,201, 3,173, 3,112,249,228,201,147,117,227,199, +143,239, 10,131, 53,253, 95,125,245, 85, 51,201,106, 52, 26,232,116, 58, 92,186,116, 9, 93,187,118,189, 77,211, 52, 43,181, 56, +109,218, 52,179, 67, 0, 92,136,246, 65, 24, 2, 48, 21, 5,112,164,247,207,133,248, 25,116,247,247,196, 23, 95,236, 69, 98,194, + 24,116, 27, 22, 6, 12, 11, 3,245,194,236,150,162, 23,192,173,155, 74,108,221,118, 24,221,253, 61,217,219,243,115,193,176,225, +125, 49,108,120,223, 86,199,113,181, 55, 97, 70, 40,210, 38,126, 2,186, 80, 79,254,207, 45,126,218, 38,123,198,120,213,253,213, + 61,239,215,190, 31, 93,142,242, 54,123, 32,237, 18, 0, 5, 5, 5,247, 61,107, 31,227,229, 50, 68, 23, 21, 21, 69,153, 32,127, +194,132, 21,147,146,146,108,250, 29,195, 85, 0, 76, 25, 87,207,223,120, 2, 96, 19,154,203, 82, 82, 82, 20, 73, 73, 73,172, 31, + 50, 67,242, 55, 53, 39,128,171, 61,107, 88,185, 89, 5,107,246,226,226,226,242,151,165,110,197, 35,163,157, 64, 3,208,168,105, + 56,139,245,213, 84, 91, 79,208,168, 33,208,234,128,130, 66, 29,116, 52,129,181, 37,123,113,113,113,249,111,188,182, 21, 19, 35, +133,152, 62, 71,136,186, 90,130,218,106,160,190,150, 66,159,190, 4, 58, 13, 5,145, 64,130,170,187, 52,202,126, 87, 99,209,203, +236, 38,140,101,175,151,145,143, 22, 2, 33, 1,192,154, 87,128, 5, 31,216, 38, 2, 72, 67,253,140,127, 12, 27,186,211, 47,103, +167,155,215,184,135,209, 13, 64, 55, 10,208, 29, 58,136,188,167,159,172,211, 52,212, 79,231, 98,143, 86, 53, 76,127, 33,106,248, +174,208,183,178,221,124, 7,143,133,143, 51,133,174, 18, 10,202,243,191, 96,235,107,115,235, 52,202, 6,214,246, 26, 85,202,233, +113,143,140,223,149,146,254,153,219,128, 33,195,224,238, 42,134,187,139, 51, 74,206,157,194, 27,169, 47,213, 41, 57,216,178,197, +147,103,115,185,166,200,127,249,242,229,173,194,252, 63,252,240,131, 34, 33, 33, 1,102,146, 4, 49, 68,175, 6,112,170, 95,191, +126, 37, 42,149,170,135, 80, 40,148,184,186,234,151, 98,109,222,188, 25, 51,103,206,132, 82,169,132, 74,165, 66, 99, 99, 35,220, +220,220, 84, 58,157, 46,135, 16,114,147,205,201, 58,106, 53,192,131, 50, 4, 96, 24, 5, 96,222,183, 7,241, 51,232,211,199, 15, +175,166, 37, 99,247,174, 95,145,189,229, 4,156,197,157,241,123,217,189, 17,172,158,254, 3,208,168,174, 65,196,176,254,248,240, +163,100,188,159,254, 57, 39,123,190,190, 30, 40, 58, 87,212,252,121,216,128, 48, 84, 84, 84,115,178, 55,101,225,116,204, 20, 60, +137,198,194, 58,140, 94, 48, 16,244, 96, 9,190,248,226,251,230,243,171,174,174,198,216,135, 67, 89,217, 51, 70, 84,102, 20,245, + 51,126,110, 83, 62,181, 89, 0,180, 5,249,179,177, 25, 21, 21, 69,101,101,101,145, 38,111, 23, 89, 89, 89,196,112, 89,162,177, +215,111, 74, 32,180,142,195, 82,128, 88, 0,184, 8, 1, 55, 17,208, 88,139,172,247,157, 0,151,163, 36,249,177, 62,128,139, 55, + 50,191,225,238,245, 91,154,237,207,144, 53,219, 53,236,198,228,111, 60, 39,128,171, 61,182,228,207,198,222,123, 25,107,169, 87, + 22,206, 35, 18, 9, 64,211,192,160,126,194,123,237,113, 86, 7,141,142, 64, 71, 11, 49, 99,198, 12, 86,226,228,237,119,215, 82, +139, 22,205, 35, 90, 45,160,214, 16,232,180,128,128, 2, 34,167, 0,181, 85, 20,126, 59,173,132, 82, 37, 64, 98,194, 12,214, 97, +255,229,207, 1,193, 61,245,255, 7,245, 0,108,141, 4,200,229,242, 35, 50,153, 44,246,230,212,184, 93, 1, 91,119,186, 5,140, +123, 24,154, 67, 7,241, 99, 66, 92,157,186,182, 54, 86, 46,151, 31,228,104,239,160, 76, 38,139, 61,255,230,180, 93,254,255,202, +113,235, 49, 98, 28,234,207, 31,194,198,127, 76,173,107,108,224,102,143,177,181, 58,237,239,187,222,249,248, 75,183,209, 99,198, +162,184,232, 20, 94, 74,126,178,174,161,174,142,243,185,181, 53,204, 37,251,145,201,100, 36, 62, 62,158,205,106, 0,161,167,167, +231, 41,165, 82,249,109,105,105,105,239, 33, 67,134, 4,106,181, 90,145,147,147, 19,114,114,114, 16, 29, 29, 13,149, 74,133,134, +134, 6, 92,186,116,169,198,203,203,107,175, 82,169,252,154,166,233,122,176,204, 0,200, 36, 5, 98, 66,236, 92, 66,255, 15,218, + 16,128, 97, 20,192, 17,237,107, 75,238, 0, 83,120, 52,118, 20, 30,141, 29,213,244,159,253, 26,182,165,189,105,246,137, 59,207, + 31,208,120,186, 14, 79,127, 54, 5,239,236, 93,102,247,185, 41,159, 81, 18, 47,173, 23, 84,223,168,238,139, 99,109,147, 0,104, + 15,207,223,216,251, 48, 12, 99,155, 11,245, 59,242, 28,185,140,253, 59,154,252, 13,196,142, 97, 34, 32, 70, 4, 41,154, 34, 29, +156,236, 89,155, 11,192,213,222, 7, 31,175,165,100, 50, 25, 17, 8,128,131, 5,250,177,126,102,194,159,126,220,127, 6, 39,123, +171, 86,173,165,230,205,111,202, 73, 33,208,219, 56,186, 31,168,175,163, 65,104, 32, 49,113, 10, 98, 98, 98,172,182, 71,246,122, + 25, 73,125, 18,240,116, 3,202,110, 3, 46,206, 0, 77,128, 78, 18, 32, 93, 6,164,201,109, 18, 1, 7,101, 50, 89,108, 65, 98, +220, 46,143,229,111,187,229, 47,127,163,174,209, 6,242, 55,182,151,191,100,234, 46,151,127,188,233,150,251,239,183, 56,147,191, +161,173, 23, 95,124, 49,238,141,127,190,176,115, 65, 74,170,219,103, 31,102, 48,228,127,218,196,179,175,229, 98,219,218,208, 17, +215,231,205, 20,249,207,155, 55,143, 48, 43, 1,182,109,219, 70, 40,138,178, 36, 4,220,212,106,117,157, 64, 32,200,243,247,247, +239, 89, 91, 91,251,226,241,227,199,187, 15, 29, 58,148,214,106,181, 13,213,213,213,183, 78,159, 62,125,165, 79,159, 62, 37, 93, +186,116, 41, 85, 42,149,155,181, 90,237, 45, 66, 8,107, 1,192, 36, 5, 50,136, 10,216,210,190,210, 54,236, 11, 29,110,219, 81, +227,254,246,218, 81, 41,133, 14, 61,222,209,246,170, 42, 5,200,208,202, 16,120,216, 15,179, 63,181, 46, 76,170, 42, 5,120, 40, +192,242, 49,247,147,252,205, 10, 0,107,107,253,185, 62,232,108,115, 7,112,177, 43,151,203, 41,115,155,237,112, 33,175,204,100, +185, 62,204,127, 17,192, 69,227, 79,171,155,254, 46,195,134,235, 85, 56,138, 92, 13,235, 69, 38,147, 17, 38,207, 64, 74, 74,138, + 77, 43, 28,140,237,109, 92,212,169, 89, 20,216, 35,154,140,219,132,153,240,103,107, 84, 98,237,231, 45,237,213,213,232, 59,224, +196,196, 68,110,247,223,183, 14,125,102, 52,134,164,189,111,249,155, 27, 26,107,107,159,182,215,187,102,236,253,244,217, 91, 27, + 84, 13,181,115,229,114,249, 33, 91,109,125,250,233,167, 7,100, 50, 89,236,103, 31,173,220, 80, 87, 87,103,238,220,180,184,255, +104,209,163, 26,147,127, 94, 94, 94, 36, 33, 4,219,183,111, 55, 60,198,146,189,107,106,181,218,153, 16, 82, 75,211,180, 92,173, + 86,255, 26, 16, 16,224, 83, 85, 85, 69,189,254,250,235, 53,213,213,213,119,122,244,232, 81, 91, 87, 87, 87,175, 86,171,107, 52, + 26, 77,163, 78,167, 83,114, 57, 97, 7, 13, 3,228,183, 97,157,230,227, 79,138,126,253, 6, 83,111,190,150, 73,102, 61, 30,141, +176,129,125,204, 30, 87, 84,120, 25,155,190,219,131,126,253, 6, 83,247,211,222,144, 33, 67,168,212, 69,114, 50,235,241,104,203, + 14,243,241, 82,108,250,110, 15,134, 12, 25, 98,245, 94,186,159,228,111, 82, 0, 56,218,179,111,203, 72, 65, 84, 84, 84, 62,171, + 16,191, 21, 56,114, 86,255,253,136,140,112,217,244,199, 17,209, 0,174,109, 98,184,172,203,222, 33, 9, 99,123, 92,201,223,158, + 25,255,108, 72, 27, 64, 80, 71,180,231,232,115,115,208,189, 77, 1, 0, 69, 81, 68, 32, 16,128,249, 99, 66,216, 83,166, 76, 65, +108,108, 44,104,154, 6, 77,211, 32,132, 88,251, 61, 74,171,213,186, 18, 66,116, 52, 77, 55,106, 52,154,253, 66,161,144, 18, 8, + 4,206, 0,156,105,154,134, 78,167, 19,106,181, 90,177, 86,171,237,174,211,233,206, 27,124,183,205, 55, 1,226,225, 24, 17,112, +165, 84, 69,118,239,220,130,107, 21, 53,240,243,106,104,254,236,102,165, 43, 2,124, 59,163,127,255,254, 86,201,186,173,236, 13, + 25, 50,132,186, 89,214, 72,214,124,180, 3,197,191,223,110,101, 47,184,167, 15, 2, 3, 3, 89,145,127, 91,193, 82,142, 20, 42, + 60, 60,156,223, 30,147, 7, 15, 30, 15, 42, 26, 12, 8,157, 54,112,108, 68, 6,229,229, 0, 60,160,159, 52,206, 19, 63, 15, 30, +230, 34, 0, 60,120,240,224,241, 0, 65,210, 36, 2,104, 3,226, 23,224,222, 16,135, 8, 64,247,166,247, 52, 95, 93, 60,120,240, + 2,128, 7, 15, 30,127, 14, 8, 0,184, 25,252,207, 16,191,216,128,244,233,166,227,120,239,159, 7, 15, 94, 0,240,224,193,227, + 47,210,167,241,164,207,131,135, 5,245,204,131, 7, 15, 30, 60,120,240,248, 43,171,229,249,243,231, 27,110,164, 67, 12,103,216, +203,100, 50, 98,180,209,206,181,168,168,168,230, 85,141,166, 82,177, 26,218,227,138, 63,163, 61,227,101,139,134,245,201,215, 31, +223, 30, 29,221, 94,122,122,122,243, 49,105,105,105,148, 13,246, 0, 51,233,128,249,251,217,186, 77,254,249,229,237,113,177,199, + 89, 0,112, 68, 87, 54, 7, 49,187,247, 57, 74,177, 24, 39, 35, 49,181, 27,160,169, 99,218, 67, 93, 49, 4,147,148,148, 36,101, +136,134,201, 0,102, 41, 39,248,253,196,246,237,219, 35,183,109,219,214, 76,130, 83,166, 76,145, 38, 38, 38,230,255, 25,213,174, +169,246, 56,127, 94,191, 50, 44, 52, 52,180, 93,207, 77, 38,147,145,169,211,100,200,201,150,155,188,103,119,238, 58, 65,114,178, +229, 22,239,229,157,187, 78, 88,236, 4,226, 98, 35,108,190,233,210,211,211, 73, 66, 66, 80,139,255,173,137, 0,107,168,173,171, +141,220,250,211, 86, 4,134, 5, 42, 64, 1,231, 79,158,147,142, 9, 31,139,208,126,161,156,238,191, 67,135, 14,181,186,238,177, + 99,199, 82,224,193,131, 71,155, 9, 0, 49,219, 3, 71,143, 30,205,217,184,169,205, 98, 24,152, 34, 81,227,141, 54,216, 18,173, + 45, 27,227,176, 17, 20,140,221,212,212, 84,100,100,100, 40,204,237, 45,206, 28,103,105,173,166,241, 57,246,232,211, 11, 0,112, + 75,165,130, 86,217,168, 47,172,170, 1,160,223,251,128, 75,110, 4, 67,242, 7,244,185,197,185,172,181,151,201,100, 68, 64,233, +179,235, 49,175,128,136, 87,212,158, 0, 0, 14,255, 73, 68, 65, 84,229,247,159,175,189,255,130,204,184, 61, 24,226,183,181, 61, + 28, 41, 42, 25,242,143,139,141, 80, 1, 50, 73, 78,182,220,230,223, 96, 4,132,105, 1, 32,183,235, 60,213,234, 84,228,230, 38, + 35, 38, 38, 19, 9, 9, 25,205, 17, 1, 91,132,192,193,162,131,228,161,161,189,240,161,124, 21,188, 92,189, 64,107,117, 80,145, + 70,197,238, 95,127,138,217,187,239,103, 50, 54,112,156, 84, 34,145, 88, 21, 2,135, 14, 29, 34, 77,145,133, 86, 30, 17, 47, 2, +120,252,149,113,234,212,169, 22,255,155,234,211,236, 17, 0,156,230, 15,152,218,197,206, 17, 32, 64,164,221, 54, 8,123, 13,192, +198,115,151,201,100, 36, 53, 53, 21, 43, 86,172, 0,128,230, 87, 83,199, 89,219, 33,172, 21, 60, 59,227, 76,233,119,112, 65, 79, +232,240, 11, 42,254,115, 2,167, 75,238, 96,198,138,117,237,118,163,157, 57, 91,136,193,131, 6,130, 38, 64, 97,161,254, 61,112, +239,189, 97, 57,205,178,170, 13,115,176, 91, 66,102,102, 38,197,182, 61,230,206,157, 11, 0,205,175, 38,201,159,162, 0, 11,247, +131, 76, 38, 35,143, 60,178, 11, 50, 89,172, 67, 69, 64, 92,108, 68, 67,114,114,178, 43,144,137,156,108,110,196,110,232,225,219, + 75,242,230,188,127, 0,152, 57,115, 51,114,115,245,175,201,201, 37, 96, 34, 2, 92,162, 1,132,144, 72,197,133,189,138, 23,255, + 49, 31,195,187, 14,133,139,135, 7,136, 90, 11,154,232, 32, 20,137, 17, 28, 21,156,251,219,176, 11, 88,145,153,161, 24,229, 51, + 90,234,234,234,106, 85, 4,220,190,125,187,197,255, 83,198,119,194,168,133,191,224,241, 12, 85,139,134,156, 52,105,146,205,237, +149,157,157, 77,166, 77,155,230,176,246,118,180,189, 54, 38,146, 72,123,211,250,158, 58,117, 42,178,137,132,108,181, 51,248,149, + 87, 94, 41,175,175,175, 15, 0, 48, 25,250, 77, 56, 67, 1,156,130,126, 83, 40, 0,216, 40,151,203,127,227,169,191, 53,249, 51, +101,198, 34,160,133, 0, 40, 45, 45, 37,165,165,165, 0,128,192,192, 64, 24,110, 54, 3,160,197,255,166, 62, 55,135,138,138, 10, + 69, 86, 86, 22,235, 72,128,241, 94,247,150, 72,152,106, 74,133,105, 76,162, 92, 67,236,153,153,153, 86,143,201,203,203, 99, 69, +254, 73, 73, 73,102, 73,127,233,210,165,200,200,200,128,161, 64, 96,131, 30,125,122,225, 70,101, 53,126,156, 55, 19, 93,168,113, + 40,249, 98, 17, 2,167, 7, 98, 79, 59,147, 63,128,102,194, 7,128,129, 3, 7,182, 40,103, 34, 3,134,229,142,246,236, 45, 17, + 49,211, 30,230, 72,127,253,250,245,200,200,200, 64,236,184,161,216,245,203, 73,192,189, 19, 80, 83,119,223,235,112,231,174, 19, +174, 64, 38,118,238, 58,225, 16,123,211,106,150, 89,124, 54,179, 59,191,199,234, 1, 49, 12,253, 39, 39,231, 34, 33, 33,168,249, +149, 65, 66, 66, 16,107, 17,240,197,255,190,192,251,159,190,139,241,125, 35,161,107,108,132, 86,167, 5, 37,162, 0, 8, 65, 64, +227,214, 31,101, 8,237,218, 31,203,230, 45,195,187, 43,223, 85, 60, 50,208,122, 52,203,184,179,155,226,191,222, 36,225,239,221, +187,151,216, 34, 2,178,179,179,201,206,215,119, 33,238, 29, 56,132,180,179,179,179,201,202,149, 43,177,100,201,146, 14, 45, 2, + 78,157, 58, 21, 89, 93, 93,173, 40, 43, 43, 67,120,120,184, 93,231, 89, 93, 93,173,184,215,101,219,244,156,151, 2,152, 11,224, + 36,128,175, 1, 68, 3,120, 20,192,223, 13, 4,192,237, 63, 41,159, 83,176,176, 13,184, 69, 71, 42, 85,207, 49,153, 25, 75, 77, +126,222, 66, 0, 4, 6, 6, 82,129,129,129,205,100,111, 24, 74,206,202,202,106,241,191,241,231,151, 46, 93, 50,123,130,140,168, + 72, 73, 73, 81,164,166,166,194,120,163, 28,227,205,115,178,178,178,204,134, 96, 77,117,246,198,101,237,185, 81, 17, 0,108,218, +180,201, 44,241, 3,104, 65,254, 75,151, 46,101,101,243,247,210,107,168,223,242, 6,220,158,253, 24, 61,250,244, 66,183, 46, 46, + 40,221, 82,170, 39,127,207,206,250, 33, 0, 39, 33,231,115, 77, 72, 72,144, 26, 14, 3, 36, 36, 36,112,142,210,208, 4, 8,232, + 4,252,251, 73,224,249,245, 64, 87, 87,224,124,149,233,242,162, 74,142,119,190, 25, 33,199, 37,106,243,246,219,111,155, 37,126, + 0, 88, 57, 55, 30,107,118, 31,129, 95, 96,119,220,188,122,203,170,247, 15, 0,108,162, 0, 92,194,248,122, 15, 95,102,210,211, +103,198,246,185,222,215, 43,255,107,190,142, 66,230,193,134,123, 37,168,197,171, 58, 33, 24,226,109,197,172,191,223,160,108,192, +184,217, 99, 21,163,187,143, 66, 99,125, 61, 68,206,206, 16,137,238,117, 65,165,197,197,216,154,147,115,227,217,103,230,246,232, +237, 28,128,161, 19,195,163,126,205,253, 53,114,212,240, 81,156,188,198,244,157,115,177,111,223, 62, 60,246, 88,203,242, 73,147, + 38, 81, 92, 69, 0, 67,254,232,253, 33,118,190,254,178,221, 34, 32, 59, 59,155,124,244,209, 71, 8, 9, 9,193,154, 53,107,176, + 96,193,130, 14, 39, 2, 12,137,223, 81,246, 24, 91,118, 68, 19,164, 0, 38, 2, 88, 79, 8,169,163, 40,202, 15,192, 5, 0, 87, +229,114,185, 22,127,110, 16,142,245,221,130,252,153,247,153, 25, 75, 91, 69, 1,238, 75, 30,128,172,172, 44,102,236, 21,165,165, +165,240,245,245,109, 37, 16,152,178,138,138, 10, 86,121,238,173, 77, 6,228,210, 97,206,154, 53,171,237,164,155, 1,129,153,242, +250, 51, 50, 50, 32,151,203, 41,107,179, 56,149,184,134,186,233,163, 64,220, 23, 1, 81,175,163, 14,255, 3,254,163,247, 22, 73, +214, 34, 56,253,109, 13,180, 90,238,137,206,226,227,227,243, 89,108,187,106, 57,194,243, 21,240,214, 90,160, 87, 79,224,214,118, + 49, 54,124,169,198,220,239,204,151,115,186,243,137, 99, 51, 85, 27, 78,246, 43,207, 94, 1,247, 48, 9,220,250,254, 19,155, 86, + 60,143, 33, 3,253,208, 47,254, 93, 86,237,193,230,254,100, 59, 84,192,220,187,134,228, 47,151,203, 41,102,226,159, 77, 68,211, +249, 61,202, 22,146, 55, 5,117, 66,176,201,242, 92,163, 72,128, 53,148, 87,148, 99,114,210,100,184,119,246,130,142,210,226,192, +190,253,168,173,171, 67, 66, 98, 34,254,168,168,192, 15,155,127,196,115,207,204,237,225, 44,113,134,128, 56, 33, 38, 34, 38,239, +130, 98,141, 77, 94, 99,101,101,165,221,215,109, 72,254, 0,236, 22, 1,217,217,217,100,249,242,229, 8, 14,214,215,103, 80, 80, + 16, 58, 82, 36,192,209,196,111,194,251,103,222,219,114,173, 3,154,136,208,137,162, 40, 87, 0, 97, 0,206, 1,232, 33,147,201, +106, 0, 84,201,229,114, 62,173, 61, 71,220,183, 68, 64,190,190,190,210,164,164,164, 86, 67, 1, 71,142, 28, 81, 52,109,246,194, +121,142,128,185,201,128,150, 60, 71,115, 2,165, 45,192,120,247,230,194,253,108,189,127, 0,216,253,234,114, 36,188,255, 1,180, + 81,227, 32, 2,224,118,184, 24,123, 74,238, 0, 0,180, 81, 11,160, 57,235, 3,170,235,223, 57,147, 20,219, 40,139, 37,220,153, +246, 63, 44,120,230, 58, 46,206, 91,130,250,159,213,240,243,177, 92,238,136, 8,128, 45,226, 96,253,250,245,122, 53,156, 48, 1, + 71,202, 42,224, 62,196, 29, 55,114, 75, 0,137, 51,102, 46,248, 27,188,123,198,183,219,131,104,110,214,191,163,162, 90,150, 86, + 8, 88, 91, 29,144,155,156,139,152,204, 24,204,220, 12, 36,231,234,223,231, 38,231,114,142, 2,212,169,106,225,227,210, 5, 90, + 85, 3,136,128, 96,196,200,145,216,178,101,139,234,163, 15, 62,144,208,132, 96,206,147,115,224,221,197, 27, 13,117,117,208,234, +180,112,119,234, 12,141, 64, 99,211,245, 86, 85, 85,181, 88, 29,192,117, 66, 96, 43,242,103, 96,163, 8,200,206,206, 38,169,169, +169, 24, 57,114,100,139,242,129, 3, 7, 34, 61, 61, 29,105,105,105,237, 38, 2,218,138,248,141,189,127, 0, 40, 43, 43,179, 53, + 10,240, 43,244,227,253, 53,208,135,254, 39, 3,184, 4, 96, 48,128, 28, 0,235,208,180, 83,167,165,238, 4, 54,134,210,255, 18, + 2,192,152, 16,152, 61,231,217,124,110,105,214, 52, 3,102,120,129,153, 16,200,204, 13, 96,162, 3,129,129,129, 10,102,184,160, +189, 58, 94, 71,194,218, 88, 63,227,253,179,177, 53, 99,237,102,144,196, 62,184, 53, 38, 2, 93, 48, 14, 46, 51,215, 64, 91,254, + 7,224,217, 25,162, 59,255,195,246,143, 10, 0,161,144,243,181,219,178, 10,194, 24,167, 95,249, 63, 12, 15, 7, 2, 23, 20, 34, +204,237, 25, 92,120, 40, 9,248,247, 18,179,229,237, 21, 1,200,200,200,192,248, 17,253, 16, 53, 46, 4, 9,131,150, 96,245, 71, +159,227, 92,193, 13,204,155, 52, 28, 55,115,118,162,186,178,198, 33,247,131,169,161, 2,107,207,135, 37,111,223, 81,247,168, 57, +251,150, 38, 14,166,165,165, 81,233,233,233,100,230,230,150,130, 0, 0, 98, 50, 99, 32,222, 86,140,109,219, 74,154, 87, 2, 48, + 19, 6,189,189,189, 77,246,191, 52, 77, 67, 71, 3,132,214,194,217, 69,130, 39,159,122, 74,242,214,155,111,162, 91,183,110,116, + 15, 63, 63,129,170,190, 14, 58, 2, 16, 90, 7,154,182, 30,209, 26, 59,118, 44,245,195, 15, 63,144, 59,119,238,160,166,166,166, +133,112, 52, 92, 29,192,101, 85, 64,118,118, 54, 89,253,124, 17, 32, 9, 6,110,126,218,250, 0, 73, 48, 86, 63, 95,132,148,255, +176, 19, 1,217,217,217,100,234,212,169,210,129, 3, 7, 42,238,220,185,211,234,243,128,128, 0, 76,157, 58, 85,250, 32, 77, 12, +180,197,251,183, 39, 10, 32,151,203,243, 13,158,175,238, 0, 78, 3,152, 46,151,203,185,108,101,202,147,191, 37, 1, 96,148,232, +199, 90, 34,160, 22,159, 91, 10,153, 38, 37, 37,153,140, 2, 48,100,239,235,235, 43, 77, 77, 77, 85, 48, 99,178, 73, 73, 73, 22, +151, 1, 90,242, 14,185, 78,254,107,171,101,128,140,119,111,105, 50, 32, 23,148,252, 43, 25, 78, 51,215, 64, 89,118, 17,162,195, +107,160,217,188, 0, 84,220, 42,108,253,251, 99,184,186,245, 50, 18, 86,126, 13,136,218, 39,179,243,146, 44, 32,119,229, 22,132, + 93,141, 1,110,215, 99,113,244, 18,139,229,142,136, 0,216,234,253,231,108, 89, 14, 97,143, 1,112, 67, 8,174,237,203, 68, 45, + 69,112,244,226,117, 68, 21,222, 96,217,238,215,154,255,159, 53, 75,222,130,236, 1,224,231,159, 99, 77, 30,103,233,249,176, 22, +234,119,196,178, 67, 71,172, 16, 72,206,189, 71,252, 0, 90,121,254,204,132,193,109,219, 74, 76,126,223,221,197, 29,101,213,101, + 24,217,123, 20,148,141, 42, 64,169,130, 86,173,193,178,212, 84, 80, 2, 8, 26,234,235, 64,211, 58,104,117, 4,206, 34, 39,252, + 81,247, 7,156,116,214, 87, 27, 63,246,216, 99,205,117,115,232,208, 33,194,244, 55,134,171, 3,202,203,203, 89, 95,231,180,105, +211,168,148,255,128,172,126,190, 8,161,125, 90,255,254,249,203,106,164,252, 39, 12,108,201,122,218,180,105, 84,118,118, 54, 25, + 57,114, 36, 2, 2, 2, 90,125, 94, 88, 88,136,156,156, 28, 69,123,145,127,147, 55, 78,181,229,216,191, 33,236,136, 2, 48,152, + 12,253,228,239, 70,158,194, 29, 40, 0,218, 10,140,231, 15, 0,163, 71,143,150,102,101,101, 41,152,208,191, 25,113, 32,189,116, +233,146,130, 43, 9,219,218, 73, 58,122, 25,160,161,247,111,138,248, 25,161,195,229,124, 79,151,220,129,230,236, 91,184,133, 95, +224, 23,183, 10,168,174, 65, 73,230, 34, 4,205,255, 16, 55,215, 45, 2,156, 68,128,160,125, 50, 59, 95,171, 7, 66,125,167,179, + 46,111,143, 8, 64, 70, 70, 70,221,236,168, 81,229, 30,180, 87,175, 6, 56, 73, 54,127,184, 0,159,109, 63,133,197,143, 62,140, +185, 31,252, 23,143,189,247, 77,187, 76, 30,101, 4,104, 83, 30, 0,202, 94,113,106, 79,168,223, 82, 20, 32,185,201,179, 55, 38, +127, 67,239,223, 26,252,125,253,177,251, 64, 46,198,246, 26, 11,215, 78,110,160,105, 2, 1,209,130,166, 40, 16, 66,160, 35,128, +150, 38,208,106,181, 80, 86,215, 99,199,177, 29, 16,235,196,156, 39,165, 26,175, 10, 72, 91, 48, 14, 83,252, 75,145,121,140,189, + 13,115, 34,128, 43,249, 27,218, 75, 75, 75, 35, 43, 87,174, 68,247,238,221,239, 9,251,146, 18,100,100,100,160, 35,120,254,142, + 22, 2,166,188,127,123,162, 0, 77,207, 68, 36,128,135, 0,188,246, 23,152,252, 7, 0, 66, 0,186, 7, 90, 0, 24,207,250, 79, + 74, 74,106, 30,119, 55, 20, 7,134,239,237,241,224,109,233,200, 29,181, 12,208,156,247,111, 43,241, 51,152,177, 98, 29,126, 4, +240,232,251, 83, 64,178, 22,129,154,181, 26,167, 75,238,128,242,246, 66,241,239, 53,122,239, 95, 40,108,151, 59,212,220,122,127, +123,242, 0,176, 17, 92,108,197,193,250,245,235,213, 0,106,159,143, 28, 92,243,207, 85, 31,171, 95, 93,150,170,234,218,217,247, + 78,209,185,107,221,230,158,251,175, 91,123,175, 26, 49, 71,206,134, 67, 52,220, 87, 20,152,250, 13,251, 34, 0,166,200,159,241, +252, 1, 88,157, 16, 40,145, 72,168,115, 91,207, 39, 42,198,229,231, 36, 13,122, 12, 53,170, 26, 80, 2, 64,159, 82,132,134, 78, + 71, 64,107,181,232,228,236,142, 67,213, 39,113,233,112, 49,162, 35,162,243,237,174,220,146, 23, 0,112, 95, 6,216, 66, 4,116, +191,134,243,229, 1, 54,145,191,161,189, 37, 75,150,144, 53,107,214,192,211,211, 19,119,238,220,193,242,229,203,209,209,194,254, +142, 16, 2,230,188,127, 91,162, 0, 50,153,172, 27, 0,191,166, 27,101, 40,128, 20, 0, 37,127, 17, 39, 93,215,150,198,239, 75, + 30, 0,115, 17,129,213,171, 87, 75,141,133, 66, 82, 82,146,130,171, 61, 67, 34,232, 8, 41,118, 13,189,127,227,229,127,165,165, +165, 45,234,141, 75,214, 62, 70, 4, 76,127,255, 43,144,205,128,207, 92, 57,242,255,249, 24, 30,206,216, 8, 56, 57,161,147, 68, +220, 46,215,107,184,198,223,212,123, 27,243, 0,104, 1, 8,154,218, 86, 96,103,123,220,154, 29, 53,170,236,159,153,219,250, 44, +123,110,114,103,127,191, 72, 53,128, 51, 73, 73, 73, 30, 0,220,108,109,143,123, 36, 29, 75, 30,121,100,151, 65,248,159,219,247, + 45,121,240,134,233,129,217, 10,137,182, 72, 6,100, 14,198,164,207, 68, 4,204, 13,121, 60, 61,235,233,173,219,254,187, 13,186, +217,218, 51, 19,123, 77, 28,220,197,189, 11, 84, 26, 21, 8, 33, 16,139,196,168, 82, 54,224,200,239, 63, 99,253,183, 27, 32, 29, + 32,117, 72,226,176,244,157,115,177, 97,195, 6, 44, 90,196, 61, 7,192, 61, 17, 0,187,200,223,208,222,130, 5, 11,152, 60, 0, +232,200, 99,254,134, 66,192,150,239,218,155, 59,192,240, 49,128,126,189,191, 10,192, 43, 0,142,201,229,114, 29,120,152,171,123, +156, 58,117, 10,153, 25, 75, 91,229, 1,176,152, 8,168,173,242, 0,152,138, 8,152, 35,122, 91,162, 0,246,162,173,150, 1, 50, + 98, 68, 46,151, 35, 47, 47,143, 46, 45, 45, 53, 36, 50,105, 84, 84, 20,103,239,102,198,138,117,128, 65,226,159,137,203,214, 54, +191,175,111,135,155,173,173,188,103,138,162, 62, 2,112, 23,250,229, 63, 79,218,105,238,230,243,145,131, 27,163,243,126,237, 60, +231,205,175, 33,151,203,197,121,121,121,221,209, 50,157,181, 77,237,209,214,145, 0,107,249,253,173,161, 45,134, 4,204,145,191, + 58, 33, 24,216,102,221, 49,147, 14,158, 68,237,251,225, 0, 57, 28,112, 4,227, 70,141, 67, 15,247, 30, 0, 77,240,135,234, 14, + 14,157, 56,132,155, 69, 55, 49, 41,116,146,212,217,217,185,221,219,195, 80, 4, 56,138,172,153, 72,192,131, 50,225,207,222, 44, +128, 14,232, 99, 50, 1,100,130, 7,103,152, 75, 0,100, 82, 0,180, 21, 82, 82, 82, 76,146,189,225, 78,108, 70, 80,176, 89, 85, +224, 40,175,191, 45,150, 1, 54,205,240,215,230,229,229,137,154,134, 14, 24,242,159, 20, 21, 21,197, 41,202,209,180,153,146,194, +209,231,104,110,140,217,209,185,238, 57,194, 25,128, 72, 46,151,191,110, 16, 2,123,202, 94,155,209,175,125, 81, 32,151,203, 39, +228,229,229, 33, 47, 47, 79, 5, 64,210,244,103, 55,241, 51, 81, 0, 91,235,204, 26,201, 79,157, 38,107,113, 28, 87,226,118,196, +144, 64, 90, 90, 26,149,158,156, 78,252, 23,248, 75,209,219,244, 49,101,201,185, 10,182,243, 1, 70,134,141,164, 26, 26, 26, 34, +215,189,191, 14, 1,193, 15, 41, 0,224, 66,225,111,210,248,232, 4,132,134,135,218,220, 30, 99,199,142,165, 54,111,222,220,106, + 85,128, 70,163,177,235, 6,114, 52, 89,255,217,102,251,119, 0,240, 75,252, 76, 68, 1,140,203, 88, 11, 0,107,158, 56, 91, 79, +221,214, 78,145,109, 34, 22,123,137,202,209, 68,199,216,203,203,203, 35,121,121,121, 34,195,250, 10, 12, 12,180,233,183,154, 8, +202,225, 29, 70, 71, 24,251, 54, 1,119, 0,117,250,132,252, 20, 5,192, 5,214,215,247,178,105,143, 43,121,121,121,204,186,178, +154,192,192,192,174,129,129,129,206, 29,161, 46,237,245,196,173,217,118,212,144,128, 85,114, 79,227,118,143,186,186,186,230,207, +154, 58,155,233,188, 49, 58,108,180, 67,206,115,230,204,153, 60,185,254,249,201,222,144,195, 52, 14, 38,127, 9,244,195, 13, 15, +188, 8,176, 90,145,225,225,225,188,106,226,193,131, 7, 15, 30, 60,254, 98, 16,240, 85,192,131, 7, 15, 30, 60,120,240, 2,128, + 7, 15, 30, 60,120,240,224,241, 23,192,255, 3,211,238,250, 72,118, 88, 93,170, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130, + 0}; diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index e29588d7cb2..808a964019f 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -4395,7 +4395,7 @@ static void editing_panel_armature_bones(Object *ob, bArmature *arm) /* bone types */ uiDefButBitI(block, TOG, BONE_HINGE, B_ARM_RECALCDATA, "Hinge", -10,by-38,80,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Don't inherit rotation or scale from parent Bone"); - uiDefButBitI(block, TOG, BONE_NO_SCALE, B_ARM_RECALCDATA, "S", 70,by-38,20,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Don't inherit rotation or scale from parent Bone"); + uiDefButBitI(block, TOG, BONE_NO_SCALE, B_ARM_RECALCDATA, "S", 70,by-38,20,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Don't inherit scale from parent Bone"); uiDefButBitI(block, TOGN, BONE_NO_DEFORM, B_ARM_RECALCDATA, "Deform", 90, by-38, 80, 18, &curBone->flag, 0.0, 0.0, 0.0, 0.0, "Indicate if Bone deforms geometry"); uiDefButBitI(block, TOG, BONE_MULT_VG_ENV, B_ARM_RECALCDATA, "Mult", 170,by-38,80,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Multiply Bone Envelope with VertexGroup"); uiDefButBitI(block, TOG, BONE_HIDDEN_A, REDRAWVIEW3D, "Hide", 250,by-38,80,18, &curBone->flag, 0, 0, 0, 0, "Toggles display of this bone in Edit Mode"); @@ -6261,6 +6261,7 @@ static void editing_panel_mesh_texface(void) uiDefButC(block, ROW, REDRAWVIEW3D, "Opaque", 600,80,60,19, &tf->transp, 2.0, (float)TF_SOLID,0, 0, "Render color of textured face as color"); uiDefButC(block, ROW, REDRAWVIEW3D, "Add", 660,80,60,19, &tf->transp, 2.0, (float)TF_ADD, 0, 0, "Render face transparent and add color of face"); uiDefButC(block, ROW, REDRAWVIEW3D, "Alpha", 720,80,60,19, &tf->transp, 2.0, (float)TF_ALPHA,0, 0, "Render polygon transparent, depending on alpha channel of the texture"); + uiDefButC(block, ROW, REDRAWVIEW3D, "Clip Alpha", 780,80,80,19, &tf->transp, 2.0, (float)TF_CLIP,0, 0, "Use the images alpha values clipped with no blending (binary alpha)"); } else uiDefBut(block,LABEL,B_NOP, "(No Active Face)", 10,200,150,19,0,0,0,0,0,""); diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index fb36d103656..ba409723784 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -4044,7 +4044,7 @@ static void object_softbodies(Object *ob) uiDefButS(block, NUM, B_BAKE_CACHE_CHANGE, "Aero:", 30,10,60,20, &sb->aeroedge, 0.00, 30000.0, 10, 0, "Make edges 'sail'"); uiDefButS(block, NUM, B_BAKE_CACHE_CHANGE, "Plas:", 90,10,60,20, &sb->plastic, 0.0, 100.0, 10, 0, "Permanent deform"); if(ob->type==OB_MESH) { - uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Be:", 150,10,80,20, &sb->secondspring, 0.0, 10.0, 10, 0, "Bendig Stiffness"); + uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Be:", 150,10,80,20, &sb->secondspring, 0.0, 10.0, 10, 0, "Bending Stiffness"); if (*softflag & OB_SB_QUADS){ uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Sh:", 230,10,80,20, &sb->shearstiff, 0.0, 1.0, 10, 0, "Shear Stiffness"); } @@ -4832,7 +4832,7 @@ static void object_panel_particle_system(Object *ob) uiDefButS(block, NUM, B_PART_RECALC, "Segments:", butx,(buty-=buth),butw,buth, &part->hair_step, 2.0, 50.0, 0, 0, "Amount of hair segments"); } else { - uiDefButF(block, NUM, B_PART_INIT, "Sta:", butx,(buty-=buth),butw,buth, &part->sta, 1.0, part->end, 100, 1, "Frame # to start emitting particles"); + uiDefButF(block, NUM, B_PART_INIT, "Sta:", butx,(buty-=buth),butw,buth, &part->sta, -MAXFRAMEF, part->end, 100, 1, "Frame # to start emitting particles"); uiDefButF(block, NUM, B_PART_INIT, "End:", butx,(buty-=buth),butw,buth, &part->end, part->sta, MAXFRAMEF, 100, 1, "Frame # to stop emitting particles"); } diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index b98a8c58102..3797a92f16f 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -2150,6 +2150,10 @@ static void render_panel_bake(void) "Normalized displacement value to fit the 'Dist' range" ); } + + uiDefButS(block, MENU, B_NOP, "Quad Split Order%t|Quad Split Auto%x0|Quad Split A (0,1,2) (0,2,3)%x1|Quad Split B (1,2,3) (1,3,0)%x2", + 10,10,190,20, &G.scene->r.bake_quad_split, 0, 0, 0, 0, "Method to divide quads (use A or B for external applications that use a fixed order)"); + #if 0 uiBlockBeginAlign(block); uiDefButBitS(block, TOG, R_BAKE_OSA, B_DIFF, "OSA", 10,120,190,20, &G.scene->r.bake_flag, 0, 0, 0, 0, "Enables Oversampling (Anti-aliasing)"); @@ -2161,14 +2165,15 @@ static void render_panel_bake(void) uiBlockBeginAlign(block); uiDefButS(block, ROW,B_REDR,"Full Render", 210,170,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_ALL, 0, 0, ""); uiDefButS(block, ROW,B_REDR,"Ambient Occlusion",210,150,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_AO, 0, 0, ""); - uiDefButS(block, ROW,B_REDR,"Normals", 210,130,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_NORMALS, 0, 0, ""); - uiDefButS(block, ROW,B_REDR,"Textures", 210,110,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_TEXTURE, 0, 0, ""); - uiDefButS(block, ROW,B_REDR,"Displacement", 210,90,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_DISPLACEMENT, 0, 0, ""); + uiDefButS(block, ROW,B_REDR,"Shadow", 210,130,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_SHADOW, 0, 0, ""); + uiDefButS(block, ROW,B_REDR,"Normals", 210,110,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_NORMALS, 0, 0, ""); + uiDefButS(block, ROW,B_REDR,"Textures", 210,90,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_TEXTURE, 0, 0, ""); + uiDefButS(block, ROW,B_REDR,"Displacement", 210,70,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_DISPLACEMENT, 0, 0, ""); uiBlockEndAlign(block); - uiDefButBitS(block, TOG, R_BAKE_CLEAR, B_DIFF, "Clear", 210,60,120,20,&G.scene->r.bake_flag, 0.0, 0, 0, 0, "Clear Images before baking"); + uiDefButBitS(block, TOG, R_BAKE_CLEAR, B_DIFF, "Clear", 210,40,120,20,&G.scene->r.bake_flag, 0.0, 0, 0, 0, "Clear Images before baking"); - uiDefButS(block, NUM, B_DIFF,"Margin:", 210,30,120,20,&G.scene->r.bake_filter, 0.0, 32.0, 0, 0, "Amount of pixels to extend the baked result with, as post process filter"); + uiDefButS(block, NUM, B_DIFF,"Margin:", 210,10,120,20,&G.scene->r.bake_filter, 0.0, 32.0, 0, 0, "Amount of pixels to extend the baked result with, as post process filter"); } static void render_panel_simplify(void) diff --git a/source/blender/src/drawipo.c b/source/blender/src/drawipo.c index 552e87a57d1..0e7476bbe82 100644 --- a/source/blender/src/drawipo.c +++ b/source/blender/src/drawipo.c @@ -1712,7 +1712,7 @@ static void boundbox_ipo_curves(SpaceIpo *si) /* is used for both read and write... */ static void ipo_editvertex_buts(uiBlock *block, SpaceIpo *si, float min, float max) { - Object *ob= OBACT; + Object *ob; EditIpo *ei; BezTriple *bezt; float median[3]; @@ -1721,6 +1721,12 @@ static void ipo_editvertex_buts(uiBlock *block, SpaceIpo *si, float min, float m median[0]= median[1]= median[2]= 0.0; tot= 0; + /* use G.sipo->from (which should be an object) so that pinning ipo's will still work ok */ + if((G.sipo->from) && (GS(G.sipo->from->name) == ID_OB)) + ob= (Object *)(G.sipo->from); + else + ob= OBACT; + ei= G.sipo->editipo; for(a=0; atotipo; a++, ei++) { diff --git a/source/blender/src/drawmesh.c b/source/blender/src/drawmesh.c index b72cd3f56f8..dd512595ebc 100644 --- a/source/blender/src/drawmesh.c +++ b/source/blender/src/drawmesh.c @@ -228,13 +228,14 @@ int set_tpage(MTFace *tface) alphamode= tface->transp; if(alphamode) { - glEnable(GL_BLEND); - if(alphamode==TF_ADD) { + glEnable(GL_BLEND); glBlendFunc(GL_ONE, GL_ONE); + glDisable ( GL_ALPHA_TEST ); /* glBlendEquationEXT(GL_FUNC_ADD_EXT); */ } else if(alphamode==TF_ALPHA) { + glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); /* added after 2.45 to clip alpha */ @@ -245,9 +246,12 @@ int set_tpage(MTFace *tface) glEnable ( GL_ALPHA_TEST ); glAlphaFunc ( GL_GREATER, U.glalphaclip ); } - - /* glBlendEquationEXT(GL_FUNC_ADD_EXT); */ + } else if (alphamode==TF_CLIP){ + glDisable(GL_BLEND); + glEnable ( GL_ALPHA_TEST ); + glAlphaFunc(GL_GREATER, 0.5f); } + /* glBlendEquationEXT(GL_FUNC_ADD_EXT); */ /* else { */ /* glBlendFunc(GL_ONE, GL_ONE); */ /* glBlendEquationEXT(GL_FUNC_REVERSE_SUBTRACT_EXT); */ diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index e83ecb13960..deb7ddc068d 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -2154,6 +2154,7 @@ void do_viewbuts(unsigned short event) } allqueue(REDRAWVIEW3D, 1); allqueue(REDRAWBUTSOBJECT, 0); + allqueue(REDRAWOOPS, 0); } break; diff --git a/source/blender/src/editmesh_lib.c b/source/blender/src/editmesh_lib.c index 6251ba1a650..4d9679b6b8a 100644 --- a/source/blender/src/editmesh_lib.c +++ b/source/blender/src/editmesh_lib.c @@ -2199,18 +2199,25 @@ UvVertMap *make_uv_vert_map_EM(int selected, int do_face_idx_array, float *limit if(!selected || ((!efa->h) && (efa->f & SELECT))) totuv += (efa->v4)? 4: 3; - if(totuv==0) + if(totuv==0) { + if (do_face_idx_array) + EM_free_index_arrays(); return NULL; - + } vmap= (UvVertMap*)MEM_callocN(sizeof(*vmap), "UvVertMap"); - if (!vmap) + if (!vmap) { + if (do_face_idx_array) + EM_free_index_arrays(); return NULL; + } vmap->vert= (UvMapVert**)MEM_callocN(sizeof(*vmap->vert)*totverts, "UvMapVert*"); buf= vmap->buf= (UvMapVert*)MEM_callocN(sizeof(*vmap->buf)*totuv, "UvMapVert"); if (!vmap->vert || !vmap->buf) { free_uv_vert_map(vmap); + if (do_face_idx_array) + EM_free_index_arrays(); return NULL; } diff --git a/source/blender/src/editnode.c b/source/blender/src/editnode.c index 9057556b796..4c7334c55e0 100644 --- a/source/blender/src/editnode.c +++ b/source/blender/src/editnode.c @@ -2382,14 +2382,14 @@ void winqreadnodespace(ScrArea *sa, void *spacedata, BWinEvent *evt) } else { - if(G.qual & LR_CTRLKEY) { - gesture(); - } else { - if(node_add_link(snode)==0) - if(node_mouse_groupheader(snode)==0) - if(node_mouse_select(snode, event)==0) - node_border_link_delete(snode); - } + if(G.qual & LR_CTRLKEY) + if(gesture()) + break; + + if(node_add_link(snode)==0) + if(node_mouse_groupheader(snode)==0) + if(node_mouse_select(snode, event)==0) + node_border_link_delete(snode); } break; diff --git a/source/blender/src/editparticle.c b/source/blender/src/editparticle.c index 95a4abe1f9d..f420d46c827 100644 --- a/source/blender/src/editparticle.c +++ b/source/blender/src/editparticle.c @@ -2273,9 +2273,9 @@ static void brush_add(Object *ob, ParticleSystem *psys, short *mval, short numbe ParticleEditSettings *pset= PE_settings(); ParticleEdit *edit = psys->edit; int i, k, n = 0, totpart = psys->totpart; + short mco[2]; short dmx = 0, dmy = 0; - short mx = mval[0] - curarea->winx / 2, my = mval[1] - curarea->winy / 2; - float co1[3], co2[3], vec[4], min_d, imat[4][4]; + float co1[3], co2[3], min_d, imat[4][4]; float framestep, timestep = psys_get_timestep(psys->part); short size = pset->brush[PE_BRUSH_ADD].size; short size2 = size*size; @@ -2302,35 +2302,9 @@ static void brush_add(Object *ob, ParticleSystem *psys, short *mval, short numbe } } - /* create intersection coordinates in view Z direction at mouse coordinates */ - /* Thanks to who ever wrote the "Mouse Location 3D Space" tutorial in "Blender 3D: Blending Into Python/Cookbook". */ - if(G.vd->persp != V3D_ORTHO){ - vec[0]= (2.0f*(mx+dmx)/curarea->winx); - vec[1]= (2.0f*(my+dmy)/curarea->winy); - vec[2]= -1.0f; - vec[3]= 1.0f; - - Mat4MulVec4fl(G.vd->persinv, vec); - VecMulf(vec, 1.0f/vec[3]); - - VECCOPY(co1, G.vd->viewinv[3]); - VECSUB(vec, vec, co1); - Normalize(vec); - - VECADDFAC(co1, G.vd->viewinv[3], vec, G.vd->near); - VECADDFAC(co2, G.vd->viewinv[3], vec, G.vd->far); - } - else { - vec[0] = 2.0f*(mx+dmx)/curarea->winx; - vec[1] = 2.0f*(my+dmy)/curarea->winy; - vec[2] = 0.0f; - vec[3] = 1.0f; - - Mat4MulVec4fl(G.vd->persinv,vec); - - VECADDFAC(co1,vec,G.vd->viewinv[2],1000.0f); - VECADDFAC(co2,vec,G.vd->viewinv[2],-1000.0f); - } + mco[0] = mval[0] + dmx; + mco[1] = mval[1] + dmy; + viewline(mco, co1, co2); Mat4MulVecfl(imat,co1); Mat4MulVecfl(imat,co2); diff --git a/source/blender/src/header_view3d.c b/source/blender/src/header_view3d.c index 82fcdd23c1f..1ada2729289 100644 --- a/source/blender/src/header_view3d.c +++ b/source/blender/src/header_view3d.c @@ -5071,6 +5071,18 @@ static char *ndof_pup(void) } +static char *snapmode_pup(void) +{ + static char string[512]; + char *str = string; + + str += sprintf(str, "%s", "Snap Mode: %t"); + str += sprintf(str, "%s", "|Vertex%x0"); + str += sprintf(str, "%s", "|Edge%x1"); + str += sprintf(str, "%s", "|Face%x2"); + return string; +} + static char *propfalloff_pup(void) { static char string[512]; @@ -5698,6 +5710,10 @@ void view3d_buttons(void) if (G.scene->snap_flag & SCE_SNAP) { uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEO,xco,0,XIC,YIC, &G.scene->snap_flag, 0, 0, 0, 0, "Use Snap or Grid (Shift Tab)"); xco+= XIC; + uiDefIconButBitS(block, TOG, SCE_SNAP_ROTATE, B_REDR, ICON_SNAP_NORMAL,xco,0,XIC,YIC, &G.scene->snap_flag, 0, 0, 0, 0, "Align rotation with the snapping target"); + xco+= XIC; + uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_VERTEXSEL, snapmode_pup(), xco,0,XIC+10,YIC, &(G.scene->snap_mode), 0.0, 0.0, 0, 0, "Snapping mode"); + xco+= XIC; uiDefButS(block, MENU, B_NOP, "Mode%t|Closest%x0|Center%x1|Median%x2|Active%x3",xco,0,70,YIC, &G.scene->snap_target, 0, 0, 0, 0, "Snap Target Mode"); xco+= 70; } else { diff --git a/source/blender/src/meshtools.c b/source/blender/src/meshtools.c index ac165d6aeb2..0f30aef04df 100644 --- a/source/blender/src/meshtools.c +++ b/source/blender/src/meshtools.c @@ -1026,7 +1026,7 @@ void objects_bake_render_menu(void) { short event; - event= pupmenu("Bake Selected Meshes %t|Full Render %x1|Ambient Occlusion %x2|Normals %x3|Texture Only %x4|Displacement %x5"); + event= pupmenu("Bake Selected Meshes %t|Full Render %x1|Ambient Occlusion %x2|Normals %x3|Texture Only %x4|Displacement %x5|Shadow %x6"); if (event < 1) return; objects_bake_render_ui(event); } @@ -1062,7 +1062,8 @@ void objects_bake_render(short event, char **error_msg) else if(event==2) event= RE_BAKE_AO; else if(event==3) event= RE_BAKE_NORMALS; else if(event==4) event= RE_BAKE_TEXTURE; - else event= RE_BAKE_DISPLACEMENT; + else if(event==5) event= RE_BAKE_DISPLACEMENT; + else event= RE_BAKE_SHADOW; if(event==RE_BAKE_AO) { if(G.scene->world==NULL) { diff --git a/source/blender/src/space.c b/source/blender/src/space.c index 8cc7e6975b4..c49486a6294 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -2077,15 +2077,16 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt) vgroup_operation_with_menu(); } } - else if((G.qual==LR_SHIFTKEY)) + else if((G.qual==LR_SHIFTKEY)) { if(G.obedit) { if(G.obedit->type==OB_MESH) select_mesh_group_menu(); } else if(ob && (ob->flag & OB_POSEMODE)) pose_select_grouped_menu(); - else + else if (ob) select_object_grouped_menu(); + } else if((G.obedit==0) && G.qual==LR_ALTKEY) { if(okee("Clear location")) { clear_object('g'); @@ -2974,8 +2975,11 @@ static void winqreadipospace(ScrArea *sa, void *spacedata, BWinEvent *evt) do_ipo_selectbuttons(); doredraw= 1; } + else if(G.qual == LR_CTRLKEY) { + if (sipo->showkey==0) + add_vert_ipo(); + } else if(view2dmove(LEFTMOUSE)); /* only checks for sliders */ - else if((G.qual & LR_CTRLKEY) && (sipo->showkey==0)) add_vert_ipo(); else { do { getmouseco_areawin(mval); @@ -3213,7 +3217,7 @@ void initipo(ScrArea *sa) sipo->v2d.min[0]= 0.01f; sipo->v2d.min[1]= 0.01f; - sipo->v2d.max[0]= 15000.0f; + sipo->v2d.max[0]= MAXFRAMEF; sipo->v2d.max[1]= 10000.0f; sipo->v2d.scroll= L_SCROLL+B_SCROLL; @@ -5172,7 +5176,7 @@ static void init_actionspace(ScrArea *sa) saction->v2d.min[0]= 0.0; saction->v2d.min[1]= 0.0; - saction->v2d.max[0]= 32000.0; + saction->v2d.max[0]= MAXFRAMEF; saction->v2d.max[1]= 1000.0; saction->v2d.minzoom= 0.01; @@ -5244,7 +5248,7 @@ static void init_soundspace(ScrArea *sa) ssound->v2d.min[0]= 1.0; ssound->v2d.min[1]= 259.0; - ssound->v2d.max[0]= 32000.0; + ssound->v2d.max[0]= MAXFRAMEF; ssound->v2d.max[1]= 259; ssound->v2d.minzoom= 0.1f; @@ -5974,7 +5978,7 @@ static void init_nlaspace(ScrArea *sa) snla->v2d.min[0]= 0.0; snla->v2d.min[1]= 0.0; - snla->v2d.max[0]= 1000.0; + snla->v2d.max[0]= MAXFRAMEF; snla->v2d.max[1]= 1000.0; snla->v2d.minzoom= 0.1F; @@ -6062,7 +6066,7 @@ static void init_timespace(ScrArea *sa) stime->v2d.min[0]= 1.0; stime->v2d.min[1]= (float)sa->winy; - stime->v2d.max[0]= 32000.0; + stime->v2d.max[0]= MAXFRAMEF; stime->v2d.max[1]= (float)sa->winy; stime->v2d.minzoom= 0.1f; @@ -6331,7 +6335,10 @@ void duplicatespacelist(ScrArea *newarea, ListBase *lb1, ListBase *lb2) SpaceNode *snode= (SpaceNode *)sl; snode->nodetree= NULL; } - + else if(sl->spacetype==SPACE_SCRIPT) { + SpaceScript *sc = ( SpaceScript * ) sl; + sc->but_refs = NULL; + } sl= sl->next; } diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c index 10035c61651..4270ce6a069 100644 --- a/source/blender/src/transform.c +++ b/source/blender/src/transform.c @@ -135,24 +135,23 @@ static void helpline(TransInfo *t, float *vec) getmouseco_areawin(mval); projectFloatView(t, vecrot, cent); // no overflow in extreme cases - if(cent[0]!=IS_CLIPPED) { - persp(PERSP_WIN); - - glDrawBuffer(GL_FRONT); - - BIF_ThemeColor(TH_WIRE); - - setlinestyle(3); - glBegin(GL_LINE_STRIP); - glVertex2sv(mval); - glVertex2fv(cent); - glEnd(); - setlinestyle(0); - - persp(PERSP_VIEW); - bglFlush(); // flush display for frontbuffer - glDrawBuffer(GL_BACK); - } + + persp(PERSP_WIN); + + glDrawBuffer(GL_FRONT); + + BIF_ThemeColor(TH_WIRE); + + setlinestyle(3); + glBegin(GL_LINE_STRIP); + glVertex2sv(mval); + glVertex2fv(cent); + glEnd(); + setlinestyle(0); + + persp(PERSP_VIEW); + bglFlush(); // flush display for frontbuffer + glDrawBuffer(GL_BACK); } @@ -354,8 +353,9 @@ void convertViewVec(TransInfo *t, float *vec, short dx, short dy) void projectIntView(TransInfo *t, float *vec, int *adr) { - if (t->spacetype==SPACE_VIEW3D) - project_int(vec, adr); + if (t->spacetype==SPACE_VIEW3D) { + project_int_noclip(vec, adr); + } else if(t->spacetype==SPACE_IMAGE) { float aspx, aspy, v[2]; @@ -376,8 +376,9 @@ void projectIntView(TransInfo *t, float *vec, int *adr) void projectFloatView(TransInfo *t, float *vec, float *adr) { - if (t->spacetype==SPACE_VIEW3D) - project_float(vec, adr); + if (t->spacetype==SPACE_VIEW3D) { + project_float_noclip(vec, adr); + } else if(t->spacetype==SPACE_IMAGE) { int a[2]; @@ -2411,18 +2412,32 @@ void initRotation(TransInfo *t) t->flag |= T_NO_CONSTRAINT; } -static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3]) { +static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short around) { float vec[3], totmat[3][3], smat[3][3]; float eul[3], fmat[3][3], quat[4]; - + float *center = t->center; + + /* local constraint shouldn't alter center */ + if (around == V3D_LOCAL) { + if (t->flag & (T_OBJECT|T_POSE)) { + center = td->center; + } + else { + /* !TODO! Make this if not rely on G */ + if(around==V3D_LOCAL && (G.scene->selectmode & SCE_SELECT_FACE)) { + center = td->center; + } + } + } + if (t->flag & T_POINTS) { Mat3MulMat3(totmat, mat, td->mtx); Mat3MulMat3(smat, td->smtx, totmat); - VecSubf(vec, td->iloc, t->center); + VecSubf(vec, td->iloc, center); Mat3MulVecfl(smat, vec); - VecAddf(td->loc, vec, t->center); + VecAddf(td->loc, vec, center); VecSubf(vec,td->loc,td->iloc); protectedTransBits(td->protectflag, vec); @@ -2459,13 +2474,13 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3]) { Mat3CpyMat4(pmtx, t->poseobj->obmat); Mat3Inv(imtx, pmtx); - VecSubf(vec, td->center, t->center); + VecSubf(vec, td->center, center); Mat3MulVecfl(pmtx, vec); // To Global space Mat3MulVecfl(mat, vec); // Applying rotation Mat3MulVecfl(imtx, vec); // To Local space - VecAddf(vec, vec, t->center); + VecAddf(vec, vec, center); /* vec now is the location where the object has to be */ VecSubf(vec, vec, td->center); // Translation needed from the initial location @@ -2494,9 +2509,9 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3]) { } else { /* translation */ - VecSubf(vec, td->center, t->center); + VecSubf(vec, td->center, center); Mat3MulVecfl(mat, vec); - VecAddf(vec, vec, t->center); + VecAddf(vec, vec, center); /* vec now is the location where the object has to be */ VecSubf(vec, vec, td->center); Mat3MulVecfl(td->smtx, vec); @@ -2529,15 +2544,22 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3]) { /* are there ipo keys? */ if(td->tdi) { TransDataIpokey *tdi= td->tdi; + float current_rot[3]; float rot[3]; + /* current IPO value for compatible euler */ + current_rot[0] = tdi->rotx[0]; + current_rot[1] = tdi->roty[0]; + current_rot[2] = tdi->rotz[0]; + VecMulf(current_rot, (float)(M_PI_2 / 9.0)); + /* calculate the total rotatation in eulers */ VecAddf(eul, td->ext->irot, td->ext->drot); EulToMat3(eul, obmat); /* mat = transform, obmat = object rotation */ Mat3MulMat3(fmat, mat, obmat); - Mat3ToCompatibleEul(fmat, eul, td->ext->irot); + Mat3ToCompatibleEul(fmat, eul, current_rot); /* correct back for delta rot */ if(tdi->flag & TOB_IPODROT) { @@ -2566,7 +2588,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3]) { /* mat = transform, obmat = object rotation */ Mat3MulMat3(fmat, smat, obmat); - Mat3ToCompatibleEul(fmat, eul, td->ext->irot); + Mat3ToCompatibleEul(fmat, eul, td->ext->rot); /* correct back for delta rot */ VecSubf(eul, eul, td->ext->drot); @@ -2585,17 +2607,9 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3]) { static void applyRotation(TransInfo *t, float angle, float axis[3]) { TransData *td = t->data; - float mat[3][3], center[3]; + float mat[3][3]; int i; - /* saving original center */ - if (t->around == V3D_LOCAL) { - VECCOPY(center, t->center); - } - else { - center[0] = center[1] = center[2] = 0.0f; - } - VecRotToMat3(axis, angle, mat); for(i = 0 ; i < t->total; i++, td++) { @@ -2606,18 +2620,6 @@ static void applyRotation(TransInfo *t, float angle, float axis[3]) if (td->flag & TD_SKIP) continue; - /* local constraint shouldn't alter center */ - if (t->around == V3D_LOCAL) { - if (t->flag & (T_OBJECT|T_POSE)) { - VECCOPY(t->center, td->center); - } - else { - if(G.vd->around==V3D_LOCAL && (G.scene->selectmode & SCE_SELECT_FACE)) { - VECCOPY(t->center, td->center); - } - } - } - if (t->con.applyRot) { t->con.applyRot(t, td, axis); VecRotToMat3(axis, angle * td->factor, mat); @@ -2626,12 +2628,7 @@ static void applyRotation(TransInfo *t, float angle, float axis[3]) VecRotToMat3(axis, angle * td->factor, mat); } - ElementRotation(t, td, mat); - } - - /* restoring original center */ - if (t->around == V3D_LOCAL) { - VECCOPY(t->center, center); + ElementRotation(t, td, mat, t->around); } } @@ -2729,7 +2726,6 @@ static void applyTrackball(TransInfo *t, float axis1[3], float axis2[3], float a { TransData *td = t->data; float mat[3][3], smat[3][3], totmat[3][3]; - float center[3]; int i; VecRotToMat3(axis1, angles[0], smat); @@ -2744,20 +2740,6 @@ static void applyTrackball(TransInfo *t, float axis1[3], float axis2[3], float a if (td->flag & TD_SKIP) continue; - VECCOPY(center, t->center); - - if (t->around == V3D_LOCAL) { - /* local-mode shouldn't change center */ - if (t->flag & (T_OBJECT|T_POSE)) { - VECCOPY(t->center, td->center); - } - else { - if(G.vd->around==V3D_LOCAL && (G.scene->selectmode & SCE_SELECT_FACE)) { - VECCOPY(t->center, td->center); - } - } - } - if (t->flag & T_PROP_EDIT) { VecRotToMat3(axis1, td->factor * angles[0], smat); VecRotToMat3(axis2, td->factor * angles[1], totmat); @@ -2765,9 +2747,7 @@ static void applyTrackball(TransInfo *t, float axis1[3], float axis2[3], float a Mat3MulMat3(mat, smat, totmat); } - ElementRotation(t, td, mat); - - VECCOPY(t->center, center); + ElementRotation(t, td, mat, t->around); } } @@ -2942,6 +2922,36 @@ static void applyTranslation(TransInfo *t, float vec[3]) { if (td->flag & TD_SKIP) continue; + /* handle snapping rotation before doing the translation */ + if (usingSnappingNormal(t)) + { + if (validSnappingNormal(t)) + { + float *original_normal = td->axismtx[2]; + float axis[3]; + float quat[4]; + float mat[3][3]; + float angle; + + Crossf(axis, original_normal, t->tsnap.snapNormal); + angle = saacos(Inpf(original_normal, t->tsnap.snapNormal)); + + AxisAngleToQuat(quat, axis, angle); + + QuatToMat3(quat, mat); + + ElementRotation(t, td, mat, V3D_LOCAL); + } + else + { + float mat[3][3]; + + Mat3One(mat); + + ElementRotation(t, td, mat, V3D_LOCAL); + } + } + if (t->con.applyVec) { float pvec[3]; t->con.applyVec(t, td, vec, tvec, pvec); @@ -4156,7 +4166,7 @@ int Align(TransInfo *t, short mval[2]) Mat3MulMat3(mat, t->spacemtx, invmat); - ElementRotation(t, td, mat); + ElementRotation(t, td, mat, t->around); } /* restoring original center */ diff --git a/source/blender/src/transform_generics.c b/source/blender/src/transform_generics.c index 8154929eb17..eaa4a1d0ecf 100644 --- a/source/blender/src/transform_generics.c +++ b/source/blender/src/transform_generics.c @@ -113,7 +113,6 @@ extern TransInfo Trans; /* From transform.c */ /* ************************** Functions *************************** */ - void getViewVector(float coord[3], float vec[3]) { TransInfo *t = BIF_GetTransInfo(); diff --git a/source/blender/src/transform_snap.c b/source/blender/src/transform_snap.c index 0e69e823d92..83940fa3729 100644 --- a/source/blender/src/transform_snap.c +++ b/source/blender/src/transform_snap.c @@ -55,11 +55,13 @@ #include "BIF_screen.h" #include "BIF_editsima.h" #include "BIF_drawimage.h" +#include "BIF_editmesh.h" #include "BKE_global.h" #include "BKE_utildefines.h" #include "BKE_DerivedMesh.h" #include "BKE_object.h" +#include "BKE_anim.h" /* for duplis */ #include "BSE_view.h" @@ -92,7 +94,8 @@ float ResizeBetween(TransInfo *t, float p1[3], float p2[3]); /* Modes */ #define NOT_SELECTED 0 #define NOT_ACTIVE 1 -int findNearestVertFromObjects(int *dist, float *loc, int mode); +int snapObjects(int *dist, float *loc, float *no, int mode); + /****************** IMPLEMENTATIONS *********************/ @@ -131,6 +134,15 @@ void drawSnapping(TransInfo *t) glTranslatef(t->tsnap.snapPoint[0], t->tsnap.snapPoint[1], t->tsnap.snapPoint[2]); + /* draw normal if needed */ + if (usingSnappingNormal(t) && validSnappingNormal(t)) + { + glBegin(GL_LINES); + glVertex3f(0, 0, 0); + glVertex3f(t->tsnap.snapNormal[0], t->tsnap.snapNormal[1], t->tsnap.snapNormal[2]); + glEnd(); + } + /* sets view screen aligned */ glRotatef( -360.0f*saacos(G.vd->viewquat[0])/(float)M_PI, G.vd->viewquat[1], G.vd->viewquat[2], G.vd->viewquat[3]); @@ -201,7 +213,8 @@ void applySnapping(TransInfo *t, float *vec) double current = PIL_check_seconds_timer(); // Time base quirky code to go around findnearest slowness - if (current - t->tsnap.last >= 0.25) + /* !TODO! add exception for object mode, no need to slow it down then */ + if (current - t->tsnap.last >= 0.1) { t->tsnap.calcSnap(t, vec); t->tsnap.targetSnap(t); @@ -222,6 +235,35 @@ void resetSnapping(TransInfo *t) t->tsnap.modeTarget = 0; t->tsnap.last = 0; t->tsnap.applySnap = NULL; + + t->tsnap.snapNormal[0] = 0; + t->tsnap.snapNormal[1] = 0; + t->tsnap.snapNormal[2] = 0; +} + +int usingSnappingNormal(TransInfo *t) +{ + if (G.scene->snap_flag & SCE_SNAP_ROTATE) + { + return 1; + } + else + { + return 0; + } +} + +int validSnappingNormal(TransInfo *t) +{ + if ((t->tsnap.status & (POINT_INIT|TARGET_INIT)) == (POINT_INIT|TARGET_INIT)) + { + if (Inpf(t->tsnap.snapNormal, t->tsnap.snapNormal) > 0) + { + return 1; + } + } + + return 0; } void initSnapping(TransInfo *t) @@ -445,14 +487,26 @@ void CalcSnapGeometry(TransInfo *t, float *vec) if (t->spacetype == SPACE_VIEW3D) { float vec[3]; + float no[3]; int found = 0; int dist = 40; // Use a user defined value here - found = findNearestVertFromObjects(&dist, vec, NOT_SELECTED); + found = snapObjects(&dist, vec, no, NOT_SELECTED); if (found == 1) { - VECCOPY(t->tsnap.snapPoint, vec); + float tangent[3]; + VecSubf(tangent, vec, t->tsnap.snapPoint); + tangent[2] = 0; + + if (Inpf(tangent, tangent) > 0) + { + VECCOPY(t->tsnap.snapTangent, tangent); + } + + VECCOPY(t->tsnap.snapPoint, vec); + VECCOPY(t->tsnap.snapNormal, no); + t->tsnap.status |= POINT_INIT; } else @@ -464,31 +518,18 @@ void CalcSnapGeometry(TransInfo *t, float *vec) /* Mesh edit mode */ else if (G.obedit != NULL && G.obedit->type==OB_MESH) { - /*if (G.scene->selectmode & B_SEL_VERT)*/ - if (t->spacetype == SPACE_VIEW3D) { - EditVert *nearest=NULL; float vec[3]; + float no[3]; int found = 0; int dist = 40; // Use a user defined value here - - // use findnearestverts in vert mode, others in other modes - nearest = findnearestvert(&dist, SELECT, 1); - - found = findNearestVertFromObjects(&dist, vec, NOT_ACTIVE); + + found = snapObjects(&dist, vec, no, NOT_ACTIVE); if (found == 1) { VECCOPY(t->tsnap.snapPoint, vec); - - t->tsnap.status |= POINT_INIT; - } - /* If there's no outside vertex nearer, but there's one in this mesh - */ - else if (nearest != NULL) - { - VECCOPY(t->tsnap.snapPoint, nearest->co); - Mat4MulVecfl(G.obedit->obmat, t->tsnap.snapPoint); + VECCOPY(t->tsnap.snapNormal, no); t->tsnap.status |= POINT_INIT; } @@ -522,33 +563,6 @@ void CalcSnapGeometry(TransInfo *t, float *vec) t->tsnap.status &= ~POINT_INIT; } } - - - /* - if (G.scene->selectmode & B_SEL_EDGE) - { - EditEdge *nearest=NULL; - int dist = 50; // Use a user defined value here - - // use findnearestverts in vert mode, others in other modes - nearest = findnearestedge(&dist); - - if (nearest != NULL) - { - VecAddf(t->tsnap.snapPoint, nearest->v1->co, nearest->v2->co); - - VecMulf(t->tsnap.snapPoint, 0.5f); - - Mat4MulVecfl(G.obedit->obmat, t->tsnap.snapPoint); - - t->tsnap.status |= POINT_INIT; - } - else - { - t->tsnap.status &= ~POINT_INIT; - } - } - */ } } @@ -723,101 +737,351 @@ void TargetSnapClosest(TransInfo *t) } /*================================================================*/ -int findNearestVertFromObjects(int *dist, float *loc, int mode) { + +/* find snapping point on face, return 1 on success */ +int snapFace(MFace *face, MVert *verts, float *intersect, float *loc, float *no) +{ + MVert *v[4]; + int totvert; + int result = 0; + + v[0] = verts + face->v1; + v[1] = verts + face->v2; + v[2] = verts + face->v3; + + if (face->v4) + { + v[3] = verts + face->v4; + totvert = 4; + } + else + { + v[3] = NULL; + totvert = 3; + } + + switch(G.scene->snap_mode) + { + case SCE_SNAP_MODE_VERTEX: + { + float min_dist = FLT_MAX; + int i; + + for(i = 0; i < totvert; i++) + { + float vert_dist = VecLenf(v[i]->co, intersect); + + if (vert_dist < min_dist) + { + result = 1; + + min_dist = vert_dist; + + VECCOPY(loc, v[i]->co); + NormalShortToFloat(no, v[i]->no); + } + } + break; + } + case SCE_SNAP_MODE_EDGE: + { + float min_dist = FLT_MAX; + int i; + + for(i = 0; i < totvert; i++) + { + MVert *v1, *v2; + float edge_loc[3]; + float vec[3]; + float mul; + float edge_dist; + + v1 = v[i]; + v2 = v[(i + 1) % totvert]; + + VecSubf(edge_loc, v2->co, v1->co); + VecSubf(vec, intersect, v1->co); + + mul = Inpf(vec, edge_loc) / Inpf(edge_loc, edge_loc); + + VecMulf(edge_loc, mul); + VecAddf(edge_loc, edge_loc, v1->co); + + edge_dist = VecLenf(edge_loc, intersect); + + if (edge_dist < min_dist) + { + float n1[3], n2[3]; + result = 1; + + min_dist = edge_dist; + + VECCOPY(loc, edge_loc); + + NormalShortToFloat(n1, v1->no); + NormalShortToFloat(n2, v2->no); + VecLerpf(no, n1, n2, mul); + Normalize(no); + } + } + break; + } + case SCE_SNAP_MODE_FACE: + { + result = 1; + + VECCOPY(loc, intersect); + + if (totvert == 4) + CalcNormFloat4(v[0]->co, v[1]->co, v[2]->co, v[3]->co, no); + else + CalcNormFloat(v[0]->co, v[1]->co, v[2]->co, no); + break; + } + } + + return result; +} + +int snapDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float ray_start[3], float ray_normal[3], short mval[2], float *loc, float *no, int *dist, float *depth, short EditMesh) +{ + float object_depth = FLT_MAX; + int retval = 0; + int totvert = dm->getNumVerts(dm); + int totface = dm->getNumFaces(dm); + + if (totvert > 0) { + float imat[4][4]; + float timat[3][3]; /* transpose inverse matrix for normals */ + float ray_start_local[3], ray_normal_local[3]; + int test = 1; + + Mat4Invert(imat, obmat); + + Mat3CpyMat4(timat, imat); + Mat3Transp(timat); + + VECCOPY(ray_start_local, ray_start); + VECCOPY(ray_normal_local, ray_normal); + + Mat4MulVecfl(imat, ray_start_local); + Mat4Mul3Vecfl(imat, ray_normal_local); + + + /* If number of vert is more than an arbitrary limit, + * test against boundbox first + * */ + if (totface > 16) { + struct BoundBox *bb = object_get_boundbox(ob); + test = ray_hit_boundbox(bb, ray_start_local, ray_normal_local); + } + + if (test == 1) { + MVert *verts = dm->getVertArray(dm); + MFace *faces = dm->getFaceArray(dm); + int *index_array; + int index = 0; + int i; + + test = 1; + + if (EditMesh) + { + index_array = dm->getFaceDataArray(dm, CD_ORIGINDEX); + EM_init_index_arrays(0, 0, 1); + } + + for( i = 0; i < totface; i++) { + MFace *f = faces + i; + float lambda; + int result; + + if (EditMesh) + { + EditFace *efa = NULL; + + if (index_array) + { + index = index_array[i]; + } + else + { + index = i; + } + + if (index == ORIGINDEX_NONE) + { + test = 0; + } + else + { + efa = EM_get_face_for_index(index); + + if (efa) + { + if (efa->v1->f1 & SELECT || efa->v2->f1 & SELECT || efa->v3->f1 & SELECT || (efa->v4 && efa->v4->f1 & SELECT)) + { + test = 0; + } + } + } + } + + + if (test) + { + result = RayIntersectsTriangle(ray_start_local, ray_normal_local, verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, &lambda, NULL); + + if (result && lambda < object_depth) { + float location[3], normal[3]; + float intersect[3]; + + VECCOPY(intersect, ray_normal_local); + VecMulf(intersect, lambda); + VecAddf(intersect, intersect, ray_start_local); + + if (snapFace(f, verts, intersect, location, normal)) + { + float new_depth; + int screen_loc[2]; + + Mat4MulVecfl(obmat, location); + + new_depth = VecLenf(location, ray_start); + + if (new_depth < *depth) + { + object_depth = lambda; + *depth = new_depth; + retval = 1; + + VECCOPY(loc, location); + VECCOPY(no, normal); + + Mat3MulVecfl(timat, no); + Normalize(no); + + project_int(loc, screen_loc); + + *dist = abs(screen_loc[0] - mval[0]) + abs(screen_loc[1] - mval[1]); + } + } + } + + if (f->v4 && result == 0) + { + result = RayIntersectsTriangle(ray_start_local, ray_normal_local, verts[f->v3].co, verts[f->v4].co, verts[f->v1].co, &lambda, NULL); + + if (result && lambda < object_depth) { + float location[3], normal[3]; + float intersect[3]; + + VECCOPY(intersect, ray_normal_local); + VecMulf(intersect, lambda); + VecAddf(intersect, intersect, ray_start_local); + + if (snapFace(f, verts, intersect, location, normal)) + { + float new_depth; + int screen_loc[2]; + + Mat4MulVecfl(obmat, location); + + new_depth = VecLenf(location, ray_start); + + if (new_depth < *depth) + { + object_depth = lambda; + *depth = new_depth; + retval = 1; + + VECCOPY(loc, location); + VECCOPY(no, normal); + + Mat3MulVecfl(timat, no); + Normalize(no); + + project_int(loc, screen_loc); + + *dist = abs(screen_loc[0] - mval[0]) + abs(screen_loc[1] - mval[1]); + } + } + } + } + } + } + + if (EditMesh) + { + EM_free_index_arrays(); + } + } + } + + return retval; +} + +int snapObjects(int *dist, float *loc, float *no, int mode) { Base *base; + float depth = FLT_MAX; int retval = 0; short mval[2]; + float ray_start[3], ray_normal[3]; getmouseco_areawin(mval); + viewray(mval, ray_start, ray_normal); + + if (mode == NOT_ACTIVE) + { + DerivedMesh *dm, *dm_cage; + Object *ob = G.obedit; + + dm_cage = editmesh_get_derived_cage_and_final(&dm, CD_MASK_BAREMESH); + + retval = snapDerivedMesh(ob, dm, ob->obmat, ray_start, ray_normal, mval, loc, no, dist, &depth, 1); + + dm_cage->release(dm_cage); + dm->release(dm); + } base= FIRSTBASE; for ( base = FIRSTBASE; base != NULL; base = base->next ) { if ( BASE_SELECTABLE(base) && ((mode == NOT_SELECTED && (base->flag & SELECT) == 0) || (mode == NOT_ACTIVE && base != BASACT)) ) { Object *ob = base->object; - if (ob->type == OB_MESH) { - Mesh *me = ob->data; + if (ob->transflag & OB_DUPLI) + { + DupliObject *dupli_ob; + ListBase *lb = object_duplilist(G.scene, ob); - if (me->totvert > 0) { - int test = 1; - int i; + for(dupli_ob = lb->first; dupli_ob; dupli_ob = dupli_ob->next) + { + Object *ob = dupli_ob->ob; - /* If number of vert is more than an arbitrary limit, - * test against boundbox first - * */ - if (me->totvert > 16) { - struct BoundBox *bb = object_get_boundbox(ob); + if (ob->type == OB_MESH) { + DerivedMesh *dm = mesh_get_derived_final(ob, CD_MASK_BAREMESH); + int val; - int minx = 0, miny = 0, maxx = 0, maxy = 0; - int i; - - for (i = 0; i < 8; i++) { - float gloc[3]; - int sloc[2]; - - VECCOPY(gloc, bb->vec[i]); - Mat4MulVecfl(ob->obmat, gloc); - project_int(gloc, sloc); - - if (i == 0) { - minx = maxx = sloc[0]; - miny = maxy = sloc[1]; - } - else { - if (minx > sloc[0]) minx = sloc[0]; - else if (maxx < sloc[0]) maxx = sloc[0]; - - if (miny > sloc[1]) miny = sloc[1]; - else if (maxy < sloc[1]) maxy = sloc[1]; - } - } - - /* Pad with distance */ + val = snapDerivedMesh(ob, dm, dupli_ob->mat, ray_start, ray_normal, mval, loc, no, dist, &depth, 0); - minx -= *dist; - miny -= *dist; - maxx += *dist; - maxy += *dist; - - if (mval[0] > maxx || mval[0] < minx || - mval[1] > maxy || mval[1] < miny) { - - test = 0; - } - } - - if (test == 1) { - float *verts = mesh_get_mapped_verts_nors(ob); - - if (verts != NULL) { - float *fp; - - fp = verts; - for( i = 0; i < me->totvert; i++, fp += 6) { - float gloc[3]; - int sloc[2]; - int curdist; - - VECCOPY(gloc, fp); - Mat4MulVecfl(ob->obmat, gloc); - project_int(gloc, sloc); - - sloc[0] -= mval[0]; - sloc[1] -= mval[1]; - - curdist = abs(sloc[0]) + abs(sloc[1]); - - if (curdist < *dist) { - *dist = curdist; - retval = 1; - VECCOPY(loc, gloc); - } - } - } - - MEM_freeN(verts); + retval = retval || val; + + dm->release(dm); } } + + free_object_duplilist(lb); + } + + if (ob->type == OB_MESH) { + DerivedMesh *dm = mesh_get_derived_final(ob, CD_MASK_BAREMESH); + int val; + + val = snapDerivedMesh(ob, dm, ob->obmat, ray_start, ray_normal, mval, loc, no, dist, &depth, 0); + + retval = retval || val; + + dm->release(dm); } } } diff --git a/source/blender/src/view.c b/source/blender/src/view.c index 1e45f2bf3e0..008387d5a70 100644 --- a/source/blender/src/view.c +++ b/source/blender/src/view.c @@ -144,6 +144,48 @@ void persp(int a) } } +/* create intersection ray in view Z direction at mouse coordinates */ +void viewray(short mval[2], float ray_start[3], float ray_normal[3]) +{ + float ray_end[3]; + viewline(mval, ray_start, ray_end); + VecSubf(ray_normal, ray_end, ray_start); + Normalize(ray_normal); +} + +/* create intersection coordinates in view Z direction at mouse coordinates */ +void viewline(short mval[2], float ray_start[3], float ray_end[3]) +{ + float vec[4]; + + if(G.vd->persp != V3D_ORTHO){ + vec[0]= 2.0f * mval[0] / curarea->winx - 1; + vec[1]= 2.0f * mval[1] / curarea->winy - 1; + vec[2]= -1.0f; + vec[3]= 1.0f; + + Mat4MulVec4fl(G.vd->persinv, vec); + VecMulf(vec, 1.0f / vec[3]); + + VECCOPY(ray_start, G.vd->viewinv[3]); + VECSUB(vec, vec, ray_start); + Normalize(vec); + + VECADDFAC(ray_start, G.vd->viewinv[3], vec, G.vd->near); + VECADDFAC(ray_end, G.vd->viewinv[3], vec, G.vd->far); + } + else { + vec[0] = 2.0f * mval[0] / curarea->winx - 1; + vec[1] = 2.0f * mval[1] / curarea->winy - 1; + vec[2] = 0.0f; + vec[3] = 1.0f; + + Mat4MulVec4fl(G.vd->persinv, vec); + + VECADDFAC(ray_start, vec, G.vd->viewinv[2], 1000.0f); + VECADDFAC(ray_end, vec, G.vd->viewinv[2], -1000.0f); + } +} void initgrabz(float x, float y, float z) { @@ -228,6 +270,29 @@ void project_int(float *vec, int *adr) } } +void project_int_noclip(float *vec, int *adr) +{ + float fx, fy, vec4[4]; + + VECCOPY(vec4, vec); + vec4[3]= 1.0; + + Mat4MulVec4fl(G.vd->persmat, vec4); + + if( fabs(vec4[3]) > BL_NEAR_CLIP ) { + fx = (curarea->winx/2)*(1 + vec4[0]/vec4[3]); + fy = (curarea->winy/2)*(1 + vec4[1]/vec4[3]); + + adr[0] = floor(fx); + adr[1] = floor(fy); + } + else + { + adr[0] = curarea->winx / 2; + adr[1] = curarea->winy / 2; + } +} + void project_short_noclip(float *vec, short *adr) { float fx, fy, vec4[4]; @@ -264,8 +329,28 @@ void project_float(float *vec, float *adr) Mat4MulVec4fl(G.vd->persmat, vec4); if( vec4[3]>BL_NEAR_CLIP ) { - adr[0]= (curarea->winx/2.0)+(curarea->winx/2.0)*vec4[0]/vec4[3]; - adr[1]= (curarea->winy/2.0)+(curarea->winy/2.0)*vec4[1]/vec4[3]; + adr[0] = (curarea->winx/2.0)+(curarea->winx/2.0)*vec4[0]/vec4[3]; + adr[1] = (curarea->winy/2.0)+(curarea->winy/2.0)*vec4[1]/vec4[3]; + } +} + +void project_float_noclip(float *vec, float *adr) +{ + float vec4[4]; + + VECCOPY(vec4, vec); + vec4[3]= 1.0; + + Mat4MulVec4fl(G.vd->persmat, vec4); + + if( fabs(vec4[3]) > BL_NEAR_CLIP ) { + adr[0] = (curarea->winx/2.0)+(curarea->winx/2.0)*vec4[0]/vec4[3]; + adr[1] = (curarea->winy/2.0)+(curarea->winy/2.0)*vec4[1]/vec4[3]; + } + else + { + adr[0] = curarea->winx / 2.0f; + adr[1] = curarea->winy / 2.0f; } } diff --git a/source/gameengine/Converter/BL_ArmatureObject.cpp b/source/gameengine/Converter/BL_ArmatureObject.cpp index ff9c6a75aa9..08567dde840 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.cpp +++ b/source/gameengine/Converter/BL_ArmatureObject.cpp @@ -153,9 +153,12 @@ void BL_ArmatureObject::GetPose(bPose **pose) int copy_constraint_channels_hack = 1; copy_pose(pose, m_pose, copy_constraint_channels_hack); } - else + else { + if (*pose == m_pose) + // no need to copy if the pointers are the same + return; extract_pose_from_pose(*pose, m_pose); - + } } void BL_ArmatureObject::GetMRDPose(bPose **pose) @@ -169,7 +172,11 @@ void BL_ArmatureObject::GetMRDPose(bPose **pose) //} if (!*pose) - copy_pose(pose, m_objArma->pose, 0); + // must duplicate the constraints too otherwise we have corruption in free_pose_channels() + // because it will free the blender constraints. + // Ideally, blender should rememeber that the constraints were not copied so that + // free_pose_channels() would not free them. + copy_pose(pose, m_objArma->pose, 1); else extract_pose_from_pose(*pose, m_objArma->pose); diff --git a/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp b/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp index 46fe24d8b87..c2f15aefe16 100644 --- a/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp +++ b/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp @@ -154,16 +154,23 @@ int set_tpage(MTFace *tface) fAlphamode= tface->transp; if(fAlphamode) { - glEnable(GL_BLEND); - if(fAlphamode==TF_ADD) { + glEnable(GL_BLEND); glBlendFunc(GL_ONE, GL_ONE); + glDisable ( GL_ALPHA_TEST ); /* glBlendEquationEXT(GL_FUNC_ADD_EXT); */ } else if(fAlphamode==TF_ALPHA) { + glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glDisable ( GL_ALPHA_TEST ); /* glBlendEquationEXT(GL_FUNC_ADD_EXT); */ } + else if (fAlphamode==TF_CLIP){ + glDisable(GL_BLEND); + glEnable ( GL_ALPHA_TEST ); + glAlphaFunc(GL_GREATER, 0.5f); + } /* else { */ /* glBlendFunc(GL_ONE, GL_ONE); */ /* glBlendEquationEXT(GL_FUNC_REVERSE_SUBTRACT_EXT); */ diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index 44727588106..5efe1ad26ca 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -478,16 +478,23 @@ bool KX_BlenderMaterial::setDefaultBlending() if( mMaterial->transp &TF_ADD) { glEnable(GL_BLEND); glBlendFunc(GL_ONE, GL_ONE); + glDisable ( GL_ALPHA_TEST ); return true; } if( mMaterial->transp & TF_ALPHA ) { glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glDisable ( GL_ALPHA_TEST ); return true; } - glDisable(GL_BLEND); + if( mMaterial->transp & TF_CLIP ) { + glDisable(GL_BLEND); + glEnable ( GL_ALPHA_TEST ); + glAlphaFunc(GL_GREATER, 0.5f); + return true; + } return false; } diff --git a/source/gameengine/Ketsji/KX_RayCast.cpp b/source/gameengine/Ketsji/KX_RayCast.cpp index ce7ed984985..b88741625b6 100644 --- a/source/gameengine/Ketsji/KX_RayCast.cpp +++ b/source/gameengine/Ketsji/KX_RayCast.cpp @@ -29,6 +29,7 @@ */ #include +#include #include "KX_RayCast.h" diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp index 9454edfacfe..80d6d55df25 100644 --- a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp +++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp @@ -166,6 +166,10 @@ void RAS_2DFilterManager::StartShaderProgram(unsigned int shaderprogram) GLint uniformLoc; bgl::blUseProgramObjectARB(shaderprogram); uniformLoc = bgl::blGetUniformLocationARB(shaderprogram, "bgl_RenderedTexture"); + bgl::blActiveTextureARB(GL_TEXTURE0); + //glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, texname); + if (uniformLoc != -1) { bgl::blUniform1iARB(uniformLoc, 0); diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.h index a18ed038f35..3e24ee204a1 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.h @@ -53,9 +53,9 @@ #elif defined(__APPLE__) # include "mac_compat_glext.h" # include -# else +#else # include -# endif +#endif #endif #ifdef __sgi From 91f8ad839805a64364f2685a00cc8309688d2f44 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Tue, 17 Jun 2008 19:00:21 +0000 Subject: [PATCH 24/76] Added merge option to shrinkwrap when using projection mode (bruteforce for now) Changed code to remove faces (now quad faces that got one vertice projected are turned on tri) Merge option is still not very usefull since shrinkwrap does not yet moves unprojected vertices --- release/scripts/CreatePlane.py | 88 +++++----- source/blender/blenkernel/BKE_shrinkwrap.h | 2 + source/blender/blenkernel/intern/modifier.c | 1 + source/blender/blenkernel/intern/shrinkwrap.c | 158 ++++++++++++++++-- source/blender/makesdna/DNA_modifier_types.h | 3 + source/blender/src/buttons_editing.c | 5 +- 6 files changed, 197 insertions(+), 60 deletions(-) diff --git a/release/scripts/CreatePlane.py b/release/scripts/CreatePlane.py index 5b72c60f541..393a3a94e65 100644 --- a/release/scripts/CreatePlane.py +++ b/release/scripts/CreatePlane.py @@ -45,24 +45,23 @@ import Blender, bpy def matrix(dima, dimb): return [[0 for b in range(dimb)] for a in range(dima)] -def makelist(a): - res = [] - for i in a: - res.append(i) - return res - def dotProduct(a): - sum = 0.0 - for i in a: - sum += i*i - return sum + return reduce(lambda x, y: x + y*y, a) + +def manhattanDistance(a, b): + return reduce(lambda x, y: x + abs(y[0]-y[1]), zip(a, b), 0) + +def xrange_tuple(low, upper): + for i in xrange( low[0], upper[0]): + for j in xrange( low[1], upper[1]): + yield (i,j) + # For now simply decompose in a triangle fan def DecomposePolygon(poly): - for i in range(2, len(poly), 1): + for i in xrange(2, len(poly), 1): yield [ poly[0], poly[i-1], poly[i] ] - def Expand3dCoordsFrom2d(coords): for c in coords: yield ( c[0] , c[1], 0 ) @@ -76,34 +75,41 @@ def ExtractSections(image): mdim = max( image.size ) dx = float(image.size[0]) / x_samples dy = float(image.size[1]) / y_samples - ox = -float(x_samples)*0.5 - oy = -float(y_samples)*0.5 + + offset = [ -0.5*i for i in image.size] def scale(a): - return ( (a[0] + ox)*dx , (a[1] + oy)*dy ) - - used = matrix(x_samples, y_samples) - for a in range(x_samples): - for b in range(y_samples): - if dotProduct(image.getPixelHDR( (int)(a*dx), (int)(b*dy))) <= 1: - used[a][b] = 1 + return (a[0] + offset[0] , a[1] + offset[1]) + + sx = 0 +#(int) (float(image.size[0]) / (x_samples)) + sy = 0 +#(int) (float(image.size[1]) / (y_samples)) - for a in range(x_samples-1): - for b in range(y_samples-1): - sum = used[a][b] + used[a+1][b] + used[a][b+1] + used[a+1][b+1] - - if sum == 4: - yield map( scale, [ (a,b) , (a+1,b), (a+1,b+1), (a,b+1) ] ) - elif sum == 3: - if not used[a][b]: - yield map( scale, [ (a+1,b), (a+1,b+1) , (a,b+1) ] ) - if not used[a+1][b]: - yield map( scale, [ (a,b), (a+1,b+1) , (a,b+1) ] ) - if not used[a][b+1]: - yield map( scale, [ (a,b), (a+1,b) , (a+1,b+1) ] ) - if not used[a+1][b+1]: - yield map( scale, [ (a,b), (a+1,b) , (a,b+1) ] ) - + def get( center ): + best = None + for pos in xrange_tuple( (max(0, center[0]-sx),max(0, center[1]-sy)) , (min(image.size[0], center[0]+sx)+1, min(image.size[1], center[1]+sy)+1 )): + if dotProduct(image.getPixelHDR(pos[0],pos[1])) <= 1: + if best == None or manhattanDistance(center, pos) < manhattanDistance(center, best): + best = pos + return best + + + pos = matrix(x_samples, y_samples) + sdx = dx + sdy = dy + for a in xrange(x_samples): + for b in xrange(y_samples): + pos[a][b] = get(((int)(a*sdx),(int)(b*sdy))) + + for a in xrange(x_samples-1): + for b in xrange(y_samples-1): + arround = [ (a,b) , (a+1,b), (a+1,b+1), (a,b+1) ] + + valid = [ pos[c[0]][c[1]] for c in arround if pos[c[0]][c[1]] != None] + if len(valid) >= 3: + yield map( scale, valid ) + def ImportPlaneFromImage(image, mesh): @@ -134,8 +140,6 @@ def ImportPlaneFromImage(image, mesh): -#use the current image on the image editor? or ask the user what image to load -#image = Blender.Image.GetCurrent() def load_image(filename): print "Loading ",filename @@ -144,11 +148,13 @@ def load_image(filename): Blender.Scene.GetCurrent().objects.new(mesh) image = Blender.Image.Load(filename) - print image ImportPlaneFromImage(image, mesh) Blender.Redraw() -image = Blender.Window.FileSelector(load_image, "Load Image") +Blender.Window.FileSelector(load_image, "Load Image") +#use the current image on the image editor? or ask the user what image to load +#image = Blender.Image.GetCurrent() +#load_image("/home/darkaj/develop/blender/shrinkwrap/road.png") diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h index babdcd78261..3eb0b6fa579 100644 --- a/source/blender/blenkernel/BKE_shrinkwrap.h +++ b/source/blender/blenkernel/BKE_shrinkwrap.h @@ -39,6 +39,8 @@ typedef char* BitSet; #define bitset_get(set,index) ((set)[(index)>>3] & (1 << ((index)&0x7))) #define bitset_set(set,index) ((set)[(index)>>3] |= (1 << ((index)&0x7))) +#define bitset_unset(set,index) ((set)[(index)>>3] &= ~(1 << ((index)&0x7))) + struct Object; diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 63d2da31b20..cd65aace158 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -7021,6 +7021,7 @@ static void shrinkwrapModifier_initData(ModifierData *md) smd->shrinkType = MOD_SHRINKWRAP_NEAREST_SURFACE; smd->shrinkOpts = MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL; smd->keptDist = 0.0f; + smd->mergeDist = 0.0f; } static void shrinkwrapModifier_copyData(ModifierData *md, ModifierData *target) diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 14ed29d0583..893cff3dd25 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -58,7 +59,7 @@ #define OUT_OF_MEMORY() ((void)printf("Shrinkwrap: Out of memory\n")) /* Benchmark macros */ -#if 1 +#if 0 #define BENCH(a) \ do { \ @@ -322,6 +323,82 @@ static float squared_dist(const float *a, const float *b) return INPR(tmp, tmp); } +/* + * + */ +static void derivedmesh_mergeNearestPoints(DerivedMesh *dm, float mdist, BitSet skipVert) +{ + if(mdist > 0.0f) + { + int i, j, merged; + int numVerts = dm->getNumVerts(dm); + int *translate_vert = MEM_mallocN( sizeof(int)*numVerts, "merge points array"); + + MVert *vert = dm->getVertDataArray(dm, CD_MVERT); + + if(!translate_vert) return; + + merged = 0; + for(i=0; i 0) + { + int numFaces = dm->getNumFaces(dm); + int freeVert; + MFace *face = dm->getFaceDataArray(dm, CD_MFACE); + + + //Adjust vertexs using the translation_table.. only translations to back indexs are allowed + //which means t[i] <= i must always verify + for(i=0, freeVert = 0; iv1 = translate_vert[f->v1]; + f->v2 = translate_vert[f->v2]; + f->v3 = translate_vert[f->v3]; + //TODO be carefull with vertexs v4 being translated to 0 + f->v4 = translate_vert[f->v4]; + } + + //TODO: maybe update edges could be done outside this function + CDDM_calc_edges(dm); + //CDDM_calc_normals(dm); + } + + if(translate_vert) MEM_freeN( translate_vert ); + } +} + + /* * This calculates the distance (in dir units) that the ray must travel to intersect plane * It can return negative values @@ -703,25 +780,57 @@ static void shrinkwrap_removeUnused(ShrinkwrapCalcData *calc) BitSet used_faces = bitset_new(numFaces, "shrinkwrap used faces"); int numUsedFaces = 0; + + //calculate which vertexs need to be used + //even unmoved vertices might need to be used if theres a face that needs it //calc real number of faces, and vertices //Count used faces for(i=0; igetVertDataArray(new, CD_MVERT); for(i=0, t=0; ifinal = new; } + /* Main shrinkwrap function */ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, DerivedMesh *dm, int useRenderParams, int isFinalCalc) { @@ -820,10 +936,12 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri //Projecting target defined - lets work! if(calc.target) { +/* printf("Shrinkwrap (%s)%d over (%s)%d\n", calc.ob->id.name, calc.final->getNumVerts(calc.final), calc.smd->target->id.name, calc.target->getNumVerts(calc.target) ); +*/ switch(smd->shrinkType) { @@ -845,14 +963,21 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri } - //Destroy faces, edges and stuff if(calc.moved) { + //Destroy faces, edges and stuff shrinkwrap_removeUnused(&calc); - bitset_free(calc.moved); + + if(calc.moved) + derivedmesh_mergeNearestPoints(calc.final, calc.smd->mergeDist, calc.moved); } - CDDM_calc_normals(calc.final); + CDDM_calc_normals(calc.final); + + //clean memory + if(calc.moved) + bitset_free(calc.moved); + return calc.final; } @@ -873,12 +998,11 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) BVHTree *tree = NULL; BVHTreeNearest nearest; - BENCH_VAR(query); - int numVerts; MVert *vert = NULL; MDeformVert *dvert = NULL; + BENCH_VAR(query); BENCH(tree = bvhtree_from_mesh_verts(calc->target)); diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 7590cd0c3b9..25830321b93 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -495,8 +495,11 @@ typedef struct ShrinkwrapModifierData { struct Object *target; /* shrink target */ char vgroup_name[32]; /* optional vertexgroup name */ float keptDist; /* distance offset from mesh/projection point */ + float mergeDist; /* distance to merge vertexs */ short shrinkType; /* shrink type projection */ short shrinkOpts; /* shrink options */ + + int pad; } ShrinkwrapModifierData; /* Shrinkwrap->shrinkType */ diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 808a964019f..5e1cfbea183 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -1830,7 +1830,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; height = 86; if (smd->shrinkType == MOD_SHRINKWRAP_NORMAL) - height += 19*5; + height += 19*6; } /* roundbox 4 free variables: corner-rounding, nop, roundbox type, shade */ uiDefBut(block, ROUNDBOX, 0, "", x-10, y-height-2, width, height-2, NULL, 5.0, 0.0, 12, 40, ""); @@ -2461,9 +2461,10 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco uiDefButBitS(block, TOG, MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE, B_MODIFIER_RECALC, "Cull frontfaces", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Controls whether a vertex can be projected to a front face on target"); uiDefButBitS(block, TOG, MOD_SHRINKWRAP_CULL_TARGET_BACKFACE, B_MODIFIER_RECALC, "Cull backfaces", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Controls whether a vertex can be projected to a back face on target"); + uiDefButF(block, NUM, B_MODIFIER_RECALC, "Merge Dist:", lx,(cy-=19),buttonWidth,19, &smd->mergeDist, 0.0f, 0.01f, 0.01f, 0.01f, "Specify merge distance"); } - but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &smd->vgroup_name, 0.0, 31.0, 0, 0, "Vertex Group name"); + but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &smd->vgroup_name, 0, 31, 0, 0, "Vertex Group name"); uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob); uiDefIDPoinBut(block, modifier_testMeshObj, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &smd->target, "Target to shrink to"); From 824eac5095924ffdc1fea213a925054c88bf05d7 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Fri, 20 Jun 2008 21:10:16 +0000 Subject: [PATCH 25/76] Added cut-plane option. Its now possible to project 2 planes over a model and get a cloth.. Tought it still has a few issues.. related with distance to kept from mesh. --- source/blender/blenkernel/BKE_shrinkwrap.h | 2 +- source/blender/blenkernel/intern/modifier.c | 13 ++- source/blender/blenkernel/intern/shrinkwrap.c | 102 +++++++++++++++--- source/blender/makesdna/DNA_modifier_types.h | 1 + source/blender/src/buttons_editing.c | 3 +- 5 files changed, 97 insertions(+), 24 deletions(-) diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h index 3eb0b6fa579..b0a40768e8b 100644 --- a/source/blender/blenkernel/BKE_shrinkwrap.h +++ b/source/blender/blenkernel/BKE_shrinkwrap.h @@ -54,7 +54,7 @@ typedef struct ShrinkwrapCalcData ShrinkwrapModifierData *smd; //shrinkwrap modifier data struct Object *ob; //object we are applying shrinkwrap to - struct DerivedMesh *original; //mesh before shrinkwrap + struct DerivedMesh *original; //mesh before shrinkwrap (TODO clean this variable.. we don't really need it) struct DerivedMesh *final; //initially a copy of original mesh.. mesh thats going to be shrinkwrapped struct DerivedMesh *target; //mesh we are shrinking to diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index cd65aace158..dfd76a9c9d4 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -7022,6 +7022,9 @@ static void shrinkwrapModifier_initData(ModifierData *md) smd->shrinkOpts = MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL; smd->keptDist = 0.0f; smd->mergeDist = 0.0f; + + smd->target = 0; + smd->cutPlane = 0; } static void shrinkwrapModifier_copyData(ModifierData *md, ModifierData *target) @@ -7045,6 +7048,7 @@ static void shrinkwrapModifier_foreachObjectLink(ModifierData *md, Object *ob, O ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; walk(userData, ob, &smd->target); + walk(userData, ob, &smd->cutPlane); } static DerivedMesh *shrinkwrapModifier_applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData, int useRenderParams, int isFinalCalc) @@ -7061,12 +7065,11 @@ static void shrinkwrapModifier_updateDepgraph(ModifierData *md, DagForest *fores { ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; - if (smd->target) { - DagNode *curNode = dag_get_node(forest, smd->target); + if (smd->target) + dag_add_relation(forest, dag_get_node(forest, smd->target), obNode, DAG_RL_OB_DATA | DAG_RL_DATA_DATA, "Shrinkwrap Modifier"); - dag_add_relation(forest, curNode, obNode, DAG_RL_OB_DATA | DAG_RL_DATA_DATA, - "Shrinkwrap Modifier"); - } + if (smd->cutPlane) + dag_add_relation(forest, dag_get_node(forest, smd->cutPlane), obNode, DAG_RL_OB_DATA | DAG_RL_DATA_DATA, "Shrinkwrap Modifier"); } diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 893cff3dd25..4ae2ad8f4a9 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -894,6 +894,73 @@ static void shrinkwrap_removeUnused(ShrinkwrapCalcData *calc) calc->final = new; } +void shrinkwrap_projectToCutPlane(ShrinkwrapCalcData *calc_data) +{ + if(calc_data->smd->cutPlane && calc_data->moved) + { + int i; + int unmoved = 0; + int numVerts= 0; + MVert *vert = NULL; + MVert *vert_unmoved = NULL; + + ShrinkwrapCalcData calc; + memcpy(&calc, calc_data, sizeof(calc)); + + calc.moved = 0; + + if(calc.smd->cutPlane) + { + calc.target = (DerivedMesh *)calc.smd->cutPlane->derivedFinal; + + if(!calc.target) + { + return; + } + + Mat4Invert (calc.smd->cutPlane->imat, calc.smd->cutPlane->obmat); //inverse is outdated + Mat4MulSerie(calc.local2target, calc.smd->cutPlane->imat, calc.ob->obmat, 0, 0, 0, 0, 0, 0); + Mat4Invert(calc.target2local, calc.local2target); + + calc.keptDist = 0; + } + + + //Make a mesh with the points we want to project + numVerts = calc_data->final->getNumVerts(calc_data->final); + + unmoved = 0; + for(i=0; imoved, i)) + unmoved++; + + calc.final = CDDM_new(unmoved, 0, 0); + if(!calc.final) return; + + + vert = calc_data->final->getVertDataArray(calc_data->final, CD_MVERT); + vert_unmoved = calc.final->getVertDataArray(calc.final, CD_MVERT); + + for(i=0; imoved, i)) + memcpy(vert_unmoved++, vert+i, sizeof(*vert_unmoved)); + + //use shrinkwrap projection + shrinkwrap_calc_normal_projection(&calc); + + //Copy the points back to the mesh + vert = calc_data->final->getVertDataArray(calc_data->final, CD_MVERT); + vert_unmoved = calc.final->getVertDataArray(calc.final, CD_MVERT); + for(i=0; imoved, i)) + memcpy(vert+i, vert_unmoved++, sizeof(*vert_unmoved) ); + + //free memory + calc.final->release(calc.final); + } + +} + /* Main shrinkwrap function */ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, DerivedMesh *dm, int useRenderParams, int isFinalCalc) @@ -951,11 +1018,29 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri break; case MOD_SHRINKWRAP_NORMAL: + + if(calc.smd->shrinkOpts & MOD_SHRINKWRAP_REMOVE_UNPROJECTED_FACES) + calc.moved = bitset_new( calc.final->getNumVerts(calc.final), "shrinkwrap bitset data"); + BENCH(shrinkwrap_calc_normal_projection(&calc)); // BENCH(shrinkwrap_calc_foreach_vertex(&calc, bruteforce_shrinkwrap_calc_normal_projection)); + + if(calc.moved) + { + //Adjust vertxs that didn't moved (project to cut plane) + shrinkwrap_projectToCutPlane(&calc); + + //Destroy faces, edges and stuff + shrinkwrap_removeUnused(&calc); + + //Merge points that didn't moved + derivedmesh_mergeNearestPoints(calc.final, calc.smd->mergeDist, calc.moved); + bitset_free(calc.moved); + } break; case MOD_SHRINKWRAP_NEAREST_VERTEX: + BENCH(shrinkwrap_calc_nearest_vertex(&calc)); // BENCH(shrinkwrap_calc_foreach_vertex(&calc, bruteforce_shrinkwrap_calc_nearest_vertex)); break; @@ -963,22 +1048,8 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri } - if(calc.moved) - { - //Destroy faces, edges and stuff - shrinkwrap_removeUnused(&calc); - - if(calc.moved) - derivedmesh_mergeNearestPoints(calc.final, calc.smd->mergeDist, calc.moved); - } - CDDM_calc_normals(calc.final); - //clean memory - if(calc.moved) - bitset_free(calc.moved); - - return calc.final; } @@ -1083,9 +1154,6 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) vert = calc->final->getVertDataArray(calc->final, CD_MVERT); dvert = calc->final->getVertDataArray(calc->final, CD_MDEFORMVERT); - if(calc->smd->shrinkOpts & MOD_SHRINKWRAP_REMOVE_UNPROJECTED_FACES) - calc->moved = bitset_new(numVerts, "shrinkwrap bitset data"); - for(i=0; ishrinkType == MOD_SHRINKWRAP_NORMAL) - height += 19*6; + height += 19*7; } /* roundbox 4 free variables: corner-rounding, nop, roundbox type, shade */ uiDefBut(block, ROUNDBOX, 0, "", x-10, y-height-2, width, height-2, NULL, 5.0, 0.0, 12, 40, ""); @@ -2462,6 +2462,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco uiDefButBitS(block, TOG, MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE, B_MODIFIER_RECALC, "Cull frontfaces", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Controls whether a vertex can be projected to a front face on target"); uiDefButBitS(block, TOG, MOD_SHRINKWRAP_CULL_TARGET_BACKFACE, B_MODIFIER_RECALC, "Cull backfaces", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Controls whether a vertex can be projected to a back face on target"); uiDefButF(block, NUM, B_MODIFIER_RECALC, "Merge Dist:", lx,(cy-=19),buttonWidth,19, &smd->mergeDist, 0.0f, 0.01f, 0.01f, 0.01f, "Specify merge distance"); + uiDefIDPoinBut(block, modifier_testMeshObj, ID_OB, B_CHANGEDEP, "Cut: ", lx, (cy-=19), buttonWidth,19, &smd->cutPlane, "Target to project points that didn't got projected over target"); } but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &smd->vgroup_name, 0, 31, 0, 0, "Vertex Group name"); From ffbe42129e0d043214daf9b07125d9d8140d1c74 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Fri, 20 Jun 2008 21:36:15 +0000 Subject: [PATCH 26/76] svn merge -r 15202:15292 https://svn.blender.org/svnroot/bf-blender/trunk/blender --- blenderplayer/CMakeLists.txt | 1 + extern/CMakeLists.txt | 3 + extern/Makefile | 2 +- extern/SConscript | 2 + extern/glew/CMakeLists.txt | 33 + extern/glew/README.txt | 18 + extern/glew/SConscript | 12 + extern/glew/include/GL/glew.h | 9797 +++++++++++++++++ extern/glew/include/GL/glxew.h | 1062 ++ extern/glew/include/GL/wglew.h | 934 ++ extern/glew/make/msvc_7_0/glew_vc7.vcproj | 146 + extern/glew/src/Makefile | 56 + extern/glew/src/glew.c | 9756 ++++++++++++++++ extern/make/msvc_7_0/extern.sln | 65 + intern/ghost/intern/GHOST_SystemX11.cpp | 8 +- projectfiles_vc7/blender/blender.vcproj | 4 +- .../blender/blenkernel/BKE_blenkernel.vcproj | 9 +- .../blender/blenlib/BLI_blenlib.vcproj | 6 + .../blenderhook/KX_blenderhook.vcproj | 4 +- .../gameengine/converter/KX_converter.vcproj | 12 + .../gameplayer/common/GP_common.vcproj | 4 +- .../gameplayer/ghost/GP_ghost.vcproj | 8 +- .../gameengine/ketsji/KX_ketsji.vcproj | 18 +- .../rasterizer/RAS_rasterizer.vcproj | 12 +- .../RAS_openglrasterizer.vcproj | 21 +- release/scripts/ms3d_import.py | 132 +- release/scripts/vrml97_export.py | 78 +- source/Makefile | 1 + source/blender/blenkernel/BKE_action.h | 5 + source/blender/blenkernel/BKE_key.h | 11 + source/blender/blenkernel/BKE_scene.h | 2 +- source/blender/blenkernel/intern/action.c | 24 +- source/blender/blenkernel/intern/armature.c | 61 +- source/blender/blenkernel/intern/key.c | 2 +- source/blender/blenkernel/intern/modifier.c | 207 +- source/blender/blenkernel/intern/object.c | 2 + source/blender/blenkernel/intern/sca.c | 1 + source/blender/blenlib/intern/util.c | 19 +- source/blender/blenloader/intern/readfile.c | 8 + source/blender/blenloader/intern/writefile.c | 1 + source/blender/imbuf/intern/cineon/dpxlib.c | 45 +- source/blender/include/BDR_editcurve.h | 1 + source/blender/include/BIF_oops.h | 8 + source/blender/makesdna/DNA_actuator_types.h | 1 + source/blender/makesdna/DNA_modifier_types.h | 6 +- source/blender/makesdna/DNA_space_types.h | 1 + .../blender/nodes/intern/CMP_nodes/CMP_math.c | 18 +- .../blender/nodes/intern/SHD_nodes/SHD_math.c | 18 +- source/blender/python/api2_2x/Mathutils.c | 49 +- .../render/intern/source/convertblender.c | 2 +- source/blender/render/intern/source/shadbuf.c | 4 +- source/blender/src/CMakeLists.txt | 2 +- source/blender/src/Makefile | 1 + source/blender/src/SConscript | 2 +- source/blender/src/buttons_editing.c | 11 +- source/blender/src/buttons_logic.c | 14 +- source/blender/src/drawaction.c | 2 +- source/blender/src/drawnode.c | 2 +- source/blender/src/drawoops.c | 9 + source/blender/src/editcurve.c | 56 + source/blender/src/editobject.c | 5 +- source/blender/src/header_oops.c | 4 +- source/blender/src/oops.c | 114 +- source/blender/src/transform_constraints.c | 16 + source/blender/src/transform_snap.c | 154 +- source/blender/src/usiblender.c | 12 +- source/blender/src/view.c | 60 +- source/creator/CMakeLists.txt | 1 + .../BlenderRoutines/BL_KetsjiEmbedStart.cpp | 50 +- .../gameengine/BlenderRoutines/CMakeLists.txt | 1 + .../BlenderRoutines/KX_BlenderCanvas.h | 8 +- .../BlenderRoutines/KX_BlenderGL.cpp | 59 +- .../BlenderRoutines/KX_BlenderRenderTools.cpp | 13 +- source/gameengine/BlenderRoutines/Makefile | 3 +- source/gameengine/BlenderRoutines/SConscript | 1 + .../BlenderRoutines/mac_compat_glext.h | 132 - .../Converter/BL_ActionActuator.cpp | 8 +- .../Converter/BL_ArmatureObject.cpp | 7 +- .../Converter/BL_BlenderDataConversion.cpp | 91 +- .../Converter/BL_DeformableGameObject.cpp | 47 + .../Converter/BL_DeformableGameObject.h | 40 +- .../gameengine/Converter/BL_MeshDeformer.cpp | 160 +- source/gameengine/Converter/BL_MeshDeformer.h | 11 +- .../Converter/BL_ShapeActionActuator.cpp | 797 ++ .../Converter/BL_ShapeActionActuator.h | 133 + .../gameengine/Converter/BL_ShapeDeformer.cpp | 127 + .../gameengine/Converter/BL_ShapeDeformer.h | 93 + .../gameengine/Converter/BL_SkinDeformer.cpp | 89 +- source/gameengine/Converter/BL_SkinDeformer.h | 35 +- .../Converter/BL_SkinMeshObject.cpp | 82 +- .../gameengine/Converter/BL_SkinMeshObject.h | 79 +- .../Converter/KX_BlenderSceneConverter.cpp | 14 +- .../Converter/KX_BlenderSceneConverter.h | 5 + .../Converter/KX_ConvertActuators.cpp | 25 + source/gameengine/GameLogic/SCA_IObject.h | 2 +- .../GamePlayer/common/CMakeLists.txt | 1 + .../gameengine/GamePlayer/common/GPC_Canvas.h | 18 +- .../GamePlayer/common/GPC_PolygonMaterial.cpp | 19 +- .../GamePlayer/common/GPC_RenderTools.cpp | 14 +- .../GamePlayer/common/GPC_RenderTools.h | 15 +- source/gameengine/GamePlayer/common/Makefile | 1 + .../gameengine/GamePlayer/common/SConscript | 3 +- .../GamePlayer/ghost/CMakeLists.txt | 1 + .../GamePlayer/ghost/GPG_Application.cpp | 43 +- .../GamePlayer/ghost/GPG_Application.h | 1 + source/gameengine/GamePlayer/ghost/Makefile | 1 + source/gameengine/GamePlayer/ghost/SConscript | 3 +- source/gameengine/Ketsji/BL_BlenderShader.cpp | 149 + source/gameengine/Ketsji/BL_BlenderShader.h | 44 + source/gameengine/Ketsji/BL_Material.cpp | 1 + source/gameengine/Ketsji/BL_Material.h | 3 +- source/gameengine/Ketsji/BL_Shader.cpp | 306 +- source/gameengine/Ketsji/BL_Texture.cpp | 161 +- source/gameengine/Ketsji/CMakeLists.txt | 1 + .../gameengine/Ketsji/KX_BlenderMaterial.cpp | 311 +- source/gameengine/Ketsji/KX_BlenderMaterial.h | 13 +- source/gameengine/Ketsji/KX_GameObject.cpp | 37 +- source/gameengine/Ketsji/KX_GameObject.h | 20 +- source/gameengine/Ketsji/KX_ISceneConverter.h | 3 + source/gameengine/Ketsji/KX_IpoActuator.cpp | 6 +- source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 13 +- source/gameengine/Ketsji/KX_KetsjiEngine.h | 10 + source/gameengine/Ketsji/KX_PythonInit.cpp | 70 +- source/gameengine/Ketsji/KX_RayCast.cpp | 2 +- .../Ketsji/KX_SG_NodeRelationships.h | 15 + source/gameengine/Ketsji/KX_Scene.cpp | 128 +- source/gameengine/Ketsji/Makefile | 1 + source/gameengine/Ketsji/SConscript | 2 +- source/gameengine/PyDoc/KX_GameObject.py | 6 +- source/gameengine/Rasterizer/CMakeLists.txt | 1 + source/gameengine/Rasterizer/Makefile | 1 + .../Rasterizer/RAS_2DFilterManager.cpp | 78 +- source/gameengine/Rasterizer/RAS_CameraData.h | 4 +- source/gameengine/Rasterizer/RAS_Deformer.h | 2 +- .../Rasterizer/RAS_IPolygonMaterial.cpp | 6 - .../Rasterizer/RAS_IPolygonMaterial.h | 2 - .../gameengine/Rasterizer/RAS_IRasterizer.h | 29 +- .../Rasterizer/RAS_MaterialBucket.cpp | 39 +- .../gameengine/Rasterizer/RAS_MeshObject.cpp | 32 +- source/gameengine/Rasterizer/RAS_MeshObject.h | 6 +- .../RAS_OpenGLRasterizer/ARB_multitexture.h | 150 - .../RAS_OpenGLRasterizer/CMakeLists.txt | 1 + .../EXT_separate_specular_color.h | 12 - .../Rasterizer/RAS_OpenGLRasterizer/Makefile | 1 + .../RAS_GLExtensionManager.cpp | 674 +- .../RAS_GLExtensionManager.h | 507 +- .../RAS_ListRasterizer.cpp | 19 +- .../RAS_OpenGLRasterizer.cpp | 1071 +- .../RAS_OpenGLRasterizer.h | 37 +- .../RAS_VAOpenGLRasterizer.cpp | 316 +- .../RAS_VAOpenGLRasterizer.h | 7 +- .../RAS_OpenGLRasterizer/SConscript | 6 +- .../RAS_OpenGLRasterizer/mkglext.py | 627 -- source/gameengine/Rasterizer/SConscript | 2 +- source/gameengine/SceneGraph/SG_Node.cpp | 11 + source/gameengine/SceneGraph/SG_Node.h | 8 + .../gameengine/SceneGraph/SG_ParentRelation.h | 10 + source/gameengine/SceneGraph/SG_Spatial.cpp | 7 + source/gameengine/SceneGraph/SG_Spatial.h | 4 + source/nan_definitions.mk | 1 + 160 files changed, 25956 insertions(+), 4414 deletions(-) create mode 100644 extern/glew/CMakeLists.txt create mode 100644 extern/glew/README.txt create mode 100644 extern/glew/SConscript create mode 100644 extern/glew/include/GL/glew.h create mode 100644 extern/glew/include/GL/glxew.h create mode 100644 extern/glew/include/GL/wglew.h create mode 100644 extern/glew/make/msvc_7_0/glew_vc7.vcproj create mode 100644 extern/glew/src/Makefile create mode 100644 extern/glew/src/glew.c delete mode 100644 source/gameengine/BlenderRoutines/mac_compat_glext.h create mode 100644 source/gameengine/Converter/BL_ShapeActionActuator.cpp create mode 100644 source/gameengine/Converter/BL_ShapeActionActuator.h create mode 100644 source/gameengine/Converter/BL_ShapeDeformer.cpp create mode 100644 source/gameengine/Converter/BL_ShapeDeformer.h create mode 100644 source/gameengine/Ketsji/BL_BlenderShader.cpp create mode 100644 source/gameengine/Ketsji/BL_BlenderShader.h delete mode 100644 source/gameengine/Rasterizer/RAS_OpenGLRasterizer/ARB_multitexture.h delete mode 100644 source/gameengine/Rasterizer/RAS_OpenGLRasterizer/EXT_separate_specular_color.h delete mode 100644 source/gameengine/Rasterizer/RAS_OpenGLRasterizer/mkglext.py diff --git a/blenderplayer/CMakeLists.txt b/blenderplayer/CMakeLists.txt index 62b64ff04bb..d90639562d2 100644 --- a/blenderplayer/CMakeLists.txt +++ b/blenderplayer/CMakeLists.txt @@ -108,6 +108,7 @@ IF(UNIX) blenkernel_blc bf_quicktime extern_binreloc + extern_glew ) FOREACH(SORTLIB ${BLENDER_SORTED_LIBS}) diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index d092e0d494d..ee5cab31e09 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -43,3 +43,6 @@ ENDIF(WITH_VERSE) IF(CMAKE_SYSTEM_NAME MATCHES "Linux") SUBDIRS(binreloc) ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux") + +SUBDIRS(glew) + diff --git a/extern/Makefile b/extern/Makefile index fd4573cc8b1..26ee25b608f 100644 --- a/extern/Makefile +++ b/extern/Makefile @@ -30,7 +30,7 @@ include nan_definitions.mk SOURCEDIR = extern DIR = $(OCGDIR)/extern -DIRS = qhull/src solid +DIRS = qhull/src solid glew/src ifeq ($(WITH_FREETYPE2), true) DIRS += bFTGL/src diff --git a/extern/SConscript b/extern/SConscript index c94b6573eb9..6612d38f4cf 100644 --- a/extern/SConscript +++ b/extern/SConscript @@ -2,6 +2,8 @@ Import('env') +SConscript(['glew/SConscript']) + if env['WITH_BF_GAMEENGINE']: SConscript(['qhull/SConscript', 'solid/SConscript']) diff --git a/extern/glew/CMakeLists.txt b/extern/glew/CMakeLists.txt new file mode 100644 index 00000000000..53ef014927c --- /dev/null +++ b/extern/glew/CMakeLists.txt @@ -0,0 +1,33 @@ +# $Id$ +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# The Original Code is Copyright (C) 2006, Blender Foundation +# All rights reserved. +# +# The Original Code is: all of this file. +# +# Contributor(s): Jacques Beaurain. +# +# ***** END GPL LICENSE BLOCK ***** + +SET(INC include src) + +SET(SRC + src/glew.c +) + +BLENDERLIB(extern_glew "${SRC}" "${INC}") diff --git a/extern/glew/README.txt b/extern/glew/README.txt new file mode 100644 index 00000000000..1b19c53523f --- /dev/null +++ b/extern/glew/README.txt @@ -0,0 +1,18 @@ +See doc/index.html for more information. + +If you downloaded the tarball from the GLEW website, you just need to: + + Unix: + + make + + Windows: + + use the project file in build/vc6/ + +If you wish to build GLEW from scratch (update the extension data from +the net or add your own extension information), you need a Unix +environment (including wget, perl, and GNU make). The extension data +is regenerated from the top level source directory with: + + make extensions diff --git a/extern/glew/SConscript b/extern/glew/SConscript new file mode 100644 index 00000000000..32b3b478113 --- /dev/null +++ b/extern/glew/SConscript @@ -0,0 +1,12 @@ +#!/usr/bin/python +import sys +import os + +Import('env') + +sources = ['src/glew.c'] + +defs = '' +incs = 'include' + +env.BlenderLib ( 'extern_glew', sources, Split(incs), Split(defs), libtype=['intern', 'player'], priority=[25, 50]) diff --git a/extern/glew/include/GL/glew.h b/extern/glew/include/GL/glew.h new file mode 100644 index 00000000000..fd3fe10b938 --- /dev/null +++ b/extern/glew/include/GL/glew.h @@ -0,0 +1,9797 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2006, Milan Ikits +** Copyright (C) 2002-2006, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* +** License Applicability. Except to the extent portions of this file are +** made subject to an alternative license as permitted in the SGI Free +** Software License B, Version 1.1 (the "License"), the contents of this +** file are subject only to the provisions of the License. You may not use +** this file except in compliance with the License. You may obtain a copy +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** +** http://oss.sgi.com/projects/FreeB +** +** Note that, as provided in the License, the Software is distributed on an +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** +** Original Code. The Original Code is: OpenGL Sample Implementation, +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, +** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. +** Copyright in any portions created by third parties is as indicated +** elsewhere herein. All Rights Reserved. +** +** Additional Notice Provisions: This software was created using the +** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has +** not been independently verified as being compliant with the OpenGL(R) +** version 1.2.1 Specification. +*/ + +/* added this here for blender, should be moved elsewhere */ +#define GLEW_STATIC + +#ifndef __glew_h__ +#define __glew_h__ +#define __GLEW_H__ + +#if defined(__gl_h_) || defined(__GL_H__) +#error gl.h included before glew.h +#endif +#if defined(__glext_h_) || defined(__GLEXT_H_) +#error glext.h included before glew.h +#endif +#if defined(__gl_ATI_h_) +#error glATI.h included before glew.h +#endif + +#define __gl_h_ +#define __GL_H__ +#define __glext_h_ +#define __GLEXT_H_ +#define __gl_ATI_h_ + +#if defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) + +/* + * GLEW does not include to avoid name space pollution. + * GL needs GLAPI and GLAPIENTRY, GLU needs APIENTRY, CALLBACK, and wchar_t + * defined properly. + */ +/* */ +#ifndef APIENTRY +#define GLEW_APIENTRY_DEFINED +# if defined(__CYGWIN__) || defined(__MINGW32__) +# define APIENTRY __stdcall +# elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) +# define APIENTRY __stdcall +# else +# define APIENTRY +# endif +#endif +#ifndef GLAPI +# if defined(__CYGWIN__) || defined(__MINGW32__) +# define GLAPI extern +# endif +#endif +/* */ +#ifndef CALLBACK +#define GLEW_CALLBACK_DEFINED +# if defined(__CYGWIN__) || defined(__MINGW32__) +# define CALLBACK __attribute__ ((__stdcall__)) +# elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) +# define CALLBACK __stdcall +# else +# define CALLBACK +# endif +#endif +/* and */ +#ifndef WINGDIAPI +#define GLEW_WINGDIAPI_DEFINED +#define WINGDIAPI __declspec(dllimport) +#endif +/* */ +#if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(_WCHAR_T_DEFINED) +typedef unsigned short wchar_t; +# define _WCHAR_T_DEFINED +#endif +/* */ +#if !defined(_W64) +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 +# define _W64 __w64 +# else +# define _W64 +# endif +#endif +#if !defined(_PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T_) +# ifdef _WIN64 +typedef __int64 ptrdiff_t; +# else +typedef _W64 int ptrdiff_t; +# endif +# define _PTRDIFF_T_DEFINED +# define _PTRDIFF_T_ +#endif + +#ifndef GLAPI +# if defined(__CYGWIN__) || defined(__MINGW32__) +# define GLAPI extern +# else +# define GLAPI WINGDIAPI +# endif +#endif + +#ifndef GLAPIENTRY +#define GLAPIENTRY APIENTRY +#endif + +/* + * GLEW_STATIC needs to be set when using the static version. + * GLEW_BUILD is set when building the DLL version. + */ +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# ifdef GLEW_BUILD +# define GLEWAPI extern __declspec(dllexport) +# else +# define GLEWAPI extern __declspec(dllimport) +# endif +#endif + +#else /* _UNIX */ + +/* + * Needed for ptrdiff_t in turn needed by VBO. This is defined by ISO + * C. On my system, this amounts to _3 lines_ of included code, all of + * them pretty much harmless. If you know of a way of detecting 32 vs + * 64 _targets_ at compile time you are free to replace this with + * something that's portable. For now, _this_ is the portable solution. + * (mem, 2004-01-04) + */ + +#include + +#define GLEW_APIENTRY_DEFINED +#define APIENTRY +#define GLEWAPI extern + +/* */ +#ifndef GLAPI +#define GLAPI extern +#endif +#ifndef GLAPIENTRY +#define GLAPIENTRY +#endif + +#endif /* _WIN32 */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* ----------------------------- GL_VERSION_1_1 ---------------------------- */ + +#ifndef GL_VERSION_1_1 +#define GL_VERSION_1_1 1 + +#if defined(__APPLE__) +typedef unsigned long GLenum; +typedef unsigned long GLbitfield; +typedef unsigned long GLuint; +typedef long GLint; +typedef long GLsizei; +#else +typedef unsigned int GLenum; +typedef unsigned int GLbitfield; +typedef unsigned int GLuint; +typedef int GLint; +typedef int GLsizei; +#endif +typedef unsigned char GLboolean; +typedef signed char GLbyte; +typedef short GLshort; +typedef unsigned char GLubyte; +typedef unsigned short GLushort; +typedef float GLfloat; +typedef float GLclampf; +typedef double GLdouble; +typedef double GLclampd; +typedef void GLvoid; + +#define GL_ACCUM 0x0100 +#define GL_LOAD 0x0101 +#define GL_RETURN 0x0102 +#define GL_MULT 0x0103 +#define GL_ADD 0x0104 +#define GL_NEVER 0x0200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 +#define GL_CURRENT_BIT 0x00000001 +#define GL_POINT_BIT 0x00000002 +#define GL_LINE_BIT 0x00000004 +#define GL_POLYGON_BIT 0x00000008 +#define GL_POLYGON_STIPPLE_BIT 0x00000010 +#define GL_PIXEL_MODE_BIT 0x00000020 +#define GL_LIGHTING_BIT 0x00000040 +#define GL_FOG_BIT 0x00000080 +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_ACCUM_BUFFER_BIT 0x00000200 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_VIEWPORT_BIT 0x00000800 +#define GL_TRANSFORM_BIT 0x00001000 +#define GL_ENABLE_BIT 0x00002000 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_HINT_BIT 0x00008000 +#define GL_EVAL_BIT 0x00010000 +#define GL_LIST_BIT 0x00020000 +#define GL_TEXTURE_BIT 0x00040000 +#define GL_SCISSOR_BIT 0x00080000 +#define GL_ALL_ATTRIB_BITS 0x000fffff +#define GL_POINTS 0x0000 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_LINE_STRIP 0x0003 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_QUADS 0x0007 +#define GL_QUAD_STRIP 0x0008 +#define GL_POLYGON 0x0009 +#define GL_ZERO 0 +#define GL_ONE 1 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +#define GL_TRUE 1 +#define GL_FALSE 0 +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_2_BYTES 0x1407 +#define GL_3_BYTES 0x1408 +#define GL_4_BYTES 0x1409 +#define GL_DOUBLE 0x140A +#define GL_NONE 0 +#define GL_FRONT_LEFT 0x0400 +#define GL_FRONT_RIGHT 0x0401 +#define GL_BACK_LEFT 0x0402 +#define GL_BACK_RIGHT 0x0403 +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_LEFT 0x0406 +#define GL_RIGHT 0x0407 +#define GL_FRONT_AND_BACK 0x0408 +#define GL_AUX0 0x0409 +#define GL_AUX1 0x040A +#define GL_AUX2 0x040B +#define GL_AUX3 0x040C +#define GL_NO_ERROR 0 +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_OUT_OF_MEMORY 0x0505 +#define GL_2D 0x0600 +#define GL_3D 0x0601 +#define GL_3D_COLOR 0x0602 +#define GL_3D_COLOR_TEXTURE 0x0603 +#define GL_4D_COLOR_TEXTURE 0x0604 +#define GL_PASS_THROUGH_TOKEN 0x0700 +#define GL_POINT_TOKEN 0x0701 +#define GL_LINE_TOKEN 0x0702 +#define GL_POLYGON_TOKEN 0x0703 +#define GL_BITMAP_TOKEN 0x0704 +#define GL_DRAW_PIXEL_TOKEN 0x0705 +#define GL_COPY_PIXEL_TOKEN 0x0706 +#define GL_LINE_RESET_TOKEN 0x0707 +#define GL_EXP 0x0800 +#define GL_EXP2 0x0801 +#define GL_CW 0x0900 +#define GL_CCW 0x0901 +#define GL_COEFF 0x0A00 +#define GL_ORDER 0x0A01 +#define GL_DOMAIN 0x0A02 +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_INDEX 0x0B01 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_CURRENT_RASTER_COLOR 0x0B04 +#define GL_CURRENT_RASTER_INDEX 0x0B05 +#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 +#define GL_CURRENT_RASTER_POSITION 0x0B07 +#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 +#define GL_CURRENT_RASTER_DISTANCE 0x0B09 +#define GL_POINT_SMOOTH 0x0B10 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_RANGE 0x0B12 +#define GL_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_LINE_SMOOTH 0x0B20 +#define GL_LINE_WIDTH 0x0B21 +#define GL_LINE_WIDTH_RANGE 0x0B22 +#define GL_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_LINE_STIPPLE 0x0B24 +#define GL_LINE_STIPPLE_PATTERN 0x0B25 +#define GL_LINE_STIPPLE_REPEAT 0x0B26 +#define GL_LIST_MODE 0x0B30 +#define GL_MAX_LIST_NESTING 0x0B31 +#define GL_LIST_BASE 0x0B32 +#define GL_LIST_INDEX 0x0B33 +#define GL_POLYGON_MODE 0x0B40 +#define GL_POLYGON_SMOOTH 0x0B41 +#define GL_POLYGON_STIPPLE 0x0B42 +#define GL_EDGE_FLAG 0x0B43 +#define GL_CULL_FACE 0x0B44 +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_LIGHTING 0x0B50 +#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_SHADE_MODEL 0x0B54 +#define GL_COLOR_MATERIAL_FACE 0x0B55 +#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_FOG 0x0B60 +#define GL_FOG_INDEX 0x0B61 +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_COLOR 0x0B66 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_TEST 0x0B71 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_ACCUM_CLEAR_VALUE 0x0B80 +#define GL_STENCIL_TEST 0x0B90 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_MATRIX_MODE 0x0BA0 +#define GL_NORMALIZE 0x0BA1 +#define GL_VIEWPORT 0x0BA2 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_ATTRIB_STACK_DEPTH 0x0BB0 +#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 +#define GL_ALPHA_TEST 0x0BC0 +#define GL_ALPHA_TEST_FUNC 0x0BC1 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_DITHER 0x0BD0 +#define GL_BLEND_DST 0x0BE0 +#define GL_BLEND_SRC 0x0BE1 +#define GL_BLEND 0x0BE2 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_INDEX_LOGIC_OP 0x0BF1 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_AUX_BUFFERS 0x0C00 +#define GL_DRAW_BUFFER 0x0C01 +#define GL_READ_BUFFER 0x0C02 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_INDEX_CLEAR_VALUE 0x0C20 +#define GL_INDEX_WRITEMASK 0x0C21 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_INDEX_MODE 0x0C30 +#define GL_RGBA_MODE 0x0C31 +#define GL_DOUBLEBUFFER 0x0C32 +#define GL_STEREO 0x0C33 +#define GL_RENDER_MODE 0x0C40 +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_POLYGON_SMOOTH_HINT 0x0C53 +#define GL_FOG_HINT 0x0C54 +#define GL_TEXTURE_GEN_S 0x0C60 +#define GL_TEXTURE_GEN_T 0x0C61 +#define GL_TEXTURE_GEN_R 0x0C62 +#define GL_TEXTURE_GEN_Q 0x0C63 +#define GL_PIXEL_MAP_I_TO_I 0x0C70 +#define GL_PIXEL_MAP_S_TO_S 0x0C71 +#define GL_PIXEL_MAP_I_TO_R 0x0C72 +#define GL_PIXEL_MAP_I_TO_G 0x0C73 +#define GL_PIXEL_MAP_I_TO_B 0x0C74 +#define GL_PIXEL_MAP_I_TO_A 0x0C75 +#define GL_PIXEL_MAP_R_TO_R 0x0C76 +#define GL_PIXEL_MAP_G_TO_G 0x0C77 +#define GL_PIXEL_MAP_B_TO_B 0x0C78 +#define GL_PIXEL_MAP_A_TO_A 0x0C79 +#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 +#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 +#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 +#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 +#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 +#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 +#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 +#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 +#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 +#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 +#define GL_UNPACK_SWAP_BYTES 0x0CF0 +#define GL_UNPACK_LSB_FIRST 0x0CF1 +#define GL_UNPACK_ROW_LENGTH 0x0CF2 +#define GL_UNPACK_SKIP_ROWS 0x0CF3 +#define GL_UNPACK_SKIP_PIXELS 0x0CF4 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_SWAP_BYTES 0x0D00 +#define GL_PACK_LSB_FIRST 0x0D01 +#define GL_PACK_ROW_LENGTH 0x0D02 +#define GL_PACK_SKIP_ROWS 0x0D03 +#define GL_PACK_SKIP_PIXELS 0x0D04 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_MAP_COLOR 0x0D10 +#define GL_MAP_STENCIL 0x0D11 +#define GL_INDEX_SHIFT 0x0D12 +#define GL_INDEX_OFFSET 0x0D13 +#define GL_RED_SCALE 0x0D14 +#define GL_RED_BIAS 0x0D15 +#define GL_ZOOM_X 0x0D16 +#define GL_ZOOM_Y 0x0D17 +#define GL_GREEN_SCALE 0x0D18 +#define GL_GREEN_BIAS 0x0D19 +#define GL_BLUE_SCALE 0x0D1A +#define GL_BLUE_BIAS 0x0D1B +#define GL_ALPHA_SCALE 0x0D1C +#define GL_ALPHA_BIAS 0x0D1D +#define GL_DEPTH_SCALE 0x0D1E +#define GL_DEPTH_BIAS 0x0D1F +#define GL_MAX_EVAL_ORDER 0x0D30 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 +#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_NAME_STACK_DEPTH 0x0D37 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_INDEX_BITS 0x0D51 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_ALPHA_BITS 0x0D55 +#define GL_DEPTH_BITS 0x0D56 +#define GL_STENCIL_BITS 0x0D57 +#define GL_ACCUM_RED_BITS 0x0D58 +#define GL_ACCUM_GREEN_BITS 0x0D59 +#define GL_ACCUM_BLUE_BITS 0x0D5A +#define GL_ACCUM_ALPHA_BITS 0x0D5B +#define GL_NAME_STACK_DEPTH 0x0D70 +#define GL_AUTO_NORMAL 0x0D80 +#define GL_MAP1_COLOR_4 0x0D90 +#define GL_MAP1_INDEX 0x0D91 +#define GL_MAP1_NORMAL 0x0D92 +#define GL_MAP1_TEXTURE_COORD_1 0x0D93 +#define GL_MAP1_TEXTURE_COORD_2 0x0D94 +#define GL_MAP1_TEXTURE_COORD_3 0x0D95 +#define GL_MAP1_TEXTURE_COORD_4 0x0D96 +#define GL_MAP1_VERTEX_3 0x0D97 +#define GL_MAP1_VERTEX_4 0x0D98 +#define GL_MAP2_COLOR_4 0x0DB0 +#define GL_MAP2_INDEX 0x0DB1 +#define GL_MAP2_NORMAL 0x0DB2 +#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 +#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 +#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 +#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 +#define GL_MAP2_VERTEX_3 0x0DB7 +#define GL_MAP2_VERTEX_4 0x0DB8 +#define GL_MAP1_GRID_DOMAIN 0x0DD0 +#define GL_MAP1_GRID_SEGMENTS 0x0DD1 +#define GL_MAP2_GRID_DOMAIN 0x0DD2 +#define GL_MAP2_GRID_SEGMENTS 0x0DD3 +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 +#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 +#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 +#define GL_SELECTION_BUFFER_POINTER 0x0DF3 +#define GL_SELECTION_BUFFER_SIZE 0x0DF4 +#define GL_TEXTURE_WIDTH 0x1000 +#define GL_TEXTURE_HEIGHT 0x1001 +#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 +#define GL_TEXTURE_BORDER_COLOR 0x1004 +#define GL_TEXTURE_BORDER 0x1005 +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 +#define GL_LIGHT0 0x4000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 +#define GL_COMPILE 0x1300 +#define GL_COMPILE_AND_EXECUTE 0x1301 +#define GL_CLEAR 0x1500 +#define GL_AND 0x1501 +#define GL_AND_REVERSE 0x1502 +#define GL_COPY 0x1503 +#define GL_AND_INVERTED 0x1504 +#define GL_NOOP 0x1505 +#define GL_XOR 0x1506 +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_EQUIV 0x1509 +#define GL_INVERT 0x150A +#define GL_OR_REVERSE 0x150B +#define GL_COPY_INVERTED 0x150C +#define GL_OR_INVERTED 0x150D +#define GL_NAND 0x150E +#define GL_SET 0x150F +#define GL_EMISSION 0x1600 +#define GL_SHININESS 0x1601 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +#define GL_COLOR_INDEXES 0x1603 +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_TEXTURE 0x1702 +#define GL_COLOR 0x1800 +#define GL_DEPTH 0x1801 +#define GL_STENCIL 0x1802 +#define GL_COLOR_INDEX 0x1900 +#define GL_STENCIL_INDEX 0x1901 +#define GL_DEPTH_COMPONENT 0x1902 +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_BITMAP 0x1A00 +#define GL_POINT 0x1B00 +#define GL_LINE 0x1B01 +#define GL_FILL 0x1B02 +#define GL_RENDER 0x1C00 +#define GL_FEEDBACK 0x1C01 +#define GL_SELECT 0x1C02 +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 +#define GL_S 0x2000 +#define GL_T 0x2001 +#define GL_R 0x2002 +#define GL_Q 0x2003 +#define GL_MODULATE 0x2100 +#define GL_DECAL 0x2101 +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_ENV_COLOR 0x2201 +#define GL_TEXTURE_ENV 0x2300 +#define GL_EYE_LINEAR 0x2400 +#define GL_OBJECT_LINEAR 0x2401 +#define GL_SPHERE_MAP 0x2402 +#define GL_TEXTURE_GEN_MODE 0x2500 +#define GL_OBJECT_PLANE 0x2501 +#define GL_EYE_PLANE 0x2502 +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_CLAMP 0x2900 +#define GL_REPEAT 0x2901 +#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 +#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 +#define GL_CLIENT_ALL_ATTRIB_BITS 0xffffffff +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_POINT 0x2A01 +#define GL_POLYGON_OFFSET_LINE 0x2A02 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_ALPHA4 0x803B +#define GL_ALPHA8 0x803C +#define GL_ALPHA12 0x803D +#define GL_ALPHA16 0x803E +#define GL_LUMINANCE4 0x803F +#define GL_LUMINANCE8 0x8040 +#define GL_LUMINANCE12 0x8041 +#define GL_LUMINANCE16 0x8042 +#define GL_LUMINANCE4_ALPHA4 0x8043 +#define GL_LUMINANCE6_ALPHA2 0x8044 +#define GL_LUMINANCE8_ALPHA8 0x8045 +#define GL_LUMINANCE12_ALPHA4 0x8046 +#define GL_LUMINANCE12_ALPHA12 0x8047 +#define GL_LUMINANCE16_ALPHA16 0x8048 +#define GL_INTENSITY 0x8049 +#define GL_INTENSITY4 0x804A +#define GL_INTENSITY8 0x804B +#define GL_INTENSITY12 0x804C +#define GL_INTENSITY16 0x804D +#define GL_R3_G3_B2 0x2A10 +#define GL_RGB4 0x804F +#define GL_RGB5 0x8050 +#define GL_RGB8 0x8051 +#define GL_RGB10 0x8052 +#define GL_RGB12 0x8053 +#define GL_RGB16 0x8054 +#define GL_RGBA2 0x8055 +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGBA8 0x8058 +#define GL_RGB10_A2 0x8059 +#define GL_RGBA12 0x805A +#define GL_RGBA16 0x805B +#define GL_TEXTURE_RED_SIZE 0x805C +#define GL_TEXTURE_GREEN_SIZE 0x805D +#define GL_TEXTURE_BLUE_SIZE 0x805E +#define GL_TEXTURE_ALPHA_SIZE 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE 0x8061 +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_TEXTURE_PRIORITY 0x8066 +#define GL_TEXTURE_RESIDENT 0x8067 +#define GL_TEXTURE_BINDING_1D 0x8068 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_INDEX_ARRAY 0x8077 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_EDGE_FLAG_ARRAY 0x8079 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_INDEX_ARRAY_TYPE 0x8085 +#define GL_INDEX_ARRAY_STRIDE 0x8086 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_INDEX_ARRAY_POINTER 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 +#define GL_V2F 0x2A20 +#define GL_V3F 0x2A21 +#define GL_C4UB_V2F 0x2A22 +#define GL_C4UB_V3F 0x2A23 +#define GL_C3F_V3F 0x2A24 +#define GL_N3F_V3F 0x2A25 +#define GL_C4F_N3F_V3F 0x2A26 +#define GL_T2F_V3F 0x2A27 +#define GL_T4F_V4F 0x2A28 +#define GL_T2F_C4UB_V3F 0x2A29 +#define GL_T2F_C3F_V3F 0x2A2A +#define GL_T2F_N3F_V3F 0x2A2B +#define GL_T2F_C4F_N3F_V3F 0x2A2C +#define GL_T4F_C4F_N3F_V4F 0x2A2D +#define GL_LOGIC_OP GL_INDEX_LOGIC_OP +#define GL_TEXTURE_COMPONENTS GL_TEXTURE_INTERNAL_FORMAT +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 + +GLAPI void GLAPIENTRY glAccum (GLenum op, GLfloat value); +GLAPI void GLAPIENTRY glAlphaFunc (GLenum func, GLclampf ref); +GLAPI GLboolean GLAPIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences); +GLAPI void GLAPIENTRY glArrayElement (GLint i); +GLAPI void GLAPIENTRY glBegin (GLenum mode); +GLAPI void GLAPIENTRY glBindTexture (GLenum target, GLuint texture); +GLAPI void GLAPIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); +GLAPI void GLAPIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); +GLAPI void GLAPIENTRY glCallList (GLuint list); +GLAPI void GLAPIENTRY glCallLists (GLsizei n, GLenum type, const GLvoid *lists); +GLAPI void GLAPIENTRY glClear (GLbitfield mask); +GLAPI void GLAPIENTRY glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void GLAPIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GLAPI void GLAPIENTRY glClearDepth (GLclampd depth); +GLAPI void GLAPIENTRY glClearIndex (GLfloat c); +GLAPI void GLAPIENTRY glClearStencil (GLint s); +GLAPI void GLAPIENTRY glClipPlane (GLenum plane, const GLdouble *equation); +GLAPI void GLAPIENTRY glColor3b (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void GLAPIENTRY glColor3bv (const GLbyte *v); +GLAPI void GLAPIENTRY glColor3d (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void GLAPIENTRY glColor3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glColor3f (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void GLAPIENTRY glColor3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glColor3i (GLint red, GLint green, GLint blue); +GLAPI void GLAPIENTRY glColor3iv (const GLint *v); +GLAPI void GLAPIENTRY glColor3s (GLshort red, GLshort green, GLshort blue); +GLAPI void GLAPIENTRY glColor3sv (const GLshort *v); +GLAPI void GLAPIENTRY glColor3ub (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void GLAPIENTRY glColor3ubv (const GLubyte *v); +GLAPI void GLAPIENTRY glColor3ui (GLuint red, GLuint green, GLuint blue); +GLAPI void GLAPIENTRY glColor3uiv (const GLuint *v); +GLAPI void GLAPIENTRY glColor3us (GLushort red, GLushort green, GLushort blue); +GLAPI void GLAPIENTRY glColor3usv (const GLushort *v); +GLAPI void GLAPIENTRY glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); +GLAPI void GLAPIENTRY glColor4bv (const GLbyte *v); +GLAPI void GLAPIENTRY glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); +GLAPI void GLAPIENTRY glColor4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void GLAPIENTRY glColor4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glColor4i (GLint red, GLint green, GLint blue, GLint alpha); +GLAPI void GLAPIENTRY glColor4iv (const GLint *v); +GLAPI void GLAPIENTRY glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha); +GLAPI void GLAPIENTRY glColor4sv (const GLshort *v); +GLAPI void GLAPIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +GLAPI void GLAPIENTRY glColor4ubv (const GLubyte *v); +GLAPI void GLAPIENTRY glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha); +GLAPI void GLAPIENTRY glColor4uiv (const GLuint *v); +GLAPI void GLAPIENTRY glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha); +GLAPI void GLAPIENTRY glColor4usv (const GLushort *v); +GLAPI void GLAPIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GLAPI void GLAPIENTRY glColorMaterial (GLenum face, GLenum mode); +GLAPI void GLAPIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); +GLAPI void GLAPIENTRY glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void GLAPIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void GLAPIENTRY glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void GLAPIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void GLAPIENTRY glCullFace (GLenum mode); +GLAPI void GLAPIENTRY glDeleteLists (GLuint list, GLsizei range); +GLAPI void GLAPIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); +GLAPI void GLAPIENTRY glDepthFunc (GLenum func); +GLAPI void GLAPIENTRY glDepthMask (GLboolean flag); +GLAPI void GLAPIENTRY glDepthRange (GLclampd zNear, GLclampd zFar); +GLAPI void GLAPIENTRY glDisable (GLenum cap); +GLAPI void GLAPIENTRY glDisableClientState (GLenum array); +GLAPI void GLAPIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); +GLAPI void GLAPIENTRY glDrawBuffer (GLenum mode); +GLAPI void GLAPIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); +GLAPI void GLAPIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glEdgeFlag (GLboolean flag); +GLAPI void GLAPIENTRY glEdgeFlagPointer (GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glEdgeFlagv (const GLboolean *flag); +GLAPI void GLAPIENTRY glEnable (GLenum cap); +GLAPI void GLAPIENTRY glEnableClientState (GLenum array); +GLAPI void GLAPIENTRY glEnd (void); +GLAPI void GLAPIENTRY glEndList (void); +GLAPI void GLAPIENTRY glEvalCoord1d (GLdouble u); +GLAPI void GLAPIENTRY glEvalCoord1dv (const GLdouble *u); +GLAPI void GLAPIENTRY glEvalCoord1f (GLfloat u); +GLAPI void GLAPIENTRY glEvalCoord1fv (const GLfloat *u); +GLAPI void GLAPIENTRY glEvalCoord2d (GLdouble u, GLdouble v); +GLAPI void GLAPIENTRY glEvalCoord2dv (const GLdouble *u); +GLAPI void GLAPIENTRY glEvalCoord2f (GLfloat u, GLfloat v); +GLAPI void GLAPIENTRY glEvalCoord2fv (const GLfloat *u); +GLAPI void GLAPIENTRY glEvalMesh1 (GLenum mode, GLint i1, GLint i2); +GLAPI void GLAPIENTRY glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); +GLAPI void GLAPIENTRY glEvalPoint1 (GLint i); +GLAPI void GLAPIENTRY glEvalPoint2 (GLint i, GLint j); +GLAPI void GLAPIENTRY glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer); +GLAPI void GLAPIENTRY glFinish (void); +GLAPI void GLAPIENTRY glFlush (void); +GLAPI void GLAPIENTRY glFogf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glFogfv (GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glFogi (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glFogiv (GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glFrontFace (GLenum mode); +GLAPI void GLAPIENTRY glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI GLuint GLAPIENTRY glGenLists (GLsizei range); +GLAPI void GLAPIENTRY glGenTextures (GLsizei n, GLuint *textures); +GLAPI void GLAPIENTRY glGetBooleanv (GLenum pname, GLboolean *params); +GLAPI void GLAPIENTRY glGetClipPlane (GLenum plane, GLdouble *equation); +GLAPI void GLAPIENTRY glGetDoublev (GLenum pname, GLdouble *params); +GLAPI GLenum GLAPIENTRY glGetError (void); +GLAPI void GLAPIENTRY glGetFloatv (GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetIntegerv (GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetLightiv (GLenum light, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetMapdv (GLenum target, GLenum query, GLdouble *v); +GLAPI void GLAPIENTRY glGetMapfv (GLenum target, GLenum query, GLfloat *v); +GLAPI void GLAPIENTRY glGetMapiv (GLenum target, GLenum query, GLint *v); +GLAPI void GLAPIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetMaterialiv (GLenum face, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetPixelMapfv (GLenum map, GLfloat *values); +GLAPI void GLAPIENTRY glGetPixelMapuiv (GLenum map, GLuint *values); +GLAPI void GLAPIENTRY glGetPixelMapusv (GLenum map, GLushort *values); +GLAPI void GLAPIENTRY glGetPointerv (GLenum pname, GLvoid* *params); +GLAPI void GLAPIENTRY glGetPolygonStipple (GLubyte *mask); +GLAPI const GLubyte * GLAPIENTRY glGetString (GLenum name); +GLAPI void GLAPIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params); +GLAPI void GLAPIENTRY glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexGeniv (GLenum coord, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void GLAPIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glHint (GLenum target, GLenum mode); +GLAPI void GLAPIENTRY glIndexMask (GLuint mask); +GLAPI void GLAPIENTRY glIndexPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glIndexd (GLdouble c); +GLAPI void GLAPIENTRY glIndexdv (const GLdouble *c); +GLAPI void GLAPIENTRY glIndexf (GLfloat c); +GLAPI void GLAPIENTRY glIndexfv (const GLfloat *c); +GLAPI void GLAPIENTRY glIndexi (GLint c); +GLAPI void GLAPIENTRY glIndexiv (const GLint *c); +GLAPI void GLAPIENTRY glIndexs (GLshort c); +GLAPI void GLAPIENTRY glIndexsv (const GLshort *c); +GLAPI void GLAPIENTRY glIndexub (GLubyte c); +GLAPI void GLAPIENTRY glIndexubv (const GLubyte *c); +GLAPI void GLAPIENTRY glInitNames (void); +GLAPI void GLAPIENTRY glInterleavedArrays (GLenum format, GLsizei stride, const GLvoid *pointer); +GLAPI GLboolean GLAPIENTRY glIsEnabled (GLenum cap); +GLAPI GLboolean GLAPIENTRY glIsList (GLuint list); +GLAPI GLboolean GLAPIENTRY glIsTexture (GLuint texture); +GLAPI void GLAPIENTRY glLightModelf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glLightModelfv (GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glLightModeli (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glLightModeliv (GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glLightf (GLenum light, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glLighti (GLenum light, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glLightiv (GLenum light, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glLineStipple (GLint factor, GLushort pattern); +GLAPI void GLAPIENTRY glLineWidth (GLfloat width); +GLAPI void GLAPIENTRY glListBase (GLuint base); +GLAPI void GLAPIENTRY glLoadIdentity (void); +GLAPI void GLAPIENTRY glLoadMatrixd (const GLdouble *m); +GLAPI void GLAPIENTRY glLoadMatrixf (const GLfloat *m); +GLAPI void GLAPIENTRY glLoadName (GLuint name); +GLAPI void GLAPIENTRY glLogicOp (GLenum opcode); +GLAPI void GLAPIENTRY glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +GLAPI void GLAPIENTRY glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +GLAPI void GLAPIENTRY glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +GLAPI void GLAPIENTRY glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +GLAPI void GLAPIENTRY glMapGrid1d (GLint un, GLdouble u1, GLdouble u2); +GLAPI void GLAPIENTRY glMapGrid1f (GLint un, GLfloat u1, GLfloat u2); +GLAPI void GLAPIENTRY glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); +GLAPI void GLAPIENTRY glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); +GLAPI void GLAPIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glMateriali (GLenum face, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glMaterialiv (GLenum face, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glMatrixMode (GLenum mode); +GLAPI void GLAPIENTRY glMultMatrixd (const GLdouble *m); +GLAPI void GLAPIENTRY glMultMatrixf (const GLfloat *m); +GLAPI void GLAPIENTRY glNewList (GLuint list, GLenum mode); +GLAPI void GLAPIENTRY glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz); +GLAPI void GLAPIENTRY glNormal3bv (const GLbyte *v); +GLAPI void GLAPIENTRY glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz); +GLAPI void GLAPIENTRY glNormal3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz); +GLAPI void GLAPIENTRY glNormal3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glNormal3i (GLint nx, GLint ny, GLint nz); +GLAPI void GLAPIENTRY glNormal3iv (const GLint *v); +GLAPI void GLAPIENTRY glNormal3s (GLshort nx, GLshort ny, GLshort nz); +GLAPI void GLAPIENTRY glNormal3sv (const GLshort *v); +GLAPI void GLAPIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void GLAPIENTRY glPassThrough (GLfloat token); +GLAPI void GLAPIENTRY glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat *values); +GLAPI void GLAPIENTRY glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint *values); +GLAPI void GLAPIENTRY glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort *values); +GLAPI void GLAPIENTRY glPixelStoref (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glPixelStorei (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glPixelTransferf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glPixelTransferi (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glPixelZoom (GLfloat xfactor, GLfloat yfactor); +GLAPI void GLAPIENTRY glPointSize (GLfloat size); +GLAPI void GLAPIENTRY glPolygonMode (GLenum face, GLenum mode); +GLAPI void GLAPIENTRY glPolygonOffset (GLfloat factor, GLfloat units); +GLAPI void GLAPIENTRY glPolygonStipple (const GLubyte *mask); +GLAPI void GLAPIENTRY glPopAttrib (void); +GLAPI void GLAPIENTRY glPopClientAttrib (void); +GLAPI void GLAPIENTRY glPopMatrix (void); +GLAPI void GLAPIENTRY glPopName (void); +GLAPI void GLAPIENTRY glPrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities); +GLAPI void GLAPIENTRY glPushAttrib (GLbitfield mask); +GLAPI void GLAPIENTRY glPushClientAttrib (GLbitfield mask); +GLAPI void GLAPIENTRY glPushMatrix (void); +GLAPI void GLAPIENTRY glPushName (GLuint name); +GLAPI void GLAPIENTRY glRasterPos2d (GLdouble x, GLdouble y); +GLAPI void GLAPIENTRY glRasterPos2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos2f (GLfloat x, GLfloat y); +GLAPI void GLAPIENTRY glRasterPos2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos2i (GLint x, GLint y); +GLAPI void GLAPIENTRY glRasterPos2iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos2s (GLshort x, GLshort y); +GLAPI void GLAPIENTRY glRasterPos2sv (const GLshort *v); +GLAPI void GLAPIENTRY glRasterPos3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glRasterPos3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glRasterPos3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos3i (GLint x, GLint y, GLint z); +GLAPI void GLAPIENTRY glRasterPos3iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos3s (GLshort x, GLshort y, GLshort z); +GLAPI void GLAPIENTRY glRasterPos3sv (const GLshort *v); +GLAPI void GLAPIENTRY glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glRasterPos4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glRasterPos4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos4i (GLint x, GLint y, GLint z, GLint w); +GLAPI void GLAPIENTRY glRasterPos4iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void GLAPIENTRY glRasterPos4sv (const GLshort *v); +GLAPI void GLAPIENTRY glReadBuffer (GLenum mode); +GLAPI void GLAPIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void GLAPIENTRY glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); +GLAPI void GLAPIENTRY glRectdv (const GLdouble *v1, const GLdouble *v2); +GLAPI void GLAPIENTRY glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); +GLAPI void GLAPIENTRY glRectfv (const GLfloat *v1, const GLfloat *v2); +GLAPI void GLAPIENTRY glRecti (GLint x1, GLint y1, GLint x2, GLint y2); +GLAPI void GLAPIENTRY glRectiv (const GLint *v1, const GLint *v2); +GLAPI void GLAPIENTRY glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2); +GLAPI void GLAPIENTRY glRectsv (const GLshort *v1, const GLshort *v2); +GLAPI GLint GLAPIENTRY glRenderMode (GLenum mode); +GLAPI void GLAPIENTRY glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glScaled (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void GLAPIENTRY glSelectBuffer (GLsizei size, GLuint *buffer); +GLAPI void GLAPIENTRY glShadeModel (GLenum mode); +GLAPI void GLAPIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); +GLAPI void GLAPIENTRY glStencilMask (GLuint mask); +GLAPI void GLAPIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); +GLAPI void GLAPIENTRY glTexCoord1d (GLdouble s); +GLAPI void GLAPIENTRY glTexCoord1dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord1f (GLfloat s); +GLAPI void GLAPIENTRY glTexCoord1fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord1i (GLint s); +GLAPI void GLAPIENTRY glTexCoord1iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord1s (GLshort s); +GLAPI void GLAPIENTRY glTexCoord1sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord2d (GLdouble s, GLdouble t); +GLAPI void GLAPIENTRY glTexCoord2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord2f (GLfloat s, GLfloat t); +GLAPI void GLAPIENTRY glTexCoord2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord2i (GLint s, GLint t); +GLAPI void GLAPIENTRY glTexCoord2iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord2s (GLshort s, GLshort t); +GLAPI void GLAPIENTRY glTexCoord2sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord3d (GLdouble s, GLdouble t, GLdouble r); +GLAPI void GLAPIENTRY glTexCoord3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord3f (GLfloat s, GLfloat t, GLfloat r); +GLAPI void GLAPIENTRY glTexCoord3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord3i (GLint s, GLint t, GLint r); +GLAPI void GLAPIENTRY glTexCoord3iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord3s (GLshort s, GLshort t, GLshort r); +GLAPI void GLAPIENTRY glTexCoord3sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void GLAPIENTRY glTexCoord4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void GLAPIENTRY glTexCoord4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord4i (GLint s, GLint t, GLint r, GLint q); +GLAPI void GLAPIENTRY glTexCoord4iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void GLAPIENTRY glTexCoord4sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexGend (GLenum coord, GLenum pname, GLdouble param); +GLAPI void GLAPIENTRY glTexGendv (GLenum coord, GLenum pname, const GLdouble *params); +GLAPI void GLAPIENTRY glTexGenf (GLenum coord, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexGeni (GLenum coord, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexGeniv (GLenum coord, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTranslated (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glVertex2d (GLdouble x, GLdouble y); +GLAPI void GLAPIENTRY glVertex2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex2f (GLfloat x, GLfloat y); +GLAPI void GLAPIENTRY glVertex2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex2i (GLint x, GLint y); +GLAPI void GLAPIENTRY glVertex2iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex2s (GLshort x, GLshort y); +GLAPI void GLAPIENTRY glVertex2sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertex3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glVertex3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glVertex3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex3i (GLint x, GLint y, GLint z); +GLAPI void GLAPIENTRY glVertex3iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex3s (GLshort x, GLshort y, GLshort z); +GLAPI void GLAPIENTRY glVertex3sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glVertex4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glVertex4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex4i (GLint x, GLint y, GLint z, GLint w); +GLAPI void GLAPIENTRY glVertex4iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void GLAPIENTRY glVertex4sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); + +#define GLEW_VERSION_1_1 GLEW_GET_VAR(__GLEW_VERSION_1_1) + +#endif /* GL_VERSION_1_1 */ + +/* ---------------------------------- GLU ---------------------------------- */ + +/* this is where we can safely include GLU */ +#if defined(__APPLE__) && defined(__MACH__) +#include +#else +#include +#endif + +/* ----------------------------- GL_VERSION_1_2 ---------------------------- */ + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 + +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_RESCALE_NORMAL 0x803A +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E + +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); + +#define glCopyTexSubImage3D GLEW_GET_FUN(__glewCopyTexSubImage3D) +#define glDrawRangeElements GLEW_GET_FUN(__glewDrawRangeElements) +#define glTexImage3D GLEW_GET_FUN(__glewTexImage3D) +#define glTexSubImage3D GLEW_GET_FUN(__glewTexSubImage3D) + +#define GLEW_VERSION_1_2 GLEW_GET_VAR(__GLEW_VERSION_1_2) + +#endif /* GL_VERSION_1_2 */ + +/* ----------------------------- GL_VERSION_1_3 ---------------------------- */ + +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 + +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_SUBTRACT 0x84E7 +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +#define GL_MULTISAMPLE_BIT 0x20000000 + +typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLvoid *img); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); + +#define glActiveTexture GLEW_GET_FUN(__glewActiveTexture) +#define glClientActiveTexture GLEW_GET_FUN(__glewClientActiveTexture) +#define glCompressedTexImage1D GLEW_GET_FUN(__glewCompressedTexImage1D) +#define glCompressedTexImage2D GLEW_GET_FUN(__glewCompressedTexImage2D) +#define glCompressedTexImage3D GLEW_GET_FUN(__glewCompressedTexImage3D) +#define glCompressedTexSubImage1D GLEW_GET_FUN(__glewCompressedTexSubImage1D) +#define glCompressedTexSubImage2D GLEW_GET_FUN(__glewCompressedTexSubImage2D) +#define glCompressedTexSubImage3D GLEW_GET_FUN(__glewCompressedTexSubImage3D) +#define glGetCompressedTexImage GLEW_GET_FUN(__glewGetCompressedTexImage) +#define glLoadTransposeMatrixd GLEW_GET_FUN(__glewLoadTransposeMatrixd) +#define glLoadTransposeMatrixf GLEW_GET_FUN(__glewLoadTransposeMatrixf) +#define glMultTransposeMatrixd GLEW_GET_FUN(__glewMultTransposeMatrixd) +#define glMultTransposeMatrixf GLEW_GET_FUN(__glewMultTransposeMatrixf) +#define glMultiTexCoord1d GLEW_GET_FUN(__glewMultiTexCoord1d) +#define glMultiTexCoord1dv GLEW_GET_FUN(__glewMultiTexCoord1dv) +#define glMultiTexCoord1f GLEW_GET_FUN(__glewMultiTexCoord1f) +#define glMultiTexCoord1fv GLEW_GET_FUN(__glewMultiTexCoord1fv) +#define glMultiTexCoord1i GLEW_GET_FUN(__glewMultiTexCoord1i) +#define glMultiTexCoord1iv GLEW_GET_FUN(__glewMultiTexCoord1iv) +#define glMultiTexCoord1s GLEW_GET_FUN(__glewMultiTexCoord1s) +#define glMultiTexCoord1sv GLEW_GET_FUN(__glewMultiTexCoord1sv) +#define glMultiTexCoord2d GLEW_GET_FUN(__glewMultiTexCoord2d) +#define glMultiTexCoord2dv GLEW_GET_FUN(__glewMultiTexCoord2dv) +#define glMultiTexCoord2f GLEW_GET_FUN(__glewMultiTexCoord2f) +#define glMultiTexCoord2fv GLEW_GET_FUN(__glewMultiTexCoord2fv) +#define glMultiTexCoord2i GLEW_GET_FUN(__glewMultiTexCoord2i) +#define glMultiTexCoord2iv GLEW_GET_FUN(__glewMultiTexCoord2iv) +#define glMultiTexCoord2s GLEW_GET_FUN(__glewMultiTexCoord2s) +#define glMultiTexCoord2sv GLEW_GET_FUN(__glewMultiTexCoord2sv) +#define glMultiTexCoord3d GLEW_GET_FUN(__glewMultiTexCoord3d) +#define glMultiTexCoord3dv GLEW_GET_FUN(__glewMultiTexCoord3dv) +#define glMultiTexCoord3f GLEW_GET_FUN(__glewMultiTexCoord3f) +#define glMultiTexCoord3fv GLEW_GET_FUN(__glewMultiTexCoord3fv) +#define glMultiTexCoord3i GLEW_GET_FUN(__glewMultiTexCoord3i) +#define glMultiTexCoord3iv GLEW_GET_FUN(__glewMultiTexCoord3iv) +#define glMultiTexCoord3s GLEW_GET_FUN(__glewMultiTexCoord3s) +#define glMultiTexCoord3sv GLEW_GET_FUN(__glewMultiTexCoord3sv) +#define glMultiTexCoord4d GLEW_GET_FUN(__glewMultiTexCoord4d) +#define glMultiTexCoord4dv GLEW_GET_FUN(__glewMultiTexCoord4dv) +#define glMultiTexCoord4f GLEW_GET_FUN(__glewMultiTexCoord4f) +#define glMultiTexCoord4fv GLEW_GET_FUN(__glewMultiTexCoord4fv) +#define glMultiTexCoord4i GLEW_GET_FUN(__glewMultiTexCoord4i) +#define glMultiTexCoord4iv GLEW_GET_FUN(__glewMultiTexCoord4iv) +#define glMultiTexCoord4s GLEW_GET_FUN(__glewMultiTexCoord4s) +#define glMultiTexCoord4sv GLEW_GET_FUN(__glewMultiTexCoord4sv) +#define glSampleCoverage GLEW_GET_FUN(__glewSampleCoverage) + +#define GLEW_VERSION_1_3 GLEW_GET_VAR(__GLEW_VERSION_1_3) + +#endif /* GL_VERSION_1_3 */ + +/* ----------------------------- GL_VERSION_1_4 ---------------------------- */ + +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 + +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#define GL_COMPARE_R_TO_TEXTURE 0x884E + +typedef void (GLAPIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDPROC) (GLdouble coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDVPROC) (const GLdouble *coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFPROC) (GLfloat coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFVPROC) (const GLfloat *coord); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVPROC) (GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVPROC) (const GLdouble *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVPROC) (const GLfloat *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVPROC) (const GLint *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVPROC) (const GLshort *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVPROC) (const GLdouble *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVPROC) (const GLfloat *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVPROC) (const GLint *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVPROC) (const GLshort *p); + +#define glBlendColor GLEW_GET_FUN(__glewBlendColor) +#define glBlendEquation GLEW_GET_FUN(__glewBlendEquation) +#define glBlendFuncSeparate GLEW_GET_FUN(__glewBlendFuncSeparate) +#define glFogCoordPointer GLEW_GET_FUN(__glewFogCoordPointer) +#define glFogCoordd GLEW_GET_FUN(__glewFogCoordd) +#define glFogCoorddv GLEW_GET_FUN(__glewFogCoorddv) +#define glFogCoordf GLEW_GET_FUN(__glewFogCoordf) +#define glFogCoordfv GLEW_GET_FUN(__glewFogCoordfv) +#define glMultiDrawArrays GLEW_GET_FUN(__glewMultiDrawArrays) +#define glMultiDrawElements GLEW_GET_FUN(__glewMultiDrawElements) +#define glPointParameterf GLEW_GET_FUN(__glewPointParameterf) +#define glPointParameterfv GLEW_GET_FUN(__glewPointParameterfv) +#define glSecondaryColor3b GLEW_GET_FUN(__glewSecondaryColor3b) +#define glSecondaryColor3bv GLEW_GET_FUN(__glewSecondaryColor3bv) +#define glSecondaryColor3d GLEW_GET_FUN(__glewSecondaryColor3d) +#define glSecondaryColor3dv GLEW_GET_FUN(__glewSecondaryColor3dv) +#define glSecondaryColor3f GLEW_GET_FUN(__glewSecondaryColor3f) +#define glSecondaryColor3fv GLEW_GET_FUN(__glewSecondaryColor3fv) +#define glSecondaryColor3i GLEW_GET_FUN(__glewSecondaryColor3i) +#define glSecondaryColor3iv GLEW_GET_FUN(__glewSecondaryColor3iv) +#define glSecondaryColor3s GLEW_GET_FUN(__glewSecondaryColor3s) +#define glSecondaryColor3sv GLEW_GET_FUN(__glewSecondaryColor3sv) +#define glSecondaryColor3ub GLEW_GET_FUN(__glewSecondaryColor3ub) +#define glSecondaryColor3ubv GLEW_GET_FUN(__glewSecondaryColor3ubv) +#define glSecondaryColor3ui GLEW_GET_FUN(__glewSecondaryColor3ui) +#define glSecondaryColor3uiv GLEW_GET_FUN(__glewSecondaryColor3uiv) +#define glSecondaryColor3us GLEW_GET_FUN(__glewSecondaryColor3us) +#define glSecondaryColor3usv GLEW_GET_FUN(__glewSecondaryColor3usv) +#define glSecondaryColorPointer GLEW_GET_FUN(__glewSecondaryColorPointer) +#define glWindowPos2d GLEW_GET_FUN(__glewWindowPos2d) +#define glWindowPos2dv GLEW_GET_FUN(__glewWindowPos2dv) +#define glWindowPos2f GLEW_GET_FUN(__glewWindowPos2f) +#define glWindowPos2fv GLEW_GET_FUN(__glewWindowPos2fv) +#define glWindowPos2i GLEW_GET_FUN(__glewWindowPos2i) +#define glWindowPos2iv GLEW_GET_FUN(__glewWindowPos2iv) +#define glWindowPos2s GLEW_GET_FUN(__glewWindowPos2s) +#define glWindowPos2sv GLEW_GET_FUN(__glewWindowPos2sv) +#define glWindowPos3d GLEW_GET_FUN(__glewWindowPos3d) +#define glWindowPos3dv GLEW_GET_FUN(__glewWindowPos3dv) +#define glWindowPos3f GLEW_GET_FUN(__glewWindowPos3f) +#define glWindowPos3fv GLEW_GET_FUN(__glewWindowPos3fv) +#define glWindowPos3i GLEW_GET_FUN(__glewWindowPos3i) +#define glWindowPos3iv GLEW_GET_FUN(__glewWindowPos3iv) +#define glWindowPos3s GLEW_GET_FUN(__glewWindowPos3s) +#define glWindowPos3sv GLEW_GET_FUN(__glewWindowPos3sv) + +#define GLEW_VERSION_1_4 GLEW_GET_VAR(__GLEW_VERSION_1_4) + +#endif /* GL_VERSION_1_4 */ + +/* ----------------------------- GL_VERSION_1_5 ---------------------------- */ + +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 + +#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE +#define GL_FOG_COORD GL_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY +#define GL_SRC0_RGB GL_SOURCE0_RGB +#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER +#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE +#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA +#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE +#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA +#define GL_SRC1_RGB GL_SOURCE1_RGB +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING +#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA +#define GL_SRC2_RGB GL_SOURCE2_RGB +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 + +typedef ptrdiff_t GLsizeiptr; +typedef ptrdiff_t GLintptr; + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENBUFFERSPROC) (GLsizei n, GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGENQUERIESPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid* data); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERPROC) (GLuint buffer); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYPROC) (GLuint id); +typedef GLvoid* (GLAPIENTRY * PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERPROC) (GLenum target); + +#define glBeginQuery GLEW_GET_FUN(__glewBeginQuery) +#define glBindBuffer GLEW_GET_FUN(__glewBindBuffer) +#define glBufferData GLEW_GET_FUN(__glewBufferData) +#define glBufferSubData GLEW_GET_FUN(__glewBufferSubData) +#define glDeleteBuffers GLEW_GET_FUN(__glewDeleteBuffers) +#define glDeleteQueries GLEW_GET_FUN(__glewDeleteQueries) +#define glEndQuery GLEW_GET_FUN(__glewEndQuery) +#define glGenBuffers GLEW_GET_FUN(__glewGenBuffers) +#define glGenQueries GLEW_GET_FUN(__glewGenQueries) +#define glGetBufferParameteriv GLEW_GET_FUN(__glewGetBufferParameteriv) +#define glGetBufferPointerv GLEW_GET_FUN(__glewGetBufferPointerv) +#define glGetBufferSubData GLEW_GET_FUN(__glewGetBufferSubData) +#define glGetQueryObjectiv GLEW_GET_FUN(__glewGetQueryObjectiv) +#define glGetQueryObjectuiv GLEW_GET_FUN(__glewGetQueryObjectuiv) +#define glGetQueryiv GLEW_GET_FUN(__glewGetQueryiv) +#define glIsBuffer GLEW_GET_FUN(__glewIsBuffer) +#define glIsQuery GLEW_GET_FUN(__glewIsQuery) +#define glMapBuffer GLEW_GET_FUN(__glewMapBuffer) +#define glUnmapBuffer GLEW_GET_FUN(__glewUnmapBuffer) + +#define GLEW_VERSION_1_5 GLEW_GET_VAR(__GLEW_VERSION_1_5) + +#endif /* GL_VERSION_1_5 */ + +/* ----------------------------- GL_VERSION_2_0 ---------------------------- */ + +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 + +#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_COORDS 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 + +typedef char GLchar; + +typedef void (GLAPIENTRY * PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum, GLenum); +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef GLuint (GLAPIENTRY * PFNGLCREATEPROGRAMPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROC) (GLenum type); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (GLAPIENTRY * PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint); +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum* bufs); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint); +typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders); +typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog); +typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEPROC) (GLint obj, GLsizei maxLength, GLsizei* length, GLchar* source); +typedef void (GLAPIENTRY * PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint* param); +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONPROC) (GLint programObj, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint, GLenum, GLvoid*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVPROC) (GLuint, GLenum, GLdouble*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVPROC) (GLuint, GLenum, GLfloat*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVPROC) (GLuint, GLenum, GLint*); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (GLAPIENTRY * PFNGLISSHADERPROC) (GLuint shader); +typedef void (GLAPIENTRY * PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar** strings, const GLint* lengths); +typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILMASKSEPARATEPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IPROC) (GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* pointer); + +#define glAttachShader GLEW_GET_FUN(__glewAttachShader) +#define glBindAttribLocation GLEW_GET_FUN(__glewBindAttribLocation) +#define glBlendEquationSeparate GLEW_GET_FUN(__glewBlendEquationSeparate) +#define glCompileShader GLEW_GET_FUN(__glewCompileShader) +#define glCreateProgram GLEW_GET_FUN(__glewCreateProgram) +#define glCreateShader GLEW_GET_FUN(__glewCreateShader) +#define glDeleteProgram GLEW_GET_FUN(__glewDeleteProgram) +#define glDeleteShader GLEW_GET_FUN(__glewDeleteShader) +#define glDetachShader GLEW_GET_FUN(__glewDetachShader) +#define glDisableVertexAttribArray GLEW_GET_FUN(__glewDisableVertexAttribArray) +#define glDrawBuffers GLEW_GET_FUN(__glewDrawBuffers) +#define glEnableVertexAttribArray GLEW_GET_FUN(__glewEnableVertexAttribArray) +#define glGetActiveAttrib GLEW_GET_FUN(__glewGetActiveAttrib) +#define glGetActiveUniform GLEW_GET_FUN(__glewGetActiveUniform) +#define glGetAttachedShaders GLEW_GET_FUN(__glewGetAttachedShaders) +#define glGetAttribLocation GLEW_GET_FUN(__glewGetAttribLocation) +#define glGetProgramInfoLog GLEW_GET_FUN(__glewGetProgramInfoLog) +#define glGetProgramiv GLEW_GET_FUN(__glewGetProgramiv) +#define glGetShaderInfoLog GLEW_GET_FUN(__glewGetShaderInfoLog) +#define glGetShaderSource GLEW_GET_FUN(__glewGetShaderSource) +#define glGetShaderiv GLEW_GET_FUN(__glewGetShaderiv) +#define glGetUniformLocation GLEW_GET_FUN(__glewGetUniformLocation) +#define glGetUniformfv GLEW_GET_FUN(__glewGetUniformfv) +#define glGetUniformiv GLEW_GET_FUN(__glewGetUniformiv) +#define glGetVertexAttribPointerv GLEW_GET_FUN(__glewGetVertexAttribPointerv) +#define glGetVertexAttribdv GLEW_GET_FUN(__glewGetVertexAttribdv) +#define glGetVertexAttribfv GLEW_GET_FUN(__glewGetVertexAttribfv) +#define glGetVertexAttribiv GLEW_GET_FUN(__glewGetVertexAttribiv) +#define glIsProgram GLEW_GET_FUN(__glewIsProgram) +#define glIsShader GLEW_GET_FUN(__glewIsShader) +#define glLinkProgram GLEW_GET_FUN(__glewLinkProgram) +#define glShaderSource GLEW_GET_FUN(__glewShaderSource) +#define glStencilFuncSeparate GLEW_GET_FUN(__glewStencilFuncSeparate) +#define glStencilMaskSeparate GLEW_GET_FUN(__glewStencilMaskSeparate) +#define glStencilOpSeparate GLEW_GET_FUN(__glewStencilOpSeparate) +#define glUniform1f GLEW_GET_FUN(__glewUniform1f) +#define glUniform1fv GLEW_GET_FUN(__glewUniform1fv) +#define glUniform1i GLEW_GET_FUN(__glewUniform1i) +#define glUniform1iv GLEW_GET_FUN(__glewUniform1iv) +#define glUniform2f GLEW_GET_FUN(__glewUniform2f) +#define glUniform2fv GLEW_GET_FUN(__glewUniform2fv) +#define glUniform2i GLEW_GET_FUN(__glewUniform2i) +#define glUniform2iv GLEW_GET_FUN(__glewUniform2iv) +#define glUniform3f GLEW_GET_FUN(__glewUniform3f) +#define glUniform3fv GLEW_GET_FUN(__glewUniform3fv) +#define glUniform3i GLEW_GET_FUN(__glewUniform3i) +#define glUniform3iv GLEW_GET_FUN(__glewUniform3iv) +#define glUniform4f GLEW_GET_FUN(__glewUniform4f) +#define glUniform4fv GLEW_GET_FUN(__glewUniform4fv) +#define glUniform4i GLEW_GET_FUN(__glewUniform4i) +#define glUniform4iv GLEW_GET_FUN(__glewUniform4iv) +#define glUniformMatrix2fv GLEW_GET_FUN(__glewUniformMatrix2fv) +#define glUniformMatrix3fv GLEW_GET_FUN(__glewUniformMatrix3fv) +#define glUniformMatrix4fv GLEW_GET_FUN(__glewUniformMatrix4fv) +#define glUseProgram GLEW_GET_FUN(__glewUseProgram) +#define glValidateProgram GLEW_GET_FUN(__glewValidateProgram) +#define glVertexAttrib1d GLEW_GET_FUN(__glewVertexAttrib1d) +#define glVertexAttrib1dv GLEW_GET_FUN(__glewVertexAttrib1dv) +#define glVertexAttrib1f GLEW_GET_FUN(__glewVertexAttrib1f) +#define glVertexAttrib1fv GLEW_GET_FUN(__glewVertexAttrib1fv) +#define glVertexAttrib1s GLEW_GET_FUN(__glewVertexAttrib1s) +#define glVertexAttrib1sv GLEW_GET_FUN(__glewVertexAttrib1sv) +#define glVertexAttrib2d GLEW_GET_FUN(__glewVertexAttrib2d) +#define glVertexAttrib2dv GLEW_GET_FUN(__glewVertexAttrib2dv) +#define glVertexAttrib2f GLEW_GET_FUN(__glewVertexAttrib2f) +#define glVertexAttrib2fv GLEW_GET_FUN(__glewVertexAttrib2fv) +#define glVertexAttrib2s GLEW_GET_FUN(__glewVertexAttrib2s) +#define glVertexAttrib2sv GLEW_GET_FUN(__glewVertexAttrib2sv) +#define glVertexAttrib3d GLEW_GET_FUN(__glewVertexAttrib3d) +#define glVertexAttrib3dv GLEW_GET_FUN(__glewVertexAttrib3dv) +#define glVertexAttrib3f GLEW_GET_FUN(__glewVertexAttrib3f) +#define glVertexAttrib3fv GLEW_GET_FUN(__glewVertexAttrib3fv) +#define glVertexAttrib3s GLEW_GET_FUN(__glewVertexAttrib3s) +#define glVertexAttrib3sv GLEW_GET_FUN(__glewVertexAttrib3sv) +#define glVertexAttrib4Nbv GLEW_GET_FUN(__glewVertexAttrib4Nbv) +#define glVertexAttrib4Niv GLEW_GET_FUN(__glewVertexAttrib4Niv) +#define glVertexAttrib4Nsv GLEW_GET_FUN(__glewVertexAttrib4Nsv) +#define glVertexAttrib4Nub GLEW_GET_FUN(__glewVertexAttrib4Nub) +#define glVertexAttrib4Nubv GLEW_GET_FUN(__glewVertexAttrib4Nubv) +#define glVertexAttrib4Nuiv GLEW_GET_FUN(__glewVertexAttrib4Nuiv) +#define glVertexAttrib4Nusv GLEW_GET_FUN(__glewVertexAttrib4Nusv) +#define glVertexAttrib4bv GLEW_GET_FUN(__glewVertexAttrib4bv) +#define glVertexAttrib4d GLEW_GET_FUN(__glewVertexAttrib4d) +#define glVertexAttrib4dv GLEW_GET_FUN(__glewVertexAttrib4dv) +#define glVertexAttrib4f GLEW_GET_FUN(__glewVertexAttrib4f) +#define glVertexAttrib4fv GLEW_GET_FUN(__glewVertexAttrib4fv) +#define glVertexAttrib4iv GLEW_GET_FUN(__glewVertexAttrib4iv) +#define glVertexAttrib4s GLEW_GET_FUN(__glewVertexAttrib4s) +#define glVertexAttrib4sv GLEW_GET_FUN(__glewVertexAttrib4sv) +#define glVertexAttrib4ubv GLEW_GET_FUN(__glewVertexAttrib4ubv) +#define glVertexAttrib4uiv GLEW_GET_FUN(__glewVertexAttrib4uiv) +#define glVertexAttrib4usv GLEW_GET_FUN(__glewVertexAttrib4usv) +#define glVertexAttribPointer GLEW_GET_FUN(__glewVertexAttribPointer) + +#define GLEW_VERSION_2_0 GLEW_GET_VAR(__GLEW_VERSION_2_0) + +#endif /* GL_VERSION_2_0 */ + +/* -------------------------- GL_3DFX_multisample -------------------------- */ + +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 + +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 + +#define GLEW_3DFX_multisample GLEW_GET_VAR(__GLEW_3DFX_multisample) + +#endif /* GL_3DFX_multisample */ + +/* ---------------------------- GL_3DFX_tbuffer ---------------------------- */ + +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 + +typedef void (GLAPIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); + +#define glTbufferMask3DFX GLEW_GET_FUN(__glewTbufferMask3DFX) + +#define GLEW_3DFX_tbuffer GLEW_GET_VAR(__GLEW_3DFX_tbuffer) + +#endif /* GL_3DFX_tbuffer */ + +/* -------------------- GL_3DFX_texture_compression_FXT1 ------------------- */ + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 + +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 + +#define GLEW_3DFX_texture_compression_FXT1 GLEW_GET_VAR(__GLEW_3DFX_texture_compression_FXT1) + +#endif /* GL_3DFX_texture_compression_FXT1 */ + +/* ------------------------ GL_APPLE_client_storage ------------------------ */ + +#ifndef GL_APPLE_client_storage +#define GL_APPLE_client_storage 1 + +#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 + +#define GLEW_APPLE_client_storage GLEW_GET_VAR(__GLEW_APPLE_client_storage) + +#endif /* GL_APPLE_client_storage */ + +/* ------------------------- GL_APPLE_element_array ------------------------ */ + +#ifndef GL_APPLE_element_array +#define GL_APPLE_element_array 1 + +#define GL_ELEMENT_ARRAY_APPLE 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const void* pointer); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint* first, const GLsizei *count, GLsizei primcount); + +#define glDrawElementArrayAPPLE GLEW_GET_FUN(__glewDrawElementArrayAPPLE) +#define glDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewDrawRangeElementArrayAPPLE) +#define glElementPointerAPPLE GLEW_GET_FUN(__glewElementPointerAPPLE) +#define glMultiDrawElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawElementArrayAPPLE) +#define glMultiDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawRangeElementArrayAPPLE) + +#define GLEW_APPLE_element_array GLEW_GET_VAR(__GLEW_APPLE_element_array) + +#endif /* GL_APPLE_element_array */ + +/* ----------------------------- GL_APPLE_fence ---------------------------- */ + +#ifndef GL_APPLE_fence +#define GL_APPLE_fence 1 + +#define GL_DRAW_PIXELS_APPLE 0x8A0A +#define GL_FENCE_APPLE 0x8A0B + +typedef void (GLAPIENTRY * PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint* fences); +typedef void (GLAPIENTRY * PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); +typedef void (GLAPIENTRY * PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint* fences); +typedef GLboolean (GLAPIENTRY * PFNGLISFENCEAPPLEPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLSETFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (GLAPIENTRY * PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); + +#define glDeleteFencesAPPLE GLEW_GET_FUN(__glewDeleteFencesAPPLE) +#define glFinishFenceAPPLE GLEW_GET_FUN(__glewFinishFenceAPPLE) +#define glFinishObjectAPPLE GLEW_GET_FUN(__glewFinishObjectAPPLE) +#define glGenFencesAPPLE GLEW_GET_FUN(__glewGenFencesAPPLE) +#define glIsFenceAPPLE GLEW_GET_FUN(__glewIsFenceAPPLE) +#define glSetFenceAPPLE GLEW_GET_FUN(__glewSetFenceAPPLE) +#define glTestFenceAPPLE GLEW_GET_FUN(__glewTestFenceAPPLE) +#define glTestObjectAPPLE GLEW_GET_FUN(__glewTestObjectAPPLE) + +#define GLEW_APPLE_fence GLEW_GET_VAR(__GLEW_APPLE_fence) + +#endif /* GL_APPLE_fence */ + +/* ------------------------- GL_APPLE_float_pixels ------------------------- */ + +#ifndef GL_APPLE_float_pixels +#define GL_APPLE_float_pixels 1 + +#define GL_HALF_APPLE 0x140B +#define GL_RGBA_FLOAT32_APPLE 0x8814 +#define GL_RGB_FLOAT32_APPLE 0x8815 +#define GL_ALPHA_FLOAT32_APPLE 0x8816 +#define GL_INTENSITY_FLOAT32_APPLE 0x8817 +#define GL_LUMINANCE_FLOAT32_APPLE 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 +#define GL_RGBA_FLOAT16_APPLE 0x881A +#define GL_RGB_FLOAT16_APPLE 0x881B +#define GL_ALPHA_FLOAT16_APPLE 0x881C +#define GL_INTENSITY_FLOAT16_APPLE 0x881D +#define GL_LUMINANCE_FLOAT16_APPLE 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F +#define GL_COLOR_FLOAT_APPLE 0x8A0F + +#define GLEW_APPLE_float_pixels GLEW_GET_VAR(__GLEW_APPLE_float_pixels) + +#endif /* GL_APPLE_float_pixels */ + +/* ------------------------- GL_APPLE_pixel_buffer ------------------------- */ + +#ifndef GL_APPLE_pixel_buffer +#define GL_APPLE_pixel_buffer 1 + +#define GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE 0x8A10 + +#define GLEW_APPLE_pixel_buffer GLEW_GET_VAR(__GLEW_APPLE_pixel_buffer) + +#endif /* GL_APPLE_pixel_buffer */ + +/* ------------------------ GL_APPLE_specular_vector ----------------------- */ + +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 + +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 + +#define GLEW_APPLE_specular_vector GLEW_GET_VAR(__GLEW_APPLE_specular_vector) + +#endif /* GL_APPLE_specular_vector */ + +/* ------------------------- GL_APPLE_texture_range ------------------------ */ + +#ifndef GL_APPLE_texture_range +#define GL_APPLE_texture_range 1 + +#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 +#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 +#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC +#define GL_STORAGE_PRIVATE_APPLE 0x85BD +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF + +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid **params); +typedef void (GLAPIENTRY * PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, GLvoid *pointer); + +#define glGetTexParameterPointervAPPLE GLEW_GET_FUN(__glewGetTexParameterPointervAPPLE) +#define glTextureRangeAPPLE GLEW_GET_FUN(__glewTextureRangeAPPLE) + +#define GLEW_APPLE_texture_range GLEW_GET_VAR(__GLEW_APPLE_texture_range) + +#endif /* GL_APPLE_texture_range */ + +/* ------------------------ GL_APPLE_transform_hint ------------------------ */ + +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 + +#define GL_TRANSFORM_HINT_APPLE 0x85B1 + +#define GLEW_APPLE_transform_hint GLEW_GET_VAR(__GLEW_APPLE_transform_hint) + +#endif /* GL_APPLE_transform_hint */ + +/* ---------------------- GL_APPLE_vertex_array_object --------------------- */ + +#ifndef GL_APPLE_vertex_array_object +#define GL_APPLE_vertex_array_object 1 + +#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); + +#define glBindVertexArrayAPPLE GLEW_GET_FUN(__glewBindVertexArrayAPPLE) +#define glDeleteVertexArraysAPPLE GLEW_GET_FUN(__glewDeleteVertexArraysAPPLE) +#define glGenVertexArraysAPPLE GLEW_GET_FUN(__glewGenVertexArraysAPPLE) +#define glIsVertexArrayAPPLE GLEW_GET_FUN(__glewIsVertexArrayAPPLE) + +#define GLEW_APPLE_vertex_array_object GLEW_GET_VAR(__GLEW_APPLE_vertex_array_object) + +#endif /* GL_APPLE_vertex_array_object */ + +/* ---------------------- GL_APPLE_vertex_array_range ---------------------- */ + +#ifndef GL_APPLE_vertex_array_range +#define GL_APPLE_vertex_array_range 1 + +#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E +#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF + +typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void* pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void* pointer); + +#define glFlushVertexArrayRangeAPPLE GLEW_GET_FUN(__glewFlushVertexArrayRangeAPPLE) +#define glVertexArrayParameteriAPPLE GLEW_GET_FUN(__glewVertexArrayParameteriAPPLE) +#define glVertexArrayRangeAPPLE GLEW_GET_FUN(__glewVertexArrayRangeAPPLE) + +#define GLEW_APPLE_vertex_array_range GLEW_GET_VAR(__GLEW_APPLE_vertex_array_range) + +#endif /* GL_APPLE_vertex_array_range */ + +/* --------------------------- GL_APPLE_ycbcr_422 -------------------------- */ + +#ifndef GL_APPLE_ycbcr_422 +#define GL_APPLE_ycbcr_422 1 + +#define GL_YCBCR_422_APPLE 0x85B9 +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB + +#define GLEW_APPLE_ycbcr_422 GLEW_GET_VAR(__GLEW_APPLE_ycbcr_422) + +#endif /* GL_APPLE_ycbcr_422 */ + +/* ----------------------- GL_ARB_color_buffer_float ----------------------- */ + +#ifndef GL_ARB_color_buffer_float +#define GL_ARB_color_buffer_float 1 + +#define GL_RGBA_FLOAT_MODE_ARB 0x8820 +#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A +#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B +#define GL_CLAMP_READ_COLOR_ARB 0x891C +#define GL_FIXED_ONLY_ARB 0x891D + +typedef void (GLAPIENTRY * PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); + +#define glClampColorARB GLEW_GET_FUN(__glewClampColorARB) + +#define GLEW_ARB_color_buffer_float GLEW_GET_VAR(__GLEW_ARB_color_buffer_float) + +#endif /* GL_ARB_color_buffer_float */ + +/* -------------------------- GL_ARB_depth_texture ------------------------- */ + +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 + +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B + +#define GLEW_ARB_depth_texture GLEW_GET_VAR(__GLEW_ARB_depth_texture) + +#endif /* GL_ARB_depth_texture */ + +/* -------------------------- GL_ARB_draw_buffers -------------------------- */ + +#ifndef GL_ARB_draw_buffers +#define GL_ARB_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 +#define GL_DRAW_BUFFER0_ARB 0x8825 +#define GL_DRAW_BUFFER1_ARB 0x8826 +#define GL_DRAW_BUFFER2_ARB 0x8827 +#define GL_DRAW_BUFFER3_ARB 0x8828 +#define GL_DRAW_BUFFER4_ARB 0x8829 +#define GL_DRAW_BUFFER5_ARB 0x882A +#define GL_DRAW_BUFFER6_ARB 0x882B +#define GL_DRAW_BUFFER7_ARB 0x882C +#define GL_DRAW_BUFFER8_ARB 0x882D +#define GL_DRAW_BUFFER9_ARB 0x882E +#define GL_DRAW_BUFFER10_ARB 0x882F +#define GL_DRAW_BUFFER11_ARB 0x8830 +#define GL_DRAW_BUFFER12_ARB 0x8831 +#define GL_DRAW_BUFFER13_ARB 0x8832 +#define GL_DRAW_BUFFER14_ARB 0x8833 +#define GL_DRAW_BUFFER15_ARB 0x8834 + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersARB GLEW_GET_FUN(__glewDrawBuffersARB) + +#define GLEW_ARB_draw_buffers GLEW_GET_VAR(__GLEW_ARB_draw_buffers) + +#endif /* GL_ARB_draw_buffers */ + +/* ------------------------ GL_ARB_fragment_program ------------------------ */ + +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 + +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 + +#define GLEW_ARB_fragment_program GLEW_GET_VAR(__GLEW_ARB_fragment_program) + +#endif /* GL_ARB_fragment_program */ + +/* --------------------- GL_ARB_fragment_program_shadow -------------------- */ + +#ifndef GL_ARB_fragment_program_shadow +#define GL_ARB_fragment_program_shadow 1 + +#define GLEW_ARB_fragment_program_shadow GLEW_GET_VAR(__GLEW_ARB_fragment_program_shadow) + +#endif /* GL_ARB_fragment_program_shadow */ + +/* ------------------------- GL_ARB_fragment_shader ------------------------ */ + +#ifndef GL_ARB_fragment_shader +#define GL_ARB_fragment_shader 1 + +#define GL_FRAGMENT_SHADER_ARB 0x8B30 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B + +#define GLEW_ARB_fragment_shader GLEW_GET_VAR(__GLEW_ARB_fragment_shader) + +#endif /* GL_ARB_fragment_shader */ + +/* ------------------------ GL_ARB_half_float_pixel ------------------------ */ + +#ifndef GL_ARB_half_float_pixel +#define GL_ARB_half_float_pixel 1 + +#define GL_HALF_FLOAT_ARB 0x140B + +#define GLEW_ARB_half_float_pixel GLEW_GET_VAR(__GLEW_ARB_half_float_pixel) + +#endif /* GL_ARB_half_float_pixel */ + +/* ----------------------------- GL_ARB_imaging ---------------------------- */ + +#ifndef GL_ARB_imaging +#define GL_ARB_imaging 1 + +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 +#define GL_FUNC_ADD 0x8006 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_BLEND_EQUATION 0x8009 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_IGNORE_BORDER 0x8150 +#define GL_CONSTANT_BORDER 0x8151 +#define GL_WRAP_BORDER 0x8152 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 + +typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (GLAPIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLRESETMINMAXPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); + +#define glColorSubTable GLEW_GET_FUN(__glewColorSubTable) +#define glColorTable GLEW_GET_FUN(__glewColorTable) +#define glColorTableParameterfv GLEW_GET_FUN(__glewColorTableParameterfv) +#define glColorTableParameteriv GLEW_GET_FUN(__glewColorTableParameteriv) +#define glConvolutionFilter1D GLEW_GET_FUN(__glewConvolutionFilter1D) +#define glConvolutionFilter2D GLEW_GET_FUN(__glewConvolutionFilter2D) +#define glConvolutionParameterf GLEW_GET_FUN(__glewConvolutionParameterf) +#define glConvolutionParameterfv GLEW_GET_FUN(__glewConvolutionParameterfv) +#define glConvolutionParameteri GLEW_GET_FUN(__glewConvolutionParameteri) +#define glConvolutionParameteriv GLEW_GET_FUN(__glewConvolutionParameteriv) +#define glCopyColorSubTable GLEW_GET_FUN(__glewCopyColorSubTable) +#define glCopyColorTable GLEW_GET_FUN(__glewCopyColorTable) +#define glCopyConvolutionFilter1D GLEW_GET_FUN(__glewCopyConvolutionFilter1D) +#define glCopyConvolutionFilter2D GLEW_GET_FUN(__glewCopyConvolutionFilter2D) +#define glGetColorTable GLEW_GET_FUN(__glewGetColorTable) +#define glGetColorTableParameterfv GLEW_GET_FUN(__glewGetColorTableParameterfv) +#define glGetColorTableParameteriv GLEW_GET_FUN(__glewGetColorTableParameteriv) +#define glGetConvolutionFilter GLEW_GET_FUN(__glewGetConvolutionFilter) +#define glGetConvolutionParameterfv GLEW_GET_FUN(__glewGetConvolutionParameterfv) +#define glGetConvolutionParameteriv GLEW_GET_FUN(__glewGetConvolutionParameteriv) +#define glGetHistogram GLEW_GET_FUN(__glewGetHistogram) +#define glGetHistogramParameterfv GLEW_GET_FUN(__glewGetHistogramParameterfv) +#define glGetHistogramParameteriv GLEW_GET_FUN(__glewGetHistogramParameteriv) +#define glGetMinmax GLEW_GET_FUN(__glewGetMinmax) +#define glGetMinmaxParameterfv GLEW_GET_FUN(__glewGetMinmaxParameterfv) +#define glGetMinmaxParameteriv GLEW_GET_FUN(__glewGetMinmaxParameteriv) +#define glGetSeparableFilter GLEW_GET_FUN(__glewGetSeparableFilter) +#define glHistogram GLEW_GET_FUN(__glewHistogram) +#define glMinmax GLEW_GET_FUN(__glewMinmax) +#define glResetHistogram GLEW_GET_FUN(__glewResetHistogram) +#define glResetMinmax GLEW_GET_FUN(__glewResetMinmax) +#define glSeparableFilter2D GLEW_GET_FUN(__glewSeparableFilter2D) + +#define GLEW_ARB_imaging GLEW_GET_VAR(__GLEW_ARB_imaging) + +#endif /* GL_ARB_imaging */ + +/* ------------------------- GL_ARB_matrix_palette ------------------------- */ + +#ifndef GL_ARB_matrix_palette +#define GL_ARB_matrix_palette 1 + +#define GL_MATRIX_PALETTE_ARB 0x8840 +#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 +#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 +#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 +#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 +#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 +#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 + +typedef void (GLAPIENTRY * PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUBVARBPROC) (GLint size, GLubyte *indices); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUIVARBPROC) (GLint size, GLuint *indices); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUSVARBPROC) (GLint size, GLushort *indices); + +#define glCurrentPaletteMatrixARB GLEW_GET_FUN(__glewCurrentPaletteMatrixARB) +#define glMatrixIndexPointerARB GLEW_GET_FUN(__glewMatrixIndexPointerARB) +#define glMatrixIndexubvARB GLEW_GET_FUN(__glewMatrixIndexubvARB) +#define glMatrixIndexuivARB GLEW_GET_FUN(__glewMatrixIndexuivARB) +#define glMatrixIndexusvARB GLEW_GET_FUN(__glewMatrixIndexusvARB) + +#define GLEW_ARB_matrix_palette GLEW_GET_VAR(__GLEW_ARB_matrix_palette) + +#endif /* GL_ARB_matrix_palette */ + +/* --------------------------- GL_ARB_multisample -------------------------- */ + +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 + +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 + +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); + +#define glSampleCoverageARB GLEW_GET_FUN(__glewSampleCoverageARB) + +#define GLEW_ARB_multisample GLEW_GET_VAR(__GLEW_ARB_multisample) + +#endif /* GL_ARB_multisample */ + +/* -------------------------- GL_ARB_multitexture -------------------------- */ + +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 + +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 + +typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); + +#define glActiveTextureARB GLEW_GET_FUN(__glewActiveTextureARB) +#define glClientActiveTextureARB GLEW_GET_FUN(__glewClientActiveTextureARB) +#define glMultiTexCoord1dARB GLEW_GET_FUN(__glewMultiTexCoord1dARB) +#define glMultiTexCoord1dvARB GLEW_GET_FUN(__glewMultiTexCoord1dvARB) +#define glMultiTexCoord1fARB GLEW_GET_FUN(__glewMultiTexCoord1fARB) +#define glMultiTexCoord1fvARB GLEW_GET_FUN(__glewMultiTexCoord1fvARB) +#define glMultiTexCoord1iARB GLEW_GET_FUN(__glewMultiTexCoord1iARB) +#define glMultiTexCoord1ivARB GLEW_GET_FUN(__glewMultiTexCoord1ivARB) +#define glMultiTexCoord1sARB GLEW_GET_FUN(__glewMultiTexCoord1sARB) +#define glMultiTexCoord1svARB GLEW_GET_FUN(__glewMultiTexCoord1svARB) +#define glMultiTexCoord2dARB GLEW_GET_FUN(__glewMultiTexCoord2dARB) +#define glMultiTexCoord2dvARB GLEW_GET_FUN(__glewMultiTexCoord2dvARB) +#define glMultiTexCoord2fARB GLEW_GET_FUN(__glewMultiTexCoord2fARB) +#define glMultiTexCoord2fvARB GLEW_GET_FUN(__glewMultiTexCoord2fvARB) +#define glMultiTexCoord2iARB GLEW_GET_FUN(__glewMultiTexCoord2iARB) +#define glMultiTexCoord2ivARB GLEW_GET_FUN(__glewMultiTexCoord2ivARB) +#define glMultiTexCoord2sARB GLEW_GET_FUN(__glewMultiTexCoord2sARB) +#define glMultiTexCoord2svARB GLEW_GET_FUN(__glewMultiTexCoord2svARB) +#define glMultiTexCoord3dARB GLEW_GET_FUN(__glewMultiTexCoord3dARB) +#define glMultiTexCoord3dvARB GLEW_GET_FUN(__glewMultiTexCoord3dvARB) +#define glMultiTexCoord3fARB GLEW_GET_FUN(__glewMultiTexCoord3fARB) +#define glMultiTexCoord3fvARB GLEW_GET_FUN(__glewMultiTexCoord3fvARB) +#define glMultiTexCoord3iARB GLEW_GET_FUN(__glewMultiTexCoord3iARB) +#define glMultiTexCoord3ivARB GLEW_GET_FUN(__glewMultiTexCoord3ivARB) +#define glMultiTexCoord3sARB GLEW_GET_FUN(__glewMultiTexCoord3sARB) +#define glMultiTexCoord3svARB GLEW_GET_FUN(__glewMultiTexCoord3svARB) +#define glMultiTexCoord4dARB GLEW_GET_FUN(__glewMultiTexCoord4dARB) +#define glMultiTexCoord4dvARB GLEW_GET_FUN(__glewMultiTexCoord4dvARB) +#define glMultiTexCoord4fARB GLEW_GET_FUN(__glewMultiTexCoord4fARB) +#define glMultiTexCoord4fvARB GLEW_GET_FUN(__glewMultiTexCoord4fvARB) +#define glMultiTexCoord4iARB GLEW_GET_FUN(__glewMultiTexCoord4iARB) +#define glMultiTexCoord4ivARB GLEW_GET_FUN(__glewMultiTexCoord4ivARB) +#define glMultiTexCoord4sARB GLEW_GET_FUN(__glewMultiTexCoord4sARB) +#define glMultiTexCoord4svARB GLEW_GET_FUN(__glewMultiTexCoord4svARB) + +#define GLEW_ARB_multitexture GLEW_GET_VAR(__GLEW_ARB_multitexture) + +#endif /* GL_ARB_multitexture */ + +/* ------------------------- GL_ARB_occlusion_query ------------------------ */ + +#ifndef GL_ARB_occlusion_query +#define GL_ARB_occlusion_query 1 + +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 +#define GL_SAMPLES_PASSED_ARB 0x8914 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYARBPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYARBPROC) (GLuint id); + +#define glBeginQueryARB GLEW_GET_FUN(__glewBeginQueryARB) +#define glDeleteQueriesARB GLEW_GET_FUN(__glewDeleteQueriesARB) +#define glEndQueryARB GLEW_GET_FUN(__glewEndQueryARB) +#define glGenQueriesARB GLEW_GET_FUN(__glewGenQueriesARB) +#define glGetQueryObjectivARB GLEW_GET_FUN(__glewGetQueryObjectivARB) +#define glGetQueryObjectuivARB GLEW_GET_FUN(__glewGetQueryObjectuivARB) +#define glGetQueryivARB GLEW_GET_FUN(__glewGetQueryivARB) +#define glIsQueryARB GLEW_GET_FUN(__glewIsQueryARB) + +#define GLEW_ARB_occlusion_query GLEW_GET_VAR(__GLEW_ARB_occlusion_query) + +#endif /* GL_ARB_occlusion_query */ + +/* ----------------------- GL_ARB_pixel_buffer_object ---------------------- */ + +#ifndef GL_ARB_pixel_buffer_object +#define GL_ARB_pixel_buffer_object 1 + +#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF + +#define GLEW_ARB_pixel_buffer_object GLEW_GET_VAR(__GLEW_ARB_pixel_buffer_object) + +#endif /* GL_ARB_pixel_buffer_object */ + +/* ------------------------ GL_ARB_point_parameters ------------------------ */ + +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 + +#define GL_POINT_SIZE_MIN_ARB 0x8126 +#define GL_POINT_SIZE_MAX_ARB 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, GLfloat* params); + +#define glPointParameterfARB GLEW_GET_FUN(__glewPointParameterfARB) +#define glPointParameterfvARB GLEW_GET_FUN(__glewPointParameterfvARB) + +#define GLEW_ARB_point_parameters GLEW_GET_VAR(__GLEW_ARB_point_parameters) + +#endif /* GL_ARB_point_parameters */ + +/* -------------------------- GL_ARB_point_sprite -------------------------- */ + +#ifndef GL_ARB_point_sprite +#define GL_ARB_point_sprite 1 + +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 + +#define GLEW_ARB_point_sprite GLEW_GET_VAR(__GLEW_ARB_point_sprite) + +#endif /* GL_ARB_point_sprite */ + +/* ------------------------- GL_ARB_shader_objects ------------------------- */ + +#ifndef GL_ARB_shader_objects +#define GL_ARB_shader_objects 1 + +#define GL_PROGRAM_OBJECT_ARB 0x8B40 +#define GL_SHADER_OBJECT_ARB 0x8B48 +#define GL_OBJECT_TYPE_ARB 0x8B4E +#define GL_OBJECT_SUBTYPE_ARB 0x8B4F +#define GL_FLOAT_VEC2_ARB 0x8B50 +#define GL_FLOAT_VEC3_ARB 0x8B51 +#define GL_FLOAT_VEC4_ARB 0x8B52 +#define GL_INT_VEC2_ARB 0x8B53 +#define GL_INT_VEC3_ARB 0x8B54 +#define GL_INT_VEC4_ARB 0x8B55 +#define GL_BOOL_ARB 0x8B56 +#define GL_BOOL_VEC2_ARB 0x8B57 +#define GL_BOOL_VEC3_ARB 0x8B58 +#define GL_BOOL_VEC4_ARB 0x8B59 +#define GL_FLOAT_MAT2_ARB 0x8B5A +#define GL_FLOAT_MAT3_ARB 0x8B5B +#define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_SAMPLER_1D_ARB 0x8B5D +#define GL_SAMPLER_2D_ARB 0x8B5E +#define GL_SAMPLER_3D_ARB 0x8B5F +#define GL_SAMPLER_CUBE_ARB 0x8B60 +#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 +#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 +#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 +#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 +#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 +#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 +#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 +#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 +#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 +#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 +#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 + +typedef char GLcharARB; +typedef unsigned int GLhandleARB; + +typedef void (GLAPIENTRY * PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); +typedef GLhandleARB (GLAPIENTRY * PFNGLCREATEPROGRAMOBJECTARBPROC) (void); +typedef GLhandleARB (GLAPIENTRY * PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); +typedef void (GLAPIENTRY * PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); +typedef void (GLAPIENTRY * PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); +typedef void (GLAPIENTRY * PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei* count, GLhandleARB *obj); +typedef GLhandleARB (GLAPIENTRY * PFNGLGETHANDLEARBPROC) (GLenum pname); +typedef void (GLAPIENTRY * PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *infoLog); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *source); +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint* params); +typedef void (GLAPIENTRY * PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (GLAPIENTRY * PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint *length); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); + +#define glAttachObjectARB GLEW_GET_FUN(__glewAttachObjectARB) +#define glCompileShaderARB GLEW_GET_FUN(__glewCompileShaderARB) +#define glCreateProgramObjectARB GLEW_GET_FUN(__glewCreateProgramObjectARB) +#define glCreateShaderObjectARB GLEW_GET_FUN(__glewCreateShaderObjectARB) +#define glDeleteObjectARB GLEW_GET_FUN(__glewDeleteObjectARB) +#define glDetachObjectARB GLEW_GET_FUN(__glewDetachObjectARB) +#define glGetActiveUniformARB GLEW_GET_FUN(__glewGetActiveUniformARB) +#define glGetAttachedObjectsARB GLEW_GET_FUN(__glewGetAttachedObjectsARB) +#define glGetHandleARB GLEW_GET_FUN(__glewGetHandleARB) +#define glGetInfoLogARB GLEW_GET_FUN(__glewGetInfoLogARB) +#define glGetObjectParameterfvARB GLEW_GET_FUN(__glewGetObjectParameterfvARB) +#define glGetObjectParameterivARB GLEW_GET_FUN(__glewGetObjectParameterivARB) +#define glGetShaderSourceARB GLEW_GET_FUN(__glewGetShaderSourceARB) +#define glGetUniformLocationARB GLEW_GET_FUN(__glewGetUniformLocationARB) +#define glGetUniformfvARB GLEW_GET_FUN(__glewGetUniformfvARB) +#define glGetUniformivARB GLEW_GET_FUN(__glewGetUniformivARB) +#define glLinkProgramARB GLEW_GET_FUN(__glewLinkProgramARB) +#define glShaderSourceARB GLEW_GET_FUN(__glewShaderSourceARB) +#define glUniform1fARB GLEW_GET_FUN(__glewUniform1fARB) +#define glUniform1fvARB GLEW_GET_FUN(__glewUniform1fvARB) +#define glUniform1iARB GLEW_GET_FUN(__glewUniform1iARB) +#define glUniform1ivARB GLEW_GET_FUN(__glewUniform1ivARB) +#define glUniform2fARB GLEW_GET_FUN(__glewUniform2fARB) +#define glUniform2fvARB GLEW_GET_FUN(__glewUniform2fvARB) +#define glUniform2iARB GLEW_GET_FUN(__glewUniform2iARB) +#define glUniform2ivARB GLEW_GET_FUN(__glewUniform2ivARB) +#define glUniform3fARB GLEW_GET_FUN(__glewUniform3fARB) +#define glUniform3fvARB GLEW_GET_FUN(__glewUniform3fvARB) +#define glUniform3iARB GLEW_GET_FUN(__glewUniform3iARB) +#define glUniform3ivARB GLEW_GET_FUN(__glewUniform3ivARB) +#define glUniform4fARB GLEW_GET_FUN(__glewUniform4fARB) +#define glUniform4fvARB GLEW_GET_FUN(__glewUniform4fvARB) +#define glUniform4iARB GLEW_GET_FUN(__glewUniform4iARB) +#define glUniform4ivARB GLEW_GET_FUN(__glewUniform4ivARB) +#define glUniformMatrix2fvARB GLEW_GET_FUN(__glewUniformMatrix2fvARB) +#define glUniformMatrix3fvARB GLEW_GET_FUN(__glewUniformMatrix3fvARB) +#define glUniformMatrix4fvARB GLEW_GET_FUN(__glewUniformMatrix4fvARB) +#define glUseProgramObjectARB GLEW_GET_FUN(__glewUseProgramObjectARB) +#define glValidateProgramARB GLEW_GET_FUN(__glewValidateProgramARB) + +#define GLEW_ARB_shader_objects GLEW_GET_VAR(__GLEW_ARB_shader_objects) + +#endif /* GL_ARB_shader_objects */ + +/* ---------------------- GL_ARB_shading_language_100 ---------------------- */ + +#ifndef GL_ARB_shading_language_100 +#define GL_ARB_shading_language_100 1 + +#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C + +#define GLEW_ARB_shading_language_100 GLEW_GET_VAR(__GLEW_ARB_shading_language_100) + +#endif /* GL_ARB_shading_language_100 */ + +/* ----------------------------- GL_ARB_shadow ----------------------------- */ + +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 + +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E + +#define GLEW_ARB_shadow GLEW_GET_VAR(__GLEW_ARB_shadow) + +#endif /* GL_ARB_shadow */ + +/* ------------------------- GL_ARB_shadow_ambient ------------------------- */ + +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 + +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF + +#define GLEW_ARB_shadow_ambient GLEW_GET_VAR(__GLEW_ARB_shadow_ambient) + +#endif /* GL_ARB_shadow_ambient */ + +/* ---------------------- GL_ARB_texture_border_clamp ---------------------- */ + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 + +#define GL_CLAMP_TO_BORDER_ARB 0x812D + +#define GLEW_ARB_texture_border_clamp GLEW_GET_VAR(__GLEW_ARB_texture_border_clamp) + +#endif /* GL_ARB_texture_border_clamp */ + +/* ----------------------- GL_ARB_texture_compression ---------------------- */ + +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 + +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 + +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, void* img); + +#define glCompressedTexImage1DARB GLEW_GET_FUN(__glewCompressedTexImage1DARB) +#define glCompressedTexImage2DARB GLEW_GET_FUN(__glewCompressedTexImage2DARB) +#define glCompressedTexImage3DARB GLEW_GET_FUN(__glewCompressedTexImage3DARB) +#define glCompressedTexSubImage1DARB GLEW_GET_FUN(__glewCompressedTexSubImage1DARB) +#define glCompressedTexSubImage2DARB GLEW_GET_FUN(__glewCompressedTexSubImage2DARB) +#define glCompressedTexSubImage3DARB GLEW_GET_FUN(__glewCompressedTexSubImage3DARB) +#define glGetCompressedTexImageARB GLEW_GET_FUN(__glewGetCompressedTexImageARB) + +#define GLEW_ARB_texture_compression GLEW_GET_VAR(__GLEW_ARB_texture_compression) + +#endif /* GL_ARB_texture_compression */ + +/* ------------------------ GL_ARB_texture_cube_map ------------------------ */ + +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 + +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C + +#define GLEW_ARB_texture_cube_map GLEW_GET_VAR(__GLEW_ARB_texture_cube_map) + +#endif /* GL_ARB_texture_cube_map */ + +/* ------------------------- GL_ARB_texture_env_add ------------------------ */ + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 + +#define GLEW_ARB_texture_env_add GLEW_GET_VAR(__GLEW_ARB_texture_env_add) + +#endif /* GL_ARB_texture_env_add */ + +/* ----------------------- GL_ARB_texture_env_combine ---------------------- */ + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 + +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A + +#define GLEW_ARB_texture_env_combine GLEW_GET_VAR(__GLEW_ARB_texture_env_combine) + +#endif /* GL_ARB_texture_env_combine */ + +/* ---------------------- GL_ARB_texture_env_crossbar ---------------------- */ + +#ifndef GL_ARB_texture_env_crossbar +#define GL_ARB_texture_env_crossbar 1 + +#define GLEW_ARB_texture_env_crossbar GLEW_GET_VAR(__GLEW_ARB_texture_env_crossbar) + +#endif /* GL_ARB_texture_env_crossbar */ + +/* ------------------------ GL_ARB_texture_env_dot3 ------------------------ */ + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 + +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF + +#define GLEW_ARB_texture_env_dot3 GLEW_GET_VAR(__GLEW_ARB_texture_env_dot3) + +#endif /* GL_ARB_texture_env_dot3 */ + +/* -------------------------- GL_ARB_texture_float ------------------------- */ + +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 + +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGB32F_ARB 0x8815 +#define GL_ALPHA32F_ARB 0x8816 +#define GL_INTENSITY32F_ARB 0x8817 +#define GL_LUMINANCE32F_ARB 0x8818 +#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 +#define GL_RGBA16F_ARB 0x881A +#define GL_RGB16F_ARB 0x881B +#define GL_ALPHA16F_ARB 0x881C +#define GL_INTENSITY16F_ARB 0x881D +#define GL_LUMINANCE16F_ARB 0x881E +#define GL_LUMINANCE_ALPHA16F_ARB 0x881F +#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 +#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 +#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 +#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 + +#define GLEW_ARB_texture_float GLEW_GET_VAR(__GLEW_ARB_texture_float) + +#endif /* GL_ARB_texture_float */ + +/* --------------------- GL_ARB_texture_mirrored_repeat -------------------- */ + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_ARB_texture_mirrored_repeat 1 + +#define GL_MIRRORED_REPEAT_ARB 0x8370 + +#define GLEW_ARB_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_ARB_texture_mirrored_repeat) + +#endif /* GL_ARB_texture_mirrored_repeat */ + +/* -------------------- GL_ARB_texture_non_power_of_two -------------------- */ + +#ifndef GL_ARB_texture_non_power_of_two +#define GL_ARB_texture_non_power_of_two 1 + +#define GLEW_ARB_texture_non_power_of_two GLEW_GET_VAR(__GLEW_ARB_texture_non_power_of_two) + +#endif /* GL_ARB_texture_non_power_of_two */ + +/* ------------------------ GL_ARB_texture_rectangle ----------------------- */ + +#ifndef GL_ARB_texture_rectangle +#define GL_ARB_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 + +#define GLEW_ARB_texture_rectangle GLEW_GET_VAR(__GLEW_ARB_texture_rectangle) + +#endif /* GL_ARB_texture_rectangle */ + +/* ------------------------ GL_ARB_transpose_matrix ------------------------ */ + +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 + +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 + +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); + +#define glLoadTransposeMatrixdARB GLEW_GET_FUN(__glewLoadTransposeMatrixdARB) +#define glLoadTransposeMatrixfARB GLEW_GET_FUN(__glewLoadTransposeMatrixfARB) +#define glMultTransposeMatrixdARB GLEW_GET_FUN(__glewMultTransposeMatrixdARB) +#define glMultTransposeMatrixfARB GLEW_GET_FUN(__glewMultTransposeMatrixfARB) + +#define GLEW_ARB_transpose_matrix GLEW_GET_VAR(__GLEW_ARB_transpose_matrix) + +#endif /* GL_ARB_transpose_matrix */ + +/* -------------------------- GL_ARB_vertex_blend -------------------------- */ + +#ifndef GL_ARB_vertex_blend +#define GL_ARB_vertex_blend 1 + +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F + +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDARBPROC) (GLint count); +typedef void (GLAPIENTRY * PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLWEIGHTBVARBPROC) (GLint size, GLbyte *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTDVARBPROC) (GLint size, GLdouble *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTFVARBPROC) (GLint size, GLfloat *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTIVARBPROC) (GLint size, GLint *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTSVARBPROC) (GLint size, GLshort *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUBVARBPROC) (GLint size, GLubyte *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUIVARBPROC) (GLint size, GLuint *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUSVARBPROC) (GLint size, GLushort *weights); + +#define glVertexBlendARB GLEW_GET_FUN(__glewVertexBlendARB) +#define glWeightPointerARB GLEW_GET_FUN(__glewWeightPointerARB) +#define glWeightbvARB GLEW_GET_FUN(__glewWeightbvARB) +#define glWeightdvARB GLEW_GET_FUN(__glewWeightdvARB) +#define glWeightfvARB GLEW_GET_FUN(__glewWeightfvARB) +#define glWeightivARB GLEW_GET_FUN(__glewWeightivARB) +#define glWeightsvARB GLEW_GET_FUN(__glewWeightsvARB) +#define glWeightubvARB GLEW_GET_FUN(__glewWeightubvARB) +#define glWeightuivARB GLEW_GET_FUN(__glewWeightuivARB) +#define glWeightusvARB GLEW_GET_FUN(__glewWeightusvARB) + +#define GLEW_ARB_vertex_blend GLEW_GET_VAR(__GLEW_ARB_vertex_blend) + +#endif /* GL_ARB_vertex_blend */ + +/* ---------------------- GL_ARB_vertex_buffer_object ---------------------- */ + +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 + +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA + +typedef ptrdiff_t GLsizeiptrARB; +typedef ptrdiff_t GLintptrARB; + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid* data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid* data); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERARBPROC) (GLuint buffer); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERARBPROC) (GLenum target); + +#define glBindBufferARB GLEW_GET_FUN(__glewBindBufferARB) +#define glBufferDataARB GLEW_GET_FUN(__glewBufferDataARB) +#define glBufferSubDataARB GLEW_GET_FUN(__glewBufferSubDataARB) +#define glDeleteBuffersARB GLEW_GET_FUN(__glewDeleteBuffersARB) +#define glGenBuffersARB GLEW_GET_FUN(__glewGenBuffersARB) +#define glGetBufferParameterivARB GLEW_GET_FUN(__glewGetBufferParameterivARB) +#define glGetBufferPointervARB GLEW_GET_FUN(__glewGetBufferPointervARB) +#define glGetBufferSubDataARB GLEW_GET_FUN(__glewGetBufferSubDataARB) +#define glIsBufferARB GLEW_GET_FUN(__glewIsBufferARB) +#define glMapBufferARB GLEW_GET_FUN(__glewMapBufferARB) +#define glUnmapBufferARB GLEW_GET_FUN(__glewUnmapBufferARB) + +#define GLEW_ARB_vertex_buffer_object GLEW_GET_VAR(__GLEW_ARB_vertex_buffer_object) + +#endif /* GL_ARB_vertex_buffer_object */ + +/* ------------------------- GL_ARB_vertex_program ------------------------- */ + +#ifndef GL_ARB_vertex_program +#define GL_ARB_vertex_program 1 + +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_PROGRAM_LENGTH_ARB 0x8627 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_PROGRAM_BINDING_ARB 0x8677 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 +#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 +#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 +#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 +#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 +#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 +#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 +#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 +#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 +#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 +#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA +#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB +#define GL_PROGRAM_ATTRIBS_ARB 0x88AC +#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD +#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE +#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF +#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 +#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 +#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 +#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 +#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 +#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 +#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 +#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_MATRIX0_ARB 0x88C0 +#define GL_MATRIX1_ARB 0x88C1 +#define GL_MATRIX2_ARB 0x88C2 +#define GL_MATRIX3_ARB 0x88C3 +#define GL_MATRIX4_ARB 0x88C4 +#define GL_MATRIX5_ARB 0x88C5 +#define GL_MATRIX6_ARB 0x88C6 +#define GL_MATRIX7_ARB 0x88C7 +#define GL_MATRIX8_ARB 0x88C8 +#define GL_MATRIX9_ARB 0x88C9 +#define GL_MATRIX10_ARB 0x88CA +#define GL_MATRIX11_ARB 0x88CB +#define GL_MATRIX12_ARB 0x88CC +#define GL_MATRIX13_ARB 0x88CD +#define GL_MATRIX14_ARB 0x88CE +#define GL_MATRIX15_ARB 0x88CF +#define GL_MATRIX16_ARB 0x88D0 +#define GL_MATRIX17_ARB 0x88D1 +#define GL_MATRIX18_ARB 0x88D2 +#define GL_MATRIX19_ARB 0x88D3 +#define GL_MATRIX20_ARB 0x88D4 +#define GL_MATRIX21_ARB 0x88D5 +#define GL_MATRIX22_ARB 0x88D6 +#define GL_MATRIX23_ARB 0x88D7 +#define GL_MATRIX24_ARB 0x88D8 +#define GL_MATRIX25_ARB 0x88D9 +#define GL_MATRIX26_ARB 0x88DA +#define GL_MATRIX27_ARB 0x88DB +#define GL_MATRIX28_ARB 0x88DC +#define GL_MATRIX29_ARB 0x88DD +#define GL_MATRIX30_ARB 0x88DE +#define GL_MATRIX31_ARB 0x88DF + +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint* programs); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint* programs); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, void* string); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMARBPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void* string); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer); + +#define glBindProgramARB GLEW_GET_FUN(__glewBindProgramARB) +#define glDeleteProgramsARB GLEW_GET_FUN(__glewDeleteProgramsARB) +#define glDisableVertexAttribArrayARB GLEW_GET_FUN(__glewDisableVertexAttribArrayARB) +#define glEnableVertexAttribArrayARB GLEW_GET_FUN(__glewEnableVertexAttribArrayARB) +#define glGenProgramsARB GLEW_GET_FUN(__glewGenProgramsARB) +#define glGetProgramEnvParameterdvARB GLEW_GET_FUN(__glewGetProgramEnvParameterdvARB) +#define glGetProgramEnvParameterfvARB GLEW_GET_FUN(__glewGetProgramEnvParameterfvARB) +#define glGetProgramLocalParameterdvARB GLEW_GET_FUN(__glewGetProgramLocalParameterdvARB) +#define glGetProgramLocalParameterfvARB GLEW_GET_FUN(__glewGetProgramLocalParameterfvARB) +#define glGetProgramStringARB GLEW_GET_FUN(__glewGetProgramStringARB) +#define glGetProgramivARB GLEW_GET_FUN(__glewGetProgramivARB) +#define glGetVertexAttribPointervARB GLEW_GET_FUN(__glewGetVertexAttribPointervARB) +#define glGetVertexAttribdvARB GLEW_GET_FUN(__glewGetVertexAttribdvARB) +#define glGetVertexAttribfvARB GLEW_GET_FUN(__glewGetVertexAttribfvARB) +#define glGetVertexAttribivARB GLEW_GET_FUN(__glewGetVertexAttribivARB) +#define glIsProgramARB GLEW_GET_FUN(__glewIsProgramARB) +#define glProgramEnvParameter4dARB GLEW_GET_FUN(__glewProgramEnvParameter4dARB) +#define glProgramEnvParameter4dvARB GLEW_GET_FUN(__glewProgramEnvParameter4dvARB) +#define glProgramEnvParameter4fARB GLEW_GET_FUN(__glewProgramEnvParameter4fARB) +#define glProgramEnvParameter4fvARB GLEW_GET_FUN(__glewProgramEnvParameter4fvARB) +#define glProgramLocalParameter4dARB GLEW_GET_FUN(__glewProgramLocalParameter4dARB) +#define glProgramLocalParameter4dvARB GLEW_GET_FUN(__glewProgramLocalParameter4dvARB) +#define glProgramLocalParameter4fARB GLEW_GET_FUN(__glewProgramLocalParameter4fARB) +#define glProgramLocalParameter4fvARB GLEW_GET_FUN(__glewProgramLocalParameter4fvARB) +#define glProgramStringARB GLEW_GET_FUN(__glewProgramStringARB) +#define glVertexAttrib1dARB GLEW_GET_FUN(__glewVertexAttrib1dARB) +#define glVertexAttrib1dvARB GLEW_GET_FUN(__glewVertexAttrib1dvARB) +#define glVertexAttrib1fARB GLEW_GET_FUN(__glewVertexAttrib1fARB) +#define glVertexAttrib1fvARB GLEW_GET_FUN(__glewVertexAttrib1fvARB) +#define glVertexAttrib1sARB GLEW_GET_FUN(__glewVertexAttrib1sARB) +#define glVertexAttrib1svARB GLEW_GET_FUN(__glewVertexAttrib1svARB) +#define glVertexAttrib2dARB GLEW_GET_FUN(__glewVertexAttrib2dARB) +#define glVertexAttrib2dvARB GLEW_GET_FUN(__glewVertexAttrib2dvARB) +#define glVertexAttrib2fARB GLEW_GET_FUN(__glewVertexAttrib2fARB) +#define glVertexAttrib2fvARB GLEW_GET_FUN(__glewVertexAttrib2fvARB) +#define glVertexAttrib2sARB GLEW_GET_FUN(__glewVertexAttrib2sARB) +#define glVertexAttrib2svARB GLEW_GET_FUN(__glewVertexAttrib2svARB) +#define glVertexAttrib3dARB GLEW_GET_FUN(__glewVertexAttrib3dARB) +#define glVertexAttrib3dvARB GLEW_GET_FUN(__glewVertexAttrib3dvARB) +#define glVertexAttrib3fARB GLEW_GET_FUN(__glewVertexAttrib3fARB) +#define glVertexAttrib3fvARB GLEW_GET_FUN(__glewVertexAttrib3fvARB) +#define glVertexAttrib3sARB GLEW_GET_FUN(__glewVertexAttrib3sARB) +#define glVertexAttrib3svARB GLEW_GET_FUN(__glewVertexAttrib3svARB) +#define glVertexAttrib4NbvARB GLEW_GET_FUN(__glewVertexAttrib4NbvARB) +#define glVertexAttrib4NivARB GLEW_GET_FUN(__glewVertexAttrib4NivARB) +#define glVertexAttrib4NsvARB GLEW_GET_FUN(__glewVertexAttrib4NsvARB) +#define glVertexAttrib4NubARB GLEW_GET_FUN(__glewVertexAttrib4NubARB) +#define glVertexAttrib4NubvARB GLEW_GET_FUN(__glewVertexAttrib4NubvARB) +#define glVertexAttrib4NuivARB GLEW_GET_FUN(__glewVertexAttrib4NuivARB) +#define glVertexAttrib4NusvARB GLEW_GET_FUN(__glewVertexAttrib4NusvARB) +#define glVertexAttrib4bvARB GLEW_GET_FUN(__glewVertexAttrib4bvARB) +#define glVertexAttrib4dARB GLEW_GET_FUN(__glewVertexAttrib4dARB) +#define glVertexAttrib4dvARB GLEW_GET_FUN(__glewVertexAttrib4dvARB) +#define glVertexAttrib4fARB GLEW_GET_FUN(__glewVertexAttrib4fARB) +#define glVertexAttrib4fvARB GLEW_GET_FUN(__glewVertexAttrib4fvARB) +#define glVertexAttrib4ivARB GLEW_GET_FUN(__glewVertexAttrib4ivARB) +#define glVertexAttrib4sARB GLEW_GET_FUN(__glewVertexAttrib4sARB) +#define glVertexAttrib4svARB GLEW_GET_FUN(__glewVertexAttrib4svARB) +#define glVertexAttrib4ubvARB GLEW_GET_FUN(__glewVertexAttrib4ubvARB) +#define glVertexAttrib4uivARB GLEW_GET_FUN(__glewVertexAttrib4uivARB) +#define glVertexAttrib4usvARB GLEW_GET_FUN(__glewVertexAttrib4usvARB) +#define glVertexAttribPointerARB GLEW_GET_FUN(__glewVertexAttribPointerARB) + +#define GLEW_ARB_vertex_program GLEW_GET_VAR(__GLEW_ARB_vertex_program) + +#endif /* GL_ARB_vertex_program */ + +/* -------------------------- GL_ARB_vertex_shader ------------------------- */ + +#ifndef GL_ARB_vertex_shader +#define GL_ARB_vertex_shader 1 + +#define GL_VERTEX_SHADER_ARB 0x8B31 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A +#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D +#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 +#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A + +typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB* name); +typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); +typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); + +#define glBindAttribLocationARB GLEW_GET_FUN(__glewBindAttribLocationARB) +#define glGetActiveAttribARB GLEW_GET_FUN(__glewGetActiveAttribARB) +#define glGetAttribLocationARB GLEW_GET_FUN(__glewGetAttribLocationARB) + +#define GLEW_ARB_vertex_shader GLEW_GET_VAR(__GLEW_ARB_vertex_shader) + +#endif /* GL_ARB_vertex_shader */ + +/* --------------------------- GL_ARB_window_pos --------------------------- */ + +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 + +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVARBPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVARBPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVARBPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVARBPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVARBPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVARBPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVARBPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVARBPROC) (const GLshort* p); + +#define glWindowPos2dARB GLEW_GET_FUN(__glewWindowPos2dARB) +#define glWindowPos2dvARB GLEW_GET_FUN(__glewWindowPos2dvARB) +#define glWindowPos2fARB GLEW_GET_FUN(__glewWindowPos2fARB) +#define glWindowPos2fvARB GLEW_GET_FUN(__glewWindowPos2fvARB) +#define glWindowPos2iARB GLEW_GET_FUN(__glewWindowPos2iARB) +#define glWindowPos2ivARB GLEW_GET_FUN(__glewWindowPos2ivARB) +#define glWindowPos2sARB GLEW_GET_FUN(__glewWindowPos2sARB) +#define glWindowPos2svARB GLEW_GET_FUN(__glewWindowPos2svARB) +#define glWindowPos3dARB GLEW_GET_FUN(__glewWindowPos3dARB) +#define glWindowPos3dvARB GLEW_GET_FUN(__glewWindowPos3dvARB) +#define glWindowPos3fARB GLEW_GET_FUN(__glewWindowPos3fARB) +#define glWindowPos3fvARB GLEW_GET_FUN(__glewWindowPos3fvARB) +#define glWindowPos3iARB GLEW_GET_FUN(__glewWindowPos3iARB) +#define glWindowPos3ivARB GLEW_GET_FUN(__glewWindowPos3ivARB) +#define glWindowPos3sARB GLEW_GET_FUN(__glewWindowPos3sARB) +#define glWindowPos3svARB GLEW_GET_FUN(__glewWindowPos3svARB) + +#define GLEW_ARB_window_pos GLEW_GET_VAR(__GLEW_ARB_window_pos) + +#endif /* GL_ARB_window_pos */ + +/* ------------------------- GL_ATIX_point_sprites ------------------------- */ + +#ifndef GL_ATIX_point_sprites +#define GL_ATIX_point_sprites 1 + +#define GLEW_ATIX_point_sprites GLEW_GET_VAR(__GLEW_ATIX_point_sprites) + +#endif /* GL_ATIX_point_sprites */ + +/* ---------------------- GL_ATIX_texture_env_combine3 --------------------- */ + +#ifndef GL_ATIX_texture_env_combine3 +#define GL_ATIX_texture_env_combine3 1 + +#define GL_MODULATE_ADD_ATIX 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATIX 0x8745 +#define GL_MODULATE_SUBTRACT_ATIX 0x8746 + +#define GLEW_ATIX_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATIX_texture_env_combine3) + +#endif /* GL_ATIX_texture_env_combine3 */ + +/* ----------------------- GL_ATIX_texture_env_route ----------------------- */ + +#ifndef GL_ATIX_texture_env_route +#define GL_ATIX_texture_env_route 1 + +#define GL_SECONDARY_COLOR_ATIX 0x8747 +#define GL_TEXTURE_OUTPUT_RGB_ATIX 0x8748 +#define GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749 + +#define GLEW_ATIX_texture_env_route GLEW_GET_VAR(__GLEW_ATIX_texture_env_route) + +#endif /* GL_ATIX_texture_env_route */ + +/* ---------------- GL_ATIX_vertex_shader_output_point_size ---------------- */ + +#ifndef GL_ATIX_vertex_shader_output_point_size +#define GL_ATIX_vertex_shader_output_point_size 1 + +#define GL_OUTPUT_POINT_SIZE_ATIX 0x610E + +#define GLEW_ATIX_vertex_shader_output_point_size GLEW_GET_VAR(__GLEW_ATIX_vertex_shader_output_point_size) + +#endif /* GL_ATIX_vertex_shader_output_point_size */ + +/* -------------------------- GL_ATI_draw_buffers -------------------------- */ + +#ifndef GL_ATI_draw_buffers +#define GL_ATI_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 +#define GL_DRAW_BUFFER0_ATI 0x8825 +#define GL_DRAW_BUFFER1_ATI 0x8826 +#define GL_DRAW_BUFFER2_ATI 0x8827 +#define GL_DRAW_BUFFER3_ATI 0x8828 +#define GL_DRAW_BUFFER4_ATI 0x8829 +#define GL_DRAW_BUFFER5_ATI 0x882A +#define GL_DRAW_BUFFER6_ATI 0x882B +#define GL_DRAW_BUFFER7_ATI 0x882C +#define GL_DRAW_BUFFER8_ATI 0x882D +#define GL_DRAW_BUFFER9_ATI 0x882E +#define GL_DRAW_BUFFER10_ATI 0x882F +#define GL_DRAW_BUFFER11_ATI 0x8830 +#define GL_DRAW_BUFFER12_ATI 0x8831 +#define GL_DRAW_BUFFER13_ATI 0x8832 +#define GL_DRAW_BUFFER14_ATI 0x8833 +#define GL_DRAW_BUFFER15_ATI 0x8834 + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersATI GLEW_GET_FUN(__glewDrawBuffersATI) + +#define GLEW_ATI_draw_buffers GLEW_GET_VAR(__GLEW_ATI_draw_buffers) + +#endif /* GL_ATI_draw_buffers */ + +/* -------------------------- GL_ATI_element_array ------------------------- */ + +#ifndef GL_ATI_element_array +#define GL_ATI_element_array 1 + +#define GL_ELEMENT_ARRAY_ATI 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); +typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERATIPROC) (GLenum type, const void* pointer); + +#define glDrawElementArrayATI GLEW_GET_FUN(__glewDrawElementArrayATI) +#define glDrawRangeElementArrayATI GLEW_GET_FUN(__glewDrawRangeElementArrayATI) +#define glElementPointerATI GLEW_GET_FUN(__glewElementPointerATI) + +#define GLEW_ATI_element_array GLEW_GET_VAR(__GLEW_ATI_element_array) + +#endif /* GL_ATI_element_array */ + +/* ------------------------- GL_ATI_envmap_bumpmap ------------------------- */ + +#ifndef GL_ATI_envmap_bumpmap +#define GL_ATI_envmap_bumpmap 1 + +#define GL_BUMP_ROT_MATRIX_ATI 0x8775 +#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 +#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 +#define GL_BUMP_TEX_UNITS_ATI 0x8778 +#define GL_DUDV_ATI 0x8779 +#define GL_DU8DV8_ATI 0x877A +#define GL_BUMP_ENVMAP_ATI 0x877B +#define GL_BUMP_TARGET_ATI 0x877C + +typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); +typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); + +#define glGetTexBumpParameterfvATI GLEW_GET_FUN(__glewGetTexBumpParameterfvATI) +#define glGetTexBumpParameterivATI GLEW_GET_FUN(__glewGetTexBumpParameterivATI) +#define glTexBumpParameterfvATI GLEW_GET_FUN(__glewTexBumpParameterfvATI) +#define glTexBumpParameterivATI GLEW_GET_FUN(__glewTexBumpParameterivATI) + +#define GLEW_ATI_envmap_bumpmap GLEW_GET_VAR(__GLEW_ATI_envmap_bumpmap) + +#endif /* GL_ATI_envmap_bumpmap */ + +/* ------------------------- GL_ATI_fragment_shader ------------------------ */ + +#ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 + +#define GL_RED_BIT_ATI 0x00000001 +#define GL_2X_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_NEGATE_BIT_ATI 0x00000004 +#define GL_BIAS_BIT_ATI 0x00000008 +#define GL_HALF_BIT_ATI 0x00000008 +#define GL_QUARTER_BIT_ATI 0x00000010 +#define GL_EIGHTH_BIT_ATI 0x00000020 +#define GL_SATURATE_BIT_ATI 0x00000040 +#define GL_FRAGMENT_SHADER_ATI 0x8920 +#define GL_REG_0_ATI 0x8921 +#define GL_REG_1_ATI 0x8922 +#define GL_REG_2_ATI 0x8923 +#define GL_REG_3_ATI 0x8924 +#define GL_REG_4_ATI 0x8925 +#define GL_REG_5_ATI 0x8926 +#define GL_CON_0_ATI 0x8941 +#define GL_CON_1_ATI 0x8942 +#define GL_CON_2_ATI 0x8943 +#define GL_CON_3_ATI 0x8944 +#define GL_CON_4_ATI 0x8945 +#define GL_CON_5_ATI 0x8946 +#define GL_CON_6_ATI 0x8947 +#define GL_CON_7_ATI 0x8948 +#define GL_MOV_ATI 0x8961 +#define GL_ADD_ATI 0x8963 +#define GL_MUL_ATI 0x8964 +#define GL_SUB_ATI 0x8965 +#define GL_DOT3_ATI 0x8966 +#define GL_DOT4_ATI 0x8967 +#define GL_MAD_ATI 0x8968 +#define GL_LERP_ATI 0x8969 +#define GL_CND_ATI 0x896A +#define GL_CND0_ATI 0x896B +#define GL_DOT2_ADD_ATI 0x896C +#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D +#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E +#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F +#define GL_NUM_PASSES_ATI 0x8970 +#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 +#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 +#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 +#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 +#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 +#define GL_SWIZZLE_STR_ATI 0x8976 +#define GL_SWIZZLE_STQ_ATI 0x8977 +#define GL_SWIZZLE_STR_DR_ATI 0x8978 +#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 +#define GL_SWIZZLE_STRQ_ATI 0x897A +#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B + +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (GLAPIENTRY * PFNGLBEGINFRAGMENTSHADERATIPROC) (void); +typedef void (GLAPIENTRY * PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (GLAPIENTRY * PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDFRAGMENTSHADERATIPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); +typedef void (GLAPIENTRY * PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); +typedef void (GLAPIENTRY * PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); +typedef void (GLAPIENTRY * PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat* value); + +#define glAlphaFragmentOp1ATI GLEW_GET_FUN(__glewAlphaFragmentOp1ATI) +#define glAlphaFragmentOp2ATI GLEW_GET_FUN(__glewAlphaFragmentOp2ATI) +#define glAlphaFragmentOp3ATI GLEW_GET_FUN(__glewAlphaFragmentOp3ATI) +#define glBeginFragmentShaderATI GLEW_GET_FUN(__glewBeginFragmentShaderATI) +#define glBindFragmentShaderATI GLEW_GET_FUN(__glewBindFragmentShaderATI) +#define glColorFragmentOp1ATI GLEW_GET_FUN(__glewColorFragmentOp1ATI) +#define glColorFragmentOp2ATI GLEW_GET_FUN(__glewColorFragmentOp2ATI) +#define glColorFragmentOp3ATI GLEW_GET_FUN(__glewColorFragmentOp3ATI) +#define glDeleteFragmentShaderATI GLEW_GET_FUN(__glewDeleteFragmentShaderATI) +#define glEndFragmentShaderATI GLEW_GET_FUN(__glewEndFragmentShaderATI) +#define glGenFragmentShadersATI GLEW_GET_FUN(__glewGenFragmentShadersATI) +#define glPassTexCoordATI GLEW_GET_FUN(__glewPassTexCoordATI) +#define glSampleMapATI GLEW_GET_FUN(__glewSampleMapATI) +#define glSetFragmentShaderConstantATI GLEW_GET_FUN(__glewSetFragmentShaderConstantATI) + +#define GLEW_ATI_fragment_shader GLEW_GET_VAR(__GLEW_ATI_fragment_shader) + +#endif /* GL_ATI_fragment_shader */ + +/* ------------------------ GL_ATI_map_object_buffer ----------------------- */ + +#ifndef GL_ATI_map_object_buffer +#define GL_ATI_map_object_buffer 1 + +typedef void* (GLAPIENTRY * PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); + +#define glMapObjectBufferATI GLEW_GET_FUN(__glewMapObjectBufferATI) +#define glUnmapObjectBufferATI GLEW_GET_FUN(__glewUnmapObjectBufferATI) + +#define GLEW_ATI_map_object_buffer GLEW_GET_VAR(__GLEW_ATI_map_object_buffer) + +#endif /* GL_ATI_map_object_buffer */ + +/* -------------------------- GL_ATI_pn_triangles -------------------------- */ + +#ifndef GL_ATI_pn_triangles +#define GL_ATI_pn_triangles 1 + +#define GL_PN_TRIANGLES_ATI 0x87F0 +#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 +#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 +#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 +#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 +#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 +#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 +#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 +#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 + +typedef void (GLAPIENTRY * PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); + +#define glPNTrianglesfATI GLEW_GET_FUN(__glPNTrianglewesfATI) +#define glPNTrianglesiATI GLEW_GET_FUN(__glPNTrianglewesiATI) + +#define GLEW_ATI_pn_triangles GLEW_GET_VAR(__GLEW_ATI_pn_triangles) + +#endif /* GL_ATI_pn_triangles */ + +/* ------------------------ GL_ATI_separate_stencil ------------------------ */ + +#ifndef GL_ATI_separate_stencil +#define GL_ATI_separate_stencil 1 + +#define GL_STENCIL_BACK_FUNC_ATI 0x8800 +#define GL_STENCIL_BACK_FAIL_ATI 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 + +typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); + +#define glStencilFuncSeparateATI GLEW_GET_FUN(__glewStencilFuncSeparateATI) +#define glStencilOpSeparateATI GLEW_GET_FUN(__glewStencilOpSeparateATI) + +#define GLEW_ATI_separate_stencil GLEW_GET_VAR(__GLEW_ATI_separate_stencil) + +#endif /* GL_ATI_separate_stencil */ + +/* ---------------------- GL_ATI_text_fragment_shader ---------------------- */ + +#ifndef GL_ATI_text_fragment_shader +#define GL_ATI_text_fragment_shader 1 + +#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 + +#define GLEW_ATI_text_fragment_shader GLEW_GET_VAR(__GLEW_ATI_text_fragment_shader) + +#endif /* GL_ATI_text_fragment_shader */ + +/* --------------------- GL_ATI_texture_compression_3dc -------------------- */ + +#ifndef GL_ATI_texture_compression_3dc +#define GL_ATI_texture_compression_3dc 1 + +#define GL_COMPRESSED_RGB_3DC_ATI 0x8837 + +#define GLEW_ATI_texture_compression_3dc GLEW_GET_VAR(__GLEW_ATI_texture_compression_3dc) + +#endif /* GL_ATI_texture_compression_3dc */ + +/* ---------------------- GL_ATI_texture_env_combine3 ---------------------- */ + +#ifndef GL_ATI_texture_env_combine3 +#define GL_ATI_texture_env_combine3 1 + +#define GL_MODULATE_ADD_ATI 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 +#define GL_MODULATE_SUBTRACT_ATI 0x8746 + +#define GLEW_ATI_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATI_texture_env_combine3) + +#endif /* GL_ATI_texture_env_combine3 */ + +/* -------------------------- GL_ATI_texture_float ------------------------- */ + +#ifndef GL_ATI_texture_float +#define GL_ATI_texture_float 1 + +#define GL_RGBA_FLOAT32_ATI 0x8814 +#define GL_RGB_FLOAT32_ATI 0x8815 +#define GL_ALPHA_FLOAT32_ATI 0x8816 +#define GL_INTENSITY_FLOAT32_ATI 0x8817 +#define GL_LUMINANCE_FLOAT32_ATI 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 +#define GL_RGBA_FLOAT16_ATI 0x881A +#define GL_RGB_FLOAT16_ATI 0x881B +#define GL_ALPHA_FLOAT16_ATI 0x881C +#define GL_INTENSITY_FLOAT16_ATI 0x881D +#define GL_LUMINANCE_FLOAT16_ATI 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F + +#define GLEW_ATI_texture_float GLEW_GET_VAR(__GLEW_ATI_texture_float) + +#endif /* GL_ATI_texture_float */ + +/* ----------------------- GL_ATI_texture_mirror_once ---------------------- */ + +#ifndef GL_ATI_texture_mirror_once +#define GL_ATI_texture_mirror_once 1 + +#define GL_MIRROR_CLAMP_ATI 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 + +#define GLEW_ATI_texture_mirror_once GLEW_GET_VAR(__GLEW_ATI_texture_mirror_once) + +#endif /* GL_ATI_texture_mirror_once */ + +/* ----------------------- GL_ATI_vertex_array_object ---------------------- */ + +#ifndef GL_ATI_vertex_array_object +#define GL_ATI_vertex_array_object 1 + +#define GL_STATIC_ATI 0x8760 +#define GL_DYNAMIC_ATI 0x8761 +#define GL_PRESERVE_ATI 0x8762 +#define GL_DISCARD_ATI 0x8763 +#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 +#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 +#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 +#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 + +typedef void (GLAPIENTRY * PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (GLAPIENTRY * PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef GLuint (GLAPIENTRY * PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const void* pointer, GLenum usage); +typedef void (GLAPIENTRY * PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const void* pointer, GLenum preserve); +typedef void (GLAPIENTRY * PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); + +#define glArrayObjectATI GLEW_GET_FUN(__glewArrayObjectATI) +#define glFreeObjectBufferATI GLEW_GET_FUN(__glewFreeObjectBufferATI) +#define glGetArrayObjectfvATI GLEW_GET_FUN(__glewGetArrayObjectfvATI) +#define glGetArrayObjectivATI GLEW_GET_FUN(__glewGetArrayObjectivATI) +#define glGetObjectBufferfvATI GLEW_GET_FUN(__glewGetObjectBufferfvATI) +#define glGetObjectBufferivATI GLEW_GET_FUN(__glewGetObjectBufferivATI) +#define glGetVariantArrayObjectfvATI GLEW_GET_FUN(__glewGetVariantArrayObjectfvATI) +#define glGetVariantArrayObjectivATI GLEW_GET_FUN(__glewGetVariantArrayObjectivATI) +#define glIsObjectBufferATI GLEW_GET_FUN(__glewIsObjectBufferATI) +#define glNewObjectBufferATI GLEW_GET_FUN(__glewNewObjectBufferATI) +#define glUpdateObjectBufferATI GLEW_GET_FUN(__glewUpdateObjectBufferATI) +#define glVariantArrayObjectATI GLEW_GET_FUN(__glewVariantArrayObjectATI) + +#define GLEW_ATI_vertex_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_array_object) + +#endif /* GL_ATI_vertex_array_object */ + +/* ------------------- GL_ATI_vertex_attrib_array_object ------------------- */ + +#ifndef GL_ATI_vertex_attrib_array_object +#define GL_ATI_vertex_attrib_array_object 1 + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); + +#define glGetVertexAttribArrayObjectfvATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectfvATI) +#define glGetVertexAttribArrayObjectivATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectivATI) +#define glVertexAttribArrayObjectATI GLEW_GET_FUN(__glewVertexAttribArrayObjectATI) + +#define GLEW_ATI_vertex_attrib_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_attrib_array_object) + +#endif /* GL_ATI_vertex_attrib_array_object */ + +/* ------------------------- GL_ATI_vertex_streams ------------------------- */ + +#ifndef GL_ATI_vertex_streams +#define GL_ATI_vertex_streams 1 + +#define GL_MAX_VERTEX_STREAMS_ATI 0x876B +#define GL_VERTEX_SOURCE_ATI 0x876C +#define GL_VERTEX_STREAM0_ATI 0x876D +#define GL_VERTEX_STREAM1_ATI 0x876E +#define GL_VERTEX_STREAM2_ATI 0x876F +#define GL_VERTEX_STREAM3_ATI 0x8770 +#define GL_VERTEX_STREAM4_ATI 0x8771 +#define GL_VERTEX_STREAM5_ATI 0x8772 +#define GL_VERTEX_STREAM6_ATI 0x8773 +#define GL_VERTEX_STREAM7_ATI 0x8774 + +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte x, GLbyte y, GLbyte z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *v); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *v); + +#define glClientActiveVertexStreamATI GLEW_GET_FUN(__glewClientActiveVertexStreamATI) +#define glNormalStream3bATI GLEW_GET_FUN(__glewNormalStream3bATI) +#define glNormalStream3bvATI GLEW_GET_FUN(__glewNormalStream3bvATI) +#define glNormalStream3dATI GLEW_GET_FUN(__glewNormalStream3dATI) +#define glNormalStream3dvATI GLEW_GET_FUN(__glewNormalStream3dvATI) +#define glNormalStream3fATI GLEW_GET_FUN(__glewNormalStream3fATI) +#define glNormalStream3fvATI GLEW_GET_FUN(__glewNormalStream3fvATI) +#define glNormalStream3iATI GLEW_GET_FUN(__glewNormalStream3iATI) +#define glNormalStream3ivATI GLEW_GET_FUN(__glewNormalStream3ivATI) +#define glNormalStream3sATI GLEW_GET_FUN(__glewNormalStream3sATI) +#define glNormalStream3svATI GLEW_GET_FUN(__glewNormalStream3svATI) +#define glVertexBlendEnvfATI GLEW_GET_FUN(__glewVertexBlendEnvfATI) +#define glVertexBlendEnviATI GLEW_GET_FUN(__glewVertexBlendEnviATI) +#define glVertexStream2dATI GLEW_GET_FUN(__glewVertexStream2dATI) +#define glVertexStream2dvATI GLEW_GET_FUN(__glewVertexStream2dvATI) +#define glVertexStream2fATI GLEW_GET_FUN(__glewVertexStream2fATI) +#define glVertexStream2fvATI GLEW_GET_FUN(__glewVertexStream2fvATI) +#define glVertexStream2iATI GLEW_GET_FUN(__glewVertexStream2iATI) +#define glVertexStream2ivATI GLEW_GET_FUN(__glewVertexStream2ivATI) +#define glVertexStream2sATI GLEW_GET_FUN(__glewVertexStream2sATI) +#define glVertexStream2svATI GLEW_GET_FUN(__glewVertexStream2svATI) +#define glVertexStream3dATI GLEW_GET_FUN(__glewVertexStream3dATI) +#define glVertexStream3dvATI GLEW_GET_FUN(__glewVertexStream3dvATI) +#define glVertexStream3fATI GLEW_GET_FUN(__glewVertexStream3fATI) +#define glVertexStream3fvATI GLEW_GET_FUN(__glewVertexStream3fvATI) +#define glVertexStream3iATI GLEW_GET_FUN(__glewVertexStream3iATI) +#define glVertexStream3ivATI GLEW_GET_FUN(__glewVertexStream3ivATI) +#define glVertexStream3sATI GLEW_GET_FUN(__glewVertexStream3sATI) +#define glVertexStream3svATI GLEW_GET_FUN(__glewVertexStream3svATI) +#define glVertexStream4dATI GLEW_GET_FUN(__glewVertexStream4dATI) +#define glVertexStream4dvATI GLEW_GET_FUN(__glewVertexStream4dvATI) +#define glVertexStream4fATI GLEW_GET_FUN(__glewVertexStream4fATI) +#define glVertexStream4fvATI GLEW_GET_FUN(__glewVertexStream4fvATI) +#define glVertexStream4iATI GLEW_GET_FUN(__glewVertexStream4iATI) +#define glVertexStream4ivATI GLEW_GET_FUN(__glewVertexStream4ivATI) +#define glVertexStream4sATI GLEW_GET_FUN(__glewVertexStream4sATI) +#define glVertexStream4svATI GLEW_GET_FUN(__glewVertexStream4svATI) + +#define GLEW_ATI_vertex_streams GLEW_GET_VAR(__GLEW_ATI_vertex_streams) + +#endif /* GL_ATI_vertex_streams */ + +/* --------------------------- GL_EXT_422_pixels --------------------------- */ + +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 + +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF + +#define GLEW_EXT_422_pixels GLEW_GET_VAR(__GLEW_EXT_422_pixels) + +#endif /* GL_EXT_422_pixels */ + +/* ---------------------------- GL_EXT_Cg_shader --------------------------- */ + +#ifndef GL_EXT_Cg_shader +#define GL_EXT_Cg_shader 1 + +#define GL_CG_VERTEX_SHADER_EXT 0x890E +#define GL_CG_FRAGMENT_SHADER_EXT 0x890F + +#define GLEW_EXT_Cg_shader GLEW_GET_VAR(__GLEW_EXT_Cg_shader) + +#endif /* GL_EXT_Cg_shader */ + +/* ------------------------------ GL_EXT_abgr ------------------------------ */ + +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 + +#define GL_ABGR_EXT 0x8000 + +#define GLEW_EXT_abgr GLEW_GET_VAR(__GLEW_EXT_abgr) + +#endif /* GL_EXT_abgr */ + +/* ------------------------------ GL_EXT_bgra ------------------------------ */ + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 + +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 + +#define GLEW_EXT_bgra GLEW_GET_VAR(__GLEW_EXT_bgra) + +#endif /* GL_EXT_bgra */ + +/* --------------------------- GL_EXT_blend_color -------------------------- */ + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 + +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 + +typedef void (GLAPIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); + +#define glBlendColorEXT GLEW_GET_FUN(__glewBlendColorEXT) + +#define GLEW_EXT_blend_color GLEW_GET_VAR(__GLEW_EXT_blend_color) + +#endif /* GL_EXT_blend_color */ + +/* --------------------- GL_EXT_blend_equation_separate -------------------- */ + +#ifndef GL_EXT_blend_equation_separate +#define GL_EXT_blend_equation_separate 1 + +#define GL_BLEND_EQUATION_RGB_EXT 0x8009 +#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); + +#define glBlendEquationSeparateEXT GLEW_GET_FUN(__glewBlendEquationSeparateEXT) + +#define GLEW_EXT_blend_equation_separate GLEW_GET_VAR(__GLEW_EXT_blend_equation_separate) + +#endif /* GL_EXT_blend_equation_separate */ + +/* ----------------------- GL_EXT_blend_func_separate ---------------------- */ + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 + +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB + +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); + +#define glBlendFuncSeparateEXT GLEW_GET_FUN(__glewBlendFuncSeparateEXT) + +#define GLEW_EXT_blend_func_separate GLEW_GET_VAR(__GLEW_EXT_blend_func_separate) + +#endif /* GL_EXT_blend_func_separate */ + +/* ------------------------- GL_EXT_blend_logic_op ------------------------- */ + +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 + +#define GLEW_EXT_blend_logic_op GLEW_GET_VAR(__GLEW_EXT_blend_logic_op) + +#endif /* GL_EXT_blend_logic_op */ + +/* -------------------------- GL_EXT_blend_minmax -------------------------- */ + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 + +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); + +#define glBlendEquationEXT GLEW_GET_FUN(__glewBlendEquationEXT) + +#define GLEW_EXT_blend_minmax GLEW_GET_VAR(__GLEW_EXT_blend_minmax) + +#endif /* GL_EXT_blend_minmax */ + +/* ------------------------- GL_EXT_blend_subtract ------------------------- */ + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 + +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B + +#define GLEW_EXT_blend_subtract GLEW_GET_VAR(__GLEW_EXT_blend_subtract) + +#endif /* GL_EXT_blend_subtract */ + +/* ------------------------ GL_EXT_clip_volume_hint ------------------------ */ + +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 + +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 + +#define GLEW_EXT_clip_volume_hint GLEW_GET_VAR(__GLEW_EXT_clip_volume_hint) + +#endif /* GL_EXT_clip_volume_hint */ + +/* ------------------------------ GL_EXT_cmyka ----------------------------- */ + +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 + +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F + +#define GLEW_EXT_cmyka GLEW_GET_VAR(__GLEW_EXT_cmyka) + +#endif /* GL_EXT_cmyka */ + +/* ------------------------- GL_EXT_color_subtable ------------------------- */ + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 + +typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void* data); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); + +#define glColorSubTableEXT GLEW_GET_FUN(__glewColorSubTableEXT) +#define glCopyColorSubTableEXT GLEW_GET_FUN(__glewCopyColorSubTableEXT) + +#define GLEW_EXT_color_subtable GLEW_GET_VAR(__GLEW_EXT_color_subtable) + +#endif /* GL_EXT_color_subtable */ + +/* ---------------------- GL_EXT_compiled_vertex_array --------------------- */ + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 + +typedef void (GLAPIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); + +#define glLockArraysEXT GLEW_GET_FUN(__glewLockArraysEXT) +#define glUnlockArraysEXT GLEW_GET_FUN(__glewUnlockArraysEXT) + +#define GLEW_EXT_compiled_vertex_array GLEW_GET_VAR(__GLEW_EXT_compiled_vertex_array) + +#endif /* GL_EXT_compiled_vertex_array */ + +/* --------------------------- GL_EXT_convolution -------------------------- */ + +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 + +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 + +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void* image); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void* row, void* column, void* span); +typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* row, const void* column); + +#define glConvolutionFilter1DEXT GLEW_GET_FUN(__glewConvolutionFilter1DEXT) +#define glConvolutionFilter2DEXT GLEW_GET_FUN(__glewConvolutionFilter2DEXT) +#define glConvolutionParameterfEXT GLEW_GET_FUN(__glewConvolutionParameterfEXT) +#define glConvolutionParameterfvEXT GLEW_GET_FUN(__glewConvolutionParameterfvEXT) +#define glConvolutionParameteriEXT GLEW_GET_FUN(__glewConvolutionParameteriEXT) +#define glConvolutionParameterivEXT GLEW_GET_FUN(__glewConvolutionParameterivEXT) +#define glCopyConvolutionFilter1DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter1DEXT) +#define glCopyConvolutionFilter2DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter2DEXT) +#define glGetConvolutionFilterEXT GLEW_GET_FUN(__glewGetConvolutionFilterEXT) +#define glGetConvolutionParameterfvEXT GLEW_GET_FUN(__glewGetConvolutionParameterfvEXT) +#define glGetConvolutionParameterivEXT GLEW_GET_FUN(__glewGetConvolutionParameterivEXT) +#define glGetSeparableFilterEXT GLEW_GET_FUN(__glewGetSeparableFilterEXT) +#define glSeparableFilter2DEXT GLEW_GET_FUN(__glewSeparableFilter2DEXT) + +#define GLEW_EXT_convolution GLEW_GET_VAR(__GLEW_EXT_convolution) + +#endif /* GL_EXT_convolution */ + +/* ------------------------ GL_EXT_coordinate_frame ------------------------ */ + +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 + +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 + +typedef void (GLAPIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, void* pointer); +typedef void (GLAPIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, void* pointer); + +#define glBinormalPointerEXT GLEW_GET_FUN(__glewBinormalPointerEXT) +#define glTangentPointerEXT GLEW_GET_FUN(__glewTangentPointerEXT) + +#define GLEW_EXT_coordinate_frame GLEW_GET_VAR(__GLEW_EXT_coordinate_frame) + +#endif /* GL_EXT_coordinate_frame */ + +/* -------------------------- GL_EXT_copy_texture -------------------------- */ + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 + +typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); + +#define glCopyTexImage1DEXT GLEW_GET_FUN(__glewCopyTexImage1DEXT) +#define glCopyTexImage2DEXT GLEW_GET_FUN(__glewCopyTexImage2DEXT) +#define glCopyTexSubImage1DEXT GLEW_GET_FUN(__glewCopyTexSubImage1DEXT) +#define glCopyTexSubImage2DEXT GLEW_GET_FUN(__glewCopyTexSubImage2DEXT) +#define glCopyTexSubImage3DEXT GLEW_GET_FUN(__glewCopyTexSubImage3DEXT) + +#define GLEW_EXT_copy_texture GLEW_GET_VAR(__GLEW_EXT_copy_texture) + +#endif /* GL_EXT_copy_texture */ + +/* --------------------------- GL_EXT_cull_vertex -------------------------- */ + +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 + +typedef void (GLAPIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat* params); + +#define glCullParameterdvEXT GLEW_GET_FUN(__glewCullParameterdvEXT) +#define glCullParameterfvEXT GLEW_GET_FUN(__glewCullParameterfvEXT) + +#define GLEW_EXT_cull_vertex GLEW_GET_VAR(__GLEW_EXT_cull_vertex) + +#endif /* GL_EXT_cull_vertex */ + +/* ------------------------ GL_EXT_depth_bounds_test ----------------------- */ + +#ifndef GL_EXT_depth_bounds_test +#define GL_EXT_depth_bounds_test 1 + +#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 +#define GL_DEPTH_BOUNDS_EXT 0x8891 + +typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); + +#define glDepthBoundsEXT GLEW_GET_FUN(__glewDepthBoundsEXT) + +#define GLEW_EXT_depth_bounds_test GLEW_GET_VAR(__GLEW_EXT_depth_bounds_test) + +#endif /* GL_EXT_depth_bounds_test */ + +/* ----------------------- GL_EXT_draw_range_elements ---------------------- */ + +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 + +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 + +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); + +#define glDrawRangeElementsEXT GLEW_GET_FUN(__glewDrawRangeElementsEXT) + +#define GLEW_EXT_draw_range_elements GLEW_GET_VAR(__GLEW_EXT_draw_range_elements) + +#endif /* GL_EXT_draw_range_elements */ + +/* ---------------------------- GL_EXT_fog_coord --------------------------- */ + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 + +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 + +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); + +#define glFogCoordPointerEXT GLEW_GET_FUN(__glewFogCoordPointerEXT) +#define glFogCoorddEXT GLEW_GET_FUN(__glewFogCoorddEXT) +#define glFogCoorddvEXT GLEW_GET_FUN(__glewFogCoorddvEXT) +#define glFogCoordfEXT GLEW_GET_FUN(__glewFogCoordfEXT) +#define glFogCoordfvEXT GLEW_GET_FUN(__glewFogCoordfvEXT) + +#define GLEW_EXT_fog_coord GLEW_GET_VAR(__GLEW_EXT_fog_coord) + +#endif /* GL_EXT_fog_coord */ + +/* ------------------------ GL_EXT_fragment_lighting ----------------------- */ + +#ifndef GL_EXT_fragment_lighting +#define GL_EXT_fragment_lighting 1 + +#define GL_FRAGMENT_LIGHTING_EXT 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_EXT 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_EXT 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_EXT 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_EXT 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_EXT 0x8405 +#define GL_CURRENT_RASTER_NORMAL_EXT 0x8406 +#define GL_LIGHT_ENV_MODE_EXT 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_EXT 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT 0x840B +#define GL_FRAGMENT_LIGHT0_EXT 0x840C +#define GL_FRAGMENT_LIGHT7_EXT 0x8413 + +typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALEXTPROC) (GLenum face, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFEXTPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVEXTPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIEXTPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVEXTPROC) (GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFEXTPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIEXTPROC) (GLenum light, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFEXTPROC) (GLenum face, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIEXTPROC) (GLenum face, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLLIGHTENVIEXTPROC) (GLenum pname, GLint param); + +#define glFragmentColorMaterialEXT GLEW_GET_FUN(__glewFragmentColorMaterialEXT) +#define glFragmentLightModelfEXT GLEW_GET_FUN(__glewFragmentLightModelfEXT) +#define glFragmentLightModelfvEXT GLEW_GET_FUN(__glewFragmentLightModelfvEXT) +#define glFragmentLightModeliEXT GLEW_GET_FUN(__glewFragmentLightModeliEXT) +#define glFragmentLightModelivEXT GLEW_GET_FUN(__glewFragmentLightModelivEXT) +#define glFragmentLightfEXT GLEW_GET_FUN(__glewFragmentLightfEXT) +#define glFragmentLightfvEXT GLEW_GET_FUN(__glewFragmentLightfvEXT) +#define glFragmentLightiEXT GLEW_GET_FUN(__glewFragmentLightiEXT) +#define glFragmentLightivEXT GLEW_GET_FUN(__glewFragmentLightivEXT) +#define glFragmentMaterialfEXT GLEW_GET_FUN(__glewFragmentMaterialfEXT) +#define glFragmentMaterialfvEXT GLEW_GET_FUN(__glewFragmentMaterialfvEXT) +#define glFragmentMaterialiEXT GLEW_GET_FUN(__glewFragmentMaterialiEXT) +#define glFragmentMaterialivEXT GLEW_GET_FUN(__glewFragmentMaterialivEXT) +#define glGetFragmentLightfvEXT GLEW_GET_FUN(__glewGetFragmentLightfvEXT) +#define glGetFragmentLightivEXT GLEW_GET_FUN(__glewGetFragmentLightivEXT) +#define glGetFragmentMaterialfvEXT GLEW_GET_FUN(__glewGetFragmentMaterialfvEXT) +#define glGetFragmentMaterialivEXT GLEW_GET_FUN(__glewGetFragmentMaterialivEXT) +#define glLightEnviEXT GLEW_GET_FUN(__glewLightEnviEXT) + +#define GLEW_EXT_fragment_lighting GLEW_GET_VAR(__GLEW_EXT_fragment_lighting) + +#endif /* GL_EXT_fragment_lighting */ + +/* ------------------------ GL_EXT_framebuffer_blit ------------------------ */ + +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA + +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + +#define glBlitFramebufferEXT GLEW_GET_FUN(__glewBlitFramebufferEXT) + +#define GLEW_EXT_framebuffer_blit GLEW_GET_VAR(__GLEW_EXT_framebuffer_blit) + +#endif /* GL_EXT_framebuffer_blit */ + +/* --------------------- GL_EXT_framebuffer_multisample -------------------- */ + +#ifndef GL_EXT_framebuffer_multisample +#define GL_EXT_framebuffer_multisample 1 + +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewRenderbufferStorageMultisampleEXT) + +#define GLEW_EXT_framebuffer_multisample GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample) + +#endif /* GL_EXT_framebuffer_multisample */ + +/* ----------------------- GL_EXT_framebuffer_object ----------------------- */ + +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 1 + +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 + +typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); +typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); +typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); +typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); + +#define glBindFramebufferEXT GLEW_GET_FUN(__glewBindFramebufferEXT) +#define glBindRenderbufferEXT GLEW_GET_FUN(__glewBindRenderbufferEXT) +#define glCheckFramebufferStatusEXT GLEW_GET_FUN(__glewCheckFramebufferStatusEXT) +#define glDeleteFramebuffersEXT GLEW_GET_FUN(__glewDeleteFramebuffersEXT) +#define glDeleteRenderbuffersEXT GLEW_GET_FUN(__glewDeleteRenderbuffersEXT) +#define glFramebufferRenderbufferEXT GLEW_GET_FUN(__glewFramebufferRenderbufferEXT) +#define glFramebufferTexture1DEXT GLEW_GET_FUN(__glewFramebufferTexture1DEXT) +#define glFramebufferTexture2DEXT GLEW_GET_FUN(__glewFramebufferTexture2DEXT) +#define glFramebufferTexture3DEXT GLEW_GET_FUN(__glewFramebufferTexture3DEXT) +#define glGenFramebuffersEXT GLEW_GET_FUN(__glewGenFramebuffersEXT) +#define glGenRenderbuffersEXT GLEW_GET_FUN(__glewGenRenderbuffersEXT) +#define glGenerateMipmapEXT GLEW_GET_FUN(__glewGenerateMipmapEXT) +#define glGetFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetFramebufferAttachmentParameterivEXT) +#define glGetRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetRenderbufferParameterivEXT) +#define glIsFramebufferEXT GLEW_GET_FUN(__glewIsFramebufferEXT) +#define glIsRenderbufferEXT GLEW_GET_FUN(__glewIsRenderbufferEXT) +#define glRenderbufferStorageEXT GLEW_GET_FUN(__glewRenderbufferStorageEXT) + +#define GLEW_EXT_framebuffer_object GLEW_GET_VAR(__GLEW_EXT_framebuffer_object) + +#endif /* GL_EXT_framebuffer_object */ + +/* ---------------------------- GL_EXT_histogram --------------------------- */ + +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 + +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 + +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void* values); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void* values); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target); + +#define glGetHistogramEXT GLEW_GET_FUN(__glewGetHistogramEXT) +#define glGetHistogramParameterfvEXT GLEW_GET_FUN(__glewGetHistogramParameterfvEXT) +#define glGetHistogramParameterivEXT GLEW_GET_FUN(__glewGetHistogramParameterivEXT) +#define glGetMinmaxEXT GLEW_GET_FUN(__glewGetMinmaxEXT) +#define glGetMinmaxParameterfvEXT GLEW_GET_FUN(__glewGetMinmaxParameterfvEXT) +#define glGetMinmaxParameterivEXT GLEW_GET_FUN(__glewGetMinmaxParameterivEXT) +#define glHistogramEXT GLEW_GET_FUN(__glewHistogramEXT) +#define glMinmaxEXT GLEW_GET_FUN(__glewMinmaxEXT) +#define glResetHistogramEXT GLEW_GET_FUN(__glewResetHistogramEXT) +#define glResetMinmaxEXT GLEW_GET_FUN(__glewResetMinmaxEXT) + +#define GLEW_EXT_histogram GLEW_GET_VAR(__GLEW_EXT_histogram) + +#endif /* GL_EXT_histogram */ + +/* ----------------------- GL_EXT_index_array_formats ---------------------- */ + +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 + +#define GLEW_EXT_index_array_formats GLEW_GET_VAR(__GLEW_EXT_index_array_formats) + +#endif /* GL_EXT_index_array_formats */ + +/* --------------------------- GL_EXT_index_func --------------------------- */ + +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 + +typedef void (GLAPIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLfloat ref); + +#define glIndexFuncEXT GLEW_GET_FUN(__glewIndexFuncEXT) + +#define GLEW_EXT_index_func GLEW_GET_VAR(__GLEW_EXT_index_func) + +#endif /* GL_EXT_index_func */ + +/* ------------------------- GL_EXT_index_material ------------------------- */ + +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 + +typedef void (GLAPIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); + +#define glIndexMaterialEXT GLEW_GET_FUN(__glewIndexMaterialEXT) + +#define GLEW_EXT_index_material GLEW_GET_VAR(__GLEW_EXT_index_material) + +#endif /* GL_EXT_index_material */ + +/* -------------------------- GL_EXT_index_texture ------------------------- */ + +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 + +#define GLEW_EXT_index_texture GLEW_GET_VAR(__GLEW_EXT_index_texture) + +#endif /* GL_EXT_index_texture */ + +/* -------------------------- GL_EXT_light_texture ------------------------- */ + +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 + +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 + +typedef void (GLAPIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (GLAPIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (GLAPIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); + +#define glApplyTextureEXT GLEW_GET_FUN(__glewApplyTextureEXT) +#define glTextureLightEXT GLEW_GET_FUN(__glewTextureLightEXT) +#define glTextureMaterialEXT GLEW_GET_FUN(__glewTextureMaterialEXT) + +#define GLEW_EXT_light_texture GLEW_GET_VAR(__GLEW_EXT_light_texture) + +#endif /* GL_EXT_light_texture */ + +/* ------------------------- GL_EXT_misc_attribute ------------------------- */ + +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 + +#define GLEW_EXT_misc_attribute GLEW_GET_VAR(__GLEW_EXT_misc_attribute) + +#endif /* GL_EXT_misc_attribute */ + +/* ------------------------ GL_EXT_multi_draw_arrays ----------------------- */ + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint* first, GLsizei *count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, GLsizei* count, GLenum type, const GLvoid **indices, GLsizei primcount); + +#define glMultiDrawArraysEXT GLEW_GET_FUN(__glewMultiDrawArraysEXT) +#define glMultiDrawElementsEXT GLEW_GET_FUN(__glewMultiDrawElementsEXT) + +#define GLEW_EXT_multi_draw_arrays GLEW_GET_VAR(__GLEW_EXT_multi_draw_arrays) + +#endif /* GL_EXT_multi_draw_arrays */ + +/* --------------------------- GL_EXT_multisample -------------------------- */ + +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 + +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 + +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); + +#define glSampleMaskEXT GLEW_GET_FUN(__glewSampleMaskEXT) +#define glSamplePatternEXT GLEW_GET_FUN(__glewSamplePatternEXT) + +#define GLEW_EXT_multisample GLEW_GET_VAR(__GLEW_EXT_multisample) + +#endif /* GL_EXT_multisample */ + +/* ---------------------- GL_EXT_packed_depth_stencil ---------------------- */ + +#ifndef GL_EXT_packed_depth_stencil +#define GL_EXT_packed_depth_stencil 1 + +#define GL_DEPTH_STENCIL_EXT 0x84F9 +#define GL_UNSIGNED_INT_24_8_EXT 0x84FA +#define GL_DEPTH24_STENCIL8_EXT 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 + +#define GLEW_EXT_packed_depth_stencil GLEW_GET_VAR(__GLEW_EXT_packed_depth_stencil) + +#endif /* GL_EXT_packed_depth_stencil */ + +/* -------------------------- GL_EXT_packed_pixels ------------------------- */ + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 + +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 + +#define GLEW_EXT_packed_pixels GLEW_GET_VAR(__GLEW_EXT_packed_pixels) + +#endif /* GL_EXT_packed_pixels */ + +/* ------------------------ GL_EXT_paletted_texture ------------------------ */ + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 + +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 +#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B + +typedef void (GLAPIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void* data); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, void* data); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); + +#define glColorTableEXT GLEW_GET_FUN(__glewColorTableEXT) +#define glGetColorTableEXT GLEW_GET_FUN(__glewGetColorTableEXT) +#define glGetColorTableParameterfvEXT GLEW_GET_FUN(__glewGetColorTableParameterfvEXT) +#define glGetColorTableParameterivEXT GLEW_GET_FUN(__glewGetColorTableParameterivEXT) + +#define GLEW_EXT_paletted_texture GLEW_GET_VAR(__GLEW_EXT_paletted_texture) + +#endif /* GL_EXT_paletted_texture */ + +/* ----------------------- GL_EXT_pixel_buffer_object ---------------------- */ + +#ifndef GL_EXT_pixel_buffer_object +#define GL_EXT_pixel_buffer_object 1 + +#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF + +#define GLEW_EXT_pixel_buffer_object GLEW_GET_VAR(__GLEW_EXT_pixel_buffer_object) + +#endif /* GL_EXT_pixel_buffer_object */ + +/* ------------------------- GL_EXT_pixel_transform ------------------------ */ + +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 + +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 + +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glGetPixelTransformParameterfvEXT GLEW_GET_FUN(__glewGetPixelTransformParameterfvEXT) +#define glGetPixelTransformParameterivEXT GLEW_GET_FUN(__glewGetPixelTransformParameterivEXT) +#define glPixelTransformParameterfEXT GLEW_GET_FUN(__glewPixelTransformParameterfEXT) +#define glPixelTransformParameterfvEXT GLEW_GET_FUN(__glewPixelTransformParameterfvEXT) +#define glPixelTransformParameteriEXT GLEW_GET_FUN(__glewPixelTransformParameteriEXT) +#define glPixelTransformParameterivEXT GLEW_GET_FUN(__glewPixelTransformParameterivEXT) + +#define GLEW_EXT_pixel_transform GLEW_GET_VAR(__GLEW_EXT_pixel_transform) + +#endif /* GL_EXT_pixel_transform */ + +/* ------------------- GL_EXT_pixel_transform_color_table ------------------ */ + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 + +#define GLEW_EXT_pixel_transform_color_table GLEW_GET_VAR(__GLEW_EXT_pixel_transform_color_table) + +#endif /* GL_EXT_pixel_transform_color_table */ + +/* ------------------------ GL_EXT_point_parameters ------------------------ */ + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 + +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, GLfloat* params); + +#define glPointParameterfEXT GLEW_GET_FUN(__glewPointParameterfEXT) +#define glPointParameterfvEXT GLEW_GET_FUN(__glewPointParameterfvEXT) + +#define GLEW_EXT_point_parameters GLEW_GET_VAR(__GLEW_EXT_point_parameters) + +#endif /* GL_EXT_point_parameters */ + +/* ------------------------- GL_EXT_polygon_offset ------------------------- */ + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 + +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 + +typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); + +#define glPolygonOffsetEXT GLEW_GET_FUN(__glewPolygonOffsetEXT) + +#define GLEW_EXT_polygon_offset GLEW_GET_VAR(__GLEW_EXT_polygon_offset) + +#endif /* GL_EXT_polygon_offset */ + +/* ------------------------- GL_EXT_rescale_normal ------------------------- */ + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 + +#define GLEW_EXT_rescale_normal GLEW_GET_VAR(__GLEW_EXT_rescale_normal) + +#endif /* GL_EXT_rescale_normal */ + +/* -------------------------- GL_EXT_scene_marker -------------------------- */ + +#ifndef GL_EXT_scene_marker +#define GL_EXT_scene_marker 1 + +typedef void (GLAPIENTRY * PFNGLBEGINSCENEEXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLENDSCENEEXTPROC) (void); + +#define glBeginSceneEXT GLEW_GET_FUN(__glewBeginSceneEXT) +#define glEndSceneEXT GLEW_GET_FUN(__glewEndSceneEXT) + +#define GLEW_EXT_scene_marker GLEW_GET_VAR(__GLEW_EXT_scene_marker) + +#endif /* GL_EXT_scene_marker */ + +/* ------------------------- GL_EXT_secondary_color ------------------------ */ + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 + +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E + +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); + +#define glSecondaryColor3bEXT GLEW_GET_FUN(__glewSecondaryColor3bEXT) +#define glSecondaryColor3bvEXT GLEW_GET_FUN(__glewSecondaryColor3bvEXT) +#define glSecondaryColor3dEXT GLEW_GET_FUN(__glewSecondaryColor3dEXT) +#define glSecondaryColor3dvEXT GLEW_GET_FUN(__glewSecondaryColor3dvEXT) +#define glSecondaryColor3fEXT GLEW_GET_FUN(__glewSecondaryColor3fEXT) +#define glSecondaryColor3fvEXT GLEW_GET_FUN(__glewSecondaryColor3fvEXT) +#define glSecondaryColor3iEXT GLEW_GET_FUN(__glewSecondaryColor3iEXT) +#define glSecondaryColor3ivEXT GLEW_GET_FUN(__glewSecondaryColor3ivEXT) +#define glSecondaryColor3sEXT GLEW_GET_FUN(__glewSecondaryColor3sEXT) +#define glSecondaryColor3svEXT GLEW_GET_FUN(__glewSecondaryColor3svEXT) +#define glSecondaryColor3ubEXT GLEW_GET_FUN(__glewSecondaryColor3ubEXT) +#define glSecondaryColor3ubvEXT GLEW_GET_FUN(__glewSecondaryColor3ubvEXT) +#define glSecondaryColor3uiEXT GLEW_GET_FUN(__glewSecondaryColor3uiEXT) +#define glSecondaryColor3uivEXT GLEW_GET_FUN(__glewSecondaryColor3uivEXT) +#define glSecondaryColor3usEXT GLEW_GET_FUN(__glewSecondaryColor3usEXT) +#define glSecondaryColor3usvEXT GLEW_GET_FUN(__glewSecondaryColor3usvEXT) +#define glSecondaryColorPointerEXT GLEW_GET_FUN(__glewSecondaryColorPointerEXT) + +#define GLEW_EXT_secondary_color GLEW_GET_VAR(__GLEW_EXT_secondary_color) + +#endif /* GL_EXT_secondary_color */ + +/* --------------------- GL_EXT_separate_specular_color -------------------- */ + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 + +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA + +#define GLEW_EXT_separate_specular_color GLEW_GET_VAR(__GLEW_EXT_separate_specular_color) + +#endif /* GL_EXT_separate_specular_color */ + +/* -------------------------- GL_EXT_shadow_funcs -------------------------- */ + +#ifndef GL_EXT_shadow_funcs +#define GL_EXT_shadow_funcs 1 + +#define GLEW_EXT_shadow_funcs GLEW_GET_VAR(__GLEW_EXT_shadow_funcs) + +#endif /* GL_EXT_shadow_funcs */ + +/* --------------------- GL_EXT_shared_texture_palette --------------------- */ + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 + +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB + +#define GLEW_EXT_shared_texture_palette GLEW_GET_VAR(__GLEW_EXT_shared_texture_palette) + +#endif /* GL_EXT_shared_texture_palette */ + +/* ------------------------ GL_EXT_stencil_clear_tag ----------------------- */ + +#ifndef GL_EXT_stencil_clear_tag +#define GL_EXT_stencil_clear_tag 1 + +#define GL_STENCIL_TAG_BITS_EXT 0x88F2 +#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 + +#define GLEW_EXT_stencil_clear_tag GLEW_GET_VAR(__GLEW_EXT_stencil_clear_tag) + +#endif /* GL_EXT_stencil_clear_tag */ + +/* ------------------------ GL_EXT_stencil_two_side ------------------------ */ + +#ifndef GL_EXT_stencil_two_side +#define GL_EXT_stencil_two_side 1 + +#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 +#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 + +typedef void (GLAPIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); + +#define glActiveStencilFaceEXT GLEW_GET_FUN(__glewActiveStencilFaceEXT) + +#define GLEW_EXT_stencil_two_side GLEW_GET_VAR(__GLEW_EXT_stencil_two_side) + +#endif /* GL_EXT_stencil_two_side */ + +/* -------------------------- GL_EXT_stencil_wrap -------------------------- */ + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 + +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 + +#define GLEW_EXT_stencil_wrap GLEW_GET_VAR(__GLEW_EXT_stencil_wrap) + +#endif /* GL_EXT_stencil_wrap */ + +/* --------------------------- GL_EXT_subtexture --------------------------- */ + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 + +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); + +#define glTexSubImage1DEXT GLEW_GET_FUN(__glewTexSubImage1DEXT) +#define glTexSubImage2DEXT GLEW_GET_FUN(__glewTexSubImage2DEXT) +#define glTexSubImage3DEXT GLEW_GET_FUN(__glewTexSubImage3DEXT) + +#define GLEW_EXT_subtexture GLEW_GET_VAR(__GLEW_EXT_subtexture) + +#endif /* GL_EXT_subtexture */ + +/* ----------------------------- GL_EXT_texture ---------------------------- */ + +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 + +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 + +#define GLEW_EXT_texture GLEW_GET_VAR(__GLEW_EXT_texture) + +#endif /* GL_EXT_texture */ + +/* ---------------------------- GL_EXT_texture3D --------------------------- */ + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 + +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); + +#define glTexImage3DEXT GLEW_GET_FUN(__glewTexImage3DEXT) + +#define GLEW_EXT_texture3D GLEW_GET_VAR(__GLEW_EXT_texture3D) + +#endif /* GL_EXT_texture3D */ + +/* -------------------- GL_EXT_texture_compression_dxt1 -------------------- */ + +#ifndef GL_EXT_texture_compression_dxt1 +#define GL_EXT_texture_compression_dxt1 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 + +#define GLEW_EXT_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_EXT_texture_compression_dxt1) + +#endif /* GL_EXT_texture_compression_dxt1 */ + +/* -------------------- GL_EXT_texture_compression_s3tc -------------------- */ + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_EXT_texture_compression_s3tc 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 + +#define GLEW_EXT_texture_compression_s3tc GLEW_GET_VAR(__GLEW_EXT_texture_compression_s3tc) + +#endif /* GL_EXT_texture_compression_s3tc */ + +/* ------------------------ GL_EXT_texture_cube_map ------------------------ */ + +#ifndef GL_EXT_texture_cube_map +#define GL_EXT_texture_cube_map 1 + +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C + +#define GLEW_EXT_texture_cube_map GLEW_GET_VAR(__GLEW_EXT_texture_cube_map) + +#endif /* GL_EXT_texture_cube_map */ + +/* ----------------------- GL_EXT_texture_edge_clamp ----------------------- */ + +#ifndef GL_EXT_texture_edge_clamp +#define GL_EXT_texture_edge_clamp 1 + +#define GL_CLAMP_TO_EDGE_EXT 0x812F + +#define GLEW_EXT_texture_edge_clamp GLEW_GET_VAR(__GLEW_EXT_texture_edge_clamp) + +#endif /* GL_EXT_texture_edge_clamp */ + +/* --------------------------- GL_EXT_texture_env -------------------------- */ + +#ifndef GL_EXT_texture_env +#define GL_EXT_texture_env 1 + +#define GL_TEXTURE_ENV0_EXT 0 +#define GL_ENV_BLEND_EXT 0 +#define GL_TEXTURE_ENV_SHIFT_EXT 0 +#define GL_ENV_REPLACE_EXT 0 +#define GL_ENV_ADD_EXT 0 +#define GL_ENV_SUBTRACT_EXT 0 +#define GL_TEXTURE_ENV_MODE_ALPHA_EXT 0 +#define GL_ENV_REVERSE_SUBTRACT_EXT 0 +#define GL_ENV_REVERSE_BLEND_EXT 0 +#define GL_ENV_COPY_EXT 0 +#define GL_ENV_MODULATE_EXT 0 + +#define GLEW_EXT_texture_env GLEW_GET_VAR(__GLEW_EXT_texture_env) + +#endif /* GL_EXT_texture_env */ + +/* ------------------------- GL_EXT_texture_env_add ------------------------ */ + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 + +#define GLEW_EXT_texture_env_add GLEW_GET_VAR(__GLEW_EXT_texture_env_add) + +#endif /* GL_EXT_texture_env_add */ + +/* ----------------------- GL_EXT_texture_env_combine ---------------------- */ + +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 + +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A + +#define GLEW_EXT_texture_env_combine GLEW_GET_VAR(__GLEW_EXT_texture_env_combine) + +#endif /* GL_EXT_texture_env_combine */ + +/* ------------------------ GL_EXT_texture_env_dot3 ------------------------ */ + +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 + +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 + +#define GLEW_EXT_texture_env_dot3 GLEW_GET_VAR(__GLEW_EXT_texture_env_dot3) + +#endif /* GL_EXT_texture_env_dot3 */ + +/* ------------------- GL_EXT_texture_filter_anisotropic ------------------- */ + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 + +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF + +#define GLEW_EXT_texture_filter_anisotropic GLEW_GET_VAR(__GLEW_EXT_texture_filter_anisotropic) + +#endif /* GL_EXT_texture_filter_anisotropic */ + +/* ------------------------ GL_EXT_texture_lod_bias ------------------------ */ + +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 + +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 + +#define GLEW_EXT_texture_lod_bias GLEW_GET_VAR(__GLEW_EXT_texture_lod_bias) + +#endif /* GL_EXT_texture_lod_bias */ + +/* ---------------------- GL_EXT_texture_mirror_clamp ---------------------- */ + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_EXT_texture_mirror_clamp 1 + +#define GL_MIRROR_CLAMP_EXT 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 + +#define GLEW_EXT_texture_mirror_clamp GLEW_GET_VAR(__GLEW_EXT_texture_mirror_clamp) + +#endif /* GL_EXT_texture_mirror_clamp */ + +/* ------------------------- GL_EXT_texture_object ------------------------- */ + +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 + +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A + +typedef GLboolean (GLAPIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint* textures, GLboolean* residences); +typedef void (GLAPIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (GLAPIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint* textures); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (GLAPIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint* textures, const GLclampf* priorities); + +#define glAreTexturesResidentEXT GLEW_GET_FUN(__glewAreTexturesResidentEXT) +#define glBindTextureEXT GLEW_GET_FUN(__glewBindTextureEXT) +#define glDeleteTexturesEXT GLEW_GET_FUN(__glewDeleteTexturesEXT) +#define glGenTexturesEXT GLEW_GET_FUN(__glewGenTexturesEXT) +#define glIsTextureEXT GLEW_GET_FUN(__glewIsTextureEXT) +#define glPrioritizeTexturesEXT GLEW_GET_FUN(__glewPrioritizeTexturesEXT) + +#define GLEW_EXT_texture_object GLEW_GET_VAR(__GLEW_EXT_texture_object) + +#endif /* GL_EXT_texture_object */ + +/* --------------------- GL_EXT_texture_perturb_normal --------------------- */ + +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 + +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF + +typedef void (GLAPIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); + +#define glTextureNormalEXT GLEW_GET_FUN(__glewTextureNormalEXT) + +#define GLEW_EXT_texture_perturb_normal GLEW_GET_VAR(__GLEW_EXT_texture_perturb_normal) + +#endif /* GL_EXT_texture_perturb_normal */ + +/* ------------------------ GL_EXT_texture_rectangle ----------------------- */ + +#ifndef GL_EXT_texture_rectangle +#define GL_EXT_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_EXT 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_EXT 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_EXT 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT 0x84F8 + +#define GLEW_EXT_texture_rectangle GLEW_GET_VAR(__GLEW_EXT_texture_rectangle) + +#endif /* GL_EXT_texture_rectangle */ + +/* -------------------------- GL_EXT_texture_sRGB -------------------------- */ + +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 + +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F + +#define GLEW_EXT_texture_sRGB GLEW_GET_VAR(__GLEW_EXT_texture_sRGB) + +#endif /* GL_EXT_texture_sRGB */ + +/* -------------------------- GL_EXT_vertex_array -------------------------- */ + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 + +#define GL_DOUBLE_EXT 0x140A +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 + +typedef void (GLAPIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (GLAPIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean* pointer); +typedef void (GLAPIENTRY * PFNGLGETPOINTERVEXTPROC) (GLenum pname, void** params); +typedef void (GLAPIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void* pointer); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void* pointer); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); + +#define glArrayElementEXT GLEW_GET_FUN(__glewArrayElementEXT) +#define glColorPointerEXT GLEW_GET_FUN(__glewColorPointerEXT) +#define glDrawArraysEXT GLEW_GET_FUN(__glewDrawArraysEXT) +#define glEdgeFlagPointerEXT GLEW_GET_FUN(__glewEdgeFlagPointerEXT) +#define glGetPointervEXT GLEW_GET_FUN(__glewGetPointervEXT) +#define glIndexPointerEXT GLEW_GET_FUN(__glewIndexPointerEXT) +#define glNormalPointerEXT GLEW_GET_FUN(__glewNormalPointerEXT) +#define glTexCoordPointerEXT GLEW_GET_FUN(__glewTexCoordPointerEXT) +#define glVertexPointerEXT GLEW_GET_FUN(__glewVertexPointerEXT) + +#define GLEW_EXT_vertex_array GLEW_GET_VAR(__GLEW_EXT_vertex_array) + +#endif /* GL_EXT_vertex_array */ + +/* -------------------------- GL_EXT_vertex_shader ------------------------- */ + +#ifndef GL_EXT_vertex_shader +#define GL_EXT_vertex_shader 1 + +#define GL_VERTEX_SHADER_EXT 0x8780 +#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 +#define GL_OP_INDEX_EXT 0x8782 +#define GL_OP_NEGATE_EXT 0x8783 +#define GL_OP_DOT3_EXT 0x8784 +#define GL_OP_DOT4_EXT 0x8785 +#define GL_OP_MUL_EXT 0x8786 +#define GL_OP_ADD_EXT 0x8787 +#define GL_OP_MADD_EXT 0x8788 +#define GL_OP_FRAC_EXT 0x8789 +#define GL_OP_MAX_EXT 0x878A +#define GL_OP_MIN_EXT 0x878B +#define GL_OP_SET_GE_EXT 0x878C +#define GL_OP_SET_LT_EXT 0x878D +#define GL_OP_CLAMP_EXT 0x878E +#define GL_OP_FLOOR_EXT 0x878F +#define GL_OP_ROUND_EXT 0x8790 +#define GL_OP_EXP_BASE_2_EXT 0x8791 +#define GL_OP_LOG_BASE_2_EXT 0x8792 +#define GL_OP_POWER_EXT 0x8793 +#define GL_OP_RECIP_EXT 0x8794 +#define GL_OP_RECIP_SQRT_EXT 0x8795 +#define GL_OP_SUB_EXT 0x8796 +#define GL_OP_CROSS_PRODUCT_EXT 0x8797 +#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 +#define GL_OP_MOV_EXT 0x8799 +#define GL_OUTPUT_VERTEX_EXT 0x879A +#define GL_OUTPUT_COLOR0_EXT 0x879B +#define GL_OUTPUT_COLOR1_EXT 0x879C +#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D +#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E +#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F +#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 +#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 +#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 +#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 +#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 +#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 +#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 +#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 +#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 +#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 +#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA +#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB +#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC +#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD +#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE +#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF +#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 +#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 +#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 +#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 +#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 +#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 +#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 +#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 +#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 +#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 +#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA +#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB +#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC +#define GL_OUTPUT_FOG_EXT 0x87BD +#define GL_SCALAR_EXT 0x87BE +#define GL_VECTOR_EXT 0x87BF +#define GL_MATRIX_EXT 0x87C0 +#define GL_VARIANT_EXT 0x87C1 +#define GL_INVARIANT_EXT 0x87C2 +#define GL_LOCAL_CONSTANT_EXT 0x87C3 +#define GL_LOCAL_EXT 0x87C4 +#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 +#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 +#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 +#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 +#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CC +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CD +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE +#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF +#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 +#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 +#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 +#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 +#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 +#define GL_X_EXT 0x87D5 +#define GL_Y_EXT 0x87D6 +#define GL_Z_EXT 0x87D7 +#define GL_W_EXT 0x87D8 +#define GL_NEGATIVE_X_EXT 0x87D9 +#define GL_NEGATIVE_Y_EXT 0x87DA +#define GL_NEGATIVE_Z_EXT 0x87DB +#define GL_NEGATIVE_W_EXT 0x87DC +#define GL_ZERO_EXT 0x87DD +#define GL_ONE_EXT 0x87DE +#define GL_NEGATIVE_ONE_EXT 0x87DF +#define GL_NORMALIZED_RANGE_EXT 0x87E0 +#define GL_FULL_RANGE_EXT 0x87E1 +#define GL_CURRENT_VERTEX_EXT 0x87E2 +#define GL_MVP_MATRIX_EXT 0x87E3 +#define GL_VARIANT_VALUE_EXT 0x87E4 +#define GL_VARIANT_DATATYPE_EXT 0x87E5 +#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 +#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 +#define GL_VARIANT_ARRAY_EXT 0x87E8 +#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 +#define GL_INVARIANT_VALUE_EXT 0x87EA +#define GL_INVARIANT_DATATYPE_EXT 0x87EB +#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC +#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED + +typedef void (GLAPIENTRY * PFNGLBEGINVERTEXSHADEREXTPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDPARAMETEREXTPROC) (GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); +typedef void (GLAPIENTRY * PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDVERTEXSHADEREXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLuint (GLAPIENTRY * PFNGLGENSYMBOLSEXTPROC) (GLenum dataType, GLenum storageType, GLenum range, GLuint components); +typedef GLuint (GLAPIENTRY * PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid **data); +typedef void (GLAPIENTRY * PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLboolean (GLAPIENTRY * PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); +typedef void (GLAPIENTRY * PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); +typedef void (GLAPIENTRY * PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +typedef void (GLAPIENTRY * PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +typedef void (GLAPIENTRY * PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (GLAPIENTRY * PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTBVEXTPROC) (GLuint id, GLbyte *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTDVEXTPROC) (GLuint id, GLdouble *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTFVEXTPROC) (GLuint id, GLfloat *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTIVEXTPROC) (GLuint id, GLint *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTSVEXTPROC) (GLuint id, GLshort *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUBVEXTPROC) (GLuint id, GLubyte *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUIVEXTPROC) (GLuint id, GLuint *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUSVEXTPROC) (GLuint id, GLushort *addr); +typedef void (GLAPIENTRY * PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); + +#define glBeginVertexShaderEXT GLEW_GET_FUN(__glewBeginVertexShaderEXT) +#define glBindLightParameterEXT GLEW_GET_FUN(__glewBindLightParameterEXT) +#define glBindMaterialParameterEXT GLEW_GET_FUN(__glewBindMaterialParameterEXT) +#define glBindParameterEXT GLEW_GET_FUN(__glewBindParameterEXT) +#define glBindTexGenParameterEXT GLEW_GET_FUN(__glewBindTexGenParameterEXT) +#define glBindTextureUnitParameterEXT GLEW_GET_FUN(__glewBindTextureUnitParameterEXT) +#define glBindVertexShaderEXT GLEW_GET_FUN(__glewBindVertexShaderEXT) +#define glDeleteVertexShaderEXT GLEW_GET_FUN(__glewDeleteVertexShaderEXT) +#define glDisableVariantClientStateEXT GLEW_GET_FUN(__glewDisableVariantClientStateEXT) +#define glEnableVariantClientStateEXT GLEW_GET_FUN(__glewEnableVariantClientStateEXT) +#define glEndVertexShaderEXT GLEW_GET_FUN(__glewEndVertexShaderEXT) +#define glExtractComponentEXT GLEW_GET_FUN(__glewExtractComponentEXT) +#define glGenSymbolsEXT GLEW_GET_FUN(__glewGenSymbolsEXT) +#define glGenVertexShadersEXT GLEW_GET_FUN(__glewGenVertexShadersEXT) +#define glGetInvariantBooleanvEXT GLEW_GET_FUN(__glewGetInvariantBooleanvEXT) +#define glGetInvariantFloatvEXT GLEW_GET_FUN(__glewGetInvariantFloatvEXT) +#define glGetInvariantIntegervEXT GLEW_GET_FUN(__glewGetInvariantIntegervEXT) +#define glGetLocalConstantBooleanvEXT GLEW_GET_FUN(__glewGetLocalConstantBooleanvEXT) +#define glGetLocalConstantFloatvEXT GLEW_GET_FUN(__glewGetLocalConstantFloatvEXT) +#define glGetLocalConstantIntegervEXT GLEW_GET_FUN(__glewGetLocalConstantIntegervEXT) +#define glGetVariantBooleanvEXT GLEW_GET_FUN(__glewGetVariantBooleanvEXT) +#define glGetVariantFloatvEXT GLEW_GET_FUN(__glewGetVariantFloatvEXT) +#define glGetVariantIntegervEXT GLEW_GET_FUN(__glewGetVariantIntegervEXT) +#define glGetVariantPointervEXT GLEW_GET_FUN(__glewGetVariantPointervEXT) +#define glInsertComponentEXT GLEW_GET_FUN(__glewInsertComponentEXT) +#define glIsVariantEnabledEXT GLEW_GET_FUN(__glewIsVariantEnabledEXT) +#define glSetInvariantEXT GLEW_GET_FUN(__glewSetInvariantEXT) +#define glSetLocalConstantEXT GLEW_GET_FUN(__glewSetLocalConstantEXT) +#define glShaderOp1EXT GLEW_GET_FUN(__glewShaderOp1EXT) +#define glShaderOp2EXT GLEW_GET_FUN(__glewShaderOp2EXT) +#define glShaderOp3EXT GLEW_GET_FUN(__glewShaderOp3EXT) +#define glSwizzleEXT GLEW_GET_FUN(__glewSwizzleEXT) +#define glVariantPointerEXT GLEW_GET_FUN(__glewVariantPointerEXT) +#define glVariantbvEXT GLEW_GET_FUN(__glewVariantbvEXT) +#define glVariantdvEXT GLEW_GET_FUN(__glewVariantdvEXT) +#define glVariantfvEXT GLEW_GET_FUN(__glewVariantfvEXT) +#define glVariantivEXT GLEW_GET_FUN(__glewVariantivEXT) +#define glVariantsvEXT GLEW_GET_FUN(__glewVariantsvEXT) +#define glVariantubvEXT GLEW_GET_FUN(__glewVariantubvEXT) +#define glVariantuivEXT GLEW_GET_FUN(__glewVariantuivEXT) +#define glVariantusvEXT GLEW_GET_FUN(__glewVariantusvEXT) +#define glWriteMaskEXT GLEW_GET_FUN(__glewWriteMaskEXT) + +#define GLEW_EXT_vertex_shader GLEW_GET_VAR(__GLEW_EXT_vertex_shader) + +#endif /* GL_EXT_vertex_shader */ + +/* ------------------------ GL_EXT_vertex_weighting ------------------------ */ + +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 + +#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 +#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6 +#define GL_MODELVIEW0_EXT 0x1700 +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW1_MATRIX_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 + +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, void* pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (GLfloat* weight); + +#define glVertexWeightPointerEXT GLEW_GET_FUN(__glewVertexWeightPointerEXT) +#define glVertexWeightfEXT GLEW_GET_FUN(__glewVertexWeightfEXT) +#define glVertexWeightfvEXT GLEW_GET_FUN(__glewVertexWeightfvEXT) + +#define GLEW_EXT_vertex_weighting GLEW_GET_VAR(__GLEW_EXT_vertex_weighting) + +#endif /* GL_EXT_vertex_weighting */ + +/* ------------------------ GL_GREMEDY_string_marker ----------------------- */ + +#ifndef GL_GREMEDY_string_marker +#define GL_GREMEDY_string_marker 1 + +typedef void (GLAPIENTRY * PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const void* string); + +#define glStringMarkerGREMEDY GLEW_GET_FUN(__glewStringMarkerGREMEDY) + +#define GLEW_GREMEDY_string_marker GLEW_GET_VAR(__GLEW_GREMEDY_string_marker) + +#endif /* GL_GREMEDY_string_marker */ + +/* --------------------- GL_HP_convolution_border_modes -------------------- */ + +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 + +#define GLEW_HP_convolution_border_modes GLEW_GET_VAR(__GLEW_HP_convolution_border_modes) + +#endif /* GL_HP_convolution_border_modes */ + +/* ------------------------- GL_HP_image_transform ------------------------- */ + +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 + +typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glGetImageTransformParameterfvHP GLEW_GET_FUN(__glewGetImageTransformParameterfvHP) +#define glGetImageTransformParameterivHP GLEW_GET_FUN(__glewGetImageTransformParameterivHP) +#define glImageTransformParameterfHP GLEW_GET_FUN(__glewImageTransformParameterfHP) +#define glImageTransformParameterfvHP GLEW_GET_FUN(__glewImageTransformParameterfvHP) +#define glImageTransformParameteriHP GLEW_GET_FUN(__glewImageTransformParameteriHP) +#define glImageTransformParameterivHP GLEW_GET_FUN(__glewImageTransformParameterivHP) + +#define GLEW_HP_image_transform GLEW_GET_VAR(__GLEW_HP_image_transform) + +#endif /* GL_HP_image_transform */ + +/* -------------------------- GL_HP_occlusion_test ------------------------- */ + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 + +#define GL_OCCLUSION_TEST_HP 0x8165 +#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 + +#define GLEW_HP_occlusion_test GLEW_GET_VAR(__GLEW_HP_occlusion_test) + +#endif /* GL_HP_occlusion_test */ + +/* ------------------------- GL_HP_texture_lighting ------------------------ */ + +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 + +#define GLEW_HP_texture_lighting GLEW_GET_VAR(__GLEW_HP_texture_lighting) + +#endif /* GL_HP_texture_lighting */ + +/* --------------------------- GL_IBM_cull_vertex -------------------------- */ + +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 + +#define GL_CULL_VERTEX_IBM 103050 + +#define GLEW_IBM_cull_vertex GLEW_GET_VAR(__GLEW_IBM_cull_vertex) + +#endif /* GL_IBM_cull_vertex */ + +/* ---------------------- GL_IBM_multimode_draw_arrays --------------------- */ + +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 + +typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum* mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum* mode, const GLsizei *count, GLenum type, const GLvoid * const *indices, GLsizei primcount, GLint modestride); + +#define glMultiModeDrawArraysIBM GLEW_GET_FUN(__glewMultiModeDrawArraysIBM) +#define glMultiModeDrawElementsIBM GLEW_GET_FUN(__glewMultiModeDrawElementsIBM) + +#define GLEW_IBM_multimode_draw_arrays GLEW_GET_VAR(__GLEW_IBM_multimode_draw_arrays) + +#endif /* GL_IBM_multimode_draw_arrays */ + +/* ------------------------- GL_IBM_rasterpos_clip ------------------------- */ + +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 + +#define GL_RASTER_POSITION_UNCLIPPED_IBM 103010 + +#define GLEW_IBM_rasterpos_clip GLEW_GET_VAR(__GLEW_IBM_rasterpos_clip) + +#endif /* GL_IBM_rasterpos_clip */ + +/* --------------------------- GL_IBM_static_data -------------------------- */ + +#ifndef GL_IBM_static_data +#define GL_IBM_static_data 1 + +#define GL_ALL_STATIC_DATA_IBM 103060 +#define GL_STATIC_VERTEX_ARRAY_IBM 103061 + +#define GLEW_IBM_static_data GLEW_GET_VAR(__GLEW_IBM_static_data) + +#endif /* GL_IBM_static_data */ + +/* --------------------- GL_IBM_texture_mirrored_repeat -------------------- */ + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_IBM_texture_mirrored_repeat 1 + +#define GL_MIRRORED_REPEAT_IBM 0x8370 + +#define GLEW_IBM_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_IBM_texture_mirrored_repeat) + +#endif /* GL_IBM_texture_mirrored_repeat */ + +/* ----------------------- GL_IBM_vertex_array_lists ----------------------- */ + +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 + +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 + +typedef void (GLAPIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); + +#define glColorPointerListIBM GLEW_GET_FUN(__glewColorPointerListIBM) +#define glEdgeFlagPointerListIBM GLEW_GET_FUN(__glewEdgeFlagPointerListIBM) +#define glFogCoordPointerListIBM GLEW_GET_FUN(__glewFogCoordPointerListIBM) +#define glIndexPointerListIBM GLEW_GET_FUN(__glewIndexPointerListIBM) +#define glNormalPointerListIBM GLEW_GET_FUN(__glewNormalPointerListIBM) +#define glSecondaryColorPointerListIBM GLEW_GET_FUN(__glewSecondaryColorPointerListIBM) +#define glTexCoordPointerListIBM GLEW_GET_FUN(__glewTexCoordPointerListIBM) +#define glVertexPointerListIBM GLEW_GET_FUN(__glewVertexPointerListIBM) + +#define GLEW_IBM_vertex_array_lists GLEW_GET_VAR(__GLEW_IBM_vertex_array_lists) + +#endif /* GL_IBM_vertex_array_lists */ + +/* -------------------------- GL_INGR_color_clamp -------------------------- */ + +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 + +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 + +#define GLEW_INGR_color_clamp GLEW_GET_VAR(__GLEW_INGR_color_clamp) + +#endif /* GL_INGR_color_clamp */ + +/* ------------------------- GL_INGR_interlace_read ------------------------ */ + +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 + +#define GL_INTERLACE_READ_INGR 0x8568 + +#define GLEW_INGR_interlace_read GLEW_GET_VAR(__GLEW_INGR_interlace_read) + +#endif /* GL_INGR_interlace_read */ + +/* ------------------------ GL_INTEL_parallel_arrays ----------------------- */ + +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 + +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 + +typedef void (GLAPIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); + +#define glColorPointervINTEL GLEW_GET_FUN(__glewColorPointervINTEL) +#define glNormalPointervINTEL GLEW_GET_FUN(__glewNormalPointervINTEL) +#define glTexCoordPointervINTEL GLEW_GET_FUN(__glewTexCoordPointervINTEL) +#define glVertexPointervINTEL GLEW_GET_FUN(__glewVertexPointervINTEL) + +#define GLEW_INTEL_parallel_arrays GLEW_GET_VAR(__GLEW_INTEL_parallel_arrays) + +#endif /* GL_INTEL_parallel_arrays */ + +/* ------------------------ GL_INTEL_texture_scissor ----------------------- */ + +#ifndef GL_INTEL_texture_scissor +#define GL_INTEL_texture_scissor 1 + +typedef void (GLAPIENTRY * PFNGLTEXSCISSORFUNCINTELPROC) (GLenum target, GLenum lfunc, GLenum hfunc); +typedef void (GLAPIENTRY * PFNGLTEXSCISSORINTELPROC) (GLenum target, GLclampf tlow, GLclampf thigh); + +#define glTexScissorFuncINTEL GLEW_GET_FUN(__glewTexScissorFuncINTEL) +#define glTexScissorINTEL GLEW_GET_FUN(__glewTexScissorINTEL) + +#define GLEW_INTEL_texture_scissor GLEW_GET_VAR(__GLEW_INTEL_texture_scissor) + +#endif /* GL_INTEL_texture_scissor */ + +/* -------------------------- GL_KTX_buffer_region ------------------------- */ + +#ifndef GL_KTX_buffer_region +#define GL_KTX_buffer_region 1 + +#define GL_KTX_FRONT_REGION 0x0 +#define GL_KTX_BACK_REGION 0x1 +#define GL_KTX_Z_REGION 0x2 +#define GL_KTX_STENCIL_REGION 0x3 + +typedef GLuint (GLAPIENTRY * PFNGLBUFFERREGIONENABLEDEXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERREGIONEXTPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERREGIONEXTPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest); +typedef GLuint (GLAPIENTRY * PFNGLNEWBUFFERREGIONEXTPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLREADBUFFERREGIONEXTPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height); + +#define glBufferRegionEnabledEXT GLEW_GET_FUN(__glewBufferRegionEnabledEXT) +#define glDeleteBufferRegionEXT GLEW_GET_FUN(__glewDeleteBufferRegionEXT) +#define glDrawBufferRegionEXT GLEW_GET_FUN(__glewDrawBufferRegionEXT) +#define glNewBufferRegionEXT GLEW_GET_FUN(__glewNewBufferRegionEXT) +#define glReadBufferRegionEXT GLEW_GET_FUN(__glewReadBufferRegionEXT) + +#define GLEW_KTX_buffer_region GLEW_GET_VAR(__GLEW_KTX_buffer_region) + +#endif /* GL_KTX_buffer_region */ + +/* ------------------------- GL_MESAX_texture_stack ------------------------ */ + +#ifndef GL_MESAX_texture_stack +#define GL_MESAX_texture_stack 1 + +#define GL_TEXTURE_1D_STACK_MESAX 0x8759 +#define GL_TEXTURE_2D_STACK_MESAX 0x875A +#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B +#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C +#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D +#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E + +#define GLEW_MESAX_texture_stack GLEW_GET_VAR(__GLEW_MESAX_texture_stack) + +#endif /* GL_MESAX_texture_stack */ + +/* -------------------------- GL_MESA_pack_invert -------------------------- */ + +#ifndef GL_MESA_pack_invert +#define GL_MESA_pack_invert 1 + +#define GL_PACK_INVERT_MESA 0x8758 + +#define GLEW_MESA_pack_invert GLEW_GET_VAR(__GLEW_MESA_pack_invert) + +#endif /* GL_MESA_pack_invert */ + +/* ------------------------- GL_MESA_resize_buffers ------------------------ */ + +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 + +typedef void (GLAPIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void); + +#define glResizeBuffersMESA GLEW_GET_FUN(__glewResizeBuffersMESA) + +#define GLEW_MESA_resize_buffers GLEW_GET_VAR(__GLEW_MESA_resize_buffers) + +#endif /* GL_MESA_resize_buffers */ + +/* --------------------------- GL_MESA_window_pos -------------------------- */ + +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 + +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort* p); + +#define glWindowPos2dMESA GLEW_GET_FUN(__glewWindowPos2dMESA) +#define glWindowPos2dvMESA GLEW_GET_FUN(__glewWindowPos2dvMESA) +#define glWindowPos2fMESA GLEW_GET_FUN(__glewWindowPos2fMESA) +#define glWindowPos2fvMESA GLEW_GET_FUN(__glewWindowPos2fvMESA) +#define glWindowPos2iMESA GLEW_GET_FUN(__glewWindowPos2iMESA) +#define glWindowPos2ivMESA GLEW_GET_FUN(__glewWindowPos2ivMESA) +#define glWindowPos2sMESA GLEW_GET_FUN(__glewWindowPos2sMESA) +#define glWindowPos2svMESA GLEW_GET_FUN(__glewWindowPos2svMESA) +#define glWindowPos3dMESA GLEW_GET_FUN(__glewWindowPos3dMESA) +#define glWindowPos3dvMESA GLEW_GET_FUN(__glewWindowPos3dvMESA) +#define glWindowPos3fMESA GLEW_GET_FUN(__glewWindowPos3fMESA) +#define glWindowPos3fvMESA GLEW_GET_FUN(__glewWindowPos3fvMESA) +#define glWindowPos3iMESA GLEW_GET_FUN(__glewWindowPos3iMESA) +#define glWindowPos3ivMESA GLEW_GET_FUN(__glewWindowPos3ivMESA) +#define glWindowPos3sMESA GLEW_GET_FUN(__glewWindowPos3sMESA) +#define glWindowPos3svMESA GLEW_GET_FUN(__glewWindowPos3svMESA) +#define glWindowPos4dMESA GLEW_GET_FUN(__glewWindowPos4dMESA) +#define glWindowPos4dvMESA GLEW_GET_FUN(__glewWindowPos4dvMESA) +#define glWindowPos4fMESA GLEW_GET_FUN(__glewWindowPos4fMESA) +#define glWindowPos4fvMESA GLEW_GET_FUN(__glewWindowPos4fvMESA) +#define glWindowPos4iMESA GLEW_GET_FUN(__glewWindowPos4iMESA) +#define glWindowPos4ivMESA GLEW_GET_FUN(__glewWindowPos4ivMESA) +#define glWindowPos4sMESA GLEW_GET_FUN(__glewWindowPos4sMESA) +#define glWindowPos4svMESA GLEW_GET_FUN(__glewWindowPos4svMESA) + +#define GLEW_MESA_window_pos GLEW_GET_VAR(__GLEW_MESA_window_pos) + +#endif /* GL_MESA_window_pos */ + +/* ------------------------- GL_MESA_ycbcr_texture ------------------------- */ + +#ifndef GL_MESA_ycbcr_texture +#define GL_MESA_ycbcr_texture 1 + +#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB +#define GL_YCBCR_MESA 0x8757 + +#define GLEW_MESA_ycbcr_texture GLEW_GET_VAR(__GLEW_MESA_ycbcr_texture) + +#endif /* GL_MESA_ycbcr_texture */ + +/* --------------------------- GL_NV_blend_square -------------------------- */ + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 + +#define GLEW_NV_blend_square GLEW_GET_VAR(__GLEW_NV_blend_square) + +#endif /* GL_NV_blend_square */ + +/* ----------------------- GL_NV_copy_depth_to_color ----------------------- */ + +#ifndef GL_NV_copy_depth_to_color +#define GL_NV_copy_depth_to_color 1 + +#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E +#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F + +#define GLEW_NV_copy_depth_to_color GLEW_GET_VAR(__GLEW_NV_copy_depth_to_color) + +#endif /* GL_NV_copy_depth_to_color */ + +/* --------------------------- GL_NV_depth_clamp --------------------------- */ + +#ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 + +#define GL_DEPTH_CLAMP_NV 0x864F + +#define GLEW_NV_depth_clamp GLEW_GET_VAR(__GLEW_NV_depth_clamp) + +#endif /* GL_NV_depth_clamp */ + +/* ---------------------------- GL_NV_evaluators --------------------------- */ + +#ifndef GL_NV_evaluators +#define GL_NV_evaluators 1 + +#define GL_EVAL_2D_NV 0x86C0 +#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 +#define GL_MAP_TESSELLATION_NV 0x86C2 +#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 +#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 +#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 +#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 +#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 +#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 +#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 +#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA +#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB +#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC +#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD +#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE +#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF +#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 +#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 +#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 +#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 +#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 +#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 +#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 +#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 + +typedef void (GLAPIENTRY * PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); +typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void* points); +typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void* points); +typedef void (GLAPIENTRY * PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glEvalMapsNV GLEW_GET_FUN(__glewEvalMapsNV) +#define glGetMapAttribParameterfvNV GLEW_GET_FUN(__glewGetMapAttribParameterfvNV) +#define glGetMapAttribParameterivNV GLEW_GET_FUN(__glewGetMapAttribParameterivNV) +#define glGetMapControlPointsNV GLEW_GET_FUN(__glewGetMapControlPointsNV) +#define glGetMapParameterfvNV GLEW_GET_FUN(__glewGetMapParameterfvNV) +#define glGetMapParameterivNV GLEW_GET_FUN(__glewGetMapParameterivNV) +#define glMapControlPointsNV GLEW_GET_FUN(__glewMapControlPointsNV) +#define glMapParameterfvNV GLEW_GET_FUN(__glewMapParameterfvNV) +#define glMapParameterivNV GLEW_GET_FUN(__glewMapParameterivNV) + +#define GLEW_NV_evaluators GLEW_GET_VAR(__GLEW_NV_evaluators) + +#endif /* GL_NV_evaluators */ + +/* ------------------------------ GL_NV_fence ------------------------------ */ + +#ifndef GL_NV_fence +#define GL_NV_fence 1 + +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 + +typedef void (GLAPIENTRY * PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint* fences); +typedef void (GLAPIENTRY * PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLGENFENCESNVPROC) (GLsizei n, GLuint* fences); +typedef void (GLAPIENTRY * PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFENCENVPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence); + +#define glDeleteFencesNV GLEW_GET_FUN(__glewDeleteFencesNV) +#define glFinishFenceNV GLEW_GET_FUN(__glewFinishFenceNV) +#define glGenFencesNV GLEW_GET_FUN(__glewGenFencesNV) +#define glGetFenceivNV GLEW_GET_FUN(__glewGetFenceivNV) +#define glIsFenceNV GLEW_GET_FUN(__glewIsFenceNV) +#define glSetFenceNV GLEW_GET_FUN(__glewSetFenceNV) +#define glTestFenceNV GLEW_GET_FUN(__glewTestFenceNV) + +#define GLEW_NV_fence GLEW_GET_VAR(__GLEW_NV_fence) + +#endif /* GL_NV_fence */ + +/* --------------------------- GL_NV_float_buffer -------------------------- */ + +#ifndef GL_NV_float_buffer +#define GL_NV_float_buffer 1 + +#define GL_FLOAT_R_NV 0x8880 +#define GL_FLOAT_RG_NV 0x8881 +#define GL_FLOAT_RGB_NV 0x8882 +#define GL_FLOAT_RGBA_NV 0x8883 +#define GL_FLOAT_R16_NV 0x8884 +#define GL_FLOAT_R32_NV 0x8885 +#define GL_FLOAT_RG16_NV 0x8886 +#define GL_FLOAT_RG32_NV 0x8887 +#define GL_FLOAT_RGB16_NV 0x8888 +#define GL_FLOAT_RGB32_NV 0x8889 +#define GL_FLOAT_RGBA16_NV 0x888A +#define GL_FLOAT_RGBA32_NV 0x888B +#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C +#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D +#define GL_FLOAT_RGBA_MODE_NV 0x888E + +#define GLEW_NV_float_buffer GLEW_GET_VAR(__GLEW_NV_float_buffer) + +#endif /* GL_NV_float_buffer */ + +/* --------------------------- GL_NV_fog_distance -------------------------- */ + +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 + +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C + +#define GLEW_NV_fog_distance GLEW_GET_VAR(__GLEW_NV_fog_distance) + +#endif /* GL_NV_fog_distance */ + +/* ------------------------- GL_NV_fragment_program ------------------------ */ + +#ifndef GL_NV_fragment_program +#define GL_NV_fragment_program 1 + +#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 +#define GL_FRAGMENT_PROGRAM_NV 0x8870 +#define GL_MAX_TEXTURE_COORDS_NV 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 +#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 +#define GL_PROGRAM_ERROR_STRING_NV 0x8874 + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble *params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLdouble v[]); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLfloat v[]); + +#define glGetProgramNamedParameterdvNV GLEW_GET_FUN(__glewGetProgramNamedParameterdvNV) +#define glGetProgramNamedParameterfvNV GLEW_GET_FUN(__glewGetProgramNamedParameterfvNV) +#define glProgramNamedParameter4dNV GLEW_GET_FUN(__glewProgramNamedParameter4dNV) +#define glProgramNamedParameter4dvNV GLEW_GET_FUN(__glewProgramNamedParameter4dvNV) +#define glProgramNamedParameter4fNV GLEW_GET_FUN(__glewProgramNamedParameter4fNV) +#define glProgramNamedParameter4fvNV GLEW_GET_FUN(__glewProgramNamedParameter4fvNV) + +#define GLEW_NV_fragment_program GLEW_GET_VAR(__GLEW_NV_fragment_program) + +#endif /* GL_NV_fragment_program */ + +/* ------------------------ GL_NV_fragment_program2 ------------------------ */ + +#ifndef GL_NV_fragment_program2 +#define GL_NV_fragment_program2 1 + +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 +#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 +#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 +#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 + +#define GLEW_NV_fragment_program2 GLEW_GET_VAR(__GLEW_NV_fragment_program2) + +#endif /* GL_NV_fragment_program2 */ + +/* --------------------- GL_NV_fragment_program_option --------------------- */ + +#ifndef GL_NV_fragment_program_option +#define GL_NV_fragment_program_option 1 + +#define GLEW_NV_fragment_program_option GLEW_GET_VAR(__GLEW_NV_fragment_program_option) + +#endif /* GL_NV_fragment_program_option */ + +/* ---------------------------- GL_NV_half_float --------------------------- */ + +#ifndef GL_NV_half_float +#define GL_NV_half_float 1 + +#define GL_HALF_FLOAT_NV 0x140B + +typedef unsigned short GLhalf; + +typedef void (GLAPIENTRY * PFNGLCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); +typedef void (GLAPIENTRY * PFNGLCOLOR3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLCOLOR4HNVPROC) (GLhalf red, GLhalf green, GLhalf blue, GLhalf alpha); +typedef void (GLAPIENTRY * PFNGLCOLOR4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLFOGCOORDHNVPROC) (GLhalf fog); +typedef void (GLAPIENTRY * PFNGLFOGCOORDHVNVPROC) (const GLhalf* fog); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalf s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalf s, GLhalf t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r, GLhalf q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLNORMAL3HNVPROC) (GLhalf nx, GLhalf ny, GLhalf nz); +typedef void (GLAPIENTRY * PFNGLNORMAL3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD1HNVPROC) (GLhalf s); +typedef void (GLAPIENTRY * PFNGLTEXCOORD1HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2HNVPROC) (GLhalf s, GLhalf t); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD3HNVPROC) (GLhalf s, GLhalf t, GLhalf r); +typedef void (GLAPIENTRY * PFNGLTEXCOORD3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4HNVPROC) (GLhalf s, GLhalf t, GLhalf r, GLhalf q); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX2HNVPROC) (GLhalf x, GLhalf y); +typedef void (GLAPIENTRY * PFNGLVERTEX2HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX3HNVPROC) (GLhalf x, GLhalf y, GLhalf z); +typedef void (GLAPIENTRY * PFNGLVERTEX3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX4HNVPROC) (GLhalf x, GLhalf y, GLhalf z, GLhalf w); +typedef void (GLAPIENTRY * PFNGLVERTEX4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalf x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalf x, GLhalf y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z, GLhalf w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHNVPROC) (GLhalf weight); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalf* weight); + +#define glColor3hNV GLEW_GET_FUN(__glewColor3hNV) +#define glColor3hvNV GLEW_GET_FUN(__glewColor3hvNV) +#define glColor4hNV GLEW_GET_FUN(__glewColor4hNV) +#define glColor4hvNV GLEW_GET_FUN(__glewColor4hvNV) +#define glFogCoordhNV GLEW_GET_FUN(__glewFogCoordhNV) +#define glFogCoordhvNV GLEW_GET_FUN(__glewFogCoordhvNV) +#define glMultiTexCoord1hNV GLEW_GET_FUN(__glewMultiTexCoord1hNV) +#define glMultiTexCoord1hvNV GLEW_GET_FUN(__glewMultiTexCoord1hvNV) +#define glMultiTexCoord2hNV GLEW_GET_FUN(__glewMultiTexCoord2hNV) +#define glMultiTexCoord2hvNV GLEW_GET_FUN(__glewMultiTexCoord2hvNV) +#define glMultiTexCoord3hNV GLEW_GET_FUN(__glewMultiTexCoord3hNV) +#define glMultiTexCoord3hvNV GLEW_GET_FUN(__glewMultiTexCoord3hvNV) +#define glMultiTexCoord4hNV GLEW_GET_FUN(__glewMultiTexCoord4hNV) +#define glMultiTexCoord4hvNV GLEW_GET_FUN(__glewMultiTexCoord4hvNV) +#define glNormal3hNV GLEW_GET_FUN(__glewNormal3hNV) +#define glNormal3hvNV GLEW_GET_FUN(__glewNormal3hvNV) +#define glSecondaryColor3hNV GLEW_GET_FUN(__glewSecondaryColor3hNV) +#define glSecondaryColor3hvNV GLEW_GET_FUN(__glewSecondaryColor3hvNV) +#define glTexCoord1hNV GLEW_GET_FUN(__glewTexCoord1hNV) +#define glTexCoord1hvNV GLEW_GET_FUN(__glewTexCoord1hvNV) +#define glTexCoord2hNV GLEW_GET_FUN(__glewTexCoord2hNV) +#define glTexCoord2hvNV GLEW_GET_FUN(__glewTexCoord2hvNV) +#define glTexCoord3hNV GLEW_GET_FUN(__glewTexCoord3hNV) +#define glTexCoord3hvNV GLEW_GET_FUN(__glewTexCoord3hvNV) +#define glTexCoord4hNV GLEW_GET_FUN(__glewTexCoord4hNV) +#define glTexCoord4hvNV GLEW_GET_FUN(__glewTexCoord4hvNV) +#define glVertex2hNV GLEW_GET_FUN(__glewVertex2hNV) +#define glVertex2hvNV GLEW_GET_FUN(__glewVertex2hvNV) +#define glVertex3hNV GLEW_GET_FUN(__glewVertex3hNV) +#define glVertex3hvNV GLEW_GET_FUN(__glewVertex3hvNV) +#define glVertex4hNV GLEW_GET_FUN(__glewVertex4hNV) +#define glVertex4hvNV GLEW_GET_FUN(__glewVertex4hvNV) +#define glVertexAttrib1hNV GLEW_GET_FUN(__glewVertexAttrib1hNV) +#define glVertexAttrib1hvNV GLEW_GET_FUN(__glewVertexAttrib1hvNV) +#define glVertexAttrib2hNV GLEW_GET_FUN(__glewVertexAttrib2hNV) +#define glVertexAttrib2hvNV GLEW_GET_FUN(__glewVertexAttrib2hvNV) +#define glVertexAttrib3hNV GLEW_GET_FUN(__glewVertexAttrib3hNV) +#define glVertexAttrib3hvNV GLEW_GET_FUN(__glewVertexAttrib3hvNV) +#define glVertexAttrib4hNV GLEW_GET_FUN(__glewVertexAttrib4hNV) +#define glVertexAttrib4hvNV GLEW_GET_FUN(__glewVertexAttrib4hvNV) +#define glVertexAttribs1hvNV GLEW_GET_FUN(__glewVertexAttribs1hvNV) +#define glVertexAttribs2hvNV GLEW_GET_FUN(__glewVertexAttribs2hvNV) +#define glVertexAttribs3hvNV GLEW_GET_FUN(__glewVertexAttribs3hvNV) +#define glVertexAttribs4hvNV GLEW_GET_FUN(__glewVertexAttribs4hvNV) +#define glVertexWeighthNV GLEW_GET_FUN(__glewVertexWeighthNV) +#define glVertexWeighthvNV GLEW_GET_FUN(__glewVertexWeighthvNV) + +#define GLEW_NV_half_float GLEW_GET_VAR(__GLEW_NV_half_float) + +#endif /* GL_NV_half_float */ + +/* ------------------------ GL_NV_light_max_exponent ----------------------- */ + +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 + +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 + +#define GLEW_NV_light_max_exponent GLEW_GET_VAR(__GLEW_NV_light_max_exponent) + +#endif /* GL_NV_light_max_exponent */ + +/* --------------------- GL_NV_multisample_filter_hint --------------------- */ + +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 + +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 + +#define GLEW_NV_multisample_filter_hint GLEW_GET_VAR(__GLEW_NV_multisample_filter_hint) + +#endif /* GL_NV_multisample_filter_hint */ + +/* ------------------------- GL_NV_occlusion_query ------------------------- */ + +#ifndef GL_NV_occlusion_query +#define GL_NV_occlusion_query 1 + +#define GL_PIXEL_COUNTER_BITS_NV 0x8864 +#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 +#define GL_PIXEL_COUNT_NV 0x8866 +#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 + +typedef void (GLAPIENTRY * PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDOCCLUSIONQUERYNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); + +#define glBeginOcclusionQueryNV GLEW_GET_FUN(__glewBeginOcclusionQueryNV) +#define glDeleteOcclusionQueriesNV GLEW_GET_FUN(__glewDeleteOcclusionQueriesNV) +#define glEndOcclusionQueryNV GLEW_GET_FUN(__glewEndOcclusionQueryNV) +#define glGenOcclusionQueriesNV GLEW_GET_FUN(__glewGenOcclusionQueriesNV) +#define glGetOcclusionQueryivNV GLEW_GET_FUN(__glewGetOcclusionQueryivNV) +#define glGetOcclusionQueryuivNV GLEW_GET_FUN(__glewGetOcclusionQueryuivNV) +#define glIsOcclusionQueryNV GLEW_GET_FUN(__glewIsOcclusionQueryNV) + +#define GLEW_NV_occlusion_query GLEW_GET_VAR(__GLEW_NV_occlusion_query) + +#endif /* GL_NV_occlusion_query */ + +/* ----------------------- GL_NV_packed_depth_stencil ---------------------- */ + +#ifndef GL_NV_packed_depth_stencil +#define GL_NV_packed_depth_stencil 1 + +#define GL_DEPTH_STENCIL_NV 0x84F9 +#define GL_UNSIGNED_INT_24_8_NV 0x84FA + +#define GLEW_NV_packed_depth_stencil GLEW_GET_VAR(__GLEW_NV_packed_depth_stencil) + +#endif /* GL_NV_packed_depth_stencil */ + +/* ------------------------- GL_NV_pixel_data_range ------------------------ */ + +#ifndef GL_NV_pixel_data_range +#define GL_NV_pixel_data_range 1 + +#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 +#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 +#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A +#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B +#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C +#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D + +typedef void (GLAPIENTRY * PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, void* pointer); + +#define glFlushPixelDataRangeNV GLEW_GET_FUN(__glewFlushPixelDataRangeNV) +#define glPixelDataRangeNV GLEW_GET_FUN(__glewPixelDataRangeNV) + +#define GLEW_NV_pixel_data_range GLEW_GET_VAR(__GLEW_NV_pixel_data_range) + +#endif /* GL_NV_pixel_data_range */ + +/* --------------------------- GL_NV_point_sprite -------------------------- */ + +#ifndef GL_NV_point_sprite +#define GL_NV_point_sprite 1 + +#define GL_POINT_SPRITE_NV 0x8861 +#define GL_COORD_REPLACE_NV 0x8862 +#define GL_POINT_SPRITE_R_MODE_NV 0x8863 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint* params); + +#define glPointParameteriNV GLEW_GET_FUN(__glewPointParameteriNV) +#define glPointParameterivNV GLEW_GET_FUN(__glewPointParameterivNV) + +#define GLEW_NV_point_sprite GLEW_GET_VAR(__GLEW_NV_point_sprite) + +#endif /* GL_NV_point_sprite */ + +/* ------------------------ GL_NV_primitive_restart ------------------------ */ + +#ifndef GL_NV_primitive_restart +#define GL_NV_primitive_restart 1 + +#define GL_PRIMITIVE_RESTART_NV 0x8558 +#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 + +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTNVPROC) (void); + +#define glPrimitiveRestartIndexNV GLEW_GET_FUN(__glewPrimitiveRestartIndexNV) +#define glPrimitiveRestartNV GLEW_GET_FUN(__glewPrimitiveRestartNV) + +#define GLEW_NV_primitive_restart GLEW_GET_VAR(__GLEW_NV_primitive_restart) + +#endif /* GL_NV_primitive_restart */ + +/* ------------------------ GL_NV_register_combiners ----------------------- */ + +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 + +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 + +typedef void (GLAPIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (GLAPIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint* params); + +#define glCombinerInputNV GLEW_GET_FUN(__glewCombinerInputNV) +#define glCombinerOutputNV GLEW_GET_FUN(__glewCombinerOutputNV) +#define glCombinerParameterfNV GLEW_GET_FUN(__glewCombinerParameterfNV) +#define glCombinerParameterfvNV GLEW_GET_FUN(__glewCombinerParameterfvNV) +#define glCombinerParameteriNV GLEW_GET_FUN(__glewCombinerParameteriNV) +#define glCombinerParameterivNV GLEW_GET_FUN(__glewCombinerParameterivNV) +#define glFinalCombinerInputNV GLEW_GET_FUN(__glewFinalCombinerInputNV) +#define glGetCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetCombinerInputParameterfvNV) +#define glGetCombinerInputParameterivNV GLEW_GET_FUN(__glewGetCombinerInputParameterivNV) +#define glGetCombinerOutputParameterfvNV GLEW_GET_FUN(__glewGetCombinerOutputParameterfvNV) +#define glGetCombinerOutputParameterivNV GLEW_GET_FUN(__glewGetCombinerOutputParameterivNV) +#define glGetFinalCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterfvNV) +#define glGetFinalCombinerInputParameterivNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterivNV) + +#define GLEW_NV_register_combiners GLEW_GET_VAR(__GLEW_NV_register_combiners) + +#endif /* GL_NV_register_combiners */ + +/* ----------------------- GL_NV_register_combiners2 ----------------------- */ + +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 + +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 + +typedef void (GLAPIENTRY * PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat* params); + +#define glCombinerStageParameterfvNV GLEW_GET_FUN(__glewCombinerStageParameterfvNV) +#define glGetCombinerStageParameterfvNV GLEW_GET_FUN(__glewGetCombinerStageParameterfvNV) + +#define GLEW_NV_register_combiners2 GLEW_GET_VAR(__GLEW_NV_register_combiners2) + +#endif /* GL_NV_register_combiners2 */ + +/* -------------------------- GL_NV_texgen_emboss -------------------------- */ + +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 + +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F + +#define GLEW_NV_texgen_emboss GLEW_GET_VAR(__GLEW_NV_texgen_emboss) + +#endif /* GL_NV_texgen_emboss */ + +/* ------------------------ GL_NV_texgen_reflection ------------------------ */ + +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 + +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 + +#define GLEW_NV_texgen_reflection GLEW_GET_VAR(__GLEW_NV_texgen_reflection) + +#endif /* GL_NV_texgen_reflection */ + +/* --------------------- GL_NV_texture_compression_vtc --------------------- */ + +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 + +#define GLEW_NV_texture_compression_vtc GLEW_GET_VAR(__GLEW_NV_texture_compression_vtc) + +#endif /* GL_NV_texture_compression_vtc */ + +/* ----------------------- GL_NV_texture_env_combine4 ---------------------- */ + +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 + +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B + +#define GLEW_NV_texture_env_combine4 GLEW_GET_VAR(__GLEW_NV_texture_env_combine4) + +#endif /* GL_NV_texture_env_combine4 */ + +/* ---------------------- GL_NV_texture_expand_normal ---------------------- */ + +#ifndef GL_NV_texture_expand_normal +#define GL_NV_texture_expand_normal 1 + +#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F + +#define GLEW_NV_texture_expand_normal GLEW_GET_VAR(__GLEW_NV_texture_expand_normal) + +#endif /* GL_NV_texture_expand_normal */ + +/* ------------------------ GL_NV_texture_rectangle ------------------------ */ + +#ifndef GL_NV_texture_rectangle +#define GL_NV_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_NV 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 + +#define GLEW_NV_texture_rectangle GLEW_GET_VAR(__GLEW_NV_texture_rectangle) + +#endif /* GL_NV_texture_rectangle */ + +/* -------------------------- GL_NV_texture_shader ------------------------- */ + +#ifndef GL_NV_texture_shader +#define GL_NV_texture_shader 1 + +#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C +#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D +#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E +#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_SHADER_CONSISTENT_NV 0x86DD +#define GL_TEXTURE_SHADER_NV 0x86DE +#define GL_SHADER_OPERATION_NV 0x86DF +#define GL_CULL_MODES_NV 0x86E0 +#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 +#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 +#define GL_CONST_EYE_NV 0x86E5 +#define GL_PASS_THROUGH_NV 0x86E6 +#define GL_CULL_FRAGMENT_NV 0x86E7 +#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 +#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 +#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA +#define GL_DOT_PRODUCT_NV 0x86EC +#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED +#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE +#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 +#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 +#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 +#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D +#define GL_HI_SCALE_NV 0x870E +#define GL_LO_SCALE_NV 0x870F +#define GL_DS_SCALE_NV 0x8710 +#define GL_DT_SCALE_NV 0x8711 +#define GL_MAGNITUDE_SCALE_NV 0x8712 +#define GL_VIBRANCE_SCALE_NV 0x8713 +#define GL_HI_BIAS_NV 0x8714 +#define GL_LO_BIAS_NV 0x8715 +#define GL_DS_BIAS_NV 0x8716 +#define GL_DT_BIAS_NV 0x8717 +#define GL_MAGNITUDE_BIAS_NV 0x8718 +#define GL_VIBRANCE_BIAS_NV 0x8719 +#define GL_TEXTURE_BORDER_VALUES_NV 0x871A +#define GL_TEXTURE_HI_SIZE_NV 0x871B +#define GL_TEXTURE_LO_SIZE_NV 0x871C +#define GL_TEXTURE_DS_SIZE_NV 0x871D +#define GL_TEXTURE_DT_SIZE_NV 0x871E +#define GL_TEXTURE_MAG_SIZE_NV 0x871F + +#define GLEW_NV_texture_shader GLEW_GET_VAR(__GLEW_NV_texture_shader) + +#endif /* GL_NV_texture_shader */ + +/* ------------------------- GL_NV_texture_shader2 ------------------------- */ + +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 + +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D + +#define GLEW_NV_texture_shader2 GLEW_GET_VAR(__GLEW_NV_texture_shader2) + +#endif /* GL_NV_texture_shader2 */ + +/* ------------------------- GL_NV_texture_shader3 ------------------------- */ + +#ifndef GL_NV_texture_shader3 +#define GL_NV_texture_shader3 1 + +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 +#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 +#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 +#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 +#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 +#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A +#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B +#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C +#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D +#define GL_HILO8_NV 0x885E +#define GL_SIGNED_HILO8_NV 0x885F +#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 + +#define GLEW_NV_texture_shader3 GLEW_GET_VAR(__GLEW_NV_texture_shader3) + +#endif /* GL_NV_texture_shader3 */ + +/* ------------------------ GL_NV_vertex_array_range ----------------------- */ + +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 + +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 + +typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, void* pointer); + +#define glFlushVertexArrayRangeNV GLEW_GET_FUN(__glewFlushVertexArrayRangeNV) +#define glVertexArrayRangeNV GLEW_GET_FUN(__glewVertexArrayRangeNV) + +#define GLEW_NV_vertex_array_range GLEW_GET_VAR(__GLEW_NV_vertex_array_range) + +#endif /* GL_NV_vertex_array_range */ + +/* ----------------------- GL_NV_vertex_array_range2 ----------------------- */ + +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 + +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 + +#define GLEW_NV_vertex_array_range2 GLEW_GET_VAR(__GLEW_NV_vertex_array_range2) + +#endif /* GL_NV_vertex_array_range2 */ + +/* -------------------------- GL_NV_vertex_program ------------------------- */ + +#ifndef GL_NV_vertex_program +#define GL_NV_vertex_program 1 + +#define GL_VERTEX_PROGRAM_NV 0x8620 +#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 +#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 +#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 +#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 +#define GL_CURRENT_ATTRIB_NV 0x8626 +#define GL_PROGRAM_LENGTH_NV 0x8627 +#define GL_PROGRAM_STRING_NV 0x8628 +#define GL_MODELVIEW_PROJECTION_NV 0x8629 +#define GL_IDENTITY_NV 0x862A +#define GL_INVERSE_NV 0x862B +#define GL_TRANSPOSE_NV 0x862C +#define GL_INVERSE_TRANSPOSE_NV 0x862D +#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E +#define GL_MAX_TRACK_MATRICES_NV 0x862F +#define GL_MATRIX0_NV 0x8630 +#define GL_MATRIX1_NV 0x8631 +#define GL_MATRIX2_NV 0x8632 +#define GL_MATRIX3_NV 0x8633 +#define GL_MATRIX4_NV 0x8634 +#define GL_MATRIX5_NV 0x8635 +#define GL_MATRIX6_NV 0x8636 +#define GL_MATRIX7_NV 0x8637 +#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 +#define GL_CURRENT_MATRIX_NV 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 +#define GL_PROGRAM_PARAMETER_NV 0x8644 +#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 +#define GL_PROGRAM_TARGET_NV 0x8646 +#define GL_PROGRAM_RESIDENT_NV 0x8647 +#define GL_TRACK_MATRIX_NV 0x8648 +#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A +#define GL_PROGRAM_ERROR_POSITION_NV 0x864B +#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 +#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 +#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 +#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 +#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 +#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 +#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 +#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 +#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 +#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 +#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A +#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B +#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C +#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D +#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E +#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F +#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 +#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 +#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 +#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 +#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 +#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 +#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 +#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 +#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 +#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 +#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A +#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B +#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C +#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D +#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E +#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F +#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 +#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 +#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 +#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 +#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 +#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 +#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 +#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 +#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 +#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 +#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A +#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B +#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C +#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D +#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E +#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F + +typedef GLboolean (GLAPIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint* ids, GLboolean *residences); +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte* program); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte* program); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint num, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint num, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei n, const GLubyte* v); + +#define glAreProgramsResidentNV GLEW_GET_FUN(__glewAreProgramsResidentNV) +#define glBindProgramNV GLEW_GET_FUN(__glewBindProgramNV) +#define glDeleteProgramsNV GLEW_GET_FUN(__glewDeleteProgramsNV) +#define glExecuteProgramNV GLEW_GET_FUN(__glewExecuteProgramNV) +#define glGenProgramsNV GLEW_GET_FUN(__glewGenProgramsNV) +#define glGetProgramParameterdvNV GLEW_GET_FUN(__glewGetProgramParameterdvNV) +#define glGetProgramParameterfvNV GLEW_GET_FUN(__glewGetProgramParameterfvNV) +#define glGetProgramStringNV GLEW_GET_FUN(__glewGetProgramStringNV) +#define glGetProgramivNV GLEW_GET_FUN(__glewGetProgramivNV) +#define glGetTrackMatrixivNV GLEW_GET_FUN(__glewGetTrackMatrixivNV) +#define glGetVertexAttribPointervNV GLEW_GET_FUN(__glewGetVertexAttribPointervNV) +#define glGetVertexAttribdvNV GLEW_GET_FUN(__glewGetVertexAttribdvNV) +#define glGetVertexAttribfvNV GLEW_GET_FUN(__glewGetVertexAttribfvNV) +#define glGetVertexAttribivNV GLEW_GET_FUN(__glewGetVertexAttribivNV) +#define glIsProgramNV GLEW_GET_FUN(__glewIsProgramNV) +#define glLoadProgramNV GLEW_GET_FUN(__glewLoadProgramNV) +#define glProgramParameter4dNV GLEW_GET_FUN(__glewProgramParameter4dNV) +#define glProgramParameter4dvNV GLEW_GET_FUN(__glewProgramParameter4dvNV) +#define glProgramParameter4fNV GLEW_GET_FUN(__glewProgramParameter4fNV) +#define glProgramParameter4fvNV GLEW_GET_FUN(__glewProgramParameter4fvNV) +#define glProgramParameters4dvNV GLEW_GET_FUN(__glewProgramParameters4dvNV) +#define glProgramParameters4fvNV GLEW_GET_FUN(__glewProgramParameters4fvNV) +#define glRequestResidentProgramsNV GLEW_GET_FUN(__glewRequestResidentProgramsNV) +#define glTrackMatrixNV GLEW_GET_FUN(__glewTrackMatrixNV) +#define glVertexAttrib1dNV GLEW_GET_FUN(__glewVertexAttrib1dNV) +#define glVertexAttrib1dvNV GLEW_GET_FUN(__glewVertexAttrib1dvNV) +#define glVertexAttrib1fNV GLEW_GET_FUN(__glewVertexAttrib1fNV) +#define glVertexAttrib1fvNV GLEW_GET_FUN(__glewVertexAttrib1fvNV) +#define glVertexAttrib1sNV GLEW_GET_FUN(__glewVertexAttrib1sNV) +#define glVertexAttrib1svNV GLEW_GET_FUN(__glewVertexAttrib1svNV) +#define glVertexAttrib2dNV GLEW_GET_FUN(__glewVertexAttrib2dNV) +#define glVertexAttrib2dvNV GLEW_GET_FUN(__glewVertexAttrib2dvNV) +#define glVertexAttrib2fNV GLEW_GET_FUN(__glewVertexAttrib2fNV) +#define glVertexAttrib2fvNV GLEW_GET_FUN(__glewVertexAttrib2fvNV) +#define glVertexAttrib2sNV GLEW_GET_FUN(__glewVertexAttrib2sNV) +#define glVertexAttrib2svNV GLEW_GET_FUN(__glewVertexAttrib2svNV) +#define glVertexAttrib3dNV GLEW_GET_FUN(__glewVertexAttrib3dNV) +#define glVertexAttrib3dvNV GLEW_GET_FUN(__glewVertexAttrib3dvNV) +#define glVertexAttrib3fNV GLEW_GET_FUN(__glewVertexAttrib3fNV) +#define glVertexAttrib3fvNV GLEW_GET_FUN(__glewVertexAttrib3fvNV) +#define glVertexAttrib3sNV GLEW_GET_FUN(__glewVertexAttrib3sNV) +#define glVertexAttrib3svNV GLEW_GET_FUN(__glewVertexAttrib3svNV) +#define glVertexAttrib4dNV GLEW_GET_FUN(__glewVertexAttrib4dNV) +#define glVertexAttrib4dvNV GLEW_GET_FUN(__glewVertexAttrib4dvNV) +#define glVertexAttrib4fNV GLEW_GET_FUN(__glewVertexAttrib4fNV) +#define glVertexAttrib4fvNV GLEW_GET_FUN(__glewVertexAttrib4fvNV) +#define glVertexAttrib4sNV GLEW_GET_FUN(__glewVertexAttrib4sNV) +#define glVertexAttrib4svNV GLEW_GET_FUN(__glewVertexAttrib4svNV) +#define glVertexAttrib4ubNV GLEW_GET_FUN(__glewVertexAttrib4ubNV) +#define glVertexAttrib4ubvNV GLEW_GET_FUN(__glewVertexAttrib4ubvNV) +#define glVertexAttribPointerNV GLEW_GET_FUN(__glewVertexAttribPointerNV) +#define glVertexAttribs1dvNV GLEW_GET_FUN(__glewVertexAttribs1dvNV) +#define glVertexAttribs1fvNV GLEW_GET_FUN(__glewVertexAttribs1fvNV) +#define glVertexAttribs1svNV GLEW_GET_FUN(__glewVertexAttribs1svNV) +#define glVertexAttribs2dvNV GLEW_GET_FUN(__glewVertexAttribs2dvNV) +#define glVertexAttribs2fvNV GLEW_GET_FUN(__glewVertexAttribs2fvNV) +#define glVertexAttribs2svNV GLEW_GET_FUN(__glewVertexAttribs2svNV) +#define glVertexAttribs3dvNV GLEW_GET_FUN(__glewVertexAttribs3dvNV) +#define glVertexAttribs3fvNV GLEW_GET_FUN(__glewVertexAttribs3fvNV) +#define glVertexAttribs3svNV GLEW_GET_FUN(__glewVertexAttribs3svNV) +#define glVertexAttribs4dvNV GLEW_GET_FUN(__glewVertexAttribs4dvNV) +#define glVertexAttribs4fvNV GLEW_GET_FUN(__glewVertexAttribs4fvNV) +#define glVertexAttribs4svNV GLEW_GET_FUN(__glewVertexAttribs4svNV) +#define glVertexAttribs4ubvNV GLEW_GET_FUN(__glewVertexAttribs4ubvNV) + +#define GLEW_NV_vertex_program GLEW_GET_VAR(__GLEW_NV_vertex_program) + +#endif /* GL_NV_vertex_program */ + +/* ------------------------ GL_NV_vertex_program1_1 ------------------------ */ + +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 + +#define GLEW_NV_vertex_program1_1 GLEW_GET_VAR(__GLEW_NV_vertex_program1_1) + +#endif /* GL_NV_vertex_program1_1 */ + +/* ------------------------- GL_NV_vertex_program2 ------------------------- */ + +#ifndef GL_NV_vertex_program2 +#define GL_NV_vertex_program2 1 + +#define GLEW_NV_vertex_program2 GLEW_GET_VAR(__GLEW_NV_vertex_program2) + +#endif /* GL_NV_vertex_program2 */ + +/* ---------------------- GL_NV_vertex_program2_option --------------------- */ + +#ifndef GL_NV_vertex_program2_option +#define GL_NV_vertex_program2_option 1 + +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 + +#define GLEW_NV_vertex_program2_option GLEW_GET_VAR(__GLEW_NV_vertex_program2_option) + +#endif /* GL_NV_vertex_program2_option */ + +/* ------------------------- GL_NV_vertex_program3 ------------------------- */ + +#ifndef GL_NV_vertex_program3 +#define GL_NV_vertex_program3 1 + +#define MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C + +#define GLEW_NV_vertex_program3 GLEW_GET_VAR(__GLEW_NV_vertex_program3) + +#endif /* GL_NV_vertex_program3 */ + +/* ---------------------------- GL_OML_interlace --------------------------- */ + +#ifndef GL_OML_interlace +#define GL_OML_interlace 1 + +#define GL_INTERLACE_OML 0x8980 +#define GL_INTERLACE_READ_OML 0x8981 + +#define GLEW_OML_interlace GLEW_GET_VAR(__GLEW_OML_interlace) + +#endif /* GL_OML_interlace */ + +/* ---------------------------- GL_OML_resample ---------------------------- */ + +#ifndef GL_OML_resample +#define GL_OML_resample 1 + +#define GL_PACK_RESAMPLE_OML 0x8984 +#define GL_UNPACK_RESAMPLE_OML 0x8985 +#define GL_RESAMPLE_REPLICATE_OML 0x8986 +#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 +#define GL_RESAMPLE_AVERAGE_OML 0x8988 +#define GL_RESAMPLE_DECIMATE_OML 0x8989 + +#define GLEW_OML_resample GLEW_GET_VAR(__GLEW_OML_resample) + +#endif /* GL_OML_resample */ + +/* ---------------------------- GL_OML_subsample --------------------------- */ + +#ifndef GL_OML_subsample +#define GL_OML_subsample 1 + +#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 +#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 + +#define GLEW_OML_subsample GLEW_GET_VAR(__GLEW_OML_subsample) + +#endif /* GL_OML_subsample */ + +/* --------------------------- GL_PGI_misc_hints --------------------------- */ + +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 + +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000 +#define GL_CONSERVE_MEMORY_HINT_PGI 107005 +#define GL_RECLAIM_MEMORY_HINT_PGI 107006 +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012 +#define GL_ALWAYS_FAST_HINT_PGI 107020 +#define GL_ALWAYS_SOFT_HINT_PGI 107021 +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022 +#define GL_ALLOW_DRAW_WIN_HINT_PGI 107023 +#define GL_ALLOW_DRAW_FRG_HINT_PGI 107024 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 107025 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 107030 +#define GL_STRICT_LIGHTING_HINT_PGI 107031 +#define GL_STRICT_SCISSOR_HINT_PGI 107032 +#define GL_FULL_STIPPLE_HINT_PGI 107033 +#define GL_CLIP_NEAR_HINT_PGI 107040 +#define GL_CLIP_FAR_HINT_PGI 107041 +#define GL_WIDE_LINE_HINT_PGI 107042 +#define GL_BACK_NORMALS_HINT_PGI 107043 + +#define GLEW_PGI_misc_hints GLEW_GET_VAR(__GLEW_PGI_misc_hints) + +#endif /* GL_PGI_misc_hints */ + +/* -------------------------- GL_PGI_vertex_hints -------------------------- */ + +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 + +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_VERTEX_DATA_HINT_PGI 107050 +#define GL_VERTEX_CONSISTENT_HINT_PGI 107051 +#define GL_MATERIAL_SIDE_HINT_PGI 107052 +#define GL_MAX_VERTEX_HINT_PGI 107053 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 + +#define GLEW_PGI_vertex_hints GLEW_GET_VAR(__GLEW_PGI_vertex_hints) + +#endif /* GL_PGI_vertex_hints */ + +/* ----------------------- GL_REND_screen_coordinates ---------------------- */ + +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 + +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 + +#define GLEW_REND_screen_coordinates GLEW_GET_VAR(__GLEW_REND_screen_coordinates) + +#endif /* GL_REND_screen_coordinates */ + +/* ------------------------------- GL_S3_s3tc ------------------------------ */ + +#ifndef GL_S3_s3tc +#define GL_S3_s3tc 1 + +#define GL_RGB_S3TC 0x83A0 +#define GL_RGB4_S3TC 0x83A1 +#define GL_RGBA_S3TC 0x83A2 +#define GL_RGBA4_S3TC 0x83A3 +#define GL_RGBA_DXT5_S3TC 0x83A4 +#define GL_RGBA4_DXT5_S3TC 0x83A5 + +#define GLEW_S3_s3tc GLEW_GET_VAR(__GLEW_S3_s3tc) + +#endif /* GL_S3_s3tc */ + +/* -------------------------- GL_SGIS_color_range -------------------------- */ + +#ifndef GL_SGIS_color_range +#define GL_SGIS_color_range 1 + +#define GL_EXTENDED_RANGE_SGIS 0x85A5 +#define GL_MIN_RED_SGIS 0x85A6 +#define GL_MAX_RED_SGIS 0x85A7 +#define GL_MIN_GREEN_SGIS 0x85A8 +#define GL_MAX_GREEN_SGIS 0x85A9 +#define GL_MIN_BLUE_SGIS 0x85AA +#define GL_MAX_BLUE_SGIS 0x85AB +#define GL_MIN_ALPHA_SGIS 0x85AC +#define GL_MAX_ALPHA_SGIS 0x85AD + +#define GLEW_SGIS_color_range GLEW_GET_VAR(__GLEW_SGIS_color_range) + +#endif /* GL_SGIS_color_range */ + +/* ------------------------- GL_SGIS_detail_texture ------------------------ */ + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 + +typedef void (GLAPIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat* points); + +#define glDetailTexFuncSGIS GLEW_GET_FUN(__glewDetailTexFuncSGIS) +#define glGetDetailTexFuncSGIS GLEW_GET_FUN(__glewGetDetailTexFuncSGIS) + +#define GLEW_SGIS_detail_texture GLEW_GET_VAR(__GLEW_SGIS_detail_texture) + +#endif /* GL_SGIS_detail_texture */ + +/* -------------------------- GL_SGIS_fog_function ------------------------- */ + +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 + +typedef void (GLAPIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLGETFOGFUNCSGISPROC) (GLfloat* points); + +#define glFogFuncSGIS GLEW_GET_FUN(__glewFogFuncSGIS) +#define glGetFogFuncSGIS GLEW_GET_FUN(__glewGetFogFuncSGIS) + +#define GLEW_SGIS_fog_function GLEW_GET_VAR(__GLEW_SGIS_fog_function) + +#endif /* GL_SGIS_fog_function */ + +/* ------------------------ GL_SGIS_generate_mipmap ------------------------ */ + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 + +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 + +#define GLEW_SGIS_generate_mipmap GLEW_GET_VAR(__GLEW_SGIS_generate_mipmap) + +#endif /* GL_SGIS_generate_mipmap */ + +/* -------------------------- GL_SGIS_multisample -------------------------- */ + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 + +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 + +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); + +#define glSampleMaskSGIS GLEW_GET_FUN(__glewSampleMaskSGIS) +#define glSamplePatternSGIS GLEW_GET_FUN(__glewSamplePatternSGIS) + +#define GLEW_SGIS_multisample GLEW_GET_VAR(__GLEW_SGIS_multisample) + +#endif /* GL_SGIS_multisample */ + +/* ------------------------- GL_SGIS_pixel_texture ------------------------- */ + +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 + +#define GLEW_SGIS_pixel_texture GLEW_GET_VAR(__GLEW_SGIS_pixel_texture) + +#endif /* GL_SGIS_pixel_texture */ + +/* ------------------------ GL_SGIS_sharpen_texture ------------------------ */ + +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 + +typedef void (GLAPIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat* points); +typedef void (GLAPIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); + +#define glGetSharpenTexFuncSGIS GLEW_GET_FUN(__glewGetSharpenTexFuncSGIS) +#define glSharpenTexFuncSGIS GLEW_GET_FUN(__glewSharpenTexFuncSGIS) + +#define GLEW_SGIS_sharpen_texture GLEW_GET_VAR(__GLEW_SGIS_sharpen_texture) + +#endif /* GL_SGIS_sharpen_texture */ + +/* --------------------------- GL_SGIS_texture4D --------------------------- */ + +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void* pixels); + +#define glTexImage4DSGIS GLEW_GET_FUN(__glewTexImage4DSGIS) +#define glTexSubImage4DSGIS GLEW_GET_FUN(__glewTexSubImage4DSGIS) + +#define GLEW_SGIS_texture4D GLEW_GET_VAR(__GLEW_SGIS_texture4D) + +#endif /* GL_SGIS_texture4D */ + +/* ---------------------- GL_SGIS_texture_border_clamp --------------------- */ + +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 + +#define GL_CLAMP_TO_BORDER_SGIS 0x812D + +#define GLEW_SGIS_texture_border_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_border_clamp) + +#endif /* GL_SGIS_texture_border_clamp */ + +/* ----------------------- GL_SGIS_texture_edge_clamp ---------------------- */ + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 + +#define GL_CLAMP_TO_EDGE_SGIS 0x812F + +#define GLEW_SGIS_texture_edge_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_edge_clamp) + +#endif /* GL_SGIS_texture_edge_clamp */ + +/* ------------------------ GL_SGIS_texture_filter4 ------------------------ */ + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 + +typedef void (GLAPIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat* weights); +typedef void (GLAPIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat* weights); + +#define glGetTexFilterFuncSGIS GLEW_GET_FUN(__glewGetTexFilterFuncSGIS) +#define glTexFilterFuncSGIS GLEW_GET_FUN(__glewTexFilterFuncSGIS) + +#define GLEW_SGIS_texture_filter4 GLEW_GET_VAR(__GLEW_SGIS_texture_filter4) + +#endif /* GL_SGIS_texture_filter4 */ + +/* -------------------------- GL_SGIS_texture_lod -------------------------- */ + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 + +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D + +#define GLEW_SGIS_texture_lod GLEW_GET_VAR(__GLEW_SGIS_texture_lod) + +#endif /* GL_SGIS_texture_lod */ + +/* ------------------------- GL_SGIS_texture_select ------------------------ */ + +#ifndef GL_SGIS_texture_select +#define GL_SGIS_texture_select 1 + +#define GLEW_SGIS_texture_select GLEW_GET_VAR(__GLEW_SGIS_texture_select) + +#endif /* GL_SGIS_texture_select */ + +/* ----------------------------- GL_SGIX_async ----------------------------- */ + +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 + +#define GL_ASYNC_MARKER_SGIX 0x8329 + +typedef void (GLAPIENTRY * PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef void (GLAPIENTRY * PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLint (GLAPIENTRY * PFNGLFINISHASYNCSGIXPROC) (GLuint* markerp); +typedef GLuint (GLAPIENTRY * PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef GLboolean (GLAPIENTRY * PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (GLAPIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint* markerp); + +#define glAsyncMarkerSGIX GLEW_GET_FUN(__glewAsyncMarkerSGIX) +#define glDeleteAsyncMarkersSGIX GLEW_GET_FUN(__glewDeleteAsyncMarkersSGIX) +#define glFinishAsyncSGIX GLEW_GET_FUN(__glewFinishAsyncSGIX) +#define glGenAsyncMarkersSGIX GLEW_GET_FUN(__glewGenAsyncMarkersSGIX) +#define glIsAsyncMarkerSGIX GLEW_GET_FUN(__glewIsAsyncMarkerSGIX) +#define glPollAsyncSGIX GLEW_GET_FUN(__glewPollAsyncSGIX) + +#define GLEW_SGIX_async GLEW_GET_VAR(__GLEW_SGIX_async) + +#endif /* GL_SGIX_async */ + +/* ------------------------ GL_SGIX_async_histogram ------------------------ */ + +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 + +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D + +#define GLEW_SGIX_async_histogram GLEW_GET_VAR(__GLEW_SGIX_async_histogram) + +#endif /* GL_SGIX_async_histogram */ + +/* -------------------------- GL_SGIX_async_pixel -------------------------- */ + +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 + +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 + +#define GLEW_SGIX_async_pixel GLEW_GET_VAR(__GLEW_SGIX_async_pixel) + +#endif /* GL_SGIX_async_pixel */ + +/* ----------------------- GL_SGIX_blend_alpha_minmax ---------------------- */ + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 + +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 + +#define GLEW_SGIX_blend_alpha_minmax GLEW_GET_VAR(__GLEW_SGIX_blend_alpha_minmax) + +#endif /* GL_SGIX_blend_alpha_minmax */ + +/* ---------------------------- GL_SGIX_clipmap ---------------------------- */ + +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 + +#define GLEW_SGIX_clipmap GLEW_GET_VAR(__GLEW_SGIX_clipmap) + +#endif /* GL_SGIX_clipmap */ + +/* ------------------------- GL_SGIX_depth_texture ------------------------- */ + +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 + +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 + +#define GLEW_SGIX_depth_texture GLEW_GET_VAR(__GLEW_SGIX_depth_texture) + +#endif /* GL_SGIX_depth_texture */ + +/* -------------------------- GL_SGIX_flush_raster ------------------------- */ + +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 + +typedef void (GLAPIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); + +#define glFlushRasterSGIX GLEW_GET_FUN(__glewFlushRasterSGIX) + +#define GLEW_SGIX_flush_raster GLEW_GET_VAR(__GLEW_SGIX_flush_raster) + +#endif /* GL_SGIX_flush_raster */ + +/* --------------------------- GL_SGIX_fog_offset -------------------------- */ + +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 + +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 + +#define GLEW_SGIX_fog_offset GLEW_GET_VAR(__GLEW_SGIX_fog_offset) + +#endif /* GL_SGIX_fog_offset */ + +/* -------------------------- GL_SGIX_fog_texture -------------------------- */ + +#ifndef GL_SGIX_fog_texture +#define GL_SGIX_fog_texture 1 + +#define GL_TEXTURE_FOG_SGIX 0 +#define GL_FOG_PATCHY_FACTOR_SGIX 0 +#define GL_FRAGMENT_FOG_SGIX 0 + +typedef void (GLAPIENTRY * PFNGLTEXTUREFOGSGIXPROC) (GLenum pname); + +#define glTextureFogSGIX GLEW_GET_FUN(__glewTextureFogSGIX) + +#define GLEW_SGIX_fog_texture GLEW_GET_VAR(__GLEW_SGIX_fog_texture) + +#endif /* GL_SGIX_fog_texture */ + +#if 0 +/* ------------------- GL_SGIX_fragment_specular_lighting ------------------ */ + +#ifndef GL_SGIX_fragment_specular_lighting +#define GL_SGIX_fragment_specular_lighting 1 + +typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum value, const GLfloat* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum value, const GLint* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* data); + +#define glFragmentColorMaterialSGIX GLEW_GET_FUN(__glewFragmentColorMaterialSGIX) +#define glFragmentLightModelfSGIX GLEW_GET_FUN(__glewFragmentLightModelfSGIX) +#define glFragmentLightModelfvSGIX GLEW_GET_FUN(__glewFragmentLightModelfvSGIX) +#define glFragmentLightModeliSGIX GLEW_GET_FUN(__glewFragmentLightModeliSGIX) +#define glFragmentLightModelivSGIX GLEW_GET_FUN(__glewFragmentLightModelivSGIX) +#define glFragmentLightfSGIX GLEW_GET_FUN(__glewFragmentLightfSGIX) +#define glFragmentLightfvSGIX GLEW_GET_FUN(__glewFragmentLightfvSGIX) +#define glFragmentLightiSGIX GLEW_GET_FUN(__glewFragmentLightiSGIX) +#define glFragmentLightivSGIX GLEW_GET_FUN(__glewFragmentLightivSGIX) +#define glFragmentMaterialfSGIX GLEW_GET_FUN(__glewFragmentMaterialfSGIX) +#define glFragmentMaterialfvSGIX GLEW_GET_FUN(__glewFragmentMaterialfvSGIX) +#define glFragmentMaterialiSGIX GLEW_GET_FUN(__glewFragmentMaterialiSGIX) +#define glFragmentMaterialivSGIX GLEW_GET_FUN(__glewFragmentMaterialivSGIX) +#define glGetFragmentLightfvSGIX GLEW_GET_FUN(__glewGetFragmentLightfvSGIX) +#define glGetFragmentLightivSGIX GLEW_GET_FUN(__glewGetFragmentLightivSGIX) +#define glGetFragmentMaterialfvSGIX GLEW_GET_FUN(__glewGetFragmentMaterialfvSGIX) +#define glGetFragmentMaterialivSGIX GLEW_GET_FUN(__glewGetFragmentMaterialivSGIX) + +#define GLEW_SGIX_fragment_specular_lighting GLEW_GET_VAR(__GLEW_SGIX_fragment_specular_lighting) +#endif + +#endif /* GL_SGIX_fragment_specular_lighting */ + +/* --------------------------- GL_SGIX_framezoom --------------------------- */ + +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 + +typedef void (GLAPIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); + +#define glFrameZoomSGIX GLEW_GET_FUN(__glewFrameZoomSGIX) + +#define GLEW_SGIX_framezoom GLEW_GET_VAR(__GLEW_SGIX_framezoom) + +#endif /* GL_SGIX_framezoom */ + +/* --------------------------- GL_SGIX_interlace --------------------------- */ + +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 + +#define GL_INTERLACE_SGIX 0x8094 + +#define GLEW_SGIX_interlace GLEW_GET_VAR(__GLEW_SGIX_interlace) + +#endif /* GL_SGIX_interlace */ + +/* ------------------------- GL_SGIX_ir_instrument1 ------------------------ */ + +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 + +#define GLEW_SGIX_ir_instrument1 GLEW_GET_VAR(__GLEW_SGIX_ir_instrument1) + +#endif /* GL_SGIX_ir_instrument1 */ + +/* ------------------------- GL_SGIX_list_priority ------------------------- */ + +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 + +#define GLEW_SGIX_list_priority GLEW_GET_VAR(__GLEW_SGIX_list_priority) + +#endif /* GL_SGIX_list_priority */ + +/* ------------------------- GL_SGIX_pixel_texture ------------------------- */ + +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 + +typedef void (GLAPIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); + +#define glPixelTexGenSGIX GLEW_GET_FUN(__glewPixelTexGenSGIX) + +#define GLEW_SGIX_pixel_texture GLEW_GET_VAR(__GLEW_SGIX_pixel_texture) + +#endif /* GL_SGIX_pixel_texture */ + +/* ----------------------- GL_SGIX_pixel_texture_bits ---------------------- */ + +#ifndef GL_SGIX_pixel_texture_bits +#define GL_SGIX_pixel_texture_bits 1 + +#define GLEW_SGIX_pixel_texture_bits GLEW_GET_VAR(__GLEW_SGIX_pixel_texture_bits) + +#endif /* GL_SGIX_pixel_texture_bits */ + +/* ------------------------ GL_SGIX_reference_plane ------------------------ */ + +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 + +typedef void (GLAPIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble* equation); + +#define glReferencePlaneSGIX GLEW_GET_FUN(__glewReferencePlaneSGIX) + +#define GLEW_SGIX_reference_plane GLEW_GET_VAR(__GLEW_SGIX_reference_plane) + +#endif /* GL_SGIX_reference_plane */ + +/* ---------------------------- GL_SGIX_resample --------------------------- */ + +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 + +#define GL_PACK_RESAMPLE_SGIX 0x842E +#define GL_UNPACK_RESAMPLE_SGIX 0x842F +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#define GL_RESAMPLE_REPLICATE_SGIX 0x8433 +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x8434 + +#define GLEW_SGIX_resample GLEW_GET_VAR(__GLEW_SGIX_resample) + +#endif /* GL_SGIX_resample */ + +/* ----------------------------- GL_SGIX_shadow ---------------------------- */ + +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 + +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D + +#define GLEW_SGIX_shadow GLEW_GET_VAR(__GLEW_SGIX_shadow) + +#endif /* GL_SGIX_shadow */ + +/* ------------------------- GL_SGIX_shadow_ambient ------------------------ */ + +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 + +#define GL_SHADOW_AMBIENT_SGIX 0x80BF + +#define GLEW_SGIX_shadow_ambient GLEW_GET_VAR(__GLEW_SGIX_shadow_ambient) + +#endif /* GL_SGIX_shadow_ambient */ + +/* ----------------------------- GL_SGIX_sprite ---------------------------- */ + +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 + +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, GLint* params); + +#define glSpriteParameterfSGIX GLEW_GET_FUN(__glewSpriteParameterfSGIX) +#define glSpriteParameterfvSGIX GLEW_GET_FUN(__glewSpriteParameterfvSGIX) +#define glSpriteParameteriSGIX GLEW_GET_FUN(__glewSpriteParameteriSGIX) +#define glSpriteParameterivSGIX GLEW_GET_FUN(__glewSpriteParameterivSGIX) + +#define GLEW_SGIX_sprite GLEW_GET_VAR(__GLEW_SGIX_sprite) + +#endif /* GL_SGIX_sprite */ + +/* ----------------------- GL_SGIX_tag_sample_buffer ----------------------- */ + +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 + +typedef void (GLAPIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); + +#define glTagSampleBufferSGIX GLEW_GET_FUN(__glewTagSampleBufferSGIX) + +#define GLEW_SGIX_tag_sample_buffer GLEW_GET_VAR(__GLEW_SGIX_tag_sample_buffer) + +#endif /* GL_SGIX_tag_sample_buffer */ + +/* ------------------------ GL_SGIX_texture_add_env ------------------------ */ + +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 + +#define GLEW_SGIX_texture_add_env GLEW_GET_VAR(__GLEW_SGIX_texture_add_env) + +#endif /* GL_SGIX_texture_add_env */ + +/* -------------------- GL_SGIX_texture_coordinate_clamp ------------------- */ + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_SGIX_texture_coordinate_clamp 1 + +#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 +#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A +#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B + +#define GLEW_SGIX_texture_coordinate_clamp GLEW_GET_VAR(__GLEW_SGIX_texture_coordinate_clamp) + +#endif /* GL_SGIX_texture_coordinate_clamp */ + +/* ------------------------ GL_SGIX_texture_lod_bias ----------------------- */ + +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 + +#define GLEW_SGIX_texture_lod_bias GLEW_GET_VAR(__GLEW_SGIX_texture_lod_bias) + +#endif /* GL_SGIX_texture_lod_bias */ + +/* ---------------------- GL_SGIX_texture_multi_buffer --------------------- */ + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 + +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E + +#define GLEW_SGIX_texture_multi_buffer GLEW_GET_VAR(__GLEW_SGIX_texture_multi_buffer) + +#endif /* GL_SGIX_texture_multi_buffer */ + +/* ------------------------- GL_SGIX_texture_range ------------------------- */ + +#ifndef GL_SGIX_texture_range +#define GL_SGIX_texture_range 1 + +#define GL_RGB_SIGNED_SGIX 0x85E0 +#define GL_RGBA_SIGNED_SGIX 0x85E1 +#define GL_ALPHA_SIGNED_SGIX 0x85E2 +#define GL_LUMINANCE_SIGNED_SGIX 0x85E3 +#define GL_INTENSITY_SIGNED_SGIX 0x85E4 +#define GL_LUMINANCE_ALPHA_SIGNED_SGIX 0x85E5 +#define GL_RGB16_SIGNED_SGIX 0x85E6 +#define GL_RGBA16_SIGNED_SGIX 0x85E7 +#define GL_ALPHA16_SIGNED_SGIX 0x85E8 +#define GL_LUMINANCE16_SIGNED_SGIX 0x85E9 +#define GL_INTENSITY16_SIGNED_SGIX 0x85EA +#define GL_LUMINANCE16_ALPHA16_SIGNED_SGIX 0x85EB +#define GL_RGB_EXTENDED_RANGE_SGIX 0x85EC +#define GL_RGBA_EXTENDED_RANGE_SGIX 0x85ED +#define GL_ALPHA_EXTENDED_RANGE_SGIX 0x85EE +#define GL_LUMINANCE_EXTENDED_RANGE_SGIX 0x85EF +#define GL_INTENSITY_EXTENDED_RANGE_SGIX 0x85F0 +#define GL_LUMINANCE_ALPHA_EXTENDED_RANGE_SGIX 0x85F1 +#define GL_RGB16_EXTENDED_RANGE_SGIX 0x85F2 +#define GL_RGBA16_EXTENDED_RANGE_SGIX 0x85F3 +#define GL_ALPHA16_EXTENDED_RANGE_SGIX 0x85F4 +#define GL_LUMINANCE16_EXTENDED_RANGE_SGIX 0x85F5 +#define GL_INTENSITY16_EXTENDED_RANGE_SGIX 0x85F6 +#define GL_LUMINANCE16_ALPHA16_EXTENDED_RANGE_SGIX 0x85F7 +#define GL_MIN_LUMINANCE_SGIS 0x85F8 +#define GL_MAX_LUMINANCE_SGIS 0x85F9 +#define GL_MIN_INTENSITY_SGIS 0x85FA +#define GL_MAX_INTENSITY_SGIS 0x85FB + +#define GLEW_SGIX_texture_range GLEW_GET_VAR(__GLEW_SGIX_texture_range) + +#endif /* GL_SGIX_texture_range */ + +/* ----------------------- GL_SGIX_texture_scale_bias ---------------------- */ + +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 + +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C + +#define GLEW_SGIX_texture_scale_bias GLEW_GET_VAR(__GLEW_SGIX_texture_scale_bias) + +#endif /* GL_SGIX_texture_scale_bias */ + +/* ------------------------- GL_SGIX_vertex_preclip ------------------------ */ + +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 + +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF + +#define GLEW_SGIX_vertex_preclip GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip) + +#endif /* GL_SGIX_vertex_preclip */ + +/* ---------------------- GL_SGIX_vertex_preclip_hint ---------------------- */ + +#ifndef GL_SGIX_vertex_preclip_hint +#define GL_SGIX_vertex_preclip_hint 1 + +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF + +#define GLEW_SGIX_vertex_preclip_hint GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip_hint) + +#endif /* GL_SGIX_vertex_preclip_hint */ + +/* ----------------------------- GL_SGIX_ycrcb ----------------------------- */ + +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 + +#define GLEW_SGIX_ycrcb GLEW_GET_VAR(__GLEW_SGIX_ycrcb) + +#endif /* GL_SGIX_ycrcb */ + +/* -------------------------- GL_SGI_color_matrix -------------------------- */ + +#ifndef GL_SGI_color_matrix +#define GL_SGI_color_matrix 1 + +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB + +#define GLEW_SGI_color_matrix GLEW_GET_VAR(__GLEW_SGI_color_matrix) + +#endif /* GL_SGI_color_matrix */ + +/* --------------------------- GL_SGI_color_table -------------------------- */ + +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 + +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF + +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* table); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, void* table); + +#define glColorTableParameterfvSGI GLEW_GET_FUN(__glewColorTableParameterfvSGI) +#define glColorTableParameterivSGI GLEW_GET_FUN(__glewColorTableParameterivSGI) +#define glColorTableSGI GLEW_GET_FUN(__glewColorTableSGI) +#define glCopyColorTableSGI GLEW_GET_FUN(__glewCopyColorTableSGI) +#define glGetColorTableParameterfvSGI GLEW_GET_FUN(__glewGetColorTableParameterfvSGI) +#define glGetColorTableParameterivSGI GLEW_GET_FUN(__glewGetColorTableParameterivSGI) +#define glGetColorTableSGI GLEW_GET_FUN(__glewGetColorTableSGI) + +#define GLEW_SGI_color_table GLEW_GET_VAR(__GLEW_SGI_color_table) + +#endif /* GL_SGI_color_table */ + +/* ----------------------- GL_SGI_texture_color_table ---------------------- */ + +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 + +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD + +#define GLEW_SGI_texture_color_table GLEW_GET_VAR(__GLEW_SGI_texture_color_table) + +#endif /* GL_SGI_texture_color_table */ + +/* ------------------------- GL_SUNX_constant_data ------------------------- */ + +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 + +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 + +typedef void (GLAPIENTRY * PFNGLFINISHTEXTURESUNXPROC) (void); + +#define glFinishTextureSUNX GLEW_GET_FUN(__glewFinishTextureSUNX) + +#define GLEW_SUNX_constant_data GLEW_GET_VAR(__GLEW_SUNX_constant_data) + +#endif /* GL_SUNX_constant_data */ + +/* -------------------- GL_SUN_convolution_border_modes -------------------- */ + +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 + +#define GL_WRAP_BORDER_SUN 0x81D4 + +#define GLEW_SUN_convolution_border_modes GLEW_GET_VAR(__GLEW_SUN_convolution_border_modes) + +#endif /* GL_SUN_convolution_border_modes */ + +/* -------------------------- GL_SUN_global_alpha -------------------------- */ + +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 + +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA + +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); + +#define glGlobalAlphaFactorbSUN GLEW_GET_FUN(__glewGlobalAlphaFactorbSUN) +#define glGlobalAlphaFactordSUN GLEW_GET_FUN(__glewGlobalAlphaFactordSUN) +#define glGlobalAlphaFactorfSUN GLEW_GET_FUN(__glewGlobalAlphaFactorfSUN) +#define glGlobalAlphaFactoriSUN GLEW_GET_FUN(__glewGlobalAlphaFactoriSUN) +#define glGlobalAlphaFactorsSUN GLEW_GET_FUN(__glewGlobalAlphaFactorsSUN) +#define glGlobalAlphaFactorubSUN GLEW_GET_FUN(__glewGlobalAlphaFactorubSUN) +#define glGlobalAlphaFactoruiSUN GLEW_GET_FUN(__glewGlobalAlphaFactoruiSUN) +#define glGlobalAlphaFactorusSUN GLEW_GET_FUN(__glewGlobalAlphaFactorusSUN) + +#define GLEW_SUN_global_alpha GLEW_GET_VAR(__GLEW_SUN_global_alpha) + +#endif /* GL_SUN_global_alpha */ + +/* --------------------------- GL_SUN_mesh_array --------------------------- */ + +#ifndef GL_SUN_mesh_array +#define GL_SUN_mesh_array 1 + +#define GL_QUAD_MESH_SUN 0x8614 +#define GL_TRIANGLE_MESH_SUN 0x8615 + +#define GLEW_SUN_mesh_array GLEW_GET_VAR(__GLEW_SUN_mesh_array) + +#endif /* GL_SUN_mesh_array */ + +/* ------------------------ GL_SUN_read_video_pixels ----------------------- */ + +#ifndef GL_SUN_read_video_pixels +#define GL_SUN_read_video_pixels 1 + +typedef void (GLAPIENTRY * PFNGLREADVIDEOPIXELSSUNPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels); + +#define glReadVideoPixelsSUN GLEW_GET_FUN(__glewReadVideoPixelsSUN) + +#define GLEW_SUN_read_video_pixels GLEW_GET_VAR(__GLEW_SUN_read_video_pixels) + +#endif /* GL_SUN_read_video_pixels */ + +/* --------------------------- GL_SUN_slice_accum -------------------------- */ + +#ifndef GL_SUN_slice_accum +#define GL_SUN_slice_accum 1 + +#define GL_SLICE_ACCUM_SUN 0x85CC + +#define GLEW_SUN_slice_accum GLEW_GET_VAR(__GLEW_SUN_slice_accum) + +#endif /* GL_SUN_slice_accum */ + +/* -------------------------- GL_SUN_triangle_list ------------------------- */ + +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 + +#define GL_RESTART_SUN 0x01 +#define GL_REPLACE_MIDDLE_SUN 0x02 +#define GL_REPLACE_OLDEST_SUN 0x03 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB + +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const void* pointer); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte* code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint* code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort* code); + +#define glReplacementCodePointerSUN GLEW_GET_FUN(__glewReplacementCodePointerSUN) +#define glReplacementCodeubSUN GLEW_GET_FUN(__glewReplacementCodeubSUN) +#define glReplacementCodeubvSUN GLEW_GET_FUN(__glewReplacementCodeubvSUN) +#define glReplacementCodeuiSUN GLEW_GET_FUN(__glewReplacementCodeuiSUN) +#define glReplacementCodeuivSUN GLEW_GET_FUN(__glewReplacementCodeuivSUN) +#define glReplacementCodeusSUN GLEW_GET_FUN(__glewReplacementCodeusSUN) +#define glReplacementCodeusvSUN GLEW_GET_FUN(__glewReplacementCodeusvSUN) + +#define GLEW_SUN_triangle_list GLEW_GET_VAR(__GLEW_SUN_triangle_list) + +#endif /* GL_SUN_triangle_list */ + +/* ----------------------------- GL_SUN_vertex ----------------------------- */ + +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 + +typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint* rc, const GLubyte *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat* tc, const GLubyte *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *v); + +#define glColor3fVertex3fSUN GLEW_GET_FUN(__glewColor3fVertex3fSUN) +#define glColor3fVertex3fvSUN GLEW_GET_FUN(__glewColor3fVertex3fvSUN) +#define glColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fSUN) +#define glColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fvSUN) +#define glColor4ubVertex2fSUN GLEW_GET_FUN(__glewColor4ubVertex2fSUN) +#define glColor4ubVertex2fvSUN GLEW_GET_FUN(__glewColor4ubVertex2fvSUN) +#define glColor4ubVertex3fSUN GLEW_GET_FUN(__glewColor4ubVertex3fSUN) +#define glColor4ubVertex3fvSUN GLEW_GET_FUN(__glewColor4ubVertex3fvSUN) +#define glNormal3fVertex3fSUN GLEW_GET_FUN(__glewNormal3fVertex3fSUN) +#define glNormal3fVertex3fvSUN GLEW_GET_FUN(__glewNormal3fVertex3fvSUN) +#define glReplacementCodeuiColor3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fSUN) +#define glReplacementCodeuiColor3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fvSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiColor4ubVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fSUN) +#define glReplacementCodeuiColor4ubVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fvSUN) +#define glReplacementCodeuiNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fSUN) +#define glReplacementCodeuiNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fvSUN) +#define glReplacementCodeuiVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fSUN) +#define glReplacementCodeuiVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fvSUN) +#define glTexCoord2fColor3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fSUN) +#define glTexCoord2fColor3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fvSUN) +#define glTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fSUN) +#define glTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fvSUN) +#define glTexCoord2fColor4ubVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fSUN) +#define glTexCoord2fColor4ubVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fvSUN) +#define glTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fSUN) +#define glTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fvSUN) +#define glTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fSUN) +#define glTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fvSUN) +#define glTexCoord4fColor4fNormal3fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fSUN) +#define glTexCoord4fColor4fNormal3fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fvSUN) +#define glTexCoord4fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fSUN) +#define glTexCoord4fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fvSUN) + +#define GLEW_SUN_vertex GLEW_GET_VAR(__GLEW_SUN_vertex) + +#endif /* GL_SUN_vertex */ + +/* -------------------------- GL_WIN_phong_shading ------------------------- */ + +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 + +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB + +#define GLEW_WIN_phong_shading GLEW_GET_VAR(__GLEW_WIN_phong_shading) + +#endif /* GL_WIN_phong_shading */ + +/* -------------------------- GL_WIN_specular_fog -------------------------- */ + +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 + +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC + +#define GLEW_WIN_specular_fog GLEW_GET_VAR(__GLEW_WIN_specular_fog) + +#endif /* GL_WIN_specular_fog */ + +/* ---------------------------- GL_WIN_swap_hint --------------------------- */ + +#ifndef GL_WIN_swap_hint +#define GL_WIN_swap_hint 1 + +typedef void (GLAPIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei width, GLsizei height); + +#define glAddSwapHintRectWIN GLEW_GET_FUN(__glewAddSwapHintRectWIN) + +#define GLEW_WIN_swap_hint GLEW_GET_VAR(__GLEW_WIN_swap_hint) + +#endif /* GL_WIN_swap_hint */ + +/* ------------------------------------------------------------------------- */ + +#if defined(GLEW_MX) && defined(_WIN32) +#define GLEW_FUN_EXPORT +#else +#define GLEW_FUN_EXPORT GLEWAPI +#endif /* GLEW_MX */ + +#if defined(GLEW_MX) +#define GLEW_VAR_EXPORT +#else +#define GLEW_VAR_EXPORT GLEWAPI +#endif /* GLEW_MX */ + +#if defined(GLEW_MX) && defined(_WIN32) +struct GLEWContextStruct +{ +#endif /* GLEW_MX */ + +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DPROC __glewTexImage3D; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D; + +GLEW_FUN_EXPORT PFNGLACTIVETEXTUREPROC __glewActiveTexture; +GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv; +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage; + +GLEW_FUN_EXPORT PFNGLBLENDCOLORPROC __glewBlendColor; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONPROC __glewBlendEquation; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate; +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer; +GLEW_FUN_EXPORT PFNGLFOGCOORDDPROC __glewFogCoordd; +GLEW_FUN_EXPORT PFNGLFOGCOORDDVPROC __glewFogCoorddv; +GLEW_FUN_EXPORT PFNGLFOGCOORDFPROC __glewFogCoordf; +GLEW_FUN_EXPORT PFNGLFOGCOORDFVPROC __glewFogCoordfv; +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFPROC __glewPointParameterf; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DPROC __glewWindowPos2d; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FPROC __glewWindowPos2f; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IPROC __glewWindowPos2i; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SPROC __glewWindowPos2s; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DPROC __glewWindowPos3d; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FPROC __glewWindowPos3f; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IPROC __glewWindowPos3i; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SPROC __glewWindowPos3s; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYPROC __glewBeginQuery; +GLEW_FUN_EXPORT PFNGLBINDBUFFERPROC __glewBindBuffer; +GLEW_FUN_EXPORT PFNGLBUFFERDATAPROC __glewBufferData; +GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAPROC __glewBufferSubData; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERSPROC __glewDeleteBuffers; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESPROC __glewDeleteQueries; +GLEW_FUN_EXPORT PFNGLENDQUERYPROC __glewEndQuery; +GLEW_FUN_EXPORT PFNGLGENBUFFERSPROC __glewGenBuffers; +GLEW_FUN_EXPORT PFNGLGENQUERIESPROC __glewGenQueries; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv; +GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv; +GLEW_FUN_EXPORT PFNGLGETQUERYIVPROC __glewGetQueryiv; +GLEW_FUN_EXPORT PFNGLISBUFFERPROC __glewIsBuffer; +GLEW_FUN_EXPORT PFNGLISQUERYPROC __glewIsQuery; +GLEW_FUN_EXPORT PFNGLMAPBUFFERPROC __glewMapBuffer; +GLEW_FUN_EXPORT PFNGLUNMAPBUFFERPROC __glewUnmapBuffer; + +GLEW_FUN_EXPORT PFNGLATTACHSHADERPROC __glewAttachShader; +GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate; +GLEW_FUN_EXPORT PFNGLCOMPILESHADERPROC __glewCompileShader; +GLEW_FUN_EXPORT PFNGLCREATEPROGRAMPROC __glewCreateProgram; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROC __glewCreateShader; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPROC __glewDeleteProgram; +GLEW_FUN_EXPORT PFNGLDELETESHADERPROC __glewDeleteShader; +GLEW_FUN_EXPORT PFNGLDETACHSHADERPROC __glewDetachShader; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray; +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSPROC __glewDrawBuffers; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray; +GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform; +GLEW_FUN_EXPORT PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders; +GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation; +GLEW_FUN_EXPORT PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVPROC __glewGetProgramiv; +GLEW_FUN_EXPORT PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog; +GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEPROC __glewGetShaderSource; +GLEW_FUN_EXPORT PFNGLGETSHADERIVPROC __glewGetShaderiv; +GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation; +GLEW_FUN_EXPORT PFNGLGETUNIFORMFVPROC __glewGetUniformfv; +GLEW_FUN_EXPORT PFNGLGETUNIFORMIVPROC __glewGetUniformiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv; +GLEW_FUN_EXPORT PFNGLISPROGRAMPROC __glewIsProgram; +GLEW_FUN_EXPORT PFNGLISSHADERPROC __glewIsShader; +GLEW_FUN_EXPORT PFNGLLINKPROGRAMPROC __glewLinkProgram; +GLEW_FUN_EXPORT PFNGLSHADERSOURCEPROC __glewShaderSource; +GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate; +GLEW_FUN_EXPORT PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate; +GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate; +GLEW_FUN_EXPORT PFNGLUNIFORM1FPROC __glewUniform1f; +GLEW_FUN_EXPORT PFNGLUNIFORM1FVPROC __glewUniform1fv; +GLEW_FUN_EXPORT PFNGLUNIFORM1IPROC __glewUniform1i; +GLEW_FUN_EXPORT PFNGLUNIFORM1IVPROC __glewUniform1iv; +GLEW_FUN_EXPORT PFNGLUNIFORM2FPROC __glewUniform2f; +GLEW_FUN_EXPORT PFNGLUNIFORM2FVPROC __glewUniform2fv; +GLEW_FUN_EXPORT PFNGLUNIFORM2IPROC __glewUniform2i; +GLEW_FUN_EXPORT PFNGLUNIFORM2IVPROC __glewUniform2iv; +GLEW_FUN_EXPORT PFNGLUNIFORM3FPROC __glewUniform3f; +GLEW_FUN_EXPORT PFNGLUNIFORM3FVPROC __glewUniform3fv; +GLEW_FUN_EXPORT PFNGLUNIFORM3IPROC __glewUniform3i; +GLEW_FUN_EXPORT PFNGLUNIFORM3IVPROC __glewUniform3iv; +GLEW_FUN_EXPORT PFNGLUNIFORM4FPROC __glewUniform4f; +GLEW_FUN_EXPORT PFNGLUNIFORM4FVPROC __glewUniform4fv; +GLEW_FUN_EXPORT PFNGLUNIFORM4IPROC __glewUniform4i; +GLEW_FUN_EXPORT PFNGLUNIFORM4IVPROC __glewUniform4iv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMPROC __glewUseProgram; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPROC __glewValidateProgram; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer; + +GLEW_FUN_EXPORT PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE; + +GLEW_FUN_EXPORT PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE; +GLEW_FUN_EXPORT PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE; +GLEW_FUN_EXPORT PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE; +GLEW_FUN_EXPORT PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE; +GLEW_FUN_EXPORT PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE; +GLEW_FUN_EXPORT PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE; +GLEW_FUN_EXPORT PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE; +GLEW_FUN_EXPORT PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE; + +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE; +GLEW_FUN_EXPORT PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE; +GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE; +GLEW_FUN_EXPORT PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE; + +GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLCLAMPCOLORARBPROC __glewClampColorARB; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB; + +GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEPROC __glewColorSubTable; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPROC __glewColorTable; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv; +GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable; +GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPROC __glewGetColorTable; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPROC __glewGetHistogram; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv; +GLEW_FUN_EXPORT PFNGLGETMINMAXPROC __glewGetMinmax; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv; +GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter; +GLEW_FUN_EXPORT PFNGLHISTOGRAMPROC __glewHistogram; +GLEW_FUN_EXPORT PFNGLMINMAXPROC __glewMinmax; +GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMPROC __glewResetHistogram; +GLEW_FUN_EXPORT PFNGLRESETMINMAXPROC __glewResetMinmax; +GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D; + +GLEW_FUN_EXPORT PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB; + +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB; + +GLEW_FUN_EXPORT PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB; +GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYARBPROC __glewBeginQueryARB; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB; +GLEW_FUN_EXPORT PFNGLENDQUERYARBPROC __glewEndQueryARB; +GLEW_FUN_EXPORT PFNGLGENQUERIESARBPROC __glewGenQueriesARB; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB; +GLEW_FUN_EXPORT PFNGLGETQUERYIVARBPROC __glewGetQueryivARB; +GLEW_FUN_EXPORT PFNGLISQUERYARBPROC __glewIsQueryARB; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB; + +GLEW_FUN_EXPORT PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB; +GLEW_FUN_EXPORT PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB; +GLEW_FUN_EXPORT PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB; +GLEW_FUN_EXPORT PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB; +GLEW_FUN_EXPORT PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB; +GLEW_FUN_EXPORT PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB; +GLEW_FUN_EXPORT PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB; +GLEW_FUN_EXPORT PFNGLGETHANDLEARBPROC __glewGetHandleARB; +GLEW_FUN_EXPORT PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB; +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB; +GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB; +GLEW_FUN_EXPORT PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB; +GLEW_FUN_EXPORT PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1FARBPROC __glewUniform1fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1IARBPROC __glewUniform1iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2FARBPROC __glewUniform2fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2IARBPROC __glewUniform2iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3FARBPROC __glewUniform3fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3IARBPROC __glewUniform3iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4FARBPROC __glewUniform4fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4IARBPROC __glewUniform4iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB; + +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB; + +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB; + +GLEW_FUN_EXPORT PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB; +GLEW_FUN_EXPORT PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB; +GLEW_FUN_EXPORT PFNGLWEIGHTBVARBPROC __glewWeightbvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTDVARBPROC __glewWeightdvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTFVARBPROC __glewWeightfvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTIVARBPROC __glewWeightivARB; +GLEW_FUN_EXPORT PFNGLWEIGHTSVARBPROC __glewWeightsvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUBVARBPROC __glewWeightubvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUIVARBPROC __glewWeightuivARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUSVARBPROC __glewWeightusvARB; + +GLEW_FUN_EXPORT PFNGLBINDBUFFERARBPROC __glewBindBufferARB; +GLEW_FUN_EXPORT PFNGLBUFFERDATAARBPROC __glewBufferDataARB; +GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB; +GLEW_FUN_EXPORT PFNGLGENBUFFERSARBPROC __glewGenBuffersARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB; +GLEW_FUN_EXPORT PFNGLISBUFFERARBPROC __glewIsBufferARB; +GLEW_FUN_EXPORT PFNGLMAPBUFFERARBPROC __glewMapBufferARB; +GLEW_FUN_EXPORT PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB; + +GLEW_FUN_EXPORT PFNGLBINDPROGRAMARBPROC __glewBindProgramARB; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB; +GLEW_FUN_EXPORT PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB; +GLEW_FUN_EXPORT PFNGLISPROGRAMARBPROC __glewIsProgramARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB; + +GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB; +GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB; +GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB; + +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI; +GLEW_FUN_EXPORT PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI; + +GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI; +GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI; +GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI; +GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI; + +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI; +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI; +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI; +GLEW_FUN_EXPORT PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI; +GLEW_FUN_EXPORT PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI; +GLEW_FUN_EXPORT PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI; +GLEW_FUN_EXPORT PFNGLSAMPLEMAPATIPROC __glewSampleMapATI; +GLEW_FUN_EXPORT PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI; + +GLEW_FUN_EXPORT PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI; +GLEW_FUN_EXPORT PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI; + +GLEW_FUN_EXPORT PFNGLPNTRIANGLESFATIPROC __glPNTrianglewesfATI; +GLEW_FUN_EXPORT PFNGLPNTRIANGLESIATIPROC __glPNTrianglewesiATI; + +GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI; +GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI; + +GLEW_FUN_EXPORT PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI; +GLEW_FUN_EXPORT PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI; +GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI; +GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI; +GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI; +GLEW_FUN_EXPORT PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI; +GLEW_FUN_EXPORT PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI; +GLEW_FUN_EXPORT PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI; + +GLEW_FUN_EXPORT PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI; +GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI; +GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI; + +GLEW_FUN_EXPORT PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT; + +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT; + +GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT; +GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT; + +GLEW_FUN_EXPORT PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT; +GLEW_FUN_EXPORT PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT; + +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT; +GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT; + +GLEW_FUN_EXPORT PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT; +GLEW_FUN_EXPORT PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT; + +GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT; + +GLEW_FUN_EXPORT PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT; +GLEW_FUN_EXPORT PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT; + +GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT; + +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT; + +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT; + +GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT; +GLEW_FUN_EXPORT PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT; + +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT; +GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT; +GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT; +GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT; +GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT; +GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT; +GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT; +GLEW_FUN_EXPORT PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT; + +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT; +GLEW_FUN_EXPORT PFNGLHISTOGRAMEXTPROC __glewHistogramEXT; +GLEW_FUN_EXPORT PFNGLMINMAXEXTPROC __glewMinmaxEXT; +GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT; +GLEW_FUN_EXPORT PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT; + +GLEW_FUN_EXPORT PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT; + +GLEW_FUN_EXPORT PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT; + +GLEW_FUN_EXPORT PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT; +GLEW_FUN_EXPORT PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT; + +GLEW_FUN_EXPORT PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT; +GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT; + +GLEW_FUN_EXPORT PFNGLCOLORTABLEEXTPROC __glewColorTableEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT; + +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT; + +GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT; + +GLEW_FUN_EXPORT PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT; +GLEW_FUN_EXPORT PFNGLENDSCENEEXTPROC __glewEndSceneEXT; + +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT; + +GLEW_FUN_EXPORT PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT; + +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT; + +GLEW_FUN_EXPORT PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT; +GLEW_FUN_EXPORT PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT; +GLEW_FUN_EXPORT PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT; +GLEW_FUN_EXPORT PFNGLISTEXTUREEXTPROC __glewIsTextureEXT; +GLEW_FUN_EXPORT PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT; + +GLEW_FUN_EXPORT PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT; + +GLEW_FUN_EXPORT PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT; +GLEW_FUN_EXPORT PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT; +GLEW_FUN_EXPORT PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT; +GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT; +GLEW_FUN_EXPORT PFNGLGETPOINTERVEXTPROC __glewGetPointervEXT; +GLEW_FUN_EXPORT PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT; +GLEW_FUN_EXPORT PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT; + +GLEW_FUN_EXPORT PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT; +GLEW_FUN_EXPORT PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT; +GLEW_FUN_EXPORT PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT; +GLEW_FUN_EXPORT PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT; +GLEW_FUN_EXPORT PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT; +GLEW_FUN_EXPORT PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT; +GLEW_FUN_EXPORT PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT; +GLEW_FUN_EXPORT PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT; +GLEW_FUN_EXPORT PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT; +GLEW_FUN_EXPORT PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT; +GLEW_FUN_EXPORT PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT; +GLEW_FUN_EXPORT PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT; +GLEW_FUN_EXPORT PFNGLSWIZZLEEXTPROC __glewSwizzleEXT; +GLEW_FUN_EXPORT PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT; +GLEW_FUN_EXPORT PFNGLVARIANTBVEXTPROC __glewVariantbvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTDVEXTPROC __glewVariantdvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTFVEXTPROC __glewVariantfvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTIVEXTPROC __glewVariantivEXT; +GLEW_FUN_EXPORT PFNGLVARIANTSVEXTPROC __glewVariantsvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT; +GLEW_FUN_EXPORT PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT; + +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT; + +GLEW_FUN_EXPORT PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY; + +GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP; +GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP; + +GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM; +GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM; + +GLEW_FUN_EXPORT PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM; +GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM; +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM; +GLEW_FUN_EXPORT PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM; +GLEW_FUN_EXPORT PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM; + +GLEW_FUN_EXPORT PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL; +GLEW_FUN_EXPORT PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL; + +GLEW_FUN_EXPORT PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL; +GLEW_FUN_EXPORT PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL; + +GLEW_FUN_EXPORT PFNGLBUFFERREGIONENABLEDEXTPROC __glewBufferRegionEnabledEXT; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERREGIONEXTPROC __glewDeleteBufferRegionEXT; +GLEW_FUN_EXPORT PFNGLDRAWBUFFERREGIONEXTPROC __glewDrawBufferRegionEXT; +GLEW_FUN_EXPORT PFNGLNEWBUFFERREGIONEXTPROC __glewNewBufferRegionEXT; +GLEW_FUN_EXPORT PFNGLREADBUFFERREGIONEXTPROC __glewReadBufferRegionEXT; + +GLEW_FUN_EXPORT PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA; + +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA; + +GLEW_FUN_EXPORT PFNGLEVALMAPSNVPROC __glewEvalMapsNV; +GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV; +GLEW_FUN_EXPORT PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV; +GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV; +GLEW_FUN_EXPORT PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV; +GLEW_FUN_EXPORT PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV; +GLEW_FUN_EXPORT PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV; + +GLEW_FUN_EXPORT PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV; +GLEW_FUN_EXPORT PFNGLFINISHFENCENVPROC __glewFinishFenceNV; +GLEW_FUN_EXPORT PFNGLGENFENCESNVPROC __glewGenFencesNV; +GLEW_FUN_EXPORT PFNGLGETFENCEIVNVPROC __glewGetFenceivNV; +GLEW_FUN_EXPORT PFNGLISFENCENVPROC __glewIsFenceNV; +GLEW_FUN_EXPORT PFNGLSETFENCENVPROC __glewSetFenceNV; +GLEW_FUN_EXPORT PFNGLTESTFENCENVPROC __glewTestFenceNV; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV; + +GLEW_FUN_EXPORT PFNGLCOLOR3HNVPROC __glewColor3hNV; +GLEW_FUN_EXPORT PFNGLCOLOR3HVNVPROC __glewColor3hvNV; +GLEW_FUN_EXPORT PFNGLCOLOR4HNVPROC __glewColor4hNV; +GLEW_FUN_EXPORT PFNGLCOLOR4HVNVPROC __glewColor4hvNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDHNVPROC __glewFogCoordhNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV; +GLEW_FUN_EXPORT PFNGLNORMAL3HNVPROC __glewNormal3hNV; +GLEW_FUN_EXPORT PFNGLNORMAL3HVNVPROC __glewNormal3hvNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX2HNVPROC __glewVertex2hNV; +GLEW_FUN_EXPORT PFNGLVERTEX2HVNVPROC __glewVertex2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX3HNVPROC __glewVertex3hNV; +GLEW_FUN_EXPORT PFNGLVERTEX3HVNVPROC __glewVertex3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX4HNVPROC __glewVertex4hNV; +GLEW_FUN_EXPORT PFNGLVERTEX4HVNVPROC __glewVertex4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV; + +GLEW_FUN_EXPORT PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV; +GLEW_FUN_EXPORT PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV; +GLEW_FUN_EXPORT PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV; +GLEW_FUN_EXPORT PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV; +GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV; +GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV; +GLEW_FUN_EXPORT PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV; + +GLEW_FUN_EXPORT PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV; +GLEW_FUN_EXPORT PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV; + +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV; +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV; + +GLEW_FUN_EXPORT PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV; +GLEW_FUN_EXPORT PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV; +GLEW_FUN_EXPORT PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV; +GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV; + +GLEW_FUN_EXPORT PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV; + +GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV; + +GLEW_FUN_EXPORT PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV; +GLEW_FUN_EXPORT PFNGLBINDPROGRAMNVPROC __glewBindProgramNV; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV; +GLEW_FUN_EXPORT PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV; +GLEW_FUN_EXPORT PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV; +GLEW_FUN_EXPORT PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV; +GLEW_FUN_EXPORT PFNGLISPROGRAMNVPROC __glewIsProgramNV; +GLEW_FUN_EXPORT PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV; +GLEW_FUN_EXPORT PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV; +GLEW_FUN_EXPORT PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV; + +GLEW_FUN_EXPORT PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS; +GLEW_FUN_EXPORT PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS; + +GLEW_FUN_EXPORT PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS; +GLEW_FUN_EXPORT PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS; + +GLEW_FUN_EXPORT PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS; +GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS; + +GLEW_FUN_EXPORT PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS; +GLEW_FUN_EXPORT PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS; + +GLEW_FUN_EXPORT PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS; +GLEW_FUN_EXPORT PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS; + +GLEW_FUN_EXPORT PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX; +GLEW_FUN_EXPORT PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX; +GLEW_FUN_EXPORT PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX; +GLEW_FUN_EXPORT PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX; +GLEW_FUN_EXPORT PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX; +GLEW_FUN_EXPORT PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX; + +GLEW_FUN_EXPORT PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX; + +GLEW_FUN_EXPORT PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX; + +#if 0 +GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX; +#endif + +GLEW_FUN_EXPORT PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX; + +GLEW_FUN_EXPORT PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX; + +GLEW_FUN_EXPORT PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX; + +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX; + +GLEW_FUN_EXPORT PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX; + +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI; +GLEW_FUN_EXPORT PFNGLCOLORTABLESGIPROC __glewColorTableSGI; +GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI; + +GLEW_FUN_EXPORT PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX; + +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN; + +GLEW_FUN_EXPORT PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN; + +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN; + +GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN; + +GLEW_FUN_EXPORT PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN; + +#if defined(GLEW_MX) && !defined(_WIN32) +struct GLEWContextStruct +{ +#endif /* GLEW_MX */ + +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_4; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_5; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_0; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_tbuffer; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_texture_compression_FXT1; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_client_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_element_array; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_fence; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_float_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_pixel_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_specular_vector; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_transform_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_ycbcr_422; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_color_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_pixel; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_imaging; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_matrix_palette; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multitexture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pixel_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_100; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow_ambient; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_border_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_add; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_combine; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_crossbar; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_dot3; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirrored_repeat; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_non_power_of_two; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transpose_matrix; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_program; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_window_pos; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_point_sprites; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_combine3; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_route; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_vertex_shader_output_point_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_element_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_envmap_bumpmap; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_map_object_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_pn_triangles; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_separate_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_text_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_compression_3dc; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_env_combine3; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_mirror_once; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_attrib_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_streams; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_422_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_Cg_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_abgr; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_equation_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_func_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_logic_op; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_subtract; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clip_volume_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cmyka; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_subtable; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_compiled_vertex_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_convolution; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_coordinate_frame; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_copy_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cull_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_depth_bounds_test; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_range_elements; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fog_coord; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fragment_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_blit; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_histogram; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_array_formats; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_func; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_material; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_light_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_misc_attribute; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multi_draw_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_paletted_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_point_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_polygon_offset; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_rescale_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_scene_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_secondary_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_specular_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shadow_funcs; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shared_texture_palette; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_clear_tag; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_two_side; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_wrap; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_subtexture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture3D; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_dxt1; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_edge_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_add; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_combine; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_dot3; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_anisotropic; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_lod_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_mirror_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_perturb_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_weighting; +GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_string_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_convolution_border_modes; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_image_transform; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_occlusion_test; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_texture_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_cull_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_multimode_draw_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_rasterpos_clip; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_static_data; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_texture_mirrored_repeat; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_vertex_array_lists; +GLEW_VAR_EXPORT GLboolean __GLEW_INGR_color_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_INGR_interlace_read; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_parallel_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_texture_scissor; +GLEW_VAR_EXPORT GLboolean __GLEW_KTX_buffer_region; +GLEW_VAR_EXPORT GLboolean __GLEW_MESAX_texture_stack; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_pack_invert; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_resize_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_window_pos; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_ycbcr_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_square; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_depth_to_color; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_evaluators; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fence; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_float_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fog_distance; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program_option; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_half_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_light_max_exponent; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_filter_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_occlusion_query; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_pixel_data_range; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_point_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_primitive_restart; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_emboss; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_reflection; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_vtc; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_env_combine4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_expand_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader3; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program1_1; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2_option; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program3; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_interlace; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_resample; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_subsample; +GLEW_VAR_EXPORT GLboolean __GLEW_PGI_misc_hints; +GLEW_VAR_EXPORT GLboolean __GLEW_PGI_vertex_hints; +GLEW_VAR_EXPORT GLboolean __GLEW_REND_screen_coordinates; +GLEW_VAR_EXPORT GLboolean __GLEW_S3_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_color_range; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_detail_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_fog_function; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_generate_mipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_sharpen_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture4D; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_border_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_edge_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_filter4; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_select; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_histogram; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_pixel; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_alpha_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_clipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_flush_raster; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_offset; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragment_specular_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_framezoom; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_interlace; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ir_instrument1; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_list_priority; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture_bits; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_reference_plane; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_resample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow_ambient; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_tag_sample_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_add_env; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_coordinate_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_lod_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_multi_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_range; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_scale_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ycrcb; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_matrix; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_texture_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_SUNX_constant_data; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_convolution_border_modes; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_global_alpha; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_mesh_array; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_read_video_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_slice_accum; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_triangle_list; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_phong_shading; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_specular_fog; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_swap_hint; + +#ifdef GLEW_MX +}; /* GLEWContextStruct */ +#endif /* GLEW_MX */ + +/* ------------------------------------------------------------------------- */ + +/* error codes */ +#define GLEW_OK 0 +#define GLEW_NO_ERROR 0 +#define GLEW_ERROR_NO_GL_VERSION 1 /* missing GL version */ +#define GLEW_ERROR_GL_VERSION_10_ONLY 2 /* GL 1.1 and up are not supported */ +#define GLEW_ERROR_GLX_VERSION_11_ONLY 3 /* GLX 1.2 and up are not supported */ + +/* string codes */ +#define GLEW_VERSION 1 + +/* API */ +#ifdef GLEW_MX + +typedef struct GLEWContextStruct GLEWContext; +GLEWAPI GLenum glewContextInit (GLEWContext* ctx); +GLEWAPI GLboolean glewContextIsSupported (GLEWContext* ctx, const char* name); + +#define glewInit() glewContextInit(glewGetContext()) +#define glewIsSupported(x) glewContextIsSupported(glewGetContext(), x) +#define glewIsExtensionSupported(x) glewIsSupported(x) + +#ifdef _WIN32 +# define GLEW_GET_VAR(x) glewGetContext()->x +# define GLEW_GET_FUN(x) glewGetContext()->x +#else +# define GLEW_GET_VAR(x) glewGetContext()->x +# define GLEW_GET_FUN(x) x +#endif + +#else /* GLEW_MX */ + +GLEWAPI GLenum glewInit (); +GLEWAPI GLboolean glewIsSupported (const char* name); +#define glewIsExtensionSupported(x) glewIsSupported(x) + +#define GLEW_GET_VAR(x) x +#define GLEW_GET_FUN(x) x + +#endif /* GLEW_MX */ + +GLEWAPI GLboolean glewExperimental; +GLEWAPI GLboolean glewGetExtension (const char* name); +GLEWAPI const GLubyte* glewGetErrorString (GLenum error); +GLEWAPI const GLubyte* glewGetString (GLenum name); + +#ifdef __cplusplus +} +#endif + +#ifdef GLEW_APIENTRY_DEFINED +#undef GLEW_APIENTRY_DEFINED +#undef APIENTRY +#undef GLAPIENTRY +#endif + +#ifdef GLEW_CALLBACK_DEFINED +#undef GLEW_CALLBACK_DEFINED +#undef CALLBACK +#endif + +#ifdef GLEW_WINGDIAPI_DEFINED +#undef GLEW_WINGDIAPI_DEFINED +#undef WINGDIAPI +#endif + +#undef GLAPI +/* #undef GLEWAPI */ + +#endif /* __glew_h__ */ diff --git a/extern/glew/include/GL/glxew.h b/extern/glew/include/GL/glxew.h new file mode 100644 index 00000000000..d21397aeed4 --- /dev/null +++ b/extern/glew/include/GL/glxew.h @@ -0,0 +1,1062 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2006, Milan Ikits +** Copyright (C) 2002-2006, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* +** The contents of this file are subject to the GLX Public License Version 1.0 +** (the "License"). You may not use this file except in compliance with the +** License. You may obtain a copy of the License at Silicon Graphics, Inc., +** attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA 94043 +** or at http://www.sgi.com/software/opensource/glx/license.html. +** +** Software distributed under the License is distributed on an "AS IS" +** basis. ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY +** IMPLIED WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR +** PURPOSE OR OF NON- INFRINGEMENT. See the License for the specific +** language governing rights and limitations under the License. +** +** The Original Software is GLX version 1.2 source code, released February, +** 1999. The developer of the Original Software is Silicon Graphics, Inc. +** Those portions of the Subject Software created by Silicon Graphics, Inc. +** are Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved. +*/ + +#ifndef __glxew_h__ +#define __glxew_h__ +#define __GLXEW_H__ + +#ifdef __glxext_h_ +#error glxext.h included before glxew.h +#endif + +#define __glxext_h_ +#define __GLX_glx_h__ + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ---------------------------- GLX_VERSION_1_0 --------------------------- */ + +#ifndef GLX_VERSION_1_0 +#define GLX_VERSION_1_0 1 + +#define GLX_USE_GL 1 +#define GLX_BUFFER_SIZE 2 +#define GLX_LEVEL 3 +#define GLX_RGBA 4 +#define GLX_DOUBLEBUFFER 5 +#define GLX_STEREO 6 +#define GLX_AUX_BUFFERS 7 +#define GLX_RED_SIZE 8 +#define GLX_GREEN_SIZE 9 +#define GLX_BLUE_SIZE 10 +#define GLX_ALPHA_SIZE 11 +#define GLX_DEPTH_SIZE 12 +#define GLX_STENCIL_SIZE 13 +#define GLX_ACCUM_RED_SIZE 14 +#define GLX_ACCUM_GREEN_SIZE 15 +#define GLX_ACCUM_BLUE_SIZE 16 +#define GLX_ACCUM_ALPHA_SIZE 17 +#define GLX_BAD_SCREEN 1 +#define GLX_BAD_ATTRIBUTE 2 +#define GLX_NO_EXTENSION 3 +#define GLX_BAD_VISUAL 4 +#define GLX_BAD_CONTEXT 5 +#define GLX_BAD_VALUE 6 +#define GLX_BAD_ENUM 7 + +typedef XID GLXDrawable; +typedef XID GLXPixmap; +typedef struct __GLXcontextRec *GLXContext; + +extern Bool glXQueryExtension (Display *dpy, int *errorBase, int *eventBase); +extern Bool glXQueryVersion (Display *dpy, int *major, int *minor); +extern int glXGetConfig (Display *dpy, XVisualInfo *vis, int attrib, int *value); +extern XVisualInfo* glXChooseVisual (Display *dpy, int screen, int *attribList); +extern GLXPixmap glXCreateGLXPixmap (Display *dpy, XVisualInfo *vis, Pixmap pixmap); +extern void glXDestroyGLXPixmap (Display *dpy, GLXPixmap pix); +extern GLXContext glXCreateContext (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct); +extern void glXDestroyContext (Display *dpy, GLXContext ctx); +extern Bool glXIsDirect (Display *dpy, GLXContext ctx); +extern void glXCopyContext (Display *dpy, GLXContext src, GLXContext dst, GLuint mask); +extern Bool glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXContext ctx); +extern GLXContext glXGetCurrentContext (void); +extern GLXDrawable glXGetCurrentDrawable (void); +extern void glXWaitGL (void); +extern void glXWaitX (void); +extern void glXSwapBuffers (Display *dpy, GLXDrawable drawable); +extern void glXUseXFont (Font font, int first, int count, int listBase); + +#define GLXEW_VERSION_1_0 GLXEW_GET_VAR(__GLXEW_VERSION_1_0) + +#endif /* GLX_VERSION_1_0 */ + +/* ---------------------------- GLX_VERSION_1_1 --------------------------- */ + +#ifndef GLX_VERSION_1_1 +#define GLX_VERSION_1_1 + +#define GLX_VENDOR 0x1 +#define GLX_VERSION 0x2 +#define GLX_EXTENSIONS 0x3 + +extern const char* glXQueryExtensionsString (Display *dpy, int screen); +extern const char* glXGetClientString (Display *dpy, int name); +extern const char* glXQueryServerString (Display *dpy, int screen, int name); + +#define GLXEW_VERSION_1_1 GLXEW_GET_VAR(__GLXEW_VERSION_1_1) + +#endif /* GLX_VERSION_1_1 */ + +/* ---------------------------- GLX_VERSION_1_2 ---------------------------- */ + +#ifndef GLX_VERSION_1_2 +#define GLX_VERSION_1_2 1 + +typedef Display* ( * PFNGLXGETCURRENTDISPLAYPROC) (void); + +#define glXGetCurrentDisplay GLXEW_GET_FUN(__glewXGetCurrentDisplay) + +#define GLXEW_VERSION_1_2 GLXEW_GET_VAR(__GLXEW_VERSION_1_2) + +#endif /* GLX_VERSION_1_2 */ + +/* ---------------------------- GLX_VERSION_1_3 ---------------------------- */ + +#ifndef GLX_VERSION_1_3 +#define GLX_VERSION_1_3 1 + +#define GLX_RGBA_BIT 0x00000001 +#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 +#define GLX_WINDOW_BIT 0x00000001 +#define GLX_COLOR_INDEX_BIT 0x00000002 +#define GLX_PIXMAP_BIT 0x00000002 +#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 +#define GLX_PBUFFER_BIT 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 +#define GLX_AUX_BUFFERS_BIT 0x00000010 +#define GLX_CONFIG_CAVEAT 0x20 +#define GLX_DEPTH_BUFFER_BIT 0x00000020 +#define GLX_X_VISUAL_TYPE 0x22 +#define GLX_TRANSPARENT_TYPE 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE 0x24 +#define GLX_TRANSPARENT_RED_VALUE 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE 0x28 +#define GLX_STENCIL_BUFFER_BIT 0x00000040 +#define GLX_ACCUM_BUFFER_BIT 0x00000080 +#define GLX_NONE 0x8000 +#define GLX_SLOW_CONFIG 0x8001 +#define GLX_TRUE_COLOR 0x8002 +#define GLX_DIRECT_COLOR 0x8003 +#define GLX_PSEUDO_COLOR 0x8004 +#define GLX_STATIC_COLOR 0x8005 +#define GLX_GRAY_SCALE 0x8006 +#define GLX_STATIC_GRAY 0x8007 +#define GLX_TRANSPARENT_RGB 0x8008 +#define GLX_TRANSPARENT_INDEX 0x8009 +#define GLX_VISUAL_ID 0x800B +#define GLX_SCREEN 0x800C +#define GLX_NON_CONFORMANT_CONFIG 0x800D +#define GLX_DRAWABLE_TYPE 0x8010 +#define GLX_RENDER_TYPE 0x8011 +#define GLX_X_RENDERABLE 0x8012 +#define GLX_FBCONFIG_ID 0x8013 +#define GLX_RGBA_TYPE 0x8014 +#define GLX_COLOR_INDEX_TYPE 0x8015 +#define GLX_MAX_PBUFFER_WIDTH 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT 0x8017 +#define GLX_MAX_PBUFFER_PIXELS 0x8018 +#define GLX_PRESERVED_CONTENTS 0x801B +#define GLX_LARGEST_PBUFFER 0x801C +#define GLX_WIDTH 0x801D +#define GLX_HEIGHT 0x801E +#define GLX_EVENT_MASK 0x801F +#define GLX_DAMAGED 0x8020 +#define GLX_SAVED 0x8021 +#define GLX_WINDOW 0x8022 +#define GLX_PBUFFER 0x8023 +#define GLX_PBUFFER_HEIGHT 0x8040 +#define GLX_PBUFFER_WIDTH 0x8041 +#define GLX_PBUFFER_CLOBBER_MASK 0x08000000 +#define GLX_DONT_CARE 0xFFFFFFFF + +typedef XID GLXFBConfigID; +typedef XID GLXWindow; +typedef XID GLXPbuffer; +typedef struct __GLXFBConfigRec *GLXFBConfig; +typedef struct { int event_type; int draw_type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; unsigned int buffer_mask; unsigned int aux_buffer; int x, y; int width, height; int count; } GLXPbufferClobberEvent; +typedef union __GLXEvent { GLXPbufferClobberEvent glxpbufferclobber; long pad[24]; } GLXEvent; + +typedef GLXFBConfig* ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); +typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); +typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list); +typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list); +typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list); +typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf); +typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap); +typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win); +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void); +typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value); +typedef GLXFBConfig* ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements); +typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask); +typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config); +typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx); +typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value); +typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value); +typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask); + +#define glXChooseFBConfig GLXEW_GET_FUN(__glewXChooseFBConfig) +#define glXCreateNewContext GLXEW_GET_FUN(__glewXCreateNewContext) +#define glXCreatePbuffer GLXEW_GET_FUN(__glewXCreatePbuffer) +#define glXCreatePixmap GLXEW_GET_FUN(__glewXCreatePixmap) +#define glXCreateWindow GLXEW_GET_FUN(__glewXCreateWindow) +#define glXDestroyPbuffer GLXEW_GET_FUN(__glewXDestroyPbuffer) +#define glXDestroyPixmap GLXEW_GET_FUN(__glewXDestroyPixmap) +#define glXDestroyWindow GLXEW_GET_FUN(__glewXDestroyWindow) +#define glXGetCurrentReadDrawable GLXEW_GET_FUN(__glewXGetCurrentReadDrawable) +#define glXGetFBConfigAttrib GLXEW_GET_FUN(__glewXGetFBConfigAttrib) +#define glXGetFBConfigs GLXEW_GET_FUN(__glewXGetFBConfigs) +#define glXGetSelectedEvent GLXEW_GET_FUN(__glewXGetSelectedEvent) +#define glXGetVisualFromFBConfig GLXEW_GET_FUN(__glewXGetVisualFromFBConfig) +#define glXMakeContextCurrent GLXEW_GET_FUN(__glewXMakeContextCurrent) +#define glXQueryContext GLXEW_GET_FUN(__glewXQueryContext) +#define glXQueryDrawable GLXEW_GET_FUN(__glewXQueryDrawable) +#define glXSelectEvent GLXEW_GET_FUN(__glewXSelectEvent) + +#define GLXEW_VERSION_1_3 GLXEW_GET_VAR(__GLXEW_VERSION_1_3) + +#endif /* GLX_VERSION_1_3 */ + +/* ---------------------------- GLX_VERSION_1_4 ---------------------------- */ + +#ifndef GLX_VERSION_1_4 +#define GLX_VERSION_1_4 1 + +#define GLX_SAMPLE_BUFFERS 100000 +#define GLX_SAMPLES 100001 + +extern void ( * glXGetProcAddress (const GLubyte *procName)) (void); + +#define GLXEW_VERSION_1_4 GLXEW_GET_VAR(__GLXEW_VERSION_1_4) + +#endif /* GLX_VERSION_1_4 */ + +/* -------------------------- GLX_3DFX_multisample ------------------------- */ + +#ifndef GLX_3DFX_multisample +#define GLX_3DFX_multisample 1 + +#define GLX_SAMPLE_BUFFERS_3DFX 0x8050 +#define GLX_SAMPLES_3DFX 0x8051 + +#define GLXEW_3DFX_multisample GLXEW_GET_VAR(__GLXEW_3DFX_multisample) + +#endif /* GLX_3DFX_multisample */ + +/* ------------------------- GLX_ARB_fbconfig_float ------------------------ */ + +#ifndef GLX_ARB_fbconfig_float +#define GLX_ARB_fbconfig_float 1 + +#define GLX_RGBA_FLOAT_BIT 0x00000004 +#define GLX_RGBA_FLOAT_TYPE 0x20B9 + +#define GLXEW_ARB_fbconfig_float GLXEW_GET_VAR(__GLXEW_ARB_fbconfig_float) + +#endif /* GLX_ARB_fbconfig_float */ + +/* ------------------------ GLX_ARB_get_proc_address ----------------------- */ + +#ifndef GLX_ARB_get_proc_address +#define GLX_ARB_get_proc_address 1 + +extern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void); + +#define GLXEW_ARB_get_proc_address GLXEW_GET_VAR(__GLXEW_ARB_get_proc_address) + +#endif /* GLX_ARB_get_proc_address */ + +/* -------------------------- GLX_ARB_multisample -------------------------- */ + +#ifndef GLX_ARB_multisample +#define GLX_ARB_multisample 1 + +#define GLX_SAMPLE_BUFFERS_ARB 100000 +#define GLX_SAMPLES_ARB 100001 + +#define GLXEW_ARB_multisample GLXEW_GET_VAR(__GLXEW_ARB_multisample) + +#endif /* GLX_ARB_multisample */ + +/* ----------------------- GLX_ATI_pixel_format_float ---------------------- */ + +#ifndef GLX_ATI_pixel_format_float +#define GLX_ATI_pixel_format_float 1 + +#define GLX_RGBA_FLOAT_ATI_BIT 0x00000100 + +#define GLXEW_ATI_pixel_format_float GLXEW_GET_VAR(__GLXEW_ATI_pixel_format_float) + +#endif /* GLX_ATI_pixel_format_float */ + +/* ------------------------- GLX_ATI_render_texture ------------------------ */ + +#ifndef GLX_ATI_render_texture +#define GLX_ATI_render_texture 1 + +#define GLX_BIND_TO_TEXTURE_RGB_ATI 0x9800 +#define GLX_BIND_TO_TEXTURE_RGBA_ATI 0x9801 +#define GLX_TEXTURE_FORMAT_ATI 0x9802 +#define GLX_TEXTURE_TARGET_ATI 0x9803 +#define GLX_MIPMAP_TEXTURE_ATI 0x9804 +#define GLX_TEXTURE_RGB_ATI 0x9805 +#define GLX_TEXTURE_RGBA_ATI 0x9806 +#define GLX_NO_TEXTURE_ATI 0x9807 +#define GLX_TEXTURE_CUBE_MAP_ATI 0x9808 +#define GLX_TEXTURE_1D_ATI 0x9809 +#define GLX_TEXTURE_2D_ATI 0x980A +#define GLX_MIPMAP_LEVEL_ATI 0x980B +#define GLX_CUBE_MAP_FACE_ATI 0x980C +#define GLX_TEXTURE_CUBE_MAP_POSITIVE_X_ATI 0x980D +#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_X_ATI 0x980E +#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Y_ATI 0x980F +#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Y_ATI 0x9810 +#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Z_ATI 0x9811 +#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Z_ATI 0x9812 +#define GLX_FRONT_LEFT_ATI 0x9813 +#define GLX_FRONT_RIGHT_ATI 0x9814 +#define GLX_BACK_LEFT_ATI 0x9815 +#define GLX_BACK_RIGHT_ATI 0x9816 +#define GLX_AUX0_ATI 0x9817 +#define GLX_AUX1_ATI 0x9818 +#define GLX_AUX2_ATI 0x9819 +#define GLX_AUX3_ATI 0x981A +#define GLX_AUX4_ATI 0x981B +#define GLX_AUX5_ATI 0x981C +#define GLX_AUX6_ATI 0x981D +#define GLX_AUX7_ATI 0x981E +#define GLX_AUX8_ATI 0x981F +#define GLX_AUX9_ATI 0x9820 +#define GLX_BIND_TO_TEXTURE_LUMINANCE_ATI 0x9821 +#define GLX_BIND_TO_TEXTURE_INTENSITY_ATI 0x9822 + +typedef void ( * PFNGLXBINDTEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer); +typedef void ( * PFNGLXDRAWABLEATTRIBATIPROC) (Display *dpy, GLXDrawable draw, const int *attrib_list); +typedef void ( * PFNGLXRELEASETEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer); + +#define glXBindTexImageATI GLXEW_GET_FUN(__glewXBindTexImageATI) +#define glXDrawableAttribATI GLXEW_GET_FUN(__glewXDrawableAttribATI) +#define glXReleaseTexImageATI GLXEW_GET_FUN(__glewXReleaseTexImageATI) + +#define GLXEW_ATI_render_texture GLXEW_GET_VAR(__GLXEW_ATI_render_texture) + +#endif /* GLX_ATI_render_texture */ + +/* ------------------------- GLX_EXT_import_context ------------------------ */ + +#ifndef GLX_EXT_import_context +#define GLX_EXT_import_context 1 + +#define GLX_SHARE_CONTEXT_EXT 0x800A +#define GLX_VISUAL_ID_EXT 0x800B +#define GLX_SCREEN_EXT 0x800C + +typedef XID GLXContextID; + +typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display* dpy, GLXContext context); +typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context); +typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display* dpy, GLXContextID contextID); +typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display* dpy, GLXContext context, int attribute,int *value); + +#define glXFreeContextEXT GLXEW_GET_FUN(__glewXFreeContextEXT) +#define glXGetContextIDEXT GLXEW_GET_FUN(__glewXGetContextIDEXT) +#define glXImportContextEXT GLXEW_GET_FUN(__glewXImportContextEXT) +#define glXQueryContextInfoEXT GLXEW_GET_FUN(__glewXQueryContextInfoEXT) + +#define GLXEW_EXT_import_context GLXEW_GET_VAR(__GLXEW_EXT_import_context) + +#endif /* GLX_EXT_import_context */ + +/* -------------------------- GLX_EXT_scene_marker ------------------------- */ + +#ifndef GLX_EXT_scene_marker +#define GLX_EXT_scene_marker 1 + +#define GLXEW_EXT_scene_marker GLXEW_GET_VAR(__GLXEW_EXT_scene_marker) + +#endif /* GLX_EXT_scene_marker */ + +/* -------------------------- GLX_EXT_visual_info -------------------------- */ + +#ifndef GLX_EXT_visual_info +#define GLX_EXT_visual_info 1 + +#define GLX_X_VISUAL_TYPE_EXT 0x22 +#define GLX_TRANSPARENT_TYPE_EXT 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 +#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 +#define GLX_NONE_EXT 0x8000 +#define GLX_TRUE_COLOR_EXT 0x8002 +#define GLX_DIRECT_COLOR_EXT 0x8003 +#define GLX_PSEUDO_COLOR_EXT 0x8004 +#define GLX_STATIC_COLOR_EXT 0x8005 +#define GLX_GRAY_SCALE_EXT 0x8006 +#define GLX_STATIC_GRAY_EXT 0x8007 +#define GLX_TRANSPARENT_RGB_EXT 0x8008 +#define GLX_TRANSPARENT_INDEX_EXT 0x8009 + +#define GLXEW_EXT_visual_info GLXEW_GET_VAR(__GLXEW_EXT_visual_info) + +#endif /* GLX_EXT_visual_info */ + +/* ------------------------- GLX_EXT_visual_rating ------------------------- */ + +#ifndef GLX_EXT_visual_rating +#define GLX_EXT_visual_rating 1 + +#define GLX_VISUAL_CAVEAT_EXT 0x20 +#define GLX_SLOW_VISUAL_EXT 0x8001 +#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D + +#define GLXEW_EXT_visual_rating GLXEW_GET_VAR(__GLXEW_EXT_visual_rating) + +#endif /* GLX_EXT_visual_rating */ + +/* -------------------------- GLX_MESA_agp_offset -------------------------- */ + +#ifndef GLX_MESA_agp_offset +#define GLX_MESA_agp_offset 1 + +typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void* pointer); + +#define glXGetAGPOffsetMESA GLXEW_GET_FUN(__glewXGetAGPOffsetMESA) + +#define GLXEW_MESA_agp_offset GLXEW_GET_VAR(__GLXEW_MESA_agp_offset) + +#endif /* GLX_MESA_agp_offset */ + +/* ------------------------ GLX_MESA_copy_sub_buffer ----------------------- */ + +#ifndef GLX_MESA_copy_sub_buffer +#define GLX_MESA_copy_sub_buffer 1 + +typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display* dpy, GLXDrawable drawable, int x, int y, int width, int height); + +#define glXCopySubBufferMESA GLXEW_GET_FUN(__glewXCopySubBufferMESA) + +#define GLXEW_MESA_copy_sub_buffer GLXEW_GET_VAR(__GLXEW_MESA_copy_sub_buffer) + +#endif /* GLX_MESA_copy_sub_buffer */ + +/* ------------------------ GLX_MESA_pixmap_colormap ----------------------- */ + +#ifndef GLX_MESA_pixmap_colormap +#define GLX_MESA_pixmap_colormap 1 + +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display* dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap); + +#define glXCreateGLXPixmapMESA GLXEW_GET_FUN(__glewXCreateGLXPixmapMESA) + +#define GLXEW_MESA_pixmap_colormap GLXEW_GET_VAR(__GLXEW_MESA_pixmap_colormap) + +#endif /* GLX_MESA_pixmap_colormap */ + +/* ------------------------ GLX_MESA_release_buffers ----------------------- */ + +#ifndef GLX_MESA_release_buffers +#define GLX_MESA_release_buffers 1 + +typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display* dpy, GLXDrawable d); + +#define glXReleaseBuffersMESA GLXEW_GET_FUN(__glewXReleaseBuffersMESA) + +#define GLXEW_MESA_release_buffers GLXEW_GET_VAR(__GLXEW_MESA_release_buffers) + +#endif /* GLX_MESA_release_buffers */ + +/* ------------------------- GLX_MESA_set_3dfx_mode ------------------------ */ + +#ifndef GLX_MESA_set_3dfx_mode +#define GLX_MESA_set_3dfx_mode 1 + +#define GLX_3DFX_WINDOW_MODE_MESA 0x1 +#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 + +typedef GLboolean ( * PFNGLXSET3DFXMODEMESAPROC) (GLint mode); + +#define glXSet3DfxModeMESA GLXEW_GET_FUN(__glewXSet3DfxModeMESA) + +#define GLXEW_MESA_set_3dfx_mode GLXEW_GET_VAR(__GLXEW_MESA_set_3dfx_mode) + +#endif /* GLX_MESA_set_3dfx_mode */ + +/* -------------------------- GLX_NV_float_buffer -------------------------- */ + +#ifndef GLX_NV_float_buffer +#define GLX_NV_float_buffer 1 + +#define GLX_FLOAT_COMPONENTS_NV 0x20B0 + +#define GLXEW_NV_float_buffer GLXEW_GET_VAR(__GLXEW_NV_float_buffer) + +#endif /* GLX_NV_float_buffer */ + +/* ----------------------- GLX_NV_vertex_array_range ----------------------- */ + +#ifndef GLX_NV_vertex_array_range +#define GLX_NV_vertex_array_range 1 + +typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); +typedef void ( * PFNGLXFREEMEMORYNVPROC) (void *pointer); + +#define glXAllocateMemoryNV GLXEW_GET_FUN(__glewXAllocateMemoryNV) +#define glXFreeMemoryNV GLXEW_GET_FUN(__glewXFreeMemoryNV) + +#define GLXEW_NV_vertex_array_range GLXEW_GET_VAR(__GLXEW_NV_vertex_array_range) + +#endif /* GLX_NV_vertex_array_range */ + +/* -------------------------- GLX_OML_swap_method -------------------------- */ + +#ifndef GLX_OML_swap_method +#define GLX_OML_swap_method 1 + +#define GLX_SWAP_METHOD_OML 0x8060 +#define GLX_SWAP_EXCHANGE_OML 0x8061 +#define GLX_SWAP_COPY_OML 0x8062 +#define GLX_SWAP_UNDEFINED_OML 0x8063 + +#define GLXEW_OML_swap_method GLXEW_GET_VAR(__GLXEW_OML_swap_method) + +#endif /* GLX_OML_swap_method */ + +/* -------------------------- GLX_OML_sync_control ------------------------- */ + +#if !defined(GLX_OML_sync_control) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +#include +#define GLX_OML_sync_control 1 + +typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display* dpy, GLXDrawable drawable, int32_t* numerator, int32_t* denominator); +typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t* ust, int64_t* msc, int64_t* sbc); +typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder); +typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t* ust, int64_t* msc, int64_t* sbc); +typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_sbc, int64_t* ust, int64_t* msc, int64_t* sbc); + +#define glXGetMscRateOML GLXEW_GET_FUN(__glewXGetMscRateOML) +#define glXGetSyncValuesOML GLXEW_GET_FUN(__glewXGetSyncValuesOML) +#define glXSwapBuffersMscOML GLXEW_GET_FUN(__glewXSwapBuffersMscOML) +#define glXWaitForMscOML GLXEW_GET_FUN(__glewXWaitForMscOML) +#define glXWaitForSbcOML GLXEW_GET_FUN(__glewXWaitForSbcOML) + +#define GLXEW_OML_sync_control GLXEW_GET_VAR(__GLXEW_OML_sync_control) + +#endif /* GLX_OML_sync_control */ + +/* ------------------------ GLX_SGIS_blended_overlay ----------------------- */ + +#ifndef GLX_SGIS_blended_overlay +#define GLX_SGIS_blended_overlay 1 + +#define GLX_BLENDED_RGBA_SGIS 0x8025 + +#define GLXEW_SGIS_blended_overlay GLXEW_GET_VAR(__GLXEW_SGIS_blended_overlay) + +#endif /* GLX_SGIS_blended_overlay */ + +/* -------------------------- GLX_SGIS_color_range ------------------------- */ + +#ifndef GLX_SGIS_color_range +#define GLX_SGIS_color_range 1 + +#define GLX_MIN_RED_SGIS 0 +#define GLX_MAX_GREEN_SGIS 0 +#define GLX_MIN_BLUE_SGIS 0 +#define GLX_MAX_ALPHA_SGIS 0 +#define GLX_MIN_GREEN_SGIS 0 +#define GLX_MIN_ALPHA_SGIS 0 +#define GLX_MAX_RED_SGIS 0 +#define GLX_EXTENDED_RANGE_SGIS 0 +#define GLX_MAX_BLUE_SGIS 0 + +#define GLXEW_SGIS_color_range GLXEW_GET_VAR(__GLXEW_SGIS_color_range) + +#endif /* GLX_SGIS_color_range */ + +/* -------------------------- GLX_SGIS_multisample ------------------------- */ + +#ifndef GLX_SGIS_multisample +#define GLX_SGIS_multisample 1 + +#define GLX_SAMPLE_BUFFERS_SGIS 100000 +#define GLX_SAMPLES_SGIS 100001 + +#define GLXEW_SGIS_multisample GLXEW_GET_VAR(__GLXEW_SGIS_multisample) + +#endif /* GLX_SGIS_multisample */ + +/* ---------------------- GLX_SGIS_shared_multisample ---------------------- */ + +#ifndef GLX_SGIS_shared_multisample +#define GLX_SGIS_shared_multisample 1 + +#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026 +#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027 + +#define GLXEW_SGIS_shared_multisample GLXEW_GET_VAR(__GLXEW_SGIS_shared_multisample) + +#endif /* GLX_SGIS_shared_multisample */ + +/* --------------------------- GLX_SGIX_fbconfig --------------------------- */ + +#ifndef GLX_SGIX_fbconfig +#define GLX_SGIX_fbconfig 1 + +#define GLX_WINDOW_BIT_SGIX 0x00000001 +#define GLX_RGBA_BIT_SGIX 0x00000001 +#define GLX_PIXMAP_BIT_SGIX 0x00000002 +#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002 +#define GLX_SCREEN_EXT 0x800C +#define GLX_DRAWABLE_TYPE_SGIX 0x8010 +#define GLX_RENDER_TYPE_SGIX 0x8011 +#define GLX_X_RENDERABLE_SGIX 0x8012 +#define GLX_FBCONFIG_ID_SGIX 0x8013 +#define GLX_RGBA_TYPE_SGIX 0x8014 +#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015 + +typedef XID GLXFBConfigIDSGIX; +typedef struct __GLXFBConfigRec *GLXFBConfigSGIX; + +typedef GLXFBConfigSGIX* ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); +typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, Pixmap pixmap); +typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display* dpy, GLXFBConfigSGIX config, int attribute, int *value); +typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display* dpy, XVisualInfo *vis); +typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfig config); + +#define glXChooseFBConfigSGIX GLXEW_GET_FUN(__glewXChooseFBConfigSGIX) +#define glXCreateContextWithConfigSGIX GLXEW_GET_FUN(__glewXCreateContextWithConfigSGIX) +#define glXCreateGLXPixmapWithConfigSGIX GLXEW_GET_FUN(__glewXCreateGLXPixmapWithConfigSGIX) +#define glXGetFBConfigAttribSGIX GLXEW_GET_FUN(__glewXGetFBConfigAttribSGIX) +#define glXGetFBConfigFromVisualSGIX GLXEW_GET_FUN(__glewXGetFBConfigFromVisualSGIX) +#define glXGetVisualFromFBConfigSGIX GLXEW_GET_FUN(__glewXGetVisualFromFBConfigSGIX) + +#define GLXEW_SGIX_fbconfig GLXEW_GET_VAR(__GLXEW_SGIX_fbconfig) + +#endif /* GLX_SGIX_fbconfig */ + +/* ---------------------------- GLX_SGIX_pbuffer --------------------------- */ + +#ifndef GLX_SGIX_pbuffer +#define GLX_SGIX_pbuffer 1 + +#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001 +#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002 +#define GLX_PBUFFER_BIT_SGIX 0x00000004 +#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008 +#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010 +#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020 +#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040 +#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080 +#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100 +#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017 +#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018 +#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019 +#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A +#define GLX_PRESERVED_CONTENTS_SGIX 0x801B +#define GLX_LARGEST_PBUFFER_SGIX 0x801C +#define GLX_WIDTH_SGIX 0x801D +#define GLX_HEIGHT_SGIX 0x801E +#define GLX_EVENT_MASK_SGIX 0x801F +#define GLX_DAMAGED_SGIX 0x8020 +#define GLX_SAVED_SGIX 0x8021 +#define GLX_WINDOW_SGIX 0x8022 +#define GLX_PBUFFER_SGIX 0x8023 +#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000 + +typedef XID GLXPbufferSGIX; +typedef struct { int type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; int event_type; int draw_type; unsigned int mask; int x, y; int width, height; int count; } GLXBufferClobberEventSGIX; + +typedef GLXPbuffer ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display* dpy, GLXFBConfig config, unsigned int width, unsigned int height, int *attrib_list); +typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf); +typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long *mask); +typedef void ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf, int attribute, unsigned int *value); +typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long mask); + +#define glXCreateGLXPbufferSGIX GLXEW_GET_FUN(__glewXCreateGLXPbufferSGIX) +#define glXDestroyGLXPbufferSGIX GLXEW_GET_FUN(__glewXDestroyGLXPbufferSGIX) +#define glXGetSelectedEventSGIX GLXEW_GET_FUN(__glewXGetSelectedEventSGIX) +#define glXQueryGLXPbufferSGIX GLXEW_GET_FUN(__glewXQueryGLXPbufferSGIX) +#define glXSelectEventSGIX GLXEW_GET_FUN(__glewXSelectEventSGIX) + +#define GLXEW_SGIX_pbuffer GLXEW_GET_VAR(__GLXEW_SGIX_pbuffer) + +#endif /* GLX_SGIX_pbuffer */ + +/* ------------------------- GLX_SGIX_swap_barrier ------------------------- */ + +#ifndef GLX_SGIX_swap_barrier +#define GLX_SGIX_swap_barrier 1 + +typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier); +typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max); + +#define glXBindSwapBarrierSGIX GLXEW_GET_FUN(__glewXBindSwapBarrierSGIX) +#define glXQueryMaxSwapBarriersSGIX GLXEW_GET_FUN(__glewXQueryMaxSwapBarriersSGIX) + +#define GLXEW_SGIX_swap_barrier GLXEW_GET_VAR(__GLXEW_SGIX_swap_barrier) + +#endif /* GLX_SGIX_swap_barrier */ + +/* -------------------------- GLX_SGIX_swap_group -------------------------- */ + +#ifndef GLX_SGIX_swap_group +#define GLX_SGIX_swap_group 1 + +typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member); + +#define glXJoinSwapGroupSGIX GLXEW_GET_FUN(__glewXJoinSwapGroupSGIX) + +#define GLXEW_SGIX_swap_group GLXEW_GET_VAR(__GLXEW_SGIX_swap_group) + +#endif /* GLX_SGIX_swap_group */ + +/* ------------------------- GLX_SGIX_video_resize ------------------------- */ + +#ifndef GLX_SGIX_video_resize +#define GLX_SGIX_video_resize 1 + +#define GLX_SYNC_FRAME_SGIX 0x00000000 +#define GLX_SYNC_SWAP_SGIX 0x00000001 + +typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display* display, int screen, int channel, Window window); +typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int x, int y, int w, int h); +typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display* display, int screen, int channel, GLenum synctype); +typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display* display, int screen, int channel, int *x, int *y, int *w, int *h); +typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int *dx, int *dy, int *dw, int *dh); + +#define glXBindChannelToWindowSGIX GLXEW_GET_FUN(__glewXBindChannelToWindowSGIX) +#define glXChannelRectSGIX GLXEW_GET_FUN(__glewXChannelRectSGIX) +#define glXChannelRectSyncSGIX GLXEW_GET_FUN(__glewXChannelRectSyncSGIX) +#define glXQueryChannelDeltasSGIX GLXEW_GET_FUN(__glewXQueryChannelDeltasSGIX) +#define glXQueryChannelRectSGIX GLXEW_GET_FUN(__glewXQueryChannelRectSGIX) + +#define GLXEW_SGIX_video_resize GLXEW_GET_VAR(__GLXEW_SGIX_video_resize) + +#endif /* GLX_SGIX_video_resize */ + +/* ---------------------- GLX_SGIX_visual_select_group --------------------- */ + +#ifndef GLX_SGIX_visual_select_group +#define GLX_SGIX_visual_select_group 1 + +#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028 + +#define GLXEW_SGIX_visual_select_group GLXEW_GET_VAR(__GLXEW_SGIX_visual_select_group) + +#endif /* GLX_SGIX_visual_select_group */ + +/* ---------------------------- GLX_SGI_cushion ---------------------------- */ + +#ifndef GLX_SGI_cushion +#define GLX_SGI_cushion 1 + +typedef void ( * PFNGLXCUSHIONSGIPROC) (Display* dpy, Window window, float cushion); + +#define glXCushionSGI GLXEW_GET_FUN(__glewXCushionSGI) + +#define GLXEW_SGI_cushion GLXEW_GET_VAR(__GLXEW_SGI_cushion) + +#endif /* GLX_SGI_cushion */ + +/* ----------------------- GLX_SGI_make_current_read ----------------------- */ + +#ifndef GLX_SGI_make_current_read +#define GLX_SGI_make_current_read 1 + +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void); +typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); + +#define glXGetCurrentReadDrawableSGI GLXEW_GET_FUN(__glewXGetCurrentReadDrawableSGI) +#define glXMakeCurrentReadSGI GLXEW_GET_FUN(__glewXMakeCurrentReadSGI) + +#define GLXEW_SGI_make_current_read GLXEW_GET_VAR(__GLXEW_SGI_make_current_read) + +#endif /* GLX_SGI_make_current_read */ + +/* -------------------------- GLX_SGI_swap_control ------------------------- */ + +#ifndef GLX_SGI_swap_control +#define GLX_SGI_swap_control 1 + +typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval); + +#define glXSwapIntervalSGI GLXEW_GET_FUN(__glewXSwapIntervalSGI) + +#define GLXEW_SGI_swap_control GLXEW_GET_VAR(__GLXEW_SGI_swap_control) + +#endif /* GLX_SGI_swap_control */ + +/* --------------------------- GLX_SGI_video_sync -------------------------- */ + +#ifndef GLX_SGI_video_sync +#define GLX_SGI_video_sync 1 + +typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (uint* count); +typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int* count); + +#define glXGetVideoSyncSGI GLXEW_GET_FUN(__glewXGetVideoSyncSGI) +#define glXWaitVideoSyncSGI GLXEW_GET_FUN(__glewXWaitVideoSyncSGI) + +#define GLXEW_SGI_video_sync GLXEW_GET_VAR(__GLXEW_SGI_video_sync) + +#endif /* GLX_SGI_video_sync */ + +/* --------------------- GLX_SUN_get_transparent_index --------------------- */ + +#ifndef GLX_SUN_get_transparent_index +#define GLX_SUN_get_transparent_index 1 + +typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display* dpy, Window overlay, Window underlay, unsigned long *pTransparentIndex); + +#define glXGetTransparentIndexSUN GLXEW_GET_FUN(__glewXGetTransparentIndexSUN) + +#define GLXEW_SUN_get_transparent_index GLXEW_GET_VAR(__GLXEW_SUN_get_transparent_index) + +#endif /* GLX_SUN_get_transparent_index */ + +/* -------------------------- GLX_SUN_video_resize ------------------------- */ + +#ifndef GLX_SUN_video_resize +#define GLX_SUN_video_resize 1 + +#define GLX_VIDEO_RESIZE_SUN 0x8171 +#define GL_VIDEO_RESIZE_COMPENSATION_SUN 0x85CD + +typedef int ( * PFNGLXGETVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float* factor); +typedef int ( * PFNGLXVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float factor); + +#define glXGetVideoResizeSUN GLXEW_GET_FUN(__glewXGetVideoResizeSUN) +#define glXVideoResizeSUN GLXEW_GET_FUN(__glewXVideoResizeSUN) + +#define GLXEW_SUN_video_resize GLXEW_GET_VAR(__GLXEW_SUN_video_resize) + +#endif /* GLX_SUN_video_resize */ + +/* ------------------------------------------------------------------------- */ + +#ifdef GLEW_MX +#define GLXEW_EXPORT +#else +#define GLXEW_EXPORT extern +#endif /* GLEW_MX */ + +extern PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay; + +extern PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig; +extern PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext; +extern PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer; +extern PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap; +extern PFNGLXCREATEWINDOWPROC __glewXCreateWindow; +extern PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer; +extern PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap; +extern PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow; +extern PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable; +extern PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib; +extern PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs; +extern PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent; +extern PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig; +extern PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent; +extern PFNGLXQUERYCONTEXTPROC __glewXQueryContext; +extern PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable; +extern PFNGLXSELECTEVENTPROC __glewXSelectEvent; + +extern PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI; +extern PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI; +extern PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI; + +extern PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT; +extern PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT; +extern PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT; +extern PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT; + +extern PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA; + +extern PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA; + +extern PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA; + +extern PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA; + +extern PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA; + +extern PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV; +extern PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV; + +#ifdef GLX_OML_sync_control +extern PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML; +extern PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML; +extern PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML; +extern PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML; +extern PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML; +#endif + +extern PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX; +extern PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX; +extern PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX; +extern PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX; +extern PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX; +extern PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX; + +extern PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX; +extern PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX; +extern PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX; +extern PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX; +extern PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX; + +extern PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX; +extern PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX; + +extern PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX; + +extern PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX; +extern PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX; +extern PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX; +extern PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX; +extern PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX; + +extern PFNGLXCUSHIONSGIPROC __glewXCushionSGI; + +extern PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI; +extern PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI; + +extern PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI; + +extern PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI; +extern PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI; + +extern PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN; + +extern PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN; +extern PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN; + +#if defined(GLEW_MX) +struct GLXEWContextStruct +{ +#endif /* GLEW_MX */ + +GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_0; +GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_1; +GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_2; +GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_3; +GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_4; +GLXEW_EXPORT GLboolean __GLXEW_3DFX_multisample; +GLXEW_EXPORT GLboolean __GLXEW_ARB_fbconfig_float; +GLXEW_EXPORT GLboolean __GLXEW_ARB_get_proc_address; +GLXEW_EXPORT GLboolean __GLXEW_ARB_multisample; +GLXEW_EXPORT GLboolean __GLXEW_ATI_pixel_format_float; +GLXEW_EXPORT GLboolean __GLXEW_ATI_render_texture; +GLXEW_EXPORT GLboolean __GLXEW_EXT_import_context; +GLXEW_EXPORT GLboolean __GLXEW_EXT_scene_marker; +GLXEW_EXPORT GLboolean __GLXEW_EXT_visual_info; +GLXEW_EXPORT GLboolean __GLXEW_EXT_visual_rating; +GLXEW_EXPORT GLboolean __GLXEW_MESA_agp_offset; +GLXEW_EXPORT GLboolean __GLXEW_MESA_copy_sub_buffer; +GLXEW_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap; +GLXEW_EXPORT GLboolean __GLXEW_MESA_release_buffers; +GLXEW_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode; +GLXEW_EXPORT GLboolean __GLXEW_NV_float_buffer; +GLXEW_EXPORT GLboolean __GLXEW_NV_vertex_array_range; +GLXEW_EXPORT GLboolean __GLXEW_OML_swap_method; +GLXEW_EXPORT GLboolean __GLXEW_OML_sync_control; +GLXEW_EXPORT GLboolean __GLXEW_SGIS_blended_overlay; +GLXEW_EXPORT GLboolean __GLXEW_SGIS_color_range; +GLXEW_EXPORT GLboolean __GLXEW_SGIS_multisample; +GLXEW_EXPORT GLboolean __GLXEW_SGIS_shared_multisample; +GLXEW_EXPORT GLboolean __GLXEW_SGIX_fbconfig; +GLXEW_EXPORT GLboolean __GLXEW_SGIX_pbuffer; +GLXEW_EXPORT GLboolean __GLXEW_SGIX_swap_barrier; +GLXEW_EXPORT GLboolean __GLXEW_SGIX_swap_group; +GLXEW_EXPORT GLboolean __GLXEW_SGIX_video_resize; +GLXEW_EXPORT GLboolean __GLXEW_SGIX_visual_select_group; +GLXEW_EXPORT GLboolean __GLXEW_SGI_cushion; +GLXEW_EXPORT GLboolean __GLXEW_SGI_make_current_read; +GLXEW_EXPORT GLboolean __GLXEW_SGI_swap_control; +GLXEW_EXPORT GLboolean __GLXEW_SGI_video_sync; +GLXEW_EXPORT GLboolean __GLXEW_SUN_get_transparent_index; +GLXEW_EXPORT GLboolean __GLXEW_SUN_video_resize; + +#ifdef GLEW_MX +}; /* GLXEWContextStruct */ +#endif /* GLEW_MX */ + +/* ------------------------------------------------------------------------ */ + +#ifdef GLEW_MX + +typedef struct GLXEWContextStruct GLXEWContext; +extern GLenum glxewContextInit (GLXEWContext* ctx); +extern GLboolean glxewContextIsSupported (GLXEWContext* ctx, const char* name); + +#define glxewInit() glxewContextInit(glxewGetContext()) +#define glxewIsSupported(x) glxewContextIsSupported(glxewGetContext(), x) + +#define GLXEW_GET_VAR(x) glxewGetContext()->x +#define GLXEW_GET_FUN(x) x + +#else /* GLEW_MX */ + +#define GLXEW_GET_VAR(x) x +#define GLXEW_GET_FUN(x) x + +extern GLboolean glxewIsSupported (const char* name); + +#endif /* GLEW_MX */ + +extern GLboolean glxewGetExtension (const char* name); + +#ifdef __cplusplus +} +#endif + +#endif /* __glxew_h__ */ diff --git a/extern/glew/include/GL/wglew.h b/extern/glew/include/GL/wglew.h new file mode 100644 index 00000000000..febb1d07399 --- /dev/null +++ b/extern/glew/include/GL/wglew.h @@ -0,0 +1,934 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2006, Milan Ikits +** Copyright (C) 2002-2006, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef __wglew_h__ +#define __wglew_h__ +#define __WGLEW_H__ + +#ifdef __wglext_h_ +#error wglext.h included before wglew.h +#endif + +#define __wglext_h_ + +#if !defined(APIENTRY) && !defined(__CYGWIN__) +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN 1 +# endif +#include +#endif + +/* + * GLEW_STATIC needs to be set when using the static version. + * GLEW_BUILD is set when building the DLL version. + */ +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# ifdef GLEW_BUILD +# define GLEWAPI extern __declspec(dllexport) +# else +# define GLEWAPI extern __declspec(dllimport) +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* -------------------------- WGL_3DFX_multisample ------------------------- */ + +#ifndef WGL_3DFX_multisample +#define WGL_3DFX_multisample 1 + +#define WGL_SAMPLE_BUFFERS_3DFX 0x2060 +#define WGL_SAMPLES_3DFX 0x2061 + +#define WGLEW_3DFX_multisample WGLEW_GET_VAR(__WGLEW_3DFX_multisample) + +#endif /* WGL_3DFX_multisample */ + +/* ------------------------- WGL_3DL_stereo_control ------------------------ */ + +#ifndef WGL_3DL_stereo_control +#define WGL_3DL_stereo_control 1 + +#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055 +#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056 +#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057 +#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058 + +typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState); + +#define wglSetStereoEmitterState3DL WGLEW_GET_FUN(__wglewSetStereoEmitterState3DL) + +#define WGLEW_3DL_stereo_control WGLEW_GET_VAR(__WGLEW_3DL_stereo_control) + +#endif /* WGL_3DL_stereo_control */ + +/* ------------------------- WGL_ARB_buffer_region ------------------------- */ + +#ifndef WGL_ARB_buffer_region +#define WGL_ARB_buffer_region 1 + +#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001 +#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002 +#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004 +#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008 + +typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType); +typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion); +typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc); +typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height); + +#define wglCreateBufferRegionARB WGLEW_GET_FUN(__wglewCreateBufferRegionARB) +#define wglDeleteBufferRegionARB WGLEW_GET_FUN(__wglewDeleteBufferRegionARB) +#define wglRestoreBufferRegionARB WGLEW_GET_FUN(__wglewRestoreBufferRegionARB) +#define wglSaveBufferRegionARB WGLEW_GET_FUN(__wglewSaveBufferRegionARB) + +#define WGLEW_ARB_buffer_region WGLEW_GET_VAR(__WGLEW_ARB_buffer_region) + +#endif /* WGL_ARB_buffer_region */ + +/* ----------------------- WGL_ARB_extensions_string ----------------------- */ + +#ifndef WGL_ARB_extensions_string +#define WGL_ARB_extensions_string 1 + +typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc); + +#define wglGetExtensionsStringARB WGLEW_GET_FUN(__wglewGetExtensionsStringARB) + +#define WGLEW_ARB_extensions_string WGLEW_GET_VAR(__WGLEW_ARB_extensions_string) + +#endif /* WGL_ARB_extensions_string */ + +/* ----------------------- WGL_ARB_make_current_read ----------------------- */ + +#ifndef WGL_ARB_make_current_read +#define WGL_ARB_make_current_read 1 + +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); + +#define wglGetCurrentReadDCARB WGLEW_GET_FUN(__wglewGetCurrentReadDCARB) +#define wglMakeContextCurrentARB WGLEW_GET_FUN(__wglewMakeContextCurrentARB) + +#define WGLEW_ARB_make_current_read WGLEW_GET_VAR(__WGLEW_ARB_make_current_read) + +#endif /* WGL_ARB_make_current_read */ + +/* -------------------------- WGL_ARB_multisample -------------------------- */ + +#ifndef WGL_ARB_multisample +#define WGL_ARB_multisample 1 + +#define WGL_SAMPLE_BUFFERS_ARB 0x2041 +#define WGL_SAMPLES_ARB 0x2042 + +#define WGLEW_ARB_multisample WGLEW_GET_VAR(__WGLEW_ARB_multisample) + +#endif /* WGL_ARB_multisample */ + +/* ---------------------------- WGL_ARB_pbuffer ---------------------------- */ + +#ifndef WGL_ARB_pbuffer +#define WGL_ARB_pbuffer 1 + +#define WGL_DRAW_TO_PBUFFER_ARB 0x202D +#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E +#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030 +#define WGL_PBUFFER_LARGEST_ARB 0x2033 +#define WGL_PBUFFER_WIDTH_ARB 0x2034 +#define WGL_PBUFFER_HEIGHT_ARB 0x2035 +#define WGL_PBUFFER_LOST_ARB 0x2036 + +DECLARE_HANDLE(HPBUFFERARB); + +typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int* piValue); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC); + +#define wglCreatePbufferARB WGLEW_GET_FUN(__wglewCreatePbufferARB) +#define wglDestroyPbufferARB WGLEW_GET_FUN(__wglewDestroyPbufferARB) +#define wglGetPbufferDCARB WGLEW_GET_FUN(__wglewGetPbufferDCARB) +#define wglQueryPbufferARB WGLEW_GET_FUN(__wglewQueryPbufferARB) +#define wglReleasePbufferDCARB WGLEW_GET_FUN(__wglewReleasePbufferDCARB) + +#define WGLEW_ARB_pbuffer WGLEW_GET_VAR(__WGLEW_ARB_pbuffer) + +#endif /* WGL_ARB_pbuffer */ + +/* -------------------------- WGL_ARB_pixel_format ------------------------- */ + +#ifndef WGL_ARB_pixel_format +#define WGL_ARB_pixel_format 1 + +#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 +#define WGL_DRAW_TO_WINDOW_ARB 0x2001 +#define WGL_DRAW_TO_BITMAP_ARB 0x2002 +#define WGL_ACCELERATION_ARB 0x2003 +#define WGL_NEED_PALETTE_ARB 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 +#define WGL_SWAP_METHOD_ARB 0x2007 +#define WGL_NUMBER_OVERLAYS_ARB 0x2008 +#define WGL_NUMBER_UNDERLAYS_ARB 0x2009 +#define WGL_TRANSPARENT_ARB 0x200A +#define WGL_SHARE_DEPTH_ARB 0x200C +#define WGL_SHARE_STENCIL_ARB 0x200D +#define WGL_SHARE_ACCUM_ARB 0x200E +#define WGL_SUPPORT_GDI_ARB 0x200F +#define WGL_SUPPORT_OPENGL_ARB 0x2010 +#define WGL_DOUBLE_BUFFER_ARB 0x2011 +#define WGL_STEREO_ARB 0x2012 +#define WGL_PIXEL_TYPE_ARB 0x2013 +#define WGL_COLOR_BITS_ARB 0x2014 +#define WGL_RED_BITS_ARB 0x2015 +#define WGL_RED_SHIFT_ARB 0x2016 +#define WGL_GREEN_BITS_ARB 0x2017 +#define WGL_GREEN_SHIFT_ARB 0x2018 +#define WGL_BLUE_BITS_ARB 0x2019 +#define WGL_BLUE_SHIFT_ARB 0x201A +#define WGL_ALPHA_BITS_ARB 0x201B +#define WGL_ALPHA_SHIFT_ARB 0x201C +#define WGL_ACCUM_BITS_ARB 0x201D +#define WGL_ACCUM_RED_BITS_ARB 0x201E +#define WGL_ACCUM_GREEN_BITS_ARB 0x201F +#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 +#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 +#define WGL_DEPTH_BITS_ARB 0x2022 +#define WGL_STENCIL_BITS_ARB 0x2023 +#define WGL_AUX_BUFFERS_ARB 0x2024 +#define WGL_NO_ACCELERATION_ARB 0x2025 +#define WGL_GENERIC_ACCELERATION_ARB 0x2026 +#define WGL_FULL_ACCELERATION_ARB 0x2027 +#define WGL_SWAP_EXCHANGE_ARB 0x2028 +#define WGL_SWAP_COPY_ARB 0x2029 +#define WGL_SWAP_UNDEFINED_ARB 0x202A +#define WGL_TYPE_RGBA_ARB 0x202B +#define WGL_TYPE_COLORINDEX_ARB 0x202C +#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 +#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 +#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 +#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A +#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B + +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int *piValues); + +#define wglChoosePixelFormatARB WGLEW_GET_FUN(__wglewChoosePixelFormatARB) +#define wglGetPixelFormatAttribfvARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvARB) +#define wglGetPixelFormatAttribivARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribivARB) + +#define WGLEW_ARB_pixel_format WGLEW_GET_VAR(__WGLEW_ARB_pixel_format) + +#endif /* WGL_ARB_pixel_format */ + +/* ----------------------- WGL_ARB_pixel_format_float ---------------------- */ + +#ifndef WGL_ARB_pixel_format_float +#define WGL_ARB_pixel_format_float 1 + +#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0 + +#define WGLEW_ARB_pixel_format_float WGLEW_GET_VAR(__WGLEW_ARB_pixel_format_float) + +#endif /* WGL_ARB_pixel_format_float */ + +/* ------------------------- WGL_ARB_render_texture ------------------------ */ + +#ifndef WGL_ARB_render_texture +#define WGL_ARB_render_texture 1 + +#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070 +#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071 +#define WGL_TEXTURE_FORMAT_ARB 0x2072 +#define WGL_TEXTURE_TARGET_ARB 0x2073 +#define WGL_MIPMAP_TEXTURE_ARB 0x2074 +#define WGL_TEXTURE_RGB_ARB 0x2075 +#define WGL_TEXTURE_RGBA_ARB 0x2076 +#define WGL_NO_TEXTURE_ARB 0x2077 +#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078 +#define WGL_TEXTURE_1D_ARB 0x2079 +#define WGL_TEXTURE_2D_ARB 0x207A +#define WGL_MIPMAP_LEVEL_ARB 0x207B +#define WGL_CUBE_MAP_FACE_ARB 0x207C +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080 +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081 +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082 +#define WGL_FRONT_LEFT_ARB 0x2083 +#define WGL_FRONT_RIGHT_ARB 0x2084 +#define WGL_BACK_LEFT_ARB 0x2085 +#define WGL_BACK_RIGHT_ARB 0x2086 +#define WGL_AUX0_ARB 0x2087 +#define WGL_AUX1_ARB 0x2088 +#define WGL_AUX2_ARB 0x2089 +#define WGL_AUX3_ARB 0x208A +#define WGL_AUX4_ARB 0x208B +#define WGL_AUX5_ARB 0x208C +#define WGL_AUX6_ARB 0x208D +#define WGL_AUX7_ARB 0x208E +#define WGL_AUX8_ARB 0x208F +#define WGL_AUX9_ARB 0x2090 + +typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int* piAttribList); + +#define wglBindTexImageARB WGLEW_GET_FUN(__wglewBindTexImageARB) +#define wglReleaseTexImageARB WGLEW_GET_FUN(__wglewReleaseTexImageARB) +#define wglSetPbufferAttribARB WGLEW_GET_FUN(__wglewSetPbufferAttribARB) + +#define WGLEW_ARB_render_texture WGLEW_GET_VAR(__WGLEW_ARB_render_texture) + +#endif /* WGL_ARB_render_texture */ + +/* ----------------------- WGL_ATI_pixel_format_float ---------------------- */ + +#ifndef WGL_ATI_pixel_format_float +#define WGL_ATI_pixel_format_float 1 + +#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 +#define GL_RGBA_FLOAT_MODE_ATI 0x8820 +#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 + +#define WGLEW_ATI_pixel_format_float WGLEW_GET_VAR(__WGLEW_ATI_pixel_format_float) + +#endif /* WGL_ATI_pixel_format_float */ + +/* -------------------- WGL_ATI_render_texture_rectangle ------------------- */ + +#ifndef WGL_ATI_render_texture_rectangle +#define WGL_ATI_render_texture_rectangle 1 + +#define WGL_TEXTURE_RECTANGLE_ATI 0x21A5 + +#define WGLEW_ATI_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_ATI_render_texture_rectangle) + +#endif /* WGL_ATI_render_texture_rectangle */ + +/* -------------------------- WGL_EXT_depth_float -------------------------- */ + +#ifndef WGL_EXT_depth_float +#define WGL_EXT_depth_float 1 + +#define WGL_DEPTH_FLOAT_EXT 0x2040 + +#define WGLEW_EXT_depth_float WGLEW_GET_VAR(__WGLEW_EXT_depth_float) + +#endif /* WGL_EXT_depth_float */ + +/* ---------------------- WGL_EXT_display_color_table ---------------------- */ + +#ifndef WGL_EXT_display_color_table +#define WGL_EXT_display_color_table 1 + +typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef void (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (GLushort* table, GLuint length); + +#define wglBindDisplayColorTableEXT WGLEW_GET_FUN(__wglewBindDisplayColorTableEXT) +#define wglCreateDisplayColorTableEXT WGLEW_GET_FUN(__wglewCreateDisplayColorTableEXT) +#define wglDestroyDisplayColorTableEXT WGLEW_GET_FUN(__wglewDestroyDisplayColorTableEXT) +#define wglLoadDisplayColorTableEXT WGLEW_GET_FUN(__wglewLoadDisplayColorTableEXT) + +#define WGLEW_EXT_display_color_table WGLEW_GET_VAR(__WGLEW_EXT_display_color_table) + +#endif /* WGL_EXT_display_color_table */ + +/* ----------------------- WGL_EXT_extensions_string ----------------------- */ + +#ifndef WGL_EXT_extensions_string +#define WGL_EXT_extensions_string 1 + +typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void); + +#define wglGetExtensionsStringEXT WGLEW_GET_FUN(__wglewGetExtensionsStringEXT) + +#define WGLEW_EXT_extensions_string WGLEW_GET_VAR(__WGLEW_EXT_extensions_string) + +#endif /* WGL_EXT_extensions_string */ + +/* ----------------------- WGL_EXT_make_current_read ----------------------- */ + +#ifndef WGL_EXT_make_current_read +#define WGL_EXT_make_current_read 1 + +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); + +#define wglGetCurrentReadDCEXT WGLEW_GET_FUN(__wglewGetCurrentReadDCEXT) +#define wglMakeContextCurrentEXT WGLEW_GET_FUN(__wglewMakeContextCurrentEXT) + +#define WGLEW_EXT_make_current_read WGLEW_GET_VAR(__WGLEW_EXT_make_current_read) + +#endif /* WGL_EXT_make_current_read */ + +/* -------------------------- WGL_EXT_multisample -------------------------- */ + +#ifndef WGL_EXT_multisample +#define WGL_EXT_multisample 1 + +#define WGL_SAMPLE_BUFFERS_EXT 0x2041 +#define WGL_SAMPLES_EXT 0x2042 + +#define WGLEW_EXT_multisample WGLEW_GET_VAR(__WGLEW_EXT_multisample) + +#endif /* WGL_EXT_multisample */ + +/* ---------------------------- WGL_EXT_pbuffer ---------------------------- */ + +#ifndef WGL_EXT_pbuffer +#define WGL_EXT_pbuffer 1 + +#define WGL_DRAW_TO_PBUFFER_EXT 0x202D +#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E +#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030 +#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031 +#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032 +#define WGL_PBUFFER_LARGEST_EXT 0x2033 +#define WGL_PBUFFER_WIDTH_EXT 0x2034 +#define WGL_PBUFFER_HEIGHT_EXT 0x2035 + +DECLARE_HANDLE(HPBUFFEREXT); + +typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int* piValue); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC); + +#define wglCreatePbufferEXT WGLEW_GET_FUN(__wglewCreatePbufferEXT) +#define wglDestroyPbufferEXT WGLEW_GET_FUN(__wglewDestroyPbufferEXT) +#define wglGetPbufferDCEXT WGLEW_GET_FUN(__wglewGetPbufferDCEXT) +#define wglQueryPbufferEXT WGLEW_GET_FUN(__wglewQueryPbufferEXT) +#define wglReleasePbufferDCEXT WGLEW_GET_FUN(__wglewReleasePbufferDCEXT) + +#define WGLEW_EXT_pbuffer WGLEW_GET_VAR(__WGLEW_EXT_pbuffer) + +#endif /* WGL_EXT_pbuffer */ + +/* -------------------------- WGL_EXT_pixel_format ------------------------- */ + +#ifndef WGL_EXT_pixel_format +#define WGL_EXT_pixel_format 1 + +#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000 +#define WGL_DRAW_TO_WINDOW_EXT 0x2001 +#define WGL_DRAW_TO_BITMAP_EXT 0x2002 +#define WGL_ACCELERATION_EXT 0x2003 +#define WGL_NEED_PALETTE_EXT 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006 +#define WGL_SWAP_METHOD_EXT 0x2007 +#define WGL_NUMBER_OVERLAYS_EXT 0x2008 +#define WGL_NUMBER_UNDERLAYS_EXT 0x2009 +#define WGL_TRANSPARENT_EXT 0x200A +#define WGL_TRANSPARENT_VALUE_EXT 0x200B +#define WGL_SHARE_DEPTH_EXT 0x200C +#define WGL_SHARE_STENCIL_EXT 0x200D +#define WGL_SHARE_ACCUM_EXT 0x200E +#define WGL_SUPPORT_GDI_EXT 0x200F +#define WGL_SUPPORT_OPENGL_EXT 0x2010 +#define WGL_DOUBLE_BUFFER_EXT 0x2011 +#define WGL_STEREO_EXT 0x2012 +#define WGL_PIXEL_TYPE_EXT 0x2013 +#define WGL_COLOR_BITS_EXT 0x2014 +#define WGL_RED_BITS_EXT 0x2015 +#define WGL_RED_SHIFT_EXT 0x2016 +#define WGL_GREEN_BITS_EXT 0x2017 +#define WGL_GREEN_SHIFT_EXT 0x2018 +#define WGL_BLUE_BITS_EXT 0x2019 +#define WGL_BLUE_SHIFT_EXT 0x201A +#define WGL_ALPHA_BITS_EXT 0x201B +#define WGL_ALPHA_SHIFT_EXT 0x201C +#define WGL_ACCUM_BITS_EXT 0x201D +#define WGL_ACCUM_RED_BITS_EXT 0x201E +#define WGL_ACCUM_GREEN_BITS_EXT 0x201F +#define WGL_ACCUM_BLUE_BITS_EXT 0x2020 +#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021 +#define WGL_DEPTH_BITS_EXT 0x2022 +#define WGL_STENCIL_BITS_EXT 0x2023 +#define WGL_AUX_BUFFERS_EXT 0x2024 +#define WGL_NO_ACCELERATION_EXT 0x2025 +#define WGL_GENERIC_ACCELERATION_EXT 0x2026 +#define WGL_FULL_ACCELERATION_EXT 0x2027 +#define WGL_SWAP_EXCHANGE_EXT 0x2028 +#define WGL_SWAP_COPY_EXT 0x2029 +#define WGL_SWAP_UNDEFINED_EXT 0x202A +#define WGL_TYPE_RGBA_EXT 0x202B +#define WGL_TYPE_COLORINDEX_EXT 0x202C + +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, int *piValues); + +#define wglChoosePixelFormatEXT WGLEW_GET_FUN(__wglewChoosePixelFormatEXT) +#define wglGetPixelFormatAttribfvEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvEXT) +#define wglGetPixelFormatAttribivEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribivEXT) + +#define WGLEW_EXT_pixel_format WGLEW_GET_VAR(__WGLEW_EXT_pixel_format) + +#endif /* WGL_EXT_pixel_format */ + +/* -------------------------- WGL_EXT_swap_control ------------------------- */ + +#ifndef WGL_EXT_swap_control +#define WGL_EXT_swap_control 1 + +typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void); +typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval); + +#define wglGetSwapIntervalEXT WGLEW_GET_FUN(__wglewGetSwapIntervalEXT) +#define wglSwapIntervalEXT WGLEW_GET_FUN(__wglewSwapIntervalEXT) + +#define WGLEW_EXT_swap_control WGLEW_GET_VAR(__WGLEW_EXT_swap_control) + +#endif /* WGL_EXT_swap_control */ + +/* --------------------- WGL_I3D_digital_video_control --------------------- */ + +#ifndef WGL_I3D_digital_video_control +#define WGL_I3D_digital_video_control 1 + +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050 +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051 +#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052 +#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053 + +typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); + +#define wglGetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewGetDigitalVideoParametersI3D) +#define wglSetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewSetDigitalVideoParametersI3D) + +#define WGLEW_I3D_digital_video_control WGLEW_GET_VAR(__WGLEW_I3D_digital_video_control) + +#endif /* WGL_I3D_digital_video_control */ + +/* ----------------------------- WGL_I3D_gamma ----------------------------- */ + +#ifndef WGL_I3D_gamma +#define WGL_I3D_gamma 1 + +#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E +#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F + +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT* puRed, USHORT *puGreen, USHORT *puBlue); +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT* puRed, const USHORT *puGreen, const USHORT *puBlue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); + +#define wglGetGammaTableI3D WGLEW_GET_FUN(__wglewGetGammaTableI3D) +#define wglGetGammaTableParametersI3D WGLEW_GET_FUN(__wglewGetGammaTableParametersI3D) +#define wglSetGammaTableI3D WGLEW_GET_FUN(__wglewSetGammaTableI3D) +#define wglSetGammaTableParametersI3D WGLEW_GET_FUN(__wglewSetGammaTableParametersI3D) + +#define WGLEW_I3D_gamma WGLEW_GET_VAR(__WGLEW_I3D_gamma) + +#endif /* WGL_I3D_gamma */ + +/* ---------------------------- WGL_I3D_genlock ---------------------------- */ + +#ifndef WGL_I3D_genlock +#define WGL_I3D_genlock 1 + +#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044 +#define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045 +#define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046 +#define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047 +#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048 +#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049 +#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A +#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B +#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C + +typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT* uRate); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT* uDelay); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT* uEdge); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT* uSource); +typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL* pFlag); +typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT* uMaxLineDelay, UINT *uMaxPixelDelay); + +#define wglDisableGenlockI3D WGLEW_GET_FUN(__wglewDisableGenlockI3D) +#define wglEnableGenlockI3D WGLEW_GET_FUN(__wglewEnableGenlockI3D) +#define wglGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGenlockSampleRateI3D) +#define wglGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGenlockSourceDelayI3D) +#define wglGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGenlockSourceEdgeI3D) +#define wglGenlockSourceI3D WGLEW_GET_FUN(__wglewGenlockSourceI3D) +#define wglGetGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGetGenlockSampleRateI3D) +#define wglGetGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGetGenlockSourceDelayI3D) +#define wglGetGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGetGenlockSourceEdgeI3D) +#define wglGetGenlockSourceI3D WGLEW_GET_FUN(__wglewGetGenlockSourceI3D) +#define wglIsEnabledGenlockI3D WGLEW_GET_FUN(__wglewIsEnabledGenlockI3D) +#define wglQueryGenlockMaxSourceDelayI3D WGLEW_GET_FUN(__wglewQueryGenlockMaxSourceDelayI3D) + +#define WGLEW_I3D_genlock WGLEW_GET_VAR(__WGLEW_I3D_genlock) + +#endif /* WGL_I3D_genlock */ + +/* -------------------------- WGL_I3D_image_buffer ------------------------- */ + +#ifndef WGL_I3D_image_buffer +#define WGL_I3D_image_buffer 1 + +#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001 +#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002 + +typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, HANDLE* pEvent, LPVOID *pAddress, DWORD *pSize, UINT count); +typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags); +typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress); +typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, LPVOID* pAddress, UINT count); + +#define wglAssociateImageBufferEventsI3D WGLEW_GET_FUN(__wglewAssociateImageBufferEventsI3D) +#define wglCreateImageBufferI3D WGLEW_GET_FUN(__wglewCreateImageBufferI3D) +#define wglDestroyImageBufferI3D WGLEW_GET_FUN(__wglewDestroyImageBufferI3D) +#define wglReleaseImageBufferEventsI3D WGLEW_GET_FUN(__wglewReleaseImageBufferEventsI3D) + +#define WGLEW_I3D_image_buffer WGLEW_GET_VAR(__WGLEW_I3D_image_buffer) + +#endif /* WGL_I3D_image_buffer */ + +/* ------------------------ WGL_I3D_swap_frame_lock ------------------------ */ + +#ifndef WGL_I3D_swap_frame_lock +#define WGL_I3D_swap_frame_lock 1 + +typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL* pFlag); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL* pFlag); + +#define wglDisableFrameLockI3D WGLEW_GET_FUN(__wglewDisableFrameLockI3D) +#define wglEnableFrameLockI3D WGLEW_GET_FUN(__wglewEnableFrameLockI3D) +#define wglIsEnabledFrameLockI3D WGLEW_GET_FUN(__wglewIsEnabledFrameLockI3D) +#define wglQueryFrameLockMasterI3D WGLEW_GET_FUN(__wglewQueryFrameLockMasterI3D) + +#define WGLEW_I3D_swap_frame_lock WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_lock) + +#endif /* WGL_I3D_swap_frame_lock */ + +/* ------------------------ WGL_I3D_swap_frame_usage ----------------------- */ + +#ifndef WGL_I3D_swap_frame_usage +#define WGL_I3D_swap_frame_usage 1 + +typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float* pUsage); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage); + +#define wglBeginFrameTrackingI3D WGLEW_GET_FUN(__wglewBeginFrameTrackingI3D) +#define wglEndFrameTrackingI3D WGLEW_GET_FUN(__wglewEndFrameTrackingI3D) +#define wglGetFrameUsageI3D WGLEW_GET_FUN(__wglewGetFrameUsageI3D) +#define wglQueryFrameTrackingI3D WGLEW_GET_FUN(__wglewQueryFrameTrackingI3D) + +#define WGLEW_I3D_swap_frame_usage WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_usage) + +#endif /* WGL_I3D_swap_frame_usage */ + +/* -------------------------- WGL_NV_float_buffer -------------------------- */ + +#ifndef WGL_NV_float_buffer +#define WGL_NV_float_buffer 1 + +#define WGL_FLOAT_COMPONENTS_NV 0x20B0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4 +#define WGL_TEXTURE_FLOAT_R_NV 0x20B5 +#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6 +#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7 +#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8 + +#define WGLEW_NV_float_buffer WGLEW_GET_VAR(__WGLEW_NV_float_buffer) + +#endif /* WGL_NV_float_buffer */ + +/* ---------------------- WGL_NV_render_depth_texture ---------------------- */ + +#ifndef WGL_NV_render_depth_texture +#define WGL_NV_render_depth_texture 1 + +#define WGL_NO_TEXTURE_ARB 0x2077 +#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4 +#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5 +#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6 +#define WGL_DEPTH_COMPONENT_NV 0x20A7 + +#define WGLEW_NV_render_depth_texture WGLEW_GET_VAR(__WGLEW_NV_render_depth_texture) + +#endif /* WGL_NV_render_depth_texture */ + +/* -------------------- WGL_NV_render_texture_rectangle -------------------- */ + +#ifndef WGL_NV_render_texture_rectangle +#define WGL_NV_render_texture_rectangle 1 + +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1 +#define WGL_TEXTURE_RECTANGLE_NV 0x20A2 + +#define WGLEW_NV_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_NV_render_texture_rectangle) + +#endif /* WGL_NV_render_texture_rectangle */ + +/* ----------------------- WGL_NV_vertex_array_range ----------------------- */ + +#ifndef WGL_NV_vertex_array_range +#define WGL_NV_vertex_array_range 1 + +typedef void * (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); +typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer); + +#define wglAllocateMemoryNV WGLEW_GET_FUN(__wglewAllocateMemoryNV) +#define wglFreeMemoryNV WGLEW_GET_FUN(__wglewFreeMemoryNV) + +#define WGLEW_NV_vertex_array_range WGLEW_GET_VAR(__WGLEW_NV_vertex_array_range) + +#endif /* WGL_NV_vertex_array_range */ + +/* -------------------------- WGL_OML_sync_control ------------------------- */ + +#ifndef WGL_OML_sync_control +#define WGL_OML_sync_control 1 + +typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32* numerator, INT32 *denominator); +typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64* ust, INT64 *msc, INT64 *sbc); +typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64* ust, INT64 *msc, INT64 *sbc); +typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64* ust, INT64 *msc, INT64 *sbc); + +#define wglGetMscRateOML WGLEW_GET_FUN(__wglewGetMscRateOML) +#define wglGetSyncValuesOML WGLEW_GET_FUN(__wglewGetSyncValuesOML) +#define wglSwapBuffersMscOML WGLEW_GET_FUN(__wglewSwapBuffersMscOML) +#define wglSwapLayerBuffersMscOML WGLEW_GET_FUN(__wglewSwapLayerBuffersMscOML) +#define wglWaitForMscOML WGLEW_GET_FUN(__wglewWaitForMscOML) +#define wglWaitForSbcOML WGLEW_GET_FUN(__wglewWaitForSbcOML) + +#define WGLEW_OML_sync_control WGLEW_GET_VAR(__WGLEW_OML_sync_control) + +#endif /* WGL_OML_sync_control */ + +/* ------------------------------------------------------------------------- */ + +#ifdef GLEW_MX +#define WGLEW_EXPORT +#else +#define WGLEW_EXPORT GLEWAPI +#endif /* GLEW_MX */ + +#ifdef GLEW_MX +struct WGLEWContextStruct +{ +#endif /* GLEW_MX */ + +WGLEW_EXPORT PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL; + +WGLEW_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB; +WGLEW_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB; +WGLEW_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB; +WGLEW_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB; + +WGLEW_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB; + +WGLEW_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB; +WGLEW_EXPORT PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB; + +WGLEW_EXPORT PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB; +WGLEW_EXPORT PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB; +WGLEW_EXPORT PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB; +WGLEW_EXPORT PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB; +WGLEW_EXPORT PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB; + +WGLEW_EXPORT PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB; +WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB; +WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB; + +WGLEW_EXPORT PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB; +WGLEW_EXPORT PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB; +WGLEW_EXPORT PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB; + +WGLEW_EXPORT PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT; +WGLEW_EXPORT PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT; +WGLEW_EXPORT PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT; +WGLEW_EXPORT PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT; + +WGLEW_EXPORT PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT; + +WGLEW_EXPORT PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT; +WGLEW_EXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT; + +WGLEW_EXPORT PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT; +WGLEW_EXPORT PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT; +WGLEW_EXPORT PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT; +WGLEW_EXPORT PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT; +WGLEW_EXPORT PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT; + +WGLEW_EXPORT PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT; +WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT; +WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT; + +WGLEW_EXPORT PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT; +WGLEW_EXPORT PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT; + +WGLEW_EXPORT PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D; +WGLEW_EXPORT PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D; + +WGLEW_EXPORT PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D; +WGLEW_EXPORT PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D; +WGLEW_EXPORT PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D; +WGLEW_EXPORT PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D; + +WGLEW_EXPORT PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D; +WGLEW_EXPORT PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D; +WGLEW_EXPORT PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D; +WGLEW_EXPORT PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D; +WGLEW_EXPORT PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D; +WGLEW_EXPORT PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D; +WGLEW_EXPORT PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D; +WGLEW_EXPORT PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D; +WGLEW_EXPORT PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D; +WGLEW_EXPORT PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D; +WGLEW_EXPORT PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D; +WGLEW_EXPORT PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D; + +WGLEW_EXPORT PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D; +WGLEW_EXPORT PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D; +WGLEW_EXPORT PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D; +WGLEW_EXPORT PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D; + +WGLEW_EXPORT PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D; +WGLEW_EXPORT PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D; +WGLEW_EXPORT PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D; +WGLEW_EXPORT PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D; + +WGLEW_EXPORT PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D; +WGLEW_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D; +WGLEW_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D; +WGLEW_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D; + +WGLEW_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV; +WGLEW_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV; + +WGLEW_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML; +WGLEW_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML; +WGLEW_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML; +WGLEW_EXPORT PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML; +WGLEW_EXPORT PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML; +WGLEW_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML; +WGLEW_EXPORT GLboolean __WGLEW_3DFX_multisample; +WGLEW_EXPORT GLboolean __WGLEW_3DL_stereo_control; +WGLEW_EXPORT GLboolean __WGLEW_ARB_buffer_region; +WGLEW_EXPORT GLboolean __WGLEW_ARB_extensions_string; +WGLEW_EXPORT GLboolean __WGLEW_ARB_make_current_read; +WGLEW_EXPORT GLboolean __WGLEW_ARB_multisample; +WGLEW_EXPORT GLboolean __WGLEW_ARB_pbuffer; +WGLEW_EXPORT GLboolean __WGLEW_ARB_pixel_format; +WGLEW_EXPORT GLboolean __WGLEW_ARB_pixel_format_float; +WGLEW_EXPORT GLboolean __WGLEW_ARB_render_texture; +WGLEW_EXPORT GLboolean __WGLEW_ATI_pixel_format_float; +WGLEW_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle; +WGLEW_EXPORT GLboolean __WGLEW_EXT_depth_float; +WGLEW_EXPORT GLboolean __WGLEW_EXT_display_color_table; +WGLEW_EXPORT GLboolean __WGLEW_EXT_extensions_string; +WGLEW_EXPORT GLboolean __WGLEW_EXT_make_current_read; +WGLEW_EXPORT GLboolean __WGLEW_EXT_multisample; +WGLEW_EXPORT GLboolean __WGLEW_EXT_pbuffer; +WGLEW_EXPORT GLboolean __WGLEW_EXT_pixel_format; +WGLEW_EXPORT GLboolean __WGLEW_EXT_swap_control; +WGLEW_EXPORT GLboolean __WGLEW_I3D_digital_video_control; +WGLEW_EXPORT GLboolean __WGLEW_I3D_gamma; +WGLEW_EXPORT GLboolean __WGLEW_I3D_genlock; +WGLEW_EXPORT GLboolean __WGLEW_I3D_image_buffer; +WGLEW_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock; +WGLEW_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage; +WGLEW_EXPORT GLboolean __WGLEW_NV_float_buffer; +WGLEW_EXPORT GLboolean __WGLEW_NV_render_depth_texture; +WGLEW_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle; +WGLEW_EXPORT GLboolean __WGLEW_NV_vertex_array_range; +WGLEW_EXPORT GLboolean __WGLEW_OML_sync_control; + +#ifdef GLEW_MX +}; /* WGLEWContextStruct */ +#endif /* GLEW_MX */ + +/* ------------------------------------------------------------------------- */ + +#ifdef GLEW_MX + +typedef struct WGLEWContextStruct WGLEWContext; +GLEWAPI GLenum wglewContextInit (WGLEWContext* ctx); +GLEWAPI GLboolean wglewContextIsSupported (WGLEWContext* ctx, const char* name); + +#define wglewInit() wglewContextInit(wglewGetContext()) +#define wglewIsSupported(x) wglewContextIsSupported(wglewGetContext(), x) + +#define WGLEW_GET_VAR(x) wglewGetContext()->x +#define WGLEW_GET_FUN(x) wglewGetContext()->x + +#else /* GLEW_MX */ + +#define WGLEW_GET_VAR(x) x +#define WGLEW_GET_FUN(x) x + +GLEWAPI GLboolean wglewIsSupported (const char* name); + +#endif /* GLEW_MX */ + +GLEWAPI GLboolean wglewGetExtension (const char* name); + +#ifdef __cplusplus +} +#endif + +#undef GLEWAPI + +#endif /* __wglew_h__ */ diff --git a/extern/glew/make/msvc_7_0/glew_vc7.vcproj b/extern/glew/make/msvc_7_0/glew_vc7.vcproj new file mode 100644 index 00000000000..a8141587350 --- /dev/null +++ b/extern/glew/make/msvc_7_0/glew_vc7.vcproj @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extern/glew/src/Makefile b/extern/glew/src/Makefile new file mode 100644 index 00000000000..55cc7cfccad --- /dev/null +++ b/extern/glew/src/Makefile @@ -0,0 +1,56 @@ +# +# $Id$ +# +# ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. The Blender +# Foundation also sells licenses for use in proprietary software under +# the Blender License. See http://www.blender.org/BL/ for information +# about this. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. +# All rights reserved. +# +# The Original Code is: all of this file. +# +# Contributor(s): none yet. +# +# ***** END GPL/BL DUAL LICENSE BLOCK ***** +# +# + +LIBNAME = glew +DIR = $(OCGDIR)/extern/$(LIBNAME) + +CCFLAGS += $(LEVEL_1_CPP_WARNINGS) + +CPPFLAGS += -I../include + +CSRCS = glew.c +CCSRCS = +include nan_compile.mk + +install: all debug + @[ -d $(NAN_GLEW) ] || mkdir -p $(NAN_GLEW) + @[ -d $(NAN_GLEW)/include/GL ] || mkdir -p $(NAN_GLEW)/include/GL + @[ -d $(NAN_GLEW)/lib ] || mkdir -p $(NAN_GLEW)/lib + @[ -d $(NAN_GLEW)/lib/debug ] || mkdir -p $(NAN_GLEW)/lib/debug + @$(NANBLENDERHOME)/intern/tools/cpifdiff.sh $(DIR)/lib$(LIBNAME).a $(NAN_GLEW)/lib/ +ifeq ($(OS),darwin) + ranlib $(NAN_GLEW)/lib/lib$(LIBNAME).a + ranlib $(NAN_GLEW)/lib/lib$(LIBNAME).a +endif + @$(NANBLENDERHOME)/intern/tools/cpifdiff.sh ../include/GL/*.h $(NAN_GLEW)/include/GL + diff --git a/extern/glew/src/glew.c b/extern/glew/src/glew.c new file mode 100644 index 00000000000..593f0e58f7c --- /dev/null +++ b/extern/glew/src/glew.c @@ -0,0 +1,9756 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2006, Milan Ikits +** Copyright (C) 2002-2006, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include +#if defined(_WIN32) +# include +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) +# include +#endif + +/* + * Define glewGetContext and related helper macros. + */ +#ifdef GLEW_MX +# define glewGetContext() ctx +# ifdef _WIN32 +# define GLEW_CONTEXT_ARG_DEF_INIT GLEWContext* ctx +# define GLEW_CONTEXT_ARG_VAR_INIT ctx +# define wglewGetContext() ctx +# define WGLEW_CONTEXT_ARG_DEF_INIT WGLEWContext* ctx +# define WGLEW_CONTEXT_ARG_DEF_LIST WGLEWContext* ctx +# else /* _WIN32 */ +# define GLEW_CONTEXT_ARG_DEF_INIT void +# define GLEW_CONTEXT_ARG_VAR_INIT +# define glxewGetContext() ctx +# define GLXEW_CONTEXT_ARG_DEF_INIT void +# define GLXEW_CONTEXT_ARG_DEF_LIST GLXEWContext* ctx +# endif /* _WIN32 */ +# define GLEW_CONTEXT_ARG_DEF_LIST GLEWContext* ctx +#else /* GLEW_MX */ +# define GLEW_CONTEXT_ARG_DEF_INIT void +# define GLEW_CONTEXT_ARG_VAR_INIT +# define GLEW_CONTEXT_ARG_DEF_LIST void +# define WGLEW_CONTEXT_ARG_DEF_INIT void +# define WGLEW_CONTEXT_ARG_DEF_LIST void +# define GLXEW_CONTEXT_ARG_DEF_INIT void +# define GLXEW_CONTEXT_ARG_DEF_LIST void +#endif /* GLEW_MX */ + +#if defined(__APPLE__) +#include +#include +#include + +void* NSGLGetProcAddress (const GLubyte *name) +{ + NSSymbol symbol; + char* symbolName; + /* prepend a '_' for the Unix C symbol mangling convention */ + symbolName = malloc(strlen((const char*)name) + 2); + strcpy(symbolName+1, (const char*)name); + symbolName[0] = '_'; + symbol = NULL; + if (NSIsSymbolNameDefined(symbolName)) + symbol = NSLookupAndBindSymbol(symbolName); + free(symbolName); + return symbol ? NSAddressOfSymbol(symbol) : NULL; +} +#endif /* __APPLE__ */ + +#if defined(__sgi) || defined (__sun) +#include +#include +#include + +void* dlGetProcAddress (const GLubyte* name) +{ + static void* h = NULL; + static void* gpa; + + if (h == NULL) + { + if ((h = dlopen(NULL, RTLD_LAZY | RTLD_LOCAL)) == NULL) return NULL; + gpa = dlsym(h, "glXGetProcAddress"); + } + + if (gpa != NULL) + return ((void*(*)(const GLubyte*))gpa)(name); + else + return dlsym(h, (const char*)name); +} +#endif /* __sgi || __sun */ + +/* + * Define glewGetProcAddress. + */ +#if defined(_WIN32) +# define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name) +#else +# if defined(__APPLE__) +# define glewGetProcAddress(name) NSGLGetProcAddress(name) +# else +# if defined(__sgi) || defined(__sun) +# define glewGetProcAddress(name) dlGetProcAddress(name) +# else /* __linux */ +# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name) +# endif +# endif +#endif + +/* + * GLEW, just like OpenGL or GLU, does not rely on the standard C library. + * These functions implement the functionality required in this file. + */ + +static GLuint _glewStrLen (const GLubyte* s) +{ + GLuint i=0; + if (s == NULL) return 0; + while (s[i] != '\0') i++; + return i; +} + +static GLuint _glewStrCLen (const GLubyte* s, GLubyte c) +{ + GLuint i=0; + if (s == NULL) return 0; + while (s[i] != '\0' && s[i] != c) i++; + return s[i] == c ? i : 0; +} + +static GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n) +{ + GLuint i=0; + if(a == NULL || b == NULL) + return (a == NULL && b == NULL && n == 0) ? GL_TRUE : GL_FALSE; + while (i < n && a[i] != '\0' && b[i] != '\0' && a[i] == b[i]) i++; + return i == n ? GL_TRUE : GL_FALSE; +} + +static GLboolean _glewStrSame1 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + while (*na > 0 && (**a == ' ' || **a == '\n' || **a == '\r' || **a == '\t')) + { + (*a)++; + (*na)--; + } + if(*na >= nb) + { + GLuint i=0; + while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; + if(i == nb) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +static GLboolean _glewStrSame2 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + if(*na >= nb) + { + GLuint i=0; + while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; + if(i == nb) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +static GLboolean _glewStrSame3 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + if(*na >= nb) + { + GLuint i=0; + while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; + if (i == nb && (*na == nb || (*a)[i] == ' ' || (*a)[i] == '\n' || (*a)[i] == '\r' || (*a)[i] == '\t')) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +#if !defined(_WIN32) || !defined(GLEW_MX) + +PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D = NULL; +PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements = NULL; +PFNGLTEXIMAGE3DPROC __glewTexImage3D = NULL; +PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D = NULL; + +PFNGLACTIVETEXTUREPROC __glewActiveTexture = NULL; +PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture = NULL; +PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D = NULL; +PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D = NULL; +PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D = NULL; +PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage = NULL; +PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd = NULL; +PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf = NULL; +PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd = NULL; +PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf = NULL; +PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d = NULL; +PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv = NULL; +PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f = NULL; +PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv = NULL; +PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i = NULL; +PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv = NULL; +PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s = NULL; +PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv = NULL; +PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d = NULL; +PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv = NULL; +PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f = NULL; +PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv = NULL; +PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i = NULL; +PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv = NULL; +PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s = NULL; +PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv = NULL; +PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d = NULL; +PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv = NULL; +PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f = NULL; +PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv = NULL; +PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i = NULL; +PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv = NULL; +PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s = NULL; +PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv = NULL; +PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d = NULL; +PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv = NULL; +PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f = NULL; +PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv = NULL; +PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i = NULL; +PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv = NULL; +PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s = NULL; +PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv = NULL; +PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage = NULL; + +PFNGLBLENDCOLORPROC __glewBlendColor = NULL; +PFNGLBLENDEQUATIONPROC __glewBlendEquation = NULL; +PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate = NULL; +PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer = NULL; +PFNGLFOGCOORDDPROC __glewFogCoordd = NULL; +PFNGLFOGCOORDDVPROC __glewFogCoorddv = NULL; +PFNGLFOGCOORDFPROC __glewFogCoordf = NULL; +PFNGLFOGCOORDFVPROC __glewFogCoordfv = NULL; +PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays = NULL; +PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements = NULL; +PFNGLPOINTPARAMETERFPROC __glewPointParameterf = NULL; +PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv = NULL; +PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b = NULL; +PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv = NULL; +PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d = NULL; +PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv = NULL; +PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f = NULL; +PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv = NULL; +PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i = NULL; +PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv = NULL; +PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s = NULL; +PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv = NULL; +PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub = NULL; +PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv = NULL; +PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui = NULL; +PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv = NULL; +PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us = NULL; +PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv = NULL; +PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer = NULL; +PFNGLWINDOWPOS2DPROC __glewWindowPos2d = NULL; +PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv = NULL; +PFNGLWINDOWPOS2FPROC __glewWindowPos2f = NULL; +PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv = NULL; +PFNGLWINDOWPOS2IPROC __glewWindowPos2i = NULL; +PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv = NULL; +PFNGLWINDOWPOS2SPROC __glewWindowPos2s = NULL; +PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv = NULL; +PFNGLWINDOWPOS3DPROC __glewWindowPos3d = NULL; +PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv = NULL; +PFNGLWINDOWPOS3FPROC __glewWindowPos3f = NULL; +PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv = NULL; +PFNGLWINDOWPOS3IPROC __glewWindowPos3i = NULL; +PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv = NULL; +PFNGLWINDOWPOS3SPROC __glewWindowPos3s = NULL; +PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv = NULL; + +PFNGLBEGINQUERYPROC __glewBeginQuery = NULL; +PFNGLBINDBUFFERPROC __glewBindBuffer = NULL; +PFNGLBUFFERDATAPROC __glewBufferData = NULL; +PFNGLBUFFERSUBDATAPROC __glewBufferSubData = NULL; +PFNGLDELETEBUFFERSPROC __glewDeleteBuffers = NULL; +PFNGLDELETEQUERIESPROC __glewDeleteQueries = NULL; +PFNGLENDQUERYPROC __glewEndQuery = NULL; +PFNGLGENBUFFERSPROC __glewGenBuffers = NULL; +PFNGLGENQUERIESPROC __glewGenQueries = NULL; +PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv = NULL; +PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv = NULL; +PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData = NULL; +PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv = NULL; +PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv = NULL; +PFNGLGETQUERYIVPROC __glewGetQueryiv = NULL; +PFNGLISBUFFERPROC __glewIsBuffer = NULL; +PFNGLISQUERYPROC __glewIsQuery = NULL; +PFNGLMAPBUFFERPROC __glewMapBuffer = NULL; +PFNGLUNMAPBUFFERPROC __glewUnmapBuffer = NULL; + +PFNGLATTACHSHADERPROC __glewAttachShader = NULL; +PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation = NULL; +PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate = NULL; +PFNGLCOMPILESHADERPROC __glewCompileShader = NULL; +PFNGLCREATEPROGRAMPROC __glewCreateProgram = NULL; +PFNGLCREATESHADERPROC __glewCreateShader = NULL; +PFNGLDELETEPROGRAMPROC __glewDeleteProgram = NULL; +PFNGLDELETESHADERPROC __glewDeleteShader = NULL; +PFNGLDETACHSHADERPROC __glewDetachShader = NULL; +PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray = NULL; +PFNGLDRAWBUFFERSPROC __glewDrawBuffers = NULL; +PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray = NULL; +PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib = NULL; +PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform = NULL; +PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders = NULL; +PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation = NULL; +PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog = NULL; +PFNGLGETPROGRAMIVPROC __glewGetProgramiv = NULL; +PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog = NULL; +PFNGLGETSHADERSOURCEPROC __glewGetShaderSource = NULL; +PFNGLGETSHADERIVPROC __glewGetShaderiv = NULL; +PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation = NULL; +PFNGLGETUNIFORMFVPROC __glewGetUniformfv = NULL; +PFNGLGETUNIFORMIVPROC __glewGetUniformiv = NULL; +PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv = NULL; +PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv = NULL; +PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv = NULL; +PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv = NULL; +PFNGLISPROGRAMPROC __glewIsProgram = NULL; +PFNGLISSHADERPROC __glewIsShader = NULL; +PFNGLLINKPROGRAMPROC __glewLinkProgram = NULL; +PFNGLSHADERSOURCEPROC __glewShaderSource = NULL; +PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate = NULL; +PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate = NULL; +PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate = NULL; +PFNGLUNIFORM1FPROC __glewUniform1f = NULL; +PFNGLUNIFORM1FVPROC __glewUniform1fv = NULL; +PFNGLUNIFORM1IPROC __glewUniform1i = NULL; +PFNGLUNIFORM1IVPROC __glewUniform1iv = NULL; +PFNGLUNIFORM2FPROC __glewUniform2f = NULL; +PFNGLUNIFORM2FVPROC __glewUniform2fv = NULL; +PFNGLUNIFORM2IPROC __glewUniform2i = NULL; +PFNGLUNIFORM2IVPROC __glewUniform2iv = NULL; +PFNGLUNIFORM3FPROC __glewUniform3f = NULL; +PFNGLUNIFORM3FVPROC __glewUniform3fv = NULL; +PFNGLUNIFORM3IPROC __glewUniform3i = NULL; +PFNGLUNIFORM3IVPROC __glewUniform3iv = NULL; +PFNGLUNIFORM4FPROC __glewUniform4f = NULL; +PFNGLUNIFORM4FVPROC __glewUniform4fv = NULL; +PFNGLUNIFORM4IPROC __glewUniform4i = NULL; +PFNGLUNIFORM4IVPROC __glewUniform4iv = NULL; +PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv = NULL; +PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv = NULL; +PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv = NULL; +PFNGLUSEPROGRAMPROC __glewUseProgram = NULL; +PFNGLVALIDATEPROGRAMPROC __glewValidateProgram = NULL; +PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d = NULL; +PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv = NULL; +PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f = NULL; +PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv = NULL; +PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s = NULL; +PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv = NULL; +PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d = NULL; +PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv = NULL; +PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f = NULL; +PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv = NULL; +PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s = NULL; +PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv = NULL; +PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d = NULL; +PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv = NULL; +PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f = NULL; +PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv = NULL; +PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s = NULL; +PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv = NULL; +PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv = NULL; +PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv = NULL; +PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv = NULL; +PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub = NULL; +PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv = NULL; +PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv = NULL; +PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv = NULL; +PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv = NULL; +PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d = NULL; +PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv = NULL; +PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f = NULL; +PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv = NULL; +PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv = NULL; +PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s = NULL; +PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv = NULL; +PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv = NULL; +PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv = NULL; +PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv = NULL; +PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer = NULL; + +PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX = NULL; + +PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE = NULL; +PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE = NULL; +PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE = NULL; +PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE = NULL; +PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE = NULL; + +PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE = NULL; +PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE = NULL; +PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE = NULL; +PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE = NULL; +PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE = NULL; +PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE = NULL; +PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE = NULL; +PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE = NULL; + +PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE = NULL; +PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE = NULL; + +PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE = NULL; +PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE = NULL; +PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE = NULL; +PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE = NULL; + +PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE = NULL; +PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE = NULL; +PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE = NULL; + +PFNGLCLAMPCOLORARBPROC __glewClampColorARB = NULL; + +PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB = NULL; + +PFNGLCOLORSUBTABLEPROC __glewColorSubTable = NULL; +PFNGLCOLORTABLEPROC __glewColorTable = NULL; +PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv = NULL; +PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv = NULL; +PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D = NULL; +PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D = NULL; +PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf = NULL; +PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv = NULL; +PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri = NULL; +PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv = NULL; +PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable = NULL; +PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable = NULL; +PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D = NULL; +PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D = NULL; +PFNGLGETCOLORTABLEPROC __glewGetColorTable = NULL; +PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv = NULL; +PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv = NULL; +PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter = NULL; +PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv = NULL; +PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv = NULL; +PFNGLGETHISTOGRAMPROC __glewGetHistogram = NULL; +PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv = NULL; +PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv = NULL; +PFNGLGETMINMAXPROC __glewGetMinmax = NULL; +PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv = NULL; +PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv = NULL; +PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter = NULL; +PFNGLHISTOGRAMPROC __glewHistogram = NULL; +PFNGLMINMAXPROC __glewMinmax = NULL; +PFNGLRESETHISTOGRAMPROC __glewResetHistogram = NULL; +PFNGLRESETMINMAXPROC __glewResetMinmax = NULL; +PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D = NULL; + +PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB = NULL; +PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB = NULL; +PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB = NULL; +PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB = NULL; +PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB = NULL; + +PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB = NULL; + +PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB = NULL; +PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB = NULL; +PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB = NULL; +PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB = NULL; +PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB = NULL; +PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB = NULL; +PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB = NULL; +PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB = NULL; +PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB = NULL; +PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB = NULL; +PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB = NULL; +PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB = NULL; +PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB = NULL; +PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB = NULL; +PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB = NULL; +PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB = NULL; +PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB = NULL; +PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB = NULL; +PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB = NULL; +PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB = NULL; +PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB = NULL; +PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB = NULL; +PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB = NULL; +PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB = NULL; +PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB = NULL; +PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB = NULL; +PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB = NULL; +PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB = NULL; +PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB = NULL; +PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB = NULL; +PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB = NULL; +PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB = NULL; +PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB = NULL; +PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB = NULL; + +PFNGLBEGINQUERYARBPROC __glewBeginQueryARB = NULL; +PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB = NULL; +PFNGLENDQUERYARBPROC __glewEndQueryARB = NULL; +PFNGLGENQUERIESARBPROC __glewGenQueriesARB = NULL; +PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB = NULL; +PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB = NULL; +PFNGLGETQUERYIVARBPROC __glewGetQueryivARB = NULL; +PFNGLISQUERYARBPROC __glewIsQueryARB = NULL; + +PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB = NULL; +PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB = NULL; + +PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB = NULL; +PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB = NULL; +PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB = NULL; +PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB = NULL; +PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB = NULL; +PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB = NULL; +PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB = NULL; +PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB = NULL; +PFNGLGETHANDLEARBPROC __glewGetHandleARB = NULL; +PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB = NULL; +PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB = NULL; +PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB = NULL; +PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB = NULL; +PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB = NULL; +PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB = NULL; +PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB = NULL; +PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB = NULL; +PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB = NULL; +PFNGLUNIFORM1FARBPROC __glewUniform1fARB = NULL; +PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB = NULL; +PFNGLUNIFORM1IARBPROC __glewUniform1iARB = NULL; +PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB = NULL; +PFNGLUNIFORM2FARBPROC __glewUniform2fARB = NULL; +PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB = NULL; +PFNGLUNIFORM2IARBPROC __glewUniform2iARB = NULL; +PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB = NULL; +PFNGLUNIFORM3FARBPROC __glewUniform3fARB = NULL; +PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB = NULL; +PFNGLUNIFORM3IARBPROC __glewUniform3iARB = NULL; +PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB = NULL; +PFNGLUNIFORM4FARBPROC __glewUniform4fARB = NULL; +PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB = NULL; +PFNGLUNIFORM4IARBPROC __glewUniform4iARB = NULL; +PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB = NULL; +PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB = NULL; +PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB = NULL; +PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB = NULL; +PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB = NULL; +PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB = NULL; + +PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB = NULL; +PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB = NULL; +PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB = NULL; +PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB = NULL; + +PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB = NULL; +PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB = NULL; +PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB = NULL; +PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB = NULL; + +PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB = NULL; +PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB = NULL; +PFNGLWEIGHTBVARBPROC __glewWeightbvARB = NULL; +PFNGLWEIGHTDVARBPROC __glewWeightdvARB = NULL; +PFNGLWEIGHTFVARBPROC __glewWeightfvARB = NULL; +PFNGLWEIGHTIVARBPROC __glewWeightivARB = NULL; +PFNGLWEIGHTSVARBPROC __glewWeightsvARB = NULL; +PFNGLWEIGHTUBVARBPROC __glewWeightubvARB = NULL; +PFNGLWEIGHTUIVARBPROC __glewWeightuivARB = NULL; +PFNGLWEIGHTUSVARBPROC __glewWeightusvARB = NULL; + +PFNGLBINDBUFFERARBPROC __glewBindBufferARB = NULL; +PFNGLBUFFERDATAARBPROC __glewBufferDataARB = NULL; +PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB = NULL; +PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB = NULL; +PFNGLGENBUFFERSARBPROC __glewGenBuffersARB = NULL; +PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB = NULL; +PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB = NULL; +PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB = NULL; +PFNGLISBUFFERARBPROC __glewIsBufferARB = NULL; +PFNGLMAPBUFFERARBPROC __glewMapBufferARB = NULL; +PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB = NULL; + +PFNGLBINDPROGRAMARBPROC __glewBindProgramARB = NULL; +PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB = NULL; +PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB = NULL; +PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB = NULL; +PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB = NULL; +PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB = NULL; +PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB = NULL; +PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB = NULL; +PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB = NULL; +PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB = NULL; +PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB = NULL; +PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB = NULL; +PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB = NULL; +PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB = NULL; +PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB = NULL; +PFNGLISPROGRAMARBPROC __glewIsProgramARB = NULL; +PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB = NULL; +PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB = NULL; +PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB = NULL; +PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB = NULL; +PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB = NULL; +PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB = NULL; +PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB = NULL; +PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB = NULL; +PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB = NULL; +PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB = NULL; +PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB = NULL; +PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB = NULL; +PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB = NULL; +PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB = NULL; +PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB = NULL; +PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB = NULL; +PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB = NULL; +PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB = NULL; +PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB = NULL; +PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB = NULL; +PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB = NULL; +PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB = NULL; +PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB = NULL; +PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB = NULL; +PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB = NULL; +PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB = NULL; +PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB = NULL; +PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB = NULL; +PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB = NULL; +PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB = NULL; +PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB = NULL; +PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB = NULL; +PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB = NULL; +PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB = NULL; +PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB = NULL; +PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB = NULL; +PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB = NULL; +PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB = NULL; +PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB = NULL; +PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB = NULL; +PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB = NULL; +PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB = NULL; +PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB = NULL; +PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB = NULL; +PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB = NULL; +PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB = NULL; + +PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB = NULL; +PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB = NULL; +PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB = NULL; + +PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB = NULL; +PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB = NULL; +PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB = NULL; +PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB = NULL; +PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB = NULL; +PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB = NULL; +PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB = NULL; +PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB = NULL; +PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB = NULL; +PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB = NULL; +PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB = NULL; +PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB = NULL; +PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB = NULL; +PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB = NULL; +PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB = NULL; +PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB = NULL; + +PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI = NULL; + +PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI = NULL; +PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI = NULL; +PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI = NULL; + +PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI = NULL; +PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI = NULL; +PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI = NULL; +PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI = NULL; + +PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI = NULL; +PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI = NULL; +PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI = NULL; +PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI = NULL; +PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI = NULL; +PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI = NULL; +PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI = NULL; +PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI = NULL; +PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI = NULL; +PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI = NULL; +PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI = NULL; +PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI = NULL; +PFNGLSAMPLEMAPATIPROC __glewSampleMapATI = NULL; +PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI = NULL; + +PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI = NULL; +PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI = NULL; + +PFNGLPNTRIANGLESFATIPROC __glPNTrianglewesfATI = NULL; +PFNGLPNTRIANGLESIATIPROC __glPNTrianglewesiATI = NULL; + +PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI = NULL; +PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI = NULL; + +PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI = NULL; +PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI = NULL; +PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI = NULL; +PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI = NULL; +PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI = NULL; +PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI = NULL; +PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI = NULL; +PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI = NULL; +PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI = NULL; +PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI = NULL; +PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI = NULL; +PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI = NULL; + +PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI = NULL; +PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI = NULL; +PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI = NULL; + +PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI = NULL; +PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI = NULL; +PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI = NULL; +PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI = NULL; +PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI = NULL; +PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI = NULL; +PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI = NULL; +PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI = NULL; +PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI = NULL; +PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI = NULL; +PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI = NULL; +PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI = NULL; +PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI = NULL; +PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI = NULL; +PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI = NULL; +PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI = NULL; +PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI = NULL; +PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI = NULL; +PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI = NULL; +PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI = NULL; +PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI = NULL; +PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI = NULL; +PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI = NULL; +PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI = NULL; +PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI = NULL; +PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI = NULL; +PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI = NULL; +PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI = NULL; +PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI = NULL; +PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI = NULL; +PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI = NULL; +PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI = NULL; +PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI = NULL; +PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI = NULL; +PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI = NULL; +PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI = NULL; +PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI = NULL; + +PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT = NULL; + +PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT = NULL; + +PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT = NULL; + +PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT = NULL; + +PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT = NULL; +PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT = NULL; + +PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT = NULL; +PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT = NULL; + +PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT = NULL; +PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT = NULL; +PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT = NULL; +PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT = NULL; +PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT = NULL; +PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT = NULL; +PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT = NULL; +PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT = NULL; +PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT = NULL; +PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT = NULL; +PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT = NULL; +PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT = NULL; +PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT = NULL; + +PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT = NULL; +PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT = NULL; + +PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT = NULL; +PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT = NULL; +PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT = NULL; +PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT = NULL; +PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT = NULL; + +PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT = NULL; +PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT = NULL; + +PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT = NULL; + +PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT = NULL; + +PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT = NULL; +PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT = NULL; +PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT = NULL; +PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT = NULL; +PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT = NULL; + +PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT = NULL; +PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT = NULL; +PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT = NULL; +PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT = NULL; +PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT = NULL; +PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT = NULL; +PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT = NULL; +PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT = NULL; +PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT = NULL; +PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT = NULL; +PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT = NULL; +PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT = NULL; +PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT = NULL; +PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT = NULL; +PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT = NULL; +PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT = NULL; +PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT = NULL; +PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT = NULL; + +PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT = NULL; + +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT = NULL; + +PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT = NULL; +PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT = NULL; +PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT = NULL; +PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT = NULL; +PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT = NULL; +PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT = NULL; +PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT = NULL; +PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT = NULL; +PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT = NULL; +PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT = NULL; +PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT = NULL; +PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT = NULL; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT = NULL; +PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT = NULL; +PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT = NULL; +PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT = NULL; +PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT = NULL; + +PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT = NULL; +PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT = NULL; +PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT = NULL; +PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT = NULL; +PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT = NULL; +PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT = NULL; +PFNGLHISTOGRAMEXTPROC __glewHistogramEXT = NULL; +PFNGLMINMAXEXTPROC __glewMinmaxEXT = NULL; +PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT = NULL; +PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT = NULL; + +PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT = NULL; + +PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT = NULL; + +PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT = NULL; +PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT = NULL; +PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT = NULL; + +PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT = NULL; +PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT = NULL; + +PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT = NULL; +PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT = NULL; + +PFNGLCOLORTABLEEXTPROC __glewColorTableEXT = NULL; +PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT = NULL; +PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT = NULL; +PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT = NULL; + +PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT = NULL; +PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT = NULL; +PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT = NULL; +PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT = NULL; +PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT = NULL; +PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT = NULL; + +PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT = NULL; +PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT = NULL; + +PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT = NULL; + +PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT = NULL; +PFNGLENDSCENEEXTPROC __glewEndSceneEXT = NULL; + +PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT = NULL; +PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT = NULL; +PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT = NULL; +PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT = NULL; +PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT = NULL; +PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT = NULL; +PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT = NULL; +PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT = NULL; +PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT = NULL; +PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT = NULL; +PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT = NULL; +PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT = NULL; +PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT = NULL; +PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT = NULL; +PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT = NULL; +PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT = NULL; +PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT = NULL; + +PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT = NULL; + +PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT = NULL; +PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT = NULL; +PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT = NULL; + +PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT = NULL; + +PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT = NULL; +PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT = NULL; +PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT = NULL; +PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT = NULL; +PFNGLISTEXTUREEXTPROC __glewIsTextureEXT = NULL; +PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT = NULL; + +PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT = NULL; + +PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT = NULL; +PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT = NULL; +PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT = NULL; +PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT = NULL; +PFNGLGETPOINTERVEXTPROC __glewGetPointervEXT = NULL; +PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT = NULL; +PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT = NULL; +PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT = NULL; +PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT = NULL; + +PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT = NULL; +PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT = NULL; +PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT = NULL; +PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT = NULL; +PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT = NULL; +PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT = NULL; +PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT = NULL; +PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT = NULL; +PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT = NULL; +PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT = NULL; +PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT = NULL; +PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT = NULL; +PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT = NULL; +PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT = NULL; +PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT = NULL; +PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT = NULL; +PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT = NULL; +PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT = NULL; +PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT = NULL; +PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT = NULL; +PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT = NULL; +PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT = NULL; +PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT = NULL; +PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT = NULL; +PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT = NULL; +PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT = NULL; +PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT = NULL; +PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT = NULL; +PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT = NULL; +PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT = NULL; +PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT = NULL; +PFNGLSWIZZLEEXTPROC __glewSwizzleEXT = NULL; +PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT = NULL; +PFNGLVARIANTBVEXTPROC __glewVariantbvEXT = NULL; +PFNGLVARIANTDVEXTPROC __glewVariantdvEXT = NULL; +PFNGLVARIANTFVEXTPROC __glewVariantfvEXT = NULL; +PFNGLVARIANTIVEXTPROC __glewVariantivEXT = NULL; +PFNGLVARIANTSVEXTPROC __glewVariantsvEXT = NULL; +PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT = NULL; +PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT = NULL; +PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT = NULL; +PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT = NULL; + +PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT = NULL; +PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT = NULL; +PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT = NULL; + +PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY = NULL; + +PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP = NULL; +PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP = NULL; +PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP = NULL; +PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP = NULL; +PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP = NULL; +PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP = NULL; + +PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM = NULL; +PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM = NULL; + +PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM = NULL; +PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM = NULL; +PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM = NULL; +PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM = NULL; +PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM = NULL; +PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM = NULL; +PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM = NULL; +PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM = NULL; + +PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL = NULL; +PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL = NULL; +PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL = NULL; +PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL = NULL; + +PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL = NULL; +PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL = NULL; + +PFNGLBUFFERREGIONENABLEDEXTPROC __glewBufferRegionEnabledEXT = NULL; +PFNGLDELETEBUFFERREGIONEXTPROC __glewDeleteBufferRegionEXT = NULL; +PFNGLDRAWBUFFERREGIONEXTPROC __glewDrawBufferRegionEXT = NULL; +PFNGLNEWBUFFERREGIONEXTPROC __glewNewBufferRegionEXT = NULL; +PFNGLREADBUFFERREGIONEXTPROC __glewReadBufferRegionEXT = NULL; + +PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA = NULL; + +PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA = NULL; +PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA = NULL; +PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA = NULL; +PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA = NULL; +PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA = NULL; +PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA = NULL; +PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA = NULL; +PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA = NULL; +PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA = NULL; +PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA = NULL; +PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA = NULL; +PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA = NULL; +PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA = NULL; +PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA = NULL; +PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA = NULL; +PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA = NULL; +PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA = NULL; +PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA = NULL; +PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA = NULL; +PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA = NULL; +PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA = NULL; +PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA = NULL; +PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA = NULL; +PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA = NULL; + +PFNGLEVALMAPSNVPROC __glewEvalMapsNV = NULL; +PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV = NULL; +PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV = NULL; +PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV = NULL; +PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV = NULL; +PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV = NULL; +PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV = NULL; +PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV = NULL; +PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV = NULL; + +PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV = NULL; +PFNGLFINISHFENCENVPROC __glewFinishFenceNV = NULL; +PFNGLGENFENCESNVPROC __glewGenFencesNV = NULL; +PFNGLGETFENCEIVNVPROC __glewGetFenceivNV = NULL; +PFNGLISFENCENVPROC __glewIsFenceNV = NULL; +PFNGLSETFENCENVPROC __glewSetFenceNV = NULL; +PFNGLTESTFENCENVPROC __glewTestFenceNV = NULL; + +PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV = NULL; +PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV = NULL; +PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV = NULL; +PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV = NULL; +PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV = NULL; +PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV = NULL; + +PFNGLCOLOR3HNVPROC __glewColor3hNV = NULL; +PFNGLCOLOR3HVNVPROC __glewColor3hvNV = NULL; +PFNGLCOLOR4HNVPROC __glewColor4hNV = NULL; +PFNGLCOLOR4HVNVPROC __glewColor4hvNV = NULL; +PFNGLFOGCOORDHNVPROC __glewFogCoordhNV = NULL; +PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV = NULL; +PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV = NULL; +PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV = NULL; +PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV = NULL; +PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV = NULL; +PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV = NULL; +PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV = NULL; +PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV = NULL; +PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV = NULL; +PFNGLNORMAL3HNVPROC __glewNormal3hNV = NULL; +PFNGLNORMAL3HVNVPROC __glewNormal3hvNV = NULL; +PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV = NULL; +PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV = NULL; +PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV = NULL; +PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV = NULL; +PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV = NULL; +PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV = NULL; +PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV = NULL; +PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV = NULL; +PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV = NULL; +PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV = NULL; +PFNGLVERTEX2HNVPROC __glewVertex2hNV = NULL; +PFNGLVERTEX2HVNVPROC __glewVertex2hvNV = NULL; +PFNGLVERTEX3HNVPROC __glewVertex3hNV = NULL; +PFNGLVERTEX3HVNVPROC __glewVertex3hvNV = NULL; +PFNGLVERTEX4HNVPROC __glewVertex4hNV = NULL; +PFNGLVERTEX4HVNVPROC __glewVertex4hvNV = NULL; +PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV = NULL; +PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV = NULL; +PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV = NULL; +PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV = NULL; +PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV = NULL; +PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV = NULL; +PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV = NULL; +PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV = NULL; +PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV = NULL; +PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV = NULL; +PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV = NULL; +PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV = NULL; +PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV = NULL; +PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV = NULL; + +PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV = NULL; +PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV = NULL; +PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV = NULL; +PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV = NULL; +PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV = NULL; +PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV = NULL; +PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV = NULL; + +PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV = NULL; +PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV = NULL; + +PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV = NULL; +PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV = NULL; + +PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV = NULL; +PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV = NULL; + +PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV = NULL; +PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV = NULL; +PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV = NULL; +PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV = NULL; +PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV = NULL; +PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV = NULL; +PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV = NULL; +PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV = NULL; +PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV = NULL; +PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV = NULL; +PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV = NULL; +PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV = NULL; +PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV = NULL; + +PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV = NULL; +PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV = NULL; + +PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV = NULL; +PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV = NULL; + +PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV = NULL; +PFNGLBINDPROGRAMNVPROC __glewBindProgramNV = NULL; +PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV = NULL; +PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV = NULL; +PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV = NULL; +PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV = NULL; +PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV = NULL; +PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV = NULL; +PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV = NULL; +PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV = NULL; +PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV = NULL; +PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV = NULL; +PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV = NULL; +PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV = NULL; +PFNGLISPROGRAMNVPROC __glewIsProgramNV = NULL; +PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV = NULL; +PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV = NULL; +PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV = NULL; +PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV = NULL; +PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV = NULL; +PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV = NULL; +PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV = NULL; +PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV = NULL; +PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV = NULL; +PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV = NULL; +PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV = NULL; +PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV = NULL; +PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV = NULL; +PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV = NULL; +PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV = NULL; +PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV = NULL; +PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV = NULL; +PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV = NULL; +PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV = NULL; +PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV = NULL; +PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV = NULL; +PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV = NULL; +PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV = NULL; +PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV = NULL; +PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV = NULL; +PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV = NULL; +PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV = NULL; +PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV = NULL; +PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV = NULL; +PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV = NULL; +PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV = NULL; +PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV = NULL; +PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV = NULL; +PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV = NULL; +PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV = NULL; +PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV = NULL; +PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV = NULL; +PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV = NULL; +PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV = NULL; +PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV = NULL; +PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV = NULL; +PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV = NULL; +PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV = NULL; +PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV = NULL; +PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV = NULL; +PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV = NULL; +PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV = NULL; +PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV = NULL; +PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV = NULL; + +PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS = NULL; +PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS = NULL; + +PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS = NULL; +PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS = NULL; + +PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS = NULL; +PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS = NULL; + +PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS = NULL; +PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS = NULL; + +PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS = NULL; +PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS = NULL; + +PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS = NULL; +PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS = NULL; + +PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX = NULL; +PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX = NULL; +PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX = NULL; +PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX = NULL; +PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX = NULL; +PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX = NULL; + +PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX = NULL; + +PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX = NULL; + +#if 0 +PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX = NULL; +PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX = NULL; +PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX = NULL; +PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX = NULL; +PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX = NULL; +PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX = NULL; +PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX = NULL; +PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX = NULL; +PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX = NULL; +PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX = NULL; +PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX = NULL; +PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX = NULL; +PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX = NULL; +PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX = NULL; +PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX = NULL; +PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX = NULL; +PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX = NULL; +#endif + +PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX = NULL; + +PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX = NULL; + +PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX = NULL; + +PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX = NULL; +PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX = NULL; +PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX = NULL; +PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX = NULL; + +PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX = NULL; + +PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI = NULL; +PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI = NULL; +PFNGLCOLORTABLESGIPROC __glewColorTableSGI = NULL; +PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI = NULL; +PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI = NULL; +PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI = NULL; +PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI = NULL; + +PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX = NULL; + +PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN = NULL; +PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN = NULL; +PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN = NULL; +PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN = NULL; +PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN = NULL; +PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN = NULL; +PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN = NULL; +PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN = NULL; + +PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN = NULL; + +PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN = NULL; +PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN = NULL; +PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN = NULL; +PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN = NULL; +PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN = NULL; +PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN = NULL; +PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN = NULL; + +PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN = NULL; +PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN = NULL; +PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN = NULL; +PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN = NULL; +PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN = NULL; +PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN = NULL; +PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN = NULL; +PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN = NULL; +PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN = NULL; +PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN = NULL; +PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN = NULL; +PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN = NULL; +PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN = NULL; +PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN = NULL; +PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN = NULL; +PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN = NULL; +PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN = NULL; +PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN = NULL; +PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN = NULL; +PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN = NULL; +PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN = NULL; +PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN = NULL; +PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN = NULL; +PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN = NULL; + +PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN = NULL; + +#endif /* !WIN32 || !GLEW_MX */ + +#if !defined(GLEW_MX) + +GLboolean __GLEW_VERSION_1_1 = GL_FALSE; +GLboolean __GLEW_VERSION_1_2 = GL_FALSE; +GLboolean __GLEW_VERSION_1_3 = GL_FALSE; +GLboolean __GLEW_VERSION_1_4 = GL_FALSE; +GLboolean __GLEW_VERSION_1_5 = GL_FALSE; +GLboolean __GLEW_VERSION_2_0 = GL_FALSE; +GLboolean __GLEW_3DFX_multisample = GL_FALSE; +GLboolean __GLEW_3DFX_tbuffer = GL_FALSE; +GLboolean __GLEW_3DFX_texture_compression_FXT1 = GL_FALSE; +GLboolean __GLEW_APPLE_client_storage = GL_FALSE; +GLboolean __GLEW_APPLE_element_array = GL_FALSE; +GLboolean __GLEW_APPLE_fence = GL_FALSE; +GLboolean __GLEW_APPLE_float_pixels = GL_FALSE; +GLboolean __GLEW_APPLE_pixel_buffer = GL_FALSE; +GLboolean __GLEW_APPLE_specular_vector = GL_FALSE; +GLboolean __GLEW_APPLE_texture_range = GL_FALSE; +GLboolean __GLEW_APPLE_transform_hint = GL_FALSE; +GLboolean __GLEW_APPLE_vertex_array_object = GL_FALSE; +GLboolean __GLEW_APPLE_vertex_array_range = GL_FALSE; +GLboolean __GLEW_APPLE_ycbcr_422 = GL_FALSE; +GLboolean __GLEW_ARB_color_buffer_float = GL_FALSE; +GLboolean __GLEW_ARB_depth_texture = GL_FALSE; +GLboolean __GLEW_ARB_draw_buffers = GL_FALSE; +GLboolean __GLEW_ARB_fragment_program = GL_FALSE; +GLboolean __GLEW_ARB_fragment_program_shadow = GL_FALSE; +GLboolean __GLEW_ARB_fragment_shader = GL_FALSE; +GLboolean __GLEW_ARB_half_float_pixel = GL_FALSE; +GLboolean __GLEW_ARB_imaging = GL_FALSE; +GLboolean __GLEW_ARB_matrix_palette = GL_FALSE; +GLboolean __GLEW_ARB_multisample = GL_FALSE; +GLboolean __GLEW_ARB_multitexture = GL_FALSE; +GLboolean __GLEW_ARB_occlusion_query = GL_FALSE; +GLboolean __GLEW_ARB_pixel_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_point_parameters = GL_FALSE; +GLboolean __GLEW_ARB_point_sprite = GL_FALSE; +GLboolean __GLEW_ARB_shader_objects = GL_FALSE; +GLboolean __GLEW_ARB_shading_language_100 = GL_FALSE; +GLboolean __GLEW_ARB_shadow = GL_FALSE; +GLboolean __GLEW_ARB_shadow_ambient = GL_FALSE; +GLboolean __GLEW_ARB_texture_border_clamp = GL_FALSE; +GLboolean __GLEW_ARB_texture_compression = GL_FALSE; +GLboolean __GLEW_ARB_texture_cube_map = GL_FALSE; +GLboolean __GLEW_ARB_texture_env_add = GL_FALSE; +GLboolean __GLEW_ARB_texture_env_combine = GL_FALSE; +GLboolean __GLEW_ARB_texture_env_crossbar = GL_FALSE; +GLboolean __GLEW_ARB_texture_env_dot3 = GL_FALSE; +GLboolean __GLEW_ARB_texture_float = GL_FALSE; +GLboolean __GLEW_ARB_texture_mirrored_repeat = GL_FALSE; +GLboolean __GLEW_ARB_texture_non_power_of_two = GL_FALSE; +GLboolean __GLEW_ARB_texture_rectangle = GL_FALSE; +GLboolean __GLEW_ARB_transpose_matrix = GL_FALSE; +GLboolean __GLEW_ARB_vertex_blend = GL_FALSE; +GLboolean __GLEW_ARB_vertex_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_vertex_program = GL_FALSE; +GLboolean __GLEW_ARB_vertex_shader = GL_FALSE; +GLboolean __GLEW_ARB_window_pos = GL_FALSE; +GLboolean __GLEW_ATIX_point_sprites = GL_FALSE; +GLboolean __GLEW_ATIX_texture_env_combine3 = GL_FALSE; +GLboolean __GLEW_ATIX_texture_env_route = GL_FALSE; +GLboolean __GLEW_ATIX_vertex_shader_output_point_size = GL_FALSE; +GLboolean __GLEW_ATI_draw_buffers = GL_FALSE; +GLboolean __GLEW_ATI_element_array = GL_FALSE; +GLboolean __GLEW_ATI_envmap_bumpmap = GL_FALSE; +GLboolean __GLEW_ATI_fragment_shader = GL_FALSE; +GLboolean __GLEW_ATI_map_object_buffer = GL_FALSE; +GLboolean __GLEW_ATI_pn_triangles = GL_FALSE; +GLboolean __GLEW_ATI_separate_stencil = GL_FALSE; +GLboolean __GLEW_ATI_text_fragment_shader = GL_FALSE; +GLboolean __GLEW_ATI_texture_compression_3dc = GL_FALSE; +GLboolean __GLEW_ATI_texture_env_combine3 = GL_FALSE; +GLboolean __GLEW_ATI_texture_float = GL_FALSE; +GLboolean __GLEW_ATI_texture_mirror_once = GL_FALSE; +GLboolean __GLEW_ATI_vertex_array_object = GL_FALSE; +GLboolean __GLEW_ATI_vertex_attrib_array_object = GL_FALSE; +GLboolean __GLEW_ATI_vertex_streams = GL_FALSE; +GLboolean __GLEW_EXT_422_pixels = GL_FALSE; +GLboolean __GLEW_EXT_Cg_shader = GL_FALSE; +GLboolean __GLEW_EXT_abgr = GL_FALSE; +GLboolean __GLEW_EXT_bgra = GL_FALSE; +GLboolean __GLEW_EXT_blend_color = GL_FALSE; +GLboolean __GLEW_EXT_blend_equation_separate = GL_FALSE; +GLboolean __GLEW_EXT_blend_func_separate = GL_FALSE; +GLboolean __GLEW_EXT_blend_logic_op = GL_FALSE; +GLboolean __GLEW_EXT_blend_minmax = GL_FALSE; +GLboolean __GLEW_EXT_blend_subtract = GL_FALSE; +GLboolean __GLEW_EXT_clip_volume_hint = GL_FALSE; +GLboolean __GLEW_EXT_cmyka = GL_FALSE; +GLboolean __GLEW_EXT_color_subtable = GL_FALSE; +GLboolean __GLEW_EXT_compiled_vertex_array = GL_FALSE; +GLboolean __GLEW_EXT_convolution = GL_FALSE; +GLboolean __GLEW_EXT_coordinate_frame = GL_FALSE; +GLboolean __GLEW_EXT_copy_texture = GL_FALSE; +GLboolean __GLEW_EXT_cull_vertex = GL_FALSE; +GLboolean __GLEW_EXT_depth_bounds_test = GL_FALSE; +GLboolean __GLEW_EXT_draw_range_elements = GL_FALSE; +GLboolean __GLEW_EXT_fog_coord = GL_FALSE; +GLboolean __GLEW_EXT_fragment_lighting = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_blit = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_multisample = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_object = GL_FALSE; +GLboolean __GLEW_EXT_histogram = GL_FALSE; +GLboolean __GLEW_EXT_index_array_formats = GL_FALSE; +GLboolean __GLEW_EXT_index_func = GL_FALSE; +GLboolean __GLEW_EXT_index_material = GL_FALSE; +GLboolean __GLEW_EXT_index_texture = GL_FALSE; +GLboolean __GLEW_EXT_light_texture = GL_FALSE; +GLboolean __GLEW_EXT_misc_attribute = GL_FALSE; +GLboolean __GLEW_EXT_multi_draw_arrays = GL_FALSE; +GLboolean __GLEW_EXT_multisample = GL_FALSE; +GLboolean __GLEW_EXT_packed_depth_stencil = GL_FALSE; +GLboolean __GLEW_EXT_packed_pixels = GL_FALSE; +GLboolean __GLEW_EXT_paletted_texture = GL_FALSE; +GLboolean __GLEW_EXT_pixel_buffer_object = GL_FALSE; +GLboolean __GLEW_EXT_pixel_transform = GL_FALSE; +GLboolean __GLEW_EXT_pixel_transform_color_table = GL_FALSE; +GLboolean __GLEW_EXT_point_parameters = GL_FALSE; +GLboolean __GLEW_EXT_polygon_offset = GL_FALSE; +GLboolean __GLEW_EXT_rescale_normal = GL_FALSE; +GLboolean __GLEW_EXT_scene_marker = GL_FALSE; +GLboolean __GLEW_EXT_secondary_color = GL_FALSE; +GLboolean __GLEW_EXT_separate_specular_color = GL_FALSE; +GLboolean __GLEW_EXT_shadow_funcs = GL_FALSE; +GLboolean __GLEW_EXT_shared_texture_palette = GL_FALSE; +GLboolean __GLEW_EXT_stencil_clear_tag = GL_FALSE; +GLboolean __GLEW_EXT_stencil_two_side = GL_FALSE; +GLboolean __GLEW_EXT_stencil_wrap = GL_FALSE; +GLboolean __GLEW_EXT_subtexture = GL_FALSE; +GLboolean __GLEW_EXT_texture = GL_FALSE; +GLboolean __GLEW_EXT_texture3D = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_dxt1 = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_s3tc = GL_FALSE; +GLboolean __GLEW_EXT_texture_cube_map = GL_FALSE; +GLboolean __GLEW_EXT_texture_edge_clamp = GL_FALSE; +GLboolean __GLEW_EXT_texture_env = GL_FALSE; +GLboolean __GLEW_EXT_texture_env_add = GL_FALSE; +GLboolean __GLEW_EXT_texture_env_combine = GL_FALSE; +GLboolean __GLEW_EXT_texture_env_dot3 = GL_FALSE; +GLboolean __GLEW_EXT_texture_filter_anisotropic = GL_FALSE; +GLboolean __GLEW_EXT_texture_lod_bias = GL_FALSE; +GLboolean __GLEW_EXT_texture_mirror_clamp = GL_FALSE; +GLboolean __GLEW_EXT_texture_object = GL_FALSE; +GLboolean __GLEW_EXT_texture_perturb_normal = GL_FALSE; +GLboolean __GLEW_EXT_texture_rectangle = GL_FALSE; +GLboolean __GLEW_EXT_texture_sRGB = GL_FALSE; +GLboolean __GLEW_EXT_vertex_array = GL_FALSE; +GLboolean __GLEW_EXT_vertex_shader = GL_FALSE; +GLboolean __GLEW_EXT_vertex_weighting = GL_FALSE; +GLboolean __GLEW_GREMEDY_string_marker = GL_FALSE; +GLboolean __GLEW_HP_convolution_border_modes = GL_FALSE; +GLboolean __GLEW_HP_image_transform = GL_FALSE; +GLboolean __GLEW_HP_occlusion_test = GL_FALSE; +GLboolean __GLEW_HP_texture_lighting = GL_FALSE; +GLboolean __GLEW_IBM_cull_vertex = GL_FALSE; +GLboolean __GLEW_IBM_multimode_draw_arrays = GL_FALSE; +GLboolean __GLEW_IBM_rasterpos_clip = GL_FALSE; +GLboolean __GLEW_IBM_static_data = GL_FALSE; +GLboolean __GLEW_IBM_texture_mirrored_repeat = GL_FALSE; +GLboolean __GLEW_IBM_vertex_array_lists = GL_FALSE; +GLboolean __GLEW_INGR_color_clamp = GL_FALSE; +GLboolean __GLEW_INGR_interlace_read = GL_FALSE; +GLboolean __GLEW_INTEL_parallel_arrays = GL_FALSE; +GLboolean __GLEW_INTEL_texture_scissor = GL_FALSE; +GLboolean __GLEW_KTX_buffer_region = GL_FALSE; +GLboolean __GLEW_MESAX_texture_stack = GL_FALSE; +GLboolean __GLEW_MESA_pack_invert = GL_FALSE; +GLboolean __GLEW_MESA_resize_buffers = GL_FALSE; +GLboolean __GLEW_MESA_window_pos = GL_FALSE; +GLboolean __GLEW_MESA_ycbcr_texture = GL_FALSE; +GLboolean __GLEW_NV_blend_square = GL_FALSE; +GLboolean __GLEW_NV_copy_depth_to_color = GL_FALSE; +GLboolean __GLEW_NV_depth_clamp = GL_FALSE; +GLboolean __GLEW_NV_evaluators = GL_FALSE; +GLboolean __GLEW_NV_fence = GL_FALSE; +GLboolean __GLEW_NV_float_buffer = GL_FALSE; +GLboolean __GLEW_NV_fog_distance = GL_FALSE; +GLboolean __GLEW_NV_fragment_program = GL_FALSE; +GLboolean __GLEW_NV_fragment_program2 = GL_FALSE; +GLboolean __GLEW_NV_fragment_program_option = GL_FALSE; +GLboolean __GLEW_NV_half_float = GL_FALSE; +GLboolean __GLEW_NV_light_max_exponent = GL_FALSE; +GLboolean __GLEW_NV_multisample_filter_hint = GL_FALSE; +GLboolean __GLEW_NV_occlusion_query = GL_FALSE; +GLboolean __GLEW_NV_packed_depth_stencil = GL_FALSE; +GLboolean __GLEW_NV_pixel_data_range = GL_FALSE; +GLboolean __GLEW_NV_point_sprite = GL_FALSE; +GLboolean __GLEW_NV_primitive_restart = GL_FALSE; +GLboolean __GLEW_NV_register_combiners = GL_FALSE; +GLboolean __GLEW_NV_register_combiners2 = GL_FALSE; +GLboolean __GLEW_NV_texgen_emboss = GL_FALSE; +GLboolean __GLEW_NV_texgen_reflection = GL_FALSE; +GLboolean __GLEW_NV_texture_compression_vtc = GL_FALSE; +GLboolean __GLEW_NV_texture_env_combine4 = GL_FALSE; +GLboolean __GLEW_NV_texture_expand_normal = GL_FALSE; +GLboolean __GLEW_NV_texture_rectangle = GL_FALSE; +GLboolean __GLEW_NV_texture_shader = GL_FALSE; +GLboolean __GLEW_NV_texture_shader2 = GL_FALSE; +GLboolean __GLEW_NV_texture_shader3 = GL_FALSE; +GLboolean __GLEW_NV_vertex_array_range = GL_FALSE; +GLboolean __GLEW_NV_vertex_array_range2 = GL_FALSE; +GLboolean __GLEW_NV_vertex_program = GL_FALSE; +GLboolean __GLEW_NV_vertex_program1_1 = GL_FALSE; +GLboolean __GLEW_NV_vertex_program2 = GL_FALSE; +GLboolean __GLEW_NV_vertex_program2_option = GL_FALSE; +GLboolean __GLEW_NV_vertex_program3 = GL_FALSE; +GLboolean __GLEW_OML_interlace = GL_FALSE; +GLboolean __GLEW_OML_resample = GL_FALSE; +GLboolean __GLEW_OML_subsample = GL_FALSE; +GLboolean __GLEW_PGI_misc_hints = GL_FALSE; +GLboolean __GLEW_PGI_vertex_hints = GL_FALSE; +GLboolean __GLEW_REND_screen_coordinates = GL_FALSE; +GLboolean __GLEW_S3_s3tc = GL_FALSE; +GLboolean __GLEW_SGIS_color_range = GL_FALSE; +GLboolean __GLEW_SGIS_detail_texture = GL_FALSE; +GLboolean __GLEW_SGIS_fog_function = GL_FALSE; +GLboolean __GLEW_SGIS_generate_mipmap = GL_FALSE; +GLboolean __GLEW_SGIS_multisample = GL_FALSE; +GLboolean __GLEW_SGIS_pixel_texture = GL_FALSE; +GLboolean __GLEW_SGIS_sharpen_texture = GL_FALSE; +GLboolean __GLEW_SGIS_texture4D = GL_FALSE; +GLboolean __GLEW_SGIS_texture_border_clamp = GL_FALSE; +GLboolean __GLEW_SGIS_texture_edge_clamp = GL_FALSE; +GLboolean __GLEW_SGIS_texture_filter4 = GL_FALSE; +GLboolean __GLEW_SGIS_texture_lod = GL_FALSE; +GLboolean __GLEW_SGIS_texture_select = GL_FALSE; +GLboolean __GLEW_SGIX_async = GL_FALSE; +GLboolean __GLEW_SGIX_async_histogram = GL_FALSE; +GLboolean __GLEW_SGIX_async_pixel = GL_FALSE; +GLboolean __GLEW_SGIX_blend_alpha_minmax = GL_FALSE; +GLboolean __GLEW_SGIX_clipmap = GL_FALSE; +GLboolean __GLEW_SGIX_depth_texture = GL_FALSE; +GLboolean __GLEW_SGIX_flush_raster = GL_FALSE; +GLboolean __GLEW_SGIX_fog_offset = GL_FALSE; +GLboolean __GLEW_SGIX_fog_texture = GL_FALSE; +GLboolean __GLEW_SGIX_fragment_specular_lighting = GL_FALSE; +GLboolean __GLEW_SGIX_framezoom = GL_FALSE; +GLboolean __GLEW_SGIX_interlace = GL_FALSE; +GLboolean __GLEW_SGIX_ir_instrument1 = GL_FALSE; +GLboolean __GLEW_SGIX_list_priority = GL_FALSE; +GLboolean __GLEW_SGIX_pixel_texture = GL_FALSE; +GLboolean __GLEW_SGIX_pixel_texture_bits = GL_FALSE; +GLboolean __GLEW_SGIX_reference_plane = GL_FALSE; +GLboolean __GLEW_SGIX_resample = GL_FALSE; +GLboolean __GLEW_SGIX_shadow = GL_FALSE; +GLboolean __GLEW_SGIX_shadow_ambient = GL_FALSE; +GLboolean __GLEW_SGIX_sprite = GL_FALSE; +GLboolean __GLEW_SGIX_tag_sample_buffer = GL_FALSE; +GLboolean __GLEW_SGIX_texture_add_env = GL_FALSE; +GLboolean __GLEW_SGIX_texture_coordinate_clamp = GL_FALSE; +GLboolean __GLEW_SGIX_texture_lod_bias = GL_FALSE; +GLboolean __GLEW_SGIX_texture_multi_buffer = GL_FALSE; +GLboolean __GLEW_SGIX_texture_range = GL_FALSE; +GLboolean __GLEW_SGIX_texture_scale_bias = GL_FALSE; +GLboolean __GLEW_SGIX_vertex_preclip = GL_FALSE; +GLboolean __GLEW_SGIX_vertex_preclip_hint = GL_FALSE; +GLboolean __GLEW_SGIX_ycrcb = GL_FALSE; +GLboolean __GLEW_SGI_color_matrix = GL_FALSE; +GLboolean __GLEW_SGI_color_table = GL_FALSE; +GLboolean __GLEW_SGI_texture_color_table = GL_FALSE; +GLboolean __GLEW_SUNX_constant_data = GL_FALSE; +GLboolean __GLEW_SUN_convolution_border_modes = GL_FALSE; +GLboolean __GLEW_SUN_global_alpha = GL_FALSE; +GLboolean __GLEW_SUN_mesh_array = GL_FALSE; +GLboolean __GLEW_SUN_read_video_pixels = GL_FALSE; +GLboolean __GLEW_SUN_slice_accum = GL_FALSE; +GLboolean __GLEW_SUN_triangle_list = GL_FALSE; +GLboolean __GLEW_SUN_vertex = GL_FALSE; +GLboolean __GLEW_WIN_phong_shading = GL_FALSE; +GLboolean __GLEW_WIN_specular_fog = GL_FALSE; +GLboolean __GLEW_WIN_swap_hint = GL_FALSE; + +#endif /* !GLEW_MX */ + +#ifdef GL_VERSION_1_2 + +static GLboolean _glewInit_GL_VERSION_1_2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage3D")) == NULL) || r; + r = ((glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElements")) == NULL) || r; + r = ((glTexImage3D = (PFNGLTEXIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexImage3D")) == NULL) || r; + r = ((glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage3D")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_1_2 */ + +#ifdef GL_VERSION_1_3 + +static GLboolean _glewInit_GL_VERSION_1_3 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveTexture = (PFNGLACTIVETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glActiveTexture")) == NULL) || r; + r = ((glClientActiveTexture = (PFNGLCLIENTACTIVETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glClientActiveTexture")) == NULL) || r; + r = ((glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage1D")) == NULL) || r; + r = ((glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage2D")) == NULL) || r; + r = ((glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage3D")) == NULL) || r; + r = ((glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage1D")) == NULL) || r; + r = ((glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage2D")) == NULL) || r; + r = ((glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage3D")) == NULL) || r; + r = ((glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTexImage")) == NULL) || r; + r = ((glLoadTransposeMatrixd = (PFNGLLOADTRANSPOSEMATRIXDPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixd")) == NULL) || r; + r = ((glLoadTransposeMatrixf = (PFNGLLOADTRANSPOSEMATRIXFPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixf")) == NULL) || r; + r = ((glMultTransposeMatrixd = (PFNGLMULTTRANSPOSEMATRIXDPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixd")) == NULL) || r; + r = ((glMultTransposeMatrixf = (PFNGLMULTTRANSPOSEMATRIXFPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixf")) == NULL) || r; + r = ((glMultiTexCoord1d = (PFNGLMULTITEXCOORD1DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1d")) == NULL) || r; + r = ((glMultiTexCoord1dv = (PFNGLMULTITEXCOORD1DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dv")) == NULL) || r; + r = ((glMultiTexCoord1f = (PFNGLMULTITEXCOORD1FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1f")) == NULL) || r; + r = ((glMultiTexCoord1fv = (PFNGLMULTITEXCOORD1FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fv")) == NULL) || r; + r = ((glMultiTexCoord1i = (PFNGLMULTITEXCOORD1IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1i")) == NULL) || r; + r = ((glMultiTexCoord1iv = (PFNGLMULTITEXCOORD1IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1iv")) == NULL) || r; + r = ((glMultiTexCoord1s = (PFNGLMULTITEXCOORD1SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1s")) == NULL) || r; + r = ((glMultiTexCoord1sv = (PFNGLMULTITEXCOORD1SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1sv")) == NULL) || r; + r = ((glMultiTexCoord2d = (PFNGLMULTITEXCOORD2DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2d")) == NULL) || r; + r = ((glMultiTexCoord2dv = (PFNGLMULTITEXCOORD2DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dv")) == NULL) || r; + r = ((glMultiTexCoord2f = (PFNGLMULTITEXCOORD2FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2f")) == NULL) || r; + r = ((glMultiTexCoord2fv = (PFNGLMULTITEXCOORD2FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fv")) == NULL) || r; + r = ((glMultiTexCoord2i = (PFNGLMULTITEXCOORD2IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2i")) == NULL) || r; + r = ((glMultiTexCoord2iv = (PFNGLMULTITEXCOORD2IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2iv")) == NULL) || r; + r = ((glMultiTexCoord2s = (PFNGLMULTITEXCOORD2SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2s")) == NULL) || r; + r = ((glMultiTexCoord2sv = (PFNGLMULTITEXCOORD2SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2sv")) == NULL) || r; + r = ((glMultiTexCoord3d = (PFNGLMULTITEXCOORD3DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3d")) == NULL) || r; + r = ((glMultiTexCoord3dv = (PFNGLMULTITEXCOORD3DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dv")) == NULL) || r; + r = ((glMultiTexCoord3f = (PFNGLMULTITEXCOORD3FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3f")) == NULL) || r; + r = ((glMultiTexCoord3fv = (PFNGLMULTITEXCOORD3FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fv")) == NULL) || r; + r = ((glMultiTexCoord3i = (PFNGLMULTITEXCOORD3IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3i")) == NULL) || r; + r = ((glMultiTexCoord3iv = (PFNGLMULTITEXCOORD3IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3iv")) == NULL) || r; + r = ((glMultiTexCoord3s = (PFNGLMULTITEXCOORD3SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3s")) == NULL) || r; + r = ((glMultiTexCoord3sv = (PFNGLMULTITEXCOORD3SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3sv")) == NULL) || r; + r = ((glMultiTexCoord4d = (PFNGLMULTITEXCOORD4DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4d")) == NULL) || r; + r = ((glMultiTexCoord4dv = (PFNGLMULTITEXCOORD4DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dv")) == NULL) || r; + r = ((glMultiTexCoord4f = (PFNGLMULTITEXCOORD4FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4f")) == NULL) || r; + r = ((glMultiTexCoord4fv = (PFNGLMULTITEXCOORD4FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fv")) == NULL) || r; + r = ((glMultiTexCoord4i = (PFNGLMULTITEXCOORD4IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4i")) == NULL) || r; + r = ((glMultiTexCoord4iv = (PFNGLMULTITEXCOORD4IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4iv")) == NULL) || r; + r = ((glMultiTexCoord4s = (PFNGLMULTITEXCOORD4SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4s")) == NULL) || r; + r = ((glMultiTexCoord4sv = (PFNGLMULTITEXCOORD4SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4sv")) == NULL) || r; + r = ((glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)glewGetProcAddress((const GLubyte*)"glSampleCoverage")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_1_3 */ + +#ifdef GL_VERSION_1_4 + +static GLboolean _glewInit_GL_VERSION_1_4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendColor = (PFNGLBLENDCOLORPROC)glewGetProcAddress((const GLubyte*)"glBlendColor")) == NULL) || r; + r = ((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)"glBlendEquation")) == NULL) || r; + r = ((glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparate")) == NULL) || r; + r = ((glFogCoordPointer = (PFNGLFOGCOORDPOINTERPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointer")) == NULL) || r; + r = ((glFogCoordd = (PFNGLFOGCOORDDPROC)glewGetProcAddress((const GLubyte*)"glFogCoordd")) == NULL) || r; + r = ((glFogCoorddv = (PFNGLFOGCOORDDVPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddv")) == NULL) || r; + r = ((glFogCoordf = (PFNGLFOGCOORDFPROC)glewGetProcAddress((const GLubyte*)"glFogCoordf")) == NULL) || r; + r = ((glFogCoordfv = (PFNGLFOGCOORDFVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfv")) == NULL) || r; + r = ((glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArrays")) == NULL) || r; + r = ((glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElements")) == NULL) || r; + r = ((glPointParameterf = (PFNGLPOINTPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glPointParameterf")) == NULL) || r; + r = ((glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfv")) == NULL) || r; + r = ((glSecondaryColor3b = (PFNGLSECONDARYCOLOR3BPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3b")) == NULL) || r; + r = ((glSecondaryColor3bv = (PFNGLSECONDARYCOLOR3BVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bv")) == NULL) || r; + r = ((glSecondaryColor3d = (PFNGLSECONDARYCOLOR3DPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3d")) == NULL) || r; + r = ((glSecondaryColor3dv = (PFNGLSECONDARYCOLOR3DVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dv")) == NULL) || r; + r = ((glSecondaryColor3f = (PFNGLSECONDARYCOLOR3FPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3f")) == NULL) || r; + r = ((glSecondaryColor3fv = (PFNGLSECONDARYCOLOR3FVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fv")) == NULL) || r; + r = ((glSecondaryColor3i = (PFNGLSECONDARYCOLOR3IPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3i")) == NULL) || r; + r = ((glSecondaryColor3iv = (PFNGLSECONDARYCOLOR3IVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3iv")) == NULL) || r; + r = ((glSecondaryColor3s = (PFNGLSECONDARYCOLOR3SPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3s")) == NULL) || r; + r = ((glSecondaryColor3sv = (PFNGLSECONDARYCOLOR3SVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3sv")) == NULL) || r; + r = ((glSecondaryColor3ub = (PFNGLSECONDARYCOLOR3UBPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ub")) == NULL) || r; + r = ((glSecondaryColor3ubv = (PFNGLSECONDARYCOLOR3UBVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubv")) == NULL) || r; + r = ((glSecondaryColor3ui = (PFNGLSECONDARYCOLOR3UIPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ui")) == NULL) || r; + r = ((glSecondaryColor3uiv = (PFNGLSECONDARYCOLOR3UIVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uiv")) == NULL) || r; + r = ((glSecondaryColor3us = (PFNGLSECONDARYCOLOR3USPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3us")) == NULL) || r; + r = ((glSecondaryColor3usv = (PFNGLSECONDARYCOLOR3USVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usv")) == NULL) || r; + r = ((glSecondaryColorPointer = (PFNGLSECONDARYCOLORPOINTERPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointer")) == NULL) || r; + r = ((glWindowPos2d = (PFNGLWINDOWPOS2DPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2d")) == NULL) || r; + r = ((glWindowPos2dv = (PFNGLWINDOWPOS2DVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dv")) == NULL) || r; + r = ((glWindowPos2f = (PFNGLWINDOWPOS2FPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2f")) == NULL) || r; + r = ((glWindowPos2fv = (PFNGLWINDOWPOS2FVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fv")) == NULL) || r; + r = ((glWindowPos2i = (PFNGLWINDOWPOS2IPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2i")) == NULL) || r; + r = ((glWindowPos2iv = (PFNGLWINDOWPOS2IVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iv")) == NULL) || r; + r = ((glWindowPos2s = (PFNGLWINDOWPOS2SPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2s")) == NULL) || r; + r = ((glWindowPos2sv = (PFNGLWINDOWPOS2SVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sv")) == NULL) || r; + r = ((glWindowPos3d = (PFNGLWINDOWPOS3DPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3d")) == NULL) || r; + r = ((glWindowPos3dv = (PFNGLWINDOWPOS3DVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dv")) == NULL) || r; + r = ((glWindowPos3f = (PFNGLWINDOWPOS3FPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3f")) == NULL) || r; + r = ((glWindowPos3fv = (PFNGLWINDOWPOS3FVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fv")) == NULL) || r; + r = ((glWindowPos3i = (PFNGLWINDOWPOS3IPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3i")) == NULL) || r; + r = ((glWindowPos3iv = (PFNGLWINDOWPOS3IVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iv")) == NULL) || r; + r = ((glWindowPos3s = (PFNGLWINDOWPOS3SPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3s")) == NULL) || r; + r = ((glWindowPos3sv = (PFNGLWINDOWPOS3SVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sv")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_1_4 */ + +#ifdef GL_VERSION_1_5 + +static GLboolean _glewInit_GL_VERSION_1_5 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginQuery = (PFNGLBEGINQUERYPROC)glewGetProcAddress((const GLubyte*)"glBeginQuery")) == NULL) || r; + r = ((glBindBuffer = (PFNGLBINDBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindBuffer")) == NULL) || r; + r = ((glBufferData = (PFNGLBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferData")) == NULL) || r; + r = ((glBufferSubData = (PFNGLBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferSubData")) == NULL) || r; + r = ((glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteBuffers")) == NULL) || r; + r = ((glDeleteQueries = (PFNGLDELETEQUERIESPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueries")) == NULL) || r; + r = ((glEndQuery = (PFNGLENDQUERYPROC)glewGetProcAddress((const GLubyte*)"glEndQuery")) == NULL) || r; + r = ((glGenBuffers = (PFNGLGENBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenBuffers")) == NULL) || r; + r = ((glGenQueries = (PFNGLGENQUERIESPROC)glewGetProcAddress((const GLubyte*)"glGenQueries")) == NULL) || r; + r = ((glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameteriv")) == NULL) || r; + r = ((glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferPointerv")) == NULL) || r; + r = ((glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glGetBufferSubData")) == NULL) || r; + r = ((glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectiv")) == NULL) || r; + r = ((glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuiv")) == NULL) || r; + r = ((glGetQueryiv = (PFNGLGETQUERYIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryiv")) == NULL) || r; + r = ((glIsBuffer = (PFNGLISBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsBuffer")) == NULL) || r; + r = ((glIsQuery = (PFNGLISQUERYPROC)glewGetProcAddress((const GLubyte*)"glIsQuery")) == NULL) || r; + r = ((glMapBuffer = (PFNGLMAPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glMapBuffer")) == NULL) || r; + r = ((glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glUnmapBuffer")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_1_5 */ + +#ifdef GL_VERSION_2_0 + +static GLboolean _glewInit_GL_VERSION_2_0 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAttachShader = (PFNGLATTACHSHADERPROC)glewGetProcAddress((const GLubyte*)"glAttachShader")) == NULL) || r; + r = ((glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glBindAttribLocation")) == NULL) || r; + r = ((glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparate")) == NULL) || r; + r = ((glCompileShader = (PFNGLCOMPILESHADERPROC)glewGetProcAddress((const GLubyte*)"glCompileShader")) == NULL) || r; + r = ((glCreateProgram = (PFNGLCREATEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glCreateProgram")) == NULL) || r; + r = ((glCreateShader = (PFNGLCREATESHADERPROC)glewGetProcAddress((const GLubyte*)"glCreateShader")) == NULL) || r; + r = ((glDeleteProgram = (PFNGLDELETEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgram")) == NULL) || r; + r = ((glDeleteShader = (PFNGLDELETESHADERPROC)glewGetProcAddress((const GLubyte*)"glDeleteShader")) == NULL) || r; + r = ((glDetachShader = (PFNGLDETACHSHADERPROC)glewGetProcAddress((const GLubyte*)"glDetachShader")) == NULL) || r; + r = ((glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribArray")) == NULL) || r; + r = ((glDrawBuffers = (PFNGLDRAWBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffers")) == NULL) || r; + r = ((glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribArray")) == NULL) || r; + r = ((glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAttrib")) == NULL) || r; + r = ((glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniform")) == NULL) || r; + r = ((glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)glewGetProcAddress((const GLubyte*)"glGetAttachedShaders")) == NULL) || r; + r = ((glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetAttribLocation")) == NULL) || r; + r = ((glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetProgramInfoLog")) == NULL) || r; + r = ((glGetProgramiv = (PFNGLGETPROGRAMIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramiv")) == NULL) || r; + r = ((glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetShaderInfoLog")) == NULL) || r; + r = ((glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)glewGetProcAddress((const GLubyte*)"glGetShaderSource")) == NULL) || r; + r = ((glGetShaderiv = (PFNGLGETSHADERIVPROC)glewGetProcAddress((const GLubyte*)"glGetShaderiv")) == NULL) || r; + r = ((glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetUniformLocation")) == NULL) || r; + r = ((glGetUniformfv = (PFNGLGETUNIFORMFVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformfv")) == NULL) || r; + r = ((glGetUniformiv = (PFNGLGETUNIFORMIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformiv")) == NULL) || r; + r = ((glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointerv")) == NULL) || r; + r = ((glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdv")) == NULL) || r; + r = ((glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfv")) == NULL) || r; + r = ((glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribiv")) == NULL) || r; + r = ((glIsProgram = (PFNGLISPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glIsProgram")) == NULL) || r; + r = ((glIsShader = (PFNGLISSHADERPROC)glewGetProcAddress((const GLubyte*)"glIsShader")) == NULL) || r; + r = ((glLinkProgram = (PFNGLLINKPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glLinkProgram")) == NULL) || r; + r = ((glShaderSource = (PFNGLSHADERSOURCEPROC)glewGetProcAddress((const GLubyte*)"glShaderSource")) == NULL) || r; + r = ((glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilFuncSeparate")) == NULL) || r; + r = ((glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilMaskSeparate")) == NULL) || r; + r = ((glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilOpSeparate")) == NULL) || r; + r = ((glUniform1f = (PFNGLUNIFORM1FPROC)glewGetProcAddress((const GLubyte*)"glUniform1f")) == NULL) || r; + r = ((glUniform1fv = (PFNGLUNIFORM1FVPROC)glewGetProcAddress((const GLubyte*)"glUniform1fv")) == NULL) || r; + r = ((glUniform1i = (PFNGLUNIFORM1IPROC)glewGetProcAddress((const GLubyte*)"glUniform1i")) == NULL) || r; + r = ((glUniform1iv = (PFNGLUNIFORM1IVPROC)glewGetProcAddress((const GLubyte*)"glUniform1iv")) == NULL) || r; + r = ((glUniform2f = (PFNGLUNIFORM2FPROC)glewGetProcAddress((const GLubyte*)"glUniform2f")) == NULL) || r; + r = ((glUniform2fv = (PFNGLUNIFORM2FVPROC)glewGetProcAddress((const GLubyte*)"glUniform2fv")) == NULL) || r; + r = ((glUniform2i = (PFNGLUNIFORM2IPROC)glewGetProcAddress((const GLubyte*)"glUniform2i")) == NULL) || r; + r = ((glUniform2iv = (PFNGLUNIFORM2IVPROC)glewGetProcAddress((const GLubyte*)"glUniform2iv")) == NULL) || r; + r = ((glUniform3f = (PFNGLUNIFORM3FPROC)glewGetProcAddress((const GLubyte*)"glUniform3f")) == NULL) || r; + r = ((glUniform3fv = (PFNGLUNIFORM3FVPROC)glewGetProcAddress((const GLubyte*)"glUniform3fv")) == NULL) || r; + r = ((glUniform3i = (PFNGLUNIFORM3IPROC)glewGetProcAddress((const GLubyte*)"glUniform3i")) == NULL) || r; + r = ((glUniform3iv = (PFNGLUNIFORM3IVPROC)glewGetProcAddress((const GLubyte*)"glUniform3iv")) == NULL) || r; + r = ((glUniform4f = (PFNGLUNIFORM4FPROC)glewGetProcAddress((const GLubyte*)"glUniform4f")) == NULL) || r; + r = ((glUniform4fv = (PFNGLUNIFORM4FVPROC)glewGetProcAddress((const GLubyte*)"glUniform4fv")) == NULL) || r; + r = ((glUniform4i = (PFNGLUNIFORM4IPROC)glewGetProcAddress((const GLubyte*)"glUniform4i")) == NULL) || r; + r = ((glUniform4iv = (PFNGLUNIFORM4IVPROC)glewGetProcAddress((const GLubyte*)"glUniform4iv")) == NULL) || r; + r = ((glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2fv")) == NULL) || r; + r = ((glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3fv")) == NULL) || r; + r = ((glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4fv")) == NULL) || r; + r = ((glUseProgram = (PFNGLUSEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glUseProgram")) == NULL) || r; + r = ((glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glValidateProgram")) == NULL) || r; + r = ((glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1d")) == NULL) || r; + r = ((glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dv")) == NULL) || r; + r = ((glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1f")) == NULL) || r; + r = ((glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fv")) == NULL) || r; + r = ((glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1s")) == NULL) || r; + r = ((glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sv")) == NULL) || r; + r = ((glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2d")) == NULL) || r; + r = ((glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dv")) == NULL) || r; + r = ((glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2f")) == NULL) || r; + r = ((glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fv")) == NULL) || r; + r = ((glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2s")) == NULL) || r; + r = ((glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sv")) == NULL) || r; + r = ((glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3d")) == NULL) || r; + r = ((glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dv")) == NULL) || r; + r = ((glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3f")) == NULL) || r; + r = ((glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fv")) == NULL) || r; + r = ((glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3s")) == NULL) || r; + r = ((glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sv")) == NULL) || r; + r = ((glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nbv")) == NULL) || r; + r = ((glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Niv")) == NULL) || r; + r = ((glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nsv")) == NULL) || r; + r = ((glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nub")) == NULL) || r; + r = ((glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nubv")) == NULL) || r; + r = ((glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nuiv")) == NULL) || r; + r = ((glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nusv")) == NULL) || r; + r = ((glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4bv")) == NULL) || r; + r = ((glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4d")) == NULL) || r; + r = ((glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dv")) == NULL) || r; + r = ((glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4f")) == NULL) || r; + r = ((glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fv")) == NULL) || r; + r = ((glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4iv")) == NULL) || r; + r = ((glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4s")) == NULL) || r; + r = ((glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sv")) == NULL) || r; + r = ((glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubv")) == NULL) || r; + r = ((glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4uiv")) == NULL) || r; + r = ((glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4usv")) == NULL) || r; + r = ((glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointer")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_2_0 */ + +#ifdef GL_3DFX_multisample + +#endif /* GL_3DFX_multisample */ + +#ifdef GL_3DFX_tbuffer + +static GLboolean _glewInit_GL_3DFX_tbuffer (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTbufferMask3DFX = (PFNGLTBUFFERMASK3DFXPROC)glewGetProcAddress((const GLubyte*)"glTbufferMask3DFX")) == NULL) || r; + + return r; +} + +#endif /* GL_3DFX_tbuffer */ + +#ifdef GL_3DFX_texture_compression_FXT1 + +#endif /* GL_3DFX_texture_compression_FXT1 */ + +#ifdef GL_APPLE_client_storage + +#endif /* GL_APPLE_client_storage */ + +#ifdef GL_APPLE_element_array + +static GLboolean _glewInit_GL_APPLE_element_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawElementArrayAPPLE = (PFNGLDRAWELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementArrayAPPLE")) == NULL) || r; + r = ((glDrawRangeElementArrayAPPLE = (PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementArrayAPPLE")) == NULL) || r; + r = ((glElementPointerAPPLE = (PFNGLELEMENTPOINTERAPPLEPROC)glewGetProcAddress((const GLubyte*)"glElementPointerAPPLE")) == NULL) || r; + r = ((glMultiDrawElementArrayAPPLE = (PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementArrayAPPLE")) == NULL) || r; + r = ((glMultiDrawRangeElementArrayAPPLE = (PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawRangeElementArrayAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_element_array */ + +#ifdef GL_APPLE_fence + +static GLboolean _glewInit_GL_APPLE_fence (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDeleteFencesAPPLE = (PFNGLDELETEFENCESAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteFencesAPPLE")) == NULL) || r; + r = ((glFinishFenceAPPLE = (PFNGLFINISHFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFinishFenceAPPLE")) == NULL) || r; + r = ((glFinishObjectAPPLE = (PFNGLFINISHOBJECTAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFinishObjectAPPLE")) == NULL) || r; + r = ((glGenFencesAPPLE = (PFNGLGENFENCESAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGenFencesAPPLE")) == NULL) || r; + r = ((glIsFenceAPPLE = (PFNGLISFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsFenceAPPLE")) == NULL) || r; + r = ((glSetFenceAPPLE = (PFNGLSETFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glSetFenceAPPLE")) == NULL) || r; + r = ((glTestFenceAPPLE = (PFNGLTESTFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTestFenceAPPLE")) == NULL) || r; + r = ((glTestObjectAPPLE = (PFNGLTESTOBJECTAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTestObjectAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_fence */ + +#ifdef GL_APPLE_float_pixels + +#endif /* GL_APPLE_float_pixels */ + +#ifdef GL_APPLE_pixel_buffer + +#endif /* GL_APPLE_pixel_buffer */ + +#ifdef GL_APPLE_specular_vector + +#endif /* GL_APPLE_specular_vector */ + +#ifdef GL_APPLE_texture_range + +static GLboolean _glewInit_GL_APPLE_texture_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetTexParameterPointervAPPLE = (PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterPointervAPPLE")) == NULL) || r; + r = ((glTextureRangeAPPLE = (PFNGLTEXTURERANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTextureRangeAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_texture_range */ + +#ifdef GL_APPLE_transform_hint + +#endif /* GL_APPLE_transform_hint */ + +#ifdef GL_APPLE_vertex_array_object + +static GLboolean _glewInit_GL_APPLE_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindVertexArrayAPPLE = (PFNGLBINDVERTEXARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glBindVertexArrayAPPLE")) == NULL) || r; + r = ((glDeleteVertexArraysAPPLE = (PFNGLDELETEVERTEXARRAYSAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexArraysAPPLE")) == NULL) || r; + r = ((glGenVertexArraysAPPLE = (PFNGLGENVERTEXARRAYSAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGenVertexArraysAPPLE")) == NULL) || r; + r = ((glIsVertexArrayAPPLE = (PFNGLISVERTEXARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsVertexArrayAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_vertex_array_object */ + +#ifdef GL_APPLE_vertex_array_range + +static GLboolean _glewInit_GL_APPLE_vertex_array_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFlushVertexArrayRangeAPPLE = (PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFlushVertexArrayRangeAPPLE")) == NULL) || r; + r = ((glVertexArrayParameteriAPPLE = (PFNGLVERTEXARRAYPARAMETERIAPPLEPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayParameteriAPPLE")) == NULL) || r; + r = ((glVertexArrayRangeAPPLE = (PFNGLVERTEXARRAYRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayRangeAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_vertex_array_range */ + +#ifdef GL_APPLE_ycbcr_422 + +#endif /* GL_APPLE_ycbcr_422 */ + +#ifdef GL_ARB_color_buffer_float + +static GLboolean _glewInit_GL_ARB_color_buffer_float (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClampColorARB = (PFNGLCLAMPCOLORARBPROC)glewGetProcAddress((const GLubyte*)"glClampColorARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_color_buffer_float */ + +#ifdef GL_ARB_depth_texture + +#endif /* GL_ARB_depth_texture */ + +#ifdef GL_ARB_draw_buffers + +static GLboolean _glewInit_GL_ARB_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawBuffersARB = (PFNGLDRAWBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_draw_buffers */ + +#ifdef GL_ARB_fragment_program + +#endif /* GL_ARB_fragment_program */ + +#ifdef GL_ARB_fragment_program_shadow + +#endif /* GL_ARB_fragment_program_shadow */ + +#ifdef GL_ARB_fragment_shader + +#endif /* GL_ARB_fragment_shader */ + +#ifdef GL_ARB_half_float_pixel + +#endif /* GL_ARB_half_float_pixel */ + +#ifdef GL_ARB_imaging + +static GLboolean _glewInit_GL_ARB_imaging (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)"glBlendEquation")) == NULL) || r; + r = ((glColorSubTable = (PFNGLCOLORSUBTABLEPROC)glewGetProcAddress((const GLubyte*)"glColorSubTable")) == NULL) || r; + r = ((glColorTable = (PFNGLCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glColorTable")) == NULL) || r; + r = ((glColorTableParameterfv = (PFNGLCOLORTABLEPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterfv")) == NULL) || r; + r = ((glColorTableParameteriv = (PFNGLCOLORTABLEPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameteriv")) == NULL) || r; + r = ((glConvolutionFilter1D = (PFNGLCONVOLUTIONFILTER1DPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter1D")) == NULL) || r; + r = ((glConvolutionFilter2D = (PFNGLCONVOLUTIONFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter2D")) == NULL) || r; + r = ((glConvolutionParameterf = (PFNGLCONVOLUTIONPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterf")) == NULL) || r; + r = ((glConvolutionParameterfv = (PFNGLCONVOLUTIONPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfv")) == NULL) || r; + r = ((glConvolutionParameteri = (PFNGLCONVOLUTIONPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteri")) == NULL) || r; + r = ((glConvolutionParameteriv = (PFNGLCONVOLUTIONPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteriv")) == NULL) || r; + r = ((glCopyColorSubTable = (PFNGLCOPYCOLORSUBTABLEPROC)glewGetProcAddress((const GLubyte*)"glCopyColorSubTable")) == NULL) || r; + r = ((glCopyColorTable = (PFNGLCOPYCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glCopyColorTable")) == NULL) || r; + r = ((glCopyConvolutionFilter1D = (PFNGLCOPYCONVOLUTIONFILTER1DPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter1D")) == NULL) || r; + r = ((glCopyConvolutionFilter2D = (PFNGLCOPYCONVOLUTIONFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter2D")) == NULL) || r; + r = ((glGetColorTable = (PFNGLGETCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glGetColorTable")) == NULL) || r; + r = ((glGetColorTableParameterfv = (PFNGLGETCOLORTABLEPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfv")) == NULL) || r; + r = ((glGetColorTableParameteriv = (PFNGLGETCOLORTABLEPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameteriv")) == NULL) || r; + r = ((glGetConvolutionFilter = (PFNGLGETCONVOLUTIONFILTERPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionFilter")) == NULL) || r; + r = ((glGetConvolutionParameterfv = (PFNGLGETCONVOLUTIONPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterfv")) == NULL) || r; + r = ((glGetConvolutionParameteriv = (PFNGLGETCONVOLUTIONPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameteriv")) == NULL) || r; + r = ((glGetHistogram = (PFNGLGETHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glGetHistogram")) == NULL) || r; + r = ((glGetHistogramParameterfv = (PFNGLGETHISTOGRAMPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterfv")) == NULL) || r; + r = ((glGetHistogramParameteriv = (PFNGLGETHISTOGRAMPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameteriv")) == NULL) || r; + r = ((glGetMinmax = (PFNGLGETMINMAXPROC)glewGetProcAddress((const GLubyte*)"glGetMinmax")) == NULL) || r; + r = ((glGetMinmaxParameterfv = (PFNGLGETMINMAXPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterfv")) == NULL) || r; + r = ((glGetMinmaxParameteriv = (PFNGLGETMINMAXPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameteriv")) == NULL) || r; + r = ((glGetSeparableFilter = (PFNGLGETSEPARABLEFILTERPROC)glewGetProcAddress((const GLubyte*)"glGetSeparableFilter")) == NULL) || r; + r = ((glHistogram = (PFNGLHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glHistogram")) == NULL) || r; + r = ((glMinmax = (PFNGLMINMAXPROC)glewGetProcAddress((const GLubyte*)"glMinmax")) == NULL) || r; + r = ((glResetHistogram = (PFNGLRESETHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glResetHistogram")) == NULL) || r; + r = ((glResetMinmax = (PFNGLRESETMINMAXPROC)glewGetProcAddress((const GLubyte*)"glResetMinmax")) == NULL) || r; + r = ((glSeparableFilter2D = (PFNGLSEPARABLEFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glSeparableFilter2D")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_imaging */ + +#ifdef GL_ARB_matrix_palette + +static GLboolean _glewInit_GL_ARB_matrix_palette (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCurrentPaletteMatrixARB = (PFNGLCURRENTPALETTEMATRIXARBPROC)glewGetProcAddress((const GLubyte*)"glCurrentPaletteMatrixARB")) == NULL) || r; + r = ((glMatrixIndexPointerARB = (PFNGLMATRIXINDEXPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexPointerARB")) == NULL) || r; + r = ((glMatrixIndexubvARB = (PFNGLMATRIXINDEXUBVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexubvARB")) == NULL) || r; + r = ((glMatrixIndexuivARB = (PFNGLMATRIXINDEXUIVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexuivARB")) == NULL) || r; + r = ((glMatrixIndexusvARB = (PFNGLMATRIXINDEXUSVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexusvARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_matrix_palette */ + +#ifdef GL_ARB_multisample + +static GLboolean _glewInit_GL_ARB_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSampleCoverageARB = (PFNGLSAMPLECOVERAGEARBPROC)glewGetProcAddress((const GLubyte*)"glSampleCoverageARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_multisample */ + +#ifdef GL_ARB_multitexture + +static GLboolean _glewInit_GL_ARB_multitexture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glActiveTextureARB")) == NULL) || r; + r = ((glClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glClientActiveTextureARB")) == NULL) || r; + r = ((glMultiTexCoord1dARB = (PFNGLMULTITEXCOORD1DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dARB")) == NULL) || r; + r = ((glMultiTexCoord1dvARB = (PFNGLMULTITEXCOORD1DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dvARB")) == NULL) || r; + r = ((glMultiTexCoord1fARB = (PFNGLMULTITEXCOORD1FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fARB")) == NULL) || r; + r = ((glMultiTexCoord1fvARB = (PFNGLMULTITEXCOORD1FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fvARB")) == NULL) || r; + r = ((glMultiTexCoord1iARB = (PFNGLMULTITEXCOORD1IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1iARB")) == NULL) || r; + r = ((glMultiTexCoord1ivARB = (PFNGLMULTITEXCOORD1IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1ivARB")) == NULL) || r; + r = ((glMultiTexCoord1sARB = (PFNGLMULTITEXCOORD1SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1sARB")) == NULL) || r; + r = ((glMultiTexCoord1svARB = (PFNGLMULTITEXCOORD1SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1svARB")) == NULL) || r; + r = ((glMultiTexCoord2dARB = (PFNGLMULTITEXCOORD2DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dARB")) == NULL) || r; + r = ((glMultiTexCoord2dvARB = (PFNGLMULTITEXCOORD2DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dvARB")) == NULL) || r; + r = ((glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fARB")) == NULL) || r; + r = ((glMultiTexCoord2fvARB = (PFNGLMULTITEXCOORD2FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fvARB")) == NULL) || r; + r = ((glMultiTexCoord2iARB = (PFNGLMULTITEXCOORD2IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2iARB")) == NULL) || r; + r = ((glMultiTexCoord2ivARB = (PFNGLMULTITEXCOORD2IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2ivARB")) == NULL) || r; + r = ((glMultiTexCoord2sARB = (PFNGLMULTITEXCOORD2SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2sARB")) == NULL) || r; + r = ((glMultiTexCoord2svARB = (PFNGLMULTITEXCOORD2SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2svARB")) == NULL) || r; + r = ((glMultiTexCoord3dARB = (PFNGLMULTITEXCOORD3DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dARB")) == NULL) || r; + r = ((glMultiTexCoord3dvARB = (PFNGLMULTITEXCOORD3DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dvARB")) == NULL) || r; + r = ((glMultiTexCoord3fARB = (PFNGLMULTITEXCOORD3FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fARB")) == NULL) || r; + r = ((glMultiTexCoord3fvARB = (PFNGLMULTITEXCOORD3FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fvARB")) == NULL) || r; + r = ((glMultiTexCoord3iARB = (PFNGLMULTITEXCOORD3IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3iARB")) == NULL) || r; + r = ((glMultiTexCoord3ivARB = (PFNGLMULTITEXCOORD3IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3ivARB")) == NULL) || r; + r = ((glMultiTexCoord3sARB = (PFNGLMULTITEXCOORD3SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3sARB")) == NULL) || r; + r = ((glMultiTexCoord3svARB = (PFNGLMULTITEXCOORD3SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3svARB")) == NULL) || r; + r = ((glMultiTexCoord4dARB = (PFNGLMULTITEXCOORD4DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dARB")) == NULL) || r; + r = ((glMultiTexCoord4dvARB = (PFNGLMULTITEXCOORD4DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dvARB")) == NULL) || r; + r = ((glMultiTexCoord4fARB = (PFNGLMULTITEXCOORD4FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fARB")) == NULL) || r; + r = ((glMultiTexCoord4fvARB = (PFNGLMULTITEXCOORD4FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fvARB")) == NULL) || r; + r = ((glMultiTexCoord4iARB = (PFNGLMULTITEXCOORD4IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4iARB")) == NULL) || r; + r = ((glMultiTexCoord4ivARB = (PFNGLMULTITEXCOORD4IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4ivARB")) == NULL) || r; + r = ((glMultiTexCoord4sARB = (PFNGLMULTITEXCOORD4SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4sARB")) == NULL) || r; + r = ((glMultiTexCoord4svARB = (PFNGLMULTITEXCOORD4SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4svARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_multitexture */ + +#ifdef GL_ARB_occlusion_query + +static GLboolean _glewInit_GL_ARB_occlusion_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginQueryARB = (PFNGLBEGINQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryARB")) == NULL) || r; + r = ((glDeleteQueriesARB = (PFNGLDELETEQUERIESARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueriesARB")) == NULL) || r; + r = ((glEndQueryARB = (PFNGLENDQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glEndQueryARB")) == NULL) || r; + r = ((glGenQueriesARB = (PFNGLGENQUERIESARBPROC)glewGetProcAddress((const GLubyte*)"glGenQueriesARB")) == NULL) || r; + r = ((glGetQueryObjectivARB = (PFNGLGETQUERYOBJECTIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectivARB")) == NULL) || r; + r = ((glGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuivARB")) == NULL) || r; + r = ((glGetQueryivARB = (PFNGLGETQUERYIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryivARB")) == NULL) || r; + r = ((glIsQueryARB = (PFNGLISQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glIsQueryARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_occlusion_query */ + +#ifdef GL_ARB_pixel_buffer_object + +#endif /* GL_ARB_pixel_buffer_object */ + +#ifdef GL_ARB_point_parameters + +static GLboolean _glewInit_GL_ARB_point_parameters (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPointParameterfARB = (PFNGLPOINTPARAMETERFARBPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfARB")) == NULL) || r; + r = ((glPointParameterfvARB = (PFNGLPOINTPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfvARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_point_parameters */ + +#ifdef GL_ARB_point_sprite + +#endif /* GL_ARB_point_sprite */ + +#ifdef GL_ARB_shader_objects + +static GLboolean _glewInit_GL_ARB_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glAttachObjectARB")) == NULL) || r; + r = ((glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)glewGetProcAddress((const GLubyte*)"glCompileShaderARB")) == NULL) || r; + r = ((glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateProgramObjectARB")) == NULL) || r; + r = ((glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderObjectARB")) == NULL) || r; + r = ((glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteObjectARB")) == NULL) || r; + r = ((glDetachObjectARB = (PFNGLDETACHOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glDetachObjectARB")) == NULL) || r; + r = ((glGetActiveUniformARB = (PFNGLGETACTIVEUNIFORMARBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformARB")) == NULL) || r; + r = ((glGetAttachedObjectsARB = (PFNGLGETATTACHEDOBJECTSARBPROC)glewGetProcAddress((const GLubyte*)"glGetAttachedObjectsARB")) == NULL) || r; + r = ((glGetHandleARB = (PFNGLGETHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetHandleARB")) == NULL) || r; + r = ((glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)glewGetProcAddress((const GLubyte*)"glGetInfoLogARB")) == NULL) || r; + r = ((glGetObjectParameterfvARB = (PFNGLGETOBJECTPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterfvARB")) == NULL) || r; + r = ((glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterivARB")) == NULL) || r; + r = ((glGetShaderSourceARB = (PFNGLGETSHADERSOURCEARBPROC)glewGetProcAddress((const GLubyte*)"glGetShaderSourceARB")) == NULL) || r; + r = ((glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformLocationARB")) == NULL) || r; + r = ((glGetUniformfvARB = (PFNGLGETUNIFORMFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformfvARB")) == NULL) || r; + r = ((glGetUniformivARB = (PFNGLGETUNIFORMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformivARB")) == NULL) || r; + r = ((glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glLinkProgramARB")) == NULL) || r; + r = ((glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)glewGetProcAddress((const GLubyte*)"glShaderSourceARB")) == NULL) || r; + r = ((glUniform1fARB = (PFNGLUNIFORM1FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1fARB")) == NULL) || r; + r = ((glUniform1fvARB = (PFNGLUNIFORM1FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1fvARB")) == NULL) || r; + r = ((glUniform1iARB = (PFNGLUNIFORM1IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1iARB")) == NULL) || r; + r = ((glUniform1ivARB = (PFNGLUNIFORM1IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1ivARB")) == NULL) || r; + r = ((glUniform2fARB = (PFNGLUNIFORM2FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2fARB")) == NULL) || r; + r = ((glUniform2fvARB = (PFNGLUNIFORM2FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2fvARB")) == NULL) || r; + r = ((glUniform2iARB = (PFNGLUNIFORM2IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2iARB")) == NULL) || r; + r = ((glUniform2ivARB = (PFNGLUNIFORM2IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2ivARB")) == NULL) || r; + r = ((glUniform3fARB = (PFNGLUNIFORM3FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3fARB")) == NULL) || r; + r = ((glUniform3fvARB = (PFNGLUNIFORM3FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3fvARB")) == NULL) || r; + r = ((glUniform3iARB = (PFNGLUNIFORM3IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3iARB")) == NULL) || r; + r = ((glUniform3ivARB = (PFNGLUNIFORM3IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3ivARB")) == NULL) || r; + r = ((glUniform4fARB = (PFNGLUNIFORM4FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4fARB")) == NULL) || r; + r = ((glUniform4fvARB = (PFNGLUNIFORM4FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4fvARB")) == NULL) || r; + r = ((glUniform4iARB = (PFNGLUNIFORM4IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4iARB")) == NULL) || r; + r = ((glUniform4ivARB = (PFNGLUNIFORM4IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4ivARB")) == NULL) || r; + r = ((glUniformMatrix2fvARB = (PFNGLUNIFORMMATRIX2FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2fvARB")) == NULL) || r; + r = ((glUniformMatrix3fvARB = (PFNGLUNIFORMMATRIX3FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3fvARB")) == NULL) || r; + r = ((glUniformMatrix4fvARB = (PFNGLUNIFORMMATRIX4FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4fvARB")) == NULL) || r; + r = ((glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glUseProgramObjectARB")) == NULL) || r; + r = ((glValidateProgramARB = (PFNGLVALIDATEPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glValidateProgramARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_objects */ + +#ifdef GL_ARB_shading_language_100 + +#endif /* GL_ARB_shading_language_100 */ + +#ifdef GL_ARB_shadow + +#endif /* GL_ARB_shadow */ + +#ifdef GL_ARB_shadow_ambient + +#endif /* GL_ARB_shadow_ambient */ + +#ifdef GL_ARB_texture_border_clamp + +#endif /* GL_ARB_texture_border_clamp */ + +#ifdef GL_ARB_texture_compression + +static GLboolean _glewInit_GL_ARB_texture_compression (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCompressedTexImage1DARB = (PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage1DARB")) == NULL) || r; + r = ((glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage2DARB")) == NULL) || r; + r = ((glCompressedTexImage3DARB = (PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage3DARB")) == NULL) || r; + r = ((glCompressedTexSubImage1DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage1DARB")) == NULL) || r; + r = ((glCompressedTexSubImage2DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage2DARB")) == NULL) || r; + r = ((glCompressedTexSubImage3DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage3DARB")) == NULL) || r; + r = ((glGetCompressedTexImageARB = (PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTexImageARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_compression */ + +#ifdef GL_ARB_texture_cube_map + +#endif /* GL_ARB_texture_cube_map */ + +#ifdef GL_ARB_texture_env_add + +#endif /* GL_ARB_texture_env_add */ + +#ifdef GL_ARB_texture_env_combine + +#endif /* GL_ARB_texture_env_combine */ + +#ifdef GL_ARB_texture_env_crossbar + +#endif /* GL_ARB_texture_env_crossbar */ + +#ifdef GL_ARB_texture_env_dot3 + +#endif /* GL_ARB_texture_env_dot3 */ + +#ifdef GL_ARB_texture_float + +#endif /* GL_ARB_texture_float */ + +#ifdef GL_ARB_texture_mirrored_repeat + +#endif /* GL_ARB_texture_mirrored_repeat */ + +#ifdef GL_ARB_texture_non_power_of_two + +#endif /* GL_ARB_texture_non_power_of_two */ + +#ifdef GL_ARB_texture_rectangle + +#endif /* GL_ARB_texture_rectangle */ + +#ifdef GL_ARB_transpose_matrix + +static GLboolean _glewInit_GL_ARB_transpose_matrix (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glLoadTransposeMatrixdARB = (PFNGLLOADTRANSPOSEMATRIXDARBPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixdARB")) == NULL) || r; + r = ((glLoadTransposeMatrixfARB = (PFNGLLOADTRANSPOSEMATRIXFARBPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixfARB")) == NULL) || r; + r = ((glMultTransposeMatrixdARB = (PFNGLMULTTRANSPOSEMATRIXDARBPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixdARB")) == NULL) || r; + r = ((glMultTransposeMatrixfARB = (PFNGLMULTTRANSPOSEMATRIXFARBPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixfARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_transpose_matrix */ + +#ifdef GL_ARB_vertex_blend + +static GLboolean _glewInit_GL_ARB_vertex_blend (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glVertexBlendARB = (PFNGLVERTEXBLENDARBPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendARB")) == NULL) || r; + r = ((glWeightPointerARB = (PFNGLWEIGHTPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glWeightPointerARB")) == NULL) || r; + r = ((glWeightbvARB = (PFNGLWEIGHTBVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightbvARB")) == NULL) || r; + r = ((glWeightdvARB = (PFNGLWEIGHTDVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightdvARB")) == NULL) || r; + r = ((glWeightfvARB = (PFNGLWEIGHTFVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightfvARB")) == NULL) || r; + r = ((glWeightivARB = (PFNGLWEIGHTIVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightivARB")) == NULL) || r; + r = ((glWeightsvARB = (PFNGLWEIGHTSVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightsvARB")) == NULL) || r; + r = ((glWeightubvARB = (PFNGLWEIGHTUBVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightubvARB")) == NULL) || r; + r = ((glWeightuivARB = (PFNGLWEIGHTUIVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightuivARB")) == NULL) || r; + r = ((glWeightusvARB = (PFNGLWEIGHTUSVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightusvARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_blend */ + +#ifdef GL_ARB_vertex_buffer_object + +static GLboolean _glewInit_GL_ARB_vertex_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindBufferARB = (PFNGLBINDBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glBindBufferARB")) == NULL) || r; + r = ((glBufferDataARB = (PFNGLBUFFERDATAARBPROC)glewGetProcAddress((const GLubyte*)"glBufferDataARB")) == NULL) || r; + r = ((glBufferSubDataARB = (PFNGLBUFFERSUBDATAARBPROC)glewGetProcAddress((const GLubyte*)"glBufferSubDataARB")) == NULL) || r; + r = ((glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteBuffersARB")) == NULL) || r; + r = ((glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glGenBuffersARB")) == NULL) || r; + r = ((glGetBufferParameterivARB = (PFNGLGETBUFFERPARAMETERIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameterivARB")) == NULL) || r; + r = ((glGetBufferPointervARB = (PFNGLGETBUFFERPOINTERVARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferPointervARB")) == NULL) || r; + r = ((glGetBufferSubDataARB = (PFNGLGETBUFFERSUBDATAARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferSubDataARB")) == NULL) || r; + r = ((glIsBufferARB = (PFNGLISBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glIsBufferARB")) == NULL) || r; + r = ((glMapBufferARB = (PFNGLMAPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glMapBufferARB")) == NULL) || r; + r = ((glUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glUnmapBufferARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_buffer_object */ + +#ifdef GL_ARB_vertex_program + +static GLboolean _glewInit_GL_ARB_vertex_program (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glBindProgramARB")) == NULL) || r; + r = ((glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramsARB")) == NULL) || r; + r = ((glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribArrayARB")) == NULL) || r; + r = ((glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribArrayARB")) == NULL) || r; + r = ((glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)glewGetProcAddress((const GLubyte*)"glGenProgramsARB")) == NULL) || r; + r = ((glGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramEnvParameterdvARB")) == NULL) || r; + r = ((glGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramEnvParameterfvARB")) == NULL) || r; + r = ((glGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramLocalParameterdvARB")) == NULL) || r; + r = ((glGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramLocalParameterfvARB")) == NULL) || r; + r = ((glGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStringARB")) == NULL) || r; + r = ((glGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramivARB")) == NULL) || r; + r = ((glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointervARB")) == NULL) || r; + r = ((glGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdvARB")) == NULL) || r; + r = ((glGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfvARB")) == NULL) || r; + r = ((glGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribivARB")) == NULL) || r; + r = ((glIsProgramARB = (PFNGLISPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glIsProgramARB")) == NULL) || r; + r = ((glProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4dARB")) == NULL) || r; + r = ((glProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4dvARB")) == NULL) || r; + r = ((glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4fARB")) == NULL) || r; + r = ((glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4fvARB")) == NULL) || r; + r = ((glProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4dARB")) == NULL) || r; + r = ((glProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4dvARB")) == NULL) || r; + r = ((glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4fARB")) == NULL) || r; + r = ((glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4fvARB")) == NULL) || r; + r = ((glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glProgramStringARB")) == NULL) || r; + r = ((glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dARB")) == NULL) || r; + r = ((glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dvARB")) == NULL) || r; + r = ((glVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fARB")) == NULL) || r; + r = ((glVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fvARB")) == NULL) || r; + r = ((glVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sARB")) == NULL) || r; + r = ((glVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1svARB")) == NULL) || r; + r = ((glVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dARB")) == NULL) || r; + r = ((glVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dvARB")) == NULL) || r; + r = ((glVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fARB")) == NULL) || r; + r = ((glVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fvARB")) == NULL) || r; + r = ((glVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sARB")) == NULL) || r; + r = ((glVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2svARB")) == NULL) || r; + r = ((glVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dARB")) == NULL) || r; + r = ((glVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dvARB")) == NULL) || r; + r = ((glVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fARB")) == NULL) || r; + r = ((glVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fvARB")) == NULL) || r; + r = ((glVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sARB")) == NULL) || r; + r = ((glVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3svARB")) == NULL) || r; + r = ((glVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NbvARB")) == NULL) || r; + r = ((glVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NivARB")) == NULL) || r; + r = ((glVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NsvARB")) == NULL) || r; + r = ((glVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NubARB")) == NULL) || r; + r = ((glVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NubvARB")) == NULL) || r; + r = ((glVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NuivARB")) == NULL) || r; + r = ((glVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NusvARB")) == NULL) || r; + r = ((glVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4bvARB")) == NULL) || r; + r = ((glVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dARB")) == NULL) || r; + r = ((glVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dvARB")) == NULL) || r; + r = ((glVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fARB")) == NULL) || r; + r = ((glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fvARB")) == NULL) || r; + r = ((glVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ivARB")) == NULL) || r; + r = ((glVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sARB")) == NULL) || r; + r = ((glVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4svARB")) == NULL) || r; + r = ((glVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubvARB")) == NULL) || r; + r = ((glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4uivARB")) == NULL) || r; + r = ((glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4usvARB")) == NULL) || r; + r = ((glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointerARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_program */ + +#ifdef GL_ARB_vertex_shader + +static GLboolean _glewInit_GL_ARB_vertex_shader (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glBindAttribLocationARB")) == NULL) || r; + r = ((glGetActiveAttribARB = (PFNGLGETACTIVEATTRIBARBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAttribARB")) == NULL) || r; + r = ((glGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glGetAttribLocationARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_shader */ + +#ifdef GL_ARB_window_pos + +static GLboolean _glewInit_GL_ARB_window_pos (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glWindowPos2dARB = (PFNGLWINDOWPOS2DARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dARB")) == NULL) || r; + r = ((glWindowPos2dvARB = (PFNGLWINDOWPOS2DVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dvARB")) == NULL) || r; + r = ((glWindowPos2fARB = (PFNGLWINDOWPOS2FARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fARB")) == NULL) || r; + r = ((glWindowPos2fvARB = (PFNGLWINDOWPOS2FVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fvARB")) == NULL) || r; + r = ((glWindowPos2iARB = (PFNGLWINDOWPOS2IARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iARB")) == NULL) || r; + r = ((glWindowPos2ivARB = (PFNGLWINDOWPOS2IVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2ivARB")) == NULL) || r; + r = ((glWindowPos2sARB = (PFNGLWINDOWPOS2SARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sARB")) == NULL) || r; + r = ((glWindowPos2svARB = (PFNGLWINDOWPOS2SVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2svARB")) == NULL) || r; + r = ((glWindowPos3dARB = (PFNGLWINDOWPOS3DARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dARB")) == NULL) || r; + r = ((glWindowPos3dvARB = (PFNGLWINDOWPOS3DVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dvARB")) == NULL) || r; + r = ((glWindowPos3fARB = (PFNGLWINDOWPOS3FARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fARB")) == NULL) || r; + r = ((glWindowPos3fvARB = (PFNGLWINDOWPOS3FVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fvARB")) == NULL) || r; + r = ((glWindowPos3iARB = (PFNGLWINDOWPOS3IARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iARB")) == NULL) || r; + r = ((glWindowPos3ivARB = (PFNGLWINDOWPOS3IVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3ivARB")) == NULL) || r; + r = ((glWindowPos3sARB = (PFNGLWINDOWPOS3SARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sARB")) == NULL) || r; + r = ((glWindowPos3svARB = (PFNGLWINDOWPOS3SVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3svARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_window_pos */ + +#ifdef GL_ATIX_point_sprites + +#endif /* GL_ATIX_point_sprites */ + +#ifdef GL_ATIX_texture_env_combine3 + +#endif /* GL_ATIX_texture_env_combine3 */ + +#ifdef GL_ATIX_texture_env_route + +#endif /* GL_ATIX_texture_env_route */ + +#ifdef GL_ATIX_vertex_shader_output_point_size + +#endif /* GL_ATIX_vertex_shader_output_point_size */ + +#ifdef GL_ATI_draw_buffers + +static GLboolean _glewInit_GL_ATI_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawBuffersATI = (PFNGLDRAWBUFFERSATIPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_draw_buffers */ + +#ifdef GL_ATI_element_array + +static GLboolean _glewInit_GL_ATI_element_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawElementArrayATI = (PFNGLDRAWELEMENTARRAYATIPROC)glewGetProcAddress((const GLubyte*)"glDrawElementArrayATI")) == NULL) || r; + r = ((glDrawRangeElementArrayATI = (PFNGLDRAWRANGEELEMENTARRAYATIPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementArrayATI")) == NULL) || r; + r = ((glElementPointerATI = (PFNGLELEMENTPOINTERATIPROC)glewGetProcAddress((const GLubyte*)"glElementPointerATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_element_array */ + +#ifdef GL_ATI_envmap_bumpmap + +static GLboolean _glewInit_GL_ATI_envmap_bumpmap (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetTexBumpParameterfvATI = (PFNGLGETTEXBUMPPARAMETERFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetTexBumpParameterfvATI")) == NULL) || r; + r = ((glGetTexBumpParameterivATI = (PFNGLGETTEXBUMPPARAMETERIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetTexBumpParameterivATI")) == NULL) || r; + r = ((glTexBumpParameterfvATI = (PFNGLTEXBUMPPARAMETERFVATIPROC)glewGetProcAddress((const GLubyte*)"glTexBumpParameterfvATI")) == NULL) || r; + r = ((glTexBumpParameterivATI = (PFNGLTEXBUMPPARAMETERIVATIPROC)glewGetProcAddress((const GLubyte*)"glTexBumpParameterivATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_envmap_bumpmap */ + +#ifdef GL_ATI_fragment_shader + +static GLboolean _glewInit_GL_ATI_fragment_shader (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAlphaFragmentOp1ATI = (PFNGLALPHAFRAGMENTOP1ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp1ATI")) == NULL) || r; + r = ((glAlphaFragmentOp2ATI = (PFNGLALPHAFRAGMENTOP2ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp2ATI")) == NULL) || r; + r = ((glAlphaFragmentOp3ATI = (PFNGLALPHAFRAGMENTOP3ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp3ATI")) == NULL) || r; + r = ((glBeginFragmentShaderATI = (PFNGLBEGINFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glBeginFragmentShaderATI")) == NULL) || r; + r = ((glBindFragmentShaderATI = (PFNGLBINDFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glBindFragmentShaderATI")) == NULL) || r; + r = ((glColorFragmentOp1ATI = (PFNGLCOLORFRAGMENTOP1ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp1ATI")) == NULL) || r; + r = ((glColorFragmentOp2ATI = (PFNGLCOLORFRAGMENTOP2ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp2ATI")) == NULL) || r; + r = ((glColorFragmentOp3ATI = (PFNGLCOLORFRAGMENTOP3ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp3ATI")) == NULL) || r; + r = ((glDeleteFragmentShaderATI = (PFNGLDELETEFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glDeleteFragmentShaderATI")) == NULL) || r; + r = ((glEndFragmentShaderATI = (PFNGLENDFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glEndFragmentShaderATI")) == NULL) || r; + r = ((glGenFragmentShadersATI = (PFNGLGENFRAGMENTSHADERSATIPROC)glewGetProcAddress((const GLubyte*)"glGenFragmentShadersATI")) == NULL) || r; + r = ((glPassTexCoordATI = (PFNGLPASSTEXCOORDATIPROC)glewGetProcAddress((const GLubyte*)"glPassTexCoordATI")) == NULL) || r; + r = ((glSampleMapATI = (PFNGLSAMPLEMAPATIPROC)glewGetProcAddress((const GLubyte*)"glSampleMapATI")) == NULL) || r; + r = ((glSetFragmentShaderConstantATI = (PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)glewGetProcAddress((const GLubyte*)"glSetFragmentShaderConstantATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_fragment_shader */ + +#ifdef GL_ATI_map_object_buffer + +static GLboolean _glewInit_GL_ATI_map_object_buffer (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMapObjectBufferATI = (PFNGLMAPOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glMapObjectBufferATI")) == NULL) || r; + r = ((glUnmapObjectBufferATI = (PFNGLUNMAPOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glUnmapObjectBufferATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_map_object_buffer */ + +#ifdef GL_ATI_pn_triangles + +static GLboolean _glewInit_GL_ATI_pn_triangles (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPNTrianglesfATI = (PFNGLPNTRIANGLESFATIPROC)glewGetProcAddress((const GLubyte*)"glPNTrianglesfATI")) == NULL) || r; + r = ((glPNTrianglesiATI = (PFNGLPNTRIANGLESIATIPROC)glewGetProcAddress((const GLubyte*)"glPNTrianglesiATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_pn_triangles */ + +#ifdef GL_ATI_separate_stencil + +static GLboolean _glewInit_GL_ATI_separate_stencil (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glStencilFuncSeparateATI = (PFNGLSTENCILFUNCSEPARATEATIPROC)glewGetProcAddress((const GLubyte*)"glStencilFuncSeparateATI")) == NULL) || r; + r = ((glStencilOpSeparateATI = (PFNGLSTENCILOPSEPARATEATIPROC)glewGetProcAddress((const GLubyte*)"glStencilOpSeparateATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_separate_stencil */ + +#ifdef GL_ATI_text_fragment_shader + +#endif /* GL_ATI_text_fragment_shader */ + +#ifdef GL_ATI_texture_compression_3dc + +#endif /* GL_ATI_texture_compression_3dc */ + +#ifdef GL_ATI_texture_env_combine3 + +#endif /* GL_ATI_texture_env_combine3 */ + +#ifdef GL_ATI_texture_float + +#endif /* GL_ATI_texture_float */ + +#ifdef GL_ATI_texture_mirror_once + +#endif /* GL_ATI_texture_mirror_once */ + +#ifdef GL_ATI_vertex_array_object + +static GLboolean _glewInit_GL_ATI_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glArrayObjectATI = (PFNGLARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glArrayObjectATI")) == NULL) || r; + r = ((glFreeObjectBufferATI = (PFNGLFREEOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glFreeObjectBufferATI")) == NULL) || r; + r = ((glGetArrayObjectfvATI = (PFNGLGETARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetArrayObjectfvATI")) == NULL) || r; + r = ((glGetArrayObjectivATI = (PFNGLGETARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetArrayObjectivATI")) == NULL) || r; + r = ((glGetObjectBufferfvATI = (PFNGLGETOBJECTBUFFERFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetObjectBufferfvATI")) == NULL) || r; + r = ((glGetObjectBufferivATI = (PFNGLGETOBJECTBUFFERIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetObjectBufferivATI")) == NULL) || r; + r = ((glGetVariantArrayObjectfvATI = (PFNGLGETVARIANTARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVariantArrayObjectfvATI")) == NULL) || r; + r = ((glGetVariantArrayObjectivATI = (PFNGLGETVARIANTARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVariantArrayObjectivATI")) == NULL) || r; + r = ((glIsObjectBufferATI = (PFNGLISOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glIsObjectBufferATI")) == NULL) || r; + r = ((glNewObjectBufferATI = (PFNGLNEWOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glNewObjectBufferATI")) == NULL) || r; + r = ((glUpdateObjectBufferATI = (PFNGLUPDATEOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glUpdateObjectBufferATI")) == NULL) || r; + r = ((glVariantArrayObjectATI = (PFNGLVARIANTARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glVariantArrayObjectATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_vertex_array_object */ + +#ifdef GL_ATI_vertex_attrib_array_object + +static GLboolean _glewInit_GL_ATI_vertex_attrib_array_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetVertexAttribArrayObjectfvATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribArrayObjectfvATI")) == NULL) || r; + r = ((glGetVertexAttribArrayObjectivATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribArrayObjectivATI")) == NULL) || r; + r = ((glVertexAttribArrayObjectATI = (PFNGLVERTEXATTRIBARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribArrayObjectATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_vertex_attrib_array_object */ + +#ifdef GL_ATI_vertex_streams + +static GLboolean _glewInit_GL_ATI_vertex_streams (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClientActiveVertexStreamATI = (PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC)glewGetProcAddress((const GLubyte*)"glClientActiveVertexStreamATI")) == NULL) || r; + r = ((glNormalStream3bATI = (PFNGLNORMALSTREAM3BATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3bATI")) == NULL) || r; + r = ((glNormalStream3bvATI = (PFNGLNORMALSTREAM3BVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3bvATI")) == NULL) || r; + r = ((glNormalStream3dATI = (PFNGLNORMALSTREAM3DATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3dATI")) == NULL) || r; + r = ((glNormalStream3dvATI = (PFNGLNORMALSTREAM3DVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3dvATI")) == NULL) || r; + r = ((glNormalStream3fATI = (PFNGLNORMALSTREAM3FATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3fATI")) == NULL) || r; + r = ((glNormalStream3fvATI = (PFNGLNORMALSTREAM3FVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3fvATI")) == NULL) || r; + r = ((glNormalStream3iATI = (PFNGLNORMALSTREAM3IATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3iATI")) == NULL) || r; + r = ((glNormalStream3ivATI = (PFNGLNORMALSTREAM3IVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3ivATI")) == NULL) || r; + r = ((glNormalStream3sATI = (PFNGLNORMALSTREAM3SATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3sATI")) == NULL) || r; + r = ((glNormalStream3svATI = (PFNGLNORMALSTREAM3SVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3svATI")) == NULL) || r; + r = ((glVertexBlendEnvfATI = (PFNGLVERTEXBLENDENVFATIPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendEnvfATI")) == NULL) || r; + r = ((glVertexBlendEnviATI = (PFNGLVERTEXBLENDENVIATIPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendEnviATI")) == NULL) || r; + r = ((glVertexStream2dATI = (PFNGLVERTEXSTREAM2DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2dATI")) == NULL) || r; + r = ((glVertexStream2dvATI = (PFNGLVERTEXSTREAM2DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2dvATI")) == NULL) || r; + r = ((glVertexStream2fATI = (PFNGLVERTEXSTREAM2FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2fATI")) == NULL) || r; + r = ((glVertexStream2fvATI = (PFNGLVERTEXSTREAM2FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2fvATI")) == NULL) || r; + r = ((glVertexStream2iATI = (PFNGLVERTEXSTREAM2IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2iATI")) == NULL) || r; + r = ((glVertexStream2ivATI = (PFNGLVERTEXSTREAM2IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2ivATI")) == NULL) || r; + r = ((glVertexStream2sATI = (PFNGLVERTEXSTREAM2SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2sATI")) == NULL) || r; + r = ((glVertexStream2svATI = (PFNGLVERTEXSTREAM2SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2svATI")) == NULL) || r; + r = ((glVertexStream3dATI = (PFNGLVERTEXSTREAM3DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3dATI")) == NULL) || r; + r = ((glVertexStream3dvATI = (PFNGLVERTEXSTREAM3DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3dvATI")) == NULL) || r; + r = ((glVertexStream3fATI = (PFNGLVERTEXSTREAM3FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3fATI")) == NULL) || r; + r = ((glVertexStream3fvATI = (PFNGLVERTEXSTREAM3FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3fvATI")) == NULL) || r; + r = ((glVertexStream3iATI = (PFNGLVERTEXSTREAM3IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3iATI")) == NULL) || r; + r = ((glVertexStream3ivATI = (PFNGLVERTEXSTREAM3IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3ivATI")) == NULL) || r; + r = ((glVertexStream3sATI = (PFNGLVERTEXSTREAM3SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3sATI")) == NULL) || r; + r = ((glVertexStream3svATI = (PFNGLVERTEXSTREAM3SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3svATI")) == NULL) || r; + r = ((glVertexStream4dATI = (PFNGLVERTEXSTREAM4DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4dATI")) == NULL) || r; + r = ((glVertexStream4dvATI = (PFNGLVERTEXSTREAM4DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4dvATI")) == NULL) || r; + r = ((glVertexStream4fATI = (PFNGLVERTEXSTREAM4FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4fATI")) == NULL) || r; + r = ((glVertexStream4fvATI = (PFNGLVERTEXSTREAM4FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4fvATI")) == NULL) || r; + r = ((glVertexStream4iATI = (PFNGLVERTEXSTREAM4IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4iATI")) == NULL) || r; + r = ((glVertexStream4ivATI = (PFNGLVERTEXSTREAM4IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4ivATI")) == NULL) || r; + r = ((glVertexStream4sATI = (PFNGLVERTEXSTREAM4SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4sATI")) == NULL) || r; + r = ((glVertexStream4svATI = (PFNGLVERTEXSTREAM4SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4svATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_vertex_streams */ + +#ifdef GL_EXT_422_pixels + +#endif /* GL_EXT_422_pixels */ + +#ifdef GL_EXT_Cg_shader + +#endif /* GL_EXT_Cg_shader */ + +#ifdef GL_EXT_abgr + +#endif /* GL_EXT_abgr */ + +#ifdef GL_EXT_bgra + +#endif /* GL_EXT_bgra */ + +#ifdef GL_EXT_blend_color + +static GLboolean _glewInit_GL_EXT_blend_color (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendColorEXT = (PFNGLBLENDCOLOREXTPROC)glewGetProcAddress((const GLubyte*)"glBlendColorEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_color */ + +#ifdef GL_EXT_blend_equation_separate + +static GLboolean _glewInit_GL_EXT_blend_equation_separate (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationSeparateEXT = (PFNGLBLENDEQUATIONSEPARATEEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_equation_separate */ + +#ifdef GL_EXT_blend_func_separate + +static GLboolean _glewInit_GL_EXT_blend_func_separate (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendFuncSeparateEXT = (PFNGLBLENDFUNCSEPARATEEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_func_separate */ + +#ifdef GL_EXT_blend_logic_op + +#endif /* GL_EXT_blend_logic_op */ + +#ifdef GL_EXT_blend_minmax + +static GLboolean _glewInit_GL_EXT_blend_minmax (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationEXT = (PFNGLBLENDEQUATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_minmax */ + +#ifdef GL_EXT_blend_subtract + +#endif /* GL_EXT_blend_subtract */ + +#ifdef GL_EXT_clip_volume_hint + +#endif /* GL_EXT_clip_volume_hint */ + +#ifdef GL_EXT_cmyka + +#endif /* GL_EXT_cmyka */ + +#ifdef GL_EXT_color_subtable + +static GLboolean _glewInit_GL_EXT_color_subtable (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorSubTableEXT = (PFNGLCOLORSUBTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glColorSubTableEXT")) == NULL) || r; + r = ((glCopyColorSubTableEXT = (PFNGLCOPYCOLORSUBTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyColorSubTableEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_color_subtable */ + +#ifdef GL_EXT_compiled_vertex_array + +static GLboolean _glewInit_GL_EXT_compiled_vertex_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glLockArraysEXT = (PFNGLLOCKARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glLockArraysEXT")) == NULL) || r; + r = ((glUnlockArraysEXT = (PFNGLUNLOCKARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glUnlockArraysEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_compiled_vertex_array */ + +#ifdef GL_EXT_convolution + +static GLboolean _glewInit_GL_EXT_convolution (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glConvolutionFilter1DEXT = (PFNGLCONVOLUTIONFILTER1DEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter1DEXT")) == NULL) || r; + r = ((glConvolutionFilter2DEXT = (PFNGLCONVOLUTIONFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter2DEXT")) == NULL) || r; + r = ((glConvolutionParameterfEXT = (PFNGLCONVOLUTIONPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfEXT")) == NULL) || r; + r = ((glConvolutionParameterfvEXT = (PFNGLCONVOLUTIONPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfvEXT")) == NULL) || r; + r = ((glConvolutionParameteriEXT = (PFNGLCONVOLUTIONPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteriEXT")) == NULL) || r; + r = ((glConvolutionParameterivEXT = (PFNGLCONVOLUTIONPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterivEXT")) == NULL) || r; + r = ((glCopyConvolutionFilter1DEXT = (PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter1DEXT")) == NULL) || r; + r = ((glCopyConvolutionFilter2DEXT = (PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter2DEXT")) == NULL) || r; + r = ((glGetConvolutionFilterEXT = (PFNGLGETCONVOLUTIONFILTEREXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionFilterEXT")) == NULL) || r; + r = ((glGetConvolutionParameterfvEXT = (PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterfvEXT")) == NULL) || r; + r = ((glGetConvolutionParameterivEXT = (PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterivEXT")) == NULL) || r; + r = ((glGetSeparableFilterEXT = (PFNGLGETSEPARABLEFILTEREXTPROC)glewGetProcAddress((const GLubyte*)"glGetSeparableFilterEXT")) == NULL) || r; + r = ((glSeparableFilter2DEXT = (PFNGLSEPARABLEFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glSeparableFilter2DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_convolution */ + +#ifdef GL_EXT_coordinate_frame + +static GLboolean _glewInit_GL_EXT_coordinate_frame (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBinormalPointerEXT = (PFNGLBINORMALPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glBinormalPointerEXT")) == NULL) || r; + r = ((glTangentPointerEXT = (PFNGLTANGENTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glTangentPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_coordinate_frame */ + +#ifdef GL_EXT_copy_texture + +static GLboolean _glewInit_GL_EXT_copy_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCopyTexImage1DEXT = (PFNGLCOPYTEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexImage1DEXT")) == NULL) || r; + r = ((glCopyTexImage2DEXT = (PFNGLCOPYTEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexImage2DEXT")) == NULL) || r; + r = ((glCopyTexSubImage1DEXT = (PFNGLCOPYTEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage1DEXT")) == NULL) || r; + r = ((glCopyTexSubImage2DEXT = (PFNGLCOPYTEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage2DEXT")) == NULL) || r; + r = ((glCopyTexSubImage3DEXT = (PFNGLCOPYTEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage3DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_copy_texture */ + +#ifdef GL_EXT_cull_vertex + +static GLboolean _glewInit_GL_EXT_cull_vertex (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCullParameterdvEXT = (PFNGLCULLPARAMETERDVEXTPROC)glewGetProcAddress((const GLubyte*)"glCullParameterdvEXT")) == NULL) || r; + r = ((glCullParameterfvEXT = (PFNGLCULLPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glCullParameterfvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_cull_vertex */ + +#ifdef GL_EXT_depth_bounds_test + +static GLboolean _glewInit_GL_EXT_depth_bounds_test (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDepthBoundsEXT = (PFNGLDEPTHBOUNDSEXTPROC)glewGetProcAddress((const GLubyte*)"glDepthBoundsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_depth_bounds_test */ + +#ifdef GL_EXT_draw_range_elements + +static GLboolean _glewInit_GL_EXT_draw_range_elements (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawRangeElementsEXT = (PFNGLDRAWRANGEELEMENTSEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_draw_range_elements */ + +#ifdef GL_EXT_fog_coord + +static GLboolean _glewInit_GL_EXT_fog_coord (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFogCoordPointerEXT = (PFNGLFOGCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointerEXT")) == NULL) || r; + r = ((glFogCoorddEXT = (PFNGLFOGCOORDDEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddEXT")) == NULL) || r; + r = ((glFogCoorddvEXT = (PFNGLFOGCOORDDVEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddvEXT")) == NULL) || r; + r = ((glFogCoordfEXT = (PFNGLFOGCOORDFEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfEXT")) == NULL) || r; + r = ((glFogCoordfvEXT = (PFNGLFOGCOORDFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_fog_coord */ + +#ifdef GL_EXT_fragment_lighting + +static GLboolean _glewInit_GL_EXT_fragment_lighting (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFragmentColorMaterialEXT = (PFNGLFRAGMENTCOLORMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentColorMaterialEXT")) == NULL) || r; + r = ((glFragmentLightModelfEXT = (PFNGLFRAGMENTLIGHTMODELFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfEXT")) == NULL) || r; + r = ((glFragmentLightModelfvEXT = (PFNGLFRAGMENTLIGHTMODELFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfvEXT")) == NULL) || r; + r = ((glFragmentLightModeliEXT = (PFNGLFRAGMENTLIGHTMODELIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModeliEXT")) == NULL) || r; + r = ((glFragmentLightModelivEXT = (PFNGLFRAGMENTLIGHTMODELIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelivEXT")) == NULL) || r; + r = ((glFragmentLightfEXT = (PFNGLFRAGMENTLIGHTFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfEXT")) == NULL) || r; + r = ((glFragmentLightfvEXT = (PFNGLFRAGMENTLIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfvEXT")) == NULL) || r; + r = ((glFragmentLightiEXT = (PFNGLFRAGMENTLIGHTIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightiEXT")) == NULL) || r; + r = ((glFragmentLightivEXT = (PFNGLFRAGMENTLIGHTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightivEXT")) == NULL) || r; + r = ((glFragmentMaterialfEXT = (PFNGLFRAGMENTMATERIALFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfEXT")) == NULL) || r; + r = ((glFragmentMaterialfvEXT = (PFNGLFRAGMENTMATERIALFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfvEXT")) == NULL) || r; + r = ((glFragmentMaterialiEXT = (PFNGLFRAGMENTMATERIALIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialiEXT")) == NULL) || r; + r = ((glFragmentMaterialivEXT = (PFNGLFRAGMENTMATERIALIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialivEXT")) == NULL) || r; + r = ((glGetFragmentLightfvEXT = (PFNGLGETFRAGMENTLIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightfvEXT")) == NULL) || r; + r = ((glGetFragmentLightivEXT = (PFNGLGETFRAGMENTLIGHTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightivEXT")) == NULL) || r; + r = ((glGetFragmentMaterialfvEXT = (PFNGLGETFRAGMENTMATERIALFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialfvEXT")) == NULL) || r; + r = ((glGetFragmentMaterialivEXT = (PFNGLGETFRAGMENTMATERIALIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialivEXT")) == NULL) || r; + r = ((glLightEnviEXT = (PFNGLLIGHTENVIEXTPROC)glewGetProcAddress((const GLubyte*)"glLightEnviEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_fragment_lighting */ + +#ifdef GL_EXT_framebuffer_blit + +static GLboolean _glewInit_GL_EXT_framebuffer_blit (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlitFramebufferEXT = (PFNGLBLITFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebufferEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_framebuffer_blit */ + +#ifdef GL_EXT_framebuffer_multisample + +static GLboolean _glewInit_GL_EXT_framebuffer_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glRenderbufferStorageMultisampleEXT = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_framebuffer_multisample */ + +#ifdef GL_EXT_framebuffer_object + +static GLboolean _glewInit_GL_EXT_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindFramebufferEXT")) == NULL) || r; + r = ((glBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindRenderbufferEXT")) == NULL) || r; + r = ((glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)glewGetProcAddress((const GLubyte*)"glCheckFramebufferStatusEXT")) == NULL) || r; + r = ((glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteFramebuffersEXT")) == NULL) || r; + r = ((glDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteRenderbuffersEXT")) == NULL) || r; + r = ((glFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferRenderbufferEXT")) == NULL) || r; + r = ((glFramebufferTexture1DEXT = (PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture1DEXT")) == NULL) || r; + r = ((glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2DEXT")) == NULL) || r; + r = ((glFramebufferTexture3DEXT = (PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture3DEXT")) == NULL) || r; + r = ((glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenFramebuffersEXT")) == NULL) || r; + r = ((glGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenRenderbuffersEXT")) == NULL) || r; + r = ((glGenerateMipmapEXT = (PFNGLGENERATEMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateMipmapEXT")) == NULL) || r; + r = ((glGetFramebufferAttachmentParameterivEXT = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferAttachmentParameterivEXT")) == NULL) || r; + r = ((glGetRenderbufferParameterivEXT = (PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetRenderbufferParameterivEXT")) == NULL) || r; + r = ((glIsFramebufferEXT = (PFNGLISFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glIsFramebufferEXT")) == NULL) || r; + r = ((glIsRenderbufferEXT = (PFNGLISRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glIsRenderbufferEXT")) == NULL) || r; + r = ((glRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_framebuffer_object */ + +#ifdef GL_EXT_histogram + +static GLboolean _glewInit_GL_EXT_histogram (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetHistogramEXT = (PFNGLGETHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramEXT")) == NULL) || r; + r = ((glGetHistogramParameterfvEXT = (PFNGLGETHISTOGRAMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterfvEXT")) == NULL) || r; + r = ((glGetHistogramParameterivEXT = (PFNGLGETHISTOGRAMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterivEXT")) == NULL) || r; + r = ((glGetMinmaxEXT = (PFNGLGETMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxEXT")) == NULL) || r; + r = ((glGetMinmaxParameterfvEXT = (PFNGLGETMINMAXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterfvEXT")) == NULL) || r; + r = ((glGetMinmaxParameterivEXT = (PFNGLGETMINMAXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterivEXT")) == NULL) || r; + r = ((glHistogramEXT = (PFNGLHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glHistogramEXT")) == NULL) || r; + r = ((glMinmaxEXT = (PFNGLMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glMinmaxEXT")) == NULL) || r; + r = ((glResetHistogramEXT = (PFNGLRESETHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glResetHistogramEXT")) == NULL) || r; + r = ((glResetMinmaxEXT = (PFNGLRESETMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glResetMinmaxEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_histogram */ + +#ifdef GL_EXT_index_array_formats + +#endif /* GL_EXT_index_array_formats */ + +#ifdef GL_EXT_index_func + +static GLboolean _glewInit_GL_EXT_index_func (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glIndexFuncEXT = (PFNGLINDEXFUNCEXTPROC)glewGetProcAddress((const GLubyte*)"glIndexFuncEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_index_func */ + +#ifdef GL_EXT_index_material + +static GLboolean _glewInit_GL_EXT_index_material (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glIndexMaterialEXT = (PFNGLINDEXMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glIndexMaterialEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_index_material */ + +#ifdef GL_EXT_index_texture + +#endif /* GL_EXT_index_texture */ + +#ifdef GL_EXT_light_texture + +static GLboolean _glewInit_GL_EXT_light_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glApplyTextureEXT = (PFNGLAPPLYTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glApplyTextureEXT")) == NULL) || r; + r = ((glTextureLightEXT = (PFNGLTEXTURELIGHTEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureLightEXT")) == NULL) || r; + r = ((glTextureMaterialEXT = (PFNGLTEXTUREMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureMaterialEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_light_texture */ + +#ifdef GL_EXT_misc_attribute + +#endif /* GL_EXT_misc_attribute */ + +#ifdef GL_EXT_multi_draw_arrays + +static GLboolean _glewInit_GL_EXT_multi_draw_arrays (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysEXT = (PFNGLMULTIDRAWARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysEXT")) == NULL) || r; + r = ((glMultiDrawElementsEXT = (PFNGLMULTIDRAWELEMENTSEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_multi_draw_arrays */ + +#ifdef GL_EXT_multisample + +static GLboolean _glewInit_GL_EXT_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSampleMaskEXT = (PFNGLSAMPLEMASKEXTPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskEXT")) == NULL) || r; + r = ((glSamplePatternEXT = (PFNGLSAMPLEPATTERNEXTPROC)glewGetProcAddress((const GLubyte*)"glSamplePatternEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_multisample */ + +#ifdef GL_EXT_packed_depth_stencil + +#endif /* GL_EXT_packed_depth_stencil */ + +#ifdef GL_EXT_packed_pixels + +#endif /* GL_EXT_packed_pixels */ + +#ifdef GL_EXT_paletted_texture + +static GLboolean _glewInit_GL_EXT_paletted_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorTableEXT = (PFNGLCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glColorTableEXT")) == NULL) || r; + r = ((glGetColorTableEXT = (PFNGLGETCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableEXT")) == NULL) || r; + r = ((glGetColorTableParameterfvEXT = (PFNGLGETCOLORTABLEPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfvEXT")) == NULL) || r; + r = ((glGetColorTableParameterivEXT = (PFNGLGETCOLORTABLEPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterivEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_paletted_texture */ + +#ifdef GL_EXT_pixel_buffer_object + +#endif /* GL_EXT_pixel_buffer_object */ + +#ifdef GL_EXT_pixel_transform + +static GLboolean _glewInit_GL_EXT_pixel_transform (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetPixelTransformParameterfvEXT = (PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPixelTransformParameterfvEXT")) == NULL) || r; + r = ((glGetPixelTransformParameterivEXT = (PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPixelTransformParameterivEXT")) == NULL) || r; + r = ((glPixelTransformParameterfEXT = (PFNGLPIXELTRANSFORMPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterfEXT")) == NULL) || r; + r = ((glPixelTransformParameterfvEXT = (PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterfvEXT")) == NULL) || r; + r = ((glPixelTransformParameteriEXT = (PFNGLPIXELTRANSFORMPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameteriEXT")) == NULL) || r; + r = ((glPixelTransformParameterivEXT = (PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterivEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_pixel_transform */ + +#ifdef GL_EXT_pixel_transform_color_table + +#endif /* GL_EXT_pixel_transform_color_table */ + +#ifdef GL_EXT_point_parameters + +static GLboolean _glewInit_GL_EXT_point_parameters (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPointParameterfEXT = (PFNGLPOINTPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfEXT")) == NULL) || r; + r = ((glPointParameterfvEXT = (PFNGLPOINTPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_point_parameters */ + +#ifdef GL_EXT_polygon_offset + +static GLboolean _glewInit_GL_EXT_polygon_offset (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPolygonOffsetEXT = (PFNGLPOLYGONOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glPolygonOffsetEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_polygon_offset */ + +#ifdef GL_EXT_rescale_normal + +#endif /* GL_EXT_rescale_normal */ + +#ifdef GL_EXT_scene_marker + +static GLboolean _glewInit_GL_EXT_scene_marker (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginSceneEXT = (PFNGLBEGINSCENEEXTPROC)glewGetProcAddress((const GLubyte*)"glBeginSceneEXT")) == NULL) || r; + r = ((glEndSceneEXT = (PFNGLENDSCENEEXTPROC)glewGetProcAddress((const GLubyte*)"glEndSceneEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_scene_marker */ + +#ifdef GL_EXT_secondary_color + +static GLboolean _glewInit_GL_EXT_secondary_color (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSecondaryColor3bEXT = (PFNGLSECONDARYCOLOR3BEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bEXT")) == NULL) || r; + r = ((glSecondaryColor3bvEXT = (PFNGLSECONDARYCOLOR3BVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bvEXT")) == NULL) || r; + r = ((glSecondaryColor3dEXT = (PFNGLSECONDARYCOLOR3DEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dEXT")) == NULL) || r; + r = ((glSecondaryColor3dvEXT = (PFNGLSECONDARYCOLOR3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dvEXT")) == NULL) || r; + r = ((glSecondaryColor3fEXT = (PFNGLSECONDARYCOLOR3FEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fEXT")) == NULL) || r; + r = ((glSecondaryColor3fvEXT = (PFNGLSECONDARYCOLOR3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fvEXT")) == NULL) || r; + r = ((glSecondaryColor3iEXT = (PFNGLSECONDARYCOLOR3IEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3iEXT")) == NULL) || r; + r = ((glSecondaryColor3ivEXT = (PFNGLSECONDARYCOLOR3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ivEXT")) == NULL) || r; + r = ((glSecondaryColor3sEXT = (PFNGLSECONDARYCOLOR3SEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3sEXT")) == NULL) || r; + r = ((glSecondaryColor3svEXT = (PFNGLSECONDARYCOLOR3SVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3svEXT")) == NULL) || r; + r = ((glSecondaryColor3ubEXT = (PFNGLSECONDARYCOLOR3UBEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubEXT")) == NULL) || r; + r = ((glSecondaryColor3ubvEXT = (PFNGLSECONDARYCOLOR3UBVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubvEXT")) == NULL) || r; + r = ((glSecondaryColor3uiEXT = (PFNGLSECONDARYCOLOR3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uiEXT")) == NULL) || r; + r = ((glSecondaryColor3uivEXT = (PFNGLSECONDARYCOLOR3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uivEXT")) == NULL) || r; + r = ((glSecondaryColor3usEXT = (PFNGLSECONDARYCOLOR3USEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usEXT")) == NULL) || r; + r = ((glSecondaryColor3usvEXT = (PFNGLSECONDARYCOLOR3USVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usvEXT")) == NULL) || r; + r = ((glSecondaryColorPointerEXT = (PFNGLSECONDARYCOLORPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_secondary_color */ + +#ifdef GL_EXT_separate_specular_color + +#endif /* GL_EXT_separate_specular_color */ + +#ifdef GL_EXT_shadow_funcs + +#endif /* GL_EXT_shadow_funcs */ + +#ifdef GL_EXT_shared_texture_palette + +#endif /* GL_EXT_shared_texture_palette */ + +#ifdef GL_EXT_stencil_clear_tag + +#endif /* GL_EXT_stencil_clear_tag */ + +#ifdef GL_EXT_stencil_two_side + +static GLboolean _glewInit_GL_EXT_stencil_two_side (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveStencilFaceEXT = (PFNGLACTIVESTENCILFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glActiveStencilFaceEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_stencil_two_side */ + +#ifdef GL_EXT_stencil_wrap + +#endif /* GL_EXT_stencil_wrap */ + +#ifdef GL_EXT_subtexture + +static GLboolean _glewInit_GL_EXT_subtexture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexSubImage1DEXT = (PFNGLTEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage1DEXT")) == NULL) || r; + r = ((glTexSubImage2DEXT = (PFNGLTEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage2DEXT")) == NULL) || r; + r = ((glTexSubImage3DEXT = (PFNGLTEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage3DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_subtexture */ + +#ifdef GL_EXT_texture + +#endif /* GL_EXT_texture */ + +#ifdef GL_EXT_texture3D + +static GLboolean _glewInit_GL_EXT_texture3D (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexImage3DEXT = (PFNGLTEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture3D */ + +#ifdef GL_EXT_texture_compression_dxt1 + +#endif /* GL_EXT_texture_compression_dxt1 */ + +#ifdef GL_EXT_texture_compression_s3tc + +#endif /* GL_EXT_texture_compression_s3tc */ + +#ifdef GL_EXT_texture_cube_map + +#endif /* GL_EXT_texture_cube_map */ + +#ifdef GL_EXT_texture_edge_clamp + +#endif /* GL_EXT_texture_edge_clamp */ + +#ifdef GL_EXT_texture_env + +#endif /* GL_EXT_texture_env */ + +#ifdef GL_EXT_texture_env_add + +#endif /* GL_EXT_texture_env_add */ + +#ifdef GL_EXT_texture_env_combine + +#endif /* GL_EXT_texture_env_combine */ + +#ifdef GL_EXT_texture_env_dot3 + +#endif /* GL_EXT_texture_env_dot3 */ + +#ifdef GL_EXT_texture_filter_anisotropic + +#endif /* GL_EXT_texture_filter_anisotropic */ + +#ifdef GL_EXT_texture_lod_bias + +#endif /* GL_EXT_texture_lod_bias */ + +#ifdef GL_EXT_texture_mirror_clamp + +#endif /* GL_EXT_texture_mirror_clamp */ + +#ifdef GL_EXT_texture_object + +static GLboolean _glewInit_GL_EXT_texture_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAreTexturesResidentEXT = (PFNGLARETEXTURESRESIDENTEXTPROC)glewGetProcAddress((const GLubyte*)"glAreTexturesResidentEXT")) == NULL) || r; + r = ((glBindTextureEXT = (PFNGLBINDTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindTextureEXT")) == NULL) || r; + r = ((glDeleteTexturesEXT = (PFNGLDELETETEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteTexturesEXT")) == NULL) || r; + r = ((glGenTexturesEXT = (PFNGLGENTEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glGenTexturesEXT")) == NULL) || r; + r = ((glIsTextureEXT = (PFNGLISTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glIsTextureEXT")) == NULL) || r; + r = ((glPrioritizeTexturesEXT = (PFNGLPRIORITIZETEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glPrioritizeTexturesEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_object */ + +#ifdef GL_EXT_texture_perturb_normal + +static GLboolean _glewInit_GL_EXT_texture_perturb_normal (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTextureNormalEXT = (PFNGLTEXTURENORMALEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureNormalEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_perturb_normal */ + +#ifdef GL_EXT_texture_rectangle + +#endif /* GL_EXT_texture_rectangle */ + +#ifdef GL_EXT_texture_sRGB + +#endif /* GL_EXT_texture_sRGB */ + +#ifdef GL_EXT_vertex_array + +static GLboolean _glewInit_GL_EXT_vertex_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glArrayElementEXT = (PFNGLARRAYELEMENTEXTPROC)glewGetProcAddress((const GLubyte*)"glArrayElementEXT")) == NULL) || r; + r = ((glColorPointerEXT = (PFNGLCOLORPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glColorPointerEXT")) == NULL) || r; + r = ((glDrawArraysEXT = (PFNGLDRAWARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysEXT")) == NULL) || r; + r = ((glEdgeFlagPointerEXT = (PFNGLEDGEFLAGPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagPointerEXT")) == NULL) || r; + r = ((glGetPointervEXT = (PFNGLGETPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPointervEXT")) == NULL) || r; + r = ((glIndexPointerEXT = (PFNGLINDEXPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glIndexPointerEXT")) == NULL) || r; + r = ((glNormalPointerEXT = (PFNGLNORMALPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glNormalPointerEXT")) == NULL) || r; + r = ((glTexCoordPointerEXT = (PFNGLTEXCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointerEXT")) == NULL) || r; + r = ((glVertexPointerEXT = (PFNGLVERTEXPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_array */ + +#ifdef GL_EXT_vertex_shader + +static GLboolean _glewInit_GL_EXT_vertex_shader (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginVertexShaderEXT = (PFNGLBEGINVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glBeginVertexShaderEXT")) == NULL) || r; + r = ((glBindLightParameterEXT = (PFNGLBINDLIGHTPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindLightParameterEXT")) == NULL) || r; + r = ((glBindMaterialParameterEXT = (PFNGLBINDMATERIALPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindMaterialParameterEXT")) == NULL) || r; + r = ((glBindParameterEXT = (PFNGLBINDPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindParameterEXT")) == NULL) || r; + r = ((glBindTexGenParameterEXT = (PFNGLBINDTEXGENPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindTexGenParameterEXT")) == NULL) || r; + r = ((glBindTextureUnitParameterEXT = (PFNGLBINDTEXTUREUNITPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindTextureUnitParameterEXT")) == NULL) || r; + r = ((glBindVertexShaderEXT = (PFNGLBINDVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindVertexShaderEXT")) == NULL) || r; + r = ((glDeleteVertexShaderEXT = (PFNGLDELETEVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexShaderEXT")) == NULL) || r; + r = ((glDisableVariantClientStateEXT = (PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVariantClientStateEXT")) == NULL) || r; + r = ((glEnableVariantClientStateEXT = (PFNGLENABLEVARIANTCLIENTSTATEEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVariantClientStateEXT")) == NULL) || r; + r = ((glEndVertexShaderEXT = (PFNGLENDVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glEndVertexShaderEXT")) == NULL) || r; + r = ((glExtractComponentEXT = (PFNGLEXTRACTCOMPONENTEXTPROC)glewGetProcAddress((const GLubyte*)"glExtractComponentEXT")) == NULL) || r; + r = ((glGenSymbolsEXT = (PFNGLGENSYMBOLSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenSymbolsEXT")) == NULL) || r; + r = ((glGenVertexShadersEXT = (PFNGLGENVERTEXSHADERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenVertexShadersEXT")) == NULL) || r; + r = ((glGetInvariantBooleanvEXT = (PFNGLGETINVARIANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantBooleanvEXT")) == NULL) || r; + r = ((glGetInvariantFloatvEXT = (PFNGLGETINVARIANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantFloatvEXT")) == NULL) || r; + r = ((glGetInvariantIntegervEXT = (PFNGLGETINVARIANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantIntegervEXT")) == NULL) || r; + r = ((glGetLocalConstantBooleanvEXT = (PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantBooleanvEXT")) == NULL) || r; + r = ((glGetLocalConstantFloatvEXT = (PFNGLGETLOCALCONSTANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantFloatvEXT")) == NULL) || r; + r = ((glGetLocalConstantIntegervEXT = (PFNGLGETLOCALCONSTANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantIntegervEXT")) == NULL) || r; + r = ((glGetVariantBooleanvEXT = (PFNGLGETVARIANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantBooleanvEXT")) == NULL) || r; + r = ((glGetVariantFloatvEXT = (PFNGLGETVARIANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantFloatvEXT")) == NULL) || r; + r = ((glGetVariantIntegervEXT = (PFNGLGETVARIANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantIntegervEXT")) == NULL) || r; + r = ((glGetVariantPointervEXT = (PFNGLGETVARIANTPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantPointervEXT")) == NULL) || r; + r = ((glInsertComponentEXT = (PFNGLINSERTCOMPONENTEXTPROC)glewGetProcAddress((const GLubyte*)"glInsertComponentEXT")) == NULL) || r; + r = ((glIsVariantEnabledEXT = (PFNGLISVARIANTENABLEDEXTPROC)glewGetProcAddress((const GLubyte*)"glIsVariantEnabledEXT")) == NULL) || r; + r = ((glSetInvariantEXT = (PFNGLSETINVARIANTEXTPROC)glewGetProcAddress((const GLubyte*)"glSetInvariantEXT")) == NULL) || r; + r = ((glSetLocalConstantEXT = (PFNGLSETLOCALCONSTANTEXTPROC)glewGetProcAddress((const GLubyte*)"glSetLocalConstantEXT")) == NULL) || r; + r = ((glShaderOp1EXT = (PFNGLSHADEROP1EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp1EXT")) == NULL) || r; + r = ((glShaderOp2EXT = (PFNGLSHADEROP2EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp2EXT")) == NULL) || r; + r = ((glShaderOp3EXT = (PFNGLSHADEROP3EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp3EXT")) == NULL) || r; + r = ((glSwizzleEXT = (PFNGLSWIZZLEEXTPROC)glewGetProcAddress((const GLubyte*)"glSwizzleEXT")) == NULL) || r; + r = ((glVariantPointerEXT = (PFNGLVARIANTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVariantPointerEXT")) == NULL) || r; + r = ((glVariantbvEXT = (PFNGLVARIANTBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantbvEXT")) == NULL) || r; + r = ((glVariantdvEXT = (PFNGLVARIANTDVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantdvEXT")) == NULL) || r; + r = ((glVariantfvEXT = (PFNGLVARIANTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantfvEXT")) == NULL) || r; + r = ((glVariantivEXT = (PFNGLVARIANTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantivEXT")) == NULL) || r; + r = ((glVariantsvEXT = (PFNGLVARIANTSVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantsvEXT")) == NULL) || r; + r = ((glVariantubvEXT = (PFNGLVARIANTUBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantubvEXT")) == NULL) || r; + r = ((glVariantuivEXT = (PFNGLVARIANTUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantuivEXT")) == NULL) || r; + r = ((glVariantusvEXT = (PFNGLVARIANTUSVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantusvEXT")) == NULL) || r; + r = ((glWriteMaskEXT = (PFNGLWRITEMASKEXTPROC)glewGetProcAddress((const GLubyte*)"glWriteMaskEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_shader */ + +#ifdef GL_EXT_vertex_weighting + +static GLboolean _glewInit_GL_EXT_vertex_weighting (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glVertexWeightPointerEXT = (PFNGLVERTEXWEIGHTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightPointerEXT")) == NULL) || r; + r = ((glVertexWeightfEXT = (PFNGLVERTEXWEIGHTFEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightfEXT")) == NULL) || r; + r = ((glVertexWeightfvEXT = (PFNGLVERTEXWEIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightfvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_weighting */ + +#ifdef GL_GREMEDY_string_marker + +static GLboolean _glewInit_GL_GREMEDY_string_marker (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glStringMarkerGREMEDY = (PFNGLSTRINGMARKERGREMEDYPROC)glewGetProcAddress((const GLubyte*)"glStringMarkerGREMEDY")) == NULL) || r; + + return r; +} + +#endif /* GL_GREMEDY_string_marker */ + +#ifdef GL_HP_convolution_border_modes + +#endif /* GL_HP_convolution_border_modes */ + +#ifdef GL_HP_image_transform + +static GLboolean _glewInit_GL_HP_image_transform (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetImageTransformParameterfvHP = (PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC)glewGetProcAddress((const GLubyte*)"glGetImageTransformParameterfvHP")) == NULL) || r; + r = ((glGetImageTransformParameterivHP = (PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC)glewGetProcAddress((const GLubyte*)"glGetImageTransformParameterivHP")) == NULL) || r; + r = ((glImageTransformParameterfHP = (PFNGLIMAGETRANSFORMPARAMETERFHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterfHP")) == NULL) || r; + r = ((glImageTransformParameterfvHP = (PFNGLIMAGETRANSFORMPARAMETERFVHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterfvHP")) == NULL) || r; + r = ((glImageTransformParameteriHP = (PFNGLIMAGETRANSFORMPARAMETERIHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameteriHP")) == NULL) || r; + r = ((glImageTransformParameterivHP = (PFNGLIMAGETRANSFORMPARAMETERIVHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterivHP")) == NULL) || r; + + return r; +} + +#endif /* GL_HP_image_transform */ + +#ifdef GL_HP_occlusion_test + +#endif /* GL_HP_occlusion_test */ + +#ifdef GL_HP_texture_lighting + +#endif /* GL_HP_texture_lighting */ + +#ifdef GL_IBM_cull_vertex + +#endif /* GL_IBM_cull_vertex */ + +#ifdef GL_IBM_multimode_draw_arrays + +static GLboolean _glewInit_GL_IBM_multimode_draw_arrays (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMultiModeDrawArraysIBM = (PFNGLMULTIMODEDRAWARRAYSIBMPROC)glewGetProcAddress((const GLubyte*)"glMultiModeDrawArraysIBM")) == NULL) || r; + r = ((glMultiModeDrawElementsIBM = (PFNGLMULTIMODEDRAWELEMENTSIBMPROC)glewGetProcAddress((const GLubyte*)"glMultiModeDrawElementsIBM")) == NULL) || r; + + return r; +} + +#endif /* GL_IBM_multimode_draw_arrays */ + +#ifdef GL_IBM_rasterpos_clip + +#endif /* GL_IBM_rasterpos_clip */ + +#ifdef GL_IBM_static_data + +#endif /* GL_IBM_static_data */ + +#ifdef GL_IBM_texture_mirrored_repeat + +#endif /* GL_IBM_texture_mirrored_repeat */ + +#ifdef GL_IBM_vertex_array_lists + +static GLboolean _glewInit_GL_IBM_vertex_array_lists (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorPointerListIBM = (PFNGLCOLORPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glColorPointerListIBM")) == NULL) || r; + r = ((glEdgeFlagPointerListIBM = (PFNGLEDGEFLAGPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagPointerListIBM")) == NULL) || r; + r = ((glFogCoordPointerListIBM = (PFNGLFOGCOORDPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointerListIBM")) == NULL) || r; + r = ((glIndexPointerListIBM = (PFNGLINDEXPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glIndexPointerListIBM")) == NULL) || r; + r = ((glNormalPointerListIBM = (PFNGLNORMALPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glNormalPointerListIBM")) == NULL) || r; + r = ((glSecondaryColorPointerListIBM = (PFNGLSECONDARYCOLORPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointerListIBM")) == NULL) || r; + r = ((glTexCoordPointerListIBM = (PFNGLTEXCOORDPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointerListIBM")) == NULL) || r; + r = ((glVertexPointerListIBM = (PFNGLVERTEXPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glVertexPointerListIBM")) == NULL) || r; + + return r; +} + +#endif /* GL_IBM_vertex_array_lists */ + +#ifdef GL_INGR_color_clamp + +#endif /* GL_INGR_color_clamp */ + +#ifdef GL_INGR_interlace_read + +#endif /* GL_INGR_interlace_read */ + +#ifdef GL_INTEL_parallel_arrays + +static GLboolean _glewInit_GL_INTEL_parallel_arrays (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorPointervINTEL = (PFNGLCOLORPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glColorPointervINTEL")) == NULL) || r; + r = ((glNormalPointervINTEL = (PFNGLNORMALPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glNormalPointervINTEL")) == NULL) || r; + r = ((glTexCoordPointervINTEL = (PFNGLTEXCOORDPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointervINTEL")) == NULL) || r; + r = ((glVertexPointervINTEL = (PFNGLVERTEXPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glVertexPointervINTEL")) == NULL) || r; + + return r; +} + +#endif /* GL_INTEL_parallel_arrays */ + +#ifdef GL_INTEL_texture_scissor + +static GLboolean _glewInit_GL_INTEL_texture_scissor (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexScissorFuncINTEL = (PFNGLTEXSCISSORFUNCINTELPROC)glewGetProcAddress((const GLubyte*)"glTexScissorFuncINTEL")) == NULL) || r; + r = ((glTexScissorINTEL = (PFNGLTEXSCISSORINTELPROC)glewGetProcAddress((const GLubyte*)"glTexScissorINTEL")) == NULL) || r; + + return r; +} + +#endif /* GL_INTEL_texture_scissor */ + +#ifdef GL_KTX_buffer_region + +static GLboolean _glewInit_GL_KTX_buffer_region (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBufferRegionEnabledEXT = (PFNGLBUFFERREGIONENABLEDEXTPROC)glewGetProcAddress((const GLubyte*)"glBufferRegionEnabledEXT")) == NULL) || r; + r = ((glDeleteBufferRegionEXT = (PFNGLDELETEBUFFERREGIONEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteBufferRegionEXT")) == NULL) || r; + r = ((glDrawBufferRegionEXT = (PFNGLDRAWBUFFERREGIONEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawBufferRegionEXT")) == NULL) || r; + r = ((glNewBufferRegionEXT = (PFNGLNEWBUFFERREGIONEXTPROC)glewGetProcAddress((const GLubyte*)"glNewBufferRegionEXT")) == NULL) || r; + r = ((glReadBufferRegionEXT = (PFNGLREADBUFFERREGIONEXTPROC)glewGetProcAddress((const GLubyte*)"glReadBufferRegionEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_KTX_buffer_region */ + +#ifdef GL_MESAX_texture_stack + +#endif /* GL_MESAX_texture_stack */ + +#ifdef GL_MESA_pack_invert + +#endif /* GL_MESA_pack_invert */ + +#ifdef GL_MESA_resize_buffers + +static GLboolean _glewInit_GL_MESA_resize_buffers (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glResizeBuffersMESA = (PFNGLRESIZEBUFFERSMESAPROC)glewGetProcAddress((const GLubyte*)"glResizeBuffersMESA")) == NULL) || r; + + return r; +} + +#endif /* GL_MESA_resize_buffers */ + +#ifdef GL_MESA_window_pos + +static GLboolean _glewInit_GL_MESA_window_pos (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glWindowPos2dMESA = (PFNGLWINDOWPOS2DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dMESA")) == NULL) || r; + r = ((glWindowPos2dvMESA = (PFNGLWINDOWPOS2DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dvMESA")) == NULL) || r; + r = ((glWindowPos2fMESA = (PFNGLWINDOWPOS2FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fMESA")) == NULL) || r; + r = ((glWindowPos2fvMESA = (PFNGLWINDOWPOS2FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fvMESA")) == NULL) || r; + r = ((glWindowPos2iMESA = (PFNGLWINDOWPOS2IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iMESA")) == NULL) || r; + r = ((glWindowPos2ivMESA = (PFNGLWINDOWPOS2IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2ivMESA")) == NULL) || r; + r = ((glWindowPos2sMESA = (PFNGLWINDOWPOS2SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sMESA")) == NULL) || r; + r = ((glWindowPos2svMESA = (PFNGLWINDOWPOS2SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2svMESA")) == NULL) || r; + r = ((glWindowPos3dMESA = (PFNGLWINDOWPOS3DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dMESA")) == NULL) || r; + r = ((glWindowPos3dvMESA = (PFNGLWINDOWPOS3DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dvMESA")) == NULL) || r; + r = ((glWindowPos3fMESA = (PFNGLWINDOWPOS3FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fMESA")) == NULL) || r; + r = ((glWindowPos3fvMESA = (PFNGLWINDOWPOS3FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fvMESA")) == NULL) || r; + r = ((glWindowPos3iMESA = (PFNGLWINDOWPOS3IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iMESA")) == NULL) || r; + r = ((glWindowPos3ivMESA = (PFNGLWINDOWPOS3IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3ivMESA")) == NULL) || r; + r = ((glWindowPos3sMESA = (PFNGLWINDOWPOS3SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sMESA")) == NULL) || r; + r = ((glWindowPos3svMESA = (PFNGLWINDOWPOS3SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3svMESA")) == NULL) || r; + r = ((glWindowPos4dMESA = (PFNGLWINDOWPOS4DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4dMESA")) == NULL) || r; + r = ((glWindowPos4dvMESA = (PFNGLWINDOWPOS4DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4dvMESA")) == NULL) || r; + r = ((glWindowPos4fMESA = (PFNGLWINDOWPOS4FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4fMESA")) == NULL) || r; + r = ((glWindowPos4fvMESA = (PFNGLWINDOWPOS4FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4fvMESA")) == NULL) || r; + r = ((glWindowPos4iMESA = (PFNGLWINDOWPOS4IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4iMESA")) == NULL) || r; + r = ((glWindowPos4ivMESA = (PFNGLWINDOWPOS4IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4ivMESA")) == NULL) || r; + r = ((glWindowPos4sMESA = (PFNGLWINDOWPOS4SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4sMESA")) == NULL) || r; + r = ((glWindowPos4svMESA = (PFNGLWINDOWPOS4SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4svMESA")) == NULL) || r; + + return r; +} + +#endif /* GL_MESA_window_pos */ + +#ifdef GL_MESA_ycbcr_texture + +#endif /* GL_MESA_ycbcr_texture */ + +#ifdef GL_NV_blend_square + +#endif /* GL_NV_blend_square */ + +#ifdef GL_NV_copy_depth_to_color + +#endif /* GL_NV_copy_depth_to_color */ + +#ifdef GL_NV_depth_clamp + +#endif /* GL_NV_depth_clamp */ + +#ifdef GL_NV_evaluators + +static GLboolean _glewInit_GL_NV_evaluators (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glEvalMapsNV = (PFNGLEVALMAPSNVPROC)glewGetProcAddress((const GLubyte*)"glEvalMapsNV")) == NULL) || r; + r = ((glGetMapAttribParameterfvNV = (PFNGLGETMAPATTRIBPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapAttribParameterfvNV")) == NULL) || r; + r = ((glGetMapAttribParameterivNV = (PFNGLGETMAPATTRIBPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapAttribParameterivNV")) == NULL) || r; + r = ((glGetMapControlPointsNV = (PFNGLGETMAPCONTROLPOINTSNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapControlPointsNV")) == NULL) || r; + r = ((glGetMapParameterfvNV = (PFNGLGETMAPPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapParameterfvNV")) == NULL) || r; + r = ((glGetMapParameterivNV = (PFNGLGETMAPPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapParameterivNV")) == NULL) || r; + r = ((glMapControlPointsNV = (PFNGLMAPCONTROLPOINTSNVPROC)glewGetProcAddress((const GLubyte*)"glMapControlPointsNV")) == NULL) || r; + r = ((glMapParameterfvNV = (PFNGLMAPPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glMapParameterfvNV")) == NULL) || r; + r = ((glMapParameterivNV = (PFNGLMAPPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glMapParameterivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_evaluators */ + +#ifdef GL_NV_fence + +static GLboolean _glewInit_GL_NV_fence (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDeleteFencesNV = (PFNGLDELETEFENCESNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteFencesNV")) == NULL) || r; + r = ((glFinishFenceNV = (PFNGLFINISHFENCENVPROC)glewGetProcAddress((const GLubyte*)"glFinishFenceNV")) == NULL) || r; + r = ((glGenFencesNV = (PFNGLGENFENCESNVPROC)glewGetProcAddress((const GLubyte*)"glGenFencesNV")) == NULL) || r; + r = ((glGetFenceivNV = (PFNGLGETFENCEIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFenceivNV")) == NULL) || r; + r = ((glIsFenceNV = (PFNGLISFENCENVPROC)glewGetProcAddress((const GLubyte*)"glIsFenceNV")) == NULL) || r; + r = ((glSetFenceNV = (PFNGLSETFENCENVPROC)glewGetProcAddress((const GLubyte*)"glSetFenceNV")) == NULL) || r; + r = ((glTestFenceNV = (PFNGLTESTFENCENVPROC)glewGetProcAddress((const GLubyte*)"glTestFenceNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_fence */ + +#ifdef GL_NV_float_buffer + +#endif /* GL_NV_float_buffer */ + +#ifdef GL_NV_fog_distance + +#endif /* GL_NV_fog_distance */ + +#ifdef GL_NV_fragment_program + +static GLboolean _glewInit_GL_NV_fragment_program (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetProgramNamedParameterdvNV = (PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramNamedParameterdvNV")) == NULL) || r; + r = ((glGetProgramNamedParameterfvNV = (PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramNamedParameterfvNV")) == NULL) || r; + r = ((glProgramNamedParameter4dNV = (PFNGLPROGRAMNAMEDPARAMETER4DNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4dNV")) == NULL) || r; + r = ((glProgramNamedParameter4dvNV = (PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4dvNV")) == NULL) || r; + r = ((glProgramNamedParameter4fNV = (PFNGLPROGRAMNAMEDPARAMETER4FNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4fNV")) == NULL) || r; + r = ((glProgramNamedParameter4fvNV = (PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4fvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_fragment_program */ + +#ifdef GL_NV_fragment_program2 + +#endif /* GL_NV_fragment_program2 */ + +#ifdef GL_NV_fragment_program_option + +#endif /* GL_NV_fragment_program_option */ + +#ifdef GL_NV_half_float + +static GLboolean _glewInit_GL_NV_half_float (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColor3hNV = (PFNGLCOLOR3HNVPROC)glewGetProcAddress((const GLubyte*)"glColor3hNV")) == NULL) || r; + r = ((glColor3hvNV = (PFNGLCOLOR3HVNVPROC)glewGetProcAddress((const GLubyte*)"glColor3hvNV")) == NULL) || r; + r = ((glColor4hNV = (PFNGLCOLOR4HNVPROC)glewGetProcAddress((const GLubyte*)"glColor4hNV")) == NULL) || r; + r = ((glColor4hvNV = (PFNGLCOLOR4HVNVPROC)glewGetProcAddress((const GLubyte*)"glColor4hvNV")) == NULL) || r; + r = ((glFogCoordhNV = (PFNGLFOGCOORDHNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordhNV")) == NULL) || r; + r = ((glFogCoordhvNV = (PFNGLFOGCOORDHVNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordhvNV")) == NULL) || r; + r = ((glMultiTexCoord1hNV = (PFNGLMULTITEXCOORD1HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1hNV")) == NULL) || r; + r = ((glMultiTexCoord1hvNV = (PFNGLMULTITEXCOORD1HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1hvNV")) == NULL) || r; + r = ((glMultiTexCoord2hNV = (PFNGLMULTITEXCOORD2HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2hNV")) == NULL) || r; + r = ((glMultiTexCoord2hvNV = (PFNGLMULTITEXCOORD2HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2hvNV")) == NULL) || r; + r = ((glMultiTexCoord3hNV = (PFNGLMULTITEXCOORD3HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3hNV")) == NULL) || r; + r = ((glMultiTexCoord3hvNV = (PFNGLMULTITEXCOORD3HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3hvNV")) == NULL) || r; + r = ((glMultiTexCoord4hNV = (PFNGLMULTITEXCOORD4HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4hNV")) == NULL) || r; + r = ((glMultiTexCoord4hvNV = (PFNGLMULTITEXCOORD4HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4hvNV")) == NULL) || r; + r = ((glNormal3hNV = (PFNGLNORMAL3HNVPROC)glewGetProcAddress((const GLubyte*)"glNormal3hNV")) == NULL) || r; + r = ((glNormal3hvNV = (PFNGLNORMAL3HVNVPROC)glewGetProcAddress((const GLubyte*)"glNormal3hvNV")) == NULL) || r; + r = ((glSecondaryColor3hNV = (PFNGLSECONDARYCOLOR3HNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3hNV")) == NULL) || r; + r = ((glSecondaryColor3hvNV = (PFNGLSECONDARYCOLOR3HVNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3hvNV")) == NULL) || r; + r = ((glTexCoord1hNV = (PFNGLTEXCOORD1HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord1hNV")) == NULL) || r; + r = ((glTexCoord1hvNV = (PFNGLTEXCOORD1HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord1hvNV")) == NULL) || r; + r = ((glTexCoord2hNV = (PFNGLTEXCOORD2HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2hNV")) == NULL) || r; + r = ((glTexCoord2hvNV = (PFNGLTEXCOORD2HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2hvNV")) == NULL) || r; + r = ((glTexCoord3hNV = (PFNGLTEXCOORD3HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord3hNV")) == NULL) || r; + r = ((glTexCoord3hvNV = (PFNGLTEXCOORD3HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord3hvNV")) == NULL) || r; + r = ((glTexCoord4hNV = (PFNGLTEXCOORD4HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4hNV")) == NULL) || r; + r = ((glTexCoord4hvNV = (PFNGLTEXCOORD4HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4hvNV")) == NULL) || r; + r = ((glVertex2hNV = (PFNGLVERTEX2HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex2hNV")) == NULL) || r; + r = ((glVertex2hvNV = (PFNGLVERTEX2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex2hvNV")) == NULL) || r; + r = ((glVertex3hNV = (PFNGLVERTEX3HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex3hNV")) == NULL) || r; + r = ((glVertex3hvNV = (PFNGLVERTEX3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex3hvNV")) == NULL) || r; + r = ((glVertex4hNV = (PFNGLVERTEX4HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex4hNV")) == NULL) || r; + r = ((glVertex4hvNV = (PFNGLVERTEX4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex4hvNV")) == NULL) || r; + r = ((glVertexAttrib1hNV = (PFNGLVERTEXATTRIB1HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1hNV")) == NULL) || r; + r = ((glVertexAttrib1hvNV = (PFNGLVERTEXATTRIB1HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1hvNV")) == NULL) || r; + r = ((glVertexAttrib2hNV = (PFNGLVERTEXATTRIB2HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2hNV")) == NULL) || r; + r = ((glVertexAttrib2hvNV = (PFNGLVERTEXATTRIB2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2hvNV")) == NULL) || r; + r = ((glVertexAttrib3hNV = (PFNGLVERTEXATTRIB3HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3hNV")) == NULL) || r; + r = ((glVertexAttrib3hvNV = (PFNGLVERTEXATTRIB3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3hvNV")) == NULL) || r; + r = ((glVertexAttrib4hNV = (PFNGLVERTEXATTRIB4HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4hNV")) == NULL) || r; + r = ((glVertexAttrib4hvNV = (PFNGLVERTEXATTRIB4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4hvNV")) == NULL) || r; + r = ((glVertexAttribs1hvNV = (PFNGLVERTEXATTRIBS1HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1hvNV")) == NULL) || r; + r = ((glVertexAttribs2hvNV = (PFNGLVERTEXATTRIBS2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2hvNV")) == NULL) || r; + r = ((glVertexAttribs3hvNV = (PFNGLVERTEXATTRIBS3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3hvNV")) == NULL) || r; + r = ((glVertexAttribs4hvNV = (PFNGLVERTEXATTRIBS4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4hvNV")) == NULL) || r; + r = ((glVertexWeighthNV = (PFNGLVERTEXWEIGHTHNVPROC)glewGetProcAddress((const GLubyte*)"glVertexWeighthNV")) == NULL) || r; + r = ((glVertexWeighthvNV = (PFNGLVERTEXWEIGHTHVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexWeighthvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_half_float */ + +#ifdef GL_NV_light_max_exponent + +#endif /* GL_NV_light_max_exponent */ + +#ifdef GL_NV_multisample_filter_hint + +#endif /* GL_NV_multisample_filter_hint */ + +#ifdef GL_NV_occlusion_query + +static GLboolean _glewInit_GL_NV_occlusion_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginOcclusionQueryNV = (PFNGLBEGINOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glBeginOcclusionQueryNV")) == NULL) || r; + r = ((glDeleteOcclusionQueriesNV = (PFNGLDELETEOCCLUSIONQUERIESNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteOcclusionQueriesNV")) == NULL) || r; + r = ((glEndOcclusionQueryNV = (PFNGLENDOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glEndOcclusionQueryNV")) == NULL) || r; + r = ((glGenOcclusionQueriesNV = (PFNGLGENOCCLUSIONQUERIESNVPROC)glewGetProcAddress((const GLubyte*)"glGenOcclusionQueriesNV")) == NULL) || r; + r = ((glGetOcclusionQueryivNV = (PFNGLGETOCCLUSIONQUERYIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetOcclusionQueryivNV")) == NULL) || r; + r = ((glGetOcclusionQueryuivNV = (PFNGLGETOCCLUSIONQUERYUIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetOcclusionQueryuivNV")) == NULL) || r; + r = ((glIsOcclusionQueryNV = (PFNGLISOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glIsOcclusionQueryNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_occlusion_query */ + +#ifdef GL_NV_packed_depth_stencil + +#endif /* GL_NV_packed_depth_stencil */ + +#ifdef GL_NV_pixel_data_range + +static GLboolean _glewInit_GL_NV_pixel_data_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFlushPixelDataRangeNV = (PFNGLFLUSHPIXELDATARANGENVPROC)glewGetProcAddress((const GLubyte*)"glFlushPixelDataRangeNV")) == NULL) || r; + r = ((glPixelDataRangeNV = (PFNGLPIXELDATARANGENVPROC)glewGetProcAddress((const GLubyte*)"glPixelDataRangeNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_pixel_data_range */ + +#ifdef GL_NV_point_sprite + +static GLboolean _glewInit_GL_NV_point_sprite (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPointParameteriNV = (PFNGLPOINTPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glPointParameteriNV")) == NULL) || r; + r = ((glPointParameterivNV = (PFNGLPOINTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_point_sprite */ + +#ifdef GL_NV_primitive_restart + +static GLboolean _glewInit_GL_NV_primitive_restart (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPrimitiveRestartIndexNV = (PFNGLPRIMITIVERESTARTINDEXNVPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartIndexNV")) == NULL) || r; + r = ((glPrimitiveRestartNV = (PFNGLPRIMITIVERESTARTNVPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_primitive_restart */ + +#ifdef GL_NV_register_combiners + +static GLboolean _glewInit_GL_NV_register_combiners (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCombinerInputNV = (PFNGLCOMBINERINPUTNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerInputNV")) == NULL) || r; + r = ((glCombinerOutputNV = (PFNGLCOMBINEROUTPUTNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerOutputNV")) == NULL) || r; + r = ((glCombinerParameterfNV = (PFNGLCOMBINERPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterfNV")) == NULL) || r; + r = ((glCombinerParameterfvNV = (PFNGLCOMBINERPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterfvNV")) == NULL) || r; + r = ((glCombinerParameteriNV = (PFNGLCOMBINERPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameteriNV")) == NULL) || r; + r = ((glCombinerParameterivNV = (PFNGLCOMBINERPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterivNV")) == NULL) || r; + r = ((glFinalCombinerInputNV = (PFNGLFINALCOMBINERINPUTNVPROC)glewGetProcAddress((const GLubyte*)"glFinalCombinerInputNV")) == NULL) || r; + r = ((glGetCombinerInputParameterfvNV = (PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerInputParameterfvNV")) == NULL) || r; + r = ((glGetCombinerInputParameterivNV = (PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerInputParameterivNV")) == NULL) || r; + r = ((glGetCombinerOutputParameterfvNV = (PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerOutputParameterfvNV")) == NULL) || r; + r = ((glGetCombinerOutputParameterivNV = (PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerOutputParameterivNV")) == NULL) || r; + r = ((glGetFinalCombinerInputParameterfvNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFinalCombinerInputParameterfvNV")) == NULL) || r; + r = ((glGetFinalCombinerInputParameterivNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFinalCombinerInputParameterivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_register_combiners */ + +#ifdef GL_NV_register_combiners2 + +static GLboolean _glewInit_GL_NV_register_combiners2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCombinerStageParameterfvNV = (PFNGLCOMBINERSTAGEPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerStageParameterfvNV")) == NULL) || r; + r = ((glGetCombinerStageParameterfvNV = (PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerStageParameterfvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_register_combiners2 */ + +#ifdef GL_NV_texgen_emboss + +#endif /* GL_NV_texgen_emboss */ + +#ifdef GL_NV_texgen_reflection + +#endif /* GL_NV_texgen_reflection */ + +#ifdef GL_NV_texture_compression_vtc + +#endif /* GL_NV_texture_compression_vtc */ + +#ifdef GL_NV_texture_env_combine4 + +#endif /* GL_NV_texture_env_combine4 */ + +#ifdef GL_NV_texture_expand_normal + +#endif /* GL_NV_texture_expand_normal */ + +#ifdef GL_NV_texture_rectangle + +#endif /* GL_NV_texture_rectangle */ + +#ifdef GL_NV_texture_shader + +#endif /* GL_NV_texture_shader */ + +#ifdef GL_NV_texture_shader2 + +#endif /* GL_NV_texture_shader2 */ + +#ifdef GL_NV_texture_shader3 + +#endif /* GL_NV_texture_shader3 */ + +#ifdef GL_NV_vertex_array_range + +static GLboolean _glewInit_GL_NV_vertex_array_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFlushVertexArrayRangeNV = (PFNGLFLUSHVERTEXARRAYRANGENVPROC)glewGetProcAddress((const GLubyte*)"glFlushVertexArrayRangeNV")) == NULL) || r; + r = ((glVertexArrayRangeNV = (PFNGLVERTEXARRAYRANGENVPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayRangeNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vertex_array_range */ + +#ifdef GL_NV_vertex_array_range2 + +#endif /* GL_NV_vertex_array_range2 */ + +#ifdef GL_NV_vertex_program + +static GLboolean _glewInit_GL_NV_vertex_program (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAreProgramsResidentNV = (PFNGLAREPROGRAMSRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glAreProgramsResidentNV")) == NULL) || r; + r = ((glBindProgramNV = (PFNGLBINDPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glBindProgramNV")) == NULL) || r; + r = ((glDeleteProgramsNV = (PFNGLDELETEPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramsNV")) == NULL) || r; + r = ((glExecuteProgramNV = (PFNGLEXECUTEPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glExecuteProgramNV")) == NULL) || r; + r = ((glGenProgramsNV = (PFNGLGENPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glGenProgramsNV")) == NULL) || r; + r = ((glGetProgramParameterdvNV = (PFNGLGETPROGRAMPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramParameterdvNV")) == NULL) || r; + r = ((glGetProgramParameterfvNV = (PFNGLGETPROGRAMPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramParameterfvNV")) == NULL) || r; + r = ((glGetProgramStringNV = (PFNGLGETPROGRAMSTRINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStringNV")) == NULL) || r; + r = ((glGetProgramivNV = (PFNGLGETPROGRAMIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramivNV")) == NULL) || r; + r = ((glGetTrackMatrixivNV = (PFNGLGETTRACKMATRIXIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetTrackMatrixivNV")) == NULL) || r; + r = ((glGetVertexAttribPointervNV = (PFNGLGETVERTEXATTRIBPOINTERVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointervNV")) == NULL) || r; + r = ((glGetVertexAttribdvNV = (PFNGLGETVERTEXATTRIBDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdvNV")) == NULL) || r; + r = ((glGetVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfvNV")) == NULL) || r; + r = ((glGetVertexAttribivNV = (PFNGLGETVERTEXATTRIBIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribivNV")) == NULL) || r; + r = ((glIsProgramNV = (PFNGLISPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glIsProgramNV")) == NULL) || r; + r = ((glLoadProgramNV = (PFNGLLOADPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glLoadProgramNV")) == NULL) || r; + r = ((glProgramParameter4dNV = (PFNGLPROGRAMPARAMETER4DNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4dNV")) == NULL) || r; + r = ((glProgramParameter4dvNV = (PFNGLPROGRAMPARAMETER4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4dvNV")) == NULL) || r; + r = ((glProgramParameter4fNV = (PFNGLPROGRAMPARAMETER4FNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4fNV")) == NULL) || r; + r = ((glProgramParameter4fvNV = (PFNGLPROGRAMPARAMETER4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4fvNV")) == NULL) || r; + r = ((glProgramParameters4dvNV = (PFNGLPROGRAMPARAMETERS4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameters4dvNV")) == NULL) || r; + r = ((glProgramParameters4fvNV = (PFNGLPROGRAMPARAMETERS4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameters4fvNV")) == NULL) || r; + r = ((glRequestResidentProgramsNV = (PFNGLREQUESTRESIDENTPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glRequestResidentProgramsNV")) == NULL) || r; + r = ((glTrackMatrixNV = (PFNGLTRACKMATRIXNVPROC)glewGetProcAddress((const GLubyte*)"glTrackMatrixNV")) == NULL) || r; + r = ((glVertexAttrib1dNV = (PFNGLVERTEXATTRIB1DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dNV")) == NULL) || r; + r = ((glVertexAttrib1dvNV = (PFNGLVERTEXATTRIB1DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dvNV")) == NULL) || r; + r = ((glVertexAttrib1fNV = (PFNGLVERTEXATTRIB1FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fNV")) == NULL) || r; + r = ((glVertexAttrib1fvNV = (PFNGLVERTEXATTRIB1FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fvNV")) == NULL) || r; + r = ((glVertexAttrib1sNV = (PFNGLVERTEXATTRIB1SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sNV")) == NULL) || r; + r = ((glVertexAttrib1svNV = (PFNGLVERTEXATTRIB1SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1svNV")) == NULL) || r; + r = ((glVertexAttrib2dNV = (PFNGLVERTEXATTRIB2DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dNV")) == NULL) || r; + r = ((glVertexAttrib2dvNV = (PFNGLVERTEXATTRIB2DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dvNV")) == NULL) || r; + r = ((glVertexAttrib2fNV = (PFNGLVERTEXATTRIB2FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fNV")) == NULL) || r; + r = ((glVertexAttrib2fvNV = (PFNGLVERTEXATTRIB2FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fvNV")) == NULL) || r; + r = ((glVertexAttrib2sNV = (PFNGLVERTEXATTRIB2SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sNV")) == NULL) || r; + r = ((glVertexAttrib2svNV = (PFNGLVERTEXATTRIB2SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2svNV")) == NULL) || r; + r = ((glVertexAttrib3dNV = (PFNGLVERTEXATTRIB3DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dNV")) == NULL) || r; + r = ((glVertexAttrib3dvNV = (PFNGLVERTEXATTRIB3DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dvNV")) == NULL) || r; + r = ((glVertexAttrib3fNV = (PFNGLVERTEXATTRIB3FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fNV")) == NULL) || r; + r = ((glVertexAttrib3fvNV = (PFNGLVERTEXATTRIB3FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fvNV")) == NULL) || r; + r = ((glVertexAttrib3sNV = (PFNGLVERTEXATTRIB3SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sNV")) == NULL) || r; + r = ((glVertexAttrib3svNV = (PFNGLVERTEXATTRIB3SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3svNV")) == NULL) || r; + r = ((glVertexAttrib4dNV = (PFNGLVERTEXATTRIB4DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dNV")) == NULL) || r; + r = ((glVertexAttrib4dvNV = (PFNGLVERTEXATTRIB4DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dvNV")) == NULL) || r; + r = ((glVertexAttrib4fNV = (PFNGLVERTEXATTRIB4FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fNV")) == NULL) || r; + r = ((glVertexAttrib4fvNV = (PFNGLVERTEXATTRIB4FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fvNV")) == NULL) || r; + r = ((glVertexAttrib4sNV = (PFNGLVERTEXATTRIB4SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sNV")) == NULL) || r; + r = ((glVertexAttrib4svNV = (PFNGLVERTEXATTRIB4SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4svNV")) == NULL) || r; + r = ((glVertexAttrib4ubNV = (PFNGLVERTEXATTRIB4UBNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubNV")) == NULL) || r; + r = ((glVertexAttrib4ubvNV = (PFNGLVERTEXATTRIB4UBVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubvNV")) == NULL) || r; + r = ((glVertexAttribPointerNV = (PFNGLVERTEXATTRIBPOINTERNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointerNV")) == NULL) || r; + r = ((glVertexAttribs1dvNV = (PFNGLVERTEXATTRIBS1DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1dvNV")) == NULL) || r; + r = ((glVertexAttribs1fvNV = (PFNGLVERTEXATTRIBS1FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1fvNV")) == NULL) || r; + r = ((glVertexAttribs1svNV = (PFNGLVERTEXATTRIBS1SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1svNV")) == NULL) || r; + r = ((glVertexAttribs2dvNV = (PFNGLVERTEXATTRIBS2DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2dvNV")) == NULL) || r; + r = ((glVertexAttribs2fvNV = (PFNGLVERTEXATTRIBS2FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2fvNV")) == NULL) || r; + r = ((glVertexAttribs2svNV = (PFNGLVERTEXATTRIBS2SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2svNV")) == NULL) || r; + r = ((glVertexAttribs3dvNV = (PFNGLVERTEXATTRIBS3DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3dvNV")) == NULL) || r; + r = ((glVertexAttribs3fvNV = (PFNGLVERTEXATTRIBS3FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3fvNV")) == NULL) || r; + r = ((glVertexAttribs3svNV = (PFNGLVERTEXATTRIBS3SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3svNV")) == NULL) || r; + r = ((glVertexAttribs4dvNV = (PFNGLVERTEXATTRIBS4DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4dvNV")) == NULL) || r; + r = ((glVertexAttribs4fvNV = (PFNGLVERTEXATTRIBS4FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4fvNV")) == NULL) || r; + r = ((glVertexAttribs4svNV = (PFNGLVERTEXATTRIBS4SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4svNV")) == NULL) || r; + r = ((glVertexAttribs4ubvNV = (PFNGLVERTEXATTRIBS4UBVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4ubvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vertex_program */ + +#ifdef GL_NV_vertex_program1_1 + +#endif /* GL_NV_vertex_program1_1 */ + +#ifdef GL_NV_vertex_program2 + +#endif /* GL_NV_vertex_program2 */ + +#ifdef GL_NV_vertex_program2_option + +#endif /* GL_NV_vertex_program2_option */ + +#ifdef GL_NV_vertex_program3 + +#endif /* GL_NV_vertex_program3 */ + +#ifdef GL_OML_interlace + +#endif /* GL_OML_interlace */ + +#ifdef GL_OML_resample + +#endif /* GL_OML_resample */ + +#ifdef GL_OML_subsample + +#endif /* GL_OML_subsample */ + +#ifdef GL_PGI_misc_hints + +#endif /* GL_PGI_misc_hints */ + +#ifdef GL_PGI_vertex_hints + +#endif /* GL_PGI_vertex_hints */ + +#ifdef GL_REND_screen_coordinates + +#endif /* GL_REND_screen_coordinates */ + +#ifdef GL_S3_s3tc + +#endif /* GL_S3_s3tc */ + +#ifdef GL_SGIS_color_range + +#endif /* GL_SGIS_color_range */ + +#ifdef GL_SGIS_detail_texture + +static GLboolean _glewInit_GL_SGIS_detail_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDetailTexFuncSGIS = (PFNGLDETAILTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glDetailTexFuncSGIS")) == NULL) || r; + r = ((glGetDetailTexFuncSGIS = (PFNGLGETDETAILTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetDetailTexFuncSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_detail_texture */ + +#ifdef GL_SGIS_fog_function + +static GLboolean _glewInit_GL_SGIS_fog_function (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFogFuncSGIS = (PFNGLFOGFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glFogFuncSGIS")) == NULL) || r; + r = ((glGetFogFuncSGIS = (PFNGLGETFOGFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetFogFuncSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_fog_function */ + +#ifdef GL_SGIS_generate_mipmap + +#endif /* GL_SGIS_generate_mipmap */ + +#ifdef GL_SGIS_multisample + +static GLboolean _glewInit_GL_SGIS_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSampleMaskSGIS = (PFNGLSAMPLEMASKSGISPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskSGIS")) == NULL) || r; + r = ((glSamplePatternSGIS = (PFNGLSAMPLEPATTERNSGISPROC)glewGetProcAddress((const GLubyte*)"glSamplePatternSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_multisample */ + +#ifdef GL_SGIS_pixel_texture + +#endif /* GL_SGIS_pixel_texture */ + +#ifdef GL_SGIS_sharpen_texture + +static GLboolean _glewInit_GL_SGIS_sharpen_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetSharpenTexFuncSGIS = (PFNGLGETSHARPENTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetSharpenTexFuncSGIS")) == NULL) || r; + r = ((glSharpenTexFuncSGIS = (PFNGLSHARPENTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glSharpenTexFuncSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_sharpen_texture */ + +#ifdef GL_SGIS_texture4D + +static GLboolean _glewInit_GL_SGIS_texture4D (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexImage4DSGIS = (PFNGLTEXIMAGE4DSGISPROC)glewGetProcAddress((const GLubyte*)"glTexImage4DSGIS")) == NULL) || r; + r = ((glTexSubImage4DSGIS = (PFNGLTEXSUBIMAGE4DSGISPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage4DSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_texture4D */ + +#ifdef GL_SGIS_texture_border_clamp + +#endif /* GL_SGIS_texture_border_clamp */ + +#ifdef GL_SGIS_texture_edge_clamp + +#endif /* GL_SGIS_texture_edge_clamp */ + +#ifdef GL_SGIS_texture_filter4 + +static GLboolean _glewInit_GL_SGIS_texture_filter4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetTexFilterFuncSGIS = (PFNGLGETTEXFILTERFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetTexFilterFuncSGIS")) == NULL) || r; + r = ((glTexFilterFuncSGIS = (PFNGLTEXFILTERFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glTexFilterFuncSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_texture_filter4 */ + +#ifdef GL_SGIS_texture_lod + +#endif /* GL_SGIS_texture_lod */ + +#ifdef GL_SGIS_texture_select + +#endif /* GL_SGIS_texture_select */ + +#ifdef GL_SGIX_async + +static GLboolean _glewInit_GL_SGIX_async (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAsyncMarkerSGIX = (PFNGLASYNCMARKERSGIXPROC)glewGetProcAddress((const GLubyte*)"glAsyncMarkerSGIX")) == NULL) || r; + r = ((glDeleteAsyncMarkersSGIX = (PFNGLDELETEASYNCMARKERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glDeleteAsyncMarkersSGIX")) == NULL) || r; + r = ((glFinishAsyncSGIX = (PFNGLFINISHASYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glFinishAsyncSGIX")) == NULL) || r; + r = ((glGenAsyncMarkersSGIX = (PFNGLGENASYNCMARKERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glGenAsyncMarkersSGIX")) == NULL) || r; + r = ((glIsAsyncMarkerSGIX = (PFNGLISASYNCMARKERSGIXPROC)glewGetProcAddress((const GLubyte*)"glIsAsyncMarkerSGIX")) == NULL) || r; + r = ((glPollAsyncSGIX = (PFNGLPOLLASYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glPollAsyncSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_async */ + +#ifdef GL_SGIX_async_histogram + +#endif /* GL_SGIX_async_histogram */ + +#ifdef GL_SGIX_async_pixel + +#endif /* GL_SGIX_async_pixel */ + +#ifdef GL_SGIX_blend_alpha_minmax + +#endif /* GL_SGIX_blend_alpha_minmax */ + +#ifdef GL_SGIX_clipmap + +#endif /* GL_SGIX_clipmap */ + +#ifdef GL_SGIX_depth_texture + +#endif /* GL_SGIX_depth_texture */ + +#ifdef GL_SGIX_flush_raster + +static GLboolean _glewInit_GL_SGIX_flush_raster (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFlushRasterSGIX = (PFNGLFLUSHRASTERSGIXPROC)glewGetProcAddress((const GLubyte*)"glFlushRasterSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_flush_raster */ + +#ifdef GL_SGIX_fog_offset + +#endif /* GL_SGIX_fog_offset */ + +#ifdef GL_SGIX_fog_texture + +static GLboolean _glewInit_GL_SGIX_fog_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTextureFogSGIX = (PFNGLTEXTUREFOGSGIXPROC)glewGetProcAddress((const GLubyte*)"glTextureFogSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_fog_texture */ + +#ifdef GL_SGIX_fragment_specular_lighting + +static GLboolean _glewInit_GL_SGIX_fragment_specular_lighting (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + +#if 0 + r = ((glFragmentColorMaterialSGIX = (PFNGLFRAGMENTCOLORMATERIALSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentColorMaterialSGIX")) == NULL) || r; + r = ((glFragmentLightModelfSGIX = (PFNGLFRAGMENTLIGHTMODELFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfSGIX")) == NULL) || r; + r = ((glFragmentLightModelfvSGIX = (PFNGLFRAGMENTLIGHTMODELFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfvSGIX")) == NULL) || r; + r = ((glFragmentLightModeliSGIX = (PFNGLFRAGMENTLIGHTMODELISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModeliSGIX")) == NULL) || r; + r = ((glFragmentLightModelivSGIX = (PFNGLFRAGMENTLIGHTMODELIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelivSGIX")) == NULL) || r; + r = ((glFragmentLightfSGIX = (PFNGLFRAGMENTLIGHTFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfSGIX")) == NULL) || r; + r = ((glFragmentLightfvSGIX = (PFNGLFRAGMENTLIGHTFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfvSGIX")) == NULL) || r; + r = ((glFragmentLightiSGIX = (PFNGLFRAGMENTLIGHTISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightiSGIX")) == NULL) || r; + r = ((glFragmentLightivSGIX = (PFNGLFRAGMENTLIGHTIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightivSGIX")) == NULL) || r; + r = ((glFragmentMaterialfSGIX = (PFNGLFRAGMENTMATERIALFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfSGIX")) == NULL) || r; + r = ((glFragmentMaterialfvSGIX = (PFNGLFRAGMENTMATERIALFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfvSGIX")) == NULL) || r; + r = ((glFragmentMaterialiSGIX = (PFNGLFRAGMENTMATERIALISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialiSGIX")) == NULL) || r; + r = ((glFragmentMaterialivSGIX = (PFNGLFRAGMENTMATERIALIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialivSGIX")) == NULL) || r; + r = ((glGetFragmentLightfvSGIX = (PFNGLGETFRAGMENTLIGHTFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightfvSGIX")) == NULL) || r; + r = ((glGetFragmentLightivSGIX = (PFNGLGETFRAGMENTLIGHTIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightivSGIX")) == NULL) || r; + r = ((glGetFragmentMaterialfvSGIX = (PFNGLGETFRAGMENTMATERIALFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialfvSGIX")) == NULL) || r; + r = ((glGetFragmentMaterialivSGIX = (PFNGLGETFRAGMENTMATERIALIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialivSGIX")) == NULL) || r; +#endif + + return r; +} + +#endif /* GL_SGIX_fragment_specular_lighting */ + +#ifdef GL_SGIX_framezoom + +static GLboolean _glewInit_GL_SGIX_framezoom (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFrameZoomSGIX = (PFNGLFRAMEZOOMSGIXPROC)glewGetProcAddress((const GLubyte*)"glFrameZoomSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_framezoom */ + +#ifdef GL_SGIX_interlace + +#endif /* GL_SGIX_interlace */ + +#ifdef GL_SGIX_ir_instrument1 + +#endif /* GL_SGIX_ir_instrument1 */ + +#ifdef GL_SGIX_list_priority + +#endif /* GL_SGIX_list_priority */ + +#ifdef GL_SGIX_pixel_texture + +static GLboolean _glewInit_GL_SGIX_pixel_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPixelTexGenSGIX = (PFNGLPIXELTEXGENSGIXPROC)glewGetProcAddress((const GLubyte*)"glPixelTexGenSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_pixel_texture */ + +#ifdef GL_SGIX_pixel_texture_bits + +#endif /* GL_SGIX_pixel_texture_bits */ + +#ifdef GL_SGIX_reference_plane + +static GLboolean _glewInit_GL_SGIX_reference_plane (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glReferencePlaneSGIX = (PFNGLREFERENCEPLANESGIXPROC)glewGetProcAddress((const GLubyte*)"glReferencePlaneSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_reference_plane */ + +#ifdef GL_SGIX_resample + +#endif /* GL_SGIX_resample */ + +#ifdef GL_SGIX_shadow + +#endif /* GL_SGIX_shadow */ + +#ifdef GL_SGIX_shadow_ambient + +#endif /* GL_SGIX_shadow_ambient */ + +#ifdef GL_SGIX_sprite + +static GLboolean _glewInit_GL_SGIX_sprite (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSpriteParameterfSGIX = (PFNGLSPRITEPARAMETERFSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterfSGIX")) == NULL) || r; + r = ((glSpriteParameterfvSGIX = (PFNGLSPRITEPARAMETERFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterfvSGIX")) == NULL) || r; + r = ((glSpriteParameteriSGIX = (PFNGLSPRITEPARAMETERISGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameteriSGIX")) == NULL) || r; + r = ((glSpriteParameterivSGIX = (PFNGLSPRITEPARAMETERIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterivSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_sprite */ + +#ifdef GL_SGIX_tag_sample_buffer + +static GLboolean _glewInit_GL_SGIX_tag_sample_buffer (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTagSampleBufferSGIX = (PFNGLTAGSAMPLEBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glTagSampleBufferSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_tag_sample_buffer */ + +#ifdef GL_SGIX_texture_add_env + +#endif /* GL_SGIX_texture_add_env */ + +#ifdef GL_SGIX_texture_coordinate_clamp + +#endif /* GL_SGIX_texture_coordinate_clamp */ + +#ifdef GL_SGIX_texture_lod_bias + +#endif /* GL_SGIX_texture_lod_bias */ + +#ifdef GL_SGIX_texture_multi_buffer + +#endif /* GL_SGIX_texture_multi_buffer */ + +#ifdef GL_SGIX_texture_range + +#endif /* GL_SGIX_texture_range */ + +#ifdef GL_SGIX_texture_scale_bias + +#endif /* GL_SGIX_texture_scale_bias */ + +#ifdef GL_SGIX_vertex_preclip + +#endif /* GL_SGIX_vertex_preclip */ + +#ifdef GL_SGIX_vertex_preclip_hint + +#endif /* GL_SGIX_vertex_preclip_hint */ + +#ifdef GL_SGIX_ycrcb + +#endif /* GL_SGIX_ycrcb */ + +#ifdef GL_SGI_color_matrix + +#endif /* GL_SGI_color_matrix */ + +#ifdef GL_SGI_color_table + +static GLboolean _glewInit_GL_SGI_color_table (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorTableParameterfvSGI = (PFNGLCOLORTABLEPARAMETERFVSGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterfvSGI")) == NULL) || r; + r = ((glColorTableParameterivSGI = (PFNGLCOLORTABLEPARAMETERIVSGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterivSGI")) == NULL) || r; + r = ((glColorTableSGI = (PFNGLCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableSGI")) == NULL) || r; + r = ((glCopyColorTableSGI = (PFNGLCOPYCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glCopyColorTableSGI")) == NULL) || r; + r = ((glGetColorTableParameterfvSGI = (PFNGLGETCOLORTABLEPARAMETERFVSGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfvSGI")) == NULL) || r; + r = ((glGetColorTableParameterivSGI = (PFNGLGETCOLORTABLEPARAMETERIVSGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterivSGI")) == NULL) || r; + r = ((glGetColorTableSGI = (PFNGLGETCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableSGI")) == NULL) || r; + + return r; +} + +#endif /* GL_SGI_color_table */ + +#ifdef GL_SGI_texture_color_table + +#endif /* GL_SGI_texture_color_table */ + +#ifdef GL_SUNX_constant_data + +static GLboolean _glewInit_GL_SUNX_constant_data (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFinishTextureSUNX = (PFNGLFINISHTEXTURESUNXPROC)glewGetProcAddress((const GLubyte*)"glFinishTextureSUNX")) == NULL) || r; + + return r; +} + +#endif /* GL_SUNX_constant_data */ + +#ifdef GL_SUN_convolution_border_modes + +#endif /* GL_SUN_convolution_border_modes */ + +#ifdef GL_SUN_global_alpha + +static GLboolean _glewInit_GL_SUN_global_alpha (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGlobalAlphaFactorbSUN = (PFNGLGLOBALALPHAFACTORBSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorbSUN")) == NULL) || r; + r = ((glGlobalAlphaFactordSUN = (PFNGLGLOBALALPHAFACTORDSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactordSUN")) == NULL) || r; + r = ((glGlobalAlphaFactorfSUN = (PFNGLGLOBALALPHAFACTORFSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorfSUN")) == NULL) || r; + r = ((glGlobalAlphaFactoriSUN = (PFNGLGLOBALALPHAFACTORISUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactoriSUN")) == NULL) || r; + r = ((glGlobalAlphaFactorsSUN = (PFNGLGLOBALALPHAFACTORSSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorsSUN")) == NULL) || r; + r = ((glGlobalAlphaFactorubSUN = (PFNGLGLOBALALPHAFACTORUBSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorubSUN")) == NULL) || r; + r = ((glGlobalAlphaFactoruiSUN = (PFNGLGLOBALALPHAFACTORUISUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactoruiSUN")) == NULL) || r; + r = ((glGlobalAlphaFactorusSUN = (PFNGLGLOBALALPHAFACTORUSSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorusSUN")) == NULL) || r; + + return r; +} + +#endif /* GL_SUN_global_alpha */ + +#ifdef GL_SUN_mesh_array + +#endif /* GL_SUN_mesh_array */ + +#ifdef GL_SUN_read_video_pixels + +static GLboolean _glewInit_GL_SUN_read_video_pixels (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glReadVideoPixelsSUN = (PFNGLREADVIDEOPIXELSSUNPROC)glewGetProcAddress((const GLubyte*)"glReadVideoPixelsSUN")) == NULL) || r; + + return r; +} + +#endif /* GL_SUN_read_video_pixels */ + +#ifdef GL_SUN_slice_accum + +#endif /* GL_SUN_slice_accum */ + +#ifdef GL_SUN_triangle_list + +static GLboolean _glewInit_GL_SUN_triangle_list (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glReplacementCodePointerSUN = (PFNGLREPLACEMENTCODEPOINTERSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodePointerSUN")) == NULL) || r; + r = ((glReplacementCodeubSUN = (PFNGLREPLACEMENTCODEUBSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeubSUN")) == NULL) || r; + r = ((glReplacementCodeubvSUN = (PFNGLREPLACEMENTCODEUBVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeubvSUN")) == NULL) || r; + r = ((glReplacementCodeuiSUN = (PFNGLREPLACEMENTCODEUISUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiSUN")) == NULL) || r; + r = ((glReplacementCodeuivSUN = (PFNGLREPLACEMENTCODEUIVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuivSUN")) == NULL) || r; + r = ((glReplacementCodeusSUN = (PFNGLREPLACEMENTCODEUSSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeusSUN")) == NULL) || r; + r = ((glReplacementCodeusvSUN = (PFNGLREPLACEMENTCODEUSVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeusvSUN")) == NULL) || r; + + return r; +} + +#endif /* GL_SUN_triangle_list */ + +#ifdef GL_SUN_vertex + +static GLboolean _glewInit_GL_SUN_vertex (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColor3fVertex3fSUN = (PFNGLCOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor3fVertex3fSUN")) == NULL) || r; + r = ((glColor3fVertex3fvSUN = (PFNGLCOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor3fVertex3fvSUN")) == NULL) || r; + r = ((glColor4fNormal3fVertex3fSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glColor4fNormal3fVertex3fvSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glColor4ubVertex2fSUN = (PFNGLCOLOR4UBVERTEX2FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex2fSUN")) == NULL) || r; + r = ((glColor4ubVertex2fvSUN = (PFNGLCOLOR4UBVERTEX2FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex2fvSUN")) == NULL) || r; + r = ((glColor4ubVertex3fSUN = (PFNGLCOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex3fSUN")) == NULL) || r; + r = ((glColor4ubVertex3fvSUN = (PFNGLCOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex3fvSUN")) == NULL) || r; + r = ((glNormal3fVertex3fSUN = (PFNGLNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glNormal3fVertex3fSUN")) == NULL) || r; + r = ((glNormal3fVertex3fvSUN = (PFNGLNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor4ubVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4ubVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor4ubVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4ubVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiNormal3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiVertex3fSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiVertex3fvSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fColor3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor3fVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fColor3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor3fVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fColor4ubVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4ubVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fColor4ubVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4ubVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fVertex3fSUN = (PFNGLTEXCOORD2FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fVertex3fvSUN = (PFNGLTEXCOORD2FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord4fColor4fNormal3fVertex4fSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fColor4fNormal3fVertex4fSUN")) == NULL) || r; + r = ((glTexCoord4fColor4fNormal3fVertex4fvSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fColor4fNormal3fVertex4fvSUN")) == NULL) || r; + r = ((glTexCoord4fVertex4fSUN = (PFNGLTEXCOORD4FVERTEX4FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fVertex4fSUN")) == NULL) || r; + r = ((glTexCoord4fVertex4fvSUN = (PFNGLTEXCOORD4FVERTEX4FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fVertex4fvSUN")) == NULL) || r; + + return r; +} + +#endif /* GL_SUN_vertex */ + +#ifdef GL_WIN_phong_shading + +#endif /* GL_WIN_phong_shading */ + +#ifdef GL_WIN_specular_fog + +#endif /* GL_WIN_specular_fog */ + +#ifdef GL_WIN_swap_hint + +static GLboolean _glewInit_GL_WIN_swap_hint (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAddSwapHintRectWIN = (PFNGLADDSWAPHINTRECTWINPROC)glewGetProcAddress((const GLubyte*)"glAddSwapHintRectWIN")) == NULL) || r; + + return r; +} + +#endif /* GL_WIN_swap_hint */ + +/* ------------------------------------------------------------------------- */ + +/* + * Search for name in the extensions string. Use of strstr() + * is not sufficient because extension names can be prefixes of + * other extension names. Could use strtok() but the constant + * string returned by glGetString might be in read-only memory. + */ +GLboolean glewGetExtension (const char* name) +{ + GLubyte* p; + GLubyte* end; + GLuint len = _glewStrLen((const GLubyte*)name); + p = (GLubyte*)glGetString(GL_EXTENSIONS); + if (0 == p) return GL_FALSE; + end = p + _glewStrLen(p); + while (p < end) + { + GLuint n = _glewStrCLen(p, ' '); + if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE; + p += n+1; + } + return GL_FALSE; +} + +/* ------------------------------------------------------------------------- */ + +#ifndef GLEW_MX +static +#endif +GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) +{ + const GLubyte* s; + GLuint dot, major, minor; + /* query opengl version */ + s = glGetString(GL_VERSION); + dot = _glewStrCLen(s, '.'); + major = dot-1; + minor = dot+1; + if (dot == 0 || s[minor] == '\0') + return GLEW_ERROR_NO_GL_VERSION; + if (s[major] == '1' && s[minor] == '0') + { + return GLEW_ERROR_GL_VERSION_10_ONLY; + } + else + { + if (s[major] >= '2') + { + GLEW_VERSION_1_1 = GL_TRUE; + GLEW_VERSION_1_2 = GL_TRUE; + GLEW_VERSION_1_3 = GL_TRUE; + GLEW_VERSION_1_4 = GL_TRUE; + GLEW_VERSION_1_5 = GL_TRUE; + GLEW_VERSION_2_0 = GL_TRUE; + } + else + { + if (s[minor] >= '5') + { + GLEW_VERSION_1_1 = GL_TRUE; + GLEW_VERSION_1_2 = GL_TRUE; + GLEW_VERSION_1_3 = GL_TRUE; + GLEW_VERSION_1_4 = GL_TRUE; + GLEW_VERSION_1_5 = GL_TRUE; + GLEW_VERSION_2_0 = GL_FALSE; + } + if (s[minor] == '4') + { + GLEW_VERSION_1_1 = GL_TRUE; + GLEW_VERSION_1_2 = GL_TRUE; + GLEW_VERSION_1_3 = GL_TRUE; + GLEW_VERSION_1_4 = GL_TRUE; + GLEW_VERSION_1_5 = GL_FALSE; + GLEW_VERSION_2_0 = GL_FALSE; + } + if (s[minor] == '3') + { + GLEW_VERSION_1_1 = GL_TRUE; + GLEW_VERSION_1_2 = GL_TRUE; + GLEW_VERSION_1_3 = GL_TRUE; + GLEW_VERSION_1_4 = GL_FALSE; + GLEW_VERSION_1_5 = GL_FALSE; + GLEW_VERSION_2_0 = GL_FALSE; + } + if (s[minor] == '2') + { + GLEW_VERSION_1_1 = GL_TRUE; + GLEW_VERSION_1_2 = GL_TRUE; + GLEW_VERSION_1_3 = GL_FALSE; + GLEW_VERSION_1_4 = GL_FALSE; + GLEW_VERSION_1_5 = GL_FALSE; + GLEW_VERSION_2_0 = GL_FALSE; + } + if (s[minor] < '2') + { + GLEW_VERSION_1_1 = GL_TRUE; + GLEW_VERSION_1_2 = GL_FALSE; + GLEW_VERSION_1_3 = GL_FALSE; + GLEW_VERSION_1_4 = GL_FALSE; + GLEW_VERSION_1_5 = GL_FALSE; + GLEW_VERSION_2_0 = GL_FALSE; + } + } + } + /* initialize extensions */ +#ifdef GL_VERSION_1_2 + if (glewExperimental || GLEW_VERSION_1_2) GLEW_VERSION_1_2 = !_glewInit_GL_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_1_2 */ +#ifdef GL_VERSION_1_3 + if (glewExperimental || GLEW_VERSION_1_3) GLEW_VERSION_1_3 = !_glewInit_GL_VERSION_1_3(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_1_3 */ +#ifdef GL_VERSION_1_4 + if (glewExperimental || GLEW_VERSION_1_4) GLEW_VERSION_1_4 = !_glewInit_GL_VERSION_1_4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_1_4 */ +#ifdef GL_VERSION_1_5 + if (glewExperimental || GLEW_VERSION_1_5) GLEW_VERSION_1_5 = !_glewInit_GL_VERSION_1_5(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_1_5 */ +#ifdef GL_VERSION_2_0 + if (glewExperimental || GLEW_VERSION_2_0) GLEW_VERSION_2_0 = !_glewInit_GL_VERSION_2_0(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_2_0 */ +#ifdef GL_3DFX_multisample + GLEW_3DFX_multisample = glewGetExtension("GL_3DFX_multisample"); +#endif /* GL_3DFX_multisample */ +#ifdef GL_3DFX_tbuffer + GLEW_3DFX_tbuffer = glewGetExtension("GL_3DFX_tbuffer"); + if (glewExperimental || GLEW_3DFX_tbuffer) GLEW_3DFX_tbuffer = !_glewInit_GL_3DFX_tbuffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_3DFX_tbuffer */ +#ifdef GL_3DFX_texture_compression_FXT1 + GLEW_3DFX_texture_compression_FXT1 = glewGetExtension("GL_3DFX_texture_compression_FXT1"); +#endif /* GL_3DFX_texture_compression_FXT1 */ +#ifdef GL_APPLE_client_storage + GLEW_APPLE_client_storage = glewGetExtension("GL_APPLE_client_storage"); +#endif /* GL_APPLE_client_storage */ +#ifdef GL_APPLE_element_array + GLEW_APPLE_element_array = glewGetExtension("GL_APPLE_element_array"); + if (glewExperimental || GLEW_APPLE_element_array) GLEW_APPLE_element_array = !_glewInit_GL_APPLE_element_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_element_array */ +#ifdef GL_APPLE_fence + GLEW_APPLE_fence = glewGetExtension("GL_APPLE_fence"); + if (glewExperimental || GLEW_APPLE_fence) GLEW_APPLE_fence = !_glewInit_GL_APPLE_fence(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_fence */ +#ifdef GL_APPLE_float_pixels + GLEW_APPLE_float_pixels = glewGetExtension("GL_APPLE_float_pixels"); +#endif /* GL_APPLE_float_pixels */ +#ifdef GL_APPLE_pixel_buffer + GLEW_APPLE_pixel_buffer = glewGetExtension("GL_APPLE_pixel_buffer"); +#endif /* GL_APPLE_pixel_buffer */ +#ifdef GL_APPLE_specular_vector + GLEW_APPLE_specular_vector = glewGetExtension("GL_APPLE_specular_vector"); +#endif /* GL_APPLE_specular_vector */ +#ifdef GL_APPLE_texture_range + GLEW_APPLE_texture_range = glewGetExtension("GL_APPLE_texture_range"); + if (glewExperimental || GLEW_APPLE_texture_range) GLEW_APPLE_texture_range = !_glewInit_GL_APPLE_texture_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_texture_range */ +#ifdef GL_APPLE_transform_hint + GLEW_APPLE_transform_hint = glewGetExtension("GL_APPLE_transform_hint"); +#endif /* GL_APPLE_transform_hint */ +#ifdef GL_APPLE_vertex_array_object + GLEW_APPLE_vertex_array_object = glewGetExtension("GL_APPLE_vertex_array_object"); + if (glewExperimental || GLEW_APPLE_vertex_array_object) GLEW_APPLE_vertex_array_object = !_glewInit_GL_APPLE_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_vertex_array_object */ +#ifdef GL_APPLE_vertex_array_range + GLEW_APPLE_vertex_array_range = glewGetExtension("GL_APPLE_vertex_array_range"); + if (glewExperimental || GLEW_APPLE_vertex_array_range) GLEW_APPLE_vertex_array_range = !_glewInit_GL_APPLE_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_vertex_array_range */ +#ifdef GL_APPLE_ycbcr_422 + GLEW_APPLE_ycbcr_422 = glewGetExtension("GL_APPLE_ycbcr_422"); +#endif /* GL_APPLE_ycbcr_422 */ +#ifdef GL_ARB_color_buffer_float + GLEW_ARB_color_buffer_float = glewGetExtension("GL_ARB_color_buffer_float"); + if (glewExperimental || GLEW_ARB_color_buffer_float) GLEW_ARB_color_buffer_float = !_glewInit_GL_ARB_color_buffer_float(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_color_buffer_float */ +#ifdef GL_ARB_depth_texture + GLEW_ARB_depth_texture = glewGetExtension("GL_ARB_depth_texture"); +#endif /* GL_ARB_depth_texture */ +#ifdef GL_ARB_draw_buffers + GLEW_ARB_draw_buffers = glewGetExtension("GL_ARB_draw_buffers"); + if (glewExperimental || GLEW_ARB_draw_buffers) GLEW_ARB_draw_buffers = !_glewInit_GL_ARB_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_draw_buffers */ +#ifdef GL_ARB_fragment_program + GLEW_ARB_fragment_program = glewGetExtension("GL_ARB_fragment_program"); +#endif /* GL_ARB_fragment_program */ +#ifdef GL_ARB_fragment_program_shadow + GLEW_ARB_fragment_program_shadow = glewGetExtension("GL_ARB_fragment_program_shadow"); +#endif /* GL_ARB_fragment_program_shadow */ +#ifdef GL_ARB_fragment_shader + GLEW_ARB_fragment_shader = glewGetExtension("GL_ARB_fragment_shader"); +#endif /* GL_ARB_fragment_shader */ +#ifdef GL_ARB_half_float_pixel + GLEW_ARB_half_float_pixel = glewGetExtension("GL_ARB_half_float_pixel"); +#endif /* GL_ARB_half_float_pixel */ +#ifdef GL_ARB_imaging + GLEW_ARB_imaging = glewGetExtension("GL_ARB_imaging"); + if (glewExperimental || GLEW_ARB_imaging) GLEW_ARB_imaging = !_glewInit_GL_ARB_imaging(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_imaging */ +#ifdef GL_ARB_matrix_palette + GLEW_ARB_matrix_palette = glewGetExtension("GL_ARB_matrix_palette"); + if (glewExperimental || GLEW_ARB_matrix_palette) GLEW_ARB_matrix_palette = !_glewInit_GL_ARB_matrix_palette(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_matrix_palette */ +#ifdef GL_ARB_multisample + GLEW_ARB_multisample = glewGetExtension("GL_ARB_multisample"); + if (glewExperimental || GLEW_ARB_multisample) GLEW_ARB_multisample = !_glewInit_GL_ARB_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_multisample */ +#ifdef GL_ARB_multitexture + GLEW_ARB_multitexture = glewGetExtension("GL_ARB_multitexture"); + if (glewExperimental || GLEW_ARB_multitexture) GLEW_ARB_multitexture = !_glewInit_GL_ARB_multitexture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_multitexture */ +#ifdef GL_ARB_occlusion_query + GLEW_ARB_occlusion_query = glewGetExtension("GL_ARB_occlusion_query"); + if (glewExperimental || GLEW_ARB_occlusion_query) GLEW_ARB_occlusion_query = !_glewInit_GL_ARB_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_occlusion_query */ +#ifdef GL_ARB_pixel_buffer_object + GLEW_ARB_pixel_buffer_object = glewGetExtension("GL_ARB_pixel_buffer_object"); +#endif /* GL_ARB_pixel_buffer_object */ +#ifdef GL_ARB_point_parameters + GLEW_ARB_point_parameters = glewGetExtension("GL_ARB_point_parameters"); + if (glewExperimental || GLEW_ARB_point_parameters) GLEW_ARB_point_parameters = !_glewInit_GL_ARB_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_point_parameters */ +#ifdef GL_ARB_point_sprite + GLEW_ARB_point_sprite = glewGetExtension("GL_ARB_point_sprite"); +#endif /* GL_ARB_point_sprite */ +#ifdef GL_ARB_shader_objects + GLEW_ARB_shader_objects = glewGetExtension("GL_ARB_shader_objects"); + if (glewExperimental || GLEW_ARB_shader_objects) GLEW_ARB_shader_objects = !_glewInit_GL_ARB_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_shader_objects */ +#ifdef GL_ARB_shading_language_100 + GLEW_ARB_shading_language_100 = glewGetExtension("GL_ARB_shading_language_100"); +#endif /* GL_ARB_shading_language_100 */ +#ifdef GL_ARB_shadow + GLEW_ARB_shadow = glewGetExtension("GL_ARB_shadow"); +#endif /* GL_ARB_shadow */ +#ifdef GL_ARB_shadow_ambient + GLEW_ARB_shadow_ambient = glewGetExtension("GL_ARB_shadow_ambient"); +#endif /* GL_ARB_shadow_ambient */ +#ifdef GL_ARB_texture_border_clamp + GLEW_ARB_texture_border_clamp = glewGetExtension("GL_ARB_texture_border_clamp"); +#endif /* GL_ARB_texture_border_clamp */ +#ifdef GL_ARB_texture_compression + GLEW_ARB_texture_compression = glewGetExtension("GL_ARB_texture_compression"); + if (glewExperimental || GLEW_ARB_texture_compression) GLEW_ARB_texture_compression = !_glewInit_GL_ARB_texture_compression(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_compression */ +#ifdef GL_ARB_texture_cube_map + GLEW_ARB_texture_cube_map = glewGetExtension("GL_ARB_texture_cube_map"); +#endif /* GL_ARB_texture_cube_map */ +#ifdef GL_ARB_texture_env_add + GLEW_ARB_texture_env_add = glewGetExtension("GL_ARB_texture_env_add"); +#endif /* GL_ARB_texture_env_add */ +#ifdef GL_ARB_texture_env_combine + GLEW_ARB_texture_env_combine = glewGetExtension("GL_ARB_texture_env_combine"); +#endif /* GL_ARB_texture_env_combine */ +#ifdef GL_ARB_texture_env_crossbar + GLEW_ARB_texture_env_crossbar = glewGetExtension("GL_ARB_texture_env_crossbar"); +#endif /* GL_ARB_texture_env_crossbar */ +#ifdef GL_ARB_texture_env_dot3 + GLEW_ARB_texture_env_dot3 = glewGetExtension("GL_ARB_texture_env_dot3"); +#endif /* GL_ARB_texture_env_dot3 */ +#ifdef GL_ARB_texture_float + GLEW_ARB_texture_float = glewGetExtension("GL_ARB_texture_float"); +#endif /* GL_ARB_texture_float */ +#ifdef GL_ARB_texture_mirrored_repeat + GLEW_ARB_texture_mirrored_repeat = glewGetExtension("GL_ARB_texture_mirrored_repeat"); +#endif /* GL_ARB_texture_mirrored_repeat */ +#ifdef GL_ARB_texture_non_power_of_two + GLEW_ARB_texture_non_power_of_two = glewGetExtension("GL_ARB_texture_non_power_of_two"); +#endif /* GL_ARB_texture_non_power_of_two */ +#ifdef GL_ARB_texture_rectangle + GLEW_ARB_texture_rectangle = glewGetExtension("GL_ARB_texture_rectangle"); +#endif /* GL_ARB_texture_rectangle */ +#ifdef GL_ARB_transpose_matrix + GLEW_ARB_transpose_matrix = glewGetExtension("GL_ARB_transpose_matrix"); + if (glewExperimental || GLEW_ARB_transpose_matrix) GLEW_ARB_transpose_matrix = !_glewInit_GL_ARB_transpose_matrix(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_transpose_matrix */ +#ifdef GL_ARB_vertex_blend + GLEW_ARB_vertex_blend = glewGetExtension("GL_ARB_vertex_blend"); + if (glewExperimental || GLEW_ARB_vertex_blend) GLEW_ARB_vertex_blend = !_glewInit_GL_ARB_vertex_blend(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_blend */ +#ifdef GL_ARB_vertex_buffer_object + GLEW_ARB_vertex_buffer_object = glewGetExtension("GL_ARB_vertex_buffer_object"); + if (glewExperimental || GLEW_ARB_vertex_buffer_object) GLEW_ARB_vertex_buffer_object = !_glewInit_GL_ARB_vertex_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_buffer_object */ +#ifdef GL_ARB_vertex_program + GLEW_ARB_vertex_program = glewGetExtension("GL_ARB_vertex_program"); + if (glewExperimental || GLEW_ARB_vertex_program) GLEW_ARB_vertex_program = !_glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_program */ +#ifdef GL_ARB_vertex_shader + GLEW_ARB_vertex_shader = glewGetExtension("GL_ARB_vertex_shader"); + if (glewExperimental || GLEW_ARB_vertex_shader) { GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); } +#endif /* GL_ARB_vertex_shader */ +#ifdef GL_ARB_window_pos + GLEW_ARB_window_pos = glewGetExtension("GL_ARB_window_pos"); + if (glewExperimental || GLEW_ARB_window_pos) GLEW_ARB_window_pos = !_glewInit_GL_ARB_window_pos(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_window_pos */ +#ifdef GL_ATIX_point_sprites + GLEW_ATIX_point_sprites = glewGetExtension("GL_ATIX_point_sprites"); +#endif /* GL_ATIX_point_sprites */ +#ifdef GL_ATIX_texture_env_combine3 + GLEW_ATIX_texture_env_combine3 = glewGetExtension("GL_ATIX_texture_env_combine3"); +#endif /* GL_ATIX_texture_env_combine3 */ +#ifdef GL_ATIX_texture_env_route + GLEW_ATIX_texture_env_route = glewGetExtension("GL_ATIX_texture_env_route"); +#endif /* GL_ATIX_texture_env_route */ +#ifdef GL_ATIX_vertex_shader_output_point_size + GLEW_ATIX_vertex_shader_output_point_size = glewGetExtension("GL_ATIX_vertex_shader_output_point_size"); +#endif /* GL_ATIX_vertex_shader_output_point_size */ +#ifdef GL_ATI_draw_buffers + GLEW_ATI_draw_buffers = glewGetExtension("GL_ATI_draw_buffers"); + if (glewExperimental || GLEW_ATI_draw_buffers) GLEW_ATI_draw_buffers = !_glewInit_GL_ATI_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_draw_buffers */ +#ifdef GL_ATI_element_array + GLEW_ATI_element_array = glewGetExtension("GL_ATI_element_array"); + if (glewExperimental || GLEW_ATI_element_array) GLEW_ATI_element_array = !_glewInit_GL_ATI_element_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_element_array */ +#ifdef GL_ATI_envmap_bumpmap + GLEW_ATI_envmap_bumpmap = glewGetExtension("GL_ATI_envmap_bumpmap"); + if (glewExperimental || GLEW_ATI_envmap_bumpmap) GLEW_ATI_envmap_bumpmap = !_glewInit_GL_ATI_envmap_bumpmap(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_envmap_bumpmap */ +#ifdef GL_ATI_fragment_shader + GLEW_ATI_fragment_shader = glewGetExtension("GL_ATI_fragment_shader"); + if (glewExperimental || GLEW_ATI_fragment_shader) GLEW_ATI_fragment_shader = !_glewInit_GL_ATI_fragment_shader(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_fragment_shader */ +#ifdef GL_ATI_map_object_buffer + GLEW_ATI_map_object_buffer = glewGetExtension("GL_ATI_map_object_buffer"); + if (glewExperimental || GLEW_ATI_map_object_buffer) GLEW_ATI_map_object_buffer = !_glewInit_GL_ATI_map_object_buffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_map_object_buffer */ +#ifdef GL_ATI_pn_triangles + GLEW_ATI_pn_triangles = glewGetExtension("GL_ATI_pn_triangles"); + if (glewExperimental || GLEW_ATI_pn_triangles) GLEW_ATI_pn_triangles = !_glewInit_GL_ATI_pn_triangles(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_pn_triangles */ +#ifdef GL_ATI_separate_stencil + GLEW_ATI_separate_stencil = glewGetExtension("GL_ATI_separate_stencil"); + if (glewExperimental || GLEW_ATI_separate_stencil) GLEW_ATI_separate_stencil = !_glewInit_GL_ATI_separate_stencil(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_separate_stencil */ +#ifdef GL_ATI_text_fragment_shader + GLEW_ATI_text_fragment_shader = glewGetExtension("GL_ATI_text_fragment_shader"); +#endif /* GL_ATI_text_fragment_shader */ +#ifdef GL_ATI_texture_compression_3dc + GLEW_ATI_texture_compression_3dc = glewGetExtension("GL_ATI_texture_compression_3dc"); +#endif /* GL_ATI_texture_compression_3dc */ +#ifdef GL_ATI_texture_env_combine3 + GLEW_ATI_texture_env_combine3 = glewGetExtension("GL_ATI_texture_env_combine3"); +#endif /* GL_ATI_texture_env_combine3 */ +#ifdef GL_ATI_texture_float + GLEW_ATI_texture_float = glewGetExtension("GL_ATI_texture_float"); +#endif /* GL_ATI_texture_float */ +#ifdef GL_ATI_texture_mirror_once + GLEW_ATI_texture_mirror_once = glewGetExtension("GL_ATI_texture_mirror_once"); +#endif /* GL_ATI_texture_mirror_once */ +#ifdef GL_ATI_vertex_array_object + GLEW_ATI_vertex_array_object = glewGetExtension("GL_ATI_vertex_array_object"); + if (glewExperimental || GLEW_ATI_vertex_array_object) GLEW_ATI_vertex_array_object = !_glewInit_GL_ATI_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_vertex_array_object */ +#ifdef GL_ATI_vertex_attrib_array_object + GLEW_ATI_vertex_attrib_array_object = glewGetExtension("GL_ATI_vertex_attrib_array_object"); + if (glewExperimental || GLEW_ATI_vertex_attrib_array_object) GLEW_ATI_vertex_attrib_array_object = !_glewInit_GL_ATI_vertex_attrib_array_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_vertex_attrib_array_object */ +#ifdef GL_ATI_vertex_streams + GLEW_ATI_vertex_streams = glewGetExtension("GL_ATI_vertex_streams"); + if (glewExperimental || GLEW_ATI_vertex_streams) GLEW_ATI_vertex_streams = !_glewInit_GL_ATI_vertex_streams(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_vertex_streams */ +#ifdef GL_EXT_422_pixels + GLEW_EXT_422_pixels = glewGetExtension("GL_EXT_422_pixels"); +#endif /* GL_EXT_422_pixels */ +#ifdef GL_EXT_Cg_shader + GLEW_EXT_Cg_shader = glewGetExtension("GL_EXT_Cg_shader"); +#endif /* GL_EXT_Cg_shader */ +#ifdef GL_EXT_abgr + GLEW_EXT_abgr = glewGetExtension("GL_EXT_abgr"); +#endif /* GL_EXT_abgr */ +#ifdef GL_EXT_bgra + GLEW_EXT_bgra = glewGetExtension("GL_EXT_bgra"); +#endif /* GL_EXT_bgra */ +#ifdef GL_EXT_blend_color + GLEW_EXT_blend_color = glewGetExtension("GL_EXT_blend_color"); + if (glewExperimental || GLEW_EXT_blend_color) GLEW_EXT_blend_color = !_glewInit_GL_EXT_blend_color(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_blend_color */ +#ifdef GL_EXT_blend_equation_separate + GLEW_EXT_blend_equation_separate = glewGetExtension("GL_EXT_blend_equation_separate"); + if (glewExperimental || GLEW_EXT_blend_equation_separate) GLEW_EXT_blend_equation_separate = !_glewInit_GL_EXT_blend_equation_separate(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_blend_equation_separate */ +#ifdef GL_EXT_blend_func_separate + GLEW_EXT_blend_func_separate = glewGetExtension("GL_EXT_blend_func_separate"); + if (glewExperimental || GLEW_EXT_blend_func_separate) GLEW_EXT_blend_func_separate = !_glewInit_GL_EXT_blend_func_separate(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_blend_func_separate */ +#ifdef GL_EXT_blend_logic_op + GLEW_EXT_blend_logic_op = glewGetExtension("GL_EXT_blend_logic_op"); +#endif /* GL_EXT_blend_logic_op */ +#ifdef GL_EXT_blend_minmax + GLEW_EXT_blend_minmax = glewGetExtension("GL_EXT_blend_minmax"); + if (glewExperimental || GLEW_EXT_blend_minmax) GLEW_EXT_blend_minmax = !_glewInit_GL_EXT_blend_minmax(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_blend_minmax */ +#ifdef GL_EXT_blend_subtract + GLEW_EXT_blend_subtract = glewGetExtension("GL_EXT_blend_subtract"); +#endif /* GL_EXT_blend_subtract */ +#ifdef GL_EXT_clip_volume_hint + GLEW_EXT_clip_volume_hint = glewGetExtension("GL_EXT_clip_volume_hint"); +#endif /* GL_EXT_clip_volume_hint */ +#ifdef GL_EXT_cmyka + GLEW_EXT_cmyka = glewGetExtension("GL_EXT_cmyka"); +#endif /* GL_EXT_cmyka */ +#ifdef GL_EXT_color_subtable + GLEW_EXT_color_subtable = glewGetExtension("GL_EXT_color_subtable"); + if (glewExperimental || GLEW_EXT_color_subtable) GLEW_EXT_color_subtable = !_glewInit_GL_EXT_color_subtable(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_color_subtable */ +#ifdef GL_EXT_compiled_vertex_array + GLEW_EXT_compiled_vertex_array = glewGetExtension("GL_EXT_compiled_vertex_array"); + if (glewExperimental || GLEW_EXT_compiled_vertex_array) GLEW_EXT_compiled_vertex_array = !_glewInit_GL_EXT_compiled_vertex_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_compiled_vertex_array */ +#ifdef GL_EXT_convolution + GLEW_EXT_convolution = glewGetExtension("GL_EXT_convolution"); + if (glewExperimental || GLEW_EXT_convolution) GLEW_EXT_convolution = !_glewInit_GL_EXT_convolution(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_convolution */ +#ifdef GL_EXT_coordinate_frame + GLEW_EXT_coordinate_frame = glewGetExtension("GL_EXT_coordinate_frame"); + if (glewExperimental || GLEW_EXT_coordinate_frame) GLEW_EXT_coordinate_frame = !_glewInit_GL_EXT_coordinate_frame(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_coordinate_frame */ +#ifdef GL_EXT_copy_texture + GLEW_EXT_copy_texture = glewGetExtension("GL_EXT_copy_texture"); + if (glewExperimental || GLEW_EXT_copy_texture) GLEW_EXT_copy_texture = !_glewInit_GL_EXT_copy_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_copy_texture */ +#ifdef GL_EXT_cull_vertex + GLEW_EXT_cull_vertex = glewGetExtension("GL_EXT_cull_vertex"); + if (glewExperimental || GLEW_EXT_cull_vertex) GLEW_EXT_cull_vertex = !_glewInit_GL_EXT_cull_vertex(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_cull_vertex */ +#ifdef GL_EXT_depth_bounds_test + GLEW_EXT_depth_bounds_test = glewGetExtension("GL_EXT_depth_bounds_test"); + if (glewExperimental || GLEW_EXT_depth_bounds_test) GLEW_EXT_depth_bounds_test = !_glewInit_GL_EXT_depth_bounds_test(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_depth_bounds_test */ +#ifdef GL_EXT_draw_range_elements + GLEW_EXT_draw_range_elements = glewGetExtension("GL_EXT_draw_range_elements"); + if (glewExperimental || GLEW_EXT_draw_range_elements) GLEW_EXT_draw_range_elements = !_glewInit_GL_EXT_draw_range_elements(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_draw_range_elements */ +#ifdef GL_EXT_fog_coord + GLEW_EXT_fog_coord = glewGetExtension("GL_EXT_fog_coord"); + if (glewExperimental || GLEW_EXT_fog_coord) GLEW_EXT_fog_coord = !_glewInit_GL_EXT_fog_coord(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_fog_coord */ +#ifdef GL_EXT_fragment_lighting + GLEW_EXT_fragment_lighting = glewGetExtension("GL_EXT_fragment_lighting"); + if (glewExperimental || GLEW_EXT_fragment_lighting) GLEW_EXT_fragment_lighting = !_glewInit_GL_EXT_fragment_lighting(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_fragment_lighting */ +#ifdef GL_EXT_framebuffer_blit + GLEW_EXT_framebuffer_blit = glewGetExtension("GL_EXT_framebuffer_blit"); + if (glewExperimental || GLEW_EXT_framebuffer_blit) GLEW_EXT_framebuffer_blit = !_glewInit_GL_EXT_framebuffer_blit(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_framebuffer_blit */ +#ifdef GL_EXT_framebuffer_multisample + GLEW_EXT_framebuffer_multisample = glewGetExtension("GL_EXT_framebuffer_multisample"); + if (glewExperimental || GLEW_EXT_framebuffer_multisample) GLEW_EXT_framebuffer_multisample = !_glewInit_GL_EXT_framebuffer_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_framebuffer_multisample */ +#ifdef GL_EXT_framebuffer_object + GLEW_EXT_framebuffer_object = glewGetExtension("GL_EXT_framebuffer_object"); + if (glewExperimental || GLEW_EXT_framebuffer_object) GLEW_EXT_framebuffer_object = !_glewInit_GL_EXT_framebuffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_framebuffer_object */ +#ifdef GL_EXT_histogram + GLEW_EXT_histogram = glewGetExtension("GL_EXT_histogram"); + if (glewExperimental || GLEW_EXT_histogram) GLEW_EXT_histogram = !_glewInit_GL_EXT_histogram(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_histogram */ +#ifdef GL_EXT_index_array_formats + GLEW_EXT_index_array_formats = glewGetExtension("GL_EXT_index_array_formats"); +#endif /* GL_EXT_index_array_formats */ +#ifdef GL_EXT_index_func + GLEW_EXT_index_func = glewGetExtension("GL_EXT_index_func"); + if (glewExperimental || GLEW_EXT_index_func) GLEW_EXT_index_func = !_glewInit_GL_EXT_index_func(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_index_func */ +#ifdef GL_EXT_index_material + GLEW_EXT_index_material = glewGetExtension("GL_EXT_index_material"); + if (glewExperimental || GLEW_EXT_index_material) GLEW_EXT_index_material = !_glewInit_GL_EXT_index_material(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_index_material */ +#ifdef GL_EXT_index_texture + GLEW_EXT_index_texture = glewGetExtension("GL_EXT_index_texture"); +#endif /* GL_EXT_index_texture */ +#ifdef GL_EXT_light_texture + GLEW_EXT_light_texture = glewGetExtension("GL_EXT_light_texture"); + if (glewExperimental || GLEW_EXT_light_texture) GLEW_EXT_light_texture = !_glewInit_GL_EXT_light_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_light_texture */ +#ifdef GL_EXT_misc_attribute + GLEW_EXT_misc_attribute = glewGetExtension("GL_EXT_misc_attribute"); +#endif /* GL_EXT_misc_attribute */ +#ifdef GL_EXT_multi_draw_arrays + GLEW_EXT_multi_draw_arrays = glewGetExtension("GL_EXT_multi_draw_arrays"); + if (glewExperimental || GLEW_EXT_multi_draw_arrays) GLEW_EXT_multi_draw_arrays = !_glewInit_GL_EXT_multi_draw_arrays(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_multi_draw_arrays */ +#ifdef GL_EXT_multisample + GLEW_EXT_multisample = glewGetExtension("GL_EXT_multisample"); + if (glewExperimental || GLEW_EXT_multisample) GLEW_EXT_multisample = !_glewInit_GL_EXT_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_multisample */ +#ifdef GL_EXT_packed_depth_stencil + GLEW_EXT_packed_depth_stencil = glewGetExtension("GL_EXT_packed_depth_stencil"); +#endif /* GL_EXT_packed_depth_stencil */ +#ifdef GL_EXT_packed_pixels + GLEW_EXT_packed_pixels = glewGetExtension("GL_EXT_packed_pixels"); +#endif /* GL_EXT_packed_pixels */ +#ifdef GL_EXT_paletted_texture + GLEW_EXT_paletted_texture = glewGetExtension("GL_EXT_paletted_texture"); + if (glewExperimental || GLEW_EXT_paletted_texture) GLEW_EXT_paletted_texture = !_glewInit_GL_EXT_paletted_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_paletted_texture */ +#ifdef GL_EXT_pixel_buffer_object + GLEW_EXT_pixel_buffer_object = glewGetExtension("GL_EXT_pixel_buffer_object"); +#endif /* GL_EXT_pixel_buffer_object */ +#ifdef GL_EXT_pixel_transform + GLEW_EXT_pixel_transform = glewGetExtension("GL_EXT_pixel_transform"); + if (glewExperimental || GLEW_EXT_pixel_transform) GLEW_EXT_pixel_transform = !_glewInit_GL_EXT_pixel_transform(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_pixel_transform */ +#ifdef GL_EXT_pixel_transform_color_table + GLEW_EXT_pixel_transform_color_table = glewGetExtension("GL_EXT_pixel_transform_color_table"); +#endif /* GL_EXT_pixel_transform_color_table */ +#ifdef GL_EXT_point_parameters + GLEW_EXT_point_parameters = glewGetExtension("GL_EXT_point_parameters"); + if (glewExperimental || GLEW_EXT_point_parameters) GLEW_EXT_point_parameters = !_glewInit_GL_EXT_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_point_parameters */ +#ifdef GL_EXT_polygon_offset + GLEW_EXT_polygon_offset = glewGetExtension("GL_EXT_polygon_offset"); + if (glewExperimental || GLEW_EXT_polygon_offset) GLEW_EXT_polygon_offset = !_glewInit_GL_EXT_polygon_offset(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_polygon_offset */ +#ifdef GL_EXT_rescale_normal + GLEW_EXT_rescale_normal = glewGetExtension("GL_EXT_rescale_normal"); +#endif /* GL_EXT_rescale_normal */ +#ifdef GL_EXT_scene_marker + GLEW_EXT_scene_marker = glewGetExtension("GL_EXT_scene_marker"); + if (glewExperimental || GLEW_EXT_scene_marker) GLEW_EXT_scene_marker = !_glewInit_GL_EXT_scene_marker(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_scene_marker */ +#ifdef GL_EXT_secondary_color + GLEW_EXT_secondary_color = glewGetExtension("GL_EXT_secondary_color"); + if (glewExperimental || GLEW_EXT_secondary_color) GLEW_EXT_secondary_color = !_glewInit_GL_EXT_secondary_color(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_secondary_color */ +#ifdef GL_EXT_separate_specular_color + GLEW_EXT_separate_specular_color = glewGetExtension("GL_EXT_separate_specular_color"); +#endif /* GL_EXT_separate_specular_color */ +#ifdef GL_EXT_shadow_funcs + GLEW_EXT_shadow_funcs = glewGetExtension("GL_EXT_shadow_funcs"); +#endif /* GL_EXT_shadow_funcs */ +#ifdef GL_EXT_shared_texture_palette + GLEW_EXT_shared_texture_palette = glewGetExtension("GL_EXT_shared_texture_palette"); +#endif /* GL_EXT_shared_texture_palette */ +#ifdef GL_EXT_stencil_clear_tag + GLEW_EXT_stencil_clear_tag = glewGetExtension("GL_EXT_stencil_clear_tag"); +#endif /* GL_EXT_stencil_clear_tag */ +#ifdef GL_EXT_stencil_two_side + GLEW_EXT_stencil_two_side = glewGetExtension("GL_EXT_stencil_two_side"); + if (glewExperimental || GLEW_EXT_stencil_two_side) GLEW_EXT_stencil_two_side = !_glewInit_GL_EXT_stencil_two_side(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_stencil_two_side */ +#ifdef GL_EXT_stencil_wrap + GLEW_EXT_stencil_wrap = glewGetExtension("GL_EXT_stencil_wrap"); +#endif /* GL_EXT_stencil_wrap */ +#ifdef GL_EXT_subtexture + GLEW_EXT_subtexture = glewGetExtension("GL_EXT_subtexture"); + if (glewExperimental || GLEW_EXT_subtexture) GLEW_EXT_subtexture = !_glewInit_GL_EXT_subtexture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_subtexture */ +#ifdef GL_EXT_texture + GLEW_EXT_texture = glewGetExtension("GL_EXT_texture"); +#endif /* GL_EXT_texture */ +#ifdef GL_EXT_texture3D + GLEW_EXT_texture3D = glewGetExtension("GL_EXT_texture3D"); + if (glewExperimental || GLEW_EXT_texture3D) GLEW_EXT_texture3D = !_glewInit_GL_EXT_texture3D(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture3D */ +#ifdef GL_EXT_texture_compression_dxt1 + GLEW_EXT_texture_compression_dxt1 = glewGetExtension("GL_EXT_texture_compression_dxt1"); +#endif /* GL_EXT_texture_compression_dxt1 */ +#ifdef GL_EXT_texture_compression_s3tc + GLEW_EXT_texture_compression_s3tc = glewGetExtension("GL_EXT_texture_compression_s3tc"); +#endif /* GL_EXT_texture_compression_s3tc */ +#ifdef GL_EXT_texture_cube_map + GLEW_EXT_texture_cube_map = glewGetExtension("GL_EXT_texture_cube_map"); +#endif /* GL_EXT_texture_cube_map */ +#ifdef GL_EXT_texture_edge_clamp + GLEW_EXT_texture_edge_clamp = glewGetExtension("GL_EXT_texture_edge_clamp"); +#endif /* GL_EXT_texture_edge_clamp */ +#ifdef GL_EXT_texture_env + GLEW_EXT_texture_env = glewGetExtension("GL_EXT_texture_env"); +#endif /* GL_EXT_texture_env */ +#ifdef GL_EXT_texture_env_add + GLEW_EXT_texture_env_add = glewGetExtension("GL_EXT_texture_env_add"); +#endif /* GL_EXT_texture_env_add */ +#ifdef GL_EXT_texture_env_combine + GLEW_EXT_texture_env_combine = glewGetExtension("GL_EXT_texture_env_combine"); +#endif /* GL_EXT_texture_env_combine */ +#ifdef GL_EXT_texture_env_dot3 + GLEW_EXT_texture_env_dot3 = glewGetExtension("GL_EXT_texture_env_dot3"); +#endif /* GL_EXT_texture_env_dot3 */ +#ifdef GL_EXT_texture_filter_anisotropic + GLEW_EXT_texture_filter_anisotropic = glewGetExtension("GL_EXT_texture_filter_anisotropic"); +#endif /* GL_EXT_texture_filter_anisotropic */ +#ifdef GL_EXT_texture_lod_bias + GLEW_EXT_texture_lod_bias = glewGetExtension("GL_EXT_texture_lod_bias"); +#endif /* GL_EXT_texture_lod_bias */ +#ifdef GL_EXT_texture_mirror_clamp + GLEW_EXT_texture_mirror_clamp = glewGetExtension("GL_EXT_texture_mirror_clamp"); +#endif /* GL_EXT_texture_mirror_clamp */ +#ifdef GL_EXT_texture_object + GLEW_EXT_texture_object = glewGetExtension("GL_EXT_texture_object"); + if (glewExperimental || GLEW_EXT_texture_object) GLEW_EXT_texture_object = !_glewInit_GL_EXT_texture_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture_object */ +#ifdef GL_EXT_texture_perturb_normal + GLEW_EXT_texture_perturb_normal = glewGetExtension("GL_EXT_texture_perturb_normal"); + if (glewExperimental || GLEW_EXT_texture_perturb_normal) GLEW_EXT_texture_perturb_normal = !_glewInit_GL_EXT_texture_perturb_normal(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture_perturb_normal */ +#ifdef GL_EXT_texture_rectangle + GLEW_EXT_texture_rectangle = glewGetExtension("GL_EXT_texture_rectangle"); +#endif /* GL_EXT_texture_rectangle */ +#ifdef GL_EXT_texture_sRGB + GLEW_EXT_texture_sRGB = glewGetExtension("GL_EXT_texture_sRGB"); +#endif /* GL_EXT_texture_sRGB */ +#ifdef GL_EXT_vertex_array + GLEW_EXT_vertex_array = glewGetExtension("GL_EXT_vertex_array"); + if (glewExperimental || GLEW_EXT_vertex_array) GLEW_EXT_vertex_array = !_glewInit_GL_EXT_vertex_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_vertex_array */ +#ifdef GL_EXT_vertex_shader + GLEW_EXT_vertex_shader = glewGetExtension("GL_EXT_vertex_shader"); + if (glewExperimental || GLEW_EXT_vertex_shader) GLEW_EXT_vertex_shader = !_glewInit_GL_EXT_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_vertex_shader */ +#ifdef GL_EXT_vertex_weighting + GLEW_EXT_vertex_weighting = glewGetExtension("GL_EXT_vertex_weighting"); + if (glewExperimental || GLEW_EXT_vertex_weighting) GLEW_EXT_vertex_weighting = !_glewInit_GL_EXT_vertex_weighting(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_vertex_weighting */ +#ifdef GL_GREMEDY_string_marker + GLEW_GREMEDY_string_marker = glewGetExtension("GL_GREMEDY_string_marker"); + if (glewExperimental || GLEW_GREMEDY_string_marker) GLEW_GREMEDY_string_marker = !_glewInit_GL_GREMEDY_string_marker(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_GREMEDY_string_marker */ +#ifdef GL_HP_convolution_border_modes + GLEW_HP_convolution_border_modes = glewGetExtension("GL_HP_convolution_border_modes"); +#endif /* GL_HP_convolution_border_modes */ +#ifdef GL_HP_image_transform + GLEW_HP_image_transform = glewGetExtension("GL_HP_image_transform"); + if (glewExperimental || GLEW_HP_image_transform) GLEW_HP_image_transform = !_glewInit_GL_HP_image_transform(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_HP_image_transform */ +#ifdef GL_HP_occlusion_test + GLEW_HP_occlusion_test = glewGetExtension("GL_HP_occlusion_test"); +#endif /* GL_HP_occlusion_test */ +#ifdef GL_HP_texture_lighting + GLEW_HP_texture_lighting = glewGetExtension("GL_HP_texture_lighting"); +#endif /* GL_HP_texture_lighting */ +#ifdef GL_IBM_cull_vertex + GLEW_IBM_cull_vertex = glewGetExtension("GL_IBM_cull_vertex"); +#endif /* GL_IBM_cull_vertex */ +#ifdef GL_IBM_multimode_draw_arrays + GLEW_IBM_multimode_draw_arrays = glewGetExtension("GL_IBM_multimode_draw_arrays"); + if (glewExperimental || GLEW_IBM_multimode_draw_arrays) GLEW_IBM_multimode_draw_arrays = !_glewInit_GL_IBM_multimode_draw_arrays(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_IBM_multimode_draw_arrays */ +#ifdef GL_IBM_rasterpos_clip + GLEW_IBM_rasterpos_clip = glewGetExtension("GL_IBM_rasterpos_clip"); +#endif /* GL_IBM_rasterpos_clip */ +#ifdef GL_IBM_static_data + GLEW_IBM_static_data = glewGetExtension("GL_IBM_static_data"); +#endif /* GL_IBM_static_data */ +#ifdef GL_IBM_texture_mirrored_repeat + GLEW_IBM_texture_mirrored_repeat = glewGetExtension("GL_IBM_texture_mirrored_repeat"); +#endif /* GL_IBM_texture_mirrored_repeat */ +#ifdef GL_IBM_vertex_array_lists + GLEW_IBM_vertex_array_lists = glewGetExtension("GL_IBM_vertex_array_lists"); + if (glewExperimental || GLEW_IBM_vertex_array_lists) GLEW_IBM_vertex_array_lists = !_glewInit_GL_IBM_vertex_array_lists(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_IBM_vertex_array_lists */ +#ifdef GL_INGR_color_clamp + GLEW_INGR_color_clamp = glewGetExtension("GL_INGR_color_clamp"); +#endif /* GL_INGR_color_clamp */ +#ifdef GL_INGR_interlace_read + GLEW_INGR_interlace_read = glewGetExtension("GL_INGR_interlace_read"); +#endif /* GL_INGR_interlace_read */ +#ifdef GL_INTEL_parallel_arrays + GLEW_INTEL_parallel_arrays = glewGetExtension("GL_INTEL_parallel_arrays"); + if (glewExperimental || GLEW_INTEL_parallel_arrays) GLEW_INTEL_parallel_arrays = !_glewInit_GL_INTEL_parallel_arrays(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_INTEL_parallel_arrays */ +#ifdef GL_INTEL_texture_scissor + GLEW_INTEL_texture_scissor = glewGetExtension("GL_INTEL_texture_scissor"); + if (glewExperimental || GLEW_INTEL_texture_scissor) GLEW_INTEL_texture_scissor = !_glewInit_GL_INTEL_texture_scissor(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_INTEL_texture_scissor */ +#ifdef GL_KTX_buffer_region + GLEW_KTX_buffer_region = glewGetExtension("GL_KTX_buffer_region"); + if (glewExperimental || GLEW_KTX_buffer_region) GLEW_KTX_buffer_region = !_glewInit_GL_KTX_buffer_region(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_KTX_buffer_region */ +#ifdef GL_MESAX_texture_stack + GLEW_MESAX_texture_stack = glewGetExtension("GL_MESAX_texture_stack"); +#endif /* GL_MESAX_texture_stack */ +#ifdef GL_MESA_pack_invert + GLEW_MESA_pack_invert = glewGetExtension("GL_MESA_pack_invert"); +#endif /* GL_MESA_pack_invert */ +#ifdef GL_MESA_resize_buffers + GLEW_MESA_resize_buffers = glewGetExtension("GL_MESA_resize_buffers"); + if (glewExperimental || GLEW_MESA_resize_buffers) GLEW_MESA_resize_buffers = !_glewInit_GL_MESA_resize_buffers(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_MESA_resize_buffers */ +#ifdef GL_MESA_window_pos + GLEW_MESA_window_pos = glewGetExtension("GL_MESA_window_pos"); + if (glewExperimental || GLEW_MESA_window_pos) GLEW_MESA_window_pos = !_glewInit_GL_MESA_window_pos(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_MESA_window_pos */ +#ifdef GL_MESA_ycbcr_texture + GLEW_MESA_ycbcr_texture = glewGetExtension("GL_MESA_ycbcr_texture"); +#endif /* GL_MESA_ycbcr_texture */ +#ifdef GL_NV_blend_square + GLEW_NV_blend_square = glewGetExtension("GL_NV_blend_square"); +#endif /* GL_NV_blend_square */ +#ifdef GL_NV_copy_depth_to_color + GLEW_NV_copy_depth_to_color = glewGetExtension("GL_NV_copy_depth_to_color"); +#endif /* GL_NV_copy_depth_to_color */ +#ifdef GL_NV_depth_clamp + GLEW_NV_depth_clamp = glewGetExtension("GL_NV_depth_clamp"); +#endif /* GL_NV_depth_clamp */ +#ifdef GL_NV_evaluators + GLEW_NV_evaluators = glewGetExtension("GL_NV_evaluators"); + if (glewExperimental || GLEW_NV_evaluators) GLEW_NV_evaluators = !_glewInit_GL_NV_evaluators(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_evaluators */ +#ifdef GL_NV_fence + GLEW_NV_fence = glewGetExtension("GL_NV_fence"); + if (glewExperimental || GLEW_NV_fence) GLEW_NV_fence = !_glewInit_GL_NV_fence(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_fence */ +#ifdef GL_NV_float_buffer + GLEW_NV_float_buffer = glewGetExtension("GL_NV_float_buffer"); +#endif /* GL_NV_float_buffer */ +#ifdef GL_NV_fog_distance + GLEW_NV_fog_distance = glewGetExtension("GL_NV_fog_distance"); +#endif /* GL_NV_fog_distance */ +#ifdef GL_NV_fragment_program + GLEW_NV_fragment_program = glewGetExtension("GL_NV_fragment_program"); + if (glewExperimental || GLEW_NV_fragment_program) GLEW_NV_fragment_program = !_glewInit_GL_NV_fragment_program(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_fragment_program */ +#ifdef GL_NV_fragment_program2 + GLEW_NV_fragment_program2 = glewGetExtension("GL_NV_fragment_program2"); +#endif /* GL_NV_fragment_program2 */ +#ifdef GL_NV_fragment_program_option + GLEW_NV_fragment_program_option = glewGetExtension("GL_NV_fragment_program_option"); +#endif /* GL_NV_fragment_program_option */ +#ifdef GL_NV_half_float + GLEW_NV_half_float = glewGetExtension("GL_NV_half_float"); + if (glewExperimental || GLEW_NV_half_float) GLEW_NV_half_float = !_glewInit_GL_NV_half_float(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_half_float */ +#ifdef GL_NV_light_max_exponent + GLEW_NV_light_max_exponent = glewGetExtension("GL_NV_light_max_exponent"); +#endif /* GL_NV_light_max_exponent */ +#ifdef GL_NV_multisample_filter_hint + GLEW_NV_multisample_filter_hint = glewGetExtension("GL_NV_multisample_filter_hint"); +#endif /* GL_NV_multisample_filter_hint */ +#ifdef GL_NV_occlusion_query + GLEW_NV_occlusion_query = glewGetExtension("GL_NV_occlusion_query"); + if (glewExperimental || GLEW_NV_occlusion_query) GLEW_NV_occlusion_query = !_glewInit_GL_NV_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_occlusion_query */ +#ifdef GL_NV_packed_depth_stencil + GLEW_NV_packed_depth_stencil = glewGetExtension("GL_NV_packed_depth_stencil"); +#endif /* GL_NV_packed_depth_stencil */ +#ifdef GL_NV_pixel_data_range + GLEW_NV_pixel_data_range = glewGetExtension("GL_NV_pixel_data_range"); + if (glewExperimental || GLEW_NV_pixel_data_range) GLEW_NV_pixel_data_range = !_glewInit_GL_NV_pixel_data_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_pixel_data_range */ +#ifdef GL_NV_point_sprite + GLEW_NV_point_sprite = glewGetExtension("GL_NV_point_sprite"); + if (glewExperimental || GLEW_NV_point_sprite) GLEW_NV_point_sprite = !_glewInit_GL_NV_point_sprite(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_point_sprite */ +#ifdef GL_NV_primitive_restart + GLEW_NV_primitive_restart = glewGetExtension("GL_NV_primitive_restart"); + if (glewExperimental || GLEW_NV_primitive_restart) GLEW_NV_primitive_restart = !_glewInit_GL_NV_primitive_restart(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_primitive_restart */ +#ifdef GL_NV_register_combiners + GLEW_NV_register_combiners = glewGetExtension("GL_NV_register_combiners"); + if (glewExperimental || GLEW_NV_register_combiners) GLEW_NV_register_combiners = !_glewInit_GL_NV_register_combiners(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_register_combiners */ +#ifdef GL_NV_register_combiners2 + GLEW_NV_register_combiners2 = glewGetExtension("GL_NV_register_combiners2"); + if (glewExperimental || GLEW_NV_register_combiners2) GLEW_NV_register_combiners2 = !_glewInit_GL_NV_register_combiners2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_register_combiners2 */ +#ifdef GL_NV_texgen_emboss + GLEW_NV_texgen_emboss = glewGetExtension("GL_NV_texgen_emboss"); +#endif /* GL_NV_texgen_emboss */ +#ifdef GL_NV_texgen_reflection + GLEW_NV_texgen_reflection = glewGetExtension("GL_NV_texgen_reflection"); +#endif /* GL_NV_texgen_reflection */ +#ifdef GL_NV_texture_compression_vtc + GLEW_NV_texture_compression_vtc = glewGetExtension("GL_NV_texture_compression_vtc"); +#endif /* GL_NV_texture_compression_vtc */ +#ifdef GL_NV_texture_env_combine4 + GLEW_NV_texture_env_combine4 = glewGetExtension("GL_NV_texture_env_combine4"); +#endif /* GL_NV_texture_env_combine4 */ +#ifdef GL_NV_texture_expand_normal + GLEW_NV_texture_expand_normal = glewGetExtension("GL_NV_texture_expand_normal"); +#endif /* GL_NV_texture_expand_normal */ +#ifdef GL_NV_texture_rectangle + GLEW_NV_texture_rectangle = glewGetExtension("GL_NV_texture_rectangle"); +#endif /* GL_NV_texture_rectangle */ +#ifdef GL_NV_texture_shader + GLEW_NV_texture_shader = glewGetExtension("GL_NV_texture_shader"); +#endif /* GL_NV_texture_shader */ +#ifdef GL_NV_texture_shader2 + GLEW_NV_texture_shader2 = glewGetExtension("GL_NV_texture_shader2"); +#endif /* GL_NV_texture_shader2 */ +#ifdef GL_NV_texture_shader3 + GLEW_NV_texture_shader3 = glewGetExtension("GL_NV_texture_shader3"); +#endif /* GL_NV_texture_shader3 */ +#ifdef GL_NV_vertex_array_range + GLEW_NV_vertex_array_range = glewGetExtension("GL_NV_vertex_array_range"); + if (glewExperimental || GLEW_NV_vertex_array_range) GLEW_NV_vertex_array_range = !_glewInit_GL_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_vertex_array_range */ +#ifdef GL_NV_vertex_array_range2 + GLEW_NV_vertex_array_range2 = glewGetExtension("GL_NV_vertex_array_range2"); +#endif /* GL_NV_vertex_array_range2 */ +#ifdef GL_NV_vertex_program + GLEW_NV_vertex_program = glewGetExtension("GL_NV_vertex_program"); + if (glewExperimental || GLEW_NV_vertex_program) GLEW_NV_vertex_program = !_glewInit_GL_NV_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_vertex_program */ +#ifdef GL_NV_vertex_program1_1 + GLEW_NV_vertex_program1_1 = glewGetExtension("GL_NV_vertex_program1_1"); +#endif /* GL_NV_vertex_program1_1 */ +#ifdef GL_NV_vertex_program2 + GLEW_NV_vertex_program2 = glewGetExtension("GL_NV_vertex_program2"); +#endif /* GL_NV_vertex_program2 */ +#ifdef GL_NV_vertex_program2_option + GLEW_NV_vertex_program2_option = glewGetExtension("GL_NV_vertex_program2_option"); +#endif /* GL_NV_vertex_program2_option */ +#ifdef GL_NV_vertex_program3 + GLEW_NV_vertex_program3 = glewGetExtension("GL_NV_vertex_program3"); +#endif /* GL_NV_vertex_program3 */ +#ifdef GL_OML_interlace + GLEW_OML_interlace = glewGetExtension("GL_OML_interlace"); +#endif /* GL_OML_interlace */ +#ifdef GL_OML_resample + GLEW_OML_resample = glewGetExtension("GL_OML_resample"); +#endif /* GL_OML_resample */ +#ifdef GL_OML_subsample + GLEW_OML_subsample = glewGetExtension("GL_OML_subsample"); +#endif /* GL_OML_subsample */ +#ifdef GL_PGI_misc_hints + GLEW_PGI_misc_hints = glewGetExtension("GL_PGI_misc_hints"); +#endif /* GL_PGI_misc_hints */ +#ifdef GL_PGI_vertex_hints + GLEW_PGI_vertex_hints = glewGetExtension("GL_PGI_vertex_hints"); +#endif /* GL_PGI_vertex_hints */ +#ifdef GL_REND_screen_coordinates + GLEW_REND_screen_coordinates = glewGetExtension("GL_REND_screen_coordinates"); +#endif /* GL_REND_screen_coordinates */ +#ifdef GL_S3_s3tc + GLEW_S3_s3tc = glewGetExtension("GL_S3_s3tc"); +#endif /* GL_S3_s3tc */ +#ifdef GL_SGIS_color_range + GLEW_SGIS_color_range = glewGetExtension("GL_SGIS_color_range"); +#endif /* GL_SGIS_color_range */ +#ifdef GL_SGIS_detail_texture + GLEW_SGIS_detail_texture = glewGetExtension("GL_SGIS_detail_texture"); + if (glewExperimental || GLEW_SGIS_detail_texture) GLEW_SGIS_detail_texture = !_glewInit_GL_SGIS_detail_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_detail_texture */ +#ifdef GL_SGIS_fog_function + GLEW_SGIS_fog_function = glewGetExtension("GL_SGIS_fog_function"); + if (glewExperimental || GLEW_SGIS_fog_function) GLEW_SGIS_fog_function = !_glewInit_GL_SGIS_fog_function(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_fog_function */ +#ifdef GL_SGIS_generate_mipmap + GLEW_SGIS_generate_mipmap = glewGetExtension("GL_SGIS_generate_mipmap"); +#endif /* GL_SGIS_generate_mipmap */ +#ifdef GL_SGIS_multisample + GLEW_SGIS_multisample = glewGetExtension("GL_SGIS_multisample"); + if (glewExperimental || GLEW_SGIS_multisample) GLEW_SGIS_multisample = !_glewInit_GL_SGIS_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_multisample */ +#ifdef GL_SGIS_pixel_texture + GLEW_SGIS_pixel_texture = glewGetExtension("GL_SGIS_pixel_texture"); +#endif /* GL_SGIS_pixel_texture */ +#ifdef GL_SGIS_sharpen_texture + GLEW_SGIS_sharpen_texture = glewGetExtension("GL_SGIS_sharpen_texture"); + if (glewExperimental || GLEW_SGIS_sharpen_texture) GLEW_SGIS_sharpen_texture = !_glewInit_GL_SGIS_sharpen_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_sharpen_texture */ +#ifdef GL_SGIS_texture4D + GLEW_SGIS_texture4D = glewGetExtension("GL_SGIS_texture4D"); + if (glewExperimental || GLEW_SGIS_texture4D) GLEW_SGIS_texture4D = !_glewInit_GL_SGIS_texture4D(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_texture4D */ +#ifdef GL_SGIS_texture_border_clamp + GLEW_SGIS_texture_border_clamp = glewGetExtension("GL_SGIS_texture_border_clamp"); +#endif /* GL_SGIS_texture_border_clamp */ +#ifdef GL_SGIS_texture_edge_clamp + GLEW_SGIS_texture_edge_clamp = glewGetExtension("GL_SGIS_texture_edge_clamp"); +#endif /* GL_SGIS_texture_edge_clamp */ +#ifdef GL_SGIS_texture_filter4 + GLEW_SGIS_texture_filter4 = glewGetExtension("GL_SGIS_texture_filter4"); + if (glewExperimental || GLEW_SGIS_texture_filter4) GLEW_SGIS_texture_filter4 = !_glewInit_GL_SGIS_texture_filter4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_texture_filter4 */ +#ifdef GL_SGIS_texture_lod + GLEW_SGIS_texture_lod = glewGetExtension("GL_SGIS_texture_lod"); +#endif /* GL_SGIS_texture_lod */ +#ifdef GL_SGIS_texture_select + GLEW_SGIS_texture_select = glewGetExtension("GL_SGIS_texture_select"); +#endif /* GL_SGIS_texture_select */ +#ifdef GL_SGIX_async + GLEW_SGIX_async = glewGetExtension("GL_SGIX_async"); + if (glewExperimental || GLEW_SGIX_async) GLEW_SGIX_async = !_glewInit_GL_SGIX_async(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_async */ +#ifdef GL_SGIX_async_histogram + GLEW_SGIX_async_histogram = glewGetExtension("GL_SGIX_async_histogram"); +#endif /* GL_SGIX_async_histogram */ +#ifdef GL_SGIX_async_pixel + GLEW_SGIX_async_pixel = glewGetExtension("GL_SGIX_async_pixel"); +#endif /* GL_SGIX_async_pixel */ +#ifdef GL_SGIX_blend_alpha_minmax + GLEW_SGIX_blend_alpha_minmax = glewGetExtension("GL_SGIX_blend_alpha_minmax"); +#endif /* GL_SGIX_blend_alpha_minmax */ +#ifdef GL_SGIX_clipmap + GLEW_SGIX_clipmap = glewGetExtension("GL_SGIX_clipmap"); +#endif /* GL_SGIX_clipmap */ +#ifdef GL_SGIX_depth_texture + GLEW_SGIX_depth_texture = glewGetExtension("GL_SGIX_depth_texture"); +#endif /* GL_SGIX_depth_texture */ +#ifdef GL_SGIX_flush_raster + GLEW_SGIX_flush_raster = glewGetExtension("GL_SGIX_flush_raster"); + if (glewExperimental || GLEW_SGIX_flush_raster) GLEW_SGIX_flush_raster = !_glewInit_GL_SGIX_flush_raster(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_flush_raster */ +#ifdef GL_SGIX_fog_offset + GLEW_SGIX_fog_offset = glewGetExtension("GL_SGIX_fog_offset"); +#endif /* GL_SGIX_fog_offset */ +#ifdef GL_SGIX_fog_texture + GLEW_SGIX_fog_texture = glewGetExtension("GL_SGIX_fog_texture"); + if (glewExperimental || GLEW_SGIX_fog_texture) GLEW_SGIX_fog_texture = !_glewInit_GL_SGIX_fog_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_fog_texture */ +#ifdef GL_SGIX_fragment_specular_lighting + GLEW_SGIX_fragment_specular_lighting = glewGetExtension("GL_SGIX_fragment_specular_lighting"); + if (glewExperimental || GLEW_SGIX_fragment_specular_lighting) GLEW_SGIX_fragment_specular_lighting = !_glewInit_GL_SGIX_fragment_specular_lighting(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_fragment_specular_lighting */ +#ifdef GL_SGIX_framezoom + GLEW_SGIX_framezoom = glewGetExtension("GL_SGIX_framezoom"); + if (glewExperimental || GLEW_SGIX_framezoom) GLEW_SGIX_framezoom = !_glewInit_GL_SGIX_framezoom(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_framezoom */ +#ifdef GL_SGIX_interlace + GLEW_SGIX_interlace = glewGetExtension("GL_SGIX_interlace"); +#endif /* GL_SGIX_interlace */ +#ifdef GL_SGIX_ir_instrument1 + GLEW_SGIX_ir_instrument1 = glewGetExtension("GL_SGIX_ir_instrument1"); +#endif /* GL_SGIX_ir_instrument1 */ +#ifdef GL_SGIX_list_priority + GLEW_SGIX_list_priority = glewGetExtension("GL_SGIX_list_priority"); +#endif /* GL_SGIX_list_priority */ +#ifdef GL_SGIX_pixel_texture + GLEW_SGIX_pixel_texture = glewGetExtension("GL_SGIX_pixel_texture"); + if (glewExperimental || GLEW_SGIX_pixel_texture) GLEW_SGIX_pixel_texture = !_glewInit_GL_SGIX_pixel_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_pixel_texture */ +#ifdef GL_SGIX_pixel_texture_bits + GLEW_SGIX_pixel_texture_bits = glewGetExtension("GL_SGIX_pixel_texture_bits"); +#endif /* GL_SGIX_pixel_texture_bits */ +#ifdef GL_SGIX_reference_plane + GLEW_SGIX_reference_plane = glewGetExtension("GL_SGIX_reference_plane"); + if (glewExperimental || GLEW_SGIX_reference_plane) GLEW_SGIX_reference_plane = !_glewInit_GL_SGIX_reference_plane(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_reference_plane */ +#ifdef GL_SGIX_resample + GLEW_SGIX_resample = glewGetExtension("GL_SGIX_resample"); +#endif /* GL_SGIX_resample */ +#ifdef GL_SGIX_shadow + GLEW_SGIX_shadow = glewGetExtension("GL_SGIX_shadow"); +#endif /* GL_SGIX_shadow */ +#ifdef GL_SGIX_shadow_ambient + GLEW_SGIX_shadow_ambient = glewGetExtension("GL_SGIX_shadow_ambient"); +#endif /* GL_SGIX_shadow_ambient */ +#ifdef GL_SGIX_sprite + GLEW_SGIX_sprite = glewGetExtension("GL_SGIX_sprite"); + if (glewExperimental || GLEW_SGIX_sprite) GLEW_SGIX_sprite = !_glewInit_GL_SGIX_sprite(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_sprite */ +#ifdef GL_SGIX_tag_sample_buffer + GLEW_SGIX_tag_sample_buffer = glewGetExtension("GL_SGIX_tag_sample_buffer"); + if (glewExperimental || GLEW_SGIX_tag_sample_buffer) GLEW_SGIX_tag_sample_buffer = !_glewInit_GL_SGIX_tag_sample_buffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_tag_sample_buffer */ +#ifdef GL_SGIX_texture_add_env + GLEW_SGIX_texture_add_env = glewGetExtension("GL_SGIX_texture_add_env"); +#endif /* GL_SGIX_texture_add_env */ +#ifdef GL_SGIX_texture_coordinate_clamp + GLEW_SGIX_texture_coordinate_clamp = glewGetExtension("GL_SGIX_texture_coordinate_clamp"); +#endif /* GL_SGIX_texture_coordinate_clamp */ +#ifdef GL_SGIX_texture_lod_bias + GLEW_SGIX_texture_lod_bias = glewGetExtension("GL_SGIX_texture_lod_bias"); +#endif /* GL_SGIX_texture_lod_bias */ +#ifdef GL_SGIX_texture_multi_buffer + GLEW_SGIX_texture_multi_buffer = glewGetExtension("GL_SGIX_texture_multi_buffer"); +#endif /* GL_SGIX_texture_multi_buffer */ +#ifdef GL_SGIX_texture_range + GLEW_SGIX_texture_range = glewGetExtension("GL_SGIX_texture_range"); +#endif /* GL_SGIX_texture_range */ +#ifdef GL_SGIX_texture_scale_bias + GLEW_SGIX_texture_scale_bias = glewGetExtension("GL_SGIX_texture_scale_bias"); +#endif /* GL_SGIX_texture_scale_bias */ +#ifdef GL_SGIX_vertex_preclip + GLEW_SGIX_vertex_preclip = glewGetExtension("GL_SGIX_vertex_preclip"); +#endif /* GL_SGIX_vertex_preclip */ +#ifdef GL_SGIX_vertex_preclip_hint + GLEW_SGIX_vertex_preclip_hint = glewGetExtension("GL_SGIX_vertex_preclip_hint"); +#endif /* GL_SGIX_vertex_preclip_hint */ +#ifdef GL_SGIX_ycrcb + GLEW_SGIX_ycrcb = glewGetExtension("GL_SGIX_ycrcb"); +#endif /* GL_SGIX_ycrcb */ +#ifdef GL_SGI_color_matrix + GLEW_SGI_color_matrix = glewGetExtension("GL_SGI_color_matrix"); +#endif /* GL_SGI_color_matrix */ +#ifdef GL_SGI_color_table + GLEW_SGI_color_table = glewGetExtension("GL_SGI_color_table"); + if (glewExperimental || GLEW_SGI_color_table) GLEW_SGI_color_table = !_glewInit_GL_SGI_color_table(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGI_color_table */ +#ifdef GL_SGI_texture_color_table + GLEW_SGI_texture_color_table = glewGetExtension("GL_SGI_texture_color_table"); +#endif /* GL_SGI_texture_color_table */ +#ifdef GL_SUNX_constant_data + GLEW_SUNX_constant_data = glewGetExtension("GL_SUNX_constant_data"); + if (glewExperimental || GLEW_SUNX_constant_data) GLEW_SUNX_constant_data = !_glewInit_GL_SUNX_constant_data(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SUNX_constant_data */ +#ifdef GL_SUN_convolution_border_modes + GLEW_SUN_convolution_border_modes = glewGetExtension("GL_SUN_convolution_border_modes"); +#endif /* GL_SUN_convolution_border_modes */ +#ifdef GL_SUN_global_alpha + GLEW_SUN_global_alpha = glewGetExtension("GL_SUN_global_alpha"); + if (glewExperimental || GLEW_SUN_global_alpha) GLEW_SUN_global_alpha = !_glewInit_GL_SUN_global_alpha(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SUN_global_alpha */ +#ifdef GL_SUN_mesh_array + GLEW_SUN_mesh_array = glewGetExtension("GL_SUN_mesh_array"); +#endif /* GL_SUN_mesh_array */ +#ifdef GL_SUN_read_video_pixels + GLEW_SUN_read_video_pixels = glewGetExtension("GL_SUN_read_video_pixels"); + if (glewExperimental || GLEW_SUN_read_video_pixels) GLEW_SUN_read_video_pixels = !_glewInit_GL_SUN_read_video_pixels(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SUN_read_video_pixels */ +#ifdef GL_SUN_slice_accum + GLEW_SUN_slice_accum = glewGetExtension("GL_SUN_slice_accum"); +#endif /* GL_SUN_slice_accum */ +#ifdef GL_SUN_triangle_list + GLEW_SUN_triangle_list = glewGetExtension("GL_SUN_triangle_list"); + if (glewExperimental || GLEW_SUN_triangle_list) GLEW_SUN_triangle_list = !_glewInit_GL_SUN_triangle_list(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SUN_triangle_list */ +#ifdef GL_SUN_vertex + GLEW_SUN_vertex = glewGetExtension("GL_SUN_vertex"); + if (glewExperimental || GLEW_SUN_vertex) GLEW_SUN_vertex = !_glewInit_GL_SUN_vertex(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SUN_vertex */ +#ifdef GL_WIN_phong_shading + GLEW_WIN_phong_shading = glewGetExtension("GL_WIN_phong_shading"); +#endif /* GL_WIN_phong_shading */ +#ifdef GL_WIN_specular_fog + GLEW_WIN_specular_fog = glewGetExtension("GL_WIN_specular_fog"); +#endif /* GL_WIN_specular_fog */ +#ifdef GL_WIN_swap_hint + GLEW_WIN_swap_hint = glewGetExtension("GL_WIN_swap_hint"); + if (glewExperimental || GLEW_WIN_swap_hint) GLEW_WIN_swap_hint = !_glewInit_GL_WIN_swap_hint(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_WIN_swap_hint */ + + return GLEW_OK; +} + + +#if defined(_WIN32) + +#if !defined(GLEW_MX) + +PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL = NULL; + +PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB = NULL; +PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB = NULL; +PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB = NULL; +PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB = NULL; + +PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB = NULL; + +PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB = NULL; +PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB = NULL; + +PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB = NULL; +PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB = NULL; +PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB = NULL; +PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB = NULL; +PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB = NULL; + +PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB = NULL; +PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB = NULL; +PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB = NULL; + +PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB = NULL; +PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB = NULL; +PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB = NULL; + +PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT = NULL; +PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT = NULL; +PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT = NULL; +PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT = NULL; + +PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT = NULL; + +PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT = NULL; +PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT = NULL; + +PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT = NULL; +PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT = NULL; +PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT = NULL; +PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT = NULL; +PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT = NULL; + +PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT = NULL; +PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT = NULL; +PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT = NULL; + +PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT = NULL; +PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT = NULL; + +PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D = NULL; +PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D = NULL; + +PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D = NULL; +PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D = NULL; +PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D = NULL; +PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D = NULL; + +PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D = NULL; +PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D = NULL; +PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D = NULL; +PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D = NULL; +PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D = NULL; +PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D = NULL; +PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D = NULL; +PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D = NULL; +PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D = NULL; +PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D = NULL; +PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D = NULL; +PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D = NULL; + +PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D = NULL; +PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D = NULL; +PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D = NULL; +PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D = NULL; + +PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D = NULL; +PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D = NULL; +PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D = NULL; +PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D = NULL; + +PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D = NULL; +PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D = NULL; +PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D = NULL; +PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D = NULL; + +PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV = NULL; +PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV = NULL; + +PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML = NULL; +PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML = NULL; +PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML = NULL; +PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML = NULL; +PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML = NULL; +PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML = NULL; +GLboolean __WGLEW_3DFX_multisample = GL_FALSE; +GLboolean __WGLEW_3DL_stereo_control = GL_FALSE; +GLboolean __WGLEW_ARB_buffer_region = GL_FALSE; +GLboolean __WGLEW_ARB_extensions_string = GL_FALSE; +GLboolean __WGLEW_ARB_make_current_read = GL_FALSE; +GLboolean __WGLEW_ARB_multisample = GL_FALSE; +GLboolean __WGLEW_ARB_pbuffer = GL_FALSE; +GLboolean __WGLEW_ARB_pixel_format = GL_FALSE; +GLboolean __WGLEW_ARB_pixel_format_float = GL_FALSE; +GLboolean __WGLEW_ARB_render_texture = GL_FALSE; +GLboolean __WGLEW_ATI_pixel_format_float = GL_FALSE; +GLboolean __WGLEW_ATI_render_texture_rectangle = GL_FALSE; +GLboolean __WGLEW_EXT_depth_float = GL_FALSE; +GLboolean __WGLEW_EXT_display_color_table = GL_FALSE; +GLboolean __WGLEW_EXT_extensions_string = GL_FALSE; +GLboolean __WGLEW_EXT_make_current_read = GL_FALSE; +GLboolean __WGLEW_EXT_multisample = GL_FALSE; +GLboolean __WGLEW_EXT_pbuffer = GL_FALSE; +GLboolean __WGLEW_EXT_pixel_format = GL_FALSE; +GLboolean __WGLEW_EXT_swap_control = GL_FALSE; +GLboolean __WGLEW_I3D_digital_video_control = GL_FALSE; +GLboolean __WGLEW_I3D_gamma = GL_FALSE; +GLboolean __WGLEW_I3D_genlock = GL_FALSE; +GLboolean __WGLEW_I3D_image_buffer = GL_FALSE; +GLboolean __WGLEW_I3D_swap_frame_lock = GL_FALSE; +GLboolean __WGLEW_I3D_swap_frame_usage = GL_FALSE; +GLboolean __WGLEW_NV_float_buffer = GL_FALSE; +GLboolean __WGLEW_NV_render_depth_texture = GL_FALSE; +GLboolean __WGLEW_NV_render_texture_rectangle = GL_FALSE; +GLboolean __WGLEW_NV_vertex_array_range = GL_FALSE; +GLboolean __WGLEW_OML_sync_control = GL_FALSE; + +#endif /* !GLEW_MX */ + +#ifdef WGL_3DFX_multisample + +#endif /* WGL_3DFX_multisample */ + +#ifdef WGL_3DL_stereo_control + +static GLboolean _glewInit_WGL_3DL_stereo_control (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglSetStereoEmitterState3DL = (PFNWGLSETSTEREOEMITTERSTATE3DLPROC)glewGetProcAddress((const GLubyte*)"wglSetStereoEmitterState3DL")) == NULL) || r; + + return r; +} + +#endif /* WGL_3DL_stereo_control */ + +#ifdef WGL_ARB_buffer_region + +static GLboolean _glewInit_WGL_ARB_buffer_region (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCreateBufferRegionARB = (PFNWGLCREATEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglCreateBufferRegionARB")) == NULL) || r; + r = ((wglDeleteBufferRegionARB = (PFNWGLDELETEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglDeleteBufferRegionARB")) == NULL) || r; + r = ((wglRestoreBufferRegionARB = (PFNWGLRESTOREBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglRestoreBufferRegionARB")) == NULL) || r; + r = ((wglSaveBufferRegionARB = (PFNWGLSAVEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglSaveBufferRegionARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_buffer_region */ + +#ifdef WGL_ARB_extensions_string + +static GLboolean _glewInit_WGL_ARB_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_extensions_string */ + +#ifdef WGL_ARB_make_current_read + +static GLboolean _glewInit_WGL_ARB_make_current_read (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetCurrentReadDCARB = (PFNWGLGETCURRENTREADDCARBPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentReadDCARB")) == NULL) || r; + r = ((wglMakeContextCurrentARB = (PFNWGLMAKECONTEXTCURRENTARBPROC)glewGetProcAddress((const GLubyte*)"wglMakeContextCurrentARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_make_current_read */ + +#ifdef WGL_ARB_multisample + +#endif /* WGL_ARB_multisample */ + +#ifdef WGL_ARB_pbuffer + +static GLboolean _glewInit_WGL_ARB_pbuffer (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCreatePbufferARB = (PFNWGLCREATEPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglCreatePbufferARB")) == NULL) || r; + r = ((wglDestroyPbufferARB = (PFNWGLDESTROYPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglDestroyPbufferARB")) == NULL) || r; + r = ((wglGetPbufferDCARB = (PFNWGLGETPBUFFERDCARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPbufferDCARB")) == NULL) || r; + r = ((wglQueryPbufferARB = (PFNWGLQUERYPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglQueryPbufferARB")) == NULL) || r; + r = ((wglReleasePbufferDCARB = (PFNWGLRELEASEPBUFFERDCARBPROC)glewGetProcAddress((const GLubyte*)"wglReleasePbufferDCARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_pbuffer */ + +#ifdef WGL_ARB_pixel_format + +static GLboolean _glewInit_WGL_ARB_pixel_format (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)glewGetProcAddress((const GLubyte*)"wglChoosePixelFormatARB")) == NULL) || r; + r = ((wglGetPixelFormatAttribfvARB = (PFNWGLGETPIXELFORMATATTRIBFVARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribfvARB")) == NULL) || r; + r = ((wglGetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribivARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_pixel_format */ + +#ifdef WGL_ARB_pixel_format_float + +#endif /* WGL_ARB_pixel_format_float */ + +#ifdef WGL_ARB_render_texture + +static GLboolean _glewInit_WGL_ARB_render_texture (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBindTexImageARB = (PFNWGLBINDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"wglBindTexImageARB")) == NULL) || r; + r = ((wglReleaseTexImageARB = (PFNWGLRELEASETEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"wglReleaseTexImageARB")) == NULL) || r; + r = ((wglSetPbufferAttribARB = (PFNWGLSETPBUFFERATTRIBARBPROC)glewGetProcAddress((const GLubyte*)"wglSetPbufferAttribARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_render_texture */ + +#ifdef WGL_ATI_pixel_format_float + +#endif /* WGL_ATI_pixel_format_float */ + +#ifdef WGL_ATI_render_texture_rectangle + +#endif /* WGL_ATI_render_texture_rectangle */ + +#ifdef WGL_EXT_depth_float + +#endif /* WGL_EXT_depth_float */ + +#ifdef WGL_EXT_display_color_table + +static GLboolean _glewInit_WGL_EXT_display_color_table (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBindDisplayColorTableEXT = (PFNWGLBINDDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglBindDisplayColorTableEXT")) == NULL) || r; + r = ((wglCreateDisplayColorTableEXT = (PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglCreateDisplayColorTableEXT")) == NULL) || r; + r = ((wglDestroyDisplayColorTableEXT = (PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglDestroyDisplayColorTableEXT")) == NULL) || r; + r = ((wglLoadDisplayColorTableEXT = (PFNWGLLOADDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglLoadDisplayColorTableEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_display_color_table */ + +#ifdef WGL_EXT_extensions_string + +static GLboolean _glewInit_WGL_EXT_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_extensions_string */ + +#ifdef WGL_EXT_make_current_read + +static GLboolean _glewInit_WGL_EXT_make_current_read (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetCurrentReadDCEXT = (PFNWGLGETCURRENTREADDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentReadDCEXT")) == NULL) || r; + r = ((wglMakeContextCurrentEXT = (PFNWGLMAKECONTEXTCURRENTEXTPROC)glewGetProcAddress((const GLubyte*)"wglMakeContextCurrentEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_make_current_read */ + +#ifdef WGL_EXT_multisample + +#endif /* WGL_EXT_multisample */ + +#ifdef WGL_EXT_pbuffer + +static GLboolean _glewInit_WGL_EXT_pbuffer (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCreatePbufferEXT = (PFNWGLCREATEPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglCreatePbufferEXT")) == NULL) || r; + r = ((wglDestroyPbufferEXT = (PFNWGLDESTROYPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglDestroyPbufferEXT")) == NULL) || r; + r = ((wglGetPbufferDCEXT = (PFNWGLGETPBUFFERDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPbufferDCEXT")) == NULL) || r; + r = ((wglQueryPbufferEXT = (PFNWGLQUERYPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglQueryPbufferEXT")) == NULL) || r; + r = ((wglReleasePbufferDCEXT = (PFNWGLRELEASEPBUFFERDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglReleasePbufferDCEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_pbuffer */ + +#ifdef WGL_EXT_pixel_format + +static GLboolean _glewInit_WGL_EXT_pixel_format (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglChoosePixelFormatEXT = (PFNWGLCHOOSEPIXELFORMATEXTPROC)glewGetProcAddress((const GLubyte*)"wglChoosePixelFormatEXT")) == NULL) || r; + r = ((wglGetPixelFormatAttribfvEXT = (PFNWGLGETPIXELFORMATATTRIBFVEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribfvEXT")) == NULL) || r; + r = ((wglGetPixelFormatAttribivEXT = (PFNWGLGETPIXELFORMATATTRIBIVEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribivEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_pixel_format */ + +#ifdef WGL_EXT_swap_control + +static GLboolean _glewInit_WGL_EXT_swap_control (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetSwapIntervalEXT")) == NULL) || r; + r = ((wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"wglSwapIntervalEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_swap_control */ + +#ifdef WGL_I3D_digital_video_control + +static GLboolean _glewInit_WGL_I3D_digital_video_control (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetDigitalVideoParametersI3D = (PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetDigitalVideoParametersI3D")) == NULL) || r; + r = ((wglSetDigitalVideoParametersI3D = (PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetDigitalVideoParametersI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_digital_video_control */ + +#ifdef WGL_I3D_gamma + +static GLboolean _glewInit_WGL_I3D_gamma (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetGammaTableI3D = (PFNWGLGETGAMMATABLEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGammaTableI3D")) == NULL) || r; + r = ((wglGetGammaTableParametersI3D = (PFNWGLGETGAMMATABLEPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGammaTableParametersI3D")) == NULL) || r; + r = ((wglSetGammaTableI3D = (PFNWGLSETGAMMATABLEI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetGammaTableI3D")) == NULL) || r; + r = ((wglSetGammaTableParametersI3D = (PFNWGLSETGAMMATABLEPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetGammaTableParametersI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_gamma */ + +#ifdef WGL_I3D_genlock + +static GLboolean _glewInit_WGL_I3D_genlock (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglDisableGenlockI3D = (PFNWGLDISABLEGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglDisableGenlockI3D")) == NULL) || r; + r = ((wglEnableGenlockI3D = (PFNWGLENABLEGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglEnableGenlockI3D")) == NULL) || r; + r = ((wglGenlockSampleRateI3D = (PFNWGLGENLOCKSAMPLERATEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSampleRateI3D")) == NULL) || r; + r = ((wglGenlockSourceDelayI3D = (PFNWGLGENLOCKSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceDelayI3D")) == NULL) || r; + r = ((wglGenlockSourceEdgeI3D = (PFNWGLGENLOCKSOURCEEDGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceEdgeI3D")) == NULL) || r; + r = ((wglGenlockSourceI3D = (PFNWGLGENLOCKSOURCEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceI3D")) == NULL) || r; + r = ((wglGetGenlockSampleRateI3D = (PFNWGLGETGENLOCKSAMPLERATEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSampleRateI3D")) == NULL) || r; + r = ((wglGetGenlockSourceDelayI3D = (PFNWGLGETGENLOCKSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceDelayI3D")) == NULL) || r; + r = ((wglGetGenlockSourceEdgeI3D = (PFNWGLGETGENLOCKSOURCEEDGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceEdgeI3D")) == NULL) || r; + r = ((wglGetGenlockSourceI3D = (PFNWGLGETGENLOCKSOURCEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceI3D")) == NULL) || r; + r = ((wglIsEnabledGenlockI3D = (PFNWGLISENABLEDGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglIsEnabledGenlockI3D")) == NULL) || r; + r = ((wglQueryGenlockMaxSourceDelayI3D = (PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryGenlockMaxSourceDelayI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_genlock */ + +#ifdef WGL_I3D_image_buffer + +static GLboolean _glewInit_WGL_I3D_image_buffer (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglAssociateImageBufferEventsI3D = (PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC)glewGetProcAddress((const GLubyte*)"wglAssociateImageBufferEventsI3D")) == NULL) || r; + r = ((wglCreateImageBufferI3D = (PFNWGLCREATEIMAGEBUFFERI3DPROC)glewGetProcAddress((const GLubyte*)"wglCreateImageBufferI3D")) == NULL) || r; + r = ((wglDestroyImageBufferI3D = (PFNWGLDESTROYIMAGEBUFFERI3DPROC)glewGetProcAddress((const GLubyte*)"wglDestroyImageBufferI3D")) == NULL) || r; + r = ((wglReleaseImageBufferEventsI3D = (PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC)glewGetProcAddress((const GLubyte*)"wglReleaseImageBufferEventsI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_image_buffer */ + +#ifdef WGL_I3D_swap_frame_lock + +static GLboolean _glewInit_WGL_I3D_swap_frame_lock (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglDisableFrameLockI3D = (PFNWGLDISABLEFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglDisableFrameLockI3D")) == NULL) || r; + r = ((wglEnableFrameLockI3D = (PFNWGLENABLEFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglEnableFrameLockI3D")) == NULL) || r; + r = ((wglIsEnabledFrameLockI3D = (PFNWGLISENABLEDFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglIsEnabledFrameLockI3D")) == NULL) || r; + r = ((wglQueryFrameLockMasterI3D = (PFNWGLQUERYFRAMELOCKMASTERI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameLockMasterI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_swap_frame_lock */ + +#ifdef WGL_I3D_swap_frame_usage + +static GLboolean _glewInit_WGL_I3D_swap_frame_usage (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBeginFrameTrackingI3D = (PFNWGLBEGINFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglBeginFrameTrackingI3D")) == NULL) || r; + r = ((wglEndFrameTrackingI3D = (PFNWGLENDFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglEndFrameTrackingI3D")) == NULL) || r; + r = ((wglGetFrameUsageI3D = (PFNWGLGETFRAMEUSAGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetFrameUsageI3D")) == NULL) || r; + r = ((wglQueryFrameTrackingI3D = (PFNWGLQUERYFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameTrackingI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_swap_frame_usage */ + +#ifdef WGL_NV_float_buffer + +#endif /* WGL_NV_float_buffer */ + +#ifdef WGL_NV_render_depth_texture + +#endif /* WGL_NV_render_depth_texture */ + +#ifdef WGL_NV_render_texture_rectangle + +#endif /* WGL_NV_render_texture_rectangle */ + +#ifdef WGL_NV_vertex_array_range + +static GLboolean _glewInit_WGL_NV_vertex_array_range (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglAllocateMemoryNV = (PFNWGLALLOCATEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"wglAllocateMemoryNV")) == NULL) || r; + r = ((wglFreeMemoryNV = (PFNWGLFREEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"wglFreeMemoryNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_vertex_array_range */ + +#ifdef WGL_OML_sync_control + +static GLboolean _glewInit_WGL_OML_sync_control (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetMscRateOML = (PFNWGLGETMSCRATEOMLPROC)glewGetProcAddress((const GLubyte*)"wglGetMscRateOML")) == NULL) || r; + r = ((wglGetSyncValuesOML = (PFNWGLGETSYNCVALUESOMLPROC)glewGetProcAddress((const GLubyte*)"wglGetSyncValuesOML")) == NULL) || r; + r = ((wglSwapBuffersMscOML = (PFNWGLSWAPBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglSwapBuffersMscOML")) == NULL) || r; + r = ((wglSwapLayerBuffersMscOML = (PFNWGLSWAPLAYERBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglSwapLayerBuffersMscOML")) == NULL) || r; + r = ((wglWaitForMscOML = (PFNWGLWAITFORMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglWaitForMscOML")) == NULL) || r; + r = ((wglWaitForSbcOML = (PFNWGLWAITFORSBCOMLPROC)glewGetProcAddress((const GLubyte*)"wglWaitForSbcOML")) == NULL) || r; + + return r; +} + +#endif /* WGL_OML_sync_control */ + +/* ------------------------------------------------------------------------- */ + +static PFNWGLGETEXTENSIONSSTRINGARBPROC _wglewGetExtensionsStringARB = NULL; +static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT = NULL; + +GLboolean wglewGetExtension (const char* name) +{ + GLubyte* p; + GLubyte* end; + GLuint len = _glewStrLen((const GLubyte*)name); + if (_wglewGetExtensionsStringARB == NULL) + if (_wglewGetExtensionsStringEXT == NULL) + return GL_FALSE; + else + p = (GLubyte*)_wglewGetExtensionsStringEXT(); + else + p = (GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC()); + if (0 == p) return GL_FALSE; + end = p + _glewStrLen(p); + while (p < end) + { + GLuint n = _glewStrCLen(p, ' '); + if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE; + p += n+1; + } + return GL_FALSE; +} + +GLenum wglewContextInit (WGLEW_CONTEXT_ARG_DEF_LIST) +{ + GLboolean crippled; + /* find wgl extension string query functions */ + if (_wglewGetExtensionsStringARB == NULL) + _wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB"); + if (_wglewGetExtensionsStringEXT == NULL) + _wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT"); + /* initialize extensions */ + crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL; +#ifdef WGL_3DFX_multisample + WGLEW_3DFX_multisample = wglewGetExtension("WGL_3DFX_multisample"); +#endif /* WGL_3DFX_multisample */ +#ifdef WGL_3DL_stereo_control + WGLEW_3DL_stereo_control = wglewGetExtension("WGL_3DL_stereo_control"); + if (glewExperimental || WGLEW_3DL_stereo_control|| crippled) WGLEW_3DL_stereo_control= !_glewInit_WGL_3DL_stereo_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_3DL_stereo_control */ +#ifdef WGL_ARB_buffer_region + WGLEW_ARB_buffer_region = wglewGetExtension("WGL_ARB_buffer_region"); + if (glewExperimental || WGLEW_ARB_buffer_region|| crippled) WGLEW_ARB_buffer_region= !_glewInit_WGL_ARB_buffer_region(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_buffer_region */ +#ifdef WGL_ARB_extensions_string + WGLEW_ARB_extensions_string = wglewGetExtension("WGL_ARB_extensions_string"); + if (glewExperimental || WGLEW_ARB_extensions_string|| crippled) WGLEW_ARB_extensions_string= !_glewInit_WGL_ARB_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_extensions_string */ +#ifdef WGL_ARB_make_current_read + WGLEW_ARB_make_current_read = wglewGetExtension("WGL_ARB_make_current_read"); + if (glewExperimental || WGLEW_ARB_make_current_read|| crippled) WGLEW_ARB_make_current_read= !_glewInit_WGL_ARB_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_make_current_read */ +#ifdef WGL_ARB_multisample + WGLEW_ARB_multisample = wglewGetExtension("WGL_ARB_multisample"); +#endif /* WGL_ARB_multisample */ +#ifdef WGL_ARB_pbuffer + WGLEW_ARB_pbuffer = wglewGetExtension("WGL_ARB_pbuffer"); + if (glewExperimental || WGLEW_ARB_pbuffer|| crippled) WGLEW_ARB_pbuffer= !_glewInit_WGL_ARB_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_pbuffer */ +#ifdef WGL_ARB_pixel_format + WGLEW_ARB_pixel_format = wglewGetExtension("WGL_ARB_pixel_format"); + if (glewExperimental || WGLEW_ARB_pixel_format|| crippled) WGLEW_ARB_pixel_format= !_glewInit_WGL_ARB_pixel_format(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_pixel_format */ +#ifdef WGL_ARB_pixel_format_float + WGLEW_ARB_pixel_format_float = wglewGetExtension("WGL_ARB_pixel_format_float"); +#endif /* WGL_ARB_pixel_format_float */ +#ifdef WGL_ARB_render_texture + WGLEW_ARB_render_texture = wglewGetExtension("WGL_ARB_render_texture"); + if (glewExperimental || WGLEW_ARB_render_texture|| crippled) WGLEW_ARB_render_texture= !_glewInit_WGL_ARB_render_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_render_texture */ +#ifdef WGL_ATI_pixel_format_float + WGLEW_ATI_pixel_format_float = wglewGetExtension("WGL_ATI_pixel_format_float"); +#endif /* WGL_ATI_pixel_format_float */ +#ifdef WGL_ATI_render_texture_rectangle + WGLEW_ATI_render_texture_rectangle = wglewGetExtension("WGL_ATI_render_texture_rectangle"); +#endif /* WGL_ATI_render_texture_rectangle */ +#ifdef WGL_EXT_depth_float + WGLEW_EXT_depth_float = wglewGetExtension("WGL_EXT_depth_float"); +#endif /* WGL_EXT_depth_float */ +#ifdef WGL_EXT_display_color_table + WGLEW_EXT_display_color_table = wglewGetExtension("WGL_EXT_display_color_table"); + if (glewExperimental || WGLEW_EXT_display_color_table|| crippled) WGLEW_EXT_display_color_table= !_glewInit_WGL_EXT_display_color_table(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_display_color_table */ +#ifdef WGL_EXT_extensions_string + WGLEW_EXT_extensions_string = wglewGetExtension("WGL_EXT_extensions_string"); + if (glewExperimental || WGLEW_EXT_extensions_string|| crippled) WGLEW_EXT_extensions_string= !_glewInit_WGL_EXT_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_extensions_string */ +#ifdef WGL_EXT_make_current_read + WGLEW_EXT_make_current_read = wglewGetExtension("WGL_EXT_make_current_read"); + if (glewExperimental || WGLEW_EXT_make_current_read|| crippled) WGLEW_EXT_make_current_read= !_glewInit_WGL_EXT_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_make_current_read */ +#ifdef WGL_EXT_multisample + WGLEW_EXT_multisample = wglewGetExtension("WGL_EXT_multisample"); +#endif /* WGL_EXT_multisample */ +#ifdef WGL_EXT_pbuffer + WGLEW_EXT_pbuffer = wglewGetExtension("WGL_EXT_pbuffer"); + if (glewExperimental || WGLEW_EXT_pbuffer|| crippled) WGLEW_EXT_pbuffer= !_glewInit_WGL_EXT_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_pbuffer */ +#ifdef WGL_EXT_pixel_format + WGLEW_EXT_pixel_format = wglewGetExtension("WGL_EXT_pixel_format"); + if (glewExperimental || WGLEW_EXT_pixel_format|| crippled) WGLEW_EXT_pixel_format= !_glewInit_WGL_EXT_pixel_format(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_pixel_format */ +#ifdef WGL_EXT_swap_control + WGLEW_EXT_swap_control = wglewGetExtension("WGL_EXT_swap_control"); + if (glewExperimental || WGLEW_EXT_swap_control|| crippled) WGLEW_EXT_swap_control= !_glewInit_WGL_EXT_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_swap_control */ +#ifdef WGL_I3D_digital_video_control + WGLEW_I3D_digital_video_control = wglewGetExtension("WGL_I3D_digital_video_control"); + if (glewExperimental || WGLEW_I3D_digital_video_control|| crippled) WGLEW_I3D_digital_video_control= !_glewInit_WGL_I3D_digital_video_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_digital_video_control */ +#ifdef WGL_I3D_gamma + WGLEW_I3D_gamma = wglewGetExtension("WGL_I3D_gamma"); + if (glewExperimental || WGLEW_I3D_gamma|| crippled) WGLEW_I3D_gamma= !_glewInit_WGL_I3D_gamma(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_gamma */ +#ifdef WGL_I3D_genlock + WGLEW_I3D_genlock = wglewGetExtension("WGL_I3D_genlock"); + if (glewExperimental || WGLEW_I3D_genlock|| crippled) WGLEW_I3D_genlock= !_glewInit_WGL_I3D_genlock(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_genlock */ +#ifdef WGL_I3D_image_buffer + WGLEW_I3D_image_buffer = wglewGetExtension("WGL_I3D_image_buffer"); + if (glewExperimental || WGLEW_I3D_image_buffer|| crippled) WGLEW_I3D_image_buffer= !_glewInit_WGL_I3D_image_buffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_image_buffer */ +#ifdef WGL_I3D_swap_frame_lock + WGLEW_I3D_swap_frame_lock = wglewGetExtension("WGL_I3D_swap_frame_lock"); + if (glewExperimental || WGLEW_I3D_swap_frame_lock|| crippled) WGLEW_I3D_swap_frame_lock= !_glewInit_WGL_I3D_swap_frame_lock(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_swap_frame_lock */ +#ifdef WGL_I3D_swap_frame_usage + WGLEW_I3D_swap_frame_usage = wglewGetExtension("WGL_I3D_swap_frame_usage"); + if (glewExperimental || WGLEW_I3D_swap_frame_usage|| crippled) WGLEW_I3D_swap_frame_usage= !_glewInit_WGL_I3D_swap_frame_usage(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_swap_frame_usage */ +#ifdef WGL_NV_float_buffer + WGLEW_NV_float_buffer = wglewGetExtension("WGL_NV_float_buffer"); +#endif /* WGL_NV_float_buffer */ +#ifdef WGL_NV_render_depth_texture + WGLEW_NV_render_depth_texture = wglewGetExtension("WGL_NV_render_depth_texture"); +#endif /* WGL_NV_render_depth_texture */ +#ifdef WGL_NV_render_texture_rectangle + WGLEW_NV_render_texture_rectangle = wglewGetExtension("WGL_NV_render_texture_rectangle"); +#endif /* WGL_NV_render_texture_rectangle */ +#ifdef WGL_NV_vertex_array_range + WGLEW_NV_vertex_array_range = wglewGetExtension("WGL_NV_vertex_array_range"); + if (glewExperimental || WGLEW_NV_vertex_array_range|| crippled) WGLEW_NV_vertex_array_range= !_glewInit_WGL_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_vertex_array_range */ +#ifdef WGL_OML_sync_control + WGLEW_OML_sync_control = wglewGetExtension("WGL_OML_sync_control"); + if (glewExperimental || WGLEW_OML_sync_control|| crippled) WGLEW_OML_sync_control= !_glewInit_WGL_OML_sync_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_OML_sync_control */ + + return GLEW_OK; +} + +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) + +PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay = NULL; + +PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig = NULL; +PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext = NULL; +PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer = NULL; +PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap = NULL; +PFNGLXCREATEWINDOWPROC __glewXCreateWindow = NULL; +PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer = NULL; +PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap = NULL; +PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow = NULL; +PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable = NULL; +PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib = NULL; +PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs = NULL; +PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent = NULL; +PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig = NULL; +PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent = NULL; +PFNGLXQUERYCONTEXTPROC __glewXQueryContext = NULL; +PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable = NULL; +PFNGLXSELECTEVENTPROC __glewXSelectEvent = NULL; + +PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI = NULL; +PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI = NULL; +PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI = NULL; + +PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT = NULL; +PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT = NULL; +PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT = NULL; +PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT = NULL; + +PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA = NULL; + +PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA = NULL; + +PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA = NULL; + +PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA = NULL; + +PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA = NULL; + +PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV = NULL; +PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV = NULL; + +#ifdef GLX_OML_sync_control +PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML = NULL; +PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML = NULL; +PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML = NULL; +PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML = NULL; +PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML = NULL; +#endif + +PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX = NULL; +PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX = NULL; +PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX = NULL; +PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX = NULL; +PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX = NULL; +PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX = NULL; + +PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX = NULL; +PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX = NULL; +PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX = NULL; +PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX = NULL; +PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX = NULL; + +PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX = NULL; +PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX = NULL; + +PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX = NULL; + +PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX = NULL; +PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX = NULL; +PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX = NULL; +PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX = NULL; +PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX = NULL; + +PFNGLXCUSHIONSGIPROC __glewXCushionSGI = NULL; + +PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI = NULL; +PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI = NULL; + +PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI = NULL; + +PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI = NULL; +PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI = NULL; + +PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN = NULL; + +PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN = NULL; +PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN = NULL; + +#if !defined(GLEW_MX) + +GLboolean __GLXEW_VERSION_1_0 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_1 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_2 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_3 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_4 = GL_FALSE; +GLboolean __GLXEW_3DFX_multisample = GL_FALSE; +GLboolean __GLXEW_ARB_fbconfig_float = GL_FALSE; +GLboolean __GLXEW_ARB_get_proc_address = GL_FALSE; +GLboolean __GLXEW_ARB_multisample = GL_FALSE; +GLboolean __GLXEW_ATI_pixel_format_float = GL_FALSE; +GLboolean __GLXEW_ATI_render_texture = GL_FALSE; +GLboolean __GLXEW_EXT_import_context = GL_FALSE; +GLboolean __GLXEW_EXT_scene_marker = GL_FALSE; +GLboolean __GLXEW_EXT_visual_info = GL_FALSE; +GLboolean __GLXEW_EXT_visual_rating = GL_FALSE; +GLboolean __GLXEW_MESA_agp_offset = GL_FALSE; +GLboolean __GLXEW_MESA_copy_sub_buffer = GL_FALSE; +GLboolean __GLXEW_MESA_pixmap_colormap = GL_FALSE; +GLboolean __GLXEW_MESA_release_buffers = GL_FALSE; +GLboolean __GLXEW_MESA_set_3dfx_mode = GL_FALSE; +GLboolean __GLXEW_NV_float_buffer = GL_FALSE; +GLboolean __GLXEW_NV_vertex_array_range = GL_FALSE; +GLboolean __GLXEW_OML_swap_method = GL_FALSE; +#ifdef GLX_OML_sync_control +GLboolean __GLXEW_OML_sync_control = GL_FALSE; +#endif +GLboolean __GLXEW_SGIS_blended_overlay = GL_FALSE; +GLboolean __GLXEW_SGIS_color_range = GL_FALSE; +GLboolean __GLXEW_SGIS_multisample = GL_FALSE; +GLboolean __GLXEW_SGIS_shared_multisample = GL_FALSE; +GLboolean __GLXEW_SGIX_fbconfig = GL_FALSE; +GLboolean __GLXEW_SGIX_pbuffer = GL_FALSE; +GLboolean __GLXEW_SGIX_swap_barrier = GL_FALSE; +GLboolean __GLXEW_SGIX_swap_group = GL_FALSE; +GLboolean __GLXEW_SGIX_video_resize = GL_FALSE; +GLboolean __GLXEW_SGIX_visual_select_group = GL_FALSE; +GLboolean __GLXEW_SGI_cushion = GL_FALSE; +GLboolean __GLXEW_SGI_make_current_read = GL_FALSE; +GLboolean __GLXEW_SGI_swap_control = GL_FALSE; +GLboolean __GLXEW_SGI_video_sync = GL_FALSE; +GLboolean __GLXEW_SUN_get_transparent_index = GL_FALSE; +GLboolean __GLXEW_SUN_video_resize = GL_FALSE; + +#endif /* !GLEW_MX */ + +#ifdef GLX_VERSION_1_2 + +static GLboolean _glewInit_GLX_VERSION_1_2 (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetCurrentDisplay = (PFNGLXGETCURRENTDISPLAYPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentDisplay")) == NULL) || r; + + return r; +} + +#endif /* GLX_VERSION_1_2 */ + +#ifdef GLX_VERSION_1_3 + +static GLboolean _glewInit_GLX_VERSION_1_3 (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXChooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC)glewGetProcAddress((const GLubyte*)"glXChooseFBConfig")) == NULL) || r; + r = ((glXCreateNewContext = (PFNGLXCREATENEWCONTEXTPROC)glewGetProcAddress((const GLubyte*)"glXCreateNewContext")) == NULL) || r; + r = ((glXCreatePbuffer = (PFNGLXCREATEPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glXCreatePbuffer")) == NULL) || r; + r = ((glXCreatePixmap = (PFNGLXCREATEPIXMAPPROC)glewGetProcAddress((const GLubyte*)"glXCreatePixmap")) == NULL) || r; + r = ((glXCreateWindow = (PFNGLXCREATEWINDOWPROC)glewGetProcAddress((const GLubyte*)"glXCreateWindow")) == NULL) || r; + r = ((glXDestroyPbuffer = (PFNGLXDESTROYPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glXDestroyPbuffer")) == NULL) || r; + r = ((glXDestroyPixmap = (PFNGLXDESTROYPIXMAPPROC)glewGetProcAddress((const GLubyte*)"glXDestroyPixmap")) == NULL) || r; + r = ((glXDestroyWindow = (PFNGLXDESTROYWINDOWPROC)glewGetProcAddress((const GLubyte*)"glXDestroyWindow")) == NULL) || r; + r = ((glXGetCurrentReadDrawable = (PFNGLXGETCURRENTREADDRAWABLEPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentReadDrawable")) == NULL) || r; + r = ((glXGetFBConfigAttrib = (PFNGLXGETFBCONFIGATTRIBPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigAttrib")) == NULL) || r; + r = ((glXGetFBConfigs = (PFNGLXGETFBCONFIGSPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigs")) == NULL) || r; + r = ((glXGetSelectedEvent = (PFNGLXGETSELECTEDEVENTPROC)glewGetProcAddress((const GLubyte*)"glXGetSelectedEvent")) == NULL) || r; + r = ((glXGetVisualFromFBConfig = (PFNGLXGETVISUALFROMFBCONFIGPROC)glewGetProcAddress((const GLubyte*)"glXGetVisualFromFBConfig")) == NULL) || r; + r = ((glXMakeContextCurrent = (PFNGLXMAKECONTEXTCURRENTPROC)glewGetProcAddress((const GLubyte*)"glXMakeContextCurrent")) == NULL) || r; + r = ((glXQueryContext = (PFNGLXQUERYCONTEXTPROC)glewGetProcAddress((const GLubyte*)"glXQueryContext")) == NULL) || r; + r = ((glXQueryDrawable = (PFNGLXQUERYDRAWABLEPROC)glewGetProcAddress((const GLubyte*)"glXQueryDrawable")) == NULL) || r; + r = ((glXSelectEvent = (PFNGLXSELECTEVENTPROC)glewGetProcAddress((const GLubyte*)"glXSelectEvent")) == NULL) || r; + + return r; +} + +#endif /* GLX_VERSION_1_3 */ + +#ifdef GLX_VERSION_1_4 + +#endif /* GLX_VERSION_1_4 */ + +#ifdef GLX_3DFX_multisample + +#endif /* GLX_3DFX_multisample */ + +#ifdef GLX_ARB_fbconfig_float + +#endif /* GLX_ARB_fbconfig_float */ + +#ifdef GLX_ARB_get_proc_address + +#endif /* GLX_ARB_get_proc_address */ + +#ifdef GLX_ARB_multisample + +#endif /* GLX_ARB_multisample */ + +#ifdef GLX_ATI_pixel_format_float + +#endif /* GLX_ATI_pixel_format_float */ + +#ifdef GLX_ATI_render_texture + +static GLboolean _glewInit_GLX_ATI_render_texture (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindTexImageATI = (PFNGLXBINDTEXIMAGEATIPROC)glewGetProcAddress((const GLubyte*)"glXBindTexImageATI")) == NULL) || r; + r = ((glXDrawableAttribATI = (PFNGLXDRAWABLEATTRIBATIPROC)glewGetProcAddress((const GLubyte*)"glXDrawableAttribATI")) == NULL) || r; + r = ((glXReleaseTexImageATI = (PFNGLXRELEASETEXIMAGEATIPROC)glewGetProcAddress((const GLubyte*)"glXReleaseTexImageATI")) == NULL) || r; + + return r; +} + +#endif /* GLX_ATI_render_texture */ + +#ifdef GLX_EXT_import_context + +static GLboolean _glewInit_GLX_EXT_import_context (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXFreeContextEXT = (PFNGLXFREECONTEXTEXTPROC)glewGetProcAddress((const GLubyte*)"glXFreeContextEXT")) == NULL) || r; + r = ((glXGetContextIDEXT = (PFNGLXGETCONTEXTIDEXTPROC)glewGetProcAddress((const GLubyte*)"glXGetContextIDEXT")) == NULL) || r; + r = ((glXImportContextEXT = (PFNGLXIMPORTCONTEXTEXTPROC)glewGetProcAddress((const GLubyte*)"glXImportContextEXT")) == NULL) || r; + r = ((glXQueryContextInfoEXT = (PFNGLXQUERYCONTEXTINFOEXTPROC)glewGetProcAddress((const GLubyte*)"glXQueryContextInfoEXT")) == NULL) || r; + + return r; +} + +#endif /* GLX_EXT_import_context */ + +#ifdef GLX_EXT_scene_marker + +#endif /* GLX_EXT_scene_marker */ + +#ifdef GLX_EXT_visual_info + +#endif /* GLX_EXT_visual_info */ + +#ifdef GLX_EXT_visual_rating + +#endif /* GLX_EXT_visual_rating */ + +#ifdef GLX_MESA_agp_offset + +static GLboolean _glewInit_GLX_MESA_agp_offset (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetAGPOffsetMESA = (PFNGLXGETAGPOFFSETMESAPROC)glewGetProcAddress((const GLubyte*)"glXGetAGPOffsetMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_agp_offset */ + +#ifdef GLX_MESA_copy_sub_buffer + +static GLboolean _glewInit_GLX_MESA_copy_sub_buffer (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCopySubBufferMESA = (PFNGLXCOPYSUBBUFFERMESAPROC)glewGetProcAddress((const GLubyte*)"glXCopySubBufferMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_copy_sub_buffer */ + +#ifdef GLX_MESA_pixmap_colormap + +static GLboolean _glewInit_GLX_MESA_pixmap_colormap (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCreateGLXPixmapMESA = (PFNGLXCREATEGLXPIXMAPMESAPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPixmapMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_pixmap_colormap */ + +#ifdef GLX_MESA_release_buffers + +static GLboolean _glewInit_GLX_MESA_release_buffers (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXReleaseBuffersMESA = (PFNGLXRELEASEBUFFERSMESAPROC)glewGetProcAddress((const GLubyte*)"glXReleaseBuffersMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_release_buffers */ + +#ifdef GLX_MESA_set_3dfx_mode + +static GLboolean _glewInit_GLX_MESA_set_3dfx_mode (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXSet3DfxModeMESA = (PFNGLXSET3DFXMODEMESAPROC)glewGetProcAddress((const GLubyte*)"glXSet3DfxModeMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_set_3dfx_mode */ + +#ifdef GLX_NV_float_buffer + +#endif /* GLX_NV_float_buffer */ + +#ifdef GLX_NV_vertex_array_range + +static GLboolean _glewInit_GLX_NV_vertex_array_range (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXAllocateMemoryNV = (PFNGLXALLOCATEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"glXAllocateMemoryNV")) == NULL) || r; + r = ((glXFreeMemoryNV = (PFNGLXFREEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"glXFreeMemoryNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_vertex_array_range */ + +#ifdef GLX_OML_swap_method + +#endif /* GLX_OML_swap_method */ + +#if defined(GLX_OML_sync_control) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +#include + +static GLboolean _glewInit_GLX_OML_sync_control (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetMscRateOML = (PFNGLXGETMSCRATEOMLPROC)glewGetProcAddress((const GLubyte*)"glXGetMscRateOML")) == NULL) || r; + r = ((glXGetSyncValuesOML = (PFNGLXGETSYNCVALUESOMLPROC)glewGetProcAddress((const GLubyte*)"glXGetSyncValuesOML")) == NULL) || r; + r = ((glXSwapBuffersMscOML = (PFNGLXSWAPBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"glXSwapBuffersMscOML")) == NULL) || r; + r = ((glXWaitForMscOML = (PFNGLXWAITFORMSCOMLPROC)glewGetProcAddress((const GLubyte*)"glXWaitForMscOML")) == NULL) || r; + r = ((glXWaitForSbcOML = (PFNGLXWAITFORSBCOMLPROC)glewGetProcAddress((const GLubyte*)"glXWaitForSbcOML")) == NULL) || r; + + return r; +} + +#endif /* GLX_OML_sync_control */ + +#ifdef GLX_SGIS_blended_overlay + +#endif /* GLX_SGIS_blended_overlay */ + +#ifdef GLX_SGIS_color_range + +#endif /* GLX_SGIS_color_range */ + +#ifdef GLX_SGIS_multisample + +#endif /* GLX_SGIS_multisample */ + +#ifdef GLX_SGIS_shared_multisample + +#endif /* GLX_SGIS_shared_multisample */ + +#ifdef GLX_SGIX_fbconfig + +static GLboolean _glewInit_GLX_SGIX_fbconfig (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXChooseFBConfigSGIX = (PFNGLXCHOOSEFBCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChooseFBConfigSGIX")) == NULL) || r; + r = ((glXCreateContextWithConfigSGIX = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateContextWithConfigSGIX")) == NULL) || r; + r = ((glXCreateGLXPixmapWithConfigSGIX = (PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPixmapWithConfigSGIX")) == NULL) || r; + r = ((glXGetFBConfigAttribSGIX = (PFNGLXGETFBCONFIGATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigAttribSGIX")) == NULL) || r; + r = ((glXGetFBConfigFromVisualSGIX = (PFNGLXGETFBCONFIGFROMVISUALSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigFromVisualSGIX")) == NULL) || r; + r = ((glXGetVisualFromFBConfigSGIX = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetVisualFromFBConfigSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_fbconfig */ + +#ifdef GLX_SGIX_pbuffer + +static GLboolean _glewInit_GLX_SGIX_pbuffer (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCreateGLXPbufferSGIX = (PFNGLXCREATEGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPbufferSGIX")) == NULL) || r; + r = ((glXDestroyGLXPbufferSGIX = (PFNGLXDESTROYGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXDestroyGLXPbufferSGIX")) == NULL) || r; + r = ((glXGetSelectedEventSGIX = (PFNGLXGETSELECTEDEVENTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetSelectedEventSGIX")) == NULL) || r; + r = ((glXQueryGLXPbufferSGIX = (PFNGLXQUERYGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryGLXPbufferSGIX")) == NULL) || r; + r = ((glXSelectEventSGIX = (PFNGLXSELECTEVENTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXSelectEventSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_pbuffer */ + +#ifdef GLX_SGIX_swap_barrier + +static GLboolean _glewInit_GLX_SGIX_swap_barrier (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindSwapBarrierSGIX = (PFNGLXBINDSWAPBARRIERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindSwapBarrierSGIX")) == NULL) || r; + r = ((glXQueryMaxSwapBarriersSGIX = (PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryMaxSwapBarriersSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_swap_barrier */ + +#ifdef GLX_SGIX_swap_group + +static GLboolean _glewInit_GLX_SGIX_swap_group (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXJoinSwapGroupSGIX = (PFNGLXJOINSWAPGROUPSGIXPROC)glewGetProcAddress((const GLubyte*)"glXJoinSwapGroupSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_swap_group */ + +#ifdef GLX_SGIX_video_resize + +static GLboolean _glewInit_GLX_SGIX_video_resize (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindChannelToWindowSGIX = (PFNGLXBINDCHANNELTOWINDOWSGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindChannelToWindowSGIX")) == NULL) || r; + r = ((glXChannelRectSGIX = (PFNGLXCHANNELRECTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChannelRectSGIX")) == NULL) || r; + r = ((glXChannelRectSyncSGIX = (PFNGLXCHANNELRECTSYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChannelRectSyncSGIX")) == NULL) || r; + r = ((glXQueryChannelDeltasSGIX = (PFNGLXQUERYCHANNELDELTASSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryChannelDeltasSGIX")) == NULL) || r; + r = ((glXQueryChannelRectSGIX = (PFNGLXQUERYCHANNELRECTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryChannelRectSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_video_resize */ + +#ifdef GLX_SGIX_visual_select_group + +#endif /* GLX_SGIX_visual_select_group */ + +#ifdef GLX_SGI_cushion + +static GLboolean _glewInit_GLX_SGI_cushion (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCushionSGI = (PFNGLXCUSHIONSGIPROC)glewGetProcAddress((const GLubyte*)"glXCushionSGI")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGI_cushion */ + +#ifdef GLX_SGI_make_current_read + +static GLboolean _glewInit_GLX_SGI_make_current_read (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetCurrentReadDrawableSGI = (PFNGLXGETCURRENTREADDRAWABLESGIPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentReadDrawableSGI")) == NULL) || r; + r = ((glXMakeCurrentReadSGI = (PFNGLXMAKECURRENTREADSGIPROC)glewGetProcAddress((const GLubyte*)"glXMakeCurrentReadSGI")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGI_make_current_read */ + +#ifdef GLX_SGI_swap_control + +static GLboolean _glewInit_GLX_SGI_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalSGI")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGI_swap_control */ + +#ifdef GLX_SGI_video_sync + +static GLboolean _glewInit_GLX_SGI_video_sync (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetVideoSyncSGI = (PFNGLXGETVIDEOSYNCSGIPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoSyncSGI")) == NULL) || r; + r = ((glXWaitVideoSyncSGI = (PFNGLXWAITVIDEOSYNCSGIPROC)glewGetProcAddress((const GLubyte*)"glXWaitVideoSyncSGI")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGI_video_sync */ + +#ifdef GLX_SUN_get_transparent_index + +static GLboolean _glewInit_GLX_SUN_get_transparent_index (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetTransparentIndexSUN = (PFNGLXGETTRANSPARENTINDEXSUNPROC)glewGetProcAddress((const GLubyte*)"glXGetTransparentIndexSUN")) == NULL) || r; + + return r; +} + +#endif /* GLX_SUN_get_transparent_index */ + +#ifdef GLX_SUN_video_resize + +static GLboolean _glewInit_GLX_SUN_video_resize (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetVideoResizeSUN = (PFNGLXGETVIDEORESIZESUNPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoResizeSUN")) == NULL) || r; + r = ((glXVideoResizeSUN = (PFNGLXVIDEORESIZESUNPROC)glewGetProcAddress((const GLubyte*)"glXVideoResizeSUN")) == NULL) || r; + + return r; +} + +#endif /* GLX_SUN_video_resize */ + +/* ------------------------------------------------------------------------ */ + +GLboolean glxewGetExtension (const char* name) +{ + GLubyte* p; + GLubyte* end; + GLuint len = _glewStrLen((const GLubyte*)name); +/* if (glXQueryExtensionsString == NULL || glXGetCurrentDisplay == NULL) return GL_FALSE; */ +/* p = (GLubyte*)glXQueryExtensionsString(glXGetCurrentDisplay(), DefaultScreen(glXGetCurrentDisplay())); */ + if (glXGetClientString == NULL || glXGetCurrentDisplay == NULL) return GL_FALSE; + p = (GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); + if (0 == p) return GL_FALSE; + end = p + _glewStrLen(p); + while (p < end) + { + GLuint n = _glewStrCLen(p, ' '); + if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE; + p += n+1; + } + return GL_FALSE; +} + +GLenum glxewContextInit (GLXEW_CONTEXT_ARG_DEF_LIST) +{ + int major, minor; + /* initialize core GLX 1.2 */ + if (_glewInit_GLX_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT)) return GLEW_ERROR_GLX_VERSION_11_ONLY; + /* initialize flags */ + GLXEW_VERSION_1_0 = GL_TRUE; + GLXEW_VERSION_1_1 = GL_TRUE; + GLXEW_VERSION_1_2 = GL_TRUE; + GLXEW_VERSION_1_3 = GL_TRUE; + GLXEW_VERSION_1_4 = GL_TRUE; + /* query GLX version */ + glXQueryVersion(glXGetCurrentDisplay(), &major, &minor); + if (major == 1 && minor <= 3) + { + switch (minor) + { + case 3: + GLXEW_VERSION_1_4 = GL_FALSE; + break; + case 2: + GLXEW_VERSION_1_4 = GL_FALSE; + GLXEW_VERSION_1_3 = GL_FALSE; + break; + default: + return GLEW_ERROR_GLX_VERSION_11_ONLY; + break; + } + } + /* initialize extensions */ +#ifdef GLX_VERSION_1_3 + if (glewExperimental || GLXEW_VERSION_1_3) GLXEW_VERSION_1_3 = !_glewInit_GLX_VERSION_1_3(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_VERSION_1_3 */ +#ifdef GLX_3DFX_multisample + GLXEW_3DFX_multisample = glxewGetExtension("GLX_3DFX_multisample"); +#endif /* GLX_3DFX_multisample */ +#ifdef GLX_ARB_fbconfig_float + GLXEW_ARB_fbconfig_float = glxewGetExtension("GLX_ARB_fbconfig_float"); +#endif /* GLX_ARB_fbconfig_float */ +#ifdef GLX_ARB_get_proc_address + GLXEW_ARB_get_proc_address = glxewGetExtension("GLX_ARB_get_proc_address"); +#endif /* GLX_ARB_get_proc_address */ +#ifdef GLX_ARB_multisample + GLXEW_ARB_multisample = glxewGetExtension("GLX_ARB_multisample"); +#endif /* GLX_ARB_multisample */ +#ifdef GLX_ATI_pixel_format_float + GLXEW_ATI_pixel_format_float = glxewGetExtension("GLX_ATI_pixel_format_float"); +#endif /* GLX_ATI_pixel_format_float */ +#ifdef GLX_ATI_render_texture + GLXEW_ATI_render_texture = glxewGetExtension("GLX_ATI_render_texture"); + if (glewExperimental || GLXEW_ATI_render_texture) GLXEW_ATI_render_texture = !_glewInit_GLX_ATI_render_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_ATI_render_texture */ +#ifdef GLX_EXT_import_context + GLXEW_EXT_import_context = glxewGetExtension("GLX_EXT_import_context"); + if (glewExperimental || GLXEW_EXT_import_context) GLXEW_EXT_import_context = !_glewInit_GLX_EXT_import_context(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_EXT_import_context */ +#ifdef GLX_EXT_scene_marker + GLXEW_EXT_scene_marker = glxewGetExtension("GLX_EXT_scene_marker"); +#endif /* GLX_EXT_scene_marker */ +#ifdef GLX_EXT_visual_info + GLXEW_EXT_visual_info = glxewGetExtension("GLX_EXT_visual_info"); +#endif /* GLX_EXT_visual_info */ +#ifdef GLX_EXT_visual_rating + GLXEW_EXT_visual_rating = glxewGetExtension("GLX_EXT_visual_rating"); +#endif /* GLX_EXT_visual_rating */ +#ifdef GLX_MESA_agp_offset + GLXEW_MESA_agp_offset = glxewGetExtension("GLX_MESA_agp_offset"); + if (glewExperimental || GLXEW_MESA_agp_offset) GLXEW_MESA_agp_offset = !_glewInit_GLX_MESA_agp_offset(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_agp_offset */ +#ifdef GLX_MESA_copy_sub_buffer + GLXEW_MESA_copy_sub_buffer = glxewGetExtension("GLX_MESA_copy_sub_buffer"); + if (glewExperimental || GLXEW_MESA_copy_sub_buffer) GLXEW_MESA_copy_sub_buffer = !_glewInit_GLX_MESA_copy_sub_buffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_copy_sub_buffer */ +#ifdef GLX_MESA_pixmap_colormap + GLXEW_MESA_pixmap_colormap = glxewGetExtension("GLX_MESA_pixmap_colormap"); + if (glewExperimental || GLXEW_MESA_pixmap_colormap) GLXEW_MESA_pixmap_colormap = !_glewInit_GLX_MESA_pixmap_colormap(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_pixmap_colormap */ +#ifdef GLX_MESA_release_buffers + GLXEW_MESA_release_buffers = glxewGetExtension("GLX_MESA_release_buffers"); + if (glewExperimental || GLXEW_MESA_release_buffers) GLXEW_MESA_release_buffers = !_glewInit_GLX_MESA_release_buffers(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_release_buffers */ +#ifdef GLX_MESA_set_3dfx_mode + GLXEW_MESA_set_3dfx_mode = glxewGetExtension("GLX_MESA_set_3dfx_mode"); + if (glewExperimental || GLXEW_MESA_set_3dfx_mode) GLXEW_MESA_set_3dfx_mode = !_glewInit_GLX_MESA_set_3dfx_mode(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_set_3dfx_mode */ +#ifdef GLX_NV_float_buffer + GLXEW_NV_float_buffer = glxewGetExtension("GLX_NV_float_buffer"); +#endif /* GLX_NV_float_buffer */ +#ifdef GLX_NV_vertex_array_range + GLXEW_NV_vertex_array_range = glxewGetExtension("GLX_NV_vertex_array_range"); + if (glewExperimental || GLXEW_NV_vertex_array_range) GLXEW_NV_vertex_array_range = !_glewInit_GLX_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_NV_vertex_array_range */ +#ifdef GLX_OML_swap_method + GLXEW_OML_swap_method = glxewGetExtension("GLX_OML_swap_method"); +#endif /* GLX_OML_swap_method */ +#if defined(GLX_OML_sync_control) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +#include + GLXEW_OML_sync_control = glxewGetExtension("GLX_OML_sync_control"); + if (glewExperimental || GLXEW_OML_sync_control) GLXEW_OML_sync_control = !_glewInit_GLX_OML_sync_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_OML_sync_control */ +#ifdef GLX_SGIS_blended_overlay + GLXEW_SGIS_blended_overlay = glxewGetExtension("GLX_SGIS_blended_overlay"); +#endif /* GLX_SGIS_blended_overlay */ +#ifdef GLX_SGIS_color_range + GLXEW_SGIS_color_range = glxewGetExtension("GLX_SGIS_color_range"); +#endif /* GLX_SGIS_color_range */ +#ifdef GLX_SGIS_multisample + GLXEW_SGIS_multisample = glxewGetExtension("GLX_SGIS_multisample"); +#endif /* GLX_SGIS_multisample */ +#ifdef GLX_SGIS_shared_multisample + GLXEW_SGIS_shared_multisample = glxewGetExtension("GLX_SGIS_shared_multisample"); +#endif /* GLX_SGIS_shared_multisample */ +#ifdef GLX_SGIX_fbconfig + GLXEW_SGIX_fbconfig = glxewGetExtension("GLX_SGIX_fbconfig"); + if (glewExperimental || GLXEW_SGIX_fbconfig) GLXEW_SGIX_fbconfig = !_glewInit_GLX_SGIX_fbconfig(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_fbconfig */ +#ifdef GLX_SGIX_pbuffer + GLXEW_SGIX_pbuffer = glxewGetExtension("GLX_SGIX_pbuffer"); + if (glewExperimental || GLXEW_SGIX_pbuffer) GLXEW_SGIX_pbuffer = !_glewInit_GLX_SGIX_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_pbuffer */ +#ifdef GLX_SGIX_swap_barrier + GLXEW_SGIX_swap_barrier = glxewGetExtension("GLX_SGIX_swap_barrier"); + if (glewExperimental || GLXEW_SGIX_swap_barrier) GLXEW_SGIX_swap_barrier = !_glewInit_GLX_SGIX_swap_barrier(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_swap_barrier */ +#ifdef GLX_SGIX_swap_group + GLXEW_SGIX_swap_group = glxewGetExtension("GLX_SGIX_swap_group"); + if (glewExperimental || GLXEW_SGIX_swap_group) GLXEW_SGIX_swap_group = !_glewInit_GLX_SGIX_swap_group(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_swap_group */ +#ifdef GLX_SGIX_video_resize + GLXEW_SGIX_video_resize = glxewGetExtension("GLX_SGIX_video_resize"); + if (glewExperimental || GLXEW_SGIX_video_resize) GLXEW_SGIX_video_resize = !_glewInit_GLX_SGIX_video_resize(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_video_resize */ +#ifdef GLX_SGIX_visual_select_group + GLXEW_SGIX_visual_select_group = glxewGetExtension("GLX_SGIX_visual_select_group"); +#endif /* GLX_SGIX_visual_select_group */ +#ifdef GLX_SGI_cushion + GLXEW_SGI_cushion = glxewGetExtension("GLX_SGI_cushion"); + if (glewExperimental || GLXEW_SGI_cushion) GLXEW_SGI_cushion = !_glewInit_GLX_SGI_cushion(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGI_cushion */ +#ifdef GLX_SGI_make_current_read + GLXEW_SGI_make_current_read = glxewGetExtension("GLX_SGI_make_current_read"); + if (glewExperimental || GLXEW_SGI_make_current_read) GLXEW_SGI_make_current_read = !_glewInit_GLX_SGI_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGI_make_current_read */ +#ifdef GLX_SGI_swap_control + GLXEW_SGI_swap_control = glxewGetExtension("GLX_SGI_swap_control"); + if (glewExperimental || GLXEW_SGI_swap_control) GLXEW_SGI_swap_control = !_glewInit_GLX_SGI_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGI_swap_control */ +#ifdef GLX_SGI_video_sync + GLXEW_SGI_video_sync = glxewGetExtension("GLX_SGI_video_sync"); + if (glewExperimental || GLXEW_SGI_video_sync) GLXEW_SGI_video_sync = !_glewInit_GLX_SGI_video_sync(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGI_video_sync */ +#ifdef GLX_SUN_get_transparent_index + GLXEW_SUN_get_transparent_index = glxewGetExtension("GLX_SUN_get_transparent_index"); + if (glewExperimental || GLXEW_SUN_get_transparent_index) GLXEW_SUN_get_transparent_index = !_glewInit_GLX_SUN_get_transparent_index(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SUN_get_transparent_index */ +#ifdef GLX_SUN_video_resize + GLXEW_SUN_video_resize = glxewGetExtension("GLX_SUN_video_resize"); + if (glewExperimental || GLXEW_SUN_video_resize) GLXEW_SUN_video_resize = !_glewInit_GLX_SUN_video_resize(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SUN_video_resize */ + + return GLEW_OK; +} + +#endif /* !__APPLE__ || GLEW_APPLE_GLX */ + +/* ------------------------------------------------------------------------ */ + +const GLubyte* glewGetErrorString (GLenum error) +{ + static const GLubyte* _glewErrorString[] = + { + (const GLubyte*)"No error", + (const GLubyte*)"Missing GL version", + (const GLubyte*)"GL 1.1 and up are not supported", + (const GLubyte*)"GLX 1.2 and up are not supported", + (const GLubyte*)"Unknown error" + }; + const int max_error = sizeof(_glewErrorString)/sizeof(*_glewErrorString) - 1; + return _glewErrorString[(int)error > max_error ? max_error : (int)error]; +} + +const GLubyte* glewGetString (GLenum name) +{ + static const GLubyte* _glewString[] = + { + (const GLubyte*)NULL, + (const GLubyte*)"1.3.4" + }; + const int max_string = sizeof(_glewString)/sizeof(*_glewString) - 1; + return _glewString[(int)name > max_string ? 0 : (int)name]; +} + +/* ------------------------------------------------------------------------ */ + +GLboolean glewExperimental = GL_FALSE; + +#if !defined(GLEW_MX) + +#if defined(_WIN32) +extern GLenum wglewContextInit (void); +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */ +extern GLenum glxewContextInit (void); +#endif /* _WIN32 */ + +GLenum glewInit () +{ + GLenum r; + if ( (r = glewContextInit()) ) return r; +#if defined(_WIN32) + return wglewContextInit(); +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */ + return glxewContextInit(); +#else + return r; +#endif /* _WIN32 */ +} + +#endif /* !GLEW_MX */ +#ifdef GLEW_MX +GLboolean glewContextIsSupported (GLEWContext* ctx, const char* name) +#else +GLboolean glewIsSupported (const char* name) +#endif +{ + GLubyte* pos = (GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if (_glewStrSame1(&pos, &len, (const GLubyte*)"GL_", 3)) + { + if (_glewStrSame2(&pos, &len, (const GLubyte*)"VERSION_", 8)) + { +#ifdef GL_VERSION_1_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2", 3)) + { + ret = GLEW_VERSION_1_2; + continue; + } +#endif +#ifdef GL_VERSION_1_3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_3", 3)) + { + ret = GLEW_VERSION_1_3; + continue; + } +#endif +#ifdef GL_VERSION_1_4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_4", 3)) + { + ret = GLEW_VERSION_1_4; + continue; + } +#endif +#ifdef GL_VERSION_1_5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_5", 3)) + { + ret = GLEW_VERSION_1_5; + continue; + } +#endif +#ifdef GL_VERSION_2_0 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"2_0", 3)) + { + ret = GLEW_VERSION_2_0; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) + { +#ifdef GL_3DFX_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLEW_3DFX_multisample; + continue; + } +#endif +#ifdef GL_3DFX_tbuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tbuffer", 7)) + { + ret = GLEW_3DFX_tbuffer; + continue; + } +#endif +#ifdef GL_3DFX_texture_compression_FXT1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_FXT1", 24)) + { + ret = GLEW_3DFX_texture_compression_FXT1; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"APPLE_", 6)) + { +#ifdef GL_APPLE_client_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"client_storage", 14)) + { + ret = GLEW_APPLE_client_storage; + continue; + } +#endif +#ifdef GL_APPLE_element_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"element_array", 13)) + { + ret = GLEW_APPLE_element_array; + continue; + } +#endif +#ifdef GL_APPLE_fence + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fence", 5)) + { + ret = GLEW_APPLE_fence; + continue; + } +#endif +#ifdef GL_APPLE_float_pixels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_pixels", 12)) + { + ret = GLEW_APPLE_float_pixels; + continue; + } +#endif +#ifdef GL_APPLE_pixel_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer", 12)) + { + ret = GLEW_APPLE_pixel_buffer; + continue; + } +#endif +#ifdef GL_APPLE_specular_vector + if (_glewStrSame3(&pos, &len, (const GLubyte*)"specular_vector", 15)) + { + ret = GLEW_APPLE_specular_vector; + continue; + } +#endif +#ifdef GL_APPLE_texture_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_range", 13)) + { + ret = GLEW_APPLE_texture_range; + continue; + } +#endif +#ifdef GL_APPLE_transform_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_hint", 14)) + { + ret = GLEW_APPLE_transform_hint; + continue; + } +#endif +#ifdef GL_APPLE_vertex_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) + { + ret = GLEW_APPLE_vertex_array_object; + continue; + } +#endif +#ifdef GL_APPLE_vertex_array_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) + { + ret = GLEW_APPLE_vertex_array_range; + continue; + } +#endif +#ifdef GL_APPLE_ycbcr_422 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycbcr_422", 9)) + { + ret = GLEW_APPLE_ycbcr_422; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) + { +#ifdef GL_ARB_color_buffer_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_buffer_float", 18)) + { + ret = GLEW_ARB_color_buffer_float; + continue; + } +#endif +#ifdef GL_ARB_depth_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13)) + { + ret = GLEW_ARB_depth_texture; + continue; + } +#endif +#ifdef GL_ARB_draw_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers", 12)) + { + ret = GLEW_ARB_draw_buffers; + continue; + } +#endif +#ifdef GL_ARB_fragment_program + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program", 16)) + { + ret = GLEW_ARB_fragment_program; + continue; + } +#endif +#ifdef GL_ARB_fragment_program_shadow + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program_shadow", 23)) + { + ret = GLEW_ARB_fragment_program_shadow; + continue; + } +#endif +#ifdef GL_ARB_fragment_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader", 15)) + { + ret = GLEW_ARB_fragment_shader; + continue; + } +#endif +#ifdef GL_ARB_half_float_pixel + if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float_pixel", 16)) + { + ret = GLEW_ARB_half_float_pixel; + continue; + } +#endif +#ifdef GL_ARB_imaging + if (_glewStrSame3(&pos, &len, (const GLubyte*)"imaging", 7)) + { + ret = GLEW_ARB_imaging; + continue; + } +#endif +#ifdef GL_ARB_matrix_palette + if (_glewStrSame3(&pos, &len, (const GLubyte*)"matrix_palette", 14)) + { + ret = GLEW_ARB_matrix_palette; + continue; + } +#endif +#ifdef GL_ARB_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLEW_ARB_multisample; + continue; + } +#endif +#ifdef GL_ARB_multitexture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multitexture", 12)) + { + ret = GLEW_ARB_multitexture; + continue; + } +#endif +#ifdef GL_ARB_occlusion_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query", 15)) + { + ret = GLEW_ARB_occlusion_query; + continue; + } +#endif +#ifdef GL_ARB_pixel_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer_object", 19)) + { + ret = GLEW_ARB_pixel_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_point_parameters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_parameters", 16)) + { + ret = GLEW_ARB_point_parameters; + continue; + } +#endif +#ifdef GL_ARB_point_sprite + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprite", 12)) + { + ret = GLEW_ARB_point_sprite; + continue; + } +#endif +#ifdef GL_ARB_shader_objects + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_objects", 14)) + { + ret = GLEW_ARB_shader_objects; + continue; + } +#endif +#ifdef GL_ARB_shading_language_100 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_100", 20)) + { + ret = GLEW_ARB_shading_language_100; + continue; + } +#endif +#ifdef GL_ARB_shadow + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow", 6)) + { + ret = GLEW_ARB_shadow; + continue; + } +#endif +#ifdef GL_ARB_shadow_ambient + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_ambient", 14)) + { + ret = GLEW_ARB_shadow_ambient; + continue; + } +#endif +#ifdef GL_ARB_texture_border_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_border_clamp", 20)) + { + ret = GLEW_ARB_texture_border_clamp; + continue; + } +#endif +#ifdef GL_ARB_texture_compression + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression", 19)) + { + ret = GLEW_ARB_texture_compression; + continue; + } +#endif +#ifdef GL_ARB_texture_cube_map + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map", 16)) + { + ret = GLEW_ARB_texture_cube_map; + continue; + } +#endif +#ifdef GL_ARB_texture_env_add + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_add", 15)) + { + ret = GLEW_ARB_texture_env_add; + continue; + } +#endif +#ifdef GL_ARB_texture_env_combine + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine", 19)) + { + ret = GLEW_ARB_texture_env_combine; + continue; + } +#endif +#ifdef GL_ARB_texture_env_crossbar + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_crossbar", 20)) + { + ret = GLEW_ARB_texture_env_crossbar; + continue; + } +#endif +#ifdef GL_ARB_texture_env_dot3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_dot3", 16)) + { + ret = GLEW_ARB_texture_env_dot3; + continue; + } +#endif +#ifdef GL_ARB_texture_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_float", 13)) + { + ret = GLEW_ARB_texture_float; + continue; + } +#endif +#ifdef GL_ARB_texture_mirrored_repeat + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirrored_repeat", 23)) + { + ret = GLEW_ARB_texture_mirrored_repeat; + continue; + } +#endif +#ifdef GL_ARB_texture_non_power_of_two + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_non_power_of_two", 24)) + { + ret = GLEW_ARB_texture_non_power_of_two; + continue; + } +#endif +#ifdef GL_ARB_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) + { + ret = GLEW_ARB_texture_rectangle; + continue; + } +#endif +#ifdef GL_ARB_transpose_matrix + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transpose_matrix", 16)) + { + ret = GLEW_ARB_transpose_matrix; + continue; + } +#endif +#ifdef GL_ARB_vertex_blend + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_blend", 12)) + { + ret = GLEW_ARB_vertex_blend; + continue; + } +#endif +#ifdef GL_ARB_vertex_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_object", 20)) + { + ret = GLEW_ARB_vertex_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_vertex_program + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program", 14)) + { + ret = GLEW_ARB_vertex_program; + continue; + } +#endif +#ifdef GL_ARB_vertex_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader", 13)) + { + ret = GLEW_ARB_vertex_shader; + continue; + } +#endif +#ifdef GL_ARB_window_pos + if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_pos", 10)) + { + ret = GLEW_ARB_window_pos; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATIX_", 5)) + { +#ifdef GL_ATIX_point_sprites + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprites", 13)) + { + ret = GLEW_ATIX_point_sprites; + continue; + } +#endif +#ifdef GL_ATIX_texture_env_combine3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine3", 20)) + { + ret = GLEW_ATIX_texture_env_combine3; + continue; + } +#endif +#ifdef GL_ATIX_texture_env_route + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_route", 17)) + { + ret = GLEW_ATIX_texture_env_route; + continue; + } +#endif +#ifdef GL_ATIX_vertex_shader_output_point_size + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_output_point_size", 31)) + { + ret = GLEW_ATIX_vertex_shader_output_point_size; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) + { +#ifdef GL_ATI_draw_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers", 12)) + { + ret = GLEW_ATI_draw_buffers; + continue; + } +#endif +#ifdef GL_ATI_element_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"element_array", 13)) + { + ret = GLEW_ATI_element_array; + continue; + } +#endif +#ifdef GL_ATI_envmap_bumpmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"envmap_bumpmap", 14)) + { + ret = GLEW_ATI_envmap_bumpmap; + continue; + } +#endif +#ifdef GL_ATI_fragment_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader", 15)) + { + ret = GLEW_ATI_fragment_shader; + continue; + } +#endif +#ifdef GL_ATI_map_object_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_object_buffer", 17)) + { + ret = GLEW_ATI_map_object_buffer; + continue; + } +#endif +#ifdef GL_ATI_pn_triangles + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pn_triangles", 12)) + { + ret = GLEW_ATI_pn_triangles; + continue; + } +#endif +#ifdef GL_ATI_separate_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_stencil", 16)) + { + ret = GLEW_ATI_separate_stencil; + continue; + } +#endif +#ifdef GL_ATI_text_fragment_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"text_fragment_shader", 20)) + { + ret = GLEW_ATI_text_fragment_shader; + continue; + } +#endif +#ifdef GL_ATI_texture_compression_3dc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_3dc", 23)) + { + ret = GLEW_ATI_texture_compression_3dc; + continue; + } +#endif +#ifdef GL_ATI_texture_env_combine3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine3", 20)) + { + ret = GLEW_ATI_texture_env_combine3; + continue; + } +#endif +#ifdef GL_ATI_texture_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_float", 13)) + { + ret = GLEW_ATI_texture_float; + continue; + } +#endif +#ifdef GL_ATI_texture_mirror_once + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_once", 19)) + { + ret = GLEW_ATI_texture_mirror_once; + continue; + } +#endif +#ifdef GL_ATI_vertex_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) + { + ret = GLEW_ATI_vertex_array_object; + continue; + } +#endif +#ifdef GL_ATI_vertex_attrib_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_array_object", 26)) + { + ret = GLEW_ATI_vertex_attrib_array_object; + continue; + } +#endif +#ifdef GL_ATI_vertex_streams + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_streams", 14)) + { + ret = GLEW_ATI_vertex_streams; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) + { +#ifdef GL_EXT_422_pixels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"422_pixels", 10)) + { + ret = GLEW_EXT_422_pixels; + continue; + } +#endif +#ifdef GL_EXT_Cg_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"Cg_shader", 9)) + { + ret = GLEW_EXT_Cg_shader; + continue; + } +#endif +#ifdef GL_EXT_abgr + if (_glewStrSame3(&pos, &len, (const GLubyte*)"abgr", 4)) + { + ret = GLEW_EXT_abgr; + continue; + } +#endif +#ifdef GL_EXT_bgra + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bgra", 4)) + { + ret = GLEW_EXT_bgra; + continue; + } +#endif +#ifdef GL_EXT_blend_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_color", 11)) + { + ret = GLEW_EXT_blend_color; + continue; + } +#endif +#ifdef GL_EXT_blend_equation_separate + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_separate", 23)) + { + ret = GLEW_EXT_blend_equation_separate; + continue; + } +#endif +#ifdef GL_EXT_blend_func_separate + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_func_separate", 19)) + { + ret = GLEW_EXT_blend_func_separate; + continue; + } +#endif +#ifdef GL_EXT_blend_logic_op + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_logic_op", 14)) + { + ret = GLEW_EXT_blend_logic_op; + continue; + } +#endif +#ifdef GL_EXT_blend_minmax + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_minmax", 12)) + { + ret = GLEW_EXT_blend_minmax; + continue; + } +#endif +#ifdef GL_EXT_blend_subtract + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_subtract", 14)) + { + ret = GLEW_EXT_blend_subtract; + continue; + } +#endif +#ifdef GL_EXT_clip_volume_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clip_volume_hint", 16)) + { + ret = GLEW_EXT_clip_volume_hint; + continue; + } +#endif +#ifdef GL_EXT_cmyka + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cmyka", 5)) + { + ret = GLEW_EXT_cmyka; + continue; + } +#endif +#ifdef GL_EXT_color_subtable + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_subtable", 14)) + { + ret = GLEW_EXT_color_subtable; + continue; + } +#endif +#ifdef GL_EXT_compiled_vertex_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compiled_vertex_array", 21)) + { + ret = GLEW_EXT_compiled_vertex_array; + continue; + } +#endif +#ifdef GL_EXT_convolution + if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution", 11)) + { + ret = GLEW_EXT_convolution; + continue; + } +#endif +#ifdef GL_EXT_coordinate_frame + if (_glewStrSame3(&pos, &len, (const GLubyte*)"coordinate_frame", 16)) + { + ret = GLEW_EXT_coordinate_frame; + continue; + } +#endif +#ifdef GL_EXT_copy_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_texture", 12)) + { + ret = GLEW_EXT_copy_texture; + continue; + } +#endif +#ifdef GL_EXT_cull_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cull_vertex", 11)) + { + ret = GLEW_EXT_cull_vertex; + continue; + } +#endif +#ifdef GL_EXT_depth_bounds_test + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_bounds_test", 17)) + { + ret = GLEW_EXT_depth_bounds_test; + continue; + } +#endif +#ifdef GL_EXT_draw_range_elements + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_range_elements", 19)) + { + ret = GLEW_EXT_draw_range_elements; + continue; + } +#endif +#ifdef GL_EXT_fog_coord + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_coord", 9)) + { + ret = GLEW_EXT_fog_coord; + continue; + } +#endif +#ifdef GL_EXT_fragment_lighting + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_lighting", 17)) + { + ret = GLEW_EXT_fragment_lighting; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_blit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_blit", 16)) + { + ret = GLEW_EXT_framebuffer_blit; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample", 23)) + { + ret = GLEW_EXT_framebuffer_multisample; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_object", 18)) + { + ret = GLEW_EXT_framebuffer_object; + continue; + } +#endif +#ifdef GL_EXT_histogram + if (_glewStrSame3(&pos, &len, (const GLubyte*)"histogram", 9)) + { + ret = GLEW_EXT_histogram; + continue; + } +#endif +#ifdef GL_EXT_index_array_formats + if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_array_formats", 19)) + { + ret = GLEW_EXT_index_array_formats; + continue; + } +#endif +#ifdef GL_EXT_index_func + if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_func", 10)) + { + ret = GLEW_EXT_index_func; + continue; + } +#endif +#ifdef GL_EXT_index_material + if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_material", 14)) + { + ret = GLEW_EXT_index_material; + continue; + } +#endif +#ifdef GL_EXT_index_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_texture", 13)) + { + ret = GLEW_EXT_index_texture; + continue; + } +#endif +#ifdef GL_EXT_light_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"light_texture", 13)) + { + ret = GLEW_EXT_light_texture; + continue; + } +#endif +#ifdef GL_EXT_misc_attribute + if (_glewStrSame3(&pos, &len, (const GLubyte*)"misc_attribute", 14)) + { + ret = GLEW_EXT_misc_attribute; + continue; + } +#endif +#ifdef GL_EXT_multi_draw_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_arrays", 17)) + { + ret = GLEW_EXT_multi_draw_arrays; + continue; + } +#endif +#ifdef GL_EXT_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLEW_EXT_multisample; + continue; + } +#endif +#ifdef GL_EXT_packed_depth_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_depth_stencil", 20)) + { + ret = GLEW_EXT_packed_depth_stencil; + continue; + } +#endif +#ifdef GL_EXT_packed_pixels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_pixels", 13)) + { + ret = GLEW_EXT_packed_pixels; + continue; + } +#endif +#ifdef GL_EXT_paletted_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"paletted_texture", 16)) + { + ret = GLEW_EXT_paletted_texture; + continue; + } +#endif +#ifdef GL_EXT_pixel_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer_object", 19)) + { + ret = GLEW_EXT_pixel_buffer_object; + continue; + } +#endif +#ifdef GL_EXT_pixel_transform + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_transform", 15)) + { + ret = GLEW_EXT_pixel_transform; + continue; + } +#endif +#ifdef GL_EXT_pixel_transform_color_table + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_transform_color_table", 27)) + { + ret = GLEW_EXT_pixel_transform_color_table; + continue; + } +#endif +#ifdef GL_EXT_point_parameters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_parameters", 16)) + { + ret = GLEW_EXT_point_parameters; + continue; + } +#endif +#ifdef GL_EXT_polygon_offset + if (_glewStrSame3(&pos, &len, (const GLubyte*)"polygon_offset", 14)) + { + ret = GLEW_EXT_polygon_offset; + continue; + } +#endif +#ifdef GL_EXT_rescale_normal + if (_glewStrSame3(&pos, &len, (const GLubyte*)"rescale_normal", 14)) + { + ret = GLEW_EXT_rescale_normal; + continue; + } +#endif +#ifdef GL_EXT_scene_marker + if (_glewStrSame3(&pos, &len, (const GLubyte*)"scene_marker", 12)) + { + ret = GLEW_EXT_scene_marker; + continue; + } +#endif +#ifdef GL_EXT_secondary_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"secondary_color", 15)) + { + ret = GLEW_EXT_secondary_color; + continue; + } +#endif +#ifdef GL_EXT_separate_specular_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_specular_color", 23)) + { + ret = GLEW_EXT_separate_specular_color; + continue; + } +#endif +#ifdef GL_EXT_shadow_funcs + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_funcs", 12)) + { + ret = GLEW_EXT_shadow_funcs; + continue; + } +#endif +#ifdef GL_EXT_shared_texture_palette + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shared_texture_palette", 22)) + { + ret = GLEW_EXT_shared_texture_palette; + continue; + } +#endif +#ifdef GL_EXT_stencil_clear_tag + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_clear_tag", 17)) + { + ret = GLEW_EXT_stencil_clear_tag; + continue; + } +#endif +#ifdef GL_EXT_stencil_two_side + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_two_side", 16)) + { + ret = GLEW_EXT_stencil_two_side; + continue; + } +#endif +#ifdef GL_EXT_stencil_wrap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_wrap", 12)) + { + ret = GLEW_EXT_stencil_wrap; + continue; + } +#endif +#ifdef GL_EXT_subtexture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"subtexture", 10)) + { + ret = GLEW_EXT_subtexture; + continue; + } +#endif +#ifdef GL_EXT_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture", 7)) + { + ret = GLEW_EXT_texture; + continue; + } +#endif +#ifdef GL_EXT_texture3D + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture3D", 9)) + { + ret = GLEW_EXT_texture3D; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_dxt1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt1", 24)) + { + ret = GLEW_EXT_texture_compression_dxt1; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_s3tc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_s3tc", 24)) + { + ret = GLEW_EXT_texture_compression_s3tc; + continue; + } +#endif +#ifdef GL_EXT_texture_cube_map + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map", 16)) + { + ret = GLEW_EXT_texture_cube_map; + continue; + } +#endif +#ifdef GL_EXT_texture_edge_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_edge_clamp", 18)) + { + ret = GLEW_EXT_texture_edge_clamp; + continue; + } +#endif +#ifdef GL_EXT_texture_env + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env", 11)) + { + ret = GLEW_EXT_texture_env; + continue; + } +#endif +#ifdef GL_EXT_texture_env_add + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_add", 15)) + { + ret = GLEW_EXT_texture_env_add; + continue; + } +#endif +#ifdef GL_EXT_texture_env_combine + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine", 19)) + { + ret = GLEW_EXT_texture_env_combine; + continue; + } +#endif +#ifdef GL_EXT_texture_env_dot3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_dot3", 16)) + { + ret = GLEW_EXT_texture_env_dot3; + continue; + } +#endif +#ifdef GL_EXT_texture_filter_anisotropic + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter_anisotropic", 26)) + { + ret = GLEW_EXT_texture_filter_anisotropic; + continue; + } +#endif +#ifdef GL_EXT_texture_lod_bias + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod_bias", 16)) + { + ret = GLEW_EXT_texture_lod_bias; + continue; + } +#endif +#ifdef GL_EXT_texture_mirror_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_clamp", 20)) + { + ret = GLEW_EXT_texture_mirror_clamp; + continue; + } +#endif +#ifdef GL_EXT_texture_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_object", 14)) + { + ret = GLEW_EXT_texture_object; + continue; + } +#endif +#ifdef GL_EXT_texture_perturb_normal + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_perturb_normal", 22)) + { + ret = GLEW_EXT_texture_perturb_normal; + continue; + } +#endif +#ifdef GL_EXT_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) + { + ret = GLEW_EXT_texture_rectangle; + continue; + } +#endif +#ifdef GL_EXT_texture_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB", 12)) + { + ret = GLEW_EXT_texture_sRGB; + continue; + } +#endif +#ifdef GL_EXT_vertex_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array", 12)) + { + ret = GLEW_EXT_vertex_array; + continue; + } +#endif +#ifdef GL_EXT_vertex_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader", 13)) + { + ret = GLEW_EXT_vertex_shader; + continue; + } +#endif +#ifdef GL_EXT_vertex_weighting + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_weighting", 16)) + { + ret = GLEW_EXT_vertex_weighting; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"GREMEDY_", 8)) + { +#ifdef GL_GREMEDY_string_marker + if (_glewStrSame3(&pos, &len, (const GLubyte*)"string_marker", 13)) + { + ret = GLEW_GREMEDY_string_marker; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"HP_", 3)) + { +#ifdef GL_HP_convolution_border_modes + if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_border_modes", 24)) + { + ret = GLEW_HP_convolution_border_modes; + continue; + } +#endif +#ifdef GL_HP_image_transform + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_transform", 15)) + { + ret = GLEW_HP_image_transform; + continue; + } +#endif +#ifdef GL_HP_occlusion_test + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_test", 14)) + { + ret = GLEW_HP_occlusion_test; + continue; + } +#endif +#ifdef GL_HP_texture_lighting + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lighting", 16)) + { + ret = GLEW_HP_texture_lighting; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"IBM_", 4)) + { +#ifdef GL_IBM_cull_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cull_vertex", 11)) + { + ret = GLEW_IBM_cull_vertex; + continue; + } +#endif +#ifdef GL_IBM_multimode_draw_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multimode_draw_arrays", 21)) + { + ret = GLEW_IBM_multimode_draw_arrays; + continue; + } +#endif +#ifdef GL_IBM_rasterpos_clip + if (_glewStrSame3(&pos, &len, (const GLubyte*)"rasterpos_clip", 14)) + { + ret = GLEW_IBM_rasterpos_clip; + continue; + } +#endif +#ifdef GL_IBM_static_data + if (_glewStrSame3(&pos, &len, (const GLubyte*)"static_data", 11)) + { + ret = GLEW_IBM_static_data; + continue; + } +#endif +#ifdef GL_IBM_texture_mirrored_repeat + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirrored_repeat", 23)) + { + ret = GLEW_IBM_texture_mirrored_repeat; + continue; + } +#endif +#ifdef GL_IBM_vertex_array_lists + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_lists", 18)) + { + ret = GLEW_IBM_vertex_array_lists; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"INGR_", 5)) + { +#ifdef GL_INGR_color_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_clamp", 11)) + { + ret = GLEW_INGR_color_clamp; + continue; + } +#endif +#ifdef GL_INGR_interlace_read + if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace_read", 14)) + { + ret = GLEW_INGR_interlace_read; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"INTEL_", 6)) + { +#ifdef GL_INTEL_parallel_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"parallel_arrays", 15)) + { + ret = GLEW_INTEL_parallel_arrays; + continue; + } +#endif +#ifdef GL_INTEL_texture_scissor + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_scissor", 15)) + { + ret = GLEW_INTEL_texture_scissor; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"KTX_", 4)) + { +#ifdef GL_KTX_buffer_region + if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_region", 13)) + { + ret = GLEW_KTX_buffer_region; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESAX_", 6)) + { +#ifdef GL_MESAX_texture_stack + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_stack", 13)) + { + ret = GLEW_MESAX_texture_stack; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESA_", 5)) + { +#ifdef GL_MESA_pack_invert + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pack_invert", 11)) + { + ret = GLEW_MESA_pack_invert; + continue; + } +#endif +#ifdef GL_MESA_resize_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"resize_buffers", 14)) + { + ret = GLEW_MESA_resize_buffers; + continue; + } +#endif +#ifdef GL_MESA_window_pos + if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_pos", 10)) + { + ret = GLEW_MESA_window_pos; + continue; + } +#endif +#ifdef GL_MESA_ycbcr_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycbcr_texture", 13)) + { + ret = GLEW_MESA_ycbcr_texture; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) + { +#ifdef GL_NV_blend_square + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_square", 12)) + { + ret = GLEW_NV_blend_square; + continue; + } +#endif +#ifdef GL_NV_copy_depth_to_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_depth_to_color", 19)) + { + ret = GLEW_NV_copy_depth_to_color; + continue; + } +#endif +#ifdef GL_NV_depth_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp", 11)) + { + ret = GLEW_NV_depth_clamp; + continue; + } +#endif +#ifdef GL_NV_evaluators + if (_glewStrSame3(&pos, &len, (const GLubyte*)"evaluators", 10)) + { + ret = GLEW_NV_evaluators; + continue; + } +#endif +#ifdef GL_NV_fence + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fence", 5)) + { + ret = GLEW_NV_fence; + continue; + } +#endif +#ifdef GL_NV_float_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) + { + ret = GLEW_NV_float_buffer; + continue; + } +#endif +#ifdef GL_NV_fog_distance + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_distance", 12)) + { + ret = GLEW_NV_fog_distance; + continue; + } +#endif +#ifdef GL_NV_fragment_program + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program", 16)) + { + ret = GLEW_NV_fragment_program; + continue; + } +#endif +#ifdef GL_NV_fragment_program2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program2", 17)) + { + ret = GLEW_NV_fragment_program2; + continue; + } +#endif +#ifdef GL_NV_fragment_program_option + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program_option", 23)) + { + ret = GLEW_NV_fragment_program_option; + continue; + } +#endif +#ifdef GL_NV_half_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float", 10)) + { + ret = GLEW_NV_half_float; + continue; + } +#endif +#ifdef GL_NV_light_max_exponent + if (_glewStrSame3(&pos, &len, (const GLubyte*)"light_max_exponent", 18)) + { + ret = GLEW_NV_light_max_exponent; + continue; + } +#endif +#ifdef GL_NV_multisample_filter_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_filter_hint", 23)) + { + ret = GLEW_NV_multisample_filter_hint; + continue; + } +#endif +#ifdef GL_NV_occlusion_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query", 15)) + { + ret = GLEW_NV_occlusion_query; + continue; + } +#endif +#ifdef GL_NV_packed_depth_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_depth_stencil", 20)) + { + ret = GLEW_NV_packed_depth_stencil; + continue; + } +#endif +#ifdef GL_NV_pixel_data_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_data_range", 16)) + { + ret = GLEW_NV_pixel_data_range; + continue; + } +#endif +#ifdef GL_NV_point_sprite + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprite", 12)) + { + ret = GLEW_NV_point_sprite; + continue; + } +#endif +#ifdef GL_NV_primitive_restart + if (_glewStrSame3(&pos, &len, (const GLubyte*)"primitive_restart", 17)) + { + ret = GLEW_NV_primitive_restart; + continue; + } +#endif +#ifdef GL_NV_register_combiners + if (_glewStrSame3(&pos, &len, (const GLubyte*)"register_combiners", 18)) + { + ret = GLEW_NV_register_combiners; + continue; + } +#endif +#ifdef GL_NV_register_combiners2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"register_combiners2", 19)) + { + ret = GLEW_NV_register_combiners2; + continue; + } +#endif +#ifdef GL_NV_texgen_emboss + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texgen_emboss", 13)) + { + ret = GLEW_NV_texgen_emboss; + continue; + } +#endif +#ifdef GL_NV_texgen_reflection + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texgen_reflection", 17)) + { + ret = GLEW_NV_texgen_reflection; + continue; + } +#endif +#ifdef GL_NV_texture_compression_vtc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_vtc", 23)) + { + ret = GLEW_NV_texture_compression_vtc; + continue; + } +#endif +#ifdef GL_NV_texture_env_combine4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine4", 20)) + { + ret = GLEW_NV_texture_env_combine4; + continue; + } +#endif +#ifdef GL_NV_texture_expand_normal + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_expand_normal", 21)) + { + ret = GLEW_NV_texture_expand_normal; + continue; + } +#endif +#ifdef GL_NV_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) + { + ret = GLEW_NV_texture_rectangle; + continue; + } +#endif +#ifdef GL_NV_texture_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader", 14)) + { + ret = GLEW_NV_texture_shader; + continue; + } +#endif +#ifdef GL_NV_texture_shader2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader2", 15)) + { + ret = GLEW_NV_texture_shader2; + continue; + } +#endif +#ifdef GL_NV_texture_shader3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader3", 15)) + { + ret = GLEW_NV_texture_shader3; + continue; + } +#endif +#ifdef GL_NV_vertex_array_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) + { + ret = GLEW_NV_vertex_array_range; + continue; + } +#endif +#ifdef GL_NV_vertex_array_range2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range2", 19)) + { + ret = GLEW_NV_vertex_array_range2; + continue; + } +#endif +#ifdef GL_NV_vertex_program + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program", 14)) + { + ret = GLEW_NV_vertex_program; + continue; + } +#endif +#ifdef GL_NV_vertex_program1_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program1_1", 17)) + { + ret = GLEW_NV_vertex_program1_1; + continue; + } +#endif +#ifdef GL_NV_vertex_program2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program2", 15)) + { + ret = GLEW_NV_vertex_program2; + continue; + } +#endif +#ifdef GL_NV_vertex_program2_option + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program2_option", 22)) + { + ret = GLEW_NV_vertex_program2_option; + continue; + } +#endif +#ifdef GL_NV_vertex_program3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program3", 15)) + { + ret = GLEW_NV_vertex_program3; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) + { +#ifdef GL_OML_interlace + if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace", 9)) + { + ret = GLEW_OML_interlace; + continue; + } +#endif +#ifdef GL_OML_resample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"resample", 8)) + { + ret = GLEW_OML_resample; + continue; + } +#endif +#ifdef GL_OML_subsample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"subsample", 9)) + { + ret = GLEW_OML_subsample; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"PGI_", 4)) + { +#ifdef GL_PGI_misc_hints + if (_glewStrSame3(&pos, &len, (const GLubyte*)"misc_hints", 10)) + { + ret = GLEW_PGI_misc_hints; + continue; + } +#endif +#ifdef GL_PGI_vertex_hints + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_hints", 12)) + { + ret = GLEW_PGI_vertex_hints; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"REND_", 5)) + { +#ifdef GL_REND_screen_coordinates + if (_glewStrSame3(&pos, &len, (const GLubyte*)"screen_coordinates", 18)) + { + ret = GLEW_REND_screen_coordinates; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"S3_", 3)) + { +#ifdef GL_S3_s3tc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"s3tc", 4)) + { + ret = GLEW_S3_s3tc; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIS_", 5)) + { +#ifdef GL_SGIS_color_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_range", 11)) + { + ret = GLEW_SGIS_color_range; + continue; + } +#endif +#ifdef GL_SGIS_detail_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"detail_texture", 14)) + { + ret = GLEW_SGIS_detail_texture; + continue; + } +#endif +#ifdef GL_SGIS_fog_function + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_function", 12)) + { + ret = GLEW_SGIS_fog_function; + continue; + } +#endif +#ifdef GL_SGIS_generate_mipmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"generate_mipmap", 15)) + { + ret = GLEW_SGIS_generate_mipmap; + continue; + } +#endif +#ifdef GL_SGIS_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLEW_SGIS_multisample; + continue; + } +#endif +#ifdef GL_SGIS_pixel_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture", 13)) + { + ret = GLEW_SGIS_pixel_texture; + continue; + } +#endif +#ifdef GL_SGIS_sharpen_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sharpen_texture", 15)) + { + ret = GLEW_SGIS_sharpen_texture; + continue; + } +#endif +#ifdef GL_SGIS_texture4D + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture4D", 9)) + { + ret = GLEW_SGIS_texture4D; + continue; + } +#endif +#ifdef GL_SGIS_texture_border_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_border_clamp", 20)) + { + ret = GLEW_SGIS_texture_border_clamp; + continue; + } +#endif +#ifdef GL_SGIS_texture_edge_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_edge_clamp", 18)) + { + ret = GLEW_SGIS_texture_edge_clamp; + continue; + } +#endif +#ifdef GL_SGIS_texture_filter4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter4", 15)) + { + ret = GLEW_SGIS_texture_filter4; + continue; + } +#endif +#ifdef GL_SGIS_texture_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod", 11)) + { + ret = GLEW_SGIS_texture_lod; + continue; + } +#endif +#ifdef GL_SGIS_texture_select + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_select", 14)) + { + ret = GLEW_SGIS_texture_select; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIX_", 5)) + { +#ifdef GL_SGIX_async + if (_glewStrSame3(&pos, &len, (const GLubyte*)"async", 5)) + { + ret = GLEW_SGIX_async; + continue; + } +#endif +#ifdef GL_SGIX_async_histogram + if (_glewStrSame3(&pos, &len, (const GLubyte*)"async_histogram", 15)) + { + ret = GLEW_SGIX_async_histogram; + continue; + } +#endif +#ifdef GL_SGIX_async_pixel + if (_glewStrSame3(&pos, &len, (const GLubyte*)"async_pixel", 11)) + { + ret = GLEW_SGIX_async_pixel; + continue; + } +#endif +#ifdef GL_SGIX_blend_alpha_minmax + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_alpha_minmax", 18)) + { + ret = GLEW_SGIX_blend_alpha_minmax; + continue; + } +#endif +#ifdef GL_SGIX_clipmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clipmap", 7)) + { + ret = GLEW_SGIX_clipmap; + continue; + } +#endif +#ifdef GL_SGIX_depth_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13)) + { + ret = GLEW_SGIX_depth_texture; + continue; + } +#endif +#ifdef GL_SGIX_flush_raster + if (_glewStrSame3(&pos, &len, (const GLubyte*)"flush_raster", 12)) + { + ret = GLEW_SGIX_flush_raster; + continue; + } +#endif +#ifdef GL_SGIX_fog_offset + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_offset", 10)) + { + ret = GLEW_SGIX_fog_offset; + continue; + } +#endif +#ifdef GL_SGIX_fog_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_texture", 11)) + { + ret = GLEW_SGIX_fog_texture; + continue; + } +#endif +#ifdef GL_SGIX_fragment_specular_lighting + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_specular_lighting", 26)) + { + ret = GLEW_SGIX_fragment_specular_lighting; + continue; + } +#endif +#ifdef GL_SGIX_framezoom + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framezoom", 9)) + { + ret = GLEW_SGIX_framezoom; + continue; + } +#endif +#ifdef GL_SGIX_interlace + if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace", 9)) + { + ret = GLEW_SGIX_interlace; + continue; + } +#endif +#ifdef GL_SGIX_ir_instrument1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ir_instrument1", 14)) + { + ret = GLEW_SGIX_ir_instrument1; + continue; + } +#endif +#ifdef GL_SGIX_list_priority + if (_glewStrSame3(&pos, &len, (const GLubyte*)"list_priority", 13)) + { + ret = GLEW_SGIX_list_priority; + continue; + } +#endif +#ifdef GL_SGIX_pixel_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture", 13)) + { + ret = GLEW_SGIX_pixel_texture; + continue; + } +#endif +#ifdef GL_SGIX_pixel_texture_bits + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture_bits", 18)) + { + ret = GLEW_SGIX_pixel_texture_bits; + continue; + } +#endif +#ifdef GL_SGIX_reference_plane + if (_glewStrSame3(&pos, &len, (const GLubyte*)"reference_plane", 15)) + { + ret = GLEW_SGIX_reference_plane; + continue; + } +#endif +#ifdef GL_SGIX_resample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"resample", 8)) + { + ret = GLEW_SGIX_resample; + continue; + } +#endif +#ifdef GL_SGIX_shadow + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow", 6)) + { + ret = GLEW_SGIX_shadow; + continue; + } +#endif +#ifdef GL_SGIX_shadow_ambient + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_ambient", 14)) + { + ret = GLEW_SGIX_shadow_ambient; + continue; + } +#endif +#ifdef GL_SGIX_sprite + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sprite", 6)) + { + ret = GLEW_SGIX_sprite; + continue; + } +#endif +#ifdef GL_SGIX_tag_sample_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tag_sample_buffer", 17)) + { + ret = GLEW_SGIX_tag_sample_buffer; + continue; + } +#endif +#ifdef GL_SGIX_texture_add_env + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_add_env", 15)) + { + ret = GLEW_SGIX_texture_add_env; + continue; + } +#endif +#ifdef GL_SGIX_texture_coordinate_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_coordinate_clamp", 24)) + { + ret = GLEW_SGIX_texture_coordinate_clamp; + continue; + } +#endif +#ifdef GL_SGIX_texture_lod_bias + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod_bias", 16)) + { + ret = GLEW_SGIX_texture_lod_bias; + continue; + } +#endif +#ifdef GL_SGIX_texture_multi_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multi_buffer", 20)) + { + ret = GLEW_SGIX_texture_multi_buffer; + continue; + } +#endif +#ifdef GL_SGIX_texture_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_range", 13)) + { + ret = GLEW_SGIX_texture_range; + continue; + } +#endif +#ifdef GL_SGIX_texture_scale_bias + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_scale_bias", 18)) + { + ret = GLEW_SGIX_texture_scale_bias; + continue; + } +#endif +#ifdef GL_SGIX_vertex_preclip + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_preclip", 14)) + { + ret = GLEW_SGIX_vertex_preclip; + continue; + } +#endif +#ifdef GL_SGIX_vertex_preclip_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_preclip_hint", 19)) + { + ret = GLEW_SGIX_vertex_preclip_hint; + continue; + } +#endif +#ifdef GL_SGIX_ycrcb + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycrcb", 5)) + { + ret = GLEW_SGIX_ycrcb; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGI_", 4)) + { +#ifdef GL_SGI_color_matrix + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_matrix", 12)) + { + ret = GLEW_SGI_color_matrix; + continue; + } +#endif +#ifdef GL_SGI_color_table + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_table", 11)) + { + ret = GLEW_SGI_color_table; + continue; + } +#endif +#ifdef GL_SGI_texture_color_table + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_color_table", 19)) + { + ret = GLEW_SGI_texture_color_table; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUNX_", 5)) + { +#ifdef GL_SUNX_constant_data + if (_glewStrSame3(&pos, &len, (const GLubyte*)"constant_data", 13)) + { + ret = GLEW_SUNX_constant_data; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUN_", 4)) + { +#ifdef GL_SUN_convolution_border_modes + if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_border_modes", 24)) + { + ret = GLEW_SUN_convolution_border_modes; + continue; + } +#endif +#ifdef GL_SUN_global_alpha + if (_glewStrSame3(&pos, &len, (const GLubyte*)"global_alpha", 12)) + { + ret = GLEW_SUN_global_alpha; + continue; + } +#endif +#ifdef GL_SUN_mesh_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"mesh_array", 10)) + { + ret = GLEW_SUN_mesh_array; + continue; + } +#endif +#ifdef GL_SUN_read_video_pixels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_video_pixels", 17)) + { + ret = GLEW_SUN_read_video_pixels; + continue; + } +#endif +#ifdef GL_SUN_slice_accum + if (_glewStrSame3(&pos, &len, (const GLubyte*)"slice_accum", 11)) + { + ret = GLEW_SUN_slice_accum; + continue; + } +#endif +#ifdef GL_SUN_triangle_list + if (_glewStrSame3(&pos, &len, (const GLubyte*)"triangle_list", 13)) + { + ret = GLEW_SUN_triangle_list; + continue; + } +#endif +#ifdef GL_SUN_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex", 6)) + { + ret = GLEW_SUN_vertex; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"WIN_", 4)) + { +#ifdef GL_WIN_phong_shading + if (_glewStrSame3(&pos, &len, (const GLubyte*)"phong_shading", 13)) + { + ret = GLEW_WIN_phong_shading; + continue; + } +#endif +#ifdef GL_WIN_specular_fog + if (_glewStrSame3(&pos, &len, (const GLubyte*)"specular_fog", 12)) + { + ret = GLEW_WIN_specular_fog; + continue; + } +#endif +#ifdef GL_WIN_swap_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_hint", 9)) + { + ret = GLEW_WIN_swap_hint; + continue; + } +#endif + } + } + ret = (len == 0); + } + return ret; +} + +#if defined(_WIN32) + +#if defined(GLEW_MX) +GLboolean wglewContextIsSupported (WGLEWContext* ctx, const char* name) +#else +GLboolean wglewIsSupported (const char* name) +#endif +{ + GLubyte* pos = (GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if (_glewStrSame1(&pos, &len, (const GLubyte*)"WGL_", 4)) + { + if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) + { +#ifdef WGL_3DFX_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = WGLEW_3DFX_multisample; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DL_", 4)) + { +#ifdef WGL_3DL_stereo_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stereo_control", 14)) + { + ret = WGLEW_3DL_stereo_control; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) + { +#ifdef WGL_ARB_buffer_region + if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_region", 13)) + { + ret = WGLEW_ARB_buffer_region; + continue; + } +#endif +#ifdef WGL_ARB_extensions_string + if (_glewStrSame3(&pos, &len, (const GLubyte*)"extensions_string", 17)) + { + ret = WGLEW_ARB_extensions_string; + continue; + } +#endif +#ifdef WGL_ARB_make_current_read + if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) + { + ret = WGLEW_ARB_make_current_read; + continue; + } +#endif +#ifdef WGL_ARB_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = WGLEW_ARB_multisample; + continue; + } +#endif +#ifdef WGL_ARB_pbuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) + { + ret = WGLEW_ARB_pbuffer; + continue; + } +#endif +#ifdef WGL_ARB_pixel_format + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format", 12)) + { + ret = WGLEW_ARB_pixel_format; + continue; + } +#endif +#ifdef WGL_ARB_pixel_format_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) + { + ret = WGLEW_ARB_pixel_format_float; + continue; + } +#endif +#ifdef WGL_ARB_render_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture", 14)) + { + ret = WGLEW_ARB_render_texture; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) + { +#ifdef WGL_ATI_pixel_format_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) + { + ret = WGLEW_ATI_pixel_format_float; + continue; + } +#endif +#ifdef WGL_ATI_render_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture_rectangle", 24)) + { + ret = WGLEW_ATI_render_texture_rectangle; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) + { +#ifdef WGL_EXT_depth_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_float", 11)) + { + ret = WGLEW_EXT_depth_float; + continue; + } +#endif +#ifdef WGL_EXT_display_color_table + if (_glewStrSame3(&pos, &len, (const GLubyte*)"display_color_table", 19)) + { + ret = WGLEW_EXT_display_color_table; + continue; + } +#endif +#ifdef WGL_EXT_extensions_string + if (_glewStrSame3(&pos, &len, (const GLubyte*)"extensions_string", 17)) + { + ret = WGLEW_EXT_extensions_string; + continue; + } +#endif +#ifdef WGL_EXT_make_current_read + if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) + { + ret = WGLEW_EXT_make_current_read; + continue; + } +#endif +#ifdef WGL_EXT_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = WGLEW_EXT_multisample; + continue; + } +#endif +#ifdef WGL_EXT_pbuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) + { + ret = WGLEW_EXT_pbuffer; + continue; + } +#endif +#ifdef WGL_EXT_pixel_format + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format", 12)) + { + ret = WGLEW_EXT_pixel_format; + continue; + } +#endif +#ifdef WGL_EXT_swap_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) + { + ret = WGLEW_EXT_swap_control; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"I3D_", 4)) + { +#ifdef WGL_I3D_digital_video_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"digital_video_control", 21)) + { + ret = WGLEW_I3D_digital_video_control; + continue; + } +#endif +#ifdef WGL_I3D_gamma + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gamma", 5)) + { + ret = WGLEW_I3D_gamma; + continue; + } +#endif +#ifdef WGL_I3D_genlock + if (_glewStrSame3(&pos, &len, (const GLubyte*)"genlock", 7)) + { + ret = WGLEW_I3D_genlock; + continue; + } +#endif +#ifdef WGL_I3D_image_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_buffer", 12)) + { + ret = WGLEW_I3D_image_buffer; + continue; + } +#endif +#ifdef WGL_I3D_swap_frame_lock + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_frame_lock", 15)) + { + ret = WGLEW_I3D_swap_frame_lock; + continue; + } +#endif +#ifdef WGL_I3D_swap_frame_usage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_frame_usage", 16)) + { + ret = WGLEW_I3D_swap_frame_usage; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) + { +#ifdef WGL_NV_float_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) + { + ret = WGLEW_NV_float_buffer; + continue; + } +#endif +#ifdef WGL_NV_render_depth_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_depth_texture", 20)) + { + ret = WGLEW_NV_render_depth_texture; + continue; + } +#endif +#ifdef WGL_NV_render_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture_rectangle", 24)) + { + ret = WGLEW_NV_render_texture_rectangle; + continue; + } +#endif +#ifdef WGL_NV_vertex_array_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) + { + ret = WGLEW_NV_vertex_array_range; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) + { +#ifdef WGL_OML_sync_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync_control", 12)) + { + ret = WGLEW_OML_sync_control; + continue; + } +#endif + } + } + ret = (len == 0); + } + return ret; +} + +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) + +#if defined(GLEW_MX) +GLboolean glxewContextIsSupported (GLXEWContext* ctx, const char* name) +#else +GLboolean glxewIsSupported (const char* name) +#endif +{ + GLubyte* pos = (GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if(_glewStrSame1(&pos, &len, (const GLubyte*)"GLX_", 4)) + { + if (_glewStrSame2(&pos, &len, (const GLubyte*)"VERSION_", 8)) + { +#ifdef GLX_VERSION_1_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2", 3)) + { + ret = GLXEW_VERSION_1_2; + continue; + } +#endif +#ifdef GLX_VERSION_1_3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_3", 3)) + { + ret = GLXEW_VERSION_1_3; + continue; + } +#endif +#ifdef GLX_VERSION_1_4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_4", 3)) + { + ret = GLXEW_VERSION_1_4; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) + { +#ifdef GLX_3DFX_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLXEW_3DFX_multisample; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) + { +#ifdef GLX_ARB_fbconfig_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig_float", 14)) + { + ret = GLXEW_ARB_fbconfig_float; + continue; + } +#endif +#ifdef GLX_ARB_get_proc_address + if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_proc_address", 16)) + { + ret = GLXEW_ARB_get_proc_address; + continue; + } +#endif +#ifdef GLX_ARB_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLXEW_ARB_multisample; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) + { +#ifdef GLX_ATI_pixel_format_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) + { + ret = GLXEW_ATI_pixel_format_float; + continue; + } +#endif +#ifdef GLX_ATI_render_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture", 14)) + { + ret = GLXEW_ATI_render_texture; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) + { +#ifdef GLX_EXT_import_context + if (_glewStrSame3(&pos, &len, (const GLubyte*)"import_context", 14)) + { + ret = GLXEW_EXT_import_context; + continue; + } +#endif +#ifdef GLX_EXT_scene_marker + if (_glewStrSame3(&pos, &len, (const GLubyte*)"scene_marker", 12)) + { + ret = GLXEW_EXT_scene_marker; + continue; + } +#endif +#ifdef GLX_EXT_visual_info + if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_info", 11)) + { + ret = GLXEW_EXT_visual_info; + continue; + } +#endif +#ifdef GLX_EXT_visual_rating + if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_rating", 13)) + { + ret = GLXEW_EXT_visual_rating; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESA_", 5)) + { +#ifdef GLX_MESA_agp_offset + if (_glewStrSame3(&pos, &len, (const GLubyte*)"agp_offset", 10)) + { + ret = GLXEW_MESA_agp_offset; + continue; + } +#endif +#ifdef GLX_MESA_copy_sub_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_sub_buffer", 15)) + { + ret = GLXEW_MESA_copy_sub_buffer; + continue; + } +#endif +#ifdef GLX_MESA_pixmap_colormap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixmap_colormap", 15)) + { + ret = GLXEW_MESA_pixmap_colormap; + continue; + } +#endif +#ifdef GLX_MESA_release_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"release_buffers", 15)) + { + ret = GLXEW_MESA_release_buffers; + continue; + } +#endif +#ifdef GLX_MESA_set_3dfx_mode + if (_glewStrSame3(&pos, &len, (const GLubyte*)"set_3dfx_mode", 13)) + { + ret = GLXEW_MESA_set_3dfx_mode; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) + { +#ifdef GLX_NV_float_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) + { + ret = GLXEW_NV_float_buffer; + continue; + } +#endif +#ifdef GLX_NV_vertex_array_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) + { + ret = GLXEW_NV_vertex_array_range; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) + { +#ifdef GLX_OML_swap_method + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_method", 11)) + { + ret = GLXEW_OML_swap_method; + continue; + } +#endif +#if defined(GLX_OML_sync_control) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +#include + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync_control", 12)) + { + ret = GLXEW_OML_sync_control; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIS_", 5)) + { +#ifdef GLX_SGIS_blended_overlay + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blended_overlay", 15)) + { + ret = GLXEW_SGIS_blended_overlay; + continue; + } +#endif +#ifdef GLX_SGIS_color_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_range", 11)) + { + ret = GLXEW_SGIS_color_range; + continue; + } +#endif +#ifdef GLX_SGIS_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLXEW_SGIS_multisample; + continue; + } +#endif +#ifdef GLX_SGIS_shared_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shared_multisample", 18)) + { + ret = GLXEW_SGIS_shared_multisample; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIX_", 5)) + { +#ifdef GLX_SGIX_fbconfig + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig", 8)) + { + ret = GLXEW_SGIX_fbconfig; + continue; + } +#endif +#ifdef GLX_SGIX_pbuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) + { + ret = GLXEW_SGIX_pbuffer; + continue; + } +#endif +#ifdef GLX_SGIX_swap_barrier + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_barrier", 12)) + { + ret = GLXEW_SGIX_swap_barrier; + continue; + } +#endif +#ifdef GLX_SGIX_swap_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) + { + ret = GLXEW_SGIX_swap_group; + continue; + } +#endif +#ifdef GLX_SGIX_video_resize + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_resize", 12)) + { + ret = GLXEW_SGIX_video_resize; + continue; + } +#endif +#ifdef GLX_SGIX_visual_select_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_select_group", 19)) + { + ret = GLXEW_SGIX_visual_select_group; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGI_", 4)) + { +#ifdef GLX_SGI_cushion + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cushion", 7)) + { + ret = GLXEW_SGI_cushion; + continue; + } +#endif +#ifdef GLX_SGI_make_current_read + if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) + { + ret = GLXEW_SGI_make_current_read; + continue; + } +#endif +#ifdef GLX_SGI_swap_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) + { + ret = GLXEW_SGI_swap_control; + continue; + } +#endif +#ifdef GLX_SGI_video_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_sync", 10)) + { + ret = GLXEW_SGI_video_sync; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUN_", 4)) + { +#ifdef GLX_SUN_get_transparent_index + if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_transparent_index", 21)) + { + ret = GLXEW_SUN_get_transparent_index; + continue; + } +#endif +#ifdef GLX_SUN_video_resize + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_resize", 12)) + { + ret = GLXEW_SUN_video_resize; + continue; + } +#endif + } + } + ret = (len == 0); + } + return ret; +} + +#endif /* _WIN32 */ diff --git a/extern/make/msvc_7_0/extern.sln b/extern/make/msvc_7_0/extern.sln index afc88ddda8e..e4bc550f503 100644 --- a/extern/make/msvc_7_0/extern.sln +++ b/extern/make/msvc_7_0/extern.sln @@ -8,6 +8,7 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "solid", "..\..\solid\make\msvc_7_0\solid.vcproj", "{D696C86B-0B53-4471-A50D-5B983A6FA4AD}" ProjectSection(ProjectDependencies) = postProject {6461F05D-4698-47AB-A8E8-1CA2ACC9948B} = {6461F05D-4698-47AB-A8E8-1CA2ACC9948B} + {BAC615B0-F1AF-418B-8D23-A10FD8870D6A} = {BAC615B0-F1AF-418B-8D23-A10FD8870D6A} {0112CAD5-3584-412A-A2E5-1315A00437B4} = {0112CAD5-3584-412A-A2E5-1315A00437B4} {B83C6BED-11EC-46C8-AFFA-121EEDE94373} = {B83C6BED-11EC-46C8-AFFA-121EEDE94373} {524264F4-DF21-4B79-847F-E7CA643ECD0B} = {524264F4-DF21-4B79-847F-E7CA643ECD0B} @@ -46,6 +47,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bullet2", "..\..\bullet2\ma ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glew", "..\..\glew\make\msvc_7_0\glew_vc7.vcproj", "{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject Global GlobalSection(SolutionConfiguration) = preSolution 3D Plugin Debug = 3D Plugin Debug @@ -54,6 +59,10 @@ Global Blender Release = Blender Release BlenderPlayer Debug = BlenderPlayer Debug BlenderPlayer Release = BlenderPlayer Release + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectDependencies) = postSolution EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {9C71A793-C177-4CAB-8EC5-923D500B39F8}.3D Plugin Debug.ActiveCfg = 3D Plugin Debug|Win32 @@ -68,6 +77,10 @@ Global {9C71A793-C177-4CAB-8EC5-923D500B39F8}.BlenderPlayer Debug.Build.0 = Blender Release|Win32 {9C71A793-C177-4CAB-8EC5-923D500B39F8}.BlenderPlayer Release.ActiveCfg = Blender Release|Win32 {9C71A793-C177-4CAB-8EC5-923D500B39F8}.BlenderPlayer Release.Build.0 = Blender Release|Win32 + {9C71A793-C177-4CAB-8EC5-923D500B39F8}.Debug.ActiveCfg = 3D Plugin Debug|Win32 + {9C71A793-C177-4CAB-8EC5-923D500B39F8}.Debug.Build.0 = 3D Plugin Debug|Win32 + {9C71A793-C177-4CAB-8EC5-923D500B39F8}.Release.ActiveCfg = 3D Plugin Release|Win32 + {9C71A793-C177-4CAB-8EC5-923D500B39F8}.Release.Build.0 = 3D Plugin Release|Win32 {D696C86B-0B53-4471-A50D-5B983A6FA4AD}.3D Plugin Debug.ActiveCfg = 3D Plugin Debug|Win32 {D696C86B-0B53-4471-A50D-5B983A6FA4AD}.3D Plugin Debug.Build.0 = 3D Plugin Debug|Win32 {D696C86B-0B53-4471-A50D-5B983A6FA4AD}.3D Plugin Release.ActiveCfg = 3D Plugin Release|Win32 @@ -80,6 +93,10 @@ Global {D696C86B-0B53-4471-A50D-5B983A6FA4AD}.BlenderPlayer Debug.Build.0 = Blender Release|Win32 {D696C86B-0B53-4471-A50D-5B983A6FA4AD}.BlenderPlayer Release.ActiveCfg = Blender Release|Win32 {D696C86B-0B53-4471-A50D-5B983A6FA4AD}.BlenderPlayer Release.Build.0 = Blender Release|Win32 + {D696C86B-0B53-4471-A50D-5B983A6FA4AD}.Debug.ActiveCfg = 3D Plugin Debug|Win32 + {D696C86B-0B53-4471-A50D-5B983A6FA4AD}.Debug.Build.0 = 3D Plugin Debug|Win32 + {D696C86B-0B53-4471-A50D-5B983A6FA4AD}.Release.ActiveCfg = 3D Plugin Release|Win32 + {D696C86B-0B53-4471-A50D-5B983A6FA4AD}.Release.Build.0 = 3D Plugin Release|Win32 {6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.3D Plugin Debug.ActiveCfg = 3D Plugin Debug|Win32 {6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.3D Plugin Debug.Build.0 = 3D Plugin Debug|Win32 {6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.3D Plugin Release.ActiveCfg = 3D Plugin Release|Win32 @@ -92,6 +109,10 @@ Global {6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.BlenderPlayer Debug.Build.0 = Blender Debug|Win32 {6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.BlenderPlayer Release.ActiveCfg = Blender Debug|Win32 {6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.BlenderPlayer Release.Build.0 = Blender Debug|Win32 + {6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.Debug.ActiveCfg = 3D Plugin Debug|Win32 + {6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.Debug.Build.0 = 3D Plugin Debug|Win32 + {6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.Release.ActiveCfg = 3D Plugin Release|Win32 + {6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.Release.Build.0 = 3D Plugin Release|Win32 {524264F4-DF21-4B79-847F-E7CA643ECD0B}.3D Plugin Debug.ActiveCfg = 3D Plugin Debug|Win32 {524264F4-DF21-4B79-847F-E7CA643ECD0B}.3D Plugin Debug.Build.0 = 3D Plugin Debug|Win32 {524264F4-DF21-4B79-847F-E7CA643ECD0B}.3D Plugin Release.ActiveCfg = 3D Plugin Release|Win32 @@ -104,6 +125,10 @@ Global {524264F4-DF21-4B79-847F-E7CA643ECD0B}.BlenderPlayer Debug.Build.0 = Blender Release|Win32 {524264F4-DF21-4B79-847F-E7CA643ECD0B}.BlenderPlayer Release.ActiveCfg = Blender Release|Win32 {524264F4-DF21-4B79-847F-E7CA643ECD0B}.BlenderPlayer Release.Build.0 = Blender Release|Win32 + {524264F4-DF21-4B79-847F-E7CA643ECD0B}.Debug.ActiveCfg = 3D Plugin Debug|Win32 + {524264F4-DF21-4B79-847F-E7CA643ECD0B}.Debug.Build.0 = 3D Plugin Debug|Win32 + {524264F4-DF21-4B79-847F-E7CA643ECD0B}.Release.ActiveCfg = 3D Plugin Release|Win32 + {524264F4-DF21-4B79-847F-E7CA643ECD0B}.Release.Build.0 = 3D Plugin Release|Win32 {B83C6BED-11EC-46C8-AFFA-121EEDE94373}.3D Plugin Debug.ActiveCfg = 3D Plugin Debug|Win32 {B83C6BED-11EC-46C8-AFFA-121EEDE94373}.3D Plugin Debug.Build.0 = 3D Plugin Debug|Win32 {B83C6BED-11EC-46C8-AFFA-121EEDE94373}.3D Plugin Release.ActiveCfg = 3D Plugin Release|Win32 @@ -116,6 +141,10 @@ Global {B83C6BED-11EC-46C8-AFFA-121EEDE94373}.BlenderPlayer Debug.Build.0 = Blender Debug|Win32 {B83C6BED-11EC-46C8-AFFA-121EEDE94373}.BlenderPlayer Release.ActiveCfg = Blender Debug|Win32 {B83C6BED-11EC-46C8-AFFA-121EEDE94373}.BlenderPlayer Release.Build.0 = Blender Debug|Win32 + {B83C6BED-11EC-46C8-AFFA-121EEDE94373}.Debug.ActiveCfg = 3D Plugin Debug|Win32 + {B83C6BED-11EC-46C8-AFFA-121EEDE94373}.Debug.Build.0 = 3D Plugin Debug|Win32 + {B83C6BED-11EC-46C8-AFFA-121EEDE94373}.Release.ActiveCfg = 3D Plugin Release|Win32 + {B83C6BED-11EC-46C8-AFFA-121EEDE94373}.Release.Build.0 = 3D Plugin Release|Win32 {0112CAD5-3584-412A-A2E5-1315A00437B4}.3D Plugin Debug.ActiveCfg = 3D Plugin Debug|Win32 {0112CAD5-3584-412A-A2E5-1315A00437B4}.3D Plugin Debug.Build.0 = 3D Plugin Debug|Win32 {0112CAD5-3584-412A-A2E5-1315A00437B4}.3D Plugin Release.ActiveCfg = 3D Plugin Release|Win32 @@ -128,6 +157,10 @@ Global {0112CAD5-3584-412A-A2E5-1315A00437B4}.BlenderPlayer Debug.Build.0 = Blender Debug|Win32 {0112CAD5-3584-412A-A2E5-1315A00437B4}.BlenderPlayer Release.ActiveCfg = Blender Debug|Win32 {0112CAD5-3584-412A-A2E5-1315A00437B4}.BlenderPlayer Release.Build.0 = Blender Debug|Win32 + {0112CAD5-3584-412A-A2E5-1315A00437B4}.Debug.ActiveCfg = 3D Plugin Debug|Win32 + {0112CAD5-3584-412A-A2E5-1315A00437B4}.Debug.Build.0 = 3D Plugin Debug|Win32 + {0112CAD5-3584-412A-A2E5-1315A00437B4}.Release.ActiveCfg = 3D Plugin Release|Win32 + {0112CAD5-3584-412A-A2E5-1315A00437B4}.Release.Build.0 = 3D Plugin Release|Win32 {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.3D Plugin Debug.ActiveCfg = 3D Plugin Debug|Win32 {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.3D Plugin Debug.Build.0 = 3D Plugin Debug|Win32 {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.3D Plugin Release.ActiveCfg = 3D Plugin Release|Win32 @@ -140,6 +173,10 @@ Global {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.BlenderPlayer Debug.Build.0 = Blender Release|Win32 {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.BlenderPlayer Release.ActiveCfg = Blender Release|Win32 {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.BlenderPlayer Release.Build.0 = Blender Release|Win32 + {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.Debug.ActiveCfg = 3D Plugin Debug|Win32 + {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.Debug.Build.0 = 3D Plugin Debug|Win32 + {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.Release.ActiveCfg = 3D Plugin Release|Win32 + {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.Release.Build.0 = 3D Plugin Release|Win32 {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.3D Plugin Debug.ActiveCfg = 3D Plugin Debug|Win32 {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.3D Plugin Debug.Build.0 = 3D Plugin Debug|Win32 {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.3D Plugin Release.ActiveCfg = 3D Plugin Release|Win32 @@ -152,6 +189,10 @@ Global {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.BlenderPlayer Debug.Build.0 = Blender Release|Win32 {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.BlenderPlayer Release.ActiveCfg = Blender Release|Win32 {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.BlenderPlayer Release.Build.0 = Blender Release|Win32 + {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.Debug.ActiveCfg = 3D Plugin Debug|Win32 + {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.Debug.Build.0 = 3D Plugin Debug|Win32 + {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.Release.ActiveCfg = 3D Plugin Release|Win32 + {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.Release.Build.0 = 3D Plugin Release|Win32 {FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.3D Plugin Debug.ActiveCfg = 3D Plugin Debug|Win32 {FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.3D Plugin Release.ActiveCfg = 3D Plugin Release|Win32 {FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.Blender Debug.ActiveCfg = Blender Debug|Win32 @@ -160,6 +201,10 @@ Global {FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.Blender Release.Build.0 = Blender Release|Win32 {FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.BlenderPlayer Debug.ActiveCfg = BlenderPlayer Debug|Win32 {FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.BlenderPlayer Release.ActiveCfg = BlenderPlayer Release|Win32 + {FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.Debug.ActiveCfg = BlenderPlayer Debug|Win32 + {FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.Debug.Build.0 = BlenderPlayer Debug|Win32 + {FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.Release.ActiveCfg = BlenderPlayer Release|Win32 + {FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.Release.Build.0 = BlenderPlayer Release|Win32 {FFD3C64A-30E2-4BC7-BC8F-51818C320400}.3D Plugin Debug.ActiveCfg = 3D Plugin Debug|Win32 {FFD3C64A-30E2-4BC7-BC8F-51818C320400}.3D Plugin Debug.Build.0 = 3D Plugin Debug|Win32 {FFD3C64A-30E2-4BC7-BC8F-51818C320400}.3D Plugin Release.ActiveCfg = 3D Plugin Release|Win32 @@ -172,6 +217,26 @@ Global {FFD3C64A-30E2-4BC7-BC8F-51818C320400}.BlenderPlayer Debug.Build.0 = Blender Release|Win32 {FFD3C64A-30E2-4BC7-BC8F-51818C320400}.BlenderPlayer Release.ActiveCfg = Blender Release|Win32 {FFD3C64A-30E2-4BC7-BC8F-51818C320400}.BlenderPlayer Release.Build.0 = Blender Release|Win32 + {FFD3C64A-30E2-4BC7-BC8F-51818C320400}.Debug.ActiveCfg = 3D Plugin Debug|Win32 + {FFD3C64A-30E2-4BC7-BC8F-51818C320400}.Debug.Build.0 = 3D Plugin Debug|Win32 + {FFD3C64A-30E2-4BC7-BC8F-51818C320400}.Release.ActiveCfg = 3D Plugin Release|Win32 + {FFD3C64A-30E2-4BC7-BC8F-51818C320400}.Release.Build.0 = 3D Plugin Release|Win32 + {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.3D Plugin Debug.ActiveCfg = Blender Release|Win32 + {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.3D Plugin Debug.Build.0 = Blender Release|Win32 + {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.3D Plugin Release.ActiveCfg = Blender Release|Win32 + {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.3D Plugin Release.Build.0 = Blender Release|Win32 + {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Blender Debug.ActiveCfg = Blender Debug|Win32 + {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Blender Debug.Build.0 = Blender Debug|Win32 + {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Blender Release.ActiveCfg = Blender Release|Win32 + {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Blender Release.Build.0 = Blender Release|Win32 + {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.BlenderPlayer Debug.ActiveCfg = Blender Release|Win32 + {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.BlenderPlayer Debug.Build.0 = Blender Release|Win32 + {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.BlenderPlayer Release.ActiveCfg = Blender Release|Win32 + {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.BlenderPlayer Release.Build.0 = Blender Release|Win32 + {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Debug.ActiveCfg = Blender Debug|Win32 + {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Debug.Build.0 = Blender Debug|Win32 + {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Release.ActiveCfg = Blender Release|Win32 + {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Release.Build.0 = Blender Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp index ff1bf51bbb5..3003e0b8b14 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cpp +++ b/intern/ghost/intern/GHOST_SystemX11.cpp @@ -488,12 +488,12 @@ GHOST_SystemX11::processEvent(XEvent *xe) data.changed = 1; data.delta = xcme.data.s[8] - data.time; data.time = xcme.data.s[8]; - data.tx = xcme.data.s[2]; - data.ty = xcme.data.s[3]; - data.tz = xcme.data.s[4]; + data.tx = xcme.data.s[2] >> 2; + data.ty = xcme.data.s[3] >> 2; + data.tz = xcme.data.s[4] >> 2; data.rx = xcme.data.s[5]; data.ry = xcme.data.s[6]; - data.rz = xcme.data.s[7]; + data.rz =-xcme.data.s[7]; g_event = new GHOST_EventNDOF(getMilliSeconds(), GHOST_kEventNDOFMotion, window, data); diff --git a/projectfiles_vc7/blender/blender.vcproj b/projectfiles_vc7/blender/blender.vcproj index 2f73bfefd27..6372a2f73f5 100644 --- a/projectfiles_vc7/blender/blender.vcproj +++ b/projectfiles_vc7/blender/blender.vcproj @@ -41,7 +41,7 @@ + + @@ -425,9 +428,6 @@ - - @@ -558,6 +558,9 @@ + + diff --git a/projectfiles_vc7/blender/blenlib/BLI_blenlib.vcproj b/projectfiles_vc7/blender/blenlib/BLI_blenlib.vcproj index 8a2b8b95e38..34c195cf23d 100644 --- a/projectfiles_vc7/blender/blenlib/BLI_blenlib.vcproj +++ b/projectfiles_vc7/blender/blenlib/BLI_blenlib.vcproj @@ -346,6 +346,9 @@ + + @@ -458,6 +461,9 @@ + + diff --git a/projectfiles_vc7/gameengine/blenderhook/KX_blenderhook.vcproj b/projectfiles_vc7/gameengine/blenderhook/KX_blenderhook.vcproj index c54666c08cd..b020d88b2b3 100644 --- a/projectfiles_vc7/gameengine/blenderhook/KX_blenderhook.vcproj +++ b/projectfiles_vc7/gameengine/blenderhook/KX_blenderhook.vcproj @@ -21,7 +21,7 @@ + + + + @@ -396,6 +402,12 @@ + + + + diff --git a/projectfiles_vc7/gameengine/gameplayer/common/GP_common.vcproj b/projectfiles_vc7/gameengine/gameplayer/common/GP_common.vcproj index cba8b1558c9..223a1187347 100644 --- a/projectfiles_vc7/gameengine/gameplayer/common/GP_common.vcproj +++ b/projectfiles_vc7/gameengine/gameplayer/common/GP_common.vcproj @@ -124,7 +124,7 @@ + + @@ -539,6 +542,9 @@ + + diff --git a/projectfiles_vc7/gameengine/rasterizer/RAS_rasterizer.vcproj b/projectfiles_vc7/gameengine/rasterizer/RAS_rasterizer.vcproj index 40a92a5c181..31520b06546 100644 --- a/projectfiles_vc7/gameengine/rasterizer/RAS_rasterizer.vcproj +++ b/projectfiles_vc7/gameengine/rasterizer/RAS_rasterizer.vcproj @@ -21,7 +21,7 @@ - - - - - - diff --git a/release/scripts/ms3d_import.py b/release/scripts/ms3d_import.py index 78ffbb92847..c1438cbfc97 100644 --- a/release/scripts/ms3d_import.py +++ b/release/scripts/ms3d_import.py @@ -50,7 +50,7 @@ def RM(a): cp = cos(a[1]) sr = sin(a[0]) cr = cos(a[0]) - return Matrix([cp*cy, sr*sp*cy+cr*-sy, cr*sp*cy+-sr*-sy],[cp*sy, sr*sp*sy+cr*cy, cr*sp*sy+-sr*cy], [-sp, sr*cp, cr*cp]) + return Matrix([cp*cy, cp*sy, -sp], [sr*sp*cy+cr*-sy, sr*sp*sy+cr*cy, sr*cp],[cr*sp*cy+-sr*-sy, cr*sp*sy+-sr*cy, cr*cp]) # Converts ms3d euler angles to a quaternion @@ -94,7 +94,12 @@ def import_ms3d(path): except IOError: return "Failed to open the file!" - # read id + # get the file size + file.seek(0, os.SEEK_END); + fileSize = file.tell(); + file.seek(0, os.SEEK_SET); + + # read id to check if the file is a MilkShape3D file id = file.read(10) if id!="MS3D000000": return "The file is not a MS3D file!" @@ -123,7 +128,7 @@ def import_ms3d(path): coords.append(struct.unpack("fff", file.read(3*4))) # read bone ids - boneIds.append(struct.unpack("B", file.read(1))[0]) + boneIds.append(struct.unpack("b", file.read(1))[0]) # skip refcount file.read(1) @@ -190,9 +195,10 @@ def import_ms3d(path): triangleIndices = struct.unpack(str(numGroupTriangles) + "H", file.read(2*numGroupTriangles)); # read material - material = struct.unpack("B", file.read(1))[0] - for j in xrange(numGroupTriangles): - mesh.faces[triangleIndices[j]].mat = material + material = struct.unpack("b", file.read(1))[0] + if material>=0: + for j in xrange(numGroupTriangles): + mesh.faces[triangleIndices[j]].mat = material # read the number of materials numMaterials = struct.unpack("H", file.read(2))[0] @@ -224,7 +230,6 @@ def import_ms3d(path): # read shininess shininess = struct.unpack("f", file.read(4))[0] - print "Shininess: " + str(shininess) # read transparency transparency = struct.unpack("f", file.read(4))[0] @@ -272,6 +277,7 @@ def import_ms3d(path): armature.makeEditable() # read joints + joints = [] rotKeys = {} posKeys = {} for i in xrange(numJoints): @@ -280,6 +286,7 @@ def import_ms3d(path): # read name name = uku(file.read(32)) + joints.append(name) # create the bone bone = Blender.Armature.Editbone() @@ -295,11 +302,13 @@ def import_ms3d(path): # read position pos = struct.unpack("fff", file.read(3*4)) - + # set head if bone.hasParent(): - bone.head = bone.parent.matrix * Vector(pos) + bone.parent.head - bone.matrix = bone.parent.matrix * RM(rot) + bone.head = Vector(pos) * bone.parent.matrix + bone.parent.head + tempM = RM(rot) * bone.parent.matrix + tempM.transpose; + bone.matrix = tempM else: bone.head = Vector(pos) bone.matrix = RM(rot) @@ -355,13 +364,111 @@ def import_ms3d(path): # create position keys for key in posKeys[name]: pbone.loc = Vector(key[1]) - pbone.insertKey(armOb, int(key[0]), Blender.Object.Pose.LOC, True) + pbone.insertKey(armOb, int(key[0]+0.5), Blender.Object.Pose.LOC, True) # create rotation keys for key in rotKeys[name]: pbone.quat = RQ(key[1]) - pbone.insertKey(armOb, int(key[0]), Blender.Object.Pose.ROT, True) + pbone.insertKey(armOb, int(key[0]+0.5), Blender.Object.Pose.ROT, True) + + # The old format ends here. If there is more data then the file is newer version + + # check to see if there are any comments + if file.tell()0: + print "Group comment: " + file.read(size) + + # Material comments + numComments = struct.unpack("i", file.read(4))[0] + for i in range(numComments): + file.read(4) # index + size = struct.unpack("i", file.read(4))[0] # comment size + if size>0: + print "Material comment: " + file.read(size) + + # Joint comments + numComments = struct.unpack("i", file.read(4))[0] + for i in range(numComments): + file.read(4) # index + size = struct.unpack("i", file.read(4))[0] # comment size + if size>0: + print "Joint comment: " + file.read(size) + + # Model comments + numComments = struct.unpack("i", file.read(4))[0] + for i in range(numComments): + file.read(4) # index + size = struct.unpack("i", file.read(4))[0] # comment size + if size>0: + print "Model comment: " + file.read(size) + + # Unknown version give a warning + else: + print "Warning: Unknown version!" + + + # check to see if there is any extra vertex data + if file.tell()=0 or ids[1]>=0 or ids[2]>=0: + mesh.assignVertsToGroup(joints[boneIds[i]], [i], 0.01*weights[0], 1) + if ids[0]>=0: + mesh.assignVertsToGroup(joints[ids[0]], [i], 0.01*weights[1], 1) + if ids[1]>=0: + mesh.assignVertsToGroup(joints[ids[1]], [i], 0.01*weights[2], 1) + if ids[2]>=0: + mesh.assignVertsToGroup(joints[ids[2]], [i], 0.01*(100-(weights[0]+weights[1]+weights[2])), 1) + + elif subVersion==1: + # read extra data for each vertex + for i in xrange(numVertices): + # bone ids + ids = struct.unpack("bbb", file.read(3)) + # weights + weights = struct.unpack("BBB", file.read(3)) + # add extra vertices with weights to deform groups + if ids[0]>=0 or ids[1]>=0 or ids[2]>=0: + mesh.assignVertsToGroup(joints[boneIds[i]], [i], 0.01*weights[0], 1) + if ids[0]>=0: + mesh.assignVertsToGroup(joints[ids[0]], [i], 0.01*weights[1], 1) + if ids[1]>=0: + mesh.assignVertsToGroup(joints[ids[1]], [i], 0.01*weights[2], 1) + if ids[2]>=0: + mesh.assignVertsToGroup(joints[ids[2]], [i], 0.01*(100-(weights[0]+weights[1]+weights[2])), 1) + + # non supported subversion give a warning + else: + print "Warning: Unknown subversion!" + # rest of the extra data in the file is not imported/used + + # refresh the view Blender.Redraw() # close the file @@ -378,4 +485,3 @@ def fileCallback(filename): Blender.Draw.PupMenu("An error occured during import: " + error + "|Not all data might have been imported succesfully.", 2) Blender.Window.FileSelector(fileCallback, 'Import') - diff --git a/release/scripts/vrml97_export.py b/release/scripts/vrml97_export.py index eb3be80c99c..b28c7f5bbdc 100644 --- a/release/scripts/vrml97_export.py +++ b/release/scripts/vrml97_export.py @@ -3,9 +3,6 @@ Name: 'VRML97 (.wrl)...' Blender: 241 Group: 'Export' -Submenu: 'All Objects...' all -Submenu: 'All Objects compressed...' comp -Submenu: 'Selected Objects...' selected Tooltip: 'Export to VRML97 file (.wrl)' """ @@ -55,7 +52,7 @@ want to export only selected or all relevant objects. import Blender from Blender import Object, Mesh, Lamp, Draw, BGL, \ - Image, Text, sys, Mathutils + Image, Text, sys, Mathutils, Registry from Blender.Scene import Render import math @@ -70,8 +67,9 @@ worldmat = Blender.Texture.Get() filename = Blender.Get('filename') _safeOverwrite = True extension = '' -ARG='' +# Matrices below are used only when export_rotate_z_to_y.val: +# # Blender is Z up, VRML is Y up, both are right hand coordinate # systems, so to go from Blender coords to VRML coords we rotate # by 90 degrees around the X axis. In matrix notation, we have a @@ -456,6 +454,8 @@ class VRML2Export: if mat: if (mat.mode & Blender.Material.Modes['VCOL_PAINT']): self.vcolors = 1 + else: + self.vcolors = 0 # check if object is wireframe only if ob.drawType == Blender.Object.DrawTypes.WIRE: @@ -633,8 +633,9 @@ class VRML2Export: meshVertexList = me.verts for vertex in meshVertexList: - blenvert = Mathutils.Vector(vertex.co) - vrmlvert = M_blen2vrml * blenvert + vrmlvert = blenvert = Mathutils.Vector(vertex.co) + if export_rotate_z_to_y.val: + vrmlvert = M_blen2vrml * vrmlvert self.writeUnindented("%s %s %s\n " % \ (vrmlvert[0], \ vrmlvert[1], \ @@ -730,8 +731,8 @@ class VRML2Export: round(uv[1], self.tp)) j=j+1 indexStr += "-1" - texIndexList.append(indexStr) - texCoordList.append(coordStr) + texIndexList.append(indexStr) + texCoordList.append(coordStr) self.writeIndented("texCoord TextureCoordinate {\n", 1) self.writeIndented("point [\n", 1) @@ -1016,7 +1017,10 @@ class VRML2Export: return ob_matrix = Mathutils.Matrix(ob.getMatrix('worldspace')) - matrix = M_blen2vrml * ob_matrix * M_vrml2blen + if export_rotate_z_to_y.val: + matrix = M_blen2vrml * ob_matrix * M_vrml2blen + else: + matrix = ob_matrix e = matrix.rotationPart().toEuler() v = matrix.translationPart() @@ -1089,7 +1093,7 @@ class VRML2Export: self.writeFog() self.proto = 0 allObj = [] - if ARG == 'selected': + if export_selection_only.val: allObj = list(scene.objects.context) else: allObj = list(scene.objects) @@ -1098,7 +1102,7 @@ class VRML2Export: for thisObj in allObj: self.writeObject(thisObj) - if ARG != 'selected': + if not export_selection_only.val: self.writeScript() self.cleanup() @@ -1213,26 +1217,54 @@ def select_file(filename): wrlexport=VRML2Export(filename) wrlexport.export(scene, world, worldmat) +######################################################### +# UI and Registry utilities +######################################################### + +export_selection_only = Draw.Create(0) +export_rotate_z_to_y = Draw.Create(1) +export_compressed = Draw.Create(0) + +def save_to_registry(): + d = {} + d['selection_only'] = export_selection_only.val + d['rotate_z_to_y'] = export_rotate_z_to_y.val + d['compressed'] = export_compressed.val + Registry.SetKey('vrml97_export', d, True) + +def load_from_registry(): + d = Registry.GetKey('vrml97_export', True) + if d: + try: + export_selection_only.val = d['selection_only'] + export_rotate_z_to_y.val = d['rotate_z_to_y'] + export_compressed.val = d['compressed'] + except: save_to_registry() # If data is not valid, rewrite it. + +def show_popup(): + pup_block = [ + ('Selection Only', export_selection_only, 'Only export objects in visible selection. Else export whole scene.'), + ('Rotate +Z to +Y', export_rotate_z_to_y, 'Rotate such that +Z axis (Blender up) becomes +Y (VRML up).'), + ('Compress', export_compressed, 'Generate a .wrz file (normal VRML compressed by gzip).') + ] + return Draw.PupBlock('Export VRML 97...', pup_block) ######################################################### # main routine ######################################################### -try: - ARG = __script__['arg'] # user selected argument -except: - print "older version" +load_from_registry() -if Blender.Get('version') < 235: - print "Warning: VRML97 export failed, wrong blender version!" - print " You aren't running blender version 2.35 or greater" - print " download a newer version from http://blender3d.org/" -else: - if ARG == 'comp': +# Note that show_popup must be done before Blender.Window.FileSelector, +# because export_compressed affects the suggested extension of resulting +# file. + +if show_popup(): + save_to_registry() + if export_compressed.val: extension=".wrz" from gzip import * else: extension=".wrl" Blender.Window.FileSelector(select_file, "Export VRML97", \ sys.makename(ext=extension)) - diff --git a/source/Makefile b/source/Makefile index 5ebff3bbbf5..d06962cbe3f 100644 --- a/source/Makefile +++ b/source/Makefile @@ -157,6 +157,7 @@ COMLIB += $(NAN_BMFONT)/lib/$(DEBUG_DIR)libbmfont.a COMLIB += $(NAN_PNG)/lib/libpng.a COMLIB += $(OCGDIR)/blender/yafray/$(DEBUG_DIR)libyafrayexport.a COMLIB += $(OCGDIR)/blender/blenlib/$(DEBUG_DIR)libblenlib.a +COMLIB += $(NAN_GLEW)/lib/libglew.a ifeq ($(WITH_QUICKTIME), true) COMLIB += $(OCGDIR)/blender/blenderqt/$(DEBUG_DIR)libblenderqt.a diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h index b5e34444d13..716eac81b55 100644 --- a/source/blender/blenkernel/BKE_action.h +++ b/source/blender/blenkernel/BKE_action.h @@ -44,6 +44,7 @@ struct bActionChannel; struct bPose; struct bPoseChannel; struct Object; +struct ID; /* Kernel prototypes */ #ifdef __cplusplus @@ -157,6 +158,10 @@ void rest_pose(struct bPose *pose); float get_action_frame(struct Object *ob, float cframe); /* map strip time to global time (frame nr) */ float get_action_frame_inv(struct Object *ob, float cframe); +/* builds a list of NlaIpoChannel with ipo values to write in datablock */ +void extract_ipochannels_from_action(ListBase *lb, struct ID *id, struct bAction *act, char *name, float ctime); +/* write values returned by extract_ipochannels_from_action, returns the number of value written */ +int execute_ipochannels(ListBase *lb); #ifdef __cplusplus }; diff --git a/source/blender/blenkernel/BKE_key.h b/source/blender/blenkernel/BKE_key.h index a6871aa837f..faf8692b89a 100644 --- a/source/blender/blenkernel/BKE_key.h +++ b/source/blender/blenkernel/BKE_key.h @@ -40,6 +40,11 @@ struct Object; struct Lattice; struct Mesh; +/* Kernel prototypes */ +#ifdef __cplusplus +extern "C" { +#endif + void free_key(struct Key *sc); struct Key *add_key(struct ID *id); struct Key *copy_key(struct Key *key); @@ -57,6 +62,12 @@ int do_ob_key(struct Object *ob); struct Key *ob_get_key(struct Object *ob); struct KeyBlock *ob_get_keyblock(struct Object *ob); struct KeyBlock *key_get_keyblock(struct Key *key, int index); +// needed for the GE +void do_rel_key(int start, int end, int tot, char *basispoin, struct Key *key, int mode); + +#ifdef __cplusplus +}; +#endif #endif diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h index c50f5498de9..2bd528ab8c8 100644 --- a/source/blender/blenkernel/BKE_scene.h +++ b/source/blender/blenkernel/BKE_scene.h @@ -53,7 +53,7 @@ struct RenderData; } /* note; doesn't work when scene is empty */ -#define SETLOOPER(s, b) sce= s, b= sce->base.first; b; b= (b->next?b->next:sce->set?(sce=sce->set)->base.first:NULL) +#define SETLOOPER(s, b) sce= s, b= (Base*)sce->base.first; b; b= (Base*)(b->next?b->next:sce->set?(sce=sce->set)->base.first:NULL) void free_avicodecdata(struct AviCodecData *acd); diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 5fb3d6f869a..05f2e69fce1 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -290,6 +290,12 @@ void copy_pose(bPose **dst, bPose *src, int copycon) return; } + if (*dst==src) { + printf("copy_pose source and target are the same\n"); + *dst=NULL; + return; + } + outPose= MEM_callocN(sizeof(bPose), "pose"); duplicatelist(&outPose->chanbase, &src->chanbase); @@ -740,6 +746,11 @@ void extract_pose_from_pose(bPose *pose, const bPose *src) const bPoseChannel *schan; bPoseChannel *pchan= pose->chanbase.first; + if (pose==src) { + printf("extract_pose_from_pose source and target are the same\n"); + return; + } + for (schan=src->chanbase.first; schan; schan=schan->next, pchan= pchan->next) { copy_pose_channel_data(pchan, schan); } @@ -817,6 +828,12 @@ void copy_pose_result(bPose *to, bPose *from) return; } + if (to==from) { + printf("copy_pose_result source and target are the same\n"); + return; + } + + for(pchanfrom= from->chanbase.first; pchanfrom; pchanfrom= pchanfrom->next) { pchanto= get_pose_channel(to, pchanfrom->name); if(pchanto) { @@ -843,7 +860,7 @@ typedef struct NlaIpoChannel { int type; } NlaIpoChannel; -static void extract_ipochannels_from_action(ListBase *lb, ID *id, bAction *act, char *name, float ctime) +void extract_ipochannels_from_action(ListBase *lb, ID *id, bAction *act, char *name, float ctime) { bActionChannel *achan= get_action_channel(act, name); IpoCurve *icu; @@ -936,15 +953,18 @@ static void blend_ipochannels(ListBase *dst, ListBase *src, float srcweight, int } } -static void execute_ipochannels(ListBase *lb) +int execute_ipochannels(ListBase *lb) { NlaIpoChannel *nic; + int count = 0; for(nic= lb->first; nic; nic= nic->next) { if(nic->poin) { write_ipo_poin(nic->poin, nic->type, nic->val); + count++; } } + return count; } /* nla timing */ diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index eca10e5b079..fb7d59c137a 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -1709,13 +1709,13 @@ static void execute_posetree(Object *ob, PoseTree *tree) if (tree->totchannel == 0) return; - + iktree= MEM_mallocN(sizeof(void*)*tree->totchannel, "ik tree"); for(a=0; atotchannel; a++) { pchan= tree->pchan[a]; bone= pchan->bone; - + /* set DoF flag */ flag= 0; if(!(pchan->ikflag & BONE_IK_NO_XDOF) && !(pchan->ikflag & BONE_IK_NO_XDOF_TEMP)) @@ -1724,32 +1724,32 @@ static void execute_posetree(Object *ob, PoseTree *tree) flag |= IK_YDOF; if(!(pchan->ikflag & BONE_IK_NO_ZDOF) && !(pchan->ikflag & BONE_IK_NO_ZDOF_TEMP)) flag |= IK_ZDOF; - + if(tree->stretch && (pchan->ikstretch > 0.0)) { flag |= IK_TRANS_YDOF; hasstretch = 1; } - + seg= iktree[a]= IK_CreateSegment(flag); - + /* find parent */ if(a == 0) parent= NULL; else parent= iktree[tree->parent[a]]; - + IK_SetParent(seg, parent); - + /* get the matrix that transforms from prevbone into this bone */ Mat3CpyMat4(R_bonemat, pchan->pose_mat); - + /* gather transformations for this IK segment */ - + if (pchan->parent) Mat3CpyMat4(R_parmat, pchan->parent->pose_mat); else Mat3One(R_parmat); - + /* bone offset */ if (pchan->parent && (a > 0)) VecSubf(start, pchan->pose_head, pchan->parent->pose_tail); @@ -1759,37 +1759,37 @@ static void execute_posetree(Object *ob, PoseTree *tree) /* change length based on bone size */ length= bone->length*VecLength(R_bonemat[1]); - + /* compute rest basis and its inverse */ Mat3CpyMat3(rest_basis, bone->bone_mat); Mat3CpyMat3(irest_basis, bone->bone_mat); Mat3Transp(irest_basis); - + /* compute basis with rest_basis removed */ Mat3Inv(iR_parmat, R_parmat); Mat3MulMat3(full_basis, iR_parmat, R_bonemat); Mat3MulMat3(basis, irest_basis, full_basis); - + /* basis must be pure rotation */ Mat3Ortho(basis); - + /* transform offset into local bone space */ Mat3Ortho(iR_parmat); Mat3MulVecfl(iR_parmat, start); - + IK_SetTransform(seg, start, rest_basis, basis, length); - + if (pchan->ikflag & BONE_IK_XLIMIT) IK_SetLimit(seg, IK_X, pchan->limitmin[0], pchan->limitmax[0]); if (pchan->ikflag & BONE_IK_YLIMIT) IK_SetLimit(seg, IK_Y, pchan->limitmin[1], pchan->limitmax[1]); if (pchan->ikflag & BONE_IK_ZLIMIT) IK_SetLimit(seg, IK_Z, pchan->limitmin[2], pchan->limitmax[2]); - + IK_SetStiffness(seg, IK_X, pchan->stiffness[0]); IK_SetStiffness(seg, IK_Y, pchan->stiffness[1]); IK_SetStiffness(seg, IK_Z, pchan->stiffness[2]); - + if(tree->stretch && (pchan->ikstretch > 0.0)) { float ikstretch = pchan->ikstretch*pchan->ikstretch; IK_SetStiffness(seg, IK_TRANS_Y, MIN2(1.0-ikstretch, 0.99)); @@ -1818,7 +1818,7 @@ static void execute_posetree(Object *ob, PoseTree *tree) for (target=tree->targets.first; target; target=target->next) { float polepos[3]; int poleconstrain= 0; - + data= (bKinematicConstraint*)target->con->data; /* 1.0=ctime, we pass on object for auto-ik (owner-type here is object, even though @@ -1835,7 +1835,7 @@ static void execute_posetree(Object *ob, PoseTree *tree) /* same for pole vector target */ if(data->poletar) { get_constraint_target_matrix(target->con, 1, CONSTRAINT_OBTYPE_OBJECT, ob, rootmat, 1.0); - + if(data->flag & CONSTRAINT_IK_SETANGLE) { /* don't solve IK when we are setting the pole angle */ break; @@ -1844,7 +1844,7 @@ static void execute_posetree(Object *ob, PoseTree *tree) Mat4MulMat4(goal, rootmat, goalinv); VECCOPY(polepos, goal[3]); poleconstrain= 1; - + if(data->flag & CONSTRAINT_IK_GETANGLE) { poleangledata= data; data->flag &= ~CONSTRAINT_IK_GETANGLE; @@ -1903,36 +1903,35 @@ static void execute_posetree(Object *ob, PoseTree *tree) tree->basis_change= MEM_mallocN(sizeof(float[3][3])*tree->totchannel, "ik basis change"); if(hasstretch) ikstretch= MEM_mallocN(sizeof(float)*tree->totchannel, "ik stretch"); - + for(a=0; atotchannel; a++) { IK_GetBasisChange(iktree[a], tree->basis_change[a]); - + if(hasstretch) { /* have to compensate for scaling received from parent */ float parentstretch, stretch; - + pchan= tree->pchan[a]; parentstretch= (tree->parent[a] >= 0)? ikstretch[tree->parent[a]]: 1.0; - + if(tree->stretch && (pchan->ikstretch > 0.0)) { float trans[3], length; - + IK_GetTranslationChange(iktree[a], trans); length= pchan->bone->length*VecLength(pchan->pose_mat[1]); - + ikstretch[a]= (length == 0.0)? 1.0: (trans[1]+length)/length; } else ikstretch[a] = 1.0; - + stretch= (parentstretch == 0.0)? 1.0: ikstretch[a]/parentstretch; - + VecMulf(tree->basis_change[a][0], stretch); VecMulf(tree->basis_change[a][1], stretch); VecMulf(tree->basis_change[a][2], stretch); - } - + IK_FreeSegment(iktree[a]); } diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c index 3b4e562a87a..dd6c7ddacd2 100644 --- a/source/blender/blenkernel/intern/key.c +++ b/source/blender/blenkernel/intern/key.c @@ -630,7 +630,7 @@ void cp_cu_key(Curve *cu, KeyBlock *kb, int start, int end) } -static void do_rel_key(int start, int end, int tot, char *basispoin, Key *key, int mode) +void do_rel_key(int start, int end, int tot, char *basispoin, Key *key, int mode) { KeyBlock *kb; int *ofsp, ofs[3], elemsize, b; diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index dfd76a9c9d4..e64064d01c2 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -40,6 +40,7 @@ #include "stdarg.h" #include "math.h" #include "float.h" +#include "ctype.h" #include "BLI_arithb.h" #include "BLI_blenlib.h" @@ -1270,7 +1271,7 @@ static void mirrorModifier_initData(ModifierData *md) { MirrorModifierData *mmd = (MirrorModifierData*) md; - mmd->flag |= MOD_MIR_AXIS_X; + mmd->flag |= (MOD_MIR_AXIS_X | MOD_MIR_VGROUP); mmd->tolerance = 0.001; mmd->mirror_ob = NULL; } @@ -1309,6 +1310,118 @@ static void mirrorModifier_updateDepgraph(ModifierData *md, DagForest *forest, } } +/* finds the best possible flipped name. For renaming; check for unique names afterwards */ +/* if strip_number: removes number extensions */ +void vertgroup_flip_name (char *name, int strip_number) +{ + int len; + char prefix[128]={""}; /* The part before the facing */ + char suffix[128]={""}; /* The part after the facing */ + char replace[128]={""}; /* The replacement string */ + char number[128]={""}; /* The number extension string */ + char *index=NULL; + + len= strlen(name); + if(len<3) return; // we don't do names like .R or .L + + /* We first check the case with a .### extension, let's find the last period */ + if(isdigit(name[len-1])) { + index= strrchr(name, '.'); // last occurrance + if (index && isdigit(index[1]) ) { // doesnt handle case bone.1abc2 correct..., whatever! + if(strip_number==0) + strcpy(number, index); + *index= 0; + len= strlen(name); + } + } + + strcpy (prefix, name); + +#define IS_SEPARATOR(a) ((a)=='.' || (a)==' ' || (a)=='-' || (a)=='_') + + /* first case; separator . - _ with extensions r R l L */ + if( IS_SEPARATOR(name[len-2]) ) { + switch(name[len-1]) { + case 'l': + prefix[len-1]= 0; + strcpy(replace, "r"); + break; + case 'r': + prefix[len-1]= 0; + strcpy(replace, "l"); + break; + case 'L': + prefix[len-1]= 0; + strcpy(replace, "R"); + break; + case 'R': + prefix[len-1]= 0; + strcpy(replace, "L"); + break; + } + } + /* case; beginning with r R l L , with separator after it */ + else if( IS_SEPARATOR(name[1]) ) { + switch(name[0]) { + case 'l': + strcpy(replace, "r"); + strcpy(suffix, name+1); + prefix[0]= 0; + break; + case 'r': + strcpy(replace, "l"); + strcpy(suffix, name+1); + prefix[0]= 0; + break; + case 'L': + strcpy(replace, "R"); + strcpy(suffix, name+1); + prefix[0]= 0; + break; + case 'R': + strcpy(replace, "L"); + strcpy(suffix, name+1); + prefix[0]= 0; + break; + } + } + else if(len > 5) { + /* hrms, why test for a separator? lets do the rule 'ultimate left or right' */ + index = BLI_strcasestr(prefix, "right"); + if (index==prefix || index==prefix+len-5) { + if(index[0]=='r') + strcpy (replace, "left"); + else { + if(index[1]=='I') + strcpy (replace, "LEFT"); + else + strcpy (replace, "Left"); + } + *index= 0; + strcpy (suffix, index+5); + } + else { + index = BLI_strcasestr(prefix, "left"); + if (index==prefix || index==prefix+len-4) { + if(index[0]=='l') + strcpy (replace, "right"); + else { + if(index[1]=='E') + strcpy (replace, "RIGHT"); + else + strcpy (replace, "Right"); + } + *index= 0; + strcpy (suffix, index+4); + } + } + } + +#undef IS_SEPARATOR + + sprintf (name, "%s%s%s%s", prefix, replace, suffix, number); +} + static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd, Object *ob, DerivedMesh *dm, @@ -1322,6 +1435,9 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd, int maxVerts = dm->getNumVerts(dm); int maxEdges = dm->getNumEdges(dm); int maxFaces = dm->getNumFaces(dm); + int vector_size, j, a, b; + bDeformGroup *def, *defb; + bDeformGroup **vector_def = NULL; int (*indexMap)[2]; float mtx[4][4], imtx[4][4]; @@ -1331,6 +1447,21 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd, result = CDDM_from_template(dm, maxVerts * 2, maxEdges * 2, maxFaces * 2); + + if (mmd->flag & MOD_MIR_VGROUP) { + /* calculate the number of deformedGroups */ + for(vector_size = 0, def = ob->defbase.first; def; + def = def->next, vector_size++); + + /* load the deformedGroups for fast access */ + vector_def = + (bDeformGroup **)MEM_mallocN(sizeof(bDeformGroup*) * vector_size, + "group_index"); + for(a = 0, def = ob->defbase.first; def; def = def->next, a++) { + vector_def[a] = def; + } + } + if (mmd->mirror_ob) { float obinv[4][4]; @@ -1375,16 +1506,48 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd, mv->flag |= ME_VERT_MERGED; } else { MVert *mv2 = CDDM_get_vert(result, numVerts); + MDeformVert *dvert = NULL; DM_copy_vert_data(dm, result, i, numVerts, 1); *mv2 = *mv; - numVerts++; co[axis] = -co[axis]; if (mmd->mirror_ob) { VecMat4MulVecfl(co, imtx, co); } VecCopyf(mv2->co, co); + + if (mmd->flag & MOD_MIR_VGROUP){ + dvert = DM_get_vert_data(result, numVerts, CD_MDEFORMVERT); + + if (dvert) + { + for(j = 0; j < dvert[0].totweight; ++j) + { + char tmpname[32]; + + if(dvert->dw[j].def_nr < 0 || + dvert->dw[j].def_nr >= vector_size) + continue; + + def = vector_def[dvert->dw[j].def_nr]; + strcpy(tmpname, def->name); + vertgroup_flip_name(tmpname,0); + + for(b = 0, defb = ob->defbase.first; defb; + defb = defb->next, b++) + { + if(!strcmp(defb->name, tmpname)) + { + dvert->dw[j].def_nr = b; + break; + } + } + } + } + } + + numVerts++; } } @@ -1468,6 +1631,8 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd, } } + if (vector_def) MEM_freeN(vector_def); + MEM_freeN(indexMap); CDDM_lower_num_verts(result, numVerts); @@ -4361,13 +4526,13 @@ static void castModifier_deformVertsEM( /* Wave */ -static void waveModifier_initData(ModifierData *md) +static void waveModifier_initData(ModifierData *md) { WaveModifierData *wmd = (WaveModifierData*) md; // whadya know, moved here from Iraq - + wmd->flag |= (MOD_WAVE_X | MOD_WAVE_Y | MOD_WAVE_CYCL | MOD_WAVE_NORM_X | MOD_WAVE_NORM_Y | MOD_WAVE_NORM_Z); - + wmd->objectcenter = NULL; wmd->texture = NULL; wmd->map_object = NULL; @@ -4377,6 +4542,7 @@ static void waveModifier_initData(ModifierData *md) wmd->narrow= 1.5f; wmd->lifetime= 0.0f; wmd->damp= 10.0f; + wmd->falloff= 0.0f; wmd->texmapping = MOD_WAV_MAP_LOCAL; wmd->defgrp_name[0] = 0; } @@ -4396,6 +4562,7 @@ static void waveModifier_copyData(ModifierData *md, ModifierData *target) twmd->starty = wmd->starty; twmd->timeoffs = wmd->timeoffs; twmd->width = wmd->width; + twmd->falloff = wmd->falloff; twmd->objectcenter = wmd->objectcenter; twmd->texture = wmd->texture; twmd->map_object = wmd->map_object; @@ -4606,7 +4773,7 @@ static void waveModifier_do( if(x > wmd->lifetime) { lifefac = x - wmd->lifetime; - + if(lifefac > wmd->damp) lifefac = 0.0; else lifefac = (float)(wmd->height * (1.0 - sqrt(lifefac / wmd->damp))); @@ -4627,6 +4794,8 @@ static void waveModifier_do( float x = co[0] - wmd->startx; float y = co[1] - wmd->starty; float amplit= 0.0f; + float dist = 0.0f; + float falloff_fac = 0.0f; TexResult texres; MDeformWeight *def_weight = NULL; @@ -4649,14 +4818,29 @@ static void waveModifier_do( get_texture_value(wmd->texture, tex_co[i], &texres); } + /*get dist*/ + if(wmd->flag & MOD_WAVE_X) { + if(wmd->flag & MOD_WAVE_Y){ + dist = (float)sqrt(x*x + y*y); + } + else{ + dist = fabs(x); + } + } + else if(wmd->flag & MOD_WAVE_Y) { + dist = fabs(y); + } + + falloff_fac = (1.0-(dist / wmd->falloff)); + CLAMP(falloff_fac,0,1); if(wmd->flag & MOD_WAVE_X) { if(wmd->flag & MOD_WAVE_Y) amplit = (float)sqrt(x*x + y*y); else amplit = x; } - else if(wmd->flag & MOD_WAVE_Y) + else if(wmd->flag & MOD_WAVE_Y) amplit= y; - + /* this way it makes nice circles */ amplit -= (ctime - wmd->timeoffs) * wmd->speed; @@ -4669,12 +4853,19 @@ static void waveModifier_do( if(amplit > -wmd->width && amplit < wmd->width) { amplit = amplit * wmd->narrow; amplit = (float)(1.0 / exp(amplit * amplit) - minfac); + + /*apply texture*/ if(wmd->texture) amplit = amplit * texres.tin; + /*apply weight*/ if(def_weight) amplit = amplit * def_weight->weight; + /*apply falloff*/ + if (wmd->falloff > 0) + amplit = amplit * falloff_fac; + if(mvert) { /* move along normals */ if(wmd->flag & MOD_WAVE_NORM_X) { diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 125243bc56f..b72d9a0b044 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1100,6 +1100,8 @@ static void copy_object_pose(Object *obn, Object *ob) { bPoseChannel *chan; + /* note: need to clear obn->pose pointer first, so that copy_pose works (otherwise there's a crash) */ + obn->pose= NULL; copy_pose(&obn->pose, ob->pose, 1); /* 1 = copy constraints */ for (chan = obn->pose->chanbase.first; chan; chan=chan->next){ diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c index 86e395b3770..92544f19721 100644 --- a/source/blender/blenkernel/intern/sca.c +++ b/source/blender/blenkernel/intern/sca.c @@ -411,6 +411,7 @@ void init_actuator(bActuator *act) switch(act->type) { #ifdef __NLA case ACT_ACTION: + case ACT_SHAPEACTION: act->data= MEM_callocN(sizeof(bActionActuator), "actionact"); break; #endif diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index a353015052c..5a85fbfc375 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -905,8 +905,11 @@ void BLI_cleanup_file(const char *relabase, char *dir) if (dir[a] == '\\') break; a--; } - memmove( dir+a, eind, strlen(eind)+1 ); - + if (a<0) { + break; + } else { + memmove( dir+a, eind, strlen(eind)+1 ); + } } while ( (start = strstr(dir,"\\.\\")) ){ @@ -939,7 +942,11 @@ void BLI_cleanup_file(const char *relabase, char *dir) if (dir[a] == '/') break; a--; } - memmove( dir+a, eind, strlen(eind)+1 ); + if (a<0) { + break; + } else { + memmove( dir+a, eind, strlen(eind)+1 ); + } } while ( (start = strstr(dir,"/./")) ){ @@ -1128,8 +1135,8 @@ int BLI_convertstringcode(char *path, const char *basepath) char vol[3] = {'\0', '\0', '\0'}; BLI_strncpy(vol, path, 3); - wasrelative= (strncmp(vol, "//", 2)==0); - + wasrelative= (vol[0]=='/' && vol[1]=='/'); + #ifdef WIN32 /* we are checking here if we have an absolute path that is not in the current blend file as a lib main - we are basically checking for the case that a @@ -1166,7 +1173,7 @@ int BLI_convertstringcode(char *path, const char *basepath) /* Paths starting with // will get the blend file as their base, * this isnt standard in any os but is uesed in blender all over the place */ - if (tmp[0] == '/' && tmp[1] == '/') { + if (wasrelative) { char *lslash= BLI_last_slash(base); if (lslash) { int baselen= (int) (lslash-base) + 1; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 7d0dd9e41c1..fa7cbb06139 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2991,6 +2991,10 @@ static void lib_link_object(FileData *fd, Main *main) bActionActuator *aa= act->data; aa->act= newlibadr(fd, ob->id.lib, aa->act); } + else if(act->type==ACT_SHAPEACTION) { + bActionActuator *aa= act->data; + aa->act= newlibadr(fd, ob->id.lib, aa->act); + } else if(act->type==ACT_PROPERTY) { bPropertyActuator *pa= act->data; pa->ob= newlibadr(fd, ob->id.lib, pa->ob); @@ -8399,6 +8403,10 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob) bActionActuator *aa= act->data; expand_doit(fd, mainvar, aa->act); } + else if(act->type==ACT_SHAPEACTION) { + bActionActuator *aa= act->data; + expand_doit(fd, mainvar, aa->act); + } else if(act->type==ACT_PROPERTY) { bPropertyActuator *pa= act->data; expand_doit(fd, mainvar, pa->ob); diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index b4a9f225470..2595b95bbf0 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -664,6 +664,7 @@ static void write_actuators(WriteData *wd, ListBase *lb) switch(act->type) { case ACT_ACTION: + case ACT_SHAPEACTION: writestruct(wd, DATA, "bActionActuator", 1, act->data); break; case ACT_SOUND: diff --git a/source/blender/imbuf/intern/cineon/dpxlib.c b/source/blender/imbuf/intern/cineon/dpxlib.c index a81e632a797..500c09ba265 100644 --- a/source/blender/imbuf/intern/cineon/dpxlib.c +++ b/source/blender/imbuf/intern/cineon/dpxlib.c @@ -441,10 +441,15 @@ intern_dpxOpen(int mode, const char* bytestuff, int bufsize) { default: break; } } - dpx->bitsPerPixel = 10; - /* dpx->bitsPerPixel = header.imageInfo.channel[0].bits_per_pixel; */ - dpx->imageOffset = ntohl(header.fileInfo.offset); + /* dpx->bitsPerPixel = 10; */ + dpx->bitsPerPixel = header.imageInfo.channel[0].bits_per_pixel; + if (dpx->bitsPerPixel != 10) { + if (verbose) d_printf("Don't support depth: %d\n", dpx->bitsPerPixel); + dpxClose(dpx); + return 0; + } + dpx->imageOffset = ntohl(header.fileInfo.offset); dpx->lineBufferLength = pixelsToLongs(dpx->width * dpx->depth); dpx->lineBuffer = malloc(dpx->lineBufferLength * 4); if (dpx->lineBuffer == 0) { @@ -471,6 +476,26 @@ intern_dpxOpen(int mode, const char* bytestuff, int bufsize) { dpx->fileYPos = 0; logImageGetByteConversionDefaults(&dpx->params); + /* The SMPTE define this code: + * 2 - Linear + * 3 - Logarithmic + * + * Note that transfer_characteristics is U8, don't need + * check the byte order. + */ + switch (header.imageInfo.channel[0].transfer_characteristics) { + case 2: + dpx->params.doLogarithm= 0; + break; + case 3: + dpx->params.doLogarithm= 1; + break; + default: + if (verbose) d_printf("Un-supported Transfer Characteristics: %d\n", header.imageInfo.channel[0].transfer_characteristics); + dpxClose(dpx); + return 0; + break; + } setupLut(dpx); dpx->getRow = &dpxGetRowBytes; @@ -563,6 +588,18 @@ dpxCreate(const char* filename, int width, int height, int depth) { ++shortFilename; } initDpxMainHeader(dpx, &header, shortFilename); + logImageGetByteConversionDefaults(&dpx->params); + /* Need set the file type before write the header! + * 2 - Linear + * 3 - Logarithmic + * + * Note that transfer characteristics is U8, don't need + * check the byte order. + */ + if (dpx->params.doLogarithm == 0) + header.imageInfo.channel[0].transfer_characteristics= 2; + else + header.imageInfo.channel[0].transfer_characteristics= 3; if (fwrite(&header, sizeof(header), 1, dpx->file) == 0) { if (verbose) d_printf("Couldn't write image header\n"); @@ -570,8 +607,6 @@ dpxCreate(const char* filename, int width, int height, int depth) { return 0; } dpx->fileYPos = 0; - - logImageGetByteConversionDefaults(&dpx->params); setupLut(dpx); dpx->getRow = 0; diff --git a/source/blender/include/BDR_editcurve.h b/source/blender/include/BDR_editcurve.h index 4604359fcc9..363a6567f3e 100644 --- a/source/blender/include/BDR_editcurve.h +++ b/source/blender/include/BDR_editcurve.h @@ -99,6 +99,7 @@ int bezt_compare (const void *e1, const void *e2); void setweightNurb( void ); void setradiusNurb( void ); void smoothradiusNurb( void ); +void smoothNurb( void ); extern void undo_push_curve(char *name); diff --git a/source/blender/include/BIF_oops.h b/source/blender/include/BIF_oops.h index f6984a23f47..adeac4f3871 100644 --- a/source/blender/include/BIF_oops.h +++ b/source/blender/include/BIF_oops.h @@ -39,6 +39,10 @@ struct Mesh; struct MetaBall; struct Object; struct Lamp; +struct Camera; +struct Texture; +struct Lattice; +struct bArmature; void add_curve_oopslinks(struct Curve *cu, struct Oops *oops, short flag); void add_from_link(struct Oops *from, struct Oops *oops); void add_material_oopslinks(struct Material *ma, struct Oops *oops, short flag); @@ -46,6 +50,9 @@ void add_mball_oopslinks(struct MetaBall *mb, struct Oops *oops, short flag); void add_mesh_oopslinks(struct Mesh *me, struct Oops *oops, short flag); void add_object_oopslinks(struct Object *ob, struct Oops *oops, short flag); void add_lamp_oopslinks(struct Lamp *la, struct Oops *oops, short flag); +void add_camera_oopslinks(struct Camera *ca, struct Oops *oops, short flag); +void add_texture_oopslinks(struct Tex *tex, struct Oops *oops, short flag); +void add_lattice_oopslinks(struct Lattice *lt, struct Oops *oops, short flag); struct Oops *add_oops(void *id); struct OopsLink *add_oopslink(char *name, struct Oops *oops, short type, void *from, float xof, float yof); struct Oops *add_test_oops(void *id); /* incl links */ @@ -66,3 +73,4 @@ void test_oopslinko(struct OopsLink *ol); #endif + diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h index e34b376737a..a326f5b01d6 100644 --- a/source/blender/makesdna/DNA_actuator_types.h +++ b/source/blender/makesdna/DNA_actuator_types.h @@ -278,6 +278,7 @@ typedef struct FreeCamera { #define ACT_VISIBILITY 18 #define ACT_2DFILTER 19 #define ACT_PARENT 20 +#define ACT_SHAPEACTION 21 /* actuator flag */ #define ACT_SHOW 1 diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index a0a41377a24..c960a78aefa 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -177,6 +177,7 @@ typedef struct MirrorModifierData { #define MOD_MIR_AXIS_X 1<<3 #define MOD_MIR_AXIS_Y 1<<4 #define MOD_MIR_AXIS_Z 1<<5 +#define MOD_MIR_VGROUP 1<<6 typedef struct EdgeSplitModifierData { ModifierData modifier; @@ -329,13 +330,14 @@ typedef struct WaveModifierData { short flag, pad; float startx, starty, height, width; - float narrow, speed, damp; + float narrow, speed, damp, falloff; int texmapping, uvlayer_tmp; char uvlayer_name[32]; - + float timeoffs, lifetime; + float pad1; } WaveModifierData; typedef struct ArmatureModifierData { diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 619dfbb43a0..af60f9ca713 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -559,6 +559,7 @@ typedef struct SpaceImaSel { #define OOPS_IM 4096 #define OOPS_AR 8192 #define OOPS_GR 16384 +#define OOPS_CA 32768 /* SpaceOops->outlinevis */ #define SO_ALL_SCENES 0 diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_math.c b/source/blender/nodes/intern/CMP_nodes/CMP_math.c index e317998b5fc..d00ce18a44f 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_math.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_math.c @@ -131,7 +131,23 @@ static void do_math(bNode *node, float *out, float *in, float *in2) { out[0]= (int)(in[0] + 0.5f); } - break; + break; + case 15: /* Less Than */ + { + if( in[0] < in2[0] ) + out[0]= 1.0f; + else + out[0]= 0.0f; + } + break; + case 16: /* Greater Than */ + { + if( in[0] > in2[0] ) + out[0]= 1.0f; + else + out[0]= 0.0f; + } + break; } } diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_math.c b/source/blender/nodes/intern/SHD_nodes/SHD_math.c index 95162e508d5..2e156cf12bf 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_math.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_math.c @@ -174,7 +174,23 @@ bNodeStack **out) else out[0]->vec[0]= (int)(in[1]->vec[0] + 0.5f); } - break; + break; + case 15: /* Less Than */ + { + if( in[0]->vec[0] < in[1]->vec[0] ) + out[0]->vec[0]= 1.0f; + else + out[0]->vec[0]= 0.0f; + } + break; + case 16: /* Greater Than */ + { + if( in[0]->vec[0] > in[1]->vec[0] ) + out[0]->vec[0]= 1.0f; + else + out[0]->vec[0]= 0.0f; + } + break; } } diff --git a/source/blender/python/api2_2x/Mathutils.c b/source/blender/python/api2_2x/Mathutils.c index e63fc5ef38f..87ac3e3e6ba 100644 --- a/source/blender/python/api2_2x/Mathutils.c +++ b/source/blender/python/api2_2x/Mathutils.c @@ -725,28 +725,33 @@ PyObject *M_Mathutils_RotationMatrix(PyObject * self, PyObject * args) vec->vec[0] /= norm; vec->vec[1] /= norm; vec->vec[2] /= norm; - - //create matrix - cosAngle = (float) cos(angle); - sinAngle = (float) sin(angle); - mat[0] = ((vec->vec[0] * vec->vec[0]) * (1 - cosAngle)) + - cosAngle; - mat[1] = ((vec->vec[0] * vec->vec[1]) * (1 - cosAngle)) + - (vec->vec[2] * sinAngle); - mat[2] = ((vec->vec[0] * vec->vec[2]) * (1 - cosAngle)) - - (vec->vec[1] * sinAngle); - mat[3] = ((vec->vec[0] * vec->vec[1]) * (1 - cosAngle)) - - (vec->vec[2] * sinAngle); - mat[4] = ((vec->vec[1] * vec->vec[1]) * (1 - cosAngle)) + - cosAngle; - mat[5] = ((vec->vec[1] * vec->vec[2]) * (1 - cosAngle)) + - (vec->vec[0] * sinAngle); - mat[6] = ((vec->vec[0] * vec->vec[2]) * (1 - cosAngle)) + - (vec->vec[1] * sinAngle); - mat[7] = ((vec->vec[1] * vec->vec[2]) * (1 - cosAngle)) - - (vec->vec[0] * sinAngle); - mat[8] = ((vec->vec[2] * vec->vec[2]) * (1 - cosAngle)) + - cosAngle; + + if (isnan(vec->vec[0]) || isnan(vec->vec[1]) || isnan(vec->vec[2])) { + /* zero length vector, return an identity matrix, could also return an error */ + mat[0]= mat[4] = mat[8] = 1.0f; + } else { + /* create matrix */ + cosAngle = (float) cos(angle); + sinAngle = (float) sin(angle); + mat[0] = ((vec->vec[0] * vec->vec[0]) * (1 - cosAngle)) + + cosAngle; + mat[1] = ((vec->vec[0] * vec->vec[1]) * (1 - cosAngle)) + + (vec->vec[2] * sinAngle); + mat[2] = ((vec->vec[0] * vec->vec[2]) * (1 - cosAngle)) - + (vec->vec[1] * sinAngle); + mat[3] = ((vec->vec[0] * vec->vec[1]) * (1 - cosAngle)) - + (vec->vec[2] * sinAngle); + mat[4] = ((vec->vec[1] * vec->vec[1]) * (1 - cosAngle)) + + cosAngle; + mat[5] = ((vec->vec[1] * vec->vec[2]) * (1 - cosAngle)) + + (vec->vec[0] * sinAngle); + mat[6] = ((vec->vec[0] * vec->vec[2]) * (1 - cosAngle)) + + (vec->vec[1] * sinAngle); + mat[7] = ((vec->vec[1] * vec->vec[2]) * (1 - cosAngle)) - + (vec->vec[0] * sinAngle); + mat[8] = ((vec->vec[2] * vec->vec[2]) * (1 - cosAngle)) + + cosAngle; + } } else { return EXPP_ReturnPyObjError(PyExc_AttributeError, "Mathutils.RotationMatrix(): unrecognizable axis of rotation type - expected x,y,z or r\n"); diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 89a0a5ba7cb..796a99ca796 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -4434,7 +4434,7 @@ void RE_Database_Free(Render *re) LampRen *lar; /* statistics for debugging render memory usage */ - if(G.f & G_DEBUG) { + if((G.f & G_DEBUG) && (G.rendering)) { if((re->r.scemode & R_PREVIEWBUTS)==0) { BKE_image_print_memlist(); MEM_printmemlist_stats(); diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c index 796272eab2e..f3258b601de 100644 --- a/source/blender/render/intern/source/shadbuf.c +++ b/source/blender/render/intern/source/shadbuf.c @@ -636,7 +636,7 @@ static float readshadowbuf(ShadBuf *shb, ShadSampleBuf *shsample, int bias, int else { /* got warning on this for 64 bits.... */ /* but it's working code! in this case rz is not a pointer but zvalue (ton) */ - zsamp= (int) rz; + zsamp= GET_INT_FROM_POINTER(rz); } /* tricky stuff here; we use ints which can overflow easily with bias values */ @@ -816,7 +816,7 @@ static float readshadowbuf_halo(ShadBuf *shb, ShadSampleBuf *shsample, int xs, i else { /* same as before */ /* still working code! (ton) */ - zsamp= (int) rz; + zsamp= GET_INT_FROM_POINTER(rz); } /* NO schadow when sampled at 'eternal' distance */ diff --git a/source/blender/src/CMakeLists.txt b/source/blender/src/CMakeLists.txt index d6874cdd4db..342579fb3b0 100644 --- a/source/blender/src/CMakeLists.txt +++ b/source/blender/src/CMakeLists.txt @@ -35,7 +35,7 @@ SET(INC ../../kernel/gen_system ../../../intern/SoundSystem ../readstreamglue ../quicktime ../../../intern/elbeem/extern ../../../intern/ghost ../../../intern/opennl/extern - ../nodes + ../nodes ../../../extern/glew/include ${PYTHON_INC} ${SDL_INC} ) diff --git a/source/blender/src/Makefile b/source/blender/src/Makefile index c1c0ef8b1f2..001efc58b5d 100644 --- a/source/blender/src/Makefile +++ b/source/blender/src/Makefile @@ -143,4 +143,5 @@ ifeq ($(NAN_TWEAK_MODE), true) CPPFLAGS += -DTWEAK_MODE endif +CPPFLAGS += -I$(NAN_GLEW)/include CPPFLAGS += -I$(OPENGL_HEADERS) diff --git a/source/blender/src/SConscript b/source/blender/src/SConscript index f466798c40c..229cc87ef37 100644 --- a/source/blender/src/SConscript +++ b/source/blender/src/SConscript @@ -26,7 +26,7 @@ incs += ' #/intern/bsp/extern ../radiosity/extern/include' incs += ' #/intern/decimation/extern ../blenloader ../python' incs += ' ../../kernel/gen_system #/intern/SoundSystem ../readstreamglue ../nodes' incs += ' ../quicktime #/intern/elbeem/extern' -incs += ' #/intern/ghost #/intern/opennl/extern' +incs += ' #/intern/ghost #/intern/opennl/extern #/extern/glew/include' incs += ' ' + env['BF_PYTHON_INC'] diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 8faad1c20ae..bdf22dfe8d8 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -1767,7 +1767,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco } else if (md->type==eModifierType_Build) { height = 86; } else if (md->type==eModifierType_Mirror) { - height = 86; + height = 105; } else if (md->type==eModifierType_Bevel) { BevelModifierData *bmd = (BevelModifierData*) md; height = 105; /* height = 124; */ @@ -1792,7 +1792,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco height = 143; } else if (md->type==eModifierType_Wave) { WaveModifierData *wmd = (WaveModifierData *)md; - height = 294; + height = 315; if(wmd->texmapping == MOD_WAV_MAP_OBJECT || wmd->texmapping == MOD_WAV_MAP_UV) height += 19; @@ -1904,6 +1904,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco uiDefButBitS(block, TOG, MOD_MIR_AXIS_Y, B_MODIFIER_RECALC, "Y", lx+20,cy,20,19, &mmd->flag, 0, 0, 0, 0, "Enable Y axis mirror"); uiDefButBitS(block, TOG, MOD_MIR_AXIS_Z, B_MODIFIER_RECALC, "Z", lx+40,cy,20,19, &mmd->flag, 0, 0, 0, 0, "Enable Z axis mirror"); uiDefButBitS(block, TOG, MOD_MIR_CLIPPING, B_MODIFIER_RECALC, "Do Clipping", lx+60, cy, buttonWidth-60,19, &mmd->flag, 1, 2, 0, 0, "Prevents during Transform vertices to go through Mirror"); + uiDefButBitS(block, TOG, MOD_MIR_VGROUP, B_MODIFIER_RECALC, "Mirror Vgroups", lx, (cy-=19), buttonWidth,19, &mmd->flag, 1, 2, 0, 0, "Mirror vertex groups (e.g. .R->.L)"); uiDefButBitS(block, TOG, MOD_MIR_MIRROR_U, B_MODIFIER_RECALC, "Mirror U", lx, (cy-=19), buttonWidth/2, 19, @@ -2158,6 +2159,8 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco uiDefButF(block, NUM, B_MODIFIER_RECALC, "Time end:", lx,(cy-=19),buttonWidth,19, &wmd->timeoffs, -MAXFRAMEF, MAXFRAMEF, 100, 0, "Specify ending frame of the wave"); uiDefButF(block, NUM, B_MODIFIER_RECALC, "Lifetime:", lx,(cy-=19),buttonWidth,19, &wmd->lifetime, -MAXFRAMEF, MAXFRAMEF, 100, 0, "Specify the lifespan of the wave"); uiDefButF(block, NUM, B_MODIFIER_RECALC, "Damptime:", lx,(cy-=19),buttonWidth,19, &wmd->damp, -MAXFRAMEF, MAXFRAMEF, 100, 0, "Specify the dampingtime of the wave"); + uiDefButF(block, NUM, B_MODIFIER_RECALC, "Falloff:", lx,(cy-=19),buttonWidth,19, &wmd->falloff, 0, 100, 100, 0, "Specify the falloff radius of the waves"); + cy -= 9; uiBlockBeginAlign(block); uiDefButF(block, NUM, B_MODIFIER_RECALC, "Sta x:", lx,(cy-=19),113,19, &wmd->startx, -100.0, 100.0, 100, 0, "Starting position for the X axis"); @@ -2194,7 +2197,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco &wmd->map_object, "Object to get texture coordinates from"); } - cy -= 9; + cy -= 9; uiBlockBeginAlign(block); uiDefButF(block, NUMSLI, B_MODIFIER_RECALC, "Speed:", lx,(cy-=19),220,19, &wmd->speed, -2.0, 2.0, 0, 0, "Specify the wave speed"); uiDefButF(block, NUMSLI, B_MODIFIER_RECALC, "Height:", lx,(cy-=19),220,19, &wmd->height, -2.0, 2.0, 0, 0, "Specify the amplitude of the wave"); @@ -2407,7 +2410,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco but= uiDefBut(block, BUT, B_MODIFIER_RECALC, "Bind", lx,(cy-=24), buttonWidth,19, 0, 0, 0, 0, 0, "Bind mesh to cage"); uiButSetFunc(but,modifiers_bindMeshDeform,ob,md); uiDefButS(block, NUM, B_NOP, "Precision:", lx,(cy-19), buttonWidth/2 + 20,19, &mmd->gridsize, 2, 10, 0.5, 0, "The grid size for binding"); - uiDefButBitS(block, TOG, MOD_MDEF_DYNAMIC_BIND, B_MODIFIER_RECALC, "Dynamic", lx+(buttonWidth+1)/2 + 20, (cy-=19), buttonWidth/2 - 20,19, &mmd->flag, 0.0, 31.0, 0, 0, "Invert vertex group influence"); + uiDefButBitS(block, TOG, MOD_MDEF_DYNAMIC_BIND, B_MODIFIER_RECALC, "Dynamic", lx+(buttonWidth+1)/2 + 20, (cy-=19), buttonWidth/2 - 20,19, &mmd->flag, 0.0, 31.0, 0, 0, "Recompute binding dynamically on top of other deformers like Shape Keys (slower and more memory consuming!)"); } uiBlockEndAlign(block); } else if (md->type==eModifierType_ParticleSystem) { diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index 27caedf0cdd..b6877b2e2b7 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -677,6 +677,8 @@ static char *controller_pup(void) static char *actuator_name(int type) { switch (type) { + case ACT_SHAPEACTION: + return "Shape Action"; case ACT_ACTION: return "Action"; case ACT_OBJECT: @@ -732,6 +734,14 @@ static char *actuator_pup(Object *owner) "|Scene %x11|Random %x13|Message %x14|CD %x16|Game %x17" "|Visibility %x18|2D Filter %x19|Parent %x20"; break; + + case OB_MESH: + return "Actuators %t|Shape Action %x21|Motion %x0|Constraint %x9|Ipo %x1" + "|Camera %x3|Sound %x5|Property %x6|Edit Object %x10" + "|Scene %x11|Random %x13|Message %x14|CD %x16|Game %x17" + "|Visibility %x18|2D Filter %x19|Parent %x20"; + break; + default: return "Actuators %t|Motion %x0|Constraint %x9|Ipo %x1" "|Camera %x3|Sound %x5|Property %x6|Edit Object %x10" @@ -1433,6 +1443,7 @@ static int get_col_actuator(int type) { switch(type) { case ACT_ACTION: return TH_BUT_ACTION; + case ACT_SHAPEACTION: return TH_BUT_ACTION; case ACT_OBJECT: return TH_BUT_NEUTRAL; case ACT_IPO: return TH_BUT_SETTING; case ACT_PROPERTY: return TH_BUT_SETTING1; @@ -1541,6 +1552,7 @@ static short draw_actuatorbuttons(bActuator *act, uiBlock *block, short xco, sho break; } case ACT_ACTION: + case ACT_SHAPEACTION: { /* DrawAct */ #ifdef __NLA_ACTION_BY_MOTION_ACTUATOR @@ -2137,7 +2149,7 @@ static short draw_actuatorbuttons(bActuator *act, uiBlock *block, short xco, sho uiDefBut(block, TEX, 1, "To: ", (xco+10), (yco-(myline++*24)), (width-20), 19, &ma->toPropName, 0, 31, 0, 0, - "Optional send message to objects with this name only" + "Optional send message to objects with this name only (Prefix name with OB)" ", or empty to broadcast"); #endif diff --git a/source/blender/src/drawaction.c b/source/blender/src/drawaction.c index 65221dceaf9..8c4958a651a 100644 --- a/source/blender/src/drawaction.c +++ b/source/blender/src/drawaction.c @@ -730,7 +730,7 @@ void check_action_context(SpaceAction *saction) for (achan=saction->action->chanbase.first; achan; achan=achan->next) { pchan= get_pose_channel(ob->pose, achan->name); - if (pchan) { + if (pchan && pchan->bone) { if ((pchan->bone->layer & arm->layer)==0) achan->flag |= ACHAN_HIDDEN; else if (pchan->bone->flag & BONE_HIDDEN_P) diff --git a/source/blender/src/drawnode.c b/source/blender/src/drawnode.c index cea33685744..1169062fdd0 100644 --- a/source/blender/src/drawnode.c +++ b/source/blender/src/drawnode.c @@ -517,7 +517,7 @@ static int node_buts_math(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *b if(block) { uiBut *bt; - bt=uiDefButS(block, MENU, B_NODE_EXEC, "Add %x0|Subtract %x1|Multiply %x2|Divide %x3|Sine %x4|Cosine %x5|Tangent %x6|Arcsine %x7|Arccosine %x8|Arctangent %x9|Power %x10|Logarithm %x11|Minimum %x12|Maximum %x13|Round %x14", butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, &node->custom1, 0, 0, 0, 0, ""); + bt=uiDefButS(block, MENU, B_NODE_EXEC, "Add %x0|Subtract %x1|Multiply %x2|Divide %x3|Sine %x4|Cosine %x5|Tangent %x6|Arcsine %x7|Arccosine %x8|Arctangent %x9|Power %x10|Logarithm %x11|Minimum %x12|Maximum %x13|Round %x14|Less Than %x15|Greater Than %x16", butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, &node->custom1, 0, 0, 0, 0, ""); uiButSetFunc(bt, node_but_title_cb, node, bt); } return 20; diff --git a/source/blender/src/drawoops.c b/source/blender/src/drawoops.c index 5da38135be3..75bea40a8b4 100644 --- a/source/blender/src/drawoops.c +++ b/source/blender/src/drawoops.c @@ -229,6 +229,8 @@ void draw_icon_oops(float *co, short type) case ID_LI: icon= ICON_LIBRARY_HLT; break; case ID_IM: icon= ICON_IMAGE_HLT; break; case ID_GR: icon= ICON_CIRCLE_DEHLT; break; + case ID_CA: icon= ICON_CAMERA_DEHLT; break; + case ID_AR: icon= ICON_ARMATURE; break; } glEnable(GL_BLEND); @@ -282,6 +284,12 @@ unsigned int give_oops_color(short type, short sel, unsigned int *border) body= 0x35659F; break; case ID_GR: body= 0x507050; break; + case ID_CA: + body= 0x7570A0; break; + case ID_LT: + body= 0xA08090; break; + case ID_AR: + body= 0x70B0C0; break; default: body= 0x606070; break; } @@ -516,3 +524,4 @@ void drawoopsspace(ScrArea *sa, void *spacedata) + diff --git a/source/blender/src/editcurve.c b/source/blender/src/editcurve.c index bd0abe83ee4..261bb26b0c4 100644 --- a/source/blender/src/editcurve.c +++ b/source/blender/src/editcurve.c @@ -1158,6 +1158,62 @@ void setradiusNurb( void ) allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */ } +void smoothNurb( void ) +{ + + extern ListBase editNurb; + Nurb *nu; + BezTriple *bezt, *beztOrig; + BPoint *bp, *bpOrig; + int a, i, change = 0; + + /* floats for smoothing */ + float val, newval, offset; + + for(nu= editNurb.first; nu; nu= nu->next) { + if(nu->bezt) { + change = 0; + beztOrig = MEM_dupallocN( nu->bezt ); + for(bezt=nu->bezt+1, a=1; apntsu-1; a++, bezt++) { + if(bezt->f2 & SELECT) { + for(i=0; i<3; i++) { + val = bezt->vec[1][i]; + newval = ((beztOrig+(a-1))->vec[1][i] * 0.5) + ((beztOrig+(a+1))->vec[1][i] * 0.5); + offset = (val*((1.0/6.0)*5)) + (newval*(1.0/6.0)) - val; + /* offset handles */ + bezt->vec[1][i] += offset; + bezt->vec[0][i] += offset; + bezt->vec[2][i] += offset; + } + change = 1; + } + } + MEM_freeN(beztOrig); + if (change) + calchandlesNurb(nu); + } else if (nu->bp) { + bpOrig = MEM_dupallocN( nu->bp ); + /* Same as above, keep these the same! */ + for(bp=nu->bp+1, a=1; apntsu-1; a++, bp++) { + if(bp->f1 & SELECT) { + for(i=0; i<3; i++) { + val = bp->vec[i]; + newval = ((bpOrig+(a-1))->vec[i] * 0.5) + ((bpOrig+(a+1))->vec[i] * 0.5); + offset = (val*((1.0/6.0)*5)) + (newval*(1.0/6.0)) - val; + + bp->vec[i] += offset; + } + } + } + MEM_freeN(bpOrig); + } + } + BIF_undo_push("Smooth Curve"); + DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); + allqueue(REDRAWVIEW3D, 0); + allqueue(REDRAWBUTSALL, 0); + allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */ +} /* TODO, make smoothing distance based */ void smoothradiusNurb( void ) diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index 4029e031b63..3c945775b5b 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -2735,7 +2735,7 @@ void special_editmenu(void) } else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) { - nr= pupmenu("Specials%t|Subdivide%x1|Switch Direction%x2|Set Goal Weight %x3|Set Radius %x4|Smooth Radius %x5"); + nr= pupmenu("Specials%t|Subdivide%x1|Switch Direction%x2|Set Goal Weight%x3|Set Radius%x4|Smooth%x5|Smooth Radius%x6"); switch(nr) { case 1: @@ -2751,6 +2751,9 @@ void special_editmenu(void) setradiusNurb(); break; case 5: + smoothNurb(); + break; + case 6: smoothradiusNurb(); break; } diff --git a/source/blender/src/header_oops.c b/source/blender/src/header_oops.c index 7bfbf0ee667..ad65705b79d 100644 --- a/source/blender/src/header_oops.c +++ b/source/blender/src/header_oops.c @@ -509,8 +509,9 @@ void oops_buttons(void) uiDefIconButBitS(block, TOG, OOPS_IM, B_NEWOOPS, ICON_IMAGE_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Image datablocks"); uiDefIconButBitS(block, TOG, OOPS_GR, B_NEWOOPS, ICON_CIRCLE_DEHLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Group datablocks"); uiDefIconButBitS(block, TOG, OOPS_LI, B_NEWOOPS, ICON_LIBRARY_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Library datablocks"); + uiDefIconButBitS(block, TOG, OOPS_CA, B_NEWOOPS, ICON_CAMERA_DEHLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Camera datablocks"); + uiDefIconButBitS(block, TOG, OOPS_AR, B_NEWOOPS, ICON_ARMATURE, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Armature datablocks"); - uiBlockEndAlign(block); /* name */ @@ -576,3 +577,4 @@ void oops_buttons(void) uiDrawBlock(block); } + diff --git a/source/blender/src/oops.c b/source/blender/src/oops.c index 1f851d2fa6c..99645b5e71f 100644 --- a/source/blender/src/oops.c +++ b/source/blender/src/oops.c @@ -48,6 +48,9 @@ #include "DNA_texture_types.h" #include "DNA_key_types.h" #include "DNA_group_types.h" +#include "DNA_camera_types.h" +#include "DNA_lattice_types.h" +#include "DNA_armature_types.h" #include "BKE_utildefines.h" #include "BKE_global.h" @@ -661,7 +664,6 @@ void add_material_oopslinks(Material *ma, Oops *oops, short flag) add_oopslink("group", oops, ID_GR, &(ma->group), OOPSX, (float)(0.5*OOPSY)); } - void add_group_oopslinks(Group *gp, Oops *oops, short flag) { GroupObject *gob; @@ -672,7 +674,6 @@ void add_group_oopslinks(Group *gp, Oops *oops, short flag) } } - void add_object_oopslinks(Object *ob, Oops *oops, short flag) { ID *id; @@ -698,6 +699,12 @@ void add_object_oopslinks(Object *ob, Oops *oops, short flag) case ID_LA: if(flag & OOPS_LA) add_oopslink("data", oops, ID_LA, &ob->data, (float)(.5*OOPSX), (float)OOPSY); break; + case ID_CA: + if(flag & OOPS_CA) add_oopslink("data", oops, ID_CA, &ob->data, (float)(.5*OOPSX), (float)OOPSY); + break; + case ID_AR: + if(flag & OOPS_AR) add_oopslink("data", oops, ID_AR, &ob->data, (float)(.5*OOPSX), (float)OOPSY); + break; } } @@ -748,7 +755,6 @@ void add_curve_oopslinks(Curve *cu, Oops *oops, short flag) add_oopslink("speed", oops, ID_IP, &cu->ipo, OOPSX, (float)(0.5*OOPSY)); if(cu->key) add_oopslink("ipo", oops, ID_IP, &cu->key->ipo, OOPSX, (float)(0.5*OOPSY)); } - } void add_mball_oopslinks(MetaBall *mb, Oops *oops, short flag) @@ -775,15 +781,36 @@ void add_lamp_oopslinks(Lamp *la, Oops *oops, short flag) } } } + if(flag & OOPS_IP) { + add_oopslink("ipo", oops, ID_IP, &la->ipo, OOPSX, (float)(0.5*OOPSY)); + } } +void add_camera_oopslinks(Camera *ca, Oops *oops, short flag) +{ + if(flag & OOPS_IP) { + add_oopslink("ipo", oops, ID_IP, &ca->ipo, OOPSX, (float)(0.5*OOPSY)); + } +} + +void add_texture_oopslinks(Tex *tex, Oops *oops, short flag) +{ + if(flag & OOPS_IM) { + add_oopslink("image", oops, ID_IM, &tex->ima, OOPSX, (float)(0.5*OOPSY)); + } +} + +void add_lattice_oopslinks(Lattice *lt, Oops *oops, short flag) +{ + if(flag & OOPS_IP) { + if(lt->key) add_oopslink("ipo", oops, ID_IP, <->key->ipo, OOPSX, (float)(0.5*OOPSY)); + } +} Oops *add_test_oops(void *id) /* incl links */ { Oops *oops; Object *ob; - Lamp *la; - Tex *tex; if(id==0) return NULL; @@ -821,9 +848,10 @@ Oops *add_test_oops(void *id) /* incl links */ add_mball_oopslinks((MetaBall *)id, oops, G.soops->visiflag); break; case ID_LA: - la= (Lamp *)id; - add_lamp_oopslinks(la, oops, G.soops->visiflag); - if(la->ipo) if(G.soops->visiflag & OOPS_IP) add_oopslink("ipo", oops, ID_IP, &la->ipo, OOPSX, (float)(0.3*OOPSY)); + add_lamp_oopslinks((Lamp *)id, oops, G.soops->visiflag); + break; + case ID_CA: + add_camera_oopslinks((Camera *)id, oops, G.soops->visiflag); break; case ID_IP: @@ -835,8 +863,14 @@ Oops *add_test_oops(void *id) /* incl links */ add_group_oopslinks((Group *)id, oops, G.soops->visiflag); break; case ID_TE: - tex= (Tex *)id; - if(tex->ima) if(G.soops->visiflag & OOPS_IM) add_oopslink("image", oops, ID_IM, &tex->ima, OOPSX, (float)(0.3*OOPSY)); + add_texture_oopslinks((Tex *)id, oops, G.soops->visiflag); + break; + case ID_LT: + add_lattice_oopslinks((Lattice *)id, oops, G.soops->visiflag); + break; + case ID_AR: + + break; } return oops; @@ -897,7 +931,7 @@ void build_oops() while(sce) { oops= add_test_oops(sce); - + if(G.soops->visiflag & OOPS_OB) { base= sce->base.first; while(base) { @@ -912,12 +946,13 @@ void build_oops() if(G.soops->visiflag & OOPS_OB) { Object *ob= G.main->object.first; - + while(ob) { oops= add_test_oops(ob); ob= ob->id.next; } } + if(G.soops->visiflag & OOPS_ME) { Mesh *me= G.main->mesh.first; while(me) { @@ -925,7 +960,7 @@ void build_oops() me= me->id.next; } } - + if(G.soops->visiflag & OOPS_CU) { Curve *cu= G.main->curve.first; while(cu) { @@ -933,7 +968,7 @@ void build_oops() cu= cu->id.next; } } - + if(G.soops->visiflag & OOPS_MB) { MetaBall *mb= G.main->mball.first; while(mb) { @@ -941,7 +976,7 @@ void build_oops() mb= mb->id.next; } } - + if(G.soops->visiflag & OOPS_LA) { Lamp *la= G.main->lamp.first; while(la) { @@ -950,6 +985,14 @@ void build_oops() } } + if(G.soops->visiflag & OOPS_CA) { + Camera *ca= G.main->camera.first; + while(ca) { + oops= add_test_oops(ca); + ca= ca->id.next; + } + } + if(G.soops->visiflag & OOPS_IP) { Ipo *ipo= G.main->ipo.first; while(ipo) { @@ -972,6 +1015,7 @@ void build_oops() tex= tex->id.next; } } + if(G.soops->visiflag & OOPS_IM) { Image *ima= G.main->image.first; while(ima) { @@ -979,6 +1023,7 @@ void build_oops() ima= ima->id.next; } } + if(G.soops->visiflag & OOPS_GR) { Group *gp= G.main->group.first; while(gp) { @@ -986,6 +1031,23 @@ void build_oops() gp= gp->id.next; } } + + if(G.soops->visiflag & OOPS_LT) { + Lattice *lt= G.main->latt.first; + while(lt) { + oops= add_test_oops(lt); + lt= lt->id.next; + } + } + + if(G.soops->visiflag & OOPS_AR) { + bArmature *ar= G.main->armature.first; + while(ar) { + oops= add_test_oops(ar); + ar= ar->id.next; + } + } + } else { @@ -1068,6 +1130,7 @@ void build_oops() else if(type==ID_LA && G.soops->visiflag & OOPS_LA) { Lamp *la= ob->data; oops= add_test_oops(ob->data); + if(G.soops->visiflag & OOPS_IP) add_test_oops(la->ipo); if(G.soops->visiflag & OOPS_TE) { for(a=0; avisiflag & OOPS_CA) { + Camera *ca= ob->data; + oops= add_test_oops(ob->data); + + if(G.soops->visiflag & OOPS_IP) add_test_oops(ca->ipo); + } + else if(type==ID_LT && G.soops->visiflag & OOPS_LT) { + Lattice *lt= ob->data; + oops= add_test_oops(ob->data); + + if(G.soops->visiflag & OOPS_IP) { + if(lt->key) oops= add_test_oops(lt->key->ipo); + } + } + else if(type==ID_AR && G.soops->visiflag & OOPS_AR) { + bArmature *ar= ob->data; + oops= add_test_oops(ob->data); + } } } base= base->next; } } - - - /* test links */ oops= G.soops->oops.first; diff --git a/source/blender/src/transform_constraints.c b/source/blender/src/transform_constraints.c index 769ebd2ea97..2d01c2303fc 100644 --- a/source/blender/src/transform_constraints.c +++ b/source/blender/src/transform_constraints.c @@ -550,6 +550,10 @@ void setUserConstraint(TransInfo *t, int mode, const char ftext[]) { void BIF_setLocalLockConstraint(char axis, char *text) { TransInfo *t = BIF_GetTransInfo(); + if (t->total == 0) { + return; + } + switch (axis) { case 'x': setLocalConstraint(t, (CON_AXIS1|CON_AXIS2), text); @@ -566,6 +570,10 @@ void BIF_setLocalLockConstraint(char axis, char *text) { void BIF_setLocalAxisConstraint(char axis, char *text) { TransInfo *t = BIF_GetTransInfo(); + if (t->total == 0) { + return; + } + switch (axis) { case 'X': setLocalConstraint(t, CON_AXIS0, text); @@ -584,6 +592,10 @@ void BIF_setSingleAxisConstraint(float vec[3], char *text) { TransInfo *t = BIF_GetTransInfo(); float space[3][3], v[3]; + if (t->total == 0) { + return; + } + VECCOPY(space[0], vec); v[0] = vec[2]; @@ -622,6 +634,10 @@ void BIF_setDualAxisConstraint(float vec1[3], float vec2[3], char *text) { TransInfo *t = BIF_GetTransInfo(); float space[3][3]; + if (t->total == 0) { + return; + } + VECCOPY(space[0], vec1); VECCOPY(space[1], vec2); Crossf(space[2], space[0], space[1]); diff --git a/source/blender/src/transform_snap.c b/source/blender/src/transform_snap.c index 83940fa3729..295cfa4574c 100644 --- a/source/blender/src/transform_snap.c +++ b/source/blender/src/transform_snap.c @@ -739,9 +739,10 @@ void TargetSnapClosest(TransInfo *t) /* find snapping point on face, return 1 on success */ -int snapFace(MFace *face, MVert *verts, float *intersect, float *loc, float *no) +int snapFace(MFace *face, EditFace *efa, MVert *verts, float *intersect, float *loc, float *no) { MVert *v[4]; + EditVert *eve[4]; int totvert; int result = 0; @@ -760,6 +761,14 @@ int snapFace(MFace *face, MVert *verts, float *intersect, float *loc, float *no) totvert = 3; } + if (efa) + { + eve[0] = efa->v1; + eve[1] = efa->v2; + eve[2] = efa->v3; + eve[3] = efa->v4; + } + switch(G.scene->snap_mode) { case SCE_SNAP_MODE_VERTEX: @@ -769,16 +778,20 @@ int snapFace(MFace *face, MVert *verts, float *intersect, float *loc, float *no) for(i = 0; i < totvert; i++) { - float vert_dist = VecLenf(v[i]->co, intersect); - if (vert_dist < min_dist) + if (efa == NULL || (eve[i]->f1 & SELECT) == 0) { - result = 1; + float vert_dist = VecLenf(v[i]->co, intersect); - min_dist = vert_dist; - - VECCOPY(loc, v[i]->co); - NormalShortToFloat(no, v[i]->no); + if (vert_dist < min_dist) + { + result = 1; + + min_dist = vert_dist; + + VECCOPY(loc, v[i]->co); + NormalShortToFloat(no, v[i]->no); + } } } break; @@ -791,51 +804,62 @@ int snapFace(MFace *face, MVert *verts, float *intersect, float *loc, float *no) for(i = 0; i < totvert; i++) { MVert *v1, *v2; - float edge_loc[3]; - float vec[3]; - float mul; - float edge_dist; + EditVert *eve1, *eve2; v1 = v[i]; v2 = v[(i + 1) % totvert]; - VecSubf(edge_loc, v2->co, v1->co); - VecSubf(vec, intersect, v1->co); + eve1 = eve[i]; + eve2 = eve[(i + 1) % totvert]; - mul = Inpf(vec, edge_loc) / Inpf(edge_loc, edge_loc); - - VecMulf(edge_loc, mul); - VecAddf(edge_loc, edge_loc, v1->co); - - edge_dist = VecLenf(edge_loc, intersect); - - if (edge_dist < min_dist) + if (efa == NULL || ((eve1->f1 & SELECT) == 0 && (eve2->f1 & SELECT) == 0)) { - float n1[3], n2[3]; - result = 1; + float edge_loc[3]; + float vec[3]; + float mul; + float edge_dist; - min_dist = edge_dist; - - VECCOPY(loc, edge_loc); + VecSubf(edge_loc, v2->co, v1->co); + VecSubf(vec, intersect, v1->co); - NormalShortToFloat(n1, v1->no); - NormalShortToFloat(n2, v2->no); - VecLerpf(no, n1, n2, mul); - Normalize(no); + mul = Inpf(vec, edge_loc) / Inpf(edge_loc, edge_loc); + + VecMulf(edge_loc, mul); + VecAddf(edge_loc, edge_loc, v1->co); + + edge_dist = VecLenf(edge_loc, intersect); + + if (edge_dist < min_dist) + { + float n1[3], n2[3]; + result = 1; + + min_dist = edge_dist; + + VECCOPY(loc, edge_loc); + + NormalShortToFloat(n1, v1->no); + NormalShortToFloat(n2, v2->no); + VecLerpf(no, n1, n2, mul); + Normalize(no); + } } } break; } case SCE_SNAP_MODE_FACE: { - result = 1; - - VECCOPY(loc, intersect); - - if (totvert == 4) - CalcNormFloat4(v[0]->co, v[1]->co, v[2]->co, v[3]->co, no); - else - CalcNormFloat(v[0]->co, v[1]->co, v[2]->co, no); + if (efa == NULL || ((efa->f1 & SELECT) == 0)) + { + result = 1; + + VECCOPY(loc, intersect); + + if (totvert == 4) + CalcNormFloat4(v[0]->co, v[1]->co, v[2]->co, v[3]->co, no); + else + CalcNormFloat(v[0]->co, v[1]->co, v[2]->co, no); + } break; } } @@ -845,7 +869,6 @@ int snapFace(MFace *face, MVert *verts, float *intersect, float *loc, float *no) int snapDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float ray_start[3], float ray_normal[3], short mval[2], float *loc, float *no, int *dist, float *depth, short EditMesh) { - float object_depth = FLT_MAX; int retval = 0; int totvert = dm->getNumVerts(dm); int totface = dm->getNumFaces(dm); @@ -879,12 +902,10 @@ int snapDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float ray_sta if (test == 1) { MVert *verts = dm->getVertArray(dm); MFace *faces = dm->getFaceArray(dm); - int *index_array; + int *index_array = NULL; int index = 0; int i; - test = 1; - if (EditMesh) { index_array = dm->getFaceDataArray(dm, CD_ORIGINDEX); @@ -892,14 +913,15 @@ int snapDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float ray_sta } for( i = 0; i < totface; i++) { + EditFace *efa = NULL; MFace *f = faces + i; float lambda; int result; + test = 1; /* reset for every face */ + if (EditMesh) { - EditFace *efa = NULL; - if (index_array) { index = index_array[i]; @@ -917,12 +939,9 @@ int snapDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float ray_sta { efa = EM_get_face_for_index(index); - if (efa) + if (efa && efa->f1 & SELECT) { - if (efa->v1->f1 & SELECT || efa->v2->f1 & SELECT || efa->v3->f1 & SELECT || (efa->v4 && efa->v4->f1 & SELECT)) - { - test = 0; - } + test = 0; } } } @@ -932,7 +951,7 @@ int snapDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float ray_sta { result = RayIntersectsTriangle(ray_start_local, ray_normal_local, verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, &lambda, NULL); - if (result && lambda < object_depth) { + if (result) { float location[3], normal[3]; float intersect[3]; @@ -940,18 +959,21 @@ int snapDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float ray_sta VecMulf(intersect, lambda); VecAddf(intersect, intersect, ray_start_local); - if (snapFace(f, verts, intersect, location, normal)) + if (snapFace(f, efa, verts, intersect, location, normal)) { float new_depth; int screen_loc[2]; + int new_dist; Mat4MulVecfl(obmat, location); new_depth = VecLenf(location, ray_start); - if (new_depth < *depth) + project_int(location, screen_loc); + new_dist = abs(screen_loc[0] - mval[0]) + abs(screen_loc[1] - mval[1]); + + if (new_dist <= *dist && new_depth < *depth) { - object_depth = lambda; *depth = new_depth; retval = 1; @@ -963,7 +985,7 @@ int snapDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float ray_sta project_int(loc, screen_loc); - *dist = abs(screen_loc[0] - mval[0]) + abs(screen_loc[1] - mval[1]); + *dist = new_dist; } } } @@ -972,7 +994,7 @@ int snapDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float ray_sta { result = RayIntersectsTriangle(ray_start_local, ray_normal_local, verts[f->v3].co, verts[f->v4].co, verts[f->v1].co, &lambda, NULL); - if (result && lambda < object_depth) { + if (result) { float location[3], normal[3]; float intersect[3]; @@ -980,18 +1002,21 @@ int snapDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float ray_sta VecMulf(intersect, lambda); VecAddf(intersect, intersect, ray_start_local); - if (snapFace(f, verts, intersect, location, normal)) + if (snapFace(f, efa, verts, intersect, location, normal)) { float new_depth; int screen_loc[2]; + int new_dist; Mat4MulVecfl(obmat, location); - new_depth = VecLenf(location, ray_start); + new_depth = VecLenf(location, ray_start); - if (new_depth < *depth) + project_int(location, screen_loc); + new_dist = abs(screen_loc[0] - mval[0]) + abs(screen_loc[1] - mval[1]); + + if (new_dist <= *dist && new_depth < *depth) { - object_depth = lambda; *depth = new_depth; retval = 1; @@ -1001,9 +1026,7 @@ int snapDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float ray_sta Mat3MulVecfl(timat, no); Normalize(no); - project_int(loc, screen_loc); - - *dist = abs(screen_loc[0] - mval[0]) + abs(screen_loc[1] - mval[1]); + *dist = new_dist; } } } @@ -1033,14 +1056,13 @@ int snapObjects(int *dist, float *loc, float *no, int mode) { if (mode == NOT_ACTIVE) { - DerivedMesh *dm, *dm_cage; + DerivedMesh *dm; Object *ob = G.obedit; - dm_cage = editmesh_get_derived_cage_and_final(&dm, CD_MASK_BAREMESH); + dm = editmesh_get_derived_cage(CD_MASK_BAREMESH); retval = snapDerivedMesh(ob, dm, ob->obmat, ray_start, ray_normal, mval, loc, no, dist, &depth, 1); - dm_cage->release(dm_cage); dm->release(dm); } diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c index 6c0838288b8..2a4672e3052 100644 --- a/source/blender/src/usiblender.c +++ b/source/blender/src/usiblender.c @@ -925,7 +925,7 @@ void BIF_write_file(char *target) writeBlog(); } else { - error("%s", err); + error("failed to write blend file: %s", err); } waitcursor(0); @@ -940,7 +940,10 @@ void BIF_write_homefile(void) /* force save as regular blend file */ write_flags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_LOCK | G_FILE_SIGN); - BLO_write_file(tstr, write_flags, &err); + + if (!BLO_write_file(tstr, write_flags, &err)) { + error("failed writing defaults: %s", err); + } } void BIF_write_autosave(void) @@ -952,7 +955,9 @@ void BIF_write_autosave(void) /* force save as regular blend file */ write_flags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_LOCK | G_FILE_SIGN); - BLO_write_file(tstr, write_flags, &err); + if (!BLO_write_file(tstr, write_flags, &err)) { + fprintf(stderr, "failed to write autosave: %s\n", err); /* using error(...) is too annoying here */ + } } /* remove temp files assosiated with this blend file when quitting, loading or saving in a new path */ @@ -1033,6 +1038,7 @@ void BIF_init(void) BIF_filelist_init_icons(); init_gl_stuff(); /* drawview.c, after homefile */ + glewInit(); readBlog(); BLI_strncpy(G.lib, G.sce, FILE_MAX); } diff --git a/source/blender/src/view.c b/source/blender/src/view.c index 008387d5a70..356a297b284 100644 --- a/source/blender/src/view.c +++ b/source/blender/src/view.c @@ -753,10 +753,11 @@ void viewmoveNDOFfly(int mode) // Apply rotation - - rvec[0] = -dval[3]; - rvec[1] = -dval[4]; - rvec[2] = dval[5]; + // Rotations feel relatively faster than translations only in fly mode, so + // we have no choice but to fix that here (not in the plugins) + rvec[0] = -0.5 * dval[3]; + rvec[1] = -0.5 * dval[4]; + rvec[2] = -0.5 * dval[5]; // rotate device x and y by view z @@ -824,8 +825,7 @@ void viewmove(int mode) return; } - // dist correction from other movement devices - + // dist correction from other movement devices if((dz_flag)||G.vd->dist==0) { dz_flag = 0; G.vd->dist = m_dist; @@ -1166,6 +1166,8 @@ void viewmoveNDOF(int mode) float reverse; float diff[4]; float d, curareaX, curareaY; + float mat[3][3]; + float upvec[3]; /* Sensitivity will control how fast the view rotates. The value was * obtained experimentally by tweaking until the author didn't get dizzy watching. @@ -1186,6 +1188,16 @@ void viewmoveNDOF(int mode) use_sel = 1; } + if((dz_flag)||G.vd->dist==0) { + dz_flag = 0; + G.vd->dist = m_dist; + upvec[0] = upvec[1] = 0; + upvec[2] = G.vd->dist; + Mat3CpyMat4(mat, G.vd->viewinv); + Mat3MulVecfl(mat, upvec); + VecAddf(G.vd->ofs, G.vd->ofs, upvec); + } + /*---------------------------------------------------- * sometimes this routine is called from headerbuttons * viewmove needs to refresh the screen @@ -1212,25 +1224,25 @@ void viewmoveNDOF(int mode) filterNDOFvalues(fval); - // put scaling back here, was previously in ghostwinlay - fval[0] = fval[0] * (1.0f/800.0f); - fval[1] = fval[1] * (1.0f/800.0f); - fval[2] = fval[2] * (1.0f/800.0f); - fval[3] = fval[3] * 0.00005f; - fval[4] = fval[4] * 0.00005f; - fval[5] = fval[5] * 0.00005f; - fval[6] = fval[6] / 1000000.0f; + // put scaling back here, was previously in ghostwinlay + fval[0] = fval[0] * (1.0f/1200.0f); + fval[1] = fval[1] * (1.0f/1200.0f); + fval[2] = fval[2] * (1.0f/1200.0f); + fval[3] = fval[3] * 0.00005f; + fval[4] =-fval[4] * 0.00005f; + fval[5] = fval[5] * 0.00005f; + fval[6] = fval[6] / 1000000.0f; - // scale more if not in perspective mode - if (G.vd->persp == V3D_ORTHO) { - fval[0] = fval[0] * 0.05f; - fval[1] = fval[1] * 0.05f; - fval[2] = fval[2] * 0.05f; - fval[3] = fval[3] * 0.9f; - fval[4] = fval[4] * 0.9f; - fval[5] = fval[5] * 0.9f; - zsens *= 8; - } + // scale more if not in perspective mode + if (G.vd->persp == V3D_ORTHO) { + fval[0] = fval[0] * 0.05f; + fval[1] = fval[1] * 0.05f; + fval[2] = fval[2] * 0.05f; + fval[3] = fval[3] * 0.9f; + fval[4] = fval[4] * 0.9f; + fval[5] = fval[5] * 0.9f; + zsens *= 8; + } /* set object offset */ diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 05c58a258ec..d17b94c631d 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -259,6 +259,7 @@ IF(UNIX) blender_python bf_quicktime extern_binreloc + extern_glew ) FOREACH(SORTLIB ${BLENDER_SORTED_LIBS}) diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index fa8409b123e..06aa0609ad9 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -40,9 +40,7 @@ #pragma warning (disable:4786) #endif -#ifdef __APPLE__ -#define GL_GLEXT_LEGACY 1 -#endif +#include "GL/glew.h" #include "KX_BlenderGL.h" #include "KX_BlenderCanvas.h" @@ -57,10 +55,10 @@ #include "KX_PythonInit.h" #include "KX_PyConstraintBinding.h" +#include "RAS_GLExtensionManager.h" #include "RAS_OpenGLRasterizer.h" #include "RAS_VAOpenGLRasterizer.h" #include "RAS_ListRasterizer.h" -#include "RAS_GLExtensionManager.h" #include "NG_LoopBackNetworkDeviceInterface.h" #include "SND_DeviceManager.h" @@ -142,12 +140,12 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, // so we can safely run Python code and API calls PyGILState_STATE gilstate = PyGILState_Ensure(); - bgl::InitExtensions(1); - + bgl::InitExtensions(true); + do { View3D *v3d= (View3D*) area->spacedata.first; - + // get some preferences SYS_SystemHandle syshandle = SYS_GetSystem(); bool properties = (SYS_GetCommandLineInt(syshandle, "show_properties", 0) != 0); @@ -156,22 +154,10 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, bool frameRate = (SYS_GetCommandLineInt(syshandle, "show_framerate", 0) != 0); bool game2ipo = (SYS_GetCommandLineInt(syshandle, "game2ipo", 0) != 0); bool displaylists = (SYS_GetCommandLineInt(syshandle, "displaylists", 0) != 0); - bool usemat = false; - - #if defined(GL_ARB_multitexture) && defined(WITH_GLEXT) - if (!getenv("WITHOUT_GLEXT")) { - if(bgl::RAS_EXT_support._ARB_multitexture && bgl::QueryVersion(1, 1)) { - usemat = (SYS_GetCommandLineInt(syshandle, "blender_material", 0) != 0); - int unitmax=0; - glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, (GLint*)&unitmax); - bgl::max_texture_units = MAXTEX>unitmax?unitmax:MAXTEX; - //std::cout << "using(" << bgl::max_texture_units << ") of(" << unitmax << ") texture units." << std::endl; - } else { - bgl::max_texture_units = 0; - } - } - #endif + bool usemat = false, useglslmat = false; + if(GLEW_ARB_multitexture && GLEW_VERSION_1_1) + usemat = (SYS_GetCommandLineInt(syshandle, "blender_material", 0) != 0); // create the canvas, rasterizer and rendertools RAS_ICanvas* canvas = new KX_BlenderCanvas(area); @@ -186,12 +172,12 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, bool lock_arrays = (displaylists && useVertexArrays); if(displaylists){ - if (useVertexArrays) { + if (useVertexArrays) rasterizer = new RAS_ListRasterizer(canvas, true, lock_arrays); - } else { + else rasterizer = new RAS_ListRasterizer(canvas); - } - } else if (useVertexArrays && bgl::QueryVersion(1, 1)) + } + else if (useVertexArrays && GLEW_VERSION_1_1) rasterizer = new RAS_VAOpenGLRasterizer(canvas, lock_arrays); else rasterizer = new RAS_OpenGLRasterizer(canvas); @@ -338,6 +324,8 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, if(usemat) sceneconverter->SetMaterials(true); + if(useglslmat) + sceneconverter->SetGLSLMaterials(true); KX_Scene* startscene = new KX_Scene(keyboarddevice, mousedevice, @@ -372,6 +360,12 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, // start the engine ketsjiengine->StartEngine(true); + + // Set the animation playback rate for ipo's and actions + // the framerate below should patch with FPS macro defined in blendef.h + // Could be in StartEngine set the framerate, we need the scene to do this + ketsjiengine->SetAnimFrameRate( (((double) blscene->r.frs_sec) / blscene->r.frs_sec_base) ); + // the mainloop while (!exitrequested) { @@ -498,7 +492,7 @@ extern "C" void StartKetsjiShellSimulation(struct ScrArea *area, // so we can safely run Python code and API calls PyGILState_STATE gilstate = PyGILState_Ensure(); - bgl::InitExtensions(1); + bgl::InitExtensions(true); do { @@ -527,7 +521,7 @@ extern "C" void StartKetsjiShellSimulation(struct ScrArea *area, if(displaylists && !useVertexArrays) rasterizer = new RAS_ListRasterizer(canvas); - else if (useVertexArrays && bgl::QueryVersion(1, 1)) + else if (useVertexArrays && GLEW_VERSION_1_1) rasterizer = new RAS_VAOpenGLRasterizer(canvas, lock_arrays); else rasterizer = new RAS_OpenGLRasterizer(canvas); diff --git a/source/gameengine/BlenderRoutines/CMakeLists.txt b/source/gameengine/BlenderRoutines/CMakeLists.txt index 764be732343..1d72fb9cde1 100644 --- a/source/gameengine/BlenderRoutines/CMakeLists.txt +++ b/source/gameengine/BlenderRoutines/CMakeLists.txt @@ -33,6 +33,7 @@ SET(INC ../../../source/blender/blenloader ../../../extern/bullet2/src ../../../extern/solid + ../../../extern/glew/include ${PYTHON_INC} ) diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h index f9ff8f61b97..b155d39e149 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h @@ -32,12 +32,8 @@ #ifdef WIN32 #include #endif -#ifdef __APPLE__ -# define GL_GLEXT_LEGACY 1 -#include -#else -#include -#endif + +#include "GL/glew.h" #include "RAS_ICanvas.h" #include "RAS_Rect.h" diff --git a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp index 7c9dbcdaab2..230d6b262c6 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp @@ -44,21 +44,9 @@ #include "BMF_Api.h" +#include "GL/glew.h" +#include "BIF_gl.h" -#ifdef __APPLE__ -#define GL_GLEXT_LEGACY 1 -#include -#include -#else -#include -#if defined(__sun__) && !defined(__sparc__) -#include -#else -#include -#endif -#endif -#include "RAS_OpenGLRasterizer/RAS_GLExtensionManager.h" -#include "RAS_OpenGLRasterizer/ARB_multitexture.h" #include "BL_Material.h" // MAXTEX /* Data types encoding the game world: */ @@ -77,7 +65,6 @@ #include "BKE_bmfont.h" #include "BKE_image.h" -#include "BIF_gl.h" extern "C" { #include "BDR_drawmesh.h" #include "BIF_mywindow.h" @@ -88,12 +75,6 @@ extern "C" { /* end of blender block */ -#ifdef __APPLE__ -#include -#else -#include -#endif - /* was in drawmesh.c */ void spack(unsigned int ucol) { @@ -133,7 +114,12 @@ void BL_RenderText(int mode,const char* textstr,int textlen,struct MTFace* tface characters = 0; } - if(!col) glColor3f(1.0f, 1.0f, 1.0f); + /* When OBCOL flag is on the color is set in IndexPrimitives_3DText */ + if (tface->mode & TF_OBCOL) { /* Color has been set */ + col= NULL; + } else { + if(!col) glColor3f(1.0f, 1.0f, 1.0f); + } glPushMatrix(); for (index = 0; index < characters; index++) { @@ -189,28 +175,19 @@ void DisableForText() glDisable(GL_LIGHTING); glDisable(GL_COLOR_MATERIAL); } -#if defined(GL_ARB_multitexture) && defined(WITH_GLEXT) - if (!getenv("WITHOUT_GLEXT")) { - for(int i=0; i -#endif //WIN32 -#ifdef __APPLE__ -#define GL_GLEXT_LEGACY 1 -#include -#else -#include -#endif +#include "GL/glew.h" #include "RAS_IRenderTools.h" #include "RAS_IRasterizer.h" @@ -317,7 +308,7 @@ void KX_BlenderRenderTools::EnableOpenGLLights() glEnable(GL_COLOR_MATERIAL); glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE); glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, true); - if (bgl::QueryExtension(bgl::_GL_EXT_separate_specular_color) || bgl::QueryVersion(1, 2)) + if (GLEW_EXT_separate_specular_color || GLEW_VERSION_1_2) glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR); } diff --git a/source/gameengine/BlenderRoutines/Makefile b/source/gameengine/BlenderRoutines/Makefile index 64a17f44a84..a7394158a20 100644 --- a/source/gameengine/BlenderRoutines/Makefile +++ b/source/gameengine/BlenderRoutines/Makefile @@ -35,7 +35,6 @@ include nan_compile.mk CCFLAGS += $(LEVEL_1_CPP_WARNINGS) -CPPFLAGS += -I$(OPENGL_HEADERS) CPPFLAGS += -I$(NAN_SUMO)/include -I$(NAN_SOLID)/include CPPFLAGS += -I$(NAN_SOLID) CPPFLAGS += -I$(NAN_STRING)/include @@ -43,6 +42,8 @@ CPPFLAGS += -I$(NAN_MOTO)/include CPPFLAGS += -I$(NAN_BMFONT)/include CPPFLAGS += -I$(NAN_FUZZICS)/include CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include +CPPFLAGS += -I$(NAN_GLEW)/include +CPPFLAGS += -I$(OPENGL_HEADERS) # because of kernel dependency on makesdna CPPFLAGS += -I../../blender/makesdna CPPFLAGS += -I../../blender/include diff --git a/source/gameengine/BlenderRoutines/SConscript b/source/gameengine/BlenderRoutines/SConscript index 95e1da2d470..327f4798e04 100644 --- a/source/gameengine/BlenderRoutines/SConscript +++ b/source/gameengine/BlenderRoutines/SConscript @@ -15,6 +15,7 @@ incs += ' #source/gameengine/SceneGraph #source/gameengine/Physics/common' incs += ' #source/gameengine/Physics/Bullet #source/gameengine/Physics/Sumo' incs += ' #source/gameengine/Physics/Sumo/Fuzzics/include #source/gameengine/Network/LoopBackNetwork' incs += ' #intern/SoundSystem #source/blender/misc #source/blender/blenloader' +incs += ' #extern/glew/include' incs += ' ' + env['BF_PYTHON_INC'] incs += ' ' + env['BF_SOLID_INC'] diff --git a/source/gameengine/BlenderRoutines/mac_compat_glext.h b/source/gameengine/BlenderRoutines/mac_compat_glext.h deleted file mode 100644 index 0ec676963b1..00000000000 --- a/source/gameengine/BlenderRoutines/mac_compat_glext.h +++ /dev/null @@ -1,132 +0,0 @@ -#ifndef __mac_compat_glext_h_ -#define __mac_compat_glext_h_ - - -#ifdef __cplusplus -extern "C" { -#endif - -#define APIENTRYP * -# define GL_GLEXT_LEGACY 1 -# include - -//#if GL_ARB_shader_objects -typedef char GLcharARB; -typedef void *GLhandleARB; -//#endif - -//#if GL_ARB_vertex_buffer_object -typedef long GLintptrARB; -typedef long GLsizeiptrARB; -//#endif - - -// GL_ARB_multitexture -typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); - -//GL_ARB_shader_objects -typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (unsigned int obj); -typedef unsigned int (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); -typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (unsigned int containerObj, unsigned int attachedObj); -typedef unsigned int (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); -typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (unsigned int shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length); -typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (unsigned int shaderObj); -typedef unsigned int (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void); -typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (unsigned int containerObj, unsigned int obj); -typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (unsigned int programObj); -typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (unsigned int programObj); -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (unsigned int programObj); -typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); -typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (unsigned int obj, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (unsigned int obj, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (unsigned int obj, GLsizei maxLength, GLsizei *length, void *infoLog); -typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (unsigned int containerObj, GLsizei maxCount, GLsizei *count, unsigned int *obj); -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (unsigned int programObj, const void *name); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (unsigned int programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (unsigned int programObj, GLint location, GLfloat *params); -typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (unsigned int programObj, GLint location, GLint *params); -typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (unsigned int obj, GLsizei maxLength, GLsizei *length, void *source); - - -//GL_ARB_vertex_shader -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (unsigned int programObj, GLuint index, const GLcharARB *name); -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (unsigned int programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (unsigned int programObj, const GLcharARB *name); - - -//GL_ARB_vertex_program -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); - -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_COMPILE_STATUS 0x8B81 -#define GL_LINK_STATUS 0x8B82 -#define GL_VALIDATE_STATUS 0x8B83 - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index 1055c8771ef..ad126ebf123 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -134,14 +134,14 @@ void BL_ActionActuator::SetStartTime(float curtime) float direction = m_startframe < m_endframe ? 1.0 : -1.0; if (!(m_flag & ACT_FLAG_REVERSE)) - m_starttime = curtime - direction*(m_localtime - m_startframe)/KX_FIXED_FRAME_PER_SEC; + m_starttime = curtime - direction*(m_localtime - m_startframe)/KX_KetsjiEngine::GetAnimFrameRate(); else - m_starttime = curtime - direction*(m_endframe - m_localtime)/KX_FIXED_FRAME_PER_SEC; + m_starttime = curtime - direction*(m_endframe - m_localtime)/KX_KetsjiEngine::GetAnimFrameRate(); } void BL_ActionActuator::SetLocalTime(float curtime) { - float delta_time = (curtime - m_starttime)*KX_FIXED_FRAME_PER_SEC; + float delta_time = (curtime - m_starttime)*KX_KetsjiEngine::GetAnimFrameRate(); if (m_endframe < m_startframe) delta_time = -delta_time; @@ -385,7 +385,7 @@ bool BL_ActionActuator::Update(double curtime, bool frame) blend_poses(m_pose, m_blendpose, 1.0 - newweight, ACTSTRIPMODE_BLEND); /* Increment current blending percentage */ - m_blendframe = (curtime - m_blendstart)*KX_FIXED_FRAME_PER_SEC; + m_blendframe = (curtime - m_blendstart)*KX_KetsjiEngine::GetAnimFrameRate(); if (m_blendframe>m_blendin) m_blendframe = m_blendin; diff --git a/source/gameengine/Converter/BL_ArmatureObject.cpp b/source/gameengine/Converter/BL_ArmatureObject.cpp index 08567dde840..f73d5b42a01 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.cpp +++ b/source/gameengine/Converter/BL_ArmatureObject.cpp @@ -92,9 +92,10 @@ BL_ArmatureObject::~BL_ArmatureObject() /* there is only 1 unique Pose per Armature */ void BL_ArmatureObject::ApplyPose() { - if (m_pose){ + if (m_pose) { // copy to armature object - extract_pose_from_pose(m_objArma->pose, m_pose); + if (m_objArma->pose != m_pose)/* This should never happen but it does - Campbell */ + extract_pose_from_pose(m_objArma->pose, m_pose); // is this needed anymore? //if (!m_mrdPose) @@ -143,7 +144,7 @@ void BL_ArmatureObject::GetPose(bPose **pose) { /* If the caller supplies a null pose, create a new one. */ /* Otherwise, copy the armature's pose channels into the caller-supplied pose */ - + if (!*pose) { /* probably not to good of an idea to duplicate everying, but it clears up diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 82d16ffa181..32946267202 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -88,7 +88,9 @@ #include "BKE_main.h" #include "BKE_global.h" #include "BKE_object.h" +#include "BKE_scene.h" #include "BL_SkinMeshObject.h" +#include "BL_ShapeDeformer.h" #include "BL_SkinDeformer.h" #include "BL_MeshDeformer.h" //#include "BL_ArmatureController.h" @@ -222,15 +224,16 @@ static unsigned int KX_Mcol2uint_new(MCol col) static void SetDefaultFaceType(Scene* scene) { default_face_mode = TF_DYNAMIC; - Base *base = static_cast(scene->base.first); - while(base) + Scene *sce; + Base *base; + + for(SETLOOPER(scene,base)) { if (base->object->type == OB_LAMP) { default_face_mode = TF_DYNAMIC|TF_LIGHT; return; } - base = base->next; } } @@ -509,6 +512,7 @@ BL_Material* ConvertMaterial( } } } + // above one tex the switches here // are not used switch(valid_index) { @@ -541,7 +545,7 @@ BL_Material* ConvertMaterial( material->amb = mat->amb; // set alpha testing without z-sorting - if( ( validface && (!tface->transp)) && mat->mode & MA_ZTRA) { + if( ( validface && (!(tface->transp &~ TF_CLIP))) && mat->mode & MA_ZTRA) { // sets the RAS_IPolyMaterial::m_flag |RAS_FORCEALPHA // this is so we don't have the overhead of the z-sorting code material->ras_mode|=ALPHA_TEST; @@ -587,6 +591,9 @@ BL_Material* ConvertMaterial( MT_Point2 uv[4]; MT_Point2 uv2[4]; + uv[0]= uv[1]= uv[2]= uv[3]= MT_Point2(0.0f, 0.0f); + uv2[0]= uv2[1]= uv2[2]= uv2[3]= MT_Point2(0.0f, 0.0f); + if( validface ) { material->ras_mode |= !( @@ -597,7 +604,7 @@ BL_Material* ConvertMaterial( material->ras_mode |= ( (tface->mode & TF_DYNAMIC)!= 0 )?COLLIDER:0; material->transp = tface->transp; - if(tface->transp) + if(tface->transp&~TF_CLIP) material->ras_mode |= TRANSP; material->tile = tface->tile; @@ -730,14 +737,14 @@ static MT_Vector4* BL_ComputeMeshTangentSpace(Mesh* mesh) MT_Vector3 *tan1 = new MT_Vector3[mesh->totvert]; MT_Vector3 *tan2 = new MT_Vector3[mesh->totvert]; - unsigned int v; + int v; for (v = 0; v < mesh->totvert; v++) { tan1[v] = MT_Vector3(0.0, 0.0, 0.0); tan2[v] = MT_Vector3(0.0, 0.0, 0.0); } - for (unsigned int p = 0; p < mesh->totface; p++, mface++, tface++) + for (int p = 0; p < mesh->totface; p++, mface++, tface++) { MT_Vector3 v1(mesh->mvert[mface->v1].co), v2(mesh->mvert[mface->v2].co), @@ -795,12 +802,12 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* // Determine if we need to make a skinned mesh - if (mesh->dvert){ - meshobj = new BL_SkinMeshObject(lightlayer); + if (mesh->dvert || mesh->key){ + meshobj = new BL_SkinMeshObject(mesh, lightlayer); skinMesh = true; } else { - meshobj = new RAS_MeshObject(lightlayer); + meshobj = new RAS_MeshObject(mesh, lightlayer); } MT_Vector4 *tangent = 0; if (tface) @@ -829,9 +836,10 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* } } - meshobj->SetName(mesh->id.name); meshobj->m_xyz_index_to_vertex_index_mapping.resize(mesh->totvert); + if(skinMesh) + ((BL_SkinMeshObject*)meshobj)->m_mvert_to_dvert_mapping.resize(mesh->totvert); for (int f=0;ftotface;f++,mface++) { @@ -881,7 +889,7 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* Material* ma = 0; bool polyvisible = true; RAS_IPolyMaterial* polymat = NULL; - BL_Material *bl_mat; + BL_Material *bl_mat = NULL; if(converter->GetMaterials()) { @@ -891,6 +899,7 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* ma = give_current_material(blenderobj, 1); bl_mat = ConvertMaterial(mesh, ma, tface, mface, mmcol, lightlayer, blenderobj, layers); + bl_mat->glslmat = converter->GetGLSLMaterials(); // set the index were dealing with bl_mat->material_index = (int)mface->mat_nr; @@ -946,7 +955,7 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* // Use texface colors if available //TF_DYNAMIC means the polygon is a collision face collider = ((tface->mode & TF_DYNAMIC) != 0); - transp = tface->transp; + transp = tface->transp &~ TF_CLIP; tile = tface->tile; mode = tface->mode; @@ -1065,19 +1074,19 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* d3=((BL_SkinMeshObject*)meshobj)->FindOrAddDeform(vtxarray, mface->v3, &mesh->dvert[mface->v3], polymat); if (nverts==4) d4=((BL_SkinMeshObject*)meshobj)->FindOrAddDeform(vtxarray, mface->v4, &mesh->dvert[mface->v4], polymat); - poly->SetVertex(0,((BL_SkinMeshObject*)meshobj)->FindOrAddVertex(vtxarray,pt0,uv0,uv20,tan0,rgb0,no0,d1,flat, polymat)); - poly->SetVertex(1,((BL_SkinMeshObject*)meshobj)->FindOrAddVertex(vtxarray,pt1,uv1,uv21,tan1,rgb1,no1,d2,flat, polymat)); - poly->SetVertex(2,((BL_SkinMeshObject*)meshobj)->FindOrAddVertex(vtxarray,pt2,uv2,uv22,tan2,rgb2,no2,d3,flat, polymat)); + poly->SetVertex(0,((BL_SkinMeshObject*)meshobj)->FindOrAddVertex(vtxarray,pt0,uv0,uv20,tan0,rgb0,no0,d1,flat,polymat,mface->v1)); + poly->SetVertex(1,((BL_SkinMeshObject*)meshobj)->FindOrAddVertex(vtxarray,pt1,uv1,uv21,tan1,rgb1,no1,d2,flat,polymat,mface->v2)); + poly->SetVertex(2,((BL_SkinMeshObject*)meshobj)->FindOrAddVertex(vtxarray,pt2,uv2,uv22,tan2,rgb2,no2,d3,flat,polymat,mface->v3)); if (nverts==4) - poly->SetVertex(3,((BL_SkinMeshObject*)meshobj)->FindOrAddVertex(vtxarray,pt3,uv3,uv23,tan3,rgb3,no3,d4, flat,polymat)); + poly->SetVertex(3,((BL_SkinMeshObject*)meshobj)->FindOrAddVertex(vtxarray,pt3,uv3,uv23,tan3,rgb3,no3,d4,flat,polymat,mface->v4)); } else { - poly->SetVertex(0,meshobj->FindOrAddVertex(vtxarray,pt0,uv0,uv20,tan0,rgb0,no0,polymat,mface->v1)); - poly->SetVertex(1,meshobj->FindOrAddVertex(vtxarray,pt1,uv1,uv21,tan1,rgb1,no1,polymat,mface->v2)); - poly->SetVertex(2,meshobj->FindOrAddVertex(vtxarray,pt2,uv2,uv22,tan2,rgb2,no2,polymat,mface->v3)); + poly->SetVertex(0,meshobj->FindOrAddVertex(vtxarray,pt0,uv0,uv20,tan0,rgb0,no0,false,polymat,mface->v1)); + poly->SetVertex(1,meshobj->FindOrAddVertex(vtxarray,pt1,uv1,uv21,tan1,rgb1,no1,false,polymat,mface->v2)); + poly->SetVertex(2,meshobj->FindOrAddVertex(vtxarray,pt2,uv2,uv22,tan2,rgb2,no2,false,polymat,mface->v3)); if (nverts==4) - poly->SetVertex(3,meshobj->FindOrAddVertex(vtxarray,pt3,uv3,uv23,tan3,rgb3,no3,polymat,mface->v4)); + poly->SetVertex(3,meshobj->FindOrAddVertex(vtxarray,pt3,uv3,uv23,tan3,rgb3,no3,false,polymat,mface->v4)); } meshobj->AddPolygon(poly); if (poly->IsCollider()) @@ -1115,6 +1124,9 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* layer.face++; } } + meshobj->m_xyz_index_to_vertex_index_mapping.clear(); + if(skinMesh) + ((BL_SkinMeshObject*)meshobj)->m_mvert_to_dvert_mapping.clear(); meshobj->UpdateMaterialList(); // pre calculate texture generation @@ -1634,7 +1646,7 @@ static KX_GameObject *gameobject_from_blenderobject( // needed for python scripting kxscene->GetLogicManager()->RegisterMeshName(meshobj->GetName(),meshobj); - gameobj = new BL_DeformableGameObject(kxscene,KX_Scene::m_callbacks); + gameobj = new BL_DeformableGameObject(ob,kxscene,KX_Scene::m_callbacks); // set transformation gameobj->AddMesh(meshobj); @@ -1645,12 +1657,24 @@ static KX_GameObject *gameobject_from_blenderobject( ((ob->gameflag2 & OB_NEVER_DO_ACTIVITY_CULLING)!=0); gameobj->SetIgnoreActivityCulling(ignoreActivityCulling); - // If this is a skin object, make Skin Controller - if (ob->parent && ob->parent->type == OB_ARMATURE && ob->partype==PARSKEL && ((Mesh*)ob->data)->dvert){ + // two options exists for deform: shape keys and armature + // only support relative shape key + bool bHasShapeKey = mesh->key != NULL && mesh->key->type==KEY_RELATIVE; + bool bHasDvert = mesh->dvert != NULL; + bool bHasArmature = (ob->parent && ob->parent->type == OB_ARMATURE && ob->partype==PARSKEL && bHasDvert); + + if (bHasShapeKey) { + // not that we can have shape keys without dvert! + BL_ShapeDeformer *dcont = new BL_ShapeDeformer((BL_DeformableGameObject*)gameobj, + ob, (BL_SkinMeshObject*)meshobj); + ((BL_DeformableGameObject*)gameobj)->m_pDeformer = dcont; + } else if (bHasArmature) { BL_SkinDeformer *dcont = new BL_SkinDeformer(ob, (BL_SkinMeshObject*)meshobj ); ((BL_DeformableGameObject*)gameobj)->m_pDeformer = dcont; - } - else if (((Mesh*)ob->data)->dvert){ + } else if (bHasDvert) { + // this case correspond to a mesh that can potentially deform but not with the + // object to which it is attached for the moment. A skin mesh was created in + // BL_ConvertMesh() so must create a deformer too! BL_MeshDeformer *dcont = new BL_MeshDeformer(ob, (BL_SkinMeshObject*)meshobj ); ((BL_DeformableGameObject*)gameobj)->m_pDeformer = dcont; } @@ -1686,6 +1710,7 @@ static KX_GameObject *gameobject_from_blenderobject( { gameobj->SetPhysicsEnvironment(kxscene->GetPhysicsEnvironment()); gameobj->SetLayer(ob->lay); + gameobj->SetBlenderObject(ob); } return gameobj; } @@ -1808,6 +1833,9 @@ void BL_ConvertBlenderObjects(struct Main* maggie, { Scene *blenderscene = GetSceneForName(maggie, scenename); + // for SETLOOPER + Scene *sce; + Base *base; // Get the frame settings of the canvas. // Get the aspect ratio of the canvas as designed by the user. @@ -1881,9 +1909,11 @@ void BL_ConvertBlenderObjects(struct Main* maggie, } SetDefaultFaceType(blenderscene); - - Base *base = static_cast(blenderscene->base.first); - while(base) + // Let's support scene set. + // Beware of name conflict in linked data, it will not crash but will create confusion + // in Python scripting and in certain actuators (replace mesh). Linked scene *should* have + // no conflicting name for Object, Object data and Action. + for (SETLOOPER(blenderscene, base)) { Object* blenderobject = base->object; KX_GameObject* gameobj = gameobject_from_blenderobject( @@ -2038,7 +2068,6 @@ void BL_ConvertBlenderObjects(struct Main* maggie, if (gameobj) gameobj->Release(); - base = base->next; } if (blenderscene->camera) { @@ -2048,7 +2077,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, } // Set up armatures - for (base = static_cast(blenderscene->base.first); base; base=base->next){ + for(SETLOOPER(blenderscene, base)){ if (base->object->type==OB_MESH){ Mesh *me = (Mesh*)base->object->data; diff --git a/source/gameengine/Converter/BL_DeformableGameObject.cpp b/source/gameengine/Converter/BL_DeformableGameObject.cpp index 68a2e41ca47..d23274324ee 100644 --- a/source/gameengine/Converter/BL_DeformableGameObject.cpp +++ b/source/gameengine/Converter/BL_DeformableGameObject.cpp @@ -28,6 +28,8 @@ */ #include "BL_DeformableGameObject.h" +#include "BL_ShapeDeformer.h" +#include "BL_ShapeActionActuator.h" #ifdef HAVE_CONFIG_H #include @@ -60,3 +62,48 @@ CValue* BL_DeformableGameObject::GetReplica() ProcessReplica(replica); return replica; } + +bool BL_DeformableGameObject::SetActiveAction(BL_ShapeActionActuator *act, short priority, double curtime) +{ + if (curtime != m_lastframe){ + m_activePriority = 9999; + m_lastframe= curtime; + m_activeAct = NULL; + } + + if (priority<=m_activePriority) + { + if (m_activeAct && (m_activeAct!=act)) + m_activeAct->SetBlendTime(0.0f); /* Reset the blend timer */ + m_activeAct = act; + m_activePriority = priority; + m_lastframe = curtime; + + return true; + } + else{ + act->SetBlendTime(0.0f); + return false; + } +} + +bool BL_DeformableGameObject::GetShape(vector &shape) +{ + shape.clear(); + if (m_pDeformer) + { + Mesh* mesh = ((BL_MeshDeformer*)m_pDeformer)->GetMesh(); + // this check is normally superfluous: a shape deformer can only be created if the mesh + // has relative keys + if (mesh && mesh->key && mesh->key->type==KEY_RELATIVE) + { + KeyBlock *kb; + for (kb = (KeyBlock*)mesh->key->block.first; kb; kb = (KeyBlock*)kb->next) + { + shape.push_back(kb->curval); + } + } + } + return !shape.empty(); +} + diff --git a/source/gameengine/Converter/BL_DeformableGameObject.h b/source/gameengine/Converter/BL_DeformableGameObject.h index d943cc7388a..57a404ad72b 100644 --- a/source/gameengine/Converter/BL_DeformableGameObject.h +++ b/source/gameengine/Converter/BL_DeformableGameObject.h @@ -34,15 +34,28 @@ #pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning #endif //WIN32 +#include "DNA_mesh_types.h" #include "KX_GameObject.h" -#include "RAS_Deformer.h" +#include "BL_MeshDeformer.h" +#include + +class BL_ShapeActionActuator; +struct Key; class BL_DeformableGameObject : public KX_GameObject { public: - RAS_Deformer *m_pDeformer; CValue* GetReplica(); + + double GetLastFrame () + { + return m_lastframe; + } + Object* GetBlendObject() + { + return m_blendobj; + } virtual void Relink(GEN_Map*map) { if (m_pDeformer) @@ -50,13 +63,32 @@ public: }; void ProcessReplica(KX_GameObject* replica); - BL_DeformableGameObject(void* sgReplicationInfo, SG_Callbacks callbacks) : + BL_DeformableGameObject(Object* blendobj, void* sgReplicationInfo, SG_Callbacks callbacks) : KX_GameObject(sgReplicationInfo,callbacks), - m_pDeformer(NULL) + m_pDeformer(NULL), + m_activeAct(NULL), + m_lastframe(0.), + m_blendobj(blendobj), + m_activePriority(9999) { m_isDeformable = true; }; virtual ~BL_DeformableGameObject(); + bool SetActiveAction(class BL_ShapeActionActuator *act, short priority, double curtime); + + bool GetShape(vector &shape); + Key* GetKey() + { + return (m_pDeformer) ? ((BL_MeshDeformer*)m_pDeformer)->GetMesh()->key : NULL; + } + +public: + RAS_Deformer *m_pDeformer; +protected: + class BL_ShapeActionActuator *m_activeAct; + double m_lastframe; + Object* m_blendobj; + short m_activePriority; }; diff --git a/source/gameengine/Converter/BL_MeshDeformer.cpp b/source/gameengine/Converter/BL_MeshDeformer.cpp index ab31179b047..212827a660f 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.cpp +++ b/source/gameengine/Converter/BL_MeshDeformer.cpp @@ -43,27 +43,25 @@ #include "BL_SkinMeshObject.h" #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" -#include "BLI_arithb.h" #include "GEN_Map.h" #include "STR_HashedString.h" - bool BL_MeshDeformer::Apply(RAS_IPolyMaterial *mat) { size_t i, j, index; vecVertexArray array; vecIndexArrays mvarray; vecIndexArrays diarray; - + RAS_TexVert *tv; MVert *mvert; - + // For each material array = m_pMeshObject->GetVertexCache(mat); mvarray = m_pMeshObject->GetMVertCache(mat); diarray = m_pMeshObject->GetDIndexCache(mat); - + // For each array for (i=0; itotvert; v++){ - m_transnors[v]=MT_Point3(0,0,0); - } - - /* Find the face normals */ - for (f = 0; ftotface; f++){ - // Make new face normal based on the transverts - MFace *mf= &((MFace*)m_bmesh->mface)[f]; - - if (mf->v3) { - for (int vl=0; vl<3; vl++){ - co1[vl]=m_transverts[mf->v1][vl]; - co2[vl]=m_transverts[mf->v2][vl]; - co3[vl]=m_transverts[mf->v3][vl]; - if (mf->v4) - co4[vl]=m_transverts[mf->v4][vl]; + vecIndexArrays indexarrays; + vecIndexArrays mvarrays; + vecIndexArrays diarrays; + vecVertexArray vertexarrays; + size_t i, j; + + /* set vertex normals to zero */ + for (i=0; i<(size_t)m_bmesh->totvert; i++) + m_transnors[i] = MT_Vector3(0.0f, 0.0f, 0.0f); + + /* add face normals to vertices. */ + for(RAS_MaterialBucket::Set::iterator mit = m_pMeshObject->GetFirstMaterial(); + mit != m_pMeshObject->GetLastMaterial(); ++ mit) { + RAS_IPolyMaterial *mat = (*mit)->GetPolyMaterial(); + + indexarrays = m_pMeshObject->GetIndexCache(mat); + vertexarrays = m_pMeshObject->GetVertexCache(mat); + diarrays = m_pMeshObject->GetDIndexCache(mat); + mvarrays = m_pMeshObject->GetMVertCache(mat); + + for (i=0; iUsesTriangles()? 3: 4; + + for(j=0; jv4) - CalcNormFloat4(co1, co2, co3, co4, fnor); - else - CalcNormFloat(co1, co2, co3, fnor); - - /* Decide which normals are affected by this face's normal */ - m_transnors[mf->v1]+=MT_Point3(fnor); - m_transnors[mf->v2]+=MT_Point3(fnor); - m_transnors[mf->v3]+=MT_Point3(fnor); - if (mf->v4) - m_transnors[mf->v4]+=MT_Point3(fnor); } } - - for (v =0; vtotvert; v++){ -// float nor[3]; - m_transnors[v]=m_transnors[v].safe_normalized(); -// nor[0]=m_transnors[v][0]; -// nor[1]=m_transnors[v][1]; -// nor[2]=m_transnors[v][2]; - - }; + /* assign smooth vertex normals */ + for(RAS_MaterialBucket::Set::iterator mit = m_pMeshObject->GetFirstMaterial(); + mit != m_pMeshObject->GetLastMaterial(); ++ mit) { + RAS_IPolyMaterial *mat = (*mit)->GetPolyMaterial(); + + vertexarrays = m_pMeshObject->GetVertexCache(mat); + diarrays = m_pMeshObject->GetDIndexCache(mat); + mvarrays = m_pMeshObject->GetMVertCache(mat); + + for (i=0; itotvert+m_bmesh->totface){ + if (m_tvtot!=m_bmesh->totvert){ if (m_transverts) - delete []m_transverts; + delete [] m_transverts; if (m_transnors) - delete []m_transnors; + delete [] m_transnors; - m_transnors =new MT_Point3[m_bmesh->totvert+m_bmesh->totface]; m_transverts=new float[(sizeof(*m_transverts)*m_bmesh->totvert)][3]; + m_transnors=new MT_Vector3[m_bmesh->totvert]; m_tvtot = m_bmesh->totvert; } } diff --git a/source/gameengine/Converter/BL_MeshDeformer.h b/source/gameengine/Converter/BL_MeshDeformer.h index a6be11d786e..8d8b56b1eed 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.h +++ b/source/gameengine/Converter/BL_MeshDeformer.h @@ -32,6 +32,7 @@ #include "RAS_Deformer.h" #include "DNA_object_types.h" +#include "DNA_key_types.h" #include "MT_Point3.h" #include @@ -48,26 +49,26 @@ public: BL_MeshDeformer(struct Object* obj, class BL_SkinMeshObject *meshobj ): m_pMeshObject(meshobj), m_bmesh((struct Mesh*)(obj->data)), + m_transverts(0), + m_transnors(0), m_objMesh(obj), - m_transnors(NULL), - m_transverts(NULL), m_tvtot(0) {}; virtual ~BL_MeshDeformer(); virtual void SetSimulatedTime(double time){}; virtual bool Apply(class RAS_IPolyMaterial *mat); - virtual void Update(void){}; + virtual bool Update(void){ return false; }; virtual RAS_Deformer* GetReplica(){return NULL;}; + struct Mesh* GetMesh() { return m_bmesh; }; // virtual void InitDeform(double time){}; protected: class BL_SkinMeshObject* m_pMeshObject; struct Mesh* m_bmesh; - MT_Point3* m_transnors; - //MT_Point3* m_transverts; // this is so m_transverts doesn't need to be converted // before deformation float (*m_transverts)[3]; + MT_Vector3* m_transnors; struct Object* m_objMesh; // -- int m_tvtot; diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp new file mode 100644 index 00000000000..58d46d76e5b --- /dev/null +++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp @@ -0,0 +1,797 @@ +/** +* $Id$ +* + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** +*/ + +#if defined (__sgi) +#include +#else +#include +#endif + +#include "SCA_LogicManager.h" +#include "BL_ShapeActionActuator.h" +#include "BL_ActionActuator.h" +#include "BL_ShapeDeformer.h" +#include "KX_GameObject.h" +#include "STR_HashedString.h" +#include "DNA_action_types.h" +#include "DNA_nla_types.h" +#include "DNA_actuator_types.h" +#include "BKE_action.h" +#include "DNA_armature_types.h" +#include "MEM_guardedalloc.h" +#include "BLI_blenlib.h" +#include "BLI_arithb.h" +#include "MT_Matrix4x4.h" +#include "BKE_utildefines.h" + +#ifdef HAVE_CONFIG_H +#include +#endif + +BL_ShapeActionActuator::~BL_ShapeActionActuator() +{ +} + +void BL_ShapeActionActuator::ProcessReplica() +{ + m_localtime=m_startframe; + m_lastUpdate=-1; +} + +void BL_ShapeActionActuator::SetBlendTime (float newtime) +{ + m_blendframe = newtime; +} + +CValue* BL_ShapeActionActuator::GetReplica() +{ + BL_ShapeActionActuator* replica = new BL_ShapeActionActuator(*this);//m_float,GetName()); + replica->ProcessReplica(); + + // this will copy properties and so on... + CValue::AddDataToReplica(replica); + return replica; +} + +bool BL_ShapeActionActuator::ClampLocalTime() +{ + if (m_startframe < m_endframe) { + if (m_localtime < m_startframe) + { + m_localtime = m_startframe; + return true; + } + else if (m_localtime > m_endframe) + { + m_localtime = m_endframe; + return true; + } + } else { + if (m_localtime > m_startframe) + { + m_localtime = m_startframe; + return true; + } + else if (m_localtime < m_endframe) + { + m_localtime = m_endframe; + return true; + } + } + return false; +} + +void BL_ShapeActionActuator::SetStartTime(float curtime) +{ + float direction = m_startframe < m_endframe ? 1.0 : -1.0; + + if (!(m_flag & ACT_FLAG_REVERSE)) + m_starttime = curtime - direction*(m_localtime - m_startframe)/KX_KetsjiEngine::GetAnimFrameRate(); + else + m_starttime = curtime - direction*(m_endframe - m_localtime)/KX_KetsjiEngine::GetAnimFrameRate(); +} + +void BL_ShapeActionActuator::SetLocalTime(float curtime) +{ + float delta_time = (curtime - m_starttime)*KX_KetsjiEngine::GetAnimFrameRate(); + + if (m_endframe < m_startframe) + delta_time = -delta_time; + + if (!(m_flag & ACT_FLAG_REVERSE)) + m_localtime = m_startframe + delta_time; + else + m_localtime = m_endframe - delta_time; +} + +void BL_ShapeActionActuator::BlendShape(Key* key, float srcweight) +{ + vector::const_iterator it; + float dstweight; + int i; + KeyBlock *kb; + + dstweight = 1.0F - srcweight; + + for (it=m_blendshape.begin(), kb = (KeyBlock*)key->block.first; + kb && it != m_blendshape.end(); + kb = (KeyBlock*)kb->next, it++) { + kb->curval = kb->curval * dstweight + (*it) * srcweight; + } +} + +bool BL_ShapeActionActuator::Update(double curtime, bool frame) +{ + bool bNegativeEvent = false; + bool bPositiveEvent = false; + bool keepgoing = true; + bool wrap = false; + bool apply=true; + int priority; + float newweight; + + // result = true if animation has to be continued, false if animation stops + // maybe there are events for us in the queue ! + if (frame) + { + for (vector::iterator i=m_events.begin(); !(i==m_events.end());i++) + { + if ((*i)->GetNumber() == 0.0f) + bNegativeEvent = true; + else + bPositiveEvent= true; + (*i)->Release(); + + } + m_events.clear(); + + if (bPositiveEvent) + m_flag |= ACT_FLAG_ACTIVE; + + if (bNegativeEvent) + { + if (!(m_flag & ACT_FLAG_ACTIVE)) + return false; + m_flag &= ~ACT_FLAG_ACTIVE; + } + } + + /* This action can only be attached to a deform object */ + BL_DeformableGameObject *obj = (BL_DeformableGameObject*)GetParent(); + float length = m_endframe - m_startframe; + + priority = m_priority; + + /* Determine pre-incrementation behaviour and set appropriate flags */ + switch (m_playtype){ + case ACT_ACTION_MOTION: + if (bNegativeEvent){ + keepgoing=false; + apply=false; + }; + break; + case ACT_ACTION_FROM_PROP: + if (bNegativeEvent){ + apply=false; + keepgoing=false; + } + break; + case ACT_ACTION_LOOP_END: + if (bPositiveEvent){ + if (!(m_flag & ACT_FLAG_LOCKINPUT)){ + m_flag &= ~ACT_FLAG_KEYUP; + m_flag &= ~ACT_FLAG_REVERSE; + m_flag |= ACT_FLAG_LOCKINPUT; + m_localtime = m_startframe; + m_starttime = curtime; + } + } + if (bNegativeEvent){ + m_flag |= ACT_FLAG_KEYUP; + } + break; + case ACT_ACTION_LOOP_STOP: + if (bPositiveEvent){ + if (!(m_flag & ACT_FLAG_LOCKINPUT)){ + m_flag &= ~ACT_FLAG_REVERSE; + m_flag &= ~ACT_FLAG_KEYUP; + m_flag |= ACT_FLAG_LOCKINPUT; + SetStartTime(curtime); + } + } + if (bNegativeEvent){ + m_flag |= ACT_FLAG_KEYUP; + m_flag &= ~ACT_FLAG_LOCKINPUT; + keepgoing=false; + apply=false; + } + break; + case ACT_ACTION_FLIPPER: + if (bPositiveEvent){ + if (!(m_flag & ACT_FLAG_LOCKINPUT)){ + m_flag &= ~ACT_FLAG_REVERSE; + m_flag |= ACT_FLAG_LOCKINPUT; + SetStartTime(curtime); + } + } + else if (bNegativeEvent){ + m_flag |= ACT_FLAG_REVERSE; + m_flag &= ~ACT_FLAG_LOCKINPUT; + SetStartTime(curtime); + } + break; + case ACT_ACTION_PLAY: + if (bPositiveEvent){ + if (!(m_flag & ACT_FLAG_LOCKINPUT)){ + m_flag &= ~ACT_FLAG_REVERSE; + m_localtime = m_starttime; + m_starttime = curtime; + m_flag |= ACT_FLAG_LOCKINPUT; + } + } + break; + default: + break; + } + + /* Perform increment */ + if (keepgoing){ + if (m_playtype == ACT_ACTION_MOTION){ + MT_Point3 newpos; + MT_Point3 deltapos; + + newpos = obj->NodeGetWorldPosition(); + + /* Find displacement */ + deltapos = newpos-m_lastpos; + m_localtime += (length/m_stridelength) * deltapos.length(); + m_lastpos = newpos; + } + else{ + SetLocalTime(curtime); + } + } + + /* Check if a wrapping response is needed */ + if (length){ + if (m_localtime < m_startframe || m_localtime > m_endframe) + { + m_localtime = m_startframe + fmod(m_localtime, length); + wrap = true; + } + } + else + m_localtime = m_startframe; + + /* Perform post-increment tasks */ + switch (m_playtype){ + case ACT_ACTION_FROM_PROP: + { + CValue* propval = GetParent()->GetProperty(m_propname); + if (propval) + m_localtime = propval->GetNumber(); + + if (bNegativeEvent){ + keepgoing=false; + } + } + break; + case ACT_ACTION_MOTION: + break; + case ACT_ACTION_LOOP_STOP: + break; + case ACT_ACTION_FLIPPER: + if (wrap){ + if (!(m_flag & ACT_FLAG_REVERSE)){ + m_localtime=m_endframe; + //keepgoing = false; + } + else { + m_localtime=m_startframe; + keepgoing = false; + } + } + break; + case ACT_ACTION_LOOP_END: + if (wrap){ + if (m_flag & ACT_FLAG_KEYUP){ + keepgoing = false; + m_localtime = m_endframe; + m_flag &= ~ACT_FLAG_LOCKINPUT; + } + SetStartTime(curtime); + } + break; + case ACT_ACTION_PLAY: + if (wrap){ + m_localtime = m_endframe; + keepgoing = false; + m_flag &= ~ACT_FLAG_LOCKINPUT; + } + break; + default: + keepgoing = false; + break; + } + + + if (bNegativeEvent) + m_blendframe=0.0f; + + /* Apply the pose if necessary*/ + if (apply) { + + /* Priority test */ + if (obj->SetActiveAction(this, priority, curtime)){ + Key *key = obj->GetKey(); + + if (!key) { + // this could happen if the mesh was changed in the middle of an action + // and the new mesh has no key, stop the action + keepgoing = false; + } + else { + ListBase tchanbase= {NULL, NULL}; + + if (m_blendin && m_blendframe==0.0f){ + // this is the start of the blending, remember the startup shape + obj->GetShape(m_blendshape); + m_blendstart = curtime; + } + // only interested in shape channel + extract_ipochannels_from_action(&tchanbase, &key->id, m_action, "Shape", m_localtime); + + if (!execute_ipochannels(&tchanbase)) { + // no update, this is possible if action does not match the keys, stop the action + keepgoing = false; + } + else { + // the key have changed, apply blending if needed + if (m_blendin && (m_blendframem_blendin) + m_blendframe = m_blendin; + } + m_lastUpdate = m_localtime; + } + BLI_freelistN(&tchanbase); + } + } + else{ + m_blendframe = 0.0f; + } + } + + if (!keepgoing){ + m_blendframe = 0.0f; + } + return keepgoing; +}; + +/* ------------------------------------------------------------------------- */ +/* Python functions */ +/* ------------------------------------------------------------------------- */ + +/* Integration hooks ------------------------------------------------------- */ + +PyTypeObject BL_ShapeActionActuator::Type = { + PyObject_HEAD_INIT(&PyType_Type) + 0, + "BL_ShapeActionActuator", + sizeof(BL_ShapeActionActuator), + 0, + PyDestructor, + 0, + __getattr, + __setattr, + 0, //&MyPyCompare, + __repr, + 0, //&cvalue_as_number, + 0, + 0, + 0, + 0 +}; + +PyParentObject BL_ShapeActionActuator::Parents[] = { + &BL_ShapeActionActuator::Type, + &SCA_IActuator::Type, + &SCA_ILogicBrick::Type, + &CValue::Type, + NULL +}; + +PyMethodDef BL_ShapeActionActuator::Methods[] = { + {"setAction", (PyCFunction) BL_ShapeActionActuator::sPySetAction, METH_VARARGS, SetAction_doc}, + {"setStart", (PyCFunction) BL_ShapeActionActuator::sPySetStart, METH_VARARGS, SetStart_doc}, + {"setEnd", (PyCFunction) BL_ShapeActionActuator::sPySetEnd, METH_VARARGS, SetEnd_doc}, + {"setBlendin", (PyCFunction) BL_ShapeActionActuator::sPySetBlendin, METH_VARARGS, SetBlendin_doc}, + {"setPriority", (PyCFunction) BL_ShapeActionActuator::sPySetPriority, METH_VARARGS, SetPriority_doc}, + {"setFrame", (PyCFunction) BL_ShapeActionActuator::sPySetFrame, METH_VARARGS, SetFrame_doc}, + {"setProperty", (PyCFunction) BL_ShapeActionActuator::sPySetProperty, METH_VARARGS, SetProperty_doc}, + {"setBlendtime", (PyCFunction) BL_ShapeActionActuator::sPySetBlendtime, METH_VARARGS, SetBlendtime_doc}, + + {"getAction", (PyCFunction) BL_ShapeActionActuator::sPyGetAction, METH_VARARGS, GetAction_doc}, + {"getStart", (PyCFunction) BL_ShapeActionActuator::sPyGetStart, METH_VARARGS, GetStart_doc}, + {"getEnd", (PyCFunction) BL_ShapeActionActuator::sPyGetEnd, METH_VARARGS, GetEnd_doc}, + {"getBlendin", (PyCFunction) BL_ShapeActionActuator::sPyGetBlendin, METH_VARARGS, GetBlendin_doc}, + {"getPriority", (PyCFunction) BL_ShapeActionActuator::sPyGetPriority, METH_VARARGS, GetPriority_doc}, + {"getFrame", (PyCFunction) BL_ShapeActionActuator::sPyGetFrame, METH_VARARGS, GetFrame_doc}, + {"getProperty", (PyCFunction) BL_ShapeActionActuator::sPyGetProperty, METH_VARARGS, GetProperty_doc}, + {"getType", (PyCFunction) BL_ShapeActionActuator::sPyGetType, METH_VARARGS, GetType_doc}, + {"setType", (PyCFunction) BL_ShapeActionActuator::sPySetType, METH_VARARGS, SetType_doc}, + {NULL,NULL} //Sentinel +}; + +PyObject* BL_ShapeActionActuator::_getattr(const STR_String& attr) { + _getattr_up(SCA_IActuator); +} + +/* setStart */ +char BL_ShapeActionActuator::GetAction_doc[] = +"getAction()\n" +"\tReturns a string containing the name of the current action.\n"; + +PyObject* BL_ShapeActionActuator::PyGetAction(PyObject* self, + PyObject* args, + PyObject* kwds) { + PyObject *result; + + if (m_action){ + result = Py_BuildValue("s", m_action->id.name+2); + } + else{ + Py_INCREF(Py_None); + result = Py_None; + } + + return result; +} + +/* getProperty */ +char BL_ShapeActionActuator::GetProperty_doc[] = +"getProperty()\n" +"\tReturns the name of the property to be used in FromProp mode.\n"; + +PyObject* BL_ShapeActionActuator::PyGetProperty(PyObject* self, + PyObject* args, + PyObject* kwds) { + PyObject *result; + + result = Py_BuildValue("s", (const char *)m_propname); + + return result; +} + +/* getFrame */ +char BL_ShapeActionActuator::GetFrame_doc[] = +"getFrame()\n" +"\tReturns the current frame number.\n"; + +PyObject* BL_ShapeActionActuator::PyGetFrame(PyObject* self, + PyObject* args, + PyObject* kwds) { + PyObject *result; + + result = Py_BuildValue("f", m_localtime); + + return result; +} + +/* getEnd */ +char BL_ShapeActionActuator::GetEnd_doc[] = +"getEnd()\n" +"\tReturns the last frame of the action.\n"; + +PyObject* BL_ShapeActionActuator::PyGetEnd(PyObject* self, + PyObject* args, + PyObject* kwds) { + PyObject *result; + + result = Py_BuildValue("f", m_endframe); + + return result; +} + +/* getStart */ +char BL_ShapeActionActuator::GetStart_doc[] = +"getStart()\n" +"\tReturns the starting frame of the action.\n"; + +PyObject* BL_ShapeActionActuator::PyGetStart(PyObject* self, + PyObject* args, + PyObject* kwds) { + PyObject *result; + + result = Py_BuildValue("f", m_startframe); + + return result; +} + +/* getBlendin */ +char BL_ShapeActionActuator::GetBlendin_doc[] = +"getBlendin()\n" +"\tReturns the number of interpolation animation frames to be\n" +"\tgenerated when this actuator is triggered.\n"; + +PyObject* BL_ShapeActionActuator::PyGetBlendin(PyObject* self, + PyObject* args, + PyObject* kwds) { + PyObject *result; + + result = Py_BuildValue("f", m_blendin); + + return result; +} + +/* getPriority */ +char BL_ShapeActionActuator::GetPriority_doc[] = +"getPriority()\n" +"\tReturns the priority for this actuator. Actuators with lower\n" +"\tPriority numbers will override actuators with higher numbers.\n"; + +PyObject* BL_ShapeActionActuator::PyGetPriority(PyObject* self, + PyObject* args, + PyObject* kwds) { + PyObject *result; + + result = Py_BuildValue("i", m_priority); + + return result; +} + +/* setAction */ +char BL_ShapeActionActuator::SetAction_doc[] = +"setAction(action, (reset))\n" +"\t - action : The name of the action to set as the current action.\n" +"\t Should be an action with Shape channels.\n" +"\t - reset : Optional parameter indicating whether to reset the\n" +"\t blend timer or not. A value of 1 indicates that the\n" +"\t timer should be reset. A value of 0 will leave it\n" +"\t unchanged. If reset is not specified, the timer will" +"\t be reset.\n"; + +PyObject* BL_ShapeActionActuator::PySetAction(PyObject* self, + PyObject* args, + PyObject* kwds) { + char *string; + int reset = 1; + + if (PyArg_ParseTuple(args,"s|i",&string, &reset)) + { + bAction *action; + + action = (bAction*)SCA_ILogicBrick::m_sCurrentLogicManager->GetActionByName(STR_String(string)); + + if (!action){ + /* NOTE! Throw an exception or something */ + // printf ("setAction failed: Action not found\n", string); + } + else{ + m_action=action; + if (reset) + m_blendframe = 0.f; + } + } + + Py_INCREF(Py_None); + return Py_None; +} + +/* setStart */ +char BL_ShapeActionActuator::SetStart_doc[] = +"setStart(start)\n" +"\t - start : Specifies the starting frame of the animation.\n"; + +PyObject* BL_ShapeActionActuator::PySetStart(PyObject* self, + PyObject* args, + PyObject* kwds) { + float start; + + if (PyArg_ParseTuple(args,"f",&start)) + { + m_startframe = start; + } + + Py_INCREF(Py_None); + return Py_None; +} + +/* setEnd */ +char BL_ShapeActionActuator::SetEnd_doc[] = +"setEnd(end)\n" +"\t - end : Specifies the ending frame of the animation.\n"; + +PyObject* BL_ShapeActionActuator::PySetEnd(PyObject* self, + PyObject* args, + PyObject* kwds) { + float end; + + if (PyArg_ParseTuple(args,"f",&end)) + { + m_endframe = end; + } + + Py_INCREF(Py_None); + return Py_None; +} + +/* setBlendin */ +char BL_ShapeActionActuator::SetBlendin_doc[] = +"setBlendin(blendin)\n" +"\t - blendin : Specifies the number of frames of animation to generate\n" +"\t when making transitions between actions.\n"; + +PyObject* BL_ShapeActionActuator::PySetBlendin(PyObject* self, + PyObject* args, + PyObject* kwds) { + float blendin; + + if (PyArg_ParseTuple(args,"f",&blendin)) + { + m_blendin = blendin; + } + + Py_INCREF(Py_None); + return Py_None; +} + +/* setBlendtime */ +char BL_ShapeActionActuator::SetBlendtime_doc[] = +"setBlendtime(blendtime)\n" +"\t - blendtime : Allows the script to directly modify the internal timer\n" +"\t used when generating transitions between actions. This\n" +"\t parameter must be in the range from 0.0 to 1.0.\n"; + +PyObject* BL_ShapeActionActuator::PySetBlendtime(PyObject* self, + PyObject* args, + PyObject* kwds) { + float blendframe; + + if (PyArg_ParseTuple(args,"f",&blendframe)) + { + m_blendframe = blendframe * m_blendin; + if (m_blendframe<0.f) + m_blendframe = 0.f; + if (m_blendframe>m_blendin) + m_blendframe = m_blendin; + } + + Py_INCREF(Py_None); + return Py_None; +} + +/* setPriority */ +char BL_ShapeActionActuator::SetPriority_doc[] = +"setPriority(priority)\n" +"\t - priority : Specifies the new priority. Actuators will lower\n" +"\t priority numbers will override actuators with higher\n" +"\t numbers.\n"; + +PyObject* BL_ShapeActionActuator::PySetPriority(PyObject* self, + PyObject* args, + PyObject* kwds) { + int priority; + + if (PyArg_ParseTuple(args,"i",&priority)) + { + m_priority = priority; + } + + Py_INCREF(Py_None); + return Py_None; +} + +/* setFrame */ +char BL_ShapeActionActuator::SetFrame_doc[] = +"setFrame(frame)\n" +"\t - frame : Specifies the new current frame for the animation\n"; + +PyObject* BL_ShapeActionActuator::PySetFrame(PyObject* self, + PyObject* args, + PyObject* kwds) { + float frame; + + if (PyArg_ParseTuple(args,"f",&frame)) + { + m_localtime = frame; + if (m_localtimem_endframe) + m_localtime=m_endframe; + } + + Py_INCREF(Py_None); + return Py_None; +} + +/* setProperty */ +char BL_ShapeActionActuator::SetProperty_doc[] = +"setProperty(prop)\n" +"\t - prop : A string specifying the property name to be used in\n" +"\t FromProp playback mode.\n"; + +PyObject* BL_ShapeActionActuator::PySetProperty(PyObject* self, + PyObject* args, + PyObject* kwds) { + char *string; + + if (PyArg_ParseTuple(args,"s",&string)) + { + m_propname = string; + } + + Py_INCREF(Py_None); + return Py_None; +} + +/* getType */ +char BL_ShapeActionActuator::GetType_doc[] = +"getType()\n" +"\tReturns the operation mode of the actuator.\n"; +PyObject* BL_ShapeActionActuator::PyGetType(PyObject* self, + PyObject* args, + PyObject* kwds) { + return Py_BuildValue("h", m_playtype); +} + +/* setType */ +char BL_ShapeActionActuator::SetType_doc[] = +"setType(mode)\n" +"\t - mode: Play (0), Flipper (2), LoopStop (3), LoopEnd (4) or Property (6)\n" +"\tSet the operation mode of the actuator.\n"; +PyObject* BL_ShapeActionActuator::PySetType(PyObject* self, + PyObject* args, + PyObject* kwds) { + short typeArg; + + if (!PyArg_ParseTuple(args, "h", &typeArg)) { + return NULL; + } + + switch (typeArg) { + case ACT_ACTION_PLAY: + case ACT_ACTION_FLIPPER: + case ACT_ACTION_LOOP_STOP: + case ACT_ACTION_LOOP_END: + case ACT_ACTION_FROM_PROP: + m_playtype = typeArg; + break; + default: + printf("Invalid type for action actuator: %d\n", typeArg); /* error */ + } + + Py_Return; +} + diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.h b/source/gameengine/Converter/BL_ShapeActionActuator.h new file mode 100644 index 00000000000..434a62a1233 --- /dev/null +++ b/source/gameengine/Converter/BL_ShapeActionActuator.h @@ -0,0 +1,133 @@ +/** + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef BL_SHAPEACTIONACTUATOR +#define BL_SHAPEACTIONACTUATOR + +#include "GEN_HashedPtr.h" +#include "SCA_IActuator.h" +#include "MT_Point3.h" +#include + +struct Key; +class BL_ShapeActionActuator : public SCA_IActuator +{ +public: + Py_Header; + BL_ShapeActionActuator(SCA_IObject* gameobj, + const STR_String& propname, + float starttime, + float endtime, + struct bAction *action, + short playtype, + short blendin, + short priority, + float stride, + PyTypeObject* T=&Type) + : SCA_IActuator(gameobj,T), + + m_lastpos(0, 0, 0), + m_blendframe(0), + m_flag(0), + m_startframe (starttime), + m_endframe(endtime) , + m_starttime(0), + m_localtime(starttime), + m_lastUpdate(-1), + m_blendin(blendin), + m_blendstart(0), + m_stridelength(stride), + m_playtype(playtype), + m_priority(priority), + m_action(action), + m_propname(propname) + { + }; + virtual ~BL_ShapeActionActuator(); + virtual bool Update(double curtime, bool frame); + virtual CValue* GetReplica(); + virtual void ProcessReplica(); + + void SetBlendTime (float newtime); + void BlendShape(struct Key* key, float weigth); + + KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetAction); + KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetBlendin); + KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetPriority); + KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetStart); + KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetEnd); + KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetFrame); + KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetProperty); + KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetBlendtime); + KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetChannel); + + KX_PYMETHOD_DOC(BL_ShapeActionActuator,GetAction); + KX_PYMETHOD_DOC(BL_ShapeActionActuator,GetBlendin); + KX_PYMETHOD_DOC(BL_ShapeActionActuator,GetPriority); + KX_PYMETHOD_DOC(BL_ShapeActionActuator,GetStart); + KX_PYMETHOD_DOC(BL_ShapeActionActuator,GetEnd); + KX_PYMETHOD_DOC(BL_ShapeActionActuator,GetFrame); + KX_PYMETHOD_DOC(BL_ShapeActionActuator,GetProperty); +// KX_PYMETHOD(BL_ActionActuator,GetChannel); + KX_PYMETHOD_DOC(BL_ShapeActionActuator,GetType); + KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetType); + + virtual PyObject* _getattr(const STR_String& attr); + +protected: + + void SetStartTime(float curtime); + void SetLocalTime(float curtime); + bool ClampLocalTime(); + + MT_Point3 m_lastpos; + float m_blendframe; + int m_flag; + /** The frame this action starts */ + float m_startframe; + /** The frame this action ends */ + float m_endframe; + /** The time this action started */ + float m_starttime; + /** The current time of the action */ + float m_localtime; + + float m_lastUpdate; + float m_blendin; + float m_blendstart; + float m_stridelength; + short m_playtype; + short m_priority; + struct bAction *m_action; + STR_String m_propname; + vector m_blendshape; +}; + +#endif + diff --git a/source/gameengine/Converter/BL_ShapeDeformer.cpp b/source/gameengine/Converter/BL_ShapeDeformer.cpp new file mode 100644 index 00000000000..3ae634905b9 --- /dev/null +++ b/source/gameengine/Converter/BL_ShapeDeformer.cpp @@ -0,0 +1,127 @@ +/** + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifdef WIN32 +#pragma warning (disable : 4786) +#endif //WIN32 + +#include "MEM_guardedalloc.h" +#include "BL_ShapeDeformer.h" +#include "GEN_Map.h" +#include "STR_HashedString.h" +#include "RAS_IPolygonMaterial.h" +#include "BL_SkinMeshObject.h" + +//#include "BL_ArmatureController.h" +#include "DNA_armature_types.h" +#include "DNA_action_types.h" +#include "DNA_key_types.h" +#include "DNA_mesh_types.h" +#include "DNA_meshdata_types.h" +#include "BKE_armature.h" +#include "BKE_action.h" +#include "BKE_key.h" +#include "MT_Point3.h" + +extern "C"{ + #include "BKE_lattice.h" +} + #include "BKE_utildefines.h" + +#include "BLI_blenlib.h" +#include "BLI_arithb.h" + +#define __NLA_DEFNORMALS +//#undef __NLA_DEFNORMALS + + +BL_ShapeDeformer::~BL_ShapeDeformer() +{ +}; + +RAS_Deformer *BL_ShapeDeformer::GetReplica() +{ + BL_ShapeDeformer *result; + + result = new BL_ShapeDeformer(*this); + result->ProcessReplica(); + return result; +} + +void BL_ShapeDeformer::ProcessReplica() +{ +} + +bool BL_ShapeDeformer::Update(void) +{ + bool bShapeUpdate = false; + bool bSkinUpdate = false; + + /* See if the object shape has changed */ + if (m_lastShapeUpdate != m_gameobj->GetLastFrame()) { + /* the key coefficient have been set already, we just need to blend the keys */ + Object* blendobj = m_gameobj->GetBlendObject(); + + // make sure the vertex weight cache is in line with this object + m_pMeshObject->CheckWeightCache(blendobj); + + /* we will blend the key directly in mvert array: it is used by armature as the start position */ + do_rel_key(0, m_bmesh->totvert, m_bmesh->totvert, (char *)m_bmesh->mvert->co, m_bmesh->key, 0); + + // Don't release the weight array as in Blender, it will most likely be reusable on next frame + // The weight array are ultimately deleted when the skin mesh is destroyed + + /* Update the current frame */ + m_lastShapeUpdate=m_gameobj->GetLastFrame(); + + // As we have changed, the mesh, the skin deformer must update as well. + // This will force the update + BL_SkinDeformer::ForceUpdate(); + bShapeUpdate = true; + } + // check for armature deform + bSkinUpdate = BL_SkinDeformer::Update(); + + if (!bSkinUpdate && bShapeUpdate) { + // this means that there is no armature, we still need to copy the vertex to m_transverts + // and update the normal (was not done after shape key calculation) + + /* store verts locally */ + VerifyStorage(); + + for (int v =0; vtotvert; v++) + VECCOPY(m_transverts[v], m_bmesh->mvert[v].co); + +#ifdef __NLA_DEFNORMALS + RecalcNormals(); +#endif + bSkinUpdate = true; + } + return bSkinUpdate; +} diff --git a/source/gameengine/Converter/BL_ShapeDeformer.h b/source/gameengine/Converter/BL_ShapeDeformer.h new file mode 100644 index 00000000000..9bbdde3fb2c --- /dev/null +++ b/source/gameengine/Converter/BL_ShapeDeformer.h @@ -0,0 +1,93 @@ +/** + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef BL_SHAPEDEFORMER +#define BL_SHAPEDEFORMER + +#ifdef WIN32 +#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning +#endif //WIN32 + +#include "BL_SkinDeformer.h" +#include "BL_DeformableGameObject.h" +#include + + +class BL_ShapeDeformer : public BL_SkinDeformer +{ +public: + virtual void Relink(GEN_Map*map) + { + void **h_obj = (*map)[m_gameobj]; + if (h_obj){ + m_gameobj = (BL_DeformableGameObject*)(*h_obj); + } + else + m_gameobj=NULL; + // relink the underlying skin deformer + BL_SkinDeformer::Relink(map); + }; + BL_ShapeDeformer(BL_DeformableGameObject *gameobj, + Object *bmeshobj, + BL_SkinMeshObject *mesh) + : + BL_SkinDeformer(bmeshobj, mesh), + m_lastShapeUpdate(-1), + m_gameobj(gameobj) + { + }; + + /* this second constructor is needed for making a mesh deformable on the fly. */ + BL_ShapeDeformer(BL_DeformableGameObject *gameobj, + struct Object *bmeshobj_old, + struct Object *bmeshobj_new, + class BL_SkinMeshObject *mesh, + bool release_object, + BL_ArmatureObject* arma = NULL) + : + BL_SkinDeformer(bmeshobj_old, bmeshobj_new, mesh, release_object, arma), + m_lastShapeUpdate(-1), + m_gameobj(gameobj) + { + }; + + virtual void ProcessReplica(); + virtual RAS_Deformer *GetReplica(); + virtual ~BL_ShapeDeformer(); + + bool Update (void); + +protected: + double m_lastShapeUpdate; + BL_DeformableGameObject* m_gameobj; + +}; + +#endif + diff --git a/source/gameengine/Converter/BL_SkinDeformer.cpp b/source/gameengine/Converter/BL_SkinDeformer.cpp index 14faa3317d0..1015221c392 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.cpp +++ b/source/gameengine/Converter/BL_SkinDeformer.cpp @@ -57,6 +57,18 @@ extern "C"{ #define __NLA_DEFNORMALS //#undef __NLA_DEFNORMALS +BL_SkinDeformer::BL_SkinDeformer(struct Object *bmeshobj, + class BL_SkinMeshObject *mesh, + BL_ArmatureObject* arma) + : // + BL_MeshDeformer(bmeshobj, mesh), + m_armobj(arma), + m_lastArmaUpdate(-1), + m_defbase(&bmeshobj->defbase), + m_releaseobject(false) +{ + Mat4CpyMat4(m_obmat, bmeshobj->obmat); +}; BL_SkinDeformer::BL_SkinDeformer( struct Object *bmeshobj_old, // Blender object that owns the new mesh @@ -66,97 +78,56 @@ BL_SkinDeformer::BL_SkinDeformer( BL_ArmatureObject* arma) : BL_MeshDeformer(bmeshobj_old, mesh), m_armobj(arma), - m_lastUpdate(-1), + m_lastArmaUpdate(-1), m_defbase(&bmeshobj_old->defbase), m_releaseobject(release_object) { - Mat4CpyMat4(m_obmat, bmeshobj_old->obmat); - m_restoremat = true; // this is needed to ensure correct deformation of mesh: // the deformation is done with Blender's armature_deform_verts() function // that takes an object as parameter and not a mesh. The object matrice is used - // in the calculation, so we must force the same matrice to simulate a pure replacement of mesh - Mat4CpyMat4(bmeshobj_old->obmat, bmeshobj_new->obmat); + // in the calculation, so we must use the matrix of the original object to + // simulate a pure replacement of the mesh. + Mat4CpyMat4(m_obmat, bmeshobj_new->obmat); } BL_SkinDeformer::~BL_SkinDeformer() { if(m_releaseobject && m_armobj) m_armobj->Release(); - if (m_restoremat) - Mat4CpyMat4(m_objMesh->obmat, m_obmat); } -/* XXX note, this __NLA_OLDDEFORM define seems to be obsolete */ - bool BL_SkinDeformer::Apply(RAS_IPolyMaterial *mat) { size_t i, j, index; vecVertexArray array; -#ifdef __NLA_OLDDEFORM - vecMVertArray mvarray; -#else vecIndexArrays mvarray; -#endif vecMDVertArray dvarray; vecIndexArrays diarray; RAS_TexVert *tv; -#ifdef __NLA_OLDDEFORM - MVert *mvert; - MDeformVert *dvert; -#endif MT_Point3 pt; // float co[3]; - if (!m_armobj) - return false; - Update(); array = m_pMeshObject->GetVertexCache(mat); -#ifdef __NLA_OLDDEFORM - dvarray = m_pMeshObject->GetDVertCache(mat); -#endif mvarray = m_pMeshObject->GetMVertCache(mat); diarray = m_pMeshObject->GetDIndexCache(mat); - - // For each array - for (i=0; isize(); j++){ + for (j=0; jsize(); j++) { tv = &((*array[i])[j]); index = ((*diarray[i])[j]); -#ifdef __NLA_OLDDEFORM - pt = tv->xyz(); - mvert = ((*mvarray[i])[index]); - dvert = ((*dvarray[i])[index]); -#endif // Copy the untransformed data from the original mvert -#ifdef __NLA_OLDDEFORM - co[0]=mvert->co[0]; - co[1]=mvert->co[1]; - co[2]=mvert->co[2]; - - // Do the deformation -/* XXX note, doesnt exist anymore */ -// GB_calc_armature_deform(co, dvert); - tv->SetXYZ(co); -#else // Set the data tv->SetXYZ(m_transverts[((*mvarray[i])[index])]); -#ifdef __NLA_DEFNORMALS - - tv->SetNormal(m_transnors[((*mvarray[i])[index])]); -#endif -#endif } } - + return true; } @@ -175,10 +146,11 @@ void BL_SkinDeformer::ProcessReplica() //void where_is_pose (Object *ob); //void armature_deform_verts(Object *armOb, Object *target, float (*vertexCos)[3], int numVerts, int deformflag); -void BL_SkinDeformer::Update(void) +bool BL_SkinDeformer::Update(void) { /* See if the armature has been updated for this frame */ - if (m_lastUpdate!=m_armobj->GetLastFrame()){ + if (m_armobj && m_lastArmaUpdate!=m_armobj->GetLastFrame()){ + float obmat[4][4]; // the original object matrice /* Do all of the posing necessary */ m_armobj->ApplyPose(); @@ -196,12 +168,27 @@ void BL_SkinDeformer::Update(void) for (int v =0; vtotvert; v++) VECCOPY(m_transverts[v], m_bmesh->mvert[v].co); + // save matrix first + Mat4CpyMat4(obmat, m_objMesh->obmat); + // set reference matrix + Mat4CpyMat4(m_objMesh->obmat, m_obmat); + armature_deform_verts( par_arma, m_objMesh, NULL, m_transverts, NULL, m_bmesh->totvert, ARM_DEF_VGROUP, NULL, NULL ); + + // restore matrix + Mat4CpyMat4(m_objMesh->obmat, obmat); + +#ifdef __NLA_DEFNORMALS RecalcNormals(); +#endif /* Update the current frame */ - m_lastUpdate=m_armobj->GetLastFrame(); + m_lastArmaUpdate=m_armobj->GetLastFrame(); + + /* indicate that the m_transverts and normals are up to date */ + return true; } + return false; } /* XXX note: I propose to drop this function */ diff --git a/source/gameengine/Converter/BL_SkinDeformer.h b/source/gameengine/Converter/BL_SkinDeformer.h index e130dc15dbf..603e716fb1e 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.h +++ b/source/gameengine/Converter/BL_SkinDeformer.h @@ -52,27 +52,20 @@ public: // void SetArmatureController (BL_ArmatureController *cont); virtual void Relink(GEN_Map*map) { - void **h_obj = (*map)[m_armobj]; - if (h_obj){ - SetArmature( (BL_ArmatureObject*)(*h_obj) ); + if (m_armobj){ + void **h_obj = (*map)[m_armobj]; + if (h_obj){ + SetArmature( (BL_ArmatureObject*)(*h_obj) ); + } + else + m_armobj=NULL; } - else - m_armobj=NULL; } void SetArmature (class BL_ArmatureObject *armobj); BL_SkinDeformer(struct Object *bmeshobj, class BL_SkinMeshObject *mesh, - BL_ArmatureObject* arma = NULL) - : // - BL_MeshDeformer(bmeshobj, mesh), - m_armobj(arma), - m_lastUpdate(-1), - m_defbase(&bmeshobj->defbase), - m_releaseobject(false), - m_restoremat(false) - { - }; + BL_ArmatureObject* arma = NULL); /* this second constructor is needed for making a mesh deformable on the fly. */ BL_SkinDeformer(struct Object *bmeshobj_old, @@ -84,16 +77,20 @@ public: virtual void ProcessReplica(); virtual RAS_Deformer *GetReplica(); virtual ~BL_SkinDeformer(); - void Update (void); + bool Update (void); bool Apply (class RAS_IPolyMaterial *polymat); + void ForceUpdate() + { + m_lastArmaUpdate = -1.0; + }; + protected: BL_ArmatureObject* m_armobj; // Our parent object float m_time; - double m_lastUpdate; + double m_lastArmaUpdate; ListBase* m_defbase; - float m_obmat[4][4]; // the original object matrice in case of dynamic mesh replacement - bool m_restoremat; + float m_obmat[4][4]; // the reference matrix for skeleton deform bool m_releaseobject; }; diff --git a/source/gameengine/Converter/BL_SkinMeshObject.cpp b/source/gameengine/Converter/BL_SkinMeshObject.cpp index 8bc78c7f757..49492923c7c 100644 --- a/source/gameengine/Converter/BL_SkinMeshObject.cpp +++ b/source/gameengine/Converter/BL_SkinMeshObject.cpp @@ -53,23 +53,27 @@ void BL_SkinMeshObject::AddPolygon(RAS_Polygon* poly) RAS_MeshObject::AddPolygon(poly); } -#ifdef __NLA_OLDDEFORM -int BL_SkinMeshObject::FindOrAddDeform(int vtxarray, struct MVert *mv, struct MDeformVert *dv, RAS_IPolyMaterial* mat) -#else int BL_SkinMeshObject::FindOrAddDeform(unsigned int vtxarray, unsigned int mv, struct MDeformVert *dv, RAS_IPolyMaterial* mat) -#endif { BL_SkinArrayOptimizer* ao = (BL_SkinArrayOptimizer*)GetArrayOptimizer(mat);//*(m_matVertexArrays[*mat]); int numvert = ao->m_MvertArrayCache1[vtxarray]->size(); - + /* Check to see if this has already been pushed */ - for (unsigned int i=0; im_MvertArrayCache1[vtxarray]->size(); i++){ - if (mv == (*ao->m_MvertArrayCache1[vtxarray])[i]) - return i; + for (vector::iterator it = m_mvert_to_dvert_mapping[mv].begin(); + it != m_mvert_to_dvert_mapping[mv].end(); + it++) + { + if(it->mat == mat) + return it->index; } ao->m_MvertArrayCache1[vtxarray]->push_back(mv); ao->m_DvertArrayCache1[vtxarray]->push_back(dv); + + BL_MDVertMap mdmap; + mdmap.mat = mat; + mdmap.index = numvert; + m_mvert_to_dvert_mapping[mv].push_back(mdmap); return numvert; }; @@ -105,11 +109,7 @@ int BL_SkinMeshObject::FindVertexArray(int numverts,RAS_IPolyMaterial* polymat) KX_IndexArray *ia = new KX_IndexArray(); ao->m_IndexArrayCache1.push_back(ia); -#ifdef __NLA_OLDDEFORM - BL_MVertArray *bva = new BL_MVertArray(); -#else KX_IndexArray *bva = new KX_IndexArray(); -#endif ao->m_MvertArrayCache1.push_back(bva); BL_DeformVertArray *dva = new BL_DeformVertArray(); @@ -150,5 +150,63 @@ void BL_SkinMeshObject::Bucketize(double* oglmatrix,void* clientobj,bool useObje } +static int get_def_index(Object* ob, const char* vgroup) +{ + bDeformGroup *curdef; + int index = 0; + + for (curdef = (bDeformGroup*)ob->defbase.first; curdef; curdef=(bDeformGroup*)curdef->next, index++) + if (!strcmp(curdef->name, vgroup)) + return index; + return -1; +} + +void BL_SkinMeshObject::CheckWeightCache(Object* obj) +{ + KeyBlock *kb; + int kbindex, defindex; + MDeformVert *dvert= NULL; + int totvert, i, j; + float *weights; + + if (!m_mesh->key) + return; + + for(kbindex=0, kb= (KeyBlock*)m_mesh->key->block.first; kb; kb= (KeyBlock*)kb->next, kbindex++) + { + // first check the cases where the weight must be cleared + if (kb->vgroup[0] == 0 || + m_mesh->dvert == NULL || + (defindex = get_def_index(obj, kb->vgroup)) == -1) { + if (kb->weights) { + MEM_freeN(kb->weights); + kb->weights = NULL; + } + m_cacheWeightIndex[kbindex] = -1; + } else if (m_cacheWeightIndex[kbindex] != defindex) { + // a weight array is required but the cache is not matching + if (kb->weights) { + MEM_freeN(kb->weights); + kb->weights = NULL; + } + + dvert= m_mesh->dvert; + totvert= m_mesh->totvert; + + weights= (float*)MEM_callocN(totvert*sizeof(float), "weights"); + + for (i=0; i < totvert; i++, dvert++) { + for(j=0; jtotweight; j++) { + if (dvert->dw[j].def_nr == defindex) { + weights[i]= dvert->dw[j].weight; + break; + } + } + } + kb->weights = weights; + m_cacheWeightIndex[kbindex] = defindex; + } + } +} diff --git a/source/gameengine/Converter/BL_SkinMeshObject.h b/source/gameengine/Converter/BL_SkinMeshObject.h index 0ca7428c0f0..cc2b8de600e 100644 --- a/source/gameengine/Converter/BL_SkinMeshObject.h +++ b/source/gameengine/Converter/BL_SkinMeshObject.h @@ -33,7 +33,7 @@ #ifdef WIN32 #pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning #endif //WIN32 - +#include "MEM_guardedalloc.h" #include "RAS_MeshObject.h" #include "RAS_Deformer.h" #include "RAS_IPolygonMaterial.h" @@ -41,6 +41,7 @@ #include "BL_MeshDeformer.h" #include "DNA_mesh_types.h" +#include "DNA_key_types.h" #include "DNA_meshdata_types.h" typedef vector BL_MVertArray; @@ -105,15 +106,43 @@ class BL_SkinMeshObject : public RAS_MeshObject } protected: + vector m_cacheWeightIndex; + public: + struct BL_MDVertMap { RAS_IPolyMaterial *mat; int index; }; + vector > m_mvert_to_dvert_mapping; + void Bucketize(double* oglmatrix,void* clientobj,bool useObjectColor,const MT_Vector4& rgbavec); // void Bucketize(double* oglmatrix,void* clientobj,bool useObjectColor,const MT_Vector4& rgbavec,class RAS_BucketManager* bucketmgr); int FindVertexArray(int numverts,RAS_IPolyMaterial* polymat); - BL_SkinMeshObject(int lightlayer) : RAS_MeshObject (lightlayer) - { m_class = 1;}; + BL_SkinMeshObject(Mesh* mesh, int lightlayer) : RAS_MeshObject (mesh, lightlayer) + { + m_class = 1; + if (m_mesh && m_mesh->key) + { + KeyBlock *kb; + int count=0; + // initialize weight cache for shape objects + // count how many keys in this mesh + for(kb= (KeyBlock*)m_mesh->key->block.first; kb; kb= (KeyBlock*)kb->next) + count++; + m_cacheWeightIndex.resize(count,-1); + } + }; - virtual ~BL_SkinMeshObject(){ + virtual ~BL_SkinMeshObject() + { + if (m_mesh && m_mesh->key) + { + KeyBlock *kb; + // remove the weight cache to avoid memory leak + for(kb= (KeyBlock*)m_mesh->key->block.first; kb; kb= (KeyBlock*)kb->next) { + if(kb->weights) + MEM_freeN(kb->weights); + kb->weights= NULL; + } + } }; const vecIndexArrays& GetDIndexCache (RAS_IPolyMaterial* mat) @@ -139,38 +168,20 @@ public: const MT_Point2& uv2, const MT_Vector4& tangent, const unsigned int rgbacolor, - const MT_Vector3& normal, int defnr, bool flat, RAS_IPolyMaterial* mat) + const MT_Vector3& normal, int defnr, bool flat, RAS_IPolyMaterial* mat, int origindex) { - RAS_TexVert tempvert(xyz,uv,uv2, tangent,rgbacolor,normal,flat ? TV_CALCFACENORMAL : 0); - - // KX_ArrayOptimizer* ao = GetArrayOptimizer(mat);//*(m_matVertexArrays[*mat]); - BL_SkinArrayOptimizer* ao = (BL_SkinArrayOptimizer*)GetArrayOptimizer(mat);//*(m_matVertexArrays[*mat]); - - int numverts = ao->m_VertexArrayCache1[vtxarray]->size();//m_VertexArrayCount[vtxarray]; - - int index=-1; - - for (int i=0;im_VertexArrayCache1[vtxarray])[i]; - if (tempvert.closeTo(&vtx)) - { - index = i; - break; - } - - } - if (index >= 0) - return index; - - // no vertex found, add one - ao->m_VertexArrayCache1[vtxarray]->push_back(tempvert); - ao->m_DIndexArrayCache1[vtxarray]->push_back(defnr); - - return numverts; - - + BL_SkinArrayOptimizer* ao = (BL_SkinArrayOptimizer*)GetArrayOptimizer(mat); + int numverts = ao->m_VertexArrayCache1[vtxarray]->size(); + int index = RAS_MeshObject::FindOrAddVertex(vtxarray, xyz, uv, uv2, tangent, rgbacolor, normal, flat, mat, origindex); + + /* this means a new vertex was added, so we add the defnr too */ + if(index == numverts) + ao->m_DIndexArrayCache1[vtxarray]->push_back(defnr); + + return index; } + // for shape keys, + void CheckWeightCache(struct Object* obj); }; diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index 8640e69102b..de91bce2ab1 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -100,7 +100,8 @@ KX_BlenderSceneConverter::KX_BlenderSceneConverter( m_sipo(sipo), m_ketsjiEngine(engine), m_alwaysUseExpandFraming(false), - m_usemat(false) + m_usemat(false), + m_useglslmat(false) { m_newfilename = ""; } @@ -449,6 +450,13 @@ void KX_BlenderSceneConverter::RemoveScene(KX_Scene *scene) void KX_BlenderSceneConverter::SetMaterials(bool val) { m_usemat = val; + m_useglslmat = false; +} + +void KX_BlenderSceneConverter::SetGLSLMaterials(bool val) +{ + m_usemat = val; + m_useglslmat = val; } bool KX_BlenderSceneConverter::GetMaterials() @@ -456,6 +464,10 @@ bool KX_BlenderSceneConverter::GetMaterials() return m_usemat; } +bool KX_BlenderSceneConverter::GetGLSLMaterials() +{ + return m_useglslmat; +} void KX_BlenderSceneConverter::RegisterBlenderMaterial(BL_Material *mat) { diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.h b/source/gameengine/Converter/KX_BlenderSceneConverter.h index a45d7396875..e5d6ccc5caf 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.h +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.h @@ -75,6 +75,7 @@ class KX_BlenderSceneConverter : public KX_ISceneConverter class KX_Scene* m_currentScene; // Scene being converted bool m_alwaysUseExpandFraming; bool m_usemat; + bool m_useglslmat; void localDel_ipoCurve ( IpoCurve * icu ,struct SpaceIpo* sipo); // struct Ipo* findIpoForName(char* objName); @@ -146,6 +147,10 @@ public: virtual void SetMaterials(bool val); virtual bool GetMaterials(); + // use blender glsl materials + virtual void SetGLSLMaterials(bool val); + virtual bool GetGLSLMaterials(); + }; #endif //__KX_BLENDERSCENECONVERTER_H diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index 6b594e2e70b..f219c3a1472 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -84,6 +84,7 @@ #include "DNA_actuator_types.h" #include "DNA_packedFile_types.h" #include "BL_ActionActuator.h" +#include "BL_ShapeActionActuator.h" /* end of blender include block */ #include "BL_BlenderDataConversion.h" @@ -195,6 +196,30 @@ void BL_ConvertActuators(char* maggiename, else printf ("Discarded action actuator from non-armature object [%s]\n", blenderobject->id.name+2); } + case ACT_SHAPEACTION: + { + if (blenderobject->type==OB_MESH){ + bActionActuator* actact = (bActionActuator*) bact->data; + STR_String propname = (actact->name ? actact->name : ""); + + BL_ShapeActionActuator* tmpbaseact = new BL_ShapeActionActuator( + gameobj, + propname, + actact->sta, + actact->end, + actact->act, + actact->type, // + 1, because Blender starts to count at zero, + actact->blendin, + actact->priority, + actact->stridelength + // Ketsji at 1, because zero is reserved for "NoDef" + ); + baseact= tmpbaseact; + break; + } + else + printf ("Discarded shape action actuator from non-mesh object [%s]\n", blenderobject->id.name+2); + } case ACT_IPO: { bIpoActuator* ipoact = (bIpoActuator*) bact->data; diff --git a/source/gameengine/GameLogic/SCA_IObject.h b/source/gameengine/GameLogic/SCA_IObject.h index 4b0fc741b8f..e8251e0ceaa 100644 --- a/source/gameengine/GameLogic/SCA_IObject.h +++ b/source/gameengine/GameLogic/SCA_IObject.h @@ -120,7 +120,7 @@ public: virtual int GetGameObjectType() {return -1;} typedef enum ObjectTypes { - OBJ_ARMATURE=0 + OBJ_ARMATURE=0, }ObjectTypes; }; diff --git a/source/gameengine/GamePlayer/common/CMakeLists.txt b/source/gameengine/GamePlayer/common/CMakeLists.txt index 29cdcd640f5..e26f8b9d69a 100644 --- a/source/gameengine/GamePlayer/common/CMakeLists.txt +++ b/source/gameengine/GamePlayer/common/CMakeLists.txt @@ -69,6 +69,7 @@ SET(INC ../../../../source/gameengine/GamePlayer/ghost ../../../../source/blender/misc ../../../../source/blender/blenloader + ../../../../extern/glew/include ${PYTHON_INC} ${SOLID_INC} ${PNG_INC} diff --git a/source/gameengine/GamePlayer/common/GPC_Canvas.h b/source/gameengine/GamePlayer/common/GPC_Canvas.h index bd66c865988..f82166dfa88 100644 --- a/source/gameengine/GamePlayer/common/GPC_Canvas.h +++ b/source/gameengine/GamePlayer/common/GPC_Canvas.h @@ -33,18 +33,12 @@ #include "RAS_ICanvas.h" #include "RAS_Rect.h" -#if defined(WIN32) || defined(__APPLE__) - #ifdef WIN32 - #pragma warning (disable:4786) // suppress stl-MSVC debug info warning - #include - #include - #else // WIN32 - // __APPLE__ is defined - #include - #endif // WIN32 -#else //defined(WIN32) || defined(__APPLE__) - #include -#endif //defined(WIN32) || defined(__APPLE__) +#ifdef WIN32 + #pragma warning (disable:4786) // suppress stl-MSVC debug info warning + #include +#endif // WIN32 + +#include "GL/glew.h" #include diff --git a/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp b/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp index c2f15aefe16..b1e2b5af0e6 100644 --- a/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp +++ b/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp @@ -31,23 +31,7 @@ #include #endif -#ifdef WIN32 -#include -#endif // WIN32 -#ifdef __APPLE__ -#define GL_GLEXT_LEGACY 1 -#include -#include -#else -#include -#if defined(__sun__) && !defined(__sparc__) -#include -#else -#include -#endif -#endif - - +#include "GL/glew.h" #include "GPC_PolygonMaterial.h" #include "MT_Vector3.h" @@ -88,7 +72,6 @@ static int fDoMipMap = 1; static int fLinearMipMap=1; static int fAlphamode= -1; -using namespace bgl; /* (n&(n-1)) zeros the least significant bit of n */ static int is_pow2(int num) { return ((num)&(num-1))==0; diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp index 885981a2898..44eeccedbd1 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp @@ -34,12 +34,8 @@ #include #endif -#ifdef __APPLE__ -#define GL_GLEXT_LEGACY 1 -#include -#else -#include -#endif +#include "GL/glew.h" + #include #include "GPC_RenderTools.h" @@ -137,10 +133,6 @@ int GPC_RenderTools::ProcessLighting(int layer) { if (m_clientobject) { - if (layer == RAS_LIGHT_OBJECT_LAYER) - { - layer = static_cast(m_clientobject)->GetLayer(); - } if (applyLights(layer)) { EnableOpenGLLights(); @@ -160,7 +152,7 @@ void GPC_RenderTools::EnableOpenGLLights() glEnable(GL_LIGHTING); glEnable(GL_COLOR_MATERIAL); glColorMaterial(GL_FRONT_AND_BACK,GL_DIFFUSE); - if (bgl::QueryExtension(bgl::_GL_EXT_separate_specular_color) || bgl::QueryVersion(1, 2)) + if (GLEW_EXT_separate_specular_color || GLEW_VERSION_1_2) glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR); } diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.h b/source/gameengine/GamePlayer/common/GPC_RenderTools.h index ee0212da643..f7230cb0865 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.h +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.h @@ -30,18 +30,11 @@ #ifndef __GPC_RENDERTOOLS_H #define __GPC_RENDERTOOLS_H -#if defined(WIN32) || defined(__APPLE__) - #ifdef WIN32 - #include - #include - #else // WIN32 - // __APPLE__ is defined - #include - #endif // WIN32 -#else //defined(WIN32) || defined(__APPLE__) - #include -#endif //defined(WIN32) || defined(__APPLE__) +#ifdef WIN32 + #include +#endif // WIN32 +#include "GL/glew.h" #include "RAS_IRenderTools.h" diff --git a/source/gameengine/GamePlayer/common/Makefile b/source/gameengine/GamePlayer/common/Makefile index 508dee18755..19d792ddbdb 100644 --- a/source/gameengine/GamePlayer/common/Makefile +++ b/source/gameengine/GamePlayer/common/Makefile @@ -35,6 +35,7 @@ include nan_compile.mk CCFLAGS += $(LEVEL_1_CPP_WARNINGS) +CPPFLAGS += -I$(NAN_GLEW)/include CPPFLAGS += -I$(OPENGL_HEADERS) CPPFLAGS += -I../../../blender/blenkernel diff --git a/source/gameengine/GamePlayer/common/SConscript b/source/gameengine/GamePlayer/common/SConscript index 6ff3ae10735..3b2367d2592 100644 --- a/source/gameengine/GamePlayer/common/SConscript +++ b/source/gameengine/GamePlayer/common/SConscript @@ -45,7 +45,8 @@ incs = ['.', '#source/gameengine/Network/LoopBackNetwork', '#source/gameengine/GamePlayer/ghost', '#source/blender/misc', - '#source/blender/blenloader'] + '#source/blender/blenloader', + '#extern/glew/include'] #This is all plugin stuff! #if sys.platform=='win32': diff --git a/source/gameengine/GamePlayer/ghost/CMakeLists.txt b/source/gameengine/GamePlayer/ghost/CMakeLists.txt index 3d17cd2cfdd..d9f0675001f 100644 --- a/source/gameengine/GamePlayer/ghost/CMakeLists.txt +++ b/source/gameengine/GamePlayer/ghost/CMakeLists.txt @@ -65,6 +65,7 @@ SET(INC ../../../../source/blender/misc ../../../../source/blender/blenloader ../../../../extern/solid + ../../../../extern/glew/include ${PYTHON_INC} ) diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp index dfd15227501..c4cf698d5ee 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -37,18 +37,7 @@ #include #endif -#ifdef __APPLE__ -#define GL_GLEXT_LEGACY 1 -#include -#include -#else -#include -#if defined(__sun__) && !defined(__sparc__) -#include -#else -#include -#endif -#endif +#include "GL/glew.h" #include "GPG_Application.h" @@ -134,7 +123,8 @@ GPG_Application::GPG_Application(GHOST_ISystem* system, struct Main* maggie, STR m_sceneconverter(0), m_networkdevice(0), m_audiodevice(0), - m_blendermat(0) + m_blendermat(0), + m_blenderglslmat(0) { fSystem = system; } @@ -487,7 +477,8 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode) { if (!m_engineInitialized) { - bgl::InitExtensions(1); + glewInit(); + bgl::InitExtensions(true); // get and set the preferences SYS_SystemHandle syshandle = SYS_GetSystem(); @@ -508,26 +499,10 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode) bool useVertexArrays = SYS_GetCommandLineInt(syshandle,"vertexarrays",1) != 0; bool useLists = (SYS_GetCommandLineInt(syshandle, "displaylists", G.fileflags & G_FILE_DIAPLAY_LISTS) != 0); -#if defined(GL_ARB_multitexture) && defined(WITH_GLEXT) - if (!getenv("WITHOUT_GLEXT")) { + if(GLEW_ARB_multitexture && GLEW_VERSION_1_1) { int gameflag =(G.fileflags & G_FILE_GAME_MAT); - - if(bgl::RAS_EXT_support._ARB_multitexture && bgl::QueryVersion(1, 1)) { - m_blendermat = (SYS_GetCommandLineInt(syshandle, "blender_material", gameflag) != 0); - int unitmax=0; - glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, (GLint*)&unitmax); - bgl::max_texture_units = MAXTEX>unitmax?unitmax:MAXTEX; - //std::cout << "using(" << bgl::max_texture_units << ") of(" << unitmax << ") texture units." << std::endl; - } else { - bgl::max_texture_units = 0; - } - } else { - m_blendermat=0; + m_blendermat = (SYS_GetCommandLineInt(syshandle, "blender_material", gameflag) != 0); } -#else - m_blendermat=0; -#endif//GL_ARB_multitexture - // ---------------------------------- // create the canvas, rasterizer and rendertools m_canvas = new GPG_Canvas(window); @@ -545,7 +520,7 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode) } else { m_rasterizer = new RAS_ListRasterizer(m_canvas); } - else if (useVertexArrays && bgl::QueryVersion(1, 1)) + else if (useVertexArrays && GLEW_VERSION_1_1) m_rasterizer = new RAS_VAOpenGLRasterizer(m_canvas); else m_rasterizer = new RAS_OpenGLRasterizer(m_canvas); @@ -655,6 +630,8 @@ bool GPG_Application::startEngine(void) // sceneconverter->SetAlwaysUseExpandFraming(true); if(m_blendermat) m_sceneconverter->SetMaterials(true); + if(m_blenderglslmat) + m_sceneconverter->SetGLSLMaterials(true); KX_Scene* startscene = new KX_Scene(m_keyboard, m_mouse, diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.h b/source/gameengine/GamePlayer/ghost/GPG_Application.h index 024ca1dbf32..17f5add8b19 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.h +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.h @@ -141,6 +141,7 @@ protected: SND_IAudioDevice* m_audiodevice; bool m_blendermat; + bool m_blenderglslmat; }; diff --git a/source/gameengine/GamePlayer/ghost/Makefile b/source/gameengine/GamePlayer/ghost/Makefile index d5aae181396..13940ac3fc8 100644 --- a/source/gameengine/GamePlayer/ghost/Makefile +++ b/source/gameengine/GamePlayer/ghost/Makefile @@ -36,6 +36,7 @@ include nan_compile.mk CCFLAGS += $(LEVEL_1_CPP_WARNINGS) # OpenGL header files +CPPFLAGS += -I$(NAN_GLEW)/include CPPFLAGS += -I$(OPENGL_HEADERS) CPPFLAGS += -I$(NAN_STRING)/include CPPFLAGS += -I$(NAN_BMFONT)/include diff --git a/source/gameengine/GamePlayer/ghost/SConscript b/source/gameengine/GamePlayer/ghost/SConscript index bd37777031e..f3cce6c7443 100644 --- a/source/gameengine/GamePlayer/ghost/SConscript +++ b/source/gameengine/GamePlayer/ghost/SConscript @@ -39,7 +39,8 @@ incs = ['.', '#source/gameengine/Network/LoopBackNetwork', '#source/gameengine/GamePlayer/common', '#source/blender/misc', - '#source/blender/blenloader'] + '#source/blender/blenloader', + '#extern/glew/include'] incs += Split(env['BF_PYTHON_INC']) incs += Split(env['BF_SOLID_INC']) diff --git a/source/gameengine/Ketsji/BL_BlenderShader.cpp b/source/gameengine/Ketsji/BL_BlenderShader.cpp new file mode 100644 index 00000000000..06e012123b1 --- /dev/null +++ b/source/gameengine/Ketsji/BL_BlenderShader.cpp @@ -0,0 +1,149 @@ + +#include "DNA_customdata_types.h" + +#include "BL_BlenderShader.h" + +#if 0 +#include "GPU_extensions.h" +#include "GPU_material.h" +#endif + +#include "RAS_MeshObject.h" +#include "RAS_IRasterizer.h" + +const bool BL_BlenderShader::Ok()const +{ +#if 0 + return (mGPUMat != 0); +#endif + + return false; +} + +BL_BlenderShader::BL_BlenderShader(struct Material *ma) +: +#if 0 + mGPUMat(0), +#endif + mBound(false) +{ +#if 0 + if(ma) + mGPUMat = GPU_material_from_blender(ma, GPU_PROFILE_DERIVEDMESH); +#endif +} + +BL_BlenderShader::~BL_BlenderShader() +{ +#if 0 + if(mGPUMat) { + GPU_material_unbind(mGPUMat); + mGPUMat = 0; + } +#endif +} + +void BL_BlenderShader::ApplyShader() +{ +} + +void BL_BlenderShader::SetProg(bool enable) +{ +#if 0 + if(mGPUMat) { + if(enable) { + GPU_material_bind(mGPUMat); + mBound = true; + } + else { + GPU_material_unbind(mGPUMat); + mBound = false; + } + } +#endif +} + +int BL_BlenderShader::GetAttribNum() +{ +#if 0 + GPUVertexAttribs attribs; + int i, enabled = 0; + + if(!mGPUMat) + return enabled; + + GPU_material_vertex_attributes(mGPUMat, &attribs); + + for(i = 0; i < attribs.totlayer; i++) + if(attribs.layer[i].glindex+1 > enabled) + enabled= attribs.layer[i].glindex+1; + + if(enabled > BL_MAX_ATTRIB) + enabled = BL_MAX_ATTRIB; + + return enabled; +#endif + + return 0; +} + +void BL_BlenderShader::SetTexCoords(RAS_IRasterizer* ras) +{ +#if 0 + GPUVertexAttribs attribs; + int i, attrib_num; + + if(!mGPUMat) + return; + + if(ras->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED) { + GPU_material_vertex_attributes(mGPUMat, &attribs); + attrib_num = GetAttribNum(); + + ras->SetTexCoordNum(0); + ras->SetAttribNum(attrib_num); + for(i=0; iSetAttrib(RAS_IRasterizer::RAS_TEXCO_DISABLE, i); + + for(i = 0; i < attribs.totlayer; i++) { + if(attribs.layer[i].glindex > attrib_num) + continue; + + if(attribs.layer[i].type == CD_MTFACE) + ras->SetAttrib(RAS_IRasterizer::RAS_TEXCO_UV1, attribs.layer[i].glindex); + else if(attribs.layer[i].type == CD_TANGENT) + ras->SetAttrib(RAS_IRasterizer::RAS_TEXTANGENT, attribs.layer[i].glindex); + else if(attribs.layer[i].type == CD_ORCO) + ras->SetAttrib(RAS_IRasterizer::RAS_TEXCO_ORCO, attribs.layer[i].glindex); + else if(attribs.layer[i].type == CD_NORMAL) + ras->SetAttrib(RAS_IRasterizer::RAS_TEXCO_NORM, attribs.layer[i].glindex); + } + + ras->EnableTextures(true); + } + else + ras->EnableTextures(false); +#endif +} + +void BL_BlenderShader::Update( const KX_MeshSlot & ms, RAS_IRasterizer* rasty ) +{ +#if 0 + float obmat[4][4], viewmat[4][4]; + + if(!mGPUMat || !mBound) + return; + + MT_Matrix4x4 model; + model.setValue(ms.m_OpenGLMatrix); + MT_Matrix4x4 view; + rasty->GetViewMatrix(view); + + model.getValue((float*)obmat); + view.getValue((float*)viewmat); + + GPU_material_bind_uniforms(mGPUMat, obmat, viewmat); +#endif +} + +// eof diff --git a/source/gameengine/Ketsji/BL_BlenderShader.h b/source/gameengine/Ketsji/BL_BlenderShader.h new file mode 100644 index 00000000000..4cab0e644c3 --- /dev/null +++ b/source/gameengine/Ketsji/BL_BlenderShader.h @@ -0,0 +1,44 @@ + +#ifndef __BL_GPUSHADER_H__ +#define __BL_GPUSHADER_H__ + +#if 0 +#include "GPU_material.h" +#endif + +#include "MT_Matrix4x4.h" +#include "MT_Matrix3x3.h" +#include "MT_Tuple2.h" +#include "MT_Tuple3.h" +#include "MT_Tuple4.h" + +struct Material; + +#define BL_MAX_ATTRIB 16 + +/** + * BL_BlenderShader + * Blender GPU shader material + */ +class BL_BlenderShader +{ +private: +#if 0 + GPUMaterial *mGPUMat; +#endif + bool mBound; + +public: + BL_BlenderShader(struct Material *ma); + virtual ~BL_BlenderShader(); + + const bool Ok()const; + void SetProg(bool enable); + + void ApplyShader(); + void SetTexCoords(class RAS_IRasterizer* ras); + int GetAttribNum(); + void Update(const class KX_MeshSlot & ms, class RAS_IRasterizer* rasty); +}; + +#endif//__BL_GPUSHADER_H__ diff --git a/source/gameengine/Ketsji/BL_Material.cpp b/source/gameengine/Ketsji/BL_Material.cpp index 7ed2da590a9..f5312ccd023 100644 --- a/source/gameengine/Ketsji/BL_Material.cpp +++ b/source/gameengine/Ketsji/BL_Material.cpp @@ -34,6 +34,7 @@ BL_Material::BL_Material() rgb[3] = 0; IdMode = 0; ras_mode = 0; + glslmat = 0; tile = 0; matname = "NoMaterial"; matcolor[0] = 0.5f; diff --git a/source/gameengine/Ketsji/BL_Material.h b/source/gameengine/Ketsji/BL_Material.h index 8be91316237..ddb6662830a 100644 --- a/source/gameengine/Ketsji/BL_Material.h +++ b/source/gameengine/Ketsji/BL_Material.h @@ -20,7 +20,7 @@ struct EnvMap; although the more you add the slower the search time will be. we will go for three, which should be enough */ -#define MAXTEX 3//match in RAS_TexVert & RAS_OpenGLRasterizer +#define MAXTEX 3 //match in RAS_TexVert & RAS_OpenGLRasterizer // different mapping modes class BL_Mapping @@ -47,6 +47,7 @@ public: int IdMode; unsigned int ras_mode; + bool glslmat; STR_String texname[MAXTEX]; unsigned int flag[MAXTEX]; diff --git a/source/gameengine/Ketsji/BL_Shader.cpp b/source/gameengine/Ketsji/BL_Shader.cpp index 105a87e767b..15350db6650 100644 --- a/source/gameengine/Ketsji/BL_Shader.cpp +++ b/source/gameengine/Ketsji/BL_Shader.cpp @@ -1,21 +1,5 @@ - -#ifdef WIN32 -#include -#endif // WIN32 -#ifdef __APPLE__ -#define GL_GLEXT_LEGACY 1 -#include -#include -#else -#include -/* #if defined(__sun__) && !defined(__sparc__) -#include -#else -*/ -#include -/* #endif */ -#endif +#include "GL/glew.h" #include #include "BL_Shader.h" @@ -31,7 +15,6 @@ #include "RAS_MeshObject.h" #include "RAS_IRasterizer.h" -//using namespace bgl; #define spit(x) std::cout << x << std::endl; #define SORT_UNIFORMS 1 @@ -46,7 +29,7 @@ BL_Uniform::BL_Uniform(int data_size) mDataLen(data_size) { #ifdef SORT_UNIFORMS - MT_assert(mDataLen <= UNIFORM_MAX_LEN); + MT_assert((int)mDataLen <= UNIFORM_MAX_LEN); mData = (void*)MEM_mallocN(mDataLen, "shader-uniform-alloc"); #endif } @@ -63,7 +46,6 @@ BL_Uniform::~BL_Uniform() void BL_Uniform::Apply(class BL_Shader *shader) { -#ifdef GL_ARB_shader_objects #ifdef SORT_UNIFORMS MT_assert(mType > UNI_NONE && mType < UNI_MAX && mData); @@ -74,48 +56,47 @@ void BL_Uniform::Apply(class BL_Shader *shader) { case UNI_FLOAT: { float *f = (float*)mData; - bgl::blUniform1fARB(mLoc,(GLfloat)*f); + glUniform1fARB(mLoc,(GLfloat)*f); }break; case UNI_INT: { int *f = (int*)mData; - bgl::blUniform1iARB(mLoc, (GLint)*f); + glUniform1iARB(mLoc, (GLint)*f); }break; case UNI_FLOAT2: { float *f = (float*)mData; - bgl::blUniform2fvARB(mLoc,1, (GLfloat*)f); + glUniform2fvARB(mLoc,1, (GLfloat*)f); }break; case UNI_FLOAT3: { float *f = (float*)mData; - bgl::blUniform3fvARB(mLoc,1,(GLfloat*)f); + glUniform3fvARB(mLoc,1,(GLfloat*)f); }break; case UNI_FLOAT4: { float *f = (float*)mData; - bgl::blUniform4fvARB(mLoc,1,(GLfloat*)f); + glUniform4fvARB(mLoc,1,(GLfloat*)f); }break; case UNI_INT2: { int *f = (int*)mData; - bgl::blUniform2ivARB(mLoc,1,(GLint*)f); + glUniform2ivARB(mLoc,1,(GLint*)f); }break; case UNI_INT3: { int *f = (int*)mData; - bgl::blUniform3ivARB(mLoc,1,(GLint*)f); + glUniform3ivARB(mLoc,1,(GLint*)f); }break; case UNI_INT4: { int *f = (int*)mData; - bgl::blUniform4ivARB(mLoc,1,(GLint*)f); + glUniform4ivARB(mLoc,1,(GLint*)f); }break; case UNI_MAT4: { float *f = (float*)mData; - bgl::blUniformMatrix4fvARB(mLoc, 1, mTranspose?GL_TRUE:GL_FALSE,(GLfloat*)f); + glUniformMatrix4fvARB(mLoc, 1, mTranspose?GL_TRUE:GL_FALSE,(GLfloat*)f); }break; case UNI_MAT3: { float *f = (float*)mData; - bgl::blUniformMatrix3fvARB(mLoc, 1, mTranspose?GL_TRUE:GL_FALSE,(GLfloat*)f); + glUniformMatrix3fvARB(mLoc, 1, mTranspose?GL_TRUE:GL_FALSE,(GLfloat*)f); }break; } mDirty = false; #endif -#endif } void BL_Uniform::SetData(int location, int type,bool transpose) @@ -144,17 +125,14 @@ BL_Shader::BL_Shader(PyTypeObject *T) mError(0), mDirty(true) { - // if !RAS_EXT_support._ARB_shader_objects this class will not be used + // if !GLEW_ARB_shader_objects this class will not be used //for (int i=0; i 0 && vertlen < MAX_LOG_LEN){ logInf = (char*)MEM_mallocN(vertlen, "vert-log"); - bgl::blGetInfoLogARB(tmpVert, vertlen, (GLsizei*)&char_len, logInf); + glGetInfoLogARB(tmpVert, vertlen, (GLsizei*)&char_len, logInf); if(char_len >0) { spit("---- Vertex Shader Error ----"); spit(logInf); @@ -308,20 +283,20 @@ bool BL_Shader::LinkProgram() logInf=0; } // check for compile errors - bgl::blGetObjectParameterivARB(tmpVert, GL_OBJECT_COMPILE_STATUS_ARB,(GLint*)&vertstatus); + glGetObjectParameterivARB(tmpVert, GL_OBJECT_COMPILE_STATUS_ARB,(GLint*)&vertstatus); if(!vertstatus) { spit("---- Vertex shader failed to compile ----"); goto programError; } // -- fragment shader ---------------- - tmpFrag = bgl::blCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB); - bgl::blShaderSourceARB(tmpFrag, 1,(const char**)&fragProg, 0); - bgl::blCompileShaderARB(tmpFrag); - bgl::blGetObjectParameterivARB(tmpFrag, GL_OBJECT_INFO_LOG_LENGTH_ARB, (GLint*) &fraglen); + tmpFrag = glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB); + glShaderSourceARB(tmpFrag, 1,(const char**)&fragProg, 0); + glCompileShaderARB(tmpFrag); + glGetObjectParameterivARB(tmpFrag, GL_OBJECT_INFO_LOG_LENGTH_ARB, (GLint*) &fraglen); if(fraglen >0 && fraglen < MAX_LOG_LEN){ logInf = (char*)MEM_mallocN(fraglen, "frag-log"); - bgl::blGetInfoLogARB(tmpFrag, fraglen,(GLsizei*) &char_len, logInf); + glGetInfoLogARB(tmpFrag, fraglen,(GLsizei*) &char_len, logInf); if(char_len >0) { spit("---- Fragment Shader Error ----"); spit(logInf); @@ -330,7 +305,7 @@ bool BL_Shader::LinkProgram() logInf=0; } - bgl::blGetObjectParameterivARB(tmpFrag, GL_OBJECT_COMPILE_STATUS_ARB, (GLint*) &fragstatus); + glGetObjectParameterivARB(tmpFrag, GL_OBJECT_COMPILE_STATUS_ARB, (GLint*) &fragstatus); if(!fragstatus){ spit("---- Fragment shader failed to compile ----"); goto programError; @@ -339,17 +314,17 @@ bool BL_Shader::LinkProgram() // -- program ------------------------ // set compiled vert/frag shader & link - tmpProg = bgl::blCreateProgramObjectARB(); - bgl::blAttachObjectARB(tmpProg, tmpVert); - bgl::blAttachObjectARB(tmpProg, tmpFrag); - bgl::blLinkProgramARB(tmpProg); - bgl::blGetObjectParameterivARB(tmpProg, GL_OBJECT_INFO_LOG_LENGTH_ARB, (GLint*) &proglen); - bgl::blGetObjectParameterivARB(tmpProg, GL_OBJECT_LINK_STATUS_ARB, (GLint*) &progstatus); + tmpProg = glCreateProgramObjectARB(); + glAttachObjectARB(tmpProg, tmpVert); + glAttachObjectARB(tmpProg, tmpFrag); + glLinkProgramARB(tmpProg); + glGetObjectParameterivARB(tmpProg, GL_OBJECT_INFO_LOG_LENGTH_ARB, (GLint*) &proglen); + glGetObjectParameterivARB(tmpProg, GL_OBJECT_LINK_STATUS_ARB, (GLint*) &progstatus); if(proglen > 0 && proglen < MAX_LOG_LEN) { logInf = (char*)MEM_mallocN(proglen, "prog-log"); - bgl::blGetInfoLogARB(tmpProg, proglen, (GLsizei*)&char_len, logInf); + glGetInfoLogARB(tmpProg, proglen, (GLsizei*)&char_len, logInf); if(char_len >0) { spit("---- GLSL Program ----"); spit(logInf); @@ -365,24 +340,24 @@ bool BL_Shader::LinkProgram() // set mShader = tmpProg; - bgl::blDeleteObjectARB(tmpVert); - bgl::blDeleteObjectARB(tmpFrag); + glDeleteObjectARB(tmpVert); + glDeleteObjectARB(tmpFrag); mOk = 1; mError = 0; return true; programError: if(tmpVert) { - bgl::blDeleteObjectARB(tmpVert); + glDeleteObjectARB(tmpVert); tmpVert=0; } if(tmpFrag) { - bgl::blDeleteObjectARB(tmpFrag); + glDeleteObjectARB(tmpFrag); tmpFrag=0; } if(tmpProg) { - bgl::blDeleteObjectARB(tmpProg); + glDeleteObjectARB(tmpProg); tmpProg=0; } @@ -390,9 +365,6 @@ programError: mUse = 0; mError = 1; return false; -#else - return false; -#endif//GL_ARB_shader_objects } const char *BL_Shader::GetVertPtr() @@ -428,15 +400,13 @@ unsigned int BL_Shader::GetProg() void BL_Shader::SetSampler(int loc, int unit) { -#ifdef GL_ARB_shader_objects - if( RAS_EXT_support._ARB_fragment_shader && - RAS_EXT_support._ARB_vertex_shader && - RAS_EXT_support._ARB_shader_objects + if( GLEW_ARB_fragment_shader && + GLEW_ARB_vertex_shader && + GLEW_ARB_shader_objects ) { - bgl::blUniform1iARB(loc, unit); + glUniform1iARB(loc, unit); } -#endif } // //void BL_Shader::InitializeSampler(int unit, BL_Texture* texture) @@ -449,31 +419,28 @@ void BL_Shader::SetSampler(int loc, int unit) void BL_Shader::SetProg(bool enable) { -#ifdef GL_ARB_shader_objects - if( RAS_EXT_support._ARB_fragment_shader && - RAS_EXT_support._ARB_vertex_shader && - RAS_EXT_support._ARB_shader_objects + if( GLEW_ARB_fragment_shader && + GLEW_ARB_vertex_shader && + GLEW_ARB_shader_objects ) { if( mShader != 0 && mOk && enable) { - bgl::blUseProgramObjectARB(mShader); + glUseProgramObjectARB(mShader); } else { - bgl::blUseProgramObjectARB(0); + glUseProgramObjectARB(0); } } -#endif } void BL_Shader::Update( const KX_MeshSlot & ms, RAS_IRasterizer* rasty ) { -#ifdef GL_ARB_shader_objects if(!Ok() || !mPreDef.size()) return; - if( RAS_EXT_support._ARB_fragment_shader && - RAS_EXT_support._ARB_vertex_shader && - RAS_EXT_support._ARB_shader_objects + if( GLEW_ARB_fragment_shader && + GLEW_ARB_vertex_shader && + GLEW_ARB_shader_objects ) { MT_Matrix4x4 model; @@ -578,210 +545,185 @@ void BL_Shader::Update( const KX_MeshSlot & ms, RAS_IRasterizer* rasty ) } } } -#endif } int BL_Shader::GetAttribLocation(const STR_String& name) { -#ifdef GL_ARB_shader_objects - if( RAS_EXT_support._ARB_fragment_shader && - RAS_EXT_support._ARB_vertex_shader && - RAS_EXT_support._ARB_shader_objects + if( GLEW_ARB_fragment_shader && + GLEW_ARB_vertex_shader && + GLEW_ARB_shader_objects ) { - return bgl::blGetAttribLocationARB(mShader, name.ReadPtr()); + return glGetAttribLocationARB(mShader, name.ReadPtr()); } -#endif + return -1; } void BL_Shader::BindAttribute(const STR_String& attr, int loc) { -#ifdef GL_ARB_shader_objects - if( RAS_EXT_support._ARB_fragment_shader && - RAS_EXT_support._ARB_vertex_shader && - RAS_EXT_support._ARB_shader_objects + if( GLEW_ARB_fragment_shader && + GLEW_ARB_vertex_shader && + GLEW_ARB_shader_objects ) { - bgl::blBindAttribLocationARB(mShader, loc, attr.ReadPtr()); + glBindAttribLocationARB(mShader, loc, attr.ReadPtr()); } -#endif } int BL_Shader::GetUniformLocation(const STR_String& name) { -#ifdef GL_ARB_shader_objects - if( RAS_EXT_support._ARB_fragment_shader && - RAS_EXT_support._ARB_vertex_shader && - RAS_EXT_support._ARB_shader_objects + if( GLEW_ARB_fragment_shader && + GLEW_ARB_vertex_shader && + GLEW_ARB_shader_objects ) { MT_assert(mShader!=0); - int location = bgl::blGetUniformLocationARB(mShader, name.ReadPtr()); + int location = glGetUniformLocationARB(mShader, name.ReadPtr()); if(location == -1) spit("Invalid uniform value: " << name.ReadPtr() << "."); return location; } -#endif + return -1; } void BL_Shader::SetUniform(int uniform, const MT_Tuple2& vec) { -#ifdef GL_ARB_shader_objects - if( RAS_EXT_support._ARB_fragment_shader && - RAS_EXT_support._ARB_vertex_shader && - RAS_EXT_support._ARB_shader_objects + if( GLEW_ARB_fragment_shader && + GLEW_ARB_vertex_shader && + GLEW_ARB_shader_objects ) { float value[2]; vec.getValue(value); - bgl::blUniform2fvARB(uniform, 1, value); + glUniform2fvARB(uniform, 1, value); } -#endif } void BL_Shader::SetUniform(int uniform, const MT_Tuple3& vec) { -#ifdef GL_ARB_shader_objects - if( RAS_EXT_support._ARB_fragment_shader && - RAS_EXT_support._ARB_vertex_shader && - RAS_EXT_support._ARB_shader_objects + if( GLEW_ARB_fragment_shader && + GLEW_ARB_vertex_shader && + GLEW_ARB_shader_objects ) { float value[3]; vec.getValue(value); - bgl::blUniform3fvARB(uniform, 1, value); + glUniform3fvARB(uniform, 1, value); } -#endif } void BL_Shader::SetUniform(int uniform, const MT_Tuple4& vec) { -#ifdef GL_ARB_shader_objects - if( RAS_EXT_support._ARB_fragment_shader && - RAS_EXT_support._ARB_vertex_shader && - RAS_EXT_support._ARB_shader_objects + if( GLEW_ARB_fragment_shader && + GLEW_ARB_vertex_shader && + GLEW_ARB_shader_objects ) { float value[4]; vec.getValue(value); - bgl::blUniform4fvARB(uniform, 1, value); + glUniform4fvARB(uniform, 1, value); } -#endif } void BL_Shader::SetUniform(int uniform, const unsigned int& val) { -#ifdef GL_ARB_shader_objects - if( RAS_EXT_support._ARB_fragment_shader && - RAS_EXT_support._ARB_vertex_shader && - RAS_EXT_support._ARB_shader_objects + if( GLEW_ARB_fragment_shader && + GLEW_ARB_vertex_shader && + GLEW_ARB_shader_objects ) { - bgl::blUniform1iARB(uniform, val); + glUniform1iARB(uniform, val); } -#endif } void BL_Shader::SetUniform(int uniform, const int val) { -#ifdef GL_ARB_shader_objects - if( RAS_EXT_support._ARB_fragment_shader && - RAS_EXT_support._ARB_vertex_shader && - RAS_EXT_support._ARB_shader_objects + if( GLEW_ARB_fragment_shader && + GLEW_ARB_vertex_shader && + GLEW_ARB_shader_objects ) { - bgl::blUniform1iARB(uniform, val); + glUniform1iARB(uniform, val); } -#endif } void BL_Shader::SetUniform(int uniform, const float& val) { -#ifdef GL_ARB_shader_objects - if( RAS_EXT_support._ARB_fragment_shader && - RAS_EXT_support._ARB_vertex_shader && - RAS_EXT_support._ARB_shader_objects + if( GLEW_ARB_fragment_shader && + GLEW_ARB_vertex_shader && + GLEW_ARB_shader_objects ) { - bgl::blUniform1fARB(uniform, val); + glUniform1fARB(uniform, val); } -#endif } void BL_Shader::SetUniform(int uniform, const MT_Matrix4x4& vec, bool transpose) { -#ifdef GL_ARB_shader_objects - if( RAS_EXT_support._ARB_fragment_shader && - RAS_EXT_support._ARB_vertex_shader && - RAS_EXT_support._ARB_shader_objects + if( GLEW_ARB_fragment_shader && + GLEW_ARB_vertex_shader && + GLEW_ARB_shader_objects ) { float value[16]; vec.getValue(value); - bgl::blUniformMatrix4fvARB(uniform, 1, transpose?GL_TRUE:GL_FALSE, value); + glUniformMatrix4fvARB(uniform, 1, transpose?GL_TRUE:GL_FALSE, value); } -#endif } void BL_Shader::SetUniform(int uniform, const MT_Matrix3x3& vec, bool transpose) { -#ifdef GL_ARB_shader_objects - if( RAS_EXT_support._ARB_fragment_shader && - RAS_EXT_support._ARB_vertex_shader && - RAS_EXT_support._ARB_shader_objects + if( GLEW_ARB_fragment_shader && + GLEW_ARB_vertex_shader && + GLEW_ARB_shader_objects ) { float value[9]; value[0] = (float)vec[0][0]; value[1] = (float)vec[1][0]; value[2] = (float)vec[2][0]; value[3] = (float)vec[0][1]; value[4] = (float)vec[1][1]; value[5] = (float)vec[2][1]; value[6] = (float)vec[0][2]; value[7] = (float)vec[1][2]; value[7] = (float)vec[2][2]; - bgl::blUniformMatrix3fvARB(uniform, 1, transpose?GL_TRUE:GL_FALSE, value); + glUniformMatrix3fvARB(uniform, 1, transpose?GL_TRUE:GL_FALSE, value); } -#endif } void BL_Shader::SetUniform(int uniform, const float* val, int len) { -#ifdef GL_ARB_shader_objects - if( RAS_EXT_support._ARB_fragment_shader && - RAS_EXT_support._ARB_vertex_shader && - RAS_EXT_support._ARB_shader_objects + if( GLEW_ARB_fragment_shader && + GLEW_ARB_vertex_shader && + GLEW_ARB_shader_objects ) { if(len == 2) - bgl::blUniform2fvARB(uniform, 1,(GLfloat*)val); + glUniform2fvARB(uniform, 1,(GLfloat*)val); else if (len == 3) - bgl::blUniform3fvARB(uniform, 1,(GLfloat*)val); + glUniform3fvARB(uniform, 1,(GLfloat*)val); else if (len == 4) - bgl::blUniform4fvARB(uniform, 1,(GLfloat*)val); + glUniform4fvARB(uniform, 1,(GLfloat*)val); else MT_assert(0); } -#endif } void BL_Shader::SetUniform(int uniform, const int* val, int len) { -#ifdef GL_ARB_shader_objects - if( RAS_EXT_support._ARB_fragment_shader && - RAS_EXT_support._ARB_vertex_shader && - RAS_EXT_support._ARB_shader_objects + if( GLEW_ARB_fragment_shader && + GLEW_ARB_vertex_shader && + GLEW_ARB_shader_objects ) { if(len == 2) - bgl::blUniform2ivARB(uniform, 1, (GLint*)val); + glUniform2ivARB(uniform, 1, (GLint*)val); else if (len == 3) - bgl::blUniform3ivARB(uniform, 1, (GLint*)val); + glUniform3ivARB(uniform, 1, (GLint*)val); else if (len == 4) - bgl::blUniform4ivARB(uniform, 1, (GLint*)val); + glUniform4ivARB(uniform, 1, (GLint*)val); else MT_assert(0); } -#endif } @@ -849,7 +791,6 @@ PyParentObject BL_Shader::Parents[] = { KX_PYMETHODDEF_DOC( BL_Shader, setSource," setSource(vertexProgram, fragmentProgram)" ) { -#ifdef GL_ARB_shader_objects if(mShader !=0 && mOk ) { // already set... @@ -862,7 +803,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setSource," setSource(vertexProgram, fragmentProg vertProg = v; fragProg = f; if( LinkProgram() ) { - bgl::blUseProgramObjectARB( mShader ); + glUseProgramObjectARB( mShader ); mUse = apply!=0; Py_Return; } @@ -871,24 +812,19 @@ KX_PYMETHODDEF_DOC( BL_Shader, setSource," setSource(vertexProgram, fragmentProg mUse = 0; Py_Return; } - return NULL; -#else Py_Return; -#endif } KX_PYMETHODDEF_DOC( BL_Shader, delSource, "delSource( )" ) { -#ifdef GL_ARB_shader_objects ClearUniforms(); - bgl::blUseProgramObjectARB(0); + glUseProgramObjectARB(0); - bgl::blDeleteObjectARB(mShader); + glDeleteObjectARB(mShader); mShader = 0; mOk = 0; mUse = 0; -#endif Py_Return; } @@ -909,7 +845,6 @@ KX_PYMETHODDEF_DOC( BL_Shader, getFragmentProg ,"getFragmentProg( )" ) KX_PYMETHODDEF_DOC( BL_Shader, validate, "validate()") { -#ifdef GL_ARB_shader_objects if(mError) { Py_INCREF(Py_None); return Py_None; @@ -919,15 +854,15 @@ KX_PYMETHODDEF_DOC( BL_Shader, validate, "validate()") return NULL; } int stat = 0; - bgl::blValidateProgramARB(mShader); - bgl::blGetObjectParameterivARB(mShader, GL_OBJECT_VALIDATE_STATUS_ARB,(GLint*) &stat); + glValidateProgramARB(mShader); + glGetObjectParameterivARB(mShader, GL_OBJECT_VALIDATE_STATUS_ARB,(GLint*) &stat); if(stat > 0 && stat < MAX_LOG_LEN) { int char_len=0; char *logInf = (char*)MEM_mallocN(stat, "validate-log"); - bgl::blGetInfoLogARB(mShader, stat,(GLsizei*) &char_len, logInf); + glGetInfoLogARB(mShader, stat,(GLsizei*) &char_len, logInf); if(char_len >0) { spit("---- GLSL Validation ----"); spit(logInf); @@ -935,7 +870,6 @@ KX_PYMETHODDEF_DOC( BL_Shader, validate, "validate()") MEM_freeN(logInf); logInf=0; } -#endif//GL_ARB_shader_objects Py_Return; } @@ -1412,7 +1346,6 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformMatrix3, KX_PYMETHODDEF_DOC( BL_Shader, setAttrib, "setAttrib(enum)" ) { -#ifdef GL_ARB_shader_objects if(mError) { Py_INCREF(Py_None); return Py_None; @@ -1424,11 +1357,10 @@ KX_PYMETHODDEF_DOC( BL_Shader, setAttrib, "setAttrib(enum)" ) return NULL; } mAttr=SHD_TANGENT; - bgl::blUseProgramObjectARB(mShader); - bgl::blBindAttribLocationARB(mShader, mAttr, "Tangent"); + glUseProgramObjectARB(mShader); + glBindAttribLocationARB(mShader, mAttr, "Tangent"); Py_Return; } -#endif return NULL; } diff --git a/source/gameengine/Ketsji/BL_Texture.cpp b/source/gameengine/Ketsji/BL_Texture.cpp index 687b1af957d..f24ef4322f0 100644 --- a/source/gameengine/Ketsji/BL_Texture.cpp +++ b/source/gameengine/Ketsji/BL_Texture.cpp @@ -1,19 +1,6 @@ // ------------------------------------ -#ifdef WIN32 -#include -#endif // WIN32 -#ifdef __APPLE__ -#define GL_GLEXT_LEGACY 1 -#include -#include -#else -#include -/* #if defined(__sun__) && !defined(__sparc__) -#include -#else */ -#include -/* #endif */ -#endif + +#include "GL/glew.h" #include #include @@ -30,15 +17,11 @@ #include "BLI_blenlib.h" #include "RAS_OpenGLRasterizer/RAS_GLExtensionManager.h" -#include "RAS_OpenGLRasterizer/ARB_multitexture.h" #include "RAS_ICanvas.h" #include "RAS_Rect.h" #include "KX_GameObject.h" - -using namespace bgl; - #define spit(x) std::cout << x << std::endl; #include "MEM_guardedalloc.h" @@ -220,9 +203,7 @@ void BL_Texture::InitNonPow2Tex(unsigned int *pix,int x,int y,bool mipmap) bool BL_Texture::InitCubeMap(int unit, EnvMap *cubemap) { -#ifdef GL_ARB_texture_cube_map - - if (!RAS_EXT_support._ARB_texture_cube_map) + if (!GLEW_ARB_texture_cube_map) { spit("cubemaps not supported"); mOk = false; @@ -312,9 +293,8 @@ bool BL_Texture::InitCubeMap(int unit, EnvMap *cubemap) glTexParameteri( GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); glTexParameteri( GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); glTexParameteri( GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); - #ifdef GL_VERSION_1_2 - glTexParameteri( GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE ); - #endif + if(GLEW_VERSION_1_2) + glTexParameteri( GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE ); if (needs_split) my_free_envmapdata(cubemap); @@ -326,13 +306,6 @@ bool BL_Texture::InitCubeMap(int unit, EnvMap *cubemap) mOk = IsValid(); return mOk; - -#else - - mOk = false; - return mOk; - -#endif//GL_ARB_texture_cube_map } bool BL_Texture::IsValid() @@ -362,58 +335,40 @@ int BL_Texture::GetMaxUnits() { GLint unit=0; -#if defined(GL_ARB_multitexture) && defined(WITH_GLEXT) - if (!getenv("WITHOUT_GLEXT")) { - if(RAS_EXT_support._ARB_multitexture) { - glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &unit); - return (MAXTEX>=unit?unit:MAXTEX); - } + if(GLEW_ARB_multitexture) { + glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &unit); + return (MAXTEX>=unit?unit:MAXTEX); } -#endif + return 0; } void BL_Texture::ActivateFirst() { -#if defined(GL_ARB_multitexture) && defined(WITH_GLEXT) - if (!getenv("WITHOUT_GLEXT")) { - if(RAS_EXT_support._ARB_multitexture) - bgl::blActiveTextureARB(GL_TEXTURE0_ARB); - } -#endif + if(GLEW_ARB_multitexture) + glActiveTextureARB(GL_TEXTURE0_ARB); } void BL_Texture::ActivateUnit(int unit) { -#if defined(GL_ARB_multitexture) && defined(WITH_GLEXT) - if (!getenv("WITHOUT_GLEXT")) { - if(RAS_EXT_support._ARB_multitexture) - if(unit <= MAXTEX) - bgl::blActiveTextureARB(GL_TEXTURE0_ARB+unit); - } -#endif + if(GLEW_ARB_multitexture) + if(unit <= MAXTEX) + glActiveTextureARB(GL_TEXTURE0_ARB+unit); } void BL_Texture::DisableUnit() { -#if defined(GL_ARB_multitexture) && defined(WITH_GLEXT) - if (!getenv("WITHOUT_GLEXT")) { - if(RAS_EXT_support._ARB_multitexture) - bgl::blActiveTextureARB(GL_TEXTURE0_ARB+mUnit); - } -#endif - + if(GLEW_ARB_multitexture) + glActiveTextureARB(GL_TEXTURE0_ARB+mUnit); glMatrixMode(GL_TEXTURE); glLoadIdentity(); glMatrixMode(GL_MODELVIEW); - #ifdef GL_ARB_texture_cube_map - if(RAS_EXT_support._ARB_texture_cube_map && glIsEnabled(GL_TEXTURE_CUBE_MAP_ARB)) + if(GLEW_ARB_texture_cube_map && glIsEnabled(GL_TEXTURE_CUBE_MAP_ARB)) glDisable(GL_TEXTURE_CUBE_MAP_ARB); else - #endif { if (glIsEnabled(GL_TEXTURE_2D)) glDisable(GL_TEXTURE_2D); @@ -429,56 +384,45 @@ void BL_Texture::DisableUnit() void BL_Texture::DisableAllTextures() { -#if defined(GL_ARB_multitexture) && defined(WITH_GLEXT) - if (!getenv("WITHOUT_GLEXT")) { - glDisable(GL_BLEND); - for(int i=0; i #endif -#ifdef WIN32 -#include -#endif // WIN32 -#ifdef __APPLE__ -#define GL_GLEXT_LEGACY 1 -#include -#include -#else -#include -/* #if defined(__sun__) && !defined(__sparc__) -#include -#else -*/ -#include -/* #endif */ -#endif +#include "GL/glew.h" #include "KX_BlenderMaterial.h" #include "BL_Material.h" @@ -37,7 +22,6 @@ #include "RAS_MeshObject.h" #include "RAS_IRasterizer.h" #include "RAS_OpenGLRasterizer/RAS_GLExtensionManager.h" -#include "RAS_OpenGLRasterizer/ARB_multitexture.h" extern "C" { #include "BDR_drawmesh.h" @@ -52,7 +36,6 @@ extern "C" { #include "DNA_meshdata_types.h" #include "BKE_mesh.h" // ------------------------------------ -using namespace bgl; #define spit(x) std::cout << x << std::endl; //static PyObject *gTextureDict = 0; @@ -81,6 +64,7 @@ KX_BlenderMaterial::KX_BlenderMaterial( ), mMaterial(data), mShader(0), + mBlenderShader(0), mScene(scene), mUserDefBlend(0), mModified(0), @@ -100,9 +84,6 @@ KX_BlenderMaterial::KX_BlenderMaterial( int max = BL_Texture::GetMaxUnits(); mMaterial->num_enabled = enabled>=max?max:enabled; - // base class - m_enabled = mMaterial->num_enabled; - // test the sum of the various modes for equality // so we can ether accept or reject this material // as being equal, this is rather important to @@ -144,25 +125,30 @@ void KX_BlenderMaterial::OnConstruction() if (mConstructed) // when material are reused between objects return; - - // for each unique material... - int i; - for(i=0; inum_enabled; i++) { - if( mMaterial->mapping[i].mapping & USEENV ) { - if(!RAS_EXT_support._ARB_texture_cube_map) { - spit("CubeMap textures not supported"); - continue; - } - if(!mTextures[i].InitCubeMap(i, mMaterial->cubemap[i] ) ) - spit("unable to initialize image("<matname<< ", image will not be available"); - } - else { - if( mMaterial->img[i] ) { - if( ! mTextures[i].InitFromImage(i, mMaterial->img[i], (mMaterial->flag[i] &MIPMAP)!=0 )) + if(mMaterial->glslmat) { + SetBlenderGLSLShader(); + } + else { + // for each unique material... + int i; + for(i=0; inum_enabled; i++) { + if( mMaterial->mapping[i].mapping & USEENV ) { + if(!GLEW_ARB_texture_cube_map) { + spit("CubeMap textures not supported"); + continue; + } + if(!mTextures[i].InitCubeMap(i, mMaterial->cubemap[i] ) ) spit("unable to initialize image("<matname<< ", image will not be available"); + mMaterial->matname<< ", image will not be available"); + } + + else { + if( mMaterial->img[i] ) { + if( ! mTextures[i].InitFromImage(i, mMaterial->img[i], (mMaterial->flag[i] &MIPMAP)!=0 )) + spit("unable to initialize image("<matname<< ", image will not be available"); + } } } } @@ -176,11 +162,17 @@ void KX_BlenderMaterial::OnExit() if( mShader ) { //note, the shader here is allocated, per unique material //and this function is called per face - mShader->SetProg(0); + mShader->SetProg(false); delete mShader; mShader = 0; } + if( mBlenderShader ) { + mBlenderShader->SetProg(false); + delete mBlenderShader; + mBlenderShader = 0; + } + BL_Texture::ActivateFirst(); for(int i=0; inum_enabled; i++) { BL_Texture::ActivateUnit(i); @@ -195,7 +187,7 @@ void KX_BlenderMaterial::OnExit() void KX_BlenderMaterial::setShaderData( bool enable, RAS_IRasterizer *ras) { - MT_assert(RAS_EXT_support._ARB_shader_objects && mShader); + MT_assert(GLEW_ARB_shader_objects && mShader); int i; if( !enable || !mShader->Ok() ) { @@ -229,10 +221,23 @@ void KX_BlenderMaterial::setShaderData( bool enable, RAS_IRasterizer *ras) } } +void KX_BlenderMaterial::setBlenderShaderData( bool enable, RAS_IRasterizer *ras) +{ + if( !enable || !mBlenderShader->Ok() ) { + // frame cleanup. + mBlenderShader->SetProg(false); + BL_Texture::DisableAllTextures(); + return; + } + + BL_Texture::DisableAllTextures(); + mBlenderShader->SetProg(true); + mBlenderShader->ApplyShader(); +} void KX_BlenderMaterial::setTexData( bool enable, RAS_IRasterizer *ras) { - if(RAS_EXT_support._ARB_shader_objects && mShader) + if(GLEW_ARB_shader_objects && mShader) mShader->SetProg(false); BL_Texture::DisableAllTextures(); @@ -301,14 +306,10 @@ KX_BlenderMaterial::ActivatShaders( cachingInfo = GetCachingInfo(); - if (rasty->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED ) { + if(rasty->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED) tmp->setShaderData( true, rasty); - rasty->EnableTextures(true); - } - else { + else tmp->setShaderData( false, rasty); - rasty->EnableTextures(false); - } if(mMaterial->mode & RAS_IRasterizer::KX_TWOSIDE) rasty->SetCullFace(false); @@ -330,24 +331,28 @@ KX_BlenderMaterial::ActivatShaders( } void -KX_BlenderMaterial::ActivateMat( - RAS_IRasterizer* rasty, - TCachingInfo& cachingInfo - )const +KX_BlenderMaterial::ActivateBlenderShaders( + RAS_IRasterizer* rasty, + TCachingInfo& cachingInfo)const { KX_BlenderMaterial *tmp = const_cast(this); + + // reset... + if(tmp->mMaterial->IsShared()) + cachingInfo =0; + if (GetCachingInfo() != cachingInfo) { - if (!cachingInfo) - tmp->setTexData( false,rasty ); + if (!cachingInfo) + tmp->setBlenderShaderData(false, rasty); cachingInfo = GetCachingInfo(); - - if (rasty->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED) { - tmp->setTexData( true,rasty ); + + if(rasty->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED) { + tmp->setBlenderShaderData(true, rasty); rasty->EnableTextures(true); } - else{ - tmp->setTexData( false,rasty); + else { + tmp->setBlenderShaderData(false, rasty); rasty->EnableTextures(false); } @@ -365,11 +370,48 @@ KX_BlenderMaterial::ActivateMat( else rasty->SetLines(false); } + + ActivatGLMaterials(rasty); + mBlenderShader->SetTexCoords(rasty); +} + +void +KX_BlenderMaterial::ActivateMat( + RAS_IRasterizer* rasty, + TCachingInfo& cachingInfo + )const +{ + KX_BlenderMaterial *tmp = const_cast(this); + if (GetCachingInfo() != cachingInfo) { + if (!cachingInfo) + tmp->setTexData( false,rasty ); + + cachingInfo = GetCachingInfo(); + + if (rasty->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED) + tmp->setTexData( true,rasty ); + else + tmp->setTexData( false,rasty); + + if(mMaterial->mode & RAS_IRasterizer::KX_TWOSIDE) + rasty->SetCullFace(false); + else + rasty->SetCullFace(true); + + if (((mMaterial->ras_mode &WIRE)!=0) || mMaterial->mode & RAS_IRasterizer::KX_LINES) + { + if((mMaterial->ras_mode &WIRE)!=0) + rasty->SetCullFace(false); + rasty->SetLines(true); + } + else + rasty->SetLines(false); + } + ActivatGLMaterials(rasty); ActivateTexGen(rasty); } - bool KX_BlenderMaterial::Activate( RAS_IRasterizer* rasty, @@ -377,7 +419,7 @@ KX_BlenderMaterial::Activate( )const { bool dopass = false; - if( RAS_EXT_support._ARB_shader_objects && ( mShader && mShader->Ok() ) ) { + if( GLEW_ARB_shader_objects && ( mShader && mShader->Ok() ) ) { if( (mPass++) < mShader->getNumPass() ) { ActivatShaders(rasty, cachingInfo); dopass = true; @@ -390,6 +432,18 @@ KX_BlenderMaterial::Activate( return dopass; } } + else if( GLEW_ARB_shader_objects && ( mBlenderShader && mBlenderShader->Ok() ) ) { + if( (mPass++) == 0 ) { + ActivateBlenderShaders(rasty, cachingInfo); + dopass = true; + return dopass; + } + else { + mPass = 0; + dopass = false; + return dopass; + } + } else { switch (mPass++) { @@ -408,34 +462,39 @@ KX_BlenderMaterial::Activate( void KX_BlenderMaterial::ActivateMeshSlot(const KX_MeshSlot & ms, RAS_IRasterizer* rasty) const { - if(mShader && RAS_EXT_support._ARB_shader_objects) + if(mShader && GLEW_ARB_shader_objects) mShader->Update(ms, rasty); + if(mBlenderShader && GLEW_ARB_shader_objects) + mBlenderShader->Update(ms, rasty); } void KX_BlenderMaterial::ActivatGLMaterials( RAS_IRasterizer* rasty )const { - rasty->SetSpecularity( - mMaterial->speccolor[0]*mMaterial->spec_f, - mMaterial->speccolor[1]*mMaterial->spec_f, - mMaterial->speccolor[2]*mMaterial->spec_f, - mMaterial->spec_f - ); + if(!mBlenderShader) { + rasty->SetSpecularity( + mMaterial->speccolor[0]*mMaterial->spec_f, + mMaterial->speccolor[1]*mMaterial->spec_f, + mMaterial->speccolor[2]*mMaterial->spec_f, + mMaterial->spec_f + ); - rasty->SetShinyness( mMaterial->hard ); + rasty->SetShinyness( mMaterial->hard ); - rasty->SetDiffuse( - mMaterial->matcolor[0]*mMaterial->ref+mMaterial->emit, - mMaterial->matcolor[1]*mMaterial->ref+mMaterial->emit, - mMaterial->matcolor[2]*mMaterial->ref+mMaterial->emit, - 1.0f); + rasty->SetDiffuse( + mMaterial->matcolor[0]*mMaterial->ref+mMaterial->emit, + mMaterial->matcolor[1]*mMaterial->ref+mMaterial->emit, + mMaterial->matcolor[2]*mMaterial->ref+mMaterial->emit, + 1.0f); - rasty->SetEmissive( - mMaterial->matcolor[0]*mMaterial->emit, - mMaterial->matcolor[1]*mMaterial->emit, - mMaterial->matcolor[2]*mMaterial->emit, - 1.0 ); + rasty->SetEmissive( + mMaterial->matcolor[0]*mMaterial->emit, + mMaterial->matcolor[1]*mMaterial->emit, + mMaterial->matcolor[2]*mMaterial->emit, + 1.0 ); + + rasty->SetAmbient(mMaterial->amb); + } - rasty->SetAmbient(mMaterial->amb); if (mMaterial->material) rasty->SetPolygonOffset(-mMaterial->material->zoffs, 0.0); } @@ -443,34 +502,46 @@ void KX_BlenderMaterial::ActivatGLMaterials( RAS_IRasterizer* rasty )const void KX_BlenderMaterial::ActivateTexGen(RAS_IRasterizer *ras) const { - if(mShader && RAS_EXT_support._ARB_shader_objects) - if(mShader->GetAttribute() == BL_Shader::SHD_TANGENT) - ras->SetAttrib(RAS_IRasterizer::RAS_TEXTANGENT); - - for(int i=0; inum_enabled; i++) { - int mode = mMaterial->mapping[i].mapping; - - if (mode &USECUSTOMUV) - { - STR_String str = mMaterial->mapping[i].uvCoName; - if (!str.IsEmpty()) - ras->SetTexCoords(RAS_IRasterizer::RAS_TEXCO_UV2, i); - continue; + if(ras->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED) { + ras->SetAttribNum(0); + if(mShader && GLEW_ARB_shader_objects) { + if(mShader->GetAttribute() == BL_Shader::SHD_TANGENT) { + ras->SetAttrib(RAS_IRasterizer::RAS_TEXTANGENT, 1); + ras->SetAttribNum(2); + } } - if( mode &(USEREFL|USEOBJ)) - ras->SetTexCoords(RAS_IRasterizer::RAS_TEXCO_GEN, i); - else if(mode &USEORCO) - ras->SetTexCoords(RAS_IRasterizer::RAS_TEXCO_ORCO, i); - else if(mode &USENORM) - ras->SetTexCoords(RAS_IRasterizer::RAS_TEXCO_NORM, i); - else if(mode &USEUV) - ras->SetTexCoords(RAS_IRasterizer::RAS_TEXCO_UV1, i); - else if(mode &USETANG) - ras->SetTexCoords(RAS_IRasterizer::RAS_TEXTANGENT, i); - else - ras->SetTexCoords(RAS_IRasterizer::RAS_TEXCO_DISABLE, i); + ras->SetTexCoordNum(mMaterial->num_enabled); + + for(int i=0; inum_enabled; i++) { + int mode = mMaterial->mapping[i].mapping; + + if (mode &USECUSTOMUV) + { + STR_String str = mMaterial->mapping[i].uvCoName; + if (!str.IsEmpty()) + ras->SetTexCoord(RAS_IRasterizer::RAS_TEXCO_UV2, i); + continue; + } + + if( mode &(USEREFL|USEOBJ)) + ras->SetTexCoord(RAS_IRasterizer::RAS_TEXCO_GEN, i); + else if(mode &USEORCO) + ras->SetTexCoord(RAS_IRasterizer::RAS_TEXCO_ORCO, i); + else if(mode &USENORM) + ras->SetTexCoord(RAS_IRasterizer::RAS_TEXCO_NORM, i); + else if(mode &USEUV) + ras->SetTexCoord(RAS_IRasterizer::RAS_TEXCO_UV1, i); + else if(mode &USETANG) + ras->SetTexCoord(RAS_IRasterizer::RAS_TEXTANGENT, i); + else + ras->SetTexCoord(RAS_IRasterizer::RAS_TEXCO_DISABLE, i); + } + + ras->EnableTextures(true); } + else + ras->EnableTextures(false); } bool KX_BlenderMaterial::setDefaultBlending() @@ -493,7 +564,7 @@ bool KX_BlenderMaterial::setDefaultBlending() glDisable(GL_BLEND); glEnable ( GL_ALPHA_TEST ); glAlphaFunc(GL_GREATER, 0.5f); - return true; + return false; } return false; } @@ -503,8 +574,7 @@ void KX_BlenderMaterial::setTexMatrixData(int i) glMatrixMode(GL_TEXTURE); glLoadIdentity(); -#ifdef GL_ARB_texture_cube_map - if( RAS_EXT_support._ARB_texture_cube_map && + if( GLEW_ARB_texture_cube_map && mTextures[i].GetTextureType() == GL_TEXTURE_CUBE_MAP_ARB && mMaterial->mapping[i].mapping & USEREFL) { glScalef( @@ -514,7 +584,6 @@ void KX_BlenderMaterial::setTexMatrixData(int i) ); } else -#endif { glScalef( mMaterial->mapping[i].scale[0], @@ -663,28 +732,23 @@ int KX_BlenderMaterial::_setattr(const STR_String& attr, PyObject *pyvalue) KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getShader , "getShader()") { -#ifdef GL_ARB_fragment_shader - if( !RAS_EXT_support._ARB_fragment_shader) { + if( !GLEW_ARB_fragment_shader) { if(!mModified) spit("Fragment shaders not supported"); mModified = true; Py_Return; } -#endif -#ifdef GL_ARB_vertex_shader - if( !RAS_EXT_support._ARB_vertex_shader) { + if( !GLEW_ARB_vertex_shader) { if(!mModified) spit("Vertex shaders not supported"); mModified = true; Py_Return; } -#endif -#ifdef GL_ARB_shader_objects - if(!RAS_EXT_support._ARB_shader_objects) { + if(!GLEW_ARB_shader_objects) { if(!mModified) spit("GLSL not supported"); mModified = true; @@ -723,13 +787,20 @@ KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getShader , "getShader()") } PyErr_Format(PyExc_ValueError, "GLSL Error"); return NULL; - -#else - Py_Return; -#endif//GL_ARB_shader_objects } +void KX_BlenderMaterial::SetBlenderGLSLShader(void) +{ + if(!mBlenderShader) + mBlenderShader = new BL_BlenderShader(mMaterial->material); + + if(!mBlenderShader->Ok()) { + delete mBlenderShader; + mBlenderShader = 0; + } +} + KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getMaterialIndex, "getMaterialIndex()") { return PyInt_FromLong( mMaterial->material_index ); diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h index b9d48199520..62e96b71937 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.h +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h @@ -8,6 +8,7 @@ #include "BL_Material.h" #include "BL_Texture.h" #include "BL_Shader.h" +#include "BL_BlenderShader.h" #include "PyObjectPlus.h" @@ -60,6 +61,10 @@ public: TCachingInfo& cachingInfo )const; + void ActivateBlenderShaders( + RAS_IRasterizer* rasty, + TCachingInfo& cachingInfo + )const; MTFace* GetMTFace(void) const; unsigned int* GetMCol(void) const; @@ -86,8 +91,9 @@ public: // pre calculate to avoid pops/lag at startup virtual void OnConstruction( ); private: - BL_Material* mMaterial; - BL_Shader* mShader; + BL_Material* mMaterial; + BL_Shader* mShader; + BL_BlenderShader* mBlenderShader; KX_Scene* mScene; BL_Texture mTextures[MAXTEX]; // texture array bool mUserDefBlend; @@ -95,12 +101,15 @@ private: bool mModified; bool mConstructed; // if false, don't clean on exit + void SetBlenderGLSLShader(); + void ActivatGLMaterials( RAS_IRasterizer* rasty )const; void ActivateTexGen( RAS_IRasterizer *ras ) const; // message centers void setTexData( bool enable,RAS_IRasterizer *ras); + void setBlenderShaderData( bool enable, RAS_IRasterizer *ras); void setShaderData( bool enable, RAS_IRasterizer *ras); bool setDefaultBlending(); diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index c192cd01261..eaa6564ba84 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -78,11 +78,12 @@ KX_GameObject::KX_GameObject( m_bSuspendDynamics(false), m_bUseObjectColor(false), m_bIsNegativeScaling(false), + m_pBlenderObject(NULL), m_bVisible(true), m_pPhysicsController1(NULL), m_pPhysicsEnvironment(NULL), - m_isDeformable(false), - m_pHitObject(NULL) + m_pHitObject(NULL), + m_isDeformable(false) { m_ignore_activity_culling = false; m_pClient_info = new KX_ClientObjectInfo(this, KX_ClientObjectInfo::ACTOR); @@ -645,8 +646,8 @@ void KX_GameObject::AlignAxisToVect(const MT_Vector3& dir, int axis) MT_Vector3 KX_GameObject::GetLinearVelocity(bool local) { - MT_Vector3 velocity(0.0,0.0,0.0); - MT_Matrix3x3 ori, locvel; + MT_Vector3 velocity(0.0,0.0,0.0), locvel; + MT_Matrix3x3 ori; int i, j; if (m_pPhysicsController1) { @@ -656,11 +657,8 @@ MT_Vector3 KX_GameObject::GetLinearVelocity(bool local) { ori = GetSGNode()->GetWorldOrientation(); - for(i=0; i < 3; i++) - for(j=0; j < 3; j++) - locvel[i][j]= velocity[i]*ori[i][j]; - for(i=0; i < 3; i++) - velocity[i] = locvel[0][i] + locvel[1][i] + locvel[2][i]; + locvel = velocity * ori; + return locvel; } } return velocity; @@ -911,6 +909,14 @@ PyObject* KX_GameObject::_getattr(const STR_String& attr) if (attr == "name") return PyString_FromString(m_name.ReadPtr()); + if (attr == "timeOffset") { + if (m_pSGNode->GetSGParent()->IsSlowParent()) { + return PyFloat_FromDouble(static_cast(m_pSGNode->GetSGParent()->GetParentRelation())->GetTimeOffset()); + } else { + return PyFloat_FromDouble(0.0); + } + } + _getattr_up(SCA_IObject); } @@ -932,6 +938,19 @@ int KX_GameObject::_setattr(const STR_String& attr, PyObject *value) // _setattr return 0; } } + + if (PyFloat_Check(value)) + { + MT_Scalar val = PyFloat_AsDouble(value); + if (attr == "timeOffset") { + if (m_pSGNode->GetSGParent()->IsSlowParent()) { + static_cast(m_pSGNode->GetSGParent()->GetParentRelation())->SetTimeOffset(val); + return 0; + } else { + return 0; + } + } + } if (PySequence_Check(value)) { diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 56b9f3f6375..63a660617c4 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -45,9 +45,8 @@ #include "GEN_Map.h" #include "GEN_HashedPtr.h" #include "KX_Scene.h" +#include "KX_KetsjiEngine.h" /* for m_anim_framerate */ -#define KX_FIXED_FRAME_PER_SEC 25.0f -#define KX_FIXED_SEC_PER_FRAME (1.0f / KX_FIXED_FRAME_PER_SEC) #define KX_OB_DYNAMIC 1 @@ -56,7 +55,7 @@ struct KX_ClientObjectInfo; class RAS_MeshObject; class KX_IPhysicsController; class PHY_IPhysicsEnvironment; - +struct Object; /** * KX_GameObject is the main class for dynamic objects. @@ -72,6 +71,7 @@ protected: STR_String m_text; int m_layer; std::vector m_meshes; + struct Object* m_pBlenderObject; bool m_bSuspendDynamics; bool m_bUseObjectColor; @@ -360,6 +360,20 @@ public: return m_pSGNode; } + /** + * @section blender object accessor functions. + */ + + struct Object* GetBlenderObject( ) + { + return m_pBlenderObject; + } + + void SetBlenderObject( struct Object* obj) + { + m_pBlenderObject = obj; + } + /** * Set the Scene graph node for this game object. * warning - it is your responsibility to make sure diff --git a/source/gameengine/Ketsji/KX_ISceneConverter.h b/source/gameengine/Ketsji/KX_ISceneConverter.h index bba289bf891..f069048cd3d 100644 --- a/source/gameengine/Ketsji/KX_ISceneConverter.h +++ b/source/gameengine/Ketsji/KX_ISceneConverter.h @@ -74,6 +74,9 @@ public: virtual void SetMaterials(bool val) =0; virtual bool GetMaterials()=0; + // use blender glsl materials + virtual void SetGLSLMaterials(bool val) =0; + virtual bool GetGLSLMaterials()=0; }; #endif //__KX_ISCENECONVERTER_H diff --git a/source/gameengine/Ketsji/KX_IpoActuator.cpp b/source/gameengine/Ketsji/KX_IpoActuator.cpp index 0f9caa456d9..cf246342cf9 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.cpp +++ b/source/gameengine/Ketsji/KX_IpoActuator.cpp @@ -164,14 +164,14 @@ void KX_IpoActuator::SetStartTime(float curtime) curtime = curtime - KX_KetsjiEngine::GetSuspendedDelta(); if (m_direction > 0) - m_starttime = curtime - direction*(m_localtime - m_startframe)/KX_FIXED_FRAME_PER_SEC; + m_starttime = curtime - direction*(m_localtime - m_startframe)/KX_KetsjiEngine::GetAnimFrameRate(); else - m_starttime = curtime - direction*(m_endframe - m_localtime)/KX_FIXED_FRAME_PER_SEC; + m_starttime = curtime - direction*(m_endframe - m_localtime)/KX_KetsjiEngine::GetAnimFrameRate(); } void KX_IpoActuator::SetLocalTime(float curtime) { - float delta_time = ((curtime - m_starttime) - KX_KetsjiEngine::GetSuspendedDelta())*KX_FIXED_FRAME_PER_SEC; + float delta_time = ((curtime - m_starttime) - KX_KetsjiEngine::GetSuspendedDelta())*KX_KetsjiEngine::GetAnimFrameRate(); // negative delta_time is caused by floating point inaccuracy // perhaps the inaccuracy could be reduced a bit diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index 1e3393d59a8..56a06786679 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -71,6 +71,7 @@ #include "KX_TimeCategoryLogger.h" #include "RAS_FramingManager.h" +#include "stdio.h" // If define: little test for Nzc: guarded drawing. If the canvas is // not valid, skip rendering this frame. @@ -91,7 +92,7 @@ const char KX_KetsjiEngine::m_profileLabels[tc_numCategories][15] = { }; double KX_KetsjiEngine::m_ticrate = DEFAULT_LOGIC_TIC_RATE; - +double KX_KetsjiEngine::m_anim_framerate = 25.0; double KX_KetsjiEngine::m_suspendedtime = 0.0; double KX_KetsjiEngine::m_suspendeddelta = 0.0; @@ -1383,6 +1384,16 @@ void KX_KetsjiEngine::SetTicRate(double ticrate) m_ticrate = ticrate; } +double KX_KetsjiEngine::GetAnimFrameRate() +{ + return m_anim_framerate; +} + +void KX_KetsjiEngine::SetAnimFrameRate(double framerate) +{ + m_anim_framerate = framerate; +} + void KX_KetsjiEngine::SetTimingDisplay(bool frameRate, bool profile, bool properties) { m_show_framerate = frameRate; diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h index bc2e3864be8..4c09bc3fcd5 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.h +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h @@ -103,6 +103,7 @@ private: double m_remainingTime; static double m_ticrate; + static double m_anim_framerate; /* for animation playback only - ipo and action */ static double m_suspendedtime; static double m_suspendeddelta; @@ -260,6 +261,15 @@ public: */ static void SetTicRate(double ticrate); + /** + * Gets the framerate for playing animations. (actions and ipos) + */ + static double GetAnimFrameRate(); + /** + * Sets the framerate for playing animations. (actions and ipos) + */ + static void SetAnimFrameRate(double framerate); + /** * Activates or deactivates timing information display. * @param frameRate Display for frame rate on or off. diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index a80a7f04e8f..0831788009d 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -28,25 +28,7 @@ * Initialize Python thingies. */ -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef WIN32 -#include -#endif // WIN32 -#ifdef __APPLE__ -#define GL_GLEXT_LEGACY 1 -#include -#include -#else -#include -/* #if defined(__sun__) && !defined(__sparc__) -#include -#else */ -#include -/* #endif */ -#endif +#include "GL/glew.h" #include @@ -310,17 +292,13 @@ static PyObject* gPyGetCurrentScene(PyObject* self, static PyObject *pyPrintExt(PyObject *,PyObject *,PyObject *) { #define pprint(x) std::cout << x << std::endl; - bgl::BL_EXTInfo ext = bgl::RAS_EXT_support; bool count=0; bool support=0; pprint("Supported Extensions..."); -#ifdef GL_ARB_shader_objects - pprint(" GL_ARB_shader_objects supported? "<< (ext._ARB_shader_objects?"yes.":"no.")); + pprint(" GL_ARB_shader_objects supported? "<< (GLEW_ARB_shader_objects?"yes.":"no.")); count = 1; -#endif -#ifdef GL_ARB_vertex_shader - support= ext._ARB_vertex_shader; + support= GLEW_ARB_vertex_shader; pprint(" GL_ARB_vertex_shader supported? "<< (support?"yes.":"no.")); count = 1; if(support){ @@ -339,9 +317,8 @@ static PyObject *pyPrintExt(PyObject *,PyObject *,PyObject *) pprint(" Max combined texture units." << max); pprint(""); } -#endif -#ifdef GL_ARB_fragment_shader - support=ext._ARB_fragment_shader; + + support=GLEW_ARB_fragment_shader; pprint(" GL_ARB_fragment_shader supported? "<< (support?"yes.":"no.")); count = 1; if(support){ @@ -351,9 +328,8 @@ static PyObject *pyPrintExt(PyObject *,PyObject *,PyObject *) pprint(" Max uniform components." << max); pprint(""); } -#endif -#ifdef GL_ARB_texture_cube_map - support = ext._ARB_texture_cube_map; + + support = GLEW_ARB_texture_cube_map; pprint(" GL_ARB_texture_cube_map supported? "<< (support?"yes.":"no.")); count = 1; if(support){ @@ -363,25 +339,21 @@ static PyObject *pyPrintExt(PyObject *,PyObject *,PyObject *) pprint(" Max cubemap size." << size); pprint(""); } -#endif -#if defined(GL_ARB_multitexture) && defined(WITH_GLEXT) - if (!getenv("WITHOUT_GLEXT")) { - support = ext._ARB_multitexture; - count = 1; - pprint(" GL_ARB_multitexture supported? "<< (support?"yes.":"no.")); - if(support){ - pprint(" ----------Details----------"); - int units=0; - glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, (GLint*)&units); - pprint(" Max texture units available. " << units); - pprint(""); - } - } -#endif -#ifdef GL_ARB_texture_env_combine - pprint(" GL_ARB_texture_env_combine supported? "<< (ext._ARB_texture_env_combine?"yes.":"no.")); + + support = GLEW_ARB_multitexture; count = 1; -#endif + pprint(" GL_ARB_multitexture supported? "<< (support?"yes.":"no.")); + if(support){ + pprint(" ----------Details----------"); + int units=0; + glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, (GLint*)&units); + pprint(" Max texture units available. " << units); + pprint(""); + } + + pprint(" GL_ARB_texture_env_combine supported? "<< (GLEW_ARB_texture_env_combine?"yes.":"no.")); + count = 1; + if(!count) pprint("No extenstions are used in this build"); diff --git a/source/gameengine/Ketsji/KX_RayCast.cpp b/source/gameengine/Ketsji/KX_RayCast.cpp index b88741625b6..89e2d645d54 100644 --- a/source/gameengine/Ketsji/KX_RayCast.cpp +++ b/source/gameengine/Ketsji/KX_RayCast.cpp @@ -49,7 +49,7 @@ bool KX_RayCast::RayTest(KX_IPhysicsController* ignore_controller, PHY_IPhysicsE // // returns true if an object was found, false if not. MT_Point3 frompoint(_frompoint); - const MT_Vector3 todir( (topoint - frompoint).normalized() ); + const MT_Vector3 todir( (topoint - frompoint).safe_normalized() ); PHY_IPhysicsController* hit_controller; PHY__Vector3 phy_pos; diff --git a/source/gameengine/Ketsji/KX_SG_NodeRelationships.h b/source/gameengine/Ketsji/KX_SG_NodeRelationships.h index e53af22408e..faa650106c8 100644 --- a/source/gameengine/Ketsji/KX_SG_NodeRelationships.h +++ b/source/gameengine/Ketsji/KX_SG_NodeRelationships.h @@ -177,8 +177,23 @@ public : NewCopy( ); + MT_Scalar + GetTimeOffset( + ) { return m_relax; } + + void + SetTimeOffset( + MT_Scalar relaxation + ) { m_relax = relaxation; } + ~KX_SlowParentRelation( ); + + bool + IsSlowRelation( + ) { + return true; + } private : diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index e4054e07475..fff33ca82fd 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -74,7 +74,7 @@ #include "KX_IPhysicsController.h" #include "KX_BlenderSceneConverter.h" -#include "BL_SkinDeformer.h" +#include "BL_ShapeDeformer.h" #include "BL_DeformableGameObject.h" // to get USE_BULLET! @@ -809,67 +809,80 @@ int KX_Scene::NewRemoveObject(class CValue* gameobj) -void KX_Scene::ReplaceMesh(class CValue* gameobj,void* meshobj) +void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj) { - KX_GameObject* newobj = static_cast(gameobj); + KX_GameObject* gameobj = static_cast(obj); RAS_MeshObject* mesh = static_cast(meshobj); - const STR_String origMeshName = newobj->GetMesh(0)->GetName(); - - if( !newobj || !mesh ) + if(!gameobj || !mesh) { std::cout << "warning: invalid object, mesh will not be replaced" << std::endl; return; } - newobj->RemoveMeshes(); - newobj->AddMesh(mesh); - - bool isDeformer = (newobj->m_isDeformable && mesh->m_class == 1); - if(isDeformer) - { - /* FindBlendObjByGameObj() can return 0... - In the case of 0 here, - the replicated object that is calling this function - is some how not in the map. (which is strange because it's added) - So we will search the map by the first mesh name - to try to locate it there. If its still not found - spit some message rather than crash - */ - Object* blendobj = static_cast(m_logicmgr->FindBlendObjByGameObj(newobj)); - Object* oldblendobj = static_cast(m_logicmgr->FindBlendObjByGameMeshName(mesh->GetName())); + gameobj->RemoveMeshes(); + gameobj->AddMesh(mesh); - bool parSkin = blendobj && blendobj->parent && blendobj->parent->type == OB_ARMATURE && blendobj->partype==PARSKEL; - bool releaseParent = true; - KX_GameObject* parentobj = newobj->GetParent(); - - - // lookup by mesh name if blendobj is 0 - if( !blendobj && parentobj ) + if (gameobj->m_isDeformable) + { + BL_DeformableGameObject* newobj = static_cast( gameobj ); + + if (newobj->m_pDeformer) { - blendobj = static_cast(m_logicmgr->FindBlendObjByGameMeshName(origMeshName)); - - // replace the mesh on the parent armature - if( blendobj ) - parSkin = parentobj->GetGameObjectType() == SCA_IObject::OBJ_ARMATURE; - - // can't do it - else - std::cout << "warning: child object for " << parentobj->GetName().ReadPtr() - << " not found, and can't create!" << std::endl; + delete newobj->m_pDeformer; + newobj->m_pDeformer = NULL; } - if( blendobj && oldblendobj ) + if (mesh->m_class == 1) { - isDeformer = (static_cast(blendobj->data)->dvert != 0); - BL_DeformableGameObject* deformIter =0; + // we must create a new deformer but which one? + KX_GameObject* parentobj = newobj->GetParent(); + // this always return the original game object (also for replicate) + Object* blendobj = newobj->GetBlenderObject(); + // object that owns the new mesh + Object* oldblendobj = static_cast(m_logicmgr->FindBlendObjByGameMeshName(mesh->GetName())); + Mesh* blendmesh = mesh->GetMesh(); - // armature parent - if( parSkin && isDeformer ) + bool bHasShapeKey = blendmesh->key != NULL && blendmesh->key->type==KEY_RELATIVE; + bool bHasDvert = blendmesh->dvert != NULL; + bool bHasArmature = + parentobj && // current parent is armature + parentobj->GetGameObjectType() == SCA_IObject::OBJ_ARMATURE && + oldblendobj && // needed for mesh deform + blendobj->parent && // original object had armature (not sure this test is needed) + blendobj->parent->type == OB_ARMATURE && + blendobj->partype==PARSKEL && + blendmesh->dvert!=NULL; // mesh has vertex group + bool releaseParent = true; + + if (bHasShapeKey) + { + BL_ShapeDeformer* shapeDeformer; + if (bHasArmature) + { + shapeDeformer = new BL_ShapeDeformer( + newobj, + oldblendobj, blendobj, + static_cast(mesh), + true, + static_cast( parentobj ) + ); + releaseParent= false; + } + else + { + shapeDeformer = new BL_ShapeDeformer( + newobj, + oldblendobj, blendobj, + static_cast(mesh), + false, + NULL + ); + } + newobj->m_pDeformer = shapeDeformer; + } + else if (bHasArmature) { - deformIter = static_cast( newobj ); - delete deformIter->m_pDeformer; - BL_SkinDeformer* skinDeformer = new BL_SkinDeformer( oldblendobj, blendobj, static_cast(mesh), @@ -877,27 +890,22 @@ void KX_Scene::ReplaceMesh(class CValue* gameobj,void* meshobj) static_cast( parentobj ) ); releaseParent= false; - deformIter->m_pDeformer = skinDeformer; + newobj->m_pDeformer = skinDeformer; } - - // normal deformer - if( !parSkin && isDeformer) + else if (bHasDvert) { - deformIter = static_cast( newobj ); - delete deformIter->m_pDeformer; - BL_MeshDeformer* meshdeformer = new BL_MeshDeformer( oldblendobj, static_cast(mesh) ); - - deformIter->m_pDeformer = meshdeformer; + newobj->m_pDeformer = meshdeformer; } + + // release parent reference if its not being used + if( releaseParent && parentobj) + parentobj->Release(); } - // release parent reference if its not being used - if( releaseParent && parentobj) - parentobj->Release(); } - newobj->Bucketize(); + gameobj->Bucketize(); } diff --git a/source/gameengine/Ketsji/Makefile b/source/gameengine/Ketsji/Makefile index e6e541d0931..47a4855b00c 100644 --- a/source/gameengine/Ketsji/Makefile +++ b/source/gameengine/Ketsji/Makefile @@ -36,6 +36,7 @@ include nan_compile.mk CCFLAGS += $(LEVEL_1_CPP_WARNINGS) CPPFLAGS += $(OGL_CPPFLAGS) +CPPFLAGS += -I$(NAN_GLEW)/include CPPFLAGS += -I$(OPENGL_HEADERS) CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) -I../../blender/python CPPFLAGS += -I$(NAN_STRING)/include diff --git a/source/gameengine/Ketsji/SConscript b/source/gameengine/Ketsji/SConscript index c7c80345796..fdac5a71071 100644 --- a/source/gameengine/Ketsji/SConscript +++ b/source/gameengine/Ketsji/SConscript @@ -18,7 +18,7 @@ incs += ' #source/gameengine/SceneGraph #source/gameengine/Physics/common #sourc incs += ' #source/gameengine/Physics/BlOde #source/gameengine/Physics/Dummy' incs += ' #source/gameengine/Physics/Sumo #source/gameengine/Physics/Sumo/include' incs += ' #source/gameengine/Physics/Sumo/Fuzzics/include #source/gameengine/Network/LoopBackNetwork' -incs += ' #source/blender/misc #source/blender/blenloader' +incs += ' #source/blender/misc #source/blender/blenloader #extern/glew/include' cflags = [] if env['OURPLATFORM'] == 'win32-vc': diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index 8d29a704380..ff55f975543 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -22,6 +22,8 @@ class KX_GameObject: @type orientation: 3x3 Matrix [[float]] @ivar scaling: The object's scaling factor. list [sx, sy, sz] @type scaling: list [sx, sy, sz] + @ivar timeOffset: adjust the slowparent delay at runtime. + @type timeOffset: float """ def setVisible(visible): @@ -48,7 +50,7 @@ class KX_GameObject: """ Sets the game object's orientation. - @type orn: 3x3 rotation matrix, or Quaternion. + @type orn: 3x3 inverted rotation matrix, or Quaternion. @param orn: a rotation matrix specifying the new rotation. """ def alignAxisToVect(vect, axis): @@ -67,7 +69,7 @@ class KX_GameObject: """ Gets the game object's orientation. - @rtype: 3x3 rotation matrix + @rtype: 3x3 inverted rotation matrix @return: The game object's rotation matrix """ def getLinearVelocity(local): diff --git a/source/gameengine/Rasterizer/CMakeLists.txt b/source/gameengine/Rasterizer/CMakeLists.txt index e604fe0e133..18a755afefd 100644 --- a/source/gameengine/Rasterizer/CMakeLists.txt +++ b/source/gameengine/Rasterizer/CMakeLists.txt @@ -31,6 +31,7 @@ SET(INC ../../../source/kernel/gen_system ../../../intern/string ../../../intern/moto/include + ../../../extern/glew/include ) BLENDERLIB(bf_rasterizer "${SRC}" "${INC}") diff --git a/source/gameengine/Rasterizer/Makefile b/source/gameengine/Rasterizer/Makefile index d544056e8ae..1ca3e3b0283 100644 --- a/source/gameengine/Rasterizer/Makefile +++ b/source/gameengine/Rasterizer/Makefile @@ -35,6 +35,7 @@ include nan_compile.mk CCFLAGS += $(LEVEL_1_CPP_WARNINGS) +CPPFLAGS += -I$(NAN_GLEW)/include CPPFLAGS += -I$(OPENGL_HEADERS) CPPFLAGS += -I$(NAN_STRING)/include CPPFLAGS += -I$(NAN_MOTO)/include diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp index 80d6d55df25..e9ab4ccca8d 100644 --- a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp +++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp @@ -46,18 +46,7 @@ #include "RAS_2DFilterManager.h" #include -#ifdef WIN32 -// OpenGL gl.h needs 'windows.h' on windows platforms -#include -#endif //WIN32 -#ifdef __APPLE__ -#define GL_GLEXT_LEGACY 1 -#include -#else -#include -#endif - -#include "RAS_OpenGLRasterizer/RAS_GLExtensionManager.h" +#include "GL/glew.h" #ifdef HAVE_CONFIG_H #include @@ -65,11 +54,13 @@ RAS_2DFilterManager::RAS_2DFilterManager(): -texturewidth(-1), textureheight(-1), +texname(-1), texturewidth(-1), textureheight(-1), canvaswidth(-1), canvasheight(-1), -numberoffilters(0),texname(-1) +numberoffilters(0) { - isshadersupported = bgl::QueryVersion(2,0); + isshadersupported = GLEW_ARB_shader_objects && + GLEW_ARB_fragment_shader && GLEW_ARB_multitexture; + if(!isshadersupported) { std::cout<<"shaders not supported!" << std::endl; @@ -92,15 +83,14 @@ RAS_2DFilterManager::~RAS_2DFilterManager() unsigned int RAS_2DFilterManager::CreateShaderProgram(char* shadersource) { GLuint program = 0; -#if defined(GL_ARB_shader_objects) && defined(WITH_GLEXT) - GLuint fShader = bgl::blCreateShaderObjectARB(GL_FRAGMENT_SHADER); + GLuint fShader = glCreateShaderObjectARB(GL_FRAGMENT_SHADER); GLint success; - bgl::blShaderSourceARB(fShader, 1, (const char**)&shadersource, NULL); + glShaderSourceARB(fShader, 1, (const char**)&shadersource, NULL); - bgl::blCompileShaderARB(fShader); + glCompileShaderARB(fShader); - bgl::blGetObjectParameterivARB(fShader, GL_COMPILE_STATUS, &success); + glGetObjectParameterivARB(fShader, GL_COMPILE_STATUS, &success); if(!success) { /*Shader Comile Error*/ @@ -108,11 +98,11 @@ unsigned int RAS_2DFilterManager::CreateShaderProgram(char* shadersource) return 0; } - program = bgl::blCreateProgramObjectARB(); - bgl::blAttachObjectARB(program, fShader); + program = glCreateProgramObjectARB(); + glAttachObjectARB(program, fShader); - bgl::blLinkProgramARB(program); - bgl::blGetObjectParameterivARB(program, GL_LINK_STATUS, &success); + glLinkProgramARB(program); + glGetObjectParameterivARB(program, GL_LINK_STATUS, &success); if (!success) { /*Program Link Error*/ @@ -120,15 +110,15 @@ unsigned int RAS_2DFilterManager::CreateShaderProgram(char* shadersource) return 0; } - bgl::blValidateProgramARB(program); - bgl::blGetObjectParameterivARB(program, GL_VALIDATE_STATUS, &success); + glValidateProgramARB(program); + glGetObjectParameterivARB(program, GL_VALIDATE_STATUS, &success); if (!success) { /*Program Validation Error*/ std::cout << "2dFilters - Shader program validation error" << std::endl; return 0; } -#endif + return program; } @@ -162,41 +152,37 @@ unsigned int RAS_2DFilterManager::CreateShaderProgram(int filtermode) void RAS_2DFilterManager::StartShaderProgram(unsigned int shaderprogram) { -#if defined(GL_ARB_shader_objects) && defined(WITH_GLEXT) GLint uniformLoc; - bgl::blUseProgramObjectARB(shaderprogram); - uniformLoc = bgl::blGetUniformLocationARB(shaderprogram, "bgl_RenderedTexture"); - bgl::blActiveTextureARB(GL_TEXTURE0); + glUseProgramObjectARB(shaderprogram); + uniformLoc = glGetUniformLocationARB(shaderprogram, "bgl_RenderedTexture"); + glActiveTextureARB(GL_TEXTURE0); //glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, texname); if (uniformLoc != -1) { - bgl::blUniform1iARB(uniformLoc, 0); + glUniform1iARB(uniformLoc, 0); } - uniformLoc = bgl::blGetUniformLocationARB(shaderprogram, "bgl_TextureCoordinateOffset"); + uniformLoc = glGetUniformLocationARB(shaderprogram, "bgl_TextureCoordinateOffset"); if (uniformLoc != -1) { - bgl::blUniform2fvARB(uniformLoc, 9, textureoffsets); + glUniform2fvARB(uniformLoc, 9, textureoffsets); } - uniformLoc = bgl::blGetUniformLocationARB(shaderprogram, "bgl_RenderedTextureWidth"); + uniformLoc = glGetUniformLocationARB(shaderprogram, "bgl_RenderedTextureWidth"); if (uniformLoc != -1) { - bgl::blUniform1fARB(uniformLoc,texturewidth); + glUniform1fARB(uniformLoc,texturewidth); } - uniformLoc = bgl::blGetUniformLocationARB(shaderprogram, "bgl_RenderedTextureHeight"); + uniformLoc = glGetUniformLocationARB(shaderprogram, "bgl_RenderedTextureHeight"); if (uniformLoc != -1) { - bgl::blUniform1fARB(uniformLoc,textureheight); + glUniform1fARB(uniformLoc,textureheight); } -#endif } void RAS_2DFilterManager::EndShaderProgram() { -#if defined(GL_ARB_shader_objects) && defined(WITH_GLEXT) - bgl::blUseProgramObjectARB(0); -#endif + glUseProgramObjectARB(0); } void RAS_2DFilterManager::SetupTexture() @@ -306,7 +292,6 @@ void RAS_2DFilterManager::EnableFilter(RAS_2DFILTER_MODE mode, int pass, STR_Str { if(!isshadersupported) return; -#if defined(GL_ARB_shader_objects) && defined(WITH_GLEXT) if(pass<0 || pass>=MAX_RENDER_PASS) return; @@ -325,7 +310,7 @@ void RAS_2DFilterManager::EnableFilter(RAS_2DFILTER_MODE mode, int pass, STR_Str if(mode == RAS_2DFILTER_NOFILTER) { if(m_filters[pass]) - bgl::blDeleteObjectARB(m_filters[pass]); + glDeleteObjectARB(m_filters[pass]); m_enabled[pass] = 0; m_filters[pass] = 0; return; @@ -334,7 +319,7 @@ void RAS_2DFilterManager::EnableFilter(RAS_2DFILTER_MODE mode, int pass, STR_Str if(mode == RAS_2DFILTER_CUSTOMFILTER) { if(m_filters[pass]) - bgl::blDeleteObjectARB(m_filters[pass]); + glDeleteObjectARB(m_filters[pass]); m_filters[pass] = CreateShaderProgram(text.Ptr()); m_enabled[pass] = 1; return; @@ -343,9 +328,8 @@ void RAS_2DFilterManager::EnableFilter(RAS_2DFILTER_MODE mode, int pass, STR_Str if(mode>=RAS_2DFILTER_MOTIONBLUR && mode<=RAS_2DFILTER_INVERT) { if(m_filters[pass]) - bgl::blDeleteObjectARB(m_filters[pass]); + glDeleteObjectARB(m_filters[pass]); m_filters[pass] = CreateShaderProgram(mode); m_enabled[pass] = 1; } -#endif } diff --git a/source/gameengine/Rasterizer/RAS_CameraData.h b/source/gameengine/Rasterizer/RAS_CameraData.h index 6aa9b34962b..0327a3f4763 100644 --- a/source/gameengine/Rasterizer/RAS_CameraData.h +++ b/source/gameengine/Rasterizer/RAS_CameraData.h @@ -49,12 +49,12 @@ struct RAS_CameraData m_clipstart(clipstart), m_clipend(clipend), m_perspective(perspective), - m_focallength(focallength), m_viewport(viewport), m_viewportleft(viewportleft), m_viewportbottom(viewportbottom), m_viewportright(viewportright), - m_viewporttop(viewporttop) + m_viewporttop(viewporttop), + m_focallength(focallength) { } }; diff --git a/source/gameengine/Rasterizer/RAS_Deformer.h b/source/gameengine/Rasterizer/RAS_Deformer.h index bea68e203a9..4e8484ab880 100644 --- a/source/gameengine/Rasterizer/RAS_Deformer.h +++ b/source/gameengine/Rasterizer/RAS_Deformer.h @@ -43,7 +43,7 @@ public: virtual ~RAS_Deformer(){}; virtual void Relink(GEN_Map*map)=0; virtual bool Apply(class RAS_IPolyMaterial *polymat)=0; - virtual void Update(void)=0; + virtual bool Update(void)=0; virtual RAS_Deformer *GetReplica()=0; protected: class RAS_MeshObject *m_pMesh; diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp index 61860c4c405..bff98abe058 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp @@ -56,7 +56,6 @@ RAS_IPolyMaterial::RAS_IPolyMaterial(const STR_String& texname, m_bIsTriangle(bIsTriangle), m_polymatid(m_newpolymatid++), m_flag(0), - m_enabled(0), m_multimode(0) { m_shininess = 35.0; @@ -148,10 +147,5 @@ const unsigned int RAS_IPolyMaterial::GetFlag() const { return m_flag; } -const unsigned int RAS_IPolyMaterial::GetEnabled() const -{ - return m_enabled; -} - unsigned int RAS_IPolyMaterial::m_newpolymatid = 0; diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h index 3284ddb7ddd..09824f6975c 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h @@ -77,7 +77,6 @@ protected: // will move... unsigned int m_flag;//MaterialProps - unsigned int m_enabled;// enabled for this mat int m_multimode; // sum of values public: @@ -141,7 +140,6 @@ public: const STR_String& GetMaterialName() const; const STR_String& GetTextureName() const; const unsigned int GetFlag() const; - const unsigned int GetEnabled() const; /* * PreCalculate texture gen diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h index 18a7f261c94..dbedc492afa 100644 --- a/source/gameengine/Rasterizer/RAS_IRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h @@ -213,17 +213,7 @@ public: bool useObjectColor, const MT_Vector4& rgbacolor, class KX_ListSlot** slot)=0; - /** - * @copydoc IndexPrimitives - * IndexPrimitivesEx will renormalize faces if @param vertexarrays[i].getFlag() & TV_CALCFACENORMAL - */ - virtual void IndexPrimitives_Ex( const vecVertexArray& vertexarrays, - const vecIndexArrays & indexarrays, - int mode, - class RAS_IPolyMaterial* polymat, - class RAS_IRenderTools* rendertools, - bool useObjectColor, - const MT_Vector4& rgbacolor)=0; + /** * IndexPrimitives_3DText will render text into the polygons. * The text to be rendered is from @param rendertools client object's text property. @@ -246,16 +236,6 @@ public: const MT_Vector4& rgbacolor, class KX_ListSlot** slot)=0; - virtual void IndexPrimitivesMulti_Ex( - const vecVertexArray& vertexarrays, - const vecIndexArrays & indexarrays, - int mode, - class RAS_IPolyMaterial* polymat, - class RAS_IRenderTools* rendertools, - bool useObjectColor, - const MT_Vector4& rgbacolor)=0; - - virtual void SetProjectionMatrix(MT_CmMatrix4x4 & mat)=0; /* This one should become our final version, methinks. */ /** @@ -389,8 +369,11 @@ public: virtual void DrawDebugLine(const MT_Vector3& from,const MT_Vector3& to,const MT_Vector3& color)=0; - virtual void SetTexCoords(TexCoGen coords, int unit) = 0; - virtual void SetAttrib(int type) = 0; + + virtual void SetTexCoordNum(int num) = 0; + virtual void SetAttribNum(int num) = 0; + virtual void SetTexCoord(TexCoGen coords, int unit) = 0; + virtual void SetAttrib(TexCoGen coords, int unit) = 0; virtual void GetViewMatrix(MT_Matrix4x4 &mat) const = 0; virtual bool QueryLists(){return false;} diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp index 96ce220ae4d..1beade7acf7 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp @@ -177,7 +177,6 @@ bool RAS_MaterialBucket::ActivateMaterial(const MT_Transform& cameratrans, RAS_I bool dolights = false; const unsigned int flag = m_material->GetFlag(); - if( flag & RAS_BLENDERMAT) dolights = (flag &RAS_MULTILIGHT)!=0; else @@ -237,11 +236,10 @@ void RAS_MaterialBucket::RenderMeshSlot(const MT_Transform& cameratrans, RAS_IRa rendertools, // needed for textprinting on polys ms.m_bObjectColor, ms.m_RGBAcolor); - } // for using glMultiTexCoord - else if(m_material->GetFlag() & RAS_MULTITEX ) + else if((m_material->GetFlag() & RAS_MULTITEX)) { rasty->IndexPrimitivesMulti( ms.m_mesh->GetVertexCache(m_material), @@ -251,37 +249,10 @@ void RAS_MaterialBucket::RenderMeshSlot(const MT_Transform& cameratrans, RAS_IRa rendertools, ms.m_bObjectColor, ms.m_RGBAcolor, - &ms.m_DisplayList + (ms.m_pDeformer)? 0: &ms.m_DisplayList ); } - // for using glMultiTexCoord on deformer - else if(m_material->GetFlag() & RAS_DEFMULTI ) - { - rasty->IndexPrimitivesMulti_Ex( - ms.m_mesh->GetVertexCache(m_material), - ms.m_mesh->GetIndexCache(m_material), - drawmode, - m_material, - rendertools, - ms.m_bObjectColor, - ms.m_RGBAcolor - ); - } - - // Use the (slower) IndexPrimitives_Ex which can recalc face normals & such - // for deformed objects - eventually should be extended to recalc ALL normals - else if (ms.m_pDeformer){ - rasty->IndexPrimitives_Ex( - ms.m_mesh->GetVertexCache(m_material), - ms.m_mesh->GetIndexCache(m_material), - drawmode, - m_material, - rendertools, // needed for textprinting on polys - ms.m_bObjectColor, - ms.m_RGBAcolor - ); - } // Use the normal IndexPrimitives else { @@ -293,7 +264,7 @@ void RAS_MaterialBucket::RenderMeshSlot(const MT_Transform& cameratrans, RAS_IRa rendertools, // needed for textprinting on polys ms.m_bObjectColor, ms.m_RGBAcolor, - &ms.m_DisplayList + (ms.m_pDeformer)? 0: &ms.m_DisplayList ); } @@ -316,14 +287,14 @@ void RAS_MaterialBucket::Render(const MT_Transform& cameratrans, //rasty->SetMaterial(*m_material); - int drawmode; for (T_MeshSlotList::const_iterator it = m_meshSlots.begin(); ! (it == m_meshSlots.end()); ++it) { rendertools->SetClientObject((*it).m_clientObj); - while (ActivateMaterial(cameratrans, rasty, rendertools, drawmode)) + while (ActivateMaterial(cameratrans, rasty, rendertools, drawmode)) { RenderMeshSlot(cameratrans, rasty, rendertools, *it, drawmode); + } } // to reset the eventual GL_CW mode rendertools->SetClientObject(NULL); diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.cpp b/source/gameengine/Rasterizer/RAS_MeshObject.cpp index e4b654343e7..d7ab88a6b06 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.cpp +++ b/source/gameengine/Rasterizer/RAS_MeshObject.cpp @@ -63,12 +63,13 @@ KX_ArrayOptimizer::~KX_ArrayOptimizer() -RAS_MeshObject::RAS_MeshObject(int lightlayer) +RAS_MeshObject::RAS_MeshObject(Mesh* mesh, int lightlayer) : m_bModified(true), m_lightlayer(lightlayer), m_zsort(false), m_MeshMod(true), - m_class(0) + m_class(0), + m_mesh(mesh) { } @@ -256,27 +257,30 @@ int RAS_MeshObject::FindOrAddVertex(int vtxarray, const MT_Vector4& tangent, const unsigned int rgbacolor, const MT_Vector3& normal, + bool flat, RAS_IPolyMaterial* mat, int orgindex) { KX_ArrayOptimizer* ao = GetArrayOptimizer(mat);//*(m_matVertexArrays[*mat]); int numverts = ao->m_VertexArrayCache1[vtxarray]->size();//m_VertexArrayCount[vtxarray]; - RAS_TexVert newvert(xyz,uv,uv2,tangent,rgbacolor,normal, 0); + RAS_TexVert newvert(xyz,uv,uv2,tangent,rgbacolor,normal, flat? TV_CALCFACENORMAL: 0); + #define KX_FIND_SHARED_VERTICES #ifdef KX_FIND_SHARED_VERTICES - - for (std::vector::iterator it = m_xyz_index_to_vertex_index_mapping[orgindex].begin(); - it != m_xyz_index_to_vertex_index_mapping[orgindex].end(); - it++) - { - if ((*it).m_arrayindex1 == ao->m_index1 && - (*it).m_array == vtxarray && - *(*it).m_matid == *mat && - (*ao->m_VertexArrayCache1[vtxarray])[(*it).m_index].closeTo(&newvert) - ) + if(!flat) { + for (std::vector::iterator it = m_xyz_index_to_vertex_index_mapping[orgindex].begin(); + it != m_xyz_index_to_vertex_index_mapping[orgindex].end(); + it++) { - return (*it).m_index; + if ((*it).m_arrayindex1 == ao->m_index1 && + (*it).m_array == vtxarray && + *(*it).m_matid == *mat && + (*ao->m_VertexArrayCache1[vtxarray])[(*it).m_index].closeTo(&newvert) + ) + { + return (*it).m_index; + } } } #endif // KX_FIND_SHARED_VERTICES diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.h b/source/gameengine/Rasterizer/RAS_MeshObject.h index 89c472cd0d4..d9aa133efb2 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.h +++ b/source/gameengine/Rasterizer/RAS_MeshObject.h @@ -43,6 +43,7 @@ #include "GEN_HashedPtr.h" +struct Mesh; /** * This class holds an array of vertices and indicies. */ @@ -144,9 +145,10 @@ protected: GEN_Map m_matVertexArrayS; RAS_MaterialBucket::Set m_materials; + Mesh* m_mesh; public: // for now, meshes need to be in a certain layer (to avoid sorting on lights in realtime) - RAS_MeshObject(int lightlayer); + RAS_MeshObject(Mesh* mesh, int lightlayer); virtual ~RAS_MeshObject(); vector m_sortedMaterials; @@ -238,6 +240,7 @@ public: const MT_Vector4& tangent, const unsigned int rgbacolor, const MT_Vector3& normal, + bool flat, RAS_IPolyMaterial* mat, int orgindex ); @@ -257,6 +260,7 @@ public: bool MeshModified(); void SetMeshModified(bool v){m_MeshMod = v;} + Mesh* GetMesh() { return m_mesh; } }; diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/ARB_multitexture.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/ARB_multitexture.h deleted file mode 100644 index a2f27ce3361..00000000000 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/ARB_multitexture.h +++ /dev/null @@ -1,150 +0,0 @@ -#ifndef __ARB_MULTITEXTURE_H__ -#define __ARB_MULTITEXTURE_H__ - -/* -*/ - -/* ---------------------------------------------------------------------------- - GL_ARB_multitexture ----------------------------------------------------------------------------- */ -#ifdef GL_ARB_multitexture - #define GL_TEXTURE0_ARB 0x84C0 - #define GL_TEXTURE1_ARB 0x84C1 - #define GL_TEXTURE2_ARB 0x84C2 - #define GL_TEXTURE3_ARB 0x84C3 - #define GL_TEXTURE4_ARB 0x84C4 - #define GL_TEXTURE5_ARB 0x84C5 - #define GL_TEXTURE6_ARB 0x84C6 - #define GL_TEXTURE7_ARB 0x84C7 - #define GL_TEXTURE8_ARB 0x84C8 - #define GL_TEXTURE9_ARB 0x84C9 - #define GL_TEXTURE10_ARB 0x84CA - #define GL_ACTIVE_TEXTURE_ARB 0x84E0 - #define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 - #define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 -#endif - - -/* ---------------------------------------------------------------------------- - GL_ARB_texture_env_combine ----------------------------------------------------------------------------- */ -#ifdef GL_ARB_texture_env_combine - #define GL_COMBINE_ARB 0x8570 - #define GL_COMBINE_RGB_ARB 0x8571 - #define GL_COMBINE_ALPHA_ARB 0x8572 - #define GL_SOURCE0_RGB_ARB 0x8580 - #define GL_SOURCE1_RGB_ARB 0x8581 - #define GL_SOURCE2_RGB_ARB 0x8582 - #define GL_SOURCE0_ALPHA_ARB 0x8588 - #define GL_SOURCE1_ALPHA_ARB 0x8589 - #define GL_SOURCE2_ALPHA_ARB 0x858A - #define GL_OPERAND0_RGB_ARB 0x8590 - #define GL_OPERAND1_RGB_ARB 0x8591 - #define GL_OPERAND2_RGB_ARB 0x8592 - #define GL_OPERAND0_ALPHA_ARB 0x8598 - #define GL_OPERAND1_ALPHA_ARB 0x8599 - #define GL_OPERAND2_ALPHA_ARB 0x859A - #define GL_RGB_SCALE_ARB 0x8573 - #define GL_ADD_SIGNED_ARB 0x8574 - #define GL_INTERPOLATE_ARB 0x8575 - #define GL_SUBTRACT_ARB 0x84E7 - #define GL_CONSTANT_ARB 0x8576 - #define GL_PRIMARY_COLOR_ARB 0x8577 - #define GL_PREVIOUS_ARB 0x8578 -#endif - -/* ---------------------------------------------------------------------------- - GL_ARB_texture_cube_map ----------------------------------------------------------------------------- */ -#ifdef GL_ARB_texture_cube_map - #define GL_NORMAL_MAP_ARB 0x8511 - #define GL_REFLECTION_MAP_ARB 0x8512 - #define GL_TEXTURE_CUBE_MAP_ARB 0x8513 - #define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 - #define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 - #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 - #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 - #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 - #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 - #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A - #define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B - #define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C -#endif - -/* ---------------------------------------------------------------------------- - GL_ARB_shader_objects ----------------------------------------------------------------------------- */ -#ifdef GL_ARB_shader_objects - #define GL_PROGRAM_OBJECT_ARB 0x8B40 - #define GL_SHADER_OBJECT_ARB 0x8B48 - #define GL_OBJECT_TYPE_ARB 0x8B4E - #define GL_OBJECT_SUBTYPE_ARB 0x8B4F - #define GL_FLOAT_VEC2_ARB 0x8B50 - #define GL_FLOAT_VEC3_ARB 0x8B51 - #define GL_FLOAT_VEC4_ARB 0x8B52 - #define GL_INT_VEC2_ARB 0x8B53 - #define GL_INT_VEC3_ARB 0x8B54 - #define GL_INT_VEC4_ARB 0x8B55 - #define GL_BOOL_ARB 0x8B56 - #define GL_BOOL_VEC2_ARB 0x8B57 - #define GL_BOOL_VEC3_ARB 0x8B58 - #define GL_BOOL_VEC4_ARB 0x8B59 - #define GL_FLOAT_MAT2_ARB 0x8B5A - #define GL_FLOAT_MAT3_ARB 0x8B5B - #define GL_FLOAT_MAT4_ARB 0x8B5C - #define GL_SAMPLER_1D_ARB 0x8B5D - #define GL_SAMPLER_2D_ARB 0x8B5E - #define GL_SAMPLER_3D_ARB 0x8B5F - #define GL_SAMPLER_CUBE_ARB 0x8B60 - #define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 - #define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 - #define GL_SAMPLER_2D_RECT_ARB 0x8B63 - #define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 - #define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 - #define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 - #define GL_OBJECT_LINK_STATUS_ARB 0x8B82 - #define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 - #define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 - #define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 - #define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 - #define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 - #define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 -#endif - -/* ---------------------------------------------------------------------------- - GL_ARB_vertex_shader ----------------------------------------------------------------------------- */ -#ifdef GL_ARB_vertex_shader - #define GL_VERTEX_SHADER_ARB 0x8B31 - #define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A - #define GL_MAX_VARYING_FLOATS_ARB 0x8B4B - #define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C - #define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D - #define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 - #define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A -#endif - - -/* ---------------------------------------------------------------------------- - GL_ARB_fragment_shader ----------------------------------------------------------------------------- */ -#ifdef GL_ARB_fragment_shader - #define GL_FRAGMENT_SHADER_ARB 0x8B30 - #define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 - #define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B -#endif - - -/* ---------------------------------------------------------------------------- - GL_ARB_depth_texture ----------------------------------------------------------------------------- */ -#ifndef GL_ARB_depth_texture - #define GL_DEPTH_COMPONENT16_ARB 0x81A5 - #define GL_DEPTH_COMPONENT24_ARB 0x81A6 - #define GL_DEPTH_COMPONENT32_ARB 0x81A7 - #define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A - #define GL_DEPTH_TEXTURE_MODE_ARB 0x884B -#endif - - -#endif//__ARB_MULTITEXTURE_H__ diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt index 5153834899b..2a6d64ecc73 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt @@ -31,6 +31,7 @@ SET(INC ../../../../intern/string ../../../../intern/moto/include ../../../../source/gameengine/Rasterizer + ../../../../extern/glew/include ) BLENDERLIB(bf_oglrasterizer "${SRC}" "${INC}") diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/EXT_separate_specular_color.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/EXT_separate_specular_color.h deleted file mode 100644 index 5a9d8f32a87..00000000000 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/EXT_separate_specular_color.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef GL_EXT_separate_specular_color -#define GL_EXT_separate_specular_color 1 -#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 -#define GL_SINGLE_COLOR_EXT 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA -#endif - -#ifndef GL_VERSION_1_2 -#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 -#define GL_SINGLE_COLOR 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR 0x81FA -#endif diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile index 1a88c51dc25..f01978b8eb1 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile @@ -36,6 +36,7 @@ include nan_compile.mk CCFLAGS += $(LEVEL_1_CPP_WARNINGS) +CPPFLAGS += -I$(NAN_GLEW)/include CPPFLAGS += -I$(OPENGL_HEADERS) CPPFLAGS += -I$(NAN_STRING)/include CPPFLAGS += -I$(NAN_MOTO)/include diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.cpp index 81a7ccb7a5d..d241bd1ee31 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.cpp @@ -25,665 +25,43 @@ * * ***** END GPL LICENSE BLOCK ***** */ -/* - The extension manager's job is to link at runtime OpenGL extension - functions. - Since the various platform have different methods of finding a fn - pointer, this file attempts to encapsulate all that, so it gets a - little messy. Hopefully we can -*/ -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef WIN32 -# include - -# include - -#elif defined(__APPLE__) -# include -# define GL_GLEXT_LEGACY 1 -# include - -#else /* UNIX */ -# include -# include - -# include -#endif - -#include #include -#include -#include -#include - -#include "STR_String.h" #include "RAS_GLExtensionManager.h" -/* ----------------------------------------------------------------------------- - - Platform specific functions section. - - Required Functions: - static void bglInitEntryPoints (void) -- Loads the GL library - static void bglDeallocEntryPoints (void) -- Frees the GL library - static void *bglGetProcAddress(const GLubyte* entry) -- Finds the address of - the GL function entry - -*/ -#if defined(BGL_NO_EXTENSIONS) -static void bglInitEntryPoints (void) {} -static void bglDeallocEntryPoints (void) {} - -static void *bglGetProcAddress(const GLubyte* entry) -{ - /* No Extensions! */ - return NULL; -} -#elif defined(__APPLE__) -/* http://developer.apple.com/qa/qa2001/qa1188.html */ -CFBundleRef gBundleRefOpenGL = NULL; - -// ------------------------- - -static OSStatus bglInitEntryPoints (void) -{ - OSStatus err = noErr; - const Str255 frameworkName = "\pOpenGL.framework"; - FSRefParam fileRefParam; - FSRef fileRef; - CFURLRef bundleURLOpenGL; - - memset(&fileRefParam, 0, sizeof(fileRefParam)); - memset(&fileRef, 0, sizeof(fileRef)); - - fileRefParam.ioNamePtr = frameworkName; - fileRefParam.newRef = &fileRef; - - // Frameworks directory/folder - err = FindFolder (kSystemDomain, kFrameworksFolderType, false, - &fileRefParam.ioVRefNum, (SInt32*)&fileRefParam.ioDirID); - if (noErr != err) { - DebugStr ((unsigned char *)"\pCould not find frameworks folder"); - return err; - } - err = PBMakeFSRefSync (&fileRefParam); // make FSRef for folder - if (noErr != err) { - DebugStr ((unsigned char *)"\pCould make FSref to frameworks folder"); - return err; - } - // create URL to folder - bundleURLOpenGL = CFURLCreateFromFSRef (kCFAllocatorDefault, - &fileRef); - if (!bundleURLOpenGL) { - DebugStr ((unsigned char *)"\pCould create OpenGL Framework bundle URL"); - return paramErr; - } - // create ref to GL's bundle - gBundleRefOpenGL = CFBundleCreate (kCFAllocatorDefault, - bundleURLOpenGL); - if (!gBundleRefOpenGL) { - DebugStr ((unsigned char *)"\pCould not create OpenGL Framework bundle"); - return paramErr; - } - CFRelease (bundleURLOpenGL); // release created bundle - // if the code was successfully loaded, look for our function. - if (!CFBundleLoadExecutable (gBundleRefOpenGL)) { - DebugStr ((unsigned char *)"\pCould not load MachO executable"); - return paramErr; - } - return err; -} - -// ------------------------- - -static void bglDeallocEntryPoints (void) -{ - if (gBundleRefOpenGL != NULL) { - // unload the bundle's code. - CFBundleUnloadExecutable (gBundleRefOpenGL); - CFRelease (gBundleRefOpenGL); - gBundleRefOpenGL = NULL; - } -} - -// ------------------------- - -/*unused*/ -static void * bglGetProcAddress (const GLubyte * pszProc) -{ - if (!gBundleRefOpenGL) - return NULL; - - return CFBundleGetFunctionPointerForName (gBundleRefOpenGL, - CFStringCreateWithCStringNoCopy (NULL, - (const char *) pszProc, CFStringGetSystemEncoding (), NULL)); -} -#elif defined(GLX_ARB_get_proc_address) -/* Not all glx.h define PFNGLXGETPROCADDRESSARBPROC ! - We define our own if needed. */ -#ifdef HAVE_PFNGLXGETPROCADDRESSARBPROC -#define PFNBGLXGETPROCADDRESSARBPROC PFNGLXGETPROCADDRESSARBPROC -#else -typedef void (*(*PFNBGLXGETPROCADDRESSARBPROC)(const GLubyte *procname))(); -#endif - -void *_getProcAddress(const GLubyte *procName) { return NULL; } -PFNBGLXGETPROCADDRESSARBPROC bglGetProcAddress; - - -//weird bug related to combination of pthreads,libGL and dlopen -//cannot call dlclose in such environment, causes crashes -//so try to keep a global handle to libGL -void* libGL = 0; - -static void bglInitEntryPoints (void) -{ - Display *dpy = glXGetCurrentDisplay(); - std::vector Xextensions = STR_String(glXQueryExtensionsString(dpy, DefaultScreen(dpy))).Explode(' '); - if (std::find(Xextensions.begin(), Xextensions.end(), "GLX_ARB_get_proc_address") != Xextensions.end()) - { - if (!libGL) - { - libGL = dlopen("libGL.so", RTLD_LAZY|RTLD_GLOBAL); - if (libGL) - bglGetProcAddress = (PFNBGLXGETPROCADDRESSARBPROC) (dlsym(libGL, "glXGetProcAddressARB")); - else - std::cout << "Error: " << dlerror() << std::endl; - - // dlclose(libGL); - if (!bglGetProcAddress) - bglGetProcAddress = (PFNBGLXGETPROCADDRESSARBPROC) _getProcAddress; - - // -- - if(!bglGetProcAddress) - std::cout << "Error: unable to find _getProcAddress in libGL" << std::endl; - } - } -} - -static void bglDeallocEntryPoints (void) {} - -#elif defined(WIN32) -static void bglInitEntryPoints (void) {} -static void bglDeallocEntryPoints (void) {} - -#define bglGetProcAddress(entry) wglGetProcAddress((LPCSTR) entry) - -#else /* Unknown Platform - disable extensions */ -static void bglInitEntryPoints (void) {} -static void bglDeallocEntryPoints (void) {} - -static void *bglGetProcAddress(const GLubyte* entry) -{ - /* No Extensions! */ - return NULL; -} - -#endif /* End Platform Specific */ - -/* ----------------------------------------------------------------------------- - - GL Extension Manager. -*/ - /* Bit array of available extensions */ -static std::bitset enabled_extensions; -static std::vector extensions; -static int m_debug; - -static void LinkExtensions(); - -static void EnableExtension(bgl::ExtensionName name) -{ - unsigned int num = (unsigned int) name; - if (num < bgl::NUM_EXTENSIONS) - enabled_extensions.set(num); -} - - -static bool QueryExtension(STR_String extension_name) -{ - return std::find(extensions.begin(), extensions.end(), extension_name) != extensions.end(); -} - namespace bgl { - -void InitExtensions(int debug) -{ - m_debug = debug; - bglInitEntryPoints (); //init bundle - EnableExtension(_BGL_TEST); - LinkExtensions(); - bglDeallocEntryPoints(); -} - -bool QueryExtension(ExtensionName name) -{ - unsigned int num = (unsigned int) name; - if (num < NUM_EXTENSIONS) - return enabled_extensions[num]; - - return false; -} - -bool QueryVersion(int major, int minor) -{ - static int gl_major = 0; - static int gl_minor = 0; - - if (gl_major == 0) + void InitExtensions(bool debug) { - const char *gl_version_str = (const char *) glGetString(GL_VERSION); - if (!gl_version_str) - return false; - STR_String gl_version = STR_String(gl_version_str); - int i = gl_version.Find('.'); - gl_major = gl_version.Left(i).ToInt(); - gl_minor = gl_version.Mid(i+1, gl_version.FindOneOf(". ", i+1) - i - 1).ToInt(); - - static bool doQueryVersion = m_debug; - if (doQueryVersion) - { - doQueryVersion = false; - std::cout << "GL_VERSION: " << gl_major << "." << gl_minor << " (" << gl_version << ")" << std::endl; - } - } - - if (gl_major > major) - return true; - - if (gl_major == major && gl_minor >= minor) - return true; + static bool firsttime = true; - return false; -} + if(firsttime) { + firsttime = false; - -/******************************************************************************* -1. Extension function entry points go here - -Need to #ifdef (compile time test for extension) -Add null functions if appropriate - -Some extensions have been incorporated into the core GL, eg Multitexture was -added in GL v1.1. If Blender calls one of these functions before they are -linked, it will crash. Even worse, if Blender *indirectly* calls one of these -functions, (ie the GL implementation calls them itself) Blender will crash. - -We fix this by adding them to the bgl namespace - the functions are now -private to the gameengine. Code can transparently use extensions by adding: - -using namespace bgl; - -to their source. Cunning like a weasel. - - ******************************************************************************/ - -#if defined(PFNGLPNTRIANGLESIATIPROC) -PFNGLPNTRIANGLESIATIPROC glPNTrianglesiATI; -PFNGLPNTRIANGLESFATIPROC glPNTrianglesfATI; -#endif - -BL_EXTInfo RAS_EXT_support; - -#ifdef GL_ARB_multitexture -int max_texture_units = 2; -PFNGLACTIVETEXTUREARBPROC blActiveTextureARB; -PFNGLCLIENTACTIVETEXTUREARBPROC blClientActiveTextureARB; -PFNGLMULTITEXCOORD1DARBPROC blMultiTexCoord1dARB; -PFNGLMULTITEXCOORD1DVARBPROC blMultiTexCoord1dvARB; -PFNGLMULTITEXCOORD1FARBPROC blMultiTexCoord1fARB; -PFNGLMULTITEXCOORD1FVARBPROC blMultiTexCoord1fvARB; -PFNGLMULTITEXCOORD1IARBPROC blMultiTexCoord1iARB; -PFNGLMULTITEXCOORD1IVARBPROC blMultiTexCoord1ivARB; -PFNGLMULTITEXCOORD1SARBPROC blMultiTexCoord1sARB; -PFNGLMULTITEXCOORD1SVARBPROC blMultiTexCoord1svARB; -PFNGLMULTITEXCOORD2DARBPROC blMultiTexCoord2dARB; -PFNGLMULTITEXCOORD2DVARBPROC blMultiTexCoord2dvARB; -PFNGLMULTITEXCOORD2FARBPROC blMultiTexCoord2fARB; -PFNGLMULTITEXCOORD2FVARBPROC blMultiTexCoord2fvARB; -PFNGLMULTITEXCOORD2IARBPROC blMultiTexCoord2iARB; -PFNGLMULTITEXCOORD2IVARBPROC blMultiTexCoord2ivARB; -PFNGLMULTITEXCOORD2SARBPROC blMultiTexCoord2sARB; -PFNGLMULTITEXCOORD2SVARBPROC blMultiTexCoord2svARB; -PFNGLMULTITEXCOORD3DARBPROC blMultiTexCoord3dARB; -PFNGLMULTITEXCOORD3DVARBPROC blMultiTexCoord3dvARB; -PFNGLMULTITEXCOORD3FARBPROC blMultiTexCoord3fARB; -PFNGLMULTITEXCOORD3FVARBPROC blMultiTexCoord3fvARB; -PFNGLMULTITEXCOORD3IARBPROC blMultiTexCoord3iARB; -PFNGLMULTITEXCOORD3IVARBPROC blMultiTexCoord3ivARB; -PFNGLMULTITEXCOORD3SARBPROC blMultiTexCoord3sARB; -PFNGLMULTITEXCOORD3SVARBPROC blMultiTexCoord3svARB; -PFNGLMULTITEXCOORD4DARBPROC blMultiTexCoord4dARB; -PFNGLMULTITEXCOORD4DVARBPROC blMultiTexCoord4dvARB; -PFNGLMULTITEXCOORD4FARBPROC blMultiTexCoord4fARB; -PFNGLMULTITEXCOORD4FVARBPROC blMultiTexCoord4fvARB; -PFNGLMULTITEXCOORD4IARBPROC blMultiTexCoord4iARB; -PFNGLMULTITEXCOORD4IVARBPROC blMultiTexCoord4ivARB; -PFNGLMULTITEXCOORD4SARBPROC blMultiTexCoord4sARB; -PFNGLMULTITEXCOORD4SVARBPROC blMultiTexCoord4svARB; -#endif - -#ifdef GL_ARB_shader_objects - PFNGLDELETEOBJECTARBPROC blDeleteObjectARB; - PFNGLGETHANDLEARBPROC blGetHandleARB; - PFNGLDETACHOBJECTARBPROC blDetachObjectARB; - PFNGLCREATESHADEROBJECTARBPROC blCreateShaderObjectARB; - PFNGLSHADERSOURCEARBPROC blShaderSourceARB; - PFNGLCOMPILESHADERARBPROC blCompileShaderARB; - PFNGLCREATEPROGRAMOBJECTARBPROC blCreateProgramObjectARB; - PFNGLATTACHOBJECTARBPROC blAttachObjectARB; - PFNGLLINKPROGRAMARBPROC blLinkProgramARB; - PFNGLUSEPROGRAMOBJECTARBPROC blUseProgramObjectARB; - PFNGLVALIDATEPROGRAMARBPROC blValidateProgramARB; - PFNGLUNIFORM1FARBPROC blUniform1fARB; - PFNGLUNIFORM2FARBPROC blUniform2fARB; - PFNGLUNIFORM3FARBPROC blUniform3fARB; - PFNGLUNIFORM4FARBPROC blUniform4fARB; - PFNGLUNIFORM1IARBPROC blUniform1iARB; - PFNGLUNIFORM2IARBPROC blUniform2iARB; - PFNGLUNIFORM3IARBPROC blUniform3iARB; - PFNGLUNIFORM4IARBPROC blUniform4iARB; - PFNGLUNIFORM1FVARBPROC blUniform1fvARB; - PFNGLUNIFORM2FVARBPROC blUniform2fvARB; - PFNGLUNIFORM3FVARBPROC blUniform3fvARB; - PFNGLUNIFORM4FVARBPROC blUniform4fvARB; - PFNGLUNIFORM1IVARBPROC blUniform1ivARB; - PFNGLUNIFORM2IVARBPROC blUniform2ivARB; - PFNGLUNIFORM3IVARBPROC blUniform3ivARB; - PFNGLUNIFORM4IVARBPROC blUniform4ivARB; - PFNGLUNIFORMMATRIX2FVARBPROC blUniformMatrix2fvARB; - PFNGLUNIFORMMATRIX3FVARBPROC blUniformMatrix3fvARB; - PFNGLUNIFORMMATRIX4FVARBPROC blUniformMatrix4fvARB; - PFNGLGETOBJECTPARAMETERFVARBPROC blGetObjectParameterfvARB; - PFNGLGETOBJECTPARAMETERIVARBPROC blGetObjectParameterivARB; - PFNGLGETINFOLOGARBPROC blGetInfoLogARB; - PFNGLGETATTACHEDOBJECTSARBPROC blGetAttachedObjectsARB; - PFNGLGETUNIFORMLOCATIONARBPROC blGetUniformLocationARB; - PFNGLGETACTIVEUNIFORMARBPROC blGetActiveUniformARB; - PFNGLGETUNIFORMFVARBPROC blGetUniformfvARB; - PFNGLGETUNIFORMIVARBPROC blGetUniformivARB; - PFNGLGETSHADERSOURCEARBPROC blGetShaderSourceARB; -#endif - -#ifdef GL_ARB_vertex_shader -PFNGLBINDATTRIBLOCATIONARBPROC blBindAttribLocationARB; -PFNGLGETACTIVEATTRIBARBPROC blGetActiveAttribARB; -PFNGLGETATTRIBLOCATIONARBPROC blGetAttribLocationARB; -#endif - -#ifdef GL_ARB_vertex_program - PFNGLVERTEXATTRIB1FARBPROC blVertexAttrib1fARB; - PFNGLVERTEXATTRIB1FVARBPROC blVertexAttrib1fvARB; - PFNGLVERTEXATTRIB2FARBPROC blVertexAttrib2fARB; - PFNGLVERTEXATTRIB2FVARBPROC blVertexAttrib2fvARB; - PFNGLVERTEXATTRIB3FARBPROC blVertexAttrib3fARB; - PFNGLVERTEXATTRIB3FVARBPROC blVertexAttrib3fvARB; - PFNGLVERTEXATTRIB4FARBPROC blVertexAttrib4fARB; - PFNGLVERTEXATTRIB4FVARBPROC blVertexAttrib4fvARB; - PFNGLGETPROGRAMSTRINGARBPROC blGetProgramStringARB; - PFNGLGETVERTEXATTRIBDVARBPROC blGetVertexAttribdvARB; - PFNGLGETVERTEXATTRIBFVARBPROC blGetVertexAttribfvARB; - PFNGLGETVERTEXATTRIBIVARBPROC blGetVertexAttribivARB; -#endif - - /* -#ifdef GL_EXT_compiled_vertex_array - PFNGLLOCKARRAYSEXTPROC blLockArraysEXT; - PFNGLUNLOCKARRAYSEXTPROC blUnlockArraysEXT; -#endif -*/ - -} // namespace bgl - -using namespace bgl; -/******************************************************************************* -2. Query extension functions here - -Need to #ifdef (compile time test for extension) -Use QueryExtension("GL_EXT_name") to test at runtime. -Use bglGetProcAddress to find entry point -Use EnableExtension(_GL_EXT_...) to allow Blender to use the extension. - - ******************************************************************************/ -static void LinkExtensions() -{ - static bool doDebugMessages = m_debug; - extensions = STR_String((const char *) glGetString(GL_EXTENSIONS)).Explode(' '); - RAS_EXT_support = BL_EXTInfo(); - -#if defined(PFNGLPNTRIANGLESIATIPROC) - if (QueryExtension("GL_ATI_pn_triangles")) - { - glPNTrianglesiATI = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glPNTrianglesiATI")); - glPNTrianglesfATI = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glPNTrianglesfATI")); - if (glPNTrianglesiATI && glPNTrianglesfATI) { - EnableExtension(_GL_ATI_pn_triangles); - if (doDebugMessages) - std::cout << "Enabled GL_ATI_pn_triangles" << std::endl; - } else { - std::cout << "ERROR: GL_ATI_pn_triangles implementation is broken!" << std::endl; - } - } -#endif - -#ifdef GL_ARB_texture_env_combine - if (QueryExtension("GL_ARB_texture_env_combine")) - { - EnableExtension(_GL_ARB_texture_env_combine); - RAS_EXT_support._ARB_texture_env_combine = 1; - if (doDebugMessages) - { - std::cout << "Detected GL_ARB_texture_env_combine" << std::endl; - } - } -#endif - -#ifdef GL_ARB_texture_cube_map - if (QueryExtension("GL_ARB_texture_cube_map")) - { - EnableExtension(_GL_ARB_texture_cube_map); - RAS_EXT_support._ARB_texture_cube_map = 1; - if (doDebugMessages) - std::cout << "Detected GL_ARB_texture_cube_map" << std::endl; - } -#endif - -#if defined(GL_ARB_multitexture) && defined(WITH_GLEXT) - if (!getenv("WITHOUT_GLEXT")) { - if (QueryExtension("GL_ARB_multitexture")) { - bgl::blActiveTextureARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glActiveTextureARB")); - bgl::blClientActiveTextureARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glClientActiveTextureARB")); - bgl::blMultiTexCoord1dARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord1dARB")); - bgl::blMultiTexCoord1dvARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord1dvARB")); - bgl::blMultiTexCoord1fARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord1fARB")); - bgl::blMultiTexCoord1fvARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord1fvARB")); - bgl::blMultiTexCoord1iARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord1iARB")); - bgl::blMultiTexCoord1ivARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord1ivARB")); - bgl::blMultiTexCoord1sARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord1sARB")); - bgl::blMultiTexCoord1svARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord1svARB")); - bgl::blMultiTexCoord2dARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord2dARB")); - bgl::blMultiTexCoord2dvARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord2dvARB")); - bgl::blMultiTexCoord2fARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord2fARB")); - bgl::blMultiTexCoord2fvARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord2fvARB")); - bgl::blMultiTexCoord2iARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord2iARB")); - bgl::blMultiTexCoord2ivARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord2ivARB")); - bgl::blMultiTexCoord2sARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord2sARB")); - bgl::blMultiTexCoord2svARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord2svARB")); - bgl::blMultiTexCoord3dARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord3dARB")); - bgl::blMultiTexCoord3dvARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord3dvARB")); - bgl::blMultiTexCoord3fARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord3fARB")); - bgl::blMultiTexCoord3fvARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord3fvARB")); - bgl::blMultiTexCoord3iARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord3iARB")); - bgl::blMultiTexCoord3ivARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord3ivARB")); - bgl::blMultiTexCoord3sARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord3sARB")); - bgl::blMultiTexCoord3svARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord3svARB")); - bgl::blMultiTexCoord4dARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord4dARB")); - bgl::blMultiTexCoord4dvARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord4dvARB")); - bgl::blMultiTexCoord4fARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord4fARB")); - bgl::blMultiTexCoord4fvARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord4fvARB")); - bgl::blMultiTexCoord4iARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord4iARB")); - bgl::blMultiTexCoord4ivARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord4ivARB")); - bgl::blMultiTexCoord4sARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord4sARB")); - bgl::blMultiTexCoord4svARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glMultiTexCoord4svARB")); - if (bgl::blActiveTextureARB && bgl::blClientActiveTextureARB && bgl::blMultiTexCoord1dARB && bgl::blMultiTexCoord1dvARB && bgl::blMultiTexCoord1fARB && bgl::blMultiTexCoord1fvARB && bgl::blMultiTexCoord1iARB && bgl::blMultiTexCoord1ivARB && bgl::blMultiTexCoord1sARB && bgl::blMultiTexCoord1svARB && bgl::blMultiTexCoord2dARB && bgl::blMultiTexCoord2dvARB && bgl::blMultiTexCoord2fARB && bgl::blMultiTexCoord2fvARB && bgl::blMultiTexCoord2iARB && bgl::blMultiTexCoord2ivARB && bgl::blMultiTexCoord2sARB && bgl::blMultiTexCoord2svARB && bgl::blMultiTexCoord3dARB && bgl::blMultiTexCoord3dvARB && bgl::blMultiTexCoord3fARB && bgl::blMultiTexCoord3fvARB && bgl::blMultiTexCoord3iARB && bgl::blMultiTexCoord3ivARB && bgl::blMultiTexCoord3sARB && bgl::blMultiTexCoord3svARB && bgl::blMultiTexCoord4dARB && bgl::blMultiTexCoord4dvARB && bgl::blMultiTexCoord4fARB && bgl::blMultiTexCoord4fvARB && bgl::blMultiTexCoord4iARB && bgl::blMultiTexCoord4ivARB && bgl::blMultiTexCoord4sARB && bgl::blMultiTexCoord4svARB) { - EnableExtension(_GL_ARB_multitexture); - RAS_EXT_support._ARB_multitexture = 1; - if (doDebugMessages) - std::cout << "Enabled GL_ARB_multitexture" << std::endl; - } else { - std::cout << "ERROR: GL_ARB_multitexture implementation is broken!" << std::endl; + if(debug) { + if(GLEW_ATI_pn_triangles) + std::cout << "Enabled GL_ATI_pn_triangles" << std::endl; + if(GLEW_ARB_texture_env_combine) + std::cout << "Detected GL_ARB_texture_env_combine" << std::endl; + if(GLEW_ARB_texture_cube_map) + std::cout << "Detected GL_ARB_texture_cube_map" << std::endl; + if(GLEW_ARB_multitexture) + std::cout << "Detected GL_ARB_multitexture" << std::endl; + if(GLEW_ARB_shader_objects) + std::cout << "Detected GL_ARB_shader_objects" << std::endl; + if(GLEW_ARB_vertex_shader) + std::cout << "Detected GL_ARB_vertex_shader" << std::endl; + if(GLEW_ARB_fragment_shader) + std::cout << "Detected GL_ARB_fragment_shader" << std::endl; + if(GLEW_ARB_vertex_program) + std::cout << "Detected GL_ARB_vertex_program" << std::endl; + if(GLEW_ARB_depth_texture) + std::cout << "Detected GL_ARB_depth_texture" << std::endl; + if(GLEW_EXT_separate_specular_color) + std::cout << "Detected GL_EXT_separate_specular_color" << std::endl; } } } -#endif - -#if GL_ARB_shader_objects - if (QueryExtension("GL_ARB_shader_objects")) - { - bgl::blDeleteObjectARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glDeleteObjectARB")); - bgl::blGetHandleARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glGetHandleARB")); - bgl::blDetachObjectARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glDetachObjectARB")); - bgl::blCreateShaderObjectARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glCreateShaderObjectARB")); - bgl::blShaderSourceARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glShaderSourceARB")); - bgl::blCompileShaderARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glCompileShaderARB")); - bgl::blCreateProgramObjectARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glCreateProgramObjectARB")); - bgl::blAttachObjectARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glAttachObjectARB")); - bgl::blLinkProgramARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glLinkProgramARB")); - bgl::blUseProgramObjectARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glUseProgramObjectARB")); - bgl::blValidateProgramARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glValidateProgramARB")); - bgl::blUniform1fARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glUniform1fARB")); - bgl::blUniform2fARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glUniform2fARB")); - bgl::blUniform3fARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glUniform3fARB")); - bgl::blUniform4fARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glUniform4fARB")); - bgl::blUniform1iARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glUniform1iARB")); - bgl::blUniform2iARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glUniform2iARB")); - bgl::blUniform3iARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glUniform3iARB")); - bgl::blUniform4iARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glUniform4iARB")); - bgl::blUniform1fvARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glUniform1fvARB")); - bgl::blUniform2fvARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glUniform2fvARB")); - bgl::blUniform3fvARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glUniform3fvARB")); - bgl::blUniform4fvARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glUniform4fvARB")); - bgl::blUniform1ivARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glUniform1ivARB")); - bgl::blUniform2ivARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glUniform2ivARB")); - bgl::blUniform3ivARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glUniform3ivARB")); - bgl::blUniform4ivARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glUniform4ivARB")); - bgl::blUniformMatrix2fvARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glUniformMatrix2fvARB")); - bgl::blUniformMatrix3fvARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glUniformMatrix3fvARB")); - bgl::blUniformMatrix4fvARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glUniformMatrix4fvARB")); - bgl::blGetObjectParameterfvARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glGetObjectParameterfvARB")); - bgl::blGetObjectParameterivARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glGetObjectParameterivARB")); - bgl::blGetInfoLogARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glGetInfoLogARB")); - bgl::blGetAttachedObjectsARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glGetAttachedObjectsARB")); - bgl::blGetUniformLocationARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glGetUniformLocationARB")); - bgl::blGetActiveUniformARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glGetActiveUniformARB")); - bgl::blGetUniformfvARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glGetUniformfvARB")); - bgl::blGetUniformivARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glGetUniformivARB")); - bgl::blGetShaderSourceARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glGetShaderSourceARB")); - if (bgl::blDeleteObjectARB && bgl::blGetHandleARB && bgl::blDetachObjectARB && bgl::blCreateShaderObjectARB && bgl::blShaderSourceARB && bgl::blCompileShaderARB && bgl::blCreateProgramObjectARB && bgl::blAttachObjectARB && bgl::blLinkProgramARB && bgl::blUseProgramObjectARB && bgl::blValidateProgramARB && bgl::blUniform1fARB && bgl::blUniform2fARB && bgl::blUniform3fARB && bgl::blUniform4fARB && bgl::blUniform1iARB && bgl::blUniform2iARB && bgl::blUniform3iARB && bgl::blUniform4iARB && bgl::blUniform1fvARB && bgl::blUniform2fvARB && bgl::blUniform3fvARB && bgl::blUniform4fvARB && bgl::blUniform1ivARB && bgl::blUniform2ivARB && bgl::blUniform3ivARB && bgl::blUniform4ivARB && bgl::blUniformMatrix2fvARB && bgl::blUniformMatrix3fvARB && bgl::blUniformMatrix4fvARB && bgl::blGetObjectParameterfvARB && bgl::blGetObjectParameterivARB && bgl::blGetInfoLogARB && bgl::blGetAttachedObjectsARB && bgl::blGetUniformLocationARB && bgl::blGetActiveUniformARB && bgl::blGetUniformfvARB && bgl::blGetUniformivARB && bgl::blGetShaderSourceARB) { - EnableExtension(_GL_ARB_shader_objects); - RAS_EXT_support._ARB_shader_objects =1; - if (doDebugMessages) - std::cout << "Enabled GL_ARB_shader_objects" << std::endl; - } else { - std::cout << "ERROR: GL_ARB_shader_objects implementation is broken!" << std::endl; - } - } -#endif - -#if GL_ARB_vertex_shader - if (QueryExtension("GL_ARB_vertex_shader")) - { - bgl::blBindAttribLocationARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glBindAttribLocationARB")); - bgl::blGetActiveAttribARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glGetActiveAttribARB")); - bgl::blGetAttribLocationARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glGetAttribLocationARB")); - if (bgl::blBindAttribLocationARB && bgl::blGetActiveAttribARB && bgl::blGetAttribLocationARB) { - EnableExtension(_GL_ARB_vertex_shader); - RAS_EXT_support._ARB_vertex_shader = 1; - if (doDebugMessages) - std::cout << "Enabled GL_ARB_vertex_shader" << std::endl; - } else { - std::cout << "ERROR: GL_ARB_vertex_shader implementation is broken!" << std::endl; - } - } -#endif - -#ifdef GL_ARB_fragment_shader - if (QueryExtension("GL_ARB_fragment_shader")) - { - EnableExtension(_GL_ARB_fragment_shader); - RAS_EXT_support._ARB_fragment_shader = 1; - if (doDebugMessages) - std::cout << "Detected GL_ARB_fragment_shader" << std::endl; - } -#endif - -#if defined(GL_ARB_vertex_program) - if (QueryExtension("GL_ARB_vertex_program")) - { - bgl::blVertexAttrib1fARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glVertexAttrib1fARB")); - bgl::blVertexAttrib1fvARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glVertexAttrib1fvARB")); - bgl::blVertexAttrib2fARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glVertexAttrib2fARB")); - bgl::blVertexAttrib2fvARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glVertexAttrib2fvARB")); - bgl::blVertexAttrib3fARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glVertexAttrib3fARB")); - bgl::blVertexAttrib3fvARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glVertexAttrib3fvARB")); - bgl::blVertexAttrib4fARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glVertexAttrib4fARB")); - bgl::blVertexAttrib4fvARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glVertexAttrib4fvARB")); - bgl::blGetVertexAttribdvARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glGetVertexAttribdvARB")); - bgl::blGetVertexAttribfvARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glGetVertexAttribfvARB")); - bgl::blGetVertexAttribivARB = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glGetVertexAttribivARB")); - if (bgl::blVertexAttrib1fARB && bgl::blVertexAttrib1fvARB && bgl::blVertexAttrib2fARB && bgl::blVertexAttrib2fvARB && bgl::blVertexAttrib3fARB && bgl::blVertexAttrib3fvARB && bgl::blGetVertexAttribdvARB) { - EnableExtension(_GL_ARB_vertex_program); - RAS_EXT_support._ARB_vertex_program = 1; - if (doDebugMessages) - std::cout << "Enabled GL_ARB_vertex_program" << std::endl; - } else { - std::cout << "ERROR: GL_ARB_vertex_program implementation is broken!" << std::endl; - } - } -#endif - - -#ifdef GL_ARB_depth_texture - if (QueryExtension("GL_ARB_depth_texture")) - { - EnableExtension(_GL_ARB_depth_texture); - RAS_EXT_support._ARB_depth_texture = 1; - if (doDebugMessages) - { - std::cout << "Detected GL_ARB_depth_texture" << std::endl; - } - } -#endif -/* -#ifdef GL_EXT_compiled_vertex_array - if (QueryExtension("GL_EXT_compiled_vertex_array")) - { - blLockArraysEXT = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glLockArraysEXT")); - blUnlockArraysEXT = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glUnlockArraysEXT")); - if (blLockArraysEXT && blUnlockArraysEXT) { - EnableExtension(_GL_EXT_compiled_vertex_array); - RAS_EXT_support._EXT_compiled_vertex_array = 1; - if (doDebugMessages) - std::cout << "Enabled GL_EXT_compiled_vertex_array" << std::endl; - } else { - std::cout << "ERROR: GL_EXT_compiled_vertex_array implementation is broken!" << std::endl; - } - } -#endif -*/ - if (QueryExtension("GL_EXT_separate_specular_color")) - { - EnableExtension(_GL_EXT_separate_specular_color); - if (doDebugMessages) - std::cout << "Detected GL_EXT_separate_specular_color" << std::endl; - } - - doDebugMessages = false; -} +} // namespace bgl diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.h index 3e24ee204a1..2265becbdad 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.h @@ -29,513 +29,14 @@ #ifndef __RAS_GLEXTENSIONMANAGER_H__ #define __RAS_GLEXTENSIONMANAGER_H__ +#include "GL/glew.h" -#ifdef WIN32 -# include -# include +/* Note: this used to have a lot more code, but now extension handling + * is done by GLEW, so it does mostly debug stuff */ -#elif defined(__APPLE__) -# define GL_GLEXT_LEGACY 1 -# include -# include - -#else /* UNIX */ -# define __glext_h_ -# include -# include -# undef GL_ARB_multitexture // (ubuntu) -# undef __glext_h_ -#endif - -#ifdef WITH_GLEXT -#ifdef WIN32 -# include -#elif defined(__APPLE__) -# include "mac_compat_glext.h" -# include -#else -# include -#endif -#endif - -#ifdef __sgi -# undef GL_ARB_vertex_program -#endif - -#include "EXT_separate_specular_color.h" -#include "ARB_multitexture.h" namespace bgl { - /** - * This is a list of all registered OpenGL extensions. - * It is available from: - * http://oss.sgi.com/projects/ogl-sample/registry/ - */ - typedef enum { - /* ARB Extensions */ - _GL_ARB_imaging, - _GL_ARB_multitexture , - _GLX_ARB_get_proc_address , - _GL_ARB_transpose_matrix , - _WGL_ARB_buffer_region , - _GL_ARB_multisample , - _GL_ARB_texture_env_add , - _GL_ARB_texture_cube_map , - _WGL_ARB_extensions_string , - _WGL_ARB_pixel_format , - _WGL_ARB_make_current_read , - _WGL_ARB_pbuffer , - _GL_ARB_texture_compression , - _GL_ARB_texture_border_clamp , - _GL_ARB_point_parameters , - _GL_ARB_vertex_blend , - _GL_ARB_matrix_palette , - _GL_ARB_texture_env_combine , - _GL_ARB_texture_env_crossbar , - _GL_ARB_texture_env_dot3 , - _WGL_ARB_render_texture , - _GL_ARB_texture_mirrored_repeat , - _GL_ARB_depth_texture , - _GL_ARB_shadow , - _GL_ARB_shadow_ambient , - _GL_ARB_window_pos , - _GL_ARB_vertex_program , - _GL_ARB_fragment_program , - _GL_ARB_vertex_buffer_object , - _GL_ARB_occlusion_query , - _GL_ARB_shader_objects , - _GL_ARB_vertex_shader , - _GL_ARB_fragment_shader , - _GL_ARB_shading_language_100 , - _GL_ARB_texture_non_power_of_two , - _GL_ARB_point_sprite , - _GL_ARB_fragment_program_shadow , - - /* Non ARB Extensions */ - _GL_EXT_abgr , - _GL_EXT_blend_color , - _GL_EXT_polygon_offset , - _GL_EXT_texture , - _GL_EXT_texture3D , - _GL_SGIS_texture_filter4 , - _GL_EXT_subtexture , - _GL_EXT_copy_texture , - _GL_EXT_histogram , - _GL_EXT_convolution , - _GL_SGI_color_matrix , - _GL_SGI_color_table , - _GL_SGIS_pixel_texture , - _GL_SGIS_texture4D , - _GL_SGI_texture_color_table , - _GL_EXT_cmyka , - _GL_EXT_texture_object , - _GL_SGIS_detail_texture , - _GL_SGIS_sharpen_texture , - _GL_EXT_packed_pixels , - _GL_SGIS_texture_lod , - _GL_SGIS_multisample , - _GL_EXT_rescale_normal , - _GLX_EXT_visual_info , - _GL_EXT_vertex_array , - _GL_EXT_misc_attribute , - _GL_SGIS_generate_mipmap , - _GL_SGIX_clipmap , - _GL_SGIX_shadow , - _GL_SGIS_texture_edge_clamp , - _GL_SGIS_texture_border_clamp , - _GL_EXT_blend_minmax , - _GL_EXT_blend_subtract , - _GL_EXT_blend_logic_op , - _GLX_SGI_swap_control , - _GLX_SGI_video_sync , - _GLX_SGI_make_current_read , - _GLX_SGIX_video_source , - _GLX_EXT_visual_rating , - _GL_SGIX_interlace , - _GLX_EXT_import_context , - _GLX_SGIX_fbconfig , - _GLX_SGIX_pbuffer , - _GL_SGIS_texture_select , - _GL_SGIX_sprite , - _GL_SGIX_texture_multi_buffer , - _GL_EXT_point_parameters , - _GL_SGIX_instruments , - _GL_SGIX_texture_scale_bias , - _GL_SGIX_framezoom , - _GL_SGIX_tag_sample_buffer , - _GL_SGIX_reference_plane , - _GL_SGIX_flush_raster , - _GLX_SGI_cushion , - _GL_SGIX_depth_texture , - _GL_SGIS_fog_function , - _GL_SGIX_fog_offset , - _GL_HP_image_transform , - _GL_HP_convolution_border_modes , - _GL_SGIX_texture_add_env , - _GL_EXT_color_subtable , - _GLU_EXT_object_space_tess , - _GL_PGI_vertex_hints , - _GL_PGI_misc_hints , - _GL_EXT_paletted_texture , - _GL_EXT_clip_volume_hint , - _GL_SGIX_list_priority , - _GL_SGIX_ir_instrument1 , - _GLX_SGIX_video_resize , - _GL_SGIX_texture_lod_bias , - _GLU_SGI_filter4_parameters , - _GLX_SGIX_dm_buffer , - _GL_SGIX_shadow_ambient , - _GLX_SGIX_swap_group , - _GLX_SGIX_swap_barrier , - _GL_EXT_index_texture , - _GL_EXT_index_material , - _GL_EXT_index_func , - _GL_EXT_index_array_formats , - _GL_EXT_compiled_vertex_array , - _GL_EXT_cull_vertex , - _GLU_EXT_nurbs_tessellator , - _GL_SGIX_ycrcb , - _GL_EXT_fragment_lighting , - _GL_IBM_rasterpos_clip , - _GL_HP_texture_lighting , - _GL_EXT_draw_range_elements , - _GL_WIN_phong_shading , - _GL_WIN_specular_fog , - _GLX_SGIS_color_range , - _GL_EXT_light_texture , - _GL_SGIX_blend_alpha_minmax , - _GL_EXT_scene_marker , - _GL_SGIX_pixel_texture_bits , - _GL_EXT_bgra , - _GL_SGIX_async , - _GL_SGIX_async_pixel , - _GL_SGIX_async_histogram , - _GL_INTEL_texture_scissor , - _GL_INTEL_parallel_arrays , - _GL_HP_occlusion_test , - _GL_EXT_pixel_transform , - _GL_EXT_pixel_transform_color_table , - _GL_EXT_shared_texture_palette , - _GLX_SGIS_blended_overlay , - _GL_EXT_separate_specular_color , - _GL_EXT_secondary_color , - _GL_EXT_texture_env , - _GL_EXT_texture_perturb_normal , - _GL_EXT_multi_draw_arrays , - _GL_EXT_fog_coord , - _GL_REND_screen_coordinates , - _GL_EXT_coordinate_frame , - _GL_EXT_texture_env_combine , - _GL_APPLE_specular_vector , - _GL_SGIX_pixel_texture , - _GL_APPLE_transform_hint , - _GL_SUNX_constant_data , - _GL_SUN_global_alpha , - _GL_SUN_triangle_list , - _GL_SUN_vertex , - _WGL_EXT_display_color_table , - _WGL_EXT_extensions_string , - _WGL_EXT_make_current_read , - _WGL_EXT_pixel_format , - _WGL_EXT_pbuffer , - _WGL_EXT_swap_control , - _GL_EXT_blend_func_separate , - _GL_INGR_color_clamp , - _GL_INGR_interlace_read , - _GL_EXT_stencil_wrap , - _WGL_EXT_depth_float , - _GL_EXT_422_pixels , - _GL_NV_texgen_reflection , - _GL_SGIX_texture_range , - _GL_SUN_convolution_border_modes , - _GLX_SUN_get_transparent_index , - _GL_EXT_texture_env_add , - _GL_EXT_texture_lod_bias , - _GL_EXT_texture_filter_anisotropic , - _GL_EXT_vertex_weighting , - _GL_NV_light_max_exponent , - _GL_NV_vertex_array_range , - _GL_NV_register_combiners , - _GL_NV_fog_distance , - _GL_NV_texgen_emboss , - _GL_NV_blend_square , - _GL_NV_texture_env_combine4 , - _GL_MESA_resize_buffers , - _GL_MESA_window_pos , - _GL_EXT_texture_compression_s3tc , - _GL_IBM_cull_vertex , - _GL_IBM_multimode_draw_arrays , - _GL_IBM_vertex_array_lists , - _GL_3DFX_texture_compression_FXT1 , - _GL_3DFX_multisample , - _GL_3DFX_tbuffer , - _WGL_EXT_multisample , - _GL_SGIX_vertex_preclip , - _GL_SGIX_resample , - _GL_SGIS_texture_color_mask , - _GLX_MESA_copy_sub_buffer , - _GLX_MESA_pixmap_colormap , - _GLX_MESA_release_buffers , - _GLX_MESA_set_3dfx_mode , - _GL_EXT_texture_env_dot3 , - _GL_ATI_texture_mirror_once , - _GL_NV_fence , - _GL_IBM_static_data , - _GL_IBM_texture_mirrored_repeat , - _GL_NV_evaluators , - _GL_NV_packed_depth_stencil , - _GL_NV_register_combiners2 , - _GL_NV_texture_compression_vtc , - _GL_NV_texture_rectangle , - _GL_NV_texture_shader , - _GL_NV_texture_shader2 , - _GL_NV_vertex_array_range2 , - _GL_NV_vertex_program , - _GLX_SGIX_visual_select_group , - _GL_SGIX_texture_coordinate_clamp , - _GLX_OML_swap_method , - _GLX_OML_sync_control , - _GL_OML_interlace , - _GL_OML_subsample , - _GL_OML_resample , - _WGL_OML_sync_control , - _GL_NV_copy_depth_to_color , - _GL_ATI_envmap_bumpmap , - _GL_ATI_fragment_shader , - _GL_ATI_pn_triangles , - _GL_ATI_vertex_array_object , - _GL_EXT_vertex_shader , - _GL_ATI_vertex_streams , - _WGL_I3D_digital_video_control , - _WGL_I3D_gamma , - _WGL_I3D_genlock , - _WGL_I3D_image_buffer , - _WGL_I3D_swap_frame_lock , - _WGL_I3D_swap_frame_usage , - _GL_ATI_element_array , - _GL_SUN_mesh_array , - _GL_SUN_slice_accum , - _GL_NV_multisample_filter_hint , - _GL_NV_depth_clamp , - _GL_NV_occlusion_query , - _GL_NV_point_sprite , - _WGL_NV_render_depth_texture , - _WGL_NV_render_texture_rectangle , - _GL_NV_texture_shader3 , - _GL_NV_vertex_program1_1 , - _GL_EXT_shadow_funcs , - _GL_EXT_stencil_two_side , - _GL_ATI_text_fragment_shader , - _GL_APPLE_client_storage , - _GL_APPLE_element_array , - _GL_APPLE_fence , - _GL_APPLE_vertex_array_object , - _GL_APPLE_vertex_array_range , - _GL_APPLE_ycbcr_422 , - _GL_S3_s3tc , - _GL_ATI_draw_buffers , - _WGL_ATI_pixel_format_float , - _GL_ATI_texture_env_combine3 , - _GL_ATI_texture_float , - _GL_NV_float_buffer , - _GL_NV_fragment_program , - _GL_NV_half_float , - _GL_NV_pixel_data_range , - _GL_NV_primitive_restart , - _GL_NV_texture_expand_normal , - _GL_NV_vertex_program2 , - _GL_ATI_map_object_buffer , - _GL_ATI_separate_stencil , - _GL_ATI_vertex_attrib_array_object , - _GL_OES_byte_coordinates , - _GL_OES_fixed_point , - _GL_OES_single_precision , - _GL_OES_compressed_paletted_texture , - _GL_OES_read_format , - _GL_OES_query_matrix , - _GL_EXT_depth_bounds_test , - _GL_EXT_texture_mirror_clamp , - _GL_EXT_blend_equation_separate , - _GL_MESA_pack_invert , - _GL_MESA_ycbcr_texture, - - /* Finished */ - _BGL_TEST, - NUM_EXTENSIONS - } ExtensionName; - - /** - * Checks at runtime whether OpenGL supports the named extension. - * Returns true if OpenGL supports the given extension. - * - * @param name The extension name to check. - */ - bool QueryExtension(ExtensionName name); - /** - * Checks the OpenGL version. - * Returns true if OpenGL is at least the given version. - * - * @param major The major version required - * @param minor The minor version required - */ - bool QueryVersion(int major, int minor); - /** - * This will dynamically link all runtime supported extensions into - * the binary. - * - * @param debug Enable debug printing. This will print debugging info - * when extensions are loaded. - */ - void InitExtensions(int debug); - -#if defined(PFNGLPNTRIANGLESIATIPROC) -extern PFNGLPNTRIANGLESIATIPROC blPNTrianglesiATI; -extern PFNGLPNTRIANGLESFATIPROC blPNTrianglesfATI; -#endif - - -// quick runtime checks -typedef struct BL_EXTInfo -{ - BL_EXTInfo(): - _ARB_multitexture(0), - _ARB_texture_env_combine(0), - _EXT_blend_color(0), - _ARB_texture_cube_map(0), - _ARB_shader_objects(0), - _ARB_vertex_shader(0), - _ARB_fragment_shader(0), - _EXT_texture3D(0), - _ARB_vertex_program(0), - _ARB_depth_texture(0), - _EXT_compiled_vertex_array(0) - { - // - } - bool _ARB_multitexture; - bool _ARB_texture_env_combine; - bool _EXT_blend_color; - bool _ARB_texture_cube_map; - bool _ARB_shader_objects; - bool _ARB_vertex_shader; - bool _ARB_fragment_shader; - bool _EXT_texture3D; - bool _ARB_vertex_program; - bool _ARB_depth_texture; - bool _EXT_compiled_vertex_array; -}BL_EXTInfo; - -extern BL_EXTInfo RAS_EXT_support; - -#ifdef GL_ARB_multitexture // defined in glext.h now... -extern int max_texture_units; -extern PFNGLACTIVETEXTUREARBPROC blActiveTextureARB; -extern PFNGLCLIENTACTIVETEXTUREARBPROC blClientActiveTextureARB; -extern PFNGLMULTITEXCOORD1DARBPROC blMultiTexCoord1dARB; -extern PFNGLMULTITEXCOORD1DVARBPROC blMultiTexCoord1dvARB; -extern PFNGLMULTITEXCOORD1FARBPROC blMultiTexCoord1fARB; -extern PFNGLMULTITEXCOORD1FVARBPROC blMultiTexCoord1fvARB; -extern PFNGLMULTITEXCOORD1IARBPROC blMultiTexCoord1iARB; -extern PFNGLMULTITEXCOORD1IVARBPROC blMultiTexCoord1ivARB; -extern PFNGLMULTITEXCOORD1SARBPROC blMultiTexCoord1sARB; -extern PFNGLMULTITEXCOORD1SVARBPROC blMultiTexCoord1svARB; -extern PFNGLMULTITEXCOORD2DARBPROC blMultiTexCoord2dARB; -extern PFNGLMULTITEXCOORD2DVARBPROC blMultiTexCoord2dvARB; -extern PFNGLMULTITEXCOORD2FARBPROC blMultiTexCoord2fARB; -extern PFNGLMULTITEXCOORD2FVARBPROC blMultiTexCoord2fvARB; -extern PFNGLMULTITEXCOORD2IARBPROC blMultiTexCoord2iARB; -extern PFNGLMULTITEXCOORD2IVARBPROC blMultiTexCoord2ivARB; -extern PFNGLMULTITEXCOORD2SARBPROC blMultiTexCoord2sARB; -extern PFNGLMULTITEXCOORD2SVARBPROC blMultiTexCoord2svARB; -extern PFNGLMULTITEXCOORD3DARBPROC blMultiTexCoord3dARB; -extern PFNGLMULTITEXCOORD3DVARBPROC blMultiTexCoord3dvARB; -extern PFNGLMULTITEXCOORD3FARBPROC blMultiTexCoord3fARB; -extern PFNGLMULTITEXCOORD3FVARBPROC blMultiTexCoord3fvARB; -extern PFNGLMULTITEXCOORD3IARBPROC blMultiTexCoord3iARB; -extern PFNGLMULTITEXCOORD3IVARBPROC blMultiTexCoord3ivARB; -extern PFNGLMULTITEXCOORD3SARBPROC blMultiTexCoord3sARB; -extern PFNGLMULTITEXCOORD3SVARBPROC blMultiTexCoord3svARB; -extern PFNGLMULTITEXCOORD4DARBPROC blMultiTexCoord4dARB; -extern PFNGLMULTITEXCOORD4DVARBPROC blMultiTexCoord4dvARB; -extern PFNGLMULTITEXCOORD4FARBPROC blMultiTexCoord4fARB; -extern PFNGLMULTITEXCOORD4FVARBPROC blMultiTexCoord4fvARB; -extern PFNGLMULTITEXCOORD4IARBPROC blMultiTexCoord4iARB; -extern PFNGLMULTITEXCOORD4IVARBPROC blMultiTexCoord4ivARB; -extern PFNGLMULTITEXCOORD4SARBPROC blMultiTexCoord4sARB; -extern PFNGLMULTITEXCOORD4SVARBPROC blMultiTexCoord4svARB; -#endif - - -#ifdef GL_ARB_shader_objects -extern PFNGLDELETEOBJECTARBPROC blDeleteObjectARB; -extern PFNGLGETHANDLEARBPROC blGetHandleARB; -extern PFNGLDETACHOBJECTARBPROC blDetachObjectARB; -extern PFNGLCREATESHADEROBJECTARBPROC blCreateShaderObjectARB; -extern PFNGLSHADERSOURCEARBPROC blShaderSourceARB; -extern PFNGLCOMPILESHADERARBPROC blCompileShaderARB; -extern PFNGLCREATEPROGRAMOBJECTARBPROC blCreateProgramObjectARB; -extern PFNGLATTACHOBJECTARBPROC blAttachObjectARB; -extern PFNGLLINKPROGRAMARBPROC blLinkProgramARB; -extern PFNGLUSEPROGRAMOBJECTARBPROC blUseProgramObjectARB; -extern PFNGLVALIDATEPROGRAMARBPROC blValidateProgramARB; -extern PFNGLUNIFORM1FARBPROC blUniform1fARB; -extern PFNGLUNIFORM2FARBPROC blUniform2fARB; -extern PFNGLUNIFORM3FARBPROC blUniform3fARB; -extern PFNGLUNIFORM4FARBPROC blUniform4fARB; -extern PFNGLUNIFORM1IARBPROC blUniform1iARB; -extern PFNGLUNIFORM2IARBPROC blUniform2iARB; -extern PFNGLUNIFORM3IARBPROC blUniform3iARB; -extern PFNGLUNIFORM4IARBPROC blUniform4iARB; -extern PFNGLUNIFORM1FVARBPROC blUniform1fvARB; -extern PFNGLUNIFORM2FVARBPROC blUniform2fvARB; -extern PFNGLUNIFORM3FVARBPROC blUniform3fvARB; -extern PFNGLUNIFORM4FVARBPROC blUniform4fvARB; -extern PFNGLUNIFORM1IVARBPROC blUniform1ivARB; -extern PFNGLUNIFORM2IVARBPROC blUniform2ivARB; -extern PFNGLUNIFORM3IVARBPROC blUniform3ivARB; -extern PFNGLUNIFORM4IVARBPROC blUniform4ivARB; -extern PFNGLUNIFORMMATRIX2FVARBPROC blUniformMatrix2fvARB; -extern PFNGLUNIFORMMATRIX3FVARBPROC blUniformMatrix3fvARB; -extern PFNGLUNIFORMMATRIX4FVARBPROC blUniformMatrix4fvARB; -extern PFNGLGETOBJECTPARAMETERFVARBPROC blGetObjectParameterfvARB; -extern PFNGLGETOBJECTPARAMETERIVARBPROC blGetObjectParameterivARB; -extern PFNGLGETINFOLOGARBPROC blGetInfoLogARB; -extern PFNGLGETATTACHEDOBJECTSARBPROC blGetAttachedObjectsARB; -extern PFNGLGETUNIFORMLOCATIONARBPROC blGetUniformLocationARB; -extern PFNGLGETACTIVEUNIFORMARBPROC blGetActiveUniformARB; -extern PFNGLGETUNIFORMFVARBPROC blGetUniformfvARB; -extern PFNGLGETUNIFORMIVARBPROC blGetUniformivARB; -extern PFNGLGETSHADERSOURCEARBPROC blGetShaderSourceARB; -#endif - -#ifdef GL_ARB_vertex_shader -extern PFNGLBINDATTRIBLOCATIONARBPROC blBindAttribLocationARB; -extern PFNGLGETACTIVEATTRIBARBPROC blGetActiveAttribARB; -extern PFNGLGETATTRIBLOCATIONARBPROC blGetAttribLocationARB; -#endif - -#ifdef GL_ARB_vertex_program -extern PFNGLVERTEXATTRIB1FARBPROC blVertexAttrib1fARB; -extern PFNGLVERTEXATTRIB1FVARBPROC blVertexAttrib1fvARB; -extern PFNGLVERTEXATTRIB2FARBPROC blVertexAttrib2fARB; -extern PFNGLVERTEXATTRIB2FVARBPROC blVertexAttrib2fvARB; -extern PFNGLVERTEXATTRIB3FARBPROC blVertexAttrib3fARB; -extern PFNGLVERTEXATTRIB3FVARBPROC blVertexAttrib3fvARB; -extern PFNGLVERTEXATTRIB4FARBPROC blVertexAttrib4fARB; -extern PFNGLVERTEXATTRIB4FVARBPROC blVertexAttrib4fvARB; -extern PFNGLGETPROGRAMSTRINGARBPROC blGetProgramStringARB; -extern PFNGLGETVERTEXATTRIBDVARBPROC blGetVertexAttribdvARB; -extern PFNGLGETVERTEXATTRIBFVARBPROC blGetVertexAttribfvARB; -extern PFNGLGETVERTEXATTRIBIVARBPROC blGetVertexAttribivARB; -#endif - -/* -#ifdef GL_EXT_compiled_vertex_array -extern PFNGLLOCKARRAYSEXTPROC blLockArraysEXT; -extern PFNGLUNLOCKARRAYSEXTPROC blUnlockArraysEXT; -#endif -*/ + void InitExtensions(bool debug); } /* namespace bgl */ - #endif /* __RAS_GLEXTENSIONMANAGER_H__ */ diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp index afa98fdb274..39080b80492 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp @@ -6,15 +6,10 @@ #ifdef WIN32 #include #endif // WIN32 -#ifdef __APPLE__ -#define GL_GLEXT_LEGACY 1 -#include -#else -#include -#endif + +#include "GL/glew.h" #include "RAS_TexVert.h" -#include "RAS_GLExtensionManager.h" #include "MT_assert.h" //#ifndef NDEBUG @@ -27,8 +22,8 @@ RAS_ListSlot::RAS_ListSlot(RAS_ListRasterizer* rasty) : KX_ListSlot(), - m_flag(LIST_MODIFY|LIST_CREATE), m_list(0), + m_flag(LIST_MODIFY|LIST_CREATE), m_rasty(rasty) { } @@ -176,7 +171,7 @@ void RAS_ListRasterizer::IndexPrimitives( RAS_ListSlot* localSlot =0; // useObjectColor(are we updating every frame?) - if(!useObjectColor) { + if(!useObjectColor && slot) { localSlot = FindOrAdd(vertexarrays, slot); localSlot->DrawList(); if(localSlot->End()) { @@ -203,7 +198,7 @@ void RAS_ListRasterizer::IndexPrimitives( ); } - if(!useObjectColor) { + if(!useObjectColor && slot) { localSlot->EndList(); *slot = localSlot; } @@ -223,7 +218,7 @@ void RAS_ListRasterizer::IndexPrimitivesMulti( RAS_ListSlot* localSlot =0; // useObjectColor(are we updating every frame?) - if(!useObjectColor) { + if(!useObjectColor && slot) { localSlot = FindOrAdd(vertexarrays, slot); localSlot->DrawList(); @@ -251,7 +246,7 @@ void RAS_ListRasterizer::IndexPrimitivesMulti( ); } - if(!useObjectColor) { + if(!useObjectColor && slot) { localSlot->EndList(); *slot = localSlot; } diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp index f99121e5b7c..d3c0426de86 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp @@ -31,33 +31,13 @@ #include "RAS_OpenGLRasterizer.h" -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef WIN32 -#include -#endif // WIN32 -#ifdef __APPLE__ -#define GL_GLEXT_LEGACY 1 -#include -#include -#else -#include -#if defined(__sun__) && !defined(__sparc__) -#include -#else -#include -#endif -#endif +#include "GL/glew.h" #include "RAS_Rect.h" #include "RAS_TexVert.h" #include "MT_CmMatrix4x4.h" #include "RAS_IRenderTools.h" // rendering text -#include "RAS_GLExtensionManager.h" - /** * 32x32 bit masks for vinterlace stereo mode */ @@ -83,10 +63,11 @@ RAS_OpenGLRasterizer::RAS_OpenGLRasterizer(RAS_ICanvas* canvas) m_focallength(0.0), m_setfocallength(false), m_noOfScanlines(32), - m_useTang(false), - m_materialCachingInfo(0), m_motionblur(0), - m_motionblurvalue(-1.0) + m_motionblurvalue(-1.0), + m_texco_num(0), + m_attrib_num(0), + m_materialCachingInfo(0) { m_viewmatrix.Identity(); @@ -335,7 +316,7 @@ void RAS_OpenGLRasterizer::Exit() glDisable(GL_POLYGON_STIPPLE); glDisable(GL_LIGHTING); - if (bgl::QueryExtension(bgl::_GL_EXT_separate_specular_color) || bgl::QueryVersion(1, 2)) + if (GLEW_EXT_separate_specular_color || GLEW_VERSION_1_2) glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SINGLE_COLOR); EndFrame(); @@ -802,277 +783,6 @@ void RAS_OpenGLRasterizer::IndexPrimitives(const vecVertexArray & vertexarrays, } -void RAS_OpenGLRasterizer::IndexPrimitives_Ex(const vecVertexArray & vertexarrays, - const vecIndexArrays & indexarrays, - int mode, - class RAS_IPolyMaterial* polymat, - class RAS_IRenderTools* rendertools, - bool useObjectColor, - const MT_Vector4& rgbacolor - ) -{ - bool recalc; - GLenum drawmode; - switch (mode) - { - case 0: - drawmode = GL_TRIANGLES; - break; - case 1: - drawmode = GL_LINES; - break; - case 2: - drawmode = GL_QUADS; - break; - default: - drawmode = GL_LINES; - break; - } - - const RAS_TexVert* vertexarray ; - unsigned int numindices,vt; - - for (vt=0;vt RAS_MAX_TEXCO) + m_texco_num = RAS_MAX_TEXCO; +} + +void RAS_OpenGLRasterizer::SetAttribNum(int num) +{ + m_attrib_num = num; + if(m_attrib_num > RAS_MAX_ATTRIB) + m_attrib_num = RAS_MAX_ATTRIB; +} + +void RAS_OpenGLRasterizer::SetTexCoord(TexCoGen coords, int unit) { // this changes from material to material - if(unit < RAS_MAX) + if(unit < RAS_MAX_TEXCO) m_texco[unit] = coords; } -void RAS_OpenGLRasterizer::SetAttrib(int type) +void RAS_OpenGLRasterizer::SetAttrib(TexCoGen coords, int unit) { - if(type == RAS_TEXTANGENT) m_useTang=true; + // this changes from material to material + if(unit < RAS_MAX_ATTRIB) + m_attrib[unit] = coords; } -void RAS_OpenGLRasterizer::TexCoord(const RAS_TexVert &tv, int enabled) +void RAS_OpenGLRasterizer::TexCoord(const RAS_TexVert &tv) { -#if defined(GL_ARB_multitexture) && defined(WITH_GLEXT) - if (!getenv("WITHOUT_GLEXT")) { - if(bgl::RAS_EXT_support._ARB_multitexture) { - for(int unit=0; unitGetEnabled(); - - if (!numindices) - break; - - int vindex=0; - switch (mode) { - case 1: + glBegin(GL_QUADS); + vindex=0; + if (useObjectColor) { - glBegin(GL_LINES); - vindex=0; - for (unsigned int i=0;iGetEnabled(); - - if (!numindices) - continue; - - int vindex=0; - switch (mode) { - case 1: + glBegin(GL_TRIANGLES); + vindex=0; + if (useObjectColor) { - glBegin(GL_LINES); - vindex=0; - for (unsigned int i=0;i m_debugLines; - virtual void SetTexCoords(TexCoGen coords,int enabled); - virtual void SetAttrib(int type); - void TexCoord(const RAS_TexVert &tv, int unit); + virtual void SetTexCoordNum(int num); + virtual void SetAttribNum(int num); + virtual void SetTexCoord(TexCoGen coords, int unit); + virtual void SetAttrib(TexCoGen coords, int unit); + + void TexCoord(const RAS_TexVert &tv); virtual void GetViewMatrix(MT_Matrix4x4 &mat) const; void Tangent(const RAS_TexVert& v1, diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp index ddfcc3f3f9d..ce76318c2ce 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp @@ -32,34 +32,21 @@ #include "RAS_VAOpenGLRasterizer.h" #include -#ifdef WIN32 -#include -#endif // WIN32 -#ifdef __APPLE__ -#define GL_GLEXT_LEGACY 1 -#include -#else -#include -#endif +#include "GL/glew.h" #include "STR_String.h" #include "RAS_TexVert.h" #include "MT_CmMatrix4x4.h" #include "RAS_IRenderTools.h" // rendering text - -#include "RAS_GLExtensionManager.h" - -using namespace bgl; - RAS_VAOpenGLRasterizer::RAS_VAOpenGLRasterizer(RAS_ICanvas* canvas, bool lock) : RAS_OpenGLRasterizer(canvas), - m_Lock(lock && RAS_EXT_support._EXT_compiled_vertex_array) + m_Lock(lock && GLEW_EXT_compiled_vertex_array), + m_last_texco_num(0), + m_last_attrib_num(0) { } - - RAS_VAOpenGLRasterizer::~RAS_VAOpenGLRasterizer() { } @@ -82,53 +69,36 @@ bool RAS_VAOpenGLRasterizer::Init(void) return result; } - - void RAS_VAOpenGLRasterizer::SetDrawingMode(int drawingmode) { m_drawingmode = drawingmode; - switch (m_drawingmode) + switch (m_drawingmode) { - case KX_BOUNDINGBOX: - { - } - case KX_WIREFRAME: - { + case KX_BOUNDINGBOX: + case KX_WIREFRAME: glDisable (GL_CULL_FACE); break; - } - case KX_TEXTURED: - { - } - case KX_SHADED: - { + case KX_TEXTURED: + case KX_SHADED: glEnableClientState(GL_COLOR_ARRAY); - } - case KX_SOLID: - { + case KX_SOLID: + break; + default: break; - } - default: - { - } } } - - void RAS_VAOpenGLRasterizer::Exit() { glDisableClientState(GL_VERTEX_ARRAY); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisableClientState(GL_COLOR_ARRAY); glDisableClientState(GL_NORMAL_ARRAY); + EnableTextures(false); RAS_OpenGLRasterizer::Exit(); } - - void RAS_VAOpenGLRasterizer::IndexPrimitives( const vecVertexArray& vertexarrays, const vecIndexArrays & indexarrays, int mode, @@ -142,24 +112,16 @@ void RAS_VAOpenGLRasterizer::IndexPrimitives( const vecVertexArray& vertexarrays GLenum drawmode; switch (mode) { - case 0: - { - drawmode = GL_TRIANGLES; - break; - } - case 2: - { - drawmode = GL_QUADS; - break; - } - case 1: //lines - { - } - default: - { - drawmode = GL_LINES; - break; - } + case 0: + drawmode = GL_TRIANGLES; + break; + case 2: + drawmode = GL_QUADS; + break; + case 1: //lines + default: + drawmode = GL_LINES; + break; } const RAS_TexVert* vertexarray; unsigned int numindices, vt; @@ -180,6 +142,9 @@ void RAS_VAOpenGLRasterizer::IndexPrimitives( const vecVertexArray& vertexarrays glColor3d(0,0,0); } + EnableTextures(false); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + // use glDrawElements to draw each vertexarray for (vt=0;vtGetEnabled(); if (drawmode != GL_LINES) { @@ -251,7 +208,8 @@ void RAS_VAOpenGLRasterizer::IndexPrimitivesMulti( const vecVertexArray& vertexa { glDisableClientState(GL_COLOR_ARRAY); glColor4d(rgbacolor[0], rgbacolor[1], rgbacolor[2], rgbacolor[3]); - } else + } + else { glColor4d(0,0,0,1.0); glEnableClientState(GL_COLOR_ARRAY); @@ -271,11 +229,10 @@ void RAS_VAOpenGLRasterizer::IndexPrimitivesMulti( const vecVertexArray& vertexa if (!numindices) continue; - - glVertexPointer(3,GL_FLOAT,vtxstride,vertexarray->getLocalXYZ()); - TexCoordPtr(vertexarray, enabled); - //glTexCoordPointer(2,GL_FLOAT,vtxstride,vertexarray->getUV1()); + glVertexPointer(3,GL_FLOAT,vtxstride,vertexarray->getLocalXYZ()); + TexCoordPtr(vertexarray); + glColorPointer(4,GL_UNSIGNED_BYTE,vtxstride,vertexarray->getRGBA()); glNormalPointer(GL_FLOAT,vtxstride,vertexarray->getNormal()); @@ -290,62 +247,157 @@ void RAS_VAOpenGLRasterizer::IndexPrimitivesMulti( const vecVertexArray& vertexa } } -void RAS_VAOpenGLRasterizer::TexCoordPtr(const RAS_TexVert *tv, int enabled) +void RAS_VAOpenGLRasterizer::TexCoordPtr(const RAS_TexVert *tv) { -#if defined(GL_ARB_multitexture) && defined(WITH_GLEXT) - if (!getenv("WITHOUT_GLEXT")) { - if(bgl::RAS_EXT_support._ARB_multitexture) - { - for(int unit=0; unitgetFlag() & TV_2NDUV && (int)tv->getUnit() == unit) { glEnableClientState(GL_TEXTURE_COORD_ARRAY); - if( tv->getFlag() & TV_2NDUV && tv->getUnit() == unit ) { - glTexCoordPointer(2, GL_FLOAT, sizeof(RAS_TexVert), tv->getUV2()); - continue; - } - switch(m_texco[unit]) - { - case RAS_TEXCO_DISABLE: - case RAS_TEXCO_OBJECT: - case RAS_TEXCO_GEN: - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - break; - case RAS_TEXCO_ORCO: - case RAS_TEXCO_GLOB: - glTexCoordPointer(3, GL_FLOAT, sizeof(RAS_TexVert),tv->getLocalXYZ()); - break; - case RAS_TEXCO_UV1: - glTexCoordPointer(2, GL_FLOAT, sizeof(RAS_TexVert),tv->getUV1()); - break; - case RAS_TEXCO_NORM: - glTexCoordPointer(3, GL_FLOAT, sizeof(RAS_TexVert),tv->getNormal()); - break; - case RAS_TEXTANGENT: - glTexCoordPointer(4, GL_FLOAT, sizeof(RAS_TexVert),tv->getTangent()); - break; - case RAS_TEXCO_UV2: - glTexCoordPointer(2, GL_FLOAT, sizeof(RAS_TexVert),tv->getUV2()); - break; - } + glTexCoordPointer(2, GL_FLOAT, sizeof(RAS_TexVert), tv->getUV2()); + continue; + } + switch(m_texco[unit]) + { + case RAS_TEXCO_ORCO: + case RAS_TEXCO_GLOB: + glTexCoordPointer(3, GL_FLOAT, sizeof(RAS_TexVert),tv->getLocalXYZ()); + break; + case RAS_TEXCO_UV1: + glTexCoordPointer(2, GL_FLOAT, sizeof(RAS_TexVert),tv->getUV1()); + break; + case RAS_TEXCO_NORM: + glTexCoordPointer(3, GL_FLOAT, sizeof(RAS_TexVert),tv->getNormal()); + break; + case RAS_TEXTANGENT: + glTexCoordPointer(4, GL_FLOAT, sizeof(RAS_TexVert),tv->getTangent()); + break; + case RAS_TEXCO_UV2: + glTexCoordPointer(2, GL_FLOAT, sizeof(RAS_TexVert),tv->getUV2()); + break; + default: + break; } } -#ifdef GL_ARB_vertex_program - if(m_useTang && bgl::RAS_EXT_support._ARB_vertex_program) - bgl::blVertexAttrib4fvARB(1/*tangent*/, tv->getTangent()); -#endif + glClientActiveTextureARB(GL_TEXTURE0_ARB); } -#endif -} + if(GLEW_ARB_vertex_program) { + for(unit=0; unitgetLocalXYZ()); + break; + case RAS_TEXCO_UV1: + glVertexAttribPointer(unit, 2, GL_FLOAT, GL_FALSE, sizeof(RAS_TexVert), tv->getUV1()); + break; + case RAS_TEXCO_NORM: + glVertexAttribPointer(unit, 3, GL_FLOAT, GL_FALSE, sizeof(RAS_TexVert), tv->getNormal()); + break; + case RAS_TEXTANGENT: + glVertexAttribPointer(unit, 4, GL_FLOAT, GL_FALSE, sizeof(RAS_TexVert), tv->getTangent()); + break; + case RAS_TEXCO_UV2: + glVertexAttribPointer(unit, 2, GL_FLOAT, GL_FALSE, sizeof(RAS_TexVert), tv->getUV2()); + break; + default: + break; + } + } + } +} void RAS_VAOpenGLRasterizer::EnableTextures(bool enable) { - if (enable) - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - else - glDisableClientState(GL_TEXTURE_COORD_ARRAY); + TexCoGen *texco, *attrib; + int unit, texco_num, attrib_num; + + /* disable previously enabled texture coordinates and attributes. ideally + * this shouldn't be necessary .. */ + if(enable) + EnableTextures(false); + + /* we cache last texcoords and attribs to ensure we disable the ones that + * were actually last set */ + if(enable) { + texco = m_texco; + texco_num = m_texco_num; + attrib = m_attrib; + attrib_num = m_attrib_num; + + memcpy(m_last_texco, m_texco, sizeof(TexCoGen)*m_texco_num); + m_last_texco_num = m_texco_num; + memcpy(m_last_attrib, m_attrib, sizeof(TexCoGen)*m_attrib_num); + m_last_attrib_num = m_attrib_num; + } + else { + texco = m_last_texco; + texco_num = m_last_texco_num; + attrib = m_last_attrib; + attrib_num = m_last_attrib_num; + } + + if(GLEW_ARB_multitexture) { + for(unit=0; unit tmp -# Code can be copied & pasted from tmp to GL_ExtensionManager.cpp. -# -# glext.h is available here: http://oss.sgi.com/projects/ogl-sample/ABI/glext.h -# - -from sys import stdin -import string, re - -glext_h = string.split(stdin.read(), '\n') - -# These extensions have been incorporated into the core GL or been superceded. -# Code will not be generated for these extensions -blacklist = [ - "GL_EXT_multisample", - "GL_INGR_blend_func_separate", - "GL_SGIX_fragment_lighting", - "GL_SGIX_polynomial_ffd", - "GL_SGIS_point_parameters", - "GL_EXT_texture_object", - "GL_EXT_subtexture", - "GL_EXT_copy_texture", - "GL_EXT_vertex_array", - "GL_EXT_point_parameters", - "GL_EXT_blend_color", - "GL_EXT_polygon_offset", - "GL_EXT_texture"] - -# Only code for these extensions will be generated. Extensions on both the -# blacklist & whitelist will not have code generated. -# This list is from http://oss.sgi.com/projects/ogl-sample/registry/ at 14-Mar-04 -whitelist = [ - # ARB Extensions - "GL_ARB_multitexture", - "GLX_ARB_get_proc_address", - "GL_ARB_transpose_matrix", - "WGL_ARB_buffer_region", - "GL_ARB_multisample", - "GL_ARB_texture_env_add", - "GL_ARB_texture_cube_map", - "WGL_ARB_extensions_string", - "WGL_ARB_pixel_format", - "WGL_ARB_make_current_read", - "WGL_ARB_pbuffer", - "GL_ARB_texture_compression", - "GL_ARB_texture_border_clamp", - "GL_ARB_point_parameters", - "GL_ARB_vertex_blend", - "GL_ARB_matrix_palette", - "GL_ARB_texture_env_combine", - "GL_ARB_texture_env_crossbar", - "GL_ARB_texture_env_dot3", - "WGL_ARB_render_texture", - "GL_ARB_texture_mirrored_repeat", - "GL_ARB_depth_texture", - "GL_ARB_shadow", - "GL_ARB_shadow_ambient", - "GL_ARB_window_pos", - "GL_ARB_vertex_program", - "GL_ARB_fragment_program", - "GL_ARB_vertex_buffer_object", - "GL_ARB_occlusion_query", - "GL_ARB_shader_objects", - "GL_ARB_vertex_shader", - "GL_ARB_fragment_shader", - "GL_ARB_shading_language_100", - "GL_ARB_texture_non_power_of_two", - "GL_ARB_point_sprite", - "GL_ARB_fragment_program_shadow", - - # Non ARB Extensions - "GL_EXT_abgr", - "GL_EXT_blend_color", - "GL_EXT_polygon_offset", - "GL_EXT_texture", - "GL_EXT_texture3D", - "GL_SGIS_texture_filter4", - "GL_EXT_subtexture", - "GL_EXT_copy_texture", - "GL_EXT_histogram", - "GL_EXT_convolution", - "GL_SGI_color_matrix", - "GL_SGI_color_table", - "GL_SGIS_pixel_texture", - "GL_SGIS_texture4D", - "GL_SGI_texture_color_table", - "GL_EXT_cmyka", - "GL_EXT_texture_object", - "GL_SGIS_detail_texture", - "GL_SGIS_sharpen_texture", - "GL_EXT_packed_pixels", - "GL_SGIS_texture_lod", - "GL_SGIS_multisample", - "GL_EXT_rescale_normal", - "GLX_EXT_visual_info", - "GL_EXT_vertex_array", - "GL_EXT_misc_attribute", - "GL_SGIS_generate_mipmap", - "GL_SGIX_clipmap", - "GL_SGIX_shadow", - "GL_SGIS_texture_edge_clamp", - "GL_SGIS_texture_border_clamp", - "GL_EXT_blend_minmax", - "GL_EXT_blend_subtract", - "GL_EXT_blend_logic_op", - "GLX_SGI_swap_control", - "GLX_SGI_video_sync", - "GLX_SGI_make_current_read", - "GLX_SGIX_video_source", - "GLX_EXT_visual_rating", - "GL_SGIX_interlace", - "GLX_EXT_import_context", - "GLX_SGIX_fbconfig", - "GLX_SGIX_pbuffer", - "GL_SGIS_texture_select", - "GL_SGIX_sprite", - "GL_SGIX_texture_multi_buffer", - "GL_EXT_point_parameters", - "GL_SGIX_instruments", - "GL_SGIX_texture_scale_bias", - "GL_SGIX_framezoom", - "GL_SGIX_tag_sample_buffer", - "GL_SGIX_reference_plane", - "GL_SGIX_flush_raster", - "GLX_SGI_cushion", - "GL_SGIX_depth_texture", - "GL_SGIS_fog_function", - "GL_SGIX_fog_offset", - "GL_HP_image_transform", - "GL_HP_convolution_border_modes", - "GL_SGIX_texture_add_env", - "GL_EXT_color_subtable", - "GLU_EXT_object_space_tess", - "GL_PGI_vertex_hints", - "GL_PGI_misc_hints", - "GL_EXT_paletted_texture", - "GL_EXT_clip_volume_hint", - "GL_SGIX_list_priority", - "GL_SGIX_ir_instrument1", - "GLX_SGIX_video_resize", - "GL_SGIX_texture_lod_bias", - "GLU_SGI_filter4_parameters", - "GLX_SGIX_dm_buffer", - "GL_SGIX_shadow_ambient", - "GLX_SGIX_swap_group", - "GLX_SGIX_swap_barrier", - "GL_EXT_index_texture", - "GL_EXT_index_material", - "GL_EXT_index_func", - "GL_EXT_index_array_formats", - "GL_EXT_compiled_vertex_array", - "GL_EXT_cull_vertex", - "GLU_EXT_nurbs_tessellator", - "GL_SGIX_ycrcb", - "GL_EXT_fragment_lighting", - "GL_IBM_rasterpos_clip", - "GL_HP_texture_lighting", - "GL_EXT_draw_range_elements", - "GL_WIN_phong_shading", - "GL_WIN_specular_fog", - "GLX_SGIS_color_range", - "GL_EXT_light_texture", - "GL_SGIX_blend_alpha_minmax", - "GL_EXT_scene_marker", - "GL_SGIX_pixel_texture_bits", - "GL_EXT_bgra", - "GL_SGIX_async", - "GL_SGIX_async_pixel", - "GL_SGIX_async_histogram", - "GL_INTEL_texture_scissor", - "GL_INTEL_parallel_arrays", - "GL_HP_occlusion_test", - "GL_EXT_pixel_transform", - "GL_EXT_pixel_transform_color_table", - "GL_EXT_shared_texture_palette", - "GLX_SGIS_blended_overlay", - "GL_EXT_separate_specular_color", - "GL_EXT_secondary_color", - "GL_EXT_texture_env", - "GL_EXT_texture_perturb_normal", - "GL_EXT_multi_draw_arrays", - "GL_EXT_fog_coord", - "GL_REND_screen_coordinates", - "GL_EXT_coordinate_frame", - "GL_EXT_texture_env_combine", - "GL_APPLE_specular_vector", - "GL_SGIX_pixel_texture", - "GL_APPLE_transform_hint", - "GL_SUNX_constant_data", - "GL_SUN_global_alpha", - "GL_SUN_triangle_list", - "GL_SUN_vertex", - "WGL_EXT_display_color_table", - "WGL_EXT_extensions_string", - "WGL_EXT_make_current_read", - "WGL_EXT_pixel_format", - "WGL_EXT_pbuffer", - "WGL_EXT_swap_control", - "GL_EXT_blend_func_separate", - "GL_INGR_color_clamp", - "GL_INGR_interlace_read", - "GL_EXT_stencil_wrap", - "WGL_EXT_depth_float", - "GL_EXT_422_pixels", - "GL_NV_texgen_reflection", - "GL_SGIX_texture_range", - "GL_SUN_convolution_border_modes", - "GLX_SUN_get_transparent_index", - "GL_EXT_texture_env_add", - "GL_EXT_texture_lod_bias", - "GL_EXT_texture_filter_anisotropic", - "GL_EXT_vertex_weighting", - "GL_NV_light_max_exponent", - "GL_NV_vertex_array_range", - "GL_NV_register_combiners", - "GL_NV_fog_distance", - "GL_NV_texgen_emboss", - "GL_NV_blend_square", - "GL_NV_texture_env_combine4", - "GL_MESA_resize_buffers", - "GL_MESA_window_pos", - "GL_EXT_texture_compression_s3tc", - "GL_IBM_cull_vertex", - "GL_IBM_multimode_draw_arrays", - "GL_IBM_vertex_array_lists", - "GL_3DFX_texture_compression_FXT1", - "GL_3DFX_multisample", - "GL_3DFX_tbuffer", - "WGL_EXT_multisample", - "GL_SGIX_vertex_preclip", - "GL_SGIX_resample", - "GL_SGIS_texture_color_mask", - "GLX_MESA_copy_sub_buffer", - "GLX_MESA_pixmap_colormap", - "GLX_MESA_release_buffers", - "GLX_MESA_set_3dfx_mode", - "GL_EXT_texture_env_dot3", - "GL_ATI_texture_mirror_once", - "GL_NV_fence", - "GL_IBM_static_data", - "GL_IBM_texture_mirrored_repeat", - "GL_NV_evaluators", - "GL_NV_packed_depth_stencil", - "GL_NV_register_combiners2", - "GL_NV_texture_compression_vtc", - "GL_NV_texture_rectangle", - "GL_NV_texture_shader", - "GL_NV_texture_shader2", - "GL_NV_vertex_array_range2", - "GL_NV_vertex_program", - "GLX_SGIX_visual_select_group", - "GL_SGIX_texture_coordinate_clamp", - "GLX_OML_swap_method", - "GLX_OML_sync_control", - "GL_OML_interlace", - "GL_OML_subsample", - "GL_OML_resample", - "WGL_OML_sync_control", - "GL_NV_copy_depth_to_color", - "GL_ATI_envmap_bumpmap", - "GL_ATI_fragment_shader", - "GL_ATI_pn_triangles", - "GL_ATI_vertex_array_object", - "GL_EXT_vertex_shader", - "GL_ATI_vertex_streams", - "WGL_I3D_digital_video_control", - "WGL_I3D_gamma", - "WGL_I3D_genlock", - "WGL_I3D_image_buffer", - "WGL_I3D_swap_frame_lock", - "WGL_I3D_swap_frame_usage", - "GL_ATI_element_array", - "GL_SUN_mesh_array", - "GL_SUN_slice_accum", - "GL_NV_multisample_filter_hint", - "GL_NV_depth_clamp", - "GL_NV_occlusion_query", - "GL_NV_point_sprite", - "WGL_NV_render_depth_texture", - "WGL_NV_render_texture_rectangle", - "GL_NV_texture_shader3", - "GL_NV_vertex_program1_1", - "GL_EXT_shadow_funcs", - "GL_EXT_stencil_two_side", - "GL_ATI_text_fragment_shader", - "GL_APPLE_client_storage", - "GL_APPLE_element_array", - "GL_APPLE_fence", - "GL_APPLE_vertex_array_object", - "GL_APPLE_vertex_array_range", - "GL_APPLE_ycbcr_422", - "GL_S3_s3tc", - "GL_ATI_draw_buffers", - "WGL_ATI_pixel_format_float", - "GL_ATI_texture_env_combine3", - "GL_ATI_texture_float", - "GL_NV_float_buffer", - "GL_NV_fragment_program", - "GL_NV_half_float", - "GL_NV_pixel_data_range", - "GL_NV_primitive_restart", - "GL_NV_texture_expand_normal", - "GL_NV_vertex_program2", - "GL_ATI_map_object_buffer", - "GL_ATI_separate_stencil", - "GL_ATI_vertex_attrib_array_object", - "GL_OES_byte_coordinates", - "GL_OES_fixed_point", - "GL_OES_single_precision", - "GL_OES_compressed_paletted_texture", - "GL_OES_read_format", - "GL_OES_query_matrix", - "GL_EXT_depth_bounds_test", - "GL_EXT_texture_mirror_clamp", - "GL_EXT_blend_equation_separate", - "GL_MESA_pack_invert", - "GL_MESA_ycbcr_texture"] - -""" -Example code output: -#ifdef GL_EXT_compiled_vertex_array - if (QueryExtension("GL_EXT_compiled_vertex_array")) - { - glUnlockArraysEXT = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glUnlockArraysEXT")); - glLockArraysEXT = reinterpret_cast(bglGetProcAddress((const GLubyte *) "glLockArraysEXT")); - if (glUnlockArraysEXT && glLockArraysEXT) - { - EnableExtension(_GL_EXT_compiled_vertex_array); - if (doDebugMessages) - std::cout << "Detected GL_EXT_compiled_vertex_array" << std::endl; - } else { - std::cout << "ERROR: GL_EXT_compiled_vertex_array implementation is broken!" << std::endl; - } - } -#endif -""" -def writeext(ext, fnlist): - if (find(blacklist, ext)): - return - if (len(fnlist) == 0): - # This extension has no functions to detect - don't need to wrap in - # #ifdef GL_extension names - print "\tif (QueryExtension(\"" + ext + "\"))" - print "\t{" - print "\t\tEnableExtension(_" + ext + ");" - print "\t\tif (doDebugMessages)" - print "\t\t\tstd::cout << \"Detected " + ext + "\" << std::endl;" - print "\t}" - print - return - print "#if defined(" + ext + ")" - print "\tif (QueryExtension(\"" + ext + "\"))" - print "\t{" - for fn in fnlist: - print "\t\t" + fn[0] + " = reinterpret_cast<" + fn[1] + ">(bglGetProcAddress((const GLubyte *) \"" + fn[0] + "\"));" - errcheck = "" - for fn in fnlist: - if (errcheck == ""): - errcheck = fn[0] - else: - errcheck = errcheck + " && " + fn[0] - print "\t\tif (" + errcheck + ") {" - print "\t\t\tEnableExtension(_" + ext + ");" - print "\t\t\tif (doDebugMessages)" - print "\t\t\t\tstd::cout << \"Enabled " + ext + "\" << std::endl;" - print "\t\t} else {" - print "\t\t\tstd::cout << \"ERROR: " + ext + " implementation is broken!\" << std::endl;" - print "\t\t}" - print "\t}" - print "#endif" - print - -""" -Example Output: -#if defined(GL_EXT_compiled_vertex_array) -PFNGLLOCKARRAYSEXTPROC glLockArraysEXT; -PFNGLUNLOCKARRAYSEXTPROC glUnlockArraysEXT; -#endif -""" -def writeproto(ext, fnlist): - if (find(blacklist, ext) or not find(whitelist, ext)): - return - print "#if defined(" + ext + ")" - for fn in fnlist: - print fn[1] + " " + fn[0] + ";" - print "#endif" - print - -""" -#ifdef GL_EXT_compiled_vertex_array -extern PFNGLLOCKARRAYSEXTPROC glLockArraysEXT; -extern PFNGLUNLOCKARRAYSEXTPROC glUnlockArraysEXT; -#endif -""" -def writeheader(ext, fnlisti): - if (find(blacklist, ext) or not find(whitelist, ext)): - return - print "#if defined(" + ext + ")" - for fn in fnlist: - print "extern " + fn[1] + " " + fn[0] + ";" - print "#endif" - print - -def find(l, x): - for i in l: - if (i == x): - return 1 - return 0 - - -# Write Prototypes -ext = "" -fns = [] -fnlist = [] -ifdef = 0 -for i in glext_h: - line = re.search('^#ifn?def', i) - if (line): - ifdef = ifdef + 1 - - line = re.search('^#ifndef (GL_.*)', i) - if (line): - if (not re.search('GL_VERSION.*', line.group(1)) and find(whitelist, line.group(1))): - ext = line.group(1) - - line = re.search('^#endif', i) - if (line): - ifdef = ifdef - 1 - if (ifdef == 0 and ext != ""): - writeproto(ext, fnlist) - ext = "" - fns = [] - fnlist = [] - if (ext != ""): - line = re.search('.* (gl.*) \(.*\);', i) - if (line): - fns += [line.group(1)] - line = re.search('.*PFN(.*)PROC.*', i) - if (line): - for j in fns: - if (string.lower(line.group(1)) == string.lower(j)): - fnlist += [(j, "PFN" + line.group(1) + "PROC")] - -# Write link code -ext = "" -fns = [] -fnlist = [] -ifdef = 0 -for i in glext_h: - line = re.search('^#ifn?def', i) - if (line): - ifdef = ifdef + 1 - - line = re.search('^#ifndef (GL_.*)', i) - if (line): - if (not re.search('GL_VERSION.*', line.group(1)) and find(whitelist, line.group(1))): - ext = line.group(1) - - line = re.search('^#endif', i) - if (line): - ifdef = ifdef - 1 - if (ifdef == 0 and ext != ""): - writeext(ext, fnlist) - ext = "" - fns = [] - fnlist = [] - if (ext != ""): - line = re.search('.* (gl.*) \(.*\);', i) - if (line): - fns += [line.group(1)] - line = re.search('.*PFN(.*)PROC.*', i) - if (line): - for j in fns: - if (string.lower(line.group(1)) == string.lower(j)): - fnlist += [(j, "PFN" + line.group(1) + "PROC")] - -# Write header code -ext = "" -fns = [] -fnlist = [] -ifdef = 0 -for i in glext_h: - line = re.search('^#ifn?def', i) - if (line): - ifdef = ifdef + 1 - - line = re.search('^#ifndef (GL_.*)', i) - if (line): - if (not re.search('GL_VERSION.*', line.group(1)) and find(whitelist, line.group(1))): - ext = line.group(1) - - line = re.search('^#endif', i) - if (line): - ifdef = ifdef - 1 - if (ifdef == 0 and ext != ""): - writeheader(ext, fnlist) - ext = "" - fns = [] - fnlist = [] - if (ext != ""): - line = re.search('.* (gl.*) \(.*\);', i) - if (line): - fns += [line.group(1)] - line = re.search('.*PFN(.*)PROC.*', i) - if (line): - for j in fns: - if (string.lower(line.group(1)) == string.lower(j)): - fnlist += [(j, "PFN" + line.group(1) + "PROC")] - -# Write Python link code -ext = "" -extensions = [] -fns = [] -defines = [] -ifdef = 0 -for i in glext_h: - line = re.search('^#ifn?def', i) - if (line): - ifdef = ifdef + 1 - - line = re.search('^#ifndef (GL_.*)', i) - if (line): - if (not re.search('GL_VERSION.*', line.group(1)) and find(whitelist, line.group(1))): - ext = line.group(1) - - line = re.search('^#endif', i) - if (line): - ifdef = ifdef - 1 - if (ifdef == 0 and ext != ""): - done = 0 - for e in range(len(extensions)): - if extensions[e][0] == ext: - extensions[e] = (ext, defines + extensions[e][1], fns + extensions[e][2]) - done = 1 - if not done: - extensions = extensions + [(ext, defines, fns)] - ext = "" - fns = [] - defines = [] - if (ext != ""): - line = re.search('#define +(GL.*) +(0x.*)', i) # #define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 - if (line): - defines += [(line.group(1), line.group(2))] - - line = re.search('(.* )(gl.*)(\(.*\));', i) # GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat); - if (line): - fns += [(line.group(1), line.group(2), line.group(3))] - -for ext in extensions: - if (find(blacklist, ext[0]) or not find(whitelist, ext[0])): - continue - print "#if defined(" + ext[0] + ")" - for fn in ext[2]: - line = re.search('gl(.*)', fn[1]) - # BGL_Wrap(2, RasterPos2f, void, (GLfloat, GLfloat)) - rtype = "" - for r in string.split(fn[0]): - if r != "GLAPI" and r != "APIENTRY": - rtype = rtype + " " + r - params = "" - for p in string.split(fn[2], ','): - pline = re.search('(.*) \*', p) - if (pline): - p = pline.group(1) + "P" - if params == "": - params = p - else: - params = params + "," + p - if not params[-1] == ")": - params = params + ")" - print "BGL_Wrap(" + str(len(string.split(fn[2], ','))) + ", " + line.group(1) + ",\t" + rtype + ",\t" + params + ")" - print "#endif" - print - -for ext in extensions: - if (find(blacklist, ext[0]) or not find(whitelist, ext[0])): - continue - print 'PyDict_SetItemString(dict, "' + ext[0] + '", PyInt_FromLong(_' + ext[0] + '))' - print "#if defined(" + ext[0] + ")" - print "if (bglQueryExtension(_" + ext[0] + ")) {" - if len(ext[2]) > 0: - for fn in ext[2]: - line = re.search('gl(.*)', fn[1]) - # MethodDef(Vertex3iv), - print " BGL_AddMethod(" + line.group(1) + ");" - print - - for define in ext[1]: - print " BGL_AddConst(" + define[0] + ");" - print - - print "}" - print "#endif" - print diff --git a/source/gameengine/Rasterizer/SConscript b/source/gameengine/Rasterizer/SConscript index ff79a5d97b8..f077833b850 100644 --- a/source/gameengine/Rasterizer/SConscript +++ b/source/gameengine/Rasterizer/SConscript @@ -7,7 +7,7 @@ if env['WITH_BF_GLEXT'] == 1: env['CPPFLAGS'].append('-DWITH_GLEXT') -incs = '. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/BlenderRoutines' +incs = '. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/BlenderRoutines #extern/glew/include' if env['OURPLATFORM']=='win32-vc': cflags = [] diff --git a/source/gameengine/SceneGraph/SG_Node.cpp b/source/gameengine/SceneGraph/SG_Node.cpp index ff9a9f7f371..4e90d7c4653 100644 --- a/source/gameengine/SceneGraph/SG_Node.cpp +++ b/source/gameengine/SceneGraph/SG_Node.cpp @@ -159,6 +159,17 @@ IsVertexParent() return false; } + bool +SG_Node:: +IsSlowParent() +{ + if (m_parent_relation) + { + return m_parent_relation->IsSlowRelation(); + } + return false; +} + void SG_Node:: DisconnectFromParent( diff --git a/source/gameengine/SceneGraph/SG_Node.h b/source/gameengine/SceneGraph/SG_Node.h index 5cf24de68f3..f86e3046d93 100644 --- a/source/gameengine/SceneGraph/SG_Node.h +++ b/source/gameengine/SceneGraph/SG_Node.h @@ -159,6 +159,14 @@ public: bool IsVertexParent( ) ; + + /** + * Return slow parent status. + */ + + bool + IsSlowParent( + ) ; /** * Update the spatial data of this node. Iterate through diff --git a/source/gameengine/SceneGraph/SG_ParentRelation.h b/source/gameengine/SceneGraph/SG_ParentRelation.h index 9d360d1c274..6507cb98519 100644 --- a/source/gameengine/SceneGraph/SG_ParentRelation.h +++ b/source/gameengine/SceneGraph/SG_ParentRelation.h @@ -99,6 +99,16 @@ public : ) { return false; } + + /** + * Need this to see if we are able to adjust time-offset from the python api + */ + virtual + bool + IsSlowRelation( + ) { + return false; + } protected : /** diff --git a/source/gameengine/SceneGraph/SG_Spatial.cpp b/source/gameengine/SceneGraph/SG_Spatial.cpp index 18049592977..5ba116e59db 100644 --- a/source/gameengine/SceneGraph/SG_Spatial.cpp +++ b/source/gameengine/SceneGraph/SG_Spatial.cpp @@ -87,6 +87,13 @@ SG_Spatial:: delete (m_parent_relation); } + SG_ParentRelation * +SG_Spatial:: +GetParentRelation( +){ + return m_parent_relation; +} + void SG_Spatial:: SetParentRelation( diff --git a/source/gameengine/SceneGraph/SG_Spatial.h b/source/gameengine/SceneGraph/SG_Spatial.h index a70784472a7..28848b0f933 100644 --- a/source/gameengine/SceneGraph/SG_Spatial.h +++ b/source/gameengine/SceneGraph/SG_Spatial.h @@ -83,6 +83,10 @@ public: SetParentRelation( SG_ParentRelation *relation ); + + SG_ParentRelation * + GetParentRelation( + ); /** diff --git a/source/nan_definitions.mk b/source/nan_definitions.mk index e19d10dba64..9c1a28de999 100644 --- a/source/nan_definitions.mk +++ b/source/nan_definitions.mk @@ -98,6 +98,7 @@ endif export NAN_OPENNL ?= $(LCGDIR)/opennl export NAN_ELBEEM ?= $(LCGDIR)/elbeem export NAN_SUPERLU ?= $(LCGDIR)/superlu + export NAN_GLEW ?= $(LCGDIR)/glew ifeq ($(FREE_WINDOWS), true) export NAN_FTGL ?= $(LCGDIR)/gcc/ftgl export NAN_FFMPEG ?= $(LCGDIR)/gcc/ffmpeg From e426c7ce2969d0f73dee09e3972a1e43d5858c63 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Mon, 23 Jun 2008 14:12:22 +0000 Subject: [PATCH 27/76] Added shrinkwrapModifier_isDisabled api function --- source/blender/blenkernel/intern/modifier.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index e64064d01c2..e2f4a781ecf 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -7234,6 +7234,13 @@ CustomDataMask shrinkwrapModifier_requiredDataMask(ModifierData *md) return dataMask; } +static int shrinkwrapModifier_isDisabled(ModifierData *md) +{ + ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; + return !smd->target; +} + + static void shrinkwrapModifier_foreachObjectLink(ModifierData *md, Object *ob, ObjectWalkFunc walk, void *userData) { ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; @@ -7593,6 +7600,7 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type) mti->initData = shrinkwrapModifier_initData; mti->copyData = shrinkwrapModifier_copyData; mti->requiredDataMask = shrinkwrapModifier_requiredDataMask; + mti->isDisabled = shrinkwrapModifier_isDisabled; mti->foreachObjectLink = shrinkwrapModifier_foreachObjectLink; mti->applyModifier = shrinkwrapModifier_applyModifier; mti->applyModifierEM = shrinkwrapModifier_applyModifierEM; From 0f8697b9d29300ac3ee143db99f2dd91163a3b30 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Mon, 23 Jun 2008 15:48:03 +0000 Subject: [PATCH 28/76] Fixed bug.. on shrinkwrap_copyModifier --- source/blender/blenkernel/intern/modifier.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index e2f4a781ecf..cf9df7f6f73 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -7220,7 +7220,9 @@ static void shrinkwrapModifier_initData(ModifierData *md) static void shrinkwrapModifier_copyData(ModifierData *md, ModifierData *target) { - memcpy(target, md, sizeof(MeshDeformModifierData)); + char *dest = (char*)target; + char *src = (char*)md; + memcpy(dest + sizeof( ModifierData ), src + sizeof(ModifierData), sizeof(ShrinkwrapModifierData) - sizeof(ModifierData) ); } CustomDataMask shrinkwrapModifier_requiredDataMask(ModifierData *md) From ac898d39caedf1dc4ff49432f320e7e99afe40ca Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Mon, 23 Jun 2008 16:23:26 +0000 Subject: [PATCH 29/76] Changed the style on shrinkwrapModifier_copyData. Genscher made me do it the same way that the other 10 modifiers do. The reason why I initially choosed memcpy was so that if anyone added parameters on DNA there would be no need to update _copyData, unless if it was a feature related to memory (eg.: point cache) --- source/blender/blenkernel/intern/modifier.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index cf9df7f6f73..c5d98dd9655 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -7220,9 +7220,16 @@ static void shrinkwrapModifier_initData(ModifierData *md) static void shrinkwrapModifier_copyData(ModifierData *md, ModifierData *target) { - char *dest = (char*)target; - char *src = (char*)md; - memcpy(dest + sizeof( ModifierData ), src + sizeof(ModifierData), sizeof(ShrinkwrapModifierData) - sizeof(ModifierData) ); + ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*)md; + ShrinkwrapModifierData *tsmd = (ShrinkwrapModifierData*)target; + + tsmd->target = smd->target; + tsmd->cutPlane = smd->cutPlane; + strcpy(tsmd->vgroup_name, smd->vgroup_name); + tsmd->keptDist = smd->keptDist; + tsmd->mergeDist = smd->mergeDist; + tsmd->shrinkType = smd->shrinkType; + tsmd->shrinkOpts = smd->shrinkOpts; } CustomDataMask shrinkwrapModifier_requiredDataMask(ModifierData *md) From 9629f7ca119fe1ea0c9549be126466e4c6880bb1 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Tue, 24 Jun 2008 12:04:27 +0000 Subject: [PATCH 30/76] Adding initial SimpleModifier (bend,taper,twist) (I might only touch this code again late on the week :S, so here is a tmp commit) --- source/blender/blenkernel/BKE_simple_deform.h | 40 ++++++ source/blender/blenkernel/intern/modifier.c | 57 +++++++++ .../blender/blenkernel/intern/simple_deform.c | 118 ++++++++++++++++++ source/blender/makesdna/DNA_modifier_types.h | 11 ++ source/blender/src/buttons_editing.c | 10 ++ 5 files changed, 236 insertions(+) create mode 100644 source/blender/blenkernel/BKE_simple_deform.h create mode 100644 source/blender/blenkernel/intern/simple_deform.c diff --git a/source/blender/blenkernel/BKE_simple_deform.h b/source/blender/blenkernel/BKE_simple_deform.h new file mode 100644 index 00000000000..b2737a2708f --- /dev/null +++ b/source/blender/blenkernel/BKE_simple_deform.h @@ -0,0 +1,40 @@ +/** + * BKE_shrinkwrap.h + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ +#ifndef BKE_SIMPLE_DEFORM_H +#define BKE_SIMPLE_DEFORM_H + +struct Object; +struct DerivedMesh; +struct SimpleDeformModifierData; + +/* struct DerivedMesh *simpledeformModifier_do(struct SimpleDeformModifierData *smd, struct Object *ob, struct DerivedMesh *dm, int useRenderParams, int isFinalCalc); */ +void SimpleDeformModifier_do(SimpleDeformModifierData *smd, float (*vertexCos)[3], int numVerts); + +#endif + diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index c5d98dd9655..4266b559030 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -7279,6 +7279,50 @@ static void shrinkwrapModifier_updateDepgraph(ModifierData *md, DagForest *fores dag_add_relation(forest, dag_get_node(forest, smd->cutPlane), obNode, DAG_RL_OB_DATA | DAG_RL_DATA_DATA, "Shrinkwrap Modifier"); } +/* SimpleDeform */ +static void simpledeformModifier_initData(ModifierData *md) +{ + SimpleDeformModifierData *smd = (SimpleDeformModifierData*) md; + + smd->mode = 0; + smd->origin = 0; + smd->factor[0] = 1.0; +} + +static void simpledeformModifier_copyData(ModifierData *md, ModifierData *target) +{ + SimpleDeformModifierData *smd = (SimpleDeformModifierData*)md; + SimpleDeformModifierData *tsmd = (SimpleDeformModifierData*)target; + + tsmd->mode = smd->mode; + tsmd->origin= smd->origin; + memcpy(tsmd->factor, smd->factor, sizeof(tsmd->factor)); +} + +static void simpledeformModifier_deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) +{ + SimpleDeformModifier_do((SimpleDeformModifierData*)md, vertexCos, numVerts); +} + +static void simpledeformModifier_deformVertsEM(ModifierData *md, Object *ob, EditMesh *editData, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) +{ + SimpleDeformModifier_do((SimpleDeformModifierData*)md, vertexCos, numVerts); +} + +static void simpledeformModifier_foreachObjectLink(ModifierData *md, Object *ob, void (*walk)(void *userData, Object *ob, Object **obpoin), void *userData) +{ + SimpleDeformModifierData *smd = (SimpleDeformModifierData*)md; + walk(userData, ob, &smd->origin); +} + +static void simpledeformModifier_updateDepgraph(ModifierData *md, DagForest *forest, Object *ob, DagNode *obNode) +{ + SimpleDeformModifierData *smd = (SimpleDeformModifierData*)md; + + if (smd->origin) + dag_add_relation(forest, dag_get_node(forest, smd->origin), obNode, DAG_RL_OB_DATA, "SimpleDeform Modifier"); +} + /***/ @@ -7615,6 +7659,19 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type) mti->applyModifierEM = shrinkwrapModifier_applyModifierEM; mti->updateDepgraph = shrinkwrapModifier_updateDepgraph; + mti = INIT_TYPE(SimpleDeform); + mti->type = eModifierTypeType_OnlyDeform; + mti->flags = eModifierTypeFlag_AcceptsMesh + | eModifierTypeFlag_SupportsEditmode + | eModifierTypeFlag_EnableInEditmode; + mti->initData = simpledeformModifier_initData; + mti->copyData = simpledeformModifier_copyData; + mti->deformVerts = simpledeformModifier_deformVerts; + mti->deformVertsEM = simpledeformModifier_deformVertsEM; + mti->foreachObjectLink = simpledeformModifier_foreachObjectLink; + mti->updateDepgraph = simpledeformModifier_updateDepgraph; + + typeArrInit = 0; #undef INIT_TYPE } diff --git a/source/blender/blenkernel/intern/simple_deform.c b/source/blender/blenkernel/intern/simple_deform.c new file mode 100644 index 00000000000..e78e73afadb --- /dev/null +++ b/source/blender/blenkernel/intern/simple_deform.c @@ -0,0 +1,118 @@ +/** + * deform_simple.c + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): André Pinto + * + * ***** END GPL LICENSE BLOCK ***** + */ +#include "DNA_object_types.h" +#include "DNA_modifier_types.h" +#include "DNA_meshdata_types.h" + +#include "BKE_simple_deform.h" +#include "BKE_DerivedMesh.h" +#include "BLI_arithb.h" + +#include +#include + + +static void simpleDeform_tapper(const float factor, float *co) +{ + float x = co[0], y = co[1], z = co[2]; + + co[0] = x*(1.0f + z*factor); + co[1] = y; + co[2] = z; +} + + +static void simpleDeform_twist(const float factor, float *co) +{ + float x = co[0], y = co[1], z = co[2]; + + float theta = z*factor; + float sint = sin(theta); + float cost = cos(theta); + + co[0] = x*cost - y*sint; + co[1] = x*sint + y*cost; + co[2] = z; +} + +static void simpleDeform_bend(const float factor, float *co) +{ + float x = co[0], y = co[1], z = co[2]; + + float x0 = 0.0f; + float theta = (x - x0)*factor; + float sint = sin(theta); + float cost = cos(theta); + + co[0] = -sint*(y-1.0f/factor) + x0; + co[1] = cost*(y-1.0f/factor) + 1.0f/factor; + co[2] = z; +} + +static void simpleDeform_shear(const float factor, float *co) +{ + float x = co[0], y = co[1], z = co[2]; + + co[0] = x + factor; + co[1] = y; + co[2] = z; +} + +/* simple deform modifier */ +void SimpleDeformModifier_do(SimpleDeformModifierData *smd, float (*vertexCos)[3], int numVerts) +{ + float (*ob2mod)[4] = NULL, (*mod2ob)[4] = NULL; + if(smd->origin) + { + Mat4Invert(smd->origin->imat, smd->origin->obmat); //inverse is outdated + + ob2mod = smd->origin->imat; + mod2ob = smd->origin->obmat; + } + + + for(; numVerts; numVerts--, vertexCos++) + { + if(ob2mod) + Mat4MulVecfl(ob2mod, *vertexCos); + + switch(smd->mode) + { + case 0: simpleDeform_tapper (smd->factor[0], *vertexCos); break; + case 1: simpleDeform_twist (smd->factor[0], *vertexCos); break; + case 2: simpleDeform_bend (smd->factor[0], *vertexCos); break; + case 3: simpleDeform_shear (smd->factor[0], *vertexCos); break; + } + + if(mod2ob) + Mat4MulVecfl(mod2ob, *vertexCos); + } +} + + diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index c960a78aefa..d938979d1ec 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -36,6 +36,7 @@ typedef enum ModifierType { eModifierType_Collision, eModifierType_Bevel, eModifierType_Shrinkwrap, + eModifierType_SimpleDeform, NUM_MODIFIER_TYPES } ModifierType; @@ -518,4 +519,14 @@ typedef struct ShrinkwrapModifierData { #define MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE (1<<3) #define MOD_SHRINKWRAP_CULL_TARGET_BACKFACE (1<<4) +typedef struct SimpleDeformModifierData { + ModifierData modifier; + + struct Object *origin; /* object to control the origin of modifier space coordinates */ + float factor[4]; /* factors to control simple deforms */ + char mode; + char pad[7]; + +} SimpleDeformModifierData; + #endif diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index bdf22dfe8d8..011da0524e2 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -1831,6 +1831,8 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco height = 86; if (smd->shrinkType == MOD_SHRINKWRAP_NORMAL) height += 19*7; + } else if (md->type==eModifierType_SimpleDeform) { + height += 19*2; } /* roundbox 4 free variables: corner-rounding, nop, roundbox type, shade */ uiDefBut(block, ROUNDBOX, 0, "", x-10, y-height-2, width, height-2, NULL, 5.0, 0.0, 12, 40, ""); @@ -2474,8 +2476,16 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco uiDefIDPoinBut(block, modifier_testMeshObj, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &smd->target, "Target to shrink to"); uiDefButF(block, NUM, B_MODIFIER_RECALC, "Offset:", lx,(cy-=19),buttonWidth,19, &smd->keptDist, 0.0f, 100.0f, 1.0f, 0, "Specify distance to kept from the target"); uiBlockEndAlign(block); + } else if (md->type==eModifierType_SimpleDeform) { + SimpleDeformModifierData *smd = (SimpleDeformModifierData*) md; + char simpledeform_typemenu[]="Deform type%t|Taper %x0|Twist %x1|Bend %x2|Shear %x3"; + + uiDefButS(block, MENU, B_MODIFIER_RECALC, simpledeform_typemenu, lx,(cy-=19),buttonWidth,19, &smd->mode, 0, 0, 0, 0, "Selects type of deform"); + uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &smd->origin, "Origin of modifier space coordinates"); + uiDefButF(block, NUM, B_MODIFIER_RECALC, "Factor:", lx,(cy-=19),buttonWidth,19, &smd->factor[0], -1000.0f, 1000.0f, 1.0f, 0, "Deform Factor"); } + uiBlockEndAlign(block); y-=height; From 09c898bd65069ec75a38f6ad28ced45454d87720 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Fri, 27 Jun 2008 16:45:37 +0000 Subject: [PATCH 31/76] Modifications on simple modifier +Added limits on bend +button to create an empty and make child of object +empty is now relative to object --- source/blender/blenkernel/BKE_simple_deform.h | 3 +- source/blender/blenkernel/intern/modifier.c | 11 +-- .../blender/blenkernel/intern/simple_deform.c | 70 +++++++++++------- source/blender/makesdna/DNA_modifier_types.h | 5 ++ source/blender/src/buttons_editing.c | 72 ++++++++++++++++--- 5 files changed, 121 insertions(+), 40 deletions(-) diff --git a/source/blender/blenkernel/BKE_simple_deform.h b/source/blender/blenkernel/BKE_simple_deform.h index b2737a2708f..dd4f3786e62 100644 --- a/source/blender/blenkernel/BKE_simple_deform.h +++ b/source/blender/blenkernel/BKE_simple_deform.h @@ -33,8 +33,7 @@ struct Object; struct DerivedMesh; struct SimpleDeformModifierData; -/* struct DerivedMesh *simpledeformModifier_do(struct SimpleDeformModifierData *smd, struct Object *ob, struct DerivedMesh *dm, int useRenderParams, int isFinalCalc); */ -void SimpleDeformModifier_do(SimpleDeformModifierData *smd, float (*vertexCos)[3], int numVerts); +void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object *ob, float (*vertexCos)[3], int numVerts); #endif diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 4266b559030..561a97d8646 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -101,6 +101,7 @@ #include "depsgraph_private.h" #include "BKE_bmesh.h" #include "BKE_shrinkwrap.h" +#include "BKE_simple_deform.h" #include "LOD_DependKludge.h" #include "LOD_decimation.h" @@ -7284,9 +7285,11 @@ static void simpledeformModifier_initData(ModifierData *md) { SimpleDeformModifierData *smd = (SimpleDeformModifierData*) md; - smd->mode = 0; + smd->mode = MOD_SIMPLEDEFORM_MODE_TWIST; smd->origin = 0; - smd->factor[0] = 1.0; + smd->factor[0] = 0.35; + smd->factor[1] = -1000.0; + smd->factor[2] = 1000.0; } static void simpledeformModifier_copyData(ModifierData *md, ModifierData *target) @@ -7301,12 +7304,12 @@ static void simpledeformModifier_copyData(ModifierData *md, ModifierData *target static void simpledeformModifier_deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { - SimpleDeformModifier_do((SimpleDeformModifierData*)md, vertexCos, numVerts); + SimpleDeformModifier_do((SimpleDeformModifierData*)md, ob, vertexCos, numVerts); } static void simpledeformModifier_deformVertsEM(ModifierData *md, Object *ob, EditMesh *editData, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { - SimpleDeformModifier_do((SimpleDeformModifierData*)md, vertexCos, numVerts); + SimpleDeformModifier_do((SimpleDeformModifierData*)md, ob, vertexCos, numVerts); } static void simpledeformModifier_foreachObjectLink(ModifierData *md, Object *ob, void (*walk)(void *userData, Object *ob, Object **obpoin), void *userData) diff --git a/source/blender/blenkernel/intern/simple_deform.c b/source/blender/blenkernel/intern/simple_deform.c index e78e73afadb..5cecb553a65 100644 --- a/source/blender/blenkernel/intern/simple_deform.c +++ b/source/blender/blenkernel/intern/simple_deform.c @@ -38,7 +38,18 @@ #include -static void simpleDeform_tapper(const float factor, float *co) + + +static void simpleDeform_tapperXY(const float factor, float *co) +{ + float x = co[0], y = co[1], z = co[2]; + + co[0] = x*(1.0f + z*factor); + co[1] = y*(1.0f + z*factor); + co[2] = z; +} + +static void simpleDeform_tapperX(const float factor, float *co) { float x = co[0], y = co[1], z = co[2]; @@ -47,7 +58,6 @@ static void simpleDeform_tapper(const float factor, float *co) co[2] = z; } - static void simpleDeform_twist(const float factor, float *co) { float x = co[0], y = co[1], z = co[2]; @@ -59,41 +69,51 @@ static void simpleDeform_twist(const float factor, float *co) co[0] = x*cost - y*sint; co[1] = x*sint + y*cost; co[2] = z; + } -static void simpleDeform_bend(const float factor, float *co) +static void simpleDeform_bend(const float factor, const float axis_limit[2], float *co) { float x = co[0], y = co[1], z = co[2]; float x0 = 0.0f; - float theta = (x - x0)*factor; - float sint = sin(theta); - float cost = cos(theta); + float theta = x*factor, sint, cost; - co[0] = -sint*(y-1.0f/factor) + x0; - co[1] = cost*(y-1.0f/factor) + 1.0f/factor; + if(x > axis_limit[1]) + { + x0 = axis_limit[1] - x; + x = axis_limit[1]; + } + else if(x < axis_limit[0]) + { + x0 = axis_limit[0] - x; + x = axis_limit[0]; + } + + theta = x*factor; + sint = sin(theta); + cost = cos(theta); + + co[0] = -y*sint - cost*x0; + co[1] = y*cost - sint*x0; co[2] = z; } -static void simpleDeform_shear(const float factor, float *co) -{ - float x = co[0], y = co[1], z = co[2]; - - co[0] = x + factor; - co[1] = y; - co[2] = z; -} - /* simple deform modifier */ -void SimpleDeformModifier_do(SimpleDeformModifierData *smd, float (*vertexCos)[3], int numVerts) +void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object *ob, float (*vertexCos)[3], int numVerts) { float (*ob2mod)[4] = NULL, (*mod2ob)[4] = NULL; + float tmp[2][4][4]; + if(smd->origin) { - Mat4Invert(smd->origin->imat, smd->origin->obmat); //inverse is outdated + //inverse is outdated + Mat4Invert(smd->origin->imat, smd->origin->obmat); - ob2mod = smd->origin->imat; - mod2ob = smd->origin->obmat; + ob2mod = tmp[0]; + mod2ob = tmp[1]; + Mat4MulSerie(ob2mod, smd->origin->imat, ob->obmat, 0, 0, 0, 0, 0, 0); + Mat4Invert(mod2ob, ob2mod); } @@ -104,10 +124,10 @@ void SimpleDeformModifier_do(SimpleDeformModifierData *smd, float (*vertexCos)[3 switch(smd->mode) { - case 0: simpleDeform_tapper (smd->factor[0], *vertexCos); break; - case 1: simpleDeform_twist (smd->factor[0], *vertexCos); break; - case 2: simpleDeform_bend (smd->factor[0], *vertexCos); break; - case 3: simpleDeform_shear (smd->factor[0], *vertexCos); break; + case MOD_SIMPLEDEFORM_MODE_TWIST: simpleDeform_twist(smd->factor[0], *vertexCos); break; + case MOD_SIMPLEDEFORM_MODE_BEND: simpleDeform_bend(smd->factor[0], smd->factor+1, *vertexCos); break; + case MOD_SIMPLEDEFORM_MODE_TAPER_X: simpleDeform_tapperX (smd->factor[0], *vertexCos); break; + case MOD_SIMPLEDEFORM_MODE_TAPER_XY: simpleDeform_tapperXY(smd->factor[0], *vertexCos); break; } if(mod2ob) diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index d938979d1ec..5ee767efb83 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -529,4 +529,9 @@ typedef struct SimpleDeformModifierData { } SimpleDeformModifierData; +#define MOD_SIMPLEDEFORM_MODE_TWIST 1 +#define MOD_SIMPLEDEFORM_MODE_BEND 2 +#define MOD_SIMPLEDEFORM_MODE_TAPER_X 3 +#define MOD_SIMPLEDEFORM_MODE_TAPER_XY 4 + #endif diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 011da0524e2..a9261185f42 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -1664,6 +1664,33 @@ static int modifier_is_fluid_particles(ModifierData *md) { } return 0; } + +static void modifier_link_new_empty(void *pp_empty, void *p_parent) +{ + Object **empty = (Object**)pp_empty; + Object *parent = (Object*) p_parent; + + /* Add object but witouth chaing layers and or changing active object */ + Base *base= BASACT, *newbase; + + (*empty) = add_object(OB_EMPTY); + + newbase= BASACT; + newbase->lay= base->lay; + (*empty)->lay= newbase->lay; + + /* restore, add_object sets active */ + BASACT= base; + + /* Makes parent relation and positions empty on center of object */ + (*empty)->partype= PAROBJECT; + (*empty)->parent = parent; + Mat4CpyMat4( (*empty)->obmat, parent->obmat ); + Mat4Invert( (*empty)->parentinv, parent->obmat); + apply_obmat( (*empty) ); + DAG_scene_sort(G.scene); +} + static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco, int *yco, int index, int cageIndex, int lastCageIndex) { ModifierTypeInfo *mti = modifierType_getInfo(md->type); @@ -1830,8 +1857,11 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; height = 86; if (smd->shrinkType == MOD_SHRINKWRAP_NORMAL) - height += 19*7; + height += 19*5; } else if (md->type==eModifierType_SimpleDeform) { + SimpleDeformModifierData *smd = (SimpleDeformModifierData*) md; + height += 19*3; + if(smd->mode == MOD_SIMPLEDEFORM_MODE_BEND) height += 19*2; } /* roundbox 4 free variables: corner-rounding, nop, roundbox type, shade */ @@ -2460,12 +2490,15 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco uiDefButS(block, MENU, B_MODIFIER_RECALC, shrinktypemenu, lx,(cy-=19),buttonWidth,19, &smd->shrinkType, 0, 0, 0, 0, "Selects type of shrinkwrap algorithm for target position."); if (smd->shrinkType == MOD_SHRINKWRAP_NORMAL){ - uiDefButBitS(block, TOG, MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL, B_MODIFIER_RECALC, "Default normal", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Allows vertices to move in the normal direction"); - uiDefButBitS(block, TOG, MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL, B_MODIFIER_RECALC, "Invert normal", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Allows vertices to move in the inverse direction of their normal"); + + uiDefButBitS(block, TOG, MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL, B_MODIFIER_RECALC, "Default normal", lx,(cy-=19),buttonWidth/2,19, &smd->shrinkOpts, 0, 0, 0, 0, "Allows vertices to move in the normal direction"); + uiDefButBitS(block, TOG, MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL, B_MODIFIER_RECALC, "Invert normal", lx + buttonWidth/2,cy,buttonWidth/2,19, &smd->shrinkOpts, 0, 0, 0, 0, "Allows vertices to move in the inverse direction of their normal"); + uiDefButBitS(block, TOG, MOD_SHRINKWRAP_REMOVE_UNPROJECTED_FACES, B_MODIFIER_RECALC, "Remove faces", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Remove faces where all vertices haven't been projected"); - uiDefButBitS(block, TOG, MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE, B_MODIFIER_RECALC, "Cull frontfaces", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Controls whether a vertex can be projected to a front face on target"); - uiDefButBitS(block, TOG, MOD_SHRINKWRAP_CULL_TARGET_BACKFACE, B_MODIFIER_RECALC, "Cull backfaces", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Controls whether a vertex can be projected to a back face on target"); + uiDefButBitS(block, TOG, MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE, B_MODIFIER_RECALC, "Cull frontfaces",lx,(cy-=19),buttonWidth/2,19, &smd->shrinkOpts, 0, 0, 0, 0, "Controls whether a vertex can be projected to a front face on target"); + uiDefButBitS(block, TOG, MOD_SHRINKWRAP_CULL_TARGET_BACKFACE, B_MODIFIER_RECALC, "Cull backfaces", lx+buttonWidth/2,cy,buttonWidth/2,19, &smd->shrinkOpts, 0, 0, 0, 0, "Controls whether a vertex can be projected to a back face on target"); + uiDefButF(block, NUM, B_MODIFIER_RECALC, "Merge Dist:", lx,(cy-=19),buttonWidth,19, &smd->mergeDist, 0.0f, 0.01f, 0.01f, 0.01f, "Specify merge distance"); uiDefIDPoinBut(block, modifier_testMeshObj, ID_OB, B_CHANGEDEP, "Cut: ", lx, (cy-=19), buttonWidth,19, &smd->cutPlane, "Target to project points that didn't got projected over target"); } @@ -2478,11 +2511,32 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco uiBlockEndAlign(block); } else if (md->type==eModifierType_SimpleDeform) { SimpleDeformModifierData *smd = (SimpleDeformModifierData*) md; - char simpledeform_typemenu[]="Deform type%t|Taper %x0|Twist %x1|Bend %x2|Shear %x3"; + char simpledeform_typemenu[]="Deform type%t|Twist %x1|Bend %x2|Taper %x3|TaperXY %x4"; - uiDefButS(block, MENU, B_MODIFIER_RECALC, simpledeform_typemenu, lx,(cy-=19),buttonWidth,19, &smd->mode, 0, 0, 0, 0, "Selects type of deform"); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &smd->origin, "Origin of modifier space coordinates"); - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Factor:", lx,(cy-=19),buttonWidth,19, &smd->factor[0], -1000.0f, 1000.0f, 1.0f, 0, "Deform Factor"); + uiDefButC(block, MENU, B_MODIFIER_RECALC, simpledeform_typemenu, lx,(cy-=19),buttonWidth,19, &smd->mode, 0, 0, 0, 0, "Selects type of deform"); + + + uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth-17,19, &smd->origin, "Origin of modifier space coordinates"); + + if(smd->origin) + { + uiDefIconButBitS(block, ICONTOG, OB_RESTRICT_VIEW, REDRAWALL, ICON_RESTRICT_VIEW_OFF, + lx + buttonWidth-17, cy, 17, 19, + &(smd->origin->restrictflag), 0, 0, 0, 0, "Restrict/Allow visibility in the 3D View"); + } + else + { + uiBut *bt; + bt= uiDefIconBut(block, BUT, B_CHANGEDEP, ICON_ZOOMIN, lx+buttonWidth-17, cy, 17, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Creates a new empty"); + uiButSetFunc(bt, modifier_link_new_empty, &smd->origin, ob); + } + uiDefButF(block, NUM, B_MODIFIER_RECALC, "Factor:", lx,(cy-=19),buttonWidth,19, &smd->factor[0], -3000.0f, 3000.0f, 1.0f, 0, "Deform Factor"); + + if(smd->mode == MOD_SIMPLEDEFORM_MODE_BEND) + { + uiDefButF(block, NUM, B_MODIFIER_RECALC, "Upper Limit:", lx,(cy-=19),buttonWidth,19, &smd->factor[2], -3000.0f, 3000.0f, 1.0f, 0, "Upper Limit Bend on X"); + uiDefButF(block, NUM, B_MODIFIER_RECALC, "Lower Limit:", lx,(cy-=19),buttonWidth,19, &smd->factor[1], -3000.0f, 3000.0f, 1.0f, 0, "Lower Limit Bend on X"); + } } From c7dbc6548811f37bfeda4013ab70e342d50707b7 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Mon, 30 Jun 2008 22:57:52 +0000 Subject: [PATCH 32/76] svn merge -r 15292:15392 https://svn.blender.org/svnroot/bf-blender/trunk/blender --- extern/libredcode/debayer.c | 24 +- intern/iksolver/intern/IK_QTask.h | 2 +- intern/moto/include/MT_random.h | 6 +- intern/moto/intern/MT_random.cpp | 10 +- .../gameengine/gamelogic/SCA_GameLogic.vcproj | 24 + .../gameengine/ketsji/KX_ketsji.vcproj | 12 + release/scripts/DirectX8Exporter.py | 34 +- release/scripts/animation_bake_constraints.py | 800 +++++++++++ release/scripts/bpymodules/BPyArmature.py | 75 +- release/scripts/c3d_import.py | 1237 +++++++++++++++++ source/blender/blenkernel/BKE_ipo.h | 8 + source/blender/blenkernel/intern/action.c | 2 +- source/blender/blenkernel/intern/image.c | 4 +- source/blender/blenkernel/intern/ipo.c | 2 +- source/blender/blenkernel/intern/modifier.c | 74 +- .../blenkernel/intern/particle_system.c | 1 + source/blender/blenkernel/intern/sca.c | 3 + source/blender/blenkernel/intern/text.c | 3 +- source/blender/blenlib/BLI_arithb.h | 1 + source/blender/blenlib/intern/arithb.c | 68 + source/blender/blenloader/intern/readfile.c | 12 + source/blender/blenloader/intern/writefile.c | 3 + source/blender/imbuf/IMB_imbuf_types.h | 1 + source/blender/imbuf/intern/IMB_anim.h | 3 +- source/blender/imbuf/intern/anim.c | 88 +- source/blender/include/BIF_butspace.h | 2 + source/blender/include/BIF_interface.h | 1 + source/blender/include/BIF_oops.h | 2 + source/blender/include/butspace.h | 4 + source/blender/include/transform.h | 6 +- source/blender/makesdna/DNA_actuator_types.h | 30 +- .../blender/makesdna/DNA_controller_types.h | 7 +- source/blender/makesdna/DNA_object_types.h | 6 +- source/blender/makesdna/DNA_sensor_types.h | 3 +- source/blender/makesdna/DNA_userdef_types.h | 2 +- .../blender/nodes/intern/CMP_nodes/CMP_math.c | 2 +- source/blender/python/api2_2x/CurNurb.c | 34 + source/blender/python/api2_2x/Lamp.c | 13 +- source/blender/python/api2_2x/Mathutils.c | 62 +- source/blender/python/api2_2x/doc/Curve.py | 2 + .../blender/render/intern/source/pipeline.c | 6 +- source/blender/src/buttons_editing.c | 2 +- source/blender/src/buttons_logic.c | 710 +++++++--- source/blender/src/buttons_scene.c | 2 +- source/blender/src/drawaction.c | 11 +- source/blender/src/drawview.c | 3 +- source/blender/src/editaction.c | 13 +- source/blender/src/editfont.c | 4 +- source/blender/src/editmesh_mods.c | 4 +- source/blender/src/editobject.c | 2 +- source/blender/src/editseq.c | 3 +- source/blender/src/editsima.c | 6 +- source/blender/src/interface.c | 4 + source/blender/src/oops.c | 1 - source/blender/src/poseobject.c | 4 +- source/blender/src/sequence.c | 14 +- source/blender/src/space.c | 24 +- source/blender/src/transform.c | 8 +- source/blender/src/transform_constraints.c | 19 +- source/blender/src/transform_generics.c | 9 +- source/blender/src/transform_snap.c | 571 ++++---- source/blender/src/view.c | 36 +- source/creator/creator.c | 4 +- .../BlenderRoutines/BL_KetsjiEmbedStart.cpp | 34 +- .../BlenderRoutines/KX_BlenderRenderTools.cpp | 4 +- .../BlenderRoutines/KX_BlenderRenderTools.h | 2 +- .../Converter/BL_ActionActuator.cpp | 49 + .../gameengine/Converter/BL_ActionActuator.h | 7 +- .../Converter/BL_BlenderDataConversion.cpp | 10 + .../gameengine/Converter/BL_ShapeDeformer.cpp | 47 + .../gameengine/Converter/BL_ShapeDeformer.h | 9 + .../gameengine/Converter/BL_SkinDeformer.cpp | 5 +- source/gameengine/Converter/BL_SkinDeformer.h | 8 + .../Converter/KX_ConvertActuators.cpp | 33 +- .../Converter/KX_ConvertControllers.cpp | 29 + .../Converter/KX_ConvertSensors.cpp | 5 +- source/gameengine/Expressions/Value.cpp | 24 +- source/gameengine/Expressions/Value.h | 2 + .../GameLogic/SCA_2DFilterActuator.cpp | 4 +- .../GameLogic/SCA_2DFilterActuator.h | 2 + .../gameengine/GameLogic/SCA_AlwaysSensor.cpp | 7 +- .../gameengine/GameLogic/SCA_AlwaysSensor.h | 2 + source/gameengine/GameLogic/SCA_IActuator.cpp | 10 + source/gameengine/GameLogic/SCA_IActuator.h | 7 + .../gameengine/GameLogic/SCA_IController.cpp | 97 +- source/gameengine/GameLogic/SCA_IController.h | 4 + source/gameengine/GameLogic/SCA_IObject.cpp | 13 +- source/gameengine/GameLogic/SCA_IObject.h | 19 +- source/gameengine/GameLogic/SCA_ISensor.cpp | 57 +- source/gameengine/GameLogic/SCA_ISensor.h | 17 + .../GameLogic/SCA_JoystickSensor.cpp | 6 +- .../gameengine/GameLogic/SCA_JoystickSensor.h | 1 + .../GameLogic/SCA_KeyboardSensor.cpp | 33 +- .../gameengine/GameLogic/SCA_KeyboardSensor.h | 2 + .../gameengine/GameLogic/SCA_LogicManager.cpp | 20 +- .../gameengine/GameLogic/SCA_MouseSensor.cpp | 15 +- source/gameengine/GameLogic/SCA_MouseSensor.h | 2 +- .../GameLogic/SCA_NANDController.cpp | 144 ++ .../gameengine/GameLogic/SCA_NANDController.h | 56 + .../GameLogic/SCA_NORController.cpp | 144 ++ .../gameengine/GameLogic/SCA_NORController.h | 56 + .../GameLogic/SCA_PropertySensor.cpp | 8 +- .../gameengine/GameLogic/SCA_PropertySensor.h | 1 + .../GameLogic/SCA_PythonController.cpp | 9 + .../GameLogic/SCA_PythonController.h | 1 + .../gameengine/GameLogic/SCA_RandomSensor.cpp | 16 +- .../gameengine/GameLogic/SCA_RandomSensor.h | 1 + .../GameLogic/SCA_XNORController.cpp | 148 ++ .../gameengine/GameLogic/SCA_XNORController.h | 56 + .../GameLogic/SCA_XORController.cpp | 148 ++ .../gameengine/GameLogic/SCA_XORController.h | 56 + .../GamePlayer/common/GPC_RenderTools.cpp | 4 +- .../GamePlayer/common/GPC_RenderTools.h | 2 +- .../GamePlayer/ghost/GPG_Application.cpp | 12 +- .../gameengine/GamePlayer/ghost/GPG_ghost.cpp | 3 +- .../KXNetwork/KX_NetworkMessageSensor.cpp | 7 +- .../KXNetwork/KX_NetworkMessageSensor.h | 1 + .../Ketsji/KX_BulletPhysicsController.cpp | 7 + .../Ketsji/KX_BulletPhysicsController.h | 1 + source/gameengine/Ketsji/KX_GameObject.cpp | 109 +- source/gameengine/Ketsji/KX_GameObject.h | 44 +- .../gameengine/Ketsji/KX_IPhysicsController.h | 1 + .../gameengine/Ketsji/KX_MouseFocusSensor.cpp | 13 +- .../gameengine/Ketsji/KX_MouseFocusSensor.h | 1 + .../gameengine/Ketsji/KX_ObjectActuator.cpp | 131 +- source/gameengine/Ketsji/KX_ObjectActuator.h | 36 +- source/gameengine/Ketsji/KX_RadarSensor.cpp | 1 - source/gameengine/Ketsji/KX_RaySensor.cpp | 14 +- source/gameengine/Ketsji/KX_RaySensor.h | 1 + .../Ketsji/KX_SCA_DynamicActuator.cpp | 206 +++ .../Ketsji/KX_SCA_DynamicActuator.h | 76 + source/gameengine/Ketsji/KX_Scene.cpp | 3 +- source/gameengine/Ketsji/KX_StateActuator.cpp | 207 +++ source/gameengine/Ketsji/KX_StateActuator.h | 83 ++ .../Ketsji/KX_SumoPhysicsController.h | 2 + source/gameengine/Ketsji/KX_TouchSensor.cpp | 14 +- source/gameengine/Ketsji/KX_TouchSensor.h | 1 + source/gameengine/PyDoc/KX_GameObject.py | 38 +- .../gameengine/PyDoc/SCA_PythonController.py | 8 + .../Rasterizer/RAS_2DFilterManager.cpp | 101 +- .../Rasterizer/RAS_2DFilterManager.h | 10 +- .../gameengine/Rasterizer/RAS_IRenderTools.h | 2 +- .../RAS_OpenGLRasterizer.cpp | 3 + .../RAS_VAOpenGLRasterizer.cpp | 5 +- 144 files changed, 5841 insertions(+), 869 deletions(-) create mode 100644 release/scripts/animation_bake_constraints.py create mode 100644 release/scripts/c3d_import.py create mode 100644 source/gameengine/GameLogic/SCA_NANDController.cpp create mode 100644 source/gameengine/GameLogic/SCA_NANDController.h create mode 100644 source/gameengine/GameLogic/SCA_NORController.cpp create mode 100644 source/gameengine/GameLogic/SCA_NORController.h create mode 100644 source/gameengine/GameLogic/SCA_XNORController.cpp create mode 100644 source/gameengine/GameLogic/SCA_XNORController.h create mode 100644 source/gameengine/GameLogic/SCA_XORController.cpp create mode 100644 source/gameengine/GameLogic/SCA_XORController.h create mode 100644 source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp create mode 100644 source/gameengine/Ketsji/KX_SCA_DynamicActuator.h create mode 100644 source/gameengine/Ketsji/KX_StateActuator.cpp create mode 100644 source/gameengine/Ketsji/KX_StateActuator.h diff --git a/extern/libredcode/debayer.c b/extern/libredcode/debayer.c index f7f22e1cc54..de7bec510cb 100644 --- a/extern/libredcode/debayer.c +++ b/extern/libredcode/debayer.c @@ -9,8 +9,6 @@ void redcode_ycbcr2rgb_fullscale( int x,y; int pix_max = 4096; int mask = pix_max - 1; - float Kb = 0.0722; - float Kr = 0.2126; float *o; for (y = 0; y < height; y++) { @@ -25,9 +23,9 @@ void redcode_ycbcr2rgb_fullscale( float y2 = (planes[3][i] & mask); float y2p = (planes[3][i_p] & mask); - float b_ = cb * (1.0 - Kb)/(pix_max/2); - float r_ = cr * (1.0 - Kr)/(pix_max/2); - float g_ = (- Kr * r_ - Kb * b_)/(1.0 - Kr - Kb); + float b_ = cb /(pix_max/2); + float r_ = cr /(pix_max/2); + float g_ = 0.0; float y_[4] = {y1 / pix_max, (y2 + y2p)/2 / pix_max, @@ -68,8 +66,6 @@ void redcode_ycbcr2rgb_halfscale( int x,y; int pix_max = 4096; int mask = pix_max - 1; - float Kb = 0.0722; - float Kr = 0.2126; for (y = 0; y < height; y++) { float *o = out + width * (height - y - 1); @@ -80,9 +76,9 @@ void redcode_ycbcr2rgb_halfscale( float cr = (planes[2][i] & mask) - pix_max/2; float y2 = (planes[3][i] & mask); - float b_ = cb * (1.0 - Kb)/(pix_max/2); - float r_ = cr * (1.0 - Kr)/(pix_max/2); - float g_ = (- Kr * r_ - Kb * b_)/(1.0 - Kr - Kb); + float b_ = cb /(pix_max/2); + float r_ = cr /(pix_max/2); + float g_ = 0.0; float y = (y1 + y2)/2 / pix_max; @@ -101,8 +97,6 @@ void redcode_ycbcr2rgb_quarterscale( int x,y; int pix_max = 4096; int mask = pix_max - 1; - float Kb = 0.0722; - float Kr = 0.2126; for (y = 0; y < height; y += 2) { float *o = out + (width/2) * (height/2 - y/2 - 1); @@ -113,9 +107,9 @@ void redcode_ycbcr2rgb_quarterscale( float cr = (planes[2][i] & mask) - pix_max/2; float y2 = planes[3][i] & mask; - float b_ = cb * (1.0 - Kb)/(pix_max/2); - float r_ = cr * (1.0 - Kr)/(pix_max/2); - float g_ = (- Kr * r_ - Kb * b_)/(1.0 - Kr - Kb); + float b_ = cb /(pix_max/2); + float r_ = cr /(pix_max/2); + float g_ = 0.0; float y = (y1 + y2)/2 / pix_max; diff --git a/intern/iksolver/intern/IK_QTask.h b/intern/iksolver/intern/IK_QTask.h index c291a0e7e50..4d469d737f8 100644 --- a/intern/iksolver/intern/IK_QTask.h +++ b/intern/iksolver/intern/IK_QTask.h @@ -74,7 +74,7 @@ public: virtual bool PositionTask() const { return false; } - virtual void Scale(float scale) {} + virtual void Scale(float) {} protected: int m_id; diff --git a/intern/moto/include/MT_random.h b/intern/moto/include/MT_random.h index d7da546cf03..3afe1dd1662 100644 --- a/intern/moto/include/MT_random.h +++ b/intern/moto/include/MT_random.h @@ -31,10 +31,10 @@ #include -#define MT_RAND_MAX ULONG_MAX +#define MT_RAND_MAX UINT_MAX -extern void MT_srand(unsigned long); -extern unsigned long MT_rand(); +extern void MT_srand(unsigned int); +extern unsigned int MT_rand(); #endif diff --git a/intern/moto/intern/MT_random.cpp b/intern/moto/intern/MT_random.cpp index 96cb394d3da..b8302e093ca 100644 --- a/intern/moto/intern/MT_random.cpp +++ b/intern/moto/intern/MT_random.cpp @@ -76,11 +76,11 @@ #define TEMPERING_SHIFT_T(y) (y << 15) #define TEMPERING_SHIFT_L(y) (y >> 18) -static unsigned long mt[N]; /* the array for the state vector */ +static unsigned int mt[N]; /* the array for the state vector */ static int mti = N+1; /* mti==N+1 means mt[N] is not initialized */ /* initializing the array with a NONZERO seed */ -void MT_srand(unsigned long seed) +void MT_srand(unsigned int seed) { /* setting initial seeds to mt[N] using */ /* the generator Line 25 of Table 1 in */ @@ -91,12 +91,12 @@ void MT_srand(unsigned long seed) mt[mti] = (69069 * mt[mti-1]) & 0xffffffff; } -unsigned long MT_rand() +unsigned int MT_rand() { - static unsigned long mag01[2] = { 0x0, MATRIX_A }; + static unsigned int mag01[2] = { 0x0, MATRIX_A }; /* mag01[x] = x * MATRIX_A for x=0,1 */ - unsigned long y; + unsigned int y; if (mti >= N) { /* generate N words at one time */ int kk; diff --git a/projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj b/projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj index 07fcfa64a72..e0405b4d7c7 100644 --- a/projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj +++ b/projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj @@ -395,6 +395,12 @@ + + + + @@ -425,6 +431,12 @@ + + + + + + + + @@ -528,6 +546,12 @@ + + + + diff --git a/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj b/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj index c8173750bdc..9d5a9f55074 100644 --- a/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj +++ b/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj @@ -462,6 +462,9 @@ + + @@ -474,6 +477,9 @@ + + @@ -683,6 +689,9 @@ + + @@ -695,6 +704,9 @@ + + diff --git a/release/scripts/DirectX8Exporter.py b/release/scripts/DirectX8Exporter.py index 2ec42057039..01212545f77 100644 --- a/release/scripts/DirectX8Exporter.py +++ b/release/scripts/DirectX8Exporter.py @@ -6,9 +6,9 @@ # Group: 'Export' # Tooltip: 'Export to DirectX text file format format for XNA Animation Component Library.' """ -__author__ = "minahito (original:Arben (Ben) Omari)" -__url__ = ("blender", "blenderartists.org", "Adjuster's site http://sunday-lab.blogspot.com/, Author's site http://www.omariben.too.it") -__version__ = "3.0" +__author__ = "vertex color exporting feature is added by mnemoto (original:minahito (original:Arben (Ben) Omari))" +__url__ = ("blender", "elysiun", "Adjuster's site http://sunday-lab.blogspot.com/, Author's site http://www.omariben.too.it","Adjuster's site http://ex.homeunix.net/") +__version__ = "3.1" __bpydoc__ = """\ This script exports a Blender mesh with armature to DirectX 8's text file @@ -444,6 +444,7 @@ class xExport: self.writeMeshMaterialList(obj, mesh, tex) self.writeMeshNormals(obj, mesh) self.writeMeshTextureCoords(obj, mesh) + self.writeMeshVertexColors(obj, mesh) self.file.write(" } // End of the Mesh %s \n" % (obj.name)) @@ -464,6 +465,7 @@ class xExport: self.writeMeshMaterialList(obj, mesh, tex) self.writeMeshNormals(obj, mesh) self.writeMeshTextureCoords(obj, mesh) + self.writeMeshVertexColors(obj, mesh) self.file.write(" }\n") self.file.write("}\n") ind = objs.index(obj) @@ -1047,6 +1049,32 @@ template SkinWeights {\n\ self.file.write(",\n") self.file.write("} //End of MeshTextureCoords\n") + + #*********************************************** + #MESH VORTEX COLORS + #*********************************************** + def writeMeshVertexColors(self, name, mesh): + if mesh.hasVertexColours(): + self.file.write("MeshVertexColors {\n") + #VERTICES NUMBER + numvert = reduce( lambda i,f: len(f)+i, mesh.faces, 0) + self.file.write("%d;\n" % (numvert)) + #VERTEX COLORS + + vcounter =0 + for f in mesh.faces: + col = f.col + for i,c in enumerate(col): + # Note vcol alpha has no meaning + self.file.write("%d;%f;%f;%f;%f;" % (vcounter,c.r/255.0, c.g/255.0, c.b/255.0, 1.0)) # c.a/255.0)) + vcounter+=1 + if vcounter == numvert : + self.file.write(";\n") + else : + self.file.write(",\n") + + self.file.write("} //End of MeshVertexColors\n") + #***********************************************#***********************************************#*********************************************** #*********************************************** #FRAMES diff --git a/release/scripts/animation_bake_constraints.py b/release/scripts/animation_bake_constraints.py new file mode 100644 index 00000000000..130e93d8591 --- /dev/null +++ b/release/scripts/animation_bake_constraints.py @@ -0,0 +1,800 @@ +#!BPY + +""" +Name: 'Bake Constraints' +Blender: 246 +Group: 'Animation' +Tooltip: 'Bake a Constrained object/rig to IPOs' +Fillename: 'Bake_Constraint.py' +""" + +__author__ = "Roger Wickes (rogerwickes(at)yahoo.com)" +__script__ = "Bake Constraints" +__version__ = "0.6" +__url__ = ["Communicate problems and errors, http://www.blenderartists.com/forum/private.php?do=newpm to PapaSmurf"] +__email__= ["Roger Wickes, rogerwickes@yahoo.com", "scripts"] +__bpydoc__ = """\ + +bake_constraints + +This script bakes the real-world LocRot of an object (the net effect of any constraints - +(Copy, Limit, Track, Follow, - that affect Location, Rotation) +(usually one constrained to match another's location and/or Tracked to another) +and creates a clone with a set of Ipo Curves named Ipo +These curves control a non-constrained object and thus make it mimic the constrained object +Actions can be then be edited without the need for the drivers/constraining objects + +Developed for use with MoCap data, where a bone is constrained to point at an empty +moving through space and time. This records the actual locrot of the armature +so that the motion can be edited, reoriented, scaled, and used as NLA Actions + +see also wiki Scripts/Manual/ Sandbox/Animation/Bake_Constraints (tbd) + +Usage:
+ - Select the reference Object(s) you want to bake
+ - Set the frame range to bake in the Anim Panel
+ - Set the test code (if you want a self-test) in the RT field in the Anim Panel
+ -- Set RT:1 in the Anim panel to create a test armature
+
+ - Run the script
+ - The clone copy of the object is created and it has an IPO curve assigned to it. + - The clone shadows the object by an offset locrot (see usrDelta) + - That Ipo has Location and Rotation curves that make the shadow mimic the movement of the selected object, + but without using constraints. Bones move identically in relation to the armature as the reference object + + +Version History: + 0.1: bakes Loc Rot for a constrained object + 0.2: bakes Loc and Rot for the bones within Armature object + 0.3: UI for setting options + 0.3.1 add manual to script library + 0.4: bake multiple objects + 0.5: root bone worldspace rotation + 0.6: re-integration with BPyArmature + +License, Copyright, and Attribution: + by Roger WICKES May 2008, released under Blender Artistic Licence to Public Domain + feel free to add to any Blender Python Scripts Bundle. + Thanks to Jean-Baptiste PERIN, IdeasMan42 (Campbell Barton?), Basil_Fawlty/Cage_drei (Andrew Cruse) + much lifted/learned from blender.org/documentation/245PytonDoc and wiki + some modules based on c3D_Import.py, PoseLib16.py and IPO/Armature code examples e.g. camera jitter + +Pseudocode (planned versions): + Initialize + If at least one object is selected + For each selected object, + create a shadow object + remove any constraints on the clone + create or reset an ipo curve named like the object + for each frame + set the clone's locrot key based on the reference object + if it's an armature, + create an action (which is an Ipo for each bone) + for each frame of the animation + for each bone in the armature + set the key + Else you're a smurf + +Test Conditions and Regressions: + 1. (v0.1) Non-armatures (the cube), with ipo curve and constraints at the object level + 2. armatures, with ipo curve and constraints at the object level + 3. armatures, with bones that have ipo curves and constraints + +Naming conventions: + arm = a specific objec type armature + bone = bones that make up the skeleton of an armature + + ob = object, an instance of an object type + ebone = edit bone, a bone in edit mode + pbone = pose bone, a posed bone in an object + tst = testing, self-test routines + usr = user-entered or designated stuff + +Pattern Notes (let me know if I've violated any): + Bergin Starting,Designing, Programming, Coding + Bergin 23 Indent for Structure - I don't like only 2, but the editor is set up that way + Bergin 26 Be Spacey Not Tabby - personal frustraion here. workaround is to Format->convert to whitespace + Bergin 27 Consistent Capitalization - except Blender, because I love it. + Bergin 28 Name Your Constants - not for those I plan on making variable + Python 01 Return Everything - I made this one up, all functions and methods end in return + even though it is decoration in Python, it helps Python throw an indentation error for typing mistakes + Wickes 01 Decorate Your Code - for visual appeal and to ease maintenance, include separators like ######### + to visually distinquish and separate functions, making it quicker to scan through code for methods + Wickes 02 Whitespace helps readability - include blanks around = # and lines (after def, after return) to make it stand out and pretty + +""" +######################################## + +import Blender +from Blender import * +from Blender.Mathutils import * +import struct +import string +import bpy +import BPyMessages +import BPyArmature +# reload(BPyArmature) +from BPyArmature import getBakedPoseData + +Vector= Blender.Mathutils.Vector +Euler= Blender.Mathutils.Euler +Matrix= Blender.Mathutils.Matrix #invert() function at least +RotationMatrix = Blender.Mathutils.RotationMatrix +TranslationMatrix= Blender.Mathutils.TranslationMatrix +Quaternion = Blender.Mathutils.Quaternion +Vector = Blender.Mathutils.Vector +POSE_XFORM= [Blender.Object.Pose.LOC, Blender.Object.Pose.ROT] + +#================= +# Global Variables +#================= + +# set senstitivity for displaying debug/console messages. 0=none, 100=max +# then call debug(num,string) to conditionally display status/info in console window +MODE=Blender.Get('rt') #execution mode: 0=run normal, x=self-test (test error trapping etc) +DEBUG=100 #how much detail on internal processing for big brother to see +BATCH=False #called from command line? is someone there? Would you like some cake? + +#there are two coordinate systems, the real, or absolute 3D space, +# and the local relative to a parent. +COORDINATE_SYSTEMS = ['local','real'] +COORD_LOCAL = 0 +COORD_REAL = 1 + +# User Settings - Change these options manually or via GUI (future TODO) +usrCoord = COORD_REAL # what the user wants +usrParent = False # True=keep parent (if exists), False = breakaway (usually with Real) +usrFreeze = 2 #2=yes, 0=no. Freezes shadow object in place at current frame as origin + #TODO - i wonder if usrFreeze means we should set Delta to the the difference between the original object and parent? +# delta is amount to offset/change from the reference object. future set in a ui, so technically not a constant +usrDelta = [10,10,0,0,0,0] #order specific - Loc xyz Rot xyz +usrACTION = True # Offset baked Action frames to start at frame 1 +usrBAKEobjIPO = False # bake the object Ipo? it is useless for MoCap, as we only want the Action, and the Object does not move + +CURFRAME = 'curframe' #keyword to use when getting the frame number that the scene is presently on +ARMATURE = 'Armature' #en anglais +BONE_SPACES = ['ARMATURESPACE','BONESPACE'] + # 'ARMATURESPACE' - this matrix of the bone in relation to the armature + # 'BONESPACE' - the matrix of the bone in relation to itself + +#Ipo curves created are prefixed with a name, like Ipo_ or Bake_ followed by the object/bone name +#bakedArmName = "b." #used for both the armature class and object instance +#ipoObjectNamePrefix= "" +#ipoBoneNamePrefix = "" +# for example, if on entry an armature named Man was selected, and the object prefix was "a." +# on exit an armature and an IPO curve named a.Man exists for the object as a whole +# if that armature had bones (spine, neck, arm) and the bone prefix was "a." +# the bones and IPO curves will be (a.spine, a.neck, a.arm) + +R2D = 18/3.1415 # radian to grad +BLENDER_VERSION = Blender.Get('version') + +# Gets the current scene, there can be many scenes in 1 blend file. +scn = Blender.Scene.GetCurrent() + +#================= +# Methods +#================= +######################################## +def debug(num,msg): #use log4j or just console here. + + if DEBUG >= num: + if BATCH == False: + print 'debug: '[:num/10+7]+msg + #TODO: else write out to file (runs faster if it doesnt have to display details) + return + +######################################## +def error(str): + debug(0,'ERROR: '+str) + if BATCH == False: + Draw.PupMenu('ERROR%t|'+str) + return + +######################################## +def getRenderInfo(): + context=scn.getRenderingContext() + staframe = context.startFrame() + endframe = context.endFrame() + if endframe 245: debug(0,'WARNING: Programmer check for Bone updates in dupliArmature') + + eboneNames = sortBones(xbones) + + i=0 + # error('bones sorted. continue?') + for abone in eboneNames: #set all editable attributes to fully define the bone. + for bone in xbones: + if bone.name == abone: break # get the reference bone + ebone = Armature.Editbone() #throw me a bone, bone-man! + ebones.append(ebone) #you're on my list, buddy + + ebone.name = bone.name + ebone.headRadius = bone.headRadius + ebone.tailRadius = bone.tailRadius + ebone.weight = bone.weight + ebone.options = bone.options + + ebone.head = bone.head[space] #dictionary lookups + ebone.tail = bone.tail[space] + ebone.matrix = bone.matrix[space] + ebone.roll = bone.roll[space] + + debug(30,'Generating new %s as child of %s' % (bone,bone.parent)) + if bone.hasParent(): +# parent=bone.parent.name +# debug(100,'looking for %s' % parent) +# for parbone in xbones: if parbone.name == parent: break # get the parent bone +# ebone.parent = arm.bones[ebones[j].name] + ebone.parent = arm.bones[bone.parent.name] +# else: +# ebone.parent = None + debug(30,'Generating new editbone %s as child of %s' % (ebone,ebone.parent)) + arm.bones[ebone.name] = ebone # i would have expected an append or add function, but this works + + debug (100,'arm.bones: \n%s' % arm.bones) + debug (20,'Cloned %i bones now in armature %s' %(len(arm.bones),arm.name)) + + myob = scn.objects.new(arm) #interestingly, object must be created before + arm.update() #armature can be saved + debug(40,'dupArm finished %s instanced as object %s' % (arm.name,myob.getName())) + print ob.matrix + print myob.matrix + + return myob + +def scrub(): # scrubs to startframe + staFrame,endFrame,curFrame = getRenderInfo() + + # eye-candy, go from current to start, fwd or back + if not BATCH: + print "Positioning to start..." + frameinc=(staFrame-curFrame)/10 + if abs(frameinc) >= 1: + for i in range(10): + curFrame+=frameinc + Blender.Set(CURFRAME,curFrame) # computes the constrained location of the 'real' objects + Blender.Redraw() + Blender.Set(CURFRAME, staFrame) + +######################################## +def bakeBones(ref_ob,arm_ob): #copy pose from ref_ob to arm_ob + scrub() + staFrame,endFrame,curFrame = getRenderInfo() + act = getBakedPoseData(ref_ob, staFrame, endFrame, ACTION_BAKE = True, ACTION_BAKE_FIRST_FRAME = usrACTION) # bake the pose positions of the reference ob to the armature ob + arm_ob.action = act + scrub() + + # user comprehension feature - change action name and channel ipo names to match the names of the bone they drive + debug (80,'Renaming each action ipo to match the bone they pose') + act.name = arm_ob.name + arm_channels = act.getAllChannelIpos() + pose= arm_ob.getPose() + pbones= pose.bones.values() #we want the bones themselves, not the dictionary lookup + print arm_channels.keys() + for pbone in pbones: + debug (100,'Channel listing for %s: %s' % (pbone.name,arm_channels[pbone.name] )) + ipo=arm_channels[pbone.name] + ipo.name = pbone.name # since bone names are unique within an armature, the pose names can be the same since they are within an Action + + return + +######################################## +def getOrCreateCurve(ipo, curvename): + + """ + Retrieve or create a Blender Ipo Curve named C{curvename} in the C{ipo} Ipo + Either an ipo curve named C{curvename} exists before the call then this curve is returned, + Or such a curve doesn't exist before the call .. then it is created into the c{ipo} Ipo and returned + """ + try: + mycurve = ipo.getCurve(curvename) + if mycurve != None: + pass + else: + mycurve = ipo.addCurve(curvename) + except: + mycurve = ipo.addCurve(curvename) + return mycurve + +######################################## +def eraseCurve(ipo,numCurves): + debug(80,'Erasing %i curves for %' % (numCurves,ipo.GetName())) + for i in range(numCurves): + nbBezPoints = ipo.getNBezPoints(i) + for j in range(nbBezPoints): + ipo.delBezPoint(i) + return + +######################################## +def resetIPO(ipo): + ipoName=ipoObjectNamePrefix + obName + debug(40,'Resetting ipo curve named %s' %ipoName) + numCurves = ipo.getNcurves() #like LocX, LocY, etc + if numCurves > 0: + eraseCurve(ipo, numCurves) #erase data if one exists + return + +######################################## +def resetIPOs(ob): #resets all IPO curvess assocated with an object and its bones + debug(30,'Resetting any ipo curves linked to %s' %ob.getName()) + ipo = ob.getIpo() #may be None + ipoName = ipo.getName() #name of the IPO that guides/controls this object + debug(70,'Object IPO is %s' %ipoName) + try: + ipo = Ipo.Get(ipoName) + except: + ipo = Ipo.New('Object', ipoName) + resetIPO(ipo) + if ob.getType() == ARMATURE: + arm_data=ob.getData() + bones=arm_data.bones.values() + for bone in bones: + #for each bone: get the name and check for a Pose IPO + debug(10,'Processing '+ bone.name) + return + +######################################## +def parse(string,delim): + index = string.find(delim) # -1 if not found, else pointer to delim + if index+1: return string[:index] + return string + +######################################## +def newIpo(ipoName): #add a new Ipo object to the Blender scene + ipo=Blender.Ipo.New('Object',ipoName) + + ipo.addCurve('LocX') + ipo.addCurve('LocY') + ipo.addCurve('LocZ') + ipo.addCurve('RotX') + ipo.addCurve('RotY') + ipo.addCurve('RotZ') + return ipo + +######################################## +def makeUpaName(type,name): #i know this exists in Blender somewhere... + debug(90,'Making up a new %s name using %s as a basis.' % (type,name)) + name = (parse(name,'.')) + if type == 'Ipo': + ipoName = name # maybe we get lucky today + ext = 0 + extlen = 3 # 3 digit extensions, like hello.002 + success = False + while not(success): + try: + debug(100,'Trying %s' % ipoName) + ipo = Ipo.Get(ipoName) + #that one exists if we get here. add on extension and keep trying + ext +=1 + if ext>=10**extlen: extlen +=1 # go to more digits if 999 not found + ipoName = '%s.%s' % (name, str(ext).zfill(extlen)) + except: # could not find it + success = True + name=ipoName + else: + debug (0,'FATAL ERROR: I dont know how to make up a new %s name based on %s' % (type,ob)) + return + return name + +######################################## +def createIpo(ob): #create an Ipo and curves and link them to this object + #first, we have to create a unique name + #try first with just the name of the object to keep things simple. + ipoName = makeUpaName('Ipo',ob.getName()) # make up a name for a new Ipo based on the object name + + debug(20,'Ipo and LocRot curves called %s' % ipoName) + + ipo=newIpo(ipoName) + + ob.setIpo(ipo) #link them + return ipo + +######################################## +def getLocLocal(ob): + key = [ + ob.LocX, + ob.LocY, + ob.LocZ, + ob.RotX*R2D, #get the curves in this order + ob.RotY*R2D, + ob.RotZ*R2D + ] + return key + +######################################## +def getLocReal(ob): + obMatrix = ob.matrixWorld #Thank you IdeasMan42 + loc = obMatrix.translationPart() + rot = obMatrix.toEuler() + key = [ + loc.x, + loc.y, + loc.z, + rot.x/10, + rot.y/10, + rot.z/10 + ] + return key + +######################################## +def getLocRot(ob,space): + if space in xrange(len(COORDINATE_SYSTEMS)): + if space == COORD_LOCAL: + key = getLocLocal(ob) + return key + elif space == COORD_REAL: + key = getLocReal(ob) + return key + else: #hey, programmers make mistakes too. + debug(0,'Fatal Error: getLoc called with %i' % space) + return + +######################################## +def getCurves(ipo): + ipos = [ + ipo[Ipo.OB_LOCX], + ipo[Ipo.OB_LOCY], + ipo[Ipo.OB_LOCZ], + ipo[Ipo.OB_ROTX], #get the curves in this order + ipo[Ipo.OB_ROTY], + ipo[Ipo.OB_ROTZ] + ] + return ipos + +######################################## +def addPoint(time,keyLocRot,ipos): + if BLENDER_VERSION < 245: + debug(0,'WARNING: addPoint uses BezTriple') + for i in range(len(ipos)): + point = BezTriple.New() #this was new with Blender 2.45 API + point.pt = (time, keyLocRot[i]) + point.handleTypes = [1,1] + + ipos[i].append(point) + return ipos + +######################################## +def bakeFrames(ob,myipo): #bakes an object in a scene, returning the IPO containing the curves + myipoName = myipo.getName() + debug(20,'Baking frames for scene %s object %s to ipo %s' % (scn.getName(),ob.getName(),myipoName)) + ipos = getCurves(myipo) + #TODO: Gui setup idea: myOffset + # reset action to start at frame 1 or at location + myOffset=0 #=1-staframe + #loop through frames in the animation. Often, there is rollup and the mocap starts late + staframe,endframe,curframe = getRenderInfo() + for frame in range(staframe, endframe+1): + debug(80,'Baking Frame %i' % frame) + #tell Blender to advace to frame + Blender.Set(CURFRAME,frame) # computes the constrained location of the 'real' objects + if not BATCH: Blender.Redraw() # no secrets, let user see what we are doing + + #using the constrained Loc Rot of the object, set the location of the unconstrained clone. Yea! Clones are FreeMen + key = getLocRot(ob,usrCoord) #a key is a set of specifed exact channel values (LocRotScale) for a certain frame + key = [a+b for a,b in zip(key, usrDelta)] #offset to the new location + + myframe= frame+myOffset + Blender.Set(CURFRAME,myframe) + + time = Blender.Get('curtime') #for BezTriple + ipos = addPoint(time,key,ipos) #add this data at this time to the ipos + debug(100,'%s %i %.3f %.2f %.2f %.2f %.2f %.2f %.2f' % (myipoName, myframe, time, key[0], key[1], key[2], key[3], key[4], key[5])) + # eye-candy - smoothly rewind the animation, showing now how the clone match moves + if endframe-staframe <400 and not BATCH: + for frame in range (endframe,staframe,-1): #rewind + Blender.Set(CURFRAME,frame) # computes the constrained location of the 'real' objects + Blender.Redraw() + Blender.Set(CURFRAME,staframe) + Blender.Redraw() + + return ipos + +######################################## +def duplicateLinked(ob): + obType = ob.type + debug(10,'Duplicating %s Object named %s' % (obType,ob.getName())) + scn.objects.selected = [ob] +## rdw: simplified by just duplicating armature. kept code as reference for creating armatures +## disadvantage is that you cant have clone as stick and original as octahedron +## since they share the same Armature. User can click Make Single User button. +## if obType == ARMATURE: #build a copy from scratch +## myob= dupliArmature(ob) +## else: + Blender.Object.Duplicate() # Duplicate linked, including pose constraints. + myobs = Object.GetSelected() #duplicate is top on the list + myob = myobs[0] + if usrParent == False: + myob.clrParent(usrFreeze) + debug(20,'=myob= was created as %s' % myob.getName()) + return myob + +######################################## +def removeConstraints(ob): + for const in ob.constraints: + debug(90,'removed %s => %s' % (ob.name, const)) + ob.constraints.remove(const) + return + +######################################## +def removeConstraintsOb(ob): # from object or armature + debug(40,'Removing constraints from '+ob.getName()) + if BLENDER_VERSION > 241: #constraints module not available before 242 + removeConstraints(ob) + if ob.getType() == ARMATURE: + pose = ob.getPose() + for pbone in pose.bones.values(): + #bone = pose.bones[bonename] + removeConstraints(pbone) + #should also check if it is a deflector? + return + +######################################## +def deLinkOb(type,ob): #remove linkages + if type == 'Ipo': + success = ob.clearIpo() #true=there was one + if success: debug(80,'deLinked Ipo curve to %s' % ob.getName()) + return + +######################################## +def bakeObject(ob): #bakes the core object locrot and assigns the Ipo to a Clone + if ob != None: + # Clone the object - duplicate it, clean the clone, and create an ipo curve for the clone + myob = duplicateLinked(ob) #clone it + removeConstraintsOb(myob) #my object is a free man + deLinkOb('Ipo',myob) #kids, it's not nice to share. you've been lied to + if usrBAKEobjIPO: + myipo = createIpo(myob) #create own IPO and curves for the clone object + ipos = bakeFrames(ob,myipo) #bake the locrot for this obj for the scene frames + +# staframe,endframe,curframe = getRenderInfo() +# frame = staframe +# Blender.Set(CURFRAME,frame) # computes the constrained location of the 'real' objects +# frame +=1 +# Blender.Set(CURFRAME,frame) # computes the constrained location of the 'real' objects +# frame -=1 +# Blender.Set(CURFRAME,frame) # computes the constrained location of the 'real' objects +# if not BATCH: Blender.Redraw() +# + return myob + +######################################## +def bake(ob): #bakes an object of any type + + debug(30,'Baking %s object %s' % (ob.getType(), ob)) + + myob = bakeObject(ob) #creates and bakes the object motion + + if ob.getType() == ARMATURE: +# error('Object baked. Continue with bones?') + bakeBones(ob,myob) #go into the bones and copy from -> to in frame range + #future idea: bakeMesh (net result of Shapekeys, Softbody, Cloth, Fluidsim,...) + + return + +######################################## +def tstCreateArm(): #create a test armature in scene + # rip-off from http://www.blender.org/documentation/245PythonDoc/Pose-module.html - thank you! + + debug(0,'Making Test Armature') + # New Armature + arm_data= Armature.New('myArmature') + print arm_data + arm_ob = scn.objects.new(arm_data) + arm_data.makeEditable() + + # Add 4 bones + ebones = [Armature.Editbone(), Armature.Editbone(), Armature.Editbone(), Armature.Editbone()] + + # Name the editbones + ebones[0].name = 'Bone.001' + ebones[1].name = 'Bone.002' + ebones[2].name = 'Bone.003' + ebones[3].name = 'Bone.004' + + # Assign the editbones to the armature + for eb in ebones: + arm_data.bones[eb.name]= eb + + # Set the locations of the bones + ebones[0].head= Mathutils.Vector(0,0,0) + ebones[0].tail= Mathutils.Vector(0,0,1) #tip + ebones[1].head= Mathutils.Vector(0,0,1) + ebones[1].tail= Mathutils.Vector(0,0,2) + ebones[2].head= Mathutils.Vector(0,0,2) + ebones[2].tail= Mathutils.Vector(0,0,3) + ebones[3].head= Mathutils.Vector(0,0,3) + ebones[3].tail= Mathutils.Vector(0,0,4) + + ebones[1].parent= ebones[0] + ebones[2].parent= ebones[1] + ebones[3].parent= ebones[2] + + arm_data.update() + # Done with editing the armature + + # Assign the pose animation + arm_pose = arm_ob.getPose() + + act = arm_ob.getAction() + if not act: # Add a pose action if we dont have one + act = Armature.NLA.NewAction() + act.setActive(arm_ob) + + xbones=arm_ob.data.bones.values() + pbones = arm_pose.bones.values() + + frame = 1 + for pbone in pbones: # set bones to no rotation + pbone.quat[:] = 1.000,0.000,0.000,0.0000 + pbone.insertKey(arm_ob, frame, Object.Pose.ROT) + + # Set a different rotation at frame 25 + pbones[0].quat[:] = 1.000,0.1000,0.2000,0.20000 + pbones[1].quat[:] = 1.000,0.6000,0.5000,0.40000 + pbones[2].quat[:] = 1.000,0.1000,0.3000,0.40000 + pbones[3].quat[:] = 1.000,-0.2000,-0.3000,0.30000 + + frame = 25 + for i in xrange(4): + pbones[i].insertKey(arm_ob, frame, Object.Pose.ROT) + + pbones[0].quat[:] = 1.000,0.000,0.000,0.0000 + pbones[1].quat[:] = 1.000,0.000,0.000,0.0000 + pbones[2].quat[:] = 1.000,0.000,0.000,0.0000 + pbones[3].quat[:] = 1.000,0.000,0.000,0.0000 + + frame = 50 + for pbone in pbones: # set bones to no rotation + pbone.quat[:] = 1.000,0.000,0.000,0.0000 + pbone.insertKey(arm_ob, frame, Object.Pose.ROT) + + return arm_ob + +######################################## +def tstMoveOb(ob): # makes a simple LocRot animation of object in the scene + anim = [ + #Loc Rot/10 + # + ( 0,0,0, 0, 0, 0), #frame 1 origin + ( 1,0,0, 0, 0, 0), #frame 2 + ( 1,1,0, 0, 0, 0), + ( 1,1,1, 0, 0, 0), + ( 1,1,1,4.5, 0, 0), + ( 1,1,1,4.5,4.5, 0), + ( 1,1,1,4.5,4.5,4.5) + ] + space = COORD_LOCAL + ipo = createIpo(ob) #create an Ipo and curves for this object + ipos = getCurves(ipo) + + # span this motion over the currently set anim range + # to set points, i need time but do not know how it is computed, so will have to advance the animation + staframe,endframe,curframe = getRenderInfo() + + frame = staframe #x position of new ipo datapoint. set to staframe if you want a match + frameDelta=(endframe-staframe)/(len(anim)) #accomplish the animation in frame range + for key in anim: #effectively does a getLocRot() + #tell Blender to advace to frame + Blender.Set('curframe',frame) # computes the constrained location of the 'real' objects + time = Blender.Get('curtime') + + ipos = addPoint(time,key,ipos) #add this data at this time to the ipos + + debug(100,'%s %i %.3f %.2f %.2f %.2f %.2f %.2f %.2f' % (ipo.name, frame, time, key[0], key[1], key[2], key[3], key[4], key[5])) + frame += frameDelta + Blender.Set('curframe',curframe) # reset back to where we started + return +#================= +# Program Template +#================= +######################################## +def main(): + # return code set via rt button in Blender Buttons Scene Context Anim panel + + if MODE == 1: #create test armature #1 + ob = tstCreateArm() # make test arm and select it + tstMoveOb(ob) + scn.objects.selected = [ob] + + obs = Blender.Object.GetSelected() #scn.objects.selected + debug(20,'Baking %i objects' % len(obs)) + + if len(obs) >= 1: # user might have multiple objects selected + for ob in obs: + bake(ob) + else: + error('Please select at least one object') + return + +######################################## +def benchmark(): # This lets you benchmark (time) the script's running duration + + Window.WaitCursor(1) + t = sys.time() + debug(60,'%s began at %.0f' %(__script__,sys.time())) + + # Run the function on the active scene + in_editmode = Window.EditMode() + if in_editmode: Window.EditMode(0) + + main() + + if in_editmode: Window.EditMode(1) + + # Timing the script is a good way to be aware on any speed hits when scripting + debug(60,'%s Script finished in %.2f seconds' % (__script__,sys.time()-t) ) + Window.WaitCursor(0) + return + +######################################## +# This lets you can import the script without running it +if __name__ == '__main__': + debug(0, "------------------------------------") + debug(0, '%s %s Script begins with mode=%i debug=%i batch=%s version=%i' % (__script__,__version__,MODE,DEBUG,BATCH,BLENDER_VERSION)) + + benchmark() diff --git a/release/scripts/bpymodules/BPyArmature.py b/release/scripts/bpymodules/BPyArmature.py index d0b41dc35c5..63df02d080c 100644 --- a/release/scripts/bpymodules/BPyArmature.py +++ b/release/scripts/bpymodules/BPyArmature.py @@ -11,13 +11,19 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Version History: +# 1.0 original release bakes an armature into a matrix +# 1.1 optional params (ACTION_BAKE, ACTION_BAKE_FIRST_FRAME, direct function to key and return the Action import Blender +from Blender import sys import bpy -def getBakedPoseData(ob_arm, start_frame, end_frame): +def getBakedPoseData(ob_arm, start_frame, end_frame, ACTION_BAKE = False, ACTION_BAKE_FIRST_FRAME = True): ''' If you are currently getting IPO's this function can be used to - return a list of frame aligned bone dictionary's + ACTION_BAKE==False: return a list of frame aligned bone dictionary's + ACTION_BAKE==True: return an action with keys aligned to bone constrained movement + if ACTION_BAKE_FIRST_FRAME is not supplied or is true: keys begin at frame 1 The data in these can be swaped in for the IPO loc and quat @@ -77,7 +83,13 @@ def getBakedPoseData(ob_arm, start_frame, end_frame): # --------------------------------- Main loop to collect IPO data frame_index = 0 + NvideoFrames= end_frame-start_frame for current_frame in xrange(start_frame, end_frame+1): + if frame_index==0: start=sys.time() + elif frame_index==15: print NvideoFrames*(sys.time()-start),"seconds estimated..." #slows as it grows *3 + elif frame_index >15: + percom= frame_index*100/NvideoFrames + print "Frame %i Overall %i percent complete\r" % (current_frame, percom), ob_arm.action = backup_action #pose.update() # not needed Blender.Set('curframe', current_frame) @@ -88,9 +100,7 @@ def getBakedPoseData(ob_arm, start_frame, end_frame): for index, parent_index, bone_name, rest_bone, rest_matrix, rest_matrix_inv, pose_bone, ipo in armature_bone_data: matrix= pose_bone.poseMatrix - parent_bone= rest_bone.parent - if parent_index != -1: parent_pose_matrix = armature_bone_data[parent_index][6].poseMatrix parent_bone_matrix_inv = armature_bone_data[parent_index][5] @@ -98,40 +108,45 @@ def getBakedPoseData(ob_arm, start_frame, end_frame): rest_matrix= rest_matrix * parent_bone_matrix_inv matrix=matrix * rest_matrix.copy().invert() - pose_bone.quat= matrix.toQuat() pose_bone.loc= matrix.translationPart() - pose_bone.insertKey(ob_arm, 1, POSE_XFORM) # always frame 1 + if ACTION_BAKE==False: + pose_bone.insertKey(ob_arm, 1, POSE_XFORM) # always frame 1 + + # THIS IS A BAD HACK! IT SUCKS BIGTIME BUT THE RESULT ARE NICE + # - use a temp action and bake into that, always at the same frame + # so as not to make big IPO's, then collect the result from the IPOs - # THIS IS A BAD HACK! IT SUCKS BIGTIME BUT THE RESULT ARE NICE - # - use a temp action and bake into that, always at the same frame - # so as not to make big IPO's, then collect the result from the IPOs + # Now get the data from the IPOs + if not ipo: ipo = armature_bone_data[index][7] = new_action.getChannelIpo(bone_name) - # Now get the data from the IPOs - if not ipo: ipo = armature_bone_data[index][7] = new_action.getChannelIpo(bone_name) + loc = Vector() + quat = Quaternion() - loc = Vector() - quat = Quaternion() + for curve in ipo: + val = curve.evaluate(1) + curve_name= curve.name + if curve_name == 'LocX': loc[0] = val + elif curve_name == 'LocY': loc[1] = val + elif curve_name == 'LocZ': loc[2] = val + elif curve_name == 'QuatW': quat[3] = val + elif curve_name == 'QuatX': quat[0] = val + elif curve_name == 'QuatY': quat[1] = val + elif curve_name == 'QuatZ': quat[2] = val - for curve in ipo: - val = curve.evaluate(1) - curve_name= curve.name - if curve_name == 'LocX': loc[0] = val - elif curve_name == 'LocY': loc[1] = val - elif curve_name == 'LocZ': loc[2] = val - elif curve_name == 'QuatW': quat[3] = val - elif curve_name == 'QuatX': quat[0] = val - elif curve_name == 'QuatY': quat[1] = val - elif curve_name == 'QuatZ': quat[2] = val - - bake_data[frame_index][bone_name] = loc, quat - - + bake_data[frame_index][bone_name] = loc, quat + else: + if ACTION_BAKE_FIRST_FRAME: pose_bone.insertKey(ob_arm, frame_index+1, POSE_XFORM) + else: pose_bone.insertKey(ob_arm, current_frame , POSE_XFORM) frame_index+=1 - + print "\nBaking Complete." ob_arm.action = backup_action - Blender.Set('curframe', backup_frame) - return bake_data + if ACTION_BAKE==False: + Blender.Set('curframe', backup_frame) + return bake_data + elif ACTION_BAKE==True: + return new_action + else: print "ERROR: Invalid ACTION_BAKE %i sent to BPyArmature" % ACTION_BAKE diff --git a/release/scripts/c3d_import.py b/release/scripts/c3d_import.py new file mode 100644 index 00000000000..d67d56261d1 --- /dev/null +++ b/release/scripts/c3d_import.py @@ -0,0 +1,1237 @@ +#!BPY + +""" +Name: 'Motion Capture (.c3d)...' +Blender: 246 +Group: 'Import' +Tooltip: 'Import a C3D Motion Capture file' +""" +__script__ = "C3D Motion Capture file import" +__author__ = " Jean-Baptiste PERIN, Roger D. Wickes (rogerwickes@yahoo.com)" +__version__ = "0.8" +__url__ = ["Communicate problems and errors, BlenderArtists.org, Python forum"] +__email__= ["rogerwickes@yahoo.com", "c3d script"] +__bpydoc__ = """\ +c3d_import.py v0.8 + +Script loading Graphics Lab Motion Capture file, +Usage:
+ - Run the script
+ - Choose the file to open
+ - Press Import C3D button
+ +Version History: + 0.4: PERIN Released under Blender Artistic Licence + 0.5: WICKES used marker names, fixed 2.45 depricated call + 0.6: WICKES creates armature for each subject + 0.7: WICKES constrains armature to follow the empties (markers). Verified for shake hands s + 0.8: WICKES resolved DEC support issue +""" + +#---------------------------------------------- +# (c) Jean-Baptiste PERIN december 2005, released under Blender Artistic Licence +# for the Blender 2.40 Python Scripts Bundle. +#---------------------------------------------- + +###################################################### +# This script imports a C3D file into blender. +# Loader is based on MATLAB C3D loader from +# Alan Morris, Toronto, October 1998 +# Jaap Harlaar, Amsterdam, april 2002 +###################################################### + +import string +import Blender +from Blender import * +import bpy +import struct +import BPyMessages +Vector= Blender.Mathutils.Vector +Euler= Blender.Mathutils.Euler +Matrix= Blender.Mathutils.Matrix +RotationMatrix = Blender.Mathutils.RotationMatrix +TranslationMatrix= Blender.Mathutils.TranslationMatrix + +#================= +# Global Variables, Constants, Defaults, and Shorthand References +#================= +# set senstitivity for displaying debug/console messages. 0=few, 100=max, including clicks at major steps +# debug(num,string) to conditionally display status/info in console window +DEBUG=Blender.Get('rt') + +# marker sets known in the world +HUMAN_CMU= "HumanRTKm.mkr" # The Human Real-Time capture marker set used by CMU +HUMAN_CMU2="HumanRT.mkr" # found in another file, seems same as others in that series +MARKER_SETS = [ HUMAN_CMU, HUMAN_CMU2 ] # marker sets that this program supports (can make an armature for) +XYZ_LIMIT= 10000 #max value for coordinates if in integer format + +# what layers to put stuff on in scene. 1 is selected, so everything goes there +# selecting only layer 2 shows only the armature moving, 12 shows only the empties +LAYERS_ARMOB= [1,2] +LAYERS_MARKER=[1,12] +CLEAN=True # Should program ignore markers at (0,0,0) and beyond the outer limits? + +scn = Blender.Scene.GetCurrent() +# Why on earth would you rename a scene when importing data??? - Campbell +# scn.name="MoCap" #may want this enterable or derived based on motion being analyzed +#TODO: ultimately, a library of motions to append from means you need good naming of things + +BCS=Blender.Constraint.Settings # shorthand dictionary - define with brace, reference with bracket +trackto={"+x":BCS.TRACKX, "+y":BCS.TRACKY, "+z":BCS.TRACKZ, "-x":BCS.TRACKNEGX, "-y":BCS.TRACKNEGY, "-z":BCS.TRACKNEGZ} +trackup={"x":BCS.UPX, "y":BCS.UPY, "z":BCS.UPZ} + +#=============================# +# Classes +#=============================# +class Marker: + def __init__(self, x, y, z): + self.x=0.0 + self.y=0.0 + self.z=0.0 + + def __repr__(self): #report on self, as in if just printed + return str("[x = "+str(self.x) +" y = " + str(self.y)+" z = "+ str(self.z)+"]") + +class ParameterGroup: + def __init__(self, nom, description, parameter): + self.name = nom + self.description = description + self.parameter = parameter + + def __repr__(self): + return self.name, " ", self.description, " ", self.parameter + +class Parameter: + def __init__(self, name, datatype, dim, data, description): + self.name = name + self.datatype = datatype + self.dim = dim + self.data = data + self.description = description + + def __repr__(self): + return self.name, " ", self.description, " ", self.dim + +class MyVector: + def __init__(self, fx,fy,fz): + self.x=fx + self.y=fy + self.z=fz + +class Mybone: + "information structure for bone generation and posing" + def __init__(self, name,vec,par,head,tail,const): + self.name=name # name of this bone. must be unique within armature + self.vec=vec # edit bone vector it points + self.parent=par # name of parent bone to locate head and form a chain + self.headMark=head # list of 0+ markers where the head of this non-parented bone should be placed + self.tailMark=tail # list of 0+ markers where the tip should be placed + self.const=const # list of 0+ constraint tuples to control posing + self.head=MyVector(0,0,0) #T-pose location + self.tail=MyVector(0,0,0) + def __repr__(self): + return '[Mybone "%s"]' % self.name + + +#=============================# +# functions/modules +#=============================# +def error(str): + Draw.PupMenu('ERROR%t|'+str) + return +def status(str): + Draw.PupMenu('STATUS%t|'+str+"|Continue?") + return +def debug(num,msg): #use log4j or just console here. + if DEBUG >= num: + print 'debug:', (' '*num), msg + #TODO: if level 0, make a text file in Blender file to record major stuff + return + +def names(ob): return ob.name + + +######### +# Cette fonction renvoie la liste des empties +# in : +# out : emp_list (List of Object) la liste des objets de type "Empty" +######### +def getEmpty(name): + obs = [ob for ob in scn.objects if ob.type=="Empty" and ob.name==name] + if len(obs)==0: + return None + elif len(obs)==1: + return obs[0] + else: + error("FATAL ERROR: %i empties %s in file" % (len(obs),ob[0])) +######### +# Cette fonction renvoie un empty +# in : objname : le nom de l'empty recherche +# out : myobj : l'empty cree ou retrouve +######### +def GetOrCreateEmpty(objname): + myobj= getEmpty(objname) + if myobj==None: + myobj = scn.objects.new("Empty",objname) + myobj.layers= LAYERS_MARKER + debug(50,'Marker/Empty created %s' % myobj) + return myobj + +def GetOrCreateCurve(ipo, curvename): + """ + Retrieve or create a Blender Ipo Curve named C{curvename} in the C{ipo} Ipo + + >>> import mylib + + >>> lIpo = GetOrCreateIPO("Une IPO") + >>> laCurve = GetOrCreateCurve(lIpo, "RotX") + + Either an ipo curve named C{curvename} exists before the call then this curve is returned, + Or such a curve doesn't exist before the call .. then it is created into the c{ipo} Ipo and returned + + @type ipo: Blender Ipo + @param ipo: the Ipo in which the curve must be retrieved or created. + @type curvename: string + @param curvename: name of the IPO. + @rtype: Blender Curve + @return: a Blender Curve named C{curvename} in the C{ipo} Ipo + """ + try: + mycurve = ipo.getCurve(curvename) + if mycurve != None: + pass + else: + mycurve = ipo.addCurve(curvename) + except: + mycurve = ipo.addCurve(curvename) + return mycurve + +def eraseIPO (objectname): + object = Blender.Object.Get(objectname) + lIpo = object.getIpo() + if lIpo != None: + nbCurves = lIpo.getNcurves() + for i in range(nbCurves): + nbBezPoints = lIpo.getNBezPoints(i) + for j in range(nbBezPoints): + lIpo.delBezPoint(i) + +def comp_loc(emptyNameList): + myloc=Vector(0,0,0) + for emName in emptyNameList: + myobj = Blender.Object.Get(emName) + for i in range(3): + myloc[i]= myloc[i]+(myobj.loc[i]/len(emptyNameList)) #take the average loc of all marks + return myloc + +def comp_len(head, tail): # computes the length of a bone + headvec=comp_loc(head) + tailvec=comp_loc(tail) + netvec=headvec-tailvec + return netvec.length + +def createHumanCMU(): # human bone structure, makes a node set for CMU MoCap Lab + # order of bones: "spine","chest","neck","head",...face toward you in front view + # pose constraints are tuples of (type,target,influence,other-as-needed) + # constraint stack order is important. for proper bone pointing and orinetation: + # IK, then TT +YZ in world space. then LR XZ to 0 in world space, this points the bone, twists it, but then + # limits the rotation to the sidebar enpty with the Z facing it, and Y pointing along the bone. + nodes=[] # bonename, vector, parent, head targets, tail targets, constraint list + for i in range(23): nodes.append(Mybone("name","vec","par",[],[],[])) + nodes[0]= Mybone("root", "-Y","",["RBWT", "LBWT"],["RFWT", "LFWT", "RBWT", "LBWT"],[("LOC","RBWT",1.0),("LOC","LBWT",0.5),("IK","RFWT",1.0),("IK","LFWT",0.5),("TT","RBWT",1,"+YZ"),("LR","XZ",1)]) + nodes[1]= Mybone("spine","+Z","root",[],["STRN","T10"],[("IK","STRN",1.0),("IK","T10",0.5),("TT","STRN",1,"+YZ"),("LR","XZ",1)]) + nodes[2]= Mybone("chest","+Z","spine",[],["CLAV","C7"],[("IK","CLAV",1.0),("IK","C7",0.5),("TT","CLAV",1,"+YZ"),("LR","XZ",1)]) + nodes[3]= Mybone("neck", "+Z","chest",[],["RBHD","LBHD"],[("IK","RBHD",1.0),("IK","LBHD",0.5),("TT","LBHD",1,"+YZ"),("LR","XZ",1)]) + nodes[4]= Mybone("head" ,"-Y","neck",[],["RFHD","LFHD"],[("IK","RFHD",1.0),("IK","LFHD",0.5),("TT","LFHD",1,"+YZ"),("LR","XZ",1)]) + + nodes[5]= Mybone("shoulder.R","-X","chest",[],["RSHO"],[("IK","RSHO",1.0)]) + nodes[6]= Mybone("toparm.R", "-X","shoulder.R",[],["RELB"],[("IK","RELB",1.0),("TT","RUPA",1,"+YZ"),("LR","XZ",1)]) + nodes[7]= Mybone("lowarm.R", "-X","toparm.R",[],["RWRA","RWRB"],[("IK","RWRA",1.0),("IK","RWRB",0.5),("TT","RFRM",1,"+YZ"),("LR","XZ",1)]) + nodes[8]= Mybone("hand.R", "-X","lowarm.R",[],["RFIN"],[("IK","RFIN",1.0),("TT","RWRA",1,"+YZ"),("LR","XZ",1)]) #missing ,"RTHM" + + nodes[9]= Mybone("hip.R", "-X","root",[],["RFWT","RBWT"],[("IK","RFWT",1.0),("IK","RBWT",0.5)]) + nodes[10]=Mybone("topleg.R","-Z","hip.R",[],["RKNE"],[("IK","RKNE",1),("TT","RTHI",1,"+YZ"),("LR","XZ",1)]) + nodes[11]=Mybone("lowleg.R","-Z","topleg.R",[],["RANK","RHEE"],[("IK","RHEE",1.0),("TT","RSHN",1,"+YZ"),("LR","XZ",1)]) + nodes[12]=Mybone("foot.R", "-Y","lowleg.R",[],["RTOE","RMT5"],[("IK","RTOE",1.0),("IK","RMT5",0.2),("TT","RMT5",1,"+YZ")]) + nodes[13]=Mybone("toes.R", "-Y","foot.R",[],["RTOE"],[("IK","RTOE",1.0)]) + + nodes[14]=Mybone("shoulder.L","+X","chest",[],["LSHO"],[("IK","LSHO",1.0)]) + nodes[15]=Mybone("toparm.L", "+X","shoulder.L",[],["LELB"],[("IK","LELB",1.0),("TT","LUPA",1,"+YZ"),("LR","XZ",1)]) + nodes[16]=Mybone("lowarm.L", "+X","toparm.L",[],["LWRA","LWRB"],[("IK","LWRA",1.0),("IK","LWRB",0.5),("TT","LFRM",1,"+YZ"),("LR","XZ",1)]) + nodes[17]=Mybone("hand.L", "+X","lowarm.L",[],["LFIN"],[("IK","LFIN",1.0),("TT","RWRA",1,"+YZ"),("LR","XZ",1)]) #missing ,"LTHM" + + nodes[18]=Mybone("hip.L", "+X","root",[],["LFWT","LBWT"],[("IK","LFWT",1.0),("IK","LBWT",0.5)]) + nodes[19]=Mybone("topleg.L","-Z","hip.L",[],["LKNE"],[("IK","LKNE",1),("TT","LTHI",1,"+YZ"),("LR","XZ",1)]) + nodes[20]=Mybone("lowleg.L","-Z","topleg.L",[],["LANK","LHEE"],[("IK","LHEE",1.0),("TT","LSHN",1,"+YZ"),("LR","XZ",1)]) + nodes[21]=Mybone("foot.L", "-Y","lowleg.L",[],["LTOE","LMT5"],[("IK","LTOE",1.0),("IK","LMT5",0.2),("TT","LMT5",1,"+YZ"),("LR","XZ",1)]) + nodes[22]=Mybone("toes.L", "-Y","foot.L",[],["LTOE"],[("IK","LTOE",1.0)]) + return nodes + +def createNodes(marker_set): # make a list of bone name, parent, edit head loc, edit tail loc, pose constraints + #ultimately, I want to read in an XML file here that specifies the node trees for various marker sets + if marker_set==HUMAN_CMU: nodes= createHumanCMU() #load up and verify the file has the CMU marker set + elif marker_set==HUMAN_CMU2: nodes= createHumanCMU() + else: nodes=[] + return nodes +def findEntry(item,list): + for i in range(len(list)): + if item==list[i]: break + debug(100,"findEtnry %s is %i in list of %i items" % (item,i,len(list))) + return i +def makeNodes(prefix, markerList, empties, marker_set): #make sure the file has the nodes selected + nodes= createNodes(marker_set) # list has generic marker names; replace them with the actual object names created + #each entry in markerlist has a corresponding entry in empties in the same order + errList=[] + for i in range(len(nodes)): + node= nodes[i] + debug(60,"Adapting node %s to prefix %s" % (node,prefix)) + + #replace generic head markers with actual empty names + for im in range(len(node.headMark)): + marker= node.headMark[im] + mark= prefix+marker + imn= findEntry(mark,markerList) + if imn < len(markerList): + debug(90,"Adapating head marker %s to %s" % (marker,empties[imn].name)) + nodes[i].headMark[im]= empties[imn].name + else: errList.append([node.name,"head location",mark,node,2]) + + #replace generic tail markers with actual empty names + for im in range(len(node.tailMark)): + marker= node.tailMark[im] + mark= prefix+marker + imn= findEntry(mark,markerList) + if imn < len(markerList): + debug(90,"Adapating marker %s to %s" % (marker,empties[imn].name)) + nodes[i].tailMark[im]= empties[imn].name + else: errList.append([node.name,"tail location",mark,node,2]) + + #replace generic constraint markers (if the constraint references a marker) with empty name + for im in range(len(node.const)): + const=node.const[im] + if const[0] in ("LOC","IK","TT"): + marker=const[1] + mark= prefix+marker + imn= findEntry(mark,markerList) + if imn < len(markerList): + debug(90,"Adapating %s constraint marker %s to %s" % (const[0],marker,empties[imn].name)) + if const[0] in ("IK","LR","LOC"): + nodes[i].const[im]=(const[0], empties[imn].name, const[2]) + else: nodes[i].const[im]=(const[0], empties[imn].name, const[2], const[3]) + else: errList.append([node.name,const[0]+" constraint",mark,node,4]) + + if errList!=[]: #we have issues. + for err in errList: + debug(0,"Bone "+err[0]+" specifies "+err[2]+" as "+err[1]+"which was not specified in file.") + #need a popup here to ignore/cleanup node tree, or add the marker(?) or abort + usrOption= 1 + if usrOption==0: #ignore this marker (remove it) + for node in nodes: #find the bone in error + if node.name==err[0]: + print "Before",node + if err[3] in range(2,3): + node[err[3]].remove(err[2]) #find the marker in error and remove it + elif err[3]==4: #find the constraint and remove it + for const in node.const: + if const[1]==err[2]: node.const.remove(const) + print "After",node + elif usrOption==1: #add these markers as static empties, and user will automate them later + #and the bones will be keyed to them, so it will all be good. + #file may have just mis-named the empty, or the location can be derived based on other markers + em= GetOrCreateEmpty(err[2]) + else: abort() #abend + if DEBUG==100: status("Nodes Updated") + return nodes #nodes may be updated + +def makeBones(arm,nodes): + debug(20,"Making %i edit bones" % len(nodes)) + for node in nodes: + bone= Blender.Armature.Editbone() + bone.name= node.name + arm.bones[bone.name]= bone #add it to the armature + debug(50,"Bone added: %s" % bone) + if bone.name <> node.name: + debug(0,"ERROR: duplicate node % name specified" % node.name) + node.name= bone.name #you may not get what you asked for + if node.parent!="": #parent + debug(60,"Bone parent: %s"%node.parent) + bone.parent= arm.bones[node.parent] + bone.options = [Armature.CONNECTED] + #compute head = average of the reference empties + if node.headMark==[]: # no head explicitly stated, must be tail of parent + for parnode in nodes: + if node.parent==parnode.name: break + node.headMark= parnode.tailMark + node.head= parnode.tail + else: node.head= comp_loc(node.headMark) #node head is specified, probably only for root. + + bone.head= node.head + debug(60,"%s bone head: (%0.2f, %0.2f, %0.2f)" % (bone.name,bone.head.x, bone.head.y, bone.head.z)) + mylen=comp_len(node.headMark,node.tailMark) # length of the bone as it was recorded for that person + # for our T position, compute the bone length, add it to the head vector component to get the tail + if node.vec[0]=="-": mylen=-mylen + debug(80,"Bone vector %s length %0.2f" %(node.vec,mylen)) + node.tail= Vector(node.head) + myvec=node.vec[1].lower() + if myvec=="x": node.tail.x+=mylen + elif myvec=="y": node.tail.y+=mylen + elif myvec=="z": node.tail.z+=mylen + else: + debug(0,"%s %s %s %s" % (node.vec,myvec,node.vec[0],node.vec[1])) + error("ERROR IN BONE SPEC ") + bone.tail= node.tail + debug(60,"Bone tail: (%i,%i,%i)" %(bone.tail.x, bone.tail.y, bone.tail.z)) + #Armature created in the T postion, but with bone lengths to match the marker set and subject + #when this is constrained to the markers, the recorded action will be relative to a know Rotation + #so that all recorded actions should be interchangeable. wooot! + #Only have to adjust starting object loc when matching up actions. + return #arm #updated + +def makeConstLoc(pbone,const): + const_new= pbone.constraints.append(Constraint.Type.COPYLOC) + const_new.name = const[0]+"-"+const[1] + const_target=Blender.Object.Get(const[1]) + const_new[BCS.TARGET]= const_target + const_new.influence = const[2] + return + +def makeConstLimRot(pbone,const): + const_new= pbone.constraints.append(Constraint.Type.LIMITROT) + const_new.name = const[0]+"-"+const[1] + for axis in const[1]: + if axis.lower()=="x": const_new[BCS.LIMIT] |= BCS.LIMIT_XROT #set + if axis.lower()=="y": const_new[BCS.LIMIT] |= BCS.LIMIT_YROT #set + if axis.lower()=="z": const_new[BCS.LIMIT] |= BCS.LIMIT_ZROT #set + const_new[BCS.OWNERSPACE]= BCS.SPACE_LOCAL + const_new.influence = const[2] + # fyi, const[Constraint.Settings.LIMIT] &= ~Constraint.Settings.LIMIT_XROT #reset + return + +def makeConstIK(prefix,pbone,const): + #Blender 246 only supports one IK Solver per bone, but we might want many, + # so we need to create a reference empty named after the bone + # that floats between the markers, so the bone can point to it as a singularity + myob= GetOrCreateEmpty(prefix+pbone.name) + # note that this empty gets all the IK constraints added on + myconst= myob.constraints.append(Constraint.Type.COPYLOC) + myconst.name=const[0]+"-"+const[1] + myconst[Constraint.Settings.TARGET]= Blender.Object.Get(const[1]) + myconst.influence = const[2] + + #point the bone once to the empty via IK + success=False + for myconst in pbone.constraints: + if myconst.type == Constraint.Type.IKSOLVER: success=True + if not(success): #add an IK constraint to the bone to point to the empty + #print pbone + myconst= pbone.constraints.append(Constraint.Type.IKSOLVER) + myconst.name = const[1] + myconst[BCS.TARGET]= myob + myconst.influence = const[2] + #const_new[Constraint.Settings.BONE]= ? + myconst[BCS.CHAINLEN]= 1 + myconst[BCS.USETIP]= True + myconst[BCS.STRETCH]= False + return + +def makeConstTT(pbone,const): + myconst= pbone.constraints.append(Constraint.Type.TRACKTO) + myconst.name=const[0]+"-"+const[1] + debug(70,"%s %s" % (myconst,const[3])) + myob= GetOrCreateEmpty(const[1]) + myconst[BCS.TARGET]= myob + myconst.influence = const[2] + #const[3] is the Track and the thrird char is the Up indicator + myconst[BCS.TRACK]= trackto[const[3][0:2].lower()] + myconst[BCS.UP]=trackup[const[3][2].lower()]#up direction + myconst[BCS.OWNERSPACE]= BCS.SPACE_LOCAL + myconst[BCS.TARGETSPACE]= [BCS.SPACE_LOCAL] + if const[3][1]==const[3][2]: debug(0,"WARNING: Track To axis and up axis should not be the same. Constraint is INACTIVE") + return + +def makePoses(prefix,arm_ob,nodes): # pose this armature object based on node requirements + #this is constraint-based posing, not hard-keyed posing. + #we do constraint-based first so that user can adjust the constraints, possibly smooth/tweak motion + # add additional bones or referneces/constraints, before baking to hard keyframes + + pose= arm_ob.getPose() + debug(0,"Posing %s %s" % (arm_ob, pose)) + for node in nodes: + debug(30, "examining %s" %node) + if len(node.const)>0: #constraints for this bone are desired + pbone = pose.bones[node.name] + debug(40,"Posing bone %s" %pbone) + for const in node.const: + debug(50,"Constraining %s by %s" %(pbone,const)) + if const[0]=="LOC":makeConstLoc(pbone,const) + elif const[0]=="IK": makeConstIK(prefix,pbone,const) + elif const[0]=="LR": makeConstLimRot(pbone,const) + elif const[0]=="TT": makeConstTT(pbone,const) + else: + error("FATAL: constraint %s not supported" %const[0]) + break + debug(10, "Posing complete. Cycling pose and edit mode") + pose.update() + return + +def make_arm(subject,prefix,markerList, emptyList,marker_set): + debug(10,"**************************") + debug(00, "**** Making Armature for %s..." % subject) + debug(10, "**************************") + # copied from bvh import bvh_node_dict2armature; trying to use similar process for further integtration down the road + # Add the new armature, + + nodes= makeNodes(prefix, markerList, emptyList, marker_set) #assume everyone in file uses the same mocap suit + # each person in the file may be different height, so each needs their own new armature to match marker location + +## obs= Blender.Object.Get() +## success=False +## for ob in obs: +## if ob.name==subject: +## success=True +## if success: +## menu="Human Armature already exists for this subject." +## menu+="%t|Create another in this scene" +## menu+="%l|Start a new scene" +## menu+="%l|Use this armature" +## menusel= Draw.PupMenu(menu) + + arm= Blender.Armature.New(subject) #make an armature. + debug(10,"Created Armature %s" % arm) + # Put us into editmode + arm.makeEditable() + arm.drawType = Armature.OCTAHEDRON + makeBones(arm,nodes) + scn = Blender.Scene.GetCurrent() #add it to the current scene. could create new scenes here as yaf + arm_ob= scn.objects.new(arm) #instance it in the scene. this is the new way for 2.46 to instance objects + arm_ob.name= subject #name it something like the person it represents + arm_ob.layers= LAYERS_ARMOB + debug(20,"Instanced Armature %s" % arm_ob) + arm.update() #exit editmode. Arm must be instanced as an object before you can save changes or pose it + Blender.Redraw() # show the world + if DEBUG==100: status("T-Bones made.") + + makePoses(prefix,arm_ob,nodes) #constrain arm_ob with these markers + + scn.update(1) #make everyone behave themselves in the scene, and respect the new constraints + return arm_ob + +def setupAnim(StartFrame, EndFrame, VideoFrameRate): + debug(100, 'VideoFrameRate is %i' %VideoFrameRate) + if VideoFrameRate<1: VideoFrameRate=1 + if VideoFrameRate>120: VideoFrameRate=120 + # set up anim panel for them + context=scn.getRenderingContext() + context.startFrame(StartFrame) + context.endFrame(EndFrame) + context.framesPerSec(int(VideoFrameRate)) + Blender.Set("curframe",StartFrame) + Blender.Redraw() + return + +def makeCloud(Nmarkers,markerList,StartFrame,EndFrame,Markers): + debug(10, "**************************") + debug(00, "*** Making Cloud Formation") + debug(10, "**************************") + empties=[] + ipos=[] + curvesX=[] + curvesY=[] + curvesZ=[] + debug(0, "%i Markers (empty cloud) will be put on layers %s" % (Nmarkers,LAYERS_MARKER)) + # Empty Cloud formation + for i in range(Nmarkers): + debug(100,"%i marker %s"%(i, markerList[i])) + emptyname = markerList[i] # rdw: to use meaningful names from Points parameter + em= GetOrCreateEmpty(emptyname) #in this scene + #make a list of the actual empty + empties.append(em) + #assign it an ipo with the loc xyz curves + lipo = Ipo.New("Object",em.name) + ipos.append(lipo) + curvesX.append(GetOrCreateCurve(ipos[i],'LocX')) + curvesY.append(GetOrCreateCurve(ipos[i],'LocY')) + curvesZ.append(GetOrCreateCurve(ipos[i],'LocZ')) + empties[i].setIpo(ipos[i]) + debug(30,"Cloud of %i empties created." % len(empties)) + NvideoFrames= EndFrame-StartFrame+1 + debug(10, "**************************") + debug(00, "**** Calculating Marker Ipo Curves over %i Frames ..." % NvideoFrames) + debug(10, "**************************") + err= index=0 #number of errors, logical frame + for frame in range(StartFrame,EndFrame+1): + if index==0: start=sys.time() + elif index==100: + tmp=(NvideoFrames-100)*(sys.time()-start)/6000 + debug(0,"%i minutes process time estimated" % tmp) + elif index >100: print index*100/(NvideoFrames-1),"% complete\r", + for i in range(Nmarkers): + if Markers[index][i].z < 0: Markers[index][i].z= -Markers[index][i].z + success=True + if CLEAN: #check for good data + # C3D marker decoding may have coordinates negative (improper sign bit decoding?) + myX= abs(Markers[index][i].x) + myY= abs(Markers[index][i].y) + myZ= Markers[index][i].z + if myX > 10000 or myY > 10000 or myZ > 10000: success=False + if myX <.01 and myY <.01 and myZ <.01: success=False # discontinuity in marker tracking (lost marker) + + if success: + curvesX[i].append((frame, Markers[index][i].x)) #2.46 knot method + curvesY[i].append((frame, Markers[index][i].y)) + curvesZ[i].append((frame, Markers[index][i].z)) + if frame==StartFrame: debug(40, "%s loc frame %i: (%0.2f, %0.2f, %0.2f)" % (markerList[i],frame,Markers[index][i].x,Markers[index][i].y,Markers[index][i].z)) + else: + err+=1 # some files have thousands... + #debug(30,"Point ignored for marker:%s frame %i: (%i, %i, %i)" % (markerList[i],frame,Markers[index][i].x,Markers[index][i].y,Markers[index][i].z)) + index += 1 + debug(70, "%i points ignored across all markers and frames. Recalculating..." % err) + + for i in range(Nmarkers): + curvesX[i].Recalc() + curvesY[i].Recalc() + curvesZ[i].Recalc() + Blender.Set('curframe', StartFrame) + Blender.Redraw() + if DEBUG==100: status("Clound formed") + return empties + +def getNumber(str, length): + if length==2: # unsigned short + return struct.unpack('H',str[0:2])[0], str[2:] + sum = 0 + for i in range(length): + #sum = (sum << 8) + ord(str[i]) for big endian + sum = sum + ord(str[i])*(2**(8*i)) + return sum, str[length:] +def unpackFloat(chunk,proctype): + #print proctype + myvar=chunk[0:4] + if proctype==2: #DEC-VAX + myvar=chunk[2:4]+chunk[0:2] #swap lo=hi word order pair + return struct.unpack('f',myvar[0:4])[0] + +def getFloat(chunk,proctype): + return unpackFloat(chunk, proctype), chunk[4:] +def parseFloat(chunk,ptr,proctype): + return unpackFloat(chunk[ptr:ptr+4], proctype), ptr+4 + + +def load_c3d(FullFileName): +# Input: FullFileName - file (including path) to be read +# +# Variable: +# Markers 3D-marker data [Nmarkers x NvideoFrames x Ndim(=3)] +# VideoFrameRate Frames/sec +# AnalogSignals Analog signals [Nsignals x NanalogSamples ] +# AnalogFrameRate Samples/sec +# Event Event(Nevents).time ..value ..name +# ParameterGroup ParameterGroup(Ngroups).Parameters(Nparameters).data ..etc. +# CameraInfo MarkerRelated CameraInfo [Nmarkers x NvideoFrames] +# ResidualError MarkerRelated ErrorInfo [Nmarkers x NvideoFrames] + + Markers=[]; + VideoFrameRate=120; + AnalogSignals=[]; + AnalogFrameRate=0; + Event=[]; + ParameterGroups=[]; + CameraInfo=[]; + ResidualError=[]; + + debug(10, "*********************") + debug(10, "**** Opening File ***") + debug(10, "*********************") + + #ind=findstr(FullFileName,'\'); + #if ind>0, FileName=FullFileName(ind(length(ind))+1:length(FullFileName)); else FileName=FullFileName; end + debug(0, "FileName = " + FullFileName) + fid=open(FullFileName,'rb'); # native format (PC-intel). ideasman says maybe rU + content = fid.read(); + content_memory = content + #Header section + NrecordFirstParameterblock, content = getNumber(content,1) # Reading record number of parameter section + + key, content = getNumber(content,1) + if key!=80: + error('File: does not comply to the C3D format') + fid.close() + return + #Paramter section + content = content[512*(NrecordFirstParameterblock-1)+1:] # first word ignored + #file format spec says that 3rd byte=NumberofParmaterRecords... but is ignored here. + proctype,content =getNumber(content,1) + proctype = proctype-83 + proctypes= ["unknown","(INTEL-PC)","(DEC-VAX)","(MIPS-SUN/SGI)"] + + if proctype in (1,2): debug(0, "Processor coding %s"%proctypes[proctype]) + elif proctype==3: debug(0,"Program untested with %s"%proctypes[proctype]) + else: + debug(0, "INVALID processor type %i"%proctype) + proctype=1 + debug(0,"OVERRIDE processor type %i"%proctype) + + #if proctype==2, + # fclose(fid); + # fid=fopen(FullFileName,'r','d'); % DEC VAX D floating point and VAX ordering + #end + debug(10, "***********************") + debug(00, "**** Reading Header ***") + debug(10, "***********************") + + # ############################################### + # ## ## + # ## read header ## + # ## ## + # ############################################### + + #%NrecordFirstParameterblock=fread(fid,1,'int8'); % Reading record number of parameter section + #%key1=fread(fid,1,'int8'); % key = 80; + + content = content_memory + #fseek(fid,2,'bof'); + content = content[2:] + + # + Nmarkers, content=getNumber(content, 2) + NanalogSamplesPerVideoFrame, content = getNumber(content, 2) + StartFrame, content = getNumber(content, 2) + EndFrame, content = getNumber(content, 2) + MaxInterpolationGap, content = getNumber(content, 2) + + Scale, content = getFloat(content,proctype) + + NrecordDataBlock, content = getNumber(content, 2) + NanalogFramesPerVideoFrame, content = getNumber(content, 2) + + if NanalogFramesPerVideoFrame > 0: + NanalogChannels=NanalogSamplesPerVideoFrame/NanalogFramesPerVideoFrame + else: + NanalogChannels=0 + + VideoFrameRate, content = getFloat(content,proctype) + + AnalogFrameRate=VideoFrameRate*NanalogFramesPerVideoFrame + NvideoFrames = EndFrame - StartFrame + 1 + + debug(0, "Scale= %0.2f" %Scale) + debug(0, "NanalogFramesPerVideoFrame= %i" %NanalogFramesPerVideoFrame) + debug(0, "Video Frame Rate= %i" %VideoFrameRate) + debug(0, "AnalogFrame Rate= %i"%AnalogFrameRate) + debug(0, "# markers= %i" %Nmarkers) + debug(0, "StartFrame= %i" %StartFrame) + debug(0, "EndFrame= %i" %EndFrame) + debug(0, "# Video Frames= %i" %NvideoFrames) + + if Scale>0: + debug(0, "Marker data is in integer format") + if Scale>(XYZ_LIMIT/32767): + Scale=XYZ_LIMIT/32767.0 + debug(0, "OVERRIDE: Max coordinate is %i, Scale changed to %0.2f" % (XYZ_LIMIT,Scale)) + else: debug(0, "Marker data is in floating point format") + if VideoFrameRate<1 or VideoFrameRate>120: + VideoFrameRate= 120 + debug(0, "OVERRIDE Video Frame Rate= %i" %VideoFrameRate) + if proctype not in (1,2): # Intel, DEC are known good + debug(0, "OVERRIDE|Program not tested with this encoding. Set to Intel") + proctype= 1 + + debug(10, "***********************") + debug(10, "**** Reading Events ...") + debug(10, "***********************") + + content = content_memory + content = content[298:] #bizarre .. ce devrait être 150 selon la doc rdw skips first 299 bytes? + + EventIndicator, content = getNumber(content, 2) + EventTime=[] + EventValue=[] + EventName=[] + + debug(0, "Event Indicator = %i" %EventIndicator) + if EventIndicator==12345: #rdw: somehow, this original code seems fishy, but I cannot deny it. + Nevents, content = getNumber(content, 2) + debug(0, "Nevents= %i" %Nevents) + content = content[2:] + if Nevents>0: + for i in range(Nevents): + letime, content = getFloat(content,proctype) + EventTime.append(letime) + content = content_memory + content = content[188*2:] + for i in range(Nevents): + lavalue, content = getNumber(content, 1) + EventValue.append(lavalue) + content = content_memory + content = content[198*2:] + for i in range(Nevents): + lenom = content[0:4] + content = content[4:] + EventName.append(lenom) + + debug(00, "***************************") + debug(00, "**** Reading Parameters ...") + debug(10, "***************************") + subjects=[] # a name would be nice, but human will do + prefixes=[] # added on to mocap marker names, one for each subject + marker_subjects = [] # hopefully will be specified in the file and known to this program + markerList=[] + ParameterGroups = [] + ParameterNumberIndex = [] + + content = content_memory + content = content[512*(NrecordFirstParameterblock-1):] + + dat1, content = getNumber(content, 1) + key2, content = getNumber(content, 1) + + NparameterRecords, content = getNumber(content, 1) + debug(100, "NparameterRecords=%i"%NparameterRecords) + proctype,content =getNumber(content,1) + proctype = proctype-83 # proctype: 1(INTEL-PC); 2(DEC-VAX); 3(MIPS-SUN/SGI) + + for i in range(NparameterRecords): + leparam = ParameterGroup(None, None, []) + ParameterGroups.append(leparam) + ParameterNumberIndex.append(0) + # + Ncharacters, content = getNumber(content, 1) + if Ncharacters>=128: + Ncharacters = -(2**8)+(Ncharacters) + GroupNumber, content = getNumber(content, 1) + if GroupNumber>=128: + GroupNumber = -(2**8)+(GroupNumber) + debug(80,"GroupNumber = %i, Nchar=%i" %(GroupNumber,Ncharacters)) + + while Ncharacters > 0: + if GroupNumber<0: + GroupNumber=abs(GroupNumber) + GroupName = content[0:Ncharacters] + content = content[Ncharacters:] + #print "Group Number = ", GroupNumber + ParameterGroups[GroupNumber].name = GroupName + #print "ParameterGroupName =", GroupName + offset, content = getNumber(content, 2) + deschars, content = getNumber(content, 1) + GroupDescription = content[0:deschars] + content = content[deschars:] + ParameterGroups[GroupNumber].description = GroupDescription + # + ParameterNumberIndex[GroupNumber]=0 + content = content[offset-3-deschars:] + else: + + ParameterNumberIndex[GroupNumber]=ParameterNumberIndex[GroupNumber]+1 + ParameterNumber=ParameterNumberIndex[GroupNumber] + #print "ParameterNumber=", ParameterNumber + ParameterGroups[GroupNumber].parameter.append(Parameter(None, None, [], [], None)) + ParameterName = content[0:Ncharacters] + content = content[Ncharacters:] + #print "ParameterName = ",ParameterName + if len(ParameterName)>0: + ParameterGroups[GroupNumber].parameter[ParameterNumber-1].name=ParameterName + offset, content = getNumber(content, 2) + filepos = len(content_memory)-len(content) + nextrec = filepos+offset-2 + + type, content=getNumber(content, 1) + if type>=128: + type = -(2**8)+type + ParameterGroups[GroupNumber].parameter[ParameterNumber-1].type=type + + dimnum, content=getNumber(content, 1) + if dimnum == 0: + datalength = abs(type) + else: + mult=1 + dimension=[] + for j in range (dimnum): + ladim, content = getNumber(content, 1) + dimension.append(ladim) + mult=mult*dimension[j] + ParameterGroups[GroupNumber].parameter[ParameterNumber-1].dim.append(dimension[j]) + datalength = abs(type)*mult + + #print "ParameterNumber = ", ParameterNumber, " Group Number = ", GroupNumber + + if type==-1: + data = "" + wordlength=dimension[0] + if dimnum==2 and datalength>0: + for j in range(dimension[1]): + data=string.rstrip(content[0:wordlength]) + content = content[wordlength:] + ParameterGroups[GroupNumber].parameter[ParameterNumber-1].data.append(data) + elif dimnum==1 and datalength>0: + data=content[0:wordlength] + ParameterGroups[GroupNumber].parameter[ParameterNumber-1].data.append(data) # ??? + + myParam=string.rstrip(ParameterName) + myGroup=string.rstrip(GroupName) + msg= "-%s-%s-" % (myGroup,myParam) + if myGroup == "POINT": + if myParam== "LABELS": + # named in form of subject:marker. + # the list "empties" is a corresponding list of actual empty object names that make up the cloud + markerList= ParameterGroups[GroupNumber].parameter[ParameterNumber-1].data + debug(0, "%sLABELS = %i %s" %(msg, len(markerList),markerList)) #list of logical markers from 0 to n corresponding to points + elif myParam== "LABELS2": #more labels + # named in form of subject:marker. + # the list "empties" is a corresponding list of actual empty object names that make up the cloud + momarkList= ParameterGroups[GroupNumber].parameter[ParameterNumber-1].data + markerList+=momarkList + debug(0, "%sLABELS2 = %i %s" %(msg, len(momarkList),momarkList)) #list of logical markers from 0 to n corresponding to points + else: debug(70, "%s UNUSED = %s" %(msg,ParameterGroups[GroupNumber].parameter[ParameterNumber-1].data)) + elif myGroup in ["SUBJECT", "SUBJECTS"]: #info about the actor + if myParam in ["NAME", "NAMES"]: + subjects= ParameterGroups[GroupNumber].parameter[ParameterNumber-1].data + debug(0, "%sNames of Subjects = %s" %(msg, subjects)) # might be useful in naming armatures + for i in range(len(subjects)): + subjects[i]=subjects[i].rstrip() + if subjects[i]=="": subjects[i]="Human" + elif myParam == "LABEL_PREFIXES": + prefixes = ParameterGroups[GroupNumber].parameter[ParameterNumber-1].data + debug(0, "%sMarker Prefixes = %s" %(msg, prefixes)) # to xlate marker name to that in file + for i in range(len(prefixes)): + prefixes[i]=prefixes[i].rstrip() + elif myParam== "MARKER_SETS": + marker_subjects= ParameterGroups[GroupNumber].parameter[ParameterNumber-1].data + debug(0, "%sMarker Set = %s"%(msg, marker_subjects)) # marker set that each subject was wearing + elif myParam== "MODEL_PARAM": + action= ParameterGroups[GroupNumber].parameter[ParameterNumber-1].data + debug(0, "%sModel Paramter = %s"%(msg,action)) # might be a good name for the blender scene + elif myParam== "LABELS": + # named in form of subject:marker. + # the list "empties" is a corresponding list of actual empty object names that make up the cloud + markerList= ParameterGroups[GroupNumber].parameter[ParameterNumber-1].data + debug(0, "%sLABELS = %i %s"%(msg, len(markerList),markerList)) #list of logical markers from 0 to n corresponding to points + else: debug(70, "%sUNUSED = %s"%(msg, ParameterGroups[GroupNumber].parameter[ParameterNumber-1].data)) + else: + debug(70, "%sUNUSED = %s"%(msg, ParameterGroups[GroupNumber].parameter[ParameterNumber-1].data)) + elif type == 1: + debug(100,"Block type %i is largely unsupported and untested."%type) + data = [] + Nparameters=datalength/abs(type) + debug(100, "Nparameters=%i"%Nparameters) + for i in range(Nparameters): + ladata,content = getNumber(content, 1) + data.append(ladata) + ParameterGroups[GroupNumber].parameter[ParameterNumber-1].data=data + #print ParameterGroups[GroupNumber].parameter[ParameterNumber-1].data + + #print "type boolean" + elif type == 2 and datalength>0: + debug(100,"Block type %i is largely unsupported and untested."%type) + data = [] + Nparameters=datalength/abs(type) + debug(100, "Nparameters=%i"%Nparameters) + for i in range(Nparameters): + ladata,content = getNumber(content, 2) + data.append(ladata) + #ParameterGroups[GroupNumber].parameter[ParameterNumber-1].data=data + if dimnum>1: + #???? print "arg je comprends pas" + ParameterGroups[GroupNumber].parameter[ParameterNumber-1].data=data + #???ParameterGroups[GroupNumber].parameter[ParameterNumber-1].data=reshape(data,dimension) + else: + ParameterGroups[GroupNumber].parameter[ParameterNumber-1].data=data + #print ParameterGroups[GroupNumber].parameter[ParameterNumber-1].data + #pass + #print "type integer" + elif type == 4 and datalength>0: + debug(100,"Block type %i is largely unsupported and untested."%type) + data = [] + Nparameters=datalength/abs(type) + debug(100, "Nparameters=%i"%Nparameters) + for i in range(Nparameters): + ladata,content = getFloat(content,proctype) + data.append(ladata) + if dimnum>1: + ParameterGroups[GroupNumber].parameter[ParameterNumber-1].data=data + #print "arg je comprends pas" + #???ParameterGroups[GroupNumber].parameter[ParameterNumber-1].data=reshape(data,dimension) + else: + ParameterGroups[GroupNumber].parameter[ParameterNumber-1].data=data + #print ParameterGroups[GroupNumber].parameter[ParameterNumber-1].data + else: + debug(100,"Block type %i is largely unsupported and untested."%type) + #print "error" + pass + deschars, content= getNumber(content, 1) + if deschars>0: + description = content[0:deschars] + content = content[deschars:] + ParameterGroups[GroupNumber].parameter[ParameterNumber-1].description=description + + content = content_memory + content = content[nextrec:] + + Ncharacters,content = getNumber(content, 1) + if Ncharacters>=128: + Ncharacters = -(2**8)+(Ncharacters) + GroupNumber,content = getNumber(content, 1) + if GroupNumber>=128: + GroupNumber = -(2**8)+(GroupNumber) + debug(80,"GroupNumber = %i, Nchar=%i" %(GroupNumber,Ncharacters)) + + debug(00, "***************************") + debug(00, "**** Examining Parameters ...") + debug(10, "***************************") + + if len(subjects)==0: subjects=["Test"] #well, somebody got mocapped! + for i in range(0, len(subjects)-len(prefixes)): prefixes.append("") + for i in range(0, len(subjects)-len(marker_subjects)): marker_subjects.append(subjects[i]) + + #make a markerlist if they didn't + debug(0, "%i Markers specified, %i marker names supplied" %(Nmarkers,len(markerList))) + if len(markerList)==0: + debug(0, "File missing any POINT LABELS marker list. Making defaults") + #I guess just make cloud of empty.xxx + if len(markerList)XYZ_LIMIT or abs(myy)>XYZ_LIMIT or abs(myz)>XYZ_LIMIT: + err+=1 + if err>100: + debug(0, "Warning: 100 data points for markers seem way out there") + debug(0, "data read: (%i, %i, %i)" %(x,y,z)) + debug(0, "Consider revising Scale %0.2f" % Scale) + debug(0, "which now givs coordinates: (%i, %i, %i)" %(x*Scale,y*Scale,z*Scale)) + err=-0 + if abs(myx)>XYZ_LIMIT: myx= XYZ_LIMIT*myx/abs(myx) #preserve sign + if abs(myy)>XYZ_LIMIT: myy= XYZ_LIMIT*myy/abs(myy) #preserve sign + if abs(myz)>XYZ_LIMIT: myz= XYZ_LIMIT*myz/abs(myz) #preserve sign + Markers[i][j].x = myx + Markers[i][j].y = myy + Markers[i][j].z = myz + + a,ptr_read = parseFloat(content, ptr_read, proctype) + a = int(a) + highbyte = int(a/256) + lowbyte=a-highbyte*256 + CameraInfo[i][j] = highbyte + ResidualError[i][j] = lowbyte*abs(Scale) + #Monitor marker location to ensure data block is being parsed properly + if j==0: debug(90,"Frame %i loc of %s: (%i, %i, %i)" % (i,markerList[j],myx,myy,myz)) + if i==0: debug(50, "Initial loc of %s: (%i, %i, %i)" % (markerList[j],myx,myy,myz)) + + ptr_read+=residuals #skip over the following + #for j in range (NanalogFramesPerVideoFrame): + # for k in range(NanalogChannels): + # val, content = getNumber(content, 2) + # AnalogSignals[j+NanalogFramesPerVideoFrame*(i)][k]=val #??? i-1 + #else + # for i=1:NvideoFrames + # for j=1:Nmarkers + # Markers(i,j,1:3)=fread(fid,3,'int16')'.*Scale; + # ResidualError(i,j)=fread(fid,1,'int8'); + # CameraInfo(i,j)=fread(fid,1,'int8'); + # end + # waitbar(i/NvideoFrames) + # for j=1:NanalogFramesPerVideoFrame, + # AnalogSignals(j+NanalogFramesPerVideoFrame*(i-1),1:NanalogChannels)=... + # fread(fid,NanalogChannels,'int16')'; + # end + # end + #end + + else: #Scale is positive, but should be <1 to scale down, like 0.05 + two16= -2**16 + if len(content) < NvideoFrames*(Nmarkers*(6+2)+residuals): + error("%i bytes is not enough data for |%i frames|%i markers|%i residual" %(len(content),NvideoFrames,Nmarkers,residuals)) + #Note: I really tried to optimize this loop, since it was taking hours to process + for i in range(NvideoFrames): + if i==0: start=sys.time() + elif i==10: + tmp=(sys.time()-start)*NvideoFrames/600 + debug(0,"%i minutes remaining..." % tmp) + else: print "%i percent complete. On Frame %i Points procesed: %i\r" % (i*100/NvideoFrames,i,i*Nmarkers), + + for j in range(Nmarkers): + #x, content = getNumber(content,2) + # this is old skool signed int, not but not a short. + x = ord(content[ptr_read+0]) + (ord(content[ptr_read+1])<<8) + if x>32768: x+=two16 + y = ord(content[ptr_read+2]) + (ord(content[ptr_read+3])<<8) + if y>32768: y+=two16 + z = ord(content[ptr_read+4]) + (ord(content[ptr_read+5])<<8) + if z>32768: z+=two16 + +## +## x = ord(content[ptr_read]) + ord(content[ptr_read+1])*(2**8) +## ptr_read+=2 +## if x > 32768: +## x=-(2**16)+(x) +## #y, content = getNumber(content,2) +## y = ord(content[ptr_read]) + ord(content[ptr_read+1])*(2**8) +## ptr_read+=2 +## if y > 32768: +## y=-(2**16)+(y) +## #z, content = getNumber(content,2) +## z = ord(content[ptr_read]) + ord(content[ptr_read+1])*(2**8) +## ptr_read+=2 +## if z > 32768: +## z=-(2**16)+(z) +## +## print "(%i=%i, %i=%i, %i=%i)" %(x,myx,y,myy,z,myz) + + # for integers, I changed Scale above to avoid getting impossible numbers + Markers[i][j].x = x*Scale + Markers[i][j].y = y*Scale + Markers[i][j].z = z*Scale + +## ResidualError[i][j], content = getNumber(content, 1) +## CameraInfo[i][j], content = getNumber(content, 1) + #try to improve performance by: + ResidualError[i][j]= ord(content[ptr_read+6]) + CameraInfo[i][j]= ord(content[ptr_read+7]) + + content= content[ptr_read+8:] + ptr_read=0 + + if j==0: debug(100,"Frame %i loc of %s: %s" % (i,markerList[j],Markers[i][j])) + if i==0: debug(50, "Initial loc of %s: (%s)" % (markerList[j],Markers[i][j])) + + #for j in range (NanalogFramesPerVideoFrame): + # for k in range(NanalogChannels): + # val, content = getNumber(content, 2) + #AnalogSignals(j+NanalogFramesPerVideoFrame*(i-1),1:NanalogChannels)=val + ptr_read= residuals # skip over the above + print "\ndone with file." + fid.close() + + cloud= makeCloud(Nmarkers,markerList,StartFrame,EndFrame,Markers) + + setupAnim(StartFrame, EndFrame,VideoFrameRate) + + debug(10, "**************************") + debug(00, "**** Making %i Armatures" % len(subjects)) + debug(10, "**************************") + for i in range(len(subjects)): + marker_set= marker_subjects[i] + success=False + if len(marker_set)>0: + for trymark in MARKER_SETS: + if trymark[0:len(marker_set)]==marker_set: + marker_set=trymark + success=True + if success: + debug(0, "Armature for %s will be put on layers %s" % (subjects[i],LAYERS_ARMOB)) + debug(0, " based on an markers beginning with %s" % prefixes[i]) + ob= make_arm(subjects[i],prefixes[i],markerList,cloud,marker_set) + else: + debug(00, "Presently, this program can automatically create a constrained armature for marker sets %s" % MARKER_SETS) + debug(00, "%s uses an unknown marker set %s" % (subjects[i],marker_set)) + debug(10, "Have a nice day! If you figure out an armature node system for this cloud, please add it to the program.") + + debug(10, "**************************") + debug(00, "**** Conclusion") + minmax=[0,0,0,0,0,0] + for i in range(NvideoFrames): + for j in range(Nmarkers): + if minmax[0]>Markers[i][j].x: minmax[0]=Markers[i][j].x + if minmax[1]>Markers[i][j].y: minmax[1]=Markers[i][j].y + if minmax[2]>Markers[i][j].z: minmax[2]=Markers[i][j].z + if minmax[3]flag= chan->flag; con= chan->constraints.first; - for(pcon= pchan->constraints.first; pcon; pcon= pcon->next) { + for(pcon= pchan->constraints.first; pcon; pcon= pcon->next, con= con->next) { pcon->enforce= con->enforce; pcon->headtail= con->headtail; } diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index b2557c9c07e..c73279746fb 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -857,8 +857,8 @@ void BKE_add_image_extension(char *string, int imtype) extension= ".bmp"; } else if(G.have_libtiff && (imtype==R_TIFF)) { - if(!BLI_testextensie(string, ".tif")) - extension= ".tif"; + if(!BLI_testextensie(string, ".tif") && + !BLI_testextensie(string, ".tiff")) extension= ".tif"; } #ifdef WITH_OPENEXR else if( ELEM(imtype, R_OPENEXR, R_MULTILAYER)) { diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 321d4f1d37e..59eb3837aab 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -1859,7 +1859,7 @@ void set_icu_vars(IpoCurve *icu) /* yafray: aperture & focal distance params */ switch(icu->adrcode) { case CAM_LENS: - icu->ymin= 5.0; + icu->ymin= 1.0; icu->ymax= 1000.0; break; case CAM_STA: diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 561a97d8646..d3cc451c6fc 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -1424,10 +1424,10 @@ void vertgroup_flip_name (char *name, int strip_number) } static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd, - Object *ob, - DerivedMesh *dm, - int initFlags, - int axis) + Object *ob, + DerivedMesh *dm, + int initFlags, + int axis) { int i; float tolerance = mmd->tolerance; @@ -1436,7 +1436,7 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd, int maxVerts = dm->getNumVerts(dm); int maxEdges = dm->getNumEdges(dm); int maxFaces = dm->getNumFaces(dm); - int vector_size, j, a, b; + int vector_size=0, j, a, b; bDeformGroup *def, *defb; bDeformGroup **vector_def = NULL; int (*indexMap)[2]; @@ -1465,7 +1465,7 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd, if (mmd->mirror_ob) { float obinv[4][4]; - + Mat4Invert(obinv, mmd->mirror_ob->obmat); Mat4MulMat4(mtx, ob->obmat, obinv); Mat4Invert(imtx, mtx); @@ -1476,16 +1476,16 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd, MVert *mv = CDDM_get_vert(result, numVerts); int isShared; float co[3]; - + dm->getVert(dm, i, &inMV); - + VecCopyf(co, inMV.co); - + if (mmd->mirror_ob) { VecMat4MulVecfl(co, mtx, co); } isShared = ABS(co[axis])<=tolerance; - + /* Because the topology result (# of vertices) must be the same if * the mesh data is overridden by vertex cos, have to calc sharedness * based on original coordinates. This is why we test before copy. @@ -1493,10 +1493,10 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd, DM_copy_vert_data(dm, result, i, numVerts, 1); *mv = inMV; numVerts++; - + indexMap[i][0] = numVerts - 1; indexMap[i][1] = !isShared; - + if(isShared) { co[axis] = 0; if (mmd->mirror_ob) { @@ -1508,33 +1508,33 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd, } else { MVert *mv2 = CDDM_get_vert(result, numVerts); MDeformVert *dvert = NULL; - + DM_copy_vert_data(dm, result, i, numVerts, 1); *mv2 = *mv; - + co[axis] = -co[axis]; if (mmd->mirror_ob) { VecMat4MulVecfl(co, imtx, co); } VecCopyf(mv2->co, co); - + if (mmd->flag & MOD_MIR_VGROUP){ dvert = DM_get_vert_data(result, numVerts, CD_MDEFORMVERT); - + if (dvert) { for(j = 0; j < dvert[0].totweight; ++j) { char tmpname[32]; - + if(dvert->dw[j].def_nr < 0 || dvert->dw[j].def_nr >= vector_size) continue; - + def = vector_def[dvert->dw[j].def_nr]; strcpy(tmpname, def->name); vertgroup_flip_name(tmpname,0); - + for(b = 0, defb = ob->defbase.first; defb; defb = defb->next, b++) { @@ -1547,7 +1547,7 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd, } } } - + numVerts++; } } @@ -1555,25 +1555,25 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd, for(i = 0; i < maxEdges; i++) { MEdge inMED; MEdge *med = CDDM_get_edge(result, numEdges); - + dm->getEdge(dm, i, &inMED); - + DM_copy_edge_data(dm, result, i, numEdges, 1); *med = inMED; numEdges++; - + med->v1 = indexMap[inMED.v1][0]; med->v2 = indexMap[inMED.v2][0]; if(initFlags) med->flag |= ME_EDGEDRAW | ME_EDGERENDER; - + if(indexMap[inMED.v1][1] || indexMap[inMED.v2][1]) { MEdge *med2 = CDDM_get_edge(result, numEdges); - + DM_copy_edge_data(dm, result, i, numEdges, 1); *med2 = *med; numEdges++; - + med2->v1 += indexMap[inMED.v1][1]; med2->v2 += indexMap[inMED.v2][1]; } @@ -1582,13 +1582,13 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd, for(i = 0; i < maxFaces; i++) { MFace inMF; MFace *mf = CDDM_get_face(result, numFaces); - + dm->getFace(dm, i, &inMF); - + DM_copy_face_data(dm, result, i, numFaces, 1); *mf = inMF; numFaces++; - + mf->v1 = indexMap[inMF.v1][0]; mf->v2 = indexMap[inMF.v2][0]; mf->v3 = indexMap[inMF.v3][0]; @@ -1600,15 +1600,15 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd, || (mf->v4 && indexMap[inMF.v4][1])) { MFace *mf2 = CDDM_get_face(result, numFaces); static int corner_indices[4] = {2, 1, 0, 3}; - + DM_copy_face_data(dm, result, i, numFaces, 1); *mf2 = *mf; - + mf2->v1 += indexMap[inMF.v1][1]; mf2->v2 += indexMap[inMF.v2][1]; mf2->v3 += indexMap[inMF.v3][1]; if(inMF.v4) mf2->v4 += indexMap[inMF.v4][1]; - + /* mirror UVs if enabled */ if(mmd->flag & (MOD_MIR_MIRROR_U | MOD_MIR_MIRROR_V)) { MTFace *tf = result->getFaceData(result, numFaces, CD_MTFACE); @@ -1622,14 +1622,14 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd, } } } - + /* Flip face normal */ SWAP(int, mf2->v1, mf2->v3); DM_swap_face_data(result, numFaces, corner_indices); - + test_index_face(mf2, &result->faceData, numFaces, inMF.v4?4:3); numFaces++; - } + } } if (vector_def) MEM_freeN(vector_def); @@ -1644,8 +1644,8 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd, } static DerivedMesh *mirrorModifier__doMirror(MirrorModifierData *mmd, - Object *ob, DerivedMesh *dm, - int initFlags) + Object *ob, DerivedMesh *dm, + int initFlags) { DerivedMesh *result = dm; diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index f06ef221795..458171cc232 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -2596,6 +2596,7 @@ static void precalc_effectors(Object *ob, ParticleSystem *psys, ParticleSystemMo for(ec= lb->first; ec; ec= ec->next) { PartDeflect *pd= ec->ob->pd; + co = NULL; if(ec->type==PSYS_EC_EFFECTOR && pd->forcefield==PFIELD_GUIDE && ec->ob->type==OB_CURVE && part->phystype!=PART_PHYS_BOIDS) { diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c index 92544f19721..16ca5d7542d 100644 --- a/source/blender/blenkernel/intern/sca.c +++ b/source/blender/blenkernel/intern/sca.c @@ -465,6 +465,9 @@ void init_actuator(bActuator *act) case ACT_PARENT: act->data = MEM_callocN(sizeof( bParentActuator ), "parent act"); break; + case ACT_STATE: + act->data = MEM_callocN(sizeof( bStateActuator ), "state act"); + break; default: ; /* this is very severe... I cannot make any memory for this */ /* logic brick... */ diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 876547042dc..53b7bb975a3 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -942,7 +942,8 @@ char *txt_to_buf (Text *text) if (!text) return NULL; if (!text->curl) return NULL; if (!text->sell) return NULL; - + if (!text->lines.first) return NULL; + linef= text->lines.first; charf= 0; diff --git a/source/blender/blenlib/BLI_arithb.h b/source/blender/blenlib/BLI_arithb.h index 4d277cf98e1..4fa880c36d1 100644 --- a/source/blender/blenlib/BLI_arithb.h +++ b/source/blender/blenlib/BLI_arithb.h @@ -374,6 +374,7 @@ void LocQuatSizeToMat4(float mat[][4], float loc[3], float quat[4], float size[3 void tubemap(float x, float y, float z, float *u, float *v); void spheremap(float x, float y, float z, float *u, float *v); +int LineIntersectLine(float v1[3], float v2[3], float v3[3], float v4[3], float i1[3], float i2[3]); int LineIntersectsTriangle(float p1[3], float p2[3], float v0[3], float v1[3], float v2[3], float *lambda, float *uv); int RayIntersectsTriangle(float p1[3], float d[3], float v0[3], float v1[3], float v2[3], float *lambda, float *uv); int SweepingSphereIntersectsTriangleUV(float p1[3], float p2[3], float radius, float v0[3], float v1[3], float v2[3], float *lambda, float *ipoint); diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index 322a9e6fd02..2084ab3da5f 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -4032,6 +4032,74 @@ int AxialLineIntersectsTriangle(int axis, float p1[3], float p2[3], float v0[3], return 1; } +/* Returns the number of point of interests + * 0 - lines are colinear + * 1 - lines are coplanar, i1 is set to intersection + * 2 - i1 and i2 are the nearest points on line 1 (v1, v2) and line 2 (v3, v4) respectively + * */ +int LineIntersectLine(float v1[3], float v2[3], float v3[3], float v4[3], float i1[3], float i2[3]) +{ + float a[3], b[3], c[3], ab[3], cb[3], dir1[3], dir2[3]; + float d; + + VecSubf(c, v3, v1); + VecSubf(a, v2, v1); + VecSubf(b, v4, v3); + + VecCopyf(dir1, a); + Normalize(dir1); + VecCopyf(dir2, b); + Normalize(dir2); + d = Inpf(dir1, dir2); + if (d == 1.0f || d == -1.0f) { + /* colinear */ + return 0; + } + + Crossf(ab, a, b); + d = Inpf(c, ab); + + /* test if the two lines are coplanar */ + if (d > -0.000001f && d < 0.000001f) { + Crossf(cb, c, b); + + VecMulf(a, Inpf(cb, ab) / Inpf(ab, ab)); + VecAddf(i1, v1, a); + VecCopyf(i2, i1); + + return 1; /* one intersection only */ + } + /* if not */ + else { + float n[3], t[3]; + float v3t[3], v4t[3]; + VecSubf(t, v1, v3); + + /* offset between both plane where the lines lies */ + Crossf(n, a, b); + Projf(t, t, n); + + /* for the first line, offset the second line until it is coplanar */ + VecAddf(v3t, v3, t); + VecAddf(v4t, v4, t); + + VecSubf(c, v3t, v1); + VecSubf(a, v2, v1); + VecSubf(b, v4t, v3); + + Crossf(ab, a, b); + Crossf(cb, c, b); + + VecMulf(a, Inpf(cb, ab) / Inpf(ab, ab)); + VecAddf(i1, v1, a); + + /* for the second line, just substract the offset from the first intersection point */ + VecSubf(i2, i1, t); + + return 2; /* two nearest points */ + } +} + int AabbIntersectAabb(float min1[3], float max1[3], float min2[3], float max2[3]) { return (min1[0]data; parenta->ob = newlibadr(fd, ob->id.lib, parenta->ob); } + else if(act->type==ACT_STATE) { + /* bStateActuator *statea = act->data; */ + } act= act->next; } @@ -3307,11 +3310,19 @@ static void direct_link_object(FileData *fd, Object *ob) direct_link_constraints(fd, &ob->constraints); link_glob_list(fd, &ob->controllers); + if (ob->init_state) { + /* if a known first state is specified, set it so that the game will start ok */ + ob->state = ob->init_state; + } else if (!ob->state) { + ob->state = 1; + } cont= ob->controllers.first; while(cont) { cont->data= newdataadr(fd, cont->data); cont->links= newdataadr(fd, cont->links); test_pointer_array(fd, (void **)&cont->links); + if (cont->state_mask == 0) + cont->state_mask = 1; cont= cont->next; } @@ -7635,6 +7646,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } + /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */ diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 2595b95bbf0..9f28e13ff7b 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -715,6 +715,9 @@ static void write_actuators(WriteData *wd, ListBase *lb) case ACT_PARENT: writestruct(wd, DATA, "bParentActuator", 1, act->data); break; + case ACT_STATE: + writestruct(wd, DATA, "bStateActuator", 1, act->data); + break; default: ; /* error: don't know how to write this file */ } diff --git a/source/blender/imbuf/IMB_imbuf_types.h b/source/blender/imbuf/IMB_imbuf_types.h index 94203bab447..73ef83393b0 100644 --- a/source/blender/imbuf/IMB_imbuf_types.h +++ b/source/blender/imbuf/IMB_imbuf_types.h @@ -149,6 +149,7 @@ typedef enum { #define IB_zbuffloat (1 << 16) #define IB_multilayer (1 << 17) #define IB_imginfo (1 << 18) +#define IB_animdeinterlace (1 << 19) /* * The bit flag is stored in the ImBuf.ftype variable. diff --git a/source/blender/imbuf/intern/IMB_anim.h b/source/blender/imbuf/intern/IMB_anim.h index 71d35949833..7dc1f966b71 100644 --- a/source/blender/imbuf/intern/IMB_anim.h +++ b/source/blender/imbuf/intern/IMB_anim.h @@ -183,8 +183,9 @@ struct anim { AVFormatContext *pFormatCtx; AVCodecContext *pCodecCtx; AVCodec *pCodec; - AVFrame *pFrameRGB; AVFrame *pFrame; + AVFrame *pFrameRGB; + AVFrame *pFrameDeinterlaced; struct SwsContext *img_convert_ctx; int videoStream; #endif diff --git a/source/blender/imbuf/intern/anim.c b/source/blender/imbuf/intern/anim.c index 87d67f5263b..720f5b0f7c8 100644 --- a/source/blender/imbuf/intern/anim.c +++ b/source/blender/imbuf/intern/anim.c @@ -600,6 +600,7 @@ static int startffmpeg(struct anim * anim) { anim->videoStream = videoStream; anim->pFrame = avcodec_alloc_frame(); + anim->pFrameDeinterlaced = avcodec_alloc_frame(); anim->pFrameRGB = avcodec_alloc_frame(); if (avpicture_get_size(PIX_FMT_BGR32, anim->x, anim->y) @@ -609,10 +610,20 @@ static int startffmpeg(struct anim * anim) { avcodec_close(anim->pCodecCtx); av_close_input_file(anim->pFormatCtx); av_free(anim->pFrameRGB); + av_free(anim->pFrameDeinterlaced); av_free(anim->pFrame); return -1; } + if (anim->ib_flags & IB_animdeinterlace) { + avpicture_fill((AVPicture*) anim->pFrameDeinterlaced, + MEM_callocN(avpicture_get_size( + anim->pCodecCtx->pix_fmt, + anim->x, anim->y), + "ffmpeg deinterlace"), + anim->pCodecCtx->pix_fmt, anim->x, anim->y); + } + if (pCodecCtx->has_b_frames) { anim->preseek = 25; /* FIXME: detect gopsize ... */ } else { @@ -638,12 +649,13 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position) { AVPacket packet; int64_t pts_to_search = 0; int pos_found = 1; + int filter_y = 0; if (anim == 0) return (0); ibuf = IMB_allocImBuf(anim->x, anim->y, 24, IB_rect, 0); - avpicture_fill((AVPicture *)anim->pFrameRGB, + avpicture_fill((AVPicture*) anim->pFrameRGB, (unsigned char*) ibuf->rect, PIX_FMT_BGR32, anim->x, anim->y); @@ -722,6 +734,32 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position) { } if(frameFinished && pos_found == 1) { + AVFrame * input = anim->pFrame; + + /* This means the data wasnt read properly, + this check stops crashing */ + if (input->data[0]==0 && input->data[1]==0 + && input->data[2]==0 && input->data[3]==0){ + av_free_packet(&packet); + break; + } + + if (anim->ib_flags & IB_animdeinterlace) { + if (avpicture_deinterlace( + (AVPicture*) + anim->pFrameDeinterlaced, + (const AVPicture*) + anim->pFrame, + anim->pCodecCtx->pix_fmt, + anim->pCodecCtx->width, + anim->pCodecCtx->height) + < 0) { + filter_y = 1; + } else { + input = anim->pFrameDeinterlaced; + } + } + if (G.order == B_ENDIAN) { int * dstStride = anim->pFrameRGB->linesize; @@ -735,8 +773,8 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position) { unsigned char* top; sws_scale(anim->img_convert_ctx, - anim->pFrame->data, - anim->pFrame->linesize, + input->data, + input->linesize, 0, anim->pCodecCtx->height, dst2, @@ -793,27 +831,25 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position) { int i; unsigned char* r; - /* This means the data wasnt read properly, this check stops crashing */ - if (anim->pFrame->data[0]!=0 || anim->pFrame->data[1]!=0 || anim->pFrame->data[2]!=0 || anim->pFrame->data[3]!=0) { - sws_scale(anim->img_convert_ctx, - anim->pFrame->data, - anim->pFrame->linesize, - 0, - anim->pCodecCtx->height, - dst2, - dstStride2); + sws_scale(anim->img_convert_ctx, + input->data, + input->linesize, + 0, + anim->pCodecCtx->height, + dst2, + dstStride2); - /* workaround: sws_scale - sets alpha = 0... */ + /* workaround: sws_scale + sets alpha = 0... */ - r = (unsigned char*) ibuf->rect; - - for (i = 0; i < ibuf->x * ibuf->y;i++){ - r[3] = 0xff; - r+=4; - } + r = (unsigned char*) ibuf->rect; + + for (i = 0; i < ibuf->x * ibuf->y;i++){ + r[3] = 0xff; + r+=4; } + av_free_packet(&packet); break; } @@ -823,6 +859,10 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position) { av_free_packet(&packet); } + if (filter_y && ibuf) { + IMB_filtery(ibuf); + } + return(ibuf); } @@ -834,6 +874,11 @@ static void free_anim_ffmpeg(struct anim * anim) { av_close_input_file(anim->pFormatCtx); av_free(anim->pFrameRGB); av_free(anim->pFrame); + + if (anim->ib_flags & IB_animdeinterlace) { + MEM_freeN(anim->pFrameDeinterlaced->data[0]); + } + av_free(anim->pFrameDeinterlaced); sws_freeContext(anim->img_convert_ctx); } anim->duration = 0; @@ -983,6 +1028,7 @@ struct ImBuf * IMB_anim_absolute(struct anim * anim, int position) { char head[256], tail[256]; unsigned short digits; int pic; + int filter_y = (anim->ib_flags & IB_animdeinterlace); if (anim == NULL) return(0); @@ -1040,6 +1086,7 @@ struct ImBuf * IMB_anim_absolute(struct anim * anim, int position) { case ANIM_FFMPEG: ibuf = ffmpeg_fetchibuf(anim, position); if (ibuf) anim->curposition = position; + filter_y = 0; /* done internally */ break; #endif #ifdef WITH_REDCODE @@ -1052,6 +1099,7 @@ struct ImBuf * IMB_anim_absolute(struct anim * anim, int position) { if (ibuf) { if (anim->ib_flags & IB_ttob) IMB_flipy(ibuf); + if (filter_y) IMB_filtery(ibuf); sprintf(ibuf->name, "%s.%04d", anim->name, anim->curposition + 1); } diff --git a/source/blender/include/BIF_butspace.h b/source/blender/include/BIF_butspace.h index cbbd8013c82..f0b37814947 100644 --- a/source/blender/include/BIF_butspace.h +++ b/source/blender/include/BIF_butspace.h @@ -99,6 +99,8 @@ extern void validate_editbonebutton_cb(void *bonev, void *namev); #define BUTS_ACT_SEL 64 #define BUTS_ACT_ACT 128 #define BUTS_ACT_LINK 256 +#define BUTS_SENS_STATE 512 +#define BUTS_ACT_STATE 1024 /* buttons grid */ diff --git a/source/blender/include/BIF_interface.h b/source/blender/include/BIF_interface.h index fbd4e4ecd91..3da4466d4d3 100644 --- a/source/blender/include/BIF_interface.h +++ b/source/blender/include/BIF_interface.h @@ -185,6 +185,7 @@ void uiDrawBlock(struct uiBlock *block); void uiGetMouse(int win, short *adr); void uiComposeLinks(uiBlock *block); void uiSetButLock(int val, char *lockstr); +uiBut *uiFindInlink(uiBlock *block, void *poin); void uiClearButLock(void); int uiDoBlocks(struct ListBase *lb, int event, int movemouse_quit); void uiSetCurFont(uiBlock *block, int index); diff --git a/source/blender/include/BIF_oops.h b/source/blender/include/BIF_oops.h index adeac4f3871..2375a918d0e 100644 --- a/source/blender/include/BIF_oops.h +++ b/source/blender/include/BIF_oops.h @@ -43,6 +43,8 @@ struct Camera; struct Texture; struct Lattice; struct bArmature; +struct Tex; + void add_curve_oopslinks(struct Curve *cu, struct Oops *oops, short flag); void add_from_link(struct Oops *from, struct Oops *oops); void add_material_oopslinks(struct Material *ma, struct Oops *oops, short flag); diff --git a/source/blender/include/butspace.h b/source/blender/include/butspace.h index 7571d64be91..c0542e3f34c 100644 --- a/source/blender/include/butspace.h +++ b/source/blender/include/butspace.h @@ -52,6 +52,8 @@ struct Image; #define BUTS_ACT_SEL 64 #define BUTS_ACT_ACT 128 #define BUTS_ACT_LINK 256 +#define BUTS_SENS_STATE 512 +#define BUTS_ACT_STATE 1024 /* internal */ @@ -583,6 +585,8 @@ void curvemap_buttons(struct uiBlock *block, struct CurveMapping *cumap, char la #define B_SETACTOR 2715 #define B_SETMAINACTOR 2716 #define B_SETDYNA 2717 +#define B_SET_STATE_BIT 2718 +#define B_INIT_STATE_BIT 2719 /* *********************** */ #define B_FPAINTBUTS 2900 diff --git a/source/blender/include/transform.h b/source/blender/include/transform.h index 7d497dc05ec..4e3b80134f9 100644 --- a/source/blender/include/transform.h +++ b/source/blender/include/transform.h @@ -102,9 +102,9 @@ typedef struct TransCon { /* Apply function pointer for linear vectorial transformation */ /* The last three parameters are pointers to the in/out/printable vectors */ void (*applySize)(struct TransInfo *, struct TransData *, float [3][3]); - /* Apply function pointer for rotation transformation (prototype will change */ - void (*applyRot)(struct TransInfo *, struct TransData *, float [3]); - /* Apply function pointer for rotation transformation (prototype will change */ + /* Apply function pointer for size transformation */ + void (*applyRot)(struct TransInfo *, struct TransData *, float [3], float *); + /* Apply function pointer for rotation transformation */ } TransCon; typedef struct TransDataIpokey { diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h index a326f5b01d6..51f03a676e4 100644 --- a/source/blender/makesdna/DNA_actuator_types.h +++ b/source/blender/makesdna/DNA_actuator_types.h @@ -50,6 +50,7 @@ typedef struct bActionActuator { short type, flag; /* Playback type */ int sta, end; /* Start & End frames */ char name[32]; /* For property-driven playback */ + char frameProp[32]; /* Set this property to the actions current frame */ int blendin; /* Number of frames of blending */ short priority; /* Execution priority */ short strideaxis; /* Displacement axis */ @@ -80,7 +81,7 @@ typedef struct bEditObjectActuator { char name[32]; float linVelocity[3]; /* initial lin. velocity on creation */ short localflag; /* flag for the lin. vel: apply locally */ - short pad; + short dyn_operation; } bEditObjectActuator; typedef struct bSceneActuator { @@ -97,7 +98,8 @@ typedef struct bPropertyActuator { } bPropertyActuator; typedef struct bObjectActuator { - int flag, type; + short flag, type; + int damping; float forceloc[3], forcerot[3]; float loc[3], rot[3]; float dloc[3], drot[3]; @@ -190,11 +192,13 @@ typedef struct bVisibilityActuator { } bVisibilityActuator; typedef struct bTwoDFilterActuator{ - char pad[4]; - /* Tells what type of 2D Filter*/ + char pad[2]; + /* bitwise flag for enabling or disabling depth(bit 0) and luminance(bit 1) */ + short texture_flag; + /* Tells what type of 2D Filter */ short type; /* (flag == 0) means 2D filter is activate and - (flag != 0) means 2D filter is inactive*/ + (flag != 0) means 2D filter is inactive */ short flag; int int_arg; /* a float argument */ @@ -208,6 +212,11 @@ typedef struct bParentActuator { struct Object *ob; } bParentActuator; +typedef struct bStateActuator { + int type; /* 0=Set, 1=Add, 2=Rem, 3=Chg */ + unsigned int mask; /* the bits to change */ +} bStateActuator; + typedef struct bActuator { struct bActuator *next, *prev, *mynew; short type; @@ -246,6 +255,7 @@ typedef struct FreeCamera { #define ACT_ANG_VEL_LOCAL 32 //#define ACT_ADD_LIN_VEL_LOCAL 64 #define ACT_ADD_LIN_VEL 64 +#define ACT_CLAMP_VEL 128 #define ACT_OBJECT_FORCE 0 #define ACT_OBJECT_TORQUE 1 @@ -279,11 +289,14 @@ typedef struct FreeCamera { #define ACT_2DFILTER 19 #define ACT_PARENT 20 #define ACT_SHAPEACTION 21 +#define ACT_STATE 22 /* actuator flag */ #define ACT_SHOW 1 #define ACT_DEL 2 #define ACT_NEW 4 +#define ACT_LINKED 8 +#define ACT_VISIBLE 16 /* link codes */ #define LINK_SENSOR 0 @@ -349,10 +362,11 @@ typedef struct FreeCamera { /* editObjectActuator->type */ #define ACT_EDOB_ADD_OBJECT 0 #define ACT_EDOB_END_OBJECT 1 -#define ACT_EDOB_REPLACE_MESH 2 +#define ACT_EDOB_REPLACE_MESH 2 #define ACT_EDOB_TRACK_TO 3 -#define ACT_EDOB_MAKE_CHILD 4 -#define ACT_EDOB_END_CHILD 5 +#define ACT_EDOB_DYNAMICS 4 + + /* editObjectActuator->flag */ #define ACT_TRACK_3D 1 diff --git a/source/blender/makesdna/DNA_controller_types.h b/source/blender/makesdna/DNA_controller_types.h index 95c9b0d0cf7..376f95b0145 100644 --- a/source/blender/makesdna/DNA_controller_types.h +++ b/source/blender/makesdna/DNA_controller_types.h @@ -57,7 +57,7 @@ typedef struct bController { struct bSensor **slinks; short val, valo; - int pad5; + unsigned int state_mask; } bController; @@ -66,11 +66,16 @@ typedef struct bController { #define CONT_LOGIC_OR 1 #define CONT_EXPRESSION 2 #define CONT_PYTHON 3 +#define CONT_LOGIC_NAND 4 +#define CONT_LOGIC_NOR 5 +#define CONT_LOGIC_XOR 6 +#define CONT_LOGIC_XNOR 7 /* controller->flag */ #define CONT_SHOW 1 #define CONT_DEL 2 #define CONT_NEW 4 +#define CONT_MASK 8 #endif diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 83168248b9a..c4e8cb4925b 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -216,7 +216,9 @@ typedef struct Object { struct DerivedMesh *derivedDeform, *derivedFinal; int lastDataMask; /* the custom data layer mask that was last used to calculate derivedDeform and derivedFinal */ - int pad; + unsigned int state; /* bit masks of game controllers that are active */ + unsigned int init_state; /* bit masks of initial state as recorded by the users */ + int pad2; /*#ifdef WITH_VERSE*/ void *vnode; /* pointer at object VerseNode */ @@ -440,6 +442,8 @@ extern Object workob; #define OB_ADDCONT 512 #define OB_ADDACT 1024 #define OB_SHOWCONT 2048 +#define OB_SETSTBIT 4096 +#define OB_INITSTBIT 8192 /* ob->restrictflag */ #define OB_RESTRICT_VIEW 1 diff --git a/source/blender/makesdna/DNA_sensor_types.h b/source/blender/makesdna/DNA_sensor_types.h index 90e2b8f9f41..ae7b92bb06c 100644 --- a/source/blender/makesdna/DNA_sensor_types.h +++ b/source/blender/makesdna/DNA_sensor_types.h @@ -144,7 +144,7 @@ typedef struct bSensor { /* just add here, to avoid align errors... */ short invert; /* Whether or not to invert the output. */ - short freq2; /* The negative pulsing frequency? Not used anymore... */ + short level; /* Whether the sensor is level base (edge by default) */ int pad; } bSensor; @@ -202,6 +202,7 @@ typedef struct bJoystickSensor { #define SENS_DEL 2 #define SENS_NEW 4 #define SENS_NOT 8 +#define SENS_VISIBLE 16 /* sensor->pulse */ #define SENS_PULSE_CONT 0 diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index acc1651e9fa..3de5b0ff5ba 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -310,7 +310,7 @@ extern UserDef U; /* from usiblender.c !!!! */ #define USER_DUP_ACT (1 << 10) /* gameflags */ -#define USER_VERTEX_ARRAYS 1 +#define USER_DEPRECATED_FLAG 1 #define USER_DISABLE_SOUND 2 #define USER_DISABLE_MIPMAP 4 diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_math.c b/source/blender/nodes/intern/CMP_nodes/CMP_math.c index d00ce18a44f..421c1343df7 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_math.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_math.c @@ -57,7 +57,7 @@ static void do_math(bNode *node, float *out, float *in, float *in2) break; case 3: /* Divide */ { - if(in[1]==0) /* We don't want to divide by zero. */ + if(in2[0]==0) /* We don't want to divide by zero. */ out[0]= 0.0; else out[0]= in[0] / in2[0]; diff --git a/source/blender/python/api2_2x/CurNurb.c b/source/blender/python/api2_2x/CurNurb.c index 174b5fb08dc..b2120bd63c6 100644 --- a/source/blender/python/api2_2x/CurNurb.c +++ b/source/blender/python/api2_2x/CurNurb.c @@ -53,6 +53,8 @@ static int CurNurb_setFlagU( BPy_CurNurb * self, PyObject * args ); static PyObject *CurNurb_getFlagV( BPy_CurNurb * self ); static PyObject *CurNurb_oldsetFlagV( BPy_CurNurb * self, PyObject * args ); static int CurNurb_setFlagV( BPy_CurNurb * self, PyObject * args ); +static PyObject *CurNurb_getOrderU( BPy_CurNurb * self ); +static int CurNurb_setOrderU( BPy_CurNurb * self, PyObject * args ); static PyObject *CurNurb_getType( BPy_CurNurb * self ); static PyObject *CurNurb_oldsetType( BPy_CurNurb * self, PyObject * args ); static int CurNurb_setType( BPy_CurNurb * self, PyObject * args ); @@ -176,6 +178,9 @@ static PyGetSetDef BPy_CurNurb_getseters[] = { (getter)CurNurb_getFlagV, (setter)CurNurb_setFlagV, "The knot type in the V direction", NULL}, + {"orderU", + (getter)CurNurb_getOrderU, (setter)CurNurb_setOrderU, + "order setting for U direction", NULL}, {"type", (getter)CurNurb_getType, (setter)CurNurb_setType, "The curve type (poly: bezier, or NURBS)", @@ -710,6 +715,35 @@ static int CurNurb_setFlagV( BPy_CurNurb * self, PyObject * args ) return 0; } +static PyObject *CurNurb_getOrderU( BPy_CurNurb * self ) +{ + return PyInt_FromLong( ( long ) self->nurb->orderu ); +} + +static int CurNurb_setOrderU( BPy_CurNurb * self, PyObject * args ) +{ + int order; + + args = PyNumber_Int( args ); + if( !args ) + return EXPP_ReturnIntError( PyExc_TypeError, + "expected integer argument" ); + + order = ( int )PyInt_AS_LONG( args ); + Py_DECREF( args ); + + if( order < 2 ) order = 2; + else if( order > 6 ) order = 6; + + if( self->nurb->pntsu < order ) + order = self->nurb->pntsu; + + self->nurb->orderu = (short)order; + makeknots( self->nurb, 1, self->nurb->flagu >> 1 ); + + return 0; +} + /* * CurNurb_getIter * diff --git a/source/blender/python/api2_2x/Lamp.c b/source/blender/python/api2_2x/Lamp.c index ef3174ac4ed..53d25a6429d 100644 --- a/source/blender/python/api2_2x/Lamp.c +++ b/source/blender/python/api2_2x/Lamp.c @@ -1520,12 +1520,11 @@ static PyObject *Lamp_oldsetType( BPy_Lamp * self, PyObject * value ) char *type = PyString_AsString(value); PyObject *arg, *error; - /* parse string argument */ - - if( !value ) - return ( EXPP_ReturnPyObjError( PyExc_TypeError, - "expected string argument" ) ); - + /* parse string argument */ + if( !type ) + return EXPP_ReturnPyObjError ( PyExc_TypeError, + "expected string argument" ); + /* check for valid arguments, set type accordingly */ if( !strcmp( type, "Lamp" ) ) @@ -1546,7 +1545,7 @@ static PyObject *Lamp_oldsetType( BPy_Lamp * self, PyObject * value ) /* build tuple, call wrapper */ - arg = Py_BuildValue( "(i)", type ); + arg = Py_BuildValue( "(i)", self->lamp->type ); error = EXPP_setterWrapper ( (void *)self, arg, (setter)Lamp_setType ); Py_DECREF ( arg ); return error; diff --git a/source/blender/python/api2_2x/Mathutils.c b/source/blender/python/api2_2x/Mathutils.c index 87ac3e3e6ba..85c56a61628 100644 --- a/source/blender/python/api2_2x/Mathutils.c +++ b/source/blender/python/api2_2x/Mathutils.c @@ -1452,8 +1452,8 @@ PyObject *M_Mathutils_LineIntersect( PyObject * self, PyObject * args ) "vectors must be of the same size\n" ) ); if( vec1->size == 3 || vec1->size == 2) { - float a[3], b[3], c[3], ab[3], cb[3], dir1[3], dir2[3]; - float d; + int result; + if (vec1->size == 3) { VECCOPY(v1, vec1->vec); VECCOPY(v2, vec2->vec); @@ -1477,63 +1477,19 @@ PyObject *M_Mathutils_LineIntersect( PyObject * self, PyObject * args ) v4[1] = vec4->vec[1]; v4[2] = 0.0f; } + + result = LineIntersectLine(v1, v2, v3, v4, i1, i2); - VecSubf(c, v3, v1); - VecSubf(a, v2, v1); - VecSubf(b, v4, v3); - - VECCOPY(dir1, a); - Normalize(dir1); - VECCOPY(dir2, b); - Normalize(dir2); - d = Inpf(dir1, dir2); - if (d == 1.0f || d == -1.0f) { + if (result == 0) { /* colinear */ return EXPP_incr_ret( Py_None ); } - - Crossf(ab, a, b); - d = Inpf(c, ab); - - /* test if the two lines are coplanar */ - if (d > -0.000001f && d < 0.000001f) { - Crossf(cb, c, b); - - VecMulf(a, Inpf(cb, ab) / Inpf(ab, ab)); - VecAddf(i1, v1, a); - VECCOPY(i2, i1); - } - /* if not */ else { - float n[3], t[3]; - VecSubf(t, v1, v3); - - /* offset between both plane where the lines lies */ - Crossf(n, a, b); - Projf(t, t, n); - - /* for the first line, offset the second line until it is coplanar */ - VecAddf(v3, v3, t); - VecAddf(v4, v4, t); - - VecSubf(c, v3, v1); - VecSubf(a, v2, v1); - VecSubf(b, v4, v3); - - Crossf(ab, a, b); - Crossf(cb, c, b); - - VecMulf(a, Inpf(cb, ab) / Inpf(ab, ab)); - VecAddf(i1, v1, a); - - /* for the second line, just substract the offset from the first intersection point */ - VecSubf(i2, i1, t); + tuple = PyTuple_New( 2 ); + PyTuple_SetItem( tuple, 0, newVectorObject(i1, vec1->size, Py_NEW) ); + PyTuple_SetItem( tuple, 1, newVectorObject(i2, vec1->size, Py_NEW) ); + return tuple; } - - tuple = PyTuple_New( 2 ); - PyTuple_SetItem( tuple, 0, newVectorObject(i1, vec1->size, Py_NEW) ); - PyTuple_SetItem( tuple, 1, newVectorObject(i2, vec1->size, Py_NEW) ); - return tuple; } else { return ( EXPP_ReturnPyObjError( PyExc_TypeError, diff --git a/source/blender/python/api2_2x/doc/Curve.py b/source/blender/python/api2_2x/doc/Curve.py index ba8d6d21970..765921665cd 100644 --- a/source/blender/python/api2_2x/doc/Curve.py +++ b/source/blender/python/api2_2x/doc/Curve.py @@ -535,6 +535,8 @@ class CurNurb: @type flagU: int @ivar flagV: The CurNurb knot flag V. See L{setFlagU} for description. @type flagV: int + @ivar orderU: The CurNurb knot order U, for nurbs curves only, this is clamped by the number of points, so the orderU will never be greater. + @type orderU: int @ivar type: The type of the curve (Poly: 0, Bezier: 1, NURBS: 4) @type type: int @ivar knotsU: The knot vector in the U direction. The tuple will be empty diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index ebb52c49132..6a0af82b4d7 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -2675,9 +2675,9 @@ void RE_set_max_threads(int threads) void RE_init_threadcount(Render *re) { - if ((re->r.mode & R_FIXED_THREADS)==0 || commandline_threads == 0) { /* Automatic threads */ + if(commandline_threads >= 1) { /* only set as an arg in background mode */ + re->r.threads= MIN2(commandline_threads, BLENDER_MAX_THREADS); + } else if ((re->r.mode & R_FIXED_THREADS)==0 || commandline_threads == 0) { /* Automatic threads */ re->r.threads = BLI_system_thread_count(); - } else if(commandline_threads >= 1 && commandline_threads<=BLENDER_MAX_THREADS) { - re->r.threads= commandline_threads; } } diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index a9261185f42..179a094a981 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -6311,7 +6311,7 @@ static void editing_panel_mesh_texface(void) uiDefButBitS(block, TOG, TF_TILES, B_REDR_3D_IMA, "Tiles", 660,160,60,19, &tf->mode, 0, 0, 0, 0, "Use tilemode for face"); uiDefButBitS(block, TOG, TF_LIGHT, REDRAWVIEW3D, "Light", 720,160,60,19, &tf->mode, 0, 0, 0, 0, "Use light for face"); uiDefButBitS(block, TOG, TF_INVISIBLE, REDRAWVIEW3D, "Invisible",780,160,60,19, &tf->mode, 0, 0, 0, 0, "Make face invisible"); - uiDefButBitS(block, TOG, TF_DYNAMIC, REDRAWVIEW3D, "Collision", 840,160,60,19, &tf->mode, 0, 0, 0, 0, "Use face for collision detection"); + uiDefButBitS(block, TOG, TF_DYNAMIC, REDRAWVIEW3D, "Collision", 840,160,60,19, &tf->mode, 0, 0, 0, 0, "Use face for collision and ray-sensor detection"); uiBlockBeginAlign(block); uiDefButBitS(block, TOG, TF_SHAREDCOL, REDRAWVIEW3D, "Shared", 600,135,60,19, &tf->mode, 0, 0, 0, 0, "Blend vertex colors across face when vertices are shared"); diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index b6877b2e2b7..4e5e8a605ee 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -88,6 +88,7 @@ #include "mydevice.h" #include "nla.h" /* For __NLA : Important, do not remove */ #include "butspace.h" // own module +#include "interface.h" /* internals */ void buttons_enji(uiBlock *, Object *); @@ -228,7 +229,7 @@ static void sca_move_sensor(void *datav, void *data2_unused) bSensor *sens_to_delete= datav; int val; Base *base; - bSensor *sens; + bSensor *sens, *tmp; val= pupmenu("Move up%x1|Move down %x2"); @@ -245,12 +246,24 @@ static void sca_move_sensor(void *datav, void *data2_unused) if(sens) { if( val==1 && sens->prev) { - BLI_remlink(&base->object->sensors, sens); - BLI_insertlinkbefore(&base->object->sensors, sens->prev, sens); + for (tmp=sens->prev; tmp; tmp=tmp->prev) { + if (tmp->flag & SENS_VISIBLE) + break; + } + if (tmp) { + BLI_remlink(&base->object->sensors, sens); + BLI_insertlinkbefore(&base->object->sensors, tmp, sens); + } } else if( val==2 && sens->next) { - BLI_remlink(&base->object->sensors, sens); - BLI_insertlink(&base->object->sensors, sens->next, sens); + for (tmp=sens->next; tmp; tmp=tmp->next) { + if (tmp->flag & SENS_VISIBLE) + break; + } + if (tmp) { + BLI_remlink(&base->object->sensors, sens); + BLI_insertlink(&base->object->sensors, tmp, sens); + } } BIF_undo_push("Move sensor"); allqueue(REDRAWBUTSLOGIC, 0); @@ -267,7 +280,7 @@ static void sca_move_controller(void *datav, void *data2_unused) bController *controller_to_del= datav; int val; Base *base; - bController *cont; + bController *cont, *tmp; val= pupmenu("Move up%x1|Move down %x2"); @@ -284,12 +297,27 @@ static void sca_move_controller(void *datav, void *data2_unused) if(cont) { if( val==1 && cont->prev) { - BLI_remlink(&base->object->controllers, cont); - BLI_insertlinkbefore(&base->object->controllers, cont->prev, cont); + /* locate the controller that has the same state mask but is earlier in the list */ + tmp = cont->prev; + while(tmp) { + if(tmp->state_mask & cont->state_mask) + break; + tmp = tmp->prev; + } + if (tmp) { + BLI_remlink(&base->object->controllers, cont); + BLI_insertlinkbefore(&base->object->controllers, tmp, cont); + } } else if( val==2 && cont->next) { + tmp = cont->next; + while(tmp) { + if(tmp->state_mask & cont->state_mask) + break; + tmp = tmp->next; + } BLI_remlink(&base->object->controllers, cont); - BLI_insertlink(&base->object->controllers, cont->next, cont); + BLI_insertlink(&base->object->controllers, tmp, cont); } BIF_undo_push("Move controller"); allqueue(REDRAWBUTSLOGIC, 0); @@ -306,7 +334,7 @@ static void sca_move_actuator(void *datav, void *data2_unused) bActuator *actuator_to_move= datav; int val; Base *base; - bActuator *act; + bActuator *act, *tmp; val= pupmenu("Move up%x1|Move down %x2"); @@ -323,12 +351,25 @@ static void sca_move_actuator(void *datav, void *data2_unused) if(act) { if( val==1 && act->prev) { - BLI_remlink(&base->object->actuators, act); - BLI_insertlinkbefore(&base->object->actuators, act->prev, act); + /* locate the first visible actuators before this one */ + for (tmp = act->prev; tmp; tmp=tmp->prev) { + if (tmp->flag & ACT_VISIBLE) + break; + } + if (tmp) { + BLI_remlink(&base->object->actuators, act); + BLI_insertlinkbefore(&base->object->actuators, tmp, act); + } } else if( val==2 && act->next) { - BLI_remlink(&base->object->actuators, act); - BLI_insertlink(&base->object->actuators, act->next, act); + for (tmp=act->next; tmp; tmp=tmp->next) { + if (tmp->flag & ACT_VISIBLE) + break; + } + if (tmp) { + BLI_remlink(&base->object->actuators, act); + BLI_insertlink(&base->object->actuators, tmp, act); + } } BIF_undo_push("Move actuator"); allqueue(REDRAWBUTSLOGIC, 0); @@ -348,7 +389,7 @@ void do_logic_buts(unsigned short event) bActuator *act; Base *base; Object *ob; - int didit; + int didit, bit; ob= OBACT; if(ob==0) return; @@ -462,6 +503,18 @@ void do_logic_buts(unsigned short event) make_unique_prop_names(cont->name); base->object->scaflag |= OB_SHOWCONT; BLI_addtail(&(base->object->controllers), cont); + /* set the controller state mask from the current object state. + A controller is always in a single state, so select the lowest bit set + from the object state */ + for (bit=0; bit<32; bit++) { + if (base->object->state & (1<state_mask = (1<state_mask == 0) { + /* shouldn't happen, object state is never 0 */ + cont->state_mask = 1; + } } base= base->next; } @@ -469,6 +522,32 @@ void do_logic_buts(unsigned short event) allqueue(REDRAWBUTSLOGIC, 0); break; + case B_SET_STATE_BIT: + base= FIRSTBASE; + while(base) { + if(base->object->scaflag & OB_SETSTBIT) { + base->object->scaflag &= ~OB_SETSTBIT; + base->object->state = 0x3FFFFFFF; + } + base= base->next; + } + allqueue(REDRAWBUTSLOGIC, 0); + break; + + case B_INIT_STATE_BIT: + base= FIRSTBASE; + while(base) { + if(base->object->scaflag & OB_INITSTBIT) { + base->object->scaflag &= ~OB_INITSTBIT; + base->object->state = base->object->init_state; + if (!base->object->state) + base->object->state = 1; + } + base= base->next; + } + allqueue(REDRAWBUTSLOGIC, 0); + break; + case B_CHANGE_CONT: base= FIRSTBASE; while(base) { @@ -505,7 +584,7 @@ void do_logic_buts(unsigned short event) BIF_undo_push("Delete controller"); allqueue(REDRAWBUTSLOGIC, 0); break; - + case B_ADD_ACT: base= FIRSTBASE; while(base) { @@ -661,6 +740,14 @@ static char *controller_name(int type) return "AND"; case CONT_LOGIC_OR: return "OR"; + case CONT_LOGIC_NAND: + return "NAND"; + case CONT_LOGIC_NOR: + return "NOR"; + case CONT_LOGIC_XOR: + return "XOR"; + case CONT_LOGIC_XNOR: + return "XNOR"; case CONT_EXPRESSION: return "Expression"; case CONT_PYTHON: @@ -671,7 +758,7 @@ static char *controller_name(int type) static char *controller_pup(void) { - return "Controllers %t|AND %x0|OR %x1|Expression %x2|Python %x3"; + return "Controllers %t|AND %x0|OR %x1|XOR %x6|NAND %x4|NOR %x5|XNOR %x7|Expression %x2|Python %x3"; } static char *actuator_name(int type) @@ -717,6 +804,8 @@ static char *actuator_name(int type) return "2D Filter"; case ACT_PARENT: return "Parent"; + case ACT_STATE: + return "State"; } return "unknown"; } @@ -732,21 +821,21 @@ static char *actuator_pup(Object *owner) return "Actuators %t|Action %x15|Motion %x0|Constraint %x9|Ipo %x1" "|Camera %x3|Sound %x5|Property %x6|Edit Object %x10" "|Scene %x11|Random %x13|Message %x14|CD %x16|Game %x17" - "|Visibility %x18|2D Filter %x19|Parent %x20"; + "|Visibility %x18|2D Filter %x19|Parent %x20|State %x22"; break; case OB_MESH: return "Actuators %t|Shape Action %x21|Motion %x0|Constraint %x9|Ipo %x1" "|Camera %x3|Sound %x5|Property %x6|Edit Object %x10" "|Scene %x11|Random %x13|Message %x14|CD %x16|Game %x17" - "|Visibility %x18|2D Filter %x19|Parent %x20"; + "|Visibility %x18|2D Filter %x19|Parent %x20|State %x22"; break; default: return "Actuators %t|Motion %x0|Constraint %x9|Ipo %x1" "|Camera %x3|Sound %x5|Property %x6|Edit Object %x10" "|Scene %x11|Random %x13|Message %x14|CD %x16|Game %x17" - "|Visibility %x18|2D Filter %x19|Parent %x20"; + "|Visibility %x18|2D Filter %x19|Parent %x20|State %x22"; } } @@ -815,7 +904,8 @@ static ID **get_selected_and_linked_obs(short *count, short scavisflag) if(scavisflag & BUTS_ACT_ACT) OBACT->scavisflag |= OB_VIS_ACT; } - if(scavisflag & (BUTS_SENS_LINK|BUTS_CONT_LINK|BUTS_ACT_LINK)) { + /* BUTS_XXX_STATE are similar to BUTS_XXX_LINK for selecting the object */ + if(scavisflag & (BUTS_SENS_LINK|BUTS_CONT_LINK|BUTS_ACT_LINK|BUTS_SENS_STATE|BUTS_ACT_STATE)) { doit= 1; while(doit) { doit= 0; @@ -824,7 +914,7 @@ static ID **get_selected_and_linked_obs(short *count, short scavisflag) while(ob) { /* 1st case: select sensor when controller selected */ - if((scavisflag & BUTS_SENS_LINK) && (ob->scavisflag & OB_VIS_SENS)==0) { + if((scavisflag & (BUTS_SENS_LINK|BUTS_SENS_STATE)) && (ob->scavisflag & OB_VIS_SENS)==0) { sens= ob->sensors.first; while(sens) { for(a=0; atotlinks; a++) { @@ -879,7 +969,7 @@ static ID **get_selected_and_linked_obs(short *count, short scavisflag) } /* 4th case: select actuator when controller selected */ - if( (scavisflag & BUTS_ACT_LINK) && (ob->scavisflag & OB_VIS_CONT)) { + if( (scavisflag & (BUTS_ACT_LINK|BUTS_ACT_STATE)) && (ob->scavisflag & OB_VIS_CONT)) { cont= ob->controllers.first; while(cont) { for(a=0; atotlinks; a++) { @@ -984,6 +1074,10 @@ static void draw_default_sensor_header(bSensor *sens, (short)(x + 10 + 0.85 * (w-20)), (short)(y - 19), (short)(0.15 * (w-20)), 19, &sens->invert, 0.0, 0.0, 0, 0, "Invert the level (output) of this sensor"); + uiDefButS(block, TOG, 1, "Lvl", + (short)(x + 10 + 0.70 * (w-20)), (short)(y - 19), (short)(0.15 * (w-20)), 19, + &sens->level, 0.0, 0.0, 0, 0, + "Level detector versus edge detector (only applicable in case of logic state transition)"); } static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short yco, short width,char* objectname) @@ -1458,6 +1552,7 @@ static int get_col_actuator(int type) case ACT_GAME: return TH_BUT_SETTING2; case ACT_VISIBILITY: return TH_BUT_NUM; case ACT_CONSTRAINT: return TH_BUT_ACTION; + case ACT_STATE: return TH_BUT_SETTING2; default: return TH_BUT_NEUTRAL; } } @@ -1468,7 +1563,23 @@ static void set_col_actuator(int item, int medium) } -static short draw_actuatorbuttons(bActuator *act, uiBlock *block, short xco, short yco, short width) +char *get_state_name(Object *ob, short bit) +{ + bController *cont; + unsigned int mask; + + mask = (1<controllers.first; + while (cont) { + if (cont->state_mask & mask) { + return cont->name; + } + cont = cont->next; + } + return (char*)""; +} + +static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, short xco, short yco, short width) { bSoundActuator *sa = NULL; bCDActuator *cda = NULL; @@ -1487,11 +1598,12 @@ static short draw_actuatorbuttons(bActuator *act, uiBlock *block, short xco, sho bVisibilityActuator *visAct = NULL; bTwoDFilterActuator *tdfa = NULL; bParentActuator *parAct = NULL; + bStateActuator *staAct = NULL; float *fp; short ysize = 0, wval; char *str; - int myline; + int myline, stbit; /* yco is at the top of the rect, draw downwards */ uiBlockSetEmboss(block, UI_EMBOSSM); @@ -1501,7 +1613,7 @@ static short draw_actuatorbuttons(bActuator *act, uiBlock *block, short xco, sho { case ACT_OBJECT: { - ysize= 129; + ysize= 152; glRects(xco, yco-ysize, xco+width, yco); uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); @@ -1539,14 +1651,18 @@ static short draw_actuatorbuttons(bActuator *act, uiBlock *block, short xco, sho uiDefButF(block, NUM, 0, "", xco+45+wval, yco-125, wval, 19, oa->angularvelocity+1, -10000.0, 10000.0, 10, 0, ""); uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-125, wval, 19, oa->angularvelocity+2, -10000.0, 10000.0, 10, 0, ""); - uiDefButBitI(block, TOG, ACT_FORCE_LOCAL, 0, "L", xco+45+3*wval, yco-22, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); - uiDefButBitI(block, TOG, ACT_TORQUE_LOCAL, 0, "L", xco+45+3*wval, yco-41, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); - uiDefButBitI(block, TOG, ACT_DLOC_LOCAL, 0, "L", xco+45+3*wval, yco-64, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); - uiDefButBitI(block, TOG, ACT_DROT_LOCAL, 0, "L", xco+45+3*wval, yco-83, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); - uiDefButBitI(block, TOG, ACT_LIN_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-106, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); - uiDefButBitI(block, TOG, ACT_ANG_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-125, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); + uiDefBut(block, LABEL, 0, "damp", xco, yco-148, 45, 19, NULL, 0, 0, 0, 0, "Number of frames to reach the target velocity"); + uiDefButI(block, NUM, 0, "", xco+45, yco-148, wval, 19, &oa->damping, 0.0, 1000.0, 100, 0, ""); + uiDefButBitS(block, TOG, ACT_CLAMP_VEL, 0, "clamp",xco+45+wval, yco-148, wval, 19, &oa->flag, 0.0, 0.0, 0, 0, "Toggles between SET and CLAMP Velocity"); + + uiDefButBitS(block, TOG, ACT_FORCE_LOCAL, 0, "L", xco+45+3*wval, yco-22, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); + uiDefButBitS(block, TOG, ACT_TORQUE_LOCAL, 0, "L", xco+45+3*wval, yco-41, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); + uiDefButBitS(block, TOG, ACT_DLOC_LOCAL, 0, "L", xco+45+3*wval, yco-64, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); + uiDefButBitS(block, TOG, ACT_DROT_LOCAL, 0, "L", xco+45+3*wval, yco-83, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); + uiDefButBitS(block, TOG, ACT_LIN_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-106, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); + uiDefButBitS(block, TOG, ACT_ANG_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-125, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); - uiDefButBitI(block, TOG, ACT_ADD_LIN_VEL, 0, "add",xco+45+3*wval+15, yco-106, 35, 19, &oa->flag, 0.0, 0.0, 0, 0, "Toggles between ADD and SET linV"); + uiDefButBitS(block, TOG, ACT_ADD_LIN_VEL, 0, "add",xco+45+3*wval+15, yco-106, 35, 19, &oa->flag, 0.0, 0.0, 0, 0, "Toggles between ADD and SET linV"); yco-= ysize; break; @@ -1573,31 +1689,34 @@ static short draw_actuatorbuttons(bActuator *act, uiBlock *block, short xco, sho #else str= "Action types %t|Play %x0|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x6"; #endif - uiDefButS(block, MENU, B_REDR, str, xco+30, yco-24, width-60, 19, &aa->type, 0.0, 0.0, 0.0, 0.0, "Action playback type"); - uiDefIDPoinBut(block, test_actionpoin_but, ID_AC, 1, "AC: ", xco+30, yco-44, width-60, 19, &aa->act, "Action name"); + uiDefButS(block, MENU, B_REDR, str, xco+30, yco-24, (width-60)/2, 19, &aa->type, 0.0, 0.0, 0.0, 0.0, "Action playback type"); + uiDefIDPoinBut(block, test_actionpoin_but, ID_AC, 1, "AC: ", xco+30 + ((width-60)/2), yco-24, (width-60)/2, 19, &aa->act, "Action name"); if(aa->type == ACT_ACTION_FROM_PROP) { - uiDefBut(block, TEX, 0, "Prop: ",xco+30, yco-64, width-60, 19, aa->name, 0.0, 31.0, 0, 0, "Use this property to define the Action position"); + uiDefBut(block, TEX, 0, "Prop: ",xco+30, yco-44, width-60, 19, aa->name, 0.0, 31.0, 0, 0, "Use this property to define the Action position"); } else { - uiDefButI(block, NUM, 0, "Sta: ",xco+30, yco-64, (width-60)/2, 19, &aa->sta, 0.0, MAXFRAMEF, 0, 0, "Start frame"); - uiDefButI(block, NUM, 0, "End: ",xco+30+(width-60)/2, yco-64, (width-60)/2, 19, &aa->end, 0.0, MAXFRAMEF, 0, 0, "End frame"); + uiDefButI(block, NUM, 0, "Sta: ",xco+30, yco-44, (width-60)/2, 19, &aa->sta, 0.0, MAXFRAMEF, 0, 0, "Start frame"); + uiDefButI(block, NUM, 0, "End: ",xco+30+(width-60)/2, yco-44, (width-60)/2, 19, &aa->end, 0.0, MAXFRAMEF, 0, 0, "End frame"); } + + uiDefButI(block, NUM, 0, "Blendin: ", xco+30, yco-64, (width-60)/2, 19, &aa->blendin, 0.0, MAXFRAMEF, 0.0, 0.0, "Number of frames of motion blending"); + uiDefButS(block, NUM, 0, "Priority: ", xco+30+(width-60)/2, yco-64, (width-60)/2, 19, &aa->priority, 0.0, 100.0, 0.0, 0.0, "Execution priority - lower numbers will override actions with higher numbers, With 2 or more actions at once, the overriding channels must be lower in the stack"); - - - uiDefButI(block, NUM, 0, "Blendin: ", xco+30, yco-84, (width-60)/2, 19, &aa->blendin, 0.0, MAXFRAMEF, 0.0, 0.0, "Number of frames of motion blending"); - uiDefButS(block, NUM, 0, "Priority: ", xco+30+(width-60)/2, yco-84, (width-60)/2, 19, &aa->priority, 0.0, 100.0, 0.0, 0.0, "Execution priority - lower numbers will override actions with higher numbers"); + uiDefBut(block, TEX, 0, "FrameProp: ",xco+30, yco-84, width-60, 19, aa->frameProp, 0.0, 31.0, 0, 0, "Assign this property this actions current frame number"); + #ifdef __NLA_ACTION_BY_MOTION_ACTUATOR if(aa->type == ACT_ACTION_MOTION) { - uiDefButF(block, NUM, 0, "Cycle: ",xco+30, yco-104, (width-60)/2, 19, &aa->stridelength, 0.0, 2500.0, 0, 0, "Distance covered by a single cycle of the action"); + uiDefButF(block, NUM, 0, "Cycle: ",xco+30, yco-84, (width-60)/2, 19, &aa->stridelength, 0.0, 2500.0, 0, 0, "Distance covered by a single cycle of the action"); } #endif + + yco-=ysize; break; } @@ -1821,8 +1940,15 @@ static short draw_actuatorbuttons(bActuator *act, uiBlock *block, short xco, sho uiDefButI(block, NUM, 0, "Time:", xco+10+(width-20)/2, yco-44, (width-20)/2-40, 19, &eoa->time, 0.0, 2000.0, 0, 0, "Duration the tracking takes"); uiDefButS(block, TOG, 0, "3D", xco+width-50, yco-44, 40, 19, &eoa->flag, 0.0, 0.0, 0, 0, "Enable 3D tracking"); } - - str= "Edit Object %t|Add Object %x0|End Object %x1|Replace Mesh %x2|Track to %x3"; + else if(eoa->type==ACT_EDOB_DYNAMICS) { + ysize= 48; + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + str= "Dynamic Operation %t|Restore Dynamics %x0|Suspend Dynamics %x1|Enable Rigid Body %x2|Disable Rigid Body %x3"; + uiDefButS(block, MENU, B_REDR, str, xco+40, yco-44, (width-80), 19, &(eoa->dyn_operation), 0.0, 0.0, 0, 0, ""); + } + str= "Edit Object %t|Add Object %x0|End Object %x1|Replace Mesh %x2|Track to %x3|Dynamics %x4"; uiDefButS(block, MENU, B_REDR, str, xco+40, yco-24, (width-80), 19, &eoa->type, 0.0, 0.0, 0, 0, ""); yco-= ysize; @@ -2022,6 +2148,37 @@ static short draw_actuatorbuttons(bActuator *act, uiBlock *block, short xco, sho break; + case ACT_STATE: + ysize = 34; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, + (float)yco-ysize, (float)xco+width, (float)yco, 1); + + staAct = act->data; + + str= "Operation %t|Cpy %x0|Add %x1|Sub %x2|Inv %x3"; + + uiDefButI(block, MENU, B_REDR, str, + xco + 10, yco - 24, 65, 19, &staAct->type, + 0.0, 0.0, 0, 0, + "Select the bit operation on object state mask"); + + for (wval=0; wval<15; wval+=5) { + uiBlockBeginAlign(block); + for (stbit=0; stbit<5; stbit++) { + uiDefButBitI(block, TOG, (1<<(stbit+wval)), 0, "", (short)(xco+85+12*stbit+13*wval), yco-17, 12, 12, (int *)&(staAct->mask), 0, 0, 0, 0, get_state_name(ob, (short)(wval+stbit))); + } + for (stbit=0; stbit<5; stbit++) { + uiDefButBitI(block, TOG, (1<<(stbit+wval+15)), 0, "", (short)(xco+85+12*stbit+13*wval), yco-29, 12, 12, (int *)&(staAct->mask), 0, 0, 0, 0, get_state_name(ob, (short)(wval+stbit+15))); + } + } + uiBlockEndAlign(block); + + yco-= ysize; + + break; + case ACT_RANDOM: ysize = 69; @@ -2225,7 +2382,11 @@ static short draw_actuatorbuttons(bActuator *act, uiBlock *block, short xco, sho break; case ACT_2DFILTER_CUSTOMFILTER: uiDefButI(block, NUM, B_REDR, "Pass Number:", xco+30,yco-44,width-60,19,&tdfa->int_arg,0.0,MAX_RENDER_PASS-1,0.0,0.0,"Set motion blur value"); - uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "Script: ", xco+30,yco-64,width-60, 19, &tdfa->text, ""); + uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "Script: ", xco+30,yco-64,width/2-32, 19, &tdfa->text, ""); + uiDefButS(block, TOG|BIT|0, B_REDR, "Depth", xco+width/2+2 , yco - 64, width/4-16 , 19, + &tdfa->texture_flag, 0.0, 0.0, 0, 0, "Includes Depth Texture (bgl_DepthTexture)"); + uiDefButS(block, TOG|BIT|1, B_REDR, "Luminance", xco+3*width/4-14 , yco - 64, width/4-16 , 19, + &tdfa->texture_flag, 0.0, 0.0, 0, 0, "Includes Luminance Texture (bgl_LuminanceTexture)"); break; } @@ -2596,6 +2757,118 @@ void buttons_bullet(uiBlock *block, Object *ob) uiBlockEndAlign(block); } +static void check_object_state(void *arg1_but, void *arg2_mask) +{ + unsigned int *cont_mask = arg2_mask; + uiBut *but = arg1_but; + + if (*cont_mask == 0 || !(G.qual & LR_SHIFTKEY)) + *cont_mask = (1<retval); + but->retval = B_REDR; +} + +static void check_controller_state_mask(void *arg1_but, void *arg2_mask) +{ + unsigned int *cont_mask = arg2_mask; + uiBut *but = arg1_but; + + /* a controller is always in a single state */ + *cont_mask = (1<retval); + but->retval = B_REDR; +} + +static int first_bit(unsigned int mask) +{ + int bit; + + for (bit=0; bit<32; bit++) { + if (mask & (1<uiblocks, "Controller state mask", UI_EMBOSS, UI_HELV, curarea->win); + + /* use this for a fake extra empy space around the buttons */ + uiDefBut(block, LABEL, 0, "", -5, -5, 200, 34, NULL, 0, 0, 0, 0, ""); + + for (offset=0; offset<15; offset+=5) { + uiBlockBeginAlign(block); + for (stbit=0; stbit<5; stbit++) { + but = uiDefButBitI(block, TOG, (1<<(stbit+offset)), (stbit+offset), "", (short)(xco+12*stbit+13*offset), yco, 12, 12, (int *)&(cont->state_mask), 0, 0, 0, 0, ""); + uiButSetFunc(but, check_controller_state_mask, but, &(cont->state_mask)); + } + for (stbit=0; stbit<5; stbit++) { + but = uiDefButBitI(block, TOG, (1<<(stbit+offset+15)), (stbit+offset+15), "", (short)(xco+12*stbit+13*offset), yco-12, 12, 12, (int *)&(cont->state_mask), 0, 0, 0, 0, ""); + uiButSetFunc(but, check_controller_state_mask, but, &(cont->state_mask)); + } + } + uiBlockEndAlign(block); + + uiBlockSetDirection(block, UI_TOP); + + return block; +} + +static void do_object_state_menu(void *arg, int event) +{ + Object *ob = arg; + + switch (event) { + case 0: + ob->state = 0x3FFFFFFF; + break; + case 1: + ob->state = ob->init_state; + if (!ob->state) + ob->state = 1; + break; + case 2: + ob->init_state = ob->state; + break; + } + allqueue(REDRAWBUTSLOGIC, 0); +} + +static uiBlock *object_state_mask_menu(void *arg_obj) +{ + uiBlock *block; + short xco = 0; + + block= uiNewBlock(&curarea->uiblocks, "obstatemenu", UI_EMBOSSP, UI_HELV, curarea->win); + uiBlockSetButmFunc(block, do_object_state_menu, arg_obj); + + uiDefBut(block, BUTM, 1, "Set all bits", 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiDefBut(block, BUTM, 1, "Recall init state", 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefBut(block, SEPR, 0, "", 0, (short)(xco-=6), 160, 6, NULL, 0.0, 0.0, 0, 0, ""); + uiDefBut(block, BUTM, 1, "Store init state", 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 2, ""); + + uiBlockSetDirection(block, UI_TOP); + return block; +} + +static int is_sensor_linked(uiBlock *block, bSensor *sens) +{ + bController *cont; + int i, count; + + for (count=0, i=0; itotlinks; i++) { + cont = sens->links[i]; + if (uiFindInlink(block, cont) != NULL) + return 1; + } + return 0; +} + /* never used, see CVS 1.134 for the code */ /* static FreeCamera *new_freecamera(void) */ @@ -2614,7 +2887,7 @@ void logic_buts(void) uiBlock *block; uiBut *but; World *wrld; - int a; + int a, iact, stbit, offset; short xco, yco, count, width, ycoo; char *pupstr, name[32]; @@ -2686,78 +2959,27 @@ void logic_buts(void) uiClearButLock(); idar= get_selected_and_linked_obs(&count, G.buts->scaflag); - - /* ******************************* */ - xco= 375; yco= 170; width= 230; - uiBlockSetEmboss(block, UI_EMBOSSP); - uiDefBlockBut(block, sensor_menu, NULL, "Sensors", xco-10, yco+35, 80, 19, ""); - uiBlockSetEmboss(block, UI_EMBOSS); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, BUTS_SENS_SEL, B_REDR, "Sel", xco+110, yco+35, (width-100)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show all selected Objects"); - uiDefButBitS(block, TOG, BUTS_SENS_ACT, B_REDR, "Act", xco+110+(width-100)/3, yco+35, (width-100)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show active Object"); - uiDefButBitS(block, TOG, BUTS_SENS_LINK, B_REDR, "Link", xco+110+2*(width-100)/3, yco+35, (width-100)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show linked Objects to Controller"); - uiBlockEndAlign(block); - + /* clean ACT_LINKED and ACT_VISIBLE of all potentially visible actuators so that + we can determine which is actually linked/visible */ for(a=0; ascavisflag & OB_VIS_SENS) == 0) continue; - - /* presume it is only objects for now */ - uiBlockSetEmboss(block, UI_EMBOSS); - uiBlockBeginAlign(block); - if(ob->sensors.first) uiSetCurFont(block, UI_HELVB); - uiDefButBitS(block, TOG, OB_SHOWSENS, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), 19, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide sensors"); - if(ob->sensors.first) uiSetCurFont(block, UI_HELV); - uiDefButBitS(block, TOG, OB_ADDSENS, B_ADD_SENS, "Add",(short)(xco+width-40), yco, 50, 19, &ob->scaflag, 0, 0, 0, 0, "Add a new Sensor"); - uiBlockEndAlign(block); - yco-=20; - - if(ob->scaflag & OB_SHOWSENS) { - - sens= ob->sensors.first; - while(sens) { - uiBlockSetEmboss(block, UI_EMBOSSM); - uiDefIconButBitS(block, TOG, SENS_DEL, B_DEL_SENS, ICON_X, xco, yco, 22, 19, &sens->flag, 0, 0, 0, 0, "Delete Sensor"); - uiDefIconButBitS(block, ICONTOG, SENS_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &sens->flag, 0, 0, 0, 0, "Sensor settings"); - - ycoo= yco; - if(sens->flag & SENS_SHOW) - { - uiDefButS(block, MENU, B_CHANGE_SENS, sensor_pup(), (short)(xco+22), yco, 100, 19, &sens->type, 0, 0, 0, 0, "Sensor type"); - but= uiDefBut(block, TEX, 1, "", (short)(xco+122), yco, (short)(width-144), 19, sens->name, 0, 31, 0, 0, "Sensor name"); - uiButSetFunc(but, make_unique_prop_names_cb, sens->name, (void*) 0); - - sens->otype= sens->type; - yco= draw_sensorbuttons(sens, block, xco, yco, width,ob->id.name); - if(yco-6 < ycoo) ycoo= (yco+ycoo-20)/2; - } - else { - set_col_sensor(sens->type, 1); - glRecti(xco+22, yco, xco+width-22,yco+19); - but= uiDefBut(block, LABEL, 0, sensor_name(sens->type), (short)(xco+22), yco, 100, 19, sens, 0, 0, 0, 0, ""); - uiButSetFunc(but, sca_move_sensor, sens, NULL); - but= uiDefBut(block, LABEL, 0, sens->name, (short)(xco+122), yco, (short)(width-144), 19, sens, 0, 31, 0, 0, ""); - uiButSetFunc(but, sca_move_sensor, sens, NULL); - } - - but= uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, 19, 19, NULL, 0, 0, 0, 0, ""); - uiSetButLink(but, NULL, (void ***)&(sens->links), &sens->totlinks, LINK_SENSOR, LINK_CONTROLLER); - - yco-=20; - - sens= sens->next; - } - yco-= 6; + act= ob->actuators.first; + while(act) { + act->flag &= ~(ACT_LINKED|ACT_VISIBLE); + act = act->next; + } + /* same for sensors */ + sens= ob->sensors.first; + while(sens) { + sens->flag &= ~(SENS_VISIBLE); + sens = sens->next; } } - + + /* start with the controller because we need to know which one is visible */ /* ******************************* */ - xco= 675; yco= 170; width= 230; + xco= 695; yco= 170; width= 275; uiBlockSetEmboss(block, UI_EMBOSSP); uiDefBlockBut(block, controller_menu, NULL, "Controllers", xco-10, yco+35, 100, 19, ""); @@ -2785,59 +3007,193 @@ void logic_buts(void) if(ob->controllers.first) uiSetCurFont(block, UI_HELV); uiDefButBitS(block, TOG, OB_ADDCONT, B_ADD_CONT, "Add",(short)(xco+width-40), yco, 50, 19, &ob->scaflag, 0, 0, 0, 0, "Add a new Controller"); uiBlockEndAlign(block); - yco-=20; + yco-=17; + /* mark all actuators linked to these controllers */ + /* note that some of these actuators could be from objects that are not in the display list. + It's ok because those actuators will not be displayed here */ + cont= ob->controllers.first; + while(cont) { + for (iact=0; iacttotlinks; iact++) { + act = cont->links[iact]; + act->flag |= ACT_LINKED; + } + cont = cont->next; + } + if(ob->scaflag & OB_SHOWCONT) { - - cont= ob->controllers.first; - while(cont) { - uiBlockSetEmboss(block, UI_EMBOSSM); - uiDefIconButBitS(block, TOG, CONT_DEL, B_DEL_CONT, ICON_X, xco, yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Delete Controller"); - uiDefIconButBitS(block, ICONTOG, CONT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Controller settings"); - - if(cont->flag & CONT_SHOW) { - cont->otype= cont->type; - uiDefButS(block, MENU, B_CHANGE_CONT, controller_pup(),(short)(xco+22), yco, 100, 19, &cont->type, 0, 0, 0, 0, "Controller type"); - but= uiDefBut(block, TEX, 1, "", (short)(xco+122), yco, (short)(width-144), 19, cont->name, 0, 31, 0, 0, "Controller name"); - uiButSetFunc(but, make_unique_prop_names_cb, cont->name, (void*) 0); - - ycoo= yco; - yco= draw_controllerbuttons(cont, block, xco, yco, width); - if(yco-6 < ycoo) ycoo= (yco+ycoo-20)/2; + + /* first show the state */ + uiBlockSetEmboss(block, UI_EMBOSSP); + uiDefBlockBut(block, object_state_mask_menu, ob, "State", (short)(xco-10), (short)(yco-10), 40, 19, "Object state menu: store and retrieve initial state"); + uiBlockSetEmboss(block, UI_EMBOSS); + if (!ob->state) + ob->state = 1; + for (offset=0; offset<15; offset+=5) { + uiBlockBeginAlign(block); + for (stbit=0; stbit<5; stbit++) { + but = uiDefButBitI(block, TOG, 1<<(stbit+offset), stbit+offset, "", (short)(xco+35+12*stbit+13*offset), yco, 12, 12, (int *)&(ob->state), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+offset))); + uiButSetFunc(but, check_object_state, but, &(ob->state)); } - else { - cpack(0x999999); - glRecti(xco+22, yco, xco+width-22,yco+19); - but= uiDefBut(block, LABEL, 0, controller_name(cont->type), (short)(xco+22), yco, 100, 19, cont, 0, 0, 0, 0, "Controller type"); - uiButSetFunc(but, sca_move_controller, cont, NULL); - but= uiDefBut(block, LABEL, 0, cont->name,(short)(xco+122), yco,(short)(width-144), 19, cont, 0, 0, 0, 0, "Controller name"); - uiButSetFunc(but, sca_move_controller, cont, NULL); - ycoo= yco; + for (stbit=0; stbit<5; stbit++) { + but = uiDefButBitI(block, TOG, 1<<(stbit+offset+15), stbit+offset+15, "", (short)(xco+35+12*stbit+13*offset), yco-12, 12, 12, (int *)&(ob->state), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+offset+15))); + uiButSetFunc(but, check_object_state, but, &(ob->state)); } + } + uiBlockBeginAlign(block); + uiDefButBitS(block, TOG, OB_SETSTBIT, B_SET_STATE_BIT, "All",(short)(xco+235), yco-10, 25, 19, &ob->scaflag, 0, 0, 0, 0, "Set all state bits"); + uiDefButBitS(block, TOG, OB_INITSTBIT, B_INIT_STATE_BIT, "Ini",(short)(xco+260), yco-10, 25, 19, &ob->scaflag, 0, 0, 0, 0, "Set the initial state"); + uiBlockEndAlign(block); + + yco-=35; - but= uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, 19, 19, NULL, 0, 0, 0, 0, ""); - uiSetButLink(but, NULL, (void ***)&(cont->links), &cont->totlinks, LINK_CONTROLLER, LINK_ACTUATOR); - - uiDefIconBut(block, INLINK, 0, ICON_INLINK,(short)(xco-19), ycoo, 19, 19, cont, LINK_CONTROLLER, 0, 0, 0, ""); - - yco-=20; + /* display only the controllers that match the current state */ + offset = 0; + for (stbit=0; stbit<32; stbit++) { + if (!(ob->state & (1<controllers.first; + while(cont) { + if (cont->state_mask & (1<totlinks; iact++) { + act = cont->links[iact]; + act->flag |= ACT_VISIBLE; + } + uiBlockSetEmboss(block, UI_EMBOSSM); + uiDefIconButBitS(block, TOG, CONT_DEL, B_DEL_CONT, ICON_X, xco, yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Delete Controller"); + uiDefIconButBitS(block, ICONTOG, CONT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Controller settings"); + uiBlockSetEmboss(block, UI_EMBOSSP); + sprintf(name, "%d", first_bit(cont->state_mask)+1); + uiDefBlockBut(block, controller_state_mask_menu, cont, name, (short)(xco+width-44), yco, 22, 19, "Set controller state mask"); + uiBlockSetEmboss(block, UI_EMBOSSM); - cont= cont->next; + if(cont->flag & CONT_SHOW) { + cont->otype= cont->type; + uiDefButS(block, MENU, B_CHANGE_CONT, controller_pup(),(short)(xco+22), yco, 100, 19, &cont->type, 0, 0, 0, 0, "Controller type"); + but= uiDefBut(block, TEX, 1, "", (short)(xco+122), yco, (short)(width-166), 19, cont->name, 0, 31, 0, 0, "Controller name"); + uiButSetFunc(but, make_unique_prop_names_cb, cont->name, (void*) 0); + + ycoo= yco; + yco= draw_controllerbuttons(cont, block, xco, yco, width); + if(yco-6 < ycoo) ycoo= (yco+ycoo-20)/2; + } + else { + cpack(0x999999); + glRecti(xco+22, yco, xco+width-22,yco+19); + but= uiDefBut(block, LABEL, 0, controller_name(cont->type), (short)(xco+22), yco, 100, 19, cont, 0, 0, 0, 0, "Controller type"); + uiButSetFunc(but, sca_move_controller, cont, NULL); + but= uiDefBut(block, LABEL, 0, cont->name,(short)(xco+122), yco,(short)(width-166), 19, cont, 0, 0, 0, 0, "Controller name"); + uiButSetFunc(but, sca_move_controller, cont, NULL); + ycoo= yco; + } + + but= uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, 19, 19, NULL, 0, 0, 0, 0, ""); + uiSetButLink(but, NULL, (void ***)&(cont->links), &cont->totlinks, LINK_CONTROLLER, LINK_ACTUATOR); + + uiDefIconBut(block, INLINK, 0, ICON_INLINK,(short)(xco-19), ycoo, 19, 19, cont, LINK_CONTROLLER, 0, 0, 0, ""); + /* offset is >0 if at least one controller was displayed */ + offset++; + yco-=20; + } + cont= cont->next; + } + } yco-= 6; } } /* ******************************* */ - xco= 985; yco= 170; width= 280; + xco= 375; yco= 170; width= 250; + + uiBlockSetEmboss(block, UI_EMBOSSP); + uiDefBlockBut(block, sensor_menu, NULL, "Sensors", xco-10, yco+35, 70, 19, ""); + uiBlockSetEmboss(block, UI_EMBOSS); + + uiBlockBeginAlign(block); + uiDefButBitS(block, TOG, BUTS_SENS_SEL, B_REDR, "Sel", xco+80, yco+35, (width-70)/4, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show all selected Objects"); + uiDefButBitS(block, TOG, BUTS_SENS_ACT, B_REDR, "Act", xco+80+(width-70)/4, yco+35, (width-70)/4, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show active Object"); + uiDefButBitS(block, TOG, BUTS_SENS_LINK, B_REDR, "Link", xco+80+2*(width-70)/4, yco+35, (width-70)/4, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show linked Objects to Controller"); + uiDefButBitS(block, TOG, BUTS_SENS_STATE, B_REDR, "Sta", xco+80+3*(width-70)/4, yco+35, (width-70)/4, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show only sensors connected to active states"); + uiBlockEndAlign(block); + + for(a=0; ascavisflag & OB_VIS_SENS) == 0) continue; + + /* presume it is only objects for now */ + uiBlockSetEmboss(block, UI_EMBOSS); + uiBlockBeginAlign(block); + if(ob->sensors.first) uiSetCurFont(block, UI_HELVB); + uiDefButBitS(block, TOG, OB_SHOWSENS, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), 19, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide sensors"); + if(ob->sensors.first) uiSetCurFont(block, UI_HELV); + uiDefButBitS(block, TOG, OB_ADDSENS, B_ADD_SENS, "Add",(short)(xco+width-40), yco, 50, 19, &ob->scaflag, 0, 0, 0, 0, "Add a new Sensor"); + uiBlockEndAlign(block); + yco-=20; + + if(ob->scaflag & OB_SHOWSENS) { + + sens= ob->sensors.first; + while(sens) { + if (!(G.buts->scaflag & BUTS_SENS_STATE) || + sens->totlinks == 0 || /* always display sensor without links so that is can be edited */ + is_sensor_linked(block, sens)) { + sens->flag |= SENS_VISIBLE; + uiBlockSetEmboss(block, UI_EMBOSSM); + uiDefIconButBitS(block, TOG, SENS_DEL, B_DEL_SENS, ICON_X, xco, yco, 22, 19, &sens->flag, 0, 0, 0, 0, "Delete Sensor"); + uiDefIconButBitS(block, ICONTOG, SENS_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &sens->flag, 0, 0, 0, 0, "Sensor settings"); + + ycoo= yco; + if(sens->flag & SENS_SHOW) + { + uiDefButS(block, MENU, B_CHANGE_SENS, sensor_pup(), (short)(xco+22), yco, 100, 19, &sens->type, 0, 0, 0, 0, "Sensor type"); + but= uiDefBut(block, TEX, 1, "", (short)(xco+122), yco, (short)(width-144), 19, sens->name, 0, 31, 0, 0, "Sensor name"); + uiButSetFunc(but, make_unique_prop_names_cb, sens->name, (void*) 0); + + sens->otype= sens->type; + yco= draw_sensorbuttons(sens, block, xco, yco, width,ob->id.name); + if(yco-6 < ycoo) ycoo= (yco+ycoo-20)/2; + } + else { + set_col_sensor(sens->type, 1); + glRecti(xco+22, yco, xco+width-22,yco+19); + but= uiDefBut(block, LABEL, 0, sensor_name(sens->type), (short)(xco+22), yco, 100, 19, sens, 0, 0, 0, 0, ""); + uiButSetFunc(but, sca_move_sensor, sens, NULL); + but= uiDefBut(block, LABEL, 0, sens->name, (short)(xco+122), yco, (short)(width-144), 19, sens, 0, 31, 0, 0, ""); + uiButSetFunc(but, sca_move_sensor, sens, NULL); + } + + but= uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, 19, 19, NULL, 0, 0, 0, 0, ""); + uiSetButLink(but, NULL, (void ***)&(sens->links), &sens->totlinks, LINK_SENSOR, LINK_CONTROLLER); + + yco-=20; + } + sens= sens->next; + } + yco-= 6; + } + } + + /* ******************************* */ + xco= 1040; yco= 170; width= 280; uiBlockSetEmboss(block, UI_EMBOSSP); - uiDefBlockBut(block, actuator_menu, NULL, "Actuators", xco-10, yco+35, 100, 19, ""); + uiDefBlockBut(block, actuator_menu, NULL, "Actuators", xco-10, yco+35, 90, 19, ""); uiBlockSetEmboss(block, UI_EMBOSS); uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, BUTS_ACT_SEL, B_REDR, "Sel", xco+110, yco+35, (width-110)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show all selected Objects"); - uiDefButBitS(block, TOG, BUTS_ACT_ACT, B_REDR, "Act", xco+110+(width-110)/3, yco+35, (width-110)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show active Object"); - uiDefButBitS(block, TOG, BUTS_ACT_LINK, B_REDR, "Link", xco+110+2*(width-110)/3, yco+35, (width-110)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show linked Objects to Controller"); + uiDefButBitS(block, TOG, BUTS_ACT_SEL, B_REDR, "Sel", xco+110, yco+35, (width-100)/4, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show all selected Objects"); + uiDefButBitS(block, TOG, BUTS_ACT_ACT, B_REDR, "Act", xco+110+(width-100)/4, yco+35, (width-100)/4, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show active Object"); + uiDefButBitS(block, TOG, BUTS_ACT_LINK, B_REDR, "Link", xco+110+2*(width-100)/4, yco+35, (width-100)/4, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show linked Objects to Controller"); + uiDefButBitS(block, TOG, BUTS_ACT_STATE, B_REDR, "Sta", xco+110+3*(width-100)/4, yco+35, (width-100)/4, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show only actuators connected to active states"); uiBlockEndAlign(block); for(a=0; aactuators.first; while(act) { - uiBlockSetEmboss(block, UI_EMBOSSM); - uiDefIconButBitS(block, TOG, ACT_DEL, B_DEL_ACT, ICON_X, xco, yco, 22, 19, &act->flag, 0, 0, 0, 0, "Delete Actuator"); - uiDefIconButBitS(block, ICONTOG, ACT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &act->flag, 0, 0, 0, 0, "Actuator settings"); + if (!(G.buts->scaflag & BUTS_ACT_STATE) || + !(act->flag & ACT_LINKED) || /* always display actuators without links so that is can be edited */ + (act->flag & ACT_VISIBLE)) { /* this actuator has visible connection, display it */ + act->flag |= ACT_VISIBLE; /* mark the actuator as visible to help implementing the up/down action */ + uiBlockSetEmboss(block, UI_EMBOSSM); + uiDefIconButBitS(block, TOG, ACT_DEL, B_DEL_ACT, ICON_X, xco, yco, 22, 19, &act->flag, 0, 0, 0, 0, "Delete Actuator"); + uiDefIconButBitS(block, ICONTOG, ACT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &act->flag, 0, 0, 0, 0, "Actuator settings"); - if(act->flag & ACT_SHOW) { - act->otype= act->type; - uiDefButS(block, MENU, B_CHANGE_ACT, actuator_pup(ob), (short)(xco+22), yco, 100, 19, &act->type, 0, 0, 0, 0, "Actuator type"); - but= uiDefBut(block, TEX, 1, "", (short)(xco+122), yco, (short)(width-144), 19, act->name, 0, 31, 0, 0, "Actuator name"); - uiButSetFunc(but, make_unique_prop_names_cb, act->name, (void*) 0); + if(act->flag & ACT_SHOW) { + act->otype= act->type; + uiDefButS(block, MENU, B_CHANGE_ACT, actuator_pup(ob), (short)(xco+22), yco, 100, 19, &act->type, 0, 0, 0, 0, "Actuator type"); + but= uiDefBut(block, TEX, 1, "", (short)(xco+122), yco, (short)(width-144), 19, act->name, 0, 31, 0, 0, "Actuator name"); + uiButSetFunc(but, make_unique_prop_names_cb, act->name, (void*) 0); - ycoo= yco; - yco= draw_actuatorbuttons(act, block, xco, yco, width); - if(yco-6 < ycoo) ycoo= (yco+ycoo-20)/2; + ycoo= yco; + yco= draw_actuatorbuttons(ob, act, block, xco, yco, width); + if(yco-6 < ycoo) ycoo= (yco+ycoo-20)/2; + } + else { + set_col_actuator(act->type, 1); + glRecti((short)(xco+22), yco, (short)(xco+width-22),(short)(yco+19)); + but= uiDefBut(block, LABEL, 0, actuator_name(act->type), (short)(xco+22), yco, 100, 19, act, 0, 0, 0, 0, "Actuator type"); + uiButSetFunc(but, sca_move_actuator, act, NULL); + but= uiDefBut(block, LABEL, 0, act->name, (short)(xco+122), yco, (short)(width-144), 19, act, 0, 0, 0, 0, "Actuator name"); + uiButSetFunc(but, sca_move_actuator, act, NULL); + ycoo= yco; + } + + uiDefIconBut(block, INLINK, 0, ICON_INLINK,(short)(xco-19), ycoo, 19, 19, act, LINK_ACTUATOR, 0, 0, 0, ""); + + yco-=20; } - else { - set_col_actuator(act->type, 1); - glRecti((short)(xco+22), yco, (short)(xco+width-22),(short)(yco+19)); - but= uiDefBut(block, LABEL, 0, actuator_name(act->type), (short)(xco+22), yco, 100, 19, act, 0, 0, 0, 0, "Actuator type"); - uiButSetFunc(but, sca_move_actuator, act, NULL); - but= uiDefBut(block, LABEL, 0, act->name, (short)(xco+122), yco, (short)(width-144), 19, act, 0, 0, 0, 0, "Actuator name"); - uiButSetFunc(but, sca_move_actuator, act, NULL); - ycoo= yco; - } - - uiDefIconBut(block, INLINK, 0, ICON_INLINK,(short)(xco-19), ycoo, 19, 19, act, LINK_ACTUATOR, 0, 0, 0, ""); - - yco-=20; - act= act->next; } yco-= 6; diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index 3797a92f16f..1c98950080a 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -900,7 +900,7 @@ static void seq_panel_filter_video() "Convert input to float data"); uiDefButBitI(block, TOG, SEQ_FILTERY, - B_SEQ_BUT_RELOAD, "FilterY", + B_SEQ_BUT_RELOAD_FILE, "De-Inter", 170,110,80,19, &last_seq->flag, 0.0, 21.0, 100, 0, "For video movies to remove fields"); diff --git a/source/blender/src/drawaction.c b/source/blender/src/drawaction.c index 8c4958a651a..89466151a39 100644 --- a/source/blender/src/drawaction.c +++ b/source/blender/src/drawaction.c @@ -474,10 +474,13 @@ static void draw_channel_names(void) indent= 0; special= -1; - if (EXPANDED_AGRP(agrp)) - expand = ICON_TRIA_DOWN; - else - expand = ICON_TRIA_RIGHT; + /* only show expand if there are any channels */ + if (agrp->channels.first) { + if (EXPANDED_AGRP(agrp)) + expand = ICON_TRIA_DOWN; + else + expand = ICON_TRIA_RIGHT; + } if (EDITABLE_AGRP(agrp)) protect = ICON_UNLOCKED; diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index deb7ddc068d..2f1cdb8b951 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -246,7 +246,8 @@ void default_gl_light(void) glDisable(GL_COLOR_MATERIAL); } -/* also called when render 'ogl' */ +/* also called when render 'ogl' + keep synced with Myinit_gl_stuff in the game engine! */ void init_gl_stuff(void) { float mat_ambient[] = { 0.0, 0.0, 0.0, 0.0 }; diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c index 40b6b7ba6fe..f93a1526e3c 100644 --- a/source/blender/src/editaction.c +++ b/source/blender/src/editaction.c @@ -390,7 +390,7 @@ static void actdata_filter_actionchannel (ListBase *act_data, bActionChannel *ac static void actdata_filter_action (ListBase *act_data, bAction *act, int filter_mode) { - bActListElem *ale; + bActListElem *ale=NULL; bActionGroup *agrp; bActionChannel *achan, *lastchan=NULL; @@ -429,6 +429,15 @@ static void actdata_filter_action (ListBase *act_data, bAction *act, int filter_ for (achan= agrp->channels.first; achan && achan->grp==agrp; achan= achan->next) { actdata_filter_actionchannel(act_data, achan, filter_mode); } + + /* remove group from filtered list if last element is group + * (i.e. only if group had channels, which were all hidden) + */ + if ( (ale) && (act_data->last == ale) && + (ale->data == agrp) && (agrp->channels.first) ) + { + BLI_freelinkN(act_data, ale); + } } } } @@ -3648,7 +3657,7 @@ static void mouse_actionchannels (short mval[]) { bActionGroup *agrp= (bActionGroup *)act_channel; - if (mval[0] < 16) { + if ((mval[0] < 16) && (agrp->channels.first)) { /* toggle expand */ agrp->flag ^= AGRP_EXPANDED; } diff --git a/source/blender/src/editfont.c b/source/blender/src/editfont.c index cb245867c89..a3b05a008c8 100644 --- a/source/blender/src/editfont.c +++ b/source/blender/src/editfont.c @@ -354,7 +354,7 @@ void txt_export_to_object(struct Text *text) // char sdir[FILE_MAXDIR]; // char sfile[FILE_MAXFILE]; - if(!text) return; + if(!text || !text->lines.first) return; id = (ID *)text; @@ -429,7 +429,7 @@ void txt_export_to_objects(struct Text *text) int linenum = 0; float offset[3] = {0.0,0.0,0.0}; - if(!text) return; + if(!text || !text->lines.first) return; id = (ID *)text; diff --git a/source/blender/src/editmesh_mods.c b/source/blender/src/editmesh_mods.c index d5e34779173..c7a75b32df1 100644 --- a/source/blender/src/editmesh_mods.c +++ b/source/blender/src/editmesh_mods.c @@ -2307,7 +2307,7 @@ void selectconnected_mesh(void) if(em->edges.first==0) return; if( unified_findnearest(&eve, &eed, &efa)==0 ) { - error("Nothing indicated "); + /* error("Nothing indicated "); */ /* this is mostly annoying, eps with occluded geometry */ return; } @@ -2407,7 +2407,7 @@ static void selectconnected_delimit_mesh__internal(short all, short sel) EditFace *efa_mouse = findnearestface(&dist); if( !efa_mouse ) { - error("Nothing indicated "); + /* error("Nothing indicated "); */ /* this is mostly annoying, eps with occluded geometry */ return; } diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index 3c945775b5b..2e5785eaab8 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -5942,7 +5942,7 @@ void hide_objects(int select) Base *base; short changed = 0, changed_act = 0; for(base = FIRSTBASE; base; base=base->next){ - if(TESTBASELIB(base)==select){ + if ((base->lay & G.vd->lay) && (TESTBASELIB(base)==select)) { base->flag &= ~SELECT; base->object->flag = base->flag; base->object->restrictflag |= OB_RESTRICT_VIEW; diff --git a/source/blender/src/editseq.c b/source/blender/src/editseq.c index fb0fac4489d..b9351f82d1e 100644 --- a/source/blender/src/editseq.c +++ b/source/blender/src/editseq.c @@ -2634,12 +2634,13 @@ void set_filter_seq(void) ed= G.scene->ed; if(ed==0) return; - if(okee("Set FilterY")==0) return; + if(okee("Set Deinterlace")==0) return; WHILE_SEQ(ed->seqbasep) { if(seq->flag & SELECT) { if(seq->type==SEQ_MOVIE) { seq->flag |= SEQ_FILTERY; + reload_sequence_new_file(seq); } } diff --git a/source/blender/src/editsima.c b/source/blender/src/editsima.c index 5f8485267bc..18a9803dcae 100644 --- a/source/blender/src/editsima.c +++ b/source/blender/src/editsima.c @@ -2690,15 +2690,17 @@ void image_changed(SpaceImage *sima, Image *image) if(image->id.us==0) id_us_plus(&image->id); else id_lib_extern(&image->id); - +#if 0 /* GE People dont like us messing with their face modes */ if (tface->transp==TF_ADD) {} /* they obviously know what they are doing! - leave as is */ else if (ibuf && ibuf->depth == 32) tface->transp = TF_ALPHA; else tface->transp = TF_SOLID; - +#endif } else { tface->tpage= NULL; tface->mode &= ~TF_TEX; +#if 0 tface->transp = TF_SOLID; +#endif } change = 1; } diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c index 6582866d9a1..4fbf92d646e 100644 --- a/source/blender/src/interface.c +++ b/source/blender/src/interface.c @@ -2797,6 +2797,10 @@ static void ui_add_link_line(ListBase *listb, uiBut *but, uiBut *bt) line->to= bt; } +uiBut *uiFindInlink(uiBlock *block, void *poin) +{ + return ui_find_inlink(block, poin); +} void uiComposeLinks(uiBlock *block) { diff --git a/source/blender/src/oops.c b/source/blender/src/oops.c index 99645b5e71f..51d83eff3e6 100644 --- a/source/blender/src/oops.c +++ b/source/blender/src/oops.c @@ -1153,7 +1153,6 @@ void build_oops() } } else if(type==ID_AR && G.soops->visiflag & OOPS_AR) { - bArmature *ar= ob->data; oops= add_test_oops(ob->data); } } diff --git a/source/blender/src/poseobject.c b/source/blender/src/poseobject.c index dcceea971f7..cc08bf53a72 100644 --- a/source/blender/src/poseobject.c +++ b/source/blender/src/poseobject.c @@ -1627,6 +1627,8 @@ void pose_flipquats(void) pchan->quat[3]= -pchan->quat[3]; } } - + + /* do autokey */ + autokeyframe_pose_cb_func(ob, TFM_ROTATION, 0); } diff --git a/source/blender/src/sequence.c b/source/blender/src/sequence.c index bf519dd6e9c..6851929bbc2 100644 --- a/source/blender/src/sequence.c +++ b/source/blender/src/sequence.c @@ -445,7 +445,10 @@ void reload_sequence_new_file(Sequence * seq) seq->strip->len = seq->len; } else if (seq->type == SEQ_MOVIE) { if(seq->anim) IMB_free_anim(seq->anim); - seq->anim = openanim(str, IB_rect); + seq->anim = openanim( + str, IB_rect | + ((seq->flag & SEQ_FILTERY) + ? IB_animdeinterlace : 0)); if (!seq->anim) { return; @@ -1445,7 +1448,7 @@ static void input_preprocess(Sequence * seq, TStripElem* se, int cfra) seq->strip->orx= se->ibuf->x; seq->strip->ory= se->ibuf->y; - if(seq->flag & SEQ_FILTERY) { + if((seq->flag & SEQ_FILTERY) && seq->type != SEQ_MOVIE) { IMB_filtery(se->ibuf); } @@ -1772,8 +1775,11 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra, BLI_join_dirfile(name, seq->strip->dir, seq->strip->stripdata->name); BLI_convertstringcode(name, G.sce); BLI_convertstringframe(name, G.scene->r.cfra); - - seq->anim = openanim(name, IB_rect); + + seq->anim = openanim( + name, IB_rect | + ((seq->flag & SEQ_FILTERY) + ? IB_animdeinterlace : 0)); } if(seq->anim) { IMB_anim_set_preseek(seq->anim, seq->anim_preseek); diff --git a/source/blender/src/space.c b/source/blender/src/space.c index c49486a6294..4422411b1c5 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -378,9 +378,6 @@ void space_set_commmandline_options(void) { if ( (syshandle = SYS_GetSystem()) ) { /* User defined settings */ - a= (U.gameflags & USER_VERTEX_ARRAYS); - SYS_WriteCommandLineInt(syshandle, "vertexarrays", a); - a= (U.gameflags & USER_DISABLE_SOUND); SYS_WriteCommandLineInt(syshandle, "noaudio", a); @@ -437,9 +434,6 @@ static void SaveState(void) if(G.f & G_TEXTUREPAINT) texpaint_enable_mipmap(); - if(G.scene->camera==0 || G.scene->camera->type!=OB_CAMERA) - error("no (correct) camera"); - waitcursor(1); } @@ -4258,15 +4252,11 @@ void drawinfospace(ScrArea *sa, void *spacedata) uiDefButS(block, MENU, B_GLRESLIMITCHANGED, "GL Texture Clamp Off%x0|%l|GL Texture Clamp 8192%x8192|GL Texture Clamp 4096%x4096|GL Texture Clamp 2048%x2048|GL Texture Clamp 1024%x1024|GL Texture Clamp 512%x512|GL Texture Clamp 256%x256|GL Texture Clamp 128%x128", (xpos+edgsp+(5*mpref)+(5*midsp)),y4,mpref,buth, &(U.glreslimit), 0, 0, 0, 0, "Limit the texture size to save graphics memory"); - uiDefButBitI(block, TOG, USER_VERTEX_ARRAYS, 0, "Vertex Arrays", - (xpos+edgsp+(5*mpref)+(5*midsp)),y3,mpref,buth, - &(U.gameflags), 0, 0, 0, 0, "Toggles between vertex arrays on (less reliable) and off (more reliable)"); - uiDefButI(block, NUM, 0, "Time Out ", - (xpos+edgsp+(5*mpref)+(5*midsp)), y2, mpref, buth, + (xpos+edgsp+(5*mpref)+(5*midsp)), y3, mpref, buth, &U.textimeout, 0.0, 3600.0, 30, 2, "Time since last access of a GL texture in seconds after which it is freed. (Set to 0 to keep textures allocated)"); uiDefButI(block, NUM, 0, "Collect Rate ", - (xpos+edgsp+(5*mpref)+(5*midsp)), y1, mpref, buth, + (xpos+edgsp+(5*mpref)+(5*midsp)), y2, mpref, buth, &U.texcollectrate, 1.0, 3600.0, 30, 2, "Number of seconds between each run of the GL texture garbage collector."); /* *** */ @@ -4976,11 +4966,13 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt) } break; case DKEY: - if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY)) + if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY)) { duplicate_marker(); - else if ((G.qual==LR_SHIFTKEY)) { + } else if ((G.qual==LR_SHIFTKEY)) { if(sseq->mainb) break; add_duplicate_seq(); + } else if (G.qual == 0) { + set_filter_seq(); } break; case EKEY: @@ -4988,10 +4980,6 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt) if((G.qual==0)) transform_seq('e', 0); break; - case FKEY: - if((G.qual==0)) - set_filter_seq(); - break; case GKEY: if (G.qual & LR_CTRLKEY) transform_markers('g', 0); diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c index 4270ce6a069..705a5f868e7 100644 --- a/source/blender/src/transform.c +++ b/source/blender/src/transform.c @@ -2621,7 +2621,7 @@ static void applyRotation(TransInfo *t, float angle, float axis[3]) continue; if (t->con.applyRot) { - t->con.applyRot(t, td, axis); + t->con.applyRot(t, td, axis, NULL); VecRotToMat3(axis, angle * td->factor, mat); } else if (t->flag & T_PROP_EDIT) { @@ -2654,7 +2654,7 @@ int Rotation(TransInfo *t, short mval[2]) snapGrid(t, &final); if (t->con.applyRot) { - t->con.applyRot(t, NULL, axis); + t->con.applyRot(t, NULL, axis, &final); } applySnapping(t, &final); @@ -3314,7 +3314,7 @@ int PushPull(TransInfo *t, short mval[2]) } if (t->con.applyRot && t->con.mode & CON_APPLY) { - t->con.applyRot(t, NULL, axis); + t->con.applyRot(t, NULL, axis, NULL); } for(i = 0 ; i < t->total; i++, td++) { @@ -3326,7 +3326,7 @@ int PushPull(TransInfo *t, short mval[2]) VecSubf(vec, t->center, td->center); if (t->con.applyRot && t->con.mode & CON_APPLY) { - t->con.applyRot(t, td, axis); + t->con.applyRot(t, td, axis, NULL); if (isLockConstraint(t)) { float dvec[3]; Projf(dvec, vec, axis); diff --git a/source/blender/src/transform_constraints.c b/source/blender/src/transform_constraints.c index 2d01c2303fc..796b013cb88 100644 --- a/source/blender/src/transform_constraints.c +++ b/source/blender/src/transform_constraints.c @@ -393,7 +393,7 @@ static void applyObjectConstraintSize(TransInfo *t, TransData *td, float smat[3] * (ie: not doing counterclockwise rotations when the mouse moves clockwise). */ -static void applyAxisConstraintRot(TransInfo *t, TransData *td, float vec[3]) +static void applyAxisConstraintRot(TransInfo *t, TransData *td, float vec[3], float *angle) { if (!td && t->con.mode & CON_APPLY) { int mode = t->con.mode & (CON_AXIS0|CON_AXIS1|CON_AXIS2); @@ -413,9 +413,9 @@ static void applyAxisConstraintRot(TransInfo *t, TransData *td, float vec[3]) break; } /* don't flip axis if asked to or if num input */ - if (!(mode & CON_NOFLIP) && hasNumInput(&t->num) == 0) { + if (angle && (mode & CON_NOFLIP) == 0 && hasNumInput(&t->num) == 0) { if (Inpf(vec, t->viewinv[2]) > 0.0f) { - VecMulf(vec, -1.0f); + *angle = -(*angle); } } } @@ -435,10 +435,15 @@ static void applyAxisConstraintRot(TransInfo *t, TransData *td, float vec[3]) * (ie: not doing counterclockwise rotations when the mouse moves clockwise). */ -static void applyObjectConstraintRot(TransInfo *t, TransData *td, float vec[3]) +static void applyObjectConstraintRot(TransInfo *t, TransData *td, float vec[3], float *angle) { - if (td && t->con.mode & CON_APPLY) { + if (t->con.mode & CON_APPLY) { int mode = t->con.mode & (CON_AXIS0|CON_AXIS1|CON_AXIS2); + + /* on setup call, use first object */ + if (td == NULL) { + td= t->data; + } switch(mode) { case CON_AXIS0: @@ -454,9 +459,9 @@ static void applyObjectConstraintRot(TransInfo *t, TransData *td, float vec[3]) VECCOPY(vec, td->axismtx[2]); break; } - if (!(mode & CON_NOFLIP)) { + if (angle && (mode & CON_NOFLIP) == 0 && hasNumInput(&t->num) == 0) { if (Inpf(vec, t->viewinv[2]) > 0.0f) { - VecMulf(vec, -1.0f); + *angle = -(*angle); } } } diff --git a/source/blender/src/transform_generics.c b/source/blender/src/transform_generics.c index eaa4a1d0ecf..6cb7a34d1bc 100644 --- a/source/blender/src/transform_generics.c +++ b/source/blender/src/transform_generics.c @@ -325,7 +325,7 @@ void recalcData(TransInfo *t) else { for (base=G.scene->base.first; base; base=base->next) { /* recalculate scale of selected nla-strips */ - if (base->object->nlastrips.first) { + if (base->object && base->object->nlastrips.first) { Object *bob= base->object; bActionStrip *strip; @@ -398,8 +398,15 @@ void recalcData(TransInfo *t) } } else if(G.sipo->blocktype==ID_OB) { + Object *ob= OBACT; Base *base= FIRSTBASE; + /* only if this if active object has this ipo in an action (assumes that current ipo is in action) */ + if ((ob) && (ob->ipoflag & OB_ACTION_OB) && (G.sipo->pin==0)) { + ob->ctime= -1234567.0f; + DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); + } + while(base) { if(base->object->ipo==G.sipo->ipo) { do_ob_ipo(base->object); diff --git a/source/blender/src/transform_snap.c b/source/blender/src/transform_snap.c index 295cfa4574c..d16308f17ae 100644 --- a/source/blender/src/transform_snap.c +++ b/source/blender/src/transform_snap.c @@ -412,7 +412,7 @@ float RotationBetween(TransInfo *t, float p1[3], float p2[3]) if (t->con.applyRot != NULL && (t->con.mode & CON_APPLY)) { float axis[3], tmp[3]; - t->con.applyRot(t, NULL, axis); + t->con.applyRot(t, NULL, axis, NULL); Projf(tmp, end, axis); VecSubf(end, end, tmp); @@ -737,136 +737,6 @@ void TargetSnapClosest(TransInfo *t) } /*================================================================*/ - -/* find snapping point on face, return 1 on success */ -int snapFace(MFace *face, EditFace *efa, MVert *verts, float *intersect, float *loc, float *no) -{ - MVert *v[4]; - EditVert *eve[4]; - int totvert; - int result = 0; - - v[0] = verts + face->v1; - v[1] = verts + face->v2; - v[2] = verts + face->v3; - - if (face->v4) - { - v[3] = verts + face->v4; - totvert = 4; - } - else - { - v[3] = NULL; - totvert = 3; - } - - if (efa) - { - eve[0] = efa->v1; - eve[1] = efa->v2; - eve[2] = efa->v3; - eve[3] = efa->v4; - } - - switch(G.scene->snap_mode) - { - case SCE_SNAP_MODE_VERTEX: - { - float min_dist = FLT_MAX; - int i; - - for(i = 0; i < totvert; i++) - { - - if (efa == NULL || (eve[i]->f1 & SELECT) == 0) - { - float vert_dist = VecLenf(v[i]->co, intersect); - - if (vert_dist < min_dist) - { - result = 1; - - min_dist = vert_dist; - - VECCOPY(loc, v[i]->co); - NormalShortToFloat(no, v[i]->no); - } - } - } - break; - } - case SCE_SNAP_MODE_EDGE: - { - float min_dist = FLT_MAX; - int i; - - for(i = 0; i < totvert; i++) - { - MVert *v1, *v2; - EditVert *eve1, *eve2; - - v1 = v[i]; - v2 = v[(i + 1) % totvert]; - - eve1 = eve[i]; - eve2 = eve[(i + 1) % totvert]; - - if (efa == NULL || ((eve1->f1 & SELECT) == 0 && (eve2->f1 & SELECT) == 0)) - { - float edge_loc[3]; - float vec[3]; - float mul; - float edge_dist; - - VecSubf(edge_loc, v2->co, v1->co); - VecSubf(vec, intersect, v1->co); - - mul = Inpf(vec, edge_loc) / Inpf(edge_loc, edge_loc); - - VecMulf(edge_loc, mul); - VecAddf(edge_loc, edge_loc, v1->co); - - edge_dist = VecLenf(edge_loc, intersect); - - if (edge_dist < min_dist) - { - float n1[3], n2[3]; - result = 1; - - min_dist = edge_dist; - - VECCOPY(loc, edge_loc); - - NormalShortToFloat(n1, v1->no); - NormalShortToFloat(n2, v2->no); - VecLerpf(no, n1, n2, mul); - Normalize(no); - } - } - } - break; - } - case SCE_SNAP_MODE_FACE: - { - if (efa == NULL || ((efa->f1 & SELECT) == 0)) - { - result = 1; - - VECCOPY(loc, intersect); - - if (totvert == 4) - CalcNormFloat4(v[0]->co, v[1]->co, v[2]->co, v[3]->co, no); - else - CalcNormFloat(v[0]->co, v[1]->co, v[2]->co, no); - } - break; - } - } - - return result; -} - int snapDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float ray_start[3], float ray_normal[3], short mval[2], float *loc, float *no, int *dist, float *depth, short EditMesh) { int retval = 0; @@ -891,7 +761,7 @@ int snapDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float ray_sta Mat4Mul3Vecfl(imat, ray_normal_local); - /* If number of vert is more than an arbitrary limit, + /* If number of vert is more than an arbitrary limit, * test against boundbox first * */ if (totface > 16) { @@ -900,117 +770,83 @@ int snapDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float ray_sta } if (test == 1) { - MVert *verts = dm->getVertArray(dm); - MFace *faces = dm->getFaceArray(dm); - int *index_array = NULL; - int index = 0; - int i; - if (EditMesh) + switch (G.scene->snap_mode) { - index_array = dm->getFaceDataArray(dm, CD_ORIGINDEX); - EM_init_index_arrays(0, 0, 1); - } - - for( i = 0; i < totface; i++) { - EditFace *efa = NULL; - MFace *f = faces + i; - float lambda; - int result; - - test = 1; /* reset for every face */ - - if (EditMesh) - { - if (index_array) + case SCE_SNAP_MODE_FACE: + { + MVert *verts = dm->getVertArray(dm); + MFace *faces = dm->getFaceArray(dm); + int *index_array = NULL; + int index = 0; + int i; + + if (EditMesh) { - index = index_array[i]; - } - else - { - index = i; + index_array = dm->getFaceDataArray(dm, CD_ORIGINDEX); + EM_init_index_arrays(0, 0, 1); } - if (index == ORIGINDEX_NONE) - { - test = 0; - } - else - { - efa = EM_get_face_for_index(index); + for( i = 0; i < totface; i++) { + EditFace *efa = NULL; + MFace *f = faces + i; + float lambda; + int result; - if (efa && efa->f1 & SELECT) + test = 1; /* reset for every face */ + + if (EditMesh) { - test = 0; - } - } - } - - - if (test) - { - result = RayIntersectsTriangle(ray_start_local, ray_normal_local, verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, &lambda, NULL); - - if (result) { - float location[3], normal[3]; - float intersect[3]; - - VECCOPY(intersect, ray_normal_local); - VecMulf(intersect, lambda); - VecAddf(intersect, intersect, ray_start_local); - - if (snapFace(f, efa, verts, intersect, location, normal)) - { - float new_depth; - int screen_loc[2]; - int new_dist; - - Mat4MulVecfl(obmat, location); - - new_depth = VecLenf(location, ray_start); - - project_int(location, screen_loc); - new_dist = abs(screen_loc[0] - mval[0]) + abs(screen_loc[1] - mval[1]); - - if (new_dist <= *dist && new_depth < *depth) + if (index_array) { - *depth = new_depth; - retval = 1; - - VECCOPY(loc, location); - VECCOPY(no, normal); - - Mat3MulVecfl(timat, no); - Normalize(no); - - project_int(loc, screen_loc); - - *dist = new_dist; - } - } - } - - if (f->v4 && result == 0) - { - result = RayIntersectsTriangle(ray_start_local, ray_normal_local, verts[f->v3].co, verts[f->v4].co, verts[f->v1].co, &lambda, NULL); - - if (result) { - float location[3], normal[3]; - float intersect[3]; + index = index_array[i]; + } + else + { + index = i; + } - VECCOPY(intersect, ray_normal_local); - VecMulf(intersect, lambda); - VecAddf(intersect, intersect, ray_start_local); - - if (snapFace(f, efa, verts, intersect, location, normal)) - { + if (index == ORIGINDEX_NONE) + { + test = 0; + } + else + { + efa = EM_get_face_for_index(index); + + if (efa && efa->f & SELECT) + { + test = 0; + } + } + } + + + if (test) + { + result = RayIntersectsTriangle(ray_start_local, ray_normal_local, verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, &lambda, NULL); + + if (result) { + float location[3], normal[3]; + float intersect[3]; float new_depth; int screen_loc[2]; int new_dist; + VECCOPY(intersect, ray_normal_local); + VecMulf(intersect, lambda); + VecAddf(intersect, intersect, ray_start_local); + + VECCOPY(location, intersect); + + if (f->v4) + CalcNormFloat4(verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, verts[f->v4].co, normal); + else + CalcNormFloat(verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, normal); + Mat4MulVecfl(obmat, location); - new_depth = VecLenf(location, ray_start); + new_depth = VecLenf(location, ray_start); project_int(location, screen_loc); new_dist = abs(screen_loc[0] - mval[0]) + abs(screen_loc[1] - mval[1]); @@ -1029,14 +865,283 @@ int snapDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float ray_sta *dist = new_dist; } } + + if (f->v4 && result == 0) + { + result = RayIntersectsTriangle(ray_start_local, ray_normal_local, verts[f->v3].co, verts[f->v4].co, verts[f->v1].co, &lambda, NULL); + + if (result) { + float location[3], normal[3]; + float intersect[3]; + float new_depth; + int screen_loc[2]; + int new_dist; + + VECCOPY(intersect, ray_normal_local); + VecMulf(intersect, lambda); + VecAddf(intersect, intersect, ray_start_local); + + VECCOPY(location, intersect); + + if (f->v4) + CalcNormFloat4(verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, verts[f->v4].co, normal); + else + CalcNormFloat(verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, normal); + + Mat4MulVecfl(obmat, location); + + new_depth = VecLenf(location, ray_start); + + project_int(location, screen_loc); + new_dist = abs(screen_loc[0] - mval[0]) + abs(screen_loc[1] - mval[1]); + + if (new_dist <= *dist && new_depth < *depth) + { + *depth = new_depth; + retval = 1; + + VECCOPY(loc, location); + VECCOPY(no, normal); + + Mat3MulVecfl(timat, no); + Normalize(no); + + *dist = new_dist; + } + } + } } } + + if (EditMesh) + { + EM_free_index_arrays(); + } + break; + } + case SCE_SNAP_MODE_VERTEX: + { + MVert *verts = dm->getVertArray(dm); + int *index_array = NULL; + int index = 0; + int i; + + if (EditMesh) + { + index_array = dm->getVertDataArray(dm, CD_ORIGINDEX); + EM_init_index_arrays(1, 0, 0); + } + + for( i = 0; i < totvert; i++) { + EditVert *eve = NULL; + MVert *v = verts + i; + + test = 1; /* reset for every vert */ + + if (EditMesh) + { + if (index_array) + { + index = index_array[i]; + } + else + { + index = i; + } + + if (index == ORIGINDEX_NONE) + { + test = 0; + } + else + { + eve = EM_get_vert_for_index(index); + + if (eve && eve->f & SELECT) + { + test = 0; + } + } + } + + + if (test) + { + float dvec[3]; + + VecSubf(dvec, v->co, ray_start_local); + + if (Inpf(ray_normal_local, dvec) > 0) + { + float location[3]; + float new_depth; + int screen_loc[2]; + int new_dist; + + VECCOPY(location, v->co); + + Mat4MulVecfl(obmat, location); + + new_depth = VecLenf(location, ray_start); + + project_int(location, screen_loc); + new_dist = abs(screen_loc[0] - mval[0]) + abs(screen_loc[1] - mval[1]); + + if (new_dist <= *dist && new_depth < *depth) + { + *depth = new_depth; + retval = 1; + + VECCOPY(loc, location); + + NormalShortToFloat(no, v->no); + Mat3MulVecfl(timat, no); + Normalize(no); + + *dist = new_dist; + } + } + } + } + + if (EditMesh) + { + EM_free_index_arrays(); + } + break; + } + case SCE_SNAP_MODE_EDGE: + { + MVert *verts = dm->getVertArray(dm); + MEdge *edges = dm->getEdgeArray(dm); + int totedge = dm->getNumEdges(dm); + int *index_array = NULL; + int index = 0; + int i; + + if (EditMesh) + { + index_array = dm->getEdgeDataArray(dm, CD_ORIGINDEX); + EM_init_index_arrays(0, 1, 0); + } + + for( i = 0; i < totedge; i++) { + EditEdge *eed = NULL; + MEdge *e = edges + i; + + test = 1; /* reset for every vert */ + + if (EditMesh) + { + if (index_array) + { + index = index_array[i]; + } + else + { + index = i; + } + + if (index == ORIGINDEX_NONE) + { + test = 0; + } + else + { + eed = EM_get_edge_for_index(index); + + if (eed && ((eed->v1->f & SELECT) || (eed->v2->f & SELECT))) + { + test = 0; + } + } + } + + + if (test) + { + float intersect[3] = {0, 0, 0}, ray_end[3], dvec[3]; + int result; + + VECCOPY(ray_end, ray_normal_local); + VecMulf(ray_end, 2000); + VecAddf(ray_end, ray_start_local, ray_end); + + result = LineIntersectLine(verts[e->v1].co, verts[e->v2].co, ray_start_local, ray_end, intersect, dvec); /* dvec used but we don't care about result */ + + if (result) + { + float edge_loc[3], vec[3]; + float mul; + + /* check for behind ray_start */ + VecSubf(dvec, intersect, ray_start_local); + + VecSubf(edge_loc, verts[e->v1].co, verts[e->v2].co); + VecSubf(vec, intersect, verts[e->v2].co); + + mul = Inpf(vec, edge_loc) / Inpf(edge_loc, edge_loc); + + if (mul > 1) { + mul = 1; + VECCOPY(intersect, verts[e->v1].co); + } + else if (mul < 0) { + mul = 0; + VECCOPY(intersect, verts[e->v2].co); + } + + if (Inpf(ray_normal_local, dvec) > 0) + { + float location[3]; + float new_depth; + int screen_loc[2]; + int new_dist; + + VECCOPY(location, intersect); + + Mat4MulVecfl(obmat, location); + + new_depth = VecLenf(location, ray_start); + + project_int(location, screen_loc); + new_dist = abs(screen_loc[0] - mval[0]) + abs(screen_loc[1] - mval[1]); + + if (new_dist <= *dist && new_depth < *depth) + { + float n1[3], n2[3]; + + *depth = new_depth; + retval = 1; + + VecSubf(edge_loc, verts[e->v1].co, verts[e->v2].co); + VecSubf(vec, intersect, verts[e->v2].co); + + mul = Inpf(vec, edge_loc) / Inpf(edge_loc, edge_loc); + + NormalShortToFloat(n1, verts[e->v1].no); + NormalShortToFloat(n2, verts[e->v2].no); + VecLerpf(no, n2, n1, mul); + Normalize(no); + + VECCOPY(loc, location); + + Mat3MulVecfl(timat, no); + Normalize(no); + + *dist = new_dist; + } + } + } + } + } + + if (EditMesh) + { + EM_free_index_arrays(); + } + break; } - } - - if (EditMesh) - { - EM_free_index_arrays(); } } } diff --git a/source/blender/src/view.c b/source/blender/src/view.c index 356a297b284..f457f9203ff 100644 --- a/source/blender/src/view.c +++ b/source/blender/src/view.c @@ -689,10 +689,6 @@ void viewmoveNDOFfly(int mode) if (G.vd->ndoffilter) filterNDOFvalues(fval); -// for(i=0;i<7;i++) printf("%f ",dval[i]); -// printf("\n"); - - // Scale input values // if(dval[6] == 0) return; // guard against divide by zero @@ -701,12 +697,6 @@ void viewmoveNDOFfly(int mode) // user scaling dval[i] = dval[i] * ndof_axis_scale[i]; - - // non-linear scaling - if(dval[i]<0.0f) - dval[i] = -1.0f * dval[i] * dval[i]; - else - dval[i] = dval[i] * dval[i]; } @@ -1216,18 +1206,16 @@ void viewmoveNDOF(int mode) // prevTime = now; // sbadjust *= 60 * frametime; /* normalize ndof device adjustments to 100Hz for framerate independence */ - /* fetch the current state of the ndof device */ + /* fetch the current state of the ndof device & enforce dominant mode if selected */ getndof(fval); - // printf(" motion command %f %f %f %f %f %f %f \n", fval[0], fval[1], fval[2], - // fval[3], fval[4], fval[5], fval[6]); - if (G.vd->ndoffilter) - filterNDOFvalues(fval); + if (G.vd->ndoffilter) + filterNDOFvalues(fval); // put scaling back here, was previously in ghostwinlay - fval[0] = fval[0] * (1.0f/1200.0f); - fval[1] = fval[1] * (1.0f/1200.0f); - fval[2] = fval[2] * (1.0f/1200.0f); + fval[0] = fval[0] * (1.0f/600.0f); + fval[1] = fval[1] * (1.0f/600.0f); + fval[2] = fval[2] * (1.0f/1100.0f); fval[3] = fval[3] * 0.00005f; fval[4] =-fval[4] * 0.00005f; fval[5] = fval[5] * 0.00005f; @@ -1255,14 +1243,16 @@ void viewmoveNDOF(int mode) VECCOPY(obofs, G.vd->ofs); } - /* calc an adjustment based on distance from camera */ - if (ob) { + /* calc an adjustment based on distance from camera + disabled per patch 14402 */ + d = 1.0f; + +/* if (ob) { VecSubf(diff, obofs, G.vd->ofs); d = VecLength(diff); } - else { - d = 1.0f; - } +*/ + reverse = (G.vd->persmat[2][1] < 0.0f) ? -1.0f : 1.0f; /*---------------------------------------------------- diff --git a/source/creator/creator.c b/source/creator/creator.c index 2e6b5d7353e..9589f1e3e94 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -195,7 +195,7 @@ static void print_help(void) printf (" (formats that can be compiled into blender, not available on all systems)\n"); printf (" \tHDR TIFF EXR MULTILAYER MPEG AVICODEC QUICKTIME CINEON DPX DDS\n"); printf (" -x \tSet option to add the file extension to the end of the file.\n"); - printf (" -t \tUse amount of for rendering.\n"); + printf (" -t \tUse amount of for rendering (background mode only).\n"); printf (" [1-8], 0 for systems processor count.\n"); printf ("\nAnimation playback options:\n"); printf (" -a \tPlayback , only operates this way when -b is not used.\n"); @@ -723,6 +723,8 @@ int main(int argc, char **argv) a++; if(G.background) { RE_set_max_threads(atoi(argv[a])); + } else { + printf("Warning: threads can only be set in background mode\n"); } break; case 'x': /* extension */ diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index 06aa0609ad9..4af5ac4d5d2 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -165,20 +165,14 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, RAS_IRenderTools* rendertools = new KX_BlenderRenderTools(); RAS_IRasterizer* rasterizer = NULL; - // let's see if we want to use vertexarrays or not - int usevta = SYS_GetCommandLineInt(syshandle,"vertexarrays",1); - bool useVertexArrays = (usevta > 0); - - bool lock_arrays = (displaylists && useVertexArrays); - - if(displaylists){ - if (useVertexArrays) - rasterizer = new RAS_ListRasterizer(canvas, true, lock_arrays); + if(displaylists) { + if (GLEW_VERSION_1_1) + rasterizer = new RAS_ListRasterizer(canvas, true, true); else rasterizer = new RAS_ListRasterizer(canvas); } - else if (useVertexArrays && GLEW_VERSION_1_1) - rasterizer = new RAS_VAOpenGLRasterizer(canvas, lock_arrays); + else if (GLEW_VERSION_1_1) + rasterizer = new RAS_VAOpenGLRasterizer(canvas, false); else rasterizer = new RAS_OpenGLRasterizer(canvas); @@ -513,16 +507,14 @@ extern "C" void StartKetsjiShellSimulation(struct ScrArea *area, RAS_IRenderTools* rendertools = new KX_BlenderRenderTools(); RAS_IRasterizer* rasterizer = NULL; - // let's see if we want to use vertexarrays or not - int usevta = SYS_GetCommandLineInt(syshandle,"vertexarrays",1); - bool useVertexArrays = (usevta > 0); - - bool lock_arrays = (displaylists && useVertexArrays); - - if(displaylists && !useVertexArrays) - rasterizer = new RAS_ListRasterizer(canvas); - else if (useVertexArrays && GLEW_VERSION_1_1) - rasterizer = new RAS_VAOpenGLRasterizer(canvas, lock_arrays); + if(displaylists) { + if (GLEW_VERSION_1_1) + rasterizer = new RAS_ListRasterizer(canvas, true, true); + else + rasterizer = new RAS_ListRasterizer(canvas); + } + else if (GLEW_VERSION_1_1) + rasterizer = new RAS_VAOpenGLRasterizer(canvas, false); else rasterizer = new RAS_OpenGLRasterizer(canvas); diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp index 07a3649aa0f..73d2870720a 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp @@ -483,9 +483,9 @@ void KX_BlenderRenderTools::MotionBlur(RAS_IRasterizer* rasterizer) } } -void KX_BlenderRenderTools::Update2DFilter(RAS_2DFilterManager::RAS_2DFILTER_MODE filtermode, int pass, STR_String& text) +void KX_BlenderRenderTools::Update2DFilter(RAS_2DFilterManager::RAS_2DFILTER_MODE filtermode, int pass, STR_String& text, short texture_flag) { - m_filtermanager.EnableFilter(filtermode, pass, text); + m_filtermanager.EnableFilter(filtermode, pass, text, texture_flag); } void KX_BlenderRenderTools::Render2DFilters(RAS_ICanvas* canvas) diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h index 31eaa14d66b..7748e31156d 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h @@ -101,7 +101,7 @@ public: virtual void MotionBlur(RAS_IRasterizer* rasterizer); - virtual void Update2DFilter(RAS_2DFilterManager::RAS_2DFILTER_MODE filtermode, int pass, STR_String& text); + virtual void Update2DFilter(RAS_2DFilterManager::RAS_2DFILTER_MODE filtermode, int pass, STR_String& text, short texture_flag); virtual void Render2DFilters(RAS_ICanvas* canvas); diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index ad126ebf123..5050da3fe7f 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -49,6 +49,7 @@ #include "BLI_arithb.h" #include "MT_Matrix4x4.h" #include "BKE_utildefines.h" +#include "FloatValue.h" #ifdef HAVE_CONFIG_H #include @@ -348,6 +349,18 @@ bool BL_ActionActuator::Update(double curtime, bool frame) break; } + /* Set the property if its defined */ + if (m_framepropname[0] != '\0') { + CValue* propowner = GetParent(); + CValue* oldprop = propowner->GetProperty(m_framepropname); + CValue* newval = new CFloatValue(m_localtime); + if (oldprop) { + oldprop->SetValue(newval); + } else { + propowner->SetProperty(m_framepropname, newval); + } + newval->Release(); + } if (bNegativeEvent) m_blendframe=0.0; @@ -446,6 +459,7 @@ PyMethodDef BL_ActionActuator::Methods[] = { {"setPriority", (PyCFunction) BL_ActionActuator::sPySetPriority, METH_VARARGS, SetPriority_doc}, {"setFrame", (PyCFunction) BL_ActionActuator::sPySetFrame, METH_VARARGS, SetFrame_doc}, {"setProperty", (PyCFunction) BL_ActionActuator::sPySetProperty, METH_VARARGS, SetProperty_doc}, + {"setFrameProperty", (PyCFunction) BL_ActionActuator::sPySetFrameProperty, METH_VARARGS, SetFrameProperty_doc}, {"setBlendtime", (PyCFunction) BL_ActionActuator::sPySetBlendtime, METH_VARARGS, SetBlendtime_doc}, {"getAction", (PyCFunction) BL_ActionActuator::sPyGetAction, METH_VARARGS, GetAction_doc}, @@ -455,6 +469,7 @@ PyMethodDef BL_ActionActuator::Methods[] = { {"getPriority", (PyCFunction) BL_ActionActuator::sPyGetPriority, METH_VARARGS, GetPriority_doc}, {"getFrame", (PyCFunction) BL_ActionActuator::sPyGetFrame, METH_VARARGS, GetFrame_doc}, {"getProperty", (PyCFunction) BL_ActionActuator::sPyGetProperty, METH_VARARGS, GetProperty_doc}, + {"getFrameProperty", (PyCFunction) BL_ActionActuator::sPyGetFrameProperty, METH_VARARGS, GetFrameProperty_doc}, {"setChannel", (PyCFunction) BL_ActionActuator::sPySetChannel, METH_VARARGS, SetChannel_doc}, // {"getChannel", (PyCFunction) BL_ActionActuator::sPyGetChannel, METH_VARARGS}, {"getType", (PyCFunction) BL_ActionActuator::sPyGetType, METH_VARARGS, GetType_doc}, @@ -502,6 +517,21 @@ PyObject* BL_ActionActuator::PyGetProperty(PyObject* self, return result; } +/* getProperty */ +char BL_ActionActuator::GetFrameProperty_doc[] = +"getFrameProperty()\n" +"\tReturns the name of the property, that is set to the current frame number.\n"; + +PyObject* BL_ActionActuator::PyGetFrameProperty(PyObject* self, + PyObject* args, + PyObject* kwds) { + PyObject *result; + + result = Py_BuildValue("s", (const char *)m_framepropname); + + return result; +} + /* getFrame */ char BL_ActionActuator::GetFrame_doc[] = "getFrame()\n" @@ -763,6 +793,25 @@ PyObject* BL_ActionActuator::PySetProperty(PyObject* self, return Py_None; } +/* setFrameProperty */ +char BL_ActionActuator::SetFrameProperty_doc[] = +"setFrameProperty(prop)\n" +"\t - prop : A string specifying the property of the frame set up update.\n"; + +PyObject* BL_ActionActuator::PySetFrameProperty(PyObject* self, + PyObject* args, + PyObject* kwds) { + char *string; + + if (PyArg_ParseTuple(args,"s",&string)) + { + m_framepropname = string; + } + + Py_INCREF(Py_None); + return Py_None; +} + /* PyObject* BL_ActionActuator::PyGetChannel(PyObject* self, PyObject* args, diff --git a/source/gameengine/Converter/BL_ActionActuator.h b/source/gameengine/Converter/BL_ActionActuator.h index 62edcc7fad7..190f727c9c3 100644 --- a/source/gameengine/Converter/BL_ActionActuator.h +++ b/source/gameengine/Converter/BL_ActionActuator.h @@ -40,6 +40,7 @@ public: Py_Header; BL_ActionActuator(SCA_IObject* gameobj, const STR_String& propname, + const STR_String& framepropname, float starttime, float endtime, struct bAction *action, @@ -67,7 +68,8 @@ public: m_blendpose(NULL), m_userpose(NULL), m_action(action), - m_propname(propname) + m_propname(propname), + m_framepropname(framepropname) { }; virtual ~BL_ActionActuator(); @@ -84,6 +86,7 @@ public: KX_PYMETHOD_DOC(BL_ActionActuator,SetEnd); KX_PYMETHOD_DOC(BL_ActionActuator,SetFrame); KX_PYMETHOD_DOC(BL_ActionActuator,SetProperty); + KX_PYMETHOD_DOC(BL_ActionActuator,SetFrameProperty); KX_PYMETHOD_DOC(BL_ActionActuator,SetBlendtime); KX_PYMETHOD_DOC(BL_ActionActuator,SetChannel); @@ -94,6 +97,7 @@ public: KX_PYMETHOD_DOC(BL_ActionActuator,GetEnd); KX_PYMETHOD_DOC(BL_ActionActuator,GetFrame); KX_PYMETHOD_DOC(BL_ActionActuator,GetProperty); + KX_PYMETHOD_DOC(BL_ActionActuator,GetFrameProperty); // KX_PYMETHOD(BL_ActionActuator,GetChannel); KX_PYMETHOD_DOC(BL_ActionActuator,GetType); KX_PYMETHOD_DOC(BL_ActionActuator,SetType); @@ -138,6 +142,7 @@ protected: struct bPose* m_userpose; struct bAction *m_action; STR_String m_propname; + STR_String m_framepropname; }; enum { diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 32946267202..665783a1ba5 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1668,6 +1668,8 @@ static KX_GameObject *gameobject_from_blenderobject( BL_ShapeDeformer *dcont = new BL_ShapeDeformer((BL_DeformableGameObject*)gameobj, ob, (BL_SkinMeshObject*)meshobj); ((BL_DeformableGameObject*)gameobj)->m_pDeformer = dcont; + if (bHasArmature) + dcont->LoadShapeDrivers(ob->parent); } else if (bHasArmature) { BL_SkinDeformer *dcont = new BL_SkinDeformer(ob, (BL_SkinMeshObject*)meshobj ); ((BL_DeformableGameObject*)gameobj)->m_pDeformer = dcont; @@ -2324,6 +2326,14 @@ void BL_ConvertBlenderObjects(struct Main* maggie, bool isInActiveLayer = (blenderobj->lay & activeLayerBitInfo)!=0; BL_ConvertSensors(blenderobj,gameobj,logicmgr,kxscene,keydev,executePriority,activeLayerBitInfo,isInActiveLayer,canvas,converter); } + // apply the initial state to controllers + for ( i=0;iGetCount();i++) + { + KX_GameObject* gameobj = static_cast(logicbrick_conversionlist->GetValue(i)); + struct Object* blenderobj = converter->FindBlenderObject(gameobj); + gameobj->SetState((blenderobj->init_state)?blenderobj->init_state:blenderobj->state); + } + #endif //CONVERT_LOGIC logicbrick_conversionlist->Release(); diff --git a/source/gameengine/Converter/BL_ShapeDeformer.cpp b/source/gameengine/Converter/BL_ShapeDeformer.cpp index 3ae634905b9..eb5c1467ea5 100644 --- a/source/gameengine/Converter/BL_ShapeDeformer.cpp +++ b/source/gameengine/Converter/BL_ShapeDeformer.cpp @@ -44,9 +44,12 @@ #include "DNA_key_types.h" #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" +#include "DNA_ipo_types.h" +#include "DNA_curve_types.h" #include "BKE_armature.h" #include "BKE_action.h" #include "BKE_key.h" +#include "BKE_ipo.h" #include "MT_Point3.h" extern "C"{ @@ -78,11 +81,55 @@ void BL_ShapeDeformer::ProcessReplica() { } +bool BL_ShapeDeformer::LoadShapeDrivers(Object* arma) +{ + IpoCurve *icu; + + m_shapeDrivers.clear(); + // check if this mesh has armature driven shape keys + if (m_bmesh->key->ipo) { + for(icu= (IpoCurve*)m_bmesh->key->ipo->curve.first; icu; icu= (IpoCurve*)icu->next) { + if(icu->driver && + (icu->flag & IPO_MUTE) == 0 && + icu->driver->type == IPO_DRIVER_TYPE_NORMAL && + icu->driver->ob == arma && + icu->driver->blocktype == ID_AR) { + // this shape key ipo curve has a driver on the parent armature + // record this curve in the shape deformer so that the corresponding + m_shapeDrivers.push_back(icu); + } + } + } + return !m_shapeDrivers.empty(); +} + +bool BL_ShapeDeformer::ExecuteShapeDrivers(void) +{ + if (!m_shapeDrivers.empty() && PoseUpdated()) { + vector::iterator it; + void *poin; + int type; + for (it=m_shapeDrivers.begin(); it!=m_shapeDrivers.end(); it++) { + // no need to set a specific time: this curve has a driver + IpoCurve *icu = *it; + calc_icu(icu, 1.0f); + poin = get_ipo_poin((ID*)m_bmesh->key, icu, &type); + if (poin) + write_ipo_poin(poin, type, icu->curval); + } + ForceUpdate(); + return true; + } + return false; +} + bool BL_ShapeDeformer::Update(void) { bool bShapeUpdate = false; bool bSkinUpdate = false; + ExecuteShapeDrivers(); + /* See if the object shape has changed */ if (m_lastShapeUpdate != m_gameobj->GetLastFrame()) { /* the key coefficient have been set already, we just need to blend the keys */ diff --git a/source/gameengine/Converter/BL_ShapeDeformer.h b/source/gameengine/Converter/BL_ShapeDeformer.h index 9bbdde3fb2c..9f8361dbaca 100644 --- a/source/gameengine/Converter/BL_ShapeDeformer.h +++ b/source/gameengine/Converter/BL_ShapeDeformer.h @@ -38,6 +38,7 @@ #include "BL_DeformableGameObject.h" #include +struct IpoCurve; class BL_ShapeDeformer : public BL_SkinDeformer { @@ -82,8 +83,16 @@ public: virtual ~BL_ShapeDeformer(); bool Update (void); + bool LoadShapeDrivers(Object* arma); + bool ExecuteShapeDrivers(void); + + void ForceUpdate() + { + m_lastShapeUpdate = -1.0; + }; protected: + vector m_shapeDrivers; double m_lastShapeUpdate; BL_DeformableGameObject* m_gameobj; diff --git a/source/gameengine/Converter/BL_SkinDeformer.cpp b/source/gameengine/Converter/BL_SkinDeformer.cpp index 1015221c392..dd7119b1031 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.cpp +++ b/source/gameengine/Converter/BL_SkinDeformer.cpp @@ -149,12 +149,9 @@ void BL_SkinDeformer::ProcessReplica() bool BL_SkinDeformer::Update(void) { /* See if the armature has been updated for this frame */ - if (m_armobj && m_lastArmaUpdate!=m_armobj->GetLastFrame()){ + if (PoseUpdated()){ float obmat[4][4]; // the original object matrice - /* Do all of the posing necessary */ - m_armobj->ApplyPose(); - /* XXX note: where_is_pose() (from BKE_armature.h) calculates all matrices needed to start deforming */ /* but it requires the blender object pointer... */ diff --git a/source/gameengine/Converter/BL_SkinDeformer.h b/source/gameengine/Converter/BL_SkinDeformer.h index 603e716fb1e..c5568c049cb 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.h +++ b/source/gameengine/Converter/BL_SkinDeformer.h @@ -79,6 +79,14 @@ public: virtual ~BL_SkinDeformer(); bool Update (void); bool Apply (class RAS_IPolyMaterial *polymat); + bool PoseUpdated(void) + { + if (m_armobj && m_lastArmaUpdate!=m_armobj->GetLastFrame()) { + m_armobj->ApplyPose(); + return true; + } + return false; + } void ForceUpdate() { diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index f219c3a1472..ea26c55a44e 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -56,11 +56,13 @@ #include "KX_ConstraintActuator.h" #include "KX_CameraActuator.h" #include "KX_GameActuator.h" +#include "KX_StateActuator.h" #include "KX_VisibilityActuator.h" #include "KX_SCA_AddObjectActuator.h" #include "KX_SCA_EndObjectActuator.h" #include "KX_SCA_ReplaceMeshActuator.h" #include "KX_ParentActuator.h" +#include "KX_SCA_DynamicActuator.h" #include "KX_Scene.h" #include "KX_KetsjiEngine.h" @@ -136,6 +138,7 @@ void BL_ConvertActuators(char* maggiename, MT_Vector3 angvelvec ( KX_BLENDERTRUNC(obact->angularvelocity[0]), KX_BLENDERTRUNC(obact->angularvelocity[1]), KX_BLENDERTRUNC(obact->angularvelocity[2])); + short damping = obact->damping; drotvec /= BLENDER_HACK_DTIME; //drotvec /= BLENDER_HACK_DTIME; @@ -156,7 +159,7 @@ void BL_ConvertActuators(char* maggiename, bitLocalFlag.DRot = bool((obact->flag & ACT_DROT_LOCAL)!=0); bitLocalFlag.LinearVelocity = bool((obact->flag & ACT_LIN_VEL_LOCAL)!=0); bitLocalFlag.AngularVelocity = bool((obact->flag & ACT_ANG_VEL_LOCAL)!=0); - + bitLocalFlag.ClampVelocity = bool((obact->flag & ACT_CLAMP_VEL)!=0); bitLocalFlag.AddOrSetLinV = bool((obact->flag & ACT_ADD_LIN_VEL)!=0); @@ -167,6 +170,7 @@ void BL_ConvertActuators(char* maggiename, drotvec.getValue(), linvelvec.getValue(), angvelvec.getValue(), + damping, bitLocalFlag ); baseact = tmpbaseact; @@ -177,10 +181,12 @@ void BL_ConvertActuators(char* maggiename, if (blenderobject->type==OB_ARMATURE){ bActionActuator* actact = (bActionActuator*) bact->data; STR_String propname = (actact->name ? actact->name : ""); + STR_String propframe = (actact->frameProp ? actact->frameProp : ""); BL_ActionActuator* tmpbaseact = new BL_ActionActuator( gameobj, propname, + propframe, actact->sta, actact->end, actact->act, @@ -597,6 +603,15 @@ void BL_ConvertActuators(char* maggiename, blenderobject->upflag ); baseact = tmptrackact; + break; + } + case ACT_EDOB_DYNAMICS: + { + KX_SCA_DynamicActuator* tmpdynact + = new KX_SCA_DynamicActuator(gameobj, + editobact->dyn_operation + ); + baseact = tmpdynact; } } break; @@ -857,7 +872,19 @@ void BL_ConvertActuators(char* maggiename, baseact = tmp_vis_act; } break; - + + case ACT_STATE: + { + bStateActuator *sta_act = (bStateActuator *) bact->data; + KX_StateActuator * tmp_sta_act = NULL; + + tmp_sta_act = + new KX_StateActuator(gameobj, sta_act->type, sta_act->mask); + + baseact = tmp_sta_act; + } + break; + case ACT_2DFILTER: { bTwoDFilterActuator *_2dfilter = (bTwoDFilterActuator*) bact->data; @@ -917,7 +944,7 @@ void BL_ConvertActuators(char* maggiename, } tmp = new SCA_2DFilterActuator(gameobj, filtermode, _2dfilter->flag, - _2dfilter->float_arg,_2dfilter->int_arg,ketsjiEngine->GetRasterizer(),rendertools); + _2dfilter->float_arg,_2dfilter->int_arg,_2dfilter->texture_flag,ketsjiEngine->GetRasterizer(),rendertools); if (_2dfilter->text) { diff --git a/source/gameengine/Converter/KX_ConvertControllers.cpp b/source/gameengine/Converter/KX_ConvertControllers.cpp index a26cfa95b6d..da490b4ee85 100644 --- a/source/gameengine/Converter/KX_ConvertControllers.cpp +++ b/source/gameengine/Converter/KX_ConvertControllers.cpp @@ -35,6 +35,10 @@ // Controller #include "SCA_ANDController.h" #include "SCA_ORController.h" +#include "SCA_NANDController.h" +#include "SCA_NORController.h" +#include "SCA_XORController.h" +#include "SCA_XNORController.h" #include "SCA_PythonController.h" #include "SCA_ExpressionController.h" @@ -112,6 +116,30 @@ void BL_ConvertControllers( LinkControllerToActuators(gamecontroller,bcontr,logicmgr,converter); break; } + case CONT_LOGIC_NAND: + { + gamecontroller = new SCA_NANDController(gameobj); + LinkControllerToActuators(gamecontroller,bcontr,logicmgr,converter); + break; + } + case CONT_LOGIC_NOR: + { + gamecontroller = new SCA_NORController(gameobj); + LinkControllerToActuators(gamecontroller,bcontr,logicmgr,converter); + break; + } + case CONT_LOGIC_XOR: + { + gamecontroller = new SCA_XORController(gameobj); + LinkControllerToActuators(gamecontroller,bcontr,logicmgr,converter); + break; + } + case CONT_LOGIC_XNOR: + { + gamecontroller = new SCA_XNORController(gameobj); + LinkControllerToActuators(gamecontroller,bcontr,logicmgr,converter); + break; + } case CONT_EXPRESSION: { bExpressionCont* bexpcont = (bExpressionCont*) bcontr->data; @@ -161,6 +189,7 @@ void BL_ConvertControllers( if (gamecontroller) { gamecontroller->SetExecutePriority(executePriority++); + gamecontroller->SetState(bcontr->state_mask); STR_String uniquename = bcontr->name; uniquename += "#CONTR#"; uniqueint++; diff --git a/source/gameengine/Converter/KX_ConvertSensors.cpp b/source/gameengine/Converter/KX_ConvertSensors.cpp index 80fa3838d60..e7e4eeae7d2 100644 --- a/source/gameengine/Converter/KX_ConvertSensors.cpp +++ b/source/gameengine/Converter/KX_ConvertSensors.cpp @@ -251,6 +251,7 @@ void BL_ConvertSensors(struct Object* blenderobject, bool neg_pulsemode = false; int frequency = 0; bool invert = false; + bool level = false; while(sens) { @@ -263,7 +264,8 @@ void BL_ConvertSensors(struct Object* blenderobject, frequency = sens->freq; invert = !(sens->invert == 0); - + level = !(sens->level == 0); + switch (sens->type) { case SENS_ALWAYS: @@ -711,6 +713,7 @@ void BL_ConvertSensors(struct Object* blenderobject, neg_pulsemode, frequency); gamesensor->SetInvert(invert); + gamesensor->SetLevel(level); gamesensor->SetName(STR_String(sens->name)); gameobj->AddSensor(gamesensor); diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index 56208ab4ad5..f0195d5df82 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -520,11 +520,6 @@ void CValue::CloneProperties(CValue *replica) } - - - - - double* CValue::GetVector3(bool bGetTransformedVec) { assertd(false); // don;t get vector from me @@ -775,6 +770,25 @@ int CValue::_setattr(const STR_String& attr,PyObject* pyobj) //PyObjectPlus::_setattr(attr,value); return 0; }; + +PyObject* CValue::ConvertKeysToPython( void ) +{ + PyObject *pylist = PyList_New( 0 ); + PyObject *pystr; + + if (m_pNamedPropertyArray) + { + for ( std::map::iterator it = m_pNamedPropertyArray->begin(); + !(it == m_pNamedPropertyArray->end());it++) + { + pystr = PyString_FromString( (*it).first ); + PyList_Append(pylist, pystr); + Py_DECREF( pystr ); + } + } + return pylist; +} + /* PyObject* CValue::PyMake(PyObject* ignored,PyObject* args) { diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index ccb9c34749d..561e5521d60 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -253,6 +253,8 @@ public: virtual int _delattr(const STR_String& attr); virtual int _setattr(const STR_String& attr,PyObject* value); + virtual PyObject* ConvertKeysToPython( void ); + KX_PYMETHOD(CValue,GetName); #else diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp index f3b5b1fdda2..56249bb52ec 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp @@ -18,6 +18,7 @@ SCA_2DFilterActuator::SCA_2DFilterActuator( short flag, float float_arg, int int_arg, + short texture_flag, RAS_IRasterizer* rasterizer, RAS_IRenderTools* rendertools, PyTypeObject* T) @@ -25,6 +26,7 @@ SCA_2DFilterActuator::SCA_2DFilterActuator( m_type(type), m_flag(flag), m_int_arg(int_arg), + m_texture_flag(texture_flag), m_float_arg(float_arg), m_rasterizer(rasterizer), m_rendertools(rendertools) @@ -72,7 +74,7 @@ bool SCA_2DFilterActuator::Update() } else if(m_type < RAS_2DFilterManager::RAS_2DFILTER_NUMBER_OF_FILTERS) { - m_rendertools->Update2DFilter(m_type, m_int_arg, m_shaderText); + m_rendertools->Update2DFilter(m_type, m_int_arg, m_shaderText, m_texture_flag); } return true; } diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.h b/source/gameengine/GameLogic/SCA_2DFilterActuator.h index 7b0cfff951e..451a7b9491a 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.h +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.h @@ -16,6 +16,7 @@ private: short m_flag; float m_float_arg; int m_int_arg; + short m_texture_flag; STR_String m_shaderText; RAS_IRasterizer* m_rasterizer; RAS_IRenderTools* m_rendertools; @@ -28,6 +29,7 @@ public: short flag, float float_arg, int int_arg, + short texture_flag, RAS_IRasterizer* rasterizer, RAS_IRenderTools* rendertools, PyTypeObject* T=&Type diff --git a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp index 67df5d091ab..f9fbf2387c4 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp +++ b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp @@ -53,10 +53,13 @@ SCA_AlwaysSensor::SCA_AlwaysSensor(class SCA_EventManager* eventmgr, : SCA_ISensor(gameobj,eventmgr, T) { //SetDrawColor(255,0,0); - m_alwaysresult = true; + Init(); } - +void SCA_AlwaysSensor::Init() +{ + m_alwaysresult = true; +} SCA_AlwaysSensor::~SCA_AlwaysSensor() { diff --git a/source/gameengine/GameLogic/SCA_AlwaysSensor.h b/source/gameengine/GameLogic/SCA_AlwaysSensor.h index 474ed025432..8bf2a8aa98e 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysSensor.h +++ b/source/gameengine/GameLogic/SCA_AlwaysSensor.h @@ -45,6 +45,8 @@ public: virtual CValue* GetReplica(); virtual bool Evaluate(CValue* event); virtual bool IsPositiveTrigger(); + virtual void Init(); + /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ diff --git a/source/gameengine/GameLogic/SCA_IActuator.cpp b/source/gameengine/GameLogic/SCA_IActuator.cpp index 568d0eb4a89..eeca2d7b44c 100644 --- a/source/gameengine/GameLogic/SCA_IActuator.cpp +++ b/source/gameengine/GameLogic/SCA_IActuator.cpp @@ -36,6 +36,7 @@ using namespace std; SCA_IActuator::SCA_IActuator(SCA_IObject* gameobj, PyTypeObject* T) : + m_links(0), SCA_ILogicBrick(gameobj,T) { // nothing to do @@ -109,3 +110,12 @@ SCA_IActuator::~SCA_IActuator() RemoveAllEvents(); } +void SCA_IActuator::DecLink() +{ + m_links--; + if (m_links < 0) + { + printf("Warning: actuator %s has negative m_links: %d\n", m_name.Ptr(), m_links); + m_links = 0; + } +} diff --git a/source/gameengine/GameLogic/SCA_IActuator.h b/source/gameengine/GameLogic/SCA_IActuator.h index b802aa4b298..774b27c5ad4 100644 --- a/source/gameengine/GameLogic/SCA_IActuator.h +++ b/source/gameengine/GameLogic/SCA_IActuator.h @@ -34,8 +34,11 @@ class SCA_IActuator : public SCA_ILogicBrick { + friend class SCA_LogicManager; protected: std::vector m_events; + int m_links; // number of active links to controllers + // when 0, the actuator is automatically stopped void RemoveAllEvents(); public: @@ -83,6 +86,10 @@ public: */ bool IsNegativeEvent() const; virtual ~SCA_IActuator(); + + void IncLink() { m_links++; } + void DecLink(); + bool IsNoLink() const { return !m_links; } }; #endif //__KX_IACTUATOR diff --git a/source/gameengine/GameLogic/SCA_IController.cpp b/source/gameengine/GameLogic/SCA_IController.cpp index 5cb62678c6b..bbe5a51db3c 100644 --- a/source/gameengine/GameLogic/SCA_IController.cpp +++ b/source/gameengine/GameLogic/SCA_IController.cpp @@ -29,6 +29,7 @@ #include "SCA_IController.h" #include "SCA_LogicManager.h" #include "SCA_IActuator.h" +#include "SCA_ISensor.h" #ifdef HAVE_CONFIG_H #include @@ -37,6 +38,7 @@ SCA_IController::SCA_IController(SCA_IObject* gameobj, PyTypeObject* T) : + m_statemask(0), SCA_ILogicBrick(gameobj,T) { } @@ -45,6 +47,7 @@ SCA_IController::SCA_IController(SCA_IObject* gameobj, SCA_IController::~SCA_IController() { + UnlinkAllActuators(); } @@ -65,6 +68,14 @@ const std::vector& SCA_IController::GetLinkedActuators() void SCA_IController::UnlinkAllSensors() { + if (IsActive()) + { + std::vector::iterator sensit; + for (sensit = m_linkedsensors.begin();!(sensit==m_linkedsensors.end());++sensit) + { + (*sensit)->DecLink(); + } + } m_linkedsensors.clear(); } @@ -72,6 +83,14 @@ void SCA_IController::UnlinkAllSensors() void SCA_IController::UnlinkAllActuators() { + if (IsActive()) + { + std::vector::iterator actit; + for (actit = m_linkedactuators.begin();!(actit==m_linkedactuators.end());++actit) + { + (*actit)->DecLink(); + } + } m_linkedactuators.clear(); } @@ -95,26 +114,94 @@ void SCA_IController::Trigger(SCA_LogicManager* logicmgr) void SCA_IController::LinkToActuator(SCA_IActuator* actua) { m_linkedactuators.push_back(actua); + if (IsActive()) + { + actua->IncLink(); + } } void SCA_IController::UnlinkActuator(class SCA_IActuator* actua) { std::vector::iterator actit; - std::vector::iterator actfound = m_linkedactuators.end(); for (actit = m_linkedactuators.begin();!(actit==m_linkedactuators.end());++actit) { if ((*actit) == actua) - actfound = actit; + { + break; + } } - if (!(actfound==m_linkedactuators.end())) + if (!(actit==m_linkedactuators.end())) { - m_linkedactuators.erase(actfound); + m_linkedactuators.erase(actit); + if (IsActive()) + { + (*actit)->DecLink(); + } } - } void SCA_IController::LinkToSensor(SCA_ISensor* sensor) { m_linkedsensors.push_back(sensor); + if (IsActive()) + { + sensor->IncLink(); + } } + +void SCA_IController::UnlinkSensor(class SCA_ISensor* sensor) +{ + std::vector::iterator sensit; + for (sensit = m_linkedsensors.begin();!(sensit==m_linkedsensors.end());++sensit) + { + if ((*sensit) == sensor) + { + break; + } + + } + if (!(sensit==m_linkedsensors.end())) + { + m_linkedsensors.erase(sensit); + if (IsActive()) + { + (*sensit)->DecLink(); + } + } +} + +void SCA_IController::ApplyState(unsigned int state) +{ + std::vector::iterator actit; + std::vector::iterator sensit; + + if (m_statemask & state) + { + if (!IsActive()) + { + // reactive the controller, all the links to actuator are valid again + for (actit = m_linkedactuators.begin();!(actit==m_linkedactuators.end());++actit) + { + (*actit)->IncLink(); + } + for (sensit = m_linkedsensors.begin();!(sensit==m_linkedsensors.end());++sensit) + { + (*sensit)->IncLink(); + } + SetActive(true); + } + } else if (IsActive()) + { + for (actit = m_linkedactuators.begin();!(actit==m_linkedactuators.end());++actit) + { + (*actit)->DecLink(); + } + for (sensit = m_linkedsensors.begin();!(sensit==m_linkedsensors.end());++sensit) + { + (*sensit)->DecLink(); + } + SetActive(false); + } +} + diff --git a/source/gameengine/GameLogic/SCA_IController.h b/source/gameengine/GameLogic/SCA_IController.h index 79e956dec4e..f67c0942eb4 100644 --- a/source/gameengine/GameLogic/SCA_IController.h +++ b/source/gameengine/GameLogic/SCA_IController.h @@ -36,6 +36,7 @@ class SCA_IController : public SCA_ILogicBrick protected: std::vector m_linkedsensors; std::vector m_linkedactuators; + unsigned int m_statemask; public: SCA_IController(SCA_IObject* gameobj,PyTypeObject* T); virtual ~SCA_IController(); @@ -47,6 +48,9 @@ public: void UnlinkAllSensors(); void UnlinkAllActuators(); void UnlinkActuator(class SCA_IActuator* actua); + void UnlinkSensor(class SCA_ISensor* sensor); + void SetState(unsigned int state) { m_statemask = state; } + void ApplyState(unsigned int state); }; diff --git a/source/gameengine/GameLogic/SCA_IObject.cpp b/source/gameengine/GameLogic/SCA_IObject.cpp index 6df9e23f3fa..826e7bbdf0e 100644 --- a/source/gameengine/GameLogic/SCA_IObject.cpp +++ b/source/gameengine/GameLogic/SCA_IObject.cpp @@ -40,7 +40,7 @@ MT_Point3 SCA_IObject::m_sDummy=MT_Point3(0,0,0); -SCA_IObject::SCA_IObject(PyTypeObject* T): CValue(T) +SCA_IObject::SCA_IObject(PyTypeObject* T): m_state(0), CValue(T) { m_suspended = false; } @@ -329,6 +329,17 @@ void SCA_IObject::Resume(void) } } +void SCA_IObject::SetState(unsigned int state) +{ + m_state = state; + // update the status of the controllers + SCA_ControllerList::iterator contit; + for (contit = m_controllers.begin(); contit != m_controllers.end(); contit++) + { + (*contit)->ApplyState(m_state); + } +} + /* ------------------------------------------------------------------------- */ diff --git a/source/gameengine/GameLogic/SCA_IObject.h b/source/gameengine/GameLogic/SCA_IObject.h index e8251e0ceaa..07b4310a91e 100644 --- a/source/gameengine/GameLogic/SCA_IObject.h +++ b/source/gameengine/GameLogic/SCA_IObject.h @@ -67,7 +67,12 @@ protected: * Ignore updates? */ bool m_suspended; - + + /** + * current state = bit mask of state that are active + */ + unsigned int m_state; + public: SCA_IObject(PyTypeObject* T=&Type); @@ -111,7 +116,17 @@ public: * Resume progress */ void Resume(void); - + + /** + * Set the object state + */ + void SetState(unsigned int state); + + /** + * Get the object state + */ + unsigned int GetState(void) { return m_state; } + // const class MT_Point3& ConvertPythonPylist(PyObject* pylist); // here come the python forwarded methods diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp index 9fdee0c19da..6cfae9d8919 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.cpp +++ b/source/gameengine/GameLogic/SCA_ISensor.cpp @@ -52,8 +52,10 @@ SCA_ISensor::SCA_ISensor(SCA_IObject* gameobj, SCA_ILogicBrick(gameobj,T), m_triggered(false) { + m_links = 0; m_suspended = false; m_invert = false; + m_level = false; m_pos_ticks = 0; m_neg_ticks = 0; m_pos_pulsemode = false; @@ -94,6 +96,10 @@ void SCA_ISensor::SetInvert(bool inv) { m_invert = inv; } +void SCA_ISensor::SetLevel(bool lvl) { + m_level = lvl; +} + float SCA_ISensor::GetNumber() { return IsPositiveTrigger(); @@ -111,6 +117,25 @@ void SCA_ISensor::Resume() { m_suspended = false; } +void SCA_ISensor::Init() { + printf("Sensor %s has no init function, please report this bug to Blender.org\n", m_name); +} + +void SCA_ISensor::DecLink() { + m_links--; + if (m_links < 0) + { + printf("Warning: sensor %s has negative m_links: %d\n", m_name.Ptr(), m_links); + m_links = 0; + } + if (!m_links) + { + // sensor is detached from all controllers, initialize it so that it + // is fresh as at startup when it is reattached again. + Init(); + } +} + /* python integration */ PyTypeObject SCA_ISensor::Type = { @@ -157,6 +182,10 @@ PyMethodDef SCA_ISensor::Methods[] = { METH_VARARGS, GetInvert_doc}, {"setInvert", (PyCFunction) SCA_ISensor::sPySetInvert, METH_VARARGS, SetInvert_doc}, + {"getLevel", (PyCFunction) SCA_ISensor::sPyGetLevel, + METH_VARARGS, GetLevel_doc}, + {"setLevel", (PyCFunction) SCA_ISensor::sPySetLevel, + METH_VARARGS, SetLevel_doc}, {NULL,NULL} //Sentinel }; @@ -177,7 +206,8 @@ void SCA_ISensor::Activate(class SCA_LogicManager* logicmgr, CValue* event) { // calculate if a __triggering__ is wanted - if (!m_suspended) { + // don't evaluate a sensor that is not connected to any controller + if (m_links && !m_suspended) { bool result = this->Evaluate(event); if (result) { logicmgr->AddActivatedSensor(this); @@ -307,6 +337,31 @@ PyObject* SCA_ISensor::PySetInvert(PyObject* self, PyObject* args, PyObject* kwd Py_Return; } +char SCA_ISensor::GetLevel_doc[] = +"getLevel()\n" +"\tReturns whether this sensor is a level detector or a edge detector.\n" +"\tIt makes a difference only in case of logic state transition (state actuator).\n" +"\tA level detector will immediately generate a pulse if the condition for the\n" +"\tdetector is met when entering the state. A edge detector will wait for an off-on\n" +"\ttransition to occur.\n" +"\tOnly some sensors implement this feature: keyboard.\n"; +PyObject* SCA_ISensor::PyGetLevel(PyObject* self, PyObject* args, PyObject* kwds) +{ + return BoolToPyArg(m_level); +} + +char SCA_ISensor::SetLevel_doc[] = +"setLevel(level?)\n" +"\t- level?: Detect level instead of edge? (KX_TRUE, KX_FALSE)\n" +"\tSet whether to detect level or edge transition when entering a state.\n"; +PyObject* SCA_ISensor::PySetLevel(PyObject* self, PyObject* args, PyObject* kwds) +{ + int pyarg = 0; + if(!PyArg_ParseTuple(args, "i", &pyarg)) { return NULL; } + m_level = PyArgToBool(pyarg); + Py_Return; +} + char SCA_ISensor::GetUseNegPulseMode_doc[] = "getUseNegPulseMode()\n" "\tReturns whether negative pulse mode is active.\n"; diff --git a/source/gameengine/GameLogic/SCA_ISensor.h b/source/gameengine/GameLogic/SCA_ISensor.h index e14fb34241a..3527b87ebdb 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.h +++ b/source/gameengine/GameLogic/SCA_ISensor.h @@ -61,9 +61,15 @@ class SCA_ISensor : public SCA_ILogicBrick /** invert the output signal*/ bool m_invert; + /** detect level instead of edge*/ + bool m_level; + /** Sensor must ignore updates? */ bool m_suspended; + /** number of connections to controller */ + int m_links; + /** Pass the activation on to the logic manager.*/ void SignalActivation(class SCA_LogicManager* logicmgr); @@ -81,6 +87,7 @@ public: void Activate(class SCA_LogicManager* logicmgr,CValue* event); virtual bool Evaluate(CValue* event) = 0; virtual bool IsPositiveTrigger(); + virtual void Init(); virtual PyObject* _getattr(const STR_String& attr); virtual CValue* GetReplica()=0; @@ -101,6 +108,8 @@ public: virtual void Delete() { Release(); } /** Set inversion of pulses on or off. */ void SetInvert(bool inv); + /** set the level detection on or off */ + void SetLevel(bool lvl); void RegisterToManager(); virtual float GetNumber(); @@ -114,6 +123,12 @@ public: /** Resume sensing. */ void Resume(); + void IncLink() + { m_links++; } + void DecLink(); + bool IsNoLink() const + { return !m_links; } + /* Python functions: */ KX_PYMETHOD_DOC(SCA_ISensor,IsPositive); KX_PYMETHOD_DOC(SCA_ISensor,GetUsePosPulseMode); @@ -124,6 +139,8 @@ public: KX_PYMETHOD_DOC(SCA_ISensor,SetUseNegPulseMode); KX_PYMETHOD_DOC(SCA_ISensor,GetInvert); KX_PYMETHOD_DOC(SCA_ISensor,SetInvert); + KX_PYMETHOD_DOC(SCA_ISensor,GetLevel); + KX_PYMETHOD_DOC(SCA_ISensor,SetLevel); }; diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp index b0e7fee130d..8668c22f044 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp @@ -64,9 +64,13 @@ std::cout << " button flag "<< m_buttonf << std::endl; std::cout << " hat " << m_hat << std::endl; std::cout << " hat flag " << m_hatf << std::endl; */ - m_istrig=0; + Init(); } +void SCA_JoystickSensor::Init() +{ + m_istrig=(m_invert)?1:0; +} SCA_JoystickSensor::~SCA_JoystickSensor() { diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.h b/source/gameengine/GameLogic/SCA_JoystickSensor.h index 2fbe1edf1e7..69068da6494 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.h +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.h @@ -95,6 +95,7 @@ public: virtual bool Evaluate(CValue* event); virtual bool IsPositiveTrigger(); + virtual void Init(); /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index f13b1bcf4c9..43ce25f94df 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -62,7 +62,7 @@ SCA_KeyboardSensor::SCA_KeyboardSensor(SCA_KeyboardManager* keybdmgr, if (hotkey == SCA_IInputDevice::KX_ESCKEY) keybdmgr->GetInputDevice()->HookEscape(); // SetDrawColor(0xff0000ff); - m_val=0; + Init(); } @@ -71,7 +71,14 @@ SCA_KeyboardSensor::~SCA_KeyboardSensor() { } - +void SCA_KeyboardSensor::Init() +{ + // this function is used when the sensor is disconnected from all controllers + // by the state engine. It reinitializes the sensor as if it was just created. + // However, if the target key is pressed when the sensor is reactivated, it + // will not generated an event (see remark in Evaluate()). + m_val = (m_invert)?1:0; +} CValue* SCA_KeyboardSensor::GetReplica() { @@ -169,10 +176,10 @@ bool SCA_KeyboardSensor::Evaluate(CValue* eventval) { if (m_val == 0) { - //see comment below - //m_val = 1; - //result = true; - ; + if (m_level) { + m_val = 1; + result = true; + } } } else { @@ -222,15 +229,11 @@ bool SCA_KeyboardSensor::Evaluate(CValue* eventval) { if (m_val == 0) { - //hmm, this abnormal situation may occur in the following cases: - //- the key was pressed while the scene was suspended - //- this is a new scene and the key is active from the start - //In the second case, it's dangerous to activate the sensor - //(think of a key to go to next scene) - //What we really need is a edge/level flag in the key sensor - //m_val = 1; - //result = true; - ; + if (m_level) + { + m_val = 1; + result = true; + } } } } diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.h b/source/gameengine/GameLogic/SCA_KeyboardSensor.h index e87eddecd32..b86f6931d27 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.h +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.h @@ -114,6 +114,8 @@ public: PyTypeObject* T=&Type ); virtual ~SCA_KeyboardSensor(); virtual CValue* GetReplica(); + virtual void Init(); + short int GetHotkey(); virtual bool Evaluate(CValue* event); diff --git a/source/gameengine/GameLogic/SCA_LogicManager.cpp b/source/gameengine/GameLogic/SCA_LogicManager.cpp index 49f01d643e5..fb1a2c29eb6 100644 --- a/source/gameengine/GameLogic/SCA_LogicManager.cpp +++ b/source/gameengine/GameLogic/SCA_LogicManager.cpp @@ -165,6 +165,11 @@ void* SCA_LogicManager::FindBlendObjByGameMeshName(const STR_String& gamemeshnam void SCA_LogicManager::RemoveSensor(SCA_ISensor* sensor) { + controllerlist contlist = m_sensorcontrollermapje[sensor]; + for (controllerlist::const_iterator c= contlist.begin();!(c==contlist.end());c++) + { + (*c)->UnlinkSensor(sensor); + } m_sensorcontrollermapje.erase(sensor); for (vector::const_iterator ie=m_eventmanagers.begin(); @@ -176,6 +181,8 @@ void SCA_LogicManager::RemoveSensor(SCA_ISensor* sensor) void SCA_LogicManager::RemoveController(SCA_IController* controller) { + controller->UnlinkAllSensors(); + controller->UnlinkAllActuators(); std::map::iterator sit; for (sit = m_sensorcontrollermapje.begin();!(sit==m_sensorcontrollermapje.end());++sit) { @@ -236,7 +243,8 @@ void SCA_LogicManager::BeginFrame(double curtime, double fixedtime) !(c==contlist.end());c++) { SCA_IController* contr = *c;//controllerarray->at(c); - triggeredControllerSet.insert(SmartControllerPtr(contr,0)); + if (contr->IsActive()) + triggeredControllerSet.insert(SmartControllerPtr(contr,0)); } //sensor->SetActive(false); } @@ -273,6 +281,16 @@ void SCA_LogicManager::UpdateFrame(double curtime, bool frame) (*ia)->SetActive(false); //m_activeactuators.pop_back(); + } else if ((*ia)->IsNoLink()) + { + // This actuator has no more links but it still active + // make sure it will get a negative event on next frame to stop it + // Do this check after Update() rather than before to make sure + // that all the actuators that are activated at same time than a state + // actuator have a chance to execute. + CValue* event = new CBoolValue(false); + (*ia)->RemoveAllEvents(); + (*ia)->AddEvent(event); } } diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.cpp b/source/gameengine/GameLogic/SCA_MouseSensor.cpp index 8810b7470ed..42d35837489 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.cpp +++ b/source/gameengine/GameLogic/SCA_MouseSensor.cpp @@ -58,7 +58,6 @@ SCA_MouseSensor::SCA_MouseSensor(SCA_MouseManager* eventmgr, { m_mousemode = mousemode; m_triggermode = true; - m_val = 0; /* stores the latest attribute */ switch (m_mousemode) { case KX_MOUSESENSORMODE_LEFTBUTTON: @@ -79,7 +78,12 @@ SCA_MouseSensor::SCA_MouseSensor(SCA_MouseManager* eventmgr, default: ; /* ignore, no hotkey */ } + Init(); +} +void SCA_MouseSensor::Init() +{ + m_val = (m_invert)?1:0; /* stores the latest attribute */ } SCA_MouseSensor::~SCA_MouseSensor() @@ -164,10 +168,11 @@ bool SCA_MouseSensor::Evaluate(CValue* event) { if (m_val == 0) { - //dangerous - //m_val = 1; - //result = true; - ; + if (m_level) + { + m_val = 1; + result = true; + } } } else { diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.h b/source/gameengine/GameLogic/SCA_MouseSensor.h index 86c9d96a800..26a1c5e3fd2 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.h +++ b/source/gameengine/GameLogic/SCA_MouseSensor.h @@ -96,7 +96,7 @@ class SCA_MouseSensor : public SCA_ISensor virtual ~SCA_MouseSensor(); virtual CValue* GetReplica(); virtual bool Evaluate(CValue* event); - + virtual void Init(); virtual bool IsPositiveTrigger(); short int GetModeKey(); SCA_IInputDevice::KX_EnumInputs GetHotKey(); diff --git a/source/gameengine/GameLogic/SCA_NANDController.cpp b/source/gameengine/GameLogic/SCA_NANDController.cpp new file mode 100644 index 00000000000..5b869ee8298 --- /dev/null +++ b/source/gameengine/GameLogic/SCA_NANDController.cpp @@ -0,0 +1,144 @@ +/** + * 'Nand' together all inputs + * + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include "SCA_NANDController.h" +#include "SCA_ISensor.h" +#include "SCA_LogicManager.h" +#include "BoolValue.h" + +#ifdef HAVE_CONFIG_H +#include +#endif + +/* ------------------------------------------------------------------------- */ +/* Native functions */ +/* ------------------------------------------------------------------------- */ + +SCA_NANDController::SCA_NANDController(SCA_IObject* gameobj, + PyTypeObject* T) + : + SCA_IController(gameobj,T) +{ +} + + + +SCA_NANDController::~SCA_NANDController() +{ +} + + + +void SCA_NANDController::Trigger(SCA_LogicManager* logicmgr) +{ + + bool sensorresult = false; + + for (vector::const_iterator is=m_linkedsensors.begin(); + !(is==m_linkedsensors.end());is++) + { + SCA_ISensor* sensor = *is; + if (!sensor->IsPositiveTrigger()) + { + sensorresult = true; + break; + } + } + + CValue* newevent = new CBoolValue(sensorresult); + + for (vector::const_iterator i=m_linkedactuators.begin(); + !(i==m_linkedactuators.end());i++) + { + SCA_IActuator* actua = *i;//m_linkedactuators.at(i); + logicmgr->AddActiveActuator(actua,newevent); + } + + // every actuator that needs the event, has a it's own reference to it now so + // release it (so to be clear: if there is no actuator, it's deleted right now) + newevent->Release(); + +} + + + +CValue* SCA_NANDController::GetReplica() +{ + CValue* replica = new SCA_NANDController(*this); + // this will copy properties and so on... + CValue::AddDataToReplica(replica); + + return replica; +} + + + +/* ------------------------------------------------------------------------- */ +/* Python functions */ +/* ------------------------------------------------------------------------- */ + +/* Integration hooks ------------------------------------------------------- */ +PyTypeObject SCA_NANDController::Type = { + PyObject_HEAD_INIT(&PyType_Type) + 0, + "SCA_NANDController", + sizeof(SCA_NANDController), + 0, + PyDestructor, + 0, + __getattr, + __setattr, + 0, //&MyPyCompare, + __repr, + 0, //&cvalue_as_number, + 0, + 0, + 0, + 0 +}; + +PyParentObject SCA_NANDController::Parents[] = { + &SCA_NANDController::Type, + &SCA_IController::Type, + &SCA_ILogicBrick::Type, + &CValue::Type, + NULL +}; + +PyMethodDef SCA_NANDController::Methods[] = { + {NULL,NULL} //Sentinel +}; + +PyObject* SCA_NANDController::_getattr(const STR_String& attr) { + _getattr_up(SCA_IController); +} + +/* eof */ diff --git a/source/gameengine/GameLogic/SCA_NANDController.h b/source/gameengine/GameLogic/SCA_NANDController.h new file mode 100644 index 00000000000..1193ff64f07 --- /dev/null +++ b/source/gameengine/GameLogic/SCA_NANDController.h @@ -0,0 +1,56 @@ +/** + * SCA_NANDController.h + * + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef __KX_NANDCONTROLLER +#define __KX_NANDCONTROLLER + +#include "SCA_IController.h" + +class SCA_NANDController : public SCA_IController +{ + Py_Header; + //virtual void Trigger(class SCA_LogicManager* logicmgr); +public: + SCA_NANDController(SCA_IObject* gameobj,PyTypeObject* T=&Type); + virtual ~SCA_NANDController(); + virtual CValue* GetReplica(); + virtual void Trigger(SCA_LogicManager* logicmgr); + + /* --------------------------------------------------------------------- */ + /* Python interface ---------------------------------------------------- */ + /* --------------------------------------------------------------------- */ + + virtual PyObject* _getattr(const STR_String& attr); + +}; + +#endif //__KX_NANDCONTROLLER + diff --git a/source/gameengine/GameLogic/SCA_NORController.cpp b/source/gameengine/GameLogic/SCA_NORController.cpp new file mode 100644 index 00000000000..2866dec0b74 --- /dev/null +++ b/source/gameengine/GameLogic/SCA_NORController.cpp @@ -0,0 +1,144 @@ +/** + * 'Nor' together all inputs + * + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include "SCA_NORController.h" +#include "SCA_ISensor.h" +#include "SCA_LogicManager.h" +#include "BoolValue.h" + +#ifdef HAVE_CONFIG_H +#include +#endif + +/* ------------------------------------------------------------------------- */ +/* Native functions */ +/* ------------------------------------------------------------------------- */ + +SCA_NORController::SCA_NORController(SCA_IObject* gameobj, + PyTypeObject* T) + : + SCA_IController(gameobj,T) +{ +} + + + +SCA_NORController::~SCA_NORController() +{ +} + + + +void SCA_NORController::Trigger(SCA_LogicManager* logicmgr) +{ + + bool sensorresult = true; + + for (vector::const_iterator is=m_linkedsensors.begin(); + !(is==m_linkedsensors.end());is++) + { + SCA_ISensor* sensor = *is; + if (sensor->IsPositiveTrigger()) + { + sensorresult = false; + break; + } + } + + CValue* newevent = new CBoolValue(sensorresult); + + for (vector::const_iterator i=m_linkedactuators.begin(); + !(i==m_linkedactuators.end());i++) + { + SCA_IActuator* actua = *i;//m_linkedactuators.at(i); + logicmgr->AddActiveActuator(actua,newevent); + } + + // every actuator that needs the event, has a it's own reference to it now so + // release it (so to be clear: if there is no actuator, it's deleted right now) + newevent->Release(); + +} + + + +CValue* SCA_NORController::GetReplica() +{ + CValue* replica = new SCA_NORController(*this); + // this will copy properties and so on... + CValue::AddDataToReplica(replica); + + return replica; +} + + + +/* ------------------------------------------------------------------------- */ +/* Python functions */ +/* ------------------------------------------------------------------------- */ + +/* Integration hooks ------------------------------------------------------- */ +PyTypeObject SCA_NORController::Type = { + PyObject_HEAD_INIT(&PyType_Type) + 0, + "SCA_NORController", + sizeof(SCA_NORController), + 0, + PyDestructor, + 0, + __getattr, + __setattr, + 0, //&MyPyCompare, + __repr, + 0, //&cvalue_as_number, + 0, + 0, + 0, + 0 +}; + +PyParentObject SCA_NORController::Parents[] = { + &SCA_NORController::Type, + &SCA_IController::Type, + &SCA_ILogicBrick::Type, + &CValue::Type, + NULL +}; + +PyMethodDef SCA_NORController::Methods[] = { + {NULL,NULL} //Sentinel +}; + +PyObject* SCA_NORController::_getattr(const STR_String& attr) { + _getattr_up(SCA_IController); +} + +/* eof */ diff --git a/source/gameengine/GameLogic/SCA_NORController.h b/source/gameengine/GameLogic/SCA_NORController.h new file mode 100644 index 00000000000..aab59e3d46c --- /dev/null +++ b/source/gameengine/GameLogic/SCA_NORController.h @@ -0,0 +1,56 @@ +/** + * SCA_NORController.h + * + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef __KX_NORCONTROLLER +#define __KX_NORCONTROLLER + +#include "SCA_IController.h" + +class SCA_NORController : public SCA_IController +{ + Py_Header; + //virtual void Trigger(class SCA_LogicManager* logicmgr); +public: + SCA_NORController(SCA_IObject* gameobj,PyTypeObject* T=&Type); + virtual ~SCA_NORController(); + virtual CValue* GetReplica(); + virtual void Trigger(SCA_LogicManager* logicmgr); + + /* --------------------------------------------------------------------- */ + /* Python interface ---------------------------------------------------- */ + /* --------------------------------------------------------------------- */ + + virtual PyObject* _getattr(const STR_String& attr); + +}; + +#endif //__KX_NORCONTROLLER + diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.cpp b/source/gameengine/GameLogic/SCA_PropertySensor.cpp index f1fcb18d32e..655e9060238 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.cpp +++ b/source/gameengine/GameLogic/SCA_PropertySensor.cpp @@ -54,10 +54,8 @@ SCA_PropertySensor::SCA_PropertySensor(SCA_EventManager* eventmgr, m_checkpropval(propval), m_checkpropmaxval(propmaxval), m_checkpropname(propname), - m_lastresult(false), m_range_expr(NULL) { - m_recentresult=false; //CParser pars; //pars.SetContext(this->AddRef()); //CValue* resultval = m_rightexpr->Calculate(); @@ -73,7 +71,13 @@ SCA_PropertySensor::SCA_PropertySensor(SCA_EventManager* eventmgr, { PrecalculateRangeExpression(); } + Init(); +} +void SCA_PropertySensor::Init() +{ + m_recentresult = false; + m_lastresult = m_invert?true:false; } void SCA_PropertySensor::PrecalculateRangeExpression() diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.h b/source/gameengine/GameLogic/SCA_PropertySensor.h index 81c9b958f25..6871cb3afdc 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.h +++ b/source/gameengine/GameLogic/SCA_PropertySensor.h @@ -77,6 +77,7 @@ public: virtual void Delete(); virtual ~SCA_PropertySensor(); virtual CValue* GetReplica(); + virtual void Init(); void PrecalculateRangeExpression(); bool CheckPropertyCondition(); diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index 44cdc0a7de5..be00117cd21 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -232,6 +232,7 @@ PyMethodDef SCA_PythonController::Methods[] = { METH_VARARGS, SCA_PythonController::GetSensor_doc}, {"getScript", (PyCFunction) SCA_PythonController::sPyGetScript, METH_VARARGS}, {"setScript", (PyCFunction) SCA_PythonController::sPySetScript, METH_VARARGS}, + {"getState", (PyCFunction) SCA_PythonController::sPyGetState, METH_VARARGS}, {NULL,NULL} //Sentinel }; @@ -442,4 +443,12 @@ PyObject* SCA_PythonController::PySetScript(PyObject* self, Py_Return; } +/* 1. getScript */ +PyObject* SCA_PythonController::PyGetState(PyObject* self, + PyObject* args, + PyObject* kwds) +{ + return PyInt_FromLong(m_statemask); +} + /* eof */ diff --git a/source/gameengine/GameLogic/SCA_PythonController.h b/source/gameengine/GameLogic/SCA_PythonController.h index 63975234da9..f3af54f402f 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.h +++ b/source/gameengine/GameLogic/SCA_PythonController.h @@ -81,6 +81,7 @@ class SCA_PythonController : public SCA_IController KX_PYMETHOD_DOC(SCA_PythonController,GetActuators); KX_PYMETHOD(SCA_PythonController,SetScript); KX_PYMETHOD(SCA_PythonController,GetScript); + KX_PYMETHOD(SCA_PythonController,GetState); }; diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.cpp b/source/gameengine/GameLogic/SCA_RandomSensor.cpp index 0e856e0d6bb..3626522e49a 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.cpp +++ b/source/gameengine/GameLogic/SCA_RandomSensor.cpp @@ -50,16 +50,9 @@ SCA_RandomSensor::SCA_RandomSensor(SCA_EventManager* eventmgr, PyTypeObject* T) : SCA_ISensor(gameobj,eventmgr, T) { - m_iteration = 0; - m_interval = 0; - m_lastdraw = false; - // m_basegenerator is never deleted => memory leak m_basegenerator = new SCA_RandomNumberGenerator(startseed); - m_currentDraw = m_basegenerator->Draw(); - //registration is done globally, don't do it here - //Note: it was probably done to work around a bug in Evaluate(). It is now fixed - //RegisterToManager(); + Init(); } @@ -69,6 +62,13 @@ SCA_RandomSensor::~SCA_RandomSensor() /* Nothing to be done here. */ } +void SCA_RandomSensor::Init() +{ + m_iteration = 0; + m_interval = 0; + m_lastdraw = false; + m_currentDraw = m_basegenerator->Draw(); +} CValue* SCA_RandomSensor::GetReplica() diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.h b/source/gameengine/GameLogic/SCA_RandomSensor.h index cc54179aa4e..d29bfb6837a 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.h +++ b/source/gameengine/GameLogic/SCA_RandomSensor.h @@ -54,6 +54,7 @@ public: virtual CValue* GetReplica(); virtual bool Evaluate(CValue* event); virtual bool IsPositiveTrigger(); + virtual void Init(); /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ diff --git a/source/gameengine/GameLogic/SCA_XNORController.cpp b/source/gameengine/GameLogic/SCA_XNORController.cpp new file mode 100644 index 00000000000..3ef7c07fe0a --- /dev/null +++ b/source/gameengine/GameLogic/SCA_XNORController.cpp @@ -0,0 +1,148 @@ +/** + * 'Xnor' together all inputs + * + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include "SCA_XNORController.h" +#include "SCA_ISensor.h" +#include "SCA_LogicManager.h" +#include "BoolValue.h" + +#ifdef HAVE_CONFIG_H +#include +#endif + +/* ------------------------------------------------------------------------- */ +/* Native functions */ +/* ------------------------------------------------------------------------- */ + +SCA_XNORController::SCA_XNORController(SCA_IObject* gameobj, + PyTypeObject* T) + : + SCA_IController(gameobj,T) +{ +} + + + +SCA_XNORController::~SCA_XNORController() +{ +} + + + +void SCA_XNORController::Trigger(SCA_LogicManager* logicmgr) +{ + + bool sensorresult = true; + + for (vector::const_iterator is=m_linkedsensors.begin(); + !(is==m_linkedsensors.end());is++) + { + SCA_ISensor* sensor = *is; + if (sensor->IsPositiveTrigger()) + { + if (sensorresult == false) + { + sensorresult = true; + break; + } + sensorresult = false; + } + } + + CValue* newevent = new CBoolValue(sensorresult); + + for (vector::const_iterator i=m_linkedactuators.begin(); + !(i==m_linkedactuators.end());i++) + { + SCA_IActuator* actua = *i;//m_linkedactuators.at(i); + logicmgr->AddActiveActuator(actua,newevent); + } + + // every actuator that needs the event, has a it's own reference to it now so + // release it (so to be clear: if there is no actuator, it's deleted right now) + newevent->Release(); + +} + + + +CValue* SCA_XNORController::GetReplica() +{ + CValue* replica = new SCA_XNORController(*this); + // this will copy properties and so on... + CValue::AddDataToReplica(replica); + + return replica; +} + + + +/* ------------------------------------------------------------------------- */ +/* Python functions */ +/* ------------------------------------------------------------------------- */ + +/* Integration hooks ------------------------------------------------------- */ +PyTypeObject SCA_XNORController::Type = { + PyObject_HEAD_INIT(&PyType_Type) + 0, + "SCA_XNORController", + sizeof(SCA_XNORController), + 0, + PyDestructor, + 0, + __getattr, + __setattr, + 0, //&MyPyCompare, + __repr, + 0, //&cvalue_as_number, + 0, + 0, + 0, + 0 +}; + +PyParentObject SCA_XNORController::Parents[] = { + &SCA_XNORController::Type, + &SCA_IController::Type, + &SCA_ILogicBrick::Type, + &CValue::Type, + NULL +}; + +PyMethodDef SCA_XNORController::Methods[] = { + {NULL,NULL} //Sentinel +}; + +PyObject* SCA_XNORController::_getattr(const STR_String& attr) { + _getattr_up(SCA_IController); +} + +/* eof */ diff --git a/source/gameengine/GameLogic/SCA_XNORController.h b/source/gameengine/GameLogic/SCA_XNORController.h new file mode 100644 index 00000000000..4b1eaee95d8 --- /dev/null +++ b/source/gameengine/GameLogic/SCA_XNORController.h @@ -0,0 +1,56 @@ +/** + * SCA_XNORController.h + * + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef __KX_XNORCONTROLLER +#define __KX_XNORCONTROLLER + +#include "SCA_IController.h" + +class SCA_XNORController : public SCA_IController +{ + Py_Header; + //virtual void Trigger(class SCA_LogicManager* logicmgr); +public: + SCA_XNORController(SCA_IObject* gameobj,PyTypeObject* T=&Type); + virtual ~SCA_XNORController(); + virtual CValue* GetReplica(); + virtual void Trigger(SCA_LogicManager* logicmgr); + + /* --------------------------------------------------------------------- */ + /* Python interface ---------------------------------------------------- */ + /* --------------------------------------------------------------------- */ + + virtual PyObject* _getattr(const STR_String& attr); + +}; + +#endif //__KX_XNORCONTROLLER + diff --git a/source/gameengine/GameLogic/SCA_XORController.cpp b/source/gameengine/GameLogic/SCA_XORController.cpp new file mode 100644 index 00000000000..6499c62f5f2 --- /dev/null +++ b/source/gameengine/GameLogic/SCA_XORController.cpp @@ -0,0 +1,148 @@ +/** + * 'Xor' together all inputs + * + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include "SCA_XORController.h" +#include "SCA_ISensor.h" +#include "SCA_LogicManager.h" +#include "BoolValue.h" + +#ifdef HAVE_CONFIG_H +#include +#endif + +/* ------------------------------------------------------------------------- */ +/* Native functions */ +/* ------------------------------------------------------------------------- */ + +SCA_XORController::SCA_XORController(SCA_IObject* gameobj, + PyTypeObject* T) + : + SCA_IController(gameobj,T) +{ +} + + + +SCA_XORController::~SCA_XORController() +{ +} + + + +void SCA_XORController::Trigger(SCA_LogicManager* logicmgr) +{ + + bool sensorresult = false; + + for (vector::const_iterator is=m_linkedsensors.begin(); + !(is==m_linkedsensors.end());is++) + { + SCA_ISensor* sensor = *is; + if (sensor->IsPositiveTrigger()) + { + if (sensorresult == true) + { + sensorresult = false; + break; + } + sensorresult = true; + } + } + + CValue* newevent = new CBoolValue(sensorresult); + + for (vector::const_iterator i=m_linkedactuators.begin(); + !(i==m_linkedactuators.end());i++) + { + SCA_IActuator* actua = *i;//m_linkedactuators.at(i); + logicmgr->AddActiveActuator(actua,newevent); + } + + // every actuator that needs the event, has a it's own reference to it now so + // release it (so to be clear: if there is no actuator, it's deleted right now) + newevent->Release(); + +} + + + +CValue* SCA_XORController::GetReplica() +{ + CValue* replica = new SCA_XORController(*this); + // this will copy properties and so on... + CValue::AddDataToReplica(replica); + + return replica; +} + + + +/* ------------------------------------------------------------------------- */ +/* Python functions */ +/* ------------------------------------------------------------------------- */ + +/* Integration hooks ------------------------------------------------------- */ +PyTypeObject SCA_XORController::Type = { + PyObject_HEAD_INIT(&PyType_Type) + 0, + "SCA_XORController", + sizeof(SCA_XORController), + 0, + PyDestructor, + 0, + __getattr, + __setattr, + 0, //&MyPyCompare, + __repr, + 0, //&cvalue_as_number, + 0, + 0, + 0, + 0 +}; + +PyParentObject SCA_XORController::Parents[] = { + &SCA_XORController::Type, + &SCA_IController::Type, + &SCA_ILogicBrick::Type, + &CValue::Type, + NULL +}; + +PyMethodDef SCA_XORController::Methods[] = { + {NULL,NULL} //Sentinel +}; + +PyObject* SCA_XORController::_getattr(const STR_String& attr) { + _getattr_up(SCA_IController); +} + +/* eof */ diff --git a/source/gameengine/GameLogic/SCA_XORController.h b/source/gameengine/GameLogic/SCA_XORController.h new file mode 100644 index 00000000000..f50cd33c125 --- /dev/null +++ b/source/gameengine/GameLogic/SCA_XORController.h @@ -0,0 +1,56 @@ +/** + * SCA_XORController.h + * + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef __KX_XORCONTROLLER +#define __KX_XORCONTROLLER + +#include "SCA_IController.h" + +class SCA_XORController : public SCA_IController +{ + Py_Header; + //virtual void Trigger(class SCA_LogicManager* logicmgr); +public: + SCA_XORController(SCA_IObject* gameobj,PyTypeObject* T=&Type); + virtual ~SCA_XORController(); + virtual CValue* GetReplica(); + virtual void Trigger(SCA_LogicManager* logicmgr); + + /* --------------------------------------------------------------------- */ + /* Python interface ---------------------------------------------------- */ + /* --------------------------------------------------------------------- */ + + virtual PyObject* _getattr(const STR_String& attr); + +}; + +#endif //__KX_XORCONTROLLER + diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp index 44eeccedbd1..a5017574873 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp @@ -602,9 +602,9 @@ void GPC_RenderTools::MotionBlur(RAS_IRasterizer* rasterizer) } } -void GPC_RenderTools::Update2DFilter(RAS_2DFilterManager::RAS_2DFILTER_MODE filtermode, int pass, STR_String& text) +void GPC_RenderTools::Update2DFilter(RAS_2DFilterManager::RAS_2DFILTER_MODE filtermode, int pass, STR_String& text, short texture_flag) { - m_filtermanager.EnableFilter(filtermode, pass, text); + m_filtermanager.EnableFilter(filtermode, pass, text, texture_flag); } void GPC_RenderTools::Render2DFilters(RAS_ICanvas* canvas) diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.h b/source/gameengine/GamePlayer/common/GPC_RenderTools.h index f7230cb0865..cb7193f3513 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.h +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.h @@ -142,7 +142,7 @@ public: virtual void MotionBlur(RAS_IRasterizer* rasterizer); - virtual void Update2DFilter(RAS_2DFilterManager::RAS_2DFILTER_MODE filtermode, int pass, STR_String& text); + virtual void Update2DFilter(RAS_2DFilterManager::RAS_2DFILTER_MODE filtermode, int pass, STR_String& text, short texture_flag); virtual void Render2DFilters(RAS_ICanvas* canvas); diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp index c4cf698d5ee..d6908b53d40 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -496,7 +496,6 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode) bool fixed_framerate= (SYS_GetCommandLineInt(syshandle, "fixed_framerate", fixedFr) != 0); bool frameRate = (SYS_GetCommandLineInt(syshandle, "show_framerate", 0) != 0); - bool useVertexArrays = SYS_GetCommandLineInt(syshandle,"vertexarrays",1) != 0; bool useLists = (SYS_GetCommandLineInt(syshandle, "displaylists", G.fileflags & G_FILE_DIAPLAY_LISTS) != 0); if(GLEW_ARB_multitexture && GLEW_VERSION_1_1) { @@ -514,16 +513,17 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode) if (!m_rendertools) goto initFailed; - if(useLists) - if (useVertexArrays) { + if(useLists) { + if(GLEW_VERSION_1_1) m_rasterizer = new RAS_ListRasterizer(m_canvas, true); - } else { + else m_rasterizer = new RAS_ListRasterizer(m_canvas); - } - else if (useVertexArrays && GLEW_VERSION_1_1) + } + else if (GLEW_VERSION_1_1) m_rasterizer = new RAS_VAOpenGLRasterizer(m_canvas); else m_rasterizer = new RAS_OpenGLRasterizer(m_canvas); + m_rasterizer->SetStereoMode((RAS_IRasterizer::StereoMode) stereoMode); if (!m_rasterizer) goto initFailed; diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index bc80c0a7612..8222e5c8bac 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -187,11 +187,10 @@ void usage(char* program) printf(" show_framerate 0 Show the frame rate\n"); printf(" show_properties 0 Show debug properties\n"); printf(" show_profile 0 Show profiling information\n"); - printf(" vertexarrays 1 Enable vertex arrays\n"); printf(" blender_material 0 Enable material settings\n"); printf("\n"); printf("example: %s -p 10 10 320 200 -g noaudio c:\\loadtest.blend\n", program); - printf("example: %s -g vertexarrays = 0 c:\\loadtest.blend\n", program); + printf("example: %s -g show_framerate = 0 c:\\loadtest.blend\n", program); } char *get_filename(int argc, char **argv) { diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp index e320453b7aa..027cb2a0ffa 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp @@ -58,10 +58,15 @@ KX_NetworkMessageSensor::KX_NetworkMessageSensor( m_NetworkScene(NetworkScene), m_subject(subject), m_frame_message_count (0), - m_IsUp(false), m_BodyList(NULL), m_SubjectList(NULL) { + Init(); +} + +void KX_NetworkMessageSensor::Init() +{ + m_IsUp = false; } KX_NetworkMessageSensor::~KX_NetworkMessageSensor() diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h index d051b715aab..6fd92d17be3 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h @@ -65,6 +65,7 @@ public: virtual CValue* GetReplica(); virtual bool Evaluate(CValue* event); virtual bool IsPositiveTrigger(); + virtual void Init(); void EndFrame(); /* ------------------------------------------------------------- */ diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp index aa7c75e9633..70443ced7a9 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp @@ -102,6 +102,13 @@ MT_Vector3 KX_BulletPhysicsController::GetLinearVelocity() CcdPhysicsController::GetLinearVelocity(angVel[0],angVel[1],angVel[2]);//rcruiz return MT_Vector3(angVel[0],angVel[1],angVel[2]); } +MT_Vector3 KX_BulletPhysicsController::GetAngularVelocity() +{ + float angVel[3]; + //CcdPhysicsController::GetAngularVelocity(angVel[0],angVel[1],angVel[2]); + CcdPhysicsController::GetAngularVelocity(angVel[0],angVel[1],angVel[2]);//rcruiz + return MT_Vector3(angVel[0],angVel[1],angVel[2]); +} MT_Vector3 KX_BulletPhysicsController::GetVelocity(const MT_Point3& pos) { float linVel[3]; diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.h b/source/gameengine/Ketsji/KX_BulletPhysicsController.h index 619ac42503f..0853755dffa 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.h +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.h @@ -25,6 +25,7 @@ public: virtual void ApplyTorque(const MT_Vector3& torque,bool local); virtual void ApplyForce(const MT_Vector3& force,bool local); virtual MT_Vector3 GetLinearVelocity(); + virtual MT_Vector3 GetAngularVelocity(); virtual MT_Vector3 GetVelocity(const MT_Point3& pos); virtual void SetAngularVelocity(const MT_Vector3& ang_vel,bool local); virtual void SetLinearVelocity(const MT_Vector3& lin_vel,bool local); diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index eaa6564ba84..b7750e68e8f 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -664,6 +664,27 @@ MT_Vector3 KX_GameObject::GetLinearVelocity(bool local) return velocity; } +MT_Vector3 KX_GameObject::GetAngularVelocity(bool local) +{ + MT_Vector3 velocity(0.0,0.0,0.0), locvel; + MT_Matrix3x3 ori; + int i, j; + if (m_pPhysicsController1) + { + velocity = m_pPhysicsController1->GetAngularVelocity(); + + if (local) + { + ori = GetSGNode()->GetWorldOrientation(); + + locvel = velocity * ori; + return locvel; + } + } + return velocity; +} + + // scenegraph node stuff @@ -782,6 +803,9 @@ void KX_GameObject::Suspend(void) PyMethodDef KX_GameObject::Methods[] = { {"setVisible",(PyCFunction) KX_GameObject::sPySetVisible, METH_VARARGS}, + {"getVisible",(PyCFunction) KX_GameObject::sPyGetVisible, METH_VARARGS}, + {"setState",(PyCFunction) KX_GameObject::sPySetState, METH_VARARGS}, + {"getState",(PyCFunction) KX_GameObject::sPyGetState, METH_VARARGS}, {"alignAxisToVect",(PyCFunction) KX_GameObject::sPyAlignAxisToVect, METH_VARARGS}, {"setPosition", (PyCFunction) KX_GameObject::sPySetPosition, METH_VARARGS}, {"getPosition", (PyCFunction) KX_GameObject::sPyGetPosition, METH_VARARGS}, @@ -802,6 +826,8 @@ PyMethodDef KX_GameObject::Methods[] = { {"removeParent", (PyCFunction)KX_GameObject::sPyRemoveParent,METH_VARARGS}, {"getMesh", (PyCFunction)KX_GameObject::sPyGetMesh,METH_VARARGS}, {"getPhysicsId", (PyCFunction)KX_GameObject::sPyGetPhysicsId,METH_VARARGS}, + {"getPropertyNames", (PyCFunction)KX_GameObject::sPyGetPropertyNames,METH_VARARGS}, + {"endObject",(PyCFunction) KX_GameObject::sPyEndObject, METH_VARARGS}, KX_PYMETHODTABLE(KX_GameObject, getDistanceTo), KX_PYMETHODTABLE(KX_GameObject, rayCastTo), KX_PYMETHODTABLE(KX_GameObject, rayCast), @@ -835,6 +861,18 @@ PyObject* KX_GameObject::sPySetPosition(PyObject* self, } +PyObject* KX_GameObject::PyEndObject(PyObject* self, + PyObject* args, + PyObject* kwds) +{ + + KX_Scene *scene = PHY_GetActiveScene(); + scene->DelayedRemoveObject(this); + + return Py_None; + +} + PyObject* KX_GameObject::PyGetPosition(PyObject* self, PyObject* args, @@ -1074,6 +1112,45 @@ PyObject* KX_GameObject::PySetVisible(PyObject* self, } +PyObject* KX_GameObject::PyGetVisible(PyObject* self, + PyObject* args, + PyObject* kwds) +{ + return PyInt_FromLong(m_bVisible); +} + +PyObject* KX_GameObject::PyGetState(PyObject* self, + PyObject* args, + PyObject* kwds) +{ + int state = 0; + state |= GetState(); + return PyInt_FromLong(state); +} + +PyObject* KX_GameObject::PySetState(PyObject* self, + PyObject* args, + PyObject* kwds) +{ + int state_i; + unsigned int state = 0; + + if (PyArg_ParseTuple(args,"i",&state_i)) + { + state |= state_i; + if ((state & ((1<<30)-1)) == 0) { + PyErr_SetString(PyExc_AttributeError, "The state bitfield was not between 0 and 30 (1<<0 and 1<<29)"); + return NULL; + } + SetState(state); + } + else + { + return NULL; + } + Py_Return; +} + PyObject* KX_GameObject::PyGetVelocity(PyObject* self, @@ -1262,17 +1339,7 @@ PyObject* KX_GameObject::PySuspendDynamics(PyObject* self, PyObject* args, PyObject* kwds) { - if (m_bSuspendDynamics) - { - Py_Return; - } - - if (m_pPhysicsController1) - { - m_pPhysicsController1->SuspendDynamics(); - } - m_bSuspendDynamics = true; - + SuspendDynamics(); Py_Return; } @@ -1282,18 +1349,7 @@ PyObject* KX_GameObject::PyRestoreDynamics(PyObject* self, PyObject* args, PyObject* kwds) { - - if (!m_bSuspendDynamics) - { - Py_Return; - } - - if (m_pPhysicsController1) - { - m_pPhysicsController1->RestoreDynamics(); - } - m_bSuspendDynamics = false; - + RestoreDynamics(); Py_Return; } @@ -1383,6 +1439,13 @@ PyObject* KX_GameObject::PyGetPhysicsId(PyObject* self, return PyInt_FromLong((long)physid); } +PyObject* KX_GameObject::PyGetPropertyNames(PyObject* self, + PyObject* args, + PyObject* kwds) +{ + return ConvertKeysToPython(); +} + KX_PYMETHODDEF_DOC(KX_GameObject, getDistanceTo, "getDistanceTo(other): get distance to another point/KX_GameObject") { diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 63a660617c4..89f4cb396d1 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -46,7 +46,7 @@ #include "GEN_HashedPtr.h" #include "KX_Scene.h" #include "KX_KetsjiEngine.h" /* for m_anim_framerate */ - +#include "KX_IPhysicsController.h" /* for suspend/resume */ #define KX_OB_DYNAMIC 1 @@ -258,6 +258,14 @@ public: bool local=false ); + /** + * Return the angular velocity of the game object. + */ + MT_Vector3 + GetAngularVelocity( + bool local=false + ); + /** * Align the object to a given normal. */ @@ -644,6 +652,32 @@ public: */ void Resume(void); + void SuspendDynamics(void) { + if (m_bSuspendDynamics) + { + return; + } + + if (m_pPhysicsController1) + { + m_pPhysicsController1->SuspendDynamics(); + } + m_bSuspendDynamics = true; + } + + void RestoreDynamics(void) { + if (!m_bSuspendDynamics) + { + return; + } + + if (m_pPhysicsController1) + { + m_pPhysicsController1->RestoreDynamics(); + } + m_bSuspendDynamics = false; + } + KX_ClientObjectInfo* getClientInfo() { return m_pClient_info; } /** * @section Python interface functions. @@ -676,7 +710,7 @@ public: PyObject* args, PyObject* kwds ); - + KX_PYMETHOD(KX_GameObject,GetPosition); KX_PYMETHOD(KX_GameObject,GetLinearVelocity); KX_PYMETHOD(KX_GameObject,GetVelocity); @@ -684,7 +718,10 @@ public: KX_PYMETHOD(KX_GameObject,GetReactionForce); KX_PYMETHOD(KX_GameObject,GetOrientation); KX_PYMETHOD(KX_GameObject,SetOrientation); + KX_PYMETHOD(KX_GameObject,GetVisible); KX_PYMETHOD(KX_GameObject,SetVisible); + KX_PYMETHOD(KX_GameObject,GetState); + KX_PYMETHOD(KX_GameObject,SetState); KX_PYMETHOD(KX_GameObject,AlignAxisToVect); KX_PYMETHOD(KX_GameObject,SuspendDynamics); KX_PYMETHOD(KX_GameObject,RestoreDynamics); @@ -697,9 +734,12 @@ public: KX_PYMETHOD(KX_GameObject,SetParent); KX_PYMETHOD(KX_GameObject,RemoveParent); KX_PYMETHOD(KX_GameObject,GetPhysicsId); + KX_PYMETHOD(KX_GameObject,GetPropertyNames); + KX_PYMETHOD(KX_GameObject,EndObject); KX_PYMETHOD_DOC(KX_GameObject,rayCastTo); KX_PYMETHOD_DOC(KX_GameObject,rayCast); KX_PYMETHOD_DOC(KX_GameObject,getDistanceTo); + private : /** diff --git a/source/gameengine/Ketsji/KX_IPhysicsController.h b/source/gameengine/Ketsji/KX_IPhysicsController.h index 009db40d3e8..2ec66a883eb 100644 --- a/source/gameengine/Ketsji/KX_IPhysicsController.h +++ b/source/gameengine/Ketsji/KX_IPhysicsController.h @@ -64,6 +64,7 @@ public: virtual void ApplyTorque(const MT_Vector3& torque,bool local)=0; virtual void ApplyForce(const MT_Vector3& force,bool local)=0; virtual MT_Vector3 GetLinearVelocity()=0; + virtual MT_Vector3 GetAngularVelocity()=0; virtual MT_Vector3 GetVelocity(const MT_Point3& pos)=0; virtual void SetAngularVelocity(const MT_Vector3& ang_vel,bool local)=0; virtual void SetLinearVelocity(const MT_Vector3& lin_vel,bool local)=0; diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp index 60b90138abe..f89d32bbe66 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp @@ -69,11 +69,14 @@ KX_MouseFocusSensor::KX_MouseFocusSensor(SCA_MouseManager* eventmgr, m_gp_canvas(canvas), m_kxscene(kxscene) { + Init(); +} - m_mouse_over_in_previous_frame = false; +void KX_MouseFocusSensor::Init() +{ + m_mouse_over_in_previous_frame = (m_invert)?true:false; m_positive_event = false; m_hitObject = 0; - } bool KX_MouseFocusSensor::Evaluate(CValue* event) @@ -89,13 +92,13 @@ bool KX_MouseFocusSensor::Evaluate(CValue* event) obHasFocus = ParentObjectHasFocus(); if (!obHasFocus) { + m_positive_event = false; if (m_mouse_over_in_previous_frame) { - m_positive_event = false; - result = true; + result = true; } } else { + m_positive_event = true; if (!m_mouse_over_in_previous_frame) { - m_positive_event = true; result = true; } } diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.h b/source/gameengine/Ketsji/KX_MouseFocusSensor.h index 86f32fbf4be..b011ebe1288 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.h +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.h @@ -68,6 +68,7 @@ class KX_MouseFocusSensor : public SCA_MouseSensor * @attention Overrides default evaluate. */ virtual bool Evaluate(CValue* event); + virtual void Init(); virtual bool IsPositiveTrigger() { bool result = m_positive_event; diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index 22a406792f9..03ae14997ab 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -50,6 +50,7 @@ KX_ObjectActuator( const MT_Vector3& drot, const MT_Vector3& linV, const MT_Vector3& angV, + const short damping, const KX_LocalFlags& flag, PyTypeObject* T ) : @@ -60,9 +61,16 @@ KX_ObjectActuator( m_drot(drot), m_linear_velocity(linV), m_angular_velocity(angV), + m_linear_length2(0.0), + m_current_linear_factor(0.0), + m_current_angular_factor(0.0), + m_damping(damping), m_bitLocalFlag (flag), - m_active_combined_velocity (false) + m_active_combined_velocity (false), + m_linear_damping_active(false), + m_angular_damping_active(false) { + UpdateFuzzyFlags(); } bool KX_ObjectActuator::Update() @@ -87,42 +95,98 @@ bool KX_ObjectActuator::Update() ); m_active_combined_velocity = false; } + m_linear_damping_active = false; return false; } else if (parent) { - /* Probably better to use some flags, so these MT_zero tests can be */ - /* skipped. */ - if (!MT_fuzzyZero(m_force)) + if (!m_bitLocalFlag.ZeroForce) { - parent->ApplyForce(m_force,(m_bitLocalFlag.Force) != 0); + if (m_bitLocalFlag.ClampVelocity && !m_bitLocalFlag.ZeroLinearVelocity) + { + // The user is requesting not to exceed the velocity set in m_linear_velocity + // The verification is done by projecting the actual speed along the linV direction + // and comparing it with the linV vector length + MT_Vector3 linV; + linV = parent->GetLinearVelocity(m_bitLocalFlag.LinearVelocity); + if (linV.dot(m_linear_velocity) < m_linear_length2) + parent->ApplyForce(m_force,(m_bitLocalFlag.Force) != 0); + } else + { + parent->ApplyForce(m_force,(m_bitLocalFlag.Force) != 0); + } } - if (!MT_fuzzyZero(m_torque)) + if (!m_bitLocalFlag.ZeroTorque) { - parent->ApplyTorque(m_torque,(m_bitLocalFlag.Torque) != 0); + if (m_bitLocalFlag.ClampVelocity && !m_bitLocalFlag.ZeroAngularVelocity) + { + // The user is requesting not to exceed the velocity set in m_angular_velocity + // The verification is done by projecting the actual speed in the + MT_Vector3 angV; + angV = parent->GetAngularVelocity(m_bitLocalFlag.AngularVelocity); + if (angV.dot(m_angular_velocity) < m_angular_velocity.length2()) + parent->ApplyTorque(m_torque,(m_bitLocalFlag.Torque) != 0); + } else + { + parent->ApplyTorque(m_torque,(m_bitLocalFlag.Torque) != 0); + } } - if (!MT_fuzzyZero(m_dloc)) + if (!m_bitLocalFlag.ZeroDLoc) { parent->ApplyMovement(m_dloc,(m_bitLocalFlag.DLoc) != 0); } - if (!MT_fuzzyZero(m_drot)) + if (!m_bitLocalFlag.ZeroDRot) { parent->ApplyRotation(m_drot,(m_bitLocalFlag.DRot) != 0); } - if (!MT_fuzzyZero(m_linear_velocity)) + if (!m_bitLocalFlag.ZeroLinearVelocity && !m_bitLocalFlag.ClampVelocity) { if (m_bitLocalFlag.AddOrSetLinV) { parent->addLinearVelocity(m_linear_velocity,(m_bitLocalFlag.LinearVelocity) != 0); } else { m_active_combined_velocity = true; - parent->setLinearVelocity(m_linear_velocity,(m_bitLocalFlag.LinearVelocity) != 0); + if (m_damping > 0) { + MT_Vector3 linV; + if (!m_linear_damping_active) { + // delta and the start speed (depends on the existing speed in that direction) + linV = parent->GetLinearVelocity(m_bitLocalFlag.LinearVelocity); + // keep only the projection along the desired direction + m_current_linear_factor = linV.dot(m_linear_velocity)/m_linear_length2; + m_linear_damping_active = true; + } + if (m_current_linear_factor < 1.0) + m_current_linear_factor += 1.0/m_damping; + if (m_current_linear_factor > 1.0) + m_current_linear_factor = 1.0; + linV = m_current_linear_factor * m_linear_velocity; + parent->setLinearVelocity(linV,(m_bitLocalFlag.LinearVelocity) != 0); + } else { + parent->setLinearVelocity(m_linear_velocity,(m_bitLocalFlag.LinearVelocity) != 0); + } } } - if (!MT_fuzzyZero(m_angular_velocity)) + if (!m_bitLocalFlag.ZeroAngularVelocity && !m_bitLocalFlag.ClampVelocity) { - parent->setAngularVelocity(m_angular_velocity,(m_bitLocalFlag.AngularVelocity) != 0); m_active_combined_velocity = true; + if (m_damping > 0) { + MT_Vector3 angV; + if (!m_angular_damping_active) { + // delta and the start speed (depends on the existing speed in that direction) + angV = parent->GetAngularVelocity(m_bitLocalFlag.AngularVelocity); + // keep only the projection along the desired direction + m_current_angular_factor = angV.dot(m_angular_velocity)/m_angular_length2; + m_angular_damping_active = true; + } + if (m_current_angular_factor < 1.0) + m_current_angular_factor += 1.0/m_damping; + if (m_current_angular_factor > 1.0) + m_current_angular_factor = 1.0; + angV = m_current_angular_factor * m_angular_velocity; + parent->setAngularVelocity(angV,(m_bitLocalFlag.AngularVelocity) != 0); + } else { + parent->setAngularVelocity(m_angular_velocity,(m_bitLocalFlag.AngularVelocity) != 0); + } } } @@ -199,6 +263,8 @@ PyMethodDef KX_ObjectActuator::Methods[] = { {"setLinearVelocity", (PyCFunction) KX_ObjectActuator::sPySetLinearVelocity, METH_VARARGS}, {"getAngularVelocity", (PyCFunction) KX_ObjectActuator::sPyGetAngularVelocity, METH_VARARGS}, {"setAngularVelocity", (PyCFunction) KX_ObjectActuator::sPySetAngularVelocity, METH_VARARGS}, + {"setVelocityDamping", (PyCFunction) KX_ObjectActuator::sPySetVelocityDamping, METH_VARARGS}, + {"getVelocityDamping", (PyCFunction) KX_ObjectActuator::sPyGetVelocityDamping, METH_VARARGS}, {NULL,NULL} //Sentinel @@ -238,6 +304,7 @@ PyObject* KX_ObjectActuator::PySetForce(PyObject* self, } m_force.setValue(vecArg); m_bitLocalFlag.Force = PyArgToBool(bToggle); + UpdateFuzzyFlags(); Py_Return; } @@ -268,6 +335,7 @@ PyObject* KX_ObjectActuator::PySetTorque(PyObject* self, } m_torque.setValue(vecArg); m_bitLocalFlag.Torque = PyArgToBool(bToggle); + UpdateFuzzyFlags(); Py_Return; } @@ -298,6 +366,7 @@ PyObject* KX_ObjectActuator::PySetDLoc(PyObject* self, } m_dloc.setValue(vecArg); m_bitLocalFlag.DLoc = PyArgToBool(bToggle); + UpdateFuzzyFlags(); Py_Return; } @@ -328,6 +397,7 @@ PyObject* KX_ObjectActuator::PySetDRot(PyObject* self, } m_drot.setValue(vecArg); m_bitLocalFlag.DRot = PyArgToBool(bToggle); + UpdateFuzzyFlags(); Py_Return; } @@ -341,6 +411,7 @@ PyObject* KX_ObjectActuator::PyGetLinearVelocity(PyObject* self, PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_linear_velocity[1])); PyList_SetItem(retVal, 2, PyFloat_FromDouble(m_linear_velocity[2])); PyList_SetItem(retVal, 3, BoolToPyArg(m_bitLocalFlag.LinearVelocity)); + PyList_SetItem(retVal, 4, BoolToPyArg(m_bitLocalFlag.ClampVelocity)); return retVal; } @@ -351,12 +422,15 @@ PyObject* KX_ObjectActuator::PySetLinearVelocity(PyObject* self, PyObject* kwds) { float vecArg[3]; int bToggle = 0; - if (!PyArg_ParseTuple(args, "fffi", &vecArg[0], &vecArg[1], - &vecArg[2], &bToggle)) { + int bClamp = 0; + if (!PyArg_ParseTuple(args, "fffi|i", &vecArg[0], &vecArg[1], + &vecArg[2], &bToggle, &bClamp)) { return NULL; } m_linear_velocity.setValue(vecArg); m_bitLocalFlag.LinearVelocity = PyArgToBool(bToggle); + m_bitLocalFlag.ClampVelocity = PyArgToBool(bClamp); + UpdateFuzzyFlags(); Py_Return; } @@ -371,6 +445,7 @@ PyObject* KX_ObjectActuator::PyGetAngularVelocity(PyObject* self, PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_angular_velocity[1])); PyList_SetItem(retVal, 2, PyFloat_FromDouble(m_angular_velocity[2])); PyList_SetItem(retVal, 3, BoolToPyArg(m_bitLocalFlag.AngularVelocity)); + PyList_SetItem(retVal, 4, BoolToPyArg(m_bitLocalFlag.ClampVelocity)); return retVal; } @@ -380,15 +455,37 @@ PyObject* KX_ObjectActuator::PySetAngularVelocity(PyObject* self, PyObject* kwds) { float vecArg[3]; int bToggle = 0; - if (!PyArg_ParseTuple(args, "fffi", &vecArg[0], &vecArg[1], - &vecArg[2], &bToggle)) { + int bClamp = 0; + if (!PyArg_ParseTuple(args, "fffi|i", &vecArg[0], &vecArg[1], + &vecArg[2], &bToggle, &bClamp)) { return NULL; } m_angular_velocity.setValue(vecArg); m_bitLocalFlag.AngularVelocity = PyArgToBool(bToggle); + m_bitLocalFlag.ClampVelocity = PyArgToBool(bClamp); + UpdateFuzzyFlags(); Py_Return; } +/* 13. setVelocityDamping */ +PyObject* KX_ObjectActuator::PySetVelocityDamping(PyObject* self, + PyObject* args, + PyObject* kwds) { + int damping = 0; + if (!PyArg_ParseTuple(args, "i", &damping) || damping < 0 || damping > 1000) { + return NULL; + } + m_damping = damping; + Py_Return; +} + +/* 13. getVelocityDamping */ +PyObject* KX_ObjectActuator::PyGetVelocityDamping(PyObject* self, + PyObject* args, + PyObject* kwds) { + return Py_BuildValue("i",m_damping); +} + diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.h b/source/gameengine/Ketsji/KX_ObjectActuator.h index edbae154b8b..ec6dab5cd48 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.h +++ b/source/gameengine/Ketsji/KX_ObjectActuator.h @@ -46,7 +46,13 @@ struct KX_LocalFlags { DLoc(false), LinearVelocity(false), AngularVelocity(false), - AddOrSetLinV(false) + AddOrSetLinV(false), + ClampVelocity(false), + ZeroForce(false), + ZeroDRot(false), + ZeroDLoc(false), + ZeroLinearVelocity(false), + ZeroAngularVelocity(false) { } @@ -57,6 +63,13 @@ struct KX_LocalFlags { unsigned short LinearVelocity : 1; unsigned short AngularVelocity : 1; unsigned short AddOrSetLinV : 1; + unsigned short ClampVelocity : 1; + unsigned short ZeroForce : 1; + unsigned short ZeroTorque : 1; + unsigned short ZeroDRot : 1; + unsigned short ZeroDLoc : 1; + unsigned short ZeroLinearVelocity : 1; + unsigned short ZeroAngularVelocity : 1; }; class KX_ObjectActuator : public SCA_IActuator @@ -69,6 +82,11 @@ class KX_ObjectActuator : public SCA_IActuator MT_Vector3 m_drot; MT_Vector3 m_linear_velocity; MT_Vector3 m_angular_velocity; + MT_Scalar m_linear_length2; + MT_Scalar m_angular_length2; + MT_Scalar m_current_linear_factor; + MT_Scalar m_current_angular_factor; + short m_damping; KX_LocalFlags m_bitLocalFlag; // A hack bool -- oh no sorry everyone @@ -77,6 +95,8 @@ class KX_ObjectActuator : public SCA_IActuator // setting linear velocity. bool m_active_combined_velocity; + bool m_linear_damping_active; + bool m_angular_damping_active; public: enum KX_OBJECT_ACT_VEC_TYPE { @@ -103,6 +123,7 @@ public: const MT_Vector3& drot, const MT_Vector3& linV, const MT_Vector3& angV, + const short damping, const KX_LocalFlags& flag, PyTypeObject* T=&Type ); @@ -110,6 +131,17 @@ public: CValue* GetReplica(); void SetForceLoc(const double force[3]) { /*m_force=force;*/ } + void UpdateFuzzyFlags() + { + m_bitLocalFlag.ZeroForce = MT_fuzzyZero(m_force); + m_bitLocalFlag.ZeroTorque = MT_fuzzyZero(m_torque); + m_bitLocalFlag.ZeroDLoc = MT_fuzzyZero(m_dloc); + m_bitLocalFlag.ZeroDRot = MT_fuzzyZero(m_drot); + m_bitLocalFlag.ZeroLinearVelocity = MT_fuzzyZero(m_linear_velocity); + m_linear_length2 = (m_bitLocalFlag.ZeroLinearVelocity) ? 0.0 : m_linear_velocity.length2(); + m_bitLocalFlag.ZeroAngularVelocity = MT_fuzzyZero(m_angular_velocity); + m_angular_length2 = (m_bitLocalFlag.ZeroAngularVelocity) ? 0.0 : m_angular_velocity.length2(); + } virtual bool Update(); @@ -132,6 +164,8 @@ public: KX_PYMETHOD(KX_ObjectActuator,SetLinearVelocity); KX_PYMETHOD(KX_ObjectActuator,GetAngularVelocity); KX_PYMETHOD(KX_ObjectActuator,SetAngularVelocity); + KX_PYMETHOD(KX_ObjectActuator,SetVelocityDamping); + KX_PYMETHOD(KX_ObjectActuator,GetVelocityDamping); }; #endif //__KX_OBJECTACTUATOR diff --git a/source/gameengine/Ketsji/KX_RadarSensor.cpp b/source/gameengine/Ketsji/KX_RadarSensor.cpp index 31fffffa3c1..987e0b946b2 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.cpp +++ b/source/gameengine/Ketsji/KX_RadarSensor.cpp @@ -71,7 +71,6 @@ KX_RadarSensor::KX_RadarSensor(SCA_EventManager* eventmgr, //sumoObj->setClientObject(&m_client_info); } - KX_RadarSensor::~KX_RadarSensor() { diff --git a/source/gameengine/Ketsji/KX_RaySensor.cpp b/source/gameengine/Ketsji/KX_RaySensor.cpp index a85dc61cac8..e847c59bae1 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.cpp +++ b/source/gameengine/Ketsji/KX_RaySensor.cpp @@ -60,17 +60,19 @@ KX_RaySensor::KX_RaySensor(class SCA_EventManager* eventmgr, m_bFindMaterial(bFindMaterial), m_distance(distance), m_scene(ketsjiScene), - m_bTriggered(false), - m_axis(axis), - m_rayHit(false), - m_hitObject(NULL) + m_axis(axis) { - + Init(); } - +void KX_RaySensor::Init() +{ + m_bTriggered = (m_invert)?true:false; + m_rayHit = false; + m_hitObject = NULL; +} KX_RaySensor::~KX_RaySensor() { diff --git a/source/gameengine/Ketsji/KX_RaySensor.h b/source/gameengine/Ketsji/KX_RaySensor.h index 8a317ffaa07..f4305b053d1 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.h +++ b/source/gameengine/Ketsji/KX_RaySensor.h @@ -66,6 +66,7 @@ public: virtual bool Evaluate(CValue* event); virtual bool IsPositiveTrigger(); + virtual void Init(); bool RayHit(KX_ClientObjectInfo* client, MT_Point3& hit_point, MT_Vector3& hit_normal, void * const data); diff --git a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp new file mode 100644 index 00000000000..d44ab477749 --- /dev/null +++ b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp @@ -0,0 +1,206 @@ +// +// Adjust dynamics settins for this object +// +// $Id$ +// +// ***** BEGIN GPL LICENSE BLOCK ***** +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. +// All rights reserved. +// +// The Original Code is: all of this file. +// +// Contributor(s): none yet. +// +// ***** END GPL LICENSE BLOCK ***** + +// +// Previously existed as: + +// \source\gameengine\GameLogic\SCA_DynamicActuator.cpp + +// Please look here for revision history. + +#include "KX_SCA_DynamicActuator.h" + +#ifdef HAVE_CONFIG_H +#include +#endif + +/* ------------------------------------------------------------------------- */ +/* Python functions */ +/* ------------------------------------------------------------------------- */ + +/* Integration hooks ------------------------------------------------------- */ + + PyTypeObject + +KX_SCA_DynamicActuator:: + +Type = { + PyObject_HEAD_INIT(&PyType_Type) + 0, + "KX_SCA_DynamicActuator", + sizeof(KX_SCA_DynamicActuator), + 0, + PyDestructor, + 0, + __getattr, + __setattr, + 0, + __repr, + 0, + 0, + 0, + 0, + 0 +}; + +PyParentObject KX_SCA_DynamicActuator::Parents[] = { + &KX_SCA_DynamicActuator::Type, + &SCA_IActuator::Type, + &SCA_ILogicBrick::Type, + &CValue::Type, + NULL +}; + + +PyMethodDef KX_SCA_DynamicActuator::Methods[] = { + KX_PYMETHODTABLE(KX_SCA_DynamicActuator, setOperation), + KX_PYMETHODTABLE(KX_SCA_DynamicActuator, getOperation), + {NULL,NULL} //Sentinel +}; + + + +PyObject* KX_SCA_DynamicActuator::_getattr(const STR_String& attr) +{ + _getattr_up(SCA_IActuator); +} + + + +/* 1. setOperation */ +KX_PYMETHODDEF_DOC(KX_SCA_DynamicActuator, setOperation, +"setOperation(operation?)\n" +"\t - operation? : type of dynamic operation\n" +"\t 0 = restore dynamics\n" +"\t 1 = disable dynamics\n" +"\t 2 = enable rigid body\n" +"\t 3 = disable rigid body\n" +"Change the dynamic status of the parent object.\n") +{ + int dyn_operation; + + if (!PyArg_ParseTuple(args, "i", &dyn_operation)) + { + return NULL; + } + if (dyn_operation <0 || dyn_operation>3) { + PyErr_SetString(PyExc_IndexError, "Dynamic Actuator's setOperation() range must be between 0 and 3"); + return NULL; + } + m_dyn_operation= dyn_operation; + Py_Return; +} + +KX_PYMETHODDEF_DOC(KX_SCA_DynamicActuator, getOperation, +"getOperation() -> integer\n" +"Returns the operation type of this actuator.\n" +) +{ + return PyInt_FromLong((long)m_dyn_operation); +} + + +/* ------------------------------------------------------------------------- */ +/* Native functions */ +/* ------------------------------------------------------------------------- */ + +KX_SCA_DynamicActuator::KX_SCA_DynamicActuator(SCA_IObject *gameobj, + short dyn_operation, + PyTypeObject* T) : + + SCA_IActuator(gameobj, T), + m_dyn_operation(dyn_operation) +{ +} /* End of constructor */ + + +KX_SCA_DynamicActuator::~KX_SCA_DynamicActuator() +{ + // there's nothing to be done here, really.... +} /* end of destructor */ + + + +bool KX_SCA_DynamicActuator::Update() +{ + // bool result = false; /*unused*/ + KX_GameObject *obj = (KX_GameObject*) GetParent(); + bool bNegativeEvent = IsNegativeEvent(); + KX_IPhysicsController* controller; + RemoveAllEvents(); + + if (bNegativeEvent) + return false; // do nothing on negative events + + if (!obj) + return false; // object not accessible, shouldnt happen + controller = obj->GetPhysicsController(); + if (!controller) + return false; // no physic object + + switch (m_dyn_operation) + { + case 0: + obj->RestoreDynamics(); + break; + case 1: + obj->SuspendDynamics(); + break; + case 2: + controller->setRigidBody(true); + break; + case 3: + controller->setRigidBody(false); + break; + } + + return false; +} + + + +CValue* KX_SCA_DynamicActuator::GetReplica() +{ + KX_SCA_DynamicActuator* replica = + new KX_SCA_DynamicActuator(*this); + + if (replica == NULL) + return NULL; + + replica->ProcessReplica(); + + // this will copy properties and so on... + CValue::AddDataToReplica(replica); + + return replica; +}; + + +/* eof */ diff --git a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h new file mode 100644 index 00000000000..b47c3a511d9 --- /dev/null +++ b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h @@ -0,0 +1,76 @@ +// +// Add object to the game world on action of this actuator +// +// $Id$ +// +// ***** BEGIN GPL LICENSE BLOCK ***** +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. +// All rights reserved. +// +// The Original Code is: all of this file. +// +// Contributor(s): Campbell Barton +// +// ***** END GPL LICENSE BLOCK ***** +// + +#ifndef __KX_SCA_DYNAMICACTUATOR +#define __KX_SCA_DYNAMICACTUATOR + +#include "SCA_IActuator.h" +#include "SCA_PropertyActuator.h" +#include "SCA_LogicManager.h" + +#include "KX_GameObject.h" +#include "KX_IPhysicsController.h" + +class KX_SCA_DynamicActuator : public SCA_IActuator +{ + Py_Header; + + // dynamics operation to apply to the game object + short m_dyn_operation; + public: + KX_SCA_DynamicActuator( + SCA_IObject* gameobj, + short dyn_operation, + PyTypeObject* T=&Type + ); + + ~KX_SCA_DynamicActuator( + ); + + CValue* + GetReplica( + ); + + virtual bool + Update(); + + virtual PyObject* + _getattr( + const STR_String& attr + ); + + /* 1. setOperation */ + KX_PYMETHOD_DOC(KX_SCA_DynamicActuator,setOperation); + KX_PYMETHOD_DOC(KX_SCA_DynamicActuator,getOperation); + +}; + +#endif diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index fff33ca82fd..a7e91e27df3 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -754,8 +754,6 @@ int KX_Scene::NewRemoveObject(class CValue* gameobj) for (SCA_ControllerList::iterator itc = controllers.begin(); !(itc==controllers.end());itc++) { - (*itc)->UnlinkAllSensors(); - (*itc)->UnlinkAllActuators(); m_logicmgr->RemoveController(*itc); } @@ -868,6 +866,7 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj) static_cast( parentobj ) ); releaseParent= false; + shapeDeformer->LoadShapeDrivers(blendobj->parent); } else { diff --git a/source/gameengine/Ketsji/KX_StateActuator.cpp b/source/gameengine/Ketsji/KX_StateActuator.cpp new file mode 100644 index 00000000000..95a79f0c480 --- /dev/null +++ b/source/gameengine/Ketsji/KX_StateActuator.cpp @@ -0,0 +1,207 @@ +/* + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + * Actuator to toggle visibility/invisibility of objects + */ + +#include "KX_StateActuator.h" +#include "KX_GameObject.h" + +#ifdef HAVE_CONFIG_H +#include +#endif + +KX_StateActuator::KX_StateActuator( + SCA_IObject* gameobj, + int operation, + unsigned int mask, + PyTypeObject* T + ) + : SCA_IActuator(gameobj,T), + m_operation(operation), + m_mask(mask) +{ + // intentionally empty +} + +KX_StateActuator::~KX_StateActuator( + void + ) +{ + // intentionally empty +} + +CValue* +KX_StateActuator::GetReplica( + void + ) +{ + KX_StateActuator* replica = new KX_StateActuator(*this); + replica->ProcessReplica(); + // this will copy properties and so on... + CValue::AddDataToReplica(replica); + return replica; +} + +bool +KX_StateActuator::Update() +{ + bool bNegativeEvent = IsNegativeEvent(); + unsigned int objMask; + + RemoveAllEvents(); + if (bNegativeEvent) return false; + + KX_GameObject *obj = (KX_GameObject*) GetParent(); + + objMask = obj->GetState(); + switch (m_operation) + { + case OP_CPY: + objMask = m_mask; + break; + case OP_SET: + objMask |= m_mask; + break; + case OP_CLR: + objMask &= ~m_mask; + break; + case OP_NEG: + objMask ^= m_mask; + break; + default: + // unsupported operation, no nothing + return false; + } + obj->SetState(objMask); + return false; +} + +/* ------------------------------------------------------------------------- */ +/* Python functions */ +/* ------------------------------------------------------------------------- */ + + + +/* Integration hooks ------------------------------------------------------- */ +PyTypeObject +KX_StateActuator::Type = { + PyObject_HEAD_INIT(&PyType_Type) + 0, + "KX_StateActuator", + sizeof(KX_StateActuator), + 0, + PyDestructor, + 0, + __getattr, + __setattr, + 0, //&MyPyCompare, + __repr, + 0, //&cvalue_as_number, + 0, + 0, + 0, + 0 +}; + +PyParentObject +KX_StateActuator::Parents[] = { + &KX_StateActuator::Type, + &SCA_IActuator::Type, + &SCA_ILogicBrick::Type, + &CValue::Type, + NULL +}; + +PyMethodDef +KX_StateActuator::Methods[] = { + {"setOperation", (PyCFunction) KX_StateActuator::sPySetOperation, + METH_VARARGS, SetOperation_doc}, + {"setMask", (PyCFunction) KX_StateActuator::sPySetMask, + METH_VARARGS, SetMask_doc}, + {NULL,NULL} //Sentinel +}; + +PyObject* +KX_StateActuator::_getattr( + const STR_String& attr + ) +{ + _getattr_up(SCA_IActuator); +}; + + + +/* set operation ---------------------------------------------------------- */ +char +KX_StateActuator::SetOperation_doc[] = +"setOperation(op)\n" +"\t - op : bit operation (0=Copy, 1=Set, 2=Clear, 3=Negate)" +"\tSet the type of bit operation to be applied on object state mask.\n" +"\tUse setMask() to specify the bits that will be modified.\n"; +PyObject* + +KX_StateActuator::PySetOperation(PyObject* self, + PyObject* args, + PyObject* kwds) { + int oper; + + if(!PyArg_ParseTuple(args, "i", &oper)) { + return NULL; + } + + m_operation = oper; + + Py_Return; +} + +/* set mask ---------------------------------------------------------- */ +char +KX_StateActuator::SetMask_doc[] = +"setMask(mask)\n" +"\t - mask : bits that will be modified" +"\tSet the value that defines the bits that will be modified by the operation.\n" +"\tThe bits that are 1 in the value will be updated in the object state,\n" +"\tthe bits that are 0 are will be left unmodified expect for the Copy operation\n" +"\twhich copies the value to the object state.\n"; +PyObject* + +KX_StateActuator::PySetMask(PyObject* self, + PyObject* args, + PyObject* kwds) { + int mask; + + if(!PyArg_ParseTuple(args, "i", &mask)) { + return NULL; + } + + m_mask = mask; + + Py_Return; +} + + diff --git a/source/gameengine/Ketsji/KX_StateActuator.h b/source/gameengine/Ketsji/KX_StateActuator.h new file mode 100644 index 00000000000..8698e51b2c1 --- /dev/null +++ b/source/gameengine/Ketsji/KX_StateActuator.h @@ -0,0 +1,83 @@ +/* + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + * Actuator to toggle visibility/invisibility of objects + */ + +#ifndef __KX_STATEACTUATOR +#define __KX_STATEACTUATOR + +#include "SCA_IActuator.h" + +class KX_StateActuator : public SCA_IActuator +{ + Py_Header; + + /** Make visible? */ + enum { + OP_CPY = 0, + OP_SET, + OP_CLR, + OP_NEG + }; + int m_operation; + unsigned int m_mask; + + public: + + KX_StateActuator( + SCA_IObject* gameobj, + int operation, + unsigned int mask, + PyTypeObject* T=&Type + ); + + virtual + ~KX_StateActuator( + void + ); + + virtual CValue* + GetReplica( + void + ); + + virtual bool + Update(); + + /* --------------------------------------------------------------------- */ + /* Python interface ---------------------------------------------------- */ + /* --------------------------------------------------------------------- */ + + virtual PyObject* _getattr(const STR_String& attr); + //KX_PYMETHOD_DOC + KX_PYMETHOD_DOC(KX_StateActuator,SetOperation); + KX_PYMETHOD_DOC(KX_StateActuator,SetMask); +}; + +#endif + diff --git a/source/gameengine/Ketsji/KX_SumoPhysicsController.h b/source/gameengine/Ketsji/KX_SumoPhysicsController.h index 868465c8f10..8c061ae4056 100644 --- a/source/gameengine/Ketsji/KX_SumoPhysicsController.h +++ b/source/gameengine/Ketsji/KX_SumoPhysicsController.h @@ -68,6 +68,8 @@ public: void ApplyTorque(const MT_Vector3& torque,bool local); void ApplyForce(const MT_Vector3& force,bool local); MT_Vector3 GetLinearVelocity(); + MT_Vector3 GetAngularVelocity() // to keep compiler happy + { return MT_Vector3(0.0,0.0,0.0); } MT_Vector3 GetVelocity(const MT_Point3& pos); void SetAngularVelocity(const MT_Vector3& ang_vel,bool local); void SetLinearVelocity(const MT_Vector3& lin_vel,bool local); diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp index 3f185359de0..5311f059f03 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.cpp +++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp @@ -77,18 +77,14 @@ KX_TouchSensor::KX_TouchSensor(SCA_EventManager* eventmgr,KX_GameObject* gameobj :SCA_ISensor(gameobj,eventmgr,T), m_touchedpropname(touchedpropname), m_bFindMaterial(bFindMaterial), -m_eventmgr(eventmgr), +m_eventmgr(eventmgr) /*m_sumoObj(sumoObj),*/ -m_bCollision(false), -m_bTriggered(false), -m_bLastTriggered(false) { // KX_TouchEventManager* touchmgr = (KX_TouchEventManager*) eventmgr; // m_resptable = touchmgr->GetResponseTable(); // m_solidHandle = m_sumoObj->getObjectHandle(); - m_hitObject = NULL; m_colliders = new CListValue(); KX_ClientObjectInfo *client_info = gameobj->getClientInfo(); @@ -98,8 +94,16 @@ m_bLastTriggered(false) m_physCtrl = dynamic_cast(gameobj->GetPhysicsController()); MT_assert( !gameobj->GetPhysicsController() || m_physCtrl ); + Init(); } +void KX_TouchSensor::Init() +{ + m_bCollision = false; + m_bTriggered = false; + m_bLastTriggered = (m_invert)?true:false; + m_hitObject = NULL; +} KX_TouchSensor::~KX_TouchSensor() { diff --git a/source/gameengine/Ketsji/KX_TouchSensor.h b/source/gameengine/Ketsji/KX_TouchSensor.h index f594196628a..056440ccd6c 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.h +++ b/source/gameengine/Ketsji/KX_TouchSensor.h @@ -72,6 +72,7 @@ public: virtual CValue* GetReplica(); virtual void SynchronizeTransform(); virtual bool Evaluate(CValue* event); + virtual void Init(); virtual void ReParent(SCA_IObject* parent); virtual void RegisterSumo(KX_TouchEventManager* touchman); diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index ff55f975543..ec7496daa75 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -25,11 +25,35 @@ class KX_GameObject: @ivar timeOffset: adjust the slowparent delay at runtime. @type timeOffset: float """ - + def endObject(visible): + """ + Delete this object, can be used inpace of the EndObject Actuator. + The actual removal of the object from the scene is delayed. + """ + def getVisible(visible): + """ + Gets the game object's visible flag. + + @type visible: boolean + """ def setVisible(visible): """ Sets the game object's visible flag. + @type visible: boolean + """ + def getState(): + """ + Gets the game object's state bitmask. + + @rtype: int + @return: the objects state. + """ + def setState(): + """ + Sets the game object's visible flag. + The bitmasks for states from 1 to 30 can be set with (1<<0, 1<<1, 1<<2 ... 1<<29) + @type visible: boolean """ def setPosition(pos): @@ -50,8 +74,9 @@ class KX_GameObject: """ Sets the game object's orientation. - @type orn: 3x3 inverted rotation matrix, or Quaternion. + @type orn: 3x3 rotation matrix, or Quaternion. @param orn: a rotation matrix specifying the new rotation. + @note: When using this matrix with Blender.Mathutils.Matrix() types, it will need to be transposed. """ def alignAxisToVect(vect, axis): """ @@ -71,6 +96,7 @@ class KX_GameObject: @rtype: 3x3 inverted rotation matrix @return: The game object's rotation matrix + @note: When using this matrix with Blender.Mathutils.Matrix() types, it will need to be transposed. """ def getLinearVelocity(local): """ @@ -174,6 +200,12 @@ class KX_GameObject: """ Returns the user data object associated with this game object's physics controller. """ + def getPropertyNames(): + """ + Gets a list of all property names. + @rtype: list + @return: All property names for this object. + """ def getDistanceTo(other): """ Returns the distance to another object or point. @@ -214,7 +246,7 @@ class KX_GameObject: If is casted from/to object center or explicit [x,y,z] points. The ray does not have X-Ray capability: the first object hit (other than self object) stops the ray If a property was specified and the first object hit does not have that property, there is no hit - The ray ignores collision-free objects + The ray ignores collision-free objects and faces that dont have the collision flag enabled, you can however use ghost objects. @param to: [x,y,z] or object to which the ray is casted @type to: L{KX_GameObject} or 3-tuple diff --git a/source/gameengine/PyDoc/SCA_PythonController.py b/source/gameengine/PyDoc/SCA_PythonController.py index eb9e57c0819..6d91736d636 100644 --- a/source/gameengine/PyDoc/SCA_PythonController.py +++ b/source/gameengine/PyDoc/SCA_PythonController.py @@ -46,4 +46,12 @@ class SCA_PythonController(SCA_IController): @type script: string. """ + def getState(): + """ + Get the controllers state bitmask, this can be used with the GameObject's state to test if the the controller is active. + This for instance will always be true however you could compare with a previous state to see when the state was activated. + GameLogic.getCurrentController().getState() & GameLogic.getCurrentController().getOwner().getState() + + @rtype: int + """ diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp index e9ab4ccca8d..23153fcd86c 100644 --- a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp +++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp @@ -54,7 +54,7 @@ RAS_2DFilterManager::RAS_2DFilterManager(): -texname(-1), texturewidth(-1), textureheight(-1), +texturewidth(-1), textureheight(-1), canvaswidth(-1), canvasheight(-1), numberoffilters(0) { @@ -72,8 +72,9 @@ numberoffilters(0) { m_filters[passindex] = 0; m_enabled[passindex] = 0; + texflag[passindex] = 0; } - + texname[0] = texname[1] = texname[2] = -1; } RAS_2DFilterManager::~RAS_2DFilterManager() @@ -150,30 +151,54 @@ unsigned int RAS_2DFilterManager::CreateShaderProgram(int filtermode) return 0; } -void RAS_2DFilterManager::StartShaderProgram(unsigned int shaderprogram) +void RAS_2DFilterManager::StartShaderProgram(int passindex) { GLint uniformLoc; - glUseProgramObjectARB(shaderprogram); - uniformLoc = glGetUniformLocationARB(shaderprogram, "bgl_RenderedTexture"); + glUseProgramObjectARB(m_filters[passindex]); + uniformLoc = glGetUniformLocationARB(m_filters[passindex], "bgl_RenderedTexture"); glActiveTextureARB(GL_TEXTURE0); - //glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, texname); + glBindTexture(GL_TEXTURE_2D, texname[0]); if (uniformLoc != -1) { glUniform1iARB(uniformLoc, 0); } - uniformLoc = glGetUniformLocationARB(shaderprogram, "bgl_TextureCoordinateOffset"); + + /* send depth texture to glsl program if it needs */ + if(texflag[passindex] & 0x1){ + uniformLoc = glGetUniformLocationARB(m_filters[passindex], "bgl_DepthTexture"); + glActiveTextureARB(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D, texname[1]); + + if (uniformLoc != -1) + { + glUniform1iARB(uniformLoc, 1); + } + } + + /* send luminance texture to glsl program if it needs */ + if(texflag[passindex] & 0x1){ + uniformLoc = glGetUniformLocationARB(m_filters[passindex], "bgl_LuminanceTexture"); + glActiveTextureARB(GL_TEXTURE2); + glBindTexture(GL_TEXTURE_2D, texname[2]); + + if (uniformLoc != -1) + { + glUniform1iARB(uniformLoc, 2); + } + } + + uniformLoc = glGetUniformLocationARB(m_filters[passindex], "bgl_TextureCoordinateOffset"); if (uniformLoc != -1) { glUniform2fvARB(uniformLoc, 9, textureoffsets); } - uniformLoc = glGetUniformLocationARB(shaderprogram, "bgl_RenderedTextureWidth"); + uniformLoc = glGetUniformLocationARB(m_filters[passindex], "bgl_RenderedTextureWidth"); if (uniformLoc != -1) { glUniform1fARB(uniformLoc,texturewidth); } - uniformLoc = glGetUniformLocationARB(shaderprogram, "bgl_RenderedTextureHeight"); + uniformLoc = glGetUniformLocationARB(m_filters[passindex], "bgl_RenderedTextureHeight"); if (uniformLoc != -1) { glUniform1fARB(uniformLoc,textureheight); @@ -187,14 +212,33 @@ void RAS_2DFilterManager::EndShaderProgram() void RAS_2DFilterManager::SetupTexture() { - if(texname!=-1) + if(texname[0]!=-1 || texname[1]!=-1) { - glDeleteTextures(1,(const GLuint *)&texname); + glDeleteTextures(2, (GLuint*)texname); } - glGenTextures(1, (GLuint *)&texname); - glBindTexture(GL_TEXTURE_2D, texname); + glGenTextures(3, (GLuint*)texname); + + glBindTexture(GL_TEXTURE_2D, texname[0]); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texturewidth, textureheight, 0, GL_RGB, - GL_UNSIGNED_BYTE, 0); + GL_UNSIGNED_BYTE, 0); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); + + glBindTexture(GL_TEXTURE_2D, texname[1]); + glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT32, texturewidth,textureheight, 0, GL_DEPTH_COMPONENT, + GL_FLOAT,NULL); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, + GL_NONE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); + + glBindTexture(GL_TEXTURE_2D, texname[2]); + glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE16, texturewidth, textureheight, 0, GL_LUMINANCE, + GL_UNSIGNED_BYTE, 0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); @@ -246,12 +290,27 @@ void RAS_2DFilterManager::RenderFilters(RAS_ICanvas* canvas) int passindex; bool first = true; + for(passindex =0; passindex Date: Wed, 2 Jul 2008 00:17:08 +0000 Subject: [PATCH 33/76] Added lower and upper options on all modes of simple deform Fixed existent offset after applying bend. --- .../blender/blenkernel/intern/simple_deform.c | 123 +++++++++++++----- source/blender/src/buttons_editing.c | 11 +- 2 files changed, 90 insertions(+), 44 deletions(-) diff --git a/source/blender/blenkernel/intern/simple_deform.c b/source/blender/blenkernel/intern/simple_deform.c index 5cecb553a65..bdd0b0e206b 100644 --- a/source/blender/blenkernel/intern/simple_deform.c +++ b/source/blender/blenkernel/intern/simple_deform.c @@ -38,77 +38,111 @@ #include - - -static void simpleDeform_tapperXY(const float factor, float *co) +static void axis_limit(int axis, const float limits[2], float *co, float *dcut) { - float x = co[0], y = co[1], z = co[2]; + float val = co[axis]; + if(limits[0] > val) val = limits[0]; + if(limits[1] < val) val = limits[1]; - co[0] = x*(1.0f + z*factor); - co[1] = y*(1.0f + z*factor); - co[2] = z; + dcut[axis] = co[axis] - val; + co[axis] = val; } -static void simpleDeform_tapperX(const float factor, float *co) +static void simpleDeform_tapperXY(const float factor, const float *dcut, float *co) { float x = co[0], y = co[1], z = co[2]; - co[0] = x*(1.0f + z*factor); + float scale = z*factor; + + co[0] = x + x*scale; + co[1] = y + y*scale; + co[2] = z; + + if(dcut) + { + co[0] += dcut[0]*scale; + co[1] += dcut[1]*scale; + co[2] += dcut[2]; + } +} + +static void simpleDeform_tapperX(const float factor, const float *dcut, float *co) +{ + float x = co[0], y = co[1], z = co[2]; + + float scale = z*factor; + + co[0] = x+ x*scale; co[1] = y; co[2] = z; + + if(dcut) + { + co[0] += dcut[0]*scale; + co[1] += dcut[1]; + co[2] += dcut[2]; + } } -static void simpleDeform_twist(const float factor, float *co) +static void simpleDeform_twist(const float factor, const float *dcut, float *co) { float x = co[0], y = co[1], z = co[2]; + float theta, sint, cost; - float theta = z*factor; - float sint = sin(theta); - float cost = cos(theta); + theta = z*factor; + sint = sin(theta); + cost = cos(theta); co[0] = x*cost - y*sint; co[1] = x*sint + y*cost; co[2] = z; + if(dcut) + { + co[0] += dcut[0]; + co[1] += dcut[1]; + co[2] += dcut[2]; + } } -static void simpleDeform_bend(const float factor, const float axis_limit[2], float *co) +static void simpleDeform_bend(const float factor, const float dcut[3], float *co) { float x = co[0], y = co[1], z = co[2]; - - float x0 = 0.0f; - float theta = x*factor, sint, cost; - - if(x > axis_limit[1]) - { - x0 = axis_limit[1] - x; - x = axis_limit[1]; - } - else if(x < axis_limit[0]) - { - x0 = axis_limit[0] - x; - x = axis_limit[0]; - } + float theta, sint, cost; theta = x*factor; sint = sin(theta); cost = cos(theta); - co[0] = -y*sint - cost*x0; - co[1] = y*cost - sint*x0; - co[2] = z; + if(fabs(factor) > 1e-7f) + { + co[0] = -(y-1.0f/factor)*sint; + co[1] = (y-1.0f/factor)*cost + 1.0f/factor; + co[2] = z; + } + + + if(dcut) + { + co[0] += cost*dcut[0]; + co[1] += sint*dcut[0]; + co[2] += dcut[2]; + } + } + /* simple deform modifier */ void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object *ob, float (*vertexCos)[3], int numVerts) { float (*ob2mod)[4] = NULL, (*mod2ob)[4] = NULL; - float tmp[2][4][4]; + float tmp[2][4][4], dcut[3]; if(smd->origin) { //inverse is outdated Mat4Invert(smd->origin->imat, smd->origin->obmat); + Mat4Invert(ob->imat, ob->obmat); ob2mod = tmp[0]; mod2ob = tmp[1]; @@ -122,12 +156,29 @@ void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object *ob, f if(ob2mod) Mat4MulVecfl(ob2mod, *vertexCos); + dcut[0] = dcut[1] = dcut[2] = 0.0f; + switch(smd->mode) { - case MOD_SIMPLEDEFORM_MODE_TWIST: simpleDeform_twist(smd->factor[0], *vertexCos); break; - case MOD_SIMPLEDEFORM_MODE_BEND: simpleDeform_bend(smd->factor[0], smd->factor+1, *vertexCos); break; - case MOD_SIMPLEDEFORM_MODE_TAPER_X: simpleDeform_tapperX (smd->factor[0], *vertexCos); break; - case MOD_SIMPLEDEFORM_MODE_TAPER_XY: simpleDeform_tapperXY(smd->factor[0], *vertexCos); break; + case MOD_SIMPLEDEFORM_MODE_TWIST: + axis_limit(2, smd->factor+1, *vertexCos, dcut); + simpleDeform_twist (smd->factor[0], dcut, *vertexCos); + break; + + case MOD_SIMPLEDEFORM_MODE_BEND: + axis_limit(0, smd->factor+1, *vertexCos, dcut); + simpleDeform_bend (smd->factor[0], dcut, *vertexCos); + break; + + case MOD_SIMPLEDEFORM_MODE_TAPER_X: + axis_limit(2, smd->factor+1, *vertexCos, dcut); + simpleDeform_tapperX (smd->factor[0], dcut, *vertexCos); + break; + + case MOD_SIMPLEDEFORM_MODE_TAPER_XY: + axis_limit(2, smd->factor+1, *vertexCos, dcut); + simpleDeform_tapperXY(smd->factor[0], dcut, *vertexCos); + break; } if(mod2ob) diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 179a094a981..5654ef0bbad 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -1860,9 +1860,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco height += 19*5; } else if (md->type==eModifierType_SimpleDeform) { SimpleDeformModifierData *smd = (SimpleDeformModifierData*) md; - height += 19*3; - if(smd->mode == MOD_SIMPLEDEFORM_MODE_BEND) - height += 19*2; + height += 19*5; } /* roundbox 4 free variables: corner-rounding, nop, roundbox type, shade */ uiDefBut(block, ROUNDBOX, 0, "", x-10, y-height-2, width, height-2, NULL, 5.0, 0.0, 12, 40, ""); @@ -2532,11 +2530,8 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco } uiDefButF(block, NUM, B_MODIFIER_RECALC, "Factor:", lx,(cy-=19),buttonWidth,19, &smd->factor[0], -3000.0f, 3000.0f, 1.0f, 0, "Deform Factor"); - if(smd->mode == MOD_SIMPLEDEFORM_MODE_BEND) - { - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Upper Limit:", lx,(cy-=19),buttonWidth,19, &smd->factor[2], -3000.0f, 3000.0f, 1.0f, 0, "Upper Limit Bend on X"); - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Lower Limit:", lx,(cy-=19),buttonWidth,19, &smd->factor[1], -3000.0f, 3000.0f, 1.0f, 0, "Lower Limit Bend on X"); - } + uiDefButF(block, NUM, B_MODIFIER_RECALC, "Upper Limit:", lx,(cy-=19),buttonWidth,19, &smd->factor[2], -3000.0f, 3000.0f, 1.0f, 0, "Upper Limit Bend on X"); + uiDefButF(block, NUM, B_MODIFIER_RECALC, "Lower Limit:", lx,(cy-=19),buttonWidth,19, &smd->factor[1], -3000.0f, 3000.0f, 1.0f, 0, "Lower Limit Bend on X"); } From ad310b5087ea1605ba235f9ed4cf8292fa4294f7 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Fri, 4 Jul 2008 01:03:50 +0000 Subject: [PATCH 34/76] Added modes Squash and Strech to SimpleDeform (need testing) CHanged the add modifier menu to show a submenu for selecting the type of simpledeform. --- .../blender/blenkernel/intern/simple_deform.c | 50 ++++++++++++ source/blender/makesdna/DNA_modifier_types.h | 2 + source/blender/src/buttons_editing.c | 77 +++++++++++++++---- 3 files changed, 114 insertions(+), 15 deletions(-) diff --git a/source/blender/blenkernel/intern/simple_deform.c b/source/blender/blenkernel/intern/simple_deform.c index bdd0b0e206b..548c53be8ba 100644 --- a/source/blender/blenkernel/intern/simple_deform.c +++ b/source/blender/blenkernel/intern/simple_deform.c @@ -66,6 +66,46 @@ static void simpleDeform_tapperXY(const float factor, const float *dcut, float * } } +/* TODO strech and squash need review on function */ +static void simpleDeform_strech(const float factor, const float dcut[3], float *co) +{ + float x = co[0], y = co[1], z = co[2]; + float scale; + + scale = z*factor; + scale = scale*scale; + + co[0] += x+x*scale; + co[1] += y+y*scale; + + if(dcut) + { + co[0] += dcut[0]*scale; + co[1] += dcut[0]*scale; + co[2] += dcut[2]; + } + +} + +static void simpleDeform_squash(const float factor, const float dcut[3], float *co) +{ + float x = co[0], y = co[1], z = co[2]; + float scale; + + scale = z*factor; + scale = -scale*scale; + + co[0] += x+x*scale; + co[1] += y+y*scale; + + if(dcut) + { + co[0] += dcut[0]*scale; + co[1] += dcut[0]*scale; + co[2] += dcut[2]; + } +} + static void simpleDeform_tapperX(const float factor, const float *dcut, float *co) { float x = co[0], y = co[1], z = co[2]; @@ -179,6 +219,16 @@ void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object *ob, f axis_limit(2, smd->factor+1, *vertexCos, dcut); simpleDeform_tapperXY(smd->factor[0], dcut, *vertexCos); break; + + case MOD_SIMPLEDEFORM_MODE_STRECH: + axis_limit(2, smd->factor+1, *vertexCos, dcut); + simpleDeform_strech(smd->factor[0], dcut, *vertexCos); + break; + + case MOD_SIMPLEDEFORM_MODE_SQUASH: + axis_limit(2, smd->factor+1, *vertexCos, dcut); + simpleDeform_squash(smd->factor[0], dcut, *vertexCos); + break; } if(mod2ob) diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 5ee767efb83..74308579cf1 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -533,5 +533,7 @@ typedef struct SimpleDeformModifierData { #define MOD_SIMPLEDEFORM_MODE_BEND 2 #define MOD_SIMPLEDEFORM_MODE_TAPER_X 3 #define MOD_SIMPLEDEFORM_MODE_TAPER_XY 4 +#define MOD_SIMPLEDEFORM_MODE_STRECH 5 +#define MOD_SIMPLEDEFORM_MODE_SQUASH 6 #endif diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 5654ef0bbad..5985d473a5d 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -938,25 +938,62 @@ void do_modifier_panels(unsigned short event) } } -static void modifiers_add(void *ob_v, int type) +static void object_add_modifier(Object *ob, ModifierData *md) { - Object *ob = ob_v; - ModifierTypeInfo *mti = modifierType_getInfo(type); - + ModifierTypeInfo *mti = modifierType_getInfo(md->type); if (mti->flags&eModifierTypeFlag_RequiresOriginalData) { - ModifierData *md = ob->modifiers.first; + ModifierData *iter = ob->modifiers.first; - while (md && modifierType_getInfo(md->type)->type==eModifierTypeType_OnlyDeform) { - md = md->next; + while (iter && modifierType_getInfo(iter->type)->type==eModifierTypeType_OnlyDeform) { + iter = iter->next; } - BLI_insertlinkbefore(&ob->modifiers, md, modifier_new(type)); + BLI_insertlinkbefore(&ob->modifiers, iter, md); } else { - BLI_addtail(&ob->modifiers, modifier_new(type)); + BLI_addtail(&ob->modifiers, md); } +} + +static void modifiers_add(void *ob_v, int type) +{ + object_add_modifier((Object*) ob_v, modifier_new(type)); BIF_undo_push("Add modifier"); } +static void do_modifiers_select_simpledeform_typemenu(void *ob_v, int event) +{ + static const char *default_name[] = { "", "Twist", "Bend", "Taper X", "Taper XY", "Strech", "Squash" }; + SimpleDeformModifierData *smd = (SimpleDeformModifierData*)modifier_new(eModifierType_SimpleDeform); + smd->mode = event; + + if(smd->mode >= 0 && smd->mode < sizeof(default_name)/sizeof(*default_name)) + strncpy( smd->modifier.name, default_name[ smd->mode ], sizeof(smd->modifier.name)); + + object_add_modifier((Object*) ob_v, (ModifierData*)smd); + BIF_undo_push("Add modifier"); +} + +static uiBlock *modifiers_select_simpledeform_typemenu(void *ob_v) +{ + uiBlock *block; + short yco = 20, menuwidth = 160; + + block= uiNewBlock(&curarea->uiblocks, "modifiers_select_simpledeform_typemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); + uiBlockSetButmFunc(block, do_modifiers_select_simpledeform_typemenu, ob_v); + + uiDefBut(block, BUTM, 1, "Twist", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_TWIST, ""); + uiDefBut(block, BUTM, 1, "Bend", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_BEND, ""); + uiDefBut(block, BUTM, 1, "Tapper X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_TAPER_X, ""); + uiDefBut(block, BUTM, 1, "Tapper XY", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_TAPER_XY, ""); + uiDefBut(block, BUTM, 1, "Strech", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_STRECH, ""); + uiDefBut(block, BUTM, 1, "Squash", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_SQUASH, ""); + + uiBlockSetDirection(block, UI_RIGHT); + uiTextBoundsBlock(block, 50); + return block; +} + + typedef struct MenuEntry { char *name; int ID; @@ -1000,8 +1037,18 @@ static uiBlock *modifiers_add_menu(void *ob_v) for(i = 0; i < numEntries; ++i) - uiDefBut(block, BUTM, B_MODIFIER_RECALC, entries[i].name, - 0, yco -= 20, 160, 19, NULL, 0, 0, 1, entries[i].ID, ""); + { + if(entries[i].ID == eModifierType_SimpleDeform) + { + //TODO: this menu has a left space.. which loooks ugly :S + uiDefIconTextBlockBut(block, modifiers_select_simpledeform_typemenu, ob_v, ICON_RIGHTARROW_THIN, entries[i].name, 0, yco-=20, 160, 19, ""); + } + else + { + uiDefBut(block, BUTM, B_MODIFIER_RECALC, entries[i].name, + 0, yco -= 20, 160, 19, NULL, 0, 0, 1, entries[i].ID, ""); + } + } uiTextBoundsBlock(block, 50); uiBlockSetDirection(block, UI_DOWN); @@ -1859,8 +1906,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco if (smd->shrinkType == MOD_SHRINKWRAP_NORMAL) height += 19*5; } else if (md->type==eModifierType_SimpleDeform) { - SimpleDeformModifierData *smd = (SimpleDeformModifierData*) md; - height += 19*5; + height += 19*4; } /* roundbox 4 free variables: corner-rounding, nop, roundbox type, shade */ uiDefBut(block, ROUNDBOX, 0, "", x-10, y-height-2, width, height-2, NULL, 5.0, 0.0, 12, 40, ""); @@ -2509,10 +2555,11 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco uiBlockEndAlign(block); } else if (md->type==eModifierType_SimpleDeform) { SimpleDeformModifierData *smd = (SimpleDeformModifierData*) md; - char simpledeform_typemenu[]="Deform type%t|Twist %x1|Bend %x2|Taper %x3|TaperXY %x4"; +/* + char simpledeform_typemenu[]="Deform type%t|Twist %x1|Bend %x2|Taper %x3|TaperXY %x4|Strech %x5|Squash %x6"; uiDefButC(block, MENU, B_MODIFIER_RECALC, simpledeform_typemenu, lx,(cy-=19),buttonWidth,19, &smd->mode, 0, 0, 0, 0, "Selects type of deform"); - +*/ uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth-17,19, &smd->origin, "Origin of modifier space coordinates"); From 37a017b18ab2bbc8c0d59a9cccd8c4f1265a59bb Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Fri, 4 Jul 2008 19:56:31 +0000 Subject: [PATCH 35/76] *Added vertex groups on simple deform *Fixed a few UI things *Make SimpleDeform and Shrinkwrap to use vertexgroup_get_vertex_weight, a similar function "static float vert_weight(MDeformVert *dvert, int group)" existed on modifier.c, changed it a bit and moved into BKE_deform.h --- source/blender/blenkernel/BKE_deform.h | 3 + source/blender/blenkernel/BKE_simple_deform.h | 2 +- source/blender/blenkernel/intern/deform.c | 28 +++++++++ source/blender/blenkernel/intern/modifier.c | 38 ++++++------ source/blender/blenkernel/intern/shrinkwrap.c | 20 ++----- .../blender/blenkernel/intern/simple_deform.c | 58 +++++++++++++------ source/blender/makesdna/DNA_modifier_types.h | 2 + source/blender/src/buttons_editing.c | 20 ++++--- 8 files changed, 107 insertions(+), 64 deletions(-) diff --git a/source/blender/blenkernel/BKE_deform.h b/source/blender/blenkernel/BKE_deform.h index a1975dd4265..b0570e8bd45 100644 --- a/source/blender/blenkernel/BKE_deform.h +++ b/source/blender/blenkernel/BKE_deform.h @@ -46,5 +46,8 @@ int get_defgroup_num (struct Object *ob, struct bDeformGroup *dg); int get_named_vertexgroup_num (Object *ob, char *name); void unique_vertexgroup_name (struct bDeformGroup *dg, struct Object *ob); +float deformvert_get_weight(struct MDeformVert *dvert, int group_num); +float vertexgroup_get_vertex_weight(struct MDeformVert *dvert, int index, int group_num); + #endif diff --git a/source/blender/blenkernel/BKE_simple_deform.h b/source/blender/blenkernel/BKE_simple_deform.h index dd4f3786e62..161871a64bc 100644 --- a/source/blender/blenkernel/BKE_simple_deform.h +++ b/source/blender/blenkernel/BKE_simple_deform.h @@ -33,7 +33,7 @@ struct Object; struct DerivedMesh; struct SimpleDeformModifierData; -void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object *ob, float (*vertexCos)[3], int numVerts); +void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object *ob, struct DerivedMesh *dm, float (*vertexCos)[3], int numVerts); #endif diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c index ab53571b62d..888432005d0 100644 --- a/source/blender/blenkernel/intern/deform.c +++ b/source/blender/blenkernel/intern/deform.c @@ -220,3 +220,31 @@ void unique_vertexgroup_name (bDeformGroup *dg, Object *ob) } } } + +float deformvert_get_weight(struct MDeformVert *dvert, int group_num) +{ + if(dvert) + { + MDeformWeight *dw = dvert->dw; + int i; + + for(i=dvert->totweight; i>0; i--, dw++) + if(dw->def_nr == group_num) + return dw->weight; + } + + /* Not found */ + return 0.0; +} + +float vertexgroup_get_vertex_weight(struct MDeformVert *dvert, int index, int group_num) +{ + if(group_num == -1) + return 1.0; + + if(dvert == 0) + return 0.0; + + return deformvert_get_weight(dvert+index, group_num); +} + diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index d3cc451c6fc..6779b18154f 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -3,7 +3,7 @@ * * ***** BEGIN GPL LICENSE BLOCK ***** * -* This program is free software; you can redistribute it and/or +* This program is free software; you can redistribute it and/orw * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. @@ -100,6 +100,7 @@ #include "BKE_utildefines.h" #include "depsgraph_private.h" #include "BKE_bmesh.h" +#include "BKE_deform.h" #include "BKE_shrinkwrap.h" #include "BKE_simple_deform.h" @@ -6088,22 +6089,6 @@ CustomDataMask explodeModifier_requiredDataMask(ModifierData *md) return dataMask; } -/* this should really be put somewhere permanently */ -static float vert_weight(MDeformVert *dvert, int group) -{ - MDeformWeight *dw; - int i; - - if(dvert) { - dw= dvert->dw; - for(i= dvert->totweight; i>0; i--, dw++) { - if(dw->def_nr == group) return dw->weight; - if(i==1) break; /*otherwise dw will point to somewhere it shouldn't*/ - } - } - return 0.0; -} - static void explodeModifier_createFacepa(ExplodeModifierData *emd, ParticleSystemModifierData *psmd, Object *ob, DerivedMesh *dm) @@ -6147,7 +6132,7 @@ static void explodeModifier_createFacepa(ExplodeModifierData *emd, for(i=0; iprotect)*val + emd->protect*0.5f; - if(val < vert_weight(dvert+i,emd->vgroup-1)) + if(val < deformvert_get_weight(dvert+i,emd->vgroup-1)) vertpa[i] = -1; } } @@ -7304,12 +7289,24 @@ static void simpledeformModifier_copyData(ModifierData *md, ModifierData *target static void simpledeformModifier_deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { - SimpleDeformModifier_do((SimpleDeformModifierData*)md, ob, vertexCos, numVerts); + SimpleDeformModifier_do((SimpleDeformModifierData*)md, ob, derivedData, vertexCos, numVerts); } static void simpledeformModifier_deformVertsEM(ModifierData *md, Object *ob, EditMesh *editData, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { - SimpleDeformModifier_do((SimpleDeformModifierData*)md, ob, vertexCos, numVerts); + SimpleDeformModifier_do((SimpleDeformModifierData*)md, ob, derivedData, vertexCos, numVerts); +} + +static CustomDataMask simpledeformModifier_requiredDataMask(ModifierData *md) +{ + SimpleDeformModifierData *smd = (SimpleDeformModifierData *)md; + CustomDataMask dataMask = 0; + + /* ask for vertexgroups if we need them */ + if(smd->vgroup_name[0]) + dataMask |= (1 << CD_MDEFORMVERT); + + return dataMask; } static void simpledeformModifier_foreachObjectLink(ModifierData *md, Object *ob, void (*walk)(void *userData, Object *ob, Object **obpoin), void *userData) @@ -7669,6 +7666,7 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type) | eModifierTypeFlag_EnableInEditmode; mti->initData = simpledeformModifier_initData; mti->copyData = simpledeformModifier_copyData; + mti->requiredDataMask = simpledeformModifier_requiredDataMask; mti->deformVerts = simpledeformModifier_deformVerts; mti->deformVertsEM = simpledeformModifier_deformVertsEM; mti->foreachObjectLink = simpledeformModifier_foreachObjectLink; diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 4ae2ad8f4a9..4409594f1e2 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -96,18 +96,6 @@ static void normal_short2float(const short *ns, float *nf) nf[2] = ns[2] / 32767.0f; } -static float vertexgroup_get_weight(MDeformVert *dvert, int index, int vgroup) -{ - if(dvert && vgroup >= 0) - { - int j; - for(j = 0; j < dvert[index].totweight; j++) - if(dvert[index].dw[j].def_nr == vgroup) - return dvert[index].dw[j].weight; - } - return 1.0; -} - /* * BVH tree from mesh vertices */ @@ -722,7 +710,7 @@ static void shrinkwrap_calc_foreach_vertex(ShrinkwrapCalcData *calc, Shrinkwrap_ //Shrink (calculate each vertex final position) for(i = 0; ilocal2target, vert[i].co); @@ -1157,7 +1145,7 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) for(i=0; ilocal2target, vert[i].co); diff --git a/source/blender/blenkernel/intern/simple_deform.c b/source/blender/blenkernel/intern/simple_deform.c index 548c53be8ba..0c58543a58d 100644 --- a/source/blender/blenkernel/intern/simple_deform.c +++ b/source/blender/blenkernel/intern/simple_deform.c @@ -32,6 +32,8 @@ #include "BKE_simple_deform.h" #include "BKE_DerivedMesh.h" +#include "BKE_deform.h" +#include "BKE_utildefines.h" #include "BLI_arithb.h" #include @@ -173,66 +175,84 @@ static void simpleDeform_bend(const float factor, const float dcut[3], float *co /* simple deform modifier */ -void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object *ob, float (*vertexCos)[3], int numVerts) +void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object *ob, struct DerivedMesh *dm, float (*vertexCos)[3], int numVerts) { + int i; float (*ob2mod)[4] = NULL, (*mod2ob)[4] = NULL; - float tmp[2][4][4], dcut[3]; + float tmp_matrix[2][4][4]; + int vgroup = get_named_vertexgroup_num(ob, smd->vgroup_name); + + MDeformVert *dvert = NULL; + + //Calculate matrixs do convert between coordinate spaces if(smd->origin) { //inverse is outdated Mat4Invert(smd->origin->imat, smd->origin->obmat); Mat4Invert(ob->imat, ob->obmat); - ob2mod = tmp[0]; - mod2ob = tmp[1]; + ob2mod = tmp_matrix[0]; + mod2ob = tmp_matrix[1]; Mat4MulSerie(ob2mod, smd->origin->imat, ob->obmat, 0, 0, 0, 0, 0, 0); Mat4Invert(mod2ob, ob2mod); } - for(; numVerts; numVerts--, vertexCos++) + if(dm) + dvert = dm->getVertDataArray(dm, CD_MDEFORMVERT); + + for(i=0; imode) { case MOD_SIMPLEDEFORM_MODE_TWIST: - axis_limit(2, smd->factor+1, *vertexCos, dcut); - simpleDeform_twist (smd->factor[0], dcut, *vertexCos); + axis_limit(2, smd->factor+1, co, dcut); + simpleDeform_twist (smd->factor[0], dcut, co); break; case MOD_SIMPLEDEFORM_MODE_BEND: - axis_limit(0, smd->factor+1, *vertexCos, dcut); - simpleDeform_bend (smd->factor[0], dcut, *vertexCos); + axis_limit(0, smd->factor+1, co, dcut); + simpleDeform_bend (smd->factor[0], dcut, co); break; case MOD_SIMPLEDEFORM_MODE_TAPER_X: - axis_limit(2, smd->factor+1, *vertexCos, dcut); - simpleDeform_tapperX (smd->factor[0], dcut, *vertexCos); + axis_limit(2, smd->factor+1, co, dcut); + simpleDeform_tapperX (smd->factor[0], dcut, co); break; case MOD_SIMPLEDEFORM_MODE_TAPER_XY: - axis_limit(2, smd->factor+1, *vertexCos, dcut); - simpleDeform_tapperXY(smd->factor[0], dcut, *vertexCos); + axis_limit(2, smd->factor+1, co, dcut); + simpleDeform_tapperXY(smd->factor[0], dcut, co); break; case MOD_SIMPLEDEFORM_MODE_STRECH: - axis_limit(2, smd->factor+1, *vertexCos, dcut); - simpleDeform_strech(smd->factor[0], dcut, *vertexCos); + axis_limit(2, smd->factor+1, co, dcut); + simpleDeform_strech(smd->factor[0], dcut, co); break; case MOD_SIMPLEDEFORM_MODE_SQUASH: - axis_limit(2, smd->factor+1, *vertexCos, dcut); - simpleDeform_squash(smd->factor[0], dcut, *vertexCos); + axis_limit(2, smd->factor+1, co, dcut); + simpleDeform_squash(smd->factor[0], dcut, co); break; } + //linear interpolation + VecLerpf(vertexCos[i], vertexCos[i], co, weight); + if(mod2ob) - Mat4MulVecfl(mod2ob, *vertexCos); + Mat4MulVecfl(mod2ob, vertexCos[i]); } } diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 74308579cf1..9e1a6ede9f9 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -523,7 +523,9 @@ typedef struct SimpleDeformModifierData { ModifierData modifier; struct Object *origin; /* object to control the origin of modifier space coordinates */ + char vgroup_name[32]; /* optional vertexgroup name */ float factor[4]; /* factors to control simple deforms */ + char mode; char pad[7]; diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 5985d473a5d..36ab0961150 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -971,22 +971,23 @@ static void do_modifiers_select_simpledeform_typemenu(void *ob_v, int event) object_add_modifier((Object*) ob_v, (ModifierData*)smd); BIF_undo_push("Add modifier"); + do_modifier_panels(B_MODIFIER_RECALC); } static uiBlock *modifiers_select_simpledeform_typemenu(void *ob_v) { uiBlock *block; - short yco = 20, menuwidth = 160; + short yco = 20, menuwidth = 120; block= uiNewBlock(&curarea->uiblocks, "modifiers_select_simpledeform_typemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); uiBlockSetButmFunc(block, do_modifiers_select_simpledeform_typemenu, ob_v); - uiDefBut(block, BUTM, 1, "Twist", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_TWIST, ""); - uiDefBut(block, BUTM, 1, "Bend", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_BEND, ""); - uiDefBut(block, BUTM, 1, "Tapper X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_TAPER_X, ""); - uiDefBut(block, BUTM, 1, "Tapper XY", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_TAPER_XY, ""); - uiDefBut(block, BUTM, 1, "Strech", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_STRECH, ""); - uiDefBut(block, BUTM, 1, "Squash", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_SQUASH, ""); + uiDefBut(block, BUTM, B_MODIFIER_RECALC, "Twist", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_TWIST, ""); + uiDefBut(block, BUTM, B_MODIFIER_RECALC, "Bend", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_BEND, ""); + uiDefBut(block, BUTM, B_MODIFIER_RECALC, "Tapper X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_TAPER_X, ""); + uiDefBut(block, BUTM, B_MODIFIER_RECALC, "Tapper XY", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_TAPER_XY, ""); + uiDefBut(block, BUTM, B_MODIFIER_RECALC, "Strech", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_STRECH, ""); + uiDefBut(block, BUTM, B_MODIFIER_RECALC, "Squash", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_SQUASH, ""); uiBlockSetDirection(block, UI_RIGHT); uiTextBoundsBlock(block, 50); @@ -1906,7 +1907,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco if (smd->shrinkType == MOD_SHRINKWRAP_NORMAL) height += 19*5; } else if (md->type==eModifierType_SimpleDeform) { - height += 19*4; + height += 19*5; } /* roundbox 4 free variables: corner-rounding, nop, roundbox type, shade */ uiDefBut(block, ROUNDBOX, 0, "", x-10, y-height-2, width, height-2, NULL, 5.0, 0.0, 12, 40, ""); @@ -2561,6 +2562,9 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco uiDefButC(block, MENU, B_MODIFIER_RECALC, simpledeform_typemenu, lx,(cy-=19),buttonWidth,19, &smd->mode, 0, 0, 0, 0, "Selects type of deform"); */ + but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &smd->vgroup_name, 0, 31, 0, 0, "Vertex Group name"); + uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob); + uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth-17,19, &smd->origin, "Origin of modifier space coordinates"); if(smd->origin) From d674041f2b7623985bcae26df04ac678d25f355b Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Wed, 9 Jul 2008 19:43:09 +0000 Subject: [PATCH 36/76] Add raycast ability for BLI_kdopbvh small bvh fixes: *allow to create any tree type >= 2 *save split axis changed shrinkwrap to perform normal cast with raytree and bvh tree and print both times: Shrinkwrap (OBCube)24578 over (OBSuzanne)504482 target = raytree_create_from_mesh(calc->target): 1260.000000ms shrinkwrap_calc_normal_projection_raytree(&calc): 1850.000000ms tree = bvhtree_from_mesh_tri(calc->target): 3330.000000ms shrinkwrap_calc_normal_projection(&calc): 3780.000000ms On general query time is bit smaller on bvh tree.. but the build time of bvh is pretty big. (build time can be removed from both if a cache system is added) But I am still trying to see how fast I can make the bvh build --- source/blender/blenkernel/intern/shrinkwrap.c | 229 ++++++++++++++++-- source/blender/blenlib/BLI_kdopbvh.h | 18 ++ source/blender/blenlib/intern/BLI_kdopbvh.c | 164 ++++++++++++- 3 files changed, 387 insertions(+), 24 deletions(-) diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 4409594f1e2..ee3bf993edb 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -59,7 +59,7 @@ #define OUT_OF_MEMORY() ((void)printf("Shrinkwrap: Out of memory\n")) /* Benchmark macros */ -#if 0 +#if 1 #define BENCH(a) \ do { \ @@ -88,14 +88,108 @@ typedef void ( *Shrinkwrap_ForeachVertexCallback) (DerivedMesh *target, float *co, float *normal); static float nearest_point_in_tri_surface(const float *point, const float *v0, const float *v1, const float *v2, float *nearest); +static float ray_intersect_plane(const float *point, const float *dir, const float *plane_point, const float *plane_normal); -static void normal_short2float(const short *ns, float *nf) + +/* ray - triangle */ + +#define ISECT_EPSILON 1e-6 +float ray_tri_intersection(const BVHTreeRay *ray, const float m_dist, const float *v0, const float *v1, const float *v2) { - nf[0] = ns[0] / 32767.0f; - nf[1] = ns[1] / 32767.0f; - nf[2] = ns[2] / 32767.0f; + float dist; + if(RayIntersectsTriangle(ray->origin, ray->direction, v0, v1, v2, &dist, NULL)) + return dist; + +/* + float pnormal[3]; + float dist; + + CalcNormFloat(v0, v1, v2, pnormal); + dist = ray_intersect_plane(ray->origin, ray->direction, v0, pnormal); + + if(dist > 0 && dist < m_dist) + { + float tmp[3], nearest[3]; + VECADDFAC(tmp, ray->origin, ray->direction, dist); + + if(fabs(nearest_point_in_tri_surface(tmp, v0, v1, v2, nearest)) < 0.0001) + return dist; + } +*/ + +/* + float x0,x1,x2,t00,t01,t02,t10,t11,t12,r0,r1,r2; + float m0, m1, m2, divdet, det1; + float u,v; + float cros0, cros1, cros2; + float labda; + + float t0[3], t1[3]; + + VECSUB(t0, v2, v0); + VECSUB(t1, v2, v1); + + Crossf(x, t1, ray->direction); + + divdet = INPR( t0, x ); + + VECSUB( m, ray->origin, v2 ); + det1 = INPR(m, x); + + Crossf(cros, m, t0); + + if(divdet == 0.0) + return FLT_MAX; + + + +/ * + t00= co3[0]-co1[0]; + t01= co3[1]-co1[1]; + t02= co3[2]-co1[2]; + t10= co3[0]-co2[0]; + t11= co3[1]-co2[1]; + t12= co3[2]-co2[2]; + + r0= ray->direction[0]; + r1= ray->direction[1]; + r2= ray->direction[2]; + + x0= t12*r1-t11*r2; + x1= t10*r2-t12*r0; + x2= t11*r0-t10*r1; + + divdet= t00*x0+t01*x1+t02*x2; + + m0= ray->origin[0]-co3[0]; + m1= ray->origin[0]-co3[1]; + m2= ray->origin[0]-co3[2]; + det1= m0*x0+m1*x1+m2*x2; + + cros0= m1*t02-m2*t01; + cros1= m2*t00-m0*t02; + cros2= m0*t01-m1*t00; + + + if(divdet==0.0f) + return FLT_MAX; + + divdet= 1.0f/divdet; + u= det1*divdet; + v= divdet*(cros0*r0 + cros1*r1 + cros2*r2); + + labda= divdet*(cros0*t10 + cros1*t11 + cros2*t12); + + if(u-(1.0f+ISECT_EPSILON) + && v -(1.0f+ISECT_EPSILON)) + { + return labda; + } +*/ + return FLT_MAX; } + /* * BVH tree from mesh vertices */ @@ -168,6 +262,44 @@ static float mesh_tri_nearest_point(void *userdata, int index, const float *co, return nearest_point_in_tri_surface(co, vert[ face->v1 ].co, vert[ face->v2 ].co, vert[ face->v3 ].co, nearest); } +static float mesh_tri_spherecast(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) +{ + DerivedMesh *mesh = (DerivedMesh*)(userdata); + MVert *vert = (MVert*)mesh->getVertDataArray(mesh, CD_MVERT); + MFace *face = (MFace*)mesh->getFaceDataArray(mesh, CD_MFACE) + index/2; + + const float *t0, *t1, *t2; + float dist; + + if(index & 1) + t0 = &vert[ face->v1 ].co, t1 = &vert[ face->v3 ].co, t2 = &vert[ face->v4 ].co; + else + t0 = &vert[ face->v1 ].co, t1 = &vert[ face->v2 ].co, t2 = &vert[ face->v3 ].co; + + + dist = ray_tri_intersection(ray, hit->dist, t0, t1, t2); + if(dist < hit->dist) + { + hit->index = index; + hit->dist = fabs(dist); + VECADDFAC(hit->co, ray->origin, ray->direction, hit->dist); + } + + + +/* + VECADDFAC(v0, ray->origin, ray->direction, 0); + VECADDFAC(v1, ray->origin, ray->direction, hit->dist); + + if(SweepingSphereIntersectsTriangleUV(v0, v1, 0.1f, t0, t1, t2, &lambda, hit_point)) + { + hit->index = index; + hit->dist *= lambda; + VECADDFAC(hit->co, ray->origin, ray->direction, hit->dist); + } +*/ + +} /* * Raytree from mesh */ @@ -724,7 +856,7 @@ static void shrinkwrap_calc_foreach_vertex(ShrinkwrapCalcData *calc, Shrinkwrap_ //We also need to apply the rotation to normal if(calc->smd->shrinkType == MOD_SHRINKWRAP_NORMAL) { - normal_short2float(vert[i].no, normal); + NormalShortToFloat(normal, vert[i].no); Mat4Mul3Vecfl(calc->local2target, normal); Normalize(normal); //Watch out for scaling (TODO: do we really needed a unit-len normal?) } @@ -991,12 +1123,12 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri //Projecting target defined - lets work! if(calc.target) { -/* + printf("Shrinkwrap (%s)%d over (%s)%d\n", calc.ob->id.name, calc.final->getNumVerts(calc.final), calc.smd->target->id.name, calc.target->getNumVerts(calc.target) ); -*/ + switch(smd->shrinkType) { @@ -1010,6 +1142,10 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri if(calc.smd->shrinkOpts & MOD_SHRINKWRAP_REMOVE_UNPROJECTED_FACES) calc.moved = bitset_new( calc.final->getNumVerts(calc.final), "shrinkwrap bitset data"); + BENCH(shrinkwrap_calc_normal_projection_raytree(&calc)); + calc.final->release( calc.final ); + + calc.final = CDDM_copy(calc.original); BENCH(shrinkwrap_calc_normal_projection(&calc)); // BENCH(shrinkwrap_calc_foreach_vertex(&calc, bruteforce_shrinkwrap_calc_normal_projection)); @@ -1116,7 +1252,7 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) * it builds a RayTree from the target mesh and then performs a * raycast for each vertex (ray direction = normal) */ -void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) +void shrinkwrap_calc_normal_projection_raytree(ShrinkwrapCalcData *calc) { int i; int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); @@ -1132,7 +1268,7 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) return; //Nothing todo //setup raytracing - target = raytree_create_from_mesh(calc->target); + BENCH(target = raytree_create_from_mesh(calc->target)); if(target == NULL) return OUT_OF_MEMORY(); @@ -1152,7 +1288,7 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) //Transform coordinates local->target VecMat4MulVecfl(tmp_co, calc->local2target, vert[i].co); - normal_short2float(vert[i].no, tmp_no); + NormalShortToFloat(tmp_no, vert[i].no); Mat4Mul3Vecfl(calc->local2target, tmp_no); //Watch out for scaling on normal Normalize(tmp_no); //(TODO: do we really needed a unit-len normal? and we could know the scale factor before hand?) @@ -1167,10 +1303,6 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) dist = FLT_MAX; } - normal_short2float(vert[i].no, tmp_no); - Mat4Mul3Vecfl(calc->local2target, tmp_no); //Watch out for scaling on normal - Normalize(tmp_no); //(TODO: do we really needed a unit-len normal? and we could know the scale factor before hand?) - if(use_normal & MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL) { float inv[3]; // = {-tmp_no[0], -tmp_no[1], -tmp_no[2]}; @@ -1211,6 +1343,73 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) free_raytree_from_mesh(target); } +void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) +{ + int i; + int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); + char use_normal = calc->smd->shrinkOpts; + + //setup raytracing + BVHTree *tree = NULL; + BVHTreeRayHit hit; + + int numVerts; + MVert *vert = NULL; + MDeformVert *dvert = NULL; + + if( (use_normal & (MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL | MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL)) == 0) + return; //Nothing todo + + BENCH(tree = bvhtree_from_mesh_tri(calc->target)); + if(tree == NULL) return OUT_OF_MEMORY(); + + + //Project each vertex along normal + numVerts= calc->final->getNumVerts(calc->final); + vert = calc->final->getVertDataArray(calc->final, CD_MVERT); + dvert = calc->final->getVertDataArray(calc->final, CD_MDEFORMVERT); + + for(i=0; itarget + VecMat4MulVecfl(tmp_co, calc->local2target, vert[i].co); + + NormalShortToFloat(tmp_no, vert[i].no); + Mat4Mul3Vecfl(calc->local2target, tmp_no); //Watch out for scaling on normal + Normalize(tmp_no); //(TODO: do we really needed a unit-len normal? and we could know the scale factor before hand?) + + hit.index = -1; + hit.dist = 1000; + + if(use_normal & MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL) + { + BLI_bvhtree_ray_cast(tree, tmp_co, tmp_no, &hit, mesh_tri_spherecast, calc->target); + } + + if(use_normal & MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL) + { + float inv[3] = { -tmp_no[0], -tmp_no[1], -tmp_no[2] }; + BLI_bvhtree_ray_cast(tree, tmp_co, inv, &hit, mesh_tri_spherecast, calc->target); + } + + if(hit.index != -1) + { + VecMat4MulVecfl(tmp_co, calc->target2local, hit.co); + VecLerpf(vert[i].co, vert[i].co, tmp_co, weight); //linear interpolation + + if(calc->moved) + bitset_set(calc->moved, i); + } + } + + BLI_bvhtree_free(tree); +} + /* * Shrinkwrap moving vertexs to the nearest surface point on the target * diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h index 41ff97d111d..1e56faaff55 100644 --- a/source/blender/blenlib/BLI_kdopbvh.h +++ b/source/blender/blenlib/BLI_kdopbvh.h @@ -47,9 +47,25 @@ typedef struct BVHTreeNearest float dist; /* squared distance to search arround */ } BVHTreeNearest; +typedef struct BVHTreeRay +{ + float origin[3]; /* ray origin */ + float direction[3]; /* ray direction */ +} BVHTreeRay; + +typedef struct BVHTreeRayHit +{ + int index; /* index of the tree node (untouched if no hit is found) */ + float co[3]; /* coordinates of the hit point */ + float dist; /* distance to the hit point */ +} BVHTreeRayHit; + /* returns square of the minimum distance from given co to the node, nearest point is stored on nearest */ typedef float (*BVHTree_NearestPointCallback) (void *userdata, int index, const float *co, float *nearest); +/* returns the ray distancence from given co to the node, nearest point is stored on nearest */ +typedef float (*BVHTree_RayCastCallback) (void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit); + BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis); void BLI_bvhtree_free(BVHTree *tree); @@ -70,5 +86,7 @@ float BLI_bvhtree_getepsilon(BVHTree *tree); /* find nearest node to the given coordinates (if nearest is given it will only search nodes where square distance is smaller than nearest->dist) */ int BLI_bvhtree_find_nearest(BVHTree *tree, float *co, BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata); +int BLI_bvhtree_ray_cast(BVHTree *tree, float *co, float *dir, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata); + #endif // BLI_KDOPBVH_H diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index e69332be295..e7b5ccd4d54 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -82,8 +82,23 @@ typedef struct BVHNearestData void *userdata; float proj[13]; //coordinates projection over axis BVHTreeNearest nearest; + } BVHNearestData; -//////////////////////////////////////// + +typedef struct BVHRayCastData +{ + BVHTree *tree; + + BVHTree_RayCastCallback callback; + void *userdata; + + + BVHTreeRay ray; + float ray_dot_axis[13]; + + BVHTreeRayHit hit; +} BVHRayCastData; +////////////////////////////////////////m //////////////////////////////////////////////////////////////////////// @@ -284,8 +299,8 @@ BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis) BVHTree *tree; int numbranches=0, i; - // only support up to octree - if(tree_type > 8) + // theres not support for trees below binary-trees :P + if(tree_type < 2) return NULL; tree = (BVHTree *)MEM_callocN(sizeof(BVHTree), "BVHTree"); @@ -415,6 +430,7 @@ static void refit_kdop_hull(BVHTree *tree, BVHNode *node, int start, int end) float newmin,newmax; int i, j; float *bv = node->bv; + for (i = tree->start_axis; i < tree->stop_axis; i++) { @@ -436,6 +452,7 @@ static void refit_kdop_hull(BVHTree *tree, BVHNode *node, int start, int end) bv[(2 * i) + 1] = newmax; } } + } int BLI_bvhtree_insert(BVHTree *tree, int index, float *co, int numpoints) @@ -503,6 +520,7 @@ static void bvh_div_nodes(BVHTree *tree, BVHNode *node, int start, int end, char // Determine which axis to split along laxis = get_largest_axis(node->bv); + node->main_axis = laxis/2; // split nodes along longest axis for (i=0; start < end; start += slice, i++) //i counts the current child @@ -582,6 +600,7 @@ static void verify_tree(BVHTree *tree) void BLI_bvhtree_balance(BVHTree *tree) { + int i; BVHNode *node; if(tree->totleaf == 0) @@ -823,7 +842,10 @@ float BLI_bvhtree_getepsilon(BVHTree *tree) } -//Nearest neighbour + +/* + * Nearest neighbour + */ static float squared_dist(const float *a, const float *b) { float tmp[3]; @@ -891,12 +913,9 @@ static void dfs_find_nearest(BVHNearestData *data, BVHNode *node) } else { - if(sdist < data->nearest.dist) + for(i=0; i != node->totnode; i++) { - for(i=0; i != node->totnode; i++) - { - dfs_find_nearest(data, node->children[i]); - } + dfs_find_nearest(data, node->children[i]); } } } @@ -941,3 +960,130 @@ int BLI_bvhtree_find_nearest(BVHTree *tree, float *co, BVHTreeNearest *nearest, return data.nearest.index; } + + +/* + * Ray cast + */ + +static float ray_nearest_hit(BVHRayCastData *data, BVHNode *node) +{ + int i; + const float *bv = node->bv; + + float low = 0, upper = data->hit.dist; + + for(i=0; i != 3; i++, bv += 2) + { + if(data->ray_dot_axis[i] == 0.0f) + { + //axis aligned ray + if(data->ray.origin[i] < bv[0] + || data->ray.origin[i] > bv[1]) + return FLT_MAX; + } + else + { + float ll = (bv[0] - data->ray.origin[i]) / data->ray_dot_axis[i]; + float lu = (bv[1] - data->ray.origin[i]) / data->ray_dot_axis[i]; + + if(data->ray_dot_axis[i] > 0) + { + if(ll > low) low = ll; + if(lu < upper) upper = lu; + } + else + { + if(lu > low) low = lu; + if(ll < upper) upper = ll; + } + + if(low > upper) return FLT_MAX; + } + } + return low; +} + +static void dfs_raycast(BVHRayCastData *data, BVHNode *node) +{ + int i; + float dist; + + dist = ray_nearest_hit(data, node); + + if(dist >= data->hit.dist) return; + + if(node->totnode == 0) + { + if(data->callback) + dist = data->callback(data->userdata, node->index, &data->ray, &data->hit); + else + { + data->hit.index = node->index; + data->hit.dist = dist; + VECADDFAC(data->hit.co, data->ray.origin, data->ray.direction, dist); + } + } + else + { + //pick loop direction to dive into the tree (based on ray direction and split axis) + if(data->ray_dot_axis[ node->main_axis ] > 0) + { + for(i=0; i != node->totnode; i++) + { + dfs_raycast(data, node->children[i]); + } + } + else + { + for(i=node->totnode-1; i >= 0; i--) + { + dfs_raycast(data, node->children[i]); + } + } + } +} + + + +int BLI_bvhtree_ray_cast(BVHTree *tree, float *co, float *dir, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata) +{ + int i; + BVHRayCastData data; + + data.tree = tree; + + data.callback = callback; + data.userdata = userdata; + + VECCOPY(data.ray.origin, co); + VECCOPY(data.ray.direction, dir); + + Normalize(data.ray.direction); + + for(i=0; i<3; i++) + { + data.ray_dot_axis[i] = INPR( data.ray.direction, KDOP_AXES[i]); + + if(fabs(data.ray_dot_axis[i]) < 1e-7) + data.ray_dot_axis[i] = 0.0; + } + + + if(hit) + memcpy( &data.hit, hit, sizeof(*hit) ); + else + { + data.hit.index = -1; + data.hit.dist = FLT_MAX; + } + + dfs_raycast(&data, tree->nodes[tree->totleaf]); + + + if(hit) + memcpy( hit, &data.hit, sizeof(*hit) ); + + return data.hit.index; +} + From 21d032e919522a199ea8343b70925d1257aa8479 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Fri, 11 Jul 2008 19:46:35 +0000 Subject: [PATCH 37/76] Added sphere cast (tought it doenst seems to solve the intersection problem) Fixed SweepingSphereIntersectsTriangleUV --- source/blender/blenkernel/intern/shrinkwrap.c | 236 ++++++++-------- source/blender/blenlib/intern/arithb.c | 254 +++++++++--------- 2 files changed, 236 insertions(+), 254 deletions(-) diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index ee3bf993edb..4c01e5fb84a 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -92,100 +92,35 @@ static float ray_intersect_plane(const float *point, const float *dir, const flo /* ray - triangle */ - #define ISECT_EPSILON 1e-6 -float ray_tri_intersection(const BVHTreeRay *ray, const float m_dist, const float *v0, const float *v1, const float *v2) +static float ray_tri_intersection(const BVHTreeRay *ray, const float m_dist, const float *v0, const float *v1, const float *v2) { float dist; + if(RayIntersectsTriangle(ray->origin, ray->direction, v0, v1, v2, &dist, NULL)) return dist; -/* - float pnormal[3]; - float dist; + return FLT_MAX; +} - CalcNormFloat(v0, v1, v2, pnormal); - dist = ray_intersect_plane(ray->origin, ray->direction, v0, pnormal); +static float sphereray_tri_intersection(const BVHTreeRay *ray, float radius, const float m_dist, const float *v0, const float *v1, const float *v2) +{ + + float dist, idist; + float p0[3], p1[3]; + float plane_normal[3], hit_point[3]; - if(dist > 0 && dist < m_dist) + CalcNormFloat((float*)v0, (float*)v1, (float*)v2, plane_normal); + + dist = ray_intersect_plane(ray->origin, ray->direction, v0, plane_normal); + + VECADDFAC( p0, ray->origin, ray->direction, /*dist-radius*/ 0); + VECADDFAC( p1, ray->origin, ray->direction, m_dist); + if(SweepingSphereIntersectsTriangleUV(p0, p1, radius, v0, v1, v2, &idist, &hit_point)) { - float tmp[3], nearest[3]; - VECADDFAC(tmp, ray->origin, ray->direction, dist); - - if(fabs(nearest_point_in_tri_surface(tmp, v0, v1, v2, nearest)) < 0.0001) - return dist; + return idist * m_dist; } -*/ -/* - float x0,x1,x2,t00,t01,t02,t10,t11,t12,r0,r1,r2; - float m0, m1, m2, divdet, det1; - float u,v; - float cros0, cros1, cros2; - float labda; - - float t0[3], t1[3]; - - VECSUB(t0, v2, v0); - VECSUB(t1, v2, v1); - - Crossf(x, t1, ray->direction); - - divdet = INPR( t0, x ); - - VECSUB( m, ray->origin, v2 ); - det1 = INPR(m, x); - - Crossf(cros, m, t0); - - if(divdet == 0.0) - return FLT_MAX; - - - -/ * - t00= co3[0]-co1[0]; - t01= co3[1]-co1[1]; - t02= co3[2]-co1[2]; - t10= co3[0]-co2[0]; - t11= co3[1]-co2[1]; - t12= co3[2]-co2[2]; - - r0= ray->direction[0]; - r1= ray->direction[1]; - r2= ray->direction[2]; - - x0= t12*r1-t11*r2; - x1= t10*r2-t12*r0; - x2= t11*r0-t10*r1; - - divdet= t00*x0+t01*x1+t02*x2; - - m0= ray->origin[0]-co3[0]; - m1= ray->origin[0]-co3[1]; - m2= ray->origin[0]-co3[2]; - det1= m0*x0+m1*x1+m2*x2; - - cros0= m1*t02-m2*t01; - cros1= m2*t00-m0*t02; - cros2= m0*t01-m1*t00; - - - if(divdet==0.0f) - return FLT_MAX; - - divdet= 1.0f/divdet; - u= det1*divdet; - v= divdet*(cros0*r0 + cros1*r1 + cros2*r2); - - labda= divdet*(cros0*t10 + cros1*t11 + cros2*t12); - - if(u-(1.0f+ISECT_EPSILON) - && v -(1.0f+ISECT_EPSILON)) - { - return labda; - } -*/ return FLT_MAX; } @@ -193,7 +128,28 @@ float ray_tri_intersection(const BVHTreeRay *ray, const float m_dist, const floa /* * BVH tree from mesh vertices */ -static BVHTree* bvhtree_from_mesh_verts(DerivedMesh *mesh) +typedef struct BVHMeshCallbackUserdata +{ + //Mesh represented on this BVH + DerivedMesh *mesh; + MVert *vert; + MFace *face; + + //radius for sphere cast + float sphere_radius; + +} BVHMeshCallbackUserdata; + + +static void bvhtree_meshcallbackdata_init(BVHMeshCallbackUserdata *data, DerivedMesh *mesh, float cast_radius) +{ + data->mesh = mesh; + data->vert = mesh->getVertDataArray(mesh, CD_MVERT); + data->face = mesh->getFaceDataArray(mesh, CD_MFACE); + data->sphere_radius = cast_radius; +} + +static BVHTree* bvhtree_from_mesh_verts(DerivedMesh *mesh, float epsilon) { int i; int numVerts= mesh->getNumVerts(mesh); @@ -211,7 +167,7 @@ static BVHTree* bvhtree_from_mesh_verts(DerivedMesh *mesh) return tree; } -static BVHTree* bvhtree_from_mesh_tri(DerivedMesh *mesh) +static BVHTree* bvhtree_from_mesh_tri(DerivedMesh *mesh, float epsilon) { int i; int numFaces= mesh->getNumFaces(mesh), totFaces; @@ -224,7 +180,7 @@ static BVHTree* bvhtree_from_mesh_tri(DerivedMesh *mesh) if(face[i].v4) totFaces++; /* Create a bvh-tree of the given target */ - tree = BLI_bvhtree_new(totFaces, 0, 2, 6); + tree = BLI_bvhtree_new(totFaces, epsilon, 2, 6); if(tree != NULL) { for(i = 0; i < numFaces; i++) @@ -250,11 +206,12 @@ static BVHTree* bvhtree_from_mesh_tri(DerivedMesh *mesh) return tree; } + static float mesh_tri_nearest_point(void *userdata, int index, const float *co, float *nearest) { - DerivedMesh *mesh = (DerivedMesh*)(userdata); - MVert *vert = (MVert*)mesh->getVertDataArray(mesh, CD_MVERT); - MFace *face = (MFace*)mesh->getFaceDataArray(mesh, CD_MFACE) + index/2; + const BVHMeshCallbackUserdata *data = (BVHMeshCallbackUserdata*) userdata; + MVert *vert = data->vert; + MFace *face = data->face + index / 2; if(index & 1) return nearest_point_in_tri_surface(co, vert[ face->v1 ].co, vert[ face->v3 ].co, vert[ face->v4 ].co, nearest); @@ -262,11 +219,13 @@ static float mesh_tri_nearest_point(void *userdata, int index, const float *co, return nearest_point_in_tri_surface(co, vert[ face->v1 ].co, vert[ face->v2 ].co, vert[ face->v3 ].co, nearest); } + + static float mesh_tri_spherecast(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) { - DerivedMesh *mesh = (DerivedMesh*)(userdata); - MVert *vert = (MVert*)mesh->getVertDataArray(mesh, CD_MVERT); - MFace *face = (MFace*)mesh->getFaceDataArray(mesh, CD_MFACE) + index/2; + const BVHMeshCallbackUserdata *data = (BVHMeshCallbackUserdata*) userdata; + MVert *vert = data->vert; + MFace *face = data->face + index / 2; const float *t0, *t1, *t2; float dist; @@ -276,29 +235,38 @@ static float mesh_tri_spherecast(void *userdata, int index, const BVHTreeRay *ra else t0 = &vert[ face->v1 ].co, t1 = &vert[ face->v2 ].co, t2 = &vert[ face->v3 ].co; + dist = sphereray_tri_intersection(ray, data->sphere_radius, hit->dist, t0, t1, t2); + if(dist >= 0 && dist < hit->dist) + { + hit->index = index; + hit->dist = dist; + VECADDFAC(hit->co, ray->origin, ray->direction, dist); + } + return dist; +} + +static float mesh_tri_raycast(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) +{ + const BVHMeshCallbackUserdata *data = (BVHMeshCallbackUserdata*) userdata; + MVert *vert = data->vert; + MFace *face = data->face + index/2; + + const float *t0, *t1, *t2; + float dist; + + if(index & 1) + t0 = &vert[ face->v1 ].co, t1 = &vert[ face->v3 ].co, t2 = &vert[ face->v4 ].co; + else + t0 = &vert[ face->v1 ].co, t1 = &vert[ face->v2 ].co, t2 = &vert[ face->v3 ].co; dist = ray_tri_intersection(ray, hit->dist, t0, t1, t2); - if(dist < hit->dist) + if(dist >= 0 && dist < hit->dist) { hit->index = index; - hit->dist = fabs(dist); - VECADDFAC(hit->co, ray->origin, ray->direction, hit->dist); + hit->dist = dist; + VECADDFAC(hit->co, ray->origin, ray->direction, dist); } - - - -/* - VECADDFAC(v0, ray->origin, ray->direction, 0); - VECADDFAC(v1, ray->origin, ray->direction, hit->dist); - - if(SweepingSphereIntersectsTriangleUV(v0, v1, 0.1f, t0, t1, t2, &lambda, hit_point)) - { - hit->index = index; - hit->dist *= lambda; - VECADDFAC(hit->co, ray->origin, ray->direction, hit->dist); - } -*/ - + return dist; } /* * Raytree from mesh @@ -916,6 +884,7 @@ static void shrinkwrap_removeUnused(ShrinkwrapCalcData *calc) //Ignore a face were not a single vertice moved if(res == 0) continue; + //Only 1 vertice moved.. (if its a quad.. remove the vertice oposite to it) if(res == 1 && face[i].v4) { @@ -942,6 +911,27 @@ static void shrinkwrap_removeUnused(ShrinkwrapCalcData *calc) face[i].v4 = 0; //this quad turned on a tri } + +/* + if(face[i].v4 && res == 3) + { + if(!bitset_get(moved_verts, face[i].v1)) + { + face[i].v1 = face[i].v4; + } + else if(!bitset_get(moved_verts, face[i].v2)) + { + face[i].v2 = face[i].v3; + face[i].v3 = face[i].v4; + } + else if(!bitset_get(moved_verts, face[i].v3)) + { + face[i].v3 = face[i].v4; + } + + face[i].v4 = 0; //this quad turned on a tri + } +*/ bitset_set(used_faces, i); //Mark face to maintain numUsedFaces++; @@ -1140,12 +1130,13 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri case MOD_SHRINKWRAP_NORMAL: if(calc.smd->shrinkOpts & MOD_SHRINKWRAP_REMOVE_UNPROJECTED_FACES) - calc.moved = bitset_new( calc.final->getNumVerts(calc.final), "shrinkwrap bitset data"); + calc.moved = bitset_new( calc.final->getNumVerts(calc.final), "shrinkwrap bitset data"); +/* BENCH(shrinkwrap_calc_normal_projection_raytree(&calc)); calc.final->release( calc.final ); - - calc.final = CDDM_copy(calc.original); +*/ +// calc.final = CDDM_copy(calc.original); BENCH(shrinkwrap_calc_normal_projection(&calc)); // BENCH(shrinkwrap_calc_foreach_vertex(&calc, bruteforce_shrinkwrap_calc_normal_projection)); @@ -1200,7 +1191,7 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) BENCH_VAR(query); - BENCH(tree = bvhtree_from_mesh_verts(calc->target)); + BENCH(tree = bvhtree_from_mesh_verts(calc->target, 0.0)); if(tree == NULL) return OUT_OF_MEMORY(); //Setup nearest @@ -1352,6 +1343,8 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) //setup raytracing BVHTree *tree = NULL; BVHTreeRayHit hit; + BVHMeshCallbackUserdata userdata; + BVHTree_RayCastCallback callback = NULL; int numVerts; MVert *vert = NULL; @@ -1360,9 +1353,10 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) if( (use_normal & (MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL | MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL)) == 0) return; //Nothing todo - BENCH(tree = bvhtree_from_mesh_tri(calc->target)); + BENCH(tree = bvhtree_from_mesh_tri(calc->target, calc->keptDist)); if(tree == NULL) return OUT_OF_MEMORY(); - + bvhtree_meshcallbackdata_init(&userdata, calc->target, calc->keptDist); + callback = calc->keptDist > 0 ? mesh_tri_spherecast : mesh_tri_raycast; //Project each vertex along normal numVerts= calc->final->getNumVerts(calc->final); @@ -1388,13 +1382,13 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) if(use_normal & MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL) { - BLI_bvhtree_ray_cast(tree, tmp_co, tmp_no, &hit, mesh_tri_spherecast, calc->target); + BLI_bvhtree_ray_cast(tree, tmp_co, tmp_no, &hit, callback, &userdata); } if(use_normal & MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL) { float inv[3] = { -tmp_no[0], -tmp_no[1], -tmp_no[2] }; - BLI_bvhtree_ray_cast(tree, tmp_co, inv, &hit, mesh_tri_spherecast, calc->target); + BLI_bvhtree_ray_cast(tree, tmp_co, inv, &hit, callback, &userdata); } if(hit.index != -1) @@ -1424,6 +1418,7 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) BVHTree *tree = NULL; BVHTreeNearest nearest; + BVHMeshCallbackUserdata userdata; int numVerts; MVert *vert = NULL; @@ -1431,8 +1426,9 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) //Create a bvh-tree of the given target - tree = bvhtree_from_mesh_tri(calc->target); + tree = bvhtree_from_mesh_tri(calc->target, 0.0); if(tree == NULL) return OUT_OF_MEMORY(); + bvhtree_meshcallbackdata_init(&userdata, calc->target, 0.0); //Setup nearest nearest.index = -1; @@ -1458,7 +1454,7 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) } else nearest.dist = FLT_MAX; - index = BLI_bvhtree_find_nearest(tree, tmp_co, &nearest, mesh_tri_nearest_point, calc->target); + index = BLI_bvhtree_find_nearest(tree, tmp_co, &nearest, mesh_tri_nearest_point, &userdata); if(index != -1) { diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index 2084ab3da5f..a366862d064 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -55,11 +55,10 @@ #include #include "BLI_arithb.h" #include "BLI_memarena.h" +#include "BKE_utildefines.h" /* A few small defines. Keep'em local! */ #define SMALL_NUMBER 1.e-8 -#define ABS(x) ((x) < 0 ? -(x) : (x)) -#define SWAP(type, a, b) { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; } #if defined(WIN32) || defined(__APPLE__) @@ -3740,12 +3739,50 @@ int RayIntersectsTriangle(float p1[3], float d[3], float v0[3], float v1[3], flo /* Adapted from the paper by Kasper Fauerby */ /* "Improved Collision detection and Response" */ +static int getLowestRoot(float a, float b, float c, float maxR, float* root) +{ + // Check if a solution exists + float determinant = b*b - 4.0f*a*c; + + // If determinant is negative it means no solutions. + if (determinant >= 0.0f) + { + // calculate the two roots: (if determinant == 0 then + // x1==x2 but let’s disregard that slight optimization) + float sqrtD = sqrt(determinant); + float r1 = (-b - sqrtD) / (2.0f*a); + float r2 = (-b + sqrtD) / (2.0f*a); + + // Sort so x1 <= x2 + if (r1 > r2) + SWAP( float, r1, r2); + + // Get lowest root: + if (r1 > 0.0f && r1 < maxR) + { + *root = r1; + return 1; + } + + // It is possible that we want x2 - this can happen + // if x1 < 0 + if (r2 > 0.0f && r2 < maxR) + { + *root = r2; + return 1; + } + } + // No (valid) solutions + return 0; +} + int SweepingSphereIntersectsTriangleUV(float p1[3], float p2[3], float radius, float v0[3], float v1[3], float v2[3], float *lambda, float *ipoint) { float e1[3], e2[3], e3[3], point[3], vel[3], /*dist[3],*/ nor[3], temp[3], bv[3]; - float a, b, c, d, e, x, y, z, t, t0, t1, radius2=radius*radius; + float a, b, c, d, e, x, y, z, radius2=radius*radius; float elen2,edotv,edotbv,nordotv,vel2; - int embedded_in_plane=0, found_by_sweep=0; + float newLambda; + int found_by_sweep=0; VecSubf(e1,v1,v0); VecSubf(e2,v2,v0); @@ -3754,44 +3791,41 @@ int SweepingSphereIntersectsTriangleUV(float p1[3], float p2[3], float radius, f /*---test plane of tri---*/ Crossf(nor,e1,e2); Normalize(nor); + /* flip normal */ if(Inpf(nor,vel)>0.0f) VecMulf(nor,-1.0f); a=Inpf(p1,nor)-Inpf(v0,nor); - nordotv=Inpf(nor,vel); - if ((nordotv > -0.000001) && (nordotv < 0.000001)) { - if(fabs(a)>=1.0f) + if (fabs(nordotv) < 0.000001) + { + if(fabs(a)>=radius) + { return 0; - else{ - embedded_in_plane=1; - t0=0.0f; - t1=1.0f; } } - else{ - t0=(radius-a)/nordotv; - t1=(-radius-a)/nordotv; - /* make t0t1){b=t1; t1=t0; t0=b;} + else + { + float t0=(-a+radius)/nordotv; + float t1=(-a-radius)/nordotv; + + if(t0>t1) + SWAP(float, t0, t1); if(t0>1.0f || t1<0.0f) return 0; /* clamp to [0,1] */ - t0=(t0<0.0f)?0.0f:((t0>1.0f)?1.0:t0); - t1=(t1<0.0f)?0.0f:((t1>1.0f)?1.0:t1); - } + CLAMP(t0, 0.0f, 1.0f); + CLAMP(t1, 0.0f, 1.0f); -/*---test inside of tri---*/ - if(embedded_in_plane==0){ + /*---test inside of tri---*/ /* plane intersection point */ - VecCopyf(point,vel); - VecMulf(point,t0); - VecAddf(point,point,p1); - VecCopyf(temp,nor); - VecMulf(temp,radius); - VecSubf(point,point,temp); + + point[0] = p1[0] + vel[0]*t0 - nor[0]*radius; + point[1] = p1[1] + vel[1]*t0 - nor[1]*radius; + point[2] = p1[2] + vel[2]*t0 - nor[2]*radius; + /* is the point in the tri? */ a=Inpf(e1,e1); @@ -3806,14 +3840,19 @@ int SweepingSphereIntersectsTriangleUV(float p1[3], float p2[3], float radius, f y=e*a-d*b; z=x+y-(a*c-b*b); - if(( ((unsigned int)z)& ~(((unsigned int)x)|((unsigned int)y)) ) & 0x80000000){ + + if( z <= 0.0f && (x >= 0.0f && y >= 0.0f)) + { + //( ((unsigned int)z)& ~(((unsigned int)x)|((unsigned int)y)) ) & 0x80000000){ *lambda=t0; VecCopyf(ipoint,point); return 1; } } + *lambda=1.0f; + /*---test points---*/ a=vel2=Inpf(vel,vel); @@ -3821,73 +3860,42 @@ int SweepingSphereIntersectsTriangleUV(float p1[3], float p2[3], float radius, f VecSubf(temp,p1,v0); b=2.0f*Inpf(vel,temp); c=Inpf(temp,temp)-radius2; - d=b*b-4*a*c; - if(d>=0.0f){ - if(d==0.0f) - t=-b/2*a; - else{ - z=sqrt(d); - x=(-b-z)*0.5/a; - y=(-b+z)*0.5/a; - t=x0.0 && t < *lambda){ - *lambda=t; - VecCopyf(ipoint,v0); - found_by_sweep=1; - } + if(getLowestRoot(a, b, c, *lambda, lambda)) + { + VecCopyf(ipoint,v0); + found_by_sweep=1; } /*v1*/ VecSubf(temp,p1,v1); b=2.0f*Inpf(vel,temp); c=Inpf(temp,temp)-radius2; - d=b*b-4*a*c; - if(d>=0.0f){ - if(d==0.0f) - t=-b/2*a; - else{ - z=sqrt(d); - x=(-b-z)*0.5/a; - y=(-b+z)*0.5/a; - t=x0.0 && t < *lambda){ - *lambda=t; - VecCopyf(ipoint,v1); - found_by_sweep=1; - } + if(getLowestRoot(a, b, c, *lambda, lambda)) + { + VecCopyf(ipoint,v1); + found_by_sweep=1; } + /*v2*/ VecSubf(temp,p1,v2); b=2.0f*Inpf(vel,temp); c=Inpf(temp,temp)-radius2; - d=b*b-4*a*c; - if(d>=0.0f){ - if(d==0.0f) - t=-b/2*a; - else{ - z=sqrt(d); - x=(-b-z)*0.5/a; - y=(-b+z)*0.5/a; - t=x0.0 && t < *lambda){ - *lambda=t; - VecCopyf(ipoint,v2); - found_by_sweep=1; - } + if(getLowestRoot(a, b, c, *lambda, lambda)) + { + VecCopyf(ipoint,v2); + found_by_sweep=1; } /*---test edges---*/ + VecSubf(e3,v2,v1); //wasnt yet calculated + + /*e1*/ VecSubf(bv,v0,p1); + elen2 = Inpf(e1,e1); edotv = Inpf(e1,vel); edotbv = Inpf(e1,bv); @@ -3895,27 +3903,18 @@ int SweepingSphereIntersectsTriangleUV(float p1[3], float p2[3], float radius, f a=elen2*(-Inpf(vel,vel))+edotv*edotv; b=2.0f*(elen2*Inpf(vel,bv)-edotv*edotbv); c=elen2*(radius2-Inpf(bv,bv))+edotbv*edotbv; - d=b*b-4*a*c; - if(d>=0.0f){ - if(d==0.0f) - t=-b/2*a; - else{ - z=sqrt(d); - x=(-b-z)*0.5/a; - y=(-b+z)*0.5/a; - t=x=0.0f) && (e<=1.0f)){ - if(t>0.0 && t < *lambda){ - *lambda=t; - VecCopyf(ipoint,e1); - VecMulf(ipoint,e); - VecAddf(ipoint,ipoint,v0); - found_by_sweep=1; - } + if(e >= 0.0f && e <= 1.0f) + { + *lambda = newLambda; + VecCopyf(ipoint,e1); + VecMulf(ipoint,e); + VecAddf(ipoint,ipoint,v0); + found_by_sweep=1; } } @@ -3928,32 +3927,27 @@ int SweepingSphereIntersectsTriangleUV(float p1[3], float p2[3], float radius, f a=elen2*(-Inpf(vel,vel))+edotv*edotv; b=2.0f*(elen2*Inpf(vel,bv)-edotv*edotbv); c=elen2*(radius2-Inpf(bv,bv))+edotbv*edotbv; - d=b*b-4*a*c; - if(d>=0.0f){ - if(d==0.0f) - t=-b/2*a; - else{ - z=sqrt(d); - x=(-b-z)*0.5/a; - y=(-b+z)*0.5/a; - t=x=0.0f) && (e<=1.0f)){ - if(t>0.0 && t < *lambda){ - *lambda=t; - VecCopyf(ipoint,e2); - VecMulf(ipoint,e); - VecAddf(ipoint,ipoint,v0); - found_by_sweep=1; - } + if(e >= 0.0f && e <= 1.0f) + { + *lambda = newLambda; + VecCopyf(ipoint,e2); + VecMulf(ipoint,e); + VecAddf(ipoint,ipoint,v0); + found_by_sweep=1; } } /*e3*/ - VecSubf(e3,v2,v1); + VecSubf(bv,v0,p1); + elen2 = Inpf(e1,e1); + edotv = Inpf(e1,vel); + edotbv = Inpf(e1,bv); + VecSubf(bv,v1,p1); elen2 = Inpf(e3,e3); edotv = Inpf(e3,vel); @@ -3962,30 +3956,22 @@ int SweepingSphereIntersectsTriangleUV(float p1[3], float p2[3], float radius, f a=elen2*(-Inpf(vel,vel))+edotv*edotv; b=2.0f*(elen2*Inpf(vel,bv)-edotv*edotbv); c=elen2*(radius2-Inpf(bv,bv))+edotbv*edotbv; - d=b*b-4*a*c; - if(d>=0.0f){ - if(d==0.0f) - t=-b/2*a; - else{ - z=sqrt(d); - x=(-b-z)*0.5/a; - y=(-b+z)*0.5/a; - t=x=0.0f) && (e<=1.0f)){ - if(t>0.0 && t < *lambda){ - *lambda=t; - VecCopyf(ipoint,e3); - VecMulf(ipoint,e); - VecAddf(ipoint,ipoint,v1); - found_by_sweep=1; - } + if(e >= 0.0f && e <= 1.0f) + { + *lambda = newLambda; + VecCopyf(ipoint,e3); + VecMulf(ipoint,e); + VecAddf(ipoint,ipoint,v1); + found_by_sweep=1; } } + return found_by_sweep; } int AxialLineIntersectsTriangle(int axis, float p1[3], float p2[3], float v0[3], float v1[3], float v2[3], float *lambda) From 7d6e004153e356101bb37be4fb6867791eb7b251 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Sun, 13 Jul 2008 01:49:53 +0000 Subject: [PATCH 38/76] Adding the Cullface option on normal projection of shrinkwrap when using bvhtrees --- source/blender/blenkernel/intern/shrinkwrap.c | 111 +++++++++++++----- 1 file changed, 79 insertions(+), 32 deletions(-) diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 4c01e5fb84a..65e49e23c9d 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -106,17 +106,14 @@ static float ray_tri_intersection(const BVHTreeRay *ray, const float m_dist, con static float sphereray_tri_intersection(const BVHTreeRay *ray, float radius, const float m_dist, const float *v0, const float *v1, const float *v2) { - float dist, idist; - float p0[3], p1[3]; + float idist; + float p1[3]; float plane_normal[3], hit_point[3]; CalcNormFloat((float*)v0, (float*)v1, (float*)v2, plane_normal); - dist = ray_intersect_plane(ray->origin, ray->direction, v0, plane_normal); - - VECADDFAC( p0, ray->origin, ray->direction, /*dist-radius*/ 0); VECADDFAC( p1, ray->origin, ray->direction, m_dist); - if(SweepingSphereIntersectsTriangleUV(p0, p1, radius, v0, v1, v2, &idist, &hit_point)) + if(SweepingSphereIntersectsTriangleUV(ray->origin, p1, radius, v0, v1, v2, &idist, &hit_point)) { return idist * m_dist; } @@ -149,6 +146,9 @@ static void bvhtree_meshcallbackdata_init(BVHMeshCallbackUserdata *data, Derived data->sphere_radius = cast_radius; } +/* + * Builds a bvh tree.. where nodes are the vertexs of the given mesh + */ static BVHTree* bvhtree_from_mesh_verts(DerivedMesh *mesh, float epsilon) { int i; @@ -167,6 +167,9 @@ static BVHTree* bvhtree_from_mesh_verts(DerivedMesh *mesh, float epsilon) return tree; } +/* + * Builds a bvh tree.. where nodes are the faces of the given mesh. Quads are splitted in 2 triangles + */ static BVHTree* bvhtree_from_mesh_tri(DerivedMesh *mesh, float epsilon) { int i; @@ -206,36 +209,46 @@ static BVHTree* bvhtree_from_mesh_tri(DerivedMesh *mesh, float epsilon) return tree; } - -static float mesh_tri_nearest_point(void *userdata, int index, const float *co, float *nearest) +/* + * Loads the coordinates of the requested tri + */ +static void bvhtree_from_mesh_get_tri(BVHMeshCallbackUserdata* userdata, int index, float **v0, float **v1, float **v2) { const BVHMeshCallbackUserdata *data = (BVHMeshCallbackUserdata*) userdata; MVert *vert = data->vert; MFace *face = data->face + index / 2; if(index & 1) - return nearest_point_in_tri_surface(co, vert[ face->v1 ].co, vert[ face->v3 ].co, vert[ face->v4 ].co, nearest); + *v0 = vert[ face->v1 ].co, *v1 = vert[ face->v3 ].co, *v2 = vert[ face->v4 ].co; else - return nearest_point_in_tri_surface(co, vert[ face->v1 ].co, vert[ face->v2 ].co, vert[ face->v3 ].co, nearest); + *v0 = vert[ face->v1 ].co, *v1 = vert[ face->v2 ].co, *v2 = vert[ face->v3 ].co; +} + +/* + * Callback to bvh tree nearest point. The tree must bust have been built using bvhtree_from_mesh_tri. + * userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree. + */ +static float mesh_tri_nearest_point(void *userdata, int index, const float *co, float *nearest) +{ + float *t0, *t1, *t2; + + bvhtree_from_mesh_get_tri( (BVHMeshCallbackUserdata*)userdata, index, &t0, &t1, &t2); + return nearest_point_in_tri_surface(co,t0, t1, t2, nearest); } - +/* + * Callback to bvh tree raycast. The tree must bust have been built using bvhtree_from_mesh_tri. + * userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree. + */ static float mesh_tri_spherecast(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) { - const BVHMeshCallbackUserdata *data = (BVHMeshCallbackUserdata*) userdata; - MVert *vert = data->vert; - MFace *face = data->face + index / 2; - - const float *t0, *t1, *t2; float dist; + float *t0, *t1, *t2; - if(index & 1) - t0 = &vert[ face->v1 ].co, t1 = &vert[ face->v3 ].co, t2 = &vert[ face->v4 ].co; - else - t0 = &vert[ face->v1 ].co, t1 = &vert[ face->v2 ].co, t2 = &vert[ face->v3 ].co; + bvhtree_from_mesh_get_tri( (BVHMeshCallbackUserdata*)userdata, index, &t0, &t1, &t2); - dist = sphereray_tri_intersection(ray, data->sphere_radius, hit->dist, t0, t1, t2); + dist = sphereray_tri_intersection(ray, ((BVHMeshCallbackUserdata*)userdata)->sphere_radius, hit->dist, t0, t1, t2); if(dist >= 0 && dist < hit->dist) { hit->index = index; @@ -245,20 +258,18 @@ static float mesh_tri_spherecast(void *userdata, int index, const BVHTreeRay *ra return dist; } +/* + * Callback to bvh tree raycast. The tree must bust have been built using bvhtree_from_mesh_tri. + * Rays are projected as a sphere with the radius configured on userdata. + * userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree. + */ static float mesh_tri_raycast(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) { - const BVHMeshCallbackUserdata *data = (BVHMeshCallbackUserdata*) userdata; - MVert *vert = data->vert; - MFace *face = data->face + index/2; - - const float *t0, *t1, *t2; float dist; + float *t0, *t1, *t2; - if(index & 1) - t0 = &vert[ face->v1 ].co, t1 = &vert[ face->v3 ].co, t2 = &vert[ face->v4 ].co; - else - t0 = &vert[ face->v1 ].co, t1 = &vert[ face->v2 ].co, t2 = &vert[ face->v3 ].co; - + bvhtree_from_mesh_get_tri( (BVHMeshCallbackUserdata*)userdata, index, &t0, &t1, &t2); + dist = ray_tri_intersection(ray, hit->dist, t0, t1, t2); if(dist >= 0 && dist < hit->dist) { @@ -268,6 +279,8 @@ static float mesh_tri_raycast(void *userdata, int index, const BVHTreeRay *ray, } return dist; } + + /* * Raytree from mesh */ @@ -1378,17 +1391,51 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) Normalize(tmp_no); //(TODO: do we really needed a unit-len normal? and we could know the scale factor before hand?) hit.index = -1; - hit.dist = 1000; + hit.dist = 1000; //TODO: we should use FLT_MAX here if(use_normal & MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL) { BLI_bvhtree_ray_cast(tree, tmp_co, tmp_no, &hit, callback, &userdata); + + if(hit.index != -1) + { + float *v0, *v1, *v2; + float facenormal[3], dot; + + bvhtree_from_mesh_get_tri(&userdata, hit.index, &v0, &v1, &v2); + CalcNormFloat(v0, v1, v2, facenormal); + dot = INPR( facenormal, tmp_no); + + if(((calc->smd->shrinkOpts & MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE) && dot < 0) + || ((calc->smd->shrinkOpts & MOD_SHRINKWRAP_CULL_TARGET_BACKFACE) && dot > 0)) + { + hit.index = -1; + hit.dist = 1000; //TODO: we should use FLT_MAX here + } + } } if(use_normal & MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL) { float inv[3] = { -tmp_no[0], -tmp_no[1], -tmp_no[2] }; BLI_bvhtree_ray_cast(tree, tmp_co, inv, &hit, callback, &userdata); + + if(hit.index != -1) + { + float *v0, *v1, *v2; + float facenormal[3], dot; + + bvhtree_from_mesh_get_tri(&userdata, hit.index, &v0, &v1, &v2); + CalcNormFloat(v0, v1, v2, facenormal); + dot = INPR( facenormal, inv); + + if(((calc->smd->shrinkOpts & MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE) && dot < 0) + || ((calc->smd->shrinkOpts & MOD_SHRINKWRAP_CULL_TARGET_BACKFACE) && dot > 0)) + { + hit.index = -1; + hit.dist = 1000; //TODO: we should use FLT_MAX here + } + } } if(hit.index != -1) From 70730c722679653d6accbb0ce36840ed84baf739 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Sun, 13 Jul 2008 13:21:01 +0000 Subject: [PATCH 39/76] svn merge -r 15392:15551 https://svn.blender.org/svnroot/bf-blender/trunk/blender --- README | 14 +- intern/ghost/intern/GHOST_SystemWin32.cpp | 9 + intern/moto/include/GEN_Map.h | 18 + .../blender/blenlib/BLI_blenlib.vcproj | 6 + .../blender/render/BRE_render.vcproj | 8 +- projectfiles_vc7/blender/src/BL_src.vcproj | 4 +- .../gameengine/gamelogic/SCA_GameLogic.vcproj | 12 + .../rasterizer/RAS_rasterizer.vcproj | 8 +- release/scripts/animation_bake_constraints.py | 208 +++---- release/scripts/c3d_import.py | 60 +- release/windows/installer/00.sconsblender.nsi | 25 +- source/blender/blenkernel/BKE_bmesh.h | 21 +- .../blender/blenkernel/BKE_bmeshCustomData.h | 4 +- source/blender/blenkernel/BKE_cloth.h | 2 +- source/blender/blenkernel/BKE_customdata.h | 29 + .../blenkernel/intern/BME_Customdata.c | 9 +- .../blenkernel/intern/BME_conversions.c | 286 ++++++++- source/blender/blenkernel/intern/BME_eulers.c | 14 +- source/blender/blenkernel/intern/BME_mesh.c | 80 +-- .../blender/blenkernel/intern/BME_structure.c | 135 +--- source/blender/blenkernel/intern/BME_tools.c | 105 +++- .../blender/blenkernel/intern/DerivedMesh.c | 2 +- .../blender/blenkernel/intern/bmesh_private.h | 6 - source/blender/blenkernel/intern/cloth.c | 4 +- source/blender/blenkernel/intern/collision.c | 473 ++++++++------- source/blender/blenkernel/intern/customdata.c | 384 +++++++++++- source/blender/blenkernel/intern/image.c | 14 +- source/blender/blenkernel/intern/implicit.c | 13 +- source/blender/blenkernel/intern/library.c | 60 +- source/blender/blenkernel/intern/modifier.c | 2 +- source/blender/blenkernel/intern/object.c | 11 + source/blender/blenkernel/intern/particle.c | 2 +- .../blenkernel/intern/particle_system.c | 10 +- source/blender/blenkernel/intern/pointcache.c | 16 +- source/blender/blenkernel/intern/sca.c | 3 + source/blender/blenlib/BLI_arithb.h | 6 + source/blender/blenlib/BLI_winstuff.h | 3 + source/blender/blenlib/intern/BLI_kdopbvh.c | 2 + source/blender/blenlib/intern/arithb.c | 60 ++ source/blender/blenlib/intern/util.c | 1 + source/blender/blenloader/intern/readfile.c | 17 + source/blender/blenloader/intern/writefile.c | 3 + .../imbuf/intern/openexr/openexr_api.cpp | 41 +- source/blender/include/BDR_drawobject.h | 1 + source/blender/include/BIF_editaction.h | 2 + source/blender/include/BIF_editarmature.h | 2 +- source/blender/include/BIF_resources.h | 3 + source/blender/include/BSE_sequence.h | 2 + source/blender/include/blendef.h | 6 + source/blender/makesdna/DNA_actuator_types.h | 52 +- .../blender/makesdna/DNA_customdata_types.h | 10 +- source/blender/makesdna/DNA_lamp_types.h | 19 + source/blender/makesdna/DNA_meshdata_types.h | 15 + source/blender/makesdna/DNA_sensor_types.h | 7 + source/blender/makesdna/DNA_space_types.h | 11 +- source/blender/makesdna/DNA_userdef_types.h | 1 + .../nodes/intern/CMP_nodes/CMP_gamma.c | 2 +- source/blender/python/BPY_interface.c | 25 +- source/blender/python/api2_2x/matrix.c | 2 +- source/blender/python/api2_2x/sceneSequence.c | 74 ++- .../radiosity/intern/source/radrender.c | 15 +- .../render/intern/include/pixelshading.h | 1 + .../render/intern/include/render_types.h | 4 + .../render/intern/source/convertblender.c | 27 +- .../render/intern/source/pixelshading.c | 78 ++- .../blender/render/intern/source/rendercore.c | 91 +++ source/blender/src/buttons_editing.c | 50 +- source/blender/src/buttons_logic.c | 523 ++++++++++------ source/blender/src/buttons_object.c | 2 +- source/blender/src/buttons_scene.c | 2 +- source/blender/src/buttons_shading.c | 47 +- source/blender/src/drawaction.c | 107 +++- source/blender/src/drawarmature.c | 17 +- source/blender/src/drawimage.c | 2 +- source/blender/src/drawobject.c | 8 +- source/blender/src/drawview.c | 4 +- source/blender/src/editaction.c | 108 ++-- source/blender/src/editarmature.c | 51 +- source/blender/src/editmesh_add.c | 18 +- source/blender/src/editnla.c | 35 +- source/blender/src/editseq.c | 17 +- source/blender/src/editsima.c | 16 +- source/blender/src/editsound.c | 2 +- source/blender/src/edittime.c | 4 +- source/blender/src/header_image.c | 23 +- source/blender/src/header_view3d.c | 15 +- source/blender/src/headerbuttons.c | 1 + source/blender/src/interface_draw.c | 8 +- source/blender/src/poselib.c | 18 +- source/blender/src/resources.c | 28 + source/blender/src/sequence.c | 10 + source/blender/src/space.c | 25 +- source/blender/src/transform_conversions.c | 9 +- source/blender/src/transform_snap.c | 2 +- source/blender/src/usiblender.c | 2 + source/blender/src/view.c | 2 +- source/blender/src/vpaint.c | 36 +- .../BlenderRoutines/KX_BlenderGL.cpp | 2 +- .../BlenderRoutines/KX_BlenderRenderTools.cpp | 4 +- .../BlenderRoutines/KX_BlenderRenderTools.h | 2 +- .../Converter/BL_ActionActuator.cpp | 65 +- .../gameengine/Converter/BL_ActionActuator.h | 5 + .../Converter/BL_BlenderDataConversion.cpp | 121 ++-- .../gameengine/Converter/BL_MeshDeformer.cpp | 164 ++--- source/gameengine/Converter/BL_MeshDeformer.h | 14 +- .../Converter/BL_ShapeActionActuator.cpp | 24 + .../gameengine/Converter/BL_ShapeDeformer.h | 11 +- .../gameengine/Converter/BL_SkinDeformer.cpp | 53 +- source/gameengine/Converter/BL_SkinDeformer.h | 6 +- .../Converter/BL_SkinMeshObject.cpp | 84 --- .../gameengine/Converter/BL_SkinMeshObject.h | 94 --- .../Converter/KX_ConvertActuators.cpp | 142 +++-- .../Converter/KX_ConvertSensors.cpp | 14 + source/gameengine/Expressions/PyObjectPlus.h | 59 +- source/gameengine/Expressions/Value.cpp | 15 +- source/gameengine/Expressions/Value.h | 1 + .../GameLogic/SCA_2DFilterActuator.cpp | 12 +- .../GameLogic/SCA_2DFilterActuator.h | 6 +- .../gameengine/GameLogic/SCA_EventManager.cpp | 4 +- .../gameengine/GameLogic/SCA_EventManager.h | 4 +- source/gameengine/GameLogic/SCA_IActuator.h | 1 + .../gameengine/GameLogic/SCA_IController.cpp | 4 +- .../gameengine/GameLogic/SCA_ILogicBrick.cpp | 12 +- source/gameengine/GameLogic/SCA_ILogicBrick.h | 4 +- source/gameengine/GameLogic/SCA_IObject.cpp | 42 +- source/gameengine/GameLogic/SCA_IObject.h | 15 + source/gameengine/GameLogic/SCA_ISensor.cpp | 3 +- source/gameengine/GameLogic/SCA_ISensor.h | 5 + .../GameLogic/SCA_JoystickSensor.cpp | 8 +- .../GameLogic/SCA_KeyboardSensor.cpp | 17 +- .../gameengine/GameLogic/SCA_LogicManager.cpp | 4 + .../gameengine/GameLogic/SCA_MouseSensor.cpp | 12 +- .../GameLogic/SCA_PropertySensor.cpp | 7 +- .../GameLogic/SCA_PythonController.cpp | 79 +-- .../GameLogic/SCA_PythonController.h | 21 +- .../GamePlayer/common/GPC_RenderTools.cpp | 4 +- .../GamePlayer/common/GPC_RenderTools.h | 2 +- source/gameengine/Ketsji/BL_BlenderShader.cpp | 80 ++- source/gameengine/Ketsji/BL_BlenderShader.h | 15 +- source/gameengine/Ketsji/BL_Material.cpp | 6 +- source/gameengine/Ketsji/BL_Material.h | 7 +- source/gameengine/Ketsji/BL_Shader.cpp | 2 +- .../KXNetwork/KX_NetworkMessageActuator.cpp | 14 +- .../KXNetwork/KX_NetworkMessageSensor.cpp | 3 + .../gameengine/Ketsji/KX_BlenderMaterial.cpp | 100 ++- source/gameengine/Ketsji/KX_BlenderMaterial.h | 2 + source/gameengine/Ketsji/KX_Camera.cpp | 8 +- .../Ketsji/KX_ConstraintActuator.cpp | 574 +++++++++++++++--- .../gameengine/Ketsji/KX_ConstraintActuator.h | 59 +- source/gameengine/Ketsji/KX_GameObject.cpp | 489 ++++++++------- source/gameengine/Ketsji/KX_GameObject.h | 84 +-- .../gameengine/Ketsji/KX_IPO_SGController.cpp | 87 ++- .../gameengine/Ketsji/KX_IPO_SGController.h | 7 +- source/gameengine/Ketsji/KX_IpoActuator.cpp | 171 +++--- source/gameengine/Ketsji/KX_IpoActuator.h | 12 +- source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 46 +- source/gameengine/Ketsji/KX_KetsjiEngine.h | 1 + source/gameengine/Ketsji/KX_Light.cpp | 80 ++- source/gameengine/Ketsji/KX_Light.h | 16 +- source/gameengine/Ketsji/KX_MeshProxy.cpp | 12 + .../gameengine/Ketsji/KX_MouseFocusSensor.cpp | 8 +- source/gameengine/Ketsji/KX_NearSensor.cpp | 5 +- .../gameengine/Ketsji/KX_ObjectActuator.cpp | 371 ++++++++--- source/gameengine/Ketsji/KX_ObjectActuator.h | 19 +- .../gameengine/Ketsji/KX_ParentActuator.cpp | 6 + .../Ketsji/KX_PhysicsObjectWrapper.cpp | 12 + .../Ketsji/KX_PyConstraintBinding.cpp | 63 +- source/gameengine/Ketsji/KX_PythonInit.cpp | 48 +- source/gameengine/Ketsji/KX_RaySensor.cpp | 10 +- .../Ketsji/KX_SCA_AddObjectActuator.cpp | 39 +- .../Ketsji/KX_SCA_AddObjectActuator.h | 10 +- source/gameengine/Ketsji/KX_Scene.cpp | 46 +- source/gameengine/Ketsji/KX_Scene.h | 8 +- .../Ketsji/KX_TouchEventManager.cpp | 16 +- source/gameengine/Ketsji/KX_TouchSensor.cpp | 12 +- .../gameengine/Ketsji/KX_TrackToActuator.cpp | 35 +- .../gameengine/Ketsji/KX_VehicleWrapper.cpp | 33 +- source/gameengine/PyDoc/BL_ActionActuator.py | 15 + source/gameengine/PyDoc/KX_GameObject.py | 33 +- source/gameengine/Rasterizer/CMakeLists.txt | 2 + .../Rasterizer/RAS_2DFilterManager.cpp | 186 ++++-- .../Rasterizer/RAS_2DFilterManager.h | 24 +- .../Rasterizer/RAS_BucketManager.cpp | 2 +- .../Rasterizer/RAS_IPolygonMaterial.cpp | 16 + .../Rasterizer/RAS_IPolygonMaterial.h | 2 + .../gameengine/Rasterizer/RAS_IRasterizer.h | 59 +- .../gameengine/Rasterizer/RAS_IRenderTools.h | 2 +- .../Rasterizer/RAS_MaterialBucket.cpp | 53 +- .../Rasterizer/RAS_MaterialBucket.h | 10 +- .../gameengine/Rasterizer/RAS_MeshObject.cpp | 63 +- source/gameengine/Rasterizer/RAS_MeshObject.h | 6 +- .../RAS_ListRasterizer.cpp | 25 +- .../RAS_OpenGLRasterizer/RAS_ListRasterizer.h | 8 +- .../RAS_OpenGLRasterizer.cpp | 102 +--- .../RAS_OpenGLRasterizer.h | 10 +- .../RAS_VAOpenGLRasterizer.cpp | 94 ++- .../RAS_VAOpenGLRasterizer.h | 8 +- source/gameengine/Rasterizer/RAS_TexVert.cpp | 42 +- source/gameengine/Rasterizer/RAS_TexVert.h | 24 +- source/gameengine/Rasterizer/SConscript | 3 +- source/gameengine/SceneGraph/SG_Controller.h | 4 +- source/kernel/gen_system/GEN_HashedPtr.h | 1 + source/kernel/gen_system/GEN_Map.h | 18 + tools/Blender.py | 27 +- 204 files changed, 5657 insertions(+), 2776 deletions(-) diff --git a/README b/README index d123a90ba48..1a7964f954e 100644 --- a/README +++ b/README @@ -24,22 +24,22 @@ dir to one of these locations (your home directory being recommended). -------------------------------------Links-------------------------------------- Getting Involved: -http://www.blender.org/docs/get_involved.html +http://www.blender.org/community/get-involved Community: -http://www.blender3d.org/Community/ +http://www.blender.org/Community Main blender development site: -http://www.blender.org/ +http://www.blender.org The Blender project homepage: -http://projects.blender.org/projects/bf-blender/ +http://projects.blender.org/projects/bf-blender Documentation: -http://www.blender.org/modules.php?op=modload&name=documentation&file=index +http://www.blender.org/education-help Bug tracker: -http://projects.blender.org/tracker/?atid=125&group_id=9&func=browse +http://www.blender.org/development/report-a-bug Feature request tracker: -http://projects.blender.org/tracker/?atid=128&group_id=9&func=browse +http://wiki.blender.org/index.php/Requests diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index 82a76b3c706..293f8fc1661 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -302,6 +302,15 @@ GHOST_TSuccess GHOST_SystemWin32::init() { GHOST_TSuccess success = GHOST_System::init(); + /* Disable scaling on high DPI displays on Vista */ + HMODULE user32 = ::LoadLibraryA("user32.dll"); + typedef BOOL (WINAPI * LPFNSETPROCESSDPIAWARE)(); + LPFNSETPROCESSDPIAWARE SetProcessDPIAware = + (LPFNSETPROCESSDPIAWARE)GetProcAddress(user32, "SetProcessDPIAware"); + if (SetProcessDPIAware) + SetProcessDPIAware(); + FreeLibrary(user32); + // Determine whether this system has a high frequency performance counter. */ m_hasPerformanceCounter = ::QueryPerformanceFrequency((LARGE_INTEGER*)&m_freq) == TRUE; if (m_hasPerformanceCounter) { diff --git a/intern/moto/include/GEN_Map.h b/intern/moto/include/GEN_Map.h index db3335d6110..9f56924419e 100644 --- a/intern/moto/include/GEN_Map.h +++ b/intern/moto/include/GEN_Map.h @@ -82,6 +82,24 @@ public: } return 0; } + + Key* getKey(int index) { + int count=0; + for (int i=0;im_key; + } + bucket = bucket->m_next; + count++; + } + } + return 0; + } void clear() { for (int i = 0; i < m_num_buckets; ++i) { diff --git a/projectfiles_vc7/blender/blenlib/BLI_blenlib.vcproj b/projectfiles_vc7/blender/blenlib/BLI_blenlib.vcproj index 34c195cf23d..0dfbcaa5577 100644 --- a/projectfiles_vc7/blender/blenlib/BLI_blenlib.vcproj +++ b/projectfiles_vc7/blender/blenlib/BLI_blenlib.vcproj @@ -358,6 +358,9 @@ + + @@ -473,6 +476,9 @@ + + diff --git a/projectfiles_vc7/blender/render/BRE_render.vcproj b/projectfiles_vc7/blender/render/BRE_render.vcproj index 4869dd606f1..4331d6e1579 100644 --- a/projectfiles_vc7/blender/render/BRE_render.vcproj +++ b/projectfiles_vc7/blender/render/BRE_render.vcproj @@ -74,7 +74,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\..\..\lib\windows\sdl\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\yafray;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenkernel;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\blender\render\intern\include;..\..\..\source\blender\render\extern\include;..\..\..\source\kernel;..\..\..\source\kernel\gen_messaging" - PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_QUICKTIME;WITH_OPENEXR" + PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_QUICKTIME;WITH_OPENEXR;_USE_MATH_DEFINES" BasicRuntimeChecks="3" RuntimeLibrary="1" DefaultCharIsUnsigned="TRUE" @@ -175,6 +175,9 @@ + + @@ -245,6 +248,9 @@ + + diff --git a/projectfiles_vc7/blender/src/BL_src.vcproj b/projectfiles_vc7/blender/src/BL_src.vcproj index 6f91aeed8b5..226bedbbfd8 100644 --- a/projectfiles_vc7/blender/src/BL_src.vcproj +++ b/projectfiles_vc7/blender/src/BL_src.vcproj @@ -21,7 +21,7 @@ + + + + @@ -444,6 +450,12 @@ + + + + diff --git a/projectfiles_vc7/gameengine/rasterizer/RAS_rasterizer.vcproj b/projectfiles_vc7/gameengine/rasterizer/RAS_rasterizer.vcproj index 31520b06546..9d55a7712fc 100644 --- a/projectfiles_vc7/gameengine/rasterizer/RAS_rasterizer.vcproj +++ b/projectfiles_vc7/gameengine/rasterizer/RAS_rasterizer.vcproj @@ -21,7 +21,7 @@ -Usage:
+Usage:
- Select the reference Object(s) you want to bake
- Set the frame range to bake in the Anim Panel
- Set the test code (if you want a self-test) in the RT field in the Anim Panel
- -- Set RT:1 in the Anim panel to create a test armature
+ -- Set RT:1 to create a test armature
+ -- Set RT: up to 100 for more debug messages and status updates

- - Run the script
- - The clone copy of the object is created and it has an IPO curve assigned to it. - - The clone shadows the object by an offset locrot (see usrDelta) - - That Ipo has Location and Rotation curves that make the shadow mimic the movement of the selected object, - but without using constraints. Bones move identically in relation to the armature as the reference object + - Run the script
+ - The clone copy of the object is created and it has an IPO curve assigned to it.
+ - The clone shadows the object by an offset locrot (see usrDelta)
+ - That Object has Ipo Location and Rotation curves that make the clone mimic the movement
+ of the selected object, but without using constraints.
+ - If the object was an Armature, the clone's bones move identically in relation to the
+ original armature, and an Action is created that drives the bone movements.
- Version History: - 0.1: bakes Loc Rot for a constrained object - 0.2: bakes Loc and Rot for the bones within Armature object - 0.3: UI for setting options - 0.3.1 add manual to script library - 0.4: bake multiple objects - 0.5: root bone worldspace rotation - 0.6: re-integration with BPyArmature - + 0.1: bakes Loc Rot for a constrained object + 0.2: bakes Loc and Rot for the bones within Armature object + 0.3: UI for setting options + 0.3.1 add manual to script library + 0.4: bake multiple objects + 0.5: root bone worldspace rotation + 0.6: re-integration with BPyArmature + 0.7: bakes parents and leaves clones selected + License, Copyright, and Attribution: - by Roger WICKES May 2008, released under Blender Artistic Licence to Public Domain - feel free to add to any Blender Python Scripts Bundle. - Thanks to Jean-Baptiste PERIN, IdeasMan42 (Campbell Barton?), Basil_Fawlty/Cage_drei (Andrew Cruse) + by Roger WICKES May 2008, released under Blender Artistic Licence to Public Domain + feel free to add to any Blender Python Scripts Bundle. + Thanks to Jean-Baptiste PERIN, IdeasMan42 (Campbell Barton), Basil_Fawlty/Cage_drei (Andrew Cruse) much lifted/learned from blender.org/documentation/245PytonDoc and wiki some modules based on c3D_Import.py, PoseLib16.py and IPO/Armature code examples e.g. camera jitter -Pseudocode (planned versions): +Pseudocode: Initialize If at least one object is selected For each selected object, - create a shadow object + create a cloned object remove any constraints on the clone create or reset an ipo curve named like the object for each frame set the clone's locrot key based on the reference object if it's an armature, - create an action (which is an Ipo for each bone) - for each frame of the animation - for each bone in the armature - set the key + create an action (which is an Ipo for each bone) + for each frame of the animation + for each bone in the armature + set the key Else you're a smurf Test Conditions and Regressions: 1. (v0.1) Non-armatures (the cube), with ipo curve and constraints at the object level 2. armatures, with ipo curve and constraints at the object level 3. armatures, with bones that have ipo curves and constraints - + 4. objects without parents, children with unselected parents, select children first. + Naming conventions: arm = a specific objec type armature bone = bones that make up the skeleton of an armature @@ -89,19 +93,6 @@ Naming conventions: pbone = pose bone, a posed bone in an object tst = testing, self-test routines usr = user-entered or designated stuff - -Pattern Notes (let me know if I've violated any): - Bergin Starting,Designing, Programming, Coding - Bergin 23 Indent for Structure - I don't like only 2, but the editor is set up that way - Bergin 26 Be Spacey Not Tabby - personal frustraion here. workaround is to Format->convert to whitespace - Bergin 27 Consistent Capitalization - except Blender, because I love it. - Bergin 28 Name Your Constants - not for those I plan on making variable - Python 01 Return Everything - I made this one up, all functions and methods end in return - even though it is decoration in Python, it helps Python throw an indentation error for typing mistakes - Wickes 01 Decorate Your Code - for visual appeal and to ease maintenance, include separators like ######### - to visually distinquish and separate functions, making it quicker to scan through code for methods - Wickes 02 Whitespace helps readability - include blanks around = # and lines (after def, after return) to make it stand out and pretty - """ ######################################## @@ -131,8 +122,8 @@ POSE_XFORM= [Blender.Object.Pose.LOC, Blender.Object.Pose.ROT] # set senstitivity for displaying debug/console messages. 0=none, 100=max # then call debug(num,string) to conditionally display status/info in console window -MODE=Blender.Get('rt') #execution mode: 0=run normal, x=self-test (test error trapping etc) -DEBUG=100 #how much detail on internal processing for big brother to see +MODE=Blender.Get('rt') #execution mode: 0=run normal, 1=make test armature +DEBUG=Blender.Get('rt') #how much detail on internal processing for user to see. range 0-100 BATCH=False #called from command line? is someone there? Would you like some cake? #there are two coordinate systems, the real, or absolute 3D space, @@ -143,13 +134,11 @@ COORD_REAL = 1 # User Settings - Change these options manually or via GUI (future TODO) usrCoord = COORD_REAL # what the user wants -usrParent = False # True=keep parent (if exists), False = breakaway (usually with Real) +usrParent = False # True=clone keeps original parent, False = clone's parent is the clone of the original parent (if cloned) usrFreeze = 2 #2=yes, 0=no. Freezes shadow object in place at current frame as origin - #TODO - i wonder if usrFreeze means we should set Delta to the the difference between the original object and parent? # delta is amount to offset/change from the reference object. future set in a ui, so technically not a constant usrDelta = [10,10,0,0,0,0] #order specific - Loc xyz Rot xyz usrACTION = True # Offset baked Action frames to start at frame 1 -usrBAKEobjIPO = False # bake the object Ipo? it is useless for MoCap, as we only want the Action, and the Object does not move CURFRAME = 'curframe' #keyword to use when getting the frame number that the scene is presently on ARMATURE = 'Armature' #en anglais @@ -159,7 +148,7 @@ BONE_SPACES = ['ARMATURESPACE','BONESPACE'] #Ipo curves created are prefixed with a name, like Ipo_ or Bake_ followed by the object/bone name #bakedArmName = "b." #used for both the armature class and object instance -#ipoObjectNamePrefix= "" +usrObjectNamePrefix= "" #ipoBoneNamePrefix = "" # for example, if on entry an armature named Man was selected, and the object prefix was "a." # on exit an armature and an IPO curve named a.Man exists for the object as a whole @@ -177,7 +166,6 @@ scn = Blender.Scene.GetCurrent() #================= ######################################## def debug(num,msg): #use log4j or just console here. - if DEBUG >= num: if BATCH == False: print 'debug: '[:num/10+7]+msg @@ -201,9 +189,26 @@ def getRenderInfo(): debug(90,'Scene is on frame %i and frame range is %i to %i' % (curframe,staframe,endframe)) return (staframe,endframe,curframe) +######################################## +def sortObjects(obs): #returns a list of objects sorted based on parent dependency + obClones= [] + while len(obClones) < len(obs): + for ob in obs: + if not ob in obClones: + par= ob.getParent() + #if no parent, or the parent is not scheduled to be cloned + if par==None: + obClones.append(ob) # add the independent + elif par not in obs: # parent will not be cloned + obClones.append(ob) # add the child + elif par in obClones: # is it on the list? + obClones.append(ob) # add the child + # parent may be a child, so it will be caught next time thru + debug(100,'clone object order: \n%s' % obClones) + return obClones # ordered list of (ob, par) tuples + ######################################## def sortBones(xbones): #returns a sorted list of bones that should be added,sorted based on parent dependency - print ('My suggestion would be:') # while there are bones to add, # look thru the list of bones we need to add # if we have not already added this bone @@ -215,7 +220,7 @@ def sortBones(xbones): #returns a sorted list of bones that should be added,sort # else #we need to keep cycling and catch its parent # else it is a root bone # add it -# else skip it, it's prego +# else skip it, it's already in there # endfor # endwhile xboneNames=[] @@ -240,7 +245,6 @@ def sortBones(xbones): #returns a sorted list of bones that should be added,sort ######################################## def dupliArmature(ob): #makes a copy in current scn of the armature used by ob and its bones - ob_mat = ob.matrixWorld ob_data = ob.getData() debug(49,'Reference object uses %s' % ob_data) @@ -261,8 +265,6 @@ def dupliArmature(ob): #makes a copy in current scn of the armature used by ob a #when creating a child, we cannot link to a parent if it does not yet exist in our armature ebones = [] #list of the bones I want to create for my arm - if BLENDER_VERSION > 245: debug(0,'WARNING: Programmer check for Bone updates in dupliArmature') - eboneNames = sortBones(xbones) i=0 @@ -306,13 +308,13 @@ def dupliArmature(ob): #makes a copy in current scn of the armature used by ob a print myob.matrix return myob - +######################################## def scrub(): # scrubs to startframe staFrame,endFrame,curFrame = getRenderInfo() # eye-candy, go from current to start, fwd or back if not BATCH: - print "Positioning to start..." + debug(100, "Positioning to start...") frameinc=(staFrame-curFrame)/10 if abs(frameinc) >= 1: for i in range(10): @@ -320,6 +322,7 @@ def scrub(): # scrubs to startframe Blender.Set(CURFRAME,curFrame) # computes the constrained location of the 'real' objects Blender.Redraw() Blender.Set(CURFRAME, staFrame) + return ######################################## def bakeBones(ref_ob,arm_ob): #copy pose from ref_ob to arm_ob @@ -335,7 +338,6 @@ def bakeBones(ref_ob,arm_ob): #copy pose from ref_ob to arm_ob arm_channels = act.getAllChannelIpos() pose= arm_ob.getPose() pbones= pose.bones.values() #we want the bones themselves, not the dictionary lookup - print arm_channels.keys() for pbone in pbones: debug (100,'Channel listing for %s: %s' % (pbone.name,arm_channels[pbone.name] )) ipo=arm_channels[pbone.name] @@ -344,8 +346,7 @@ def bakeBones(ref_ob,arm_ob): #copy pose from ref_ob to arm_ob return ######################################## -def getOrCreateCurve(ipo, curvename): - +def getOrCreateCurve(ipo, curvename): """ Retrieve or create a Blender Ipo Curve named C{curvename} in the C{ipo} Ipo Either an ipo curve named C{curvename} exists before the call then this curve is returned, @@ -362,18 +363,17 @@ def getOrCreateCurve(ipo, curvename): return mycurve ######################################## -def eraseCurve(ipo,numCurves): - debug(80,'Erasing %i curves for %' % (numCurves,ipo.GetName())) +def eraseCurve(ipo,numCurves): + debug(90,'Erasing %i curves for %' % (numCurves,ipo.GetName())) for i in range(numCurves): - nbBezPoints = ipo.getNBezPoints(i) + nbBezPoints= ipo.getNBezPoints(i) for j in range(nbBezPoints): ipo.delBezPoint(i) return ######################################## def resetIPO(ipo): - ipoName=ipoObjectNamePrefix + obName - debug(40,'Resetting ipo curve named %s' %ipoName) + debug(60,'Resetting ipo curve named %s' %ipo.name) numCurves = ipo.getNcurves() #like LocX, LocY, etc if numCurves > 0: eraseCurve(ipo, numCurves) #erase data if one exists @@ -399,11 +399,11 @@ def resetIPOs(ob): #resets all IPO curvess assocated with an object and its bone return ######################################## -def parse(string,delim): +def parse(string,delim): index = string.find(delim) # -1 if not found, else pointer to delim if index+1: return string[:index] return string - + ######################################## def newIpo(ipoName): #add a new Ipo object to the Blender scene ipo=Blender.Ipo.New('Object',ipoName) @@ -438,19 +438,16 @@ def makeUpaName(type,name): #i know this exists in Blender somewhere... name=ipoName else: debug (0,'FATAL ERROR: I dont know how to make up a new %s name based on %s' % (type,ob)) - return + return None return name ######################################## -def createIpo(ob): #create an Ipo and curves and link them to this object +def createIpo(ob): #create an Ipo and curves and link them to this object #first, we have to create a unique name #try first with just the name of the object to keep things simple. ipoName = makeUpaName('Ipo',ob.getName()) # make up a name for a new Ipo based on the object name - debug(20,'Ipo and LocRot curves called %s' % ipoName) - ipo=newIpo(ipoName) - ob.setIpo(ipo) #link them return ipo @@ -465,7 +462,7 @@ def getLocLocal(ob): ob.RotZ*R2D ] return key - + ######################################## def getLocReal(ob): obMatrix = ob.matrixWorld #Thank you IdeasMan42 @@ -505,7 +502,7 @@ def getCurves(ipo): ipo[Ipo.OB_ROTZ] ] return ipos - + ######################################## def addPoint(time,keyLocRot,ipos): if BLENDER_VERSION < 245: @@ -579,7 +576,7 @@ def removeConstraints(ob): debug(90,'removed %s => %s' % (ob.name, const)) ob.constraints.remove(const) return - + ######################################## def removeConstraintsOb(ob): # from object or armature debug(40,'Removing constraints from '+ob.getName()) @@ -605,37 +602,27 @@ def bakeObject(ob): #bakes the core object locrot and assigns the Ipo to a Clone if ob != None: # Clone the object - duplicate it, clean the clone, and create an ipo curve for the clone myob = duplicateLinked(ob) #clone it + myob.name= usrObjectNamePrefix + ob.getName() removeConstraintsOb(myob) #my object is a free man deLinkOb('Ipo',myob) #kids, it's not nice to share. you've been lied to - if usrBAKEobjIPO: + if ob.getType() != ARMATURE: # baking armatures is based on bones, not object myipo = createIpo(myob) #create own IPO and curves for the clone object ipos = bakeFrames(ob,myipo) #bake the locrot for this obj for the scene frames - -# staframe,endframe,curframe = getRenderInfo() -# frame = staframe -# Blender.Set(CURFRAME,frame) # computes the constrained location of the 'real' objects -# frame +=1 -# Blender.Set(CURFRAME,frame) # computes the constrained location of the 'real' objects -# frame -=1 -# Blender.Set(CURFRAME,frame) # computes the constrained location of the 'real' objects -# if not BATCH: Blender.Redraw() -# return myob - + ######################################## -def bake(ob): #bakes an object of any type - - debug(30,'Baking %s object %s' % (ob.getType(), ob)) - - myob = bakeObject(ob) #creates and bakes the object motion - +def bake(ob,par): #bakes an object of any type, linking it to parent + debug(0,'Baking %s object %s' % (ob.getType(), ob)) + clone = bakeObject(ob) #creates and bakes the object motion + if par!= None: + par.makeParent([clone]) + debug(20,"assigned object to parent %s" % par) if ob.getType() == ARMATURE: -# error('Object baked. Continue with bones?') - bakeBones(ob,myob) #go into the bones and copy from -> to in frame range +## error('Object baked. Continue with bones?') + bakeBones(ob,clone) #go into the bones and copy from -> to in frame range #future idea: bakeMesh (net result of Shapekeys, Softbody, Cloth, Fluidsim,...) - - return - + return clone + ######################################## def tstCreateArm(): #create a test armature in scene # rip-off from http://www.blender.org/documentation/245PythonDoc/Pose-module.html - thank you! @@ -690,8 +677,8 @@ def tstCreateArm(): #create a test armature in scene frame = 1 for pbone in pbones: # set bones to no rotation - pbone.quat[:] = 1.000,0.000,0.000,0.0000 - pbone.insertKey(arm_ob, frame, Object.Pose.ROT) + pbone.quat[:] = 1.000,0.000,0.000,0.0000 + pbone.insertKey(arm_ob, frame, Object.Pose.ROT) # Set a different rotation at frame 25 pbones[0].quat[:] = 1.000,0.1000,0.2000,0.20000 @@ -747,7 +734,7 @@ def tstMoveOb(ob): # makes a simple LocRot animation of object in the scene debug(100,'%s %i %.3f %.2f %.2f %.2f %.2f %.2f %.2f' % (ipo.name, frame, time, key[0], key[1], key[2], key[3], key[4], key[5])) frame += frameDelta - Blender.Set('curframe',curframe) # reset back to where we started + Blender.Set(CURFRAME,curframe) # reset back to where we started return #================= # Program Template @@ -755,25 +742,31 @@ def tstMoveOb(ob): # makes a simple LocRot animation of object in the scene ######################################## def main(): # return code set via rt button in Blender Buttons Scene Context Anim panel - if MODE == 1: #create test armature #1 ob = tstCreateArm() # make test arm and select it tstMoveOb(ob) scn.objects.selected = [ob] - obs = Blender.Object.GetSelected() #scn.objects.selected - debug(20,'Baking %i objects' % len(obs)) + obs= Blender.Object.GetSelected() #scn.objects.selected + obs= sortObjects(obs) + debug(0,'Baking %i objects' % len(obs)) if len(obs) >= 1: # user might have multiple objects selected + i= 0 + clones=[] # my clone army for ob in obs: - bake(ob) + par= ob.getParent() + if not usrParent: + if par in obs: + par= clones[obs.index(par)] + clones.append(bake(ob,par)) + scn.objects.selected = clones else: error('Please select at least one object') return ######################################## def benchmark(): # This lets you benchmark (time) the script's running duration - Window.WaitCursor(1) t = sys.time() debug(60,'%s began at %.0f' %(__script__,sys.time())) @@ -787,7 +780,7 @@ def benchmark(): # This lets you benchmark (time) the script's running duration if in_editmode: Window.EditMode(1) # Timing the script is a good way to be aware on any speed hits when scripting - debug(60,'%s Script finished in %.2f seconds' % (__script__,sys.time()-t) ) + debug(0,'%s Script finished in %.2f seconds' % (__script__,sys.time()-t) ) Window.WaitCursor(0) return @@ -795,6 +788,5 @@ def benchmark(): # This lets you benchmark (time) the script's running duration # This lets you can import the script without running it if __name__ == '__main__': debug(0, "------------------------------------") - debug(0, '%s %s Script begins with mode=%i debug=%i batch=%s version=%i' % (__script__,__version__,MODE,DEBUG,BATCH,BLENDER_VERSION)) - + debug(0, "%s %s Script begins with mode=%i debug=%i batch=%s" % (__script__,__version__,MODE,DEBUG,BATCH)) benchmark() diff --git a/release/scripts/c3d_import.py b/release/scripts/c3d_import.py index d67d56261d1..ca4f8cd79e9 100644 --- a/release/scripts/c3d_import.py +++ b/release/scripts/c3d_import.py @@ -8,7 +8,7 @@ Tooltip: 'Import a C3D Motion Capture file' """ __script__ = "C3D Motion Capture file import" __author__ = " Jean-Baptiste PERIN, Roger D. Wickes (rogerwickes@yahoo.com)" -__version__ = "0.8" +__version__ = "0.9" __url__ = ["Communicate problems and errors, BlenderArtists.org, Python forum"] __email__= ["rogerwickes@yahoo.com", "c3d script"] __bpydoc__ = """\ @@ -16,9 +16,9 @@ c3d_import.py v0.8 Script loading Graphics Lab Motion Capture file, Usage:
- - Run the script
- - Choose the file to open
- - Press Import C3D button
+ - Run the script
+ - Choose the file to open
+ - Press Import C3D button
Version History: 0.4: PERIN Released under Blender Artistic Licence @@ -26,6 +26,7 @@ Version History: 0.6: WICKES creates armature for each subject 0.7: WICKES constrains armature to follow the empties (markers). Verified for shake hands s 0.8: WICKES resolved DEC support issue + 0.9: BARTON removed scene name change, whitespace edits. WICKES added IK layers """ #---------------------------------------------- @@ -69,12 +70,12 @@ XYZ_LIMIT= 10000 #max value for coordinates if in integer format # selecting only layer 2 shows only the armature moving, 12 shows only the empties LAYERS_ARMOB= [1,2] LAYERS_MARKER=[1,12] +LAYERS_IK=[1,11] +IK_PREFIX="ik_" # prefix in empty name: ik_prefix+subject prefix+bone name + CLEAN=True # Should program ignore markers at (0,0,0) and beyond the outer limits? scn = Blender.Scene.GetCurrent() -# Why on earth would you rename a scene when importing data??? - Campbell -# scn.name="MoCap" #may want this enterable or derived based on motion being analyzed -#TODO: ultimately, a library of motions to append from means you need good naming of things BCS=Blender.Constraint.Settings # shorthand dictionary - define with brace, reference with bracket trackto={"+x":BCS.TRACKX, "+y":BCS.TRACKY, "+z":BCS.TRACKZ, "-x":BCS.TRACKNEGX, "-y":BCS.TRACKNEGY, "-z":BCS.TRACKNEGZ} @@ -169,22 +170,21 @@ def getEmpty(name): # in : objname : le nom de l'empty recherche # out : myobj : l'empty cree ou retrouve ######### -def GetOrCreateEmpty(objname): +def getOrCreateEmpty(objname): myobj= getEmpty(objname) if myobj==None: myobj = scn.objects.new("Empty",objname) - myobj.layers= LAYERS_MARKER debug(50,'Marker/Empty created %s' % myobj) return myobj -def GetOrCreateCurve(ipo, curvename): +def getOrCreateCurve(ipo, curvename): """ Retrieve or create a Blender Ipo Curve named C{curvename} in the C{ipo} Ipo >>> import mylib >>> lIpo = GetOrCreateIPO("Une IPO") - >>> laCurve = GetOrCreateCurve(lIpo, "RotX") + >>> laCurve = getOrCreateCurve(lIpo, "RotX") Either an ipo curve named C{curvename} exists before the call then this curve is returned, Or such a curve doesn't exist before the call .. then it is created into the c{ipo} Ipo and returned @@ -338,7 +338,8 @@ def makeNodes(prefix, markerList, empties, marker_set): #make sure the file has elif usrOption==1: #add these markers as static empties, and user will automate them later #and the bones will be keyed to them, so it will all be good. #file may have just mis-named the empty, or the location can be derived based on other markers - em= GetOrCreateEmpty(err[2]) + em= getOrCreateEmpty(err[2]) + em.layers= LAYERS_MARKER else: abort() #abend if DEBUG==100: status("Nodes Updated") return nodes #nodes may be updated @@ -411,8 +412,9 @@ def makeConstIK(prefix,pbone,const): #Blender 246 only supports one IK Solver per bone, but we might want many, # so we need to create a reference empty named after the bone # that floats between the markers, so the bone can point to it as a singularity - myob= GetOrCreateEmpty(prefix+pbone.name) - # note that this empty gets all the IK constraints added on + myob= getOrCreateEmpty(IK_PREFIX+prefix+pbone.name) + myob.layers= LAYERS_IK + # note that this empty gets all the IK constraints added on as location constraints myconst= myob.constraints.append(Constraint.Type.COPYLOC) myconst.name=const[0]+"-"+const[1] myconst[Constraint.Settings.TARGET]= Blender.Object.Get(const[1]) @@ -438,15 +440,18 @@ def makeConstTT(pbone,const): myconst= pbone.constraints.append(Constraint.Type.TRACKTO) myconst.name=const[0]+"-"+const[1] debug(70,"%s %s" % (myconst,const[3])) - myob= GetOrCreateEmpty(const[1]) - myconst[BCS.TARGET]= myob - myconst.influence = const[2] - #const[3] is the Track and the thrird char is the Up indicator - myconst[BCS.TRACK]= trackto[const[3][0:2].lower()] - myconst[BCS.UP]=trackup[const[3][2].lower()]#up direction - myconst[BCS.OWNERSPACE]= BCS.SPACE_LOCAL - myconst[BCS.TARGETSPACE]= [BCS.SPACE_LOCAL] - if const[3][1]==const[3][2]: debug(0,"WARNING: Track To axis and up axis should not be the same. Constraint is INACTIVE") + myob= getEmpty(const[1]) + if myob!= None: + myconst[BCS.TARGET]= myob + myconst.influence = const[2] + #const[3] is the Track and the thrird char is the Up indicator + myconst[BCS.TRACK]= trackto[const[3][0:2].lower()] + myconst[BCS.UP]=trackup[const[3][2].lower()]#up direction + myconst[BCS.OWNERSPACE]= BCS.SPACE_LOCAL + myconst[BCS.TARGETSPACE]= [BCS.SPACE_LOCAL] + if const[3][1]==const[3][2]: debug(0,"WARNING: Track To axis and up axis should not be the same. Constraint is INACTIVE") + else: #marker not found. could be missing from this file, or an error in node spec + error("TrackTo Constraint for %s |specifies unknown marker %s" % (pbone.name,const[1])) return def makePoses(prefix,arm_ob,nodes): # pose this armature object based on node requirements @@ -543,15 +548,16 @@ def makeCloud(Nmarkers,markerList,StartFrame,EndFrame,Markers): for i in range(Nmarkers): debug(100,"%i marker %s"%(i, markerList[i])) emptyname = markerList[i] # rdw: to use meaningful names from Points parameter - em= GetOrCreateEmpty(emptyname) #in this scene + em= getOrCreateEmpty(emptyname) #in this scene + em.layers= LAYERS_MARKER #make a list of the actual empty empties.append(em) #assign it an ipo with the loc xyz curves lipo = Ipo.New("Object",em.name) ipos.append(lipo) - curvesX.append(GetOrCreateCurve(ipos[i],'LocX')) - curvesY.append(GetOrCreateCurve(ipos[i],'LocY')) - curvesZ.append(GetOrCreateCurve(ipos[i],'LocZ')) + curvesX.append(getOrCreateCurve(ipos[i],'LocX')) + curvesY.append(getOrCreateCurve(ipos[i],'LocY')) + curvesZ.append(getOrCreateCurve(ipos[i],'LocZ')) empties[i].setIpo(ipos[i]) debug(30,"Cloud of %i empties created." % len(empties)) NvideoFrames= EndFrame-StartFrame+1 diff --git a/release/windows/installer/00.sconsblender.nsi b/release/windows/installer/00.sconsblender.nsi index 338075c1b18..c96b188fb02 100644 --- a/release/windows/installer/00.sconsblender.nsi +++ b/release/windows/installer/00.sconsblender.nsi @@ -353,6 +353,7 @@ Section "Blender-VERSION (required)" SecCopyUI SetOutPath $INSTDIR ; Write the installation path into the registry WriteRegStr HKLM SOFTWARE\BlenderFoundation "Install_Dir" "$INSTDIR" + WriteRegStr HKLM SOFTWARE\BlenderFoundation "Home_Dir" "$BLENDERHOME" ; Write the uninstall keys for Windows WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "DisplayName" "Blender (remove only)" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "UninstallString" '"$INSTDIR\uninstall.exe"' @@ -406,28 +407,32 @@ SectionEnd UninstallText "This will uninstall Blender VERSION. Hit next to continue." Section "Uninstall" + Delete $INSTDIR\uninstall.exe + + ReadRegStr $BLENDERHOME HKLM "SOFTWARE\BlenderFoundation" "Home_Dir" + ; remove registry keys DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" DeleteRegKey HKLM SOFTWARE\BlenderFoundation ; remove files [DELROOTDIRCONTS] - Delete $INSTDIR\.blender\.bfont.ttf - Delete $INSTDIR\.blender\.Blanguages + Delete $BLENDERHOME\.blender\.bfont.ttf + Delete $BLENDERHOME\.blender\.Blanguages ; remove shortcuts, if any. Delete "$SMPROGRAMS\Blender Foundation\Blender\*.*" Delete "$DESKTOP\Blender.lnk" ; remove directories used. - RMDir /r $INSTDIR\.blender\locale + RMDir /r $BLENDERHOME\.blender\locale MessageBox MB_YESNO "Erase .blender\scripts folder? (ALL contents will be erased!)" IDNO Next - RMDir /r $INSTDIR\.blender\scripts - RMDir /r $INSTDIR\.blender\scripts\bpymodules - RMDir /r $INSTDIR\.blender\scripts\bpydata - RMDir /r $INSTDIR\.blender\scripts\bpydata\config + RMDir /r $BLENDERHOME\.blender\scripts + RMDir /r $BLENDERHOME\.blender\scripts\bpymodules + RMDir /r $BLENDERHOME\.blender\scripts\bpydata + RMDir /r $BLENDERHOME\.blender\scripts\bpydata\config Next: - RMDir /r $INSTDIR\plugins\include - RMDir /r $INSTDIR\plugins - RMDir $INSTDIR\.blender + RMDir /r $BLENDERHOME\plugins\include + RMDir /r $BLENDERHOME\plugins + RMDir $BLENDERHOME\.blender RMDir "$SMPROGRAMS\Blender Foundation\Blender" RMDir "$SMPROGRAMS\Blender Foundation" RMDir "$INSTDIR" diff --git a/source/blender/blenkernel/BKE_bmesh.h b/source/blender/blenkernel/BKE_bmesh.h index 51a5d29dbb7..8ec7144faf6 100644 --- a/source/blender/blenkernel/BKE_bmesh.h +++ b/source/blender/blenkernel/BKE_bmesh.h @@ -39,12 +39,12 @@ #include "DNA_listBase.h" #include "BLI_ghash.h" +#include "BLI_mempool.h" #include "BLI_memarena.h" #include "DNA_image_types.h" #include "BLI_editVert.h" #include "BKE_DerivedMesh.h" #include "transform.h" -#include "BKE_bmeshCustomData.h" /*forward declerations*/ struct BME_Vert; @@ -53,13 +53,6 @@ struct BME_Poly; struct BME_Loop; -/*structure for fast memory allocation/frees*/ -typedef struct BME_mempool{ - struct ListBase chunks; - int esize, csize, pchunk; /*size of elements and chunks in bytes and number of elements per chunk*/ - struct BME_freenode *free; /*free element list. Interleaved into chunk datas.*/ -}BME_mempool; - /*Notes on further structure Cleanup: -Remove the tflags, they belong in custom data layers -Remove the eflags completely, they are mostly not used @@ -78,10 +71,10 @@ typedef struct BME_Mesh { ListBase verts, edges, polys; /*memory pools used for storing mesh elements*/ - struct BME_mempool *vpool; - struct BME_mempool *epool; - struct BME_mempool *ppool; - struct BME_mempool *lpool; + struct BLI_mempool *vpool; + struct BLI_mempool *epool; + struct BLI_mempool *ppool; + struct BLI_mempool *lpool; /*some scratch arrays used by eulers*/ struct BME_Vert **vtar; struct BME_Edge **edar; @@ -90,7 +83,7 @@ typedef struct BME_Mesh int vtarlen, edarlen, lparlen, plarlen; int totvert, totedge, totpoly, totloop; /*record keeping*/ int nextv, nexte, nextp, nextl; /*Next element ID for verts/edges/faces/loops. Never reused*/ - struct BME_CustomData vdata, edata, pdata, ldata; /*Custom Data Layer information*/ + struct CustomData vdata, edata, pdata, ldata; /*Custom Data Layer information*/ } BME_Mesh; typedef struct BME_Vert @@ -169,7 +162,7 @@ int BME_radial_find_face(struct BME_Edge *e,struct BME_Poly *f); struct BME_Loop *BME_loop_find_loop(struct BME_Poly *f, struct BME_Vert *v); /*MESH CREATION/DESTRUCTION*/ -struct BME_Mesh *BME_make_mesh(int allocsize[4], struct BME_CustomDataInit init[4]); +struct BME_Mesh *BME_make_mesh(int allocsize[4]); void BME_free_mesh(struct BME_Mesh *bm); /*FULL MESH VALIDATION*/ int BME_validate_mesh(struct BME_Mesh *bm, int halt); diff --git a/source/blender/blenkernel/BKE_bmeshCustomData.h b/source/blender/blenkernel/BKE_bmeshCustomData.h index 423f75e532d..4f5f2641f54 100644 --- a/source/blender/blenkernel/BKE_bmeshCustomData.h +++ b/source/blender/blenkernel/BKE_bmeshCustomData.h @@ -38,7 +38,7 @@ #ifndef BKE_BMESHCUSTOMDATA_H #define BKE_BMESHCUSTOMDATA_H -struct BME_mempool; +struct BLI_mempool; /*Custom Data Types and defines Eventual plan is to move almost everything to custom data and let caller @@ -62,7 +62,7 @@ typedef struct BME_CustomDataLayer { typedef struct BME_CustomData { struct BME_CustomDataLayer *layers; /*Custom Data Layers*/ - struct BME_mempool *pool; /*pool for alloc of blocks*/ + struct BLI_mempool *pool; /*pool for alloc of blocks*/ int totlayer, totsize; /*total layers and total size in bytes of each block*/ } BME_CustomData; diff --git a/source/blender/blenkernel/BKE_cloth.h b/source/blender/blenkernel/BKE_cloth.h index 2e5da236a89..f3c13d3d820 100644 --- a/source/blender/blenkernel/BKE_cloth.h +++ b/source/blender/blenkernel/BKE_cloth.h @@ -208,7 +208,7 @@ typedef enum //////////////////////////////////////////////// // needed for implicit.c -int cloth_bvh_objcollision ( ClothModifierData * clmd, float step, float dt ); +int cloth_bvh_objcollision ( Object *ob, ClothModifierData * clmd, float step, float dt ); //////////////////////////////////////////////// diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h index d0535f1752e..e84c7d30956 100644 --- a/source/blender/blenkernel/BKE_customdata.h +++ b/source/blender/blenkernel/BKE_customdata.h @@ -40,6 +40,8 @@ extern const CustomDataMask CD_MASK_BAREMESH; extern const CustomDataMask CD_MASK_MESH; extern const CustomDataMask CD_MASK_EDITMESH; extern const CustomDataMask CD_MASK_DERIVEDMESH; +extern const CustomDataMask CD_MASK_BMESH; +extern const CustomDataMask CD_MASK_FACECORNERS; /* for ORIGINDEX layer type, indicates no original index for this element */ #define ORIGINDEX_NONE -1 @@ -134,6 +136,9 @@ void CustomData_copy_data(const struct CustomData *source, void CustomData_em_copy_data(const struct CustomData *source, struct CustomData *dest, void *src_block, void **dest_block); +void CustomData_bmesh_copy_data(const struct CustomData *source, + struct CustomData *dest,void *src_block, + void **dest_block); /* frees data in a CustomData object * return 1 on success, 0 on failure @@ -160,6 +165,10 @@ void CustomData_interp(const struct CustomData *source, struct CustomData *dest, void CustomData_em_interp(struct CustomData *data, void **src_blocks, float *weights, float *sub_weights, int count, void *dest_block); +void CustomData_bmesh_interp(struct CustomData *data, void **src_blocks, + float *weights, float *sub_weights, int count, + void *dest_block); + /* swaps the data in the element corners, to new corners with indices as specified in corner_indices. for edges this is an array of length 2, for @@ -172,6 +181,8 @@ void CustomData_swap(struct CustomData *data, int index, int *corner_indices); void *CustomData_get(const struct CustomData *data, int index, int type); void *CustomData_em_get(const struct CustomData *data, void *block, int type); void *CustomData_em_get_n(const struct CustomData *data, void *block, int type, int n); +void *CustomData_bmesh_get(const struct CustomData *data, void *block, int type); +void *CustomData_bmesh_get_n(const struct CustomData *data, void *block, int type, int n); /* gets a pointer to the active or first layer of type * returns NULL if there is no layer of type @@ -199,6 +210,12 @@ void CustomData_em_set(struct CustomData *data, void *block, int type, void CustomData_em_set_n(struct CustomData *data, void *block, int type, int n, void *source); +void CustomData_bmesh_set(const struct CustomData *data, void *block, int type, + void *source); + +void CustomData_bmesh_set_n(struct CustomData *data, void *block, int type, int n, + void *source); + /* set the pointer of to the first layer of type. the old data is not freed. * returns the value of ptr if the layer is found, NULL otherwise */ @@ -220,12 +237,20 @@ void CustomData_set_layer_flag(struct CustomData *data, int type, int flag); void CustomData_em_set_default(struct CustomData *data, void **block); void CustomData_em_free_block(struct CustomData *data, void **block); +void CustomData_bmesh_set_default(struct CustomData *data, void **block); +void CustomData_bmesh_free_block(struct CustomData *data, void **block); + /* copy custom data to/from layers as in mesh/derivedmesh, to editmesh blocks of data. the CustomData's must not be compatible */ void CustomData_to_em_block(const struct CustomData *source, struct CustomData *dest, int index, void **block); void CustomData_from_em_block(const struct CustomData *source, struct CustomData *dest, void *block, int index); +void CustomData_to_bmesh_block(const struct CustomData *source, + struct CustomData *dest, int src_index, void **dest_block); +void CustomData_from_bmesh_block(const struct CustomData *source, + struct CustomData *dest, void *src_block, int dest_index); + /* query info over types */ void CustomData_file_write_info(int type, char **structname, int *structnum); @@ -241,4 +266,8 @@ void CustomData_set_layer_unique_name(struct CustomData *data, int index); only after this test passes, layer->data should be assigned */ int CustomData_verify_versions(struct CustomData *data, int index); +/*BMesh specific customdata stuff*/ +void CustomData_to_bmeshpoly(struct CustomData *fdata, struct CustomData *pdata, struct CustomData *ldata); +void CustomData_from_bmeshpoly(struct CustomData *fdata, struct CustomData *pdata, struct CustomData *ldata, int total); +void CustomData_bmesh_init_pool(struct CustomData *data, int allocsize); #endif diff --git a/source/blender/blenkernel/intern/BME_Customdata.c b/source/blender/blenkernel/intern/BME_Customdata.c index 8b48efbdbd2..1fc8a4071dc 100644 --- a/source/blender/blenkernel/intern/BME_Customdata.c +++ b/source/blender/blenkernel/intern/BME_Customdata.c @@ -40,6 +40,7 @@ #include "bmesh_private.h" #include #include "MEM_guardedalloc.h" +#include "BLI_mempool.h" /********************* Layer type information **********************/ typedef struct BME_LayerTypeInfo { @@ -83,7 +84,7 @@ void BME_CD_Create(BME_CustomData *data, BME_CustomDataInit *init, int initalloc if(data->totlayer){ /*alloc memory*/ data->layers = MEM_callocN(sizeof(BME_CustomDataLayer)*data->totlayer, "BMesh Custom Data Layers"); - data->pool = BME_mempool_create(data->totsize, initalloc, initalloc); + data->pool = BLI_mempool_create(data->totsize, initalloc, initalloc); /*initialize layer data*/ for(i=0; i < BME_CD_NUMTYPES; i++){ if(init->layout[i]){ @@ -102,7 +103,7 @@ void BME_CD_Create(BME_CustomData *data, BME_CustomDataInit *init, int initalloc void BME_CD_Free(BME_CustomData *data) { - if(data->pool) BME_mempool_destroy(data->pool); + if(data->pool) BLI_mempool_destroy(data->pool); } /*Block level ops*/ @@ -119,7 +120,7 @@ void BME_CD_free_block(BME_CustomData *data, void **block) typeInfo->free((char*)*block + offset, 1, typeInfo->size); } } - BME_mempool_free(data->pool, *block); + BLI_mempool_free(data->pool, *block); *block = NULL; } @@ -130,7 +131,7 @@ static void BME_CD_alloc_block(BME_CustomData *data, void **block) if (*block) BME_CD_free_block(data, block); //if we copy layers that have their own free functions like deformverts if (data->totsize > 0) - *block = BME_mempool_alloc(data->pool); + *block = BLI_mempool_alloc(data->pool); else *block = NULL; } diff --git a/source/blender/blenkernel/intern/BME_conversions.c b/source/blender/blenkernel/intern/BME_conversions.c index 08483711c45..daf0de5b748 100644 --- a/source/blender/blenkernel/intern/BME_conversions.c +++ b/source/blender/blenkernel/intern/BME_conversions.c @@ -33,6 +33,7 @@ */ #include "MEM_guardedalloc.h" +#include "BKE_customdata.h" #include "DNA_listBase.h" #include "DNA_meshdata_types.h" @@ -55,10 +56,199 @@ #include "BSE_edit.h" +/*merge these functions*/ +static void BME_DMcorners_to_loops(BME_Mesh *bm, CustomData *facedata, int index, BME_Poly *f, int numCol, int numTex){ + int i, j; + BME_Loop *l; + MTFace *texface; + MTexPoly *texpoly; + MCol *mcol; + MLoopCol *mloopcol; + MLoopUV *mloopuv; + + for(i=0; i< numTex; i++){ + texface = CustomData_get_layer_n(facedata, CD_MTFACE, i); + texpoly = CustomData_bmesh_get_n(&bm->pdata, f->data, CD_MTEXPOLY, i); + + texpoly->tpage = texface[index].tpage; + texpoly->flag = texface[index].flag; + texpoly->transp = texface[index].transp; + texpoly->mode = texface[index].mode; + texpoly->tile = texface[index].tile; + texpoly->unwrap = texface[index].unwrap; + + j = 0; + l = f->loopbase; + do{ + mloopuv = CustomData_bmesh_get_n(&bm->ldata, l->data, CD_MLOOPUV, i); + mloopuv->uv[0] = texface[index].uv[j][0]; + mloopuv->uv[1] = texface[index].uv[j][1]; + j++; + l = l->next; + }while(l!=f->loopbase); + } + + for(i=0; i < numCol; i++){ + mcol = CustomData_get_layer_n(facedata, CD_MCOL, i); + j = 0; + l = f->loopbase; + do{ + mloopcol = CustomData_bmesh_get_n(&bm->ldata, l->data, CD_MLOOPCOL, i); + mloopcol->r = mcol[(index*4)+j].r; + mloopcol->g = mcol[(index*4)+j].g; + mloopcol->b = mcol[(index*4)+j].b; + mloopcol->a = mcol[(index*4)+j].a; + j++; + l = l->next; + }while(l!=f->loopbase); + } +} + +static void BME_DMloops_to_corners(BME_Mesh *bm, CustomData *facedata, int index, BME_Poly *f,int numCol, int numTex){ + int i, j; + BME_Loop *l; + MTFace *texface; + MTexPoly *texpoly; + MCol *mcol; + MLoopCol *mloopcol; + MLoopUV *mloopuv; + + for(i=0; i < numTex; i++){ + texface = CustomData_get_layer_n(facedata, CD_MTFACE, i); + texpoly = CustomData_bmesh_get_n(&bm->pdata, f->data, CD_MTEXPOLY, i); + + texface[index].tpage = texpoly->tpage; + texface[index].flag = texpoly->flag; + texface[index].transp = texpoly->transp; + texface[index].mode = texpoly->mode; + texface[index].tile = texpoly->tile; + texface[index].unwrap = texpoly->unwrap; + + j = 0; + l = f->loopbase; + do{ + mloopuv = CustomData_bmesh_get_n(&bm->ldata, l->data, CD_MLOOPUV, i); + texface[index].uv[j][0] = mloopuv->uv[0]; + texface[index].uv[j][1] = mloopuv->uv[1]; + j++; + l = l->next; + }while(l!=f->loopbase); + + } + for(i=0; i < numCol; i++){ + mcol = CustomData_get_layer_n(facedata,CD_MCOL, i); + j = 0; + l = f->loopbase; + do{ + mloopcol = CustomData_bmesh_get_n(&bm->ldata, l->data, CD_MLOOPCOL, i); + mcol[(index*4) + j].r = mloopcol->r; + mcol[(index*4) + j].g = mloopcol->g; + mcol[(index*4) + j].b = mloopcol->b; + mcol[(index*4) + j].a = mloopcol->a; + j++; + l = l->next; + }while(l!=f->loopbase); + } +} + + +static void BME_corners_to_loops(BME_Mesh *bm, CustomData *facedata, void *face_block, BME_Poly *f,int numCol, int numTex){ + int i, j; + BME_Loop *l; + MTFace *texface; + MTexPoly *texpoly; + MCol *mcol; + MLoopCol *mloopcol; + MLoopUV *mloopuv; + + for(i=0; i < numTex; i++){ + texface = CustomData_em_get_n(facedata, face_block, CD_MTFACE, i); + texpoly = CustomData_bmesh_get_n(&bm->pdata, f->data, CD_MTEXPOLY, i); + + texpoly->tpage = texface->tpage; + texpoly->flag = texface->flag; + texpoly->transp = texface->transp; + texpoly->mode = texface->mode; + texpoly->tile = texface->tile; + texpoly->unwrap = texface->unwrap; + + j = 0; + l = f->loopbase; + do{ + mloopuv = CustomData_bmesh_get_n(&bm->ldata, l->data, CD_MLOOPUV, i); + mloopuv->uv[0] = texface->uv[j][0]; + mloopuv->uv[1] = texface->uv[j][1]; + j++; + l = l->next; + }while(l!=f->loopbase); + + } + for(i=0; i < numCol; i++){ + mcol = CustomData_em_get_n(facedata, face_block, CD_MCOL, i); + j = 0; + l = f->loopbase; + do{ + mloopcol = CustomData_bmesh_get_n(&bm->ldata, l->data, CD_MLOOPCOL, i); + mloopcol->r = mcol[j].r; + mloopcol->g = mcol[j].g; + mloopcol->b = mcol[j].b; + mloopcol->a = mcol[j].a; + j++; + l = l->next; + }while(l!=f->loopbase); + } +} + +static void BME_loops_to_corners(BME_Mesh *bm, CustomData *facedata, void *face_block, BME_Poly *f,int numCol, int numTex){ + int i, j; + BME_Loop *l; + MTFace *texface; + MTexPoly *texpoly; + MCol *mcol; + MLoopCol *mloopcol; + MLoopUV *mloopuv; + + for(i=0; i < numTex; i++){ + texface = CustomData_em_get_n(facedata, face_block, CD_MTFACE, i); + texpoly = CustomData_bmesh_get_n(&bm->pdata, f->data, CD_MTEXPOLY, i); + + texface->tpage = texpoly->tpage; + texface->flag = texpoly->flag; + texface->transp = texpoly->transp; + texface->mode = texpoly->mode; + texface->tile = texpoly->tile; + texface->unwrap = texpoly->unwrap; + + j = 0; + l = f->loopbase; + do{ + mloopuv = CustomData_bmesh_get_n(&bm->ldata, l->data, CD_MLOOPUV, i); + texface->uv[j][0] = mloopuv->uv[0]; + texface->uv[j][1] = mloopuv->uv[1]; + j++; + l = l->next; + }while(l!=f->loopbase); + + } + for(i=0; i < numCol; i++){ + mcol = CustomData_em_get_n(facedata, face_block, CD_MCOL, i); + j = 0; + l = f->loopbase; + do{ + mloopcol = CustomData_bmesh_get_n(&bm->ldata, l->data, CD_MLOOPCOL, i); + mcol[j].r = mloopcol->r; + mcol[j].g = mloopcol->g; + mcol[j].b = mloopcol->b; + mcol[j].a = mloopcol->a; + j++; + l = l->next; + }while(l!=f->loopbase); + } +} +/*move the EditMesh conversion functions to editmesh_tools.c*/ BME_Mesh *BME_editmesh_to_bmesh(EditMesh *em) { BME_Mesh *bm; - int allocsize[4] = {512,512,2048,512}; - BME_CustomDataInit *init = MEM_callocN(sizeof(BME_CustomDataInit) * 4, "Bmesh custom data init"); + int allocsize[4] = {512,512,2048,512}, numTex, numCol; BME_Vert *v1, *v2; BME_Edge *e, *edar[4]; BME_Poly *f; @@ -68,9 +258,25 @@ BME_Mesh *BME_editmesh_to_bmesh(EditMesh *em) { EditFace *efa; int len; - bm = BME_make_mesh(allocsize,init); + bm = BME_make_mesh(allocsize); + + /*copy custom data layout*/ + CustomData_copy(&em->vdata, &bm->vdata, CD_MASK_BMESH, CD_CALLOC, 0); + CustomData_copy(&em->edata, &bm->edata, CD_MASK_BMESH, CD_CALLOC, 0); + CustomData_copy(&em->fdata, &bm->pdata, CD_MASK_BMESH, CD_CALLOC, 0); + + /*copy face corner data*/ + CustomData_to_bmeshpoly(&em->fdata, &bm->pdata, &bm->ldata); + /*initialize memory pools*/ + CustomData_bmesh_init_pool(&bm->vdata, allocsize[0]); + CustomData_bmesh_init_pool(&bm->edata, allocsize[1]); + CustomData_bmesh_init_pool(&bm->ldata, allocsize[2]); + CustomData_bmesh_init_pool(&bm->pdata, allocsize[3]); + /*needed later*/ + numTex = CustomData_number_of_layers(&bm->pdata, CD_MTEXPOLY); + numCol = CustomData_number_of_layers(&bm->ldata, CD_MLOOPCOL); + BME_model_begin(bm); - /*add verts*/ eve= em->verts.first; while(eve) { @@ -79,9 +285,8 @@ BME_Mesh *BME_editmesh_to_bmesh(EditMesh *em) { v1->flag = eve->f; v1->h = eve->h; v1->bweight = eve->bweight; - - /* link the verts for edge and face construction; - * kind of a dangerous thing - remember to cast back to BME_Vert before using! */ + /*Copy Custom Data*/ + CustomData_bmesh_copy_data(&em->vdata, &bm->vdata, eve->data, &v1->data); eve->tmp.v = (EditVert*)v1; eve = eve->next; } @@ -99,13 +304,10 @@ BME_Mesh *BME_editmesh_to_bmesh(EditMesh *em) { if(eed->seam) e->flag |= ME_SEAM; if(eed->h & EM_FGON) e->flag |= ME_FGON; if(eed->h & 1) e->flag |= ME_HIDE; - - /* link the edges for face construction; - * kind of a dangerous thing - remember to cast back to BME_Edge before using! */ eed->tmp.e = (EditEdge*)e; + CustomData_bmesh_copy_data(&em->edata, &bm->edata, eed->data, &e->data); eed = eed->next; } - /*add faces.*/ efa= em->faces.first; while(efa) { @@ -134,13 +336,13 @@ BME_Mesh *BME_editmesh_to_bmesh(EditMesh *em) { if(efa->f & 1) f->flag |= ME_FACE_SEL; else f->flag &= ~ME_FACE_SEL; } + CustomData_bmesh_copy_data(&em->fdata, &bm->pdata, efa->data, &f->data); + BME_corners_to_loops(bm, &em->fdata, efa->data, f,numCol,numTex); efa = efa->next; } BME_model_end(bm); - MEM_freeN(init); return bm; } - /* adds the geometry in the bmesh to G.editMesh (does not free G.editMesh) * if td != NULL, the transdata will be mapped to the EditVert's co */ EditMesh *BME_bmesh_to_editmesh(BME_Mesh *bm, BME_TransData_Head *td) { @@ -155,12 +357,21 @@ EditMesh *BME_bmesh_to_editmesh(BME_Mesh *bm, BME_TransData_Head *td) { EditEdge *eed; EditFace *efa; - int totvert, len, i; + int totvert, len, i, numTex, numCol; em = G.editMesh; if (em == NULL) return NULL; + + CustomData_copy(&bm->vdata, &em->vdata, CD_MASK_BMESH, CD_CALLOC, 0); + CustomData_copy(&bm->edata, &em->edata, CD_MASK_BMESH, CD_CALLOC, 0); + CustomData_copy(&bm->pdata, &em->fdata, CD_MASK_BMESH, CD_CALLOC, 0); + CustomData_from_bmeshpoly(&em->fdata, &bm->pdata, &bm->ldata,0); + numTex = CustomData_number_of_layers(&bm->pdata, CD_MTEXPOLY); + numCol = CustomData_number_of_layers(&bm->ldata, CD_MLOOPCOL); + + /* convert to EditMesh */ /* make editverts */ totvert = BLI_countlist(&(bm->verts)); @@ -176,6 +387,7 @@ EditMesh *BME_bmesh_to_editmesh(BME_Mesh *bm, BME_TransData_Head *td) { eve1->f = (unsigned char)v1->flag; eve1->h = (unsigned char)v1->h; eve1->bweight = v1->bweight; + CustomData_em_copy_data(&bm->vdata, &em->vdata, v1->data, &eve1->data); } /* make edges */ @@ -191,6 +403,8 @@ EditMesh *BME_bmesh_to_editmesh(BME_Mesh *bm, BME_TransData_Head *td) { if(e->flag & ME_HIDE) eed->h |= 1; if(G.scene->selectmode==SCE_SELECT_EDGE) EM_select_edge(eed, eed->f & SELECT); + + CustomData_em_copy_data(&bm->edata, &em->edata, e->data, &eed->data); } } @@ -217,6 +431,8 @@ EditMesh *BME_bmesh_to_editmesh(BME_Mesh *bm, BME_TransData_Head *td) { if(f->flag & ME_HIDE) efa->h= 1; if((G.f & G_FACESELECT) && (efa->f & SELECT)) EM_select_face(efa, 1); /* flush down */ + CustomData_em_copy_data(&bm->pdata, &em->fdata, f->data, &efa->data); + BME_loops_to_corners(bm, &em->fdata, efa->data, f,numCol,numTex); } } @@ -234,18 +450,33 @@ BME_Mesh *BME_derivedmesh_to_bmesh(DerivedMesh *dm) BME_Mesh *bm; int allocsize[4] = {512,512,2048,512}; - BME_CustomDataInit *init = MEM_callocN(sizeof(BME_CustomDataInit) * 4, "Bmesh custom data init"); MVert *mvert, *mv; MEdge *medge, *me; MFace *mface, *mf; - int totface,totedge,totvert,i,len; + int totface,totedge,totvert,i,len, numTex, numCol; BME_Vert *v1=NULL,*v2=NULL, **vert_array; BME_Edge *e=NULL; BME_Poly *f=NULL; EdgeHash *edge_hash = BLI_edgehash_new(); - bm = BME_make_mesh(allocsize,init); + bm = BME_make_mesh(allocsize); + /*copy custom data layout*/ + CustomData_copy(&dm->vertData, &bm->vdata, CD_MASK_BMESH, CD_CALLOC, 0); + CustomData_copy(&dm->edgeData, &bm->edata, CD_MASK_BMESH, CD_CALLOC, 0); + CustomData_copy(&dm->faceData, &bm->pdata, CD_MASK_BMESH, CD_CALLOC, 0); + + /*copy face corner data*/ + CustomData_to_bmeshpoly(&dm->faceData, &bm->pdata, &bm->ldata); + /*initialize memory pools*/ + CustomData_bmesh_init_pool(&bm->vdata, allocsize[0]); + CustomData_bmesh_init_pool(&bm->edata, allocsize[1]); + CustomData_bmesh_init_pool(&bm->ldata, allocsize[2]); + CustomData_bmesh_init_pool(&bm->pdata, allocsize[3]); + /*needed later*/ + numTex = CustomData_number_of_layers(&bm->pdata, CD_MTEXPOLY); + numCol = CustomData_number_of_layers(&bm->ldata, CD_MLOOPCOL); + totvert = dm->getNumVerts(dm); totedge = dm->getNumEdges(dm); totface = dm->getNumFaces(dm); @@ -262,6 +493,7 @@ BME_Mesh *BME_derivedmesh_to_bmesh(DerivedMesh *dm) vert_array[i] = v1; v1->flag = mv->flag; v1->bweight = mv->bweight/255.0f; + CustomData_to_bmesh_block(&dm->vertData, &bm->vdata, i, &v1->data); } /*add edges*/ for(i=0,me = medge; i < totedge;i++,me++){ @@ -272,6 +504,7 @@ BME_Mesh *BME_derivedmesh_to_bmesh(DerivedMesh *dm) e->bweight = me->bweight/255.0f; e->flag = (unsigned char)me->flag; BLI_edgehash_insert(edge_hash,me->v1,me->v2,e); + CustomData_to_bmesh_block(&dm->edgeData, &bm->edata, i, &e->data); } /*add faces.*/ for(i=0,mf = mface; i < totface;i++,mf++){ @@ -295,12 +528,13 @@ BME_Mesh *BME_derivedmesh_to_bmesh(DerivedMesh *dm) f = BME_MF(bm,v1,v2,edar,len); f->mat_nr = mf->mat_nr; f->flag = mf->flag; + CustomData_to_bmesh_block(&dm->faceData,&bm->pdata,i,&f->data); + BME_DMcorners_to_loops(bm, &dm->faceData,i,f, numCol,numTex); } BME_model_end(bm); BLI_edgehash_free(edge_hash, NULL); MEM_freeN(vert_array); - MEM_freeN(init); return bm; } @@ -309,7 +543,7 @@ DerivedMesh *BME_bmesh_to_derivedmesh(BME_Mesh *bm, DerivedMesh *dm) MFace *mface, *mf; MEdge *medge, *me; MVert *mvert, *mv; - int totface,totedge,totvert,i,bmeshok,len; + int totface,totedge,totvert,i,bmeshok,len, numTex, numCol; BME_Vert *v1=NULL; BME_Edge *e=NULL, *oe=NULL; @@ -345,12 +579,21 @@ DerivedMesh *BME_bmesh_to_derivedmesh(BME_Mesh *bm, DerivedMesh *dm) /*convert back to mesh*/ result = CDDM_from_template(dm,totvert,totedge,totface); + CustomData_merge(&bm->vdata, &result->vertData, CD_MASK_BMESH, CD_CALLOC, totvert); + CustomData_merge(&bm->edata, &result->edgeData, CD_MASK_BMESH, CD_CALLOC, totedge); + CustomData_merge(&bm->pdata, &result->faceData, CD_MASK_BMESH, CD_CALLOC, totface); + CustomData_from_bmeshpoly(&result->faceData, &bm->pdata, &bm->ldata,totface); + numTex = CustomData_number_of_layers(&bm->pdata, CD_MTEXPOLY); + numCol = CustomData_number_of_layers(&bm->ldata, CD_MLOOPCOL); + + /*Make Verts*/ mvert = CDDM_get_verts(result); for(i=0,v1=bm->verts.first,mv=mvert;v1;v1=v1->next,i++,mv++){ VECCOPY(mv->co,v1->co); mv->flag = (unsigned char)v1->flag; mv->bweight = (char)(255.0*v1->bweight); + CustomData_from_bmesh_block(&bm->vdata, &result->vertData, &v1->data, i); } medge = CDDM_get_edges(result); i=0; @@ -368,6 +611,7 @@ DerivedMesh *BME_bmesh_to_derivedmesh(BME_Mesh *bm, DerivedMesh *dm) me->crease = (char)(255.0*e->crease); me->bweight = (char)(255.0*e->bweight); me->flag = e->flag; + CustomData_from_bmesh_block(&bm->edata, &result->edgeData, &e->data, i); me++; i++; } @@ -389,9 +633,11 @@ DerivedMesh *BME_bmesh_to_derivedmesh(BME_Mesh *bm, DerivedMesh *dm) if(mf->v3 == 0 || (len == 4 && mf->v4 == 0)){ test_index_face(mf, NULL, i, len); } - i++; mf->mat_nr = (unsigned char)f->mat_nr; mf->flag = (unsigned char)f->flag; + CustomData_from_bmesh_block(&bm->pdata, &result->faceData, &f->data, i); + BME_DMloops_to_corners(bm, &result->faceData, i, f,numCol,numTex); + i++; } } } diff --git a/source/blender/blenkernel/intern/BME_eulers.c b/source/blender/blenkernel/intern/BME_eulers.c index 3403f5829fe..801e0b8bdec 100644 --- a/source/blender/blenkernel/intern/BME_eulers.c +++ b/source/blender/blenkernel/intern/BME_eulers.c @@ -39,6 +39,7 @@ #include "DNA_mesh_types.h" #include "BKE_utildefines.h" +#include "BKE_customdata.h" #include "BKE_bmesh.h" #include "BLI_blenlib.h" @@ -618,8 +619,8 @@ BME_Poly *BME_SFME(BME_Mesh *bm, BME_Poly *f, BME_Vert *v1, BME_Vert *v2, BME_Lo BME_disk_append_edge(e, v2); f2 = BME_addpolylist(bm,f); - f1loop = BME_create_loop(bm,v2,e,f,NULL); - f2loop = BME_create_loop(bm,v1,e,f2,NULL); + f1loop = BME_create_loop(bm,v2,e,f,v2loop); + f2loop = BME_create_loop(bm,v1,e,f2,v1loop); f1loop->prev = v2loop->prev; f2loop->prev = v1loop->prev; @@ -663,16 +664,16 @@ BME_Poly *BME_SFME(BME_Mesh *bm, BME_Poly *f, BME_Vert *v1, BME_Vert *v2, BME_Lo * Takes a an edge and pointer to one of its vertices and collapses * the edge on that vertex. * - * Before: OE KE + * Before: OE KE * ------- ------- * | || | - * OV KV TV + * OV KV TV * * * After: OE * --------------- * | | - * OV TV + * OV TV * * * Restrictions: @@ -723,6 +724,8 @@ int BME_JEKV(BME_Mesh *bm, BME_Edge *ke, BME_Vert *kv) /*remove ke from tv's disk cycle*/ BME_disk_remove_edge(ke, tv); + + /*deal with radial cycle of ke*/ if(ke->loop){ /*first step, fix the neighboring loops of all loops in ke's radial cycle*/ @@ -763,6 +766,7 @@ int BME_JEKV(BME_Mesh *bm, BME_Edge *ke, BME_Vert *kv) } + /*Validate disk cycles*/ diskbase = BME_disk_getpointer(ov->edge,ov); edok = BME_cycle_validate(valance1, diskbase); diff --git a/source/blender/blenkernel/intern/BME_mesh.c b/source/blender/blenkernel/intern/BME_mesh.c index 184ef2b8a0e..ad46a7c1eb7 100644 --- a/source/blender/blenkernel/intern/BME_mesh.c +++ b/source/blender/blenkernel/intern/BME_mesh.c @@ -32,64 +32,33 @@ * ***** END GPL LICENSE BLOCK ***** */ + #include "MEM_guardedalloc.h" - #include "DNA_listBase.h" -#include "DNA_meshdata_types.h" -#include "DNA_mesh_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" - - +#include "BLI_blenlib.h" #include "BKE_utildefines.h" #include "BKE_bmesh.h" -#include "BKE_global.h" -#include "BKE_depsgraph.h" -#include "BLI_blenlib.h" -#include "BLI_editVert.h" -#include "BIF_editmesh.h" -#include "BIF_space.h" -#include "editmesh.h" #include "bmesh_private.h" -#include "mydevice.h" - -#include "BSE_edit.h" /* * BME MAKE MESH * * Allocates a new BME_Mesh structure. - * The arguments are two arrays, one of type int - * and another of type BME_CustomDataInit. The first array - * contains the allocation size for each element pool in - * the mesh. For instance allocsize[0] contains the number - * of vertices to allocate at a time for the vertex pool. - * - * The second array contains structures describing the layout - * of custom data for each element type in the mesh. So init[0] - * contains the custom data layout information for vertices, init[1] - * the layout information for edges and so on. - * * Returns - * Pointer to a Bmesh * */ -BME_Mesh *BME_make_mesh(int allocsize[4], BME_CustomDataInit init[4]) +BME_Mesh *BME_make_mesh(int allocsize[4]) { /*allocate the structure*/ BME_Mesh *bm = MEM_callocN(sizeof(BME_Mesh),"BMesh"); /*allocate the memory pools for the mesh elements*/ - bm->vpool = BME_mempool_create(sizeof(BME_Vert), allocsize[0], allocsize[0]); - bm->epool = BME_mempool_create(sizeof(BME_Edge), allocsize[1], allocsize[1]); - bm->lpool = BME_mempool_create(sizeof(BME_Loop), allocsize[2], allocsize[2]); - bm->ppool = BME_mempool_create(sizeof(BME_Poly), allocsize[3], allocsize[3]); - /*Setup custom data layers*/ - BME_CD_Create(&bm->vdata, &init[0], allocsize[0]); - BME_CD_Create(&bm->edata, &init[1], allocsize[1]); - BME_CD_Create(&bm->ldata, &init[2], allocsize[2]); - BME_CD_Create(&bm->pdata, &init[3], allocsize[3]); + bm->vpool = BLI_mempool_create(sizeof(BME_Vert), allocsize[0], allocsize[0]); + bm->epool = BLI_mempool_create(sizeof(BME_Edge), allocsize[1], allocsize[1]); + bm->lpool = BLI_mempool_create(sizeof(BME_Loop), allocsize[2], allocsize[2]); + bm->ppool = BLI_mempool_create(sizeof(BME_Poly), allocsize[3], allocsize[3]); return bm; } /* @@ -105,26 +74,35 @@ void BME_free_mesh(BME_Mesh *bm) BME_Loop *l; BME_Poly *f; - for(v=bm->verts.first; v; v=v->next) BME_CD_free_block(&bm->vdata, &v->data); - for(e=bm->edges.first; e; e=e->next) BME_CD_free_block(&bm->edata, &e->data); + for(v=bm->verts.first; v; v=v->next) CustomData_bmesh_free_block(&bm->vdata, &v->data); + for(e=bm->edges.first; e; e=e->next) CustomData_bmesh_free_block(&bm->edata, &e->data); for(f=bm->polys.first; f; f=f->next){ - BME_CD_free_block(&bm->pdata, &f->data); + CustomData_bmesh_free_block(&bm->pdata, &f->data); l = f->loopbase; do{ - BME_CD_free_block(&bm->ldata, &l->data); + CustomData_bmesh_free_block(&bm->ldata, &l->data); l = l->next; }while(l!=f->loopbase); } + + /*Free custom data pools, This should probably go in CustomData_free?*/ + if(bm->vdata.totlayer) BLI_mempool_destroy(bm->vdata.pool); + if(bm->edata.totlayer) BLI_mempool_destroy(bm->edata.pool); + if(bm->ldata.totlayer) BLI_mempool_destroy(bm->ldata.pool); + if(bm->pdata.totlayer) BLI_mempool_destroy(bm->pdata.pool); + + /*free custom data*/ + CustomData_free(&bm->vdata,0); + CustomData_free(&bm->edata,0); + CustomData_free(&bm->ldata,0); + CustomData_free(&bm->pdata,0); + /*destroy element pools*/ - BME_mempool_destroy(bm->vpool); - BME_mempool_destroy(bm->epool); - BME_mempool_destroy(bm->ppool); - BME_mempool_destroy(bm->lpool); - /*free custom data pools*/ - BME_CD_Free(&bm->vdata); - BME_CD_Free(&bm->edata); - BME_CD_Free(&bm->ldata); - BME_CD_Free(&bm->pdata); + BLI_mempool_destroy(bm->vpool); + BLI_mempool_destroy(bm->epool); + BLI_mempool_destroy(bm->ppool); + BLI_mempool_destroy(bm->lpool); + MEM_freeN(bm); } diff --git a/source/blender/blenkernel/intern/BME_structure.c b/source/blender/blenkernel/intern/BME_structure.c index cbf780c6467..ca27f5efd10 100644 --- a/source/blender/blenkernel/intern/BME_structure.c +++ b/source/blender/blenkernel/intern/BME_structure.c @@ -41,101 +41,6 @@ #include "BLI_blenlib.h" #include "BLI_linklist.h" #include "BLI_ghash.h" - -#include "BKE_customdata.h" - -/* - Simple, fast memory allocator for allocating many elements of the same size. -*/ -typedef struct BME_mempool_chunk{ - struct BME_mempool_chunk *next, *prev; - void *data; -}BME_mempool_chunk; - -/*this is just to make things prettier*/ -typedef struct BME_freenode{ - struct BME_freenode *next; -}BME_freenode; - -BME_mempool *BME_mempool_create(int esize, int tote, int pchunk) -{ BME_mempool *pool = NULL; - BME_freenode *lasttail = NULL, *curnode = NULL; - int i,j, maxchunks; - char *addr; - - /*allocate the pool structure*/ - pool = MEM_mallocN(sizeof(BME_mempool),"memory pool"); - pool->esize = esize; - pool->pchunk = pchunk; - pool->csize = esize * pchunk; - pool->chunks.first = pool->chunks.last = NULL; - - maxchunks = tote / pchunk; - - /*allocate the actual chunks*/ - for(i=0; i < maxchunks; i++){ - BME_mempool_chunk *mpchunk = MEM_mallocN(sizeof(BME_mempool_chunk), "BME_Mempool Chunk"); - mpchunk->next = mpchunk->prev = NULL; - mpchunk->data = MEM_mallocN(pool->csize, "BME Mempool Chunk Data"); - BLI_addtail(&(pool->chunks), mpchunk); - - if(i==0) pool->free = mpchunk->data; /*start of the list*/ - /*loop through the allocated data, building the pointer structures*/ - for(addr = mpchunk->data, j=0; j < pool->pchunk; j++){ - curnode = ((BME_freenode*)addr); - addr += pool->esize; - curnode->next = (BME_freenode*)addr; - } - /*final pointer in the previously allocated chunk is wrong.*/ - if(lasttail) lasttail->next = mpchunk->data; - /*set the end of this chunks memory to the new tail for next iteration*/ - lasttail = curnode; - } - /*terminate the list*/ - curnode->next = NULL; - return pool; -} - -void *BME_mempool_alloc(BME_mempool *pool){ - void *retval=NULL; - BME_freenode *curnode=NULL; - char *addr=NULL; - int j; - - if(!(pool->free)){ - /*need to allocate a new chunk*/ - BME_mempool_chunk *mpchunk = MEM_mallocN(sizeof(BME_mempool_chunk), "BME_Mempool Chunk"); - mpchunk->next = mpchunk->prev = NULL; - mpchunk->data = MEM_mallocN(pool->csize, "BME_Mempool Chunk Data"); - BLI_addtail(&(pool->chunks), mpchunk); - - pool->free = mpchunk->data; /*start of the list*/ - for(addr = mpchunk->data, j=0; j < pool->pchunk; j++){ - curnode = ((BME_freenode*)addr); - addr += pool->esize; - curnode->next = (BME_freenode*)addr; - } - curnode->next = NULL; /*terminate the list*/ - } - - retval = pool->free; - pool->free = pool->free->next; - //memset(retval, 0, pool->esize); - return retval; -} - -void BME_mempool_free(BME_mempool *pool, void *addr){ //doesnt protect against double frees, dont be stupid! - BME_freenode *newhead = addr; - newhead->next = pool->free; - pool->free = newhead; -} -void BME_mempool_destroy(BME_mempool *pool) -{ - BME_mempool_chunk *mpchunk=NULL; - for(mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) MEM_freeN(mpchunk->data); - BLI_freelistN(&(pool->chunks)); - MEM_freeN(pool); -} /** * MISC utility functions. * @@ -179,7 +84,7 @@ int BME_edge_swapverts(BME_Edge *e, BME_Vert *orig, BME_Vert *new){ BME_Vert *BME_addvertlist(BME_Mesh *bm, BME_Vert *example){ BME_Vert *v=NULL; - v = BME_mempool_alloc(bm->vpool); + v = BLI_mempool_alloc(bm->vpool); v->next = v->prev = NULL; v->EID = bm->nextv; v->co[0] = v->co[1] = v->co[2] = 0.0f; @@ -195,16 +100,16 @@ BME_Vert *BME_addvertlist(BME_Mesh *bm, BME_Vert *example){ if(example){ VECCOPY(v->co,example->co); - BME_CD_copy_data(&bm->vdata, &bm->vdata, example->data, &v->data); + CustomData_bmesh_copy_data(&bm->vdata, &bm->vdata, example->data, &v->data); } else - BME_CD_set_default(&bm->vdata, &v->data); + CustomData_bmesh_set_default(&bm->vdata, &v->data); return v; } BME_Edge *BME_addedgelist(BME_Mesh *bm, BME_Vert *v1, BME_Vert *v2, BME_Edge *example){ BME_Edge *e=NULL; - e = BME_mempool_alloc(bm->epool); + e = BLI_mempool_alloc(bm->epool); e->next = e->prev = NULL; e->EID = bm->nexte; e->v1 = v1; @@ -222,16 +127,16 @@ BME_Edge *BME_addedgelist(BME_Mesh *bm, BME_Vert *v1, BME_Vert *v2, BME_Edge *ex BLI_addtail(&(bm->edges), e); if(example) - BME_CD_copy_data(&bm->edata, &bm->edata, example->data, &e->data); + CustomData_bmesh_copy_data(&bm->edata, &bm->edata, example->data, &e->data); else - BME_CD_set_default(&bm->edata, &e->data); + CustomData_bmesh_set_default(&bm->edata, &e->data); return e; } BME_Loop *BME_create_loop(BME_Mesh *bm, BME_Vert *v, BME_Edge *e, BME_Poly *f, BME_Loop *example){ BME_Loop *l=NULL; - l = BME_mempool_alloc(bm->lpool); + l = BLI_mempool_alloc(bm->lpool); l->next = l->prev = NULL; l->EID = bm->nextl; l->radial.next = l->radial.prev = NULL; @@ -246,16 +151,16 @@ BME_Loop *BME_create_loop(BME_Mesh *bm, BME_Vert *v, BME_Edge *e, BME_Poly *f, B bm->totloop++; if(example) - BME_CD_copy_data(&bm->ldata, &bm->ldata, example->data, &l->data); + CustomData_bmesh_copy_data(&bm->ldata, &bm->ldata, example->data, &l->data); else - BME_CD_set_default(&bm->ldata, &l->data); + CustomData_bmesh_set_default(&bm->ldata, &l->data); return l; } BME_Poly *BME_addpolylist(BME_Mesh *bm, BME_Poly *example){ BME_Poly *f = NULL; - f = BME_mempool_alloc(bm->ppool); + f = BLI_mempool_alloc(bm->ppool); f->next = f->prev = NULL; f->EID = bm->nextp; f->loopbase = NULL; @@ -268,9 +173,9 @@ BME_Poly *BME_addpolylist(BME_Mesh *bm, BME_Poly *example){ bm->totpoly++; if(example) - BME_CD_copy_data(&bm->pdata, &bm->pdata, example->data, &f->data); + CustomData_bmesh_copy_data(&bm->pdata, &bm->pdata, example->data, &f->data); else - BME_CD_set_default(&bm->pdata, &f->data); + CustomData_bmesh_set_default(&bm->pdata, &f->data); return f; @@ -281,23 +186,23 @@ BME_Poly *BME_addpolylist(BME_Mesh *bm, BME_Poly *example){ */ void BME_free_vert(BME_Mesh *bm, BME_Vert *v){ bm->totvert--; - BME_CD_free_block(&bm->vdata, &v->data); - BME_mempool_free(bm->vpool, v); + CustomData_bmesh_free_block(&bm->vdata, &v->data); + BLI_mempool_free(bm->vpool, v); } void BME_free_edge(BME_Mesh *bm, BME_Edge *e){ bm->totedge--; - BME_CD_free_block(&bm->edata, &e->data); - BME_mempool_free(bm->epool, e); + CustomData_bmesh_free_block(&bm->edata, &e->data); + BLI_mempool_free(bm->epool, e); } void BME_free_poly(BME_Mesh *bm, BME_Poly *f){ bm->totpoly--; - BME_CD_free_block(&bm->pdata, &f->data); - BME_mempool_free(bm->ppool, f); + CustomData_bmesh_free_block(&bm->pdata, &f->data); + BLI_mempool_free(bm->ppool, f); } void BME_free_loop(BME_Mesh *bm, BME_Loop *l){ bm->totloop--; - BME_CD_free_block(&bm->ldata, &l->data); - BME_mempool_free(bm->lpool, l); + CustomData_bmesh_free_block(&bm->ldata, &l->data); + BLI_mempool_free(bm->lpool, l); } /** * BMESH CYCLES diff --git a/source/blender/blenkernel/intern/BME_tools.c b/source/blender/blenkernel/intern/BME_tools.c index 7ce967d1d22..90259031e5c 100644 --- a/source/blender/blenkernel/intern/BME_tools.c +++ b/source/blender/blenkernel/intern/BME_tools.c @@ -205,7 +205,53 @@ static BME_Poly *BME_split_face(BME_Mesh *bm, BME_Poly *f, BME_Vert *v1, BME_Ver return nf; } -/* a wrapper for BME_SEMV that transfers element flags */ + +static void BME_data_interp_from_verts(BME_Mesh *bm, BME_Vert *v1, BME_Vert *v2, BME_Vert *v, float fac) +{ + void *src[2]; + float w[2]; + if (v1->data && v2->data) { + src[0]= v1->data; + src[1]= v2->data; + w[0] = 1.0f-fac; + w[1] = fac; + CustomData_bmesh_interp(&bm->vdata, src, w, NULL, 2, v->data); + } +} + + +static void BME_data_facevert_edgesplit(BME_Mesh *bm, BME_Vert *v1, BME_Vert *v2, BME_Vert *v, BME_Edge *e1, float fac){ + void *src[2]; + float w[2]; + BME_Loop *l=NULL, *v1loop = NULL, *vloop = NULL, *v2loop = NULL; + + w[0] = 1.0f - fac; + w[1] = fac; + + if(!e1->loop) return; + l = e1->loop; + do{ + if(l->v == v1){ + v1loop = l; + vloop = v1loop->next; + v2loop = vloop->next; + }else if(l->v == v){ + v1loop = l->next; + vloop = l; + v2loop = l->prev; + + } + + src[0] = v1loop->data; + src[1] = v2loop->data; + + CustomData_bmesh_interp(&bm->ldata, src,w, NULL, 2, vloop->data); + l = l->radial.next->data; + }while(l!=e1->loop); +} + + +/* a wrapper for BME_SEMV that transfers element flags */ /*add custom data interpolation in here!*/ static BME_Vert *BME_split_edge(BME_Mesh *bm, BME_Vert *v, BME_Edge *e, BME_Edge **ne, float percent) { BME_Vert *nv, *v2; float len; @@ -224,10 +270,39 @@ static BME_Vert *BME_split_edge(BME_Mesh *bm, BME_Vert *v, BME_Edge *e, BME_Edge (*ne)->crease = e->crease; (*ne)->bweight = e->bweight; } - + /*v->nv->v2*/ + BME_data_facevert_edgesplit(bm,v2, v, nv, e, 0.75); return nv; } +static void BME_collapse_vert(BME_Mesh *bm, BME_Edge *ke, BME_Vert *kv, float fac){ + void *src[2]; + float w[2]; + BME_Loop *l=NULL, *kvloop=NULL, *tvloop=NULL; + BME_Vert *tv = BME_edge_getothervert(ke,kv); + + w[0] = 1.0f - fac; + w[1] = fac; + + if(ke->loop){ + l = ke->loop; + do{ + if(l->v == tv && l->next->v == kv){ + tvloop = l; + kvloop = l->next; + + src[0] = kvloop->data; + src[1] = tvloop->data; + CustomData_bmesh_interp(&bm->ldata, src,w, NULL, 2, kvloop->data); + } + l=l->radial.next->data; + }while(l!=ke->loop); + } + BME_JEKV(bm,ke,kv); +} + + + static int BME_bevel_is_split_vert(BME_Loop *l) { /* look for verts that have already been added to the edge when * beveling other polys; this can be determined by testing the @@ -315,7 +390,7 @@ static float BME_bevel_project_vec(float *vec1, float *vec2, float *up_vec, int * Finally, return the split vert. */ static BME_Vert *BME_bevel_split_edge(BME_Mesh *bm, BME_Vert *v, BME_Vert *v1, BME_Loop *l, float *up_vec, float value, BME_TransData_Head *td) { BME_TransData *vtd, *vtd1, *vtd2; - BME_Vert *sv, *v2, *v3; + BME_Vert *sv, *v2, *v3, *ov; BME_Loop *lv1, *lv2; BME_Edge *ne, *e1, *e2; float maxfactor, scale, len, dis, vec1[3], vec2[3], t_up_vec[3]; @@ -349,7 +424,11 @@ static BME_Vert *BME_bevel_split_edge(BME_Mesh *bm, BME_Vert *v, BME_Vert *v1, B else { e1 = e2; } + ov = BME_edge_getothervert(e1,v); sv = BME_split_edge(bm,v,e1,&ne,0); + //BME_data_interp_from_verts(bm, v, ov, sv, 0.25); /*this is technically wrong...*/ + //BME_data_interp_from_faceverts(bm, v, ov, sv, 0.25); + //BME_data_interp_from_faceverts(bm, ov, v, sv, 0.25); BME_assign_transdata(td, bm, sv, sv->co, sv->co, NULL, sv->co, 0, -1, -1, NULL); /* quick default */ sv->tflag1 |= BME_BEVEL_BEVEL; ne->tflag1 = BME_BEVEL_ORIG; /* mark edge as original, even though it isn't */ @@ -388,7 +467,11 @@ static BME_Vert *BME_bevel_split_edge(BME_Mesh *bm, BME_Vert *v, BME_Vert *v1, B } else { is_split_vert = 0; + ov = BME_edge_getothervert(l->e,v); sv = BME_split_edge(bm,v,l->e,&ne,0); + //BME_data_interp_from_verts(bm, v, ov, sv, 0.25); /*this is technically wrong...*/ + //BME_data_interp_from_faceverts(bm, v, ov, sv, 0.25); + //BME_data_interp_from_faceverts(bm, ov, v, sv, 0.25); BME_assign_transdata(td, bm, sv, sv->co, sv->co, NULL, sv->co, 0, -1, -1, NULL); /* quick default */ sv->tflag1 |= BME_BEVEL_BEVEL; ne->tflag1 = BME_BEVEL_ORIG; /* mark edge as original, even though it isn't */ @@ -567,12 +650,15 @@ static BME_Loop *BME_bevel_edge(BME_Mesh *bm, BME_Loop *l, float value, int opti if (kl->v == kv) { BME_split_face(bm,kl->f,kl->prev->v,kl->next->v,&nl,kl->prev->e); BME_JFKE(bm,((BME_Loop*)kl->prev->radial.next->data)->f,kl->f,kl->prev->e); - BME_JEKV(bm,kl->e,kv); + BME_collapse_vert(bm, kl->e, kv, 1.0); + //BME_JEKV(bm,kl->e,kv); + } else { BME_split_face(bm,kl->f,kl->next->next->v,kl->v,&nl,kl->next->e); BME_JFKE(bm,((BME_Loop*)kl->next->radial.next->data)->f,kl->f,kl->next->e); - BME_JEKV(bm,kl->e,kv); + BME_collapse_vert(bm, kl->e, kv, 1.0); + //BME_JEKV(bm,kl->e,kv); } l = l->prev; } @@ -601,12 +687,14 @@ static BME_Loop *BME_bevel_edge(BME_Mesh *bm, BME_Loop *l, float value, int opti if (kl->v == kv) { BME_split_face(bm,kl->f,kl->prev->v,kl->next->v,&nl,kl->prev->e); BME_JFKE(bm,((BME_Loop*)kl->prev->radial.next->data)->f,kl->f,kl->prev->e); - BME_JEKV(bm,kl->e,kv); + BME_collapse_vert(bm, kl->e, kv, 1.0); + //BME_JEKV(bm,kl->e,kv); } else { BME_split_face(bm,kl->f,kl->next->next->v,kl->v,&nl,kl->next->e); BME_JFKE(bm,((BME_Loop*)kl->next->radial.next->data)->f,kl->f,kl->next->e); - BME_JEKV(bm,kl->e,kv); + BME_collapse_vert(bm, kl->e, kv, 1.0); + //BME_JEKV(bm,kl->e,kv); } } @@ -1073,7 +1161,8 @@ static void bmesh_dissolve_disk(BME_Mesh *bm, BME_Vert *v){ e = BME_disk_nextedge(e,v); }while(e != v->edge); } - BME_JEKV(bm,v->edge,v); + BME_collapse_vert(bm, v->edge, v, 1.0); + //BME_JEKV(bm,v->edge,v); } } static BME_Mesh *BME_bevel_mesh(BME_Mesh *bm, float value, int res, int options, int defgrp_index, BME_TransData_Head *td) { diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 30405660658..4d3f9143b85 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -1052,7 +1052,7 @@ void emDM_copyEdgeArray(DerivedMesh *dm, MEdge *edge_r) /* store vertex indices in tmp union */ for(ev = em->verts.first, i = 0; ev; ev = ev->next, ++i) - ev->tmp.l = (long) i++; + ev->tmp.l = (long) i; for( ; ee; ee = ee->next, ++edge_r) { edge_r->crease = (unsigned char) (ee->crease*255.0f); diff --git a/source/blender/blenkernel/intern/bmesh_private.h b/source/blender/blenkernel/intern/bmesh_private.h index 4aa2a85b8b1..f34ef0090f3 100644 --- a/source/blender/blenkernel/intern/bmesh_private.h +++ b/source/blender/blenkernel/intern/bmesh_private.h @@ -39,11 +39,6 @@ #include "BKE_bmesh.h" -struct BME_mempool *BME_mempool_create(int esize, int tote, int pchunk); -void BME_mempool_destroy(struct BME_mempool *pool); -void *BME_mempool_alloc(struct BME_mempool *pool); -void BME_mempool_free(struct BME_mempool *pool, void *address); - /*ALLOCATION/DEALLOCATION*/ struct BME_Vert *BME_addvertlist(struct BME_Mesh *bm, struct BME_Vert *example); struct BME_Edge *BME_addedgelist(struct BME_Mesh *bm, struct BME_Vert *v1, struct BME_Vert *v2, struct BME_Edge *example); @@ -54,7 +49,6 @@ void BME_free_vert(struct BME_Mesh *bm, struct BME_Vert *v); void BME_free_edge(struct BME_Mesh *bm, struct BME_Edge *e); void BME_free_poly(struct BME_Mesh *bm, struct BME_Poly *f); void BME_free_loop(struct BME_Mesh *bm, struct BME_Loop *l); -//void BME_delete_loop(struct BME_Mesh *bm, struct BME_Loop *l); /*DOUBLE CIRCULAR LINKED LIST FUNCTIONS*/ void BME_cycle_append(void *h, void *nt); diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index 6034b85e20f..c7817b017ef 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -132,7 +132,7 @@ void cloth_init ( ClothModifierData *clmd ) clmd->coll_parms->self_friction = 5.0; clmd->coll_parms->friction = 5.0; - clmd->coll_parms->loop_count = 3; + clmd->coll_parms->loop_count = 2; clmd->coll_parms->epsilon = 0.015f; clmd->coll_parms->flags = CLOTH_COLLSETTINGS_FLAG_ENABLED; clmd->coll_parms->collision_list = NULL; @@ -471,7 +471,7 @@ static int do_step_cloth(Object *ob, ClothModifierData *clmd, DerivedMesh *resul tend(); - /* printf ( "Cloth simulation time: %f\n", ( float ) tval() ); */ + // printf ( "%f\n", ( float ) tval() ); return ret; } diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index 7f41ca033d3..26c5d186d87 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -541,7 +541,7 @@ int cloth_collision_response_static ( ClothModifierData *clmd, CollisionModifier { Normalize ( vrel_t_pre ); - impulse = 2.0 * magtangent / ( 1.0 + w1*w1 + w2*w2 + w3*w3 ); + impulse = magtangent / ( 1.0 + w1*w1 + w2*w2 + w3*w3 ); // 2.0 * VECADDMUL ( cloth1->verts[collpair->ap1].impulse, vrel_t_pre, w1 * impulse ); VECADDMUL ( cloth1->verts[collpair->ap2].impulse, vrel_t_pre, w2 * impulse ); VECADDMUL ( cloth1->verts[collpair->ap3].impulse, vrel_t_pre, w3 * impulse ); @@ -1291,52 +1291,223 @@ int cloth_collision_moving ( ClothModifierData *clmd, CollisionModifierData *col return 1; } -int cloth_bvh_objcollisions_do ( ClothModifierData * clmd, CollisionModifierData *collmd, float step, float dt ) +int cloth_do_selfcollisions(ClothModifierData * clmd) +{ + int ret2 = 0, l; + Cloth *cloth = clmd->clothObject; + + if ( clmd->clothObject->bvhselftree ) + { + for(l = 0; l < clmd->coll_parms->self_loop_count; l++) + { + BVHTreeOverlap *overlap = NULL; + ClothVertex *verts = clmd->clothObject->verts; // needed for openMP + int k; + int ret = 0, result = 0; + + // search for overlapping collision pairs + overlap = BLI_bvhtree_overlap ( cloth->bvhselftree, cloth->bvhselftree, &result ); + +// #pragma omp parallel for private(k, i, j) schedule(static) + for ( k = 0; k < result; k++ ) + { + float temp[3]; + float length = 0; + float mindistance; + int i, j; + + i = overlap[k].indexA; + j = overlap[k].indexB; + + mindistance = clmd->coll_parms->selfepsilon* ( cloth->verts[i].avg_spring_len + cloth->verts[j].avg_spring_len ); + + if ( clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL ) + { + if ( ( cloth->verts [i].flags & CLOTH_VERT_FLAG_PINNED ) + && ( cloth->verts [j].flags & CLOTH_VERT_FLAG_PINNED ) ) + { + continue; + } + } + + VECSUB ( temp, verts[i].tx, verts[j].tx ); + + if ( ( ABS ( temp[0] ) > mindistance ) || ( ABS ( temp[1] ) > mindistance ) || ( ABS ( temp[2] ) > mindistance ) ) continue; + + // check for adjacent points (i must be smaller j) + if ( BLI_edgehash_haskey ( cloth->edgehash, MIN2(i, j), MAX2(i, j) ) ) + { + continue; + } + + length = Normalize ( temp ); + + if ( length < mindistance ) + { + float correction = mindistance - length; + + if ( cloth->verts [i].flags & CLOTH_VERT_FLAG_PINNED ) + { + VecMulf ( temp, -correction ); + VECADD ( verts[j].tx, verts[j].tx, temp ); + } + else if ( cloth->verts [j].flags & CLOTH_VERT_FLAG_PINNED ) + { + VecMulf ( temp, correction ); + VECADD ( verts[i].tx, verts[i].tx, temp ); + } + else + { + VecMulf ( temp, -correction*0.5 ); + VECADD ( verts[j].tx, verts[j].tx, temp ); + + VECSUB ( verts[i].tx, verts[i].tx, temp ); + } + ret = 1; + ret2 += ret; + } + else + { + // check for approximated time collisions + } + } + + if ( overlap ) + MEM_freeN ( overlap ); + + if(!ret) + break; + + } + //////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////// + // SELFCOLLISIONS: update velocities + //////////////////////////////////////////////////////////// + if ( ret2 ) + { + int i; + ClothVertex *verts = clmd->clothObject->verts; // needed for openMP + + for ( i = 0; i < cloth->numverts; i++ ) + { + if ( ! ( verts [i].flags & CLOTH_VERT_FLAG_PINNED ) ) + { + VECSUB ( verts[i].tv, verts[i].tx, verts[i].txold ); + } + } + } + //////////////////////////////////////////////////////////// + } + return ret2; +} + +// return all collision objects in scene +// collision object will exclude self +CollisionModifierData **get_collisionobjects(Object *self, int *numcollobj) +{ + Base *base=NULL; + CollisionModifierData **objs = NULL; + Object *coll_ob = NULL; + CollisionModifierData *collmd = NULL; + int numobj = 0, maxobj = 100; + + objs = MEM_callocN(sizeof(CollisionModifierData *)*maxobj, "CollisionObjectsArray"); + // check all collision objects + for ( base = G.scene->base.first; base; base = base->next ) + { + coll_ob = base->object; + collmd = ( CollisionModifierData * ) modifiers_findByType ( coll_ob, eModifierType_Collision ); + + if ( !collmd ) + { + if ( coll_ob->dup_group ) + { + GroupObject *go; + Group *group = coll_ob->dup_group; + + for ( go= group->gobject.first; go; go= go->next ) + { + coll_ob = go->ob; + + collmd = ( CollisionModifierData * ) modifiers_findByType ( coll_ob, eModifierType_Collision ); + + if ( !collmd ) + continue; + + if(coll_ob == self) + continue; + + if(numobj >= maxobj) + { + // realloc + int oldmax = maxobj; + CollisionModifierData **tmp; + maxobj *= 2; + tmp = MEM_callocN(sizeof(CollisionModifierData *)*maxobj, "CollisionObjectsArray"); + memcpy(tmp, objs, sizeof(CollisionModifierData *)*oldmax); + MEM_freeN(objs); + objs = tmp; + } + + objs[numobj] = collmd; + numobj++; + } + } + } + else + { + if(coll_ob == self) + continue; + + if(numobj >= maxobj) + { + // realloc + int oldmax = maxobj; + CollisionModifierData **tmp; + maxobj *= 2; + tmp = MEM_callocN(sizeof(CollisionModifierData *)*maxobj, "CollisionObjectsArray"); + memcpy(tmp, objs, sizeof(CollisionModifierData *)*oldmax); + MEM_freeN(objs); + objs = tmp; + + } + + objs[numobj] = collmd; + numobj++; + } + } + *numcollobj = numobj; + return objs; +} + +void cloth_bvh_objcollisions_nearcheck ( ClothModifierData * clmd, CollisionModifierData *collmd, CollPair **collisions, CollPair **collisions_index, int numresult, BVHTreeOverlap *overlap) +{ + int i; + + *collisions = ( CollPair* ) MEM_mallocN ( sizeof ( CollPair ) * numresult * 4, "collision array" ); //*4 since cloth_collision_static can return more than 1 collision + *collisions_index = *collisions; + + for ( i = 0; i < numresult; i++ ) + { + *collisions_index = cloth_collision ( ( ModifierData * ) clmd, ( ModifierData * ) collmd, overlap+i, *collisions_index ); + } +} + +int cloth_bvh_objcollisions_resolve ( ClothModifierData * clmd, CollisionModifierData *collmd, CollPair *collisions, CollPair *collisions_index) { Cloth *cloth = clmd->clothObject; - BVHTree *cloth_bvh= ( BVHTree * ) cloth->bvhtree; - long i=0, j = 0, numfaces = 0, numverts = 0; + int i=0, j = 0, numfaces = 0, numverts = 0; ClothVertex *verts = NULL; - CollPair *collisions = NULL, *collisions_index = NULL; int ret = 0; int result = 0; float tnull[3] = {0,0,0}; - BVHTreeOverlap *overlap = NULL; - - + numfaces = clmd->clothObject->numfaces; numverts = clmd->clothObject->numverts; - + verts = cloth->verts; - - if ( collmd->bvhtree ) - { - /* get pointer to bounding volume hierarchy */ - BVHTree *coll_bvh = collmd->bvhtree; - - /* move object to position (step) in time */ - collision_move_object ( collmd, step + dt, step ); - - /* search for overlapping collision pairs */ - overlap = BLI_bvhtree_overlap ( cloth_bvh, coll_bvh, &result ); - - collisions = ( CollPair* ) MEM_mallocN ( sizeof ( CollPair ) * result*4, "collision array" ); //*4 since cloth_collision_static can return more than 1 collision - collisions_index = collisions; - - for ( i = 0; i < result; i++ ) - { - collisions_index = cloth_collision ( ( ModifierData * ) clmd, ( ModifierData * ) collmd, overlap+i, collisions_index ); - } - - if ( overlap ) - MEM_freeN ( overlap ); - } - else - { - if ( G.rt > 0 ) - printf ( "cloth_bvh_objcollision: found a collision object with clothObject or collData NULL.\n" ); - } - + // process all collisions (calculate impulses, TODO: also repulses if distance too short) result = 1; for ( j = 0; j < 5; j++ ) // 5 is just a value that ensures convergence @@ -1363,48 +1534,22 @@ int cloth_bvh_objcollisions_do ( ClothModifierData * clmd, CollisionModifierData } } } -/* - result += cloth_collision_moving ( clmd, collmd, collisions, collisions_index ); - - // apply impulses in parallel - if ( result ) - { - for ( i = 0; i < numverts; i++ ) - { - // calculate "velocities" (just xnew = xold + v; no dt in v) - if ( verts[i].impulse_count ) - { - VECADDMUL ( verts[i].tv, verts[i].impulse, 1.0f / verts[i].impulse_count ); - VECCOPY ( verts[i].impulse, tnull ); - verts[i].impulse_count = 0; - - ret++; - } - } - } -*/ } } - - if ( collisions ) MEM_freeN ( collisions ); - return ret; } // cloth - object collisions -int cloth_bvh_objcollision ( ClothModifierData * clmd, float step, float dt ) +int cloth_bvh_objcollision ( Object *ob, ClothModifierData * clmd, float step, float dt ) { - Base *base=NULL; - CollisionModifierData *collmd=NULL; Cloth *cloth=NULL; - Object *coll_ob=NULL; BVHTree *cloth_bvh=NULL; - long i=0, j = 0, k = 0, l = 0, numfaces = 0, numverts = 0; - int result = 0, rounds = 0; // result counts applied collisions; ic is for debug output; + long i=0, numfaces = 0, numverts = 0; + int rounds = 0; // result counts applied collisions; ic is for debug output; ClothVertex *verts = NULL; int ret = 0, ret2 = 0; - ClothModifierData *tclmd; - int collisions = 0; + CollisionModifierData **collobjs = NULL; + int numcollobj = 0; if ( ( clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_COLLOBJ ) || ! ( ( ( Cloth * ) clmd->clothObject )->bvhtree ) ) { @@ -1424,54 +1569,61 @@ int cloth_bvh_objcollision ( ClothModifierData * clmd, float step, float dt ) // update cloth bvh bvhtree_update_from_cloth ( clmd, 1 ); // 0 means STATIC, 1 means MOVING (see later in this function) bvhselftree_update_from_cloth ( clmd, 0 ); // 0 means STATIC, 1 means MOVING (see later in this function) + + collobjs = get_collisionobjects(ob, &numcollobj); + + if(!collobjs) + return 0; do { - result = 0; + CollPair **collisions, **collisions_index; + ret2 = 0; + collisions = MEM_callocN(sizeof(CollPair *) *numcollobj , "CollPair"); + collisions_index = MEM_callocN(sizeof(CollPair *) *numcollobj , "CollPair"); + // check all collision objects - for ( base = G.scene->base.first; base; base = base->next ) + for(i = 0; i < numcollobj; i++) { - coll_ob = base->object; - collmd = ( CollisionModifierData * ) modifiers_findByType ( coll_ob, eModifierType_Collision ); - - if ( !collmd ) + CollisionModifierData *collmd = collobjs[i]; + BVHTreeOverlap *overlap = NULL; + int result = 0; + + /* move object to position (step) in time */ + collision_move_object ( collmd, step + dt, step ); + + /* search for overlapping collision pairs */ + overlap = BLI_bvhtree_overlap ( cloth_bvh, collmd->bvhtree, &result ); + + // go to next object if no overlap is there + if(!result || !overlap) { - if ( coll_ob->dup_group ) - { - GroupObject *go; - Group *group = coll_ob->dup_group; - - for ( go= group->gobject.first; go; go= go->next ) - { - coll_ob = go->ob; - - collmd = ( CollisionModifierData * ) modifiers_findByType ( coll_ob, eModifierType_Collision ); - - if ( !collmd ) - continue; - - tclmd = ( ClothModifierData * ) modifiers_findByType ( coll_ob, eModifierType_Cloth ); - if ( tclmd == clmd ) - continue; - - ret += cloth_bvh_objcollisions_do ( clmd, collmd, step, dt ); - ret2 += ret; - } - } - } - else - { - tclmd = ( ClothModifierData * ) modifiers_findByType ( coll_ob, eModifierType_Cloth ); - if ( tclmd == clmd ) - continue; - - ret += cloth_bvh_objcollisions_do ( clmd, collmd, step, dt ); - ret2 += ret; + if ( overlap ) + MEM_freeN ( overlap ); + continue; } + + /* check if collisions really happen (costly near check) */ + cloth_bvh_objcollisions_nearcheck ( clmd, collmd, &collisions[i], &collisions_index[i], result, overlap); + + // resolve nearby collisions + ret += cloth_bvh_objcollisions_resolve ( clmd, collmd, collisions[i], collisions_index[i]); + ret2 += ret; + + if ( overlap ) + MEM_freeN ( overlap ); } rounds++; + + for(i = 0; i < numcollobj; i++) + { + if ( collisions[i] ) MEM_freeN ( collisions[i] ); + } + + MEM_freeN(collisions); + MEM_freeN(collisions_index); //////////////////////////////////////////////////////////// // update positions @@ -1493,117 +1645,20 @@ int cloth_bvh_objcollision ( ClothModifierData * clmd, float step, float dt ) } //////////////////////////////////////////////////////////// - + //////////////////////////////////////////////////////////// // Test on *simple* selfcollisions //////////////////////////////////////////////////////////// if ( clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_SELF ) { - for(l = 0; l < clmd->coll_parms->self_loop_count; l++) - { - // TODO: add coll quality rounds again - BVHTreeOverlap *overlap = NULL; - - collisions = 1; - verts = cloth->verts; // needed for openMP - - numfaces = clmd->clothObject->numfaces; - numverts = clmd->clothObject->numverts; - - verts = cloth->verts; - - if ( cloth->bvhselftree ) - { - // search for overlapping collision pairs - overlap = BLI_bvhtree_overlap ( cloth->bvhselftree, cloth->bvhselftree, &result ); - - // #pragma omp parallel for private(k, i, j) schedule(static) - for ( k = 0; k < result; k++ ) - { - float temp[3]; - float length = 0; - float mindistance; - - i = overlap[k].indexA; - j = overlap[k].indexB; - - mindistance = clmd->coll_parms->selfepsilon* ( cloth->verts[i].avg_spring_len + cloth->verts[j].avg_spring_len ); - - if ( clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL ) - { - if ( ( cloth->verts [i].flags & CLOTH_VERT_FLAG_PINNED ) - && ( cloth->verts [j].flags & CLOTH_VERT_FLAG_PINNED ) ) - { - continue; - } - } - - VECSUB ( temp, verts[i].tx, verts[j].tx ); - - if ( ( ABS ( temp[0] ) > mindistance ) || ( ABS ( temp[1] ) > mindistance ) || ( ABS ( temp[2] ) > mindistance ) ) continue; - - // check for adjacent points (i must be smaller j) - if ( BLI_edgehash_haskey ( cloth->edgehash, MIN2(i, j), MAX2(i, j) ) ) - { - continue; - } - - length = Normalize ( temp ); - - if ( length < mindistance ) - { - float correction = mindistance - length; - - if ( cloth->verts [i].flags & CLOTH_VERT_FLAG_PINNED ) - { - VecMulf ( temp, -correction ); - VECADD ( verts[j].tx, verts[j].tx, temp ); - } - else if ( cloth->verts [j].flags & CLOTH_VERT_FLAG_PINNED ) - { - VecMulf ( temp, correction ); - VECADD ( verts[i].tx, verts[i].tx, temp ); - } - else - { - VecMulf ( temp, -correction*0.5 ); - VECADD ( verts[j].tx, verts[j].tx, temp ); - - VECSUB ( verts[i].tx, verts[i].tx, temp ); - } - ret = 1; - ret2 += ret; - } - else - { - // check for approximated time collisions - } - } - - if ( overlap ) - MEM_freeN ( overlap ); - - } - } - //////////////////////////////////////////////////////////// - - //////////////////////////////////////////////////////////// - // SELFCOLLISIONS: update velocities - //////////////////////////////////////////////////////////// - if ( ret2 ) - { - for ( i = 0; i < cloth->numverts; i++ ) - { - if ( ! ( verts [i].flags & CLOTH_VERT_FLAG_PINNED ) ) - { - VECSUB ( verts[i].tv, verts[i].tx, verts[i].txold ); - } - } - } - //////////////////////////////////////////////////////////// + ret2 += cloth_do_selfcollisions(clmd); } + //////////////////////////////////////////////////////////// } while ( ret2 && ( clmd->coll_parms->loop_count>rounds ) ); + + if(collobjs) + + MEM_freeN(collobjs); return MIN2 ( ret, 1 ); } diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 77068d8ed66..501293ecd81 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -36,6 +36,7 @@ #include "BLI_blenlib.h" #include "BLI_linklist.h" +#include "BLI_mempool.h" #include "DNA_customdata_types.h" #include "DNA_listBase.h" @@ -359,8 +360,80 @@ static void layerDefault_origspace_face(void *data, int count) } /* --------- */ +static void layerDefault_mloopcol(void *data, int count) +{ + static MLoopCol default_mloopcol = {255,255,255,255}; + MLoopCol *mlcol = (MLoopCol*)data; + int i; + for(i = 0; i < count; i++) + mlcol[i] = default_mloopcol; +} +static void layerInterp_mloopcol(void **sources, float *weights, + float *sub_weights, int count, void *dest) +{ + MLoopCol *mc = dest; + int i; + float *sub_weight; + struct { + float a; + float r; + float g; + float b; + } col; + col.a = col.r = col.g = col.b = 0; + + sub_weight = sub_weights; + for(i = 0; i < count; ++i){ + float weight = weights ? weights[i] : 1; + MLoopCol *src = sources[i]; + if(sub_weights){ + col.a += src->a * (*sub_weight) * weight; + col.r += src->r * (*sub_weight) * weight; + col.g += src->g * (*sub_weight) * weight; + col.b += src->b * (*sub_weight) * weight; + sub_weight++; + } else { + col.a += src->a * weight; + col.r += src->r * weight; + col.g += src->g * weight; + col.b += src->b * weight; + } + } + mc->a = (int)col.a; + mc->r = (int)col.r; + mc->g = (int)col.g; + mc->b = (int)col.b; +} +static void layerInterp_mloopuv(void **sources, float *weights, + float *sub_weights, int count, void *dest) +{ + MLoopUV *mluv = dest; + int i; + float *sub_weight; + struct { + float u; + float v; + }uv; + uv.u = uv.v = 0.0; + + sub_weight = sub_weights; + for(i = 0; i < count; ++i){ + float weight = weights ? weights[i] : 1; + MLoopUV *src = sources[i]; + if(sub_weights){ + uv.u += src->uv[0] * (*sub_weight) * weight; + uv.v += src->uv[1] * (*sub_weight) * weight; + sub_weight++; + } else { + uv.u += src->uv[0] * weight; + uv.v += src->uv[1] * weight; + } + } + mluv->uv[0] = uv.u; + mluv->uv[1] = uv.v; +} static void layerInterp_mcol(void **sources, float *weights, float *sub_weights, int count, void *dest) @@ -432,6 +505,8 @@ static void layerDefault_mcol(void *data, int count) mcol[i] = default_mcol; } + + const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = { {sizeof(MVert), "MVert", 1, NULL, NULL, NULL, NULL, NULL, NULL}, {sizeof(MSticky), "MSticky", 1, NULL, NULL, NULL, layerInterp_msticky, NULL, @@ -454,13 +529,16 @@ const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = { {sizeof(MStringProperty), "MStringProperty",1,"String",NULL,NULL,NULL,NULL}, {sizeof(OrigSpaceFace), "OrigSpaceFace", 1, "UVTex", layerCopy_origspace_face, NULL, layerInterp_origspace_face, layerSwap_origspace_face, layerDefault_origspace_face}, - {sizeof(float)*3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL} + {sizeof(float)*3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL}, + {sizeof(MTexPoly), "MTexPoly", 1, "Face Texture", NULL, NULL, NULL, NULL, NULL}, + {sizeof(MLoopUV), "MLoopUV", 1, "UV coord", NULL, NULL, layerInterp_mloopuv, NULL, NULL}, + {sizeof(MLoopCol), "MLoopCol", 1, "Col", NULL, NULL, layerInterp_mloopcol, NULL, layerDefault_mloopcol} }; const char *LAYERTYPENAMES[CD_NUMTYPES] = { "CDMVert", "CDMSticky", "CDMDeformVert", "CDMEdge", "CDMFace", "CDMTFace", "CDMCol", "CDOrigIndex", "CDNormal", "CDFlags","CDMFloatProperty", - "CDMIntProperty","CDMStringProperty", "CDOrigSpace", "CDOrco"}; + "CDMIntProperty","CDMStringProperty", "CDOrigSpace", "CDOrco", "CDMTexPoly", "CDMLoopUV", "CDMloopCol"}; const CustomDataMask CD_MASK_BAREMESH = CD_MASK_MVERT | CD_MASK_MEDGE | CD_MASK_MFACE; @@ -475,6 +553,12 @@ const CustomDataMask CD_MASK_DERIVEDMESH = CD_MASK_MSTICKY | CD_MASK_MDEFORMVERT | CD_MASK_MTFACE | CD_MASK_MCOL | CD_MASK_ORIGINDEX | CD_MASK_PROP_FLT | CD_MASK_PROP_INT | CD_MASK_PROP_STR | CD_MASK_ORIGSPACE | CD_MASK_ORCO; +const CustomDataMask CD_MASK_BMESH = + CD_MASK_MSTICKY | CD_MASK_MDEFORMVERT | CD_MASK_PROP_FLT | CD_MASK_PROP_INT | CD_MASK_PROP_STR; +const CustomDataMask CD_MASK_FACECORNERS = + CD_MASK_MTFACE | CD_MASK_MCOL | CD_MASK_MTEXPOLY | CD_MASK_MLOOPUV | + CD_MASK_MLOOPCOL; + static const LayerTypeInfo *layerType_getInfo(int type) { @@ -1449,6 +1533,302 @@ void CustomData_from_em_block(const CustomData *source, CustomData *dest, } +/*Bmesh functions*/ +/*needed to convert to/from different face reps*/ +void CustomData_to_bmeshpoly(CustomData *fdata, CustomData *pdata, CustomData *ldata) +{ + int i; + for(i=0; i < fdata->totlayer; i++){ + if(fdata->layers[i].type == CD_MTFACE){ + CustomData_add_layer(pdata, CD_MTEXPOLY, CD_CALLOC, &(fdata->layers[i].name), 0); + CustomData_add_layer(ldata, CD_MLOOPUV, CD_CALLOC, &(fdata->layers[i].name), 0); + } + else if(fdata->layers[i].type == CD_MCOL) + CustomData_add_layer(ldata, CD_MLOOPCOL, CD_CALLOC, &(fdata->layers[i].name), 0); + } +} +void CustomData_from_bmeshpoly(CustomData *fdata, CustomData *pdata, CustomData *ldata, int total){ + int i; + for(i=0; i < pdata->totlayer; i++){ + if(pdata->layers[i].type == CD_MTEXPOLY) + CustomData_add_layer(fdata, CD_MTFACE, CD_CALLOC, &(pdata->layers[i].name), total); + } + for(i=0; i < ldata->totlayer; i++){ + if(ldata->layers[i].type == CD_MLOOPCOL) + CustomData_add_layer(fdata, CD_MCOL, CD_CALLOC, &(ldata->layers[i].name), total); + } +} + + +void CustomData_bmesh_init_pool(CustomData *data, int allocsize){ + if(data->totlayer)data->pool = BLI_mempool_create(data->totsize, allocsize, allocsize); +} + +void CustomData_bmesh_free_block(CustomData *data, void **block) +{ + const LayerTypeInfo *typeInfo; + int i; + + if(!*block) return; + for(i = 0; i < data->totlayer; ++i) { + if(!(data->layers[i].flag & CD_FLAG_NOFREE)) { + typeInfo = layerType_getInfo(data->layers[i].type); + + if(typeInfo->free) { + int offset = data->layers[i].offset; + typeInfo->free((char*)*block + offset, 1, typeInfo->size); + } + } + } + + BLI_mempool_free(data->pool, *block); + *block = NULL; +} + +static void CustomData_bmesh_alloc_block(CustomData *data, void **block) +{ + + if (*block) + CustomData_bmesh_free_block(data, block); + + if (data->totsize > 0) + *block = BLI_mempool_calloc(data->pool); + else + *block = NULL; +} + +void CustomData_bmesh_copy_data(const CustomData *source, CustomData *dest, + void *src_block, void **dest_block) +{ + const LayerTypeInfo *typeInfo; + int dest_i, src_i; + + if (!*dest_block) + CustomData_bmesh_alloc_block(dest, dest_block); + + /* copies a layer at a time */ + dest_i = 0; + for(src_i = 0; src_i < source->totlayer; ++src_i) { + + /* find the first dest layer with type >= the source type + * (this should work because layers are ordered by type) + */ + while(dest_i < dest->totlayer + && dest->layers[dest_i].type < source->layers[src_i].type) + ++dest_i; + + /* if there are no more dest layers, we're done */ + if(dest_i >= dest->totlayer) return; + + /* if we found a matching layer, copy the data */ + if(dest->layers[dest_i].type == source->layers[src_i].type && + strcmp(dest->layers[dest_i].name, source->layers[src_i].name) == 0) { + char *src_data = (char*)src_block + source->layers[src_i].offset; + char *dest_data = (char*)*dest_block + dest->layers[dest_i].offset; + + typeInfo = layerType_getInfo(source->layers[src_i].type); + + if(typeInfo->copy) + typeInfo->copy(src_data, dest_data, 1); + else + memcpy(dest_data, src_data, typeInfo->size); + + /* if there are multiple source & dest layers of the same type, + * we don't want to copy all source layers to the same dest, so + * increment dest_i + */ + ++dest_i; + } + } +} + +/*Bmesh Custom Data Functions. Should replace editmesh ones with these as well, due to more effecient memory alloc*/ +void *CustomData_bmesh_get(const CustomData *data, void *block, int type) +{ + int layer_index; + + /* get the layer index of the first layer of type */ + layer_index = CustomData_get_active_layer_index(data, type); + if(layer_index < 0) return NULL; + + return (char *)block + data->layers[layer_index].offset; +} + +void *CustomData_bmesh_get_n(const CustomData *data, void *block, int type, int n) +{ + int layer_index; + + /* get the layer index of the first layer of type */ + layer_index = CustomData_get_layer_index(data, type); + if(layer_index < 0) return NULL; + + return (char *)block + data->layers[layer_index+n].offset; +} + +void CustomData_bmesh_set(const CustomData *data, void *block, int type, void *source) +{ + void *dest = CustomData_bmesh_get(data, block, type); + const LayerTypeInfo *typeInfo = layerType_getInfo(type); + + if(!dest) return; + + if(typeInfo->copy) + typeInfo->copy(source, dest, 1); + else + memcpy(dest, source, typeInfo->size); +} + +void CustomData_bmesh_set_n(CustomData *data, void *block, int type, int n, void *source) +{ + void *dest = CustomData_bmesh_get_n(data, block, type, n); + const LayerTypeInfo *typeInfo = layerType_getInfo(type); + + if(!dest) return; + + if(typeInfo->copy) + typeInfo->copy(source, dest, 1); + else + memcpy(dest, source, typeInfo->size); +} + +void CustomData_bmesh_interp(CustomData *data, void **src_blocks, float *weights, + float *sub_weights, int count, void *dest_block) +{ + int i, j; + void *source_buf[SOURCE_BUF_SIZE]; + void **sources = source_buf; + + /* slow fallback in case we're interpolating a ridiculous number of + * elements + */ + if(count > SOURCE_BUF_SIZE) + sources = MEM_callocN(sizeof(*sources) * count, + "CustomData_interp sources"); + + /* interpolates a layer at a time */ + for(i = 0; i < data->totlayer; ++i) { + CustomDataLayer *layer = &data->layers[i]; + const LayerTypeInfo *typeInfo = layerType_getInfo(layer->type); + if(typeInfo->interp) { + for(j = 0; j < count; ++j) + sources[j] = (char *)src_blocks[j] + layer->offset; + + typeInfo->interp(sources, weights, sub_weights, count, + (char *)dest_block + layer->offset); + } + } + + if(count > SOURCE_BUF_SIZE) MEM_freeN(sources); +} + +void CustomData_bmesh_set_default(CustomData *data, void **block) +{ + const LayerTypeInfo *typeInfo; + int i; + + if (!*block) + CustomData_bmesh_alloc_block(data, block); + + for(i = 0; i < data->totlayer; ++i) { + int offset = data->layers[i].offset; + + typeInfo = layerType_getInfo(data->layers[i].type); + + if(typeInfo->set_default) + typeInfo->set_default((char*)*block + offset, 1); + } +} + +void CustomData_to_bmesh_block(const CustomData *source, CustomData *dest, + int src_index, void **dest_block) +{ + const LayerTypeInfo *typeInfo; + int dest_i, src_i, src_offset; + + if (!*dest_block) + CustomData_bmesh_alloc_block(dest, dest_block); + + /* copies a layer at a time */ + dest_i = 0; + for(src_i = 0; src_i < source->totlayer; ++src_i) { + + /* find the first dest layer with type >= the source type + * (this should work because layers are ordered by type) + */ + while(dest_i < dest->totlayer + && dest->layers[dest_i].type < source->layers[src_i].type) + ++dest_i; + + /* if there are no more dest layers, we're done */ + if(dest_i >= dest->totlayer) return; + + /* if we found a matching layer, copy the data */ + if(dest->layers[dest_i].type == source->layers[src_i].type) { + int offset = dest->layers[dest_i].offset; + char *src_data = source->layers[src_i].data; + char *dest_data = (char*)*dest_block + offset; + + typeInfo = layerType_getInfo(dest->layers[dest_i].type); + src_offset = src_index * typeInfo->size; + + if(typeInfo->copy) + typeInfo->copy(src_data + src_offset, dest_data, 1); + else + memcpy(dest_data, src_data + src_offset, typeInfo->size); + + /* if there are multiple source & dest layers of the same type, + * we don't want to copy all source layers to the same dest, so + * increment dest_i + */ + ++dest_i; + } + } +} + +void CustomData_from_bmesh_block(const CustomData *source, CustomData *dest, + void *src_block, int dest_index) +{ + const LayerTypeInfo *typeInfo; + int dest_i, src_i, dest_offset; + + /* copies a layer at a time */ + dest_i = 0; + for(src_i = 0; src_i < source->totlayer; ++src_i) { + + /* find the first dest layer with type >= the source type + * (this should work because layers are ordered by type) + */ + while(dest_i < dest->totlayer + && dest->layers[dest_i].type < source->layers[src_i].type) + ++dest_i; + + /* if there are no more dest layers, we're done */ + if(dest_i >= dest->totlayer) return; + + /* if we found a matching layer, copy the data */ + if(dest->layers[dest_i].type == source->layers[src_i].type) { + int offset = source->layers[src_i].offset; + char *src_data = (char*)src_block + offset; + char *dest_data = dest->layers[dest_i].data; + + typeInfo = layerType_getInfo(dest->layers[dest_i].type); + dest_offset = dest_index * typeInfo->size; + + if(typeInfo->copy) + typeInfo->copy(src_data, dest_data + dest_offset, 1); + else + memcpy(dest_data + dest_offset, src_data, typeInfo->size); + + /* if there are multiple source & dest layers of the same type, + * we don't want to copy all source layers to the same dest, so + * increment dest_i + */ + ++dest_i; + } + } + +} + void CustomData_file_write_info(int type, char **structname, int *structnum) { const LayerTypeInfo *typeInfo = layerType_getInfo(type); diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index c73279746fb..b6c8ad59e08 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -848,10 +848,6 @@ void BKE_add_image_extension(char *string, int imtype) if(!BLI_testextensie(string, ".tga")) extension= ".tga"; } - else if(ELEM5(imtype, R_MOVIE, R_AVICODEC, R_AVIRAW, R_AVIJPEG, R_JPEG90)) { - if(!( BLI_testextensie(string, ".jpg") || BLI_testextensie(string, ".jpeg"))) - extension= ".jpg"; - } else if(imtype==R_BMP) { if(!BLI_testextensie(string, ".bmp")) extension= ".bmp"; @@ -874,10 +870,14 @@ void BKE_add_image_extension(char *string, int imtype) if (!BLI_testextensie(string, ".dpx")) extension= ".dpx"; } - else { /* targa default */ + else if(imtype==R_TARGA) { if(!BLI_testextensie(string, ".tga")) extension= ".tga"; } + else { // R_MOVIE, R_AVICODEC, R_AVIRAW, R_AVIJPEG, R_JPEG90, R_QUICKTIME etc + if(!( BLI_testextensie(string, ".jpg") || BLI_testextensie(string, ".jpeg"))) + extension= ".jpg"; + } strcat(string, extension); } @@ -1512,6 +1512,10 @@ static ImBuf *image_load_sequence_file(Image *ima, ImageUser *iuser, int frame) image_initialize_after_load(ima, ibuf); image_assign_ibuf(ima, ibuf, 0, frame); #endif + + if(ima->flag & IMA_DO_PREMUL) + converttopremul(ibuf); + } else ima->ok= 0; diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c index 808984aaa3c..297ac0b1530 100644 --- a/source/blender/blenkernel/intern/implicit.c +++ b/source/blender/blenkernel/intern/implicit.c @@ -1588,10 +1588,17 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase VECSUB(verts[i].tv, verts[i].tx, verts[i].txold); VECCOPY(verts[i].v, verts[i].tv); } - + // call collision function - result = cloth_bvh_objcollision(clmd, step + dt, dt); - + // TODO: check if "step" or "step+dt" is correct - dg + result = cloth_bvh_objcollision(ob, clmd, step, dt); + + // correct velocity again, just to be sure we had to change it due to adaptive collisions + for(i = 0; i < numverts; i++) + { + VECSUB(verts[i].tv, verts[i].tx, id->X[i]); + } + // copy corrected positions back to simulation for(i = 0; i < numverts; i++) { diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 7c50b409693..c3dddf06e7c 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -224,48 +224,50 @@ void flag_all_listbases_ids(short flag, short value) /* note: MAX_LIBARRAY define should match this code */ int set_listbasepointers(Main *main, ListBase **lb) { + int a = 0; + /* BACKWARDS! also watch order of free-ing! (mesh<->mat) */ - lb[0]= &(main->ipo); - lb[1]= &(main->key); - lb[2]= &(main->image); - lb[3]= &(main->tex); - lb[4]= &(main->mat); - lb[5]= &(main->vfont); + lb[a++]= &(main->ipo); + lb[a++]= &(main->key); + lb[a++]= &(main->nodetree); + lb[a++]= &(main->image); + lb[a++]= &(main->tex); + lb[a++]= &(main->mat); + lb[a++]= &(main->vfont); /* Important!: When adding a new object type, * the specific data should be inserted here */ - lb[6]= &(main->armature); - lb[7]= &(main->action); + lb[a++]= &(main->armature); + lb[a++]= &(main->action); - lb[8]= &(main->mesh); - lb[9]= &(main->curve); - lb[10]= &(main->mball); + lb[a++]= &(main->mesh); + lb[a++]= &(main->curve); + lb[a++]= &(main->mball); - lb[11]= &(main->wave); - lb[12]= &(main->latt); - lb[13]= &(main->lamp); - lb[14]= &(main->camera); + lb[a++]= &(main->wave); + lb[a++]= &(main->latt); + lb[a++]= &(main->lamp); + lb[a++]= &(main->camera); - lb[15]= &(main->text); - lb[16]= &(main->sound); - lb[17]= &(main->group); - lb[18]= &(main->nodetree); - lb[19]= &(main->brush); - lb[20]= &(main->script); - lb[21]= &(main->particle); + lb[a++]= &(main->text); + lb[a++]= &(main->sound); + lb[a++]= &(main->group); + lb[a++]= &(main->brush); + lb[a++]= &(main->script); + lb[a++]= &(main->particle); - lb[22]= &(main->world); - lb[23]= &(main->screen); - lb[24]= &(main->object); - lb[25]= &(main->scene); - lb[26]= &(main->library); + lb[a++]= &(main->world); + lb[a++]= &(main->screen); + lb[a++]= &(main->object); + lb[a++]= &(main->scene); + lb[a++]= &(main->library); - lb[27]= NULL; + lb[a]= NULL; - return 27; + return a; } /* *********** ALLOC AND FREE ***************** diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 6779b18154f..124474ca09c 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -4923,7 +4923,7 @@ static void waveModifier_deformVertsEM( if(!wmd->texture && !wmd->defgrp_name[0] && !(wmd->flag & MOD_WAVE_NORM)) dm = derivedData; - else if(derivedData) dm = derivedData; + else if(derivedData) dm = CDDM_copy(derivedData); else dm = CDDM_from_editmesh(editData, ob->data); if(wmd->flag & MOD_WAVE_NORM) { diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index b72d9a0b044..7b36e46d45e 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -732,6 +732,17 @@ void *add_lamp(char *name) la->preview=NULL; la->falloff_type = LA_FALLOFF_INVLINEAR; la->curfalloff = curvemapping_add(1, 0.0f, 1.0f, 1.0f, 0.0f); + la->sun_effect_type = 0; + la->horizon_brightness = 1.0; + la->spread = 1.0; + la->sun_brightness = 1.0; + la->sun_size = 1.0; + la->backscattered_light = 1.0; + la->atm_turbidity = 2.0; + la->atm_inscattering_factor = 1.0; + la->atm_extinction_factor = 1.0; + la->atm_distance_factor = 1.0; + la->sun_intensity = 1.0; curvemapping_initialize(la->curfalloff); return la; } diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 18fca5439ef..24a3d348ae7 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -1371,7 +1371,7 @@ void psys_particle_on_shape(int distr, int index, float *fuv, float *vec, float /************************************************/ void psys_particle_on_emitter(Object *ob, ParticleSystemModifierData *psmd, int from, int index, int index_dmcache, float *fuv, float foffset, float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor){ if(psmd){ - if(psmd->psys->part->distr==PART_DISTR_GRID){ + if(psmd->psys->part->distr==PART_DISTR_GRID && psmd->psys->part->from != PART_FROM_VERT){ if(vec){ VECCOPY(vec,fuv); } diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 458171cc232..f70648965f4 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -168,7 +168,7 @@ static void realloc_particles(Object *ob, ParticleSystem *psys, int new_totpart) int i, totpart, totsaved = 0; if(new_totpart<0) { - if(psys->part->distr==PART_DISTR_GRID) { + if(psys->part->distr==PART_DISTR_GRID && psys->part->from != PART_FROM_VERT) { totpart= psys->part->grid_res; totpart*=totpart*totpart; } @@ -1056,7 +1056,7 @@ int psys_threads_init_distribution(ParticleThread *threads, DerivedMesh *finaldm dm= CDDM_from_mesh((Mesh*)ob->data, ob); /* special handling of grid distribution */ - if(part->distr==PART_DISTR_GRID){ + if(part->distr==PART_DISTR_GRID && from != PART_FROM_VERT){ distribute_particles_in_grid(dm,psys); dm->release(dm); return 0; @@ -1600,7 +1600,7 @@ void initialize_particle(ParticleData *pa, int p, Object *ob, ParticleSystem *ps NormalQuat(pa->r_rot); - if(part->distr!=PART_DISTR_GRID){ + if(part->distr!=PART_DISTR_GRID && part->from != PART_FROM_VERT){ /* any unique random number will do (r_ave[0]) */ if(ptex.exist < 0.5*(1.0+pa->r_ave[0])) pa->flag |= PARS_UNEXIST; @@ -4515,7 +4515,7 @@ void psys_changed_type(ParticleSystem *psys) if(part->from == PART_FROM_PARTICLE) { if(part->type != PART_REACTOR) part->from = PART_FROM_FACE; - if(part->distr == PART_DISTR_GRID) + if(part->distr == PART_DISTR_GRID && part->from != PART_FROM_VERT) part->distr = PART_DISTR_JIT; } @@ -4710,7 +4710,7 @@ static void system_step(Object *ob, ParticleSystem *psys, ParticleSystemModifier oldtotpart = psys->totpart; oldtotchild = psys->totchild; - if(part->distr == PART_DISTR_GRID) + if(part->distr == PART_DISTR_GRID && part->from != PART_FROM_VERT) totpart = part->grid_res*part->grid_res*part->grid_res; else totpart = psys->part->totpart; diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 57ecffbb796..43805959e62 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -459,9 +459,10 @@ int BKE_ptcache_object_reset(Object *ob, int mode) PTCacheID pid; ParticleSystem *psys; ModifierData *md; - int reset; + int reset, skip; reset= 0; + skip= 0; if(ob->soft) { BKE_ptcache_id_from_softbody(&pid, ob, ob->soft); @@ -469,11 +470,18 @@ int BKE_ptcache_object_reset(Object *ob, int mode) } for(psys=ob->particlesystem.first; psys; psys=psys->next) { - BKE_ptcache_id_from_particles(&pid, ob, psys); - reset |= BKE_ptcache_id_reset(&pid, mode); - + /* Baked softbody hair has to be checked first, because we don't want to reset */ + /* particles or softbody in that case -jahka */ if(psys->soft) { BKE_ptcache_id_from_softbody(&pid, ob, psys->soft); + if(mode == PSYS_RESET_ALL || !(psys->part->type == PART_HAIR && (pid.cache->flag & PTCACHE_BAKED))) + reset |= BKE_ptcache_id_reset(&pid, mode); + else + skip = 1; + } + + if(skip == 0) { + BKE_ptcache_id_from_particles(&pid, ob, psys); reset |= BKE_ptcache_id_reset(&pid, mode); } } diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c index 16ca5d7542d..fcf1c7ce311 100644 --- a/source/blender/blenkernel/intern/sca.c +++ b/source/blender/blenkernel/intern/sca.c @@ -150,6 +150,9 @@ void init_sensor(bSensor *sens) case SENS_PROPERTY: sens->data= MEM_callocN(sizeof(bPropertySensor), "propsens"); break; + case SENS_ACTUATOR: + sens->data= MEM_callocN(sizeof(bActuatorSensor), "actsens"); + break; case SENS_MOUSE: ms=sens->data= MEM_callocN(sizeof(bMouseSensor), "mousesens"); ms->type= LEFTMOUSE; diff --git a/source/blender/blenlib/BLI_arithb.h b/source/blender/blenlib/BLI_arithb.h index 4fa880c36d1..c22b6f79e08 100644 --- a/source/blender/blenlib/BLI_arithb.h +++ b/source/blender/blenlib/BLI_arithb.h @@ -50,6 +50,9 @@ extern "C" { #ifndef M_SQRT1_2 #define M_SQRT1_2 0.70710678118654752440 #endif +#ifndef M_1_PI +#define M_1_PI 0.318309886183790671538 +#endif #ifdef WIN32 #ifndef FREE_WINDOWS @@ -323,6 +326,9 @@ void yuv_to_rgb(float y, float u, float v, float *lr, float *lg, float *lb); void ycc_to_rgb(float y, float cb, float cr, float *lr, float *lg, float *lb); void rgb_to_ycc(float r, float g, float b, float *ly, float *lcb, float *lcr); void rgb_to_hsv(float r, float g, float b, float *lh, float *ls, float *lv); +void xyz_to_rgb(float x, float y, float z, float *r, float *g, float *b); +int constrain_rgb(float *r, float *g, float *b); +void gamma_correct_rgb(float *r, float *g, float *b); unsigned int hsv_to_cpack(float h, float s, float v); unsigned int rgb_to_cpack(float r, float g, float b); void cpack_to_rgb(unsigned int col, float *r, float *g, float *b); diff --git a/source/blender/blenlib/BLI_winstuff.h b/source/blender/blenlib/BLI_winstuff.h index 9c192ba8b09..11150075bac 100644 --- a/source/blender/blenlib/BLI_winstuff.h +++ b/source/blender/blenlib/BLI_winstuff.h @@ -73,6 +73,9 @@ #ifndef M_SQRT1_2 #define M_SQRT1_2 0.70710678118654752440 #endif +#ifndef M_1_PI +#define M_1_PI 0.318309886183790671538 +#endif #define MAXPATHLEN MAX_PATH diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index e7b5ccd4d54..d84a9d09d4b 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -551,6 +551,7 @@ static void bvh_div_nodes(BVHTree *tree, BVHNode *node, int start, int end, char return; } +#if 0 static void verify_tree(BVHTree *tree) { int i, j, check = 0; @@ -597,6 +598,7 @@ static void verify_tree(BVHTree *tree) printf("branches: %d, leafs: %d, total: %d\n", tree->totbranch, tree->totleaf, tree->totbranch + tree->totleaf); } +#endif void BLI_bvhtree_balance(BVHTree *tree) { diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index a366862d064..dd9c76d9172 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -3413,6 +3413,66 @@ void rgb_to_hsv(float r, float g, float b, float *lh, float *ls, float *lv) *lv = v; } +/*http://brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html + * SMPTE-C XYZ to RGB matrix*/ +void xyz_to_rgb(float xc, float yc, float zc, float *r, float *g, float *b) +{ + *r = (3.50570 * xc) + (-1.73964 * yc) + (-0.544011 * zc); + *g = (-1.06906 * xc) + (1.97781 * yc) + (0.0351720 * zc); + *b = (0.0563117 * xc) + (-0.196994 * yc) + (1.05005 * zc); +} + +/*If the requested RGB shade contains a negative weight for + one of the primaries, it lies outside the colour gamut + accessible from the given triple of primaries. Desaturate + it by adding white, equal quantities of R, G, and B, enough + to make RGB all positive. The function returns 1 if the + components were modified, zero otherwise.*/ +int constrain_rgb(float *r, float *g, float *b) +{ + float w; + + /* Amount of white needed is w = - min(0, *r, *g, *b) */ + + w = (0 < *r) ? 0 : *r; + w = (w < *g) ? w : *g; + w = (w < *b) ? w : *b; + w = -w; + + /* Add just enough white to make r, g, b all positive. */ + + if (w > 0) { + *r += w; *g += w; *b += w; + return 1; /* Colour modified to fit RGB gamut */ + } + + return 0; /* Colour within RGB gamut */ +} + +/*Transform linear RGB values to nonlinear RGB values. Rec. + 709 is ITU-R Recommendation BT. 709 (1990) ``Basic + Parameter Values for the HDTV Standard for the Studio and + for International Programme Exchange'', formerly CCIR Rec. + 709.*/ +void gamma_correct(float *c) +{ + /* Rec. 709 gamma correction. */ + float cc = 0.018; + + if (*c < cc) { + *c *= ((1.099 * pow(cc, 0.45)) - 0.099) / cc; + } else { + *c = (1.099 * pow(*c, 0.45)) - 0.099; + } +} + +void gamma_correct_rgb(float *r, float *g, float *b) +{ + gamma_correct(r); + gamma_correct(g); + gamma_correct(b); +} + /* we define a 'cpack' here as a (3 byte color code) number that can be expressed like 0xFFAA66 or so. for that reason it is sensitive for endianness... with this function it works correctly diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index 5a85fbfc375..48ebf770e1b 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -1722,6 +1722,7 @@ void BLI_where_am_i(char *fullname, const char *name) path = br_find_exe( NULL ); if (path) { strcpy(fullname, path); + free(path); return; } #endif diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 9cfce5e34fa..3c629818b2d 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7646,6 +7646,23 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } + /* sun/sky */ + if ((main->versionfile < 246) ){ + Lamp *la; + for(la=main->lamp.first; la; la= la->id.next) { + la->sun_effect_type = 0; + la->horizon_brightness = 1.0; + la->spread = 1.0; + la->sun_brightness = 1.0; + la->sun_size = 1.0; + la->backscattered_light = 1.0; + la->atm_turbidity = 2.0; + la->atm_inscattering_factor = 1.0; + la->atm_extinction_factor = 1.0; + la->atm_distance_factor = 1.0; + la->sun_intensity = 1.0; + } + } /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */ diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 9f28e13ff7b..ca91f1dc346 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -603,6 +603,9 @@ static void write_sensors(WriteData *wd, ListBase *lb) case SENS_PROPERTY: writestruct(wd, DATA, "bPropertySensor", 1, sens->data); break; + case SENS_ACTUATOR: + writestruct(wd, DATA, "bActuatorSensor", 1, sens->data); + break; case SENS_COLLISION: writestruct(wd, DATA, "bCollisionSensor", 1, sens->data); break; diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index b59908fef39..fe352610a40 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -842,7 +842,7 @@ typedef struct RGBA } RGBA; -#if 0 +/* debug only */ static void exr_print_filecontents(InputFile *file) { const ChannelList &channels = file->header().channels(); @@ -853,7 +853,27 @@ static void exr_print_filecontents(InputFile *file) printf("OpenEXR-load: Found channel %s of type %d\n", i.name(), channel.type); } } -#endif + +/* for non-multilayer, map R G B A channel names to something that's in this file */ +static const char *exr_rgba_channelname(InputFile *file, const char *chan) +{ + const ChannelList &channels = file->header().channels(); + + for (ChannelList::ConstIterator i = channels.begin(); i != channels.end(); ++i) + { + const Channel &channel = i.channel(); + const char *str= i.name(); + int len= strlen(str); + if(len) { + if(BLI_strcasecmp(chan, str+len-1)==0) { + return str; + } + } + } + return chan; +} + + static int exr_has_zbuffer(InputFile *file) { @@ -896,7 +916,8 @@ struct ImBuf *imb_load_openexr(unsigned char *mem, int size, int flags) //printf("OpenEXR-load: image data window %d %d %d %d\n", // dw.min.x, dw.min.y, dw.max.x, dw.max.y); - // exr_print_filecontents(file); + if(0) // debug + exr_print_filecontents(file); is_multi= exr_is_renderresult(file); @@ -935,11 +956,15 @@ struct ImBuf *imb_load_openexr(unsigned char *mem, int size, int flags) /* but, since we read y-flipped (negative y stride) we move to last scanline */ first+= 4*(height-1)*width; - frameBuffer.insert ("R", Slice (FLOAT, (char *) first, xstride, ystride)); - frameBuffer.insert ("G", Slice (FLOAT, (char *) (first+1), xstride, ystride)); - frameBuffer.insert ("B", Slice (FLOAT, (char *) (first+2), xstride, ystride)); - /* 1.0 is fill value */ - frameBuffer.insert ("A", Slice (FLOAT, (char *) (first+3), xstride, ystride, 1, 1, 1.0f)); + frameBuffer.insert ( exr_rgba_channelname(file, "R"), + Slice (FLOAT, (char *) first, xstride, ystride)); + frameBuffer.insert ( exr_rgba_channelname(file, "G"), + Slice (FLOAT, (char *) (first+1), xstride, ystride)); + frameBuffer.insert ( exr_rgba_channelname(file, "B"), + Slice (FLOAT, (char *) (first+2), xstride, ystride)); + + frameBuffer.insert ( exr_rgba_channelname(file, "A"), + Slice (FLOAT, (char *) (first+3), xstride, ystride, 1, 1, 1.0f)); /* 1.0 is fill value */ if(exr_has_zbuffer(file)) { diff --git a/source/blender/include/BDR_drawobject.h b/source/blender/include/BDR_drawobject.h index 3f9a6e438cc..de28db64c3b 100644 --- a/source/blender/include/BDR_drawobject.h +++ b/source/blender/include/BDR_drawobject.h @@ -63,6 +63,7 @@ void get_local_bounds(struct Object *ob, float *center, float *size); /* drawing flags: */ #define DRAW_PICKING 1 #define DRAW_CONSTCOLOR 2 +#define DRAW_SCENESET 4 void draw_object(struct Base *base, int flag); void drawaxes(float size, int flag, char drawtype); diff --git a/source/blender/include/BIF_editaction.h b/source/blender/include/BIF_editaction.h index 2d751f56fc5..7e0f703681b 100644 --- a/source/blender/include/BIF_editaction.h +++ b/source/blender/include/BIF_editaction.h @@ -141,6 +141,7 @@ void paste_actdata(void); /* Group/Channel Operations */ struct bActionGroup *get_active_actiongroup(struct bAction *act); void set_active_actiongroup(struct bAction *act, struct bActionGroup *agrp, short select); +void actionbone_group_copycolors(struct bActionGroup *grp, short init_new); void verify_pchan2achan_grouping(struct bAction *act, struct bPose *pose, char name[]); void sync_pchan2achan_grouping(void); void action_groups_group(short add_group); @@ -166,6 +167,7 @@ void deselect_action_channels(short mode); void deselect_actionchannels(struct bAction *act, short mode); int select_channel(struct bAction *act, struct bActionChannel *achan, int selectmode); void select_actionchannel_by_name(struct bAction *act, char *name, int select); +void select_action_group_channels(struct bAction *act, struct bActionGroup *agrp); void selectkeys_leftright (short leftright, short select_mode); /* Action Markers */ diff --git a/source/blender/include/BIF_editarmature.h b/source/blender/include/BIF_editarmature.h index 0e1557ac378..24112c7f11a 100644 --- a/source/blender/include/BIF_editarmature.h +++ b/source/blender/include/BIF_editarmature.h @@ -80,7 +80,7 @@ void clear_armature(struct Object *ob, char mode); void delete_armature(void); void deselectall_armature(int toggle, int doundo); void deselectall_posearmature (struct Object *ob, int test, int doundo); -int draw_armature(struct Base *base, int dt); +int draw_armature(struct Base *base, int dt, int flag); void extrude_armature(int forked); void subdivide_armature(int numcuts); diff --git a/source/blender/include/BIF_resources.h b/source/blender/include/BIF_resources.h index e6cbe7bb69a..df514190270 100644 --- a/source/blender/include/BIF_resources.h +++ b/source/blender/include/BIF_resources.h @@ -591,6 +591,9 @@ void BIF_load_ui_colors (void); char *BIF_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid); char *BIF_ThemeColorsPup(int spacetype); +/* only for Bone Color sets */ +char *BIF_ThemeColorSetsPup(short inc_custom); + void BIF_def_color (BIFColorID colorid, unsigned char r, unsigned char g, unsigned char b); diff --git a/source/blender/include/BSE_sequence.h b/source/blender/include/BSE_sequence.h index 15a9218b735..0d96de7be60 100644 --- a/source/blender/include/BSE_sequence.h +++ b/source/blender/include/BSE_sequence.h @@ -92,6 +92,8 @@ void update_changed_seq_and_deps(struct Sequence *seq, int len_change, int ibuf_ struct RenderResult; void do_render_seq(struct RenderResult *rr, int cfra); +int seq_can_blend(struct Sequence *seq); + #define SEQ_HAS_PATH(seq) (seq->type==SEQ_MOVIE || seq->type==SEQ_HD_SOUND || seq->type==SEQ_RAM_SOUND || seq->type==SEQ_IMAGE) #endif diff --git a/source/blender/include/blendef.h b/source/blender/include/blendef.h index a798224b35b..6f8b94d7cd1 100644 --- a/source/blender/include/blendef.h +++ b/source/blender/include/blendef.h @@ -409,6 +409,12 @@ #define B_ACTCOPYKEYS 710 #define B_ACTPASTEKEYS 711 +#define B_ACTCUSTCOLORS 712 +#define B_ACTCOLSSELECTOR 713 +#define B_ACTGRP_SELALL 714 +#define B_ACTGRP_ADDTOSELF 715 +#define B_ACTGRP_UNGROUP 716 + /* TIME: 751 - 800 */ #define B_TL_REW 751 #define B_TL_PLAY 752 diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h index 51f03a676e4..ac9761f165d 100644 --- a/source/blender/makesdna/DNA_actuator_types.h +++ b/source/blender/makesdna/DNA_actuator_types.h @@ -51,8 +51,9 @@ typedef struct bActionActuator { int sta, end; /* Start & End frames */ char name[32]; /* For property-driven playback */ char frameProp[32]; /* Set this property to the actions current frame */ - int blendin; /* Number of frames of blending */ - short priority; /* Execution priority */ + short blendin; /* Number of frames of blending */ + short priority; /* Execution priority */ + short end_reset; /* Ending the actuator (negative pulse) wont reset the the action to its starting frame */ short strideaxis; /* Displacement axis */ float stridelength; /* Displacement incurred by cycle */ } bActionActuator; @@ -98,8 +99,8 @@ typedef struct bPropertyActuator { } bPropertyActuator; typedef struct bObjectActuator { - short flag, type; - int damping; + short flag, type, otype; + short damping; float forceloc[3], forcerot[3]; float loc[3], rot[3]; float dloc[3], drot[3]; @@ -124,10 +125,13 @@ typedef struct bCameraActuator { } bCameraActuator ; typedef struct bConstraintActuator { + short type, mode; short flag, damp; - float slow; + short time, rotdamp; + int pad; float minloc[3], maxloc[3]; float minrot[3], maxrot[3]; + char matprop[32]; } bConstraintActuator; typedef struct bGroupActuator { @@ -192,9 +196,7 @@ typedef struct bVisibilityActuator { } bVisibilityActuator; typedef struct bTwoDFilterActuator{ - char pad[2]; - /* bitwise flag for enabling or disabling depth(bit 0) and luminance(bit 1) */ - short texture_flag; + char pad[4]; /* Tells what type of 2D Filter */ short type; /* (flag == 0) means 2D filter is activate and @@ -249,20 +251,19 @@ typedef struct FreeCamera { /* objectactuator->flag */ #define ACT_FORCE_LOCAL 1 #define ACT_TORQUE_LOCAL 2 +#define ACT_SERVO_LIMIT_X 2 #define ACT_DLOC_LOCAL 4 +#define ACT_SERVO_LIMIT_Y 4 #define ACT_DROT_LOCAL 8 +#define ACT_SERVO_LIMIT_Z 8 #define ACT_LIN_VEL_LOCAL 16 #define ACT_ANG_VEL_LOCAL 32 //#define ACT_ADD_LIN_VEL_LOCAL 64 #define ACT_ADD_LIN_VEL 64 -#define ACT_CLAMP_VEL 128 -#define ACT_OBJECT_FORCE 0 -#define ACT_OBJECT_TORQUE 1 -#define ACT_OBJECT_DLOC 2 -#define ACT_OBJECT_DROT 3 -#define ACT_OBJECT_LINV 4 -#define ACT_OBJECT_ANGV 5 +/* objectactuator->type */ +#define ACT_OBJECT_NORMAL 0 +#define ACT_OBJECT_SERVO 1 /* actuator->type */ #define ACT_OBJECT 0 @@ -337,8 +338,9 @@ typedef struct FreeCamera { /* ipoactuator->flag */ #define ACT_IPOFORCE (1 << 0) #define ACT_IPOEND (1 << 1) -#define ACT_IPOFORCE_LOCAL (1 << 2) -#define ACT_IPOCHILD (1 << 4) +#define ACT_IPOLOCAL (1 << 2) +#define ACT_IPOCHILD (1 << 4) +#define ACT_IPOADD (1 << 5) /* ipoactuator->flag for k2k */ #define ACT_K2K_PREV 1 @@ -358,6 +360,22 @@ typedef struct FreeCamera { #define ACT_CONST_ROTX 8 #define ACT_CONST_ROTY 16 #define ACT_CONST_ROTZ 32 +#define ACT_CONST_NORMAL 64 +#define ACT_CONST_MATERIAL 128 +#define ACT_CONST_PERMANENT 256 +#define ACT_CONST_DISTANCE 512 +/* constraint mode */ +#define ACT_CONST_DIRPX 1 +#define ACT_CONST_DIRPY 2 +#define ACT_CONST_DIRPZ 4 +#define ACT_CONST_DIRMX 8 +#define ACT_CONST_DIRMY 16 +#define ACT_CONST_DIRMZ 32 + +/* constraint type */ +#define ACT_CONST_TYPE_LOC 0 +#define ACT_CONST_TYPE_DIST 1 +#define ACT_CONST_TYPE_ORI 2 /* editObjectActuator->type */ #define ACT_EDOB_ADD_OBJECT 0 diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h index 73a39abac55..72557145270 100644 --- a/source/blender/makesdna/DNA_customdata_types.h +++ b/source/blender/makesdna/DNA_customdata_types.h @@ -26,6 +26,7 @@ * * ***** END GPL LICENSE BLOCK ***** */ + #ifndef DNA_CUSTOMDATA_TYPES_H #define DNA_CUSTOMDATA_TYPES_H @@ -48,6 +49,7 @@ typedef struct CustomData { CustomDataLayer *layers; /* CustomDataLayers, ordered by type */ int totlayer, maxlayer; /* number of layers, size of layers array */ int totsize, pad; /* in editmode, total size of all data layers */ + void *pool; /* for Bmesh: Memory pool for allocation of blocks*/ } CustomData; /* CustomData.type */ @@ -66,7 +68,10 @@ typedef struct CustomData { #define CD_PROP_STR 12 #define CD_ORIGSPACE 13 /* for modifier stack face location mapping */ #define CD_ORCO 14 -#define CD_NUMTYPES 15 +#define CD_MTEXPOLY 15 +#define CD_MLOOPUV 16 +#define CD_MLOOPCOL 17 +#define CD_NUMTYPES 18 /* Bits for CustomDataMask */ #define CD_MASK_MVERT (1 << CD_MVERT) @@ -84,6 +89,9 @@ typedef struct CustomData { #define CD_MASK_PROP_STR (1 << CD_PROP_STR) #define CD_MASK_ORIGSPACE (1 << CD_ORIGSPACE) #define CD_MASK_ORCO (1 << CD_ORCO) +#define CD_MASK_MTEXPOLY (1 << CD_MTEXPOLY) +#define CD_MASK_MLOOPUV (1 << CD_MLOOPUV) +#define CD_MASK_MLOOPCOL (1 << CD_MLOOPCOL) /* CustomData.flag */ diff --git a/source/blender/makesdna/DNA_lamp_types.h b/source/blender/makesdna/DNA_lamp_types.h index 2afe78289c1..c00dae08eb4 100644 --- a/source/blender/makesdna/DNA_lamp_types.h +++ b/source/blender/makesdna/DNA_lamp_types.h @@ -76,6 +76,21 @@ typedef struct Lamp { /* texact is for buttons */ short texact, shadhalostep; + /* sun/sky */ + short sun_effect_type; + short atm_pad[3]; + float horizon_brightness; + float spread; + float sun_brightness; + float sun_size; + float backscattered_light; + float sun_intensity; + float atm_turbidity; + float atm_inscattering_factor; + float atm_extinction_factor; + float atm_distance_factor; + + /* yafray: photonlight params */ int YF_numphotons, YF_numsearch; short YF_phdepth, YF_useqmc, YF_bufsize, YF_pad; @@ -123,6 +138,10 @@ typedef struct Lamp { /* Since it is used with LOCAL lamp, can't use LA_SHAD */ #define LA_YF_SOFT 16384 +/* sun effect type*/ +#define LA_SUN_EFFECT_SKY 1 +#define LA_SUN_EFFECT_AP 2 + /* falloff_type */ #define LA_FALLOFF_CONSTANT 0 #define LA_FALLOFF_INVLINEAR 1 diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h index a717df640f1..6d025839ac8 100644 --- a/source/blender/makesdna/DNA_meshdata_types.h +++ b/source/blender/makesdna/DNA_meshdata_types.h @@ -69,6 +69,21 @@ typedef struct MCol { char a, r, g, b; } MCol; +/*bmesh custom data stuff*/ +typedef struct MTexPoly{ + struct Image *tpage; + char flag, transp; + short mode,tile,unwrap; +}MTexPoly; + +typedef struct MLoopUV{ + float uv[2]; +}MLoopUV; + +typedef struct MLoopCol{ + char a, r, g, b; +}MLoopCol; + typedef struct MSticky { float co[2]; } MSticky; diff --git a/source/blender/makesdna/DNA_sensor_types.h b/source/blender/makesdna/DNA_sensor_types.h index ae7b92bb06c..c0306f43730 100644 --- a/source/blender/makesdna/DNA_sensor_types.h +++ b/source/blender/makesdna/DNA_sensor_types.h @@ -82,6 +82,12 @@ typedef struct bPropertySensor { char maxvalue[32]; } bPropertySensor; +typedef struct bActuatorSensor { + int type; + int pad; + char name[32]; +} bActuatorSensor; + typedef struct bCollisionSensor { char name[32]; /* property name */ char materialName[32]; /* material */ @@ -197,6 +203,7 @@ typedef struct bJoystickSensor { #define SENS_RAY 9 #define SENS_MESSAGE 10 #define SENS_JOYSTICK 11 +#define SENS_ACTUATOR 12 /* sensor->flag */ #define SENS_SHOW 1 #define SENS_DEL 2 diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index af60f9ca713..bc30a12ff27 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -232,8 +232,9 @@ typedef struct SpaceImage { short imanr; short curtile; /* the currently active tile of the image when tile is enabled, is kept in sync with the active faces tile */ int flag; + short selectmode; short imtypenr, lock; - short pin, pad2; + short pin; float zoom; char dt_uv; /* UV draw type */ char sticky; /* sticky selection type */ @@ -496,6 +497,12 @@ typedef struct SpaceImaSel { #define SI_STICKY_DISABLE 1 #define SI_STICKY_VERTEX 2 +/* SpaceImage->selectmode */ +#define SI_SELECT_VERTEX 0 +#define SI_SELECT_EDGE 1 /* not implemented */ +#define SI_SELECT_FACE 2 +#define SI_SELECT_ISLAND 3 + /* SpaceImage->flag */ #define SI_BE_SQUARE 1<<0 #define SI_EDITTILE 1<<1 @@ -503,7 +510,7 @@ typedef struct SpaceImaSel { #define SI_DRAWTOOL 1<<3 #define SI_DEPRECATED1 1<<4 /* stick UVs to others in the same location */ #define SI_DRAWSHADOW 1<<5 -#define SI_SELACTFACE 1<<6 +#define SI_SELACTFACE 1<<6 /* deprecated */ #define SI_DEPRECATED2 1<<7 #define SI_DEPRECATED3 1<<8 /* stick UV selection to mesh vertex (UVs wont always be touching) */ #define SI_COORDFLOATS 1<<9 diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 3de5b0ff5ba..cd1c047dac9 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -116,6 +116,7 @@ typedef struct ThemeWireColor { /* flags for ThemeWireColor */ #define TH_WIRECOLOR_CONSTCOLS (1<<0) +#define TH_WIRECOLOR_TEXTCOLS (1<<1) /* A theme */ typedef struct bTheme { diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c b/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c index ff9e2b716ce..e77de3726cb 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c @@ -47,7 +47,7 @@ static void do_gamma(bNode *node, float *out, float *in, float *fac) int i=0; for(i=0; i<3; i++) { /* check for negative to avoid nan's */ - out[i] = (in[0] > 0.0f)? pow(in[i],fac[0]): in[0]; + out[i] = (in[i] > 0.0f)? pow(in[i],fac[0]): in[i]; } out[3] = in[3]; } diff --git a/source/blender/python/BPY_interface.c b/source/blender/python/BPY_interface.c index 2f94e0eeebc..226657655fa 100644 --- a/source/blender/python/BPY_interface.c +++ b/source/blender/python/BPY_interface.c @@ -229,13 +229,6 @@ void BPY_start_python( int argc, char **argv ) /* Initialize thread support (also acquires lock) */ PyEval_InitThreads(); - /* Don't allow the Python Interpreter to release the GIL on - * its own, to guarantee PyNodes work properly. For Blender this - * is currently the best default behavior. - * The following code in C is equivalent in Python to: - * "import sys; sys.setcheckinterval(sys.maxint)" */ - _Py_CheckInterval = PyInt_GetMax(); - //Overrides __import__ init_ourImport( ); init_ourReload( ); @@ -2188,6 +2181,18 @@ void BPY_do_all_scripts( short event ) BPY_do_pyscript( &( G.scene->id ), event ); + /* Don't allow the Python Interpreter to release the GIL on + * its own, to guarantee PyNodes work properly. For Blender this + * is currently the best default behavior. + * The following code in C is equivalent in Python to: + * "import sys; sys.setcheckinterval(sys.maxint)" */ + if (event == SCRIPT_RENDER) { + _Py_CheckInterval = PyInt_GetMax(); + } + else if (event == SCRIPT_POSTRENDER) { + _Py_CheckInterval = 100; /* Python default */ + } + return; } @@ -2270,9 +2275,9 @@ void BPY_do_pyscript( ID * id, short event ) return; } - /* tell we're running a scriptlink. The sum also tells if this script - * is running nested inside another. Blender.Load needs this info to - * avoid trouble with invalid slink pointers. */ + /* tell we're running a scriptlink. The sum also tells if this + * script is running nested inside another. Blender.Load needs + * this info to avoid trouble with invalid slink pointers. */ during_slink++; disable_where_scriptlink( (short)during_slink ); diff --git a/source/blender/python/api2_2x/matrix.c b/source/blender/python/api2_2x/matrix.c index d81e56ec3dc..9f5e49e8d88 100644 --- a/source/blender/python/api2_2x/matrix.c +++ b/source/blender/python/api2_2x/matrix.c @@ -483,7 +483,7 @@ static char MatrixObject_doc[] = "This is a wrapper for matrix objects."; sequence length*/ static int Matrix_len(MatrixObject * self) { - return (self->colSize * self->rowSize); + return (self->rowSize); } /*----------------------------object[]--------------------------- sequence accessor (get) diff --git a/source/blender/python/api2_2x/sceneSequence.c b/source/blender/python/api2_2x/sceneSequence.c index 56821980cd2..0d3ad3fcb44 100644 --- a/source/blender/python/api2_2x/sceneSequence.c +++ b/source/blender/python/api2_2x/sceneSequence.c @@ -81,6 +81,7 @@ returns None if notfound.\nIf 'name' is not specified, it returns a list of all static PyObject *Sequence_copy( BPy_Sequence * self ); static PyObject *Sequence_new( BPy_Sequence * self, PyObject * args ); static PyObject *Sequence_remove( BPy_Sequence * self, PyObject * args ); +static PyObject *Sequence_rebuildProxy( BPy_Sequence * self ); static PyObject *SceneSeq_new( BPy_SceneSeq * self, PyObject * args ); static PyObject *SceneSeq_remove( BPy_SceneSeq * self, PyObject * args ); @@ -96,6 +97,8 @@ static PyMethodDef BPy_Sequence_methods[] = { "() - Return a copy of the sequence containing the same objects."}, {"copy", ( PyCFunction ) Sequence_copy, METH_NOARGS, "() - Return a copy of the sequence containing the same objects."}, + {"rebuildProxy", ( PyCFunction ) Sequence_rebuildProxy, METH_VARARGS, + "() - Rebuild the active strip's Proxy."}, {NULL, NULL, 0, NULL} }; @@ -309,6 +312,7 @@ static PyObject *Sequence_copy( BPy_Sequence * self ) Py_RETURN_NONE; } + /*****************************************************************************/ /* PythonTypeObject callback function prototypes */ /*****************************************************************************/ @@ -383,8 +387,6 @@ static PyObject *SceneSeq_nextIter( BPy_Sequence * self ) } - - static PyObject *Sequence_getName( BPy_Sequence * self ) { return PyString_FromString( self->seq->name+2 ); @@ -403,11 +405,13 @@ static int Sequence_setName( BPy_Sequence * self, PyObject * value ) return 0; } + static PyObject *Sequence_getProxyDir( BPy_Sequence * self ) { return PyString_FromString( self->seq->strip->proxy ? self->seq->strip->proxy->dir : "" ); } + static int Sequence_setProxyDir( BPy_Sequence * self, PyObject * value ) { char *name = NULL; @@ -430,6 +434,14 @@ static int Sequence_setProxyDir( BPy_Sequence * self, PyObject * value ) } +static PyObject *Sequence_rebuildProxy( BPy_Sequence * self ) +{ + if (self->seq->strip->proxy) + seq_proxy_rebuild(self->seq); + Py_RETURN_NONE; +} + + static PyObject *Sequence_getSound( BPy_Sequence * self ) { if (self->seq->type == SEQ_RAM_SOUND && self->seq->sound) @@ -622,6 +634,54 @@ static int Sequence_setImages( BPy_Sequence * self, PyObject *value ) return 0; } +static PyObject *M_Sequence_BlendModesDict( void ) +{ + PyObject *M = PyConstant_New( ); + + if( M ) { + BPy_constant *d = ( BPy_constant * ) M; + PyConstant_Insert( d, "CROSS", PyInt_FromLong( SEQ_CROSS ) ); + PyConstant_Insert( d, "ADD", PyInt_FromLong( SEQ_ADD ) ); + PyConstant_Insert( d, "SUBTRACT", PyInt_FromLong( SEQ_SUB ) ); + PyConstant_Insert( d, "ALPHAOVER", PyInt_FromLong( SEQ_ALPHAOVER ) ); + PyConstant_Insert( d, "ALPHAUNDER", PyInt_FromLong( SEQ_ALPHAUNDER ) ); + PyConstant_Insert( d, "GAMMACROSS", PyInt_FromLong( SEQ_GAMCROSS ) ); + PyConstant_Insert( d, "MULTIPLY", PyInt_FromLong( SEQ_MUL ) ); + PyConstant_Insert( d, "OVERDROP", PyInt_FromLong( SEQ_OVERDROP ) ); + PyConstant_Insert( d, "PLUGIN", PyInt_FromLong( SEQ_PLUGIN ) ); + PyConstant_Insert( d, "WIPE", PyInt_FromLong( SEQ_WIPE ) ); + PyConstant_Insert( d, "GLOW", PyInt_FromLong( SEQ_GLOW ) ); + PyConstant_Insert( d, "TRANSFORM", PyInt_FromLong( SEQ_TRANSFORM ) ); + PyConstant_Insert( d, "COLOR", PyInt_FromLong( SEQ_COLOR ) ); + PyConstant_Insert( d, "SPEED", PyInt_FromLong( SEQ_SPEED ) ); + } + return M; +} + +static PyObject *Sequence_getBlendMode( BPy_Sequence * self ) +{ + return PyInt_FromLong( self->seq->blend_mode ); +} + +static int Sequence_setBlendMode( BPy_Sequence * self, PyObject * value ) +{ + struct Sequence *seq= self->seq; + int number = PyInt_AsLong( value ); + + if( number==-1 && PyErr_Occurred() ) + return EXPP_ReturnIntError( PyExc_TypeError, "expected an int value" ); + + if ( !seq_can_blend(seq) ) + return EXPP_ReturnIntError( PyExc_AttributeError, "this sequence type dosnt support blending" ); + + if (numberSEQ_EFFECT_MAX) + return EXPP_ReturnIntError( PyExc_TypeError, "expected an int value" ); + + seq->blend_mode=number; + + return 0; +} + /* * get floating point attributes */ @@ -836,7 +896,11 @@ static PyGetSetDef BPy_Sequence_getseters[] = { (getter)Sequence_getImages, (setter)Sequence_setImages, "Sequence scene", NULL}, - + {"blendMode", + (getter)Sequence_getBlendMode, (setter)Sequence_setBlendMode, + "Sequence Blend Mode", + NULL}, + {"type", (getter)getIntAttr, (setter)NULL, "", @@ -1131,6 +1195,7 @@ PyObject *M_Sequence_Get( PyObject * self, PyObject * args ) /*****************************************************************************/ PyObject *Sequence_Init( void ) { + PyObject *BlendModesDict = M_Sequence_BlendModesDict( ); PyObject *submodule; if( PyType_Ready( &Sequence_Type ) < 0 ) return NULL; @@ -1142,6 +1207,9 @@ PyObject *Sequence_Init( void ) "The Blender Sequence module\n\n\ This module provides access to **Sequence Data** in Blender.\n" ); + if( BlendModesDict ) + PyModule_AddObject( submodule, "BlendModes", BlendModesDict ); + /*Add SUBMODULES to the module*/ /*PyDict_SetItemString(dict, "Constraint", Constraint_Init()); //creates a *new* module*/ return submodule; diff --git a/source/blender/radiosity/intern/source/radrender.c b/source/blender/radiosity/intern/source/radrender.c index e5ef1e9a4a2..68b5fa81f43 100644 --- a/source/blender/radiosity/intern/source/radrender.c +++ b/source/blender/radiosity/intern/source/radrender.c @@ -369,9 +369,18 @@ printf(" Rad elems: %d emittors %d\n", RG.totelem, RG.totpatch); if(vlr->mat->mode & MA_RADIO) { /* during render, vlr->n gets flipped/corrected, we cannot have that */ - if(vlr->v4) CalcNormFloat4(vlr->v1->co, vlr->v2->co, vlr->v3->co, vlr->v4->co, rf->norm); - else CalcNormFloat(vlr->v1->co, vlr->v2->co, vlr->v3->co, rf->norm); - + if (obr->ob->transflag & OB_NEG_SCALE){ + /* The object has negative scale that will cause the normals to flip. + To counter this unwanted normal flip, swap vertex 2 and 4 for a quad + or vertex 2 and 3 (see flip_face) for a triangle in the call to CalcNormFloat4 + in order to flip the normals back to the way they were in the original mesh. */ + if(vlr->v4) CalcNormFloat4(vlr->v1->co, vlr->v4->co, vlr->v3->co, vlr->v2->co, rf->norm); + else CalcNormFloat(vlr->v1->co, vlr->v3->co, vlr->v2->co, rf->norm); + }else{ + if(vlr->v4) CalcNormFloat4(vlr->v1->co, vlr->v2->co, vlr->v3->co, vlr->v4->co, rf->norm); + else CalcNormFloat(vlr->v1->co, vlr->v2->co, vlr->v3->co, rf->norm); + } + rf->totrad[0]= vlr->mat->emit*vlr->mat->r; rf->totrad[1]= vlr->mat->emit*vlr->mat->g; rf->totrad[2]= vlr->mat->emit*vlr->mat->b; diff --git a/source/blender/render/intern/include/pixelshading.h b/source/blender/render/intern/include/pixelshading.h index ee7199a4295..15d696df89d 100644 --- a/source/blender/render/intern/include/pixelshading.h +++ b/source/blender/render/intern/include/pixelshading.h @@ -55,6 +55,7 @@ int shadeHaloFloat(HaloRen *har, */ void shadeSkyPixel(float *collector, float fx, float fy); void shadeSkyView(float *colf, float *rco, float *view, float *dxyview); +void shadeAtmPixel(struct SunSky *sunsky, float *collector, float fx, float fy, float distance); /* ------------------------------------------------------------------------- */ diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index 8414b6aefe3..2f97b19f75c 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -42,6 +42,7 @@ #include "RE_pipeline.h" #include "RE_shader_ext.h" /* TexResult, ShadeResult, ShadeInput */ +#include "sunsky.h" struct Object; struct MemArena; @@ -455,6 +456,9 @@ typedef struct LampRen { float area_size, area_sizey, area_sizez; float adapt_thresh; + /* sun/sky */ + struct SunSky *sunsky; + struct ShadBuf *shb; float *jitter; diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 796a99ca796..faa7a68f754 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -114,6 +114,7 @@ #include "sss.h" #include "strand.h" #include "zbuf.h" +#include "sunsky.h" #ifndef DISABLE_YAFRAY /* disable yafray */ @@ -203,6 +204,7 @@ void RE_make_stars(Render *re, void (*initfunc)(void), else stargrid *= 1.0; /* then it draws fewer */ if(re) MTC_Mat4Invert(mat, re->viewmat); + else MTC_Mat4One(mat); /* BOUNDING BOX CALCULATION * bbox goes from z = loc_near_var | loc_far_var, @@ -3494,6 +3496,7 @@ static GroupObject *add_render_lamp(Render *re, Object *ob) LampRen *lar; GroupObject *go; float mat[4][4], angle, xn, yn; + float vec[3]; int c; /* previewrender sets this to zero... prevent accidents */ @@ -3576,8 +3579,9 @@ static GroupObject *add_render_lamp(Render *re, Object *ob) lar->ray_samp_type= la->ray_samp_type; lar->adapt_thresh= la->adapt_thresh; + lar->sunsky = NULL; - if( ELEM3(lar->type, LA_SPOT, LA_SUN, LA_LOCAL)) { + if( ELEM(lar->type, LA_SPOT, LA_LOCAL)) { lar->ray_totsamp= lar->ray_samp*lar->ray_samp; lar->area_shape = LA_AREA_SQUARE; lar->area_sizey= lar->area_size; @@ -3607,6 +3611,26 @@ static GroupObject *add_render_lamp(Render *re, Object *ob) area_lamp_vectors(lar); init_jitter_plane(lar); // subsamples } + else if(lar->type==LA_SUN){ + lar->ray_totsamp= lar->ray_samp*lar->ray_samp; + lar->area_shape = LA_AREA_SQUARE; + lar->area_sizey= lar->area_size; + + if((la->sun_effect_type & LA_SUN_EFFECT_SKY) || + (la->sun_effect_type & LA_SUN_EFFECT_AP)){ + lar->sunsky = (struct SunSky*)MEM_callocN(sizeof(struct SunSky), "sunskyren"); + lar->sunsky->effect_type = la->sun_effect_type; + + VECCOPY(vec,ob->obmat[2]); + Normalize(vec); + + InitSunSky(lar->sunsky, la->atm_turbidity, vec, la->horizon_brightness, + la->spread, la->sun_brightness, la->sun_size, la->backscattered_light); + + InitAtmosphere(lar->sunsky, la->sun_intensity, 1.0, 1.0, la->atm_inscattering_factor, la->atm_extinction_factor, + la->atm_distance_factor); + } + } else lar->ray_totsamp= 0; #ifndef DISABLE_YAFRAY @@ -4447,6 +4471,7 @@ void RE_Database_Free(Render *re) freeshadowbuf(lar); if(lar->jitter) MEM_freeN(lar->jitter); if(lar->shadsamp) MEM_freeN(lar->shadsamp); + if(lar->sunsky) MEM_freeN(lar->sunsky); curvemapping_free(lar->curfalloff); } diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c index fc5ac68e8c9..2e3509f0471 100644 --- a/source/blender/render/intern/source/pixelshading.c +++ b/source/blender/render/intern/source/pixelshading.c @@ -57,6 +57,7 @@ #include "rendercore.h" #include "shadbuf.h" #include "pixelshading.h" +#include "sunsky.h" /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ /* defined in pipeline.c, is hardcopy of active dynamic allocated Render */ @@ -567,13 +568,49 @@ void shadeSkyView(float *colf, float *rco, float *view, float *dxyview) } } +/* shade sky according to sun lamps, all parameters are like shadeSkyView except sunsky*/ +void shadeSunView(struct SunSky *sunsky, float *colf, float *rco, float *view, float *dxyview) +{ + float colorxyz[3]; + float scale; + + /** + sunAngle = sqrt(sunsky->sunSolidAngle / M_PI); + + sunDir[0] = sunsky->toSun[0]; + sunDir[1] = sunsky->toSun[1]; + sunDir[2] = sunsky->toSun[2]; + */ + + Normalize(view); + MTC_Mat3MulVecfl(R.imat, view); + if (view[2] < 0.0) + view[2] = 0.0; + Normalize(view); + GetSkyXYZRadiancef(sunsky, view, colorxyz); + scale = MAX3(colorxyz[0], colorxyz[1], colorxyz[2]); + colorxyz[0] /= scale; + colorxyz[1] /= scale; + colorxyz[2] /= scale; + + xyz_to_rgb(colorxyz[0], colorxyz[1], colorxyz[2], &colf[0], &colf[1], &colf[2]); + + ClipColor(colf); +} + + /* Stuff the sky color into the collector. */ void shadeSkyPixel(float *collector, float fx, float fy) { float view[3], dxyview[2]; - + float sun_collector[3]; + float suns_color[3]; + short num_sun_lamp; + GroupObject *go; + LampRen *lar; + /* The rules for sky: 1. Draw an image, if a background image was provided. Stop @@ -585,7 +622,6 @@ void shadeSkyPixel(float *collector, float fx, float fy) /* 1. Do a backbuffer image: */ if(R.r.bufflag & 1) { fillBackgroundImage(collector, fx, fy); - return; } else if((R.wrld.skytype & (WO_SKYBLEND+WO_SKYTEX))==0) { /* 2. solid color */ @@ -620,7 +656,45 @@ void shadeSkyPixel(float *collector, float fx, float fy) shadeSkyView(collector, NULL, view, dxyview); collector[3] = 0.0f; } + + suns_color[0] = suns_color[1] = suns_color[2] = 0; + num_sun_lamp = 0; + for(go=R.lights.first; go; go= go->next) { + lar= go->lampren; + if(lar->type==LA_SUN && lar->sunsky && (lar->sunsky->effect_type & LA_SUN_EFFECT_SKY)){ + + num_sun_lamp ++; + calc_view_vector(view, fx, fy); + Normalize(view); + + shadeSunView(lar->sunsky, sun_collector, NULL, view, NULL); + suns_color[0] += sun_collector[0]; + suns_color[1] += sun_collector[1]; + suns_color[2] += sun_collector[2]; + + } + } + if( num_sun_lamp > 0 ){ + suns_color[0] /= num_sun_lamp; + suns_color[1] /= num_sun_lamp; + suns_color[2] /= num_sun_lamp; + + collector[0] += suns_color[0]; + collector[1] += suns_color[1]; + collector[2] += suns_color[2]; + ClipColor(collector); + } } +/* aerial perspective */ +void shadeAtmPixel(struct SunSky *sunsky, float *collector, float fx, float fy, float distance) +{ + float view[3]; + + calc_view_vector(view, fx, fy); + Normalize(view); + /*MTC_Mat3MulVecfl(R.imat, view);*/ + AtmospherePixleShader(sunsky, view, distance, collector); +} /* eof */ diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index dae7b0dcd88..67be0ce4c00 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -47,6 +47,7 @@ #include "DNA_lamp_types.h" #include "DNA_material_types.h" #include "DNA_meshdata_types.h" +#include "DNA_group_types.h" #include "BKE_global.h" #include "BKE_image.h" @@ -665,6 +666,88 @@ static void sky_tile(RenderPart *pa, RenderLayer *rl) } } +static void atm_tile(RenderPart *pa, RenderLayer *rl) +{ + RenderPass *zpass; + GroupObject *go; + LampRen *lar; + + int x, y; + short first_lamp; + float *zrect; + float *rgbrect; + float rgb[3]={0}; + float tmp_rgb[3]; + float fac; + float facm; + + fac = 0.5; + facm = 1.0 - fac; + + /* check that z pass is enabled */ + if(pa->rectz==NULL) return; + for(zpass= rl->passes.first; zpass; zpass= zpass->next) + if(zpass->passtype==SCE_PASS_Z) + break; + + if(zpass==NULL) return; + + /* check for at least one sun lamp that its atmosphere flag is is enabled */ + first_lamp = 1; + for(go=R.lights.first; go; go= go->next) { + lar= go->lampren; + if(lar->type==LA_SUN && lar->sunsky && + (lar->sunsky->effect_type & LA_SUN_EFFECT_AP)){ + first_lamp = 0; + break; + } + } + /* do nothign and return if there is no sun lamp */ + if(first_lamp) + return; + + zrect = zpass->rect; + rgbrect = rl->rectf; + /* for each x,y and sun lamp*/ + for(y=pa->disprect.ymin; ydisprect.ymax; y++) { + for(x=pa->disprect.xmin; xdisprect.xmax; x++, zrect++, rgbrect+=4) { + + first_lamp = 1; + for(go=R.lights.first; go; go= go->next) { + lar= go->lampren; + if(lar->type==LA_SUN && lar->sunsky) + + { + /* if it's sky continue and don't apply atmosphere effect on it */ + if(*zrect >= 9.9e10){ + continue; + } + + if(lar->sunsky->effect_type & LA_SUN_EFFECT_AP){ + VECCOPY(tmp_rgb, rgbrect); + + shadeAtmPixel(lar->sunsky, tmp_rgb, x, y, *zrect); + + if(first_lamp){ + VECCOPY(rgb, tmp_rgb); + first_lamp = 0; + } + else{ + rgb[0] = facm*rgb[0] + fac*tmp_rgb[0]; + rgb[1] = facm*rgb[1] + fac*tmp_rgb[1]; + rgb[2] = facm*rgb[2] + fac*tmp_rgb[2]; + } + } + } + } + + /* if at least for one sun lamp aerial perspective was applied*/ + if(first_lamp==0) + VECCOPY(rgbrect, rgb); + } + } +} + static void shadeDA_tile(RenderPart *pa, RenderLayer *rl) { RenderResult *rr= pa->result; @@ -1122,6 +1205,10 @@ void zbufshadeDA_tile(RenderPart *pa) if(R.r.mode & R_EDGE) edge_enhance_add(pa, rl->rectf, edgerect); + /* sun/sky */ + if(rl->layflag & SCE_LAY_SKY) + atm_tile(pa, rl); + if(rl->passflag & SCE_PASS_VECTOR) reset_sky_speed(pa, rl); @@ -1282,6 +1369,10 @@ void zbufshade_tile(RenderPart *pa) edge_enhance_add(pa, rl->rectf, edgerect); } + /* sun/sky */ + if(rl->layflag & SCE_LAY_SKY) + atm_tile(pa, rl); + if(rl->passflag & SCE_PASS_VECTOR) reset_sky_speed(pa, rl); diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 36ab0961150..a21dc8b0f5d 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -5291,32 +5291,6 @@ static void verify_posegroup_groupname(void *arg1, void *arg2) BLI_uniquename(&pose->agroups, grp, "Group", offsetof(bActionGroup, name), 32); } -static char *build_colorsets_menustr () -{ - DynStr *pupds= BLI_dynstr_new(); - char *str; - char buf[48]; - int i; - - /* add title first (and the "default" entry) */ - BLI_dynstr_append(pupds, "Bone Color Set%t|Default Colors%x0|"); - - /* loop through set indices, adding them */ - for (i=1; i<21; i++) { - sprintf(buf, "%d - Theme Color Set%%x%d|", i, i); - BLI_dynstr_append(pupds, buf); - } - - /* add the 'custom' entry */ - BLI_dynstr_append(pupds, "Custom Set %x-1"); - - /* convert to normal MEM_malloc'd string */ - str= BLI_dynstr_get_cstring(pupds); - BLI_dynstr_free(pupds); - - return str; -} - static void editing_panel_links(Object *ob) { uiBlock *block; @@ -5476,32 +5450,14 @@ static void editing_panel_links(Object *ob) /* color set for 'active' group */ if (pose->active_group && grp) { uiBlockBeginAlign(block); - menustr= build_colorsets_menustr(); + menustr= BIF_ThemeColorSetsPup(1); uiDefButI(block, MENU,B_POSEGRP_RECALC, menustr, xco,85,140,19, &grp->customCol, -1, 20, 0.0, 0.0, "Index of set of Custom Colors to shade Group's bones with. 0 = Use Default Color Scheme, -1 = Use Custom Color Scheme"); MEM_freeN(menustr); /* show color-selection/preview */ if (grp->customCol) { - if (grp->customCol > 0) { - /* copy theme colors on-to group's custom color in case user tries to edit color */ - bTheme *btheme= U.themes.first; - ThemeWireColor *col_set= &btheme->tarm[(grp->customCol - 1)]; - - memcpy(&grp->cs, col_set, sizeof(ThemeWireColor)); - } - else { - /* init custom colors with a generic multi-color rgb set, if not initialised already */ - if (grp->cs.solid[0] == 0) { - /* define for setting colors in theme below */ - #define SETCOL(col, r, g, b, a) col[0]=r; col[1]=g; col[2]= b; col[3]= a; - - SETCOL(grp->cs.solid, 0xff, 0x00, 0x00, 255); - SETCOL(grp->cs.select, 0x81, 0xe6, 0x14, 255); - SETCOL(grp->cs.active, 0x18, 0xb6, 0xe0, 255); - - #undef SETCOL - } - } + /* do color copying/init (to stay up to date) */ + actionbone_group_copycolors(grp, 1); /* color changing */ uiDefButC(block, COL, B_POSEGRP_MCUSTOM, "", xco, 65, 30, 19, grp->cs.solid, 0, 0, 0, 0, "Color to use for surface of bones"); diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index 4e5e8a605ee..441d00ffc30 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -387,7 +387,6 @@ void do_logic_buts(unsigned short event) bSensor *sens; bController *cont; bActuator *act; - Base *base; Object *ob; int didit, bit; @@ -443,16 +442,14 @@ void do_logic_buts(unsigned short event) break; case B_ADD_SENS: - base= FIRSTBASE; - while(base) { - if(base->object->scaflag & OB_ADDSENS) { - base->object->scaflag &= ~OB_ADDSENS; + for(ob=G.main->object.first; ob; ob=ob->id.next) { + if(ob->scaflag & OB_ADDSENS) { + ob->scaflag &= ~OB_ADDSENS; sens= new_sensor(SENS_ALWAYS); - BLI_addtail(&(base->object->sensors), sens); + BLI_addtail(&(ob->sensors), sens); make_unique_prop_names(sens->name); - base->object->scaflag |= OB_SHOWSENS; + ob->scaflag |= OB_SHOWSENS; } - base= base->next; } BIF_undo_push("Add sensor"); @@ -460,9 +457,8 @@ void do_logic_buts(unsigned short event) break; case B_CHANGE_SENS: - base= FIRSTBASE; - while(base) { - sens= base->object->sensors.first; + for(ob=G.main->object.first; ob; ob=ob->id.next) { + sens= ob->sensors.first; while(sens) { if(sens->type != sens->otype) { init_sensor(sens); @@ -471,43 +467,39 @@ void do_logic_buts(unsigned short event) } sens= sens->next; } - base= base->next; } allqueue(REDRAWBUTSLOGIC, 0); break; case B_DEL_SENS: - base= FIRSTBASE; - while(base) { - sens= base->object->sensors.first; + for(ob=G.main->object.first; ob; ob=ob->id.next) { + sens= ob->sensors.first; while(sens) { if(sens->flag & SENS_DEL) { - BLI_remlink(&(base->object->sensors), sens); + BLI_remlink(&(ob->sensors), sens); free_sensor(sens); break; } sens= sens->next; } - base= base->next; } BIF_undo_push("Delete sensor"); allqueue(REDRAWBUTSLOGIC, 0); break; case B_ADD_CONT: - base= FIRSTBASE; - while(base) { - if(base->object->scaflag & OB_ADDCONT) { - base->object->scaflag &= ~OB_ADDCONT; + for(ob=G.main->object.first; ob; ob=ob->id.next) { + if(ob->scaflag & OB_ADDCONT) { + ob->scaflag &= ~OB_ADDCONT; cont= new_controller(CONT_LOGIC_AND); make_unique_prop_names(cont->name); - base->object->scaflag |= OB_SHOWCONT; - BLI_addtail(&(base->object->controllers), cont); + ob->scaflag |= OB_SHOWCONT; + BLI_addtail(&(ob->controllers), cont); /* set the controller state mask from the current object state. A controller is always in a single state, so select the lowest bit set from the object state */ for (bit=0; bit<32; bit++) { - if (base->object->state & (1<state & (1<state_mask = (1<state_mask = 1; } } - base= base->next; } BIF_undo_push("Add controller"); allqueue(REDRAWBUTSLOGIC, 0); break; case B_SET_STATE_BIT: - base= FIRSTBASE; - while(base) { - if(base->object->scaflag & OB_SETSTBIT) { - base->object->scaflag &= ~OB_SETSTBIT; - base->object->state = 0x3FFFFFFF; + for(ob=G.main->object.first; ob; ob=ob->id.next) { + if(ob->scaflag & OB_SETSTBIT) { + ob->scaflag &= ~OB_SETSTBIT; + ob->state = 0x3FFFFFFF; } - base= base->next; } allqueue(REDRAWBUTSLOGIC, 0); break; case B_INIT_STATE_BIT: - base= FIRSTBASE; - while(base) { - if(base->object->scaflag & OB_INITSTBIT) { - base->object->scaflag &= ~OB_INITSTBIT; - base->object->state = base->object->init_state; - if (!base->object->state) - base->object->state = 1; + for(ob=G.main->object.first; ob; ob=ob->id.next) { + if(ob->scaflag & OB_INITSTBIT) { + ob->scaflag &= ~OB_INITSTBIT; + ob->state = ob->init_state; + if (!ob->state) + ob->state = 1; } - base= base->next; } allqueue(REDRAWBUTSLOGIC, 0); break; case B_CHANGE_CONT: - base= FIRSTBASE; - while(base) { - cont= base->object->controllers.first; + for(ob=G.main->object.first; ob; ob=ob->id.next) { + cont= ob->controllers.first; while(cont) { if(cont->type != cont->otype) { init_controller(cont); @@ -560,51 +546,45 @@ void do_logic_buts(unsigned short event) } cont= cont->next; } - base= base->next; } allqueue(REDRAWBUTSLOGIC, 0); break; case B_DEL_CONT: - base= FIRSTBASE; - while(base) { - cont= base->object->controllers.first; + for(ob=G.main->object.first; ob; ob=ob->id.next) { + cont= ob->controllers.first; while(cont) { if(cont->flag & CONT_DEL) { - BLI_remlink(&(base->object->controllers), cont); + BLI_remlink(&(ob->controllers), cont); unlink_controller(cont); free_controller(cont); break; } cont= cont->next; } - base= base->next; } BIF_undo_push("Delete controller"); allqueue(REDRAWBUTSLOGIC, 0); break; case B_ADD_ACT: - base= FIRSTBASE; - while(base) { - if(base->object->scaflag & OB_ADDACT) { - base->object->scaflag &= ~OB_ADDACT; + for(ob=G.main->object.first; ob; ob=ob->id.next) { + if(ob->scaflag & OB_ADDACT) { + ob->scaflag &= ~OB_ADDACT; act= new_actuator(ACT_OBJECT); make_unique_prop_names(act->name); - BLI_addtail(&(base->object->actuators), act); - base->object->scaflag |= OB_SHOWACT; + BLI_addtail(&(ob->actuators), act); + ob->scaflag |= OB_SHOWACT; } - base= base->next; } BIF_undo_push("Add actuator"); allqueue(REDRAWBUTSLOGIC, 0); break; case B_CHANGE_ACT: - base= FIRSTBASE; - while(base) { - act= base->object->actuators.first; + for(ob=G.main->object.first; ob; ob=ob->id.next) { + act= ob->actuators.first; while(act) { if(act->type != act->otype) { init_actuator(act); @@ -613,25 +593,22 @@ void do_logic_buts(unsigned short event) } act= act->next; } - base= base->next; } allqueue(REDRAWBUTSLOGIC, 0); break; case B_DEL_ACT: - base= FIRSTBASE; - while(base) { - act= base->object->actuators.first; + for(ob=G.main->object.first; ob; ob=ob->id.next) { + act= ob->actuators.first; while(act) { if(act->flag & ACT_DEL) { - BLI_remlink(&(base->object->actuators), act); + BLI_remlink(&(ob->actuators), act); unlink_actuator(act); free_actuator(act); break; } act= act->next; } - base= base->next; } BIF_undo_push("Delete actuator"); allqueue(REDRAWBUTSLOGIC, 0); @@ -640,10 +617,8 @@ void do_logic_buts(unsigned short event) case B_SOUNDACT_BROWSE: /* since we don't know which... */ didit= 0; - base= FIRSTBASE; - while(base) - { - act= base->object->actuators.first; + for(ob=G.main->object.first; ob; ob=ob->id.next) { + act= ob->actuators.first; while(act) { if(act->type==ACT_SOUND) @@ -684,7 +659,6 @@ void do_logic_buts(unsigned short event) } if(didit) break; - base= base->next; } allqueue(REDRAWBUTSLOGIC, 0); allqueue(REDRAWSOUND, 0); @@ -707,6 +681,8 @@ static char *sensor_name(int type) return "Keyboard"; case SENS_PROPERTY: return "Property"; + case SENS_ACTUATOR: + return "Actuator"; case SENS_MOUSE: return "Mouse"; case SENS_COLLISION: @@ -730,7 +706,7 @@ static char *sensor_pup(void) /* the number needs to match defines in game.h */ return "Sensors %t|Always %x0|Keyboard %x3|Mouse %x5|" "Touch %x1|Collision %x6|Near %x2|Radar %x7|" - "Property %x4|Random %x8|Ray %x9|Message %x10|Joystick %x11"; + "Property %x4|Random %x8|Ray %x9|Message %x10|Joystick %x11|Actuator %x12"; } static char *controller_name(int type) @@ -1029,6 +1005,7 @@ static int get_col_sensor(int type) case SENS_NEAR: return TH_BUT_SETTING1; case SENS_KEYBOARD: return TH_BUT_SETTING2; case SENS_PROPERTY: return TH_BUT_NUM; + case SENS_ACTUATOR: return TH_BUT_NUM; case SENS_MOUSE: return TH_BUT_TEXTFIELD; case SENS_RADAR: return TH_BUT_POPUP; case SENS_RANDOM: return TH_BUT_NEUTRAL; @@ -1093,6 +1070,7 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short bRaySensor *raySens = NULL; bMessageSensor *mes = NULL; bJoystickSensor *joy = NULL; + bActuatorSensor *as = NULL; short ysize; char *str; @@ -1303,6 +1281,22 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short yco-= ysize; break; } + case SENS_ACTUATOR: + { + ysize= 48; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, + (float)xco+width, (float)yco, 1); + + draw_default_sensor_header(sens, block, xco, yco, width); + as= sens->data; + + uiDefBut(block, TEX, 1, "Act: ", xco+30,yco-44,width-60, 19, + as->name, 0, 31, 0, 0, "Actuator name, actuator active state modifications will be detected"); + yco-= ysize; + break; + } case SENS_MOUSE: { ms= sens->data; @@ -1563,6 +1557,48 @@ static void set_col_actuator(int item, int medium) } +static void change_object_actuator(void *act, void *arg) +{ + bObjectActuator *oa = act; + + if (oa->type != oa->otype) { + switch (oa->type) { + case ACT_OBJECT_NORMAL: + memset(oa, 0, sizeof(bObjectActuator)); + oa->flag = ACT_FORCE_LOCAL|ACT_TORQUE_LOCAL|ACT_DLOC_LOCAL|ACT_DROT_LOCAL; + oa->type = ACT_OBJECT_NORMAL; + break; + + case ACT_OBJECT_SERVO: + memset(oa, 0, sizeof(bObjectActuator)); + oa->flag = ACT_LIN_VEL_LOCAL; + oa->type = ACT_OBJECT_SERVO; + oa->forcerot[0] = 30.0f; + oa->forcerot[1] = 0.5f; + oa->forcerot[2] = 0.0f; + break; + } + } +} + +static void change_ipo_actuator(void *arg1_but, void *arg2_ia) +{ + bIpoActuator *ia = arg2_ia; + uiBut *but = arg1_but; + + if (but->retval & ACT_IPOFORCE) + ia->flag &= ~ACT_IPOADD; + else if (but->retval & ACT_IPOADD) + ia->flag &= ~ACT_IPOFORCE; + but->retval = B_REDR; +} + +void update_object_actuator_PID(void *act, void *arg) +{ + bObjectActuator *oa = act; + oa->forcerot[0] = 60.0f*oa->forcerot[1]; +} + char *get_state_name(Object *ob, short bit) { bController *cont; @@ -1604,6 +1640,7 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh short ysize = 0, wval; char *str; int myline, stbit; + uiBut *but; /* yco is at the top of the rect, draw downwards */ uiBlockSetEmboss(block, UI_EMBOSSM); @@ -1613,57 +1650,100 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh { case ACT_OBJECT: { - ysize= 152; - - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - oa = act->data; wval = (width-100)/3; - - uiDefBut(block, LABEL, 0, "Force", xco, yco-22, 55, 19, NULL, 0, 0, 0, 0, "Sets the force"); - uiDefButF(block, NUM, 0, "", xco+45, yco-22, wval, 19, oa->forceloc, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+wval, yco-22, wval, 19, oa->forceloc+1, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-22, wval, 19, oa->forceloc+2, -10000.0, 10000.0, 10, 0, ""); - - uiDefBut(block, LABEL, 0, "Torque", xco, yco-41, 55, 19, NULL, 0, 0, 0, 0, "Sets the torque"); - uiDefButF(block, NUM, 0, "", xco+45, yco-41, wval, 19, oa->forcerot, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+wval, yco-41, wval, 19, oa->forcerot+1, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-41, wval, 19, oa->forcerot+2, -10000.0, 10000.0, 10, 0, ""); - - uiDefBut(block, LABEL, 0, "dLoc", xco, yco-64, 45, 19, NULL, 0, 0, 0, 0, "Sets the dLoc"); - uiDefButF(block, NUM, 0, "", xco+45, yco-64, wval, 19, oa->dloc, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+wval, yco-64, wval, 19, oa->dloc+1, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-64, wval, 19, oa->dloc+2, -10000.0, 10000.0, 10, 0, ""); - - uiDefBut(block, LABEL, 0, "dRot", xco, yco-83, 45, 19, NULL, 0, 0, 0, 0, "Sets the dRot"); - uiDefButF(block, NUM, 0, "", xco+45, yco-83, wval, 19, oa->drot, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+wval, yco-83, wval, 19, oa->drot+1, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-83, wval, 19, oa->drot+2, -10000.0, 10000.0, 10, 0, ""); - - uiDefBut(block, LABEL, 0, "linV", xco, yco-106, 45, 19, NULL, 0, 0, 0, 0, "Sets the linear velocity"); - uiDefButF(block, NUM, 0, "", xco+45, yco-106, wval, 19, oa->linearvelocity, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+wval, yco-106, wval, 19, oa->linearvelocity+1, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-106, wval, 19, oa->linearvelocity+2, -10000.0, 10000.0, 10, 0, ""); - - uiDefBut(block, LABEL, 0, "angV", xco, yco-125, 45, 19, NULL, 0, 0, 0, 0, "Sets the angular velocity"); - uiDefButF(block, NUM, 0, "", xco+45, yco-125, wval, 19, oa->angularvelocity, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+wval, yco-125, wval, 19, oa->angularvelocity+1, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-125, wval, 19, oa->angularvelocity+2, -10000.0, 10000.0, 10, 0, ""); - - uiDefBut(block, LABEL, 0, "damp", xco, yco-148, 45, 19, NULL, 0, 0, 0, 0, "Number of frames to reach the target velocity"); - uiDefButI(block, NUM, 0, "", xco+45, yco-148, wval, 19, &oa->damping, 0.0, 1000.0, 100, 0, ""); - uiDefButBitS(block, TOG, ACT_CLAMP_VEL, 0, "clamp",xco+45+wval, yco-148, wval, 19, &oa->flag, 0.0, 0.0, 0, 0, "Toggles between SET and CLAMP Velocity"); + if (oa->type == ACT_OBJECT_NORMAL) + { + ysize= 175; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + uiDefBut(block, LABEL, 0, "Force", xco, yco-45, 55, 19, NULL, 0, 0, 0, 0, "Sets the force"); + uiDefButF(block, NUM, 0, "", xco+45, yco-45, wval, 19, oa->forceloc, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-45, wval, 19, oa->forceloc+1, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-45, wval, 19, oa->forceloc+2, -10000.0, 10000.0, 10, 0, ""); + + uiDefBut(block, LABEL, 0, "Torque", xco, yco-64, 55, 19, NULL, 0, 0, 0, 0, "Sets the torque"); + uiDefButF(block, NUM, 0, "", xco+45, yco-64, wval, 19, oa->forcerot, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-64, wval, 19, oa->forcerot+1, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-64, wval, 19, oa->forcerot+2, -10000.0, 10000.0, 10, 0, ""); + + uiDefBut(block, LABEL, 0, "dLoc", xco, yco-87, 45, 19, NULL, 0, 0, 0, 0, "Sets the dLoc"); + uiDefButF(block, NUM, 0, "", xco+45, yco-87, wval, 19, oa->dloc, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-87, wval, 19, oa->dloc+1, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-87, wval, 19, oa->dloc+2, -10000.0, 10000.0, 10, 0, ""); + + uiDefBut(block, LABEL, 0, "dRot", xco, yco-106, 45, 19, NULL, 0, 0, 0, 0, "Sets the dRot"); + uiDefButF(block, NUM, 0, "", xco+45, yco-106, wval, 19, oa->drot, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-106, wval, 19, oa->drot+1, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-106, wval, 19, oa->drot+2, -10000.0, 10000.0, 10, 0, ""); + + uiDefBut(block, LABEL, 0, "linV", xco, yco-129, 45, 19, NULL, 0, 0, 0, 0, "Sets the linear velocity"); + uiDefButF(block, NUM, 0, "", xco+45, yco-129, wval, 19, oa->linearvelocity, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-129, wval, 19, oa->linearvelocity+1, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-129, wval, 19, oa->linearvelocity+2, -10000.0, 10000.0, 10, 0, ""); + + uiDefBut(block, LABEL, 0, "angV", xco, yco-148, 45, 19, NULL, 0, 0, 0, 0, "Sets the angular velocity"); + uiDefButF(block, NUM, 0, "", xco+45, yco-148, wval, 19, oa->angularvelocity, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-148, wval, 19, oa->angularvelocity+1, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-148, wval, 19, oa->angularvelocity+2, -10000.0, 10000.0, 10, 0, ""); + + uiDefBut(block, LABEL, 0, "damp", xco, yco-171, 45, 19, NULL, 0, 0, 0, 0, "Number of frames to reach the target velocity"); + uiDefButS(block, NUM, 0, "", xco+45, yco-171, wval, 19, &oa->damping, 0.0, 1000.0, 100, 0, ""); - uiDefButBitS(block, TOG, ACT_FORCE_LOCAL, 0, "L", xco+45+3*wval, yco-22, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); - uiDefButBitS(block, TOG, ACT_TORQUE_LOCAL, 0, "L", xco+45+3*wval, yco-41, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); - uiDefButBitS(block, TOG, ACT_DLOC_LOCAL, 0, "L", xco+45+3*wval, yco-64, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); - uiDefButBitS(block, TOG, ACT_DROT_LOCAL, 0, "L", xco+45+3*wval, yco-83, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); - uiDefButBitS(block, TOG, ACT_LIN_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-106, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); - uiDefButBitS(block, TOG, ACT_ANG_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-125, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); - - uiDefButBitS(block, TOG, ACT_ADD_LIN_VEL, 0, "add",xco+45+3*wval+15, yco-106, 35, 19, &oa->flag, 0.0, 0.0, 0, 0, "Toggles between ADD and SET linV"); - + uiDefButBitS(block, TOG, ACT_FORCE_LOCAL, 0, "L", xco+45+3*wval, yco-45, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); + uiDefButBitS(block, TOG, ACT_TORQUE_LOCAL, 0, "L", xco+45+3*wval, yco-64, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); + uiDefButBitS(block, TOG, ACT_DLOC_LOCAL, 0, "L", xco+45+3*wval, yco-87, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); + uiDefButBitS(block, TOG, ACT_DROT_LOCAL, 0, "L", xco+45+3*wval, yco-106, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); + uiDefButBitS(block, TOG, ACT_LIN_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-129, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); + uiDefButBitS(block, TOG, ACT_ANG_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-148, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); + + uiDefButBitS(block, TOG, ACT_ADD_LIN_VEL, 0, "add",xco+45+3*wval+15, yco-129, 35, 19, &oa->flag, 0.0, 0.0, 0, 0, "Toggles between ADD and SET linV"); + + } else if (oa->type == ACT_OBJECT_SERVO) + { + ysize= 172; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + uiDefBut(block, LABEL, 0, "linV", xco, yco-45, 45, 19, NULL, 0, 0, 0, 0, "Sets the target linear velocity, it will be achieve by automatic application of force. Null velocity is a valid target"); + uiDefButF(block, NUM, 0, "", xco+45, yco-45, wval, 19, oa->linearvelocity, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-45, wval, 19, oa->linearvelocity+1, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-45, wval, 19, oa->linearvelocity+2, -10000.0, 10000.0, 10, 0, ""); + uiDefButBitS(block, TOG, ACT_LIN_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-45, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Velocity is defined in local coordinates"); + + uiDefBut(block, LABEL, 0, "Limit", xco, yco-68, 45, 19, NULL, 0, 0, 0, 0, "Select if the force need to be limited along certain axis (local or global depending on LinV Local flag)"); + uiDefButBitS(block, TOG, ACT_SERVO_LIMIT_X, B_REDR, "X", xco+45, yco-68, wval, 19, &oa->flag, 0.0, 0.0, 0, 0, "Set limit to force along the X axis"); + uiDefButBitS(block, TOG, ACT_SERVO_LIMIT_Y, B_REDR, "Y", xco+45+wval, yco-68, wval, 19, &oa->flag, 0.0, 0.0, 0, 0, "Set limit to force along the Y axis"); + uiDefButBitS(block, TOG, ACT_SERVO_LIMIT_Z, B_REDR, "Z", xco+45+2*wval, yco-68, wval, 19, &oa->flag, 0.0, 0.0, 0, 0, "Set limit to force along the Z axis"); + uiDefBut(block, LABEL, 0, "Max", xco, yco-87, 45, 19, NULL, 0, 0, 0, 0, "Set the upper limit for force"); + uiDefBut(block, LABEL, 0, "Min", xco, yco-106, 45, 19, NULL, 0, 0, 0, 0, "Set the lower limit for force"); + if (oa->flag & ACT_SERVO_LIMIT_X) { + uiDefButF(block, NUM, 0, "", xco+45, yco-87, wval, 19, oa->dloc, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45, yco-106, wval, 19, oa->drot, -10000.0, 10000.0, 10, 0, ""); + } + if (oa->flag & ACT_SERVO_LIMIT_Y) { + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-87, wval, 19, oa->dloc+1, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-106, wval, 19, oa->drot+1, -10000.0, 10000.0, 10, 0, ""); + } + if (oa->flag & ACT_SERVO_LIMIT_Z) { + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-87, wval, 19, oa->dloc+2, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-106, wval, 19, oa->drot+2, -10000.0, 10000.0, 10, 0, ""); + } + uiDefBut(block, LABEL, 0, "Servo", xco, yco-129, 45, 19, NULL, 0, 0, 0, 0, "Coefficients of the PID servo controller"); + uiDefButF(block, NUMSLI, B_REDR, "P: ", xco+45, yco-129, wval*3, 19, oa->forcerot, 0.00, 200.0, 100, 0, "Proportional coefficient, typical value is 60x Integral coefficient"); + uiDefBut(block, LABEL, 0, "Slow", xco, yco-148, 45, 19, NULL, 0, 0, 0, 0, "Low value of I coefficient correspond to slow response"); + but = uiDefButF(block, NUMSLI, B_REDR, " I : ", xco+45, yco-148, wval*3, 19, oa->forcerot+1, 0.0, 3.0, 1, 0, "Integral coefficient, low value (0.01) for slow response, high value (0.5) for fast response"); + uiButSetFunc(but, update_object_actuator_PID, oa, NULL); + uiDefBut(block, LABEL, 0, "Fast", xco+45+3*wval, yco-148, 45, 19, NULL, 0, 0, 0, 0, "High value of I coefficient correspond to fast response"); + uiDefButF(block, NUMSLI, B_REDR, "D: ", xco+45, yco-167, wval*3, 19, oa->forcerot+2, -100.0, 100.0, 100, 0, "Derivate coefficient, not required, high values can cause instability"); + } + str= "Motion Type %t|Simple motion %x0|Servo Control %x1"; + but = uiDefButS(block, MENU, B_REDR, str, xco+40, yco-23, (width-80), 19, &oa->type, 0.0, 0.0, 0, 0, ""); + oa->otype = oa->type; + uiButSetFunc(but, change_object_actuator, oa, NULL); yco-= ysize; break; } @@ -1689,23 +1769,27 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh #else str= "Action types %t|Play %x0|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x6"; #endif - uiDefButS(block, MENU, B_REDR, str, xco+30, yco-24, (width-60)/2, 19, &aa->type, 0.0, 0.0, 0.0, 0.0, "Action playback type"); - uiDefIDPoinBut(block, test_actionpoin_but, ID_AC, 1, "AC: ", xco+30 + ((width-60)/2), yco-24, (width-60)/2, 19, &aa->act, "Action name"); + uiDefButS(block, MENU, B_REDR, str, xco+10, yco-24, width/3, 19, &aa->type, 0.0, 0.0, 0.0, 0.0, "Action playback type"); + uiDefIDPoinBut(block, test_actionpoin_but, ID_AC, 1, "AC: ", xco+10+ (width/3), yco-24, ((width/3)*2) - (20 + 60), 19, &aa->act, "Action name"); + + uiDefButBitS(block, TOGN, 1, 0, "Continue", xco+((width/3)*2)+20, yco-24, 60, 19, + &aa->end_reset, 0.0, 0.0, 0, 0, "Restore last frame when switching on/off, otherwise play from the start each time"); + if(aa->type == ACT_ACTION_FROM_PROP) { - uiDefBut(block, TEX, 0, "Prop: ",xco+30, yco-44, width-60, 19, aa->name, 0.0, 31.0, 0, 0, "Use this property to define the Action position"); + uiDefBut(block, TEX, 0, "Prop: ",xco+10, yco-44, width-20, 19, aa->name, 0.0, 31.0, 0, 0, "Use this property to define the Action position"); } else { - uiDefButI(block, NUM, 0, "Sta: ",xco+30, yco-44, (width-60)/2, 19, &aa->sta, 0.0, MAXFRAMEF, 0, 0, "Start frame"); - uiDefButI(block, NUM, 0, "End: ",xco+30+(width-60)/2, yco-44, (width-60)/2, 19, &aa->end, 0.0, MAXFRAMEF, 0, 0, "End frame"); + uiDefButI(block, NUM, 0, "Sta: ",xco+10, yco-44, (width-20)/2, 19, &aa->sta, 0.0, MAXFRAMEF, 0, 0, "Start frame"); + uiDefButI(block, NUM, 0, "End: ",xco+10+(width-20)/2, yco-44, (width-20)/2, 19, &aa->end, 0.0, MAXFRAMEF, 0, 0, "End frame"); } - uiDefButI(block, NUM, 0, "Blendin: ", xco+30, yco-64, (width-60)/2, 19, &aa->blendin, 0.0, MAXFRAMEF, 0.0, 0.0, "Number of frames of motion blending"); - uiDefButS(block, NUM, 0, "Priority: ", xco+30+(width-60)/2, yco-64, (width-60)/2, 19, &aa->priority, 0.0, 100.0, 0.0, 0.0, "Execution priority - lower numbers will override actions with higher numbers, With 2 or more actions at once, the overriding channels must be lower in the stack"); + uiDefButS(block, NUM, 0, "Blendin: ", xco+10, yco-64, (width-20)/2, 19, &aa->blendin, 0.0, 32767, 0.0, 0.0, "Number of frames of motion blending"); + uiDefButS(block, NUM, 0, "Priority: ", xco+10+(width-20)/2, yco-64, (width-20)/2, 19, &aa->priority, 0.0, 100.0, 0.0, 0.0, "Execution priority - lower numbers will override actions with higher numbers, With 2 or more actions at once, the overriding channels must be lower in the stack"); - uiDefBut(block, TEX, 0, "FrameProp: ",xco+30, yco-84, width-60, 19, aa->frameProp, 0.0, 31.0, 0, 0, "Assign this property this actions current frame number"); + uiDefBut(block, TEX, 0, "FrameProp: ",xco+10, yco-84, width-20, 19, aa->frameProp, 0.0, 31.0, 0, 0, "Assign this property this actions current frame number"); #ifdef __NLA_ACTION_BY_MOTION_ACTUATOR @@ -1731,42 +1815,49 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh str = "Ipo types %t|Play %x0|Ping Pong %x1|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x6"; - uiDefButS(block, MENU, B_REDR, str, xco+20, yco-24, width-40 - (width-40)/3, 19, &ia->type, 0, 0, 0, 0, ""); - uiDefButBitS(block, TOG, ACT_IPOCHILD, B_REDR, - "Child", xco+20+0.666*(width-40), yco-24, (width-40)/3, 19, + uiDefButS(block, MENU, B_REDR, str, xco+10, yco-24, (width-20)/2, 19, &ia->type, 0, 0, 0, 0, ""); + + but = uiDefButBitS(block, TOG, ACT_IPOFORCE, ACT_IPOFORCE, + "Force", xco+10+(width-20)/2, yco-24, (width-20)/4-10, 19, &ia->flag, 0, 0, 0, 0, - "Add all children Objects as well"); + "Convert Ipo to force. Force is applied in global or local coordinate according to Local flag"); + uiButSetFunc(but, change_ipo_actuator, but, ia); + + but = uiDefButBitS(block, TOG, ACT_IPOADD, ACT_IPOADD, + "Add", xco+3*(width-20)/4, yco-24, (width-20)/4-10, 19, + &ia->flag, 0, 0, 0, 0, + "Ipo is added to the current loc/rot/scale in global or local coordinate according to Local flag"); + uiButSetFunc(but, change_ipo_actuator, but, ia); + + /* Only show the do-force-local toggle if force is requested */ + if (ia->flag & (ACT_IPOFORCE|ACT_IPOADD)) { + uiDefButBitS(block, TOG, ACT_IPOLOCAL, 0, + "L", xco+width-30, yco-24, 20, 19, + &ia->flag, 0, 0, 0, 0, + "Let the ipo acts in local coordinates, used in Force and Add mode."); + } if(ia->type==ACT_IPO_FROM_PROP) { uiDefBut(block, TEX, 0, - "Prop: ", xco+20, yco-44, width-40, 19, + "Prop: ", xco+10, yco-44, width-80, 19, ia->name, 0.0, 31.0, 0, 0, "Use this property to define the Ipo position"); } else { uiDefButI(block, NUM, 0, - "Sta", xco+20, yco-44, (width-100)/2, 19, + "Sta", xco+10, yco-44, (width-80)/2, 19, &ia->sta, 0.0, MAXFRAMEF, 0, 0, - "Start frame"); + "Start frame, (subtract 1 to match blenders frame numbers)"); uiDefButI(block, NUM, 0, - "End", xco+18+(width-90)/2, yco-44, (width-100)/2, 19, + "End", xco+10+(width-80)/2, yco-44, (width-80)/2, 19, &ia->end, 0.0, MAXFRAMEF, 0, 0, - "End frame"); - - uiDefButBitS(block, TOG, ACT_IPOFORCE, B_REDR, - "Force", xco+width-78, yco-44, 43, 19, - &ia->flag, 0, 0, 0, 0, - "Convert Ipo to force"); - - /* Only show the do-force-local toggle if force is requested */ - if (ia->flag & ACT_IPOFORCE) { - uiDefButBitS(block, TOG, ACT_IPOFORCE_LOCAL, 0, - "L", xco+width-35, yco-44, 15, 19, - &ia->flag, 0, 0, 0, 0, - "Let the force-ipo act in local coordinates."); - } - + "End frame, (subtract 1 to match blenders frame numbers)"); } + uiDefButBitS(block, TOG, ACT_IPOCHILD, B_REDR, + "Child", xco+10+(width-80), yco-44, 60, 19, + &ia->flag, 0, 0, 0, 0, + "Update IPO on all children Objects as well"); + yco-= ysize; break; } @@ -1898,7 +1989,7 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh glRects(xco, yco-ysize, xco+width, yco); uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+10, yco-44, (width-20)/2, 19, &(eoa->ob), "Add this Object (cant be on an visible layer)"); + uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+10, yco-44, (width-20)/2, 19, &(eoa->ob), "Add this Object and all its children (cant be on an visible layer)"); uiDefButI(block, NUM, 0, "Time:", xco+10+(width-20)/2, yco-44, (width-20)/2, 19, &eoa->time, 0.0, 2000.0, 0, 0, "Duration the new Object lives"); wval= (width-60)/3; @@ -1956,34 +2047,97 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh break; case ACT_CONSTRAINT: - - ysize= 44; - - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - coa= act->data; - -/* str= "Limit %t|None %x0|Loc X %x1|Loc Y %x2|Loc Z %x4|Rot X %x8|Rot Y %x16|Rot Z %x32"; */ - str= "Limit %t|None %x0|Loc X %x1|Loc Y %x2|Loc Z %x4"; - uiDefButS(block, MENU, 1, str, xco+10, yco-40, 70, 19, &coa->flag, 0.0, 0.0, 0, 0, ""); - uiDefButS(block, NUM, 0, "Damp:", xco+10, yco-20, 70, 19, &coa->damp, 0.0, 100.0, 0, 0, ""); - uiDefBut(block, LABEL, 0, "Min", xco+80, yco-20, (width-90)/2, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefBut(block, LABEL, 0, "Max", xco+80+(width-90)/2, yco-20, (width-90)/2, 19, NULL, 0.0, 0.0, 0, 0, ""); - - if(coa->flag & ACT_CONST_LOCX) fp= coa->minloc; - else if(coa->flag & ACT_CONST_LOCY) fp= coa->minloc+1; - else if(coa->flag & ACT_CONST_LOCZ) fp= coa->minloc+2; - else if(coa->flag & ACT_CONST_ROTX) fp= coa->minrot; - else if(coa->flag & ACT_CONST_ROTY) fp= coa->minrot+1; - else fp= coa->minrot+2; - - uiDefButF(block, NUM, 0, "", xco+80, yco-40, (width-90)/2, 19, fp, -2000.0, 2000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+80+(width-90)/2, yco-40, (width-90)/2, 19, fp+3, -2000.0, 2000.0, 10, 0, ""); - - yco-= ysize; + if (coa->type == ACT_CONST_TYPE_LOC) { + ysize= 69; + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + /* str= "Limit %t|None %x0|Loc X %x1|Loc Y %x2|Loc Z %x4|Rot X %x8|Rot Y %x16|Rot Z %x32"; */ + /* coa->flag &= ~(63); */ + str= "Limit %t|None %x0|Loc X %x1|Loc Y %x2|Loc Z %x4"; + coa->flag &= ~(7); + coa->time = 0; + uiDefButS(block, MENU, 1, str, xco+10, yco-65, 70, 19, &coa->flag, 0.0, 0.0, 0, 0, ""); + + uiDefButS(block, NUM, 0, "Damp:", xco+10, yco-45, 70, 19, &coa->damp, 0.0, 100.0, 0, 0, ""); + uiDefBut(block, LABEL, 0, "Min", xco+80, yco-45, (width-90)/2, 19, NULL, 0.0, 0.0, 0, 0, ""); + uiDefBut(block, LABEL, 0, "Max", xco+80+(width-90)/2, yco-45, (width-90)/2, 19, NULL, 0.0, 0.0, 0, 0, ""); + + if(coa->flag & ACT_CONST_LOCX) fp= coa->minloc; + else if(coa->flag & ACT_CONST_LOCY) fp= coa->minloc+1; + else if(coa->flag & ACT_CONST_LOCZ) fp= coa->minloc+2; + else if(coa->flag & ACT_CONST_ROTX) fp= coa->minrot; + else if(coa->flag & ACT_CONST_ROTY) fp= coa->minrot+1; + else fp= coa->minrot+2; + + uiDefButF(block, NUM, 0, "", xco+80, yco-65, (width-90)/2, 19, fp, -2000.0, 2000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+80+(width-90)/2, yco-65, (width-90)/2, 19, fp+3, -2000.0, 2000.0, 10, 0, ""); + } else if (coa->type == ACT_CONST_TYPE_DIST) { + ysize= 106; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + str= "Direction %t|None %x0|X axis %x1|Y axis %x2|Z axis %x4|-X axis %x8|-Y axis %x16|-Z axis %x32"; + uiDefButS(block, MENU, B_REDR, str, xco+10, yco-65, 70, 19, &coa->mode, 0.0, 0.0, 0, 0, "Set the direction of the ray"); + + uiDefButS(block, NUM, 0, "Damp:", xco+10, yco-45, 70, 19, &coa->damp, 0.0, 100.0, 0, 0, ""); + uiDefBut(block, LABEL, 0, "Range", xco+80, yco-45, (width-115)/2, 19, NULL, 0.0, 0.0, 0, 0, "Set the maximum length of ray"); + uiDefButBitS(block, TOG, ACT_CONST_DISTANCE, B_REDR, "Dist", xco+80+(width-115)/2, yco-45, (width-115)/2, 19, &coa->flag, 0.0, 0.0, 0, 0, "Force distance of object to point of impact of ray"); + + if(coa->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRMX)) fp= coa->minloc; + else if(coa->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRMY)) fp= coa->minloc+1; + else fp= coa->minloc+2; + + uiDefButF(block, NUM, 0, "", xco+80, yco-65, (width-115)/2, 19, fp+3, 0.0, 2000.0, 10, 0, "Maximum length of ray"); + if (coa->flag & ACT_CONST_DISTANCE) + uiDefButF(block, NUM, 0, "", xco+80+(width-115)/2, yco-65, (width-115)/2, 19, fp, -2000.0, 2000.0, 10, 0, "Keep this distance to target"); + uiDefButBitS(block, TOG, ACT_CONST_NORMAL, 0, "N", xco+80+(width-115), yco-65, 25, 19, + &coa->flag, 0.0, 0.0, 0, 0, "Set object axis along the normal at hit position"); + uiDefButBitS(block, TOG, ACT_CONST_MATERIAL, B_REDR, "M/P", xco+10, yco-84, 40, 19, + &coa->flag, 0.0, 0.0, 0, 0, "Detect material instead of property"); + if (coa->flag & ACT_CONST_MATERIAL) + { + uiDefBut(block, TEX, 1, "Material:", xco + 50, yco-84, (width-60), 19, + coa->matprop, 0, 31, 0, 0, + "Ray detects only Objects with this material"); + } + else + { + uiDefBut(block, TEX, 1, "Property:", xco + 50, yco-84, (width-60), 19, + coa->matprop, 0, 31, 0, 0, + "Ray detect only Objects with this property"); + } + uiDefButBitS(block, TOG, ACT_CONST_PERMANENT, 0, "PER", xco+10, yco-103, 40, 19, + &coa->flag, 0.0, 0.0, 0, 0, "Persistent actuator: stays active even if ray does not reach target"); + uiDefButS(block, NUM, 0, "time", xco+50, yco-103, (width-60)/2, 19, &(coa->time), 0.0, 1000.0, 0, 0, "Maximum activation time in frame, 0 for unlimited"); + uiDefButS(block, NUM, 0, "rotDamp", xco+50+(width-60)/2, yco-103, (width-60)/2, 19, &(coa->rotdamp), 0.0, 100.0, 0, 0, "Use a different damping for orientation"); + } else if (coa->type == ACT_CONST_TYPE_ORI) { + ysize= 87; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + str= "Direction %t|None %x0|X axis %x1|Y axis %x2|Z axis %x4"; + uiDefButS(block, MENU, B_REDR, str, xco+10, yco-65, 70, 19, &coa->mode, 0.0, 0.0, 0, 0, "Select the axis to be aligned along the reference direction"); + + uiDefButS(block, NUM, 0, "Damp:", xco+10, yco-45, 70, 19, &coa->damp, 0.0, 100.0, 0, 0, ""); + uiDefBut(block, LABEL, 0, "X", xco+80, yco-45, (width-115)/3, 19, NULL, 0.0, 0.0, 0, 0, ""); + uiDefBut(block, LABEL, 0, "Y", xco+80+(width-115)/3, yco-45, (width-115)/3, 19, NULL, 0.0, 0.0, 0, 0, ""); + uiDefBut(block, LABEL, 0, "Z", xco+80+2*(width-115)/3, yco-45, (width-115)/3, 19, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefButF(block, NUM, 0, "", xco+80, yco-65, (width-115)/3, 19, &coa->maxrot[0], -2000.0, 2000.0, 10, 0, "X component of reference direction"); + uiDefButF(block, NUM, 0, "", xco+80+(width-115)/3, yco-65, (width-115)/3, 19, &coa->maxrot[1], -2000.0, 2000.0, 10, 0, "Y component of reference direction"); + uiDefButF(block, NUM, 0, "", xco+80+2*(width-115)/3, yco-65, (width-115)/3, 19, &coa->maxrot[2], -2000.0, 2000.0, 10, 0, "Z component of reference direction"); + + uiDefButS(block, NUM, 0, "time", xco+10, yco-84, 70+(width-115)/3, 19, &(coa->time), 0.0, 1000.0, 0, 0, "Maximum activation time in frame, 0 for unlimited"); + } + str= "Constraint Type %t|Location %x0|Distance %x1|Orientation %x2"; + but = uiDefButS(block, MENU, B_REDR, str, xco+40, yco-23, (width-80), 19, &coa->type, 0.0, 0.0, 0, 0, ""); + yco-= ysize; break; case ACT_SCENE: @@ -2116,7 +2270,7 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh uiDefBut(block, TEX, 0, "Prop: ", xco+20, yco-44, width-40, 19, ga->name, 0.0, 31.0, 0, 0, "Use this property to define the Group position"); } else { - uiDefButI(block, NUM, 0, "Sta", xco+20, yco-44, (width-40)/2, 19, &ga->sta, 0.0, 2500.0, 0, 0, "Start frame"); + uiDefButI(block, NUM, 0, "State", xco+20, yco-44, (width-40)/2, 19, &ga->sta, 0.0, 2500.0, 0, 0, "Start frame"); uiDefButI(block, NUM, 0, "End", xco+20+(width-40)/2, yco-44, (width-40)/2, 19, &ga->end, 0.0, 2500.0, 0, 0, "End frame"); } yco-= ysize; @@ -2382,11 +2536,7 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh break; case ACT_2DFILTER_CUSTOMFILTER: uiDefButI(block, NUM, B_REDR, "Pass Number:", xco+30,yco-44,width-60,19,&tdfa->int_arg,0.0,MAX_RENDER_PASS-1,0.0,0.0,"Set motion blur value"); - uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "Script: ", xco+30,yco-64,width/2-32, 19, &tdfa->text, ""); - uiDefButS(block, TOG|BIT|0, B_REDR, "Depth", xco+width/2+2 , yco - 64, width/4-16 , 19, - &tdfa->texture_flag, 0.0, 0.0, 0, 0, "Includes Depth Texture (bgl_DepthTexture)"); - uiDefButS(block, TOG|BIT|1, B_REDR, "Luminance", xco+3*width/4-14 , yco - 64, width/4-16 , 19, - &tdfa->texture_flag, 0.0, 0.0, 0, 0, "Includes Luminance Texture (bgl_LuminanceTexture)"); + uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "Script: ", xco+30,yco-64,width-60, 19, &tdfa->text, ""); break; } @@ -2994,6 +3144,8 @@ void logic_buts(void) ob= OBACT; for(a=0; alinks[iact]; act->flag |= ACT_LINKED; } + controller_state_mask |= cont->state_mask; cont = cont->next; } @@ -3032,11 +3185,11 @@ void logic_buts(void) for (offset=0; offset<15; offset+=5) { uiBlockBeginAlign(block); for (stbit=0; stbit<5; stbit++) { - but = uiDefButBitI(block, TOG, 1<<(stbit+offset), stbit+offset, "", (short)(xco+35+12*stbit+13*offset), yco, 12, 12, (int *)&(ob->state), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+offset))); + but = uiDefButBitI(block, controller_state_mask&(1<<(stbit+offset)) ? BUT_TOGDUAL:TOG, 1<<(stbit+offset), stbit+offset, "", (short)(xco+35+12*stbit+13*offset), yco, 12, 12, (int *)&(ob->state), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+offset))); uiButSetFunc(but, check_object_state, but, &(ob->state)); } for (stbit=0; stbit<5; stbit++) { - but = uiDefButBitI(block, TOG, 1<<(stbit+offset+15), stbit+offset+15, "", (short)(xco+35+12*stbit+13*offset), yco-12, 12, 12, (int *)&(ob->state), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+offset+15))); + but = uiDefButBitI(block, controller_state_mask&(1<<(stbit+offset+15)) ? BUT_TOGDUAL:TOG, 1<<(stbit+offset+15), stbit+offset+15, "", (short)(xco+35+12*stbit+13*offset), yco-12, 12, 12, (int *)&(ob->state), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+offset+15))); uiButSetFunc(but, check_object_state, but, &(ob->state)); } } @@ -3120,7 +3273,7 @@ void logic_buts(void) uiDefButBitS(block, TOG, BUTS_SENS_SEL, B_REDR, "Sel", xco+80, yco+35, (width-70)/4, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show all selected Objects"); uiDefButBitS(block, TOG, BUTS_SENS_ACT, B_REDR, "Act", xco+80+(width-70)/4, yco+35, (width-70)/4, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show active Object"); uiDefButBitS(block, TOG, BUTS_SENS_LINK, B_REDR, "Link", xco+80+2*(width-70)/4, yco+35, (width-70)/4, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show linked Objects to Controller"); - uiDefButBitS(block, TOG, BUTS_SENS_STATE, B_REDR, "Sta", xco+80+3*(width-70)/4, yco+35, (width-70)/4, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show only sensors connected to active states"); + uiDefButBitS(block, TOG, BUTS_SENS_STATE, B_REDR, "State", xco+80+3*(width-70)/4, yco+35, (width-70)/4, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show only sensors connected to active states"); uiBlockEndAlign(block); for(a=0; ascaflag, 0, 0, 0, 0, "Show all selected Objects"); uiDefButBitS(block, TOG, BUTS_ACT_ACT, B_REDR, "Act", xco+110+(width-100)/4, yco+35, (width-100)/4, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show active Object"); uiDefButBitS(block, TOG, BUTS_ACT_LINK, B_REDR, "Link", xco+110+2*(width-100)/4, yco+35, (width-100)/4, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show linked Objects to Controller"); - uiDefButBitS(block, TOG, BUTS_ACT_STATE, B_REDR, "Sta", xco+110+3*(width-100)/4, yco+35, (width-100)/4, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show only actuators connected to active states"); + uiDefButBitS(block, TOG, BUTS_ACT_STATE, B_REDR, "State", xco+110+3*(width-100)/4, yco+35, (width-100)/4, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show only actuators connected to active states"); uiBlockEndAlign(block); for(a=0; adistr==PART_DISTR_GRID) + if(part->distr==PART_DISTR_GRID && part->from != PART_FROM_VERT) uiDefButI(block, NUM, B_PART_ALLOC, "Resol:", butx,(buty-=buth),butw,buth, &part->grid_res, 1.0, 100.0, 0, 0, "The resolution of the particle grid"); else uiDefButI(block, NUM, B_PART_ALLOC, "Amount:", butx,(buty-=buth),butw,buth, &part->totpart, 0.0, 100000.0, 0, 0, "The total number of particles"); diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index 1c98950080a..af90d01fb59 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -499,7 +499,7 @@ static char* seq_panel_blend_modes() so that would collide also. */ - if (!(last_seq->type & SEQ_EFFECT)) { + if ( seq_can_blend(last_seq) ) { int i; for (i = SEQ_EFFECT; i <= SEQ_EFFECT_MAX; i++) { diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 04a497ffdea..1b580381ca5 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -2803,6 +2803,42 @@ static void lamp_panel_yafray(Object *ob, Lamp *la) } +static void lamp_panel_atmosphere(Object *ob, Lamp *la) +{ + uiBlock *block; + int y; + block= uiNewBlock(&curarea->uiblocks, "lamp_panel_atm", UI_EMBOSS, UI_HELV, curarea->win); + uiNewPanelTabbed("Shadow and Spot", "Lamp"); + if(uiNewPanel(curarea, block, "Sky/Atmosphere", "Lamp", 3*PANELX, PANELY, PANELW, PANELH)==0) return; + + uiSetButLock(la->id.lib!=0, ERROR_LIBDATA_MESSAGE); + + uiDefButBitS(block, TOG, LA_SUN_EFFECT_SKY, REDRAWVIEW3D, "Sky", 10,205,BUTW2,20,&(la->sun_effect_type), 0, 0, 0, 0, "Apply sun light effect on sky."); + uiDefButBitS(block, TOG, LA_SUN_EFFECT_AP, REDRAWVIEW3D, "Atmosphere", 20+BUTW2,205,BUTW2,20,&(la->sun_effect_type), 0, 0, 0, 0, "Apply sun light effect on atmosphere."); + + if(la->sun_effect_type & (LA_SUN_EFFECT_SKY|LA_SUN_EFFECT_AP)){ + uiDefButF(block, NUM, B_LAMPREDRAW, "Turbidity:",10,180,BUTW1,19, &(la->atm_turbidity), 1.000f, 30.0f, 1, 0, "Sky Turbidity"); + } + + y = 180; + if(la->sun_effect_type & LA_SUN_EFFECT_SKY) + { + uiDefButF(block, NUM, B_LAMPREDRAW, "Hor.Bright:",10,y-25,BUTW2,19, &(la->horizon_brightness), 0.00f, 20.00f, 10, 0, "Sets horizon brightness."); + uiDefButF(block, NUM, B_LAMPREDRAW, "Hor.Spread:",10,y-50,BUTW2,19, &(la->spread), 0.00f, 10.00f, 10, 0, "Sets horizon spread."); + uiDefButF(block, NUM, B_LAMPREDRAW, "Sun Bright:",10,y-75,BUTW2,19, &(la->sun_brightness), 0.00f, 10.0f, 10, 0, "Sets sun brightness."); + uiDefButF(block, NUM, B_LAMPREDRAW, "Sun Size:",10,y-100,BUTW2,19, &(la->sun_size), 0.00f, 10.00f, 10, 0, "Sets sun size."); + uiDefButF(block, NUM, B_LAMPREDRAW, "Back Light:",10,y-125,BUTW2,19, &(la->backscattered_light), -1.00f, 1.00f, 10, 0, "Sets backscatter light."); + } + + if(la->sun_effect_type & LA_SUN_EFFECT_AP) + { + uiDefButF(block, NUM, B_LAMPREDRAW, "Sun Intens.:",20+BUTW2,y-25,BUTW2,19, &(la->sun_intensity), 0.00f, 10.00f, 10, 0, "Sets sun intensity."); + uiDefButF(block, NUM, B_LAMPREDRAW, "Inscattering:",20+BUTW2,y-50,BUTW2,19, &(la->atm_inscattering_factor), 0.00f, 1.00f, 10, 0, "In Scattering Contribution Factor."); + uiDefButF(block, NUM, B_LAMPREDRAW, "Extinction:",20+BUTW2,y-75,BUTW2,19, &(la->atm_extinction_factor), 0.00f, 1.00f, 10, 0, "Extinction Scattering Contribution Factor."); + uiDefButF(block, NUM, B_LAMPREDRAW, "Distance:",20+BUTW2,y-100,BUTW2,19, &(la->atm_distance_factor), 0.000f, 500.0f, 10, 0, "Scale blender distance to real distance."); + } +} + static void lamp_panel_falloff(Object *ob, Lamp *la) { uiBlock *block; @@ -2864,15 +2900,15 @@ static void lamp_panel_lamp(Object *ob, Lamp *la) uiBlockSetCol(block, TH_BUT_SETTING1); uiDefButS(block, MENU, B_LAMPREDRAW, "Falloff %t|Constant %x0|Inverse Linear %x1|Inverse Square %x2|Custom Curve %x3|Lin/Quad Weighted %x4|", 10,150,100,19, &la->falloff_type, 0,0,0,0, "Lamp falloff - intensity decay with distance"); - uiDefButBitS(block, TOG, LA_SPHERE, REDRAWVIEW3D,"Sphere", 10,130,100,19,&la->mode, 0, 0, 0, 0, "Sets light intensity to zero for objects beyond the distance value"); + uiDefButBitS(block, TOG, LA_SPHERE, B_LAMPPRV,"Sphere", 10,130,100,19,&la->mode, 0, 0, 0, 0, "Sets light intensity to zero for objects beyond the distance value"); } uiBlockBeginAlign(block); uiBlockSetCol(block, TH_BUT_SETTING1); uiDefButBitS(block, TOG, LA_LAYER, 0,"Layer", 10,70,100,19,&la->mode, 0, 0, 0, 0, "Illuminates objects in the same layer as the lamp only"); uiDefButBitS(block, TOG, LA_NEG, B_LAMPPRV,"Negative", 10,50,100,19,&la->mode, 0, 0, 0, 0, "Sets lamp to cast negative light"); - uiDefButBitS(block, TOG, LA_NO_DIFF, 0,"No Diffuse", 10,30,100,19,&la->mode, 0, 0, 0, 0, "Disables diffuse shading of material illuminated by this lamp"); - uiDefButBitS(block, TOG, LA_NO_SPEC, 0,"No Specular", 10,10,100,19,&la->mode, 0, 0, 0, 0, "Disables specular shading of material illuminated by this lamp"); + uiDefButBitS(block, TOG, LA_NO_DIFF, B_LAMPPRV,"No Diffuse", 10,30,100,19,&la->mode, 0, 0, 0, 0, "Disables diffuse shading of material illuminated by this lamp"); + uiDefButBitS(block, TOG, LA_NO_SPEC, B_LAMPPRV,"No Specular", 10,10,100,19,&la->mode, 0, 0, 0, 0, "Disables specular shading of material illuminated by this lamp"); uiBlockEndAlign(block); uiBlockSetCol(block, TH_AUTO); @@ -4354,6 +4390,11 @@ void lamp_panels() /* spherelight radius default is zero, so nothing to do */ lamp_panel_yafray(ob, la); } + + if(la->type == LA_SUN){ + lamp_panel_atmosphere(ob, ob->data); + } + lamp_panel_texture(ob, ob->data); lamp_panel_mapto(ob, ob->data); diff --git a/source/blender/src/drawaction.c b/source/blender/src/drawaction.c index 89466151a39..6fe37c1c6e5 100644 --- a/source/blender/src/drawaction.c +++ b/source/blender/src/drawaction.c @@ -32,6 +32,7 @@ #include #include +#include #ifdef HAVE_CONFIG_H #include @@ -56,6 +57,7 @@ #include "DNA_space_types.h" #include "DNA_constraint_types.h" #include "DNA_key_types.h" +#include "DNA_userdef_types.h" #include "BKE_action.h" #include "BKE_depsgraph.h" @@ -928,12 +930,55 @@ static void draw_channel_strips(void) void do_actionbuts(unsigned short event) { switch(event) { + /* general */ case REDRAWVIEW3D: allqueue(REDRAWVIEW3D, 0); break; case B_REDR: allqueue(REDRAWACTION, 0); break; + + /* action-groups */ + case B_ACTCUSTCOLORS: /* only when of the color wells is edited */ + { + bActionGroup *agrp= get_active_actiongroup(G.saction->action); + + if (agrp) + agrp->customCol= -1; + + allqueue(REDRAWACTION, 0); + } + break; + case B_ACTCOLSSELECTOR: /* sync color set after using selector */ + { + bActionGroup *agrp= get_active_actiongroup(G.saction->action); + + if (agrp) + actionbone_group_copycolors(agrp, 1); + + allqueue(REDRAWACTION, 0); + } + break; + case B_ACTGRP_SELALL: /* select all grouped channels */ + { + bAction *act= G.saction->action; + bActionGroup *agrp= get_active_actiongroup(act); + + /* select all in group, then reselect/activate group as the previous operation clears that */ + select_action_group_channels(act, agrp); + agrp->flag |= (AGRP_ACTIVE|AGRP_SELECTED); + + allqueue(REDRAWACTION, 0); + } + break; + case B_ACTGRP_ADDTOSELF: /* add all selected action channels to self */ + action_groups_group(0); + break; + case B_ACTGRP_UNGROUP: /* remove channels from active group */ + // FIXME: todo... + printf("FIXME: remove achans from active Action-Group not implemented yet! \n"); + break; + } } @@ -941,14 +986,68 @@ void do_actionbuts(unsigned short event) static void action_panel_properties(short cntrl) // ACTION_HANDLER_PROPERTIES { uiBlock *block; - + void *data; + short datatype; + block= uiNewBlock(&curarea->uiblocks, "action_panel_properties", UI_EMBOSS, UI_HELV, curarea->win); uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl); uiSetPanelHandler(ACTION_HANDLER_PROPERTIES); // for close and esc - if (uiNewPanel(curarea, block, "Transform Properties", "Action", 10, 230, 318, 204)==0) + + /* get datatype */ + data= get_action_context(&datatype); + //if (data == NULL) return; + + if (uiNewPanel(curarea, block, "Active Channel Properties", "Action", 10, 230, 318, 204)==0) return; - - uiDefBut(block, LABEL, 0, "test text", 10,180,300,19, 0, 0, 0, 0, 0, ""); + + /* currently, only show data for actions */ + if (datatype == ACTCONT_ACTION) { + bActionGroup *agrp= get_active_actiongroup(data); + //bActionChannel *achan= get_hilighted_action_channel(data); + char *menustr; + + /* only for action-groups */ + if (agrp) { + /* general stuff */ + uiDefBut(block, LABEL, 1, "Action Group:", 10, 180, 150, 19, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefBut(block, TEX, B_REDR, "Name: ", 10,160,150,20, agrp->name, 0.0, 31.0, 0, 0, ""); + uiBlockBeginAlign(block); + uiDefButBitI(block, TOG, AGRP_EXPANDED, B_REDR, "Expanded", 170, 160, 75, 20, &agrp->flag, 0, 0, 0, 0, "Action Group is expanded"); + uiDefButBitI(block, TOG, AGRP_PROTECTED, B_REDR, "Protected", 245, 160, 75, 20, &agrp->flag, 0, 0, 0, 0, "Action Group is protected"); + uiBlockEndAlign(block); + + /* color stuff */ + uiDefBut(block, LABEL, 1, "Group Colors:", 10, 107, 150, 19, NULL, 0.0, 0.0, 0, 0, ""); + uiBlockBeginAlign(block); + menustr= BIF_ThemeColorSetsPup(1); + uiDefButI(block, MENU,B_ACTCOLSSELECTOR, menustr, 10,85,150,19, &agrp->customCol, -1, 20, 0.0, 0.0, "Index of set of Custom Colors to shade Group's bones with. 0 = Use Default Color Scheme, -1 = Use Custom Color Scheme"); + MEM_freeN(menustr); + + /* show color-selection/preview */ + if (agrp->customCol) { + /* do color copying/init (to stay up to date) */ + actionbone_group_copycolors(agrp, 1); + + /* color changing */ + uiDefButC(block, COL, B_ACTCUSTCOLORS, "", 10, 65, 50, 19, agrp->cs.active, 0, 0, 0, 0, "Color to use for 'top-level' channels"); + uiDefButC(block, COL, B_ACTCUSTCOLORS, "", 60, 65, 50, 19, agrp->cs.select, 0, 0, 0, 0, "Color to use for '2nd-level' channels"); + uiDefButC(block, COL, B_ACTCUSTCOLORS, "", 110, 65, 50, 19, agrp->cs.solid, 0, 0, 0, 0, "Color to use for '3rd-level' channels"); + } + uiBlockEndAlign(block); + + /* commands for active group */ + uiDefBut(block, BUT, B_ACTGRP_SELALL, "Select Grouped", 170,85,150,20, 0, 21, 0, 0, 0, "Select all action-channels belonging to this group (same as doing Ctrl-Shift-LMB)"); + + uiBlockBeginAlign(block); + uiDefBut(block, BUT, B_ACTGRP_ADDTOSELF, "Add to Group", 170,60,150,20, 0, 21, 0, 0, 0, "Add selected action-channels to this group"); + uiDefBut(block, BUT, B_ACTGRP_UNGROUP, "Un-Group", 170,40,150,20, 0, 21, 0, 0, 0, "Remove selected action-channels from this group (unimplemented)"); + uiBlockEndAlign(block); + } + } + else { + /* Currently, there isn't anything to display for these types ... */ + } } static void action_blockhandlers(ScrArea *sa) diff --git a/source/blender/src/drawarmature.c b/source/blender/src/drawarmature.c index 73915a69139..6d78b21dfbb 100644 --- a/source/blender/src/drawarmature.c +++ b/source/blender/src/drawarmature.c @@ -2500,7 +2500,7 @@ static void draw_ghost_poses(Base *base) /* ********************************** Armature Drawing - Main ************************* */ /* called from drawobject.c, return 1 if nothing was drawn */ -int draw_armature(Base *base, int dt) +int draw_armature(Base *base, int dt, int flag) { Object *ob= base->object; bArmature *arm= ob->data; @@ -2544,15 +2544,16 @@ int draw_armature(Base *base, int dt) if (arm->ghostep) draw_ghost_poses(base); } + if ((flag & DRAW_SCENESET)==0) { + if(ob==OBACT) + arm->flag |= ARM_POSEMODE; + else if(G.f & G_WEIGHTPAINT) + arm->flag |= ARM_POSEMODE; - if(ob==OBACT) - arm->flag |= ARM_POSEMODE; - else if(G.f & G_WEIGHTPAINT) - arm->flag |= ARM_POSEMODE; - - draw_pose_paths(ob); + draw_pose_paths(ob); + } } - } + } draw_pose_channels(base, dt); arm->flag &= ~ARM_POSEMODE; diff --git a/source/blender/src/drawimage.c b/source/blender/src/drawimage.c index 547de85e856..14849cdd450 100644 --- a/source/blender/src/drawimage.c +++ b/source/blender/src/drawimage.c @@ -422,7 +422,7 @@ int draw_uvs_face_check(void) return 1; } } else { - if (G.sima->flag & SI_SELACTFACE) { + if (G.sima->selectmode == SI_SELECT_FACE) { return 1; } } diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index 96ba8c71755..045bf292446 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -4620,7 +4620,7 @@ static void drawSolidSelect(Base *base) } else if(ob->type==OB_ARMATURE) { if(!(ob->flag & OB_POSEMODE)) { - draw_armature(base, OB_WIRE); + draw_armature(base, OB_WIRE, 0); } } @@ -4741,7 +4741,7 @@ void drawRBpivot(bRigidBodyJointConstraint *data){ setlinestyle(0); } -/* flag can be DRAW_PICKING and/or DRAW_CONSTCOLOR */ +/* flag can be DRAW_PICKING and/or DRAW_CONSTCOLOR, DRAW_SCENESET */ void draw_object(Base *base, int flag) { static int warning_recursive= 0; @@ -4943,7 +4943,7 @@ void draw_object(Base *base, int flag) /* draw outline for selected solid objects, mesh does itself */ if((G.vd->flag & V3D_SELECT_OUTLINE) && ob->type!=OB_MESH) { - if(dt>OB_WIRE && dtOB_WIRE && dtdtx&OB_DRAWWIRE) && (ob->flag&SELECT) && !(flag&DRAW_PICKING)) { drawSolidSelect(base); } @@ -5090,7 +5090,7 @@ void draw_object(Base *base, int flag) break; case OB_ARMATURE: if(dt>OB_WIRE) set_gl_material(0); // we use defmaterial - empty_object= draw_armature(base, dt); + empty_object= draw_armature(base, dt, flag); break; default: drawaxes(1.0, flag, OB_ARROWS); diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index 2f1cdb8b951..f595a101f63 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -3097,7 +3097,7 @@ void drawview3dspace(ScrArea *sa, void *spacedata) if(v3d->lay & base->lay) { BIF_ThemeColorBlend(TH_WIRE, TH_BACK, 0.6f); - draw_object(base, DRAW_CONSTCOLOR); + draw_object(base, DRAW_CONSTCOLOR|DRAW_SCENESET); if(base->object->transflag & OB_DUPLI) { draw_dupli_objects_color(v3d, base, TH_WIRE); @@ -3319,7 +3319,7 @@ void drawview3d_render(struct View3D *v3d, int winx, int winy, float winmat[][4] where_is_object(base->object); BIF_ThemeColorBlend(TH_WIRE, TH_BACK, 0.6f); - draw_object(base, DRAW_CONSTCOLOR); + draw_object(base, DRAW_CONSTCOLOR|DRAW_SCENESET); if(base->object->transflag & OB_DUPLI) { draw_dupli_objects(v3d, base); diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c index f93a1526e3c..4cc0e52ce3f 100644 --- a/source/blender/src/editaction.c +++ b/source/blender/src/editaction.c @@ -1114,6 +1114,38 @@ void action_groups_ungroup (void) allqueue(REDRAWACTION, 0); } +/* Copy colors from a specified theme's color set to an Action/Bone Group */ +void actionbone_group_copycolors (bActionGroup *grp, short init_new) +{ + /* error checking */ + if (grp == NULL) + return; + + /* only do color copying if using a custom color */ + if (grp->customCol) { + if (grp->customCol > 0) { + /* copy theme colors on-to group's custom color in case user tries to edit color */ + bTheme *btheme= U.themes.first; + ThemeWireColor *col_set= &btheme->tarm[(grp->customCol - 1)]; + + memcpy(&grp->cs, col_set, sizeof(ThemeWireColor)); + } + else if (init_new) { + /* init custom colors with a generic multi-color rgb set, if not initialised already (and allowed to do so) */ + if (grp->cs.solid[0] == 0) { + /* define for setting colors in theme below */ + #define SETCOL(col, r, g, b, a) col[0]=r; col[1]=g; col[2]= b; col[3]= a; + + SETCOL(grp->cs.solid, 0xff, 0x00, 0x00, 255); + SETCOL(grp->cs.select, 0x81, 0xe6, 0x14, 255); + SETCOL(grp->cs.active, 0x18, 0xb6, 0xe0, 255); + + #undef SETCOL + } + } + } +} + /* This function is used when inserting keyframes for pose-channels. It assigns the * action-channel with the nominated name to a group with the same name as that of * the pose-channel with the nominated name. @@ -1160,34 +1192,9 @@ void verify_pchan2achan_grouping (bAction *act, bPose *pose, char name[]) /* copy name */ sprintf(grp->name, agrp->name); - /* deal with group-color copying */ - if (agrp->customCol) { - if (agrp->customCol > 0) { - /* copy theme colors on-to group's custom color in case user tries to edit color */ - bTheme *btheme= U.themes.first; - ThemeWireColor *col_set= &btheme->tarm[(agrp->customCol - 1)]; - - memcpy(&grp->cs, col_set, sizeof(ThemeWireColor)); - } - else { - /* init custom colors with a generic multi-color rgb set, if not initialised already */ - if (agrp->cs.solid[0] == 0) { - /* define for setting colors in theme below */ - #define SETCOL(col, r, g, b, a) col[0]=r; col[1]=g; col[2]= b; col[3]= a; - - SETCOL(grp->cs.solid, 0xff, 0x00, 0x00, 255); - SETCOL(grp->cs.select, 0x81, 0xe6, 0x14, 255); - SETCOL(grp->cs.active, 0x18, 0xb6, 0xe0, 255); - - #undef SETCOL - } - else { - /* just copy color set specified */ - memcpy(&grp->cs, &agrp->cs, sizeof(ThemeWireColor)); - } - } - } - grp->customCol= agrp->customCol; + /* deal with group-color copying (grp is destination, agrp is source) */ + memcpy(grp, agrp, sizeof(bActionGroup)); + actionbone_group_copycolors(grp, 1); BLI_addtail(&act->groups, grp); } @@ -2697,6 +2704,28 @@ int select_icu_channel(bAction *act, IpoCurve *icu, int selectmode) return flag; } + +/* select only the active action-group's action channels */ +void select_action_group_channels (bAction *act, bActionGroup *agrp) +{ + bActionChannel *achan; + + /* error checking */ + if (ELEM(NULL, act, agrp)) + return; + + /* deselect all other channels */ + deselect_actionchannels(act, 0); + + /* only select channels in group */ + for (achan= agrp->channels.first; achan && achan->grp==agrp; achan= achan->next) { + select_channel(act, achan, SELECT_ADD); + + /* messy... set active bone */ + select_poseelement_by_name(achan->name, 1); + } +} + /* ----------------------------------------- */ /* De-selects or inverts the selection of Channels in a given Action @@ -3672,17 +3701,8 @@ static void mouse_actionchannels (short mval[]) select_action_group(act, agrp, SELECT_INVERT); } else if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY)) { - bActionChannel *achan; - /* select all in group (and deselect everthing else) */ - deselect_actionchannels(act, 0); - - for (achan= agrp->channels.first; achan && achan->grp==agrp; achan= achan->next) { - select_channel(act, achan, SELECT_ADD); - - /* messy... set active bone */ - select_poseelement_by_name(achan->name, 1); - } + select_action_group_channels(act, agrp); select_action_group(act, agrp, SELECT_ADD); } else { @@ -4682,11 +4702,13 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt) case NKEY: if (G.qual==0) { - numbuts_action(); - - /* no panel (yet). current numbuts are not easy to put in panel... */ - //add_blockhandler(curarea, ACTION_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE); - //scrarea_queue_winredraw(curarea); + /* panel will not always show useful info! */ + if (mval[0] > ACTWIDTH) { + add_blockhandler(curarea, ACTION_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE); + scrarea_queue_winredraw(curarea); + } + else + numbuts_action(); } break; diff --git a/source/blender/src/editarmature.c b/source/blender/src/editarmature.c index 39f93510358..6310dd0a262 100644 --- a/source/blender/src/editarmature.c +++ b/source/blender/src/editarmature.c @@ -1646,8 +1646,9 @@ void load_editArmature(void) } /* toggle==0: deselect - toggle==1: swap + toggle==1: swap (based on test) toggle==2: only active tag + toggle==3: swap (no test) */ void deselectall_armature(int toggle, int doundo) { @@ -1670,18 +1671,30 @@ void deselectall_armature(int toggle, int doundo) else sel= toggle; /* Set the flags */ - for (eBone=G.edbo.first;eBone;eBone=eBone->next){ - if (sel==1) { + for (eBone=G.edbo.first;eBone;eBone=eBone->next) { + if (sel==3) { + /* invert selection of bone */ + if ((arm->layer & eBone->layer) && (eBone->flag & BONE_HIDDEN_A)==0) { + eBone->flag ^= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL); + eBone->flag &= ~BONE_ACTIVE; + } + } + else if (sel==1) { + /* select bone */ if(arm->layer & eBone->layer && (eBone->flag & BONE_HIDDEN_A)==0) { eBone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL); if(eBone->parent) eBone->parent->flag |= (BONE_TIPSEL); } } - else if (sel==2) + else if (sel==2) { + /* clear active flag */ eBone->flag &= ~(BONE_ACTIVE); - else + } + else { + /* deselect bone */ eBone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL | BONE_ACTIVE); + } } allqueue(REDRAWVIEW3D, 0); @@ -3276,8 +3289,9 @@ int do_pose_selectbuffer(Base *base, unsigned int *buffer, short hits) } /* test==0: deselect all - test==1: swap select - test==2: only clear active tag + test==1: swap select (apply to all the opposite of current situation) + test==2: only clear active tag + test==3: swap select (no test / inverse selection status of all independently) */ void deselectall_posearmature (Object *ob, int test, int doundo) { @@ -3307,16 +3321,27 @@ void deselectall_posearmature (Object *ob, int test, int doundo) /* Set the flags accordingly */ for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { if ((pchan->bone->layer & arm->layer) && !(pchan->bone->flag & BONE_HIDDEN_P)) { - if (selectmode==0) pchan->bone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL|BONE_ACTIVE); - else if (selectmode==1) pchan->bone->flag |= BONE_SELECTED; - else pchan->bone->flag &= ~BONE_ACTIVE; + if (test==3) { + pchan->bone->flag ^= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL); + pchan->bone->flag &= ~BONE_ACTIVE; + } + else { + if (selectmode==0) pchan->bone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL|BONE_ACTIVE); + else if (selectmode==1) pchan->bone->flag |= BONE_SELECTED; + else pchan->bone->flag &= ~BONE_ACTIVE; + } } } /* action editor */ - deselect_actionchannels(ob->action, 0); /* deselects for sure */ - if (selectmode == 1) - deselect_actionchannels(ob->action, 1); /* swaps */ + if (test == 3) { + deselect_actionchannels(ob->action, 2); /* inverts selection */ + } + else { + deselect_actionchannels(ob->action, 0); /* deselects for sure */ + if (selectmode == 1) + deselect_actionchannels(ob->action, 1); /* swaps */ + } allqueue(REDRAWBUTSEDIT, 0); allqueue(REDRAWBUTSOBJECT, 0); diff --git a/source/blender/src/editmesh_add.c b/source/blender/src/editmesh_add.c index 952ae957f34..9516f39b05c 100644 --- a/source/blender/src/editmesh_add.c +++ b/source/blender/src/editmesh_add.c @@ -379,7 +379,7 @@ static EditFace *addface_from_edges(void) /* find the 4 edges */ for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->f & SELECT) { + if( (eed->f & SELECT) || (eed->v1->f & eed->v2->f & SELECT) ) { if(eedar[0]==NULL) eedar[0]= eed; else if(eedar[1]==NULL) eedar[1]= eed; else if(eedar[2]==NULL) eedar[2]= eed; @@ -765,6 +765,7 @@ void addedgeface_mesh(void) /* if 4 edges exist, we just create the face, convex or not */ efa= addface_from_edges(); if(efa==NULL) { + /* the order of vertices can be anything, 6 cases to check */ if( convex(neweve[0]->co, neweve[1]->co, neweve[2]->co, neweve[3]->co) ) { efa= addfacelist(neweve[0], neweve[1], neweve[2], neweve[3], NULL, NULL); @@ -775,17 +776,16 @@ void addedgeface_mesh(void) else if( convex(neweve[0]->co, neweve[2]->co, neweve[1]->co, neweve[3]->co) ) { efa= addfacelist(neweve[0], neweve[2], neweve[1], neweve[3], NULL, NULL); } - - else if( convex(neweve[1]->co, neweve[2]->co, neweve[3]->co, neweve[0]->co) ) { - efa= addfacelist(neweve[1], neweve[2], neweve[3], neweve[0], NULL, NULL); + else if( convex(neweve[0]->co, neweve[1]->co, neweve[3]->co, neweve[2]->co) ) { + efa= addfacelist(neweve[0], neweve[1], neweve[3], neweve[2], NULL, NULL); } - else if( convex(neweve[1]->co, neweve[3]->co, neweve[0]->co, neweve[2]->co) ) { - efa= addfacelist(neweve[1], neweve[3], neweve[0], neweve[2], NULL, NULL); + else if( convex(neweve[0]->co, neweve[3]->co, neweve[2]->co, neweve[1]->co) ) { + efa= addfacelist(neweve[0], neweve[3], neweve[2], neweve[1], NULL, NULL); } - else if( convex(neweve[1]->co, neweve[3]->co, neweve[2]->co, neweve[0]->co) ) { - efa= addfacelist(neweve[1], neweve[3], neweve[2], neweve[0], NULL, NULL); + else if( convex(neweve[0]->co, neweve[3]->co, neweve[1]->co, neweve[2]->co) ) { + efa= addfacelist(neweve[0], neweve[3], neweve[1], neweve[2], NULL, NULL); } - else error("The selected vertices form a concave quad"); + else printf("cannot find nice quad from concave set of vertices\n"); } } } diff --git a/source/blender/src/editnla.c b/source/blender/src/editnla.c index d758f34949a..dbc0deecb2c 100644 --- a/source/blender/src/editnla.c +++ b/source/blender/src/editnla.c @@ -501,26 +501,47 @@ static void set_active_strip(Object *ob, bActionStrip *act) { bActionStrip *strip; + /* make sure all other strips are not active */ for (strip = ob->nlastrips.first; strip; strip=strip->next) strip->flag &= ~ACTSTRIP_ACTIVE; - if(act) { + /* act is new active strip */ + if (act) { + /* set active flag for this strip */ act->flag |= ACTSTRIP_ACTIVE; - - if(ob->action!=act->act) { - if(ob->action) ob->action->id.us--; - if(act->act->id.lib) { + + /* check if active action will still be the same one */ + if (ob->action != act->act) { + /* clear object's links with its current action (if present) */ + if (ob->action) { + ob->action->id.us--; + } + + /* only set object's action to active strip's action if possible */ + if (act->act->id.lib) { ob->action= NULL; } else { ob->action= act->act; id_us_plus(&ob->action->id); - } + } + + /* request redrawing in relevant spaces */ allqueue(REDRAWIPO, 0); allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWACTION, 0); allqueue(REDRAWNLA, 0); - ob->ctime= -1234567.0f; // eveil! + + /* when only showing action (i.e. nla-override off), + * reset pose to restpose for armatures + */ + if ((ob->nlaflag & OB_NLA_OVERRIDE)==0) { + if (ob->type == OB_ARMATURE) + rest_pose(ob->pose); + } + + /* flush depsgraph */ + ob->ctime= -1234567.0f; // evil! DAG_object_flush_update(G.scene, ob, OB_RECALC_OB|OB_RECALC_DATA); } } diff --git a/source/blender/src/editseq.c b/source/blender/src/editseq.c index b9351f82d1e..f9432f8e69a 100644 --- a/source/blender/src/editseq.c +++ b/source/blender/src/editseq.c @@ -2135,12 +2135,25 @@ void del_seq(void) Sequence *seq; MetaStack *ms; Editing *ed; - - if(okee("Erase selected")==0) return; + int nothingSelected = TRUE; ed= G.scene->ed; if(ed==0) return; + seq=get_last_seq(); + if (seq && seq->flag & SELECT) { /* avoid a loop since this is likely to be selected */ + nothingSelected = FALSE; + } else { + for (seq = ed->seqbasep->first; seq; seq = seq->next) { + if (seq->flag & SELECT) { + nothingSelected = FALSE; + break; + } + } + } + + if(nothingSelected || okee("Erase selected")==0) return; + /* free imbufs of all dependent strips */ for(seq=ed->seqbasep->first; seq; seq=seq->next) if(seq->flag & SELECT) diff --git a/source/blender/src/editsima.c b/source/blender/src/editsima.c index 18a9803dcae..69070d61bf0 100644 --- a/source/blender/src/editsima.c +++ b/source/blender/src/editsima.c @@ -694,7 +694,7 @@ void mouse_select_sima(void) EditFace *efa; MTFace *tf, *nearesttf; EditFace *nearestefa=NULL; - int a, selectsticky, edgeloop, actface, nearestuv, nearestedge, i, shift; + int a, selectsticky, edgeloop, actface, nearestuv, nearestedge, i, shift, island=0; char sticky= 0; int flush = 0; /* 0 == dont flush, 1 == sel, -1 == desel; only use when selection sync is enabled */ unsigned int hitv[4], nearestv; @@ -706,7 +706,7 @@ void mouse_select_sima(void) edgeloop= G.qual & LR_ALTKEY; shift= G.qual & LR_SHIFTKEY; - + if (G.sima->flag & SI_SYNC_UVSEL) { /* copy from mesh */ if (G.scene->selectmode == SCE_SELECT_FACE) { @@ -718,7 +718,8 @@ void mouse_select_sima(void) } } else { /* normal operation */ - actface= G.sima->flag & SI_SELACTFACE; + actface= G.sima->selectmode == SI_SELECT_FACE; + island= G.sima->selectmode == SI_SELECT_ISLAND; switch(G.sima->sticky) { case SI_STICKY_LOC: @@ -760,6 +761,9 @@ void mouse_select_sima(void) if (nearestefa->v4) hitv[3]= nearestefa->v4->tmp.l; else hitv[3]= 0xFFFFFFFF; + } + else if (island) { + } else { find_nearest_uv(&nearesttf, &nearestefa, &nearestv, &nearestuv); @@ -774,7 +778,11 @@ void mouse_select_sima(void) } } - if(!edgeloop && shift) { + if (island) { + if(shift) select_linked_tface_uv(1); + else select_linked_tface_uv(0); + } + else if(!edgeloop && shift) { /* (de)select face */ if(actface) { if(simaFaceSel_Check(nearestefa, nearesttf)) { diff --git a/source/blender/src/editsound.c b/source/blender/src/editsound.c index 1cb7ec276cb..05eb094a7c2 100644 --- a/source/blender/src/editsound.c +++ b/source/blender/src/editsound.c @@ -148,7 +148,7 @@ void winqreadsoundspace(ScrArea *sa, void *spacedata, BWinEvent *evt) first= 0; CFRA= cfra; update_for_newframe(); - force_draw_plus(SPACE_VIEW3D, 1); + force_draw_all(0); } else PIL_sleep_ms(30); diff --git a/source/blender/src/edittime.c b/source/blender/src/edittime.c index 5a10ea65738..2c37a0eb20f 100644 --- a/source/blender/src/edittime.c +++ b/source/blender/src/edittime.c @@ -803,11 +803,11 @@ static void timeline_force_draw(short val) if(sa->spacetype==SPACE_VIEW3D) { if(sa==samin || (val & TIME_ALL_3D_WIN)) dodraw= 1; } - else if(ELEM6(sa->spacetype, SPACE_NLA, SPACE_IPO, SPACE_SEQ, SPACE_BUTS, SPACE_ACTION, SPACE_SOUND)) { + else if(ELEM5(sa->spacetype, SPACE_NLA, SPACE_IPO, SPACE_SEQ, SPACE_ACTION, SPACE_SOUND)) { if(val & TIME_ALL_ANIM_WIN) dodraw= 1; } else if(sa->spacetype==SPACE_BUTS) { - if(val & TIME_ALL_BUTS_WIN) dodraw= 1; + if(val & TIME_ALL_BUTS_WIN) dodraw= 2; } else if(sa->spacetype==SPACE_IMAGE) { if (val & TIME_ALL_IMAGE_WIN) dodraw = 1; diff --git a/source/blender/src/header_image.c b/source/blender/src/header_image.c index 7ac57cb839b..fac9e3af1af 100644 --- a/source/blender/src/header_image.c +++ b/source/blender/src/header_image.c @@ -1214,28 +1214,31 @@ void image_buttons(void) uiBlockBeginAlign(block); /* B_SEL_VERT & B_SEL_FACE are not defined here which is a bit bad, BUT it works even if image editor is fullscreen */ - uiDefIconButBitS(block, TOG, SCE_SELECT_VERTEX, B_SEL_VERT, ICON_VERTEXSEL, xco,0,XIC,YIC, &G.scene->selectmode, 1.0, 0.0, 0, 0, "Vertex select mode (Ctrl Tab 1)"); - xco+= XIC; + uiDefIconButBitS(block, TOG, SCE_SELECT_VERTEX, B_SEL_VERT, ICON_VERTEXSEL, + xco,0,XIC,YIC, &G.scene->selectmode, 1.0, 0.0, 0, 0, "Vertex select mode (Ctrl Tab 1)"); /* no edge */ /*uiDefIconButBitS(block, TOG, SCE_SELECT_EDGE, B_SEL_EDGE, ICON_EDGESEL, xco,0,XIC,YIC, &G.scene->selectmode, 1.0, 0.0, 0, 0, "Edge select mode (Ctrl Tab 2)"); xco+= XIC; */ - uiDefIconButBitS(block, TOG, SCE_SELECT_FACE, B_SEL_FACE, ICON_FACESEL, xco,0,XIC,YIC, &G.scene->selectmode, 1.0, 0.0, 0, 0, "Face select mode (Ctrl Tab 3)"); - xco+= XIC+8; + uiDefIconButBitS(block, TOG, SCE_SELECT_FACE, B_SEL_FACE, ICON_FACESEL, + xco+=XIC,0,XIC,YIC, &G.scene->selectmode, 1.0, 0.0, 0, 0, "Face select mode (Ctrl Tab 3)"); uiBlockEndAlign(block); } else { uiBlockBeginAlign(block); - uiDefIconButBitI(block, TOGN, SI_SELACTFACE, B_REDR, ICON_VERTEXSEL, xco,0,XIC,YIC, &G.sima->flag, 1.0, 0.0, 0, 0, "UV Vertex select mode"); - xco+= XIC; - uiDefIconButBitI(block, TOG, SI_SELACTFACE, B_REDR, ICON_FACESEL, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "UV Face select mode"); - xco+= XIC+8; - uiBlockEndAlign(block); + uiDefIconButS(block, ROW, B_REDR, ICON_VERTEXSEL, + xco,0,XIC,YIC, &G.sima->selectmode, 0.0, SI_SELECT_VERTEX, 0, 0, "UV vertex select mode"); + uiDefIconButS(block, ROW, B_REDR, ICON_FACESEL, + xco+=XIC,0,XIC,YIC, &G.sima->selectmode, 0.0, SI_SELECT_FACE, 0, 0, "UV Face select mode"); + uiDefIconButS(block, ROW, B_REDR, ICON_MESH, + xco+=XIC,0,XIC,YIC, &G.sima->selectmode, 0.0, SI_SELECT_ISLAND, 0, 0, "UV Island select mode"); + uiBlockEndAlign(block); + /* would use these if const's could go in strings * SI_STICKY_LOC SI_STICKY_DISABLE SI_STICKY_VERTEX */ ubut = uiDefIconTextButC(block, ICONTEXTROW, B_REDR, ICON_STICKY_UVS_LOC, "Sticky UV Selection: %t|Disable%x1|Shared Location%x0|Shared Vertex%x2", - xco,0,XIC+10,YIC, &(G.sima->sticky), 0, 3.0, 0, 0, + xco+=XIC+10,0,XIC+10,YIC, &(G.sima->sticky), 0, 3.0, 0, 0, "Sticky UV Selection (Hotkeys: Shift C, Alt C, Ctrl C)"); } diff --git a/source/blender/src/header_view3d.c b/source/blender/src/header_view3d.c index 1ada2729289..0f3a46c8a8c 100644 --- a/source/blender/src/header_view3d.c +++ b/source/blender/src/header_view3d.c @@ -1313,6 +1313,9 @@ static void do_view3d_select_armaturemenu(void *arg, int event) case 3: /* Select Parent(s) */ select_bone_parent(); break; + case 4: /* Swap Select All */ + deselectall_armature(3, 1); + break; } allqueue(REDRAWVIEW3D, 0); } @@ -1331,6 +1334,8 @@ static uiBlock *view3d_select_armaturemenu(void *arg_unused) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Swap Select All|Ctrl I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Parent(s)|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); if(curarea->headertype==HEADERTOP) { @@ -1356,12 +1361,15 @@ static void do_view3d_select_pose_armaturemenu(void *arg, int event) case 2: /* Select/Deselect all */ deselectall_posearmature(OBACT, 1, 1); break; - case 3: + case 3: /* Select Target(s) of Constraint(s) */ pose_select_constraint_target(); break; - case 4: + case 4: /* Select Bone's Parent */ select_bone_parent(); break; + case 5: /* Swap Select All */ + deselectall_posearmature(OBACT, 3, 1); + break; } allqueue(REDRAWVIEW3D, 0); } @@ -1379,6 +1387,7 @@ static uiBlock *view3d_select_pose_armaturemenu(void *arg_unused) uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Swap Select All|Ctrl I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Constraint Target|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Parent(s)|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); @@ -4106,7 +4115,7 @@ static uiBlock *view3d_pose_armature_ikmenu(void *arg_unused) block= uiNewBlock(&curarea->uiblocks, "view3d_pose_armature_ikmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); uiBlockSetButmFunc(block, do_view3d_pose_armature_ikmenu, NULL); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add IK to Bone...|Ctrl I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add IK to Bone...|Shift I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear IK...|Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); uiBlockSetDirection(block, UI_RIGHT); diff --git a/source/blender/src/headerbuttons.c b/source/blender/src/headerbuttons.c index 81ad135f514..1a91ada1562 100644 --- a/source/blender/src/headerbuttons.c +++ b/source/blender/src/headerbuttons.c @@ -1628,6 +1628,7 @@ void do_global_buttons(unsigned short event) allqueue(REDRAWOOPS, 1); allqueue(REDRAWACTION, 1); allqueue(REDRAWNLA, 1); + allqueue(REDRAWVIEW3D, 1); /* name scene also in set PUPmenu */ allqueue(REDRAWBUTSALL, 0); allqueue(REDRAWIMAGE, 0); diff --git a/source/blender/src/interface_draw.c b/source/blender/src/interface_draw.c index 83f1221b1fb..e7041e60003 100644 --- a/source/blender/src/interface_draw.c +++ b/source/blender/src/interface_draw.c @@ -180,8 +180,12 @@ static void ui_draw_icon(uiBut *but, BIFIconID icon, int blend) height= ICON_HEIGHT; if(but->flag & UI_ICON_LEFT) { - if (but->type==BUT_TOGDUAL && but->drawstr[0]) { - xs= but->x1-1.0; + if (but->type==BUT_TOGDUAL) { + if (but->drawstr[0]) { + xs= but->x1-1.0; + } else { + xs= (but->x1+but->x2- height)/2.0; + } } else if (but->type==BUTM ) { xs= but->x1+1.0; diff --git a/source/blender/src/poselib.c b/source/blender/src/poselib.c index 2d8b0c81175..fb2bfe5b605 100644 --- a/source/blender/src/poselib.c +++ b/source/blender/src/poselib.c @@ -756,6 +756,13 @@ static void poselib_keytag_pose (tPoseLib_PreviewData *pld) */ static void poselib_preview_get_next (tPoseLib_PreviewData *pld, int step) { + /* check if we no longer have search-string, but don't have any marker */ + if (pld->marker == NULL) { + if ((step) && (pld->searchstr[0] == 0)) + pld->marker= pld->act->markers.first; + } + + /* the following operations assume that there is a starting point and direction */ if ((pld->marker) && (step)) { /* search-string dictates a special approach */ if (pld->searchstr[0]) { @@ -1262,9 +1269,14 @@ void poselib_preview_poses (Object *ob, short apply_active) /* get search-string */ index= pld.search_cursor; - memcpy(&tempstr[0], &pld.searchstr[0], index); - tempstr[index]= '|'; - memcpy(&tempstr[index+1], &pld.searchstr[index], 64-index); + if (IN_RANGE(index, 0, 64)) { + memcpy(&tempstr[0], &pld.searchstr[0], index); + tempstr[index]= '|'; + memcpy(&tempstr[index+1], &pld.searchstr[index], 64-index); + } + else { + strncpy(tempstr, pld.searchstr, 64); + } /* get marker name */ if (pld.marker) diff --git a/source/blender/src/resources.c b/source/blender/src/resources.c index 046d14c990d..f47f14a605c 100644 --- a/source/blender/src/resources.c +++ b/source/blender/src/resources.c @@ -52,6 +52,7 @@ #include "BIF_interface_icons.h" #include "BLI_blenlib.h" +#include "BLI_dynstr.h" #include "blendef.h" // CLAMP #include "datatoc.h" @@ -784,6 +785,33 @@ char *BIF_ThemeColorsPup(int spacetype) return cp; } +char *BIF_ThemeColorSetsPup (short inc_custom) +{ + DynStr *pupds= BLI_dynstr_new(); + char *str; + char buf[48]; + int i; + + /* add title first (and the "default" entry) */ + BLI_dynstr_append(pupds, "Bone Color Set%t|Default Colors%x0|"); + + /* loop through set indices, adding them */ + for (i=1; i<21; i++) { + sprintf(buf, "%d - Theme Color Set%%x%d|", i, i); + BLI_dynstr_append(pupds, buf); + } + + /* add the 'custom' entry */ + if (inc_custom) + BLI_dynstr_append(pupds, "Custom Set %x-1"); + + /* convert to normal MEM_malloc'd string */ + str= BLI_dynstr_get_cstring(pupds); + BLI_dynstr_free(pupds); + + return str; +} + void BIF_SetTheme(ScrArea *sa) { if(sa==NULL) { // called for safety, when delete themes diff --git a/source/blender/src/sequence.c b/source/blender/src/sequence.c index 6851929bbc2..9426548dc38 100644 --- a/source/blender/src/sequence.c +++ b/source/blender/src/sequence.c @@ -2380,6 +2380,16 @@ ImBuf *give_ibuf_seq(int rectx, int recty, int cfra, int chanshown) return i; } +/* check used when we need to change seq->blend_mode but not to effect or audio strips */ +int seq_can_blend(Sequence *seq) +{ + if (ELEM4(seq->type, SEQ_IMAGE, SEQ_META, SEQ_SCENE, SEQ_MOVIE)) { + return 1; + } else { + return 0; + } +} + /* threading api */ static ListBase running_threads; diff --git a/source/blender/src/space.c b/source/blender/src/space.c index 4422411b1c5..58420604c83 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -2189,10 +2189,14 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt) break; case IKEY: if(G.qual==LR_CTRLKEY) { - if(ob && (ob->flag & OB_POSEMODE) && ob->type==OB_ARMATURE) - pose_add_IK(); - else if(ob && G.obedit) - selectswap_mesh(); + if((ob) && (ob->flag & OB_POSEMODE) && (ob->type==OB_ARMATURE)) + deselectall_posearmature(ob, 3, 1); + else if(ob && G.obedit) { + if(G.obedit->type == OB_ARMATURE) + deselectall_armature(3, 1); + else + selectswap_mesh(); + } else selectswap(); } @@ -2200,6 +2204,10 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt) if(ob && (ob->flag & OB_POSEMODE) && ob->type==OB_ARMATURE) pose_clear_IK(); } + else if(G.qual==LR_SHIFTKEY) { + if(ob && (ob->flag & OB_POSEMODE) && ob->type==OB_ARMATURE) + pose_add_IK(); + } break; case JKEY: @@ -4432,7 +4440,10 @@ static void winqreadinfospace(ScrArea *sa, void *spacedata, BWinEvent *evt) switch(event) { case UI_BUT_EVENT: - if(val==REDRAWTIME) allqueue(REDRAWTIME, 0); + if(val==REDRAWTIME) { + allqueue(REDRAWTIME, 0); + addqueue(sa->win, REDRAW, 1); + } else if(val==B_ADD_THEME) { bTheme *btheme, *new; @@ -4833,9 +4844,9 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt) if( cfra!=CFRA || first ) { first= 0; - + CFRA= cfra; - force_draw(0); + force_draw_all(0); update_for_newframe(); /* for audio scrubbing */ } else PIL_sleep_ms(30); diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c index dcebf6b7557..10e49cdd218 100644 --- a/source/blender/src/transform_conversions.c +++ b/source/blender/src/transform_conversions.c @@ -3610,6 +3610,7 @@ void special_aftertrans_update(TransInfo *t) Base *base; short redrawipo=0, resetslowpar=1; int cancelled= (t->state == TRANS_CANCEL); + short duplicate= (t->undostr && strstr(t->undostr, "Duplicate")) ? 1 : 0; if (t->spacetype==SPACE_VIEW3D) { if (G.obedit) { @@ -3622,7 +3623,7 @@ void special_aftertrans_update(TransInfo *t) } } } - if (t->spacetype == SPACE_ACTION) { + else if (t->spacetype == SPACE_ACTION) { void *data; short datatype; @@ -3644,7 +3645,7 @@ void special_aftertrans_update(TransInfo *t) /* Do curve cleanups? */ if ( (G.saction->flag & SACTION_NOTRANSKEYCULL)==0 && - (cancelled == 0) ) + ((cancelled == 0) || (duplicate)) ) { posttrans_action_clean((bAction *)data); } @@ -3659,7 +3660,7 @@ void special_aftertrans_update(TransInfo *t) IpoCurve *icu; if ( (G.saction->flag & SACTION_NOTRANSKEYCULL)==0 && - (cancelled == 0) ) + ((cancelled == 0) || (duplicate)) ) { posttrans_ipo_clean(key->ipo); } @@ -3685,7 +3686,7 @@ void special_aftertrans_update(TransInfo *t) /* after transform, remove duplicate keyframes on a frame that resulted from transform */ if ( (G.snla->flag & SNLA_NOTRANSKEYCULL)==0 && - (cancelled == 0) ) + ((cancelled == 0) || (duplicate)) ) { posttrans_nla_clean(t); } diff --git a/source/blender/src/transform_snap.c b/source/blender/src/transform_snap.c index d16308f17ae..3c17d0c1da8 100644 --- a/source/blender/src/transform_snap.c +++ b/source/blender/src/transform_snap.c @@ -814,7 +814,7 @@ int snapDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float ray_sta { efa = EM_get_face_for_index(index); - if (efa && efa->f & SELECT) + if (efa && ((efa->v1->f & SELECT) || (efa->v2->f & SELECT) || (efa->v3->f & SELECT) || (efa->v4 && efa->v4->f & SELECT))) { test = 0; } diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c index 2a4672e3052..4aea0df74b9 100644 --- a/source/blender/src/usiblender.c +++ b/source/blender/src/usiblender.c @@ -34,6 +34,8 @@ #include #include +#include "GL/glew.h" + #ifdef WIN32 #include /* need to include windows.h so _WIN32_IE is defined */ #ifndef _WIN32_IE diff --git a/source/blender/src/view.c b/source/blender/src/view.c index f457f9203ff..12450bee9de 100644 --- a/source/blender/src/view.c +++ b/source/blender/src/view.c @@ -1154,7 +1154,7 @@ void viewmoveNDOF(int mode) float q1[4]; float obofs[3]; float reverse; - float diff[4]; + //float diff[4]; float d, curareaX, curareaY; float mat[3][3]; float upvec[3]; diff --git a/source/blender/src/vpaint.c b/source/blender/src/vpaint.c index 4e883caba55..935c546a235 100644 --- a/source/blender/src/vpaint.c +++ b/source/blender/src/vpaint.c @@ -566,9 +566,9 @@ static unsigned int mcol_blend(unsigned int col1, unsigned int col2, int fac) cp= (char *)&col; cp[0]= 255; - cp[1]= (mfac*cp1[1]+fac*cp2[1])>>8; - cp[2]= (mfac*cp1[2]+fac*cp2[2])>>8; - cp[3]= (mfac*cp1[3]+fac*cp2[3])>>8; + cp[1]= (mfac*cp1[1]+fac*cp2[1])/255; + cp[2]= (mfac*cp1[2]+fac*cp2[2])/255; + cp[3]= (mfac*cp1[3]+fac*cp2[3])/255; return col; } @@ -586,11 +586,11 @@ static unsigned int mcol_add(unsigned int col1, unsigned int col2, int fac) cp= (char *)&col; cp[0]= 255; - temp= cp1[1] + ((fac*cp2[1])>>8); + temp= cp1[1] + ((fac*cp2[1])/255); if(temp>254) cp[1]= 255; else cp[1]= temp; - temp= cp1[2] + ((fac*cp2[2])>>8); + temp= cp1[2] + ((fac*cp2[2])/255); if(temp>254) cp[2]= 255; else cp[2]= temp; - temp= cp1[3] + ((fac*cp2[3])>>8); + temp= cp1[3] + ((fac*cp2[3])/255); if(temp>254) cp[3]= 255; else cp[3]= temp; return col; @@ -609,11 +609,11 @@ static unsigned int mcol_sub(unsigned int col1, unsigned int col2, int fac) cp= (char *)&col; cp[0]= 255; - temp= cp1[1] - ((fac*cp2[1])>>8); + temp= cp1[1] - ((fac*cp2[1])/255); if(temp<0) cp[1]= 0; else cp[1]= temp; - temp= cp1[2] - ((fac*cp2[2])>>8); + temp= cp1[2] - ((fac*cp2[2])/255); if(temp<0) cp[2]= 0; else cp[2]= temp; - temp= cp1[3] - ((fac*cp2[3])>>8); + temp= cp1[3] - ((fac*cp2[3])/255); if(temp<0) cp[3]= 0; else cp[3]= temp; return col; @@ -635,9 +635,9 @@ static unsigned int mcol_mul(unsigned int col1, unsigned int col2, int fac) /* first mul, then blend the fac */ cp[0]= 255; - cp[1]= (mfac*cp1[1] + fac*((cp2[1]*cp1[1])>>8) )>>8; - cp[2]= (mfac*cp1[2] + fac*((cp2[2]*cp1[2])>>8) )>>8; - cp[3]= (mfac*cp1[3] + fac*((cp2[3]*cp1[3])>>8) )>>8; + cp[1]= (mfac*cp1[1] + fac*((cp2[1]*cp1[1])/255) )/255; + cp[2]= (mfac*cp1[2] + fac*((cp2[2]*cp1[2])/255) )/255; + cp[3]= (mfac*cp1[3] + fac*((cp2[3]*cp1[3])/255) )/255; return col; @@ -664,9 +664,9 @@ static unsigned int mcol_lighten(unsigned int col1, unsigned int col2, int fac) return col1; cp[0]= 255; - cp[1]= (mfac*cp1[1]+fac*cp2[1])>>8; - cp[2]= (mfac*cp1[2]+fac*cp2[2])>>8; - cp[3]= (mfac*cp1[3]+fac*cp2[3])>>8; + cp[1]= (mfac*cp1[1]+fac*cp2[1])/255; + cp[2]= (mfac*cp1[2]+fac*cp2[2])/255; + cp[3]= (mfac*cp1[3]+fac*cp2[3])/255; return col; } @@ -692,9 +692,9 @@ static unsigned int mcol_darken(unsigned int col1, unsigned int col2, int fac) return col1; cp[0]= 255; - cp[1]= (mfac*cp1[1]+fac*cp2[1])>>8; - cp[2]= (mfac*cp1[2]+fac*cp2[2])>>8; - cp[3]= (mfac*cp1[3]+fac*cp2[3])>>8; + cp[1]= (mfac*cp1[1]+fac*cp2[1])/255; + cp[2]= (mfac*cp1[2]+fac*cp2[2])/255; + cp[3]= (mfac*cp1[3]+fac*cp2[3])/255; return col; } diff --git a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp index 230d6b262c6..ed6ea7c5f6a 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp @@ -26,6 +26,7 @@ * ***** END GPL LICENSE BLOCK ***** */ +#include "GL/glew.h" #include "KX_BlenderGL.h" #ifdef HAVE_CONFIG_H @@ -44,7 +45,6 @@ #include "BMF_Api.h" -#include "GL/glew.h" #include "BIF_gl.h" #include "BL_Material.h" // MAXTEX diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp index 73d2870720a..220d174d464 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp @@ -483,9 +483,9 @@ void KX_BlenderRenderTools::MotionBlur(RAS_IRasterizer* rasterizer) } } -void KX_BlenderRenderTools::Update2DFilter(RAS_2DFilterManager::RAS_2DFILTER_MODE filtermode, int pass, STR_String& text, short texture_flag) +void KX_BlenderRenderTools::Update2DFilter(vector& propNames, void* gameObj, RAS_2DFilterManager::RAS_2DFILTER_MODE filtermode, int pass, STR_String& text) { - m_filtermanager.EnableFilter(filtermode, pass, text, texture_flag); + m_filtermanager.EnableFilter(propNames, gameObj, filtermode, pass, text); } void KX_BlenderRenderTools::Render2DFilters(RAS_ICanvas* canvas) diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h index 7748e31156d..8abce1b8c3e 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h @@ -101,7 +101,7 @@ public: virtual void MotionBlur(RAS_IRasterizer* rasterizer); - virtual void Update2DFilter(RAS_2DFilterManager::RAS_2DFILTER_MODE filtermode, int pass, STR_String& text, short texture_flag); + virtual void Update2DFilter(vector& propNames, void* gameObj, RAS_2DFilterManager::RAS_2DFILTER_MODE filtermode, int pass, STR_String& text); virtual void Render2DFilters(RAS_ICanvas* canvas); diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index 5050da3fe7f..5d6dd694765 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -184,6 +184,11 @@ bool BL_ActionActuator::Update(double curtime, bool frame) if (bNegativeEvent) { + // dont continue where we left off when restarting + if (m_end_reset) { + m_flag &= ~ACT_FLAG_LOCKINPUT; + } + if (!(m_flag & ACT_FLAG_ACTIVE)) return false; m_flag &= ~ACT_FLAG_ACTIVE; @@ -472,8 +477,10 @@ PyMethodDef BL_ActionActuator::Methods[] = { {"getFrameProperty", (PyCFunction) BL_ActionActuator::sPyGetFrameProperty, METH_VARARGS, GetFrameProperty_doc}, {"setChannel", (PyCFunction) BL_ActionActuator::sPySetChannel, METH_VARARGS, SetChannel_doc}, // {"getChannel", (PyCFunction) BL_ActionActuator::sPyGetChannel, METH_VARARGS}, - {"getType", (PyCFunction) BL_ActionActuator::sPyGetType, METH_VARARGS, GetType_doc}, + {"getType", (PyCFunction) BL_ActionActuator::sPyGetType, METH_VARARGS, GetType_doc}, {"setType", (PyCFunction) BL_ActionActuator::sPySetType, METH_VARARGS, SetType_doc}, + {"getContinue", (PyCFunction) BL_ActionActuator::sPyGetContinue, METH_NOARGS, 0}, + {"setContinue", (PyCFunction) BL_ActionActuator::sPySetContinue, METH_O, 0}, {NULL,NULL} //Sentinel }; @@ -641,6 +648,9 @@ PyObject* BL_ActionActuator::PySetAction(PyObject* self, m_blendframe = 0; } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; @@ -660,6 +670,9 @@ PyObject* BL_ActionActuator::PySetStart(PyObject* self, { m_startframe = start; } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; @@ -679,6 +692,9 @@ PyObject* BL_ActionActuator::PySetEnd(PyObject* self, { m_endframe = end; } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; @@ -699,6 +715,9 @@ PyObject* BL_ActionActuator::PySetBlendin(PyObject* self, { m_blendin = blendin; } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; @@ -724,6 +743,9 @@ PyObject* BL_ActionActuator::PySetBlendtime(PyObject* self, if (m_blendframe>m_blendin) m_blendframe = m_blendin; } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; @@ -745,6 +767,9 @@ PyObject* BL_ActionActuator::PySetPriority(PyObject* self, { m_priority = priority; } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; @@ -768,6 +793,9 @@ PyObject* BL_ActionActuator::PySetFrame(PyObject* self, else if (m_localtime>m_endframe) m_localtime=m_endframe; } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; @@ -788,6 +816,9 @@ PyObject* BL_ActionActuator::PySetProperty(PyObject* self, { m_propname = string; } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; @@ -807,6 +838,9 @@ PyObject* BL_ActionActuator::PySetFrameProperty(PyObject* self, { m_framepropname = string; } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; @@ -822,6 +856,9 @@ PyObject* BL_ActionActuator::PyGetChannel(PyObject* self, { m_propname = string; } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; @@ -846,7 +883,8 @@ PyObject* BL_ActionActuator::PySetChannel(PyObject* self, int row,col; int mode = 0; /* 0 for bone space, 1 for armature/world space */ - PyArg_ParseTuple(args,"sO|i", &string, &pylist, &mode); + if (!PyArg_ParseTuple(args,"sO|i", &string, &pylist, &mode)) + return NULL; if (pylist->ob_type == &CListValue::Type) { @@ -947,7 +985,26 @@ PyObject* BL_ActionActuator::PySetType(PyObject* self, default: printf("Invalid type for action actuator: %d\n", typeArg); /* error */ } - - Py_Return; + Py_RETURN_NONE; +} + +PyObject* BL_ActionActuator::PyGetContinue(PyObject* self) { + return PyInt_FromLong((long)(m_end_reset==0)); +} + +PyObject* BL_ActionActuator::PySetContinue(PyObject* self, PyObject* value) { + int param = PyObject_IsTrue( value ); + + if( param == -1 ) { + PyErr_SetString( PyExc_TypeError, "expected True/False or 0/1" ); + return NULL; + } + + if (param) { + m_end_reset = 0; + } else { + m_end_reset = 1; + } + Py_RETURN_NONE; } diff --git a/source/gameengine/Converter/BL_ActionActuator.h b/source/gameengine/Converter/BL_ActionActuator.h index 190f727c9c3..a67b6d29b74 100644 --- a/source/gameengine/Converter/BL_ActionActuator.h +++ b/source/gameengine/Converter/BL_ActionActuator.h @@ -47,6 +47,7 @@ public: short playtype, short blendin, short priority, + short end_reset, float stride, PyTypeObject* T=&Type) : SCA_IActuator(gameobj,T), @@ -64,6 +65,7 @@ public: m_stridelength(stride), m_playtype(playtype), m_priority(priority), + m_end_reset(end_reset), m_pose(NULL), m_blendpose(NULL), m_userpose(NULL), @@ -101,6 +103,8 @@ public: // KX_PYMETHOD(BL_ActionActuator,GetChannel); KX_PYMETHOD_DOC(BL_ActionActuator,GetType); KX_PYMETHOD_DOC(BL_ActionActuator,SetType); + KX_PYMETHOD_NOARGS(BL_ActionActuator,GetContinue); + KX_PYMETHOD_O(BL_ActionActuator,SetContinue); virtual PyObject* _getattr(const STR_String& attr); @@ -137,6 +141,7 @@ protected: float m_stridelength; short m_playtype; short m_priority; + short m_end_reset; struct bPose* m_pose; struct bPose* m_blendpose; struct bPose* m_userpose; diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 665783a1ba5..f3e22cd297a 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -312,11 +312,13 @@ BL_Material* ConvertMaterial( Mesh* mesh, Material *mat, MTFace* tface, + const char *tfaceName, MFace* mface, MCol* mmcol, int lightlayer, Object* blenderobj, - MTF_localLayer *layers) + MTF_localLayer *layers, + bool glslmat) { //this needs some type of manager BL_Material *material = new BL_Material(); @@ -335,7 +337,7 @@ BL_Material* ConvertMaterial( if(validmat) { // use vertex colors by explicitly setting - if(mat->mode &MA_VERTEXCOLP) + if(mat->mode &MA_VERTEXCOLP || glslmat) type = 0; // use lighting? @@ -558,6 +560,7 @@ BL_Material* ConvertMaterial( } else { int valid = 0; + // check for tface tex to fallback on if( validface ){ @@ -590,6 +593,7 @@ BL_Material* ConvertMaterial( } MT_Point2 uv[4]; MT_Point2 uv2[4]; + const char *uvName = "", *uv2Name = ""; uv[0]= uv[1]= uv[2]= uv[3]= MT_Point2(0.0f, 0.0f); uv2[0]= uv2[1]= uv2[2]= uv2[3]= MT_Point2(0.0f, 0.0f); @@ -616,6 +620,8 @@ BL_Material* ConvertMaterial( if (mface->v4) uv[3] = MT_Point2(tface->uv[3]); + + uvName = tfaceName; } else { // nothing at all @@ -641,39 +647,38 @@ BL_Material* ConvertMaterial( isFirstSet = false; else { - MT_Point2 uvSet[4]; for (int lay=0; layuv[0]); uvSet[1] = MT_Point2(layer.face->uv[1]); uvSet[2] = MT_Point2(layer.face->uv[2]); if (mface->v4) uvSet[3] = MT_Point2(layer.face->uv[3]); + else + uvSet[3] = MT_Point2(0.0f, 0.0f); - processed = true; - } - - if (!processed) continue; - - if (isFirstSet) - { - uv[0] = uvSet[0]; uv[1] = uvSet[1]; - uv[2] = uvSet[2]; uv[3] = uvSet[3]; - isFirstSet = false; - } - else - { - uv2[0] = uvSet[0]; uv2[1] = uvSet[1]; - uv2[2] = uvSet[2]; uv2[3] = uvSet[3]; - map.mapping |= USECUSTOMUV; + if (isFirstSet) + { + uv[0] = uvSet[0]; uv[1] = uvSet[1]; + uv[2] = uvSet[2]; uv[3] = uvSet[3]; + isFirstSet = false; + uvName = layer.name; + } + else + { + uv2[0] = uvSet[0]; uv2[1] = uvSet[1]; + uv2[2] = uvSet[2]; uv2[3] = uvSet[3]; + map.mapping |= USECUSTOMUV; + uv2Name = layer.name; + } } } } @@ -693,9 +698,8 @@ BL_Material* ConvertMaterial( } material->SetConversionRGB(rgb); - material->SetConversionUV(uv); - material->SetConversionUV2(uv2); - + material->SetConversionUV(uvName, uv); + material->SetConversionUV2(uv2Name, uv2); material->ras_mode |= (mface->v4==0)?TRIANGLE:0; if(validmat) @@ -797,6 +801,7 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* MFace* mface = static_cast(mesh->mface); MTFace* tface = static_cast(mesh->mtface); + const char *tfaceName = ""; MCol* mmcol = mesh->mcol; MT_assert(mface || mesh->totface == 0); @@ -832,14 +837,14 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* layers[validLayers].face = (MTFace*)mesh->fdata.layers[i].data;; layers[validLayers].name = mesh->fdata.layers[i].name; + if(tface == layers[validLayers].face) + tfaceName = layers[validLayers].name; validLayers++; } } meshobj->SetName(mesh->id.name); meshobj->m_xyz_index_to_vertex_index_mapping.resize(mesh->totvert); - if(skinMesh) - ((BL_SkinMeshObject*)meshobj)->m_mvert_to_dvert_mapping.resize(mesh->totvert); for (int f=0;ftotface;f++,mface++) { @@ -898,8 +903,7 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* else ma = give_current_material(blenderobj, 1); - bl_mat = ConvertMaterial(mesh, ma, tface, mface, mmcol, lightlayer, blenderobj, layers); - bl_mat->glslmat = converter->GetGLSLMaterials(); + bl_mat = ConvertMaterial(mesh, ma, tface, tfaceName, mface, mmcol, lightlayer, blenderobj, layers, converter->GetGLSLMaterials()); // set the index were dealing with bl_mat->material_index = (int)mface->mat_nr; @@ -1059,35 +1063,25 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* int nverts = mface->v4?4:3; int vtxarray = meshobj->FindVertexArray(nverts,polymat); RAS_Polygon* poly = new RAS_Polygon(bucket,polyvisible,nverts,vtxarray); - if (skinMesh) { - int d1, d2, d3, d4=0; - bool flat; + bool flat; + + if (skinMesh) { /* If the face is set to solid, all fnors are the same */ if (mface->flag & ME_SMOOTH) flat = false; else flat = true; - - d1=((BL_SkinMeshObject*)meshobj)->FindOrAddDeform(vtxarray, mface->v1, &mesh->dvert[mface->v1], polymat); - d2=((BL_SkinMeshObject*)meshobj)->FindOrAddDeform(vtxarray, mface->v2, &mesh->dvert[mface->v2], polymat); - d3=((BL_SkinMeshObject*)meshobj)->FindOrAddDeform(vtxarray, mface->v3, &mesh->dvert[mface->v3], polymat); - if (nverts==4) - d4=((BL_SkinMeshObject*)meshobj)->FindOrAddDeform(vtxarray, mface->v4, &mesh->dvert[mface->v4], polymat); - poly->SetVertex(0,((BL_SkinMeshObject*)meshobj)->FindOrAddVertex(vtxarray,pt0,uv0,uv20,tan0,rgb0,no0,d1,flat,polymat,mface->v1)); - poly->SetVertex(1,((BL_SkinMeshObject*)meshobj)->FindOrAddVertex(vtxarray,pt1,uv1,uv21,tan1,rgb1,no1,d2,flat,polymat,mface->v2)); - poly->SetVertex(2,((BL_SkinMeshObject*)meshobj)->FindOrAddVertex(vtxarray,pt2,uv2,uv22,tan2,rgb2,no2,d3,flat,polymat,mface->v3)); - if (nverts==4) - poly->SetVertex(3,((BL_SkinMeshObject*)meshobj)->FindOrAddVertex(vtxarray,pt3,uv3,uv23,tan3,rgb3,no3,d4,flat,polymat,mface->v4)); } else - { - poly->SetVertex(0,meshobj->FindOrAddVertex(vtxarray,pt0,uv0,uv20,tan0,rgb0,no0,false,polymat,mface->v1)); - poly->SetVertex(1,meshobj->FindOrAddVertex(vtxarray,pt1,uv1,uv21,tan1,rgb1,no1,false,polymat,mface->v2)); - poly->SetVertex(2,meshobj->FindOrAddVertex(vtxarray,pt2,uv2,uv22,tan2,rgb2,no2,false,polymat,mface->v3)); - if (nverts==4) - poly->SetVertex(3,meshobj->FindOrAddVertex(vtxarray,pt3,uv3,uv23,tan3,rgb3,no3,false,polymat,mface->v4)); - } + flat = false; + + poly->SetVertex(0,meshobj->FindOrAddVertex(vtxarray,pt0,uv0,uv20,tan0,rgb0,no0,flat,polymat,mface->v1)); + poly->SetVertex(1,meshobj->FindOrAddVertex(vtxarray,pt1,uv1,uv21,tan1,rgb1,no1,flat,polymat,mface->v2)); + poly->SetVertex(2,meshobj->FindOrAddVertex(vtxarray,pt2,uv2,uv22,tan2,rgb2,no2,flat,polymat,mface->v3)); + if (nverts==4) + poly->SetVertex(3,meshobj->FindOrAddVertex(vtxarray,pt3,uv3,uv23,tan3,rgb3,no3,flat,polymat,mface->v4)); + meshobj->AddPolygon(poly); if (poly->IsCollider()) { @@ -1125,8 +1119,6 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* } } meshobj->m_xyz_index_to_vertex_index_mapping.clear(); - if(skinMesh) - ((BL_SkinMeshObject*)meshobj)->m_mvert_to_dvert_mapping.clear(); meshobj->UpdateMaterialList(); // pre calculate texture generation @@ -1545,7 +1537,7 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, -static KX_LightObject *gamelight_from_blamp(Lamp *la, unsigned int layerflag, KX_Scene *kxscene, RAS_IRenderTools *rendertools, KX_BlenderSceneConverter *converter) { +static KX_LightObject *gamelight_from_blamp(Object *ob, Lamp *la, unsigned int layerflag, KX_Scene *kxscene, RAS_IRenderTools *rendertools, KX_BlenderSceneConverter *converter) { RAS_LightObject lightobj; KX_LightObject *gamelight; @@ -1577,8 +1569,15 @@ static KX_LightObject *gamelight_from_blamp(Lamp *la, unsigned int layerflag, KX } else { lightobj.m_type = RAS_LightObject::LIGHT_NORMAL; } + +#ifdef BLENDER_GLSL + if(converter->GetGLSLMaterials()) + GPU_lamp_from_blender(ob, la); - gamelight = new KX_LightObject(kxscene, KX_Scene::m_callbacks, rendertools, lightobj); + gamelight = new KX_LightObject(kxscene, KX_Scene::m_callbacks, rendertools, lightobj, ob->gpulamp); +#else + gamelight = new KX_LightObject(kxscene, KX_Scene::m_callbacks, rendertools, lightobj, NULL); +#endif BL_ConvertLampIpos(la, gamelight, converter); return gamelight; @@ -1610,7 +1609,7 @@ static KX_GameObject *gameobject_from_blenderobject( { case OB_LAMP: { - KX_LightObject* gamelight= gamelight_from_blamp(static_cast(ob->data), ob->lay, kxscene, rendertools, converter); + KX_LightObject* gamelight= gamelight_from_blamp(ob, static_cast(ob->data), ob->lay, kxscene, rendertools, converter); gameobj = gamelight; gamelight->AddRef(); @@ -1660,7 +1659,7 @@ static KX_GameObject *gameobject_from_blenderobject( // two options exists for deform: shape keys and armature // only support relative shape key bool bHasShapeKey = mesh->key != NULL && mesh->key->type==KEY_RELATIVE; - bool bHasDvert = mesh->dvert != NULL; + bool bHasDvert = mesh->dvert != NULL && ob->defbase.first; bool bHasArmature = (ob->parent && ob->parent->type == OB_ARMATURE && ob->partype==PARSKEL && bHasDvert); if (bHasShapeKey) { @@ -1671,13 +1670,15 @@ static KX_GameObject *gameobject_from_blenderobject( if (bHasArmature) dcont->LoadShapeDrivers(ob->parent); } else if (bHasArmature) { - BL_SkinDeformer *dcont = new BL_SkinDeformer(ob, (BL_SkinMeshObject*)meshobj ); + BL_SkinDeformer *dcont = new BL_SkinDeformer((BL_DeformableGameObject*)gameobj, + ob, (BL_SkinMeshObject*)meshobj); ((BL_DeformableGameObject*)gameobj)->m_pDeformer = dcont; } else if (bHasDvert) { // this case correspond to a mesh that can potentially deform but not with the // object to which it is attached for the moment. A skin mesh was created in // BL_ConvertMesh() so must create a deformer too! - BL_MeshDeformer *dcont = new BL_MeshDeformer(ob, (BL_SkinMeshObject*)meshobj ); + BL_MeshDeformer *dcont = new BL_MeshDeformer((BL_DeformableGameObject*)gameobj, + ob, (BL_SkinMeshObject*)meshobj); ((BL_DeformableGameObject*)gameobj)->m_pDeformer = dcont; } @@ -2075,7 +2076,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie, if (blenderscene->camera) { KX_Camera *gamecamera= (KX_Camera*) converter->FindGameObject(blenderscene->camera); - kxscene->SetActiveCamera(gamecamera); + if(gamecamera) + kxscene->SetActiveCamera(gamecamera); } // Set up armatures @@ -2331,7 +2333,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie, { KX_GameObject* gameobj = static_cast(logicbrick_conversionlist->GetValue(i)); struct Object* blenderobj = converter->FindBlenderObject(gameobj); - gameobj->SetState((blenderobj->init_state)?blenderobj->init_state:blenderobj->state); + gameobj->SetInitState((blenderobj->init_state)?blenderobj->init_state:blenderobj->state); + gameobj->ResetState(); } #endif //CONVERT_LOGIC diff --git a/source/gameengine/Converter/BL_MeshDeformer.cpp b/source/gameengine/Converter/BL_MeshDeformer.cpp index 212827a660f..39d66a90e92 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.cpp +++ b/source/gameengine/Converter/BL_MeshDeformer.cpp @@ -39,6 +39,7 @@ #endif #include "RAS_IPolygonMaterial.h" +#include "BL_DeformableGameObject.h" #include "BL_MeshDeformer.h" #include "BL_SkinMeshObject.h" #include "DNA_mesh_types.h" @@ -47,33 +48,40 @@ #include "GEN_Map.h" #include "STR_HashedString.h" -bool BL_MeshDeformer::Apply(RAS_IPolyMaterial *mat) +bool BL_MeshDeformer::Apply(RAS_IPolyMaterial*) { - size_t i, j, index; - vecVertexArray array; - vecIndexArrays mvarray; - vecIndexArrays diarray; + size_t i, j; + float *co; - RAS_TexVert *tv; - MVert *mvert; + // only apply once per frame if the mesh is actually modified + if(m_pMeshObject->MeshModified() && + m_lastDeformUpdate != m_gameobj->GetLastFrame()) { + // For each material + for(RAS_MaterialBucket::Set::iterator mit = m_pMeshObject->GetFirstMaterial(); + mit != m_pMeshObject->GetLastMaterial(); ++ mit) { + RAS_IPolyMaterial *mat = (*mit)->GetPolyMaterial(); - // For each material - array = m_pMeshObject->GetVertexCache(mat); - mvarray = m_pMeshObject->GetMVertCache(mat); - diarray = m_pMeshObject->GetDIndexCache(mat); + vecVertexArray& vertexarrays = m_pMeshObject->GetVertexCache(mat); - // For each array - for (i=0; isize(); j++){ - tv = &((*array[i])[j]); - index = ((*diarray[i])[j]); + // For each array + for (i=0; imvert[((*mvarray[i])[index])]); - tv->SetXYZ(MT_Point3(mvert->co)); + // For each vertex + for (j=0; jmvert[v.getOrigIndex()].co; + v.SetXYZ(MT_Point3(co)); + } + } } + + m_lastDeformUpdate = m_gameobj->GetLastFrame(); + + return true; } - return true; + + return false; } BL_MeshDeformer::~BL_MeshDeformer() @@ -92,83 +100,86 @@ void BL_MeshDeformer::RecalcNormals() /* We don't normalize for performance, not doing it for faces normals * gives area-weight normals which often look better anyway, and use * GL_NORMALIZE so we don't have to do per vertex normalization either - * since the GPU can do it faster - * - * There's a lot of indirection here to get to the data, can this work - * with less arrays/indirection? */ - - vecIndexArrays indexarrays; - vecIndexArrays mvarrays; - vecIndexArrays diarrays; - vecVertexArray vertexarrays; + * since the GPU can do it faster */ size_t i, j; /* set vertex normals to zero */ - for (i=0; i<(size_t)m_bmesh->totvert; i++) - m_transnors[i] = MT_Vector3(0.0f, 0.0f, 0.0f); + memset(m_transnors, 0, sizeof(float)*3*m_bmesh->totvert); /* add face normals to vertices. */ for(RAS_MaterialBucket::Set::iterator mit = m_pMeshObject->GetFirstMaterial(); mit != m_pMeshObject->GetLastMaterial(); ++ mit) { RAS_IPolyMaterial *mat = (*mit)->GetPolyMaterial(); - indexarrays = m_pMeshObject->GetIndexCache(mat); - vertexarrays = m_pMeshObject->GetVertexCache(mat); - diarrays = m_pMeshObject->GetDIndexCache(mat); - mvarrays = m_pMeshObject->GetMVertCache(mat); + const vecIndexArrays& indexarrays = m_pMeshObject->GetIndexCache(mat); + vecVertexArray& vertexarrays = m_pMeshObject->GetVertexCache(mat); for (i=0; iUsesTriangles()? 3: 4; for(j=0; jgetLocalXYZ(); - fnor = (((mv2-mv1).cross(mv3-mv2))+((mv4-mv3).cross(mv1-mv4))); //.safe_normalized(); + n1[0]= co1[0]-co3[0]; + n1[1]= co1[1]-co3[1]; + n1[2]= co1[2]-co3[2]; + + n2[0]= co2[0]-co4[0]; + n2[1]= co2[1]-co4[1]; + n2[2]= co2[2]-co4[2]; } - else - fnor = ((mv2-mv1).cross(mv3-mv2)); //.safe_normalized(); + else { + n1[0]= co1[0]-co2[0]; + n2[0]= co2[0]-co3[0]; + n1[1]= co1[1]-co2[1]; + + n2[1]= co2[1]-co3[1]; + n1[2]= co1[2]-co2[2]; + n2[2]= co2[2]-co3[2]; + } + + fnor[0]= n1[1]*n2[2] - n1[2]*n2[1]; + fnor[1]= n1[2]*n2[0] - n1[0]*n2[2]; + fnor[2]= n1[0]*n2[1] - n1[1]*n2[0]; /* add to vertices for smooth normals */ - m_transnors[mvarray[diarray[i1]]] += fnor; - m_transnors[mvarray[diarray[i2]]] += fnor; - m_transnors[mvarray[diarray[i3]]] += fnor; + float *vn1 = m_transnors[v1.getOrigIndex()]; + float *vn2 = m_transnors[v2.getOrigIndex()]; + float *vn3 = m_transnors[v3.getOrigIndex()]; + + vn1[0] += fnor[0]; vn1[1] += fnor[1]; vn1[2] += fnor[2]; + vn2[0] += fnor[0]; vn2[1] += fnor[1]; vn2[2] += fnor[2]; + vn3[0] += fnor[0]; vn3[1] += fnor[1]; vn3[2] += fnor[2]; + + if(v4) { + float *vn4 = m_transnors[v4->getOrigIndex()]; + vn4[0] += fnor[0]; vn4[1] += fnor[1]; vn4[2] += fnor[2]; + } /* in case of flat - just assign, the vertices are split */ if(v1.getFlag() & TV_CALCFACENORMAL) { v1.SetNormal(fnor); v2.SetNormal(fnor); v3.SetNormal(fnor); - } - - if(nvert == 4) { - int i4 = indexarray[j+3]; - RAS_TexVert& v4 = vertexarray[i4]; - - /* same as above */ - m_transnors[mvarray[diarray[i4]]] += fnor; - - if(v4.getFlag() & TV_CALCFACENORMAL) - v4.SetNormal(fnor); + if(v4) + v4->SetNormal(fnor); } } } @@ -179,18 +190,17 @@ void BL_MeshDeformer::RecalcNormals() mit != m_pMeshObject->GetLastMaterial(); ++ mit) { RAS_IPolyMaterial *mat = (*mit)->GetPolyMaterial(); - vertexarrays = m_pMeshObject->GetVertexCache(mat); - diarrays = m_pMeshObject->GetDIndexCache(mat); - mvarrays = m_pMeshObject->GetMVertCache(mat); + vecVertexArray& vertexarrays = m_pMeshObject->GetVertexCache(mat); for (i=0; itotvert)][3]; - m_transnors=new MT_Vector3[m_bmesh->totvert]; + m_transverts=new float[m_bmesh->totvert][3]; + m_transnors=new float[m_bmesh->totvert][3]; m_tvtot = m_bmesh->totvert; } } diff --git a/source/gameengine/Converter/BL_MeshDeformer.h b/source/gameengine/Converter/BL_MeshDeformer.h index 8d8b56b1eed..e9f7f0b192f 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.h +++ b/source/gameengine/Converter/BL_MeshDeformer.h @@ -40,19 +40,25 @@ #pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning #endif //WIN32 +class BL_DeformableGameObject; + class BL_MeshDeformer : public RAS_Deformer { public: void VerifyStorage(); void RecalcNormals(); virtual void Relink(GEN_Map*map){}; - BL_MeshDeformer(struct Object* obj, class BL_SkinMeshObject *meshobj ): + BL_MeshDeformer(BL_DeformableGameObject *gameobj, + struct Object* obj, + class BL_SkinMeshObject *meshobj ): m_pMeshObject(meshobj), m_bmesh((struct Mesh*)(obj->data)), m_transverts(0), m_transnors(0), m_objMesh(obj), - m_tvtot(0) + m_tvtot(0), + m_gameobj(gameobj), + m_lastDeformUpdate(-1) {}; virtual ~BL_MeshDeformer(); virtual void SetSimulatedTime(double time){}; @@ -68,10 +74,12 @@ protected: // this is so m_transverts doesn't need to be converted // before deformation float (*m_transverts)[3]; - MT_Vector3* m_transnors; + float (*m_transnors)[3]; struct Object* m_objMesh; // -- int m_tvtot; + BL_DeformableGameObject* m_gameobj; + double m_lastDeformUpdate; }; #endif diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp index 58d46d76e5b..7196b393ed4 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp +++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp @@ -604,6 +604,9 @@ PyObject* BL_ShapeActionActuator::PySetAction(PyObject* self, m_blendframe = 0.f; } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; @@ -623,6 +626,9 @@ PyObject* BL_ShapeActionActuator::PySetStart(PyObject* self, { m_startframe = start; } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; @@ -642,6 +648,9 @@ PyObject* BL_ShapeActionActuator::PySetEnd(PyObject* self, { m_endframe = end; } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; @@ -662,6 +671,9 @@ PyObject* BL_ShapeActionActuator::PySetBlendin(PyObject* self, { m_blendin = blendin; } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; @@ -687,6 +699,9 @@ PyObject* BL_ShapeActionActuator::PySetBlendtime(PyObject* self, if (m_blendframe>m_blendin) m_blendframe = m_blendin; } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; @@ -708,6 +723,9 @@ PyObject* BL_ShapeActionActuator::PySetPriority(PyObject* self, { m_priority = priority; } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; @@ -731,6 +749,9 @@ PyObject* BL_ShapeActionActuator::PySetFrame(PyObject* self, else if (m_localtime>m_endframe) m_localtime=m_endframe; } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; @@ -751,6 +772,9 @@ PyObject* BL_ShapeActionActuator::PySetProperty(PyObject* self, { m_propname = string; } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; diff --git a/source/gameengine/Converter/BL_ShapeDeformer.h b/source/gameengine/Converter/BL_ShapeDeformer.h index 9f8361dbaca..5f0188e3a42 100644 --- a/source/gameengine/Converter/BL_ShapeDeformer.h +++ b/source/gameengine/Converter/BL_ShapeDeformer.h @@ -58,9 +58,8 @@ public: Object *bmeshobj, BL_SkinMeshObject *mesh) : - BL_SkinDeformer(bmeshobj, mesh), - m_lastShapeUpdate(-1), - m_gameobj(gameobj) + BL_SkinDeformer(gameobj,bmeshobj, mesh), + m_lastShapeUpdate(-1) { }; @@ -72,9 +71,8 @@ public: bool release_object, BL_ArmatureObject* arma = NULL) : - BL_SkinDeformer(bmeshobj_old, bmeshobj_new, mesh, release_object, arma), - m_lastShapeUpdate(-1), - m_gameobj(gameobj) + BL_SkinDeformer(gameobj, bmeshobj_old, bmeshobj_new, mesh, release_object, arma), + m_lastShapeUpdate(-1) { }; @@ -94,7 +92,6 @@ public: protected: vector m_shapeDrivers; double m_lastShapeUpdate; - BL_DeformableGameObject* m_gameobj; }; diff --git a/source/gameengine/Converter/BL_SkinDeformer.cpp b/source/gameengine/Converter/BL_SkinDeformer.cpp index dd7119b1031..d3442fe5298 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.cpp +++ b/source/gameengine/Converter/BL_SkinDeformer.cpp @@ -57,11 +57,12 @@ extern "C"{ #define __NLA_DEFNORMALS //#undef __NLA_DEFNORMALS -BL_SkinDeformer::BL_SkinDeformer(struct Object *bmeshobj, +BL_SkinDeformer::BL_SkinDeformer(BL_DeformableGameObject *gameobj, + struct Object *bmeshobj, class BL_SkinMeshObject *mesh, BL_ArmatureObject* arma) : // - BL_MeshDeformer(bmeshobj, mesh), + BL_MeshDeformer(gameobj, bmeshobj, mesh), m_armobj(arma), m_lastArmaUpdate(-1), m_defbase(&bmeshobj->defbase), @@ -71,12 +72,13 @@ BL_SkinDeformer::BL_SkinDeformer(struct Object *bmeshobj, }; BL_SkinDeformer::BL_SkinDeformer( + BL_DeformableGameObject *gameobj, struct Object *bmeshobj_old, // Blender object that owns the new mesh struct Object *bmeshobj_new, // Blender object that owns the original mesh class BL_SkinMeshObject *mesh, bool release_object, BL_ArmatureObject* arma) : - BL_MeshDeformer(bmeshobj_old, mesh), + BL_MeshDeformer(gameobj, bmeshobj_old, mesh), m_armobj(arma), m_lastArmaUpdate(-1), m_defbase(&bmeshobj_old->defbase), @@ -96,35 +98,32 @@ BL_SkinDeformer::~BL_SkinDeformer() m_armobj->Release(); } -bool BL_SkinDeformer::Apply(RAS_IPolyMaterial *mat) +bool BL_SkinDeformer::Apply(RAS_IPolyMaterial *) { - size_t i, j, index; - vecVertexArray array; - vecIndexArrays mvarray; - vecMDVertArray dvarray; - vecIndexArrays diarray; + size_t i, j; - RAS_TexVert *tv; - MT_Point3 pt; -// float co[3]; + if (!Update()) + // no need to update the cache + return false; - Update(); + // Update all materials at once, so we can do the above update test + // without ending up with some materials not updated + for(RAS_MaterialBucket::Set::iterator mit = m_pMeshObject->GetFirstMaterial(); + mit != m_pMeshObject->GetLastMaterial(); ++ mit) { + RAS_IPolyMaterial *mat = (*mit)->GetPolyMaterial(); - array = m_pMeshObject->GetVertexCache(mat); - mvarray = m_pMeshObject->GetMVertCache(mat); - diarray = m_pMeshObject->GetDIndexCache(mat); - // For each array - for (i=0; isize(); j++) { + vecVertexArray& vertexarrays = m_pMeshObject->GetVertexCache(mat); - tv = &((*array[i])[j]); - - index = ((*diarray[i])[j]); - - // Copy the untransformed data from the original mvert - // Set the data - tv->SetXYZ(m_transverts[((*mvarray[i])[index])]); + // For each array + for (i=0; im_MvertArrayCache1[vtxarray]->size(); - - /* Check to see if this has already been pushed */ - for (vector::iterator it = m_mvert_to_dvert_mapping[mv].begin(); - it != m_mvert_to_dvert_mapping[mv].end(); - it++) - { - if(it->mat == mat) - return it->index; - } - - ao->m_MvertArrayCache1[vtxarray]->push_back(mv); - ao->m_DvertArrayCache1[vtxarray]->push_back(dv); - - BL_MDVertMap mdmap; - mdmap.mat = mat; - mdmap.index = numvert; - m_mvert_to_dvert_mapping[mv].push_back(mdmap); - - return numvert; -}; - -int BL_SkinMeshObject::FindVertexArray(int numverts,RAS_IPolyMaterial* polymat) -{ - int array=-1; - - BL_SkinArrayOptimizer* ao = (BL_SkinArrayOptimizer*)GetArrayOptimizer(polymat); - - - for (size_t i=0;im_VertexArrayCache1.size();i++) - { - if ( (ao->m_TriangleArrayCount[i] + (numverts-2)) < BUCKET_MAX_TRIANGLES) - { - if((ao->m_VertexArrayCache1[i]->size()+numverts < BUCKET_MAX_INDICES)) - { - array = i; - ao->m_TriangleArrayCount[array]+=numverts-2; - break; - } - } - } - - - if (array == -1) - { - array = ao->m_VertexArrayCache1.size(); - - vector* va = new vector; - ao->m_VertexArrayCache1.push_back(va); - - KX_IndexArray *ia = new KX_IndexArray(); - ao->m_IndexArrayCache1.push_back(ia); - - KX_IndexArray *bva = new KX_IndexArray(); - ao->m_MvertArrayCache1.push_back(bva); - - BL_DeformVertArray *dva = new BL_DeformVertArray(); - ao->m_DvertArrayCache1.push_back(dva); - - KX_IndexArray *da = new KX_IndexArray(); - ao->m_DIndexArrayCache1.push_back(da); - - ao->m_TriangleArrayCount.push_back(numverts-2); - - } - - - return array; -} - - //void BL_SkinMeshObject::Bucketize(double* oglmatrix,void* clientobj,bool useObjectColor,const MT_Vector4& rgbavec,RAS_BucketManager* bucketmgr) void BL_SkinMeshObject::Bucketize(double* oglmatrix,void* clientobj,bool useObjectColor,const MT_Vector4& rgbavec) { diff --git a/source/gameengine/Converter/BL_SkinMeshObject.h b/source/gameengine/Converter/BL_SkinMeshObject.h index cc2b8de600e..c21fb64204b 100644 --- a/source/gameengine/Converter/BL_SkinMeshObject.h +++ b/source/gameengine/Converter/BL_SkinMeshObject.h @@ -44,78 +44,19 @@ #include "DNA_key_types.h" #include "DNA_meshdata_types.h" -typedef vector BL_MVertArray; -typedef vector BL_DeformVertArray; -typedef vector BL_VertexArray; - - -typedef vector*> vecMDVertArray; -typedef vector*> vecBVertexArray; - -class BL_SkinArrayOptimizer : public KX_ArrayOptimizer -{ -public: - BL_SkinArrayOptimizer(int index) - :KX_ArrayOptimizer (index) {}; - virtual ~BL_SkinArrayOptimizer(){ - - for (vector::iterator itv = m_MvertArrayCache1.begin(); - !(itv == m_MvertArrayCache1.end());itv++) - { - delete (*itv); - } - for (vector::iterator itd = m_DvertArrayCache1.begin(); - !(itd == m_DvertArrayCache1.end());itd++) - { - delete (*itd); - } - for (vector::iterator iti = m_DIndexArrayCache1.begin(); - !(iti == m_DIndexArrayCache1.end());iti++) - { - delete (*iti); - } - - m_MvertArrayCache1.clear(); - m_DvertArrayCache1.clear(); - m_DIndexArrayCache1.clear(); - }; - - vector m_MvertArrayCache1; - vector m_DvertArrayCache1; - vector m_DIndexArrayCache1; - -}; - class BL_SkinMeshObject : public RAS_MeshObject { // enum { BUCKET_MAX_INDICES = 16384};//2048};//8192}; // enum { BUCKET_MAX_TRIANGLES = 4096}; - KX_ArrayOptimizer* GetArrayOptimizer(RAS_IPolyMaterial* polymat) - { - KX_ArrayOptimizer** aop = (m_matVertexArrayS[*polymat]); - if (aop) - return *aop; - int numelements = m_matVertexArrayS.size(); - m_sortedMaterials.push_back(polymat); - - BL_SkinArrayOptimizer* ao = new BL_SkinArrayOptimizer(numelements); - m_matVertexArrayS.insert(*polymat,ao); - return ao; - } - protected: vector m_cacheWeightIndex; public: - struct BL_MDVertMap { RAS_IPolyMaterial *mat; int index; }; - vector > m_mvert_to_dvert_mapping; - void Bucketize(double* oglmatrix,void* clientobj,bool useObjectColor,const MT_Vector4& rgbavec); // void Bucketize(double* oglmatrix,void* clientobj,bool useObjectColor,const MT_Vector4& rgbavec,class RAS_BucketManager* bucketmgr); - int FindVertexArray(int numverts,RAS_IPolyMaterial* polymat); BL_SkinMeshObject(Mesh* mesh, int lightlayer) : RAS_MeshObject (mesh, lightlayer) { m_class = 1; @@ -144,42 +85,7 @@ public: } } }; - - const vecIndexArrays& GetDIndexCache (RAS_IPolyMaterial* mat) - { - BL_SkinArrayOptimizer* ao = (BL_SkinArrayOptimizer*)GetArrayOptimizer(mat);//*(m_matVertexArrays[*mat]); - return ao->m_DIndexArrayCache1; - } - const vecMDVertArray& GetDVertCache (RAS_IPolyMaterial* mat) - { - BL_SkinArrayOptimizer* ao = (BL_SkinArrayOptimizer*)GetArrayOptimizer(mat);//*(m_matVertexArrays[*mat]); - return ao->m_DvertArrayCache1; - } - const vecIndexArrays& GetMVertCache (RAS_IPolyMaterial* mat) - { - BL_SkinArrayOptimizer* ao = (BL_SkinArrayOptimizer*)GetArrayOptimizer(mat);//*(m_matVertexArrays[*mat]); - return ao->m_MvertArrayCache1; - } - void AddPolygon(RAS_Polygon* poly); - int FindOrAddDeform(unsigned int vtxarray, unsigned int mv, struct MDeformVert *dv, RAS_IPolyMaterial* mat); - int FindOrAddVertex(int vtxarray,const MT_Point3& xyz, - const MT_Point2& uv, - const MT_Point2& uv2, - const MT_Vector4& tangent, - const unsigned int rgbacolor, - const MT_Vector3& normal, int defnr, bool flat, RAS_IPolyMaterial* mat, int origindex) - { - BL_SkinArrayOptimizer* ao = (BL_SkinArrayOptimizer*)GetArrayOptimizer(mat); - int numverts = ao->m_VertexArrayCache1[vtxarray]->size(); - int index = RAS_MeshObject::FindOrAddVertex(vtxarray, xyz, uv, uv2, tangent, rgbacolor, normal, flat, mat, origindex); - - /* this means a new vertex was added, so we add the defnr too */ - if(index == numverts) - ao->m_DIndexArrayCache1[vtxarray]->push_back(defnr); - - return index; - } // for shape keys, void CheckWeightCache(struct Object* obj); diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index ea26c55a44e..1cc1b2e27a3 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -159,7 +159,7 @@ void BL_ConvertActuators(char* maggiename, bitLocalFlag.DRot = bool((obact->flag & ACT_DROT_LOCAL)!=0); bitLocalFlag.LinearVelocity = bool((obact->flag & ACT_LIN_VEL_LOCAL)!=0); bitLocalFlag.AngularVelocity = bool((obact->flag & ACT_ANG_VEL_LOCAL)!=0); - bitLocalFlag.ClampVelocity = bool((obact->flag & ACT_CLAMP_VEL)!=0); + bitLocalFlag.ServoControl = bool(obact->type == ACT_OBJECT_SERVO); bitLocalFlag.AddOrSetLinV = bool((obact->flag & ACT_ADD_LIN_VEL)!=0); @@ -193,6 +193,7 @@ void BL_ConvertActuators(char* maggiename, actact->type, // + 1, because Blender starts to count at zero, actact->blendin, actact->priority, + actact->end_reset, actact->stridelength // Ketsji at 1, because zero is reserved for "NoDef" ); @@ -233,7 +234,8 @@ void BL_ConvertActuators(char* maggiename, STR_String propname = ( ipoact->name ? ipoact->name : ""); // first bit? bool ipo_as_force = (ipoact->flag & ACT_IPOFORCE); - bool force_local = (ipoact->flag & ACT_IPOFORCE_LOCAL); + bool local = (ipoact->flag & ACT_IPOLOCAL); + bool ipo_add = (ipoact->flag & ACT_IPOADD); KX_IpoActuator* tmpbaseact = new KX_IpoActuator( gameobj, @@ -244,8 +246,8 @@ void BL_ConvertActuators(char* maggiename, ipoact->type + 1, // + 1, because Blender starts to count at zero, // Ketsji at 1, because zero is reserved for "NoDef" ipo_as_force, - force_local - ); + ipo_add, + local); baseact = tmpbaseact; break; } @@ -537,7 +539,7 @@ void BL_ConvertActuators(char* maggiename, // does the 'original' for replication exists, and // is it in a non-active layer ? - CValue* originalval = NULL; + SCA_IObject* originalval = NULL; if (editobact->ob && !(editobact->ob->lay & activeLayerBitInfo)) originalval = converter->FindGameObject(editobact->ob); @@ -619,51 +621,105 @@ void BL_ConvertActuators(char* maggiename, case ACT_CONSTRAINT: { float min = 0.0, max = 0.0; + char *prop = NULL; KX_ConstraintActuator::KX_CONSTRAINTTYPE locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_NODEF; bConstraintActuator *conact = (bConstraintActuator*) bact->data; /* convert settings... degrees in the ui become radians */ /* internally */ - switch (conact->flag) { - case ACT_CONST_LOCX: - locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCX; - min = conact->minloc[0]; - max = conact->maxloc[0]; - break; - case ACT_CONST_LOCY: - locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCY; - min = conact->minloc[1]; - max = conact->maxloc[1]; - break; - case ACT_CONST_LOCZ: - locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCZ; - min = conact->minloc[2]; - max = conact->maxloc[2]; - break; - case ACT_CONST_ROTX: - locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_ROTX; - min = MT_2_PI * conact->minrot[0] / 360.0; - max = MT_2_PI * conact->maxrot[0] / 360.0; - break; - case ACT_CONST_ROTY: - locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_ROTY; - min = MT_2_PI * conact->minrot[1] / 360.0; - max = MT_2_PI * conact->maxrot[1] / 360.0; - break; - case ACT_CONST_ROTZ: - locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_ROTZ; - min = MT_2_PI * conact->minrot[2] / 360.0; - max = MT_2_PI * conact->maxrot[2] / 360.0; - break; - default: - ; /* error */ + if (conact->type == ACT_CONST_TYPE_ORI) { + switch (conact->mode) { + case ACT_CONST_DIRPX: + locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_ORIX; + break; + case ACT_CONST_DIRPY: + locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_ORIY; + break; + case ACT_CONST_DIRPZ: + locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_ORIZ; + break; + } + } else if (conact->type == ACT_CONST_TYPE_DIST) { + switch (conact->mode) { + case ACT_CONST_DIRPX: + locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRPX; + min = conact->minloc[0]; + max = conact->maxloc[0]; + break; + case ACT_CONST_DIRPY: + locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRPY; + min = conact->minloc[1]; + max = conact->maxloc[1]; + break; + case ACT_CONST_DIRPZ: + locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRPZ; + min = conact->minloc[2]; + max = conact->maxloc[2]; + break; + case ACT_CONST_DIRMX: + locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRMX; + min = conact->minloc[0]; + max = conact->maxloc[0]; + break; + case ACT_CONST_DIRMY: + locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRMY; + min = conact->minloc[1]; + max = conact->maxloc[1]; + break; + case ACT_CONST_DIRMZ: + locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRMZ; + min = conact->minloc[2]; + max = conact->maxloc[2]; + break; + } + prop = conact->matprop; + } else { + switch (conact->flag) { + case ACT_CONST_LOCX: + locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCX; + min = conact->minloc[0]; + max = conact->maxloc[0]; + break; + case ACT_CONST_LOCY: + locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCY; + min = conact->minloc[1]; + max = conact->maxloc[1]; + break; + case ACT_CONST_LOCZ: + locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCZ; + min = conact->minloc[2]; + max = conact->maxloc[2]; + break; + case ACT_CONST_ROTX: + locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_ROTX; + min = MT_2_PI * conact->minrot[0] / 360.0; + max = MT_2_PI * conact->maxrot[0] / 360.0; + break; + case ACT_CONST_ROTY: + locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_ROTY; + min = MT_2_PI * conact->minrot[1] / 360.0; + max = MT_2_PI * conact->maxrot[1] / 360.0; + break; + case ACT_CONST_ROTZ: + locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_ROTZ; + min = MT_2_PI * conact->minrot[2] / 360.0; + max = MT_2_PI * conact->maxrot[2] / 360.0; + break; + default: + ; /* error */ + } } KX_ConstraintActuator *tmpconact = new KX_ConstraintActuator(gameobj, - conact->damp, - min, - max, - locrot); + conact->damp, + conact->rotdamp, + min, + max, + conact->maxrot, + locrot, + conact->time, + conact->flag, + prop); baseact = tmpconact; break; } @@ -944,7 +1000,7 @@ void BL_ConvertActuators(char* maggiename, } tmp = new SCA_2DFilterActuator(gameobj, filtermode, _2dfilter->flag, - _2dfilter->float_arg,_2dfilter->int_arg,_2dfilter->texture_flag,ketsjiEngine->GetRasterizer(),rendertools); + _2dfilter->float_arg,_2dfilter->int_arg,ketsjiEngine->GetRasterizer(),rendertools); if (_2dfilter->text) { diff --git a/source/gameengine/Converter/KX_ConvertSensors.cpp b/source/gameengine/Converter/KX_ConvertSensors.cpp index e7e4eeae7d2..7c9df688d45 100644 --- a/source/gameengine/Converter/KX_ConvertSensors.cpp +++ b/source/gameengine/Converter/KX_ConvertSensors.cpp @@ -64,6 +64,7 @@ probably misplaced */ #include "KX_MouseFocusSensor.h" #include "SCA_JoystickSensor.h" #include "KX_NetworkMessageSensor.h" +#include "SCA_ActuatorSensor.h" #include "SCA_PropertySensor.h" @@ -538,6 +539,19 @@ void BL_ConvertSensors(struct Object* blenderobject, break; } + case SENS_ACTUATOR: + { + bActuatorSensor* blenderactsensor = (bActuatorSensor*) sens->data; + // we will reuse the property event manager, there is nothing special with this sensor + SCA_EventManager* eventmgr + = logicmgr->FindEventManager(SCA_EventManager::ACTUATOR_EVENTMGR); + if (eventmgr) + { + STR_String propname=blenderactsensor->name; + gamesensor = new SCA_ActuatorSensor(eventmgr,gameobj,propname); + } + break; + } case SENS_RADAR: { diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index de89ed9b5c8..2bcb604dd23 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -76,18 +76,36 @@ static inline void Py_Fatal(char *M) { virtual PyTypeObject *GetType(void) {return &Type;}; \ virtual PyParentObject *GetParents(void) {return Parents;} + // This defines the _getattr_up macro // which allows attribute and method calls // to be properly passed up the hierarchy. #define _getattr_up(Parent) \ - PyObject *rvalue = Py_FindMethod(Methods, this, const_cast(attr.ReadPtr())); \ - if (rvalue == NULL) \ - { \ - PyErr_Clear(); \ - return Parent::_getattr(attr); \ + PyObject *rvalue = NULL; \ + if (attr=="__methods__") { \ + PyObject *_attr_string = NULL; \ + PyMethodDef *meth = Methods; \ + rvalue = Parent::_getattr(attr); \ + if (rvalue==NULL) { \ + PyErr_Clear(); \ + rvalue = PyList_New(0); \ } \ - else \ - return rvalue + if (meth) { \ + for (; meth->ml_name != NULL; meth++) { \ + _attr_string = PyString_FromString(meth->ml_name); \ + PyList_Append(rvalue, _attr_string); \ + Py_DECREF(_attr_string); \ + } \ + } \ + } else { \ + rvalue = Py_FindMethod(Methods, this, const_cast(attr.ReadPtr())); \ + if (rvalue == NULL) { \ + PyErr_Clear(); \ + rvalue = Parent::_getattr(attr); \ + } \ + } \ + return rvalue; \ + /** * These macros are helpfull when embedding Python routines. The second @@ -99,6 +117,18 @@ static inline void Py_Fatal(char *M) { return ((class_name*) self)->Py##method_name(self, args, kwds); \ }; \ +#define KX_PYMETHOD_NOARGS(class_name, method_name) \ + PyObject* Py##method_name(PyObject* self); \ + static PyObject* sPy##method_name( PyObject* self) { \ + return ((class_name*) self)->Py##method_name(self); \ + }; \ + +#define KX_PYMETHOD_O(class_name, method_name) \ + PyObject* Py##method_name(PyObject* self, PyObject* value); \ + static PyObject* sPy##method_name( PyObject* self, PyObject* value) { \ + return ((class_name*) self)->Py##method_name(self, value); \ + }; \ + #define KX_PYMETHOD_DOC(class_name, method_name) \ PyObject* Py##method_name(PyObject* self, PyObject* args, PyObject* kwds); \ static PyObject* sPy##method_name( PyObject* self, PyObject* args, PyObject* kwds) { \ @@ -106,6 +136,21 @@ static inline void Py_Fatal(char *M) { }; \ static char method_name##_doc[]; \ +#define KX_PYMETHOD_DOC_O(class_name, method_name) \ + PyObject* Py##method_name(PyObject* self, PyObject* value); \ + static PyObject* sPy##method_name( PyObject* self, PyObject* value) { \ + return ((class_name*) self)->Py##method_name(self, value); \ + }; \ + static char method_name##_doc[]; \ + +#define KX_PYMETHOD_DOC_NOARGS(class_name, method_name) \ + PyObject* Py##method_name(PyObject* self); \ + static PyObject* sPy##method_name( PyObject* self) { \ + return ((class_name*) self)->Py##method_name(self); \ + }; \ + static char method_name##_doc[]; \ + + /* The line above should remain empty */ /** * Method table macro (with doc) diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index f0195d5df82..48136eb9dc3 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -405,7 +405,20 @@ bool CValue::RemoveProperty(const STR_String & inName) return false; } - +// +// Get Property Names +// +vector CValue::GetPropertyNames() +{ + vector result; + if(!m_pNamedPropertyArray) return result; + for ( std::map::iterator it = m_pNamedPropertyArray->begin(); + !(it == m_pNamedPropertyArray->end());it++) + { + result.push_back((*it).first); + } + return result; +} // // Clear all properties diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index 561e5521d60..bcf231cf4f0 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -286,6 +286,7 @@ public: STR_String GetPropertyText(const STR_String & inName,const STR_String& deftext=""); // Get text description of property with name , returns an empty string if there is no property named float GetPropertyNumber(const STR_String& inName,float defnumber); virtual bool RemoveProperty(const STR_String & inName); // Remove the property named , returns true if the property was succesfully removed, false if property was not found or could not be removed + virtual vector GetPropertyNames(); virtual void ClearProperties(); // Clear all properties virtual void SetPropertiesModified(bool inModified); // Set all properties' modified flag to diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp index 56249bb52ec..96a770a553f 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp @@ -7,7 +7,6 @@ #endif #include - SCA_2DFilterActuator::~SCA_2DFilterActuator() { } @@ -18,7 +17,6 @@ SCA_2DFilterActuator::SCA_2DFilterActuator( short flag, float float_arg, int int_arg, - short texture_flag, RAS_IRasterizer* rasterizer, RAS_IRenderTools* rendertools, PyTypeObject* T) @@ -26,11 +24,15 @@ SCA_2DFilterActuator::SCA_2DFilterActuator( m_type(type), m_flag(flag), m_int_arg(int_arg), - m_texture_flag(texture_flag), m_float_arg(float_arg), m_rasterizer(rasterizer), m_rendertools(rendertools) { + m_gameObj = NULL; + if(gameobj){ + m_propNames = gameobj->GetPropertyNames(); + m_gameObj = gameobj; + } } void SCA_2DFilterActuator::SetShaderText(STR_String text) @@ -52,8 +54,6 @@ CValue* SCA_2DFilterActuator::GetReplica() bool SCA_2DFilterActuator::Update() { - bool result = false; - bool bNegativeEvent = IsNegativeEvent(); RemoveAllEvents(); @@ -74,7 +74,7 @@ bool SCA_2DFilterActuator::Update() } else if(m_type < RAS_2DFilterManager::RAS_2DFILTER_NUMBER_OF_FILTERS) { - m_rendertools->Update2DFilter(m_type, m_int_arg, m_shaderText, m_texture_flag); + m_rendertools->Update2DFilter(m_propNames, m_gameObj, m_type, m_int_arg, m_shaderText); } return true; } diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.h b/source/gameengine/GameLogic/SCA_2DFilterActuator.h index 451a7b9491a..7ec07cf5b19 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.h +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.h @@ -5,18 +5,17 @@ #include "RAS_IRenderTools.h" #include "SCA_IActuator.h" - class SCA_2DFilterActuator : public SCA_IActuator { Py_Header; private: - + vector m_propNames; + void * m_gameObj; RAS_2DFilterManager::RAS_2DFILTER_MODE m_type; short m_flag; float m_float_arg; int m_int_arg; - short m_texture_flag; STR_String m_shaderText; RAS_IRasterizer* m_rasterizer; RAS_IRenderTools* m_rendertools; @@ -29,7 +28,6 @@ public: short flag, float float_arg, int int_arg, - short texture_flag, RAS_IRasterizer* rasterizer, RAS_IRenderTools* rendertools, PyTypeObject* T=&Type diff --git a/source/gameengine/GameLogic/SCA_EventManager.cpp b/source/gameengine/GameLogic/SCA_EventManager.cpp index 1ca88182ddc..0169864a133 100644 --- a/source/gameengine/GameLogic/SCA_EventManager.cpp +++ b/source/gameengine/GameLogic/SCA_EventManager.cpp @@ -72,7 +72,9 @@ void SCA_EventManager::EndFrame() { } - +void SCA_EventManager::UpdateFrame() +{ +} int SCA_EventManager::GetType() { diff --git a/source/gameengine/GameLogic/SCA_EventManager.h b/source/gameengine/GameLogic/SCA_EventManager.h index 89731497f6f..9cc1718cd1e 100644 --- a/source/gameengine/GameLogic/SCA_EventManager.h +++ b/source/gameengine/GameLogic/SCA_EventManager.h @@ -49,7 +49,8 @@ public: RAY_EVENTMGR, RADAR_EVENTMGR, NETWORK_EVENTMGR, - JOY_EVENTMGR + JOY_EVENTMGR, + ACTUATOR_EVENTMGR }; SCA_EventManager(EVENT_MANAGER_TYPE mgrtype); @@ -58,6 +59,7 @@ public: virtual void RemoveSensor(class SCA_ISensor* sensor); virtual void NextFrame(double curtime, double fixedtime); virtual void NextFrame(); + virtual void UpdateFrame(); virtual void EndFrame(); virtual void RegisterSensor(class SCA_ISensor* sensor)=0; int GetType(); diff --git a/source/gameengine/GameLogic/SCA_IActuator.h b/source/gameengine/GameLogic/SCA_IActuator.h index 774b27c5ad4..7ffb21b5490 100644 --- a/source/gameengine/GameLogic/SCA_IActuator.h +++ b/source/gameengine/GameLogic/SCA_IActuator.h @@ -87,6 +87,7 @@ public: bool IsNegativeEvent() const; virtual ~SCA_IActuator(); + void ClrLink() { m_links=0; } void IncLink() { m_links++; } void DecLink(); bool IsNoLink() const { return !m_links; } diff --git a/source/gameengine/GameLogic/SCA_IController.cpp b/source/gameengine/GameLogic/SCA_IController.cpp index bbe5a51db3c..8f156cc63e7 100644 --- a/source/gameengine/GameLogic/SCA_IController.cpp +++ b/source/gameengine/GameLogic/SCA_IController.cpp @@ -133,11 +133,11 @@ void SCA_IController::UnlinkActuator(class SCA_IActuator* actua) } if (!(actit==m_linkedactuators.end())) { - m_linkedactuators.erase(actit); if (IsActive()) { (*actit)->DecLink(); } + m_linkedactuators.erase(actit); } } @@ -163,11 +163,11 @@ void SCA_IController::UnlinkSensor(class SCA_ISensor* sensor) } if (!(sensit==m_linkedsensors.end())) { - m_linkedsensors.erase(sensit); if (IsActive()) { (*sensit)->DecLink(); } + m_linkedsensors.erase(sensit); } } diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp index 8423d06dfcd..f6efd485adb 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp @@ -242,8 +242,8 @@ PyParentObject SCA_ILogicBrick::Parents[] = { PyMethodDef SCA_ILogicBrick::Methods[] = { - {"getOwner", (PyCFunction) SCA_ILogicBrick::sPyGetOwner, METH_VARARGS}, - {"getExecutePriority", (PyCFunction) SCA_ILogicBrick::sPySetExecutePriority, METH_VARARGS}, + {"getOwner", (PyCFunction) SCA_ILogicBrick::sPyGetOwner, METH_NOARGS}, + {"getExecutePriority", (PyCFunction) SCA_ILogicBrick::sPySetExecutePriority, METH_NOARGS}, {"setExecutePriority", (PyCFunction) SCA_ILogicBrick::sPySetExecutePriority, METH_VARARGS}, {NULL,NULL} //Sentinel }; @@ -258,9 +258,7 @@ SCA_ILogicBrick::_getattr(const STR_String& attr) -PyObject* SCA_ILogicBrick::PyGetOwner(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* SCA_ILogicBrick::PyGetOwner(PyObject* self) { CValue* parent = GetParent(); if (parent) @@ -294,9 +292,7 @@ PyObject* SCA_ILogicBrick::PySetExecutePriority(PyObject* self, -PyObject* SCA_ILogicBrick::PyGetExecutePriority(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* SCA_ILogicBrick::PyGetExecutePriority(PyObject* self) { return PyInt_FromLong(m_Execute_Ueber_Priority); } diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.h b/source/gameengine/GameLogic/SCA_ILogicBrick.h index f359ee0911b..80bc6ae3b86 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.h +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.h @@ -82,9 +82,9 @@ public: // python methods - KX_PYMETHOD(SCA_ILogicBrick,GetOwner); + KX_PYMETHOD_NOARGS(SCA_ILogicBrick,GetOwner); KX_PYMETHOD(SCA_ILogicBrick,SetExecutePriority); - KX_PYMETHOD(SCA_ILogicBrick,GetExecutePriority); + KX_PYMETHOD_NOARGS(SCA_ILogicBrick,GetExecutePriority); enum KX_BOOL_TYPE { KX_BOOL_NODEF = 0, diff --git a/source/gameengine/GameLogic/SCA_IObject.cpp b/source/gameengine/GameLogic/SCA_IObject.cpp index 826e7bbdf0e..c5bb4a41552 100644 --- a/source/gameengine/GameLogic/SCA_IObject.cpp +++ b/source/gameengine/GameLogic/SCA_IObject.cpp @@ -40,7 +40,7 @@ MT_Point3 SCA_IObject::m_sDummy=MT_Point3(0,0,0); -SCA_IObject::SCA_IObject(PyTypeObject* T): m_state(0), CValue(T) +SCA_IObject::SCA_IObject(PyTypeObject* T): m_initState(0), m_state(0), CValue(T) { m_suspended = false; } @@ -157,15 +157,17 @@ bool SCA_IObject::GetIgnoreActivityCulling() void SCA_IObject::ReParentLogic() { - SCA_SensorList& oldsensors = GetSensors(); - - int sen = 0; - SCA_SensorList::iterator its; - for (its = oldsensors.begin(); !(its==oldsensors.end()); ++its) + SCA_ActuatorList& oldactuators = GetActuators(); + int act = 0; + SCA_ActuatorList::iterator ita; + for (ita = oldactuators.begin(); !(ita==oldactuators.end()); ++ita) { - SCA_ISensor* newsensor = (SCA_ISensor*)(*its)->GetReplica(); - newsensor->ReParent(this); - oldsensors[sen++] = newsensor; + SCA_IActuator* newactuator = (SCA_IActuator*) (*ita)->GetReplica(); + newactuator->ReParent(this); + // actuators are initially not connected to any controller + newactuator->SetActive(false); + newactuator->ClrLink(); + oldactuators[act++] = newactuator; } SCA_ControllerList& oldcontrollers = GetControllers(); @@ -175,20 +177,24 @@ void SCA_IObject::ReParentLogic() { SCA_IController* newcontroller = (SCA_IController*)(*itc)->GetReplica(); newcontroller->ReParent(this); + newcontroller->SetActive(false); oldcontrollers[con++]=newcontroller; } - SCA_ActuatorList& oldactuators = GetActuators(); - - int act = 0; - SCA_ActuatorList::iterator ita; - for (ita = oldactuators.begin(); !(ita==oldactuators.end()); ++ita) + // convert sensors last so that actuators are already available for Actuator sensor + SCA_SensorList& oldsensors = GetSensors(); + int sen = 0; + SCA_SensorList::iterator its; + for (its = oldsensors.begin(); !(its==oldsensors.end()); ++its) { - SCA_IActuator* newactuator = (SCA_IActuator*) (*ita)->GetReplica(); - newactuator->ReParent(this); - newactuator->SetActive(false); - oldactuators[act++] = newactuator; + SCA_ISensor* newsensor = (SCA_ISensor*)(*its)->GetReplica(); + newsensor->ReParent(this); + newsensor->SetActive(false); + // sensors are initially not connected to any controller + newsensor->ClrLink(); + oldsensors[sen++] = newsensor; } + // a new object cannot be client of any actuator m_registeredActuators.clear(); diff --git a/source/gameengine/GameLogic/SCA_IObject.h b/source/gameengine/GameLogic/SCA_IObject.h index 07b4310a91e..38a7ed29dca 100644 --- a/source/gameengine/GameLogic/SCA_IObject.h +++ b/source/gameengine/GameLogic/SCA_IObject.h @@ -68,6 +68,11 @@ protected: */ bool m_suspended; + /** + * init state of object (used when object is created) + */ + unsigned int m_initState; + /** * current state = bit mask of state that are active */ @@ -117,6 +122,16 @@ public: */ void Resume(void); + /** + * Set init state + */ + void SetInitState(unsigned int initState) { m_initState = initState; } + + /** + * initialize the state when object is created + */ + void ResetState(void) { SetState(m_initState); } + /** * Set the object state */ diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp index 6cfae9d8919..68341b57435 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.cpp +++ b/source/gameengine/GameLogic/SCA_ISensor.cpp @@ -56,6 +56,7 @@ SCA_ISensor::SCA_ISensor(SCA_IObject* gameobj, m_suspended = false; m_invert = false; m_level = false; + m_reset = false; m_pos_ticks = 0; m_neg_ticks = 0; m_pos_pulsemode = false; @@ -118,7 +119,7 @@ void SCA_ISensor::Resume() { } void SCA_ISensor::Init() { - printf("Sensor %s has no init function, please report this bug to Blender.org\n", m_name); + printf("Sensor %s has no init function, please report this bug to Blender.org\n", m_name.Ptr()); } void SCA_ISensor::DecLink() { diff --git a/source/gameengine/GameLogic/SCA_ISensor.h b/source/gameengine/GameLogic/SCA_ISensor.h index 3527b87ebdb..4ce49e71507 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.h +++ b/source/gameengine/GameLogic/SCA_ISensor.h @@ -64,6 +64,9 @@ class SCA_ISensor : public SCA_ILogicBrick /** detect level instead of edge*/ bool m_level; + /** sensor has been reset */ + bool m_reset; + /** Sensor must ignore updates? */ bool m_suspended; @@ -123,6 +126,8 @@ public: /** Resume sensing. */ void Resume(); + void ClrLink() + { m_links = 0; } void IncLink() { m_links++; } void DecLink(); diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp index 8668c22f044..3fb439eb25b 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp @@ -70,6 +70,7 @@ std::cout << " hat flag " << m_hatf << std::endl; void SCA_JoystickSensor::Init() { m_istrig=(m_invert)?1:0; + m_reset = true; } SCA_JoystickSensor::~SCA_JoystickSensor() @@ -79,9 +80,10 @@ SCA_JoystickSensor::~SCA_JoystickSensor() CValue* SCA_JoystickSensor::GetReplica() { - CValue* replica = new SCA_JoystickSensor(*this); + SCA_JoystickSensor* replica = new SCA_JoystickSensor(*this); // this will copy properties and so on... CValue::AddDataToReplica(replica); + replica->Init(); return replica; } @@ -99,7 +101,9 @@ bool SCA_JoystickSensor::Evaluate(CValue* event) { SCA_Joystick *js = m_pJoystickMgr->GetJoystickDevice(); bool result = false; + bool reset = m_reset && m_level; + m_reset = false; switch(m_joymode) { case KX_JOYSENSORMODE_AXIS: @@ -240,6 +244,8 @@ bool SCA_JoystickSensor::Evaluate(CValue* event) if(!js->IsTrig()){ m_istrig = 0; } + if (reset) + result = true; return result; } diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index 43ce25f94df..a7a6fa93db4 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -78,14 +78,15 @@ void SCA_KeyboardSensor::Init() // However, if the target key is pressed when the sensor is reactivated, it // will not generated an event (see remark in Evaluate()). m_val = (m_invert)?1:0; + m_reset = true; } CValue* SCA_KeyboardSensor::GetReplica() { - CValue* replica = new SCA_KeyboardSensor(*this); + SCA_KeyboardSensor* replica = new SCA_KeyboardSensor(*this); // this will copy properties and so on... CValue::AddDataToReplica(replica); - + replica->Init(); return replica; } @@ -120,8 +121,8 @@ bool SCA_KeyboardSensor::TriggerOnAllKeys() bool SCA_KeyboardSensor::Evaluate(CValue* eventval) { bool result = false; + bool reset = m_reset && m_level; SCA_IInputDevice* inputdev = m_pKeyboardMgr->GetInputDevice(); - // cerr << "SCA_KeyboardSensor::Eval event, sensing for "<< m_hotkey << " at device " << inputdev << "\n"; /* See if we need to do logging: togPropState exists and is @@ -134,7 +135,7 @@ bool SCA_KeyboardSensor::Evaluate(CValue* eventval) LogKeystrokes(); } - + m_reset = false; /* Now see whether events must be bounced. */ if (m_bAllKeys) @@ -176,8 +177,8 @@ bool SCA_KeyboardSensor::Evaluate(CValue* eventval) { if (m_val == 0) { + m_val = 1; if (m_level) { - m_val = 1; result = true; } } @@ -229,9 +230,9 @@ bool SCA_KeyboardSensor::Evaluate(CValue* eventval) { if (m_val == 0) { + m_val = 1; if (m_level) { - m_val = 1; result = true; } } @@ -240,7 +241,9 @@ bool SCA_KeyboardSensor::Evaluate(CValue* eventval) } } } - + if (reset) + // force an event + result = true; return result; } diff --git a/source/gameengine/GameLogic/SCA_LogicManager.cpp b/source/gameengine/GameLogic/SCA_LogicManager.cpp index fb1a2c29eb6..f50161cbecb 100644 --- a/source/gameengine/GameLogic/SCA_LogicManager.cpp +++ b/source/gameengine/GameLogic/SCA_LogicManager.cpp @@ -271,6 +271,10 @@ void SCA_LogicManager::UpdateFrame(double curtime, bool frame) } m_removedActuators.clear(); + // About to run actuators, but before update the sensors for those which depends on actuators + for (vector::const_iterator ie=m_eventmanagers.begin(); !(ie==m_eventmanagers.end()); ie++) + (*ie)->UpdateFrame(); + for (set::iterator ia = m_activeActuators.begin();!(ia==m_activeActuators.end());ia++) { //SCA_IActuator* actua = *ia; diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.cpp b/source/gameengine/GameLogic/SCA_MouseSensor.cpp index 42d35837489..2298ddb0743 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.cpp +++ b/source/gameengine/GameLogic/SCA_MouseSensor.cpp @@ -84,6 +84,7 @@ SCA_MouseSensor::SCA_MouseSensor(SCA_MouseManager* eventmgr, void SCA_MouseSensor::Init() { m_val = (m_invert)?1:0; /* stores the latest attribute */ + m_reset = true; } SCA_MouseSensor::~SCA_MouseSensor() @@ -95,9 +96,10 @@ SCA_MouseSensor::~SCA_MouseSensor() CValue* SCA_MouseSensor::GetReplica() { - CValue* replica = new SCA_MouseSensor(*this); + SCA_MouseSensor* replica = new SCA_MouseSensor(*this); // this will copy properties and so on... CValue::AddDataToReplica(replica); + replica->Init(); return replica; } @@ -132,6 +134,7 @@ SCA_IInputDevice::KX_EnumInputs SCA_MouseSensor::GetHotKey() bool SCA_MouseSensor::Evaluate(CValue* event) { bool result = false; + bool reset = m_reset && m_level; SCA_IInputDevice* mousedev = m_pMouseMgr->GetInputDevice(); @@ -143,7 +146,7 @@ bool SCA_MouseSensor::Evaluate(CValue* event) /* both MOUSEX and MOUSEY. Treat all of these as key-presses. */ /* So, treat KX_MOUSESENSORMODE_POSITION as */ /* KX_MOUSESENSORMODE_POSITIONX || KX_MOUSESENSORMODE_POSITIONY */ - + m_reset = false; switch (m_mousemode) { case KX_MOUSESENSORMODE_LEFTBUTTON: case KX_MOUSESENSORMODE_MIDDLEBUTTON: @@ -168,9 +171,9 @@ bool SCA_MouseSensor::Evaluate(CValue* event) { if (m_val == 0) { + m_val = 1; if (m_level) { - m_val = 1; result = true; } } @@ -222,6 +225,9 @@ bool SCA_MouseSensor::Evaluate(CValue* event) ; /* error */ } + if (reset) + // force an event + result = true; return result; } diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.cpp b/source/gameengine/GameLogic/SCA_PropertySensor.cpp index 655e9060238..c50c011cc63 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.cpp +++ b/source/gameengine/GameLogic/SCA_PropertySensor.cpp @@ -78,6 +78,7 @@ void SCA_PropertySensor::Init() { m_recentresult = false; m_lastresult = m_invert?true:false; + m_reset = true; } void SCA_PropertySensor::PrecalculateRangeExpression() @@ -111,6 +112,7 @@ CValue* SCA_PropertySensor::GetReplica() SCA_PropertySensor* replica = new SCA_PropertySensor(*this); // m_range_expr must be recalculated on replica! CValue::AddDataToReplica(replica); + replica->Init(); replica->m_range_expr = NULL; if (replica->m_checktype==KX_PROPSENSOR_INTERVAL) @@ -153,14 +155,15 @@ SCA_PropertySensor::~SCA_PropertySensor() bool SCA_PropertySensor::Evaluate(CValue* event) { bool result = CheckPropertyCondition(); + bool reset = m_reset && m_level; + m_reset = false; if (m_lastresult!=result) { m_lastresult = result; return true; } - - return false; + return (reset) ? true : false; } diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index be00117cd21..76386079bdf 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -144,9 +144,7 @@ static char* sPyGetCurrentController__doc__; #endif -PyObject* SCA_PythonController::sPyGetCurrentController(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* SCA_PythonController::sPyGetCurrentController(PyObject* self) { m_sCurrentController->AddRef(); return m_sCurrentController; @@ -159,8 +157,7 @@ static char* sPyAddActiveActuator__doc__; PyObject* SCA_PythonController::sPyAddActiveActuator( PyObject* self, - PyObject* args, - PyObject* kwds) + PyObject* args) { PyObject* ob1; @@ -187,8 +184,7 @@ PyObject* SCA_PythonController::sPyAddActiveActuator( m_sCurrentLogicManager->AddActiveActuator((SCA_IActuator*)act,boolval); boolval->Release(); } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } @@ -222,17 +218,13 @@ PyParentObject SCA_PythonController::Parents[] = { NULL }; PyMethodDef SCA_PythonController::Methods[] = { - {"getActuators", (PyCFunction) SCA_PythonController::sPyGetActuators, - METH_VARARGS, SCA_PythonController::GetActuators_doc}, - {"getActuator", (PyCFunction) SCA_PythonController::sPyGetActuator, - METH_VARARGS, SCA_PythonController::GetActuator_doc}, - {"getSensors", (PyCFunction) SCA_PythonController::sPyGetSensors, - METH_VARARGS, SCA_PythonController::GetSensors_doc}, - {"getSensor", (PyCFunction) SCA_PythonController::sPyGetSensor, - METH_VARARGS, SCA_PythonController::GetSensor_doc}, - {"getScript", (PyCFunction) SCA_PythonController::sPyGetScript, METH_VARARGS}, - {"setScript", (PyCFunction) SCA_PythonController::sPySetScript, METH_VARARGS}, - {"getState", (PyCFunction) SCA_PythonController::sPyGetState, METH_VARARGS}, + {"getActuators", (PyCFunction) SCA_PythonController::sPyGetActuators, METH_NOARGS, SCA_PythonController::GetActuators_doc}, + {"getActuator", (PyCFunction) SCA_PythonController::sPyGetActuator, METH_O, SCA_PythonController::GetActuator_doc}, + {"getSensors", (PyCFunction) SCA_PythonController::sPyGetSensors, METH_NOARGS, SCA_PythonController::GetSensors_doc}, + {"getSensor", (PyCFunction) SCA_PythonController::sPyGetSensor, METH_O, SCA_PythonController::GetSensor_doc}, + {"getScript", (PyCFunction) SCA_PythonController::sPyGetScript, METH_NOARGS}, + {"setScript", (PyCFunction) SCA_PythonController::sPySetScript, METH_O}, + {"getState", (PyCFunction) SCA_PythonController::sPyGetState, METH_NOARGS}, {NULL,NULL} //Sentinel }; @@ -330,14 +322,12 @@ PyObject* SCA_PythonController::_getattr(const STR_String& attr) -PyObject* SCA_PythonController::PyGetActuators(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* SCA_PythonController::PyGetActuators(PyObject* self) { PyObject* resultlist = PyList_New(m_linkedactuators.size()); for (unsigned int index=0;indexAddRef()); + PyList_SET_ITEM(resultlist,index,m_linkedactuators[index]->AddRef()); } return resultlist; @@ -346,14 +336,12 @@ PyObject* SCA_PythonController::PyGetActuators(PyObject* self, char SCA_PythonController::GetSensor_doc[] = "GetSensor (char sensorname) return linked sensor that is named [sensorname]\n"; PyObject* -SCA_PythonController::PyGetSensor(PyObject* self, - PyObject* args, - PyObject* kwds) +SCA_PythonController::PyGetSensor(PyObject* self, PyObject* value) { - char *scriptArg; - - if (!PyArg_ParseTuple(args, "s", &scriptArg)) { + char *scriptArg = PyString_AsString(value); + if (scriptArg==NULL) { + PyErr_SetString(PyExc_TypeError, "expected a string (sensor name)"); return NULL; } @@ -376,14 +364,12 @@ SCA_PythonController::PyGetSensor(PyObject* self, char SCA_PythonController::GetActuator_doc[] = "GetActuator (char sensorname) return linked actuator that is named [actuatorname]\n"; PyObject* -SCA_PythonController::PyGetActuator(PyObject* self, - PyObject* args, - PyObject* kwds) +SCA_PythonController::PyGetActuator(PyObject* self, PyObject* value) { - char *scriptArg; - - if (!PyArg_ParseTuple(args, "s", &scriptArg)) { + char *scriptArg = PyString_AsString(value); + if (scriptArg==NULL) { + PyErr_SetString(PyExc_TypeError, "expected a string (actuator name)"); return NULL; } @@ -404,34 +390,29 @@ SCA_PythonController::PyGetActuator(PyObject* self, char SCA_PythonController::GetSensors_doc[] = "getSensors returns a list of all attached sensors"; PyObject* -SCA_PythonController::PyGetSensors(PyObject* self, - PyObject* args, - PyObject* kwds) +SCA_PythonController::PyGetSensors(PyObject* self) { PyObject* resultlist = PyList_New(m_linkedsensors.size()); for (unsigned int index=0;indexAddRef()); + PyList_SET_ITEM(resultlist,index,m_linkedsensors[index]->AddRef()); } return resultlist; } /* 1. getScript */ -PyObject* SCA_PythonController::PyGetScript(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* SCA_PythonController::PyGetScript(PyObject* self) { return PyString_FromString(m_scriptText); } /* 2. setScript */ -PyObject* SCA_PythonController::PySetScript(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* SCA_PythonController::PySetScript(PyObject* self, PyObject* value) { - char *scriptArg; - if (!PyArg_ParseTuple(args, "s", &scriptArg)) { + char *scriptArg = PyString_AsString(value); + if (scriptArg==NULL) { + PyErr_SetString(PyExc_TypeError, "expected a string (script name)"); return NULL; } @@ -440,13 +421,11 @@ PyObject* SCA_PythonController::PySetScript(PyObject* self, this->SetScriptText(scriptArg); - Py_Return; + Py_RETURN_NONE; } /* 1. getScript */ -PyObject* SCA_PythonController::PyGetState(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* SCA_PythonController::PyGetState(PyObject* self) { return PyInt_FromLong(m_statemask); } diff --git a/source/gameengine/GameLogic/SCA_PythonController.h b/source/gameengine/GameLogic/SCA_PythonController.h index f3af54f402f..39b6c68c359 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.h +++ b/source/gameengine/GameLogic/SCA_PythonController.h @@ -66,22 +66,19 @@ class SCA_PythonController : public SCA_IController void SetDictionary(PyObject* pythondictionary); static char* sPyGetCurrentController__doc__; - static PyObject* sPyGetCurrentController(PyObject* self, - PyObject* args, - PyObject* kwds); + static PyObject* sPyGetCurrentController(PyObject* self); static char* sPyAddActiveActuator__doc__; static PyObject* sPyAddActiveActuator(PyObject* self, - PyObject* args, - PyObject* kwds); + PyObject* args); virtual PyObject* _getattr(const STR_String& attr); - KX_PYMETHOD_DOC(SCA_PythonController,GetSensors); - KX_PYMETHOD_DOC(SCA_PythonController,GetSensor); - KX_PYMETHOD_DOC(SCA_PythonController,GetActuator); - KX_PYMETHOD_DOC(SCA_PythonController,GetActuators); - KX_PYMETHOD(SCA_PythonController,SetScript); - KX_PYMETHOD(SCA_PythonController,GetScript); - KX_PYMETHOD(SCA_PythonController,GetState); + KX_PYMETHOD_DOC_NOARGS(SCA_PythonController,GetSensors); + KX_PYMETHOD_DOC_NOARGS(SCA_PythonController,GetActuators); + KX_PYMETHOD_DOC_O(SCA_PythonController,GetSensor); + KX_PYMETHOD_DOC_O(SCA_PythonController,GetActuator); + KX_PYMETHOD_O(SCA_PythonController,SetScript); + KX_PYMETHOD_NOARGS(SCA_PythonController,GetScript); + KX_PYMETHOD_NOARGS(SCA_PythonController,GetState); }; diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp index a5017574873..8b828393c67 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp @@ -602,9 +602,9 @@ void GPC_RenderTools::MotionBlur(RAS_IRasterizer* rasterizer) } } -void GPC_RenderTools::Update2DFilter(RAS_2DFilterManager::RAS_2DFILTER_MODE filtermode, int pass, STR_String& text, short texture_flag) +void GPC_RenderTools::Update2DFilter(vector& propNames, void* gameObj, RAS_2DFilterManager::RAS_2DFILTER_MODE filtermode, int pass, STR_String& text) { - m_filtermanager.EnableFilter(filtermode, pass, text, texture_flag); + m_filtermanager.EnableFilter(propNames, gameObj, filtermode, pass, text); } void GPC_RenderTools::Render2DFilters(RAS_ICanvas* canvas) diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.h b/source/gameengine/GamePlayer/common/GPC_RenderTools.h index cb7193f3513..8fae3d2b305 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.h +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.h @@ -142,7 +142,7 @@ public: virtual void MotionBlur(RAS_IRasterizer* rasterizer); - virtual void Update2DFilter(RAS_2DFilterManager::RAS_2DFILTER_MODE filtermode, int pass, STR_String& text, short texture_flag); + virtual void Update2DFilter(vector& propNames, void* gameObj, RAS_2DFilterManager::RAS_2DFILTER_MODE filtermode, int pass, STR_String& text); virtual void Render2DFilters(RAS_ICanvas* canvas); diff --git a/source/gameengine/Ketsji/BL_BlenderShader.cpp b/source/gameengine/Ketsji/BL_BlenderShader.cpp index 06e012123b1..dd45d522b9f 100644 --- a/source/gameengine/Ketsji/BL_BlenderShader.cpp +++ b/source/gameengine/Ketsji/BL_BlenderShader.cpp @@ -1,9 +1,11 @@ #include "DNA_customdata_types.h" +#include "DNA_material_types.h" #include "BL_BlenderShader.h" +#include "BL_Material.h" -#if 0 +#ifdef BLENDER_GLSL #include "GPU_extensions.h" #include "GPU_material.h" #endif @@ -13,29 +15,32 @@ const bool BL_BlenderShader::Ok()const { -#if 0 +#ifdef BLENDER_GLSL return (mGPUMat != 0); +#else + return 0; #endif - - return false; } -BL_BlenderShader::BL_BlenderShader(struct Material *ma) +BL_BlenderShader::BL_BlenderShader(struct Material *ma, int lightlayer) : -#if 0 +#ifdef BLENDER_GLSL mGPUMat(0), #endif - mBound(false) + mBound(false), + mLightLayer(lightlayer) { -#if 0 - if(ma) - mGPUMat = GPU_material_from_blender(ma, GPU_PROFILE_DERIVEDMESH); +#ifdef BLENDER_GLSL + if(ma) { + GPU_material_from_blender(ma); + mGPUMat = ma->gpumaterial; + } #endif } BL_BlenderShader::~BL_BlenderShader() { -#if 0 +#ifdef BLENDER_GLSL if(mGPUMat) { GPU_material_unbind(mGPUMat); mGPUMat = 0; @@ -43,16 +48,12 @@ BL_BlenderShader::~BL_BlenderShader() #endif } -void BL_BlenderShader::ApplyShader() -{ -} - void BL_BlenderShader::SetProg(bool enable) { -#if 0 +#ifdef BLENDER_GLSL if(mGPUMat) { if(enable) { - GPU_material_bind(mGPUMat); + GPU_material_bind(mGPUMat, mLightLayer); mBound = true; } else { @@ -65,7 +66,7 @@ void BL_BlenderShader::SetProg(bool enable) int BL_BlenderShader::GetAttribNum() { -#if 0 +#ifdef BLENDER_GLSL GPUVertexAttribs attribs; int i, enabled = 0; @@ -82,17 +83,19 @@ int BL_BlenderShader::GetAttribNum() enabled = BL_MAX_ATTRIB; return enabled; -#endif - +#else return 0; +#endif } -void BL_BlenderShader::SetTexCoords(RAS_IRasterizer* ras) +void BL_BlenderShader::SetAttribs(RAS_IRasterizer* ras, const BL_Material *mat) { -#if 0 +#ifdef BLENDER_GLSL GPUVertexAttribs attribs; int i, attrib_num; + ras->SetAttribNum(0); + if(!mGPUMat) return; @@ -109,14 +112,24 @@ void BL_BlenderShader::SetTexCoords(RAS_IRasterizer* ras) if(attribs.layer[i].glindex > attrib_num) continue; - if(attribs.layer[i].type == CD_MTFACE) - ras->SetAttrib(RAS_IRasterizer::RAS_TEXCO_UV1, attribs.layer[i].glindex); + if(attribs.layer[i].type == CD_MTFACE) { + if(!mat->uvName.IsEmpty() && strcmp(mat->uvName.ReadPtr(), attribs.layer[i].name) == 0) + ras->SetAttrib(RAS_IRasterizer::RAS_TEXCO_UV1, attribs.layer[i].glindex); + else if(!mat->uv2Name.IsEmpty() && strcmp(mat->uv2Name.ReadPtr(), attribs.layer[i].name) == 0) + ras->SetAttrib(RAS_IRasterizer::RAS_TEXCO_UV2, attribs.layer[i].glindex); + else + ras->SetAttrib(RAS_IRasterizer::RAS_TEXCO_UV1, attribs.layer[i].glindex); + } else if(attribs.layer[i].type == CD_TANGENT) ras->SetAttrib(RAS_IRasterizer::RAS_TEXTANGENT, attribs.layer[i].glindex); else if(attribs.layer[i].type == CD_ORCO) ras->SetAttrib(RAS_IRasterizer::RAS_TEXCO_ORCO, attribs.layer[i].glindex); else if(attribs.layer[i].type == CD_NORMAL) ras->SetAttrib(RAS_IRasterizer::RAS_TEXCO_NORM, attribs.layer[i].glindex); + else if(attribs.layer[i].type == CD_MCOL) + ras->SetAttrib(RAS_IRasterizer::RAS_TEXCO_VCOL, attribs.layer[i].glindex); + else + ras->SetAttrib(RAS_IRasterizer::RAS_TEXCO_DISABLE, attribs.layer[i].glindex); } ras->EnableTextures(true); @@ -128,8 +141,8 @@ void BL_BlenderShader::SetTexCoords(RAS_IRasterizer* ras) void BL_BlenderShader::Update( const KX_MeshSlot & ms, RAS_IRasterizer* rasty ) { -#if 0 - float obmat[4][4], viewmat[4][4]; +#ifdef BLENDER_GLSL + float obmat[4][4], viewmat[4][4], viewinvmat[4][4]; if(!mGPUMat || !mBound) return; @@ -142,7 +155,20 @@ void BL_BlenderShader::Update( const KX_MeshSlot & ms, RAS_IRasterizer* rasty ) model.getValue((float*)obmat); view.getValue((float*)viewmat); - GPU_material_bind_uniforms(mGPUMat, obmat, viewmat); + view.invert(); + view.getValue((float*)viewinvmat); + + GPU_material_bind_uniforms(mGPUMat, obmat, viewmat, viewinvmat); +#endif +} + +bool BL_BlenderShader::Equals(BL_BlenderShader *blshader) +{ +#ifdef BLENDER_GLSL + /* to avoid unneeded state switches */ + return (blshader && mGPUMat == blshader->mGPUMat && mLightLayer == blshader->mLightLayer); +#else + return true; #endif } diff --git a/source/gameengine/Ketsji/BL_BlenderShader.h b/source/gameengine/Ketsji/BL_BlenderShader.h index 4cab0e644c3..b758d1a9cba 100644 --- a/source/gameengine/Ketsji/BL_BlenderShader.h +++ b/source/gameengine/Ketsji/BL_BlenderShader.h @@ -2,7 +2,7 @@ #ifndef __BL_GPUSHADER_H__ #define __BL_GPUSHADER_H__ -#if 0 +#ifdef BLENDER_GLSL #include "GPU_material.h" #endif @@ -12,7 +12,10 @@ #include "MT_Tuple3.h" #include "MT_Tuple4.h" +#include "RAS_IPolygonMaterial.h" + struct Material; +class BL_Material; #define BL_MAX_ATTRIB 16 @@ -23,22 +26,24 @@ struct Material; class BL_BlenderShader { private: -#if 0 +#ifdef BLENDER_GLSL GPUMaterial *mGPUMat; #endif bool mBound; + int mLightLayer; public: - BL_BlenderShader(struct Material *ma); + BL_BlenderShader(struct Material *ma, int lightlayer); virtual ~BL_BlenderShader(); const bool Ok()const; void SetProg(bool enable); - void ApplyShader(); - void SetTexCoords(class RAS_IRasterizer* ras); int GetAttribNum(); + void SetAttribs(class RAS_IRasterizer* ras, const BL_Material *mat); void Update(const class KX_MeshSlot & ms, class RAS_IRasterizer* rasty); + + bool Equals(BL_BlenderShader *blshader); }; #endif//__BL_GPUSHADER_H__ diff --git a/source/gameengine/Ketsji/BL_Material.cpp b/source/gameengine/Ketsji/BL_Material.cpp index f5312ccd023..7e3d6984f19 100644 --- a/source/gameengine/Ketsji/BL_Material.cpp +++ b/source/gameengine/Ketsji/BL_Material.cpp @@ -105,7 +105,8 @@ void BL_Material::GetConversionRGB(unsigned int *nrgb) { *nrgb = rgb[3]; } -void BL_Material::SetConversionUV(MT_Point2 *nuv) { +void BL_Material::SetConversionUV(const STR_String& name, MT_Point2 *nuv) { + uvName = name; uv[0] = *nuv++; uv[1] = *nuv++; uv[2] = *nuv++; @@ -118,7 +119,8 @@ void BL_Material::GetConversionUV(MT_Point2 *nuv){ *nuv++ = uv[2]; *nuv = uv[3]; } -void BL_Material::SetConversionUV2(MT_Point2 *nuv) { +void BL_Material::SetConversionUV2(const STR_String& name, MT_Point2 *nuv) { + uv2Name = name; uv2[0] = *nuv++; uv2[1] = *nuv++; uv2[2] = *nuv++; diff --git a/source/gameengine/Ketsji/BL_Material.h b/source/gameengine/Ketsji/BL_Material.h index ddb6662830a..568f7e171de 100644 --- a/source/gameengine/Ketsji/BL_Material.h +++ b/source/gameengine/Ketsji/BL_Material.h @@ -83,13 +83,16 @@ public: MT_Point2 uv[4]; MT_Point2 uv2[4]; + STR_String uvName; + STR_String uv2Name; + void SetConversionRGB(unsigned int *rgb); void GetConversionRGB(unsigned int *rgb); - void SetConversionUV(MT_Point2 *uv); + void SetConversionUV(const STR_String& name, MT_Point2 *uv); void GetConversionUV(MT_Point2 *uv); - void SetConversionUV2(MT_Point2 *uv); + void SetConversionUV2(const STR_String& name, MT_Point2 *uv); void GetConversionUV2(MT_Point2 *uv); void SetSharedMaterial(bool v); diff --git a/source/gameengine/Ketsji/BL_Shader.cpp b/source/gameengine/Ketsji/BL_Shader.cpp index 15350db6650..f6f9a29b0e2 100644 --- a/source/gameengine/Ketsji/BL_Shader.cpp +++ b/source/gameengine/Ketsji/BL_Shader.cpp @@ -812,7 +812,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setSource," setSource(vertexProgram, fragmentProg mUse = 0; Py_Return; } - Py_Return; + return NULL; } diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp index 3ade810c394..85921ae75ca 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp @@ -158,6 +158,9 @@ PyObject* KX_NetworkMessageActuator::PySetToPropName( if (PyArg_ParseTuple(args, "s", &ToPropName)) { m_toPropName = ToPropName; } + else { + return NULL; + } Py_Return; } @@ -173,7 +176,10 @@ PyObject* KX_NetworkMessageActuator::PySetSubject( if (PyArg_ParseTuple(args, "s", &Subject)) { m_subject = Subject; } - + else { + return NULL; + } + Py_Return; } @@ -188,6 +194,9 @@ PyObject* KX_NetworkMessageActuator::PySetBodyType( if (PyArg_ParseTuple(args, "i", &BodyType)) { m_bodyType = BodyType; } + else { + return NULL; + } Py_Return; } @@ -203,6 +212,9 @@ PyObject* KX_NetworkMessageActuator::PySetBody( if (PyArg_ParseTuple(args, "s", &Body)) { m_body = Body; } + else { + return NULL; + } Py_Return; } diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp index 027cb2a0ffa..0c66ac1fde3 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp @@ -233,6 +233,9 @@ PyObject* KX_NetworkMessageSensor::PySetSubjectFilterText( { m_subject = Subject; } + else { + return NULL; + } Py_Return; } diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index 02b1ffd432a..0f445a9f32e 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -38,6 +38,8 @@ extern "C" { // ------------------------------------ #define spit(x) std::cout << x << std::endl; +BL_BlenderShader *KX_BlenderMaterial::mLastBlenderShader = NULL; + //static PyObject *gTextureDict = 0; KX_BlenderMaterial::KX_BlenderMaterial( @@ -126,32 +128,31 @@ void KX_BlenderMaterial::OnConstruction() // when material are reused between objects return; - if(mMaterial->glslmat) { + if(mMaterial->glslmat) SetBlenderGLSLShader(); - } - else { - // for each unique material... - int i; - for(i=0; inum_enabled; i++) { - if( mMaterial->mapping[i].mapping & USEENV ) { - if(!GLEW_ARB_texture_cube_map) { - spit("CubeMap textures not supported"); - continue; - } - if(!mTextures[i].InitCubeMap(i, mMaterial->cubemap[i] ) ) + + // for each unique material... + int i; + for(i=0; inum_enabled; i++) { + if( mMaterial->mapping[i].mapping & USEENV ) { + if(!GLEW_ARB_texture_cube_map) { + spit("CubeMap textures not supported"); + continue; + } + if(!mTextures[i].InitCubeMap(i, mMaterial->cubemap[i] ) ) + spit("unable to initialize image("<matname<< ", image will not be available"); + } + + else { + if( mMaterial->img[i] ) { + if( ! mTextures[i].InitFromImage(i, mMaterial->img[i], (mMaterial->flag[i] &MIPMAP)!=0 )) spit("unable to initialize image("<matname<< ", image will not be available"); - } - - else { - if( mMaterial->img[i] ) { - if( ! mTextures[i].InitFromImage(i, mMaterial->img[i], (mMaterial->flag[i] &MIPMAP)!=0 )) - spit("unable to initialize image("<matname<< ", image will not be available"); - } + mMaterial->matname<< ", image will not be available"); } } } + mBlendFunc[0] =0; mBlendFunc[1] =0; mConstructed = true; @@ -168,7 +169,11 @@ void KX_BlenderMaterial::OnExit() } if( mBlenderShader ) { - mBlenderShader->SetProg(false); + if(mBlenderShader == mLastBlenderShader) { + mBlenderShader->SetProg(false); + mLastBlenderShader = NULL; + } + delete mBlenderShader; mBlenderShader = 0; } @@ -225,14 +230,23 @@ void KX_BlenderMaterial::setBlenderShaderData( bool enable, RAS_IRasterizer *ras { if( !enable || !mBlenderShader->Ok() ) { // frame cleanup. - mBlenderShader->SetProg(false); + if(mLastBlenderShader) { + mLastBlenderShader->SetProg(false); + mLastBlenderShader= NULL; + } BL_Texture::DisableAllTextures(); return; } - BL_Texture::DisableAllTextures(); - mBlenderShader->SetProg(true); - mBlenderShader->ApplyShader(); + if(!mBlenderShader->Equals(mLastBlenderShader)) { + BL_Texture::DisableAllTextures(); + + if(mLastBlenderShader) + mLastBlenderShader->SetProg(false); + + mBlenderShader->SetProg(true); + mLastBlenderShader= mBlenderShader; + } } void KX_BlenderMaterial::setTexData( bool enable, RAS_IRasterizer *ras) @@ -298,7 +312,12 @@ KX_BlenderMaterial::ActivatShaders( // reset... if(tmp->mMaterial->IsShared()) cachingInfo =0; - + + if(mLastBlenderShader) { + mLastBlenderShader->SetProg(false); + mLastBlenderShader= NULL; + } + if (GetCachingInfo() != cachingInfo) { if (!cachingInfo) @@ -372,7 +391,7 @@ KX_BlenderMaterial::ActivateBlenderShaders( } ActivatGLMaterials(rasty); - mBlenderShader->SetTexCoords(rasty); + mBlenderShader->SetAttribs(rasty, mMaterial); } void @@ -382,6 +401,12 @@ KX_BlenderMaterial::ActivateMat( )const { KX_BlenderMaterial *tmp = const_cast(this); + + if(mLastBlenderShader) { + mLastBlenderShader->SetProg(false); + mLastBlenderShader= NULL; + } + if (GetCachingInfo() != cachingInfo) { if (!cachingInfo) tmp->setTexData( false,rasty ); @@ -460,17 +485,29 @@ KX_BlenderMaterial::Activate( return dopass; } +bool KX_BlenderMaterial::UsesLighting(RAS_IRasterizer *rasty) const +{ + if(!RAS_IPolyMaterial::UsesLighting(rasty)) + return false; + + if(mShader && mShader->Ok()); + else if(mBlenderShader && mBlenderShader->Ok()) + return false; + + return true; +} + void KX_BlenderMaterial::ActivateMeshSlot(const KX_MeshSlot & ms, RAS_IRasterizer* rasty) const { if(mShader && GLEW_ARB_shader_objects) mShader->Update(ms, rasty); - if(mBlenderShader && GLEW_ARB_shader_objects) + else if(mBlenderShader && GLEW_ARB_shader_objects) mBlenderShader->Update(ms, rasty); } void KX_BlenderMaterial::ActivatGLMaterials( RAS_IRasterizer* rasty )const { - if(!mBlenderShader) { + if(mShader || !mBlenderShader) { rasty->SetSpecularity( mMaterial->speccolor[0]*mMaterial->spec_f, mMaterial->speccolor[1]*mMaterial->spec_f, @@ -506,6 +543,7 @@ void KX_BlenderMaterial::ActivateTexGen(RAS_IRasterizer *ras) const ras->SetAttribNum(0); if(mShader && GLEW_ARB_shader_objects) { if(mShader->GetAttribute() == BL_Shader::SHD_TANGENT) { + ras->SetAttrib(RAS_IRasterizer::RAS_TEXCO_DISABLE, 0); ras->SetAttrib(RAS_IRasterizer::RAS_TEXTANGENT, 1); ras->SetAttribNum(2); } @@ -793,7 +831,7 @@ KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getShader , "getShader()") void KX_BlenderMaterial::SetBlenderGLSLShader(void) { if(!mBlenderShader) - mBlenderShader = new BL_BlenderShader(mMaterial->material); + mBlenderShader = new BL_BlenderShader(mMaterial->material, m_lightlayer); if(!mBlenderShader->Ok()) { delete mBlenderShader; diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h index 62e96b71937..bf6d2095e7c 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.h +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h @@ -94,6 +94,7 @@ private: BL_Material* mMaterial; BL_Shader* mShader; BL_BlenderShader* mBlenderShader; + static BL_BlenderShader *mLastBlenderShader; KX_Scene* mScene; BL_Texture mTextures[MAXTEX]; // texture array bool mUserDefBlend; @@ -106,6 +107,7 @@ private: void ActivatGLMaterials( RAS_IRasterizer* rasty )const; void ActivateTexGen( RAS_IRasterizer *ras ) const; + bool UsesLighting(RAS_IRasterizer *rasty) const; // message centers void setTexData( bool enable,RAS_IRasterizer *ras); diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index 27e47d72bbe..3830d422138 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -588,7 +588,7 @@ KX_PYMETHODDEF_DOC(KX_Camera, sphereInsideFrustum, PyErr_SetString(PyExc_TypeError, "sphereInsideFrustum: Expected arguments: (center, radius)"); - Py_Return; + return NULL; } KX_PYMETHODDEF_DOC(KX_Camera, boxInsideFrustum, @@ -766,6 +766,10 @@ KX_PYMETHODDEF_DOC(KX_Camera, enableViewport, else EnableViewport(false); } + else { + return NULL; + } + Py_Return; } @@ -777,6 +781,8 @@ KX_PYMETHODDEF_DOC(KX_Camera, setViewport, if (PyArg_ParseTuple(args,"iiii",&left, &bottom, &right, &top)) { SetViewport(left, bottom, right, top); + } else { + return NULL; } Py_Return; } diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp index bd843d97199..80288a72485 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp @@ -35,6 +35,7 @@ #include "MT_Point3.h" #include "MT_Matrix3x3.h" #include "KX_GameObject.h" +#include "KX_RayCast.h" #ifdef HAVE_CONFIG_H #include @@ -45,35 +46,54 @@ /* ------------------------------------------------------------------------- */ KX_ConstraintActuator::KX_ConstraintActuator(SCA_IObject *gameobj, - int dampTime, + int posDampTime, + int rotDampTime, float minBound, float maxBound, + float refDir[3], int locrotxyz, - PyTypeObject* T) - : SCA_IActuator(gameobj, T) + int time, + int option, + char *property, + PyTypeObject* T) : + m_refDirection(refDir), + m_currentTime(0), + SCA_IActuator(gameobj, T) { - m_dampTime = dampTime; + m_posDampTime = posDampTime; + m_rotDampTime = rotDampTime; m_locrot = locrotxyz; + m_option = option; + m_activeTime = time; + if (property) { + strncpy(m_property, property, sizeof(m_property)); + m_property[sizeof(m_property)-1] = 0; + } else { + m_property[0] = 0; + } /* The units of bounds are determined by the type of constraint. To */ /* make the constraint application easier and more transparent later on, */ /* I think converting the bounds to the applicable domain makes more */ /* sense. */ switch (m_locrot) { - case KX_ACT_CONSTRAINT_LOCX: - case KX_ACT_CONSTRAINT_LOCY: - case KX_ACT_CONSTRAINT_LOCZ: + case KX_ACT_CONSTRAINT_ORIX: + case KX_ACT_CONSTRAINT_ORIY: + case KX_ACT_CONSTRAINT_ORIZ: + { + MT_Scalar len = m_refDirection.length(); + if (MT_fuzzyZero(len)) { + // missing a valid direction + std::cout << "WARNING: Constraint actuator " << GetName() << ": There is no valid reference direction!" << std::endl; + m_locrot = KX_ACT_CONSTRAINT_NODEF; + } else { + m_refDirection /= len; + } + } + break; + default: m_minimumBound = minBound; m_maximumBound = maxBound; break; - case KX_ACT_CONSTRAINT_ROTX: - case KX_ACT_CONSTRAINT_ROTY: - case KX_ACT_CONSTRAINT_ROTZ: - /* The user interface asks for degrees, we are radian. */ - m_minimumBound = MT_radians(minBound); - m_maximumBound = MT_radians(maxBound); - break; - default: - ; /* error */ } } /* End of constructor */ @@ -83,6 +103,40 @@ KX_ConstraintActuator::~KX_ConstraintActuator() // there's nothing to be done here, really.... } /* end of destructor */ +bool KX_ConstraintActuator::RayHit(KX_ClientObjectInfo* client, MT_Point3& hit_point, MT_Vector3& hit_normal, void * const data) +{ + + KX_GameObject* hitKXObj = client->m_gameobject; + + if (client->m_type > KX_ClientObjectInfo::ACTOR) + { + // false hit + return false; + } + bool bFound = false; + + if (m_property[0] == 0) + { + bFound = true; + } + else + { + if (m_option & KX_ACT_CONSTRAINT_MATERIAL) + { + if (client->m_auxilary_info) + { + bFound = !strcmp(m_property, ((char*)client->m_auxilary_info)); + } + } + else + { + bFound = hitKXObj->GetProperty(m_property) != NULL; + } + } + + return bFound; +} + bool KX_ConstraintActuator::Update(double curtime, bool frame) { @@ -90,70 +144,198 @@ bool KX_ConstraintActuator::Update(double curtime, bool frame) bool bNegativeEvent = IsNegativeEvent(); RemoveAllEvents(); - if (bNegativeEvent) - return false; // do nothing on negative events + if (!bNegativeEvent) { + /* Constraint clamps the values to the specified range, with a sort of */ + /* low-pass filtered time response, if the damp time is unequal to 0. */ - /* Constraint clamps the values to the specified range, with a sort of */ - /* low-pass filtered time response, if the damp time is unequal to 0. */ + /* Having to retrieve location/rotation and setting it afterwards may not */ + /* be efficient enough... Somthing to look at later. */ + KX_GameObject *obj = (KX_GameObject*) GetParent(); + MT_Point3 position = obj->NodeGetWorldPosition(); + MT_Point3 newposition; + MT_Vector3 direction; + MT_Matrix3x3 rotation = obj->NodeGetWorldOrientation(); + MT_Scalar filter, newdistance; + int axis, sign; - /* Having to retrieve location/rotation and setting it afterwards may not */ - /* be efficient enough... Somthing to look at later. */ - KX_GameObject *parent = (KX_GameObject*) GetParent(); - MT_Point3 position = parent->NodeGetWorldPosition(); - MT_Matrix3x3 rotation = parent->NodeGetWorldOrientation(); -// MT_Vector3 eulerrot = rotation.getEuler(); - - switch (m_locrot) { - case KX_ACT_CONSTRAINT_LOCX: - Clamp(position[0], m_minimumBound, m_maximumBound); - result = true; - break; - case KX_ACT_CONSTRAINT_LOCY: - Clamp(position[1], m_minimumBound, m_maximumBound); - result = true; - break; - case KX_ACT_CONSTRAINT_LOCZ: - Clamp(position[2], m_minimumBound, m_maximumBound); - result = true; - break; - -// case KX_ACT_CONSTRAINT_ROTX: -// /* The angles are Euler angles (I think that's what they are called) */ -// /* but we need to convert from/to the MT_Matrix3x3. */ -// Clamp(eulerrot[0], m_minimumBound, m_maximumBound); -// break; -// case KX_ACT_CONSTRAINT_ROTY: -// Clamp(eulerrot[1], m_minimumBound, m_maximumBound); -// break; -// case KX_ACT_CONSTRAINT_ROTZ: -// Clamp(eulerrot[2], m_minimumBound, m_maximumBound); -// break; -// default: -// ; /* error */ + if (m_posDampTime) { + filter = m_posDampTime/(1.0+m_posDampTime); + } + switch (m_locrot) { + case KX_ACT_CONSTRAINT_ORIX: + case KX_ACT_CONSTRAINT_ORIY: + case KX_ACT_CONSTRAINT_ORIZ: + switch (m_locrot) { + case KX_ACT_CONSTRAINT_ORIX: + direction[0] = rotation[0][0]; + direction[1] = rotation[1][0]; + direction[2] = rotation[2][0]; + axis = 0; + break; + case KX_ACT_CONSTRAINT_ORIY: + direction[0] = rotation[0][1]; + direction[1] = rotation[1][1]; + direction[2] = rotation[2][1]; + axis = 1; + break; + case KX_ACT_CONSTRAINT_ORIZ: + direction[0] = rotation[0][2]; + direction[1] = rotation[1][2]; + direction[2] = rotation[2][2]; + axis = 2; + break; + } + // apply damping on the direction + if (m_posDampTime) { + direction = filter*direction + (1.0-filter)*m_refDirection; + } + obj->AlignAxisToVect(direction, axis); + result = true; + goto CHECK_TIME; + case KX_ACT_CONSTRAINT_DIRPX: + case KX_ACT_CONSTRAINT_DIRPY: + case KX_ACT_CONSTRAINT_DIRPZ: + case KX_ACT_CONSTRAINT_DIRMX: + case KX_ACT_CONSTRAINT_DIRMY: + case KX_ACT_CONSTRAINT_DIRMZ: + switch (m_locrot) { + case KX_ACT_CONSTRAINT_DIRPX: + direction[0] = rotation[0][0]; + direction[1] = rotation[1][0]; + direction[2] = rotation[2][0]; + axis = 0; // axis according to KX_GameObject::AlignAxisToVect() + sign = 1; // X axis will be anti parrallel to normal + break; + case KX_ACT_CONSTRAINT_DIRPY: + direction[0] = rotation[0][1]; + direction[1] = rotation[1][1]; + direction[2] = rotation[2][1]; + axis = 1; + sign = 1; + break; + case KX_ACT_CONSTRAINT_DIRPZ: + direction[0] = rotation[0][2]; + direction[1] = rotation[1][2]; + direction[2] = rotation[2][2]; + axis = 2; + sign = 1; + break; + case KX_ACT_CONSTRAINT_DIRMX: + direction[0] = -rotation[0][0]; + direction[1] = -rotation[1][0]; + direction[2] = -rotation[2][0]; + axis = 0; + sign = 0; + break; + case KX_ACT_CONSTRAINT_DIRMY: + direction[0] = -rotation[0][1]; + direction[1] = -rotation[1][1]; + direction[2] = -rotation[2][1]; + axis = 1; + sign = 0; + break; + case KX_ACT_CONSTRAINT_DIRMZ: + direction[0] = -rotation[0][2]; + direction[1] = -rotation[1][2]; + direction[2] = -rotation[2][2]; + axis = 2; + sign = 0; + break; + } + direction.normalize(); + { + MT_Point3 topoint = position + (m_maximumBound) * direction; + MT_Point3 resultpoint; + MT_Vector3 resultnormal; + PHY_IPhysicsEnvironment* pe = obj->GetPhysicsEnvironment(); + KX_IPhysicsController *spc = obj->GetPhysicsController(); + + if (!pe) { + std::cout << "WARNING: Constraint actuator " << GetName() << ": There is no physics environment!" << std::endl; + goto CHECK_TIME; + } + if (!spc) { + // the object is not physical, we probably want to avoid hitting its own parent + KX_GameObject *parent = obj->GetParent(); + if (parent) { + spc = parent->GetPhysicsController(); + parent->Release(); + } + } + result = KX_RayCast::RayTest(spc, pe, position, topoint, resultpoint, resultnormal, KX_RayCast::Callback(this)); + + if (result) { + // compute new position & orientation + if ((m_option & (KX_ACT_CONSTRAINT_NORMAL|KX_ACT_CONSTRAINT_DISTANCE)) == 0) { + // if none option is set, the actuator does nothing but detect ray + // (works like a sensor) + goto CHECK_TIME; + } + if (m_option & KX_ACT_CONSTRAINT_NORMAL) { + // the new orientation must be so that the axis is parallel to normal + if (sign) + resultnormal = -resultnormal; + // apply damping on the direction + if (m_rotDampTime) { + MT_Scalar rotFilter = 1.0/(1.0+m_rotDampTime); + resultnormal = (-m_rotDampTime*rotFilter)*direction + rotFilter*resultnormal; + } else if (m_posDampTime) { + resultnormal = -filter*direction + (1.0-filter)*resultnormal; + } + obj->AlignAxisToVect(resultnormal, axis); + direction = -resultnormal; + } + if (m_option & KX_ACT_CONSTRAINT_DISTANCE) { + if (m_posDampTime) { + newdistance = filter*(position-resultpoint).length()+(1.0-filter)*m_minimumBound; + } else { + newdistance = m_minimumBound; + } + } else { + newdistance = (position-resultpoint).length(); + } + newposition = resultpoint-newdistance*direction; + } else if (m_option & KX_ACT_CONSTRAINT_PERMANENT) { + // no contact but still keep running + result = true; + goto CHECK_TIME; + } + } + break; + case KX_ACT_CONSTRAINT_LOCX: + case KX_ACT_CONSTRAINT_LOCY: + case KX_ACT_CONSTRAINT_LOCZ: + newposition = position; + switch (m_locrot) { + case KX_ACT_CONSTRAINT_LOCX: + Clamp(newposition[0], m_minimumBound, m_maximumBound); + break; + case KX_ACT_CONSTRAINT_LOCY: + Clamp(newposition[1], m_minimumBound, m_maximumBound); + break; + case KX_ACT_CONSTRAINT_LOCZ: + Clamp(newposition[2], m_minimumBound, m_maximumBound); + break; + } + result = true; + if (m_posDampTime) { + newposition = filter*position + (1.0-filter)*newposition; + } + break; + } + if (result) { + // set the new position but take into account parent if any + obj->NodeSetWorldPosition(newposition); + } + CHECK_TIME: + if (result && m_activeTime > 0 ) { + if (++m_currentTime >= m_activeTime) + result = false; + } } - - /* Will be replaced by a filtered clamp. */ - - - switch (m_locrot) { - case KX_ACT_CONSTRAINT_LOCX: - case KX_ACT_CONSTRAINT_LOCY: - case KX_ACT_CONSTRAINT_LOCZ: - parent->NodeSetLocalPosition(position); - break; - - -// case KX_ACT_CONSTRAINT_ROTX: -// case KX_ACT_CONSTRAINT_ROTY: -// case KX_ACT_CONSTRAINT_ROTZ: -// rotation.setEuler(eulerrot); -// parent->NodeSetLocalOrientation(rotation); - break; - - default: - ; /* error */ + if (!result) { + m_currentTime = 0; } - return result; } /* end of KX_ConstraintActuator::Update(double curtime,double deltatime) */ @@ -214,10 +396,24 @@ PyParentObject KX_ConstraintActuator::Parents[] = { PyMethodDef KX_ConstraintActuator::Methods[] = { {"setDamp", (PyCFunction) KX_ConstraintActuator::sPySetDamp, METH_VARARGS, SetDamp_doc}, {"getDamp", (PyCFunction) KX_ConstraintActuator::sPyGetDamp, METH_VARARGS, GetDamp_doc}, + {"setRotDamp", (PyCFunction) KX_ConstraintActuator::sPySetRotDamp, METH_VARARGS, SetRotDamp_doc}, + {"getRotDamp", (PyCFunction) KX_ConstraintActuator::sPyGetRotDamp, METH_VARARGS, GetRotDamp_doc}, + {"setDirection", (PyCFunction) KX_ConstraintActuator::sPySetDirection, METH_VARARGS, SetDirection_doc}, + {"getDirection", (PyCFunction) KX_ConstraintActuator::sPyGetDirection, METH_VARARGS, GetDirection_doc}, + {"setOption", (PyCFunction) KX_ConstraintActuator::sPySetOption, METH_VARARGS, SetOption_doc}, + {"getOption", (PyCFunction) KX_ConstraintActuator::sPyGetOption, METH_VARARGS, GetOption_doc}, + {"setTime", (PyCFunction) KX_ConstraintActuator::sPySetTime, METH_VARARGS, SetTime_doc}, + {"getTime", (PyCFunction) KX_ConstraintActuator::sPyGetTime, METH_VARARGS, GetTime_doc}, + {"setProperty", (PyCFunction) KX_ConstraintActuator::sPySetProperty, METH_VARARGS, SetProperty_doc}, + {"getProperty", (PyCFunction) KX_ConstraintActuator::sPyGetProperty, METH_VARARGS, GetProperty_doc}, {"setMin", (PyCFunction) KX_ConstraintActuator::sPySetMin, METH_VARARGS, SetMin_doc}, {"getMin", (PyCFunction) KX_ConstraintActuator::sPyGetMin, METH_VARARGS, GetMin_doc}, + {"setDistance", (PyCFunction) KX_ConstraintActuator::sPySetMin, METH_VARARGS, SetDistance_doc}, + {"getDistance", (PyCFunction) KX_ConstraintActuator::sPyGetMin, METH_VARARGS, GetDistance_doc}, {"setMax", (PyCFunction) KX_ConstraintActuator::sPySetMax, METH_VARARGS, SetMax_doc}, {"getMax", (PyCFunction) KX_ConstraintActuator::sPyGetMax, METH_VARARGS, GetMax_doc}, + {"setRayLength", (PyCFunction) KX_ConstraintActuator::sPySetMax, METH_VARARGS, SetRayLength_doc}, + {"getRayLength", (PyCFunction) KX_ConstraintActuator::sPyGetMax, METH_VARARGS, GetRayLength_doc}, {"setLimit", (PyCFunction) KX_ConstraintActuator::sPySetLimit, METH_VARARGS, SetLimit_doc}, {"getLimit", (PyCFunction) KX_ConstraintActuator::sPyGetLimit, METH_VARARGS, GetLimit_doc}, {NULL,NULL} //Sentinel @@ -231,7 +427,7 @@ PyObject* KX_ConstraintActuator::_getattr(const STR_String& attr) { char KX_ConstraintActuator::SetDamp_doc[] = "setDamp(duration)\n" "\t- duration: integer\n" -"\tSets the time with which the constraint application is delayed.\n" +"\tSets the time constant of the orientation and distance constraint.\n" "\tIf the duration is negative, it is set to 0.\n"; PyObject* KX_ConstraintActuator::PySetDamp(PyObject* self, PyObject* args, @@ -241,21 +437,192 @@ PyObject* KX_ConstraintActuator::PySetDamp(PyObject* self, return NULL; } - m_dampTime = dampArg; - if (m_dampTime < 0) m_dampTime = 0; + m_posDampTime = dampArg; + if (m_posDampTime < 0) m_posDampTime = 0; Py_Return; } /* 3. getDamp */ char KX_ConstraintActuator::GetDamp_doc[] = -"GetDamp()\n" -"\tReturns the damping time for application of the constraint.\n"; +"getDamp()\n" +"\tReturns the damping parameter.\n"; PyObject* KX_ConstraintActuator::PyGetDamp(PyObject* self, PyObject* args, PyObject* kwds){ - return PyInt_FromLong(m_dampTime); + return PyInt_FromLong(m_posDampTime); } +/* 2. setRotDamp */ +char KX_ConstraintActuator::SetRotDamp_doc[] = +"setRotDamp(duration)\n" +"\t- duration: integer\n" +"\tSets the time constant of the orientation constraint.\n" +"\tIf the duration is negative, it is set to 0.\n"; +PyObject* KX_ConstraintActuator::PySetRotDamp(PyObject* self, + PyObject* args, + PyObject* kwds) { + int dampArg; + if(!PyArg_ParseTuple(args, "i", &dampArg)) { + return NULL; + } + + m_rotDampTime = dampArg; + if (m_rotDampTime < 0) m_rotDampTime = 0; + + Py_Return; +} +/* 3. getRotDamp */ +char KX_ConstraintActuator::GetRotDamp_doc[] = +"getRotDamp()\n" +"\tReturns the damping time for application of the constraint.\n"; +PyObject* KX_ConstraintActuator::PyGetRotDamp(PyObject* self, + PyObject* args, + PyObject* kwds){ + return PyInt_FromLong(m_rotDampTime); +} + +/* 2. setDirection */ +char KX_ConstraintActuator::SetDirection_doc[] = +"setDirection(vector)\n" +"\t- vector: 3-tuple\n" +"\tSets the reference direction in world coordinate for the orientation constraint.\n"; +PyObject* KX_ConstraintActuator::PySetDirection(PyObject* self, + PyObject* args, + PyObject* kwds) { + float x, y, z; + MT_Scalar len; + MT_Vector3 dir; + + if(!PyArg_ParseTuple(args, "(fff)", &x, &y, &z)) { + return NULL; + } + dir[0] = x; + dir[1] = y; + dir[2] = z; + len = dir.length(); + if (MT_fuzzyZero(len)) { + std::cout << "Invalid direction" << std::endl; + return NULL; + } + m_refDirection = dir/len; + + Py_Return; +} +/* 3. getDirection */ +char KX_ConstraintActuator::GetDirection_doc[] = +"getDirection()\n" +"\tReturns the reference direction of the orientation constraint as a 3-tuple.\n"; +PyObject* KX_ConstraintActuator::PyGetDirection(PyObject* self, + PyObject* args, + PyObject* kwds){ + PyObject *retVal = PyList_New(3); + + PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_refDirection[0])); + PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_refDirection[1])); + PyList_SetItem(retVal, 2, PyFloat_FromDouble(m_refDirection[2])); + return retVal; +} + +/* 2. setOption */ +char KX_ConstraintActuator::SetOption_doc[] = +"setOption(option)\n" +"\t- option: integer\n" +"\tSets several options of the distance constraint.\n" +"\tBinary combination of the following values:\n" +"\t\t 64 : Activate alignment to surface\n" +"\t\t128 : Detect material rather than property\n" +"\t\t256 : No deactivation if ray does not hit target\n" +"\t\t512 : Activate distance control\n"; +PyObject* KX_ConstraintActuator::PySetOption(PyObject* self, + PyObject* args, + PyObject* kwds) { + int option; + if(!PyArg_ParseTuple(args, "i", &option)) { + return NULL; + } + + m_option = option; + + Py_Return; +} +/* 3. getOption */ +char KX_ConstraintActuator::GetOption_doc[] = +"getOption()\n" +"\tReturns the option parameter.\n"; +PyObject* KX_ConstraintActuator::PyGetOption(PyObject* self, + PyObject* args, + PyObject* kwds){ + return PyInt_FromLong(m_option); +} + +/* 2. setTime */ +char KX_ConstraintActuator::SetTime_doc[] = +"setTime(duration)\n" +"\t- duration: integer\n" +"\tSets the activation time of the actuator.\n" +"\tThe actuator disables itself after this many frame.\n" +"\tIf set to 0 or negative, the actuator is not limited in time.\n"; +PyObject* KX_ConstraintActuator::PySetTime(PyObject* self, + PyObject* args, + PyObject* kwds) { + int t; + if(!PyArg_ParseTuple(args, "i", &t)) { + return NULL; + } + + if (t < 0) + t = 0; + m_activeTime = t; + + Py_Return; +} +/* 3. getTime */ +char KX_ConstraintActuator::GetTime_doc[] = +"getTime()\n" +"\tReturns the time parameter.\n"; +PyObject* KX_ConstraintActuator::PyGetTime(PyObject* self, + PyObject* args, + PyObject* kwds){ + return PyInt_FromLong(m_activeTime); +} + +/* 2. setProperty */ +char KX_ConstraintActuator::SetProperty_doc[] = +"setProperty(property)\n" +"\t- property: string\n" +"\tSets the name of the property or material for the ray detection of the distance constraint.\n" +"\tIf empty, the ray will detect any collisioning object.\n"; +PyObject* KX_ConstraintActuator::PySetProperty(PyObject* self, + PyObject* args, + PyObject* kwds) { + char *property; + if (!PyArg_ParseTuple(args, "s", &property)) { + return NULL; + } + if (property == NULL) { + m_property[0] = 0; + } else { + strncpy(m_property, property, sizeof(m_property)); + m_property[sizeof(m_property)-1] = 0; + } + + Py_Return; +} +/* 3. getProperty */ +char KX_ConstraintActuator::GetProperty_doc[] = +"getProperty()\n" +"\tReturns the property parameter.\n"; +PyObject* KX_ConstraintActuator::PyGetProperty(PyObject* self, + PyObject* args, + PyObject* kwds){ + return PyString_FromString(m_property); +} + +/* 4. setDistance */ +char KX_ConstraintActuator::SetDistance_doc[] = +"setDistance(distance)\n" +"\t- distance: float\n" +"\tSets the target distance in distance constraint\n"; /* 4. setMin */ char KX_ConstraintActuator::SetMin_doc[] = "setMin(lower_bound)\n" @@ -271,9 +638,7 @@ PyObject* KX_ConstraintActuator::PySetMin(PyObject* self, } switch (m_locrot) { - case KX_ACT_CONSTRAINT_LOCX: - case KX_ACT_CONSTRAINT_LOCY: - case KX_ACT_CONSTRAINT_LOCZ: + default: m_minimumBound = minArg; break; case KX_ACT_CONSTRAINT_ROTX: @@ -281,12 +646,14 @@ PyObject* KX_ConstraintActuator::PySetMin(PyObject* self, case KX_ACT_CONSTRAINT_ROTZ: m_minimumBound = MT_radians(minArg); break; - default: - ; /* error */ } Py_Return; } +/* 5. getDistance */ +char KX_ConstraintActuator::GetDistance_doc[] = +"getDistance()\n" +"\tReturns the distance parameter \n"; /* 5. getMin */ char KX_ConstraintActuator::GetMin_doc[] = "getMin()\n" @@ -298,6 +665,11 @@ PyObject* KX_ConstraintActuator::PyGetMin(PyObject* self, return PyFloat_FromDouble(m_minimumBound); } +/* 6. setRayLength */ +char KX_ConstraintActuator::SetRayLength_doc[] = +"setRayLength(length)\n" +"\t- length: float\n" +"\tSets the maximum ray length of the distance constraint\n"; /* 6. setMax */ char KX_ConstraintActuator::SetMax_doc[] = "setMax(upper_bound)\n" @@ -313,9 +685,7 @@ PyObject* KX_ConstraintActuator::PySetMax(PyObject* self, } switch (m_locrot) { - case KX_ACT_CONSTRAINT_LOCX: - case KX_ACT_CONSTRAINT_LOCY: - case KX_ACT_CONSTRAINT_LOCZ: + default: m_maximumBound = maxArg; break; case KX_ACT_CONSTRAINT_ROTX: @@ -323,12 +693,14 @@ PyObject* KX_ConstraintActuator::PySetMax(PyObject* self, case KX_ACT_CONSTRAINT_ROTZ: m_maximumBound = MT_radians(maxArg); break; - default: - ; /* error */ } Py_Return; } +/* 7. getRayLength */ +char KX_ConstraintActuator::GetRayLength_doc[] = +"getRayLength()\n" +"\tReturns the length of the ray\n"; /* 7. getMax */ char KX_ConstraintActuator::GetMax_doc[] = "getMax()\n" @@ -345,9 +717,19 @@ PyObject* KX_ConstraintActuator::PyGetMax(PyObject* self, /* 8. setLimit */ char KX_ConstraintActuator::SetLimit_doc[] = "setLimit(type)\n" -"\t- type: KX_CONSTRAINTACT_LOCX, KX_CONSTRAINTACT_LOCY,\n" -"\t KX_CONSTRAINTACT_LOCZ, KX_CONSTRAINTACT_ROTX,\n" -"\t KX_CONSTRAINTACT_ROTY, or KX_CONSTRAINTACT_ROTZ.\n" +"\t- type: integer\n" +"\t 1 : LocX\n" +"\t 2 : LocY\n" +"\t 3 : LocZ\n" +"\t 7 : Distance along +X axis\n" +"\t 8 : Distance along +Y axis\n" +"\t 9 : Distance along +Z axis\n" +"\t 10 : Distance along -X axis\n" +"\t 11 : Distance along -Y axis\n" +"\t 12 : Distance along -Z axis\n" +"\t 13 : Align X axis\n" +"\t 14 : Align Y axis\n" +"\t 15 : Align Z axis\n" "\tSets the type of constraint.\n"; PyObject* KX_ConstraintActuator::PySetLimit(PyObject* self, PyObject* args, @@ -363,7 +745,7 @@ PyObject* KX_ConstraintActuator::PySetLimit(PyObject* self, } /* 9. getLimit */ char KX_ConstraintActuator::GetLimit_doc[] = -"getLimit(type)\n" +"getLimit()\n" "\tReturns the type of constraint.\n"; PyObject* KX_ConstraintActuator::PyGetLimit(PyObject* self, PyObject* args, diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.h b/source/gameengine/Ketsji/KX_ConstraintActuator.h index a21a5f30de6..5a1d4d23217 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.h +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.h @@ -34,19 +34,31 @@ #include "SCA_IActuator.h" #include "MT_Scalar.h" +#include "MT_Vector3.h" +#include "KX_ClientObjectInfo.h" class KX_ConstraintActuator : public SCA_IActuator { Py_Header; protected: // Damp time (int), - int m_dampTime; - // min (float), + int m_posDampTime; + int m_rotDampTime; + // min (float) float m_minimumBound; - // max (float), + // max (float) float m_maximumBound; + // reference direction + MT_Vector3 m_refDirection; // locrotxyz choice (pick one): only one choice allowed at a time! int m_locrot; + // active time of actuator + int m_activeTime; + int m_currentTime; + // option + int m_option; + // property to check + char m_property[32]; /** * Clamp to , . Borders are included (in as far as @@ -56,6 +68,7 @@ protected: public: + // m_locrot enum KX_CONSTRAINTTYPE { KX_ACT_CONSTRAINT_NODEF = 0, KX_ACT_CONSTRAINT_LOCX, @@ -64,16 +77,37 @@ protected: KX_ACT_CONSTRAINT_ROTX, KX_ACT_CONSTRAINT_ROTY, KX_ACT_CONSTRAINT_ROTZ, + KX_ACT_CONSTRAINT_DIRPX, + KX_ACT_CONSTRAINT_DIRPY, + KX_ACT_CONSTRAINT_DIRPZ, + KX_ACT_CONSTRAINT_DIRMX, + KX_ACT_CONSTRAINT_DIRMY, + KX_ACT_CONSTRAINT_DIRMZ, + KX_ACT_CONSTRAINT_ORIX, + KX_ACT_CONSTRAINT_ORIY, + KX_ACT_CONSTRAINT_ORIZ, KX_ACT_CONSTRAINT_MAX }; - + // match ACT_CONST_... values from BIF_interface.h + enum KX_CONSTRAINTOPT { + KX_ACT_CONSTRAINT_NORMAL = 64, + KX_ACT_CONSTRAINT_MATERIAL = 128, + KX_ACT_CONSTRAINT_PERMANENT = 256, + KX_ACT_CONSTRAINT_DISTANCE = 512 + }; bool IsValidMode(KX_CONSTRAINTTYPE m); + bool RayHit(KX_ClientObjectInfo* client, MT_Point3& hit_point, MT_Vector3& hit_normal, void * const data); KX_ConstraintActuator(SCA_IObject* gameobj, - int damptime, + int posDamptime, + int rotDampTime, float min, float max, + float refDir[3], int locrot, + int time, + int option, + char *property, PyTypeObject* T=&Type); virtual ~KX_ConstraintActuator(); virtual CValue* GetReplica() { @@ -94,13 +128,26 @@ protected: KX_PYMETHOD_DOC(KX_ConstraintActuator,SetDamp); KX_PYMETHOD_DOC(KX_ConstraintActuator,GetDamp); + KX_PYMETHOD_DOC(KX_ConstraintActuator,SetRotDamp); + KX_PYMETHOD_DOC(KX_ConstraintActuator,GetRotDamp); + KX_PYMETHOD_DOC(KX_ConstraintActuator,SetDirection); + KX_PYMETHOD_DOC(KX_ConstraintActuator,GetDirection); + KX_PYMETHOD_DOC(KX_ConstraintActuator,SetOption); + KX_PYMETHOD_DOC(KX_ConstraintActuator,GetOption); + KX_PYMETHOD_DOC(KX_ConstraintActuator,SetTime); + KX_PYMETHOD_DOC(KX_ConstraintActuator,GetTime); + KX_PYMETHOD_DOC(KX_ConstraintActuator,SetProperty); + KX_PYMETHOD_DOC(KX_ConstraintActuator,GetProperty); KX_PYMETHOD_DOC(KX_ConstraintActuator,SetMin); KX_PYMETHOD_DOC(KX_ConstraintActuator,GetMin); + static char SetDistance_doc[]; + static char GetDistance_doc[]; KX_PYMETHOD_DOC(KX_ConstraintActuator,SetMax); KX_PYMETHOD_DOC(KX_ConstraintActuator,GetMax); + static char SetRayLength_doc[]; + static char GetRayLength_doc[]; KX_PYMETHOD_DOC(KX_ConstraintActuator,SetLimit); KX_PYMETHOD_DOC(KX_ConstraintActuator,GetLimit); - }; #endif //__KX_CONSTRAINTACTUATOR diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index b7750e68e8f..2ac4f909077 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -405,34 +405,25 @@ void KX_GameObject::ResetDebugColor() SetDebugColor(0xff000000); } +void KX_GameObject::InitIPO(bool ipo_as_force, + bool ipo_add, + bool ipo_local) +{ + SGControllerList::iterator it = GetSGNode()->GetSGControllerList().begin(); + while (it != GetSGNode()->GetSGControllerList().end()) { + (*it)->SetOption(SG_Controller::SG_CONTR_IPO_RESET, true); + (*it)->SetOption(SG_Controller::SG_CONTR_IPO_IPO_AS_FORCE, ipo_as_force); + (*it)->SetOption(SG_Controller::SG_CONTR_IPO_IPO_ADD, ipo_add); + (*it)->SetOption(SG_Controller::SG_CONTR_IPO_LOCAL, ipo_local); + it++; + } +} void KX_GameObject::UpdateIPO(float curframetime, - bool recurse, - bool ipo_as_force, - bool force_local) + bool recurse) { - - // The ipo-actuator needs a sumo reference... this is retrieved (unfortunately) - // by the iposgcontr itself... -// ipocontr->SetSumoReference(gameobj->GetSumoScene(), -// gameobj->GetSumoObject()); - - - // The ipo has to be treated as a force, and not a displacement! - // For this case, we send some settings to the controller. This - // may need some caching... - if (ipo_as_force) { - SGControllerList::iterator it = GetSGNode()->GetSGControllerList().begin(); - - while (it != GetSGNode()->GetSGControllerList().end()) { - (*it)->SetOption(SG_Controller::SG_CONTR_IPO_IPO_AS_FORCE, ipo_as_force); - (*it)->SetOption(SG_Controller::SG_CONTR_IPO_FORCES_ACT_LOCAL, force_local); - it++; - } - } - - // The rest is the 'normal' update procedure. + // just the 'normal' update procedure. GetSGNode()->SetSimulatedTime(curframetime,recurse); GetSGNode()->UpdateWorldData(curframetime); UpdateTransform(); @@ -581,7 +572,7 @@ void KX_GameObject::SetObjectColor(const MT_Vector4& rgbavec) m_objectColor = rgbavec; } -void KX_GameObject::AlignAxisToVect(const MT_Vector3& dir, int axis) +void KX_GameObject::AlignAxisToVect(const MT_Vector3& dir, int axis, float fac) { MT_Matrix3x3 orimat; MT_Vector3 vect,ori,z,x,y; @@ -594,6 +585,11 @@ void KX_GameObject::AlignAxisToVect(const MT_Vector3& dir, int axis) cout << "alignAxisToVect() Error: Null vector!\n"; return; } + + if (fac<=0.0) { + return; + } + // normalize vect /= len; orimat = GetSGNode()->GetWorldOrientation(); @@ -603,7 +599,14 @@ void KX_GameObject::AlignAxisToVect(const MT_Vector3& dir, int axis) ori = MT_Vector3(orimat[0][2], orimat[1][2], orimat[2][2]); //pivot axis if (MT_abs(vect.dot(ori)) > 1.0-3.0*MT_EPSILON) //is the vector paralell to the pivot? ori = MT_Vector3(orimat[0][1], orimat[1][1], orimat[2][1]); //change the pivot! - x = vect; + if (fac == 1.0) { + x = vect; + } else { + x = (vect * fac) + ((orimat * MT_Vector3(1.0, 0.0, 0.0)) * (1-fac)); + len = x.length(); + if (MT_fuzzyZero(len)) x = vect; + else x /= len; + } y = ori.cross(x); z = x.cross(y); break; @@ -611,7 +614,14 @@ void KX_GameObject::AlignAxisToVect(const MT_Vector3& dir, int axis) ori = MT_Vector3(orimat[0][0], orimat[1][0], orimat[2][0]); if (MT_abs(vect.dot(ori)) > 1.0-3.0*MT_EPSILON) ori = MT_Vector3(orimat[0][2], orimat[1][2], orimat[2][2]); - y = vect; + if (fac == 1.0) { + y = vect; + } else { + y = (vect * fac) + ((orimat * MT_Vector3(0.0, 1.0, 0.0)) * (1-fac)); + len = y.length(); + if (MT_fuzzyZero(len)) y = vect; + else y /= len; + } z = ori.cross(y); x = y.cross(z); break; @@ -619,7 +629,14 @@ void KX_GameObject::AlignAxisToVect(const MT_Vector3& dir, int axis) ori = MT_Vector3(orimat[0][1], orimat[1][1], orimat[2][1]); if (MT_abs(vect.dot(ori)) > 1.0-3.0*MT_EPSILON) ori = MT_Vector3(orimat[0][0], orimat[1][0], orimat[2][0]); - z = vect; + if (fac == 1.0) { + z = vect; + } else { + z = (vect * fac) + ((orimat * MT_Vector3(0.0, 0.0, 1.0)) * (1-fac)); + len = z.length(); + if (MT_fuzzyZero(len)) z = vect; + else z /= len; + } x = ori.cross(z); y = z.cross(x); break; @@ -644,11 +661,19 @@ void KX_GameObject::AlignAxisToVect(const MT_Vector3& dir, int axis) NodeSetLocalOrientation(orimat); } +MT_Scalar KX_GameObject::GetMass() +{ + if (m_pPhysicsController1) + { + return m_pPhysicsController1->GetMass(); + } + return 0.0; +} + MT_Vector3 KX_GameObject::GetLinearVelocity(bool local) { MT_Vector3 velocity(0.0,0.0,0.0), locvel; MT_Matrix3x3 ori; - int i, j; if (m_pPhysicsController1) { velocity = m_pPhysicsController1->GetLinearVelocity(); @@ -668,7 +693,6 @@ MT_Vector3 KX_GameObject::GetAngularVelocity(bool local) { MT_Vector3 velocity(0.0,0.0,0.0), locvel; MT_Matrix3x3 ori; - int i, j; if (m_pPhysicsController1) { velocity = m_pPhysicsController1->GetAngularVelocity(); @@ -737,6 +761,31 @@ void KX_GameObject::NodeSetRelativeScale(const MT_Vector3& scale) GetSGNode()->RelativeScale(scale); } +void KX_GameObject::NodeSetWorldPosition(const MT_Point3& trans) +{ + SG_Node* parent = m_pSGNode->GetSGParent(); + if (parent != NULL) + { + // Make sure the objects have some scale + MT_Vector3 scale = parent->GetWorldScaling(); + if (fabs(scale[0]) < FLT_EPSILON || + fabs(scale[1]) < FLT_EPSILON || + fabs(scale[2]) < FLT_EPSILON) + { + return; + } + scale[0] = 1.0/scale[0]; + scale[1] = 1.0/scale[1]; + scale[2] = 1.0/scale[2]; + MT_Matrix3x3 invori = parent->GetWorldOrientation().inverse(); + MT_Vector3 newpos = invori*(trans-parent->GetWorldPosition())*scale; + NodeSetLocalPosition(MT_Point3(newpos[0],newpos[1],newpos[2])); + } + else + { + NodeSetLocalPosition(trans); + } +} void KX_GameObject::NodeUpdateGS(double time,bool bInitiator) @@ -802,35 +851,37 @@ void KX_GameObject::Suspend(void) PyMethodDef KX_GameObject::Methods[] = { - {"setVisible",(PyCFunction) KX_GameObject::sPySetVisible, METH_VARARGS}, - {"getVisible",(PyCFunction) KX_GameObject::sPyGetVisible, METH_VARARGS}, - {"setState",(PyCFunction) KX_GameObject::sPySetState, METH_VARARGS}, - {"getState",(PyCFunction) KX_GameObject::sPyGetState, METH_VARARGS}, - {"alignAxisToVect",(PyCFunction) KX_GameObject::sPyAlignAxisToVect, METH_VARARGS}, - {"setPosition", (PyCFunction) KX_GameObject::sPySetPosition, METH_VARARGS}, - {"getPosition", (PyCFunction) KX_GameObject::sPyGetPosition, METH_VARARGS}, - {"getOrientation", (PyCFunction) KX_GameObject::sPyGetOrientation, METH_VARARGS}, - {"setOrientation", (PyCFunction) KX_GameObject::sPySetOrientation, METH_VARARGS}, + {"getPosition", (PyCFunction) KX_GameObject::sPyGetPosition, METH_NOARGS}, + {"setPosition", (PyCFunction) KX_GameObject::sPySetPosition, METH_O}, {"getLinearVelocity", (PyCFunction) KX_GameObject::sPyGetLinearVelocity, METH_VARARGS}, + {"setLinearVelocity", (PyCFunction) KX_GameObject::sPySetLinearVelocity, METH_VARARGS}, {"getVelocity", (PyCFunction) KX_GameObject::sPyGetVelocity, METH_VARARGS}, - {"getMass", (PyCFunction) KX_GameObject::sPyGetMass, METH_VARARGS}, - {"getReactionForce", (PyCFunction) KX_GameObject::sPyGetReactionForce, METH_VARARGS}, + {"getMass", (PyCFunction) KX_GameObject::sPyGetMass, METH_NOARGS}, + {"getReactionForce", (PyCFunction) KX_GameObject::sPyGetReactionForce, METH_NOARGS}, + {"getOrientation", (PyCFunction) KX_GameObject::sPyGetOrientation, METH_NOARGS}, + {"setOrientation", (PyCFunction) KX_GameObject::sPySetOrientation, METH_O}, + {"getVisible",(PyCFunction) KX_GameObject::sPyGetVisible, METH_NOARGS}, + {"setVisible",(PyCFunction) KX_GameObject::sPySetVisible, METH_O}, + {"getState",(PyCFunction) KX_GameObject::sPyGetState, METH_NOARGS}, + {"setState",(PyCFunction) KX_GameObject::sPySetState, METH_O}, + {"alignAxisToVect",(PyCFunction) KX_GameObject::sPyAlignAxisToVect, METH_VARARGS}, + {"getAxisVect",(PyCFunction) KX_GameObject::sPyGetAxisVect, METH_O}, + {"suspendDynamics", (PyCFunction)KX_GameObject::sPySuspendDynamics,METH_NOARGS}, + {"restoreDynamics", (PyCFunction)KX_GameObject::sPyRestoreDynamics,METH_NOARGS}, + {"enableRigidBody", (PyCFunction)KX_GameObject::sPyEnableRigidBody,METH_NOARGS}, + {"disableRigidBody", (PyCFunction)KX_GameObject::sPyDisableRigidBody,METH_NOARGS}, {"applyImpulse", (PyCFunction) KX_GameObject::sPyApplyImpulse, METH_VARARGS}, - {"setCollisionMargin", (PyCFunction) KX_GameObject::sPySetCollisionMargin, METH_VARARGS}, - {"suspendDynamics", (PyCFunction)KX_GameObject::sPySuspendDynamics,METH_VARARGS}, - {"restoreDynamics", (PyCFunction)KX_GameObject::sPyRestoreDynamics,METH_VARARGS}, - {"enableRigidBody", (PyCFunction)KX_GameObject::sPyEnableRigidBody,METH_VARARGS}, - {"disableRigidBody", (PyCFunction)KX_GameObject::sPyDisableRigidBody,METH_VARARGS}, - {"getParent", (PyCFunction)KX_GameObject::sPyGetParent,METH_VARARGS}, - {"setParent", (PyCFunction)KX_GameObject::sPySetParent,METH_VARARGS}, - {"removeParent", (PyCFunction)KX_GameObject::sPyRemoveParent,METH_VARARGS}, + {"setCollisionMargin", (PyCFunction) KX_GameObject::sPySetCollisionMargin, METH_O}, + {"getParent", (PyCFunction)KX_GameObject::sPyGetParent,METH_NOARGS}, + {"setParent", (PyCFunction)KX_GameObject::sPySetParent,METH_O}, + {"removeParent", (PyCFunction)KX_GameObject::sPyRemoveParent,METH_NOARGS}, {"getMesh", (PyCFunction)KX_GameObject::sPyGetMesh,METH_VARARGS}, - {"getPhysicsId", (PyCFunction)KX_GameObject::sPyGetPhysicsId,METH_VARARGS}, - {"getPropertyNames", (PyCFunction)KX_GameObject::sPyGetPropertyNames,METH_VARARGS}, - {"endObject",(PyCFunction) KX_GameObject::sPyEndObject, METH_VARARGS}, - KX_PYMETHODTABLE(KX_GameObject, getDistanceTo), + {"getPhysicsId", (PyCFunction)KX_GameObject::sPyGetPhysicsId,METH_NOARGS}, + {"getPropertyNames", (PyCFunction)KX_GameObject::sPyGetPropertyNames,METH_NOARGS}, + {"endObject",(PyCFunction) KX_GameObject::sPyEndObject, METH_NOARGS}, KX_PYMETHODTABLE(KX_GameObject, rayCastTo), KX_PYMETHODTABLE(KX_GameObject, rayCast), + KX_PYMETHODTABLE(KX_GameObject, getDistanceTo), {NULL,NULL} //Sentinel }; @@ -852,18 +903,7 @@ bool KX_GameObject::ConvertPythonVectorArgs(PyObject* args, } */ - -PyObject* KX_GameObject::sPySetPosition(PyObject* self, - PyObject* args, - PyObject* kwds) -{ - return ((KX_GameObject*) self)->PySetPosition(self, args, kwds); -} - - -PyObject* KX_GameObject::PyEndObject(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_GameObject::PyEndObject(PyObject* self) { KX_Scene *scene = PHY_GetActiveScene(); @@ -874,9 +914,7 @@ PyObject* KX_GameObject::PyEndObject(PyObject* self, } -PyObject* KX_GameObject::PyGetPosition(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_GameObject::PyGetPosition(PyObject* self) { return PyObjectFrom(NodeGetWorldPosition()); } @@ -930,7 +968,7 @@ PyObject* KX_GameObject::_getattr(const STR_String& attr) parent->AddRef(); return parent; } - Py_Return; + Py_RETURN_NONE; } if (attr == "visible") @@ -981,7 +1019,7 @@ int KX_GameObject::_setattr(const STR_String& attr, PyObject *value) // _setattr { MT_Scalar val = PyFloat_AsDouble(value); if (attr == "timeOffset") { - if (m_pSGNode->GetSGParent()->IsSlowParent()) { + if (m_pSGNode->GetSGParent() && m_pSGNode->GetSGParent()->IsSlowParent()) { static_cast(m_pSGNode->GetSGParent()->GetParentRelation())->SetTimeOffset(val); return 0; } else { @@ -1091,64 +1129,68 @@ PyObject* KX_GameObject::PyGetLinearVelocity(PyObject* self, } } - - -PyObject* KX_GameObject::PySetVisible(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_GameObject::PySetLinearVelocity(PyObject* self, + PyObject* args, + PyObject* kwds) { - int visible = 1; + int local = 0; + PyObject* pyvect; - if (PyArg_ParseTuple(args,"i",&visible)) - { - MarkVisible(visible!=0); - m_bVisible = (visible!=0); + if (PyArg_ParseTuple(args,"O|i",&pyvect,&local)) { + MT_Vector3 velocity; + if (PyVecTo(pyvect, velocity)) { + setLinearVelocity(velocity, (local!=0)); + Py_RETURN_NONE; + } } - else - { - return NULL; + return NULL; +} + +PyObject* KX_GameObject::PySetVisible(PyObject* self, PyObject* value) +{ + int visible = PyInt_AsLong(value); + + if (visible==-1 && PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "expected 0 or 1"); + return NULL; } - Py_Return; + + MarkVisible(visible!=0); + m_bVisible = (visible!=0); + Py_RETURN_NONE; } -PyObject* KX_GameObject::PyGetVisible(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_GameObject::PyGetVisible(PyObject* self) { return PyInt_FromLong(m_bVisible); } -PyObject* KX_GameObject::PyGetState(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_GameObject::PyGetState(PyObject* self) { int state = 0; state |= GetState(); return PyInt_FromLong(state); } -PyObject* KX_GameObject::PySetState(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_GameObject::PySetState(PyObject* self, PyObject* value) { - int state_i; + int state_i = PyInt_AsLong(value); unsigned int state = 0; - if (PyArg_ParseTuple(args,"i",&state_i)) - { - state |= state_i; - if ((state & ((1<<30)-1)) == 0) { - PyErr_SetString(PyExc_AttributeError, "The state bitfield was not between 0 and 30 (1<<0 and 1<<29)"); - return NULL; - } - SetState(state); + if (state_i == -1 && PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "expected an int bit field"); + return NULL; } - else - { - return NULL; + + state |= state_i; + if ((state & ((1<<30)-1)) == 0) { + PyErr_SetString(PyExc_AttributeError, "The state bitfield was not between 0 and 30 (1<<0 and 1<<29)"); + return NULL; } - Py_Return; + SetState(state); + + Py_RETURN_NONE; } @@ -1168,6 +1210,9 @@ PyObject* KX_GameObject::PyGetVelocity(PyObject* self, if (pypos) PyVecTo(pypos, point); } + else { + return NULL; + } if (m_pPhysicsController1) { @@ -1179,26 +1224,14 @@ PyObject* KX_GameObject::PyGetVelocity(PyObject* self, -PyObject* KX_GameObject::PyGetMass(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_GameObject::PyGetMass(PyObject* self) { - PyObject* pymass = NULL; - - float mass = GetPhysicsController()->GetMass(); - pymass = PyFloat_FromDouble(mass); - - if (pymass) - return pymass; - - Py_Return; + return PyFloat_FromDouble(GetPhysicsController()->GetMass()); } -PyObject* KX_GameObject::PyGetReactionForce(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_GameObject::PyGetReactionForce(PyObject* self) { // only can get the velocity if we have a physics object connected to us... return PyObjectFrom(GetPhysicsController()->getReactionForce()); @@ -1206,32 +1239,25 @@ PyObject* KX_GameObject::PyGetReactionForce(PyObject* self, -PyObject* KX_GameObject::PyEnableRigidBody(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_GameObject::PyEnableRigidBody(PyObject* self) { - GetPhysicsController()->setRigidBody(true); - Py_Return; + Py_RETURN_NONE; } -PyObject* KX_GameObject::PyDisableRigidBody(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_GameObject::PyDisableRigidBody(PyObject* self) { GetPhysicsController()->setRigidBody(false); - Py_Return; + Py_RETURN_NONE; } -PyObject* KX_GameObject::PyGetParent(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_GameObject::PyGetParent(PyObject* self) { KX_GameObject* parent = this->GetParent(); if (parent) @@ -1239,33 +1265,31 @@ PyObject* KX_GameObject::PyGetParent(PyObject* self, parent->AddRef(); return parent; } - Py_Return; + Py_RETURN_NONE; } -PyObject* KX_GameObject::PySetParent(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_GameObject::PySetParent(PyObject* self, PyObject* value) { - PyObject* gameobj; - if (PyArg_ParseTuple(args, "O!", &KX_GameObject::Type, &gameobj)) - { - // The object we want to set as parent - CValue *m_ob = (CValue*)gameobj; - KX_GameObject *obj = ((KX_GameObject*)m_ob); - KX_Scene *scene = PHY_GetActiveScene(); - - this->SetParent(scene, obj); + if (!PyObject_TypeCheck(value, &KX_GameObject::Type)) { + PyErr_SetString(PyExc_TypeError, "expected a KX_GameObject type"); + return NULL; } - Py_Return; + + // The object we want to set as parent + CValue *m_ob = (CValue*)value; + KX_GameObject *obj = ((KX_GameObject*)m_ob); + KX_Scene *scene = PHY_GetActiveScene(); + + this->SetParent(scene, obj); + + Py_RETURN_NONE; } -PyObject* KX_GameObject::PyRemoveParent(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_GameObject::PyRemoveParent(PyObject* self) { KX_Scene *scene = PHY_GetActiveScene(); this->RemoveParent(scene); - Py_Return; + Py_RETURN_NONE; } PyObject* KX_GameObject::PyGetMesh(PyObject* self, @@ -1282,28 +1306,28 @@ PyObject* KX_GameObject::PyGetMesh(PyObject* self, return meshproxy; } } - Py_Return; + Py_RETURN_NONE; } -PyObject* KX_GameObject::PySetCollisionMargin(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_GameObject::PySetCollisionMargin(PyObject* self, PyObject* value) { - float collisionMargin; - if (PyArg_ParseTuple(args, "f", &collisionMargin)) - { - if (m_pPhysicsController1) - { - m_pPhysicsController1->setMargin(collisionMargin); - Py_Return; - } - + float collisionMargin = PyFloat_AsDouble(value); + + if (collisionMargin==-1 && PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "expected a float"); + return NULL; } + if (m_pPhysicsController1) + { + m_pPhysicsController1->setMargin(collisionMargin); + Py_RETURN_NONE; + } + PyErr_SetString(PyExc_RuntimeError, "This object has no physics controller"); return NULL; } @@ -1315,17 +1339,20 @@ PyObject* KX_GameObject::PyApplyImpulse(PyObject* self, { PyObject* pyattach; PyObject* pyimpulse; + + if (!m_pPhysicsController1) { + PyErr_SetString(PyExc_RuntimeError, "This object has no physics controller"); + return NULL; + } + if (PyArg_ParseTuple(args, "OO", &pyattach, &pyimpulse)) { MT_Point3 attach; MT_Vector3 impulse; - if (m_pPhysicsController1) + if (PyVecTo(pyattach, attach) && PyVecTo(pyimpulse, impulse)) { - if (PyVecTo(pyattach, attach) && PyVecTo(pyimpulse, impulse)) - { - m_pPhysicsController1->applyImpulse(attach, impulse); - Py_Return; - } + m_pPhysicsController1->applyImpulse(attach, impulse); + Py_RETURN_NONE; } } @@ -1335,59 +1362,46 @@ PyObject* KX_GameObject::PyApplyImpulse(PyObject* self, -PyObject* KX_GameObject::PySuspendDynamics(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_GameObject::PySuspendDynamics(PyObject* self) { SuspendDynamics(); - Py_Return; + Py_RETURN_NONE; } -PyObject* KX_GameObject::PyRestoreDynamics(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_GameObject::PyRestoreDynamics(PyObject* self) { RestoreDynamics(); - Py_Return; + Py_RETURN_NONE; } -PyObject* KX_GameObject::PyGetOrientation(PyObject* self, - PyObject* args, - PyObject* kwds) //keywords +PyObject* KX_GameObject::PyGetOrientation(PyObject* self) //keywords { return PyObjectFrom(NodeGetWorldOrientation()); } -PyObject* KX_GameObject::PySetOrientation(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_GameObject::PySetOrientation(PyObject* self, PyObject* value) { - PyObject* pylist; - - if (PyArg_ParseTuple(args,"O",&pylist)) + MT_Matrix3x3 matrix; + if (PyObject_IsMT_Matrix(value, 3) && PyMatTo(value, matrix)) { - MT_Matrix3x3 matrix; - if (PyObject_IsMT_Matrix(pylist, 3) && PyMatTo(pylist, matrix)) - { - NodeSetLocalOrientation(matrix); - NodeUpdateGS(0.f,true); - Py_Return; - } - - MT_Quaternion quat; - if (PyVecTo(pylist, quat)) - { - matrix.setRotation(quat); - NodeSetLocalOrientation(matrix); - NodeUpdateGS(0.f,true); - Py_Return; - } + NodeSetLocalOrientation(matrix); + NodeUpdateGS(0.f,true); + Py_RETURN_NONE; + } + + MT_Quaternion quat; + if (PyVecTo(value, quat)) + { + matrix.setRotation(quat); + NodeSetLocalOrientation(matrix); + NodeUpdateGS(0.f,true); + Py_RETURN_NONE; } return NULL; } @@ -1398,37 +1412,44 @@ PyObject* KX_GameObject::PyAlignAxisToVect(PyObject* self, { PyObject* pyvect; int axis = 2; //z axis is the default + float fac = 1.0; - if (PyArg_ParseTuple(args,"O|i",&pyvect,&axis)) + if (PyArg_ParseTuple(args,"O|if",&pyvect,&axis, &fac)) { MT_Vector3 vect; if (PyVecTo(pyvect, vect)) { - AlignAxisToVect(vect,axis); - Py_Return; + AlignAxisToVect(vect,axis,fac); + Py_RETURN_NONE; } } return NULL; } -PyObject* KX_GameObject::PySetPosition(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_GameObject::PyGetAxisVect(PyObject* self, PyObject* value) { - MT_Point3 pos; - if (PyVecArgTo(args, pos)) + MT_Vector3 vect; + if (PyVecTo(value, vect)) { - NodeSetLocalPosition(pos); - NodeUpdateGS(0.f,true); - Py_Return; + return PyObjectFrom(NodeGetWorldOrientation() * vect); } - return NULL; } -PyObject* KX_GameObject::PyGetPhysicsId(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_GameObject::PySetPosition(PyObject* self, PyObject* value) +{ + MT_Point3 pos; + if (PyVecTo(value, pos)) + { + NodeSetLocalPosition(pos); + NodeUpdateGS(0.f,true); + Py_RETURN_NONE; + } + + return NULL; +} + +PyObject* KX_GameObject::PyGetPhysicsId(PyObject* self) { KX_IPhysicsController* ctrl = GetPhysicsController(); uint_ptr physid=0; @@ -1439,9 +1460,7 @@ PyObject* KX_GameObject::PyGetPhysicsId(PyObject* self, return PyInt_FromLong((long)physid); } -PyObject* KX_GameObject::PyGetPropertyNames(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_GameObject::PyGetPropertyNames(PyObject* self) { return ConvertKeysToPython(); } @@ -1505,8 +1524,10 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCastTo, { KX_GameObject *other; PyErr_Clear(); - if (!PyType_IsSubtype(pyarg->ob_type, &KX_GameObject::Type)) + if (!PyType_IsSubtype(pyarg->ob_type, &KX_GameObject::Type)) { + PyErr_SetString(PyExc_TypeError, "the first argument to rayCastTo must be a vector or a KX_GameObject"); return NULL; + } other = static_cast(pyarg); toPoint = other->NodeGetWorldPosition(); } @@ -1540,7 +1561,7 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCastTo, m_pHitObject->AddRef(); return m_pHitObject; } - Py_Return; + Py_RETURN_NONE; } KX_PYMETHODDEF_DOC(KX_GameObject, rayCast, @@ -1566,8 +1587,10 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCast, if (!PyVecTo(pyto, toPoint)) { PyErr_Clear(); - if (!PyType_IsSubtype(pyto->ob_type, &KX_GameObject::Type)) + if (!PyType_IsSubtype(pyto->ob_type, &KX_GameObject::Type)) { + PyErr_SetString(PyExc_TypeError, "the first argument to rayCast must be a vector or a KX_GameObject"); return NULL; + } other = static_cast(pyto); toPoint = other->NodeGetWorldPosition(); } @@ -1578,19 +1601,25 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCast, else if (!PyVecTo(pyfrom, fromPoint)) { PyErr_Clear(); - if (!PyType_IsSubtype(pyfrom->ob_type, &KX_GameObject::Type)) + if (!PyType_IsSubtype(pyfrom->ob_type, &KX_GameObject::Type)) { + PyErr_SetString(PyExc_TypeError, "the second optional argument to rayCast must be a vector or a KX_GameObject"); return NULL; + } other = static_cast(pyfrom); fromPoint = other->NodeGetWorldPosition(); } - - if (dist != 0.0f) - { + + if (dist != 0.0f) { MT_Vector3 toDir = toPoint-fromPoint; + if (MT_fuzzyZero(toDir.length2())) { + return Py_BuildValue("OOO", Py_None, Py_None, Py_None); + } toDir.normalize(); toPoint = fromPoint + (dist) * toDir; + } else if (MT_fuzzyZero((toPoint-fromPoint).length2())) { + return Py_BuildValue("OOO", Py_None, Py_None, Py_None); } - + MT_Point3 resultPoint; MT_Vector3 resultNormal; PHY_IPhysicsEnvironment* pe = GetPhysicsEnvironment(); @@ -1623,7 +1652,7 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCast, // resultNormal[0], resultNormal[1], resultNormal[2]); } return Py_BuildValue("OOO", Py_None, Py_None, Py_None); - //Py_Return; + //Py_RETURN_NONE; } /* --------------------------------------------------------------------- diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 89f4cb396d1..ddbf863aa1a 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -258,6 +258,12 @@ public: bool local=false ); + /** + * Return the mass of the object + */ + MT_Scalar + GetMass(); + /** * Return the angular velocity of the game object. */ @@ -272,7 +278,8 @@ public: void AlignAxisToVect( const MT_Vector3& vect, - int axis = 2 + int axis = 2, + float fac = 1.0 ); /** @@ -332,6 +339,9 @@ public: void NodeSetRelativeScale( const MT_Vector3& scale ); + // adapt local position so that world position is set to desired position + void NodeSetWorldPosition(const MT_Point3& trans); + void NodeUpdateGS( double time, @@ -480,15 +490,23 @@ public: UpdateNonDynas( ); + /** + * Function to set IPO option at start of IPO + */ + void + InitIPO( + bool ipo_as_force, + bool ipo_add, + bool ipo_local + ); + /** * Odd function to update an ipo. ??? */ void UpdateIPO( float curframetime, - bool recurse, - bool ipo_as_force, - bool force_ipo_local + bool recurse ); /** * Updates Material Ipo data @@ -696,46 +714,34 @@ public: PyObject *value ); // _setattr method - PyObject* - PySetPosition( - PyObject* self, - PyObject* args, - PyObject* kwds - ); - - static - PyObject* - sPySetPosition( - PyObject* self, - PyObject* args, - PyObject* kwds - ); - - KX_PYMETHOD(KX_GameObject,GetPosition); + KX_PYMETHOD_NOARGS(KX_GameObject,GetPosition); + KX_PYMETHOD_O(KX_GameObject,SetPosition); KX_PYMETHOD(KX_GameObject,GetLinearVelocity); + KX_PYMETHOD(KX_GameObject,SetLinearVelocity); KX_PYMETHOD(KX_GameObject,GetVelocity); - KX_PYMETHOD(KX_GameObject,GetMass); - KX_PYMETHOD(KX_GameObject,GetReactionForce); - KX_PYMETHOD(KX_GameObject,GetOrientation); - KX_PYMETHOD(KX_GameObject,SetOrientation); - KX_PYMETHOD(KX_GameObject,GetVisible); - KX_PYMETHOD(KX_GameObject,SetVisible); - KX_PYMETHOD(KX_GameObject,GetState); - KX_PYMETHOD(KX_GameObject,SetState); + KX_PYMETHOD_NOARGS(KX_GameObject,GetMass); + KX_PYMETHOD_NOARGS(KX_GameObject,GetReactionForce); + KX_PYMETHOD_NOARGS(KX_GameObject,GetOrientation); + KX_PYMETHOD_O(KX_GameObject,SetOrientation); + KX_PYMETHOD_NOARGS(KX_GameObject,GetVisible); + KX_PYMETHOD_O(KX_GameObject,SetVisible); + KX_PYMETHOD_NOARGS(KX_GameObject,GetState); + KX_PYMETHOD_O(KX_GameObject,SetState); KX_PYMETHOD(KX_GameObject,AlignAxisToVect); - KX_PYMETHOD(KX_GameObject,SuspendDynamics); - KX_PYMETHOD(KX_GameObject,RestoreDynamics); - KX_PYMETHOD(KX_GameObject,EnableRigidBody); - KX_PYMETHOD(KX_GameObject,DisableRigidBody); + KX_PYMETHOD_O(KX_GameObject,GetAxisVect); + KX_PYMETHOD_NOARGS(KX_GameObject,SuspendDynamics); + KX_PYMETHOD_NOARGS(KX_GameObject,RestoreDynamics); + KX_PYMETHOD_NOARGS(KX_GameObject,EnableRigidBody); + KX_PYMETHOD_NOARGS(KX_GameObject,DisableRigidBody); KX_PYMETHOD(KX_GameObject,ApplyImpulse); - KX_PYMETHOD(KX_GameObject,SetCollisionMargin); + KX_PYMETHOD_O(KX_GameObject,SetCollisionMargin); + KX_PYMETHOD_NOARGS(KX_GameObject,GetParent); + KX_PYMETHOD_O(KX_GameObject,SetParent); + KX_PYMETHOD_NOARGS(KX_GameObject,RemoveParent); KX_PYMETHOD(KX_GameObject,GetMesh); - KX_PYMETHOD(KX_GameObject,GetParent); - KX_PYMETHOD(KX_GameObject,SetParent); - KX_PYMETHOD(KX_GameObject,RemoveParent); - KX_PYMETHOD(KX_GameObject,GetPhysicsId); - KX_PYMETHOD(KX_GameObject,GetPropertyNames); - KX_PYMETHOD(KX_GameObject,EndObject); + KX_PYMETHOD_NOARGS(KX_GameObject,GetPhysicsId); + KX_PYMETHOD_NOARGS(KX_GameObject,GetPropertyNames); + KX_PYMETHOD_NOARGS(KX_GameObject,EndObject); KX_PYMETHOD_DOC(KX_GameObject,rayCastTo); KX_PYMETHOD_DOC(KX_GameObject,rayCast); KX_PYMETHOD_DOC(KX_GameObject,getDistanceTo); diff --git a/source/gameengine/Ketsji/KX_IPO_SGController.cpp b/source/gameengine/Ketsji/KX_IPO_SGController.cpp index 5303e9a9e85..d3aa924665e 100644 --- a/source/gameengine/Ketsji/KX_IPO_SGController.cpp +++ b/source/gameengine/Ketsji/KX_IPO_SGController.cpp @@ -55,7 +55,8 @@ typedef unsigned long uint_ptr; // start on another frame, the 1.0 should change. KX_IpoSGController::KX_IpoSGController() : m_ipo_as_force(false), - m_force_ipo_acts_local(false), + m_ipo_add(false), + m_ipo_local(false), m_modified(true), m_ipo_start_initialized(false), m_ipotime(1.0) @@ -75,8 +76,23 @@ void KX_IpoSGController::SetOption( m_ipo_as_force = (value != 0); m_modified = true; break; - case SG_CONTR_IPO_FORCES_ACT_LOCAL: - m_force_ipo_acts_local = (value != 0); + case SG_CONTR_IPO_IPO_ADD: + m_ipo_add = (value != 0); + m_modified = true; + break; + case SG_CONTR_IPO_RESET: + if (m_ipo_start_initialized && value) { + m_ipo_start_initialized = false; + m_modified = true; + } + break; + case SG_CONTR_IPO_LOCAL: + if (value/* && ((SG_Node*)m_pObject)->GetSGParent() == NULL*/) { + // only accept local Ipo if the object has no parent + m_ipo_local = true; + } else { + m_ipo_local = false; + } m_modified = true; break; default: @@ -129,15 +145,19 @@ bool KX_IpoSGController::Update(double currentTime) { if (m_game_object && ob) { - m_game_object->GetPhysicsController()->ApplyForce(m_force_ipo_acts_local ? + m_game_object->GetPhysicsController()->ApplyForce(m_ipo_local ? ob->GetWorldOrientation() * m_ipo_xform.GetPosition() : m_ipo_xform.GetPosition(), false); } } else { - //by default, leave object as it stands - MT_Point3 newPosition = ob->GetLocalPosition(); + // Local ipo should be defined with the object position at (0,0,0) + // Local transform is applied to the object based on initial position + MT_Point3 newPosition(0.0,0.0,0.0); + + if (!m_ipo_add) + newPosition = ob->GetLocalPosition(); //apply separate IPO channels if there is any data in them //Loc and dLoc act by themselves or are additive //LocX and dLocX @@ -145,23 +165,28 @@ bool KX_IpoSGController::Update(double currentTime) newPosition[0] = (m_ipo_channels_active[OB_DLOC_X] ? m_ipo_xform.GetPosition()[0] + m_ipo_xform.GetDeltaPosition()[0] : m_ipo_xform.GetPosition()[0]); } else if (m_ipo_channels_active[OB_DLOC_X] && m_ipo_start_initialized) { - newPosition[0] = (m_ipo_start_point[0] + m_ipo_xform.GetDeltaPosition()[0]); + newPosition[0] = (((!m_ipo_add)?m_ipo_start_point[0]:0.0) + m_ipo_xform.GetDeltaPosition()[0]); } //LocY and dLocY if (m_ipo_channels_active[OB_LOC_Y]) { newPosition[1] = (m_ipo_channels_active[OB_DLOC_Y] ? m_ipo_xform.GetPosition()[1] + m_ipo_xform.GetDeltaPosition()[1] : m_ipo_xform.GetPosition()[1]); } else if (m_ipo_channels_active[OB_DLOC_Y] && m_ipo_start_initialized) { - newPosition[1] = (m_ipo_start_point[1] + m_ipo_xform.GetDeltaPosition()[1]); + newPosition[1] = (((!m_ipo_add)?m_ipo_start_point[1]:0.0) + m_ipo_xform.GetDeltaPosition()[1]); } //LocZ and dLocZ if (m_ipo_channels_active[OB_LOC_Z]) { newPosition[2] = (m_ipo_channels_active[OB_DLOC_Z] ? m_ipo_xform.GetPosition()[2] + m_ipo_xform.GetDeltaPosition()[2] : m_ipo_xform.GetPosition()[2]); } else if (m_ipo_channels_active[OB_DLOC_Z] && m_ipo_start_initialized) { - newPosition[2] = (m_ipo_start_point[2] + m_ipo_xform.GetDeltaPosition()[2]); + newPosition[2] = (((!m_ipo_add)?m_ipo_start_point[2]:0.0) + m_ipo_xform.GetDeltaPosition()[2]); + } + if (m_ipo_add) { + if (m_ipo_local) + newPosition = m_ipo_start_point + m_ipo_start_scale*(m_ipo_start_orient*newPosition); + else + newPosition = m_ipo_start_point + newPosition; } - ob->SetLocalPosition(newPosition); } } @@ -170,21 +195,23 @@ bool KX_IpoSGController::Update(double currentTime) if (m_ipo_as_force) { if (m_game_object && ob) { - m_game_object->ApplyTorque(m_force_ipo_acts_local ? + m_game_object->ApplyTorque(m_ipo_local ? ob->GetWorldOrientation() * m_ipo_xform.GetEulerAngles() : m_ipo_xform.GetEulerAngles(), false); } } else { - double yaw, pitch, roll; //final Euler angles + double yaw=0, pitch=0, roll=0; //final Euler angles double tempYaw=0, tempPitch=0, tempRoll=0; //temp holders - ob->GetLocalOrientation().getEuler(yaw, pitch, roll); + if (!m_ipo_add) + ob->GetLocalOrientation().getEuler(yaw, pitch, roll); //RotX and dRotX if (m_ipo_channels_active[OB_ROT_X]) { yaw = (m_ipo_channels_active[OB_DROT_X] ? (m_ipo_xform.GetEulerAngles()[0] + m_ipo_xform.GetDeltaEulerAngles()[0]) : m_ipo_xform.GetEulerAngles()[0] ); } else if (m_ipo_channels_active[OB_DROT_X] && m_ipo_start_initialized) { - m_ipo_start_orient.getEuler(tempYaw, tempPitch, tempRoll); + if (!m_ipo_add) + m_ipo_start_orient.getEuler(tempYaw, tempPitch, tempRoll); yaw = tempYaw + m_ipo_xform.GetDeltaEulerAngles()[0]; } @@ -193,7 +220,8 @@ bool KX_IpoSGController::Update(double currentTime) pitch = (m_ipo_channels_active[OB_DROT_Y] ? (m_ipo_xform.GetEulerAngles()[1] + m_ipo_xform.GetDeltaEulerAngles()[1]) : m_ipo_xform.GetEulerAngles()[1] ); } else if (m_ipo_channels_active[OB_DROT_Y] && m_ipo_start_initialized) { - m_ipo_start_orient.getEuler(tempYaw, tempPitch, tempRoll); + if (!m_ipo_add) + m_ipo_start_orient.getEuler(tempYaw, tempPitch, tempRoll); pitch = tempPitch + m_ipo_xform.GetDeltaEulerAngles()[1]; } @@ -202,23 +230,34 @@ bool KX_IpoSGController::Update(double currentTime) roll = (m_ipo_channels_active[OB_DROT_Z] ? (m_ipo_xform.GetEulerAngles()[2] + m_ipo_xform.GetDeltaEulerAngles()[2]) : m_ipo_xform.GetEulerAngles()[2] ); } else if (m_ipo_channels_active[OB_DROT_Z] && m_ipo_start_initialized) { - m_ipo_start_orient.getEuler(tempYaw, tempPitch, tempRoll); + if (!m_ipo_add) + m_ipo_start_orient.getEuler(tempYaw, tempPitch, tempRoll); roll = tempRoll + m_ipo_xform.GetDeltaEulerAngles()[2]; } - - ob->SetLocalOrientation(MT_Vector3(yaw, pitch, roll)); + if (m_ipo_add) { + MT_Matrix3x3 rotation(MT_Vector3(yaw, pitch, roll)); + if (m_ipo_local) + rotation = m_ipo_start_orient * rotation; + else + rotation = rotation * m_ipo_start_orient; + ob->SetLocalOrientation(rotation); + } else { + ob->SetLocalOrientation(MT_Vector3(yaw, pitch, roll)); + } } } //modifies scale? if (m_ipo_channels_active[OB_SIZE_X] || m_ipo_channels_active[OB_SIZE_Y] || m_ipo_channels_active[OB_SIZE_Z] || m_ipo_channels_active[OB_DSIZE_X] || m_ipo_channels_active[OB_DSIZE_Y] || m_ipo_channels_active[OB_DSIZE_Z]) { //default is no scale change - MT_Vector3 newScale = ob->GetLocalScale(); + MT_Vector3 newScale(1.0,1.0,1.0); + if (!m_ipo_add) + newScale = ob->GetLocalScale(); if (m_ipo_channels_active[OB_SIZE_X]) { newScale[0] = (m_ipo_channels_active[OB_DSIZE_X] ? (m_ipo_xform.GetScaling()[0] + m_ipo_xform.GetDeltaScaling()[0]) : m_ipo_xform.GetScaling()[0]); } else if (m_ipo_channels_active[OB_DSIZE_X] && m_ipo_start_initialized) { - newScale[0] = (m_ipo_xform.GetDeltaScaling()[0] + m_ipo_start_scale[0]); + newScale[0] = (m_ipo_xform.GetDeltaScaling()[0] + ((!m_ipo_add)?m_ipo_start_scale[0]:0.0)); } //RotY dRotY @@ -226,7 +265,7 @@ bool KX_IpoSGController::Update(double currentTime) newScale[1] = (m_ipo_channels_active[OB_DSIZE_Y] ? (m_ipo_xform.GetScaling()[1] + m_ipo_xform.GetDeltaScaling()[1]): m_ipo_xform.GetScaling()[1]); } else if (m_ipo_channels_active[OB_DSIZE_Y] && m_ipo_start_initialized) { - newScale[1] = (m_ipo_xform.GetDeltaScaling()[1] + m_ipo_start_scale[1]); + newScale[1] = (m_ipo_xform.GetDeltaScaling()[1] + ((!m_ipo_add)?m_ipo_start_scale[1]:0.0)); } //RotZ and dRotZ @@ -234,7 +273,11 @@ bool KX_IpoSGController::Update(double currentTime) newScale[2] = (m_ipo_channels_active[OB_DSIZE_Z] ? (m_ipo_xform.GetScaling()[2] + m_ipo_xform.GetDeltaScaling()[2]) : m_ipo_xform.GetScaling()[2]); } else if (m_ipo_channels_active[OB_DSIZE_Z] && m_ipo_start_initialized) { - newScale[2] = (m_ipo_xform.GetDeltaScaling()[2] + m_ipo_start_scale[2]); + newScale[2] = (m_ipo_xform.GetDeltaScaling()[2] + ((!m_ipo_add)?m_ipo_start_scale[2]:1.0)); + } + + if (m_ipo_add) { + newScale = m_ipo_start_scale * newScale; } ob->SetLocalScale(newScale); diff --git a/source/gameengine/Ketsji/KX_IPO_SGController.h b/source/gameengine/Ketsji/KX_IPO_SGController.h index 7b5a151b41c..0bd8980f11c 100644 --- a/source/gameengine/Ketsji/KX_IPO_SGController.h +++ b/source/gameengine/Ketsji/KX_IPO_SGController.h @@ -48,8 +48,11 @@ class KX_IpoSGController : public SG_Controller /** Interpret the ipo as a force rather than a displacement? */ bool m_ipo_as_force; - /** Ipo-as-force acts in local rather than in global coordinates? */ - bool m_force_ipo_acts_local; + /** Add Ipo curve to current loc/rot/scale */ + bool m_ipo_add; + + /** Ipo must be applied in local coordinate rather than in global coordinates (used for force and Add mode)*/ + bool m_ipo_local; /** Were settings altered since the last update? */ bool m_modified; diff --git a/source/gameengine/Ketsji/KX_IpoActuator.cpp b/source/gameengine/Ketsji/KX_IpoActuator.cpp index cf246342cf9..b7103f49aee 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.cpp +++ b/source/gameengine/Ketsji/KX_IpoActuator.cpp @@ -59,40 +59,6 @@ STR_String KX_IpoActuator::S_KX_ACT_IPO_FROM_PROP_STRING = "FromProp"; /* ------------------------------------------------------------------------- */ /* Native functions */ /* ------------------------------------------------------------------------- */ -/** Another poltergeist? This seems to be a very transient class... */ -class CIpoAction : public CAction -{ - float m_curtime; - bool m_recurse; - KX_GameObject* m_gameobj; - bool m_ipo_as_force; - bool m_force_ipo_local; - -public: - CIpoAction(KX_GameObject* gameobj, - float curtime, - bool recurse, - bool ipo_as_force, - bool force_ipo_local) : - m_curtime(curtime) , - m_recurse(recurse), - m_gameobj(gameobj), - m_ipo_as_force(ipo_as_force), - m_force_ipo_local(force_ipo_local) - { - /* intentionally empty */ - }; - - virtual void Execute() const - { - m_gameobj->UpdateIPO( - m_curtime, - m_recurse, - m_ipo_as_force, - m_force_ipo_local); - }; - -}; KX_IpoActuator::KX_IpoActuator(SCA_IObject* gameobj, const STR_String& propname, @@ -101,7 +67,8 @@ KX_IpoActuator::KX_IpoActuator(SCA_IObject* gameobj, bool recurse, int acttype, bool ipo_as_force, - bool force_ipo_local, + bool ipo_add, + bool ipo_local, PyTypeObject* T) : SCA_IActuator(gameobj,T), m_bNegativeEvent(false), @@ -112,7 +79,8 @@ KX_IpoActuator::KX_IpoActuator(SCA_IObject* gameobj, m_direction(1), m_propname(propname), m_ipo_as_force(ipo_as_force), - m_force_ipo_local(force_ipo_local), + m_ipo_add(ipo_add), + m_ipo_local(ipo_local), m_type((IpoActType)acttype) { m_starttime = -2.0*fabs(m_endframe - m_startframe) - 1.0; @@ -160,7 +128,7 @@ bool KX_IpoActuator::ClampLocalTime() void KX_IpoActuator::SetStartTime(float curtime) { - float direction = m_startframe < m_endframe ? 1.0 : -1.0; + float direction = m_startframe < m_endframe ? 1.0f : -1.0f; curtime = curtime - KX_KetsjiEngine::GetSuspendedDelta(); if (m_direction > 0) @@ -195,31 +163,26 @@ bool KX_IpoActuator::Update(double curtime, bool frame) // maybe there are events for us in the queue ! bool bNegativeEvent = false; int numevents = 0; + bool bIpoStart = false; if (frame) { numevents = m_events.size(); - for (vector::iterator i=m_events.end(); !(i==m_events.begin());) - { - --i; - if ((*i)->GetNumber() == 0.0f) - bNegativeEvent = true; - - (*i)->Release(); - } - m_events.clear(); + bNegativeEvent = IsNegativeEvent(); + RemoveAllEvents(); } - double start_smaller_then_end = ( m_startframe < m_endframe ? 1.0 : -1.0); + float start_smaller_then_end = ( m_startframe < m_endframe ? 1.0f : -1.0f); bool result=true; if (!bNegativeEvent) { - if (m_starttime < -2.0*start_smaller_then_end*(m_endframe - m_startframe)) + if (m_starttime < -2.0f*start_smaller_then_end*(m_endframe - m_startframe)) { // start for all Ipo, initial start for LOOP_STOP m_starttime = curtime - KX_KetsjiEngine::GetSuspendedDelta(); m_bIpoPlaying = true; + bIpoStart = true; } } @@ -230,7 +193,7 @@ bool KX_IpoActuator::Update(double curtime, bool frame) { // Check if playing forwards. result = ! finished - if (start_smaller_then_end > 0.0) + if (start_smaller_then_end > 0.f) result = (m_localtime < m_endframe && m_bIpoPlaying); else result = (m_localtime > m_endframe && m_bIpoPlaying); @@ -241,14 +204,10 @@ bool KX_IpoActuator::Update(double curtime, bool frame) /* Perform clamping */ ClampLocalTime(); - - CIpoAction ipoaction( - (KX_GameObject*)GetParent(), - m_localtime, - m_recurse, - m_ipo_as_force, - m_force_ipo_local); - GetParent()->Execute(ipoaction); + + if (bIpoStart) + ((KX_GameObject*)GetParent())->InitIPO(m_ipo_as_force, m_ipo_add, m_ipo_local); + ((KX_GameObject*)GetParent())->UpdateIPO(m_localtime,m_recurse); } else { m_localtime=m_startframe; @@ -270,13 +229,9 @@ bool KX_IpoActuator::Update(double curtime, bool frame) m_direction = -m_direction; } - CIpoAction ipoaction( - (KX_GameObject*) GetParent(), - m_localtime, - m_recurse, - m_ipo_as_force, - m_force_ipo_local); - GetParent()->Execute(ipoaction); + if (bIpoStart && m_direction > 0) + ((KX_GameObject*)GetParent())->InitIPO(m_ipo_as_force, m_ipo_add, m_ipo_local); + ((KX_GameObject*)GetParent())->UpdateIPO(m_localtime,m_recurse); break; } case KX_ACT_IPO_FLIPPER: @@ -299,14 +254,10 @@ bool KX_IpoActuator::Update(double curtime, bool frame) if (ClampLocalTime() && m_localtime == m_startframe) result = false; - - CIpoAction ipoaction( - (KX_GameObject*) GetParent(), - m_localtime, - m_recurse, - m_ipo_as_force, - m_force_ipo_local); - GetParent()->Execute(ipoaction); + + if (bIpoStart) + ((KX_GameObject*)GetParent())->InitIPO(m_ipo_as_force, m_ipo_add, m_ipo_local); + ((KX_GameObject*)GetParent())->UpdateIPO(m_localtime,m_recurse); break; } @@ -352,8 +303,12 @@ bool KX_IpoActuator::Update(double curtime, bool frame) if (!m_bNegativeEvent){ /* Perform wraparound */ SetLocalTime(curtime); - m_localtime = m_startframe + fmod(m_localtime, m_startframe - m_endframe); + if (start_smaller_then_end > 0.f) + m_localtime = m_startframe + fmod(m_localtime - m_startframe, m_endframe - m_startframe); + else + m_localtime = m_startframe - fmod(m_startframe - m_localtime, m_startframe - m_endframe); SetStartTime(curtime); + bIpoStart = true; } else { @@ -365,13 +320,9 @@ bool KX_IpoActuator::Update(double curtime, bool frame) } } - CIpoAction ipoaction( - (KX_GameObject*) GetParent(), - m_localtime, - m_recurse, - m_ipo_as_force, - m_force_ipo_local); - GetParent()->Execute(ipoaction); + if (m_bIpoPlaying && bIpoStart) + ((KX_GameObject*)GetParent())->InitIPO(m_ipo_as_force, m_ipo_add, m_ipo_local); + ((KX_GameObject*)GetParent())->UpdateIPO(m_localtime,m_recurse); break; } @@ -391,14 +342,9 @@ bool KX_IpoActuator::Update(double curtime, bool frame) { m_localtime = propval->GetNumber(); - CIpoAction ipoaction( - (KX_GameObject*) GetParent(), - m_localtime, - m_recurse, - m_ipo_as_force, - m_force_ipo_local); - GetParent()->Execute(ipoaction); - + if (bIpoStart) + ((KX_GameObject*)GetParent())->InitIPO(m_ipo_as_force, m_ipo_add, m_ipo_local); + ((KX_GameObject*)GetParent())->UpdateIPO(m_localtime,m_recurse); } else { result = false; @@ -493,6 +439,10 @@ PyMethodDef KX_IpoActuator::Methods[] = { METH_VARARGS, SetIpoAsForce_doc}, {"getIpoAsForce", (PyCFunction) KX_IpoActuator::sPyGetIpoAsForce, METH_VARARGS, GetIpoAsForce_doc}, + {"setIpoAdd", (PyCFunction) KX_IpoActuator::sPySetIpoAdd, + METH_VARARGS, SetIpoAdd_doc}, + {"getIpoAdd", (PyCFunction) KX_IpoActuator::sPyGetIpoAdd, + METH_VARARGS, GetIpoAdd_doc}, {"setType", (PyCFunction) KX_IpoActuator::sPySetType, METH_VARARGS, SetType_doc}, {"getType", (PyCFunction) KX_IpoActuator::sPyGetType, @@ -512,11 +462,11 @@ PyObject* KX_IpoActuator::_getattr(const STR_String& attr) { /* set --------------------------------------------------------------------- */ char KX_IpoActuator::Set_doc[] = -"set(mode, startframe, endframe, force?)\n" -"\t - mode: Play, PingPong, Flipper, LoopStop, LoopEnd or FromProp (string)\n" +"set(type, startframe, endframe, mode?)\n" +"\t - type: Play, PingPong, Flipper, LoopStop, LoopEnd or FromProp (string)\n" "\t - startframe: first frame to use (int)\n" "\t - endframe : last frame to use (int)\n" -"\t - force? : interpret this ipo as a force? (KX_TRUE, KX_FALSE)" +"\t - mode? : special mode (0=normal, 1=interpret location as force, 2=additive)" "\tSet the properties of the actuator.\n"; PyObject* KX_IpoActuator::PySet(PyObject* self, PyObject* args, @@ -543,7 +493,8 @@ PyObject* KX_IpoActuator::PySet(PyObject* self, m_type = modenum; m_startframe = startFrame; m_endframe = stopFrame; - m_ipo_as_force = PyArgToBool(forceToggle); + m_ipo_as_force = forceToggle == 1; + m_ipo_add = forceToggle == 2; break; default: ; /* error */ @@ -641,6 +592,8 @@ PyObject* KX_IpoActuator::PySetIpoAsForce(PyObject* self, } m_ipo_as_force = PyArgToBool(boolArg); + if (m_ipo_as_force) + m_ipo_add = false; Py_Return; } @@ -654,6 +607,36 @@ PyObject* KX_IpoActuator::PyGetIpoAsForce(PyObject* self, return BoolToPyArg(m_ipo_as_force); } +/* 6. setIpoAsForce: */ +char KX_IpoActuator::SetIpoAdd_doc[] = +"setIpoAdd(add?)\n" +"\t - add? : add flag (KX_TRUE, KX_FALSE)\n" +"\tSet whether to interpret the ipo as additive rather than absolute.\n"; +PyObject* KX_IpoActuator::PySetIpoAdd(PyObject* self, + PyObject* args, + PyObject* kwds) { + int boolArg; + + if (!PyArg_ParseTuple(args, "i", &boolArg)) { + return NULL; + } + + m_ipo_add = PyArgToBool(boolArg); + if (m_ipo_add) + m_ipo_as_force = false; + + Py_Return; +} +/* 7. getIpoAsForce: */ +char KX_IpoActuator::GetIpoAdd_doc[] = +"getIpoAsAdd()\n" +"\tReturns whether to interpret the ipo as additive rather than absolute.\n"; +PyObject* KX_IpoActuator::PyGetIpoAdd(PyObject* self, + PyObject* args, + PyObject* kwds) { + return BoolToPyArg(m_ipo_add); +} + /* 8. setType: */ char KX_IpoActuator::SetType_doc[] = "setType(mode)\n" @@ -701,7 +684,7 @@ PyObject* KX_IpoActuator::PySetForceIpoActsLocal(PyObject* self, return NULL; } - m_force_ipo_local = PyArgToBool(boolArg); + m_ipo_local = PyArgToBool(boolArg); Py_Return; } @@ -713,7 +696,7 @@ char KX_IpoActuator::GetForceIpoActsLocal_doc[] = PyObject* KX_IpoActuator::PyGetForceIpoActsLocal(PyObject* self, PyObject* args, PyObject* kwds) { - return BoolToPyArg(m_force_ipo_local); + return BoolToPyArg(m_ipo_local); } diff --git a/source/gameengine/Ketsji/KX_IpoActuator.h b/source/gameengine/Ketsji/KX_IpoActuator.h index 79e8daa3f87..ae554fb0fce 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.h +++ b/source/gameengine/Ketsji/KX_IpoActuator.h @@ -75,8 +75,11 @@ protected: /** Interpret the ipo as a force? */ bool m_ipo_as_force; - /** Apply a force-ipo locally? */ - bool m_force_ipo_local; + /** Add Ipo curve to current loc/rot/scale */ + bool m_ipo_add; + + /** The Ipo curve is applied in local coordinates */ + bool m_ipo_local; bool m_bIpoPlaying; @@ -113,7 +116,8 @@ public: bool recurse, int acttype, bool ipo_as_force, - bool force_ipo_local, + bool ipo_add, + bool ipo_local, PyTypeObject* T=&Type); virtual ~KX_IpoActuator() {}; @@ -144,6 +148,8 @@ public: KX_PYMETHOD_DOC(KX_IpoActuator,GetEnd); KX_PYMETHOD_DOC(KX_IpoActuator,SetIpoAsForce); KX_PYMETHOD_DOC(KX_IpoActuator,GetIpoAsForce); + KX_PYMETHOD_DOC(KX_IpoActuator,SetIpoAdd); + KX_PYMETHOD_DOC(KX_IpoActuator,GetIpoAdd); KX_PYMETHOD_DOC(KX_IpoActuator,SetType); KX_PYMETHOD_DOC(KX_IpoActuator,GetType); KX_PYMETHOD_DOC(KX_IpoActuator,SetForceIpoActsLocal); diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index 56a06786679..20187a193ba 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -55,6 +55,7 @@ #include "KX_Scene.h" #include "MT_CmMatrix4x4.h" #include "KX_Camera.h" +#include "KX_Light.h" #include "KX_PythonInit.h" #include "KX_PyConstraintBinding.h" #include "PHY_IPhysicsEnvironment.h" @@ -614,6 +615,9 @@ void KX_KetsjiEngine::Render() // pass the scene's worldsettings to the rasterizer SetWorldSettings(scene->GetWorldInfo()); + // shadow buffers + RenderShadowBuffers(scene); + // Avoid drawing the scene with the active camera twice when it's viewport is enabled if(cam && !cam->GetViewport()) { @@ -885,8 +889,48 @@ void KX_KetsjiEngine::SetupRenderFrame(KX_Scene *scene, KX_Camera* cam) viewport.GetTop() ); -} +} +void KX_KetsjiEngine::RenderShadowBuffers(KX_Scene *scene) +{ + CListValue *lightlist = scene->GetLightList(); + int i, drawmode; + + for(i=0; iGetCount(); i++) { + KX_LightObject *light = (KX_LightObject*)lightlist->GetValue(i); + + light->Update(); + + if(m_drawingmode == RAS_IRasterizer::KX_TEXTURED && light->HasShadowBuffer()) { + /* make temporary camera */ + RAS_CameraData camdata = RAS_CameraData(); + KX_Camera *cam = new KX_Camera(scene, scene->m_callbacks, camdata, false); + cam->SetName("__shadow__cam__"); + + MT_Transform camtrans; + + /* switch drawmode for speed */ + drawmode = m_rasterizer->GetDrawingMode(); + m_rasterizer->SetDrawingMode(RAS_IRasterizer::KX_SHADOW); + + /* binds framebuffer object, sets up camera .. */ + light->BindShadowBuffer(m_rasterizer, cam, camtrans); + + /* update scene */ + scene->UpdateMeshTransformations(); + scene->CalculateVisibleMeshes(m_rasterizer, cam, light->GetShadowLayer()); + + /* render */ + m_rasterizer->ClearDepthBuffer(); + scene->RenderBuckets(camtrans, m_rasterizer, m_rendertools); + + /* unbind framebuffer object, restore drawmode, free camera */ + light->UnbindShadowBuffer(m_rasterizer); + m_rasterizer->SetDrawingMode(drawmode); + cam->Release(); + } + } +} // update graphics void KX_KetsjiEngine::RenderFrame(KX_Scene* scene, KX_Camera* cam) diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h index 4c09bc3fcd5..77b69ec2d9e 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.h +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h @@ -179,6 +179,7 @@ private: void RenderFrame(KX_Scene* scene, KX_Camera* cam); void PostRenderFrame(); void RenderDebugProperties(); + void RenderShadowBuffers(KX_Scene *scene); void SetBackGround(KX_WorldInfo* worldinfo); void SetWorldSettings(KX_WorldInfo* worldinfo); void DoSound(KX_Scene* scene); diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp index 7decc5bc769..4e3d6180d22 100644 --- a/source/gameengine/Ketsji/KX_Light.cpp +++ b/source/gameengine/Ketsji/KX_Light.cpp @@ -36,14 +36,20 @@ #endif #include "KX_Light.h" +#include "KX_Camera.h" +#include "RAS_IRasterizer.h" #include "RAS_IRenderTools.h" #include "KX_PyMath.h" +#ifdef BLENDER_GLSL +#include "GPU_material.h" +#endif KX_LightObject::KX_LightObject(void* sgReplicationInfo,SG_Callbacks callbacks, class RAS_IRenderTools* rendertools, const RAS_LightObject& lightobj, + struct GPULamp *gpulamp, PyTypeObject* T ) : @@ -53,12 +59,12 @@ KX_LightObject::KX_LightObject(void* sgReplicationInfo,SG_Callbacks callbacks, m_lightobj = lightobj; m_lightobj.m_worldmatrix = GetOpenGLMatrixPtr(); m_rendertools->AddLight(&m_lightobj); + m_gpulamp = gpulamp; }; KX_LightObject::~KX_LightObject() { - m_rendertools->RemoveLight(&m_lightobj); } @@ -78,6 +84,78 @@ CValue* KX_LightObject::GetReplica() return replica; } +void KX_LightObject::Update() +{ +#ifdef BLENDER_GLSL + if(m_gpulamp) { + float obmat[4][4]; + double *dobmat = GetOpenGLMatrixPtr()->getPointer(); + + for(int i=0; i<4; i++) + for(int j=0; j<4; j++, dobmat++) + obmat[i][j] = (float)*dobmat; + + GPU_lamp_update(m_gpulamp, obmat); + } +#endif +} + +bool KX_LightObject::HasShadowBuffer() +{ +#ifdef BLENDER_GLSL + return (m_gpulamp && GPU_lamp_has_shadow_buffer(m_gpulamp)); +#else + return false; +#endif +} + +int KX_LightObject::GetShadowLayer() +{ +#ifdef BLENDER_GLSL + if(m_gpulamp) + return GPU_lamp_shadow_layer(m_gpulamp); + else +#endif + return 0; +} + +void KX_LightObject::BindShadowBuffer(RAS_IRasterizer *ras, KX_Camera *cam, MT_Transform& camtrans) +{ +#ifdef BLENDER_GLSL + float viewmat[4][4], winmat[4][4]; + int winsize; + + /* bind framebuffer */ + GPU_lamp_shadow_buffer_bind(m_gpulamp, viewmat, &winsize, winmat); + + /* setup camera transformation */ + MT_Matrix4x4 modelviewmat((float*)viewmat); + MT_Matrix4x4 projectionmat((float*)winmat); + + MT_Transform trans = MT_Transform((float*)viewmat); + camtrans.invert(trans); + + cam->SetModelviewMatrix(modelviewmat); + cam->SetProjectionMatrix(projectionmat); + + cam->NodeSetLocalPosition(camtrans.getOrigin()); + cam->NodeSetLocalOrientation(camtrans.getBasis()); + cam->NodeUpdateGS(0,true); + + /* setup rasterizer transformations */ + ras->SetProjectionMatrix(projectionmat); + ras->SetViewMatrix(modelviewmat, cam->NodeGetWorldPosition(), + cam->GetCameraLocation(), cam->GetCameraOrientation()); +#endif +} + +void KX_LightObject::UnbindShadowBuffer(RAS_IRasterizer *ras) +{ +#ifdef BLENDER_GLSL + GPU_lamp_shadow_buffer_unbind(m_gpulamp); +#endif +} + PyObject* KX_LightObject::_getattr(const STR_String& attr) { if (attr == "layer") diff --git a/source/gameengine/Ketsji/KX_Light.h b/source/gameengine/Ketsji/KX_Light.h index 236d3e4e12e..62eb26c61a8 100644 --- a/source/gameengine/Ketsji/KX_Light.h +++ b/source/gameengine/Ketsji/KX_Light.h @@ -32,19 +32,33 @@ #include "RAS_LightObject.h" #include "KX_GameObject.h" +struct GPULamp; +class KX_Camera; +class RAS_IRasterizer; +class RAS_IRenderTools; +class MT_Transform; + class KX_LightObject : public KX_GameObject { Py_Header; protected: RAS_LightObject m_lightobj; class RAS_IRenderTools* m_rendertools; //needed for registering and replication of lightobj + struct GPULamp *m_gpulamp; static char doc[]; public: - KX_LightObject(void* sgReplicationInfo,SG_Callbacks callbacks,class RAS_IRenderTools* rendertools,const struct RAS_LightObject& lightobj, PyTypeObject *T = &Type); + KX_LightObject(void* sgReplicationInfo,SG_Callbacks callbacks,class RAS_IRenderTools* rendertools,const struct RAS_LightObject& lightobj, struct GPULamp *gpulamp, PyTypeObject *T = &Type); virtual ~KX_LightObject(); virtual CValue* GetReplica(); RAS_LightObject* GetLightData() { return &m_lightobj;} + + /* GLSL shadow */ + bool HasShadowBuffer(); + int GetShadowLayer(); + void BindShadowBuffer(class RAS_IRasterizer *ras, class KX_Camera *cam, class MT_Transform& camtrans); + void UnbindShadowBuffer(class RAS_IRasterizer *ras); + void Update(); virtual PyObject* _getattr(const STR_String& attr); /* lens, near, far, projection_matrix */ virtual int _setattr(const STR_String& attr, PyObject *pyvalue); diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index 5c8fef1fca0..c7a251751cd 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -157,6 +157,9 @@ PyObject* KX_MeshProxy::PyGetMaterialName(PyObject* self, { matname = m_meshobj->GetMaterialName(matid); } + else { + return NULL; + } return PyString_FromString(matname.Ptr()); @@ -174,6 +177,9 @@ PyObject* KX_MeshProxy::PyGetTextureName(PyObject* self, { matname = m_meshobj->GetTextureName(matid); } + else { + return NULL; + } return PyString_FromString(matname.Ptr()); @@ -195,6 +201,9 @@ PyObject* KX_MeshProxy::PyGetVertexArrayLength(PyObject* self, length = m_meshobj->GetVertexArrayLength(mat); } } + else { + return NULL; + } return PyInt_FromLong(length); @@ -217,6 +226,9 @@ PyObject* KX_MeshProxy::PyGetVertex(PyObject* self, vertexob = new KX_VertexProxy(this, vertex); } } + else { + return NULL; + } return vertexob; diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp index f89d32bbe66..db0bef8b7e1 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp @@ -77,15 +77,17 @@ void KX_MouseFocusSensor::Init() m_mouse_over_in_previous_frame = (m_invert)?true:false; m_positive_event = false; m_hitObject = 0; + m_reset = true; } bool KX_MouseFocusSensor::Evaluate(CValue* event) { bool result = false; bool obHasFocus = false; + bool reset = m_reset && m_level; // cout << "evaluate focus mouse sensor "<m_colliders = new CListValue(); - replica->m_bCollision = false; - replica->m_bTriggered= false; - replica->m_hitObject = NULL; - replica->m_bLastTriggered = false; + replica->Init(); // this will copy properties and so on... CValue::AddDataToReplica(replica); diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index 03ae14997ab..9ac0b4d4703 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -68,8 +68,15 @@ KX_ObjectActuator( m_bitLocalFlag (flag), m_active_combined_velocity (false), m_linear_damping_active(false), - m_angular_damping_active(false) + m_angular_damping_active(false), + m_error_accumulator(0.0,0.0,0.0), + m_previous_error(0.0,0.0,0.0) { + if (m_bitLocalFlag.ServoControl) + { + // in servo motion, the force is local if the target velocity is local + m_bitLocalFlag.Force = m_bitLocalFlag.LinearVelocity; + } UpdateFuzzyFlags(); } @@ -87,105 +94,151 @@ bool KX_ObjectActuator::Update() // it should reconcile the externally set velocity with it's // own velocity. if (m_active_combined_velocity) { - parent->ResolveCombinedVelocities( - m_linear_velocity, - m_angular_velocity, - (m_bitLocalFlag.LinearVelocity) != 0, - (m_bitLocalFlag.AngularVelocity) != 0 - ); + if (parent) + parent->ResolveCombinedVelocities( + m_linear_velocity, + m_angular_velocity, + (m_bitLocalFlag.LinearVelocity) != 0, + (m_bitLocalFlag.AngularVelocity) != 0 + ); m_active_combined_velocity = false; } m_linear_damping_active = false; + m_angular_damping_active = false; + m_error_accumulator.setValue(0.0,0.0,0.0); + m_previous_error.setValue(0.0,0.0,0.0); return false; - } else - if (parent) + } else if (parent) { - if (!m_bitLocalFlag.ZeroForce) + if (m_bitLocalFlag.ServoControl) { - if (m_bitLocalFlag.ClampVelocity && !m_bitLocalFlag.ZeroLinearVelocity) + // In this mode, we try to reach a target speed using force + // As we don't know the friction, we must implement a generic + // servo control to achieve the speed in a configurable + // v = current velocity + // V = target velocity + // e = V-v = speed error + // dt = time interval since previous update + // I = sum(e(t)*dt) + // dv = e(t) - e(t-1) + // KP, KD, KI : coefficient + // F = KP*e+KI*I+KD*dv + MT_Scalar mass = parent->GetMass(); + if (mass < MT_EPSILON) + return false; + MT_Vector3 v = parent->GetLinearVelocity(m_bitLocalFlag.LinearVelocity); + MT_Vector3 e = m_linear_velocity - v; + MT_Vector3 dv = e - m_previous_error; + MT_Vector3 I = m_error_accumulator + e; + + m_force = m_torque.x()*e+m_torque.y()*I+m_torque.z()*dv; + // to automatically adapt the PID coefficient to mass; + m_force *= mass; + if (m_bitLocalFlag.Torque) { - // The user is requesting not to exceed the velocity set in m_linear_velocity - // The verification is done by projecting the actual speed along the linV direction - // and comparing it with the linV vector length - MT_Vector3 linV; - linV = parent->GetLinearVelocity(m_bitLocalFlag.LinearVelocity); - if (linV.dot(m_linear_velocity) < m_linear_length2) - parent->ApplyForce(m_force,(m_bitLocalFlag.Force) != 0); - } else + if (m_force[0] > m_dloc[0]) + { + m_force[0] = m_dloc[0]; + I[0] = m_error_accumulator[0]; + } else if (m_force[0] < m_drot[0]) + { + m_force[0] = m_drot[0]; + I[0] = m_error_accumulator[0]; + } + } + if (m_bitLocalFlag.DLoc) + { + if (m_force[1] > m_dloc[1]) + { + m_force[1] = m_dloc[1]; + I[1] = m_error_accumulator[1]; + } else if (m_force[1] < m_drot[1]) + { + m_force[1] = m_drot[1]; + I[1] = m_error_accumulator[1]; + } + } + if (m_bitLocalFlag.DRot) + { + if (m_force[2] > m_dloc[2]) + { + m_force[2] = m_dloc[2]; + I[2] = m_error_accumulator[2]; + } else if (m_force[2] < m_drot[2]) + { + m_force[2] = m_drot[2]; + I[2] = m_error_accumulator[2]; + } + } + m_previous_error = e; + m_error_accumulator = I; + parent->ApplyForce(m_force,(m_bitLocalFlag.LinearVelocity) != 0); + } else + { + if (!m_bitLocalFlag.ZeroForce) { parent->ApplyForce(m_force,(m_bitLocalFlag.Force) != 0); } - } - if (!m_bitLocalFlag.ZeroTorque) - { - if (m_bitLocalFlag.ClampVelocity && !m_bitLocalFlag.ZeroAngularVelocity) - { - // The user is requesting not to exceed the velocity set in m_angular_velocity - // The verification is done by projecting the actual speed in the - MT_Vector3 angV; - angV = parent->GetAngularVelocity(m_bitLocalFlag.AngularVelocity); - if (angV.dot(m_angular_velocity) < m_angular_velocity.length2()) - parent->ApplyTorque(m_torque,(m_bitLocalFlag.Torque) != 0); - } else + if (!m_bitLocalFlag.ZeroTorque) { parent->ApplyTorque(m_torque,(m_bitLocalFlag.Torque) != 0); } - } - if (!m_bitLocalFlag.ZeroDLoc) - { - parent->ApplyMovement(m_dloc,(m_bitLocalFlag.DLoc) != 0); - } - if (!m_bitLocalFlag.ZeroDRot) - { - parent->ApplyRotation(m_drot,(m_bitLocalFlag.DRot) != 0); - } - if (!m_bitLocalFlag.ZeroLinearVelocity && !m_bitLocalFlag.ClampVelocity) - { - if (m_bitLocalFlag.AddOrSetLinV) { - parent->addLinearVelocity(m_linear_velocity,(m_bitLocalFlag.LinearVelocity) != 0); - } else { - m_active_combined_velocity = true; - if (m_damping > 0) { - MT_Vector3 linV; - if (!m_linear_damping_active) { - // delta and the start speed (depends on the existing speed in that direction) - linV = parent->GetLinearVelocity(m_bitLocalFlag.LinearVelocity); - // keep only the projection along the desired direction - m_current_linear_factor = linV.dot(m_linear_velocity)/m_linear_length2; - m_linear_damping_active = true; - } - if (m_current_linear_factor < 1.0) - m_current_linear_factor += 1.0/m_damping; - if (m_current_linear_factor > 1.0) - m_current_linear_factor = 1.0; - linV = m_current_linear_factor * m_linear_velocity; - parent->setLinearVelocity(linV,(m_bitLocalFlag.LinearVelocity) != 0); + if (!m_bitLocalFlag.ZeroDLoc) + { + parent->ApplyMovement(m_dloc,(m_bitLocalFlag.DLoc) != 0); + } + if (!m_bitLocalFlag.ZeroDRot) + { + parent->ApplyRotation(m_drot,(m_bitLocalFlag.DRot) != 0); + } + if (!m_bitLocalFlag.ZeroLinearVelocity) + { + if (m_bitLocalFlag.AddOrSetLinV) { + parent->addLinearVelocity(m_linear_velocity,(m_bitLocalFlag.LinearVelocity) != 0); } else { - parent->setLinearVelocity(m_linear_velocity,(m_bitLocalFlag.LinearVelocity) != 0); + m_active_combined_velocity = true; + if (m_damping > 0) { + MT_Vector3 linV; + if (!m_linear_damping_active) { + // delta and the start speed (depends on the existing speed in that direction) + linV = parent->GetLinearVelocity(m_bitLocalFlag.LinearVelocity); + // keep only the projection along the desired direction + m_current_linear_factor = linV.dot(m_linear_velocity)/m_linear_length2; + m_linear_damping_active = true; + } + if (m_current_linear_factor < 1.0) + m_current_linear_factor += 1.0/m_damping; + if (m_current_linear_factor > 1.0) + m_current_linear_factor = 1.0; + linV = m_current_linear_factor * m_linear_velocity; + parent->setLinearVelocity(linV,(m_bitLocalFlag.LinearVelocity) != 0); + } else { + parent->setLinearVelocity(m_linear_velocity,(m_bitLocalFlag.LinearVelocity) != 0); + } } } - } - if (!m_bitLocalFlag.ZeroAngularVelocity && !m_bitLocalFlag.ClampVelocity) - { - m_active_combined_velocity = true; - if (m_damping > 0) { - MT_Vector3 angV; - if (!m_angular_damping_active) { - // delta and the start speed (depends on the existing speed in that direction) - angV = parent->GetAngularVelocity(m_bitLocalFlag.AngularVelocity); - // keep only the projection along the desired direction - m_current_angular_factor = angV.dot(m_angular_velocity)/m_angular_length2; - m_angular_damping_active = true; + if (!m_bitLocalFlag.ZeroAngularVelocity) + { + m_active_combined_velocity = true; + if (m_damping > 0) { + MT_Vector3 angV; + if (!m_angular_damping_active) { + // delta and the start speed (depends on the existing speed in that direction) + angV = parent->GetAngularVelocity(m_bitLocalFlag.AngularVelocity); + // keep only the projection along the desired direction + m_current_angular_factor = angV.dot(m_angular_velocity)/m_angular_length2; + m_angular_damping_active = true; + } + if (m_current_angular_factor < 1.0) + m_current_angular_factor += 1.0/m_damping; + if (m_current_angular_factor > 1.0) + m_current_angular_factor = 1.0; + angV = m_current_angular_factor * m_angular_velocity; + parent->setAngularVelocity(angV,(m_bitLocalFlag.AngularVelocity) != 0); + } else { + parent->setAngularVelocity(m_angular_velocity,(m_bitLocalFlag.AngularVelocity) != 0); } - if (m_current_angular_factor < 1.0) - m_current_angular_factor += 1.0/m_damping; - if (m_current_angular_factor > 1.0) - m_current_angular_factor = 1.0; - angV = m_current_angular_factor * m_angular_velocity; - parent->setAngularVelocity(angV,(m_bitLocalFlag.AngularVelocity) != 0); - } else { - parent->setAngularVelocity(m_angular_velocity,(m_bitLocalFlag.AngularVelocity) != 0); } } @@ -263,8 +316,17 @@ PyMethodDef KX_ObjectActuator::Methods[] = { {"setLinearVelocity", (PyCFunction) KX_ObjectActuator::sPySetLinearVelocity, METH_VARARGS}, {"getAngularVelocity", (PyCFunction) KX_ObjectActuator::sPyGetAngularVelocity, METH_VARARGS}, {"setAngularVelocity", (PyCFunction) KX_ObjectActuator::sPySetAngularVelocity, METH_VARARGS}, - {"setVelocityDamping", (PyCFunction) KX_ObjectActuator::sPySetVelocityDamping, METH_VARARGS}, - {"getVelocityDamping", (PyCFunction) KX_ObjectActuator::sPyGetVelocityDamping, METH_VARARGS}, + {"setDamping", (PyCFunction) KX_ObjectActuator::sPySetDamping, METH_VARARGS}, + {"getDamping", (PyCFunction) KX_ObjectActuator::sPyGetDamping, METH_VARARGS}, + {"setForceLimitX", (PyCFunction) KX_ObjectActuator::sPySetForceLimitX, METH_VARARGS}, + {"getForceLimitX", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitX, METH_VARARGS}, + {"setForceLimitY", (PyCFunction) KX_ObjectActuator::sPySetForceLimitY, METH_VARARGS}, + {"getForceLimitY", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitY, METH_VARARGS}, + {"setForceLimitZ", (PyCFunction) KX_ObjectActuator::sPySetForceLimitZ, METH_VARARGS}, + {"getForceLimitZ", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitZ, METH_VARARGS}, + {"setPID", (PyCFunction) KX_ObjectActuator::sPyGetPID, METH_VARARGS}, + {"getPID", (PyCFunction) KX_ObjectActuator::sPySetPID, METH_VARARGS}, + {NULL,NULL} //Sentinel @@ -411,7 +473,6 @@ PyObject* KX_ObjectActuator::PyGetLinearVelocity(PyObject* self, PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_linear_velocity[1])); PyList_SetItem(retVal, 2, PyFloat_FromDouble(m_linear_velocity[2])); PyList_SetItem(retVal, 3, BoolToPyArg(m_bitLocalFlag.LinearVelocity)); - PyList_SetItem(retVal, 4, BoolToPyArg(m_bitLocalFlag.ClampVelocity)); return retVal; } @@ -422,14 +483,12 @@ PyObject* KX_ObjectActuator::PySetLinearVelocity(PyObject* self, PyObject* kwds) { float vecArg[3]; int bToggle = 0; - int bClamp = 0; - if (!PyArg_ParseTuple(args, "fffi|i", &vecArg[0], &vecArg[1], - &vecArg[2], &bToggle, &bClamp)) { + if (!PyArg_ParseTuple(args, "fffi", &vecArg[0], &vecArg[1], + &vecArg[2], &bToggle)) { return NULL; } m_linear_velocity.setValue(vecArg); m_bitLocalFlag.LinearVelocity = PyArgToBool(bToggle); - m_bitLocalFlag.ClampVelocity = PyArgToBool(bClamp); UpdateFuzzyFlags(); Py_Return; } @@ -445,7 +504,6 @@ PyObject* KX_ObjectActuator::PyGetAngularVelocity(PyObject* self, PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_angular_velocity[1])); PyList_SetItem(retVal, 2, PyFloat_FromDouble(m_angular_velocity[2])); PyList_SetItem(retVal, 3, BoolToPyArg(m_bitLocalFlag.AngularVelocity)); - PyList_SetItem(retVal, 4, BoolToPyArg(m_bitLocalFlag.ClampVelocity)); return retVal; } @@ -455,22 +513,20 @@ PyObject* KX_ObjectActuator::PySetAngularVelocity(PyObject* self, PyObject* kwds) { float vecArg[3]; int bToggle = 0; - int bClamp = 0; - if (!PyArg_ParseTuple(args, "fffi|i", &vecArg[0], &vecArg[1], - &vecArg[2], &bToggle, &bClamp)) { + if (!PyArg_ParseTuple(args, "fffi", &vecArg[0], &vecArg[1], + &vecArg[2], &bToggle)) { return NULL; } m_angular_velocity.setValue(vecArg); m_bitLocalFlag.AngularVelocity = PyArgToBool(bToggle); - m_bitLocalFlag.ClampVelocity = PyArgToBool(bClamp); UpdateFuzzyFlags(); Py_Return; } -/* 13. setVelocityDamping */ -PyObject* KX_ObjectActuator::PySetVelocityDamping(PyObject* self, - PyObject* args, - PyObject* kwds) { +/* 13. setDamping */ +PyObject* KX_ObjectActuator::PySetDamping(PyObject* self, + PyObject* args, + PyObject* kwds) { int damping = 0; if (!PyArg_ParseTuple(args, "i", &damping) || damping < 0 || damping > 1000) { return NULL; @@ -480,11 +536,124 @@ PyObject* KX_ObjectActuator::PySetVelocityDamping(PyObject* self, } /* 13. getVelocityDamping */ -PyObject* KX_ObjectActuator::PyGetVelocityDamping(PyObject* self, - PyObject* args, - PyObject* kwds) { +PyObject* KX_ObjectActuator::PyGetDamping(PyObject* self, + PyObject* args, + PyObject* kwds) { return Py_BuildValue("i",m_damping); } +/* 6. getForceLimitX */ +PyObject* KX_ObjectActuator::PyGetForceLimitX(PyObject* self, + PyObject* args, + PyObject* kwds) +{ + PyObject *retVal = PyList_New(3); + + PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_drot[0])); + PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_dloc[0])); + PyList_SetItem(retVal, 2, BoolToPyArg(m_bitLocalFlag.Torque)); + + return retVal; +} +/* 7. setForceLimitX */ +PyObject* KX_ObjectActuator::PySetForceLimitX(PyObject* self, + PyObject* args, + PyObject* kwds) +{ + float vecArg[2]; + int bToggle = 0; + if(!PyArg_ParseTuple(args, "ffi", &vecArg[0], &vecArg[1], &bToggle)) { + return NULL; + } + m_drot[0] = vecArg[0]; + m_dloc[0] = vecArg[1]; + m_bitLocalFlag.Torque = PyArgToBool(bToggle); + Py_Return; +} + +/* 6. getForceLimitY */ +PyObject* KX_ObjectActuator::PyGetForceLimitY(PyObject* self, + PyObject* args, + PyObject* kwds) +{ + PyObject *retVal = PyList_New(3); + + PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_drot[1])); + PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_dloc[1])); + PyList_SetItem(retVal, 2, BoolToPyArg(m_bitLocalFlag.DLoc)); + + return retVal; +} +/* 7. setForceLimitY */ +PyObject* KX_ObjectActuator::PySetForceLimitY(PyObject* self, + PyObject* args, + PyObject* kwds) +{ + float vecArg[2]; + int bToggle = 0; + if(!PyArg_ParseTuple(args, "ffi", &vecArg[0], &vecArg[1], &bToggle)) { + return NULL; + } + m_drot[1] = vecArg[0]; + m_dloc[1] = vecArg[1]; + m_bitLocalFlag.DLoc = PyArgToBool(bToggle); + Py_Return; +} + +/* 6. getForceLimitZ */ +PyObject* KX_ObjectActuator::PyGetForceLimitZ(PyObject* self, + PyObject* args, + PyObject* kwds) +{ + PyObject *retVal = PyList_New(3); + + PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_drot[2])); + PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_dloc[2])); + PyList_SetItem(retVal, 2, BoolToPyArg(m_bitLocalFlag.DRot)); + + return retVal; +} +/* 7. setForceLimitZ */ +PyObject* KX_ObjectActuator::PySetForceLimitZ(PyObject* self, + PyObject* args, + PyObject* kwds) +{ + float vecArg[2]; + int bToggle = 0; + if(!PyArg_ParseTuple(args, "ffi", &vecArg[0], &vecArg[1], &bToggle)) { + return NULL; + } + m_drot[2] = vecArg[0]; + m_dloc[2] = vecArg[1]; + m_bitLocalFlag.DRot = PyArgToBool(bToggle); + Py_Return; +} + +/* 4. getPID */ +PyObject* KX_ObjectActuator::PyGetPID(PyObject* self, + PyObject* args, + PyObject* kwds) +{ + PyObject *retVal = PyList_New(3); + + PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_torque[0])); + PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_torque[1])); + PyList_SetItem(retVal, 2, PyFloat_FromDouble(m_torque[2])); + + return retVal; +} +/* 5. setPID */ +PyObject* KX_ObjectActuator::PySetPID(PyObject* self, + PyObject* args, + PyObject* kwds) +{ + float vecArg[3]; + if (!PyArg_ParseTuple(args, "fff", &vecArg[0], &vecArg[1], &vecArg[2])) { + return NULL; + } + m_torque.setValue(vecArg); + Py_Return; +} + diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.h b/source/gameengine/Ketsji/KX_ObjectActuator.h index ec6dab5cd48..bb74756551f 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.h +++ b/source/gameengine/Ketsji/KX_ObjectActuator.h @@ -47,7 +47,6 @@ struct KX_LocalFlags { LinearVelocity(false), AngularVelocity(false), AddOrSetLinV(false), - ClampVelocity(false), ZeroForce(false), ZeroDRot(false), ZeroDLoc(false), @@ -63,7 +62,7 @@ struct KX_LocalFlags { unsigned short LinearVelocity : 1; unsigned short AngularVelocity : 1; unsigned short AddOrSetLinV : 1; - unsigned short ClampVelocity : 1; + unsigned short ServoControl : 1; unsigned short ZeroForce : 1; unsigned short ZeroTorque : 1; unsigned short ZeroDRot : 1; @@ -84,9 +83,13 @@ class KX_ObjectActuator : public SCA_IActuator MT_Vector3 m_angular_velocity; MT_Scalar m_linear_length2; MT_Scalar m_angular_length2; + // used in damping MT_Scalar m_current_linear_factor; MT_Scalar m_current_angular_factor; short m_damping; + // used in servo control + MT_Vector3 m_previous_error; + MT_Vector3 m_error_accumulator; KX_LocalFlags m_bitLocalFlag; // A hack bool -- oh no sorry everyone @@ -164,8 +167,16 @@ public: KX_PYMETHOD(KX_ObjectActuator,SetLinearVelocity); KX_PYMETHOD(KX_ObjectActuator,GetAngularVelocity); KX_PYMETHOD(KX_ObjectActuator,SetAngularVelocity); - KX_PYMETHOD(KX_ObjectActuator,SetVelocityDamping); - KX_PYMETHOD(KX_ObjectActuator,GetVelocityDamping); + KX_PYMETHOD(KX_ObjectActuator,SetDamping); + KX_PYMETHOD(KX_ObjectActuator,GetDamping); + KX_PYMETHOD(KX_ObjectActuator,GetForceLimitX); + KX_PYMETHOD(KX_ObjectActuator,SetForceLimitX); + KX_PYMETHOD(KX_ObjectActuator,GetForceLimitY); + KX_PYMETHOD(KX_ObjectActuator,SetForceLimitY); + KX_PYMETHOD(KX_ObjectActuator,GetForceLimitZ); + KX_PYMETHOD(KX_ObjectActuator,SetForceLimitZ); + KX_PYMETHOD(KX_ObjectActuator,GetPID); + KX_PYMETHOD(KX_ObjectActuator,SetPID); }; #endif //__KX_OBJECTACTUATOR diff --git a/source/gameengine/Ketsji/KX_ParentActuator.cpp b/source/gameengine/Ketsji/KX_ParentActuator.cpp index 5c433cb68b1..8b379bcd44f 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.cpp +++ b/source/gameengine/Ketsji/KX_ParentActuator.cpp @@ -77,6 +77,12 @@ CValue* KX_ParentActuator::GetReplica() bool KX_ParentActuator::Update() { + bool bNegativeEvent = IsNegativeEvent(); + RemoveAllEvents(); + + if (bNegativeEvent) + return false; // do nothing on negative events + KX_GameObject *obj = (KX_GameObject*) GetParent(); KX_Scene *scene = PHY_GetActiveScene(); switch (m_mode) { diff --git a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp index 27cfaefc076..2df4c6a9980 100644 --- a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp +++ b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp @@ -58,6 +58,9 @@ PyObject* KX_PhysicsObjectWrapper::PySetPosition(PyObject* self, { m_ctrl->setPosition(x,y,z); } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -72,6 +75,9 @@ PyObject* KX_PhysicsObjectWrapper::PySetLinearVelocity(PyObject* self, { m_ctrl->SetLinearVelocity(x,y,z,local != 0); } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -85,6 +91,9 @@ PyObject* KX_PhysicsObjectWrapper::PySetAngularVelocity(PyObject* self, { m_ctrl->SetAngularVelocity(x,y,z,local != 0); } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -97,6 +106,9 @@ PyObject* KX_PhysicsObjectWrapper::PySetActive(PyObject* self, { m_ctrl->SetActive(active!=0); } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp index 172882ff18d..c01d6a632a3 100644 --- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp +++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp @@ -82,12 +82,15 @@ static PyObject* gPySetGravity(PyObject* self, PyObject* kwds) { float x,y,z; - int len = PyTuple_Size(args); - if ((len == 3) && PyArg_ParseTuple(args,"fff",&x,&y,&z)) + if (PyArg_ParseTuple(args,"fff",&x,&y,&z)) { if (PHY_GetActiveEnvironment()) PHY_GetActiveEnvironment()->setGravity(x,y,z); } + else { + return NULL; + } + Py_INCREF(Py_None); return Py_None; } @@ -105,6 +108,10 @@ static PyObject* gPySetDebugMode(PyObject* self, } } + else { + return NULL; + } + Py_INCREF(Py_None); return Py_None; } @@ -122,6 +129,9 @@ static PyObject* gPySetNumTimeSubSteps(PyObject* self, PHY_GetActiveEnvironment()->setNumTimeSubSteps(substep); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -138,6 +148,9 @@ static PyObject* gPySetNumIterations(PyObject* self, PHY_GetActiveEnvironment()->setNumIterations(iter); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -155,6 +168,9 @@ static PyObject* gPySetDeactivationTime(PyObject* self, PHY_GetActiveEnvironment()->setDeactivationTime(deactive_time); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -171,6 +187,9 @@ static PyObject* gPySetDeactivationLinearTreshold(PyObject* self, PHY_GetActiveEnvironment()->setDeactivationLinearTreshold( linearDeactivationTreshold); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -187,6 +206,9 @@ static PyObject* gPySetDeactivationAngularTreshold(PyObject* self, PHY_GetActiveEnvironment()->setDeactivationAngularTreshold( angularDeactivationTreshold); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -202,6 +224,9 @@ static PyObject* gPySetContactBreakingTreshold(PyObject* self, PHY_GetActiveEnvironment()->setContactBreakingTreshold( contactBreakingTreshold); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -218,6 +243,9 @@ static PyObject* gPySetCcdMode(PyObject* self, PHY_GetActiveEnvironment()->setCcdMode( ccdMode); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -233,6 +261,9 @@ static PyObject* gPySetSorConstant(PyObject* self, PHY_GetActiveEnvironment()->setSolverSorConstant( sor); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -248,6 +279,9 @@ static PyObject* gPySetSolverTau(PyObject* self, PHY_GetActiveEnvironment()->setSolverTau( tau); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -264,6 +298,9 @@ static PyObject* gPySetSolverDamping(PyObject* self, PHY_GetActiveEnvironment()->setSolverDamping( damping); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -279,6 +316,9 @@ static PyObject* gPySetLinearAirDamping(PyObject* self, PHY_GetActiveEnvironment()->setLinearAirDamping( damping); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -295,6 +335,9 @@ static PyObject* gPySetUseEpa(PyObject* self, PHY_GetActiveEnvironment()->setUseEpa(epa); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } static PyObject* gPySetSolverType(PyObject* self, @@ -309,6 +352,9 @@ static PyObject* gPySetSolverType(PyObject* self, PHY_GetActiveEnvironment()->setSolverType(solverType); } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -338,6 +384,9 @@ static PyObject* gPyGetVehicleConstraint(PyObject* self, } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -395,6 +444,9 @@ static PyObject* gPyCreateConstraint(PyObject* self, } } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -421,6 +473,9 @@ static PyObject* gPyGetAppliedImpulse(PyObject* self, appliedImpulse = PHY_GetActiveEnvironment()->getAppliedImpulse(constraintid); } } + else { + return NULL; + } return PyFloat_FromDouble(appliedImpulse); } @@ -443,6 +498,10 @@ static PyObject* gPyRemoveConstraint(PyObject* self, PHY_GetActiveEnvironment()->removeConstraint(constraintid); } } + else { + return NULL; + } + Py_INCREF(Py_None); return Py_None; } diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 0831788009d..433e0636833 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -103,9 +103,7 @@ void KX_RasterizerDrawDebugLine(const MT_Vector3& from,const MT_Vector3& to,cons static PyObject* ErrorObject; STR_String gPyGetRandomFloat_doc="getRandomFloat returns a random floating point value in the range [0..1)"; -static PyObject* gPyGetRandomFloat(PyObject*, - PyObject*, - PyObject*) +static PyObject* gPyGetRandomFloat(PyObject*) { return PyFloat_FromDouble(MT_random()); } @@ -156,9 +154,7 @@ static PyObject* gPyExpandPath(PyObject*, static bool usedsp = false; // this gets a pointer to an array filled with floats -static PyObject* gPyGetSpectrum(PyObject*, - PyObject* args, - PyObject*) +static PyObject* gPyGetSpectrum(PyObject*) { SND_IAudioDevice* audiodevice = SND_DeviceManager::Instance(); @@ -237,7 +233,7 @@ static PyObject* gPySetLogicTicRate(PyObject*, return NULL; } -static PyObject* gPyGetLogicTicRate(PyObject*, PyObject*, PyObject*) +static PyObject* gPyGetLogicTicRate(PyObject*) { return PyFloat_FromDouble(KX_KetsjiEngine::GetTicRate()); } @@ -273,7 +269,7 @@ static PyObject* gPySetPhysicsDebug(PyObject*, -static PyObject* gPyGetPhysicsTicRate(PyObject*, PyObject*, PyObject*) +static PyObject* gPyGetPhysicsTicRate(PyObject*) { return PyFloat_FromDouble(PHY_GetActiveEnvironment()->getFixedTimeStep()); } @@ -281,9 +277,7 @@ static PyObject* gPyGetPhysicsTicRate(PyObject*, PyObject*, PyObject*) static STR_String gPyGetCurrentScene_doc = "getCurrentScene()\n" "Gets a reference to the current scene.\n"; -static PyObject* gPyGetCurrentScene(PyObject* self, - PyObject* args, - PyObject* kwds) +static PyObject* gPyGetCurrentScene(PyObject* self) { Py_INCREF(gp_KetsjiScene); return (PyObject*) gp_KetsjiScene; @@ -366,19 +360,19 @@ static struct PyMethodDef game_methods[] = { {"expandPath", (PyCFunction)gPyExpandPath, METH_VARARGS, gPyExpandPath_doc}, {"getCurrentController", (PyCFunction) SCA_PythonController::sPyGetCurrentController, - METH_VARARGS, SCA_PythonController::sPyGetCurrentController__doc__}, + METH_NOARGS, SCA_PythonController::sPyGetCurrentController__doc__}, {"getCurrentScene", (PyCFunction) gPyGetCurrentScene, - METH_VARARGS, gPyGetCurrentScene_doc.Ptr()}, + METH_NOARGS, gPyGetCurrentScene_doc.Ptr()}, {"addActiveActuator",(PyCFunction) SCA_PythonController::sPyAddActiveActuator, METH_VARARGS, SCA_PythonController::sPyAddActiveActuator__doc__}, {"getRandomFloat",(PyCFunction) gPyGetRandomFloat, - METH_VARARGS,gPyGetRandomFloat_doc.Ptr()}, + METH_NOARGS,gPyGetRandomFloat_doc.Ptr()}, {"setGravity",(PyCFunction) gPySetGravity, METH_VARARGS,"set Gravitation"}, - {"getSpectrum",(PyCFunction) gPyGetSpectrum, METH_VARARGS,"get audio spectrum"}, + {"getSpectrum",(PyCFunction) gPyGetSpectrum, METH_NOARGS,"get audio spectrum"}, {"stopDSP",(PyCFunction) gPyStopDSP, METH_VARARGS,"stop using the audio dsp (for performance reasons)"}, - {"getLogicTicRate", (PyCFunction) gPyGetLogicTicRate, METH_VARARGS, "Gets the logic tic rate"}, + {"getLogicTicRate", (PyCFunction) gPyGetLogicTicRate, METH_NOARGS, "Gets the logic tic rate"}, {"setLogicTicRate", (PyCFunction) gPySetLogicTicRate, METH_VARARGS, "Sets the logic tic rate"}, - {"getPhysicsTicRate", (PyCFunction) gPyGetPhysicsTicRate, METH_VARARGS, "Gets the physics tic rate"}, + {"getPhysicsTicRate", (PyCFunction) gPyGetPhysicsTicRate, METH_NOARGS, "Gets the physics tic rate"}, {"setPhysicsTicRate", (PyCFunction) gPySetPhysicsTicRate, METH_VARARGS, "Sets the physics tic rate"}, {"PrintGLInfo", (PyCFunction)pyPrintExt, METH_NOARGS, "Prints GL Extension Info"}, {NULL, (PyCFunction) NULL, 0, NULL } @@ -425,7 +419,7 @@ static PyObject* gPyEnableVisibility(PyObject*, } else { - Py_Return; + return NULL; } Py_Return; } @@ -449,6 +443,9 @@ static PyObject* gPyShowMouse(PyObject*, gp_Canvas->SetMouseState(RAS_ICanvas::MOUSE_INVISIBLE); } } + else { + return NULL; + } Py_Return; } @@ -465,6 +462,9 @@ static PyObject* gPySetMousePosition(PyObject*, if (gp_Canvas) gp_Canvas->SetMousePosition(x,y); } + else { + return NULL; + } Py_Return; } @@ -568,6 +568,9 @@ static PyObject* gPySetMistStart(PyObject*, gp_Rasterizer->SetFogStart(miststart); } } + else { + return NULL; + } Py_Return; } @@ -586,6 +589,9 @@ static PyObject* gPySetMistEnd(PyObject*, gp_Rasterizer->SetFogEnd(mistend); } } + else { + return NULL; + } Py_Return; } @@ -623,6 +629,9 @@ static PyObject* gPyMakeScreenshot(PyObject*, gp_Canvas->MakeScreenShot(filename); } } + else { + return NULL; + } Py_Return; } @@ -638,6 +647,9 @@ static PyObject* gPyEnableMotionBlur(PyObject*, gp_Rasterizer->EnableMotionBlur(motionblurvalue); } } + else { + return NULL; + } Py_Return; } diff --git a/source/gameengine/Ketsji/KX_RaySensor.cpp b/source/gameengine/Ketsji/KX_RaySensor.cpp index e847c59bae1..a416c8c9f89 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.cpp +++ b/source/gameengine/Ketsji/KX_RaySensor.cpp @@ -72,6 +72,7 @@ void KX_RaySensor::Init() m_bTriggered = (m_invert)?true:false; m_rayHit = false; m_hitObject = NULL; + m_reset = true; } KX_RaySensor::~KX_RaySensor() @@ -83,9 +84,10 @@ KX_RaySensor::~KX_RaySensor() CValue* KX_RaySensor::GetReplica() { - CValue* replica = new KX_RaySensor(*this); + KX_RaySensor* replica = new KX_RaySensor(*this); // this will copy properties and so on... CValue::AddDataToReplica(replica); + replica->Init(); return replica; } @@ -151,6 +153,7 @@ bool KX_RaySensor::RayHit(KX_ClientObjectInfo* client, MT_Point3& hit_point, MT_ bool KX_RaySensor::Evaluate(CValue* event) { bool result = false; + bool reset = m_reset && m_level; m_rayHit = false; m_hitObject = NULL; m_hitPosition = MT_Vector3(0,0,0); @@ -162,6 +165,7 @@ bool KX_RaySensor::Evaluate(CValue* event) MT_Matrix3x3 invmat = matje.inverse(); MT_Vector3 todir; + m_reset = false; switch (m_axis) { case 1: // X @@ -263,7 +267,9 @@ bool KX_RaySensor::Evaluate(CValue* event) } } - + if (reset) + // force an event + result = true; return result; } diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp index 76ce086ab97..e5ee4cbddf1 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp @@ -48,7 +48,7 @@ /* ------------------------------------------------------------------------- */ KX_SCA_AddObjectActuator::KX_SCA_AddObjectActuator(SCA_IObject *gameobj, - CValue* original, + SCA_IObject *original, int time, SCA_IScene* scene, const MT_Vector3& linvel, @@ -61,6 +61,9 @@ KX_SCA_AddObjectActuator::KX_SCA_AddObjectActuator(SCA_IObject *gameobj, m_linear_velocity(linvel), m_localFlag(local) { + if (m_OriginalObject) + m_OriginalObject->RegisterActuator(this); + m_lastCreatedObject = NULL; m_timeProp = time; } @@ -69,6 +72,8 @@ KX_SCA_AddObjectActuator::KX_SCA_AddObjectActuator(SCA_IObject *gameobj, KX_SCA_AddObjectActuator::~KX_SCA_AddObjectActuator() { + if (m_OriginalObject) + m_OriginalObject->UnregisterActuator(this); if (m_lastCreatedObject) m_lastCreatedObject->Release(); } @@ -108,12 +113,29 @@ CValue* KX_SCA_AddObjectActuator::GetReplica() // this will copy properties and so on... replica->ProcessReplica(); - replica->m_lastCreatedObject=NULL; CValue::AddDataToReplica(replica); return replica; } +void KX_SCA_AddObjectActuator::ProcessReplica() +{ + if (m_OriginalObject) + m_OriginalObject->RegisterActuator(this); + m_lastCreatedObject=NULL; + SCA_IActuator::ProcessReplica(); +} + +bool KX_SCA_AddObjectActuator::UnlinkObject(SCA_IObject* clientobj) +{ + if (clientobj == m_OriginalObject) + { + // this object is being deleted, we cannot continue to track it. + m_OriginalObject = NULL; + return true; + } + return false; +} /* ------------------------------------------------------------------------- */ @@ -181,7 +203,11 @@ PyObject* KX_SCA_AddObjectActuator::PySetObject(PyObject* self, PyObject* gameobj; if (PyArg_ParseTuple(args, "O!", &KX_GameObject::Type, &gameobj)) { - m_OriginalObject = (CValue*)gameobj; + if (m_OriginalObject != NULL) + m_OriginalObject->UnregisterActuator(this); + m_OriginalObject = (SCA_IObject*)gameobj; + if (m_OriginalObject) + m_OriginalObject->RegisterActuator(this); Py_Return; } PyErr_Clear(); @@ -189,8 +215,11 @@ PyObject* KX_SCA_AddObjectActuator::PySetObject(PyObject* self, char* objectname; if (PyArg_ParseTuple(args, "s", &objectname)) { - m_OriginalObject= (CValue*)SCA_ILogicBrick::m_sCurrentLogicManager->GetGameObjectByName(STR_String(objectname));; - + if (m_OriginalObject != NULL) + m_OriginalObject->UnregisterActuator(this); + m_OriginalObject = (SCA_IObject*)SCA_ILogicBrick::m_sCurrentLogicManager->GetGameObjectByName(STR_String(objectname));; + if (m_OriginalObject) + m_OriginalObject->RegisterActuator(this); Py_Return; } diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h index 2126a646303..42123b94a68 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h @@ -53,7 +53,7 @@ class KX_SCA_AddObjectActuator : public SCA_IActuator int m_timeProp; /// Original object reference (object to replicate) - CValue* m_OriginalObject; + SCA_IObject* m_OriginalObject; /// Object will be added to the following scene SCA_IScene* m_scene; @@ -75,7 +75,7 @@ public: KX_SCA_AddObjectActuator( SCA_IObject *gameobj, - CValue* original, + SCA_IObject *original, int time, SCA_IScene* scene, const MT_Vector3& linvel, @@ -89,6 +89,12 @@ public: GetReplica( ) ; + virtual void + ProcessReplica(); + + virtual bool + UnlinkObject(SCA_IObject* clientobj); + virtual bool Update(); diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index a7e91e27df3..065800379d8 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -48,6 +48,7 @@ #include "SCA_KeyboardManager.h" #include "SCA_MouseManager.h" #include "SCA_PropertyEventManager.h" +#include "SCA_ActuatorEventManager.h" #include "KX_Camera.h" #include "SCA_JoystickManager.h" @@ -143,6 +144,7 @@ KX_Scene::KX_Scene(class SCA_IInputDevice* keyboarddevice, SCA_AlwaysEventManager* alwaysmgr = new SCA_AlwaysEventManager(m_logicmgr); SCA_PropertyEventManager* propmgr = new SCA_PropertyEventManager(m_logicmgr); + SCA_ActuatorEventManager* actmgr = new SCA_ActuatorEventManager(m_logicmgr); SCA_RandomEventManager* rndmgr = new SCA_RandomEventManager(m_logicmgr); KX_RayEventManager* raymgr = new KX_RayEventManager(m_logicmgr); @@ -152,6 +154,7 @@ KX_Scene::KX_Scene(class SCA_IInputDevice* keyboarddevice, m_logicmgr->RegisterEventManager(alwaysmgr); m_logicmgr->RegisterEventManager(propmgr); + m_logicmgr->RegisterEventManager(actmgr); m_logicmgr->RegisterEventManager(m_keyboardmgr); m_logicmgr->RegisterEventManager(m_mousemgr); m_logicmgr->RegisterEventManager(m_timemgr); @@ -598,6 +601,8 @@ void KX_Scene::ReplicateLogic(KX_GameObject* newobj) } } } + // ready to set initial state + newobj->ResetState(); } @@ -883,6 +888,7 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj) else if (bHasArmature) { BL_SkinDeformer* skinDeformer = new BL_SkinDeformer( + newobj, oldblendobj, blendobj, static_cast(mesh), true, @@ -894,7 +900,7 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj) else if (bHasDvert) { BL_MeshDeformer* meshdeformer = new BL_MeshDeformer( - oldblendobj, static_cast(mesh) + newobj, oldblendobj, static_cast(mesh) ); newobj->m_pDeformer = meshdeformer; } @@ -999,12 +1005,13 @@ void KX_Scene::UpdateMeshTransformations() } } -void KX_Scene::MarkVisible(SG_Tree *node, RAS_IRasterizer* rasty, KX_Camera* cam) +void KX_Scene::MarkVisible(SG_Tree *node, RAS_IRasterizer* rasty, KX_Camera* cam, int layer) { int intersect = KX_Camera::INTERSECT; KX_GameObject *gameobj = node->Client()?(KX_GameObject*) node->Client()->GetSGClientObject():NULL; - bool dotest = (gameobj && gameobj->GetVisible()) || node->Left() || node->Right(); - + bool visible = (gameobj && gameobj->GetVisible() && (!layer || (gameobj->GetLayer() & layer))); + bool dotest = visible || node->Left() || node->Right(); + /* If the camera is inside the box, assume intersect. */ if (dotest && !node->inside( cam->NodeGetWorldPosition())) { @@ -1028,19 +1035,19 @@ void KX_Scene::MarkVisible(SG_Tree *node, RAS_IRasterizer* rasty, KX_Camera* cam break; case KX_Camera::INTERSECT: if (gameobj) - MarkVisible(rasty, gameobj,cam); + MarkVisible(rasty, gameobj, cam, layer); if (node->Left()) - MarkVisible(node->Left(), rasty,cam); + MarkVisible(node->Left(), rasty, cam, layer); if (node->Right()) - MarkVisible(node->Right(), rasty,cam); + MarkVisible(node->Right(), rasty, cam, layer); break; case KX_Camera::INSIDE: - MarkSubTreeVisible(node, rasty, true,cam); + MarkSubTreeVisible(node, rasty, true, cam, layer); break; } } -void KX_Scene::MarkSubTreeVisible(SG_Tree *node, RAS_IRasterizer* rasty, bool visible,KX_Camera* cam) +void KX_Scene::MarkSubTreeVisible(SG_Tree *node, RAS_IRasterizer* rasty, bool visible, KX_Camera* cam, int layer) { if (node->Client()) { @@ -1063,16 +1070,23 @@ void KX_Scene::MarkSubTreeVisible(SG_Tree *node, RAS_IRasterizer* rasty, bool vi } } if (node->Left()) - MarkSubTreeVisible(node->Left(), rasty, visible,cam); + MarkSubTreeVisible(node->Left(), rasty, visible, cam, layer); if (node->Right()) - MarkSubTreeVisible(node->Right(), rasty, visible,cam); + MarkSubTreeVisible(node->Right(), rasty, visible, cam, layer); } -void KX_Scene::MarkVisible(RAS_IRasterizer* rasty, KX_GameObject* gameobj,KX_Camera* cam) +void KX_Scene::MarkVisible(RAS_IRasterizer* rasty, KX_GameObject* gameobj,KX_Camera* cam,int layer) { // User (Python/Actuator) has forced object invisible... if (!gameobj->GetVisible()) return; + + // Shadow lamp layers + if(layer && !(gameobj->GetLayer() & layer)) { + gameobj->MarkVisible(false); + return; + } + // If Frustum culling is off, the object is always visible. bool vis = !cam->GetFrustumCulling(); @@ -1122,20 +1136,20 @@ void KX_Scene::MarkVisible(RAS_IRasterizer* rasty, KX_GameObject* gameobj,KX_Cam } } -void KX_Scene::CalculateVisibleMeshes(RAS_IRasterizer* rasty,KX_Camera* cam) +void KX_Scene::CalculateVisibleMeshes(RAS_IRasterizer* rasty,KX_Camera* cam, int layer) { // FIXME: When tree is operational #if 1 // do this incrementally in the future for (int i = 0; i < m_objectlist->GetCount(); i++) { - MarkVisible(rasty, static_cast(m_objectlist->GetValue(i)), cam); + MarkVisible(rasty, static_cast(m_objectlist->GetValue(i)), cam, layer); } #else if (cam->GetFrustumCulling()) - MarkVisible(m_objecttree, rasty, cam); + MarkVisible(m_objecttree, rasty, cam, layer); else - MarkSubTreeVisible(m_objecttree, rasty, true, cam); + MarkSubTreeVisible(m_objecttree, rasty, true, cam, layer); #endif } diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index 733df2f69a1..28dee1b5893 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -260,9 +260,9 @@ protected: /** * Visibility testing functions. */ - void MarkVisible(SG_Tree *node, RAS_IRasterizer* rasty, KX_Camera*cam); - void MarkSubTreeVisible(SG_Tree *node, RAS_IRasterizer* rasty, bool visible, KX_Camera*cam); - void MarkVisible(RAS_IRasterizer* rasty, KX_GameObject* gameobj, KX_Camera*cam); + void MarkVisible(SG_Tree *node, RAS_IRasterizer* rasty, KX_Camera*cam,int layer=0); + void MarkSubTreeVisible(SG_Tree *node, RAS_IRasterizer* rasty, bool visible, KX_Camera*cam,int layer=0); + void MarkVisible(RAS_IRasterizer* rasty, KX_GameObject* gameobj, KX_Camera*cam, int layer=0); double m_suspendedtime; double m_suspendeddelta; @@ -483,7 +483,7 @@ public: void SetNetworkScene(NG_NetworkScene *newScene); void SetWorldInfo(class KX_WorldInfo* wi); KX_WorldInfo* GetWorldInfo(); - void CalculateVisibleMeshes(RAS_IRasterizer* rasty, KX_Camera *cam); + void CalculateVisibleMeshes(RAS_IRasterizer* rasty, KX_Camera *cam, int layer=0); void UpdateMeshTransformations(); KX_Camera* GetpCamera(); SND_Scene* GetSoundScene(); diff --git a/source/gameengine/Ketsji/KX_TouchEventManager.cpp b/source/gameengine/Ketsji/KX_TouchEventManager.cpp index 80ee15a9475..423543eef5c 100644 --- a/source/gameengine/Ketsji/KX_TouchEventManager.cpp +++ b/source/gameengine/Ketsji/KX_TouchEventManager.cpp @@ -137,14 +137,18 @@ void KX_TouchEventManager::NextFrame() // KX_GameObject* gameOb1 = ctrl1->getClientInfo(); KX_ClientObjectInfo *client_info = static_cast(ctrl1->getNewClientInfo()); - list::iterator sit; - for ( sit = client_info->m_sensors.begin(); sit != client_info->m_sensors.end(); ++sit) - static_cast(*sit)->NewHandleCollision((*cit).first, (*cit).second, NULL); - + if (client_info) { + for ( sit = client_info->m_sensors.begin(); sit != client_info->m_sensors.end(); ++sit) { + static_cast(*sit)->NewHandleCollision((*cit).first, (*cit).second, NULL); + } + } client_info = static_cast((*cit).second->getNewClientInfo()); - for ( sit = client_info->m_sensors.begin(); sit != client_info->m_sensors.end(); ++sit) - static_cast(*sit)->NewHandleCollision((*cit).second, (*cit).first, NULL); + if (client_info) { + for ( sit = client_info->m_sensors.begin(); sit != client_info->m_sensors.end(); ++sit) { + static_cast(*sit)->NewHandleCollision((*cit).second, (*cit).first, NULL); + } + } } m_newCollisions.clear(); diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp index 5311f059f03..ce3aa1de2ef 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.cpp +++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp @@ -61,7 +61,9 @@ void KX_TouchSensor::EndFrame() { bool KX_TouchSensor::Evaluate(CValue* event) { bool result = false; + bool reset = m_reset && m_level; + m_reset = false; if (m_bTriggered != m_bLastTriggered) { m_bLastTriggered = m_bTriggered; @@ -69,7 +71,9 @@ bool KX_TouchSensor::Evaluate(CValue* event) m_hitObject = NULL; result = true; } - + if (reset) + // force an event + result = true; return result; } @@ -103,6 +107,7 @@ void KX_TouchSensor::Init() m_bTriggered = false; m_bLastTriggered = (m_invert)?true:false; m_hitObject = NULL; + m_reset = true; } KX_TouchSensor::~KX_TouchSensor() @@ -115,10 +120,7 @@ CValue* KX_TouchSensor::GetReplica() { KX_TouchSensor* replica = new KX_TouchSensor(*this); replica->m_colliders = new CListValue(); - replica->m_bCollision = false; - replica->m_bTriggered= false; - replica->m_hitObject = NULL; - replica->m_bLastTriggered = false; + replica->Init(); // this will copy properties and so on... CValue::AddDataToReplica(replica); return replica; diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.cpp b/source/gameengine/Ketsji/KX_TrackToActuator.cpp index b9792303565..731a610c2eb 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.cpp +++ b/source/gameengine/Ketsji/KX_TrackToActuator.cpp @@ -224,7 +224,8 @@ bool KX_TrackToActuator::Update(double curtime, bool frame) { KX_GameObject* curobj = (KX_GameObject*) GetParent(); MT_Vector3 dir = ((KX_GameObject*)m_object)->NodeGetWorldPosition() - curobj->NodeGetWorldPosition(); - dir.normalize(); + if (dir.length2()) + dir.normalize(); MT_Vector3 up(0,0,1); @@ -250,12 +251,12 @@ bool KX_TrackToActuator::Update(double curtime, bool frame) #endif if (m_allow3D) { - up = (up - up.dot(dir) * dir).normalized(); + up = (up - up.dot(dir) * dir).safe_normalized(); } else { - dir = (dir - up.dot(dir)*up).normalized(); + dir = (dir - up.dot(dir)*up).safe_normalized(); } MT_Vector3 left; @@ -266,8 +267,8 @@ bool KX_TrackToActuator::Update(double curtime, bool frame) case 0: // TRACK X { // (1.0 , 0.0 , 0.0 ) x direction is forward, z (0.0 , 0.0 , 1.0 ) up - left = dir.normalized(); - dir = (left.cross(up)).normalized(); + left = dir.safe_normalized(); + dir = (left.cross(up)).safe_normalized(); mat.setValue ( left[0], dir[0],up[0], left[1], dir[1],up[1], @@ -279,7 +280,7 @@ bool KX_TrackToActuator::Update(double curtime, bool frame) case 1: // TRACK Y { // (0.0 , 1.0 , 0.0 ) y direction is forward, z (0.0 , 0.0 , 1.0 ) up - left = (dir.cross(up)).normalized(); + left = (dir.cross(up)).safe_normalized(); mat.setValue ( left[0], dir[0],up[0], left[1], dir[1],up[1], @@ -291,10 +292,10 @@ bool KX_TrackToActuator::Update(double curtime, bool frame) case 2: // track Z { - left = up.normalized(); - up = dir.normalized(); + left = up.safe_normalized(); + up = dir.safe_normalized(); dir = left; - left = (dir.cross(up)).normalized(); + left = (dir.cross(up)).safe_normalized(); mat.setValue ( left[0], dir[0],up[0], left[1], dir[1],up[1], @@ -306,8 +307,8 @@ bool KX_TrackToActuator::Update(double curtime, bool frame) case 3: // TRACK -X { // (1.0 , 0.0 , 0.0 ) x direction is forward, z (0.0 , 0.0 , 1.0 ) up - left = -dir.normalized(); - dir = -(left.cross(up)).normalized(); + left = -dir.safe_normalized(); + dir = -(left.cross(up)).safe_normalized(); mat.setValue ( left[0], dir[0],up[0], left[1], dir[1],up[1], @@ -319,7 +320,7 @@ bool KX_TrackToActuator::Update(double curtime, bool frame) case 4: // TRACK -Y { // (0.0 , -1.0 , 0.0 ) -y direction is forward, z (0.0 , 0.0 , 1.0 ) up - left = (-dir.cross(up)).normalized(); + left = (-dir.cross(up)).safe_normalized(); mat.setValue ( left[0], -dir[0],up[0], left[1], -dir[1],up[1], @@ -329,10 +330,10 @@ bool KX_TrackToActuator::Update(double curtime, bool frame) } case 5: // track -Z { - left = up.normalized(); - up = -dir.normalized(); + left = up.safe_normalized(); + up = -dir.safe_normalized(); dir = left; - left = (dir.cross(up)).normalized(); + left = (dir.cross(up)).safe_normalized(); mat.setValue ( left[0], dir[0],up[0], left[1], dir[1],up[1], @@ -345,8 +346,8 @@ bool KX_TrackToActuator::Update(double curtime, bool frame) default: { // (1.0 , 0.0 , 0.0 ) -x direction is forward, z (0.0 , 0.0 , 1.0 ) up - left = -dir.normalized(); - dir = -(left.cross(up)).normalized(); + left = -dir.safe_normalized(); + dir = -(left.cross(up)).safe_normalized(); mat.setValue ( left[0], dir[0],up[0], left[1], dir[1],up[1], diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp index fba2ecc223b..7e8160a4d67 100644 --- a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp +++ b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp @@ -68,6 +68,8 @@ PyObject* KX_VehicleWrapper::PyAddWheel(PyObject* self, printf("attempt for addWheel: suspensionRestLength%f wheelRadius %f, hasSteering:%d\n",suspensionRestLength,wheelRadius,hasSteering); m_vehicle->AddWheel(motionState,aPos,aDir,aAxle,suspensionRestLength,wheelRadius,hasSteering); + } else { + return NULL; } Py_INCREF(Py_None); return Py_None; @@ -90,8 +92,7 @@ PyObject* KX_VehicleWrapper::PyGetWheelPosition(PyObject* self, MT_Vector3 pos(position[0],position[1],position[2]); return PyObjectFrom(pos); } - Py_INCREF(Py_None); - return Py_None; + return NULL; } PyObject* KX_VehicleWrapper::PyGetWheelRotation(PyObject* self, @@ -103,8 +104,7 @@ PyObject* KX_VehicleWrapper::PyGetWheelRotation(PyObject* self, { return PyFloat_FromDouble(m_vehicle->GetWheelRotation(wheelIndex)); } - Py_INCREF(Py_None); - return Py_None; + return NULL; } PyObject* KX_VehicleWrapper::PyGetWheelOrientationQuaternion(PyObject* self, @@ -120,8 +120,7 @@ PyObject* KX_VehicleWrapper::PyGetWheelOrientationQuaternion(PyObject* self, MT_Matrix3x3 ornmat(quatorn); return PyObjectFrom(ornmat); } - Py_INCREF(Py_None); - return Py_None; + return NULL; } @@ -155,6 +154,9 @@ PyObject* KX_VehicleWrapper::PyApplyEngineForce(PyObject* self, force *= -1.f;//someone reverse some conventions inside Bullet (axle winding) m_vehicle->ApplyEngineForce(force,wheelIndex); } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -170,6 +172,9 @@ PyObject* KX_VehicleWrapper::PySetTyreFriction(PyObject* self, { m_vehicle->SetWheelFriction(wheelFriction,wheelIndex); } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -185,6 +190,9 @@ PyObject* KX_VehicleWrapper::PySetSuspensionStiffness(PyObject* self, { m_vehicle->SetSuspensionStiffness(suspensionStiffness,wheelIndex); } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -199,6 +207,8 @@ PyObject* KX_VehicleWrapper::PySetSuspensionDamping(PyObject* self, if (PyArg_ParseTuple(args,"fi",&suspensionDamping,&wheelIndex)) { m_vehicle->SetSuspensionDamping(suspensionDamping,wheelIndex); + } else { + return NULL; } Py_INCREF(Py_None); return Py_None; @@ -214,6 +224,8 @@ PyObject* KX_VehicleWrapper::PySetSuspensionCompression(PyObject* self, if (PyArg_ParseTuple(args,"fi",&suspensionCompression,&wheelIndex)) { m_vehicle->SetSuspensionCompression(suspensionCompression,wheelIndex); + } else { + return NULL; } Py_INCREF(Py_None); return Py_None; @@ -230,6 +242,9 @@ PyObject* KX_VehicleWrapper::PySetRollInfluence(PyObject* self, { m_vehicle->SetRollInfluence(rollInfluence,wheelIndex); } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -246,6 +261,9 @@ PyObject* KX_VehicleWrapper::PyApplyBraking(PyObject* self, { m_vehicle->ApplyBraking(braking,wheelIndex); } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } @@ -264,6 +282,9 @@ PyObject* KX_VehicleWrapper::PySetSteeringValue(PyObject* self, { m_vehicle->SetSteeringValue(steeringValue,wheelIndex); } + else { + return NULL; + } Py_INCREF(Py_None); return Py_None; } diff --git a/source/gameengine/PyDoc/BL_ActionActuator.py b/source/gameengine/PyDoc/BL_ActionActuator.py index 41f41080c31..d56888cde80 100644 --- a/source/gameengine/PyDoc/BL_ActionActuator.py +++ b/source/gameengine/PyDoc/BL_ActionActuator.py @@ -86,6 +86,14 @@ class BL_ActionActuator(SCA_IActuator): @param mode: KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND @type mode: integer """ + + def setContinue(cont): + """ + Set the actions continue option True or False. see getContinue. + + @param cont: The continue option. + @type cont: bool + """ def getType(): """ @@ -94,6 +102,13 @@ class BL_ActionActuator(SCA_IActuator): @rtype: integer @return: KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND """ + + def getContinue(): + """ + When True, the action will always play from where last left off, otherwise negative events to this actuator will reset it to its start frame. + + @rtype: bool + """ def getAction(): """ diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index ec7496daa75..37c188b7f22 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -90,15 +90,26 @@ class KX_GameObject: - 1: Y axis - 2: Z axis (default) """ + def getAxisVect(vect): + """ + Returns the axis vector rotates by the objects worldspace orientation. + This is the equivalent if multiplying the vector by the orientation matrix. + + @type vect: 3d vector. + @param vect: a vector to align the axis. + @rtype: 3d vector. + @return: The vector in relation to the objects rotation. + + """ def getOrientation(): """ Gets the game object's orientation. - @rtype: 3x3 inverted rotation matrix + @rtype: 3x3 rotation matrix @return: The game object's rotation matrix @note: When using this matrix with Blender.Mathutils.Matrix() types, it will need to be transposed. """ - def getLinearVelocity(local): + def getLinearVelocity(local = 0): """ Gets the game object's linear velocity. @@ -106,11 +117,24 @@ class KX_GameObject: ie no angular velocity component. @type local: boolean - @param local: - False: you get the "global" velocity ie: relative to world orientation. + @param local: - False: you get the "global" velocity ie: relative to world orientation (default). - True: you get the "local" velocity ie: relative to object orientation. @rtype: list [vx, vy, vz] @return: the object's linear velocity. """ + def setLinearVelocity(velocity, local = 0): + """ + Sets the game object's linear velocity. + + This method sets game object's velocity through it's centre of mass, + ie no angular velocity component. + + @type velocity: 3d vector. + @param velocity: linear velocity vector. + @type local: boolean + @param local: - False: you get the "global" velocity ie: relative to world orientation (default). + - True: you get the "local" velocity ie: relative to object orientation. + """ def getVelocity(point): """ Gets the game object's velocity at the specified point. @@ -158,16 +182,19 @@ class KX_GameObject: def restoreDynamics(): """ Resumes physics for this object. + @Note: The objects linear velocity will be applied from when the dynamics were suspended. """ def enableRigidBody(): """ Enables rigid body physics for this object. Rigid body physics allows the object to roll on collisions. + @Note: This is not working with bullet physics yet. """ def disableRigidBody(): """ Disables rigid body physics for this object. + @Note: This is not working with bullet physics yet. The angular is removed but rigid body physics can still rotate it later. """ def getParent(): """ diff --git a/source/gameengine/Rasterizer/CMakeLists.txt b/source/gameengine/Rasterizer/CMakeLists.txt index 18a755afefd..6d53ee53471 100644 --- a/source/gameengine/Rasterizer/CMakeLists.txt +++ b/source/gameengine/Rasterizer/CMakeLists.txt @@ -32,6 +32,8 @@ SET(INC ../../../intern/string ../../../intern/moto/include ../../../extern/glew/include + ../Expressions + ${PYTHON_INC} ) BLENDERLIB(bf_rasterizer "${SRC}" "${INC}") diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp index 23153fcd86c..958fead33ce 100644 --- a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp +++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp @@ -52,6 +52,7 @@ #include #endif +#include "Value.h" RAS_2DFilterManager::RAS_2DFilterManager(): texturewidth(-1), textureheight(-1), @@ -73,12 +74,14 @@ numberoffilters(0) m_filters[passindex] = 0; m_enabled[passindex] = 0; texflag[passindex] = 0; + m_gameObjects[passindex] = NULL; } texname[0] = texname[1] = texname[2] = -1; } RAS_2DFilterManager::~RAS_2DFilterManager() { + FreeTextures(); } unsigned int RAS_2DFilterManager::CreateShaderProgram(char* shadersource) @@ -150,6 +153,27 @@ unsigned int RAS_2DFilterManager::CreateShaderProgram(int filtermode) } return 0; } +void RAS_2DFilterManager::AnalyseShader(int passindex, vector& propNames) +{ + texflag[passindex] = 0; + if(glGetUniformLocationARB(m_filters[passindex], "bgl_DepthTexture") != -1) + { + texflag[passindex] |= 0x1; + } + if(glGetUniformLocationARB(m_filters[passindex], "bgl_LuminanceTexture") != -1) + { + texflag[passindex] |= 0x2; + } + + if(m_gameObjects[passindex]) + { + int objProperties = propNames.size(); + int i; + for(i=0; iGetPropertyNumber(m_properties[passindex][i], 0.0); + glUniform1fARB(uniformLoc,value); + } + } } void RAS_2DFilterManager::EndShaderProgram() @@ -210,14 +245,21 @@ void RAS_2DFilterManager::EndShaderProgram() glUseProgramObjectARB(0); } -void RAS_2DFilterManager::SetupTexture() +void RAS_2DFilterManager::FreeTextures() { - if(texname[0]!=-1 || texname[1]!=-1) - { - glDeleteTextures(2, (GLuint*)texname); - } - glGenTextures(3, (GLuint*)texname); + if(texname[0]!=-1) + glDeleteTextures(1, (GLuint*)&texname[0]); + if(texname[1]!=-1) + glDeleteTextures(1, (GLuint*)&texname[1]); + if(texname[2]!=-1) + glDeleteTextures(1, (GLuint*)&texname[2]); +} +void RAS_2DFilterManager::SetupTextures(bool depth, bool luminance) +{ + FreeTextures(); + + glGenTextures(1, (GLuint*)&texname[0]); glBindTexture(GL_TEXTURE_2D, texname[0]); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texturewidth, textureheight, 0, GL_RGB, GL_UNSIGNED_BYTE, 0); @@ -226,23 +268,29 @@ void RAS_2DFilterManager::SetupTexture() glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); - glBindTexture(GL_TEXTURE_2D, texname[1]); - glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT32, texturewidth,textureheight, 0, GL_DEPTH_COMPONENT, - GL_FLOAT,NULL); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, + if(depth){ + glGenTextures(1, (GLuint*)&texname[1]); + glBindTexture(GL_TEXTURE_2D, texname[1]); + glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT32, texturewidth,textureheight, + 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE,NULL); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_NONE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); - - glBindTexture(GL_TEXTURE_2D, texname[2]); - glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE16, texturewidth, textureheight, 0, GL_LUMINANCE, - GL_UNSIGNED_BYTE, 0); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); + } + + if(luminance){ + glGenTextures(1, (GLuint*)&texname[2]); + glBindTexture(GL_TEXTURE_2D, texname[2]); + glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE16, texturewidth, textureheight, + 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, 0); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); + } } void RAS_2DFilterManager::UpdateOffsetMatrix(int width, int height) @@ -273,62 +321,72 @@ void RAS_2DFilterManager::UpdateOffsetMatrix(int width, int height) textureoffsets[(((i*3)+j)*2)+1] = (-1.0f * yInc) + ((GLfloat)j * yInc); } } - - SetupTexture(); } void RAS_2DFilterManager::RenderFilters(RAS_ICanvas* canvas) { + bool need_depth=false; + bool need_luminance=false; + int num_filters = 0; + + int passindex; + if(!isshadersupported) return; + for(passindex =0; passindexGetWidth() || canvasheight != canvas->GetHeight()) { UpdateOffsetMatrix(canvas->GetWidth(), canvas->GetHeight()); + SetupTextures(need_depth, need_luminance); } GLuint viewport[4]={0}; - int passindex; - bool first = true; + if(need_depth){ + glActiveTextureARB(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D, texname[1]); + glCopyTexImage2D(GL_TEXTURE_2D,0,GL_DEPTH_COMPONENT, 0,0, texturewidth,textureheight, 0); + } + + if(need_luminance){ + glActiveTextureARB(GL_TEXTURE2); + glBindTexture(GL_TEXTURE_2D, texname[2]); + glCopyTexImage2D(GL_TEXTURE_2D,0,GL_LUMINANCE16, 0,0, texturewidth,textureheight, 0); + } + + glGetIntegerv(GL_VIEWPORT,(GLint *)viewport); + glViewport(0, 0, texturewidth, textureheight); + + glDisable(GL_DEPTH_TEST); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); for(passindex =0; passindex& propNames, void* gameObj, RAS_2DFILTER_MODE mode, int pass, STR_String& text) { if(!isshadersupported) return; @@ -374,16 +429,19 @@ void RAS_2DFilterManager::EnableFilter(RAS_2DFILTER_MODE mode, int pass, STR_Str glDeleteObjectARB(m_filters[pass]); m_enabled[pass] = 0; m_filters[pass] = 0; + m_gameObjects[pass] = NULL; + m_properties[pass].clear(); texflag[pass] = 0; return; } if(mode == RAS_2DFILTER_CUSTOMFILTER) { - texflag[pass] = tflag; if(m_filters[pass]) glDeleteObjectARB(m_filters[pass]); m_filters[pass] = CreateShaderProgram(text.Ptr()); + m_gameObjects[pass] = gameObj; + AnalyseShader(pass, propNames); m_enabled[pass] = 1; return; } diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.h b/source/gameengine/Rasterizer/RAS_2DFilterManager.h index faf7c652388..9d8326b96de 100644 --- a/source/gameengine/Rasterizer/RAS_2DFilterManager.h +++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.h @@ -28,8 +28,6 @@ #ifndef __RAS_I2DFILTER #define __RAS_I2DFILTER - - #define MAX_RENDER_PASS 100 class RAS_2DFilterManager @@ -37,9 +35,15 @@ class RAS_2DFilterManager private: unsigned int CreateShaderProgram(char* shadersource); unsigned int CreateShaderProgram(int filtermode); + void AnalyseShader(int passindex, vector& propNames); void StartShaderProgram(int passindex); void EndShaderProgram(); + void SetupTextures(bool depth, bool luminance); + void FreeTextures(); + + void UpdateOffsetMatrix(int width, int height); + float textureoffsets[18]; float view[4]; /* texname[0] contains render to texture, texname[1] contains depth texture, texname[2] contains luminance texture*/ @@ -54,6 +58,13 @@ private: short texflag[MAX_RENDER_PASS]; bool isshadersupported; + + unsigned int m_filters[MAX_RENDER_PASS]; + short m_enabled[MAX_RENDER_PASS]; + + // stores object properties to send to shaders in each pass + vector m_properties[MAX_RENDER_PASS]; + void* m_gameObjects[MAX_RENDER_PASS]; public: enum RAS_2DFILTER_MODE { RAS_2DFILTER_ENABLED = -2, @@ -74,19 +85,12 @@ public: RAS_2DFILTER_NUMBER_OF_FILTERS }; - unsigned int m_filters[MAX_RENDER_PASS]; - short m_enabled[MAX_RENDER_PASS]; - RAS_2DFilterManager(); ~RAS_2DFilterManager(); - void SetupTexture(); - - void UpdateOffsetMatrix(int width, int height); - void RenderFilters(RAS_ICanvas* canvas); - void EnableFilter(RAS_2DFILTER_MODE mode, int pass, STR_String& text, short tflag); + void EnableFilter(vector& propNames, void* gameObj, RAS_2DFILTER_MODE mode, int pass, STR_String& text); }; #endif diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.cpp b/source/gameengine/Rasterizer/RAS_BucketManager.cpp index 50df1a1e2ea..b4492ca03a9 100644 --- a/source/gameengine/Rasterizer/RAS_BucketManager.cpp +++ b/source/gameengine/Rasterizer/RAS_BucketManager.cpp @@ -109,7 +109,7 @@ void RAS_BucketManager::RenderAlphaBuckets( // it is needed for compatibility. rasty->SetDepthMask(RAS_IRasterizer::KX_DEPTHMASK_DISABLED); - int drawingmode; + RAS_IRasterizer::DrawMode drawingmode; std::multiset< alphamesh, backtofront>::iterator msit = alphameshset.begin(); for (; msit != alphameshset.end(); ++msit) { diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp index bff98abe058..cb10ba6bf37 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp @@ -27,6 +27,7 @@ */ #include "RAS_IPolygonMaterial.h" +#include "RAS_IRasterizer.h" #ifdef HAVE_CONFIG_H #include @@ -148,4 +149,19 @@ const unsigned int RAS_IPolyMaterial::GetFlag() const return m_flag; } +bool RAS_IPolyMaterial::UsesLighting(RAS_IRasterizer *rasty) const +{ + bool dolights = false; + + if(m_flag & RAS_BLENDERMAT) + dolights = (m_flag &RAS_MULTILIGHT)!=0; + else if(rasty->GetDrawingMode() < RAS_IRasterizer::KX_SOLID); + else if(rasty->GetDrawingMode() == RAS_IRasterizer::KX_SHADOW); + else + dolights = (m_drawingmode & 16)!=0; + + return dolights; +} + unsigned int RAS_IPolyMaterial::m_newpolymatid = 0; + diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h index 09824f6975c..d2d1dba99d9 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h @@ -140,6 +140,8 @@ public: const STR_String& GetMaterialName() const; const STR_String& GetTextureName() const; const unsigned int GetFlag() const; + + virtual bool UsesLighting(RAS_IRasterizer *rasty) const; /* * PreCalculate texture gen diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h index dbedc492afa..d4a9177a85d 100644 --- a/source/gameengine/Rasterizer/RAS_IRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h @@ -33,12 +33,23 @@ #pragma warning (disable:4786) #endif +#include "STR_HashedString.h" + #include "MT_CmMatrix4x4.h" #include "MT_Matrix4x4.h" +#include "RAS_TexVert.h" + +#include +using namespace std; + class RAS_ICanvas; class RAS_IPolyMaterial; -#include "RAS_MaterialBucket.h" + +typedef vector KX_IndexArray; +typedef vector KX_VertexArray; +typedef vector< KX_VertexArray* > vecVertexArray; +typedef vector< KX_IndexArray* > vecIndexArrays; /** * 3D rendering device context interface. @@ -62,7 +73,18 @@ public: KX_WIREFRAME, KX_SOLID, KX_SHADED, - KX_TEXTURED + KX_TEXTURED, + KX_SHADOW + }; + + /** + * Drawing modes + */ + + enum DrawMode { + KX_MODE_LINES = 1, + KX_MODE_TRIANGLES, + KX_MODE_QUADS }; /** @@ -111,6 +133,7 @@ public: RAS_TEXCO_NORM, //< Normal coordinates RAS_TEXTANGENT, //< RAS_TEXCO_UV2, //< + RAS_TEXCO_VCOL, //< Vertex Color RAS_TEXCO_DISABLE //< Disable this texture unit (cached) }; @@ -197,45 +220,37 @@ public: * IndexPrimitives: Renders primitives. * @param vertexarrays is an array of vertex arrays * @param indexarrays is an array of index arrays - * @param mode determines the type of primitive stored in the vertex/index arrays: - * 0 triangles - * 1 lines (default) - * 2 quads - * @param polymat (reserved) + * @param mode determines the type of primitive stored in the vertex/index arrays * @param useObjectColor will render the object using @param rgbacolor instead of * vertex colors. */ - virtual void IndexPrimitives( const vecVertexArray& vertexarrays, + virtual void IndexPrimitives( const vecVertexArray& vertexarrays, const vecIndexArrays & indexarrays, - int mode, - class RAS_IPolyMaterial* polymat, - class RAS_IRenderTools* rendertools, + DrawMode mode, bool useObjectColor, const MT_Vector4& rgbacolor, class KX_ListSlot** slot)=0; + virtual void IndexPrimitivesMulti( + const vecVertexArray& vertexarrays, + const vecIndexArrays & indexarrays, + DrawMode mode, + bool useObjectColor, + const MT_Vector4& rgbacolor, + class KX_ListSlot** slot)=0; + /** * IndexPrimitives_3DText will render text into the polygons. * The text to be rendered is from @param rendertools client object's text property. */ virtual void IndexPrimitives_3DText( const vecVertexArray& vertexarrays, const vecIndexArrays & indexarrays, - int mode, + DrawMode mode, class RAS_IPolyMaterial* polymat, class RAS_IRenderTools* rendertools, bool useObjectColor, const MT_Vector4& rgbacolor)=0; - virtual void IndexPrimitivesMulti( - const vecVertexArray& vertexarrays, - const vecIndexArrays & indexarrays, - int mode, - class RAS_IPolyMaterial* polymat, - class RAS_IRenderTools* rendertools, - bool useObjectColor, - const MT_Vector4& rgbacolor, - class KX_ListSlot** slot)=0; - virtual void SetProjectionMatrix(MT_CmMatrix4x4 & mat)=0; /* This one should become our final version, methinks. */ /** diff --git a/source/gameengine/Rasterizer/RAS_IRenderTools.h b/source/gameengine/Rasterizer/RAS_IRenderTools.h index 781f90d4124..54a663ba111 100644 --- a/source/gameengine/Rasterizer/RAS_IRenderTools.h +++ b/source/gameengine/Rasterizer/RAS_IRenderTools.h @@ -185,7 +185,7 @@ public: virtual void - Update2DFilter(RAS_2DFilterManager::RAS_2DFILTER_MODE filtermode, int pass, STR_String& text, short textureflag)=0; + Update2DFilter(vector& propNames, void* gameObj, RAS_2DFilterManager::RAS_2DFILTER_MODE filtermode, int pass, STR_String& text)=0; virtual void diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp index 1beade7acf7..e295d69e48e 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp @@ -167,38 +167,30 @@ RAS_MaterialBucket::T_MeshSlotList::iterator RAS_MaterialBucket::msEnd() } bool RAS_MaterialBucket::ActivateMaterial(const MT_Transform& cameratrans, RAS_IRasterizer* rasty, - RAS_IRenderTools *rendertools, int &drawmode) + RAS_IRenderTools *rendertools, RAS_IRasterizer::DrawMode &drawmode) { rendertools->SetViewMat(cameratrans); if (!rasty->SetMaterial(*m_material)) return false; - bool dolights = false; - const unsigned int flag = m_material->GetFlag(); - - if( flag & RAS_BLENDERMAT) - dolights = (flag &RAS_MULTILIGHT)!=0; - else - dolights = (m_material->GetDrawingMode()&16)!=0; - - if ((rasty->GetDrawingMode() < RAS_IRasterizer::KX_SOLID) || !dolights) - { - rendertools->ProcessLighting(-1); - } - else - { + if (m_material->UsesLighting(rasty)) rendertools->ProcessLighting(RAS_IRenderTools::RAS_LIGHT_OBJECT_LAYER/*m_material->GetLightLayer()*/); - } + else + rendertools->ProcessLighting(-1); - drawmode = (rasty->GetDrawingMode() < RAS_IRasterizer::KX_SOLID ? - 1: (m_material->UsesTriangles() ? 0 : 2)); + if(rasty->GetDrawingMode() < RAS_IRasterizer::KX_SOLID) + drawmode = RAS_IRasterizer::KX_MODE_LINES; + else if(m_material->UsesTriangles()) + drawmode = RAS_IRasterizer::KX_MODE_TRIANGLES; + else + drawmode = RAS_IRasterizer::KX_MODE_QUADS; return true; } void RAS_MaterialBucket::RenderMeshSlot(const MT_Transform& cameratrans, RAS_IRasterizer* rasty, - RAS_IRenderTools* rendertools, const KX_MeshSlot &ms, int drawmode) + RAS_IRenderTools* rendertools, const KX_MeshSlot &ms, RAS_IRasterizer::DrawMode drawmode) { if (!ms.m_bVisible) return; @@ -225,6 +217,17 @@ void RAS_MaterialBucket::RenderMeshSlot(const MT_Transform& cameratrans, RAS_IRa ms.m_DisplayList->SetModified(ms.m_mesh->MeshModified()); } + // verify if we can use display list, not for deformed object, and + // also don't create a new display list when drawing shadow buffers, + // then it won't have texture coordinates for actual drawing + KX_ListSlot **displaylist; + if(ms.m_pDeformer) + displaylist = 0; + else if(!ms.m_DisplayList && rasty->GetDrawingMode() == RAS_IRasterizer::KX_SHADOW) + displaylist = 0; + else + displaylist = &ms.m_DisplayList; + // Use the text-specific IndexPrimitives for text faces if (m_material->GetDrawingMode() & RAS_IRasterizer::RAS_RENDER_3DPOLYGON_TEXT) { @@ -245,12 +248,9 @@ void RAS_MaterialBucket::RenderMeshSlot(const MT_Transform& cameratrans, RAS_IRa ms.m_mesh->GetVertexCache(m_material), ms.m_mesh->GetIndexCache(m_material), drawmode, - m_material, - rendertools, ms.m_bObjectColor, ms.m_RGBAcolor, - (ms.m_pDeformer)? 0: &ms.m_DisplayList - ); + displaylist); } // Use the normal IndexPrimitives @@ -260,12 +260,9 @@ void RAS_MaterialBucket::RenderMeshSlot(const MT_Transform& cameratrans, RAS_IRa ms.m_mesh->GetVertexCache(m_material), ms.m_mesh->GetIndexCache(m_material), drawmode, - m_material, - rendertools, // needed for textprinting on polys ms.m_bObjectColor, ms.m_RGBAcolor, - (ms.m_pDeformer)? 0: &ms.m_DisplayList - ); + displaylist); } if(rasty->QueryLists()) { @@ -287,7 +284,7 @@ void RAS_MaterialBucket::Render(const MT_Transform& cameratrans, //rasty->SetMaterial(*m_material); - int drawmode; + RAS_IRasterizer::DrawMode drawmode; for (T_MeshSlotList::const_iterator it = m_meshSlots.begin(); ! (it == m_meshSlots.end()); ++it) { diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.h b/source/gameengine/Rasterizer/RAS_MaterialBucket.h index 5ad0c173a56..13d8a53714a 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.h +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.h @@ -35,17 +35,13 @@ #include "MT_Transform.h" #include "RAS_IPolygonMaterial.h" +#include "RAS_IRasterizer.h" #include "RAS_Deformer.h" // __NLA #include #include #include using namespace std; -typedef vector KX_IndexArray; -typedef vector KX_VertexArray; -typedef vector< KX_VertexArray* > vecVertexArray; -typedef vector< KX_IndexArray* > vecIndexArrays; - /** * KX_VertexIndex */ @@ -146,9 +142,9 @@ public: const MT_Vector4& rgbavec); void RenderMeshSlot(const MT_Transform& cameratrans, RAS_IRasterizer* rasty, - RAS_IRenderTools* rendertools, const KX_MeshSlot &ms, int drawmode); + RAS_IRenderTools* rendertools, const KX_MeshSlot &ms, RAS_IRasterizer::DrawMode drawmode); bool ActivateMaterial(const MT_Transform& cameratrans, RAS_IRasterizer* rasty, - RAS_IRenderTools *rendertools, int &drawmode); + RAS_IRenderTools *rendertools, RAS_IRasterizer::DrawMode& drawmode); unsigned int NumMeshSlots(); T_MeshSlotList::iterator msBegin(); diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.cpp b/source/gameengine/Rasterizer/RAS_MeshObject.cpp index d7ab88a6b06..4420f16c56d 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.cpp +++ b/source/gameengine/Rasterizer/RAS_MeshObject.cpp @@ -68,8 +68,8 @@ RAS_MeshObject::RAS_MeshObject(Mesh* mesh, int lightlayer) m_lightlayer(lightlayer), m_zsort(false), m_MeshMod(true), - m_class(0), - m_mesh(mesh) + m_mesh(mesh), + m_class(0) { } @@ -259,18 +259,18 @@ int RAS_MeshObject::FindOrAddVertex(int vtxarray, const MT_Vector3& normal, bool flat, RAS_IPolyMaterial* mat, - int orgindex) + int origindex) { - KX_ArrayOptimizer* ao = GetArrayOptimizer(mat);//*(m_matVertexArrays[*mat]); + KX_ArrayOptimizer* ao = GetArrayOptimizer(mat); int numverts = ao->m_VertexArrayCache1[vtxarray]->size();//m_VertexArrayCount[vtxarray]; - RAS_TexVert newvert(xyz,uv,uv2,tangent,rgbacolor,normal, flat? TV_CALCFACENORMAL: 0); + RAS_TexVert newvert(xyz,uv,uv2,tangent,rgbacolor,normal, flat? TV_CALCFACENORMAL: 0,origindex); #define KX_FIND_SHARED_VERTICES #ifdef KX_FIND_SHARED_VERTICES if(!flat) { - for (std::vector::iterator it = m_xyz_index_to_vertex_index_mapping[orgindex].begin(); - it != m_xyz_index_to_vertex_index_mapping[orgindex].end(); + for (std::vector::iterator it = m_xyz_index_to_vertex_index_mapping[origindex].begin(); + it != m_xyz_index_to_vertex_index_mapping[origindex].end(); it++) { if ((*it).m_arrayindex1 == ao->m_index1 && @@ -293,22 +293,18 @@ int RAS_MeshObject::FindOrAddVertex(int vtxarray, idx.m_array = vtxarray; idx.m_index = numverts; idx.m_matid = mat; - m_xyz_index_to_vertex_index_mapping[orgindex].push_back(idx); + m_xyz_index_to_vertex_index_mapping[origindex].push_back(idx); return numverts; } - - -const vecVertexArray& RAS_MeshObject::GetVertexCache (RAS_IPolyMaterial* mat) +vecVertexArray& RAS_MeshObject::GetVertexCache (RAS_IPolyMaterial* mat) { - KX_ArrayOptimizer* ao = GetArrayOptimizer(mat);//*(m_matVertexArrays[*mat]); + KX_ArrayOptimizer* ao = GetArrayOptimizer(mat); return ao->m_VertexArrayCache1; } - - int RAS_MeshObject::GetVertexArrayLength(RAS_IPolyMaterial* mat) { int len = 0; @@ -362,7 +358,7 @@ RAS_TexVert* RAS_MeshObject::GetVertex(unsigned int matid, const vecIndexArrays& RAS_MeshObject::GetIndexCache (RAS_IPolyMaterial* mat) { - KX_ArrayOptimizer* ao = GetArrayOptimizer(mat);//*(m_matVertexArrays[*mat]); + KX_ArrayOptimizer* ao = GetArrayOptimizer(mat); return ao->m_IndexArrayCache1; } @@ -371,16 +367,27 @@ const vecIndexArrays& RAS_MeshObject::GetIndexCache (RAS_IPolyMaterial* mat) KX_ArrayOptimizer* RAS_MeshObject::GetArrayOptimizer(RAS_IPolyMaterial* polymat) { - KX_ArrayOptimizer** aop = (m_matVertexArrayS[*polymat]); + KX_ArrayOptimizer** aop = m_matVertexArrayS[polymat]; - if (aop) + if(aop) return *aop; + // didn't find array, but an array might already exist + // for a material equal to this one + for(int i=0;igetValue()); + if(*mat == *polymat) { + m_matVertexArrayS.insert(polymat, *m_matVertexArrayS.at(i)); + return *m_matVertexArrayS.at(i); + } + } + + // create new array int numelements = m_matVertexArrayS.size(); m_sortedMaterials.push_back(polymat); - + KX_ArrayOptimizer* ao = new KX_ArrayOptimizer(numelements); - m_matVertexArrayS.insert(*polymat,ao); + m_matVertexArrayS.insert(polymat, ao); return ao; } @@ -463,7 +470,7 @@ RAS_TexVert* RAS_MeshObject::GetVertex(short array, unsigned int index, RAS_IPolyMaterial* polymat) { - KX_ArrayOptimizer* ao = GetArrayOptimizer(polymat);//*(m_matVertexArrays[*polymat]); + KX_ArrayOptimizer* ao = GetArrayOptimizer(polymat); return &((*(ao->m_VertexArrayCache1)[array])[index]); } @@ -471,13 +478,19 @@ RAS_TexVert* RAS_MeshObject::GetVertex(short array, void RAS_MeshObject::ClearArrayData() { - for (int i=0;i m_matVertexArrayS; + GEN_Map m_matVertexArrayS; RAS_MaterialBucket::Set m_materials; Mesh* m_mesh; @@ -242,10 +242,10 @@ public: const MT_Vector3& normal, bool flat, RAS_IPolyMaterial* mat, - int orgindex + int origindex ); - const vecVertexArray& GetVertexCache (RAS_IPolyMaterial* mat); + vecVertexArray& GetVertexCache (RAS_IPolyMaterial* mat); int GetVertexArrayLength(RAS_IPolyMaterial* mat); diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp index 39080b80492..c2687319717 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp @@ -161,9 +161,7 @@ void RAS_ListRasterizer::ReleaseAlloc() void RAS_ListRasterizer::IndexPrimitives( const vecVertexArray & vertexarrays, const vecIndexArrays & indexarrays, - int mode, - class RAS_IPolyMaterial* polymat, - class RAS_IRenderTools* rendertools, + DrawMode mode, bool useObjectColor, const MT_Vector4& rgbacolor, class KX_ListSlot** slot) @@ -185,15 +183,13 @@ void RAS_ListRasterizer::IndexPrimitives( if (mUseVertexArrays) { RAS_VAOpenGLRasterizer::IndexPrimitives( vertexarrays, indexarrays, - mode, polymat, - rendertools, useObjectColor, + mode, useObjectColor, rgbacolor,slot ); } else { RAS_OpenGLRasterizer::IndexPrimitives( vertexarrays, indexarrays, - mode, polymat, - rendertools, useObjectColor, + mode, useObjectColor, rgbacolor,slot ); } @@ -208,9 +204,7 @@ void RAS_ListRasterizer::IndexPrimitives( void RAS_ListRasterizer::IndexPrimitivesMulti( const vecVertexArray& vertexarrays, const vecIndexArrays & indexarrays, - int mode, - class RAS_IPolyMaterial* polymat, - class RAS_IRenderTools* rendertools, + DrawMode mode, bool useObjectColor, const MT_Vector4& rgbacolor, class KX_ListSlot** slot) @@ -230,18 +224,19 @@ void RAS_ListRasterizer::IndexPrimitivesMulti( } } - if (mUseVertexArrays) { + // workaround: note how we do not use vertex arrays for making display + // lists, since glVertexAttribPointerARB doesn't seem to work correct + // in display lists on ATI? either a bug in the driver or in Blender .. + if (mUseVertexArrays && !localSlot) { RAS_VAOpenGLRasterizer::IndexPrimitivesMulti( vertexarrays, indexarrays, - mode, polymat, - rendertools, useObjectColor, + mode, useObjectColor, rgbacolor,slot ); } else { RAS_OpenGLRasterizer::IndexPrimitivesMulti( vertexarrays, indexarrays, - mode, polymat, - rendertools, useObjectColor, + mode, useObjectColor, rgbacolor,slot ); } diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h index 4b3304d7396..b1b19144c12 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h @@ -52,9 +52,7 @@ public: virtual void IndexPrimitives( const vecVertexArray& vertexarrays, const vecIndexArrays & indexarrays, - int mode, - class RAS_IPolyMaterial* polymat, - class RAS_IRenderTools* rendertools, + DrawMode mode, bool useObjectColor, const MT_Vector4& rgbacolor, class KX_ListSlot** slot @@ -63,9 +61,7 @@ public: virtual void IndexPrimitivesMulti( const vecVertexArray& vertexarrays, const vecIndexArrays & indexarrays, - int mode, - class RAS_IPolyMaterial* polymat, - class RAS_IRenderTools* rendertools, + DrawMode mode, bool useObjectColor, const MT_Vector4& rgbacolor, class KX_ListSlot** slot diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp index 18147b53f4c..dcc36bf5a39 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp @@ -368,23 +368,11 @@ void RAS_OpenGLRasterizer::SetDrawingMode(int drawingmode) switch (m_drawingmode) { - case KX_BOUNDINGBOX: - { - } case KX_WIREFRAME: { glDisable (GL_CULL_FACE); break; } - case KX_TEXTURED: - { - } - case KX_SHADED: - { - } - case KX_SOLID: - { - } default: { } @@ -603,33 +591,14 @@ void RAS_OpenGLRasterizer::GetViewMatrix(MT_Matrix4x4 &mat) const void RAS_OpenGLRasterizer::IndexPrimitives(const vecVertexArray & vertexarrays, const vecIndexArrays & indexarrays, - int mode, - class RAS_IPolyMaterial* polymat, - class RAS_IRenderTools* rendertools, + DrawMode mode, bool useObjectColor, const MT_Vector4& rgbacolor, class KX_ListSlot** slot ) { - GLenum drawmode; - switch (mode) - { - case 0: - drawmode = GL_TRIANGLES; - break; - case 1: - drawmode = GL_LINES; - break; - case 2: - drawmode = GL_QUADS; - break; - default: - drawmode = GL_LINES; - break; - } - - const RAS_TexVert* vertexarray ; - unsigned int numindices,vt; + const RAS_TexVert* vertexarray; + unsigned int numindices, vt; for (vt=0;vtgetLocalXYZ()); - glTexCoordPointer(2,GL_FLOAT,vtxstride,vertexarray->getUV1()); - glColorPointer(4,GL_UNSIGNED_BYTE,vtxstride,vertexarray->getRGBA()); glNormalPointer(GL_FLOAT,vtxstride,vertexarray->getNormal()); + glTexCoordPointer(2,GL_FLOAT,vtxstride,vertexarray->getUV1()); + if(glIsEnabled(GL_COLOR_ARRAY)) + glColorPointer(4,GL_UNSIGNED_BYTE,vtxstride,vertexarray->getRGBA()); //if(m_Lock) // local->Begin(vertexarrays[vt]->size()); @@ -169,8 +166,6 @@ void RAS_VAOpenGLRasterizer::IndexPrimitives( const vecVertexArray& vertexarrays //if(m_Lock) // local->End(); - - } glDisableClientState(GL_TEXTURE_COORD_ARRAY); @@ -178,28 +173,21 @@ void RAS_VAOpenGLRasterizer::IndexPrimitives( const vecVertexArray& vertexarrays void RAS_VAOpenGLRasterizer::IndexPrimitivesMulti( const vecVertexArray& vertexarrays, const vecIndexArrays & indexarrays, - int mode, - class RAS_IPolyMaterial* polymat, - class RAS_IRenderTools* rendertools, + DrawMode mode, bool useObjectColor, const MT_Vector4& rgbacolor, class KX_ListSlot** slot) { static const GLsizei vtxstride = sizeof(RAS_TexVert); + GLenum drawmode; - switch (mode) - { - case 0: - drawmode = GL_TRIANGLES; - break; - case 2: - drawmode = GL_QUADS; - break; - case 1: //lines - default: - drawmode = GL_LINES; - break; - } + if(mode == KX_MODE_TRIANGLES) + drawmode = GL_TRIANGLES; + else if(mode == KX_MODE_QUADS) + drawmode = GL_QUADS; + else + drawmode = GL_LINES; + const RAS_TexVert* vertexarray; unsigned int numindices, vt; @@ -232,10 +220,10 @@ void RAS_VAOpenGLRasterizer::IndexPrimitivesMulti( const vecVertexArray& vertexa continue; glVertexPointer(3,GL_FLOAT,vtxstride,vertexarray->getLocalXYZ()); - TexCoordPtr(vertexarray); - - glColorPointer(4,GL_UNSIGNED_BYTE,vtxstride,vertexarray->getRGBA()); glNormalPointer(GL_FLOAT,vtxstride,vertexarray->getNormal()); + TexCoordPtr(vertexarray); + if(glIsEnabled(GL_COLOR_ARRAY)) + glColorPointer(4,GL_UNSIGNED_BYTE,vtxstride,vertexarray->getRGBA()); //if(m_Lock) // local->Begin(vertexarrays[vt]->size()); @@ -296,19 +284,22 @@ void RAS_VAOpenGLRasterizer::TexCoordPtr(const RAS_TexVert *tv) switch(m_attrib[unit]) { case RAS_TEXCO_ORCO: case RAS_TEXCO_GLOB: - glVertexAttribPointer(unit, 3, GL_FLOAT, GL_FALSE, sizeof(RAS_TexVert), tv->getLocalXYZ()); + glVertexAttribPointerARB(unit, 3, GL_FLOAT, GL_FALSE, sizeof(RAS_TexVert), tv->getLocalXYZ()); break; case RAS_TEXCO_UV1: - glVertexAttribPointer(unit, 2, GL_FLOAT, GL_FALSE, sizeof(RAS_TexVert), tv->getUV1()); + glVertexAttribPointerARB(unit, 2, GL_FLOAT, GL_FALSE, sizeof(RAS_TexVert), tv->getUV1()); break; case RAS_TEXCO_NORM: - glVertexAttribPointer(unit, 3, GL_FLOAT, GL_FALSE, sizeof(RAS_TexVert), tv->getNormal()); + glVertexAttribPointerARB(unit, 3, GL_FLOAT, GL_FALSE, sizeof(RAS_TexVert), tv->getNormal()); break; case RAS_TEXTANGENT: - glVertexAttribPointer(unit, 4, GL_FLOAT, GL_FALSE, sizeof(RAS_TexVert), tv->getTangent()); + glVertexAttribPointerARB(unit, 4, GL_FLOAT, GL_FALSE, sizeof(RAS_TexVert), tv->getTangent()); break; case RAS_TEXCO_UV2: - glVertexAttribPointer(unit, 2, GL_FLOAT, GL_FALSE, sizeof(RAS_TexVert), tv->getUV2()); + glVertexAttribPointerARB(unit, 2, GL_FLOAT, GL_FALSE, sizeof(RAS_TexVert), tv->getUV2()); + break; + case RAS_TEXCO_VCOL: + glVertexAttribPointerARB(unit, 4, GL_UNSIGNED_BYTE, GL_FALSE, sizeof(RAS_TexVert), tv->getRGBA()); break; default: break; @@ -386,11 +377,12 @@ void RAS_VAOpenGLRasterizer::EnableTextures(bool enable) case RAS_TEXCO_NORM: case RAS_TEXTANGENT: case RAS_TEXCO_UV2: - if(enable) glEnableVertexAttribArray(unit); - else glDisableVertexAttribArray(unit); + case RAS_TEXCO_VCOL: + if(enable) glEnableVertexAttribArrayARB(unit); + else glDisableVertexAttribArrayARB(unit); break; default: - glDisableVertexAttribArray(unit); + glDisableVertexAttribArrayARB(unit); break; } } diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h index ea08887028f..e4cc4ace0e8 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h @@ -52,9 +52,7 @@ public: virtual void IndexPrimitives( const vecVertexArray& vertexarrays, const vecIndexArrays & indexarrays, - int mode, - class RAS_IPolyMaterial* polymat, - class RAS_IRenderTools* rendertools, + DrawMode mode, bool useObjectColor, const MT_Vector4& rgbacolor, class KX_ListSlot** slot); @@ -62,9 +60,7 @@ public: virtual void IndexPrimitivesMulti( const vecVertexArray& vertexarrays, const vecIndexArrays & indexarrays, - int mode, - class RAS_IPolyMaterial* polymat, - class RAS_IRenderTools* rendertools, + DrawMode mode, bool useObjectColor, const MT_Vector4& rgbacolor, class KX_ListSlot** slot); diff --git a/source/gameengine/Rasterizer/RAS_TexVert.cpp b/source/gameengine/Rasterizer/RAS_TexVert.cpp index 61ac456b2bc..935633dc636 100644 --- a/source/gameengine/Rasterizer/RAS_TexVert.cpp +++ b/source/gameengine/Rasterizer/RAS_TexVert.cpp @@ -40,7 +40,8 @@ RAS_TexVert::RAS_TexVert(const MT_Point3& xyz, const MT_Vector4& tangent, const unsigned int rgba, const MT_Vector3& normal, - const short flag) + const short flag, + const unsigned int origindex) { xyz.getValue(m_localxyz); uv.getValue(m_uv1); @@ -49,6 +50,7 @@ RAS_TexVert::RAS_TexVert(const MT_Point3& xyz, SetNormal(normal); tangent.getValue(m_tangent); m_flag = flag; + m_origindex = origindex; m_unit = 2; } @@ -107,44 +109,6 @@ void RAS_TexVert::SetNormal(const MT_Vector3& normal) normal.getValue(m_normal); } -#ifndef RAS_TexVert_INLINE - -// leave multiline for debugging -const float* RAS_TexVert::getUV1 () const -{ - return m_uv1; -} - -const float* RAS_TexVert::getUV2 () const -{ - return m_uv2; -} - - - -const float* RAS_TexVert::getNormal() const -{ - return m_normal; -} - -const float* RAS_TexVert::getTangent() const -{ - return m_tangent; -} - - -const float* RAS_TexVert::getLocalXYZ() const -{ - return m_localxyz; -} - -const unsigned char* RAS_TexVert::getRGBA() const -{ - return (unsigned char*) &m_rgba; -} - -#endif - // compare two vertices, and return TRUE if both are almost identical (they can be shared) bool RAS_TexVert::closeTo(const RAS_TexVert* other) { diff --git a/source/gameengine/Rasterizer/RAS_TexVert.h b/source/gameengine/Rasterizer/RAS_TexVert.h index 84135db918f..bf092b4b230 100644 --- a/source/gameengine/Rasterizer/RAS_TexVert.h +++ b/source/gameengine/Rasterizer/RAS_TexVert.h @@ -42,8 +42,6 @@ static MT_Point2 g_pt2; #define TV_MAX 3//match Def in BL_Material.h -#define RAS_TexVert_INLINE 1 - class RAS_TexVert { @@ -55,9 +53,10 @@ class RAS_TexVert float m_normal[3]; // 3*2 = 6 short m_flag; // 2 unsigned int m_unit; // 4 + unsigned int m_origindex; // 4 //--------- - // 52 - //32 bytes total size, fits nice = 52 = not fit nice. + // 56 + // 32 bytes total size, fits nice = 56 = not fit nice. // We'll go for 64 bytes total size - 24 bytes left. public: short getFlag() const; @@ -71,11 +70,10 @@ public: const MT_Vector4& tangent, const unsigned int rgba, const MT_Vector3& normal, - const short flag); + const short flag, + const unsigned int origindex); ~RAS_TexVert() {}; - // leave multiline for debugging -#ifdef RAS_TexVert_INLINE const float* getUV1 () const { return m_uv1; }; @@ -99,13 +97,11 @@ public: const unsigned char* getRGBA() const { return (unsigned char *) &m_rgba; } -#else - const float* getUV1 () const; - const float* getUV2 () const; - const float* getNormal() const; - const float* getLocalXYZ() const; - const unsigned char* getRGBA() const; -#endif + + const unsigned int getOrigIndex() const { + return m_origindex; + } + void SetXYZ(const MT_Point3& xyz); void SetUV(const MT_Point2& uv); void SetUV2(const MT_Point2& uv); diff --git a/source/gameengine/Rasterizer/SConscript b/source/gameengine/Rasterizer/SConscript index f077833b850..e6bc657ed6d 100644 --- a/source/gameengine/Rasterizer/SConscript +++ b/source/gameengine/Rasterizer/SConscript @@ -7,7 +7,8 @@ if env['WITH_BF_GLEXT'] == 1: env['CPPFLAGS'].append('-DWITH_GLEXT') -incs = '. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/BlenderRoutines #extern/glew/include' +incs = '. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/BlenderRoutines #extern/glew/include #source/gameengine/Expressions' +incs += ' ' + env['BF_PYTHON_INC'] if env['OURPLATFORM']=='win32-vc': cflags = [] diff --git a/source/gameengine/SceneGraph/SG_Controller.h b/source/gameengine/SceneGraph/SG_Controller.h index d65a2f0c256..c32885b915f 100644 --- a/source/gameengine/SceneGraph/SG_Controller.h +++ b/source/gameengine/SceneGraph/SG_Controller.h @@ -101,7 +101,9 @@ public: enum SG_Controller_option { SG_CONTR_NODEF = 0, SG_CONTR_IPO_IPO_AS_FORCE, - SG_CONTR_IPO_FORCES_ACT_LOCAL, + SG_CONTR_IPO_IPO_ADD, + SG_CONTR_IPO_LOCAL, + SG_CONTR_IPO_RESET, SG_CONTR_CAMIPO_LENS, SG_CONTR_CAMIPO_CLIPEND, SG_CONTR_CAMIPO_CLIPSTART, diff --git a/source/kernel/gen_system/GEN_HashedPtr.h b/source/kernel/gen_system/GEN_HashedPtr.h index 777ec76e067..13faa5f227b 100644 --- a/source/kernel/gen_system/GEN_HashedPtr.h +++ b/source/kernel/gen_system/GEN_HashedPtr.h @@ -39,6 +39,7 @@ public: GEN_HashedPtr(void* val) : m_valptr(val) {}; unsigned int hash() const { return GEN_Hash(m_valptr);}; inline friend bool operator ==(const GEN_HashedPtr & rhs, const GEN_HashedPtr & lhs) { return rhs.m_valptr == lhs.m_valptr;}; + void *getValue() const { return m_valptr; } }; #endif //__GEN_HASHEDPTR diff --git a/source/kernel/gen_system/GEN_Map.h b/source/kernel/gen_system/GEN_Map.h index f9c14800499..37c75d8293a 100644 --- a/source/kernel/gen_system/GEN_Map.h +++ b/source/kernel/gen_system/GEN_Map.h @@ -82,6 +82,24 @@ public: } return 0; } + + Key* getKey(int index) { + int count=0; + for (int i=0;im_key; + } + bucket = bucket->m_next; + count++; + } + } + return 0; + } void clear() { for (int i = 0; i < m_num_buckets; ++i) { diff --git a/tools/Blender.py b/tools/Blender.py index 30e9979cf9a..2c982a0a46f 100644 --- a/tools/Blender.py +++ b/tools/Blender.py @@ -69,10 +69,10 @@ def internal_lib_to_dict(dict = None, libtype = None, libname = None, priority = dict[libtype][priority] = libname # libtype and priority can both be lists, for defining lib in multiple places -def add_lib_to_dict(dict = None, libtype = None, libname = None, priority = 100): +def add_lib_to_dict(env, dict = None, libtype = None, libname = None, priority = 100): if not dict or not libtype or not libname: print "Passed wrong arg" - Exit() + env.Exit() if type(libtype) is str and type(priority) is int: internal_lib_to_dict(dict, libtype, libname, priority) @@ -82,10 +82,10 @@ def add_lib_to_dict(dict = None, libtype = None, libname = None, priority = 100) internal_lib_to_dict(dict, lt, libname, p) else: print "libtype and priority lists are unequal in length" - Exit() + env.Exit() else: print "Wrong type combinations for libtype and priority. Only str and int or list and list" - Exit() + env.Exit() def create_blender_liblist(lenv = None, libtype = None): if not lenv or not libtype: @@ -93,11 +93,9 @@ def create_blender_liblist(lenv = None, libtype = None): lst = [] if libtype in possible_types: - sortlist = [] - for k,v in libs[libtype].iteritems(): - sortlist.append(k) - sortlist.sort() curlib = libs[libtype] + sortlist = curlib.keys() + sortlist.sort() for sk in sortlist: v = curlib[sk] lst.append('#' + root_build_dir + 'lib/'+lenv['LIBPREFIX'] + v + lenv['LIBSUFFIX']) @@ -175,11 +173,10 @@ def propose_priorities(): for t in possible_types: print bc.OKGREEN+"\t"+t+bc.ENDC new_priority = 0 - sortlist = [] - for k,v in libs[t].iteritems(): - sortlist.append(k) - sortlist.sort() curlib = libs[t] + sortlist = curlib.keys() + sortlist.sort() + for sk in sortlist: v = curlib[sk] #for p,v in sorted(libs[t].iteritems()): @@ -368,7 +365,7 @@ class BlenderEnvironment(SConsEnvironment): global libs if not self or not libname or not source: print bc.FAIL+'Cannot continue. Missing argument for BlenderRes '+libname+bc.ENDC - Exit() + self.Exit() if self['OURPLATFORM'] not in ('win32-vc','win32-mingw','linuxcross'): print bc.FAIL+'BlenderRes is for windows only!'+bc.END self.Exit() @@ -383,7 +380,7 @@ class BlenderEnvironment(SConsEnvironment): def BlenderLib(self=None, libname=None, sources=None, includes=[], defines=[], libtype='common', priority = 100, compileflags=None): if not self or not libname or not sources: print bc.FAIL+'Cannot continue. Missing argument for BuildBlenderLib '+libname+bc.ENDC - Exit() + self.Exit() if libname in quickie or len(quickie)==0: if libname in quickdebug: print bc.HEADER+'Configuring library '+bc.ENDC+bc.OKGREEN+libname +bc.ENDC+bc.OKBLUE+ " (debug mode)" + bc.ENDC @@ -419,7 +416,7 @@ class BlenderEnvironment(SConsEnvironment): else: print bc.WARNING+'Not building '+bc.ENDC+bc.OKGREEN+libname+bc.ENDC+' for '+bc.OKBLUE+'BF_QUICK'+bc.ENDC # note: libs is a global - add_lib_to_dict(libs, libtype, libname, priority) + add_lib_to_dict(self, libs, libtype, libname, priority) def BlenderProg(self=None, builddir=None, progname=None, sources=None, includes=None, libs=None, libpath=None, binarykind=''): print bc.HEADER+'Configuring program '+bc.ENDC+bc.OKGREEN+progname+bc.ENDC From 785123cc5ab2d9681817bee6ee6bd8c11ac476f0 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Mon, 14 Jul 2008 18:42:53 +0000 Subject: [PATCH 40/76] Improved build time on BLI_kdopbvh Its now faster than raytree (both on build and query) Things tryed: X=>Y=>Z=>X split (reduces build time.. but increases query time) bucket sorts (initial sorts for fast usage of bucket take a long time) (nth is linear.. so its quite fast already) Best times archieve with: *usage of 4-ary trees.. reduces build time and tree size but didnt decreased query time *quads are on the same node instead of splitting in 2 tris.. (this actually turned on speedup on query time.. since tree size is reduced by a factor of 2) *test ray-bb before ray-primitive gives better times on both tris and quads Notes: measures where made projecting a sphere from inside the head of suzanne. --- source/blender/blenkernel/intern/shrinkwrap.c | 114 +++++++++++++----- source/blender/blenlib/intern/BLI_kdopbvh.c | 15 ++- 2 files changed, 95 insertions(+), 34 deletions(-) diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 65e49e23c9d..cb49f762cac 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -149,13 +149,13 @@ static void bvhtree_meshcallbackdata_init(BVHMeshCallbackUserdata *data, Derived /* * Builds a bvh tree.. where nodes are the vertexs of the given mesh */ -static BVHTree* bvhtree_from_mesh_verts(DerivedMesh *mesh, float epsilon) +static BVHTree* bvhtree_from_mesh_verts(DerivedMesh *mesh, float epsilon, int tree_type, int axis) { int i; int numVerts= mesh->getNumVerts(mesh); MVert *vert = mesh->getVertDataArray(mesh, CD_MVERT); - BVHTree *tree = BLI_bvhtree_new(numVerts, 0, 2, 6); + BVHTree *tree = BLI_bvhtree_new(numVerts, epsilon, tree_type, axis); if(tree != NULL) { for(i = 0; i < numVerts; i++) @@ -170,7 +170,7 @@ static BVHTree* bvhtree_from_mesh_verts(DerivedMesh *mesh, float epsilon) /* * Builds a bvh tree.. where nodes are the faces of the given mesh. Quads are splitted in 2 triangles */ -static BVHTree* bvhtree_from_mesh_tri(DerivedMesh *mesh, float epsilon) +static BVHTree* bvhtree_from_mesh_tri(DerivedMesh *mesh, float epsilon, int tree_type, int axis) { int i; int numFaces= mesh->getNumFaces(mesh), totFaces; @@ -183,7 +183,7 @@ static BVHTree* bvhtree_from_mesh_tri(DerivedMesh *mesh, float epsilon) if(face[i].v4) totFaces++; /* Create a bvh-tree of the given target */ - tree = BLI_bvhtree_new(totFaces, epsilon, 2, 6); + tree = BLI_bvhtree_new(totFaces, epsilon, tree_type, axis); if(tree != NULL) { for(i = 0; i < numFaces; i++) @@ -209,6 +209,42 @@ static BVHTree* bvhtree_from_mesh_tri(DerivedMesh *mesh, float epsilon) return tree; } +/* + * Builds a bvh tree.. where nodes are the faces of the given mesh. + */ +static BVHTree* bvhtree_from_mesh_faces(DerivedMesh *mesh, float epsilon, int tree_type, int axis) +{ + int i; + int numFaces= mesh->getNumFaces(mesh); + MVert *vert = mesh->getVertDataArray(mesh, CD_MVERT); + MFace *face = mesh->getFaceDataArray(mesh, CD_MFACE); + BVHTree *tree= NULL; + + /* Count needed faces */ + + /* Create a bvh-tree of the given target */ + tree = BLI_bvhtree_new(numFaces, epsilon, tree_type, axis); + if(tree != NULL) + { + for(i = 0; i < numFaces; i++) + { + float co[4][3]; + + VECCOPY(co[0], vert[ face[i].v1 ].co); + VECCOPY(co[1], vert[ face[i].v2 ].co); + VECCOPY(co[2], vert[ face[i].v3 ].co); + if(face[i].v4) + VECCOPY(co[3], vert[ face[i].v4 ].co); + + BLI_bvhtree_insert(tree, i, co[0], face[i].v4 ? 4 : 3); + } + + BLI_bvhtree_balance(tree); + } + + return tree; +} + /* * Loads the coordinates of the requested tri */ @@ -248,7 +284,11 @@ static float mesh_tri_spherecast(void *userdata, int index, const BVHTreeRay *ra bvhtree_from_mesh_get_tri( (BVHMeshCallbackUserdata*)userdata, index, &t0, &t1, &t2); - dist = sphereray_tri_intersection(ray, ((BVHMeshCallbackUserdata*)userdata)->sphere_radius, hit->dist, t0, t1, t2); + if(((BVHMeshCallbackUserdata*)userdata)->sphere_radius == 0.0f) + dist = ray_tri_intersection(ray, hit->dist, t0, t1, t2); + else + dist = sphereray_tri_intersection(ray, ((BVHMeshCallbackUserdata*)userdata)->sphere_radius, hit->dist, t0, t1, t2); + if(dist >= 0 && dist < hit->dist) { hit->index = index; @@ -259,27 +299,45 @@ static float mesh_tri_spherecast(void *userdata, int index, const BVHTreeRay *ra } /* - * Callback to bvh tree raycast. The tree must bust have been built using bvhtree_from_mesh_tri. - * Rays are projected as a sphere with the radius configured on userdata. + * Callback to bvh tree raycast. The tree must bust have been built using bvhtree_from_mesh_faces. * userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree. */ -static float mesh_tri_raycast(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) +static float mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) { - float dist; - float *t0, *t1, *t2; + const BVHMeshCallbackUserdata *data = (BVHMeshCallbackUserdata*) userdata; + MVert *vert = data->vert; + MFace *face = data->face + index; + + float *t0, *t1, *t2, *t3; + t0 = vert[ face->v1 ].co; + t1 = vert[ face->v2 ].co; + t2 = vert[ face->v3 ].co; + t3 = face->v4 ? vert[ face->v4].co : NULL; - bvhtree_from_mesh_get_tri( (BVHMeshCallbackUserdata*)userdata, index, &t0, &t1, &t2); - dist = ray_tri_intersection(ray, hit->dist, t0, t1, t2); - if(dist >= 0 && dist < hit->dist) - { - hit->index = index; - hit->dist = dist; - VECADDFAC(hit->co, ray->origin, ray->direction, dist); - } - return dist; -} + do + { + float dist; + if(data->sphere_radius == 0.0f) + dist = ray_tri_intersection(ray, hit->dist, t0, t1, t2); + else + dist = sphereray_tri_intersection(ray, data->sphere_radius, hit->dist, t0, t1, t2); + if(dist >= 0 && dist < hit->dist) + { + hit->index = index; + hit->dist = dist; + VECADDFAC(hit->co, ray->origin, ray->direction, dist); + } + + t1 = t2; + t2 = t3; + t3 = NULL; + + } while(t2); + + return hit->dist; +} /* * Raytree from mesh @@ -1145,11 +1203,11 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri if(calc.smd->shrinkOpts & MOD_SHRINKWRAP_REMOVE_UNPROJECTED_FACES) calc.moved = bitset_new( calc.final->getNumVerts(calc.final), "shrinkwrap bitset data"); -/* - BENCH(shrinkwrap_calc_normal_projection_raytree(&calc)); - calc.final->release( calc.final ); -*/ + +// BENCH(shrinkwrap_calc_normal_projection_raytree(&calc)); +// calc.final->release( calc.final ); // calc.final = CDDM_copy(calc.original); + BENCH(shrinkwrap_calc_normal_projection(&calc)); // BENCH(shrinkwrap_calc_foreach_vertex(&calc, bruteforce_shrinkwrap_calc_normal_projection)); @@ -1204,7 +1262,7 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) BENCH_VAR(query); - BENCH(tree = bvhtree_from_mesh_verts(calc->target, 0.0)); + BENCH(tree = bvhtree_from_mesh_verts(calc->target, 0.0, 2, 6)); if(tree == NULL) return OUT_OF_MEMORY(); //Setup nearest @@ -1366,10 +1424,10 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) if( (use_normal & (MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL | MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL)) == 0) return; //Nothing todo - BENCH(tree = bvhtree_from_mesh_tri(calc->target, calc->keptDist)); + BENCH(tree = bvhtree_from_mesh_faces(calc->target, calc->keptDist, 4, 6)); if(tree == NULL) return OUT_OF_MEMORY(); bvhtree_meshcallbackdata_init(&userdata, calc->target, calc->keptDist); - callback = calc->keptDist > 0 ? mesh_tri_spherecast : mesh_tri_raycast; + callback = mesh_faces_spherecast; //Project each vertex along normal numVerts= calc->final->getNumVerts(calc->final); @@ -1473,7 +1531,7 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) //Create a bvh-tree of the given target - tree = bvhtree_from_mesh_tri(calc->target, 0.0); + tree = bvhtree_from_mesh_tri(calc->target, 0.0, 2, 6); if(tree == NULL) return OUT_OF_MEMORY(); bvhtree_meshcallbackdata_init(&userdata, calc->target, 0.0); diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index d84a9d09d4b..73bc3e6a9bc 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -520,6 +520,8 @@ static void bvh_div_nodes(BVHTree *tree, BVHNode *node, int start, int end, char // Determine which axis to split along laxis = get_largest_axis(node->bv); + //laxis = (lastaxis + 2) % tree->axis; // XYZ split + node->main_axis = laxis/2; // split nodes along longest axis @@ -543,7 +545,7 @@ static void bvh_div_nodes(BVHTree *tree, BVHNode *node, int start, int end, char if(tend != end) partition_nth_element(tree->nodes, start, end, tend, laxis); refit_kdop_hull(tree, tnode, start, tend); - bvh_div_nodes(tree, tnode, start, tend, laxis); + bvh_div_nodes(tree, tnode, start, tend, laxis); // not called on XYZ split } node->totnode++; } @@ -613,9 +615,10 @@ void BLI_bvhtree_balance(BVHTree *tree) tree->totbranch++; // refit root bvh node - refit_kdop_hull(tree, tree->nodes[tree->totleaf], 0, tree->totleaf); + refit_kdop_hull(tree, tree->nodes[tree->totleaf], 0, tree->totleaf); // not called on XYZ split // create + balance tree bvh_div_nodes(tree, tree->nodes[tree->totleaf], 0, tree->totleaf, 0); + //BLI_bvhtree_update_tree(tree); // XYZ split // verify_tree(tree); } @@ -1009,16 +1012,16 @@ static float ray_nearest_hit(BVHRayCastData *data, BVHNode *node) static void dfs_raycast(BVHRayCastData *data, BVHNode *node) { int i; - float dist; - - dist = ray_nearest_hit(data, node); + //ray-bv is really fast.. and simple tests revealed its worth to test it + //before calling the ray-primitive functions + float dist = ray_nearest_hit(data, node); if(dist >= data->hit.dist) return; if(node->totnode == 0) { if(data->callback) - dist = data->callback(data->userdata, node->index, &data->ray, &data->hit); + data->callback(data->userdata, node->index, &data->ray, &data->hit); else { data->hit.index = node->index; From afc30d1a33506d8c0fb08f6b2df7856071383430 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Tue, 15 Jul 2008 12:54:57 +0000 Subject: [PATCH 41/76] There was a problem with the last merge :S Somehow it didnt finished and didnt added some files under the svn control (found thanks to lguillaume that reported some files were missing) Last merge fixed and also merged modifications up to revision 15584. I checked the diff svn diff --new . --old https://svn.blender.org/svnroot/bf-blender/trunk/blender And everything seems to be right now --- CMakeLists.txt | 27 +- intern/bsp/intern/BSP_CSGMesh.cpp | 2 +- intern/container/CTR_TaggedIndex.h | 16 + intern/decimation/intern/LOD_ManMesh2.cpp | 6 +- intern/elbeem/intern/solver_init.cpp | 2 +- intern/ghost/intern/GHOST_SystemWin32.cpp | 8 + intern/ghost/intern/GHOST_WindowWin32.cpp | 8 + release/scripts/scripttemplate_ipo_gen.py | 92 ++++ source/blender/blenlib/BLI_mempool.h | 44 ++ source/blender/blenlib/intern/BLI_mempool.c | 140 +++++ .../imbuf/intern/openexr/openexr_api.cpp | 2 +- source/blender/render/intern/include/sunsky.h | 141 +++++ source/blender/render/intern/source/sunsky.c | 492 ++++++++++++++++++ source/blender/render/intern/source/zbuf.c | 24 +- source/blender/src/buttons_editing.c | 4 +- source/blender/src/buttons_scene.c | 80 +-- source/blender/src/transform_conversions.c | 2 +- .../BlenderRoutines/BL_KetsjiEmbedStart.cpp | 11 +- .../GameLogic/SCA_ActuatorEventManager.cpp | 76 +++ .../GameLogic/SCA_ActuatorEventManager.h | 52 ++ .../GameLogic/SCA_ActuatorSensor.cpp | 196 +++++++ .../gameengine/GameLogic/SCA_ActuatorSensor.h | 74 +++ .../GameLogic/SCA_PythonController.cpp | 14 +- .../GamePlayer/ghost/GPG_Application.cpp | 2 +- source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 5 +- source/gameengine/Ketsji/KX_PythonInit.cpp | 13 +- source/gameengine/Ketsji/KX_PythonInit.h | 1 - source/gameengine/Ketsji/KX_SoundActuator.cpp | 3 +- 28 files changed, 1457 insertions(+), 80 deletions(-) create mode 100644 release/scripts/scripttemplate_ipo_gen.py create mode 100644 source/blender/blenlib/BLI_mempool.h create mode 100644 source/blender/blenlib/intern/BLI_mempool.c create mode 100644 source/blender/render/intern/include/sunsky.h create mode 100644 source/blender/render/intern/source/sunsky.c create mode 100644 source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp create mode 100644 source/gameengine/GameLogic/SCA_ActuatorEventManager.h create mode 100644 source/gameengine/GameLogic/SCA_ActuatorSensor.cpp create mode 100644 source/gameengine/GameLogic/SCA_ActuatorSensor.h diff --git a/CMakeLists.txt b/CMakeLists.txt index b58fe945663..5a23e77d9f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -197,10 +197,17 @@ IF(UNIX) ENDIF(UNIX) IF(WIN32) - INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake) + INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake) + SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/windows) + # Setup 64bit and 64bit windows systems + IF(CMAKE_CL_64) + message("64 bit compiler detected.") + SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64) + ENDIF(CMAKE_CL_64) + SET(PYTHON ${LIBDIR}/python) SET(PYTHON_VERSION 2.5) SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}") @@ -214,12 +221,20 @@ IF(WIN32) SET(OPENAL_LIB openal_static) SET(OPENAL_LIBPATH ${OPENAL}/lib) - SET(PNG_LIB libpng_st) + IF(CMAKE_CL_64) + SET(PNG_LIB libpng) + ELSE(CMAKE_CL_64) + SET(PNG_LIB libpng_st) + ENDIF(CMAKE_CL_64) SET(JPEG_LIB libjpeg) SET(ZLIB ${LIBDIR}/zlib) SET(ZLIB_INC ${ZLIB}/include) - SET(ZLIB_LIB libz) + IF(CMAKE_CL_64) + SET(ZLIB_LIB zlib) + ELSE(CMAKE_CL_64) + SET(ZLIB_LIB libz) + ENDIF(CMAKE_CL_64) SET(ZLIB_LIBPATH ${ZLIB}/lib) SET(PTHREADS ${LIBDIR}/pthreads) @@ -302,7 +317,11 @@ IF(WIN32) SET(WINTAB_INC ${LIBDIR}/wintab/include) - SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib") + IF(CMAKE_CL_64) + SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib;MSVCRT.lib ") + ELSE(CMAKE_CL_64) + SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ") + ENDIF(CMAKE_CL_64) SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ") ENDIF(WIN32) diff --git a/intern/bsp/intern/BSP_CSGMesh.cpp b/intern/bsp/intern/BSP_CSGMesh.cpp index 553f39a4642..ca7795b3cf5 100644 --- a/intern/bsp/intern/BSP_CSGMesh.cpp +++ b/intern/bsp/intern/BSP_CSGMesh.cpp @@ -197,7 +197,7 @@ BuildEdges( for (int vert = 0; vert < vertex_num; ++vert) { - BSP_FaceInd fi(f_it - f_it_begin); + BSP_FaceInd fi(size_t (f_it - f_it_begin)); InsertEdge(prev_vi,face.m_verts[vert],fi,dummy); prev_vi = face.m_verts[vert]; } diff --git a/intern/container/CTR_TaggedIndex.h b/intern/container/CTR_TaggedIndex.h index 7a7bd85e890..68d2536c879 100644 --- a/intern/container/CTR_TaggedIndex.h +++ b/intern/container/CTR_TaggedIndex.h @@ -93,6 +93,16 @@ public: } +#if defined(_WIN64) + CTR_TaggedIndex( + const unsigned __int64 val + ) : + m_val ( ((unsigned __int64)val & index_mask) + | ( (empty_tag << tag_shift) + & (~index_mask) ) ) { + } +#endif + CTR_TaggedIndex( const CTR_TaggedIndex &my_index ): @@ -124,6 +134,12 @@ public: return (long int)(m_val & index_mask); } +#if defined(_WIN64) + operator unsigned __int64 () const { + return (unsigned __int64)(m_val & index_mask); + } +#endif + bool IsEmpty( ) const { diff --git a/intern/decimation/intern/LOD_ManMesh2.cpp b/intern/decimation/intern/LOD_ManMesh2.cpp index eeb497bb09e..2fe49b36583 100644 --- a/intern/decimation/intern/LOD_ManMesh2.cpp +++ b/intern/decimation/intern/LOD_ManMesh2.cpp @@ -477,7 +477,7 @@ DeleteVertex( return; } - LOD_VertexInd last = LOD_VertexInd(verts.end() - verts.begin() - 1); + LOD_VertexInd last = LOD_VertexInd(size_t(verts.end() - verts.begin() - 1)); if (!(last == v)) { @@ -533,7 +533,7 @@ DeleteEdge( return; } - LOD_EdgeInd last = LOD_EdgeInd(edges.end() - edges.begin() - 1); + LOD_EdgeInd last = LOD_EdgeInd(size_t(edges.end() - edges.begin() - 1)); if (!(last == e)) { vector e_verts; @@ -573,7 +573,7 @@ DeleteFace( return; } - LOD_FaceInd last = LOD_FaceInd(faces.end() - faces.begin() - 1); + LOD_FaceInd last = LOD_FaceInd(size_t (faces.end() - faces.begin() - 1)); if (!(last == f)) { diff --git a/intern/elbeem/intern/solver_init.cpp b/intern/elbeem/intern/solver_init.cpp index c953d2f47da..a873f3c6987 100644 --- a/intern/elbeem/intern/solver_init.cpp +++ b/intern/elbeem/intern/solver_init.cpp @@ -694,7 +694,7 @@ bool LbmFsgrSolver::initializeSolverMemory() double maxDefaultMemChunk = 2.*1024.*1024.*1024.; //std::cerr<<" memEstFine "<< memEstFine <<" maxWin:" < maxWinMemChunk) { + if(sizeof(void *)==4 && memEstFine>maxWinMemChunk) { memBlockAllocProblem = true; } #endif // WIN32 diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index 293f8fc1661..f5c7c08ebfe 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -42,6 +42,14 @@ #include "GHOST_SystemWin32.h" +// win64 doesn't define GWL_USERDATA +#ifdef WIN32 +#ifndef GWL_USERDATA +#define GWL_USERDATA GWLP_USERDATA +#define GWL_WNDPROC GWLP_WNDPROC +#endif +#endif + /* * According to the docs the mouse wheel message is supported from windows 98 * upwards. Leaving WINVER at default value, the WM_MOUSEWHEEL message and the diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp index 905b2f7ac63..fef58d071a4 100644 --- a/intern/ghost/intern/GHOST_WindowWin32.cpp +++ b/intern/ghost/intern/GHOST_WindowWin32.cpp @@ -48,6 +48,14 @@ #define M_PI 3.1415926536 #endif +// win64 doesn't define GWL_USERDATA +#ifdef WIN32 +#ifndef GWL_USERDATA +#define GWL_USERDATA GWLP_USERDATA +#define GWL_WNDPROC GWLP_WNDPROC +#endif +#endif + LPCSTR GHOST_WindowWin32::s_windowClassName = "GHOST_WindowClass"; const int GHOST_WindowWin32::s_maxTitleLength = 128; HGLRC GHOST_WindowWin32::s_firsthGLRc = NULL; diff --git a/release/scripts/scripttemplate_ipo_gen.py b/release/scripts/scripttemplate_ipo_gen.py new file mode 100644 index 00000000000..791eaed2c6b --- /dev/null +++ b/release/scripts/scripttemplate_ipo_gen.py @@ -0,0 +1,92 @@ +#!BPY +""" +Name: 'Camera/Object Example' +Blender: 245 +Group: 'ScriptTemplate' +Tooltip: 'Script template for setting the camera direction' +""" + +from Blender import Window +import bpy + +script_data = \ +'''#!BPY +""" +Name: 'My Ipo Script' +Blender: 245 +Group: 'Animation' +Tooltip: 'Put some useful info here' +""" + +# Add a licence here if you wish to re-distribute, we recommend the GPL + +from Blender import Ipo, Mathutils, Window +import bpy, BPyMessages + +def makeRandomIpo(object, firstFrame, numberOfFrames, frameStep): + # Create an new Ipo Curve of name myIpo and type Object + myIpo = bpy.data.ipos.new('myIpo', 'Object') + + # Create LocX, LocY, and LocZ Ipo curves in our new Curve Object + # and store them so we can access them later + myIpo_x = myIpo.addCurve('LocX') + myIpo_y = myIpo.addCurve('LocY') + myIpo_z = myIpo.addCurve('LocZ') + + # What value we want to scale our random value by + ipoScale = 4 + + # This Calculates the End Frame for use in an xrange() expression + endFrame = firstFrame + (numberOfFrames * frameStep) + frameStep + + for frame in xrange(firstFrame, endFrame, frameStep): + + # Use the Mathutils Rand() function to get random numbers + ipoValue_x = Mathutils.Rand(-1, 1) * ipoScale + ipoValue_y = Mathutils.Rand(-1, 1) * ipoScale + ipoValue_z = Mathutils.Rand(-1, 1) * ipoScale + + # Append to the Ipo curve at location frame, with the value ipoValue_x + # Note that we should pass the append function a tuple or a BezTriple + myIpo_x.append((frame, ipoValue_x)) + + # Similar to above + myIpo_y.append((frame, ipoValue_y)) + myIpo_z.append((frame, ipoValue_z)) + + # Link our new Ipo Curve to the passed object + object.setIpo(myIpo) + print object + + +def main(): + + # Get the active scene, since there can be multiple ones + sce = bpy.data.scenes.active + + # Get the active object + object = sce.objects.active + + # If there is no active object, pop up an error message + if not object: + BPyMessages.Error_NoActive() + + Window.WaitCursor(1) + + # Call our makeRandomIpo function + # Pass it our object, Tell it to keys from the start frame until the end frame, at a step of 10 frames + # between them + + makeRandomIpo(object, sce.render.sFrame, sce.render.eFrame, 10) + + Window.WaitCursor(0) + +if __name__ == '__main__': + main() + +''' + +new_text = bpy.data.texts.new('ipo_template.py') +new_text.write(script_data) +bpy.data.texts.active = new_text +Window.RedrawAll() diff --git a/source/blender/blenlib/BLI_mempool.h b/source/blender/blenlib/BLI_mempool.h new file mode 100644 index 00000000000..8b31459dd38 --- /dev/null +++ b/source/blender/blenlib/BLI_mempool.h @@ -0,0 +1,44 @@ +/** + * Simple fast memory allocator + * + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2008 Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Geoffrey Bantle. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef BLI_MEMPOOL_H +#define BLI_MEMPOOL_H + +struct BLI_mempool; +typedef struct BLI_mempool BLI_mempool; + +BLI_mempool *BLI_mempool_create(int esize, int tote, int pchunk); +void *BLI_mempool_alloc(BLI_mempool *pool); +void *BLI_mempool_calloc(BLI_mempool *pool); +void BLI_mempool_free(BLI_mempool *pool, void *addr); +void BLI_mempool_destroy(BLI_mempool *pool); + + +#endif diff --git a/source/blender/blenlib/intern/BLI_mempool.c b/source/blender/blenlib/intern/BLI_mempool.c new file mode 100644 index 00000000000..7ac7b8b1791 --- /dev/null +++ b/source/blender/blenlib/intern/BLI_mempool.c @@ -0,0 +1,140 @@ +/** + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2008 by Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/* + Simple, fast memory allocator for allocating many elements of the same size. +*/ + +#include "MEM_guardedalloc.h" +#include "BLI_blenlib.h" +#include "DNA_listBase.h" +#include "BLI_linklist.h" +#include + +typedef struct BLI_freenode{ + struct BLI_freenode *next; +}BLI_freenode; + +typedef struct BLI_mempool_chunk{ + struct BLI_mempool_chunk *next, *prev; + void *data; +}BLI_mempool_chunk; + +typedef struct BLI_mempool{ + struct ListBase chunks; + int esize, csize, pchunk; /*size of elements and chunks in bytes and number of elements per chunk*/ + struct BLI_freenode *free; /*free element list. Interleaved into chunk datas.*/ +}BLI_mempool; + +BLI_mempool *BLI_mempool_create(int esize, int tote, int pchunk) +{ BLI_mempool *pool = NULL; + BLI_freenode *lasttail = NULL, *curnode = NULL; + int i,j, maxchunks; + char *addr; + + /*allocate the pool structure*/ + pool = MEM_mallocN(sizeof(BLI_mempool),"memory pool"); + pool->esize = esize; + pool->pchunk = pchunk; + pool->csize = esize * pchunk; + pool->chunks.first = pool->chunks.last = NULL; + + maxchunks = tote / pchunk; + + /*allocate the actual chunks*/ + for(i=0; i < maxchunks; i++){ + BLI_mempool_chunk *mpchunk = MEM_mallocN(sizeof(BLI_mempool_chunk), "BLI_Mempool Chunk"); + mpchunk->next = mpchunk->prev = NULL; + mpchunk->data = MEM_mallocN(pool->csize, "BLI Mempool Chunk Data"); + BLI_addtail(&(pool->chunks), mpchunk); + + if(i==0) pool->free = mpchunk->data; /*start of the list*/ + /*loop through the allocated data, building the pointer structures*/ + for(addr = mpchunk->data, j=0; j < pool->pchunk; j++){ + curnode = ((BLI_freenode*)addr); + addr += pool->esize; + curnode->next = (BLI_freenode*)addr; + } + /*final pointer in the previously allocated chunk is wrong.*/ + if(lasttail) lasttail->next = mpchunk->data; + /*set the end of this chunks memoryy to the new tail for next iteration*/ + lasttail = curnode; + } + /*terminate the list*/ + curnode->next = NULL; + return pool; +} +void *BLI_mempool_alloc(BLI_mempool *pool){ + void *retval=NULL; + BLI_freenode *curnode=NULL; + char *addr=NULL; + int j; + + if(!(pool->free)){ + /*need to allocate a new chunk*/ + BLI_mempool_chunk *mpchunk = MEM_mallocN(sizeof(BLI_mempool_chunk), "BLI_Mempool Chunk"); + mpchunk->next = mpchunk->prev = NULL; + mpchunk->data = MEM_mallocN(pool->csize, "BLI_Mempool Chunk Data"); + BLI_addtail(&(pool->chunks), mpchunk); + + pool->free = mpchunk->data; /*start of the list*/ + for(addr = mpchunk->data, j=0; j < pool->pchunk; j++){ + curnode = ((BLI_freenode*)addr); + addr += pool->esize; + curnode->next = (BLI_freenode*)addr; + } + curnode->next = NULL; /*terminate the list*/ + } + + retval = pool->free; + pool->free = pool->free->next; + //memset(retval, 0, pool->esize); + return retval; +} + +void *BLI_mempool_calloc(BLI_mempool *pool){ + void *retval=NULL; + retval = BLI_mempool_alloc(pool); + memset(retval, 0, pool->esize); + return retval; +} + + + +void BLI_mempool_free(BLI_mempool *pool, void *addr){ //doesnt protect against double frees, dont be stupid! + BLI_freenode *newhead = addr; + newhead->next = pool->free; + pool->free = newhead; +} +void BLI_mempool_destroy(BLI_mempool *pool) +{ + BLI_mempool_chunk *mpchunk=NULL; + for(mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) MEM_freeN(mpchunk->data); + BLI_freelistN(&(pool->chunks)); + MEM_freeN(pool); +} diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index fe352610a40..3e618a483e3 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -451,7 +451,7 @@ void IMB_exr_begin_write(void *handle, char *filename, int width, int height, in openexr_header_compression(&header, compress); /* header.lineOrder() = DECREASING_Y; this crashes in windows for file read! */ - header.insert ("BlenderMultiChannel", StringAttribute ("Blender V2.43")); + header.insert ("BlenderMultiChannel", StringAttribute ("Blender V2.43 and newer")); data->ofile = new OutputFile(filename, header); } diff --git a/source/blender/render/intern/include/sunsky.h b/source/blender/render/intern/include/sunsky.h new file mode 100644 index 00000000000..c61a637269a --- /dev/null +++ b/source/blender/render/intern/include/sunsky.h @@ -0,0 +1,141 @@ + /** + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * Contributor(s): zaghaghi + * + * ***** END GPL LICENSE BLOCK ***** + */ +/** + * This feature comes from Preetham paper on "A Practical Analytic Model for Daylight" + * and example code from Brian Smits, another author of that paper in + * http://www.cs.utah.edu/vissim/papers/sunsky/code/ + * */ +#ifndef SUNSKY_H_ +#define SUNSKY_H_ + +#define SPECTRUM_MAX_COMPONENTS 100 +#define SPECTRUM_START 350.0 +#define SPECTRUM_END 800.0 + +typedef struct SunSky +{ + short effect_type; + float turbidity; + float theta, phi; + + float toSun[3]; + + /*float sunSpectralRaddata[SPECTRUM_MAX_COMPONENTS];*/ + float sunSolidAngle; + + float zenith_Y, zenith_x, zenith_y; + + float perez_Y[5], perez_x[5], perez_y[5]; + + /* suggested by glome in + * http://projects.blender.org/tracker/?func=detail&atid=127&aid=8063&group_id=9*/ + float horizon_brightness; + float spread; + float sun_brightness; + float sun_size; + float backscattered_light; + + float atm_HGg; + + float atm_SunIntensity; + float atm_InscatteringMultiplier; + float atm_ExtinctionMultiplier; + float atm_BetaRayMultiplier; + float atm_BetaMieMultiplier; + float atm_DistanceMultiplier; + + float atm_BetaRay[3]; + float atm_BetaDashRay[3]; + float atm_BetaMie[3]; + float atm_BetaDashMie[3]; + float atm_BetaRM[3]; +}SunSky; + +/** + * InitSunSky: + * this function compute some sun,sky parameters according to input parameters and also initiate some other sun, sky parameters + * parameters: + * sunSky, is a structure that contains informtion about sun, sky and atmosphere, in this function, most of its values initiated + * turb, is atmosphere turbidity + * toSun, contains sun direction + * horizon_brighness, controls the brightness of the horizon colors + * spread, controls colors spreed at horizon + * sun_brightness, controls sun's brightness + * sun_size, controls sun's size + * back_scatter, controls back scatter light + * */ +void InitSunSky(struct SunSky *sunsky, float turb, float *toSun, float horizon_brightness, + float spread,float sun_brightness, float sun_size, float back_scatter); + +/** + * GetSkyXYZRadiance: + * this function compute sky radiance according to a view parameters `theta' and `phi'and sunSky values + * parameters: + * sunSky, sontains sun and sky parameters + * theta, is sun's theta + * phi, is sun's phi + * color_out, is computed color that shows sky radiance in XYZ color format + * */ +void GetSkyXYZRadiance(struct SunSky* sunsky, float theta, float phi, float color_out[3]); + +/** + * GetSkyXYZRadiancef: + * this function compute sky radiance according to a view direction `varg' and sunSky values + * parameters: + * sunSky, sontains sun and sky parameters + * varg, shows direction + * color_out, is computed color that shows sky radiance in XYZ color format + * */ +void GetSkyXYZRadiancef(struct SunSky* sunsky, const float varg[3], float color_out[3]); + +/** + * InitAtmosphere: + * this function intiate sunSky structure with user input parameters. + * parameters: + * sunSky, contains information about sun, and in this function some atmosphere parameters will initiated + * sun_intens, shows sun intensity value + * mief, Mie scattering factor this factor currently call with 1.0 + * rayf, Rayleigh scattering factor, this factor currently call with 1.0 + * inscattf, inscatter light factor that range from 0.0 to 1.0, 0.0 means no inscatter light and 1.0 means full inscatter light + * extincf, extinction light factor that range from 0.0 to 1.0, 0.0 means no extinction and 1.0 means full extinction + * disf, is distance factor, multiplyed to pixle's z value to compute each pixle's distance to camera, + * */ +void InitAtmosphere(struct SunSky *sunSky, float sun_intens, float mief, float rayf, float inscattf, float extincf, float disf); + +/** + * AtmospherePixleShader: + * this function apply atmosphere effect on a pixle color `rgb' at distance `s' + * parameters: + * sunSky, contains information about sun parameters and user values + * view, is camera view vector + * s, is distance + * rgb, contains rendered color value for a pixle + * */ +void AtmospherePixleShader( struct SunSky* sunSky, float view[3], float s, float rgb[3]); + +/** + * ClipColor: + * clip a color to range [0,1]; + * */ +void ClipColor(float c[3]); + +#endif /*SUNSKY_H_*/ diff --git a/source/blender/render/intern/source/sunsky.c b/source/blender/render/intern/source/sunsky.c new file mode 100644 index 00000000000..191867765a3 --- /dev/null +++ b/source/blender/render/intern/source/sunsky.c @@ -0,0 +1,492 @@ + /** + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * ***** END GPL LICENSE BLOCK ***** + */ + + +#include "sunsky.h" +#include "math.h" +#include "BLI_arithb.h" + + +/** + * These macros are defined for vector operations + * */ + +/** + * compute v1 = v2 op v3 + * v1, v2 and v3 are vectors contains 3 float + * */ +#define vec3opv(v1, v2, op, v3) \ + v1[0] = (v2[0] op v3[0]); \ + v1[1] = (v2[1] op v3[1]);\ + v1[2] = (v2[2] op v3[2]); + +/** + * compute v1 = v2 op f1 + * v1, v2 are vectors contains 3 float + * and f1 is a float + * */ +#define vec3opf(v1, v2, op, f1)\ + v1[0] = (v2[0] op (f1));\ + v1[1] = (v2[1] op (f1));\ + v1[2] = (v2[2] op (f1)); + +/** + * compute v1 = f1 op v2 + * v1, v2 are vectors contains 3 float + * and f1 is a float + * */ +#define fopvec3(v1, f1, op, v2)\ + v1[0] = ((f1) op v2[0]);\ + v1[1] = ((f1) op v2[1]);\ + v1[2] = ((f1) op v2[2]); + +/** + * ClipColor: + * clip a color to range [0,1]; + * */ +void ClipColor(float c[3]) +{ + if (c[0] > 1.0) c[0] = 1.0; + if (c[0] < 0.0) c[0] = 0.0; + if (c[1] > 1.0) c[1] = 1.0; + if (c[1] < 0.0) c[1] = 0.0; + if (c[2] > 1.0) c[2] = 1.0; + if (c[2] < 0.0) c[2] = 0.0; +} + +/** + * AngleBetween: + * compute angle between to direction + * all angles are in radians + * */ +static float AngleBetween(float thetav, float phiv, float theta, float phi) +{ + float cospsi = sin(thetav) * sin(theta) * cos(phi - phiv) + cos(thetav) * cos(theta); + + if (cospsi > 1.0) + return 0; + if (cospsi < -1.0) + return M_PI; + + return acos(cospsi); +} + +/** + * DirectionToThetaPhi: + * this function convert a direction to it's theta and phi value + * parameters: + * toSun: contains direction information + * theta, phi, are return values from this conversion + * */ +static void DirectionToThetaPhi(float *toSun, float *theta, float *phi) +{ + *theta = acos(toSun[2]); + if (fabs(*theta) < 1e-5) + *phi = 0; + else + *phi = atan2(toSun[1], toSun[0]); +} + +/** + * PerezFunction: + * compute perez function value based on input paramters + * */ +float PerezFunction(struct SunSky *sunsky, const float *lam, float theta, float gamma, float lvz) +{ + float den, num; + + den = ((1 + lam[0] * exp(lam[1])) * + (1 + lam[2] * exp(lam[3] * sunsky->theta) + lam[4] * cos(sunsky->theta) * cos(sunsky->theta))); + + num = ((1 + lam[0] * exp(lam[1] / cos(theta))) * + (1 + lam[2] * exp(lam[3] * gamma) + lam[4] * cos(gamma) * cos(gamma))); + + return(lvz * num / den); +} + +/** + * InitSunSky: + * this function compute some sun,sky parameters according to input parameters and also initiate some other sun, sky parameters + * parameters: + * sunSky, is a structure that contains informtion about sun, sky and atmosphere, in this function, most of its values initiated + * turb, is atmosphere turbidity + * toSun, contains sun direction + * horizon_brighness, controls the brightness of the horizon colors + * spread, controls colors spreed at horizon + * sun_brightness, controls sun's brightness + * sun_size, controls sun's size + * back_scatter, controls back scatter light + * */ +void InitSunSky(struct SunSky *sunsky, float turb, float *toSun, float horizon_brightness, + float spread,float sun_brightness, float sun_size, float back_scatter) +{ + + float theta2; + float theta3; + float T; + float T2; + float chi; + + sunsky->turbidity = turb; + + sunsky->horizon_brightness = horizon_brightness; + sunsky->spread = spread; + sunsky->sun_brightness = sun_brightness; + sunsky->sun_size = sun_size; + sunsky->backscattered_light = back_scatter; + + sunsky->toSun[0] = toSun[0]; + sunsky->toSun[1] = toSun[1]; + sunsky->toSun[2] = toSun[2]; + + DirectionToThetaPhi(sunsky->toSun, &sunsky->theta, &sunsky->phi); + + sunsky->sunSolidAngle = 0.25 * M_PI * 1.39 * 1.39 / (150 * 150); // = 6.7443e-05 + + theta2 = sunsky->theta*sunsky->theta; + theta3 = theta2 * sunsky->theta; + T = turb; + T2 = turb*turb; + + chi = (4.0 / 9.0 - T / 120.0) * (M_PI - 2 * sunsky->theta); + sunsky->zenith_Y = (4.0453 * T - 4.9710) * tan(chi) - .2155 * T + 2.4192; + sunsky->zenith_Y *= 1000; // conversion from kcd/m^2 to cd/m^2 + + if (sunsky->zenith_Y<=0) + sunsky->zenith_Y = 1e-6; + + sunsky->zenith_x = + ( + 0.00165 * theta3 - 0.00374 * theta2 + 0.00208 * sunsky->theta + 0) * T2 + + ( -0.02902 * theta3 + 0.06377 * theta2 - 0.03202 * sunsky->theta + 0.00394) * T + + ( + 0.11693 * theta3 - 0.21196 * theta2 + 0.06052 * sunsky->theta + 0.25885); + + sunsky->zenith_y = + ( + 0.00275 * theta3 - 0.00610 * theta2 + 0.00316 * sunsky->theta + 0) * T2 + + ( -0.04214 * theta3 + 0.08970 * theta2 - 0.04153 * sunsky->theta + 0.00515) * T + + ( + 0.15346 * theta3 - 0.26756 * theta2 + 0.06669 * sunsky->theta + 0.26688); + + + sunsky->perez_Y[0] = 0.17872 * T - 1.46303; + sunsky->perez_Y[1] = -0.35540 * T + 0.42749; + sunsky->perez_Y[2] = -0.02266 * T + 5.32505; + sunsky->perez_Y[3] = 0.12064 * T - 2.57705; + sunsky->perez_Y[4] = -0.06696 * T + 0.37027; + + sunsky->perez_x[0] = -0.01925 * T - 0.25922; + sunsky->perez_x[1] = -0.06651 * T + 0.00081; + sunsky->perez_x[2] = -0.00041 * T + 0.21247; + sunsky->perez_x[3] = -0.06409 * T - 0.89887; + sunsky->perez_x[4] = -0.00325 * T + 0.04517; + + sunsky->perez_y[0] = -0.01669 * T - 0.26078; + sunsky->perez_y[1] = -0.09495 * T + 0.00921; + sunsky->perez_y[2] = -0.00792 * T + 0.21023; + sunsky->perez_y[3] = -0.04405 * T - 1.65369; + sunsky->perez_y[4] = -0.01092 * T + 0.05291; + + /* suggested by glome in + * http://projects.blender.org/tracker/?func=detail&atid=127&aid=8063&group_id=9*/ + sunsky->perez_Y[0] *= sunsky->horizon_brightness; + sunsky->perez_x[0] *= sunsky->horizon_brightness; + sunsky->perez_y[0] *= sunsky->horizon_brightness; + + sunsky->perez_Y[1] *= sunsky->spread; + sunsky->perez_x[1] *= sunsky->spread; + sunsky->perez_y[1] *= sunsky->spread; + + sunsky->perez_Y[2] *= sunsky->sun_brightness; + sunsky->perez_x[2] *= sunsky->sun_brightness; + sunsky->perez_y[2] *= sunsky->sun_brightness; + + sunsky->perez_Y[3] *= sunsky->sun_size; + sunsky->perez_x[3] *= sunsky->sun_size; + sunsky->perez_y[3] *= sunsky->sun_size; + + sunsky->perez_Y[4] *= sunsky->backscattered_light; + sunsky->perez_x[4] *= sunsky->backscattered_light; + sunsky->perez_y[4] *= sunsky->backscattered_light; +} + +/** + * GetSkyXYZRadiance: + * this function compute sky radiance according to a view parameters `theta' and `phi'and sunSky values + * parameters: + * sunSky, sontains sun and sky parameters + * theta, is sun's theta + * phi, is sun's phi + * color_out, is computed color that shows sky radiance in XYZ color format + * */ +void GetSkyXYZRadiance(struct SunSky* sunsky, float theta, float phi, float color_out[3]) +{ + float gamma; + float x,y,Y,X,Z; + float hfade=1, nfade=1; + + + if (theta>(0.5*M_PI)) { + hfade = 1.0-(theta*M_1_PI-0.5)*2.0; + hfade = hfade*hfade*(3.0-2.0*hfade); + theta = 0.5*M_PI; + } + + if (sunsky->theta>(0.5*M_PI)) { + if (theta<=0.5*M_PI) { + nfade = 1.0-(0.5-theta*M_1_PI)*2.0; + nfade *= 1.0-(sunsky->theta*M_1_PI-0.5)*2.0; + nfade = nfade*nfade*(3.0-2.0*nfade); + } + } + + gamma = AngleBetween(theta, phi, sunsky->theta, sunsky->phi); + + // Compute xyY values + x = PerezFunction(sunsky, sunsky->perez_x, theta, gamma, sunsky->zenith_x); + y = PerezFunction(sunsky, sunsky->perez_y, theta, gamma, sunsky->zenith_y); + Y = nfade * hfade * PerezFunction(sunsky, sunsky->perez_Y, theta, gamma, sunsky->zenith_Y); + + X = (x / y) * Y; + Z = ((1 - x - y) / y) * Y; + + color_out[0] = X; + color_out[1] = Y; + color_out[2] = Z; +} + +/** + * GetSkyXYZRadiancef: + * this function compute sky radiance according to a view direction `varg' and sunSky values + * parameters: + * sunSky, sontains sun and sky parameters + * varg, shows direction + * color_out, is computed color that shows sky radiance in XYZ color format + * */ +void GetSkyXYZRadiancef(struct SunSky* sunsky, const float varg[3], float color_out[3]) +{ + float theta, phi; + float v[3]; + + VecCopyf(v, (float*)varg); + Normalize(v); + + if (v[2] < 0.001){ + v[2] = 0.001; + Normalize(v); + } + + DirectionToThetaPhi(v, &theta, &phi); + GetSkyXYZRadiance(sunsky, theta, phi, color_out); +} + +/** + * ComputeAttenuatedSunlight: + * this function compute attenuated sun light based on sun's theta and atmosphere turbidity + * parameters: + * theta, is sun's theta + * turbidity: is atmosphere turbidity + * fTau: contains computed attenuated sun light + * */ +void ComputeAttenuatedSunlight(float theta, int turbidity, float fTau[3]) +{ + float fBeta ; + float fTauR, fTauA; + float m ; + float fAlpha; + + int i; + float fLambda[3]; + fLambda[0] = 0.65f; + fLambda[1] = 0.57f; + fLambda[2] = 0.475f; + + fAlpha = 1.3f; + fBeta = 0.04608365822050f * turbidity - 0.04586025928522f; + + m = 1.0/(cos(theta) + 0.15f*pow(93.885f-theta/M_PI*180.0f,-1.253f)); + + for(i = 0; i < 3; i++) + { + // Rayleigh Scattering + fTauR = exp( -m * 0.008735f * pow(fLambda[i], (float)(-4.08f))); + + // Aerosal (water + dust) attenuation + fTauA = exp(-m * fBeta * pow(fLambda[i], -fAlpha)); + + fTau[i] = fTauR * fTauA; + } +} + +/** + * InitAtmosphere: + * this function intiate sunSky structure with user input parameters. + * parameters: + * sunSky, contains information about sun, and in this function some atmosphere parameters will initiated + * sun_intens, shows sun intensity value + * mief, Mie scattering factor this factor currently call with 1.0 + * rayf, Rayleigh scattering factor, this factor currently call with 1.0 + * inscattf, inscatter light factor that range from 0.0 to 1.0, 0.0 means no inscatter light and 1.0 means full inscatter light + * extincf, extinction light factor that range from 0.0 to 1.0, 0.0 means no extinction and 1.0 means full extinction + * disf, is distance factor, multiplyed to pixle's z value to compute each pixle's distance to camera, + * */ +void InitAtmosphere(struct SunSky *sunSky, float sun_intens, float mief, float rayf, + float inscattf, float extincf, float disf) +{ + const float pi = 3.14159265358f; + const float n = 1.003f; // refractive index + const float N = 2.545e25; + const float pn = 0.035f; + const float T = 2.0f; + float fTemp, fTemp2, fTemp3, fBeta, fBetaDash; + float c = (6.544*T - 6.51)*1e-17; + float K[3] = {0.685f, 0.679f, 0.670f}; + float vBetaMieTemp[3]; + + float fLambda[3],fLambda2[3], fLambda4[3]; + float vLambda2[3]; + float vLambda4[3]; + + int i; + + sunSky->atm_SunIntensity = sun_intens; + sunSky->atm_BetaMieMultiplier = mief; + sunSky->atm_BetaRayMultiplier = rayf; + sunSky->atm_InscatteringMultiplier = inscattf; + sunSky->atm_ExtinctionMultiplier = extincf; + sunSky->atm_DistanceMultiplier = disf; + + sunSky->atm_HGg=0.8; + + fLambda[0] = 1/650e-9f; + fLambda[1] = 1/570e-9f; + fLambda[2] = 1/475e-9f; + for (i=0; i < 3; i++) + { + fLambda2[i] = fLambda[i]*fLambda[i]; + fLambda4[i] = fLambda2[i]*fLambda2[i]; + } + + vLambda2[0] = fLambda2[0]; + vLambda2[1] = fLambda2[1]; + vLambda2[2] = fLambda2[2]; + + vLambda4[0] = fLambda4[0]; + vLambda4[1] = fLambda4[1]; + vLambda4[2] = fLambda4[2]; + + // Rayleigh scattering constants. + fTemp = pi*pi*(n*n-1)*(n*n-1)*(6+3*pn)/(6-7*pn)/N; + fBeta = 8*fTemp*pi/3; + + vec3opf(sunSky->atm_BetaRay, vLambda4, *, fBeta); + fBetaDash = fTemp/2; + vec3opf(sunSky->atm_BetaDashRay, vLambda4,*, fBetaDash); + + + // Mie scattering constants. + fTemp2 = 0.434*c*(2*pi)*(2*pi)*0.5f; + vec3opf(sunSky->atm_BetaDashMie, vLambda2, *, fTemp2); + + fTemp3 = 0.434f*c*pi*(2*pi)*(2*pi); + + vec3opv(vBetaMieTemp, K, *, fLambda); + vec3opf(sunSky->atm_BetaMie, vBetaMieTemp,*, fTemp3); + +} + +/** + * AtmospherePixleShader: + * this function apply atmosphere effect on a pixle color `rgb' at distance `s' + * parameters: + * sunSky, contains information about sun parameters and user values + * view, is camera view vector + * s, is distance + * rgb, contains rendered color value for a pixle + * */ +void AtmospherePixleShader( struct SunSky* sunSky, float view[3], float s, float rgb[3]) +{ + float costheta; + float Phase_1; + float Phase_2; + float sunColor[3]; + + float E[3]; + float E1[3]; + + + float I[3]; + float fTemp; + float vTemp1[3], vTemp2[3]; + + float sunDirection[3]; + + s *= sunSky->atm_DistanceMultiplier; + + sunDirection[0] = sunSky->toSun[0]; + sunDirection[1] = sunSky->toSun[1]; + sunDirection[2] = sunSky->toSun[2]; + + costheta = Inpf(view, sunDirection); // cos(theta) + Phase_1 = 1 + (costheta * costheta); // Phase_1 + + vec3opf(sunSky->atm_BetaRay, sunSky->atm_BetaRay, *, sunSky->atm_BetaRayMultiplier); + vec3opf(sunSky->atm_BetaMie, sunSky->atm_BetaMie, *, sunSky->atm_BetaMieMultiplier); + vec3opv(sunSky->atm_BetaRM, sunSky->atm_BetaRay, +, sunSky->atm_BetaMie); + + //e^(-(beta_1 + beta_2) * s) = E1 + vec3opf(E1, sunSky->atm_BetaRM, *, -s/log(2)); + E1[0] = exp(E1[0]); + E1[1] = exp(E1[1]); + E1[2] = exp(E1[2]); + + VecCopyf(E, E1); + + //Phase2(theta) = (1-g^2)/(1+g-2g*cos(theta))^(3/2) + fTemp = 1 + sunSky->atm_HGg - 2 * sunSky->atm_HGg * costheta; + fTemp = fTemp * sqrt(fTemp); + Phase_2 = (1 - sunSky->atm_HGg * sunSky->atm_HGg)/fTemp; + + vec3opf(vTemp1, sunSky->atm_BetaDashRay, *, Phase_1); + vec3opf(vTemp2, sunSky->atm_BetaDashMie, *, Phase_2); + + vec3opv(vTemp1, vTemp1, +, vTemp2); + fopvec3(vTemp2, 1.0, -, E1); + vec3opv(vTemp1, vTemp1, *, vTemp2); + + fopvec3(vTemp2, 1.0, / , sunSky->atm_BetaRM); + + vec3opv(I, vTemp1, *, vTemp2); + + vec3opf(I, I, *, sunSky->atm_InscatteringMultiplier); + vec3opf(E, E, *, sunSky->atm_ExtinctionMultiplier); + + //scale to color sun + ComputeAttenuatedSunlight(sunSky->theta, sunSky->turbidity, sunColor); + vec3opv(E, E, *, sunColor); + + vec3opf(I, I, *, sunSky->atm_SunIntensity); + + vec3opv(rgb, rgb, *, E); + vec3opv(rgb, rgb, +, I); +} + +#undef vec3opv +#undef vec3opf +#undef fopvec3 + +/* EOF */ diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index 579905315bb..c91c9e2f799 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -3545,7 +3545,7 @@ void merge_transp_passes(RenderLayer *rl, ShadeResult *shr) for(rpass= rl->passes.first; rpass; rpass= rpass->next) { float *col= NULL; - int pixsize= 0; + int pixsize= 3; switch(rpass->passtype) { case SCE_PASS_RGBA: @@ -3580,6 +3580,10 @@ void merge_transp_passes(RenderLayer *rl, ShadeResult *shr) col= &shr->mist; pixsize= 1; break; + case SCE_PASS_Z: + col= &shr->z; + pixsize= 1; + break; case SCE_PASS_VECTOR: { @@ -3612,14 +3616,18 @@ void merge_transp_passes(RenderLayer *rl, ShadeResult *shr) for(samp= 1; samp1) { + col[1]+= fp[1]; + col[2]+= fp[2]; + if(pixsize==4) col[3]+= fp[3]; + } } col[0]*= weight; - col[1]*= weight; - col[2]*= weight; - if(pixsize) col[3]*= weight; + if(pixsize>1) { + col[1]*= weight; + col[2]*= weight; + if(pixsize==4) col[3]*= weight; + } } } @@ -3973,7 +3981,7 @@ unsigned short *zbuffer_transp_shade(RenderPart *pa, RenderLayer *rl, float *pas /* general shader info, passes */ shade_sample_initialize(&ssamp, pa, rl); - addpassflag= rl->passflag & ~(SCE_PASS_Z|SCE_PASS_COMBINED); + addpassflag= rl->passflag & ~(SCE_PASS_COMBINED); addzbuf= rl->passflag & SCE_PASS_Z; if(R.osa) diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index a21dc8b0f5d..c30f39b5f4c 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -513,7 +513,6 @@ void do_common_editbuts(unsigned short event) // old name, is a mix of object an } else { editmesh_deselect_by_material(G.obedit->actcol-1); } - allqueue(REDRAWVIEW3D, 0); } else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) { nu= editNurb.first; @@ -553,8 +552,9 @@ void do_common_editbuts(unsigned short event) // old name, is a mix of object an nu= nu->next; } BIF_undo_push("Select material index"); - allqueue(REDRAWVIEW3D, 0); } + allqueue(REDRAWIMAGE, 0); + allqueue(REDRAWVIEW3D, 0); } countall(); break; diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index af90d01fb59..3b0167d673c 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -137,36 +137,42 @@ static void load_new_sample(char *str) /* called from fileselect */ bSample *sample, *newsample; sound = G.buts->lockpoin; - - if (sound) { - // save values - sample = sound->sample; - strcpy(name, sound->sample->name); - - strcpy(sound->name, str); - sound_set_sample(sound, NULL); - sound_initialize_sample(sound); - - if (sound->sample->type == SAMPLE_INVALID) { - error("Not a valid sample: %s", str); - - newsample = sound->sample; - - // restore values - strcpy(sound->name, name); - sound_set_sample(sound, sample); - - // remove invalid sample - - sound_free_sample(newsample); - BLI_remlink(samples, newsample); - MEM_freeN(newsample); - } + + /* No Sound or Selected the same sample as we alredy have, just ignore */ + if (sound==NULL || str==sound->name) + return; + + if (sizeof(sound->sample->name) < strlen(str)) { + error("Path too long: %s", str); + return; } + + // save values + sample = sound->sample; + strcpy(name, sound->sample->name); + strcpy(sound->name, str); + sound_set_sample(sound, NULL); + sound_initialize_sample(sound); + if (sound->sample->type == SAMPLE_INVALID) { + error("Not a valid sample: %s", str); + + newsample = sound->sample; + + // restore values + strcpy(sound->name, name); + sound_set_sample(sound, sample); + + // remove invalid sample + + sound_free_sample(newsample); + BLI_remlink(samples, newsample); + MEM_freeN(newsample); + return; + } + BIF_undo_push("Load new audio file"); allqueue(REDRAWBUTSSCENE, 0); - } @@ -403,7 +409,7 @@ static void sound_panel_sound(bSound *sound) sample = sound->sample; /* info string */ - if (sound->sample && sound->sample->len) { + if (sound->sample && sound->sample->len && sound->sample->channels && sound->sample->bits) { char *tmp; if (sound->sample->channels == 1) tmp= "Mono"; else if (sound->sample->channels == 2) tmp= "Stereo"; @@ -1174,18 +1180,18 @@ static void seq_panel_proxy() 130,140,120,19, &last_seq->flag, 0.0, 21.0, 100, 0, "Use a custom directory to store data"); - } - if (last_seq->flag & SEQ_USE_PROXY_CUSTOM_DIR) { - uiDefIconBut(block, BUT, B_SEQ_SEL_PROXY_DIR, - ICON_FILESEL, 10, 120, 20, 20, 0, 0, 0, 0, 0, - "Select the directory/name for " - "the proxy storage"); + if (last_seq->flag & SEQ_USE_PROXY_CUSTOM_DIR) { + uiDefIconBut(block, BUT, B_SEQ_SEL_PROXY_DIR, + ICON_FILESEL, 10, 120, 20, 20, 0, 0, 0, 0, 0, + "Select the directory/name for " + "the proxy storage"); - uiDefBut(block, TEX, - B_SEQ_BUT_RELOAD, "Dir: ", - 30,120,220,20, last_seq->strip->proxy->dir, - 0.0, 160.0, 100, 0, ""); + uiDefBut(block, TEX, + B_SEQ_BUT_RELOAD, "Dir: ", + 30,120,220,20, last_seq->strip->proxy->dir, + 0.0, 160.0, 100, 0, ""); + } } if (last_seq->flag & SEQ_USE_PROXY) { diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c index 10e49cdd218..562d9a4934d 100644 --- a/source/blender/src/transform_conversions.c +++ b/source/blender/src/transform_conversions.c @@ -3623,7 +3623,7 @@ void special_aftertrans_update(TransInfo *t) } } } - else if (t->spacetype == SPACE_ACTION) { + if (t->spacetype == SPACE_ACTION) { void *data; short datatype; diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index 4af5ac4d5d2..b3a3a47152a 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -332,6 +332,7 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, ketsjiengine->SetPythonDictionary(dictionaryobject); initRasterizer(rasterizer, canvas); PyObject *gameLogic = initGameLogic(startscene); + PyDict_SetItemString(dictionaryobject, "GameLogic", gameLogic); // Same as importing the module. initGameKeys(); initPythonConstraintBinding(); @@ -399,7 +400,14 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, exitstring = ketsjiengine->GetExitString(); // when exiting the mainloop - dictionaryClearByHand(gameLogic); + + // Clears the dictionary by hand: + // This prevents, extra references to global variables + // inside the GameLogic dictionary when the python interpreter is finalized. + // which allows the scene to safely delete them :) + // see: (space.c)->start_game + PyDict_Clear(PyModule_GetDict(gameLogic)); + ketsjiengine->StopEngine(); exitGamePythonScripting(); networkdevice->Disconnect(); @@ -591,6 +599,7 @@ extern "C" void StartKetsjiShellSimulation(struct ScrArea *area, ketsjiengine->SetPythonDictionary(dictionaryobject); initRasterizer(rasterizer, canvas); PyObject *gameLogic = initGameLogic(startscene); + PyDict_SetItemString(dictionaryobject, "GameLogic", gameLogic); // Same as importing the module initGameKeys(); initPythonConstraintBinding(); diff --git a/source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp b/source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp new file mode 100644 index 00000000000..c635227140e --- /dev/null +++ b/source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp @@ -0,0 +1,76 @@ +/** + * $Id: SCA_ActuatorEventManager.cpp 15444 2008-07-05 17:05:05Z lukep $ + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include "SCA_ISensor.h" +#include "SCA_ActuatorEventManager.h" +#include "SCA_ActuatorSensor.h" + +#ifdef HAVE_CONFIG_H +#include +#endif + + +SCA_ActuatorEventManager::SCA_ActuatorEventManager(class SCA_LogicManager* logicmgr) + : SCA_EventManager(ACTUATOR_EVENTMGR), + m_logicmgr(logicmgr) +{ +} + + + +SCA_ActuatorEventManager::~SCA_ActuatorEventManager() +{ + +} + + + +void SCA_ActuatorEventManager::RegisterSensor(SCA_ISensor* sensor) +{ + m_sensors.push_back(sensor); +} + + + +void SCA_ActuatorEventManager::NextFrame() +{ + // check for changed actuator + for (vector::const_iterator it = m_sensors.begin();!(it==m_sensors.end());it++) + { + (*it)->Activate(m_logicmgr,NULL); + } +} + +void SCA_ActuatorEventManager::UpdateFrame() +{ + // update the state of actuator before executing them + for (vector::const_iterator it = m_sensors.begin();!(it==m_sensors.end());it++) + { + ((SCA_ActuatorSensor*)(*it))->Update(); + } +} \ No newline at end of file diff --git a/source/gameengine/GameLogic/SCA_ActuatorEventManager.h b/source/gameengine/GameLogic/SCA_ActuatorEventManager.h new file mode 100644 index 00000000000..98e217c830e --- /dev/null +++ b/source/gameengine/GameLogic/SCA_ActuatorEventManager.h @@ -0,0 +1,52 @@ +/** + * $Id: SCA_ActuatorEventManager.h 15444 2008-07-05 17:05:05Z lukep $ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ +#ifndef __KX_ACTUATOREVENTMANAGER +#define __KX_ACTUATOREVENTMANAGER + +#include "SCA_EventManager.h" + +#include + +using namespace std; + +class SCA_ActuatorEventManager : public SCA_EventManager +{ + class SCA_LogicManager* m_logicmgr; + +public: + SCA_ActuatorEventManager(class SCA_LogicManager* logicmgr); + virtual ~SCA_ActuatorEventManager(); + virtual void NextFrame(); + virtual void UpdateFrame(); + virtual void RegisterSensor(SCA_ISensor* sensor); + //SCA_LogicManager* GetLogicManager() { return m_logicmgr;} +}; + +#endif //__KX_ACTUATOREVENTMANAGER + diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp new file mode 100644 index 00000000000..a16f71991d6 --- /dev/null +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp @@ -0,0 +1,196 @@ +/** + * Actuator sensor + * + * $Id: SCA_ActuatorSensor.cpp 15486 2008-07-08 12:18:43Z ben2610 $ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include "SCA_ActuatorSensor.h" +#include "SCA_EventManager.h" +#include "SCA_LogicManager.h" + +#ifdef HAVE_CONFIG_H +#include +#endif + +SCA_ActuatorSensor::SCA_ActuatorSensor(SCA_EventManager* eventmgr, + SCA_IObject* gameobj, + const STR_String& actname, + PyTypeObject* T ) + : SCA_ISensor(gameobj,eventmgr,T), + m_checkactname(actname) +{ + m_actuator = GetParent()->FindActuator(m_checkactname); + Init(); +} + +void SCA_ActuatorSensor::Init() +{ + m_lastresult = m_invert?true:false; + m_midresult = m_lastresult; + m_reset = true; +} + +CValue* SCA_ActuatorSensor::GetReplica() +{ + SCA_ActuatorSensor* replica = new SCA_ActuatorSensor(*this); + // m_range_expr must be recalculated on replica! + CValue::AddDataToReplica(replica); + replica->Init(); + + return replica; +} + +void SCA_ActuatorSensor::ReParent(SCA_IObject* parent) +{ + m_actuator = parent->FindActuator(m_checkactname); + SCA_ISensor::ReParent(parent); +} + +bool SCA_ActuatorSensor::IsPositiveTrigger() +{ + bool result = m_lastresult; + if (m_invert) + result = !result; + + return result; +} + + + +SCA_ActuatorSensor::~SCA_ActuatorSensor() +{ +} + + + +bool SCA_ActuatorSensor::Evaluate(CValue* event) +{ + if (m_actuator) + { + bool result = m_actuator->IsActive(); + bool reset = m_reset && m_level; + + m_reset = false; + if (m_lastresult != result || m_midresult != result) + { + m_lastresult = m_midresult = result; + return true; + } + return (reset) ? true : false; + } + return false; +} + +void SCA_ActuatorSensor::Update() +{ + if (m_actuator) + { + m_midresult = m_actuator->IsActive() && !m_actuator->IsNegativeEvent(); + } +} + + +/* ------------------------------------------------------------------------- */ +/* Python functions */ +/* ------------------------------------------------------------------------- */ + +/* Integration hooks ------------------------------------------------------- */ +PyTypeObject SCA_ActuatorSensor::Type = { + PyObject_HEAD_INIT(&PyType_Type) + 0, + "SCA_ActuatorSensor", + sizeof(SCA_ActuatorSensor), + 0, + PyDestructor, + 0, + __getattr, + __setattr, + 0, //&MyPyCompare, + __repr, + 0, //&cvalue_as_number, + 0, + 0, + 0, + 0 +}; + +PyParentObject SCA_ActuatorSensor::Parents[] = { + &SCA_ActuatorSensor::Type, + &SCA_ISensor::Type, + &SCA_ILogicBrick::Type, + &CValue::Type, + NULL +}; + +PyMethodDef SCA_ActuatorSensor::Methods[] = { + {"getActuator", (PyCFunction) SCA_ActuatorSensor::sPyGetActuator, METH_VARARGS, GetActuator_doc}, + {"setActuator", (PyCFunction) SCA_ActuatorSensor::sPySetActuator, METH_VARARGS, SetActuator_doc}, + {NULL,NULL} //Sentinel +}; + +PyObject* SCA_ActuatorSensor::_getattr(const STR_String& attr) { + _getattr_up(SCA_ISensor); /* implicit return! */ +} + +/* 3. getActuator */ +char SCA_ActuatorSensor::GetActuator_doc[] = +"getActuator()\n" +"\tReturn the Actuator with which the sensor operates.\n"; +PyObject* SCA_ActuatorSensor::PyGetActuator(PyObject* self, PyObject* args, PyObject* kwds) +{ + return PyString_FromString(m_checkactname); +} + +/* 4. setActuator */ +char SCA_ActuatorSensor::SetActuator_doc[] = +"setActuator(name)\n" +"\t- name: string\n" +"\tSets the Actuator with which to operate. If there is no Actuator\n" +"\tof this name, the call is ignored.\n"; +PyObject* SCA_ActuatorSensor::PySetActuator(PyObject* self, PyObject* args, PyObject* kwds) +{ + /* We should query whether the name exists. Or should we create a prop */ + /* on the fly? */ + char *actNameArg = NULL; + + if (!PyArg_ParseTuple(args, "s", &actNameArg)) { + return NULL; + } + + SCA_IActuator* act = GetParent()->FindActuator(STR_String(actNameArg)); + if (act) { + m_checkactname = actNameArg; + m_actuator = act; + } else { + ; /* error: bad actuator name */ + } + Py_Return; +} + +/* eof */ diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.h b/source/gameengine/GameLogic/SCA_ActuatorSensor.h new file mode 100644 index 00000000000..f662c579ab7 --- /dev/null +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.h @@ -0,0 +1,74 @@ +/** + * Actuator sensor + * + * $Id: SCA_ActuatorSensor.h 15444 2008-07-05 17:05:05Z lukep $ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef __KX_ACTUATORSENSOR +#define __KX_ACTUATORSENSOR + +#include "SCA_ISensor.h" +#include "SCA_IActuator.h" + +class SCA_ActuatorSensor : public SCA_ISensor +{ + Py_Header; + STR_String m_checkactname; + bool m_lastresult; + bool m_midresult; + protected: + SCA_IActuator* m_actuator; +public: + SCA_ActuatorSensor(class SCA_EventManager* eventmgr, + SCA_IObject* gameobj, + const STR_String& actname, + PyTypeObject* T=&Type ); + + virtual ~SCA_ActuatorSensor(); + virtual CValue* GetReplica(); + virtual void Init(); + virtual bool Evaluate(CValue* event); + virtual bool IsPositiveTrigger(); + virtual void ReParent(SCA_IObject* parent); + void Update(); + + /* --------------------------------------------------------------------- */ + /* Python interface ---------------------------------------------------- */ + /* --------------------------------------------------------------------- */ + + virtual PyObject* _getattr(const STR_String& attr); + + /* 3. setProperty */ + KX_PYMETHOD_DOC(SCA_ActuatorSensor,SetActuator); + /* 4. getProperty */ + KX_PYMETHOD_DOC(SCA_ActuatorSensor,GetActuator); + +}; + +#endif + diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index 76386079bdf..01ae4072335 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -116,7 +116,7 @@ CValue* SCA_PythonController::GetReplica() void SCA_PythonController::SetScriptText(const STR_String& text) { - m_scriptText = "import GameLogic\n" + text; + m_scriptText = text; m_bModified = true; } @@ -354,8 +354,10 @@ SCA_PythonController::PyGetSensor(PyObject* self, PyObject* value) return sensor->AddRef(); } } - - PyErr_SetString(PyExc_AttributeError, "Unable to find requested sensor"); + + char emsg[96]; + PyOS_snprintf( emsg, sizeof( emsg ), "Unable to find requested sensor \"%s\"", scriptArg ); + PyErr_SetString(PyExc_AttributeError, emsg); return NULL; } @@ -382,8 +384,10 @@ SCA_PythonController::PyGetActuator(PyObject* self, PyObject* value) return actua->AddRef(); } } - - PyErr_SetString(PyExc_AttributeError, "Unable to find requested actuator"); + + char emsg[96]; + PyOS_snprintf( emsg, sizeof( emsg ), "Unable to find requested actuator \"%s\"", scriptArg ); + PyErr_SetString(PyExc_AttributeError, emsg); return NULL; } diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp index d6908b53d40..b5ebffb9378 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -644,7 +644,7 @@ bool GPG_Application::startEngine(void) PyObject* dictionaryobject = initGamePlayerPythonScripting("Ketsji", psl_Lowest); m_ketsjiengine->SetPythonDictionary(dictionaryobject); initRasterizer(m_rasterizer, m_canvas); - PyObject *gameLogic = initGameLogic(startscene); + PyDict_SetItemString(dictionaryobject, "GameLogic", initGameLogic(startscene)); // Same as importing the module initGameKeys(); initPythonConstraintBinding(); diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index 20187a193ba..db099d56b55 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -231,7 +231,10 @@ void KX_KetsjiEngine::SetRasterizer(RAS_IRasterizer* rasterizer) } - +/* + * At the moment the GameLogic module is imported into 'pythondictionary' after this function is called. + * if this function ever changes to assign a copy, make sure the game logic module is imported into this dictionary before hand. + */ void KX_KetsjiEngine::SetPythonDictionary(PyObject* pythondictionary) { MT_assert(pythondictionary); diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 433e0636833..61ed8b6a8e4 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -828,20 +828,9 @@ PyObject* initGameLogic(KX_Scene* scene) // quick hack to get gravity hook Py_FatalError("can't initialize module GameLogic"); } - return d; + return m; } -void dictionaryClearByHand(PyObject *dict) -{ - // Clears the dictionary by hand: - // This prevents, extra references to global variables - // inside the GameLogic dictionary when the python interpreter is finalized. - // which allows the scene to safely delete them :) - // see: (space.c)->start_game - if(dict) PyDict_Clear(dict); -} - - // Python Sandbox code // override builtin functions import() and open() diff --git a/source/gameengine/Ketsji/KX_PythonInit.h b/source/gameengine/Ketsji/KX_PythonInit.h index c7d8f1b78bc..41cf7fd67b3 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.h +++ b/source/gameengine/Ketsji/KX_PythonInit.h @@ -47,7 +47,6 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur void exitGamePlayerPythonScripting(); PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLevel level); void exitGamePythonScripting(); -void dictionaryClearByHand(PyObject *dict); void PHY_SetActiveScene(class KX_Scene* scene); class KX_Scene* PHY_GetActiveScene(); diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp index 949156571a7..34a3baec093 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.cpp +++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp @@ -291,7 +291,8 @@ PyObject* KX_SoundActuator::PyGetFilename(PyObject* self, PyObject* args, PyObje char* name = objectname.Ptr(); if (!name) { - Py_Return; /* internal error */ + PyErr_SetString(PyExc_RuntimeError, "Unable to get sound filename"); + return NULL; } else return PyString_FromString(name); } From 8d94bfec1b9f692474d74441ec92ef5d3765e8e5 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Tue, 15 Jul 2008 21:08:39 +0000 Subject: [PATCH 42/76] Last commit fixed the file contents.. but some svn props were missing. So I fixed the problem with merges instead of copying files over. Also trunk/blender/release/scripts/scripttemplate_ipo_gen.py from revision 14530 was missing. (that was fixed) svn merge -r 15590:15551 https://svn.blender.org/svnroot/bf-blender/branches/soc-2008-jaguarandi (revert changes to the point where the merge was incorrect) svn merge -r 15552:15572 https://svn.blender.org/svnroot/bf-blender/branches/soc-2008-jaguarandi (apply branch modifications) svn merge -r 15392:15590 https://svn.blender.org/svnroot/bf-blender/trunk/blender (merge from trunk) --- source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp | 2 +- source/gameengine/GameLogic/SCA_ActuatorEventManager.h | 2 +- source/gameengine/GameLogic/SCA_ActuatorSensor.cpp | 2 +- source/gameengine/GameLogic/SCA_ActuatorSensor.h | 2 +- source/gameengine/Ketsji/KX_NearSensor.cpp | 4 +--- source/gameengine/Ketsji/KX_RadarSensor.cpp | 4 ++++ source/gameengine/Rasterizer/Makefile | 3 +++ 7 files changed, 12 insertions(+), 7 deletions(-) diff --git a/source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp b/source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp index c635227140e..28ca1fd673f 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp +++ b/source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp @@ -1,5 +1,5 @@ /** - * $Id: SCA_ActuatorEventManager.cpp 15444 2008-07-05 17:05:05Z lukep $ + * $Id$ * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/gameengine/GameLogic/SCA_ActuatorEventManager.h b/source/gameengine/GameLogic/SCA_ActuatorEventManager.h index 98e217c830e..b5108764197 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorEventManager.h +++ b/source/gameengine/GameLogic/SCA_ActuatorEventManager.h @@ -1,5 +1,5 @@ /** - * $Id: SCA_ActuatorEventManager.h 15444 2008-07-05 17:05:05Z lukep $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp index a16f71991d6..e1c8ef87dd1 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp @@ -1,7 +1,7 @@ /** * Actuator sensor * - * $Id: SCA_ActuatorSensor.cpp 15486 2008-07-08 12:18:43Z ben2610 $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.h b/source/gameengine/GameLogic/SCA_ActuatorSensor.h index f662c579ab7..6086c5bfce0 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.h +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.h @@ -1,7 +1,7 @@ /** * Actuator sensor * - * $Id: SCA_ActuatorSensor.h 15444 2008-07-05 17:05:05Z lukep $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/gameengine/Ketsji/KX_NearSensor.cpp b/source/gameengine/Ketsji/KX_NearSensor.cpp index d69871275b9..89699d80031 100644 --- a/source/gameengine/Ketsji/KX_NearSensor.cpp +++ b/source/gameengine/Ketsji/KX_NearSensor.cpp @@ -135,9 +135,6 @@ CValue* KX_NearSensor::GetReplica() void KX_NearSensor::ReParent(SCA_IObject* parent) { - - SCA_ISensor::ReParent(parent); - m_client_info->m_gameobject = static_cast(parent); m_client_info->m_sensors.push_back(this); @@ -151,6 +148,7 @@ void KX_NearSensor::ReParent(SCA_IObject* parent) */ ((KX_GameObject*)GetParent())->GetSGNode()->ComputeWorldTransforms(NULL); SynchronizeTransform(); + SCA_ISensor::ReParent(parent); } diff --git a/source/gameengine/Ketsji/KX_RadarSensor.cpp b/source/gameengine/Ketsji/KX_RadarSensor.cpp index 987e0b946b2..9dab09f8f2a 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.cpp +++ b/source/gameengine/Ketsji/KX_RadarSensor.cpp @@ -92,6 +92,10 @@ CValue* KX_RadarSensor::GetReplica() if (replica->m_physCtrl) { replica->m_physCtrl = replica->m_physCtrl->GetReplica(); + if (replica->m_physCtrl) + { + replica->m_physCtrl->setNewClientInfo(replica->m_client_info); + } } //todo: make sure replication works fine! diff --git a/source/gameengine/Rasterizer/Makefile b/source/gameengine/Rasterizer/Makefile index 1ca3e3b0283..e3b1f274ee5 100644 --- a/source/gameengine/Rasterizer/Makefile +++ b/source/gameengine/Rasterizer/Makefile @@ -41,6 +41,9 @@ CPPFLAGS += -I$(NAN_STRING)/include CPPFLAGS += -I$(NAN_MOTO)/include CPPFLAGS += -I../../kernel/gen_system CPPFLAGS += -I../BlenderRoutines +CPPFLAGS += -I../Expressions + +CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) ifeq ($(OS),darwin) CPPFLAGS += -fpascal-strings From 59a2b5017185369836678b14325666f62dba9311 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Fri, 18 Jul 2008 22:24:20 +0000 Subject: [PATCH 43/76] *Added "kept" mesh above surface option on shrinkwrap to nearest surface changed a few code relative to project over normal mode (to try to kept code generic and more independent of modifier itself) --- source/blender/blenkernel/BKE_shrinkwrap.h | 25 +- source/blender/blenkernel/intern/shrinkwrap.c | 231 ++++++++++++------ source/blender/blenlib/BLI_kdopbvh.h | 5 +- source/blender/blenlib/intern/BLI_kdopbvh.c | 4 +- source/blender/makesdna/DNA_modifier_types.h | 2 + source/blender/src/buttons_editing.c | 6 + 6 files changed, 197 insertions(+), 76 deletions(-) diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h index b0a40768e8b..a512c1d57cb 100644 --- a/source/blender/blenkernel/BKE_shrinkwrap.h +++ b/source/blender/blenkernel/BKE_shrinkwrap.h @@ -42,7 +42,27 @@ typedef char* BitSet; #define bitset_unset(set,index) ((set)[(index)>>3] &= ~(1 << ((index)&0x7))) +/* SpaceTransform stuff */ +//TODO: should move to other generic space? +struct Object; +typedef struct SpaceTransform +{ + float local2target[4][4]; + float target2local[4][4]; + +} SpaceTransform; + +void space_transform_setup(SpaceTransform *data, struct Object *local, struct Object *target); + +void space_transform_apply (SpaceTransform *data, float *co); +void space_transform_invert(SpaceTransform *data, float *co); + +void space_transform_apply_normal (SpaceTransform *data, float *co); +void space_transform_invert_normal(SpaceTransform *data, float *co); + + +/* Shrinkwrap stuff */ struct Object; struct DerivedMesh; struct ShrinkwrapModifierData; @@ -59,9 +79,7 @@ typedef struct ShrinkwrapCalcData struct DerivedMesh *target; //mesh we are shrinking to - //matrixs for local<->target space transform - float local2target[4][4]; - float target2local[4][4]; + SpaceTransform local2target; float keptDist; //Distance to kept from target (units are in local space) //float *weights; //weights of vertexs @@ -75,6 +93,7 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *data); struct DerivedMesh *shrinkwrapModifier_do(struct ShrinkwrapModifierData *smd, struct Object *ob, struct DerivedMesh *dm, int useRenderParams, int isFinalCalc); + #endif diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index cb49f762cac..0aacdbc9a08 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -121,6 +121,38 @@ static float sphereray_tri_intersection(const BVHTreeRay *ray, float radius, con return FLT_MAX; } +/* Space transform */ +void space_transform_setup(SpaceTransform *data, struct Object *local, struct Object *target) +{ + Mat4Invert(target->imat, target->obmat); //Invserse might be outdated + Mat4MulSerie(data->local2target, target->imat, local->obmat, 0, 0, 0, 0, 0, 0); + Mat4Invert(data->target2local, data->local2target); +} + +void space_transform_apply(/* const */ SpaceTransform *data, float *co) +{ + VecMat4MulVecfl(co, data->local2target, co); +// Mat4Mul3Vecfl(data->local2target, co); +} + +void space_transform_invert(/* const */SpaceTransform *data, float *co) +{ + VecMat4MulVecfl(co, data->target2local, co); +// Mat4Mul3Vecfl(data->target2local, co); +} + +void space_transform_apply_normal(/* const */ SpaceTransform *data, float *no) +{ + Mat4Mul3Vecfl(data->local2target, no); + Normalize(no); // TODO: could we just determine de scale value from the matrix? +} + +void space_transform_invert_normal(/* const */ SpaceTransform *data, float *no) +{ + Mat4Mul3Vecfl(data->target2local, no); + Normalize(no); // TODO: could we just determine de scale value from the matrix? +} + /* * BVH tree from mesh vertices @@ -328,6 +360,8 @@ static float mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay * hit->index = index; hit->dist = dist; VECADDFAC(hit->co, ray->origin, ray->direction, dist); + + CalcNormFloat(t0, t1, t2, hit->no); } t1 = t2; @@ -883,25 +917,24 @@ static void shrinkwrap_calc_foreach_vertex(ShrinkwrapCalcData *calc, Shrinkwrap_ { float weight = vertexgroup_get_vertex_weight(dvert, i, vgroup); - float orig[3], final[3]; //Coords relative to target + float final[3]; //Coords relative to target float normal[3]; float dist; if(weight == 0.0f) continue; //Skip vertexs where we have no influence - VecMat4MulVecfl(orig, calc->local2target, vert[i].co); - VECCOPY(final, orig); + VECCOPY(final, vert[i].co); + space_transform_apply(&calc->local2target, final); //We also need to apply the rotation to normal if(calc->smd->shrinkType == MOD_SHRINKWRAP_NORMAL) { NormalShortToFloat(normal, vert[i].no); - Mat4Mul3Vecfl(calc->local2target, normal); - Normalize(normal); //Watch out for scaling (TODO: do we really needed a unit-len normal?) + space_transform_apply_normal(&calc->local2target, normal); } (callback)(calc->target, final, normal); - VecMat4MulVecfl(final, calc->target2local, final); + space_transform_invert(&calc->local2target, final); dist = VecLenf(vert[i].co, final); if(dist > 1e-5) weight *= (dist - calc->keptDist)/dist; @@ -1075,6 +1108,7 @@ static void shrinkwrap_removeUnused(ShrinkwrapCalcData *calc) calc->final = new; } + void shrinkwrap_projectToCutPlane(ShrinkwrapCalcData *calc_data) { if(calc_data->smd->cutPlane && calc_data->moved) @@ -1099,10 +1133,7 @@ void shrinkwrap_projectToCutPlane(ShrinkwrapCalcData *calc_data) return; } - Mat4Invert (calc.smd->cutPlane->imat, calc.smd->cutPlane->obmat); //inverse is outdated - Mat4MulSerie(calc.local2target, calc.smd->cutPlane->imat, calc.ob->obmat, 0, 0, 0, 0, 0, 0); - Mat4Invert(calc.target2local, calc.local2target); - + space_transform_setup(&calc.local2target, calc.ob, calc.smd->cutPlane); calc.keptDist = 0; } @@ -1172,12 +1203,10 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri printf("Target derived mesh is null! :S\n"); } - //TODO should we reduce the number of matrix mults? by choosing applying matrixs to target or to derived mesh? - //Calculate matrixs for local <-> target - Mat4Invert (smd->target->imat, smd->target->obmat); //inverse is outdated - Mat4MulSerie(calc.local2target, smd->target->imat, ob->obmat, 0, 0, 0, 0, 0, 0); - Mat4Invert(calc.target2local, calc.local2target); - + //TODO there might be several "bugs" on non-uniform scales matrixs.. because it will no longer be nearest surface, not sphere projection + //because space has been deformed + space_transform_setup(&calc.local2target, ob, smd->target); + calc.keptDist = smd->keptDist; //TODO: smd->keptDist is in global units.. must change to local } @@ -1282,7 +1311,8 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) float weight = vertexgroup_get_vertex_weight(dvert, i, vgroup); if(weight == 0.0f) continue; - VecMat4MulVecfl(tmp_co, calc->local2target, vert[i].co); + VECCOPY(tmp_co, vert[i].co); + space_transform_apply(&calc->local2target, tmp_co); if(nearest.index != -1) { @@ -1296,7 +1326,7 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) { float dist; - VecMat4MulVecfl(tmp_co, calc->target2local, nearest.nearest); + space_transform_invert(&calc->local2target, tmp_co); dist = VecLenf(vert[i].co, tmp_co); if(dist > 1e-5) weight *= (dist - calc->keptDist)/dist; VecLerpf(vert[i].co, vert[i].co, tmp_co, weight); //linear interpolation @@ -1314,6 +1344,7 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) * it builds a RayTree from the target mesh and then performs a * raycast for each vertex (ray direction = normal) */ +/* void shrinkwrap_calc_normal_projection_raytree(ShrinkwrapCalcData *calc) { int i; @@ -1354,7 +1385,6 @@ void shrinkwrap_calc_normal_projection_raytree(ShrinkwrapCalcData *calc) Mat4Mul3Vecfl(calc->local2target, tmp_no); //Watch out for scaling on normal Normalize(tmp_no); //(TODO: do we really needed a unit-len normal? and we could know the scale factor before hand?) - if(use_normal & MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL) { dist = raytree_cast_ray(target, tmp_co, tmp_no, face_normal); @@ -1404,6 +1434,61 @@ void shrinkwrap_calc_normal_projection_raytree(ShrinkwrapCalcData *calc) free_raytree_from_mesh(target); } +*/ + + +/* + * This function raycast a single vertex and updates the hit if the "hit" is considered valid. + * Returns TRUE if "hit" was updated. + * Opts control whether an hit is valid or not + * Supported options are: + * MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE (front faces hits are ignored) + * MOD_SHRINKWRAP_CULL_TARGET_BACKFACE (back faces hits are ignored) + */ +static int normal_projection_project_vertex(char options, const float *vert, const float *dir,/* const */ SpaceTransform *transf, BVHTree *tree, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, BVHMeshCallbackUserdata *userdata) +{ + float tmp_co[3], tmp_no[3]; + BVHTreeRayHit hit_tmp; + memcpy( &hit_tmp, hit, sizeof(hit_tmp) ); + + //Apply space transform (TODO readjust dist) + if(transf) + { + VECCOPY( tmp_co, vert ); + space_transform_apply( transf, tmp_co ); + vert = tmp_co; + + VECCOPY( tmp_no, dir ); + space_transform_apply_normal( transf, tmp_no ); + dir = tmp_no; + } + + hit_tmp.index = -1; + + BLI_bvhtree_ray_cast(tree, vert, dir, &hit_tmp, callback, userdata); + + if(hit_tmp.index != -1) + { + float dot = INPR( dir, hit_tmp.no); + + if(((options & MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE) && dot < 0) + || ((options & MOD_SHRINKWRAP_CULL_TARGET_BACKFACE) && dot > 0)) + return FALSE; //Ignore hit + + + //Inverting space transform (TODO readjust dist) + if(transf) + { + space_transform_invert( transf, hit_tmp.co ); + space_transform_invert_normal( transf, hit_tmp.no ); + } + + memcpy(hit, &hit_tmp, sizeof(hit_tmp) ); + return TRUE; + } + return FALSE; +} + void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) { @@ -1417,6 +1502,14 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) BVHMeshCallbackUserdata userdata; BVHTree_RayCastCallback callback = NULL; + + //cutTree + BVHTree *limit_tree = NULL; + BVHMeshCallbackUserdata limit_userdata; + BVHTree_RayCastCallback limit_callback = NULL; + SpaceTransform local2cut; + + int numVerts; MVert *vert = NULL; MDeformVert *dvert = NULL; @@ -1429,6 +1522,21 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) bvhtree_meshcallbackdata_init(&userdata, calc->target, calc->keptDist); callback = mesh_faces_spherecast; + if(calc->smd->cutPlane) + { + DerivedMesh * limit_mesh = (DerivedMesh *)calc->smd->cutPlane->derivedFinal; + if(limit_mesh) + { + BENCH(limit_tree = bvhtree_from_mesh_faces(limit_mesh, 0.0, 4, 6)); + bvhtree_meshcallbackdata_init(&limit_userdata, limit_mesh, 0.0); + limit_callback = mesh_faces_spherecast; + + space_transform_setup( &local2cut, calc->ob, calc->smd->cutPlane); + } + else printf("CutPlane finalDerived mesh is null\n"); + } + + //Project each vertex along normal numVerts= calc->final->getNumVerts(calc->final); vert = calc->final->getVertDataArray(calc->final, CD_MVERT); @@ -1437,69 +1545,39 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) for(i=0; itarget - VecMat4MulVecfl(tmp_co, calc->local2target, vert[i].co); - + VECCOPY(tmp_co, vert[i].co); NormalShortToFloat(tmp_no, vert[i].no); - Mat4Mul3Vecfl(calc->local2target, tmp_no); //Watch out for scaling on normal - Normalize(tmp_no); //(TODO: do we really needed a unit-len normal? and we could know the scale factor before hand?) + hit.index = -1; - hit.dist = 1000; //TODO: we should use FLT_MAX here + hit.dist = lim; +/* if(limit_tree) + { + normal_projection_project_vertex(0, tmp_co, tmp_no, &local2cut, limit_tree, &hit, callback, &userdata); + } +*/ if(use_normal & MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL) { - BLI_bvhtree_ray_cast(tree, tmp_co, tmp_no, &hit, callback, &userdata); - - if(hit.index != -1) - { - float *v0, *v1, *v2; - float facenormal[3], dot; - - bvhtree_from_mesh_get_tri(&userdata, hit.index, &v0, &v1, &v2); - CalcNormFloat(v0, v1, v2, facenormal); - dot = INPR( facenormal, tmp_no); - - if(((calc->smd->shrinkOpts & MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE) && dot < 0) - || ((calc->smd->shrinkOpts & MOD_SHRINKWRAP_CULL_TARGET_BACKFACE) && dot > 0)) - { - hit.index = -1; - hit.dist = 1000; //TODO: we should use FLT_MAX here - } - } + normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, tmp_no, &calc->local2target, tree, &hit, callback, &userdata); } + if(use_normal & MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL) { - float inv[3] = { -tmp_no[0], -tmp_no[1], -tmp_no[2] }; - BLI_bvhtree_ray_cast(tree, tmp_co, inv, &hit, callback, &userdata); - - if(hit.index != -1) - { - float *v0, *v1, *v2; - float facenormal[3], dot; - - bvhtree_from_mesh_get_tri(&userdata, hit.index, &v0, &v1, &v2); - CalcNormFloat(v0, v1, v2, facenormal); - dot = INPR( facenormal, inv); - - if(((calc->smd->shrinkOpts & MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE) && dot < 0) - || ((calc->smd->shrinkOpts & MOD_SHRINKWRAP_CULL_TARGET_BACKFACE) && dot > 0)) - { - hit.index = -1; - hit.dist = 1000; //TODO: we should use FLT_MAX here - } - } + float inv_no[3] = { -tmp_no[0], -tmp_no[1], -tmp_no[2] }; + normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, inv_no, &calc->local2target, tree, &hit, callback, &userdata); } + if(hit.index != -1) { - VecMat4MulVecfl(tmp_co, calc->target2local, hit.co); - VecLerpf(vert[i].co, vert[i].co, tmp_co, weight); //linear interpolation + VecLerpf(vert[i].co, vert[i].co, hit.co, weight); //linear interpolation if(calc->moved) bitset_set(calc->moved, i); @@ -1507,6 +1585,9 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) } BLI_bvhtree_free(tree); + + if(limit_tree) + BLI_bvhtree_free(limit_tree); } /* @@ -1551,7 +1632,8 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) float weight = vertexgroup_get_vertex_weight(dvert, i, vgroup); if(weight == 0.0f) continue; - VecMat4MulVecfl(tmp_co, calc->local2target, vert[i].co); + VECCOPY(tmp_co, vert[i].co); + space_transform_apply(&calc->local2target, tmp_co); if(nearest.index != -1) { @@ -1563,11 +1645,22 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) if(index != -1) { - float dist; + if(calc->smd->shrinkOpts & MOD_SHRINKWRAP_KEPT_ABOVE_SURFACE) + { + float *t0, *t1, *t2; + float surface_normal[3], tmp[3]; + bvhtree_from_mesh_get_tri(&userdata, index, &t0, &t1, &t2); + CalcNormFloat(t0, t1, t2, surface_normal); + VECSUB(tmp, vert[i].co, t0 ); + VECADDFAC(tmp_co, nearest.nearest, surface_normal, calc->keptDist); - VecMat4MulVecfl(tmp_co, calc->target2local, nearest.nearest); - dist = VecLenf(vert[i].co, tmp_co); - if(dist > 1e-5) weight *= (dist - calc->keptDist)/dist; + } + else + { + float dist = VecLenf(tmp_co, nearest.nearest); + VecLerpf(tmp_co, tmp_co, nearest.nearest, (dist - calc->keptDist)/dist); //linear interpolation + } + space_transform_invert(&calc->local2target, tmp_co); VecLerpf(vert[i].co, vert[i].co, tmp_co, weight); //linear interpolation } } diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h index 1e56faaff55..d090784e450 100644 --- a/source/blender/blenlib/BLI_kdopbvh.h +++ b/source/blender/blenlib/BLI_kdopbvh.h @@ -57,6 +57,7 @@ typedef struct BVHTreeRayHit { int index; /* index of the tree node (untouched if no hit is found) */ float co[3]; /* coordinates of the hit point */ + float no[3]; /* normal on hit point */ float dist; /* distance to the hit point */ } BVHTreeRayHit; @@ -84,9 +85,9 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, int *result) float BLI_bvhtree_getepsilon(BVHTree *tree); /* find nearest node to the given coordinates (if nearest is given it will only search nodes where square distance is smaller than nearest->dist) */ -int BLI_bvhtree_find_nearest(BVHTree *tree, float *co, BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata); +int BLI_bvhtree_find_nearest(BVHTree *tree, const float *co, BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata); -int BLI_bvhtree_ray_cast(BVHTree *tree, float *co, float *dir, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata); +int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata); #endif // BLI_KDOPBVH_H diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index 73bc3e6a9bc..58a8f9f845c 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -925,7 +925,7 @@ static void dfs_find_nearest(BVHNearestData *data, BVHNode *node) } } -int BLI_bvhtree_find_nearest(BVHTree *tree, float *co, BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata) +int BLI_bvhtree_find_nearest(BVHTree *tree, const float *co, BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata) { int i; @@ -1051,7 +1051,7 @@ static void dfs_raycast(BVHRayCastData *data, BVHNode *node) -int BLI_bvhtree_ray_cast(BVHTree *tree, float *co, float *dir, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata) +int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata) { int i; BVHRayCastData data; diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 9e1a6ede9f9..40c3b223e01 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -519,6 +519,8 @@ typedef struct ShrinkwrapModifierData { #define MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE (1<<3) #define MOD_SHRINKWRAP_CULL_TARGET_BACKFACE (1<<4) +#define MOD_SHRINKWRAP_KEPT_ABOVE_SURFACE (1<<5) + typedef struct SimpleDeformModifierData { ModifierData modifier; diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index c30f39b5f4c..404da946a5a 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -1906,6 +1906,9 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco height = 86; if (smd->shrinkType == MOD_SHRINKWRAP_NORMAL) height += 19*5; + else if (smd->shrinkType == MOD_SHRINKWRAP_NEAREST_SURFACE) + height += 19; + } else if (md->type==eModifierType_SimpleDeform) { height += 19*5; } @@ -2547,6 +2550,9 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco uiDefButF(block, NUM, B_MODIFIER_RECALC, "Merge Dist:", lx,(cy-=19),buttonWidth,19, &smd->mergeDist, 0.0f, 0.01f, 0.01f, 0.01f, "Specify merge distance"); uiDefIDPoinBut(block, modifier_testMeshObj, ID_OB, B_CHANGEDEP, "Cut: ", lx, (cy-=19), buttonWidth,19, &smd->cutPlane, "Target to project points that didn't got projected over target"); } + else if (smd->shrinkType == MOD_SHRINKWRAP_NEAREST_SURFACE){ + uiDefButBitS(block, TOG, MOD_SHRINKWRAP_KEPT_ABOVE_SURFACE, B_MODIFIER_RECALC, "Above surface", lx,(cy-=19),buttonWidth/2,19, &smd->shrinkOpts, 0, 0, 0, 0, "Vertices are kept on the front side of faces"); + } but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &smd->vgroup_name, 0, 31, 0, 0, "Vertex Group name"); uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob); From 0703d9aad1aa3f1233389c462cdb90414fbe31ae Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Sat, 19 Jul 2008 15:22:38 +0000 Subject: [PATCH 44/76] Following the same optimization as bvh raycast: *Made nearest surface also use "quad" bvh tree (instead of splitting quads in 2 bvh nodes). Again that leaded to improvements in build and query time. *BLI_bvhtree_find_nearest api is now following the same concept as BLI_bvhtree_ray_cast removed code relative to bvhtree_from_mesh_tris. --- source/blender/blenkernel/BKE_shrinkwrap.h | 8 +- source/blender/blenkernel/intern/shrinkwrap.c | 192 +++++++----------- source/blender/blenlib/BLI_kdopbvh.h | 11 +- source/blender/blenlib/intern/BLI_kdopbvh.c | 17 +- 4 files changed, 94 insertions(+), 134 deletions(-) diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h index a512c1d57cb..296bbbaf886 100644 --- a/source/blender/blenkernel/BKE_shrinkwrap.h +++ b/source/blender/blenkernel/BKE_shrinkwrap.h @@ -55,11 +55,11 @@ typedef struct SpaceTransform void space_transform_setup(SpaceTransform *data, struct Object *local, struct Object *target); -void space_transform_apply (SpaceTransform *data, float *co); -void space_transform_invert(SpaceTransform *data, float *co); +void space_transform_apply (const SpaceTransform *data, float *co); +void space_transform_invert(const SpaceTransform *data, float *co); -void space_transform_apply_normal (SpaceTransform *data, float *co); -void space_transform_invert_normal(SpaceTransform *data, float *co); +void space_transform_apply_normal (const SpaceTransform *data, float *co); +void space_transform_invert_normal(const SpaceTransform *data, float *co); /* Shrinkwrap stuff */ diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 0aacdbc9a08..9e47dcfd056 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -129,25 +129,23 @@ void space_transform_setup(SpaceTransform *data, struct Object *local, struct Ob Mat4Invert(data->target2local, data->local2target); } -void space_transform_apply(/* const */ SpaceTransform *data, float *co) +void space_transform_apply(const SpaceTransform *data, float *co) { VecMat4MulVecfl(co, data->local2target, co); -// Mat4Mul3Vecfl(data->local2target, co); } -void space_transform_invert(/* const */SpaceTransform *data, float *co) +void space_transform_invert(const SpaceTransform *data, float *co) { VecMat4MulVecfl(co, data->target2local, co); -// Mat4Mul3Vecfl(data->target2local, co); } -void space_transform_apply_normal(/* const */ SpaceTransform *data, float *no) +void space_transform_apply_normal(const SpaceTransform *data, float *no) { Mat4Mul3Vecfl(data->local2target, no); Normalize(no); // TODO: could we just determine de scale value from the matrix? } -void space_transform_invert_normal(/* const */ SpaceTransform *data, float *no) +void space_transform_invert_normal(const SpaceTransform *data, float *no) { Mat4Mul3Vecfl(data->target2local, no); Normalize(no); // TODO: could we just determine de scale value from the matrix? @@ -199,48 +197,6 @@ static BVHTree* bvhtree_from_mesh_verts(DerivedMesh *mesh, float epsilon, int tr return tree; } -/* - * Builds a bvh tree.. where nodes are the faces of the given mesh. Quads are splitted in 2 triangles - */ -static BVHTree* bvhtree_from_mesh_tri(DerivedMesh *mesh, float epsilon, int tree_type, int axis) -{ - int i; - int numFaces= mesh->getNumFaces(mesh), totFaces; - MVert *vert = mesh->getVertDataArray(mesh, CD_MVERT); - MFace *face = mesh->getFaceDataArray(mesh, CD_MFACE); - BVHTree *tree= NULL; - - /* Count needed faces */ - for(totFaces=numFaces, i=0; ivert; - MFace *face = data->face + index / 2; + MFace *face = data->face + index; - if(index & 1) - *v0 = vert[ face->v1 ].co, *v1 = vert[ face->v3 ].co, *v2 = vert[ face->v4 ].co; - else - *v0 = vert[ face->v1 ].co, *v1 = vert[ face->v2 ].co, *v2 = vert[ face->v3 ].co; -} + float *t0, *t1, *t2, *t3; + t0 = vert[ face->v1 ].co; + t1 = vert[ face->v2 ].co; + t2 = vert[ face->v3 ].co; + t3 = face->v4 ? vert[ face->v4].co : NULL; -/* - * Callback to bvh tree nearest point. The tree must bust have been built using bvhtree_from_mesh_tri. - * userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree. - */ -static float mesh_tri_nearest_point(void *userdata, int index, const float *co, float *nearest) -{ - float *t0, *t1, *t2; + + do + { + float nearest_tmp[3], dist; - bvhtree_from_mesh_get_tri( (BVHMeshCallbackUserdata*)userdata, index, &t0, &t1, &t2); - return nearest_point_in_tri_surface(co,t0, t1, t2, nearest); -} + dist = nearest_point_in_tri_surface(co,t0, t1, t2, nearest_tmp); + if(dist < nearest->dist) + { + nearest->index = index; + nearest->dist = dist; + VECCOPY(nearest->co, nearest_tmp); + CalcNormFloat((float*)t0, (float*)t1, (float*)t2, nearest->no); //TODO.. (interpolate normals from the vertexs coordinates? + } -/* - * Callback to bvh tree raycast. The tree must bust have been built using bvhtree_from_mesh_tri. - * userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree. - */ -static float mesh_tri_spherecast(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) -{ - float dist; - float *t0, *t1, *t2; + t1 = t2; + t2 = t3; + t3 = NULL; - bvhtree_from_mesh_get_tri( (BVHMeshCallbackUserdata*)userdata, index, &t0, &t1, &t2); - - if(((BVHMeshCallbackUserdata*)userdata)->sphere_radius == 0.0f) - dist = ray_tri_intersection(ray, hit->dist, t0, t1, t2); - else - dist = sphereray_tri_intersection(ray, ((BVHMeshCallbackUserdata*)userdata)->sphere_radius, hit->dist, t0, t1, t2); - - if(dist >= 0 && dist < hit->dist) - { - hit->index = index; - hit->dist = dist; - VECADDFAC(hit->co, ray->origin, ray->direction, dist); - } - return dist; + } while(t2); } /* * Callback to bvh tree raycast. The tree must bust have been built using bvhtree_from_mesh_faces. * userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree. */ -static float mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) +static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) { const BVHMeshCallbackUserdata *data = (BVHMeshCallbackUserdata*) userdata; MVert *vert = data->vert; @@ -370,7 +311,7 @@ static float mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay * } while(t2); - return hit->dist; + //return hit->dist; } /* @@ -742,6 +683,12 @@ static float nearest_point_in_tri_surface(const float *point, const float *v0, c //point-plane distance and calculate axis normal_dist = point_plane_distance(point, v0, dw); + // OPTIMIZATION + // if we are only interested in nearest distance if its closer than some distance already found + // we can: + // if(normal_dist*normal_dist >= best_dist_so_far) return FLOAT_MAX; + // + VECSUB(du, v1, v0); Normalize(du); Crossf(dv, dw, du); @@ -1316,7 +1263,7 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) if(nearest.index != -1) { - nearest.dist = squared_dist(tmp_co, nearest.nearest); + nearest.dist = squared_dist(tmp_co, nearest.co); } else nearest.dist = FLT_MAX; @@ -1325,7 +1272,7 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) if(index != -1) { float dist; - + VECCOPY(tmp_co, nearest.co); space_transform_invert(&calc->local2target, tmp_co); dist = VecLenf(vert[i].co, tmp_co); if(dist > 1e-5) weight *= (dist - calc->keptDist)/dist; @@ -1448,6 +1395,7 @@ void shrinkwrap_calc_normal_projection_raytree(ShrinkwrapCalcData *calc) static int normal_projection_project_vertex(char options, const float *vert, const float *dir,/* const */ SpaceTransform *transf, BVHTree *tree, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, BVHMeshCallbackUserdata *userdata) { float tmp_co[3], tmp_no[3]; + const float *co, *no; BVHTreeRayHit hit_tmp; memcpy( &hit_tmp, hit, sizeof(hit_tmp) ); @@ -1456,16 +1404,23 @@ static int normal_projection_project_vertex(char options, const float *vert, con { VECCOPY( tmp_co, vert ); space_transform_apply( transf, tmp_co ); - vert = tmp_co; + co = tmp_co; VECCOPY( tmp_no, dir ); space_transform_apply_normal( transf, tmp_no ); - dir = tmp_no; + no = tmp_no; + + hit_tmp.dist *= Mat4ToScalef( transf->local2target ); + } + else + { + co = vert; + no = dir; } hit_tmp.index = -1; - BLI_bvhtree_ray_cast(tree, vert, dir, &hit_tmp, callback, userdata); + BLI_bvhtree_ray_cast(tree, co, no, &hit_tmp, callback, userdata); if(hit_tmp.index != -1) { @@ -1476,11 +1431,13 @@ static int normal_projection_project_vertex(char options, const float *vert, con return FALSE; //Ignore hit - //Inverting space transform (TODO readjust dist) + //Inverting space transform (TODO make coeherent with the initial dist readjust) if(transf) { space_transform_invert( transf, hit_tmp.co ); space_transform_invert_normal( transf, hit_tmp.no ); + + hit_tmp.dist = VecLenf( vert, hit_tmp.co ); } memcpy(hit, &hit_tmp, sizeof(hit_tmp) ); @@ -1547,6 +1504,7 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) float tmp_co[3], tmp_no[3]; float lim = 1000; //TODO: we should use FLT_MAX here, but sweepsphere code isnt prepared for that float weight = vertexgroup_get_vertex_weight(dvert, i, vgroup); + char moved = FALSE; if(weight == 0.0f) continue; @@ -1557,21 +1515,29 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) hit.index = -1; hit.dist = lim; -/* if(limit_tree) - { - normal_projection_project_vertex(0, tmp_co, tmp_no, &local2cut, limit_tree, &hit, callback, &userdata); - } -*/ + if(use_normal & MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL) { - normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, tmp_no, &calc->local2target, tree, &hit, callback, &userdata); +/* + if(limit_tree) + normal_projection_project_vertex(0, tmp_co, tmp_no, &local2cut, limit_tree, &hit, limit_callback, &limit_userdata); +*/ + + if(normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, tmp_no, &calc->local2target, tree, &hit, callback, &userdata)) + moved = TRUE; } if(use_normal & MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL) { float inv_no[3] = { -tmp_no[0], -tmp_no[1], -tmp_no[2] }; - normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, inv_no, &calc->local2target, tree, &hit, callback, &userdata); + +/* + if(limit_tree) + normal_projection_project_vertex(0, tmp_co, inv_no, &local2cut, limit_tree, &hit, limit_callback, &limit_userdata); +*/ + if(normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, inv_no, &calc->local2target, tree, &hit, callback, &userdata)) + moved = TRUE; } @@ -1579,7 +1545,7 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) { VecLerpf(vert[i].co, vert[i].co, hit.co, weight); //linear interpolation - if(calc->moved) + if(moved && calc->moved) bitset_set(calc->moved, i); } } @@ -1612,7 +1578,7 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) //Create a bvh-tree of the given target - tree = bvhtree_from_mesh_tri(calc->target, 0.0, 2, 6); + BENCH( tree = bvhtree_from_mesh_faces(calc->target, 0.0, 2, 6) ); if(tree == NULL) return OUT_OF_MEMORY(); bvhtree_meshcallbackdata_init(&userdata, calc->target, 0.0); @@ -1637,28 +1603,22 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) if(nearest.index != -1) { - nearest.dist = squared_dist(tmp_co, nearest.nearest); + nearest.dist = squared_dist(tmp_co, nearest.co); } else nearest.dist = FLT_MAX; - index = BLI_bvhtree_find_nearest(tree, tmp_co, &nearest, mesh_tri_nearest_point, &userdata); + index = BLI_bvhtree_find_nearest(tree, tmp_co, &nearest, mesh_faces_nearest_point, &userdata); if(index != -1) { if(calc->smd->shrinkOpts & MOD_SHRINKWRAP_KEPT_ABOVE_SURFACE) { - float *t0, *t1, *t2; - float surface_normal[3], tmp[3]; - bvhtree_from_mesh_get_tri(&userdata, index, &t0, &t1, &t2); - CalcNormFloat(t0, t1, t2, surface_normal); - VECSUB(tmp, vert[i].co, t0 ); - VECADDFAC(tmp_co, nearest.nearest, surface_normal, calc->keptDist); - + VECADDFAC(tmp_co, nearest.co, nearest.no, calc->keptDist); } else { - float dist = VecLenf(tmp_co, nearest.nearest); - VecLerpf(tmp_co, tmp_co, nearest.nearest, (dist - calc->keptDist)/dist); //linear interpolation + float dist = VecLenf(tmp_co, nearest.co); + VecLerpf(tmp_co, tmp_co, nearest.co, (dist - calc->keptDist)/dist); //linear interpolation } space_transform_invert(&calc->local2target, tmp_co); VecLerpf(vert[i].co, vert[i].co, tmp_co, weight); //linear interpolation diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h index d090784e450..6d9c82a9626 100644 --- a/source/blender/blenlib/BLI_kdopbvh.h +++ b/source/blender/blenlib/BLI_kdopbvh.h @@ -43,7 +43,8 @@ typedef struct BVHTreeOverlap { typedef struct BVHTreeNearest { int index; /* the index of the nearest found (untouched if none is found within a dist radius from the given coordinates) */ - float nearest[3]; /* nearest coordinates (untouched it none is found within a dist radius from the given coordinates) */ + float co[3]; /* nearest coordinates (untouched it none is found within a dist radius from the given coordinates) */ + float no[3]; /* normal at nearest coordinates (untouched it none is found within a dist radius from the given coordinates) */ float dist; /* squared distance to search arround */ } BVHTreeNearest; @@ -61,11 +62,11 @@ typedef struct BVHTreeRayHit float dist; /* distance to the hit point */ } BVHTreeRayHit; -/* returns square of the minimum distance from given co to the node, nearest point is stored on nearest */ -typedef float (*BVHTree_NearestPointCallback) (void *userdata, int index, const float *co, float *nearest); +/* callback must update nearest in case it finds a nearest result */ +typedef void (*BVHTree_NearestPointCallback) (void *userdata, int index, const float *co, BVHTreeNearest *nearest); -/* returns the ray distancence from given co to the node, nearest point is stored on nearest */ -typedef float (*BVHTree_RayCastCallback) (void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit); +/* callback must update hit in case it finds a nearest successful hit */ +typedef void (*BVHTree_RayCastCallback) (void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit); BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis); diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index 58a8f9f845c..d9c24853236 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -897,6 +897,7 @@ static float calc_nearest_point(BVHNearestData *data, BVHNode *node, float *near } +// TODO: use a priority queue to reduce the number of nodes looked on static void dfs_find_nearest(BVHNearestData *data, BVHNode *node) { int i; @@ -908,20 +909,18 @@ static void dfs_find_nearest(BVHNearestData *data, BVHNode *node) if(node->totnode == 0) { if(data->callback) - sdist = data->callback(data->userdata , node->index, data->co, nearest); - - if(sdist >= data->nearest.dist) return; - - data->nearest.index = node->index; - VECCOPY(data->nearest.nearest, nearest); - data->nearest.dist = sdist; + data->callback(data->userdata , node->index, data->co, &data->nearest); + else + { + data->nearest.index = node->index; + VECCOPY(data->nearest.co, nearest); + data->nearest.dist = sdist; + } } else { for(i=0; i != node->totnode; i++) - { dfs_find_nearest(data, node->children[i]); - } } } From 4c76c57a77a2d955c53c071d2e9dee193960f7a2 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Mon, 21 Jul 2008 18:12:02 +0000 Subject: [PATCH 45/76] Made shrinkwrap modifier work when target or cutPlane are in editmode. --- source/blender/blenkernel/intern/shrinkwrap.c | 64 +++++++++++++++---- 1 file changed, 50 insertions(+), 14 deletions(-) diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 9e47dcfd056..6e48c1b2dd0 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -42,6 +42,7 @@ #include "BKE_utildefines.h" #include "BKE_deform.h" #include "BKE_cdderivedmesh.h" +#include "BKE_displist.h" #include "BKE_global.h" #include "BLI_arithb.h" @@ -90,7 +91,20 @@ typedef void ( *Shrinkwrap_ForeachVertexCallback) (DerivedMesh *target, float *c static float nearest_point_in_tri_surface(const float *point, const float *v0, const float *v1, const float *v2, float *nearest); static float ray_intersect_plane(const float *point, const float *dir, const float *plane_point, const float *plane_normal); - +/* get derived mesh */ +//TODO is anyfunction that does this? returning the derivedFinal witouth we caring if its in edit mode or not? +DerivedMesh *object_get_derived_final(Object *ob, CustomDataMask dataMask) +{ + if (ob==G.obedit) + { + DerivedMesh *final = NULL; + editmesh_get_derived_cage_and_final(&final, dataMask); + return final; + } + else + return mesh_get_derived_final(ob, dataMask); +} + /* ray - triangle */ #define ISECT_EPSILON 1e-6 static float ray_tri_intersection(const BVHTreeRay *ray, const float m_dist, const float *v0, const float *v1, const float *v2) @@ -184,8 +198,15 @@ static BVHTree* bvhtree_from_mesh_verts(DerivedMesh *mesh, float epsilon, int tr int i; int numVerts= mesh->getNumVerts(mesh); MVert *vert = mesh->getVertDataArray(mesh, CD_MVERT); + BVHTree *tree = NULL; - BVHTree *tree = BLI_bvhtree_new(numVerts, epsilon, tree_type, axis); + if(vert == NULL) + { + printf("bvhtree cant be build: cant get a vertex array"); + return NULL; + } + + tree = BLI_bvhtree_new(numVerts, epsilon, tree_type, axis); if(tree != NULL) { for(i = 0; i < numVerts; i++) @@ -206,9 +227,13 @@ static BVHTree* bvhtree_from_mesh_faces(DerivedMesh *mesh, float epsilon, int tr int numFaces= mesh->getNumFaces(mesh); MVert *vert = mesh->getVertDataArray(mesh, CD_MVERT); MFace *face = mesh->getFaceDataArray(mesh, CD_MFACE); - BVHTree *tree= NULL; + BVHTree *tree = NULL; - /* Count needed faces */ + if(vert == NULL && face == NULL) + { + printf("bvhtree cant be build: cant get a vertex/face array"); + return NULL; + } /* Create a bvh-tree of the given target */ tree = BLI_bvhtree_new(numFaces, epsilon, tree_type, axis); @@ -217,7 +242,6 @@ static BVHTree* bvhtree_from_mesh_faces(DerivedMesh *mesh, float epsilon, int tr for(i = 0; i < numFaces; i++) { float co[4][3]; - VECCOPY(co[0], vert[ face[i].v1 ].co); VECCOPY(co[1], vert[ face[i].v2 ].co); VECCOPY(co[2], vert[ face[i].v3 ].co); @@ -226,7 +250,6 @@ static BVHTree* bvhtree_from_mesh_faces(DerivedMesh *mesh, float epsilon, int tr BLI_bvhtree_insert(tree, i, co[0], face[i].v4 ? 4 : 3); } - BLI_bvhtree_balance(tree); } @@ -1141,9 +1164,15 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri return dm; } + //remove loop dependencies on derived meshs (TODO should this be done elsewhere?) + if(smd->target == ob) smd->target = NULL; + if(smd->cutPlane == ob) smd->cutPlane = NULL; + + if(smd->target) { - calc.target = (DerivedMesh *)smd->target->derivedFinal; + //TODO currently we need a copy in case object_get_derived_final returns an emDM that does not defines getVertArray or getFace array + calc.target = CDDM_copy( object_get_derived_final(smd->target, CD_MASK_BAREMESH) ); if(!calc.target) { @@ -1190,7 +1219,7 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri if(calc.moved) { //Adjust vertxs that didn't moved (project to cut plane) - shrinkwrap_projectToCutPlane(&calc); +// shrinkwrap_projectToCutPlane(&calc); //Destroy faces, edges and stuff shrinkwrap_removeUnused(&calc); @@ -1208,6 +1237,9 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri break; } + //free derived mesh + calc.target->release( calc.target ); + calc.target = NULL; } CDDM_calc_normals(calc.final); @@ -1392,7 +1424,7 @@ void shrinkwrap_calc_normal_projection_raytree(ShrinkwrapCalcData *calc) * MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE (front faces hits are ignored) * MOD_SHRINKWRAP_CULL_TARGET_BACKFACE (back faces hits are ignored) */ -static int normal_projection_project_vertex(char options, const float *vert, const float *dir,/* const */ SpaceTransform *transf, BVHTree *tree, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, BVHMeshCallbackUserdata *userdata) +static int normal_projection_project_vertex(char options, const float *vert, const float *dir, const SpaceTransform *transf, BVHTree *tree, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, BVHMeshCallbackUserdata *userdata) { float tmp_co[3], tmp_no[3]; const float *co, *no; @@ -1461,6 +1493,7 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) //cutTree + DerivedMesh * limit_mesh = NULL; BVHTree *limit_tree = NULL; BVHMeshCallbackUserdata limit_userdata; BVHTree_RayCastCallback limit_callback = NULL; @@ -1481,7 +1514,8 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) if(calc->smd->cutPlane) { - DerivedMesh * limit_mesh = (DerivedMesh *)calc->smd->cutPlane->derivedFinal; + //TODO currently we need a copy in case object_get_derived_final returns an emDM that does not defines getVertArray or getFace array + limit_mesh = CDDM_copy( object_get_derived_final(calc->smd->cutPlane, CD_MASK_BAREMESH) ); if(limit_mesh) { BENCH(limit_tree = bvhtree_from_mesh_faces(limit_mesh, 0.0, 4, 6)); @@ -1518,10 +1552,9 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) if(use_normal & MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL) { -/* + if(limit_tree) normal_projection_project_vertex(0, tmp_co, tmp_no, &local2cut, limit_tree, &hit, limit_callback, &limit_userdata); -*/ if(normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, tmp_no, &calc->local2target, tree, &hit, callback, &userdata)) moved = TRUE; @@ -1532,10 +1565,10 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) { float inv_no[3] = { -tmp_no[0], -tmp_no[1], -tmp_no[2] }; -/* + if(limit_tree) normal_projection_project_vertex(0, tmp_co, inv_no, &local2cut, limit_tree, &hit, limit_callback, &limit_userdata); -*/ + if(normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, inv_no, &calc->local2target, tree, &hit, callback, &userdata)) moved = TRUE; } @@ -1554,6 +1587,9 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) if(limit_tree) BLI_bvhtree_free(limit_tree); + + if(limit_mesh) + limit_mesh->release(limit_mesh); } /* From 3c8b695f726f1ee532219772c234e8e75436f981 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Mon, 21 Jul 2008 22:36:05 +0000 Subject: [PATCH 46/76] Fixed a bug relative to editmode.. now its calling CDDM_calc_normals when receiving a mesh to deform, since in edit mode the mesh doenst has normals calculated --- source/blender/blenkernel/intern/shrinkwrap.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 6e48c1b2dd0..0d085450bde 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -1096,7 +1096,8 @@ void shrinkwrap_projectToCutPlane(ShrinkwrapCalcData *calc_data) if(calc.smd->cutPlane) { - calc.target = (DerivedMesh *)calc.smd->cutPlane->derivedFinal; + //TODO currently we need a copy in case object_get_derived_final returns an emDM that does not defines getVertArray or getFace array + calc.target = CDDM_copy( object_get_derived_final(calc.smd->cutPlane, CD_MASK_BAREMESH) ); if(!calc.target) { @@ -1139,6 +1140,7 @@ void shrinkwrap_projectToCutPlane(ShrinkwrapCalcData *calc_data) //free memory calc.final->release(calc.final); + calc.target->release(calc.target); } } @@ -1164,6 +1166,8 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri return dm; } + CDDM_calc_normals(calc.final); //Normals maybe not be calculated yet + //remove loop dependencies on derived meshs (TODO should this be done elsewhere?) if(smd->target == ob) smd->target = NULL; if(smd->cutPlane == ob) smd->cutPlane = NULL; @@ -1219,7 +1223,7 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri if(calc.moved) { //Adjust vertxs that didn't moved (project to cut plane) -// shrinkwrap_projectToCutPlane(&calc); + shrinkwrap_projectToCutPlane(&calc); //Destroy faces, edges and stuff shrinkwrap_removeUnused(&calc); @@ -1552,9 +1556,10 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) if(use_normal & MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL) { - +/* if(limit_tree) normal_projection_project_vertex(0, tmp_co, tmp_no, &local2cut, limit_tree, &hit, limit_callback, &limit_userdata); +*/ if(normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, tmp_no, &calc->local2target, tree, &hit, callback, &userdata)) moved = TRUE; @@ -1565,10 +1570,10 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) { float inv_no[3] = { -tmp_no[0], -tmp_no[1], -tmp_no[2] }; - +/* if(limit_tree) normal_projection_project_vertex(0, tmp_co, inv_no, &local2cut, limit_tree, &hit, limit_callback, &limit_userdata); - +*/ if(normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, inv_no, &calc->local2target, tree, &hit, callback, &userdata)) moved = TRUE; } From 06f67dd53178d3729f9b30d018d1a0715287b825 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Tue, 22 Jul 2008 11:50:50 +0000 Subject: [PATCH 47/76] *BVHTreeFromMesh api changed.. it now stores all information like defaults callbacks to raycast and nearest surface (just to make it easier to use) *Fixed button size of "Above surface" --- source/blender/blenkernel/BKE_shrinkwrap.h | 38 +++++ source/blender/blenkernel/intern/shrinkwrap.c | 145 +++++++++--------- source/blender/src/buttons_editing.c | 4 +- 3 files changed, 114 insertions(+), 73 deletions(-) diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h index 296bbbaf886..f84b8fb6ec4 100644 --- a/source/blender/blenkernel/BKE_shrinkwrap.h +++ b/source/blender/blenkernel/BKE_shrinkwrap.h @@ -61,11 +61,46 @@ void space_transform_invert(const SpaceTransform *data, float *co); void space_transform_apply_normal (const SpaceTransform *data, float *co); void space_transform_invert_normal(const SpaceTransform *data, float *co); +/* BVH from mesh */ +#include "BLI_kdopbvh.h" + +struct DerivedMesh; +struct MVert; +struct MFace; + +//struct that kepts basic information about a BVHTree build from a mesh +typedef struct BVHTreeFromMesh +{ + struct BVHTree *tree; + + //Callbacks + BVHTree_NearestPointCallback nearest_callback; + BVHTree_RayCastCallback raycast_callback; + + //Mesh represented on this BVH + struct DerivedMesh *mesh; + struct MVert *vert; + struct MFace *face; + + //radius for sphere cast + float sphere_radius; + +} BVHTreeFromMesh; + +// Builds a bvh tree where nodes are the vertexs of the given mesh. And configures BVHMesh if one given. +struct BVHTree* bvhtree_from_mesh_verts(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis); + +// Builds a bvh tree where nodes are the faces of the given mesh. And configures BVHMesh if one is given. +struct BVHTree* bvhtree_from_mesh_faces(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis); + + + /* Shrinkwrap stuff */ struct Object; struct DerivedMesh; struct ShrinkwrapModifierData; +struct BVHTree; @@ -75,6 +110,9 @@ typedef struct ShrinkwrapCalcData struct Object *ob; //object we are applying shrinkwrap to struct DerivedMesh *original; //mesh before shrinkwrap (TODO clean this variable.. we don't really need it) + struct BVHTree *original_tree; //BVHTree build with the original mesh (to be used on kept volume) + struct BVHMeshCallbackUserdata *callback; + struct DerivedMesh *final; //initially a copy of original mesh.. mesh thats going to be shrinkwrapped struct DerivedMesh *target; //mesh we are shrinking to diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 0d085450bde..648071b2c9f 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -104,7 +104,7 @@ DerivedMesh *object_get_derived_final(Object *ob, CustomDataMask dataMask) else return mesh_get_derived_final(ob, dataMask); } - + /* ray - triangle */ #define ISECT_EPSILON 1e-6 static float ray_tri_intersection(const BVHTreeRay *ray, const float m_dist, const float *v0, const float *v1, const float *v2) @@ -167,39 +167,25 @@ void space_transform_invert_normal(const SpaceTransform *data, float *no) /* - * BVH tree from mesh vertices + * BVH Tree from Mesh */ -typedef struct BVHMeshCallbackUserdata -{ - //Mesh represented on this BVH - DerivedMesh *mesh; - MVert *vert; - MFace *face; - - //radius for sphere cast - float sphere_radius; - -} BVHMeshCallbackUserdata; - - -static void bvhtree_meshcallbackdata_init(BVHMeshCallbackUserdata *data, DerivedMesh *mesh, float cast_radius) -{ - data->mesh = mesh; - data->vert = mesh->getVertDataArray(mesh, CD_MVERT); - data->face = mesh->getFaceDataArray(mesh, CD_MFACE); - data->sphere_radius = cast_radius; -} +//callbacks +static void mesh_faces_nearest_point(void *userdata, int index, const float *co, BVHTreeNearest *nearest); +static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit); /* * Builds a bvh tree.. where nodes are the vertexs of the given mesh */ -static BVHTree* bvhtree_from_mesh_verts(DerivedMesh *mesh, float epsilon, int tree_type, int axis) +BVHTree* bvhtree_from_mesh_verts(BVHTreeFromMesh *data, DerivedMesh *mesh, float epsilon, int tree_type, int axis) { int i; int numVerts= mesh->getNumVerts(mesh); MVert *vert = mesh->getVertDataArray(mesh, CD_MVERT); BVHTree *tree = NULL; + if(data) + memset(data, 0, sizeof(*data)); + if(vert == NULL) { printf("bvhtree cant be build: cant get a vertex array"); @@ -213,6 +199,19 @@ static BVHTree* bvhtree_from_mesh_verts(DerivedMesh *mesh, float epsilon, int tr BLI_bvhtree_insert(tree, i, vert[i].co, 1); BLI_bvhtree_balance(tree); + + if(data) + { + data->tree = tree; + data->nearest_callback = NULL; + data->raycast_callback = NULL; + + data->mesh = mesh; + data->vert = mesh->getVertDataArray(mesh, CD_MVERT); + data->face = mesh->getFaceDataArray(mesh, CD_MFACE); + + data->sphere_radius = epsilon; + } } return tree; @@ -221,7 +220,7 @@ static BVHTree* bvhtree_from_mesh_verts(DerivedMesh *mesh, float epsilon, int tr /* * Builds a bvh tree.. where nodes are the faces of the given mesh. */ -static BVHTree* bvhtree_from_mesh_faces(DerivedMesh *mesh, float epsilon, int tree_type, int axis) +BVHTree* bvhtree_from_mesh_faces(BVHTreeFromMesh *data, DerivedMesh *mesh, float epsilon, int tree_type, int axis) { int i; int numFaces= mesh->getNumFaces(mesh); @@ -229,6 +228,9 @@ static BVHTree* bvhtree_from_mesh_faces(DerivedMesh *mesh, float epsilon, int tr MFace *face = mesh->getFaceDataArray(mesh, CD_MFACE); BVHTree *tree = NULL; + if(data) + memset(data, 0, sizeof(*data)); + if(vert == NULL && face == NULL) { printf("bvhtree cant be build: cant get a vertex/face array"); @@ -251,6 +253,19 @@ static BVHTree* bvhtree_from_mesh_faces(DerivedMesh *mesh, float epsilon, int tr BLI_bvhtree_insert(tree, i, co[0], face[i].v4 ? 4 : 3); } BLI_bvhtree_balance(tree); + + if(data) + { + data->tree = tree; + data->nearest_callback = mesh_faces_nearest_point; + data->raycast_callback = mesh_faces_spherecast; + + data->mesh = mesh; + data->vert = mesh->getVertDataArray(mesh, CD_MVERT); + data->face = mesh->getFaceDataArray(mesh, CD_MFACE); + + data->sphere_radius = epsilon; + } } return tree; @@ -262,7 +277,7 @@ static BVHTree* bvhtree_from_mesh_faces(DerivedMesh *mesh, float epsilon, int tr */ static void mesh_faces_nearest_point(void *userdata, int index, const float *co, BVHTreeNearest *nearest) { - const BVHMeshCallbackUserdata *data = (BVHMeshCallbackUserdata*) userdata; + const BVHTreeFromMesh *data = (BVHTreeFromMesh*) userdata; MVert *vert = data->vert; MFace *face = data->face + index; @@ -300,7 +315,7 @@ static void mesh_faces_nearest_point(void *userdata, int index, const float *co, */ static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) { - const BVHMeshCallbackUserdata *data = (BVHMeshCallbackUserdata*) userdata; + const BVHTreeFromMesh *data = (BVHTreeFromMesh*) userdata; MVert *vert = data->vert; MFace *face = data->face + index; @@ -1264,18 +1279,17 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); float tmp_co[3]; - BVHTree *tree = NULL; + BVHTreeFromMesh treeData; BVHTreeNearest nearest; int numVerts; MVert *vert = NULL; MDeformVert *dvert = NULL; - BENCH_VAR(query); - BENCH(tree = bvhtree_from_mesh_verts(calc->target, 0.0, 2, 6)); - if(tree == NULL) return OUT_OF_MEMORY(); + bvhtree_from_mesh_verts(&treeData, calc->target, 0.0, 2, 6); + if(treeData.tree == NULL) return OUT_OF_MEMORY(); //Setup nearest nearest.index = -1; @@ -1287,7 +1301,6 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) vert = calc->final->getVertDataArray(calc->final, CD_MVERT); dvert = calc->final->getVertDataArray(calc->final, CD_MDEFORMVERT); - BENCH_BEGIN(query); for(i=0; ismd->shrinkOpts; //setup raytracing - BVHTree *tree = NULL; + BVHTreeFromMesh treeData; BVHTreeRayHit hit; - BVHMeshCallbackUserdata userdata; - BVHTree_RayCastCallback callback = NULL; +/* //cutTree DerivedMesh * limit_mesh = NULL; - BVHTree *limit_tree = NULL; - BVHMeshCallbackUserdata limit_userdata; - BVHTree_RayCastCallback limit_callback = NULL; + BVHTreeFromMesh limitData; SpaceTransform local2cut; - +*/ int numVerts; MVert *vert = NULL; @@ -1511,26 +1518,22 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) if( (use_normal & (MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL | MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL)) == 0) return; //Nothing todo - BENCH(tree = bvhtree_from_mesh_faces(calc->target, calc->keptDist, 4, 6)); - if(tree == NULL) return OUT_OF_MEMORY(); - bvhtree_meshcallbackdata_init(&userdata, calc->target, calc->keptDist); - callback = mesh_faces_spherecast; + bvhtree_from_mesh_faces(&treeData, calc->target, calc->keptDist, 4, 6); + if(treeData.tree == NULL) return OUT_OF_MEMORY(); +/* if(calc->smd->cutPlane) { + space_transform_setup( &local2cut, calc->ob, calc->smd->cutPlane); + //TODO currently we need a copy in case object_get_derived_final returns an emDM that does not defines getVertArray or getFace array limit_mesh = CDDM_copy( object_get_derived_final(calc->smd->cutPlane, CD_MASK_BAREMESH) ); if(limit_mesh) - { - BENCH(limit_tree = bvhtree_from_mesh_faces(limit_mesh, 0.0, 4, 6)); - bvhtree_meshcallbackdata_init(&limit_userdata, limit_mesh, 0.0); - limit_callback = mesh_faces_spherecast; - - space_transform_setup( &local2cut, calc->ob, calc->smd->cutPlane); - } - else printf("CutPlane finalDerived mesh is null\n"); + bvhtree_from_mesh_faces(&limitData, limit_mesh, 0.0, 4, 6); + else + printf("CutPlane finalDerived mesh is null\n"); } - +*/ //Project each vertex along normal numVerts= calc->final->getNumVerts(calc->final); @@ -1561,7 +1564,7 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) normal_projection_project_vertex(0, tmp_co, tmp_no, &local2cut, limit_tree, &hit, limit_callback, &limit_userdata); */ - if(normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, tmp_no, &calc->local2target, tree, &hit, callback, &userdata)) + if(normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, tmp_no, &calc->local2target, treeData.tree, &hit, treeData.raycast_callback, &treeData)) moved = TRUE; } @@ -1574,27 +1577,29 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) if(limit_tree) normal_projection_project_vertex(0, tmp_co, inv_no, &local2cut, limit_tree, &hit, limit_callback, &limit_userdata); */ - if(normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, inv_no, &calc->local2target, tree, &hit, callback, &userdata)) + if(normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, inv_no, &calc->local2target, treeData.tree, &hit, treeData.raycast_callback, &treeData)) moved = TRUE; } if(hit.index != -1) { - VecLerpf(vert[i].co, vert[i].co, hit.co, weight); //linear interpolation + VecLerpf(vert[i].co, vert[i].co, hit.co, weight); if(moved && calc->moved) bitset_set(calc->moved, i); } } - BLI_bvhtree_free(tree); + BLI_bvhtree_free(treeData.tree); - if(limit_tree) - BLI_bvhtree_free(limit_tree); +/* + if(limitData.tree) + BLI_bvhtree_free(limitData.tree); if(limit_mesh) limit_mesh->release(limit_mesh); +*/ } /* @@ -1609,9 +1614,8 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); float tmp_co[3]; - BVHTree *tree = NULL; - BVHTreeNearest nearest; - BVHMeshCallbackUserdata userdata; + BVHTreeFromMesh treeData; + BVHTreeNearest nearest; int numVerts; MVert *vert = NULL; @@ -1619,9 +1623,8 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) //Create a bvh-tree of the given target - BENCH( tree = bvhtree_from_mesh_faces(calc->target, 0.0, 2, 6) ); - if(tree == NULL) return OUT_OF_MEMORY(); - bvhtree_meshcallbackdata_init(&userdata, calc->target, 0.0); + bvhtree_from_mesh_faces( &treeData, calc->target, 0.0, 2, 6); + if(treeData.tree == NULL) return OUT_OF_MEMORY(); //Setup nearest nearest.index = -1; @@ -1648,7 +1651,7 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) } else nearest.dist = FLT_MAX; - index = BLI_bvhtree_find_nearest(tree, tmp_co, &nearest, mesh_faces_nearest_point, &userdata); + index = BLI_bvhtree_find_nearest(treeData.tree, tmp_co, &nearest, treeData.nearest_callback, &treeData); if(index != -1) { @@ -1666,6 +1669,6 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) } } - BLI_bvhtree_free(tree); + BLI_bvhtree_free(treeData.tree); } diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 404da946a5a..235463d5a75 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -2548,10 +2548,10 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco uiDefButBitS(block, TOG, MOD_SHRINKWRAP_CULL_TARGET_BACKFACE, B_MODIFIER_RECALC, "Cull backfaces", lx+buttonWidth/2,cy,buttonWidth/2,19, &smd->shrinkOpts, 0, 0, 0, 0, "Controls whether a vertex can be projected to a back face on target"); uiDefButF(block, NUM, B_MODIFIER_RECALC, "Merge Dist:", lx,(cy-=19),buttonWidth,19, &smd->mergeDist, 0.0f, 0.01f, 0.01f, 0.01f, "Specify merge distance"); - uiDefIDPoinBut(block, modifier_testMeshObj, ID_OB, B_CHANGEDEP, "Cut: ", lx, (cy-=19), buttonWidth,19, &smd->cutPlane, "Target to project points that didn't got projected over target"); + uiDefIDPoinBut(block, modifier_testMeshObj, ID_OB, B_CHANGEDEP, "Ob2: ", lx, (cy-=19), buttonWidth,19, &smd->cutPlane, "Target to project points that didn't got projected over target"); } else if (smd->shrinkType == MOD_SHRINKWRAP_NEAREST_SURFACE){ - uiDefButBitS(block, TOG, MOD_SHRINKWRAP_KEPT_ABOVE_SURFACE, B_MODIFIER_RECALC, "Above surface", lx,(cy-=19),buttonWidth/2,19, &smd->shrinkOpts, 0, 0, 0, 0, "Vertices are kept on the front side of faces"); + uiDefButBitS(block, TOG, MOD_SHRINKWRAP_KEPT_ABOVE_SURFACE, B_MODIFIER_RECALC, "Above surface", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Vertices are kept on the front side of faces"); } but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &smd->vgroup_name, 0, 31, 0, 0, "Vertex Group name"); From aec6b78deda32d7aa1631ec76efda5bcea83a8c9 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Tue, 22 Jul 2008 12:02:57 +0000 Subject: [PATCH 48/76] svn merge -r 15590:15688 https://svn.blender.org/svnroot/bf-blender/trunk/blender --- source/blender/blenkernel/BKE_global.h | 2 + source/blender/blenkernel/intern/collision.c | 3 + source/blender/blenkernel/intern/lattice.c | 5 +- .../blenkernel/intern/particle_system.c | 5 +- source/blender/blenlib/intern/arithb.c | 1 + source/blender/blenloader/intern/readfile.c | 64 +- source/blender/blenloader/intern/writefile.c | 34 +- source/blender/include/BDR_drawaction.h | 3 + source/blender/include/BDR_gpencil.h | 76 + source/blender/include/BIF_drawgpencil.h | 44 + source/blender/include/BIF_editaction.h | 28 +- source/blender/include/BIF_space.h | 8 +- source/blender/include/BSE_editaction_types.h | 6 +- source/blender/include/transform.h | 1 + source/blender/makesdna/DNA_action_types.h | 20 +- source/blender/makesdna/DNA_gpencil_types.h | 141 ++ source/blender/makesdna/DNA_space_types.h | 8 + source/blender/makesdna/DNA_view3d_types.h | 15 +- source/blender/makesdna/intern/makesdna.c | 2 + source/blender/python/api2_2x/Blender.c | 2 +- source/blender/python/api2_2x/Library.c | 69 + source/blender/python/api2_2x/Particle.c | 468 ++++-- source/blender/python/api2_2x/doc/LibData.py | 42 +- source/blender/python/api2_2x/doc/Particle.py | 229 +-- source/blender/python/api2_2x/doc/Render.py | 4 +- source/blender/python/api2_2x/sceneRender.c | 2 +- .../blender/render/intern/source/rendercore.c | 27 +- .../render/intern/source/shadeoutput.c | 2 + source/blender/src/drawaction.c | 124 +- source/blender/src/drawgpencil.c | 653 +++++++++ source/blender/src/drawnode.c | 77 + source/blender/src/drawobject.c | 5 + source/blender/src/drawseq.c | 97 +- source/blender/src/drawview.c | 80 +- source/blender/src/editaction.c | 396 ++++- source/blender/src/editaction_gpencil.c | 549 +++++++ source/blender/src/editmesh.c | 11 +- source/blender/src/editnode.c | 37 +- source/blender/src/editobject.c | 1 + source/blender/src/gpencil.c | 1290 +++++++++++++++++ source/blender/src/header_action.c | 379 +++-- source/blender/src/header_node.c | 10 + source/blender/src/header_seq.c | 13 +- source/blender/src/header_view3d.c | 4 + source/blender/src/interface.c | 7 +- source/blender/src/space.c | 39 +- source/blender/src/transform_conversions.c | 223 ++- source/blender/src/transform_generics.c | 9 + source/blender/src/usiblender.c | 2 +- .../BlenderRoutines/KX_BlenderCanvas.cpp | 12 + .../BlenderRoutines/KX_BlenderCanvas.h | 5 + .../Converter/BL_BlenderDataConversion.cpp | 243 +++- .../Converter/BL_DeformableGameObject.h | 1 + .../gameengine/Converter/BL_ShapeDeformer.cpp | 7 + .../gameengine/Converter/BL_SkinDeformer.cpp | 48 +- source/gameengine/Converter/BL_SkinDeformer.h | 6 +- .../Converter/KX_ConvertActuators.cpp | 2 +- .../gameengine/GameLogic/SCA_ILogicBrick.cpp | 5 +- source/gameengine/GameLogic/SCA_ILogicBrick.h | 3 + source/gameengine/GameLogic/SCA_IObject.cpp | 2 +- .../GameLogic/SCA_PropertyActuator.cpp | 33 +- .../GameLogic/SCA_PropertyActuator.h | 8 +- .../gameengine/GamePlayer/common/GPC_Canvas.h | 6 + .../Ketsji/KX_BulletPhysicsController.cpp | 40 +- .../Ketsji/KX_BulletPhysicsController.h | 9 +- .../gameengine/Ketsji/KX_CameraActuator.cpp | 62 +- source/gameengine/Ketsji/KX_CameraActuator.h | 8 +- .../Ketsji/KX_ConstraintActuator.cpp | 6 +- source/gameengine/Ketsji/KX_GameObject.cpp | 86 +- source/gameengine/Ketsji/KX_GameObject.h | 10 + .../gameengine/Ketsji/KX_IPhysicsController.h | 5 +- .../Ketsji/KX_OdePhysicsController.cpp | 5 +- .../Ketsji/KX_OdePhysicsController.h | 4 +- .../gameengine/Ketsji/KX_ParentActuator.cpp | 51 +- source/gameengine/Ketsji/KX_ParentActuator.h | 7 +- source/gameengine/Ketsji/KX_RadarSensor.cpp | 11 +- .../Ketsji/KX_SCA_AddObjectActuator.cpp | 11 + .../Ketsji/KX_SCA_AddObjectActuator.h | 3 + source/gameengine/Ketsji/KX_Scene.cpp | 283 +++- source/gameengine/Ketsji/KX_Scene.h | 16 + source/gameengine/Ketsji/KX_SceneActuator.cpp | 45 +- source/gameengine/Ketsji/KX_SceneActuator.h | 3 + .../Ketsji/KX_SumoPhysicsController.cpp | 5 +- .../Ketsji/KX_SumoPhysicsController.h | 4 +- .../gameengine/Ketsji/KX_TrackToActuator.cpp | 12 + source/gameengine/Ketsji/KX_TrackToActuator.h | 1 + .../Physics/Bullet/CcdPhysicsController.cpp | 34 +- .../Physics/Bullet/CcdPhysicsController.h | 5 +- .../Physics/Bullet/CcdPhysicsEnvironment.cpp | 32 + .../Physics/Bullet/CcdPhysicsEnvironment.h | 9 + source/gameengine/PyDoc/KX_GameObject.py | 12 + .../Rasterizer/RAS_2DFilterManager.cpp | 25 +- .../Rasterizer/RAS_2DFilterManager.h | 2 +- source/gameengine/Rasterizer/RAS_ICanvas.h | 8 + source/gameengine/SceneGraph/SG_IObject.cpp | 6 +- source/gameengine/SceneGraph/SG_IObject.h | 2 +- source/gameengine/SceneGraph/SG_Node.cpp | 29 +- source/gameengine/SceneGraph/SG_Node.h | 2 +- 98 files changed, 5733 insertions(+), 818 deletions(-) create mode 100644 source/blender/include/BDR_gpencil.h create mode 100644 source/blender/include/BIF_drawgpencil.h create mode 100644 source/blender/makesdna/DNA_gpencil_types.h create mode 100644 source/blender/src/drawgpencil.c create mode 100644 source/blender/src/editaction_gpencil.c create mode 100644 source/blender/src/gpencil.c diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h index 62289d227c7..8c9634cba06 100644 --- a/source/blender/blenkernel/BKE_global.h +++ b/source/blender/blenkernel/BKE_global.h @@ -175,6 +175,7 @@ typedef struct Global { #define G_WEIGHTPAINT (1 << 15) #define G_TEXTUREPAINT (1 << 16) /* #define G_NOFROZEN (1 << 17) also removed */ +#define G_GREASEPENCIL (1 << 17) #define G_DRAWEDGES (1 << 18) #define G_DRAWCREASES (1 << 19) #define G_DRAWSEAMS (1 << 20) @@ -265,3 +266,4 @@ extern Global G; #endif + diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index 26c5d186d87..6dfb77504fb 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -1437,6 +1437,9 @@ CollisionModifierData **get_collisionobjects(Object *self, int *numcollobj) if(coll_ob == self) continue; + + if( !collmd->bvhtree) + continue; if(numobj >= maxobj) { diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c index e8bcae42d5a..54915058bab 100644 --- a/source/blender/blenkernel/intern/lattice.c +++ b/source/blender/blenkernel/intern/lattice.c @@ -915,7 +915,10 @@ void lattice_calc_modifiers(Object *ob) mti->deformVerts(md, ob, NULL, vertexCos, numVerts); } - if (vertexCos) { + /* always displist to make this work like derivedmesh */ + if (!vertexCos) vertexCos = lattice_getVertexCos(ob, &numVerts); + + { DispList *dl = MEM_callocN(sizeof(*dl), "lt_dl"); dl->type = DL_VERTS; dl->parts = 1; diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index f70648965f4..7dca87d5c13 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -2797,7 +2797,10 @@ void do_effectors(int pa_no, ParticleData *pa, ParticleKey *state, Object *ob, P epart= epsys->part; pd= epart->pd; totepart= epsys->totpart; - + + if(totepart <= 0) + continue; + if(pd->forcefield==PFIELD_HARMONIC){ /* every particle is mapped to only one harmonic effector particle */ p= pa_no%epsys->totpart; diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index dd9c76d9172..a31c769a5b3 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -59,6 +59,7 @@ /* A few small defines. Keep'em local! */ #define SMALL_NUMBER 1.e-8 +#define CLAMP(a, b, c) if((a)<(b)) (a)=(b); else if((a)>(c)) (a)=(c) #if defined(WIN32) || defined(__APPLE__) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 3c629818b2d..090b1d7c6b6 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -69,6 +69,7 @@ #include "DNA_effect_types.h" #include "DNA_fileglobal_types.h" #include "DNA_group_types.h" +#include "DNA_gpencil_types.h" #include "DNA_ipo_types.h" #include "DNA_image_types.h" #include "DNA_key_types.h" @@ -3698,6 +3699,32 @@ static void lib_link_screen_sequence_ipos(Main *main) /* ************ READ SCREEN ***************** */ +/* relinks grease-pencil data for 3d-view(s) - used for direct_link */ +static void link_gpencil(FileData *fd, bGPdata *gpd) +{ + bGPDlayer *gpl; + bGPDframe *gpf; + bGPDstroke *gps; + + /* relink layers */ + link_list(fd, &gpd->layers); + + for (gpl= gpd->layers.first; gpl; gpl= gpl->next) { + /* relink frames */ + link_list(fd, &gpl->frames); + gpl->actframe= newdataadr(fd, gpl->actframe); + + for (gpf= gpl->frames.first; gpf; gpf= gpf->next) { + /* relink strokes (and their points) */ + link_list(fd, &gpf->strokes); + + for (gps= gpf->strokes.first; gps; gps= gps->next) { + gps->points= newdataadr(fd, gps->points); + } + } + } +} + /* note: file read without screens option G_FILE_NO_UI; check lib pointers in call below */ static void lib_link_screen(FileData *fd, Main *main) @@ -3709,23 +3736,23 @@ static void lib_link_screen(FileData *fd, Main *main) if(sc->id.flag & LIB_NEEDLINK) { sc->id.us= 1; sc->scene= newlibadr(fd, sc->id.lib, sc->scene); - + sa= sc->areabase.first; while(sa) { SpaceLink *sl; - + sa->full= newlibadr(fd, sc->id.lib, sa->full); - + /* space handler scriptlinks */ lib_link_scriptlink(fd, &sc->id, &sa->scriptlink); - + for (sl= sa->spacedata.first; sl; sl= sl->next) { if(sl->spacetype==SPACE_VIEW3D) { View3D *v3d= (View3D*) sl; - + v3d->camera= newlibadr(fd, sc->id.lib, v3d->camera); v3d->ob_centre= newlibadr(fd, sc->id.lib, v3d->ob_centre); - + if(v3d->bgpic) { v3d->bgpic->ima= newlibadr_us(fd, sc->id.lib, v3d->bgpic->ima); } @@ -4081,6 +4108,10 @@ static void direct_link_screen(FileData *fd, bScreen *sc) v3d->bgpic= newdataadr(fd, v3d->bgpic); if(v3d->bgpic) v3d->bgpic->iuser.ok= 1; + if(v3d->gpd) { + v3d->gpd= newdataadr(fd, v3d->gpd); + link_gpencil(fd, v3d->gpd); + } v3d->localvd= newdataadr(fd, v3d->localvd); v3d->afterdraw.first= v3d->afterdraw.last= NULL; v3d->clipbb= newdataadr(fd, v3d->clipbb); @@ -4115,9 +4146,30 @@ static void direct_link_screen(FileData *fd, bScreen *sc) } else if(sl->spacetype==SPACE_NODE) { SpaceNode *snode= (SpaceNode *)sl; + + if(snode->gpd) { + snode->gpd= newdataadr(fd, snode->gpd); + link_gpencil(fd, snode->gpd); + } snode->nodetree= snode->edittree= NULL; snode->flag |= SNODE_DO_PREVIEW; } + else if(sl->spacetype==SPACE_SEQ) { + SpaceSeq *sseq= (SpaceSeq *)sl; + if(sseq->gpd) { + sseq->gpd= newdataadr(fd, sseq->gpd); + link_gpencil(fd, sseq->gpd); + } + } + else if(sl->spacetype==SPACE_ACTION) { + SpaceAction *sact= (SpaceAction *)sl; + + /* WARNING: action-editor doesn't have it's own gpencil data! + * so only adjust pointer, but DON'T LINK + */ + if (sact->gpd) + sact->gpd= newdataadr(fd, sact->gpd); + } } sa->v1= newdataadr(fd, sa->v1); diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index ca91f1dc346..b59dd851dfe 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -112,6 +112,7 @@ Important to know is that 'streaming' has been added to files, for Blender Publi #include "DNA_customdata_types.h" #include "DNA_effect_types.h" #include "DNA_group_types.h" +#include "DNA_gpencil_types.h" #include "DNA_image_types.h" #include "DNA_ipo_types.h" #include "DNA_fileglobal_types.h" @@ -1565,6 +1566,32 @@ static void write_scenes(WriteData *wd, ListBase *scebase) mywrite(wd, MYWRITE_FLUSH, 0); } +static void write_gpencil(WriteData *wd, bGPdata *gpd) +{ + bGPDlayer *gpl; + bGPDframe *gpf; + bGPDstroke *gps; + + /* write gpd data block to file */ + writestruct(wd, DATA, "bGPdata", 1, gpd); + + /* write grease-pencil layers to file */ + for (gpl= gpd->layers.first; gpl; gpl= gpl->next) { + writestruct(wd, DATA, "bGPDlayer", 1, gpl); + + /* write this layer's frames to file */ + for (gpf= gpl->frames.first; gpf; gpf= gpf->next) { + writestruct(wd, DATA, "bGPDframe", 1, gpf); + + /* write strokes */ + for (gps= gpf->strokes.first; gps; gps= gps->next) { + writestruct(wd, DATA, "bGPDstroke", 1, gps); + writestruct(wd, DATA, "bGPDspoint", gps->totpoints, gps->points); + } + } + } +} + static void write_screens(WriteData *wd, ListBase *scrbase) { bScreen *sc; @@ -1610,11 +1637,12 @@ static void write_screens(WriteData *wd, ListBase *scrbase) sl= sa->spacedata.first; while(sl) { if(sl->spacetype==SPACE_VIEW3D) { - View3D *v3d= (View3D*) sl; + View3D *v3d= (View3D *) sl; writestruct(wd, DATA, "View3D", 1, v3d); if(v3d->bgpic) writestruct(wd, DATA, "BGpic", 1, v3d->bgpic); if(v3d->localvd) writestruct(wd, DATA, "View3D", 1, v3d->localvd); if(v3d->clipbb) writestruct(wd, DATA, "BoundBox", 1, v3d->clipbb); + if(v3d->gpd) write_gpencil(wd, v3d->gpd); } else if(sl->spacetype==SPACE_IPO) { writestruct(wd, DATA, "SpaceIpo", 1, sl); @@ -1626,7 +1654,9 @@ static void write_screens(WriteData *wd, ListBase *scrbase) writestruct(wd, DATA, "SpaceFile", 1, sl); } else if(sl->spacetype==SPACE_SEQ) { + SpaceSeq *sseq= (SpaceSeq *)sl; writestruct(wd, DATA, "SpaceSeq", 1, sl); + if(sseq->gpd) write_gpencil(wd, sseq->gpd); } else if(sl->spacetype==SPACE_OOPS) { SpaceOops *so= (SpaceOops *)sl; @@ -1689,7 +1719,9 @@ static void write_screens(WriteData *wd, ListBase *scrbase) writestruct(wd, DATA, "SpaceTime", 1, sl); } else if(sl->spacetype==SPACE_NODE){ + SpaceNode *snode= (SpaceNode *)sl; writestruct(wd, DATA, "SpaceNode", 1, sl); + if(snode->gpd) write_gpencil(wd, snode->gpd); } sl= sl->next; } diff --git a/source/blender/include/BDR_drawaction.h b/source/blender/include/BDR_drawaction.h index 91635123cb7..7cb0768e832 100644 --- a/source/blender/include/BDR_drawaction.h +++ b/source/blender/include/BDR_drawaction.h @@ -38,6 +38,7 @@ struct bAction; struct bActionGroup; struct Object; struct ListBase; +struct bGPDlayer; /* ****************************** Base Structs ****************************** */ @@ -82,6 +83,7 @@ void draw_ipo_channel(struct gla2DDrawInfo *di, struct Ipo *ipo, float ypos); void draw_agroup_channel(struct gla2DDrawInfo *di, struct bActionGroup *agrp, float ypos); void draw_action_channel(struct gla2DDrawInfo *di, struct bAction *act, float ypos); void draw_object_channel(struct gla2DDrawInfo *di, struct Object *ob, float ypos); +void draw_gpl_channel(struct gla2DDrawInfo *di, struct bGPDlayer *gpl, float ypos); /* Keydata Generation */ void icu_to_keylist(struct IpoCurve *icu, ListBase *keys, ListBase *blocks, ActKeysInc *aki); @@ -89,6 +91,7 @@ void ipo_to_keylist(struct Ipo *ipo, ListBase *keys, ListBase *blocks, ActKeysIn void agroup_to_keylist(struct bActionGroup *agrp, ListBase *keys, ListBase *blocks, ActKeysInc *aki); void action_to_keylist(struct bAction *act, ListBase *keys, ListBase *blocks, ActKeysInc *aki); void ob_to_keylist(struct Object *ob, ListBase *keys, ListBase *blocks, ActKeysInc *aki); +void gpl_to_keylist(struct bGPDlayer *gpl, ListBase *keys, ListBase *blocks, ActKeysInc *aki); #endif /* BDR_DRAWACTION_H */ diff --git a/source/blender/include/BDR_gpencil.h b/source/blender/include/BDR_gpencil.h new file mode 100644 index 00000000000..d0ebd096ecb --- /dev/null +++ b/source/blender/include/BDR_gpencil.h @@ -0,0 +1,76 @@ +/** + * $Id: BDR_gpencil.h 14444 2008-04-16 22:40:48Z aligorith $ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2008, Blender Foundation + * This is a new part of Blender + * + * Contributor(s): Joshua Leung + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef BDR_GPENCIL_H +#define BDR_GPENCIL_H + +struct ListBase; +struct bScreen; +struct ScrArea; +struct View3D; +struct SpaceNode; +struct SpaceSeq; +struct bGPdata; +struct bGPDlayer; +struct bGPDframe; + +/* ------------ Grease-Pencil API ------------------ */ + +void free_gpencil_strokes(struct bGPDframe *gpf); +void free_gpencil_frames(struct bGPDlayer *gpl); +void free_gpencil_layers(struct ListBase *list); +void free_gpencil_data(struct bGPdata *gpd); + +struct bGPDframe *gpencil_frame_addnew(struct bGPDlayer *gpl, int cframe); +struct bGPDlayer *gpencil_layer_addnew(struct bGPdata *gpd); +struct bGPdata *gpencil_data_addnew(void); + +struct bGPdata *gpencil_data_duplicate(struct bGPdata *gpd); + +struct bGPdata *gpencil_data_getactive(struct ScrArea *sa); +short gpencil_data_setactive(struct ScrArea *sa, struct bGPdata *gpd); +struct bGPdata *gpencil_data_getetime(struct bScreen *sc); +void gpencil_data_setetime(struct bScreen *sc, struct bGPdata *gpd); + +void gpencil_frame_delete_laststroke(struct bGPDframe *gpf); + +struct bGPDframe *gpencil_layer_getframe(struct bGPDlayer *gpl, int cframe, short addnew); +void gpencil_layer_delframe(struct bGPDlayer *gpl, struct bGPDframe *gpf); +struct bGPDlayer *gpencil_layer_getactive(struct bGPdata *gpd); +void gpencil_layer_setactive(struct bGPdata *gpd, struct bGPDlayer *active); +void gpencil_layer_delactive(struct bGPdata *gpd); + +void gpencil_delete_actframe(struct bGPdata *gpd); +void gpencil_delete_laststroke(struct bGPdata *gpd); + +void gpencil_delete_operation(short mode); +void gpencil_delete_menu(void); + +//short gpencil_paint(short mousebutton); +short gpencil_do_paint(struct ScrArea *sa); + +#endif /* BDR_GPENCIL_H */ diff --git a/source/blender/include/BIF_drawgpencil.h b/source/blender/include/BIF_drawgpencil.h new file mode 100644 index 00000000000..418446313df --- /dev/null +++ b/source/blender/include/BIF_drawgpencil.h @@ -0,0 +1,44 @@ +/** + * $Id: BIF_drawgpencil.h 14444 2008-04-16 22:40:48Z aligorith $ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2008, Blender Foundation + * This is a new part of Blender + * + * Contributor(s): Joshua Leung + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef BIF_DRAWGPENCIL_H +#define BIF_DRAWGPENCIL_H + +struct ScrArea; +struct View3D; +struct SpaceNode; +struct SpaceSeq; +struct bGPdata; +struct uiBlock; + +short draw_gpencil_panel(struct uiBlock *block, struct bGPdata *gpd, struct ScrArea *sa); + +void draw_gpencil_2dview(struct ScrArea *sa, short onlyv2d); +void draw_gpencil_3dview(struct ScrArea *sa, short only3d); +void draw_gpencil_oglrender(struct View3D *v3d, int winx, int winy); + +#endif /* BIF_DRAWGPENCIL_H */ diff --git a/source/blender/include/BIF_editaction.h b/source/blender/include/BIF_editaction.h index 7e0f703681b..9f6751daeff 100644 --- a/source/blender/include/BIF_editaction.h +++ b/source/blender/include/BIF_editaction.h @@ -48,7 +48,8 @@ enum { ACTTYPE_FILLIPO, ACTTYPE_FILLCON, ACTTYPE_IPO, - ACTTYPE_SHAPEKEY + ACTTYPE_SHAPEKEY, + ACTTYPE_GPLAYER }; /* Macros for easier/more consistant state testing */ @@ -69,7 +70,10 @@ enum { #define EDITABLE_ICU(icu) ((icu->flag & IPO_PROTECT)==0) #define SEL_ICU(icu) (icu->flag & IPO_SELECT) -#define NLA_ACTION_SCALED (G.saction->pin==0 && OBACT && OBACT->action) +#define EDITABLE_GPL(gpl) ((gpl->flag & GP_LAYER_LOCKED)==0) +#define SEL_GPL(gpl) ((gpl->flag & GP_LAYER_ACTIVE) || (gpl->flag & GP_LAYER_SELECT)) + +#define NLA_ACTION_SCALED (G.saction->mode==SACTCONT_ACTION && G.saction->pin==0 && OBACT && OBACT->action) #define NLA_IPO_SCALED (OBACT && OBACT->action && G.sipo->pin==0 && G.sipo->actname) /* constants for setting ipo-interpolation type */ @@ -114,6 +118,8 @@ struct BWinEvent; struct Key; struct ListBase; struct TimeMarker; +struct bGPdata; +struct bGPDlayer; /* Key operations */ void transform_action_keys(int mode, int dummy); @@ -176,6 +182,24 @@ void action_add_localmarker(struct bAction *act, int frame); void action_rename_localmarker(struct bAction *act); void action_remove_localmarkers(struct bAction *act); +/* Grease-Pencil Data */ +void gplayer_make_cfra_list(struct bGPDlayer *gpl, ListBase *elems, short onlysel); + +void deselect_gpencil_layers(struct bGPdata *gpd, short select_mode); + +short is_gplayer_frame_selected(struct bGPDlayer *gpl); +void set_gplayer_frame_selection(struct bGPDlayer *gpl, short mode); +void select_gpencil_frames(struct bGPDlayer *gpl, short select_mode); +void select_gpencil_frame(struct bGPDlayer *gpl, int selx, short select_mode); +void borderselect_gplayer_frames(struct bGPDlayer *gpl, float min, float max, short select_mode); + +void delete_gpencil_layers(void); +void delete_gplayer_frames(struct bGPDlayer *gpl); +void duplicate_gplayer_frames(struct bGPDlayer *gpd); + +void snap_gplayer_frames(struct bGPDlayer *gpl, short mode); +void mirror_gplayer_frames(struct bGPDlayer *gpl, short mode); + /* ShapeKey stuff */ struct Key *get_action_mesh_key(void); int get_nearest_key_num(struct Key *key, short *mval, float *x); diff --git a/source/blender/include/BIF_space.h b/source/blender/include/BIF_space.h index 37be4a9eafc..4b2b8e14bb6 100644 --- a/source/blender/include/BIF_space.h +++ b/source/blender/include/BIF_space.h @@ -53,6 +53,7 @@ struct SpaceOops; #define VIEW3D_HANDLER_PREVIEW 4 #define VIEW3D_HANDLER_MULTIRES 5 #define VIEW3D_HANDLER_TRANSFORM 6 +#define VIEW3D_HANDLER_GREASEPENCIL 7 /* ipo handler codes */ #define IPO_HANDLER_PROPERTIES 20 @@ -73,11 +74,15 @@ struct SpaceOops; #define NLA_HANDLER_PROPERTIES 50 /* sequence handler codes */ -#define SEQ_HANDLER_PROPERTIES 60 +#define SEQ_HANDLER_PROPERTIES 60 +#define SEQ_HANDLER_GREASEPENCIL 61 /* imasel handler codes */ #define IMASEL_HANDLER_IMAGE 70 +/* nodes handler codes */ +#define NODES_HANDLER_GREASEPENCIL 80 + /* theme codes */ #define B_ADD_THEME 3301 #define B_DEL_THEME 3302 @@ -145,3 +150,4 @@ extern void mainwindow_close(void); #endif + diff --git a/source/blender/include/BSE_editaction_types.h b/source/blender/include/BSE_editaction_types.h index c531383accc..be210415973 100644 --- a/source/blender/include/BSE_editaction_types.h +++ b/source/blender/include/BSE_editaction_types.h @@ -38,7 +38,8 @@ typedef enum ALE_KEYTYPE { ALE_NONE = 0, ALE_IPO, ALE_ICU, - ALE_GROUP + ALE_GROUP, + ALE_GPFRAME, } ALE_KEYTYPE; /* This struct defines a structure used for quick access */ @@ -78,7 +79,8 @@ typedef enum ACTFILTER_FLAGS { typedef enum ACTCONT_TYPES { ACTCONT_NONE = 0, ACTCONT_ACTION, - ACTCONT_SHAPEKEY + ACTCONT_SHAPEKEY, + ACTCONT_GPENCIL } ACTCONT_TYPES; #endif diff --git a/source/blender/include/transform.h b/source/blender/include/transform.h index 4e3b80134f9..720b856a149 100644 --- a/source/blender/include/transform.h +++ b/source/blender/include/transform.h @@ -397,6 +397,7 @@ int Align(TransInfo *t, short mval[2]); /*********************** transform_conversions.c ********** */ struct ListBase; +void flushTransGPactionData(TransInfo *t); void flushTransIpoData(TransInfo *t); void flushTransUVs(TransInfo *t); void flushTransParticles(TransInfo *t); diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index 18d2a1cb6f3..d7969a7379b 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -32,6 +32,7 @@ #include "DNA_listBase.h" #include "DNA_ID.h" +#include "DNA_gpencil_types.h" #include "DNA_view2d_types.h" #include "DNA_userdef_types.h" @@ -183,8 +184,11 @@ typedef struct SpaceAction { View2D v2d; bAction *action; /* the currently active action */ - short flag, autosnap; /* flag: bitmapped settings; autosnap: automatic keyframe snapping mode */ - short pin, actnr, lock; /* pin: keep showing current action; actnr: used for finding chosen action from menu; lock: lock time to other windows */ + bGPdata *gpd; /* the currently active gpencil block (for editing) */ + + char mode, autosnap; /* mode: editing context; autosnap: automatic keyframe snapping mode */ + short flag, actnr; /* flag: bitmapped settings; */ + short pin, lock; /* pin: keep showing current action; actnr: used for finding chosen action from menu; lock: lock time to other windows */ short actwidth; /* width of the left-hand side name panel (in pixels?) */ float timeslide; /* for Time-Slide transform mode drawing - current frame? */ } SpaceAction; @@ -238,6 +242,18 @@ typedef enum SACTION_FLAG { SACTION_NODRAWGCOLORS = (1<<7) } SACTION_FLAG; +/* SpaceAction Mode Settings */ +typedef enum SACTCONT_MODES { + /* action (default) */ + SACTCONT_ACTION = 0, + /* editing of shapekey's IPO block */ + SACTCONT_SHAPEKEY, + /* editing of gpencil data */ + SACTCONT_GPENCIL, + /* dopesheet (unimplemented... future idea?) */ + SACTCONT_DOPESHEET +} SACTCONTEXT_MODES; + /* SpaceAction AutoSnap Settings (also used by SpaceNLA) */ typedef enum SACTSNAP_MODES { /* no auto-snap */ diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h new file mode 100644 index 00000000000..eafd886981b --- /dev/null +++ b/source/blender/makesdna/DNA_gpencil_types.h @@ -0,0 +1,141 @@ +/** + * $Id: DNA_gpencil_types.h 8768 2006-11-07 00:10:37Z aligorith $ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2008, Blender Foundation. + * This is a new part of Blender + * + * Contributor(s): Joshua Leung + * + * ***** END GPL LICENSE BLOCK ***** + */ +#ifndef DNA_GPENCIL_TYPES_H +#define DNA_GPENCIL_TYPES_H + +#include "DNA_listBase.h" +#include "DNA_ID.h" + +/* Grease-Pencil Annotations - 'Stroke Point' + * -> Coordinates may either be 2d or 3d depending on settings at the time + * -> Coordinates of point on stroke, in proportions of window size + * (i.e. n/1000). This assumes that the bottom-left corner is (0,0) + */ +typedef struct bGPDspoint { + float x, y, z; /* co-ordinates of point (usually 2d, but can be 3d as well) */ + float pressure; /* pressure of input device (from 0 to 1) at this point */ +} bGPDspoint; + +/* Grease-Pencil Annotations - 'Stroke' + * -> A stroke represents a (simplified version) of the curve + * drawn by the user in one 'mousedown'->'mouseup' operation + */ +typedef struct bGPDstroke { + struct bGPDstroke *next, *prev; + + bGPDspoint *points; /* array of data-points for stroke */ + int totpoints; /* number of data-points in array */ + + short thickness; /* thickness of stroke (currently not used) */ + short flag; /* various settings about this stroke */ +} bGPDstroke; + +/* bGPDstroke->flag */ + /* stroke is in 3d-space */ +#define GP_STROKE_3DSPACE (1<<0) + /* stroke is in 2d-space */ +#define GP_STROKE_2DSPACE (1<<1) + + +/* Grease-Pencil Annotations - 'Frame' + * -> Acts as storage for the 'image' formed by strokes + */ +typedef struct bGPDframe { + struct bGPDframe *next, *prev; + + ListBase strokes; /* list of the simplified 'strokes' that make up the frame's data */ + + int framenum; /* frame number of this frame */ + int flag; /* temp settings */ +} bGPDframe; + +/* bGPDframe->flag */ + /* frame is being painted on */ +#define GP_FRAME_PAINT (1<<0) + /* for editing in Action Editor */ +#define GP_FRAME_SELECT (1<<1) + + +/* Grease-Pencil Annotations - 'Layer' */ +typedef struct bGPDlayer { + struct bGPDlayer *next, *prev; + + ListBase frames; /* list of annotations to display for frames (bGPDframe list) */ + bGPDframe *actframe; /* active frame (should be the frame that is currently being displayed) */ + + int flag; /* settings for layer */ + short thickness; /* current thickness to apply to strokes */ + short gstep; /* max number of frames between active and ghost to show (0=only those on either side) */ + + float color[4]; /* color that should be used to draw all the strokes in this layer */ + + char info[128]; /* optional reference info about this layer (i.e. "director's comments, 12/3") */ +} bGPDlayer; + +/* bGPDlayer->flag */ + /* don't display layer */ +#define GP_LAYER_HIDE (1<<0) + /* protected from further editing */ +#define GP_LAYER_LOCKED (1<<1) + /* layer is 'active' layer being edited */ +#define GP_LAYER_ACTIVE (1<<2) + /* draw points of stroke for debugging purposes */ +#define GP_LAYER_DRAWDEBUG (1<<3) + /* do onionskinning */ +#define GP_LAYER_ONIONSKIN (1<<4) + /* for editing in Action Editor */ +#define GP_LAYER_SELECT (1<<5) + + +/* Grease-Pencil Annotations - 'DataBlock' */ +typedef struct bGPdata { + /* saved Grease-Pencil data */ + ListBase layers; /* bGPDlayers */ + int flag; /* settings for this datablock */ + + /* not-saved stroke buffer data (only used during paint-session) + * - buffer must be initialised before use, but freed after + * whole paint operation is over + */ + short sbuffer_size; /* number of elements currently in cache */ + short sbuffer_sflag; /* flags for stroke that cache represents */ + bGPDspoint *sbuffer; /* stroke buffer (can hold GP_STROKE_BUFFER_MAX) */ +} bGPdata; + +/* bGPdata->flag */ + /* draw this datablock's data (not used) */ +#define GP_DATA_DISP (1<<0) + /* show debugging info in viewport (i.e. status print) */ +#define GP_DATA_DISPINFO (1<<1) + /* is the block being shown in Action Editor */ +#define GP_DATA_EDITTIME (1<<2) + /* is the block overriding all clicks? */ +#define GP_DATA_EDITPAINT (1<<3) + /* new strokes are added in viewport space */ +#define GP_DATA_VIEWALIGN (1<<4) + +#endif /* DNA_GPENCIL_TYPES_H */ diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index bc30a12ff27..a8694dfb7f5 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -50,6 +50,7 @@ struct RenderInfo; struct bNodeTree; struct uiBlock; struct FileList; +struct bGPdata; /** * The base structure all the other spaces @@ -150,6 +151,8 @@ typedef struct SpaceSeq { short zebra; int flag; float zoom; + + struct bGPdata *gpd; /* grease-pencil data */ } SpaceSeq; typedef struct SpaceFile { @@ -339,6 +342,8 @@ typedef struct SpaceNode { float blockscale; struct ScrArea *area; + short blockhandler[8]; + View2D v2d; struct ID *id, *from; /* context, no need to save in file? well... pinning... */ @@ -351,11 +356,13 @@ typedef struct SpaceNode { struct bNodeTree *nodetree, *edittree; int treetype, pad; /* treetype: as same nodetree->type */ + struct bGPdata *gpd; /* grease-pencil data */ } SpaceNode; /* snode->flag */ #define SNODE_DO_PREVIEW 1 #define SNODE_BACKDRAW 2 +#define SNODE_DISPGP 4 typedef struct SpaceImaSel { SpaceLink *next, *prev; @@ -657,6 +664,7 @@ typedef struct SpaceImaSel { #define SEQ_MARKER_TRANS 2 #define SEQ_DRAW_COLOR_SEPERATED 4 #define SEQ_DRAW_SAFE_MARGINS 8 +#define SEQ_DRAW_GPENCIL 16 /* space types, moved from DNA_screen_types.h */ enum { diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index c21d629be83..135272b9ac2 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -40,6 +40,7 @@ struct Base; struct BoundBox; struct RenderInfo; struct RetopoViewData; +struct bGPdata; /* This is needed to not let VC choke on near and far... old * proprietary MS extensions... */ @@ -53,9 +54,12 @@ struct RetopoViewData; #include "DNA_listBase.h" #include "DNA_image_types.h" +/* ******************************** */ + /* The near/far thing is a Win EXCEPTION. Thus, leave near/far in the * code, and patch for windows. */ - + +/* Background Picture in 3D-View */ typedef struct BGpic { struct Image *ima; struct ImageUser iuser; @@ -63,6 +67,9 @@ typedef struct BGpic { short xim, yim; } BGpic; +/* ********************************* */ + +/* 3D ViewPort Struct */ typedef struct View3D { struct SpaceLink *next, *prev; int spacetype; @@ -135,9 +142,10 @@ typedef struct View3D { char ndoffilter; /*filter for 6DOF devices 0 normal, 1 dominant */ void *properties_storage; /* Nkey panel stores stuff here, not in file */ - + struct bGPdata *gpd; /* Grease-Pencil Data (annotation layers) */ } View3D; + /* View3D->flag (short) */ #define V3D_MODE (16+32+64+128+256+512) #define V3D_DISPIMAGE 1 @@ -158,10 +166,12 @@ typedef struct View3D { #define V3D_DRAW_CENTERS 32768 /* View3d->flag2 (short) */ +#define V3D_MODE2 (32) #define V3D_OPP_DIRECTION_NAME 1 #define V3D_FLYMODE 2 #define V3D_DEPRECATED 4 /* V3D_TRANSFORM_SNAP, moved to a scene setting */ #define V3D_SOLID_TEX 8 +#define V3D_DISPGP 16 /* View3D->around */ #define V3D_CENTER 0 @@ -203,3 +213,4 @@ typedef struct View3D { #endif + diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index 83f4e633fa1..3818d66b39c 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -126,6 +126,7 @@ char *includefiles[] = { "DNA_customdata_types.h", "DNA_particle_types.h", "DNA_cloth_types.h", + "DNA_gpencil_types.h", // if you add files here, please add them at the end // of makesdna.c (this file) as well @@ -1147,4 +1148,5 @@ int main(int argc, char ** argv) #include "DNA_customdata_types.h" #include "DNA_particle_types.h" #include "DNA_cloth_types.h" +#include "DNA_gpencil_types.h" /* end of list */ diff --git a/source/blender/python/api2_2x/Blender.c b/source/blender/python/api2_2x/Blender.c index d8385c1d660..420d292cdce 100644 --- a/source/blender/python/api2_2x/Blender.c +++ b/source/blender/python/api2_2x/Blender.c @@ -708,7 +708,7 @@ static PyObject *Blender_Save( PyObject * self, PyObject * args ) "expected filename and optional int (overwrite flag) as arguments" ); for( li = G.main->library.first; li; li = li->id.next ) { - if( BLI_streq( li->name, fname ) ) { + if( li->parent==NULL && BLI_streq( li->name, fname ) ) { return EXPP_ReturnPyObjError( PyExc_AttributeError, "cannot overwrite used library" ); } diff --git a/source/blender/python/api2_2x/Library.c b/source/blender/python/api2_2x/Library.c index 799735c2062..468263c4208 100644 --- a/source/blender/python/api2_2x/Library.c +++ b/source/blender/python/api2_2x/Library.c @@ -1135,9 +1135,78 @@ static PyObject *M_Library_Load(PyObject *self, PyObject * args) return (PyObject *)lib; } +static PyObject *M_Library_GetPaths(PyObject *self, PyObject * args) +{ + PyObject *list; + PyObject *name; + int type=0; + Library *lib; + + if( !PyArg_ParseTuple( args, "|i", &type ) || type < 0 || type > 2 ) { + return EXPP_ReturnPyObjError( PyExc_TypeError, + "expected an int between 0 and 2." ); + } + + list = PyList_New(0); + + for(lib= G.main->library.first; lib; lib= lib->id.next) { + if (type==0) { + /* any type is ok */ + } else if (type==1 && lib->parent == 0) { + /* only direct linked */ + } else if (type==2 && lib->parent != 0) { + /* only indirect */ + } else { + continue; /* incompatible type */ + } + + name = PyString_FromString(lib->name); + PyList_Append(list, name); + Py_DECREF(name); + } + return list; +} + +static PyObject *M_Library_ReplacePath(PyObject *self, PyObject * args) +{ + char *name_from, *name_to; + Library *lib; + + if( !PyArg_ParseTuple( args, "ss", &name_from, &name_to )) { + return EXPP_ReturnPyObjError( PyExc_TypeError, + "expected the name of a library path" ); + } + + for(lib= G.main->library.first; lib; lib= lib->id.next) { + if (strcmp(lib->name, name_from)==0) { + if (lib->parent) { + return EXPP_ReturnPyObjError( PyExc_RuntimeError, + "path is indirectly linked, cannot be changed." ); + } + + if (strlen(name_to) > sizeof(lib->name)) { + return EXPP_ReturnPyObjError( PyExc_RuntimeError, + "string length too long, cannot set path." ); + } + + strcpy(lib->name, name_to); + Py_RETURN_NONE; + } + } + + return EXPP_ReturnPyObjError( PyExc_ValueError, + "path given does not exist as a library" ); +} + + + static struct PyMethodDef M_Library_methods[] = { {"load", (PyCFunction)M_Library_Load, METH_VARARGS, "(string) - declare a .blend file for use as a library"}, + {"paths", (PyCFunction)M_Library_GetPaths, METH_VARARGS, + "(type) - return a list of library paths, type 0 for all, 1 only direct links, 2 only indirect links"}, + {"replace", (PyCFunction)M_Library_ReplacePath, METH_VARARGS, + "(from, to) - replace the path of an existing, directly linked library."}, {NULL, NULL, 0, NULL} }; diff --git a/source/blender/python/api2_2x/Particle.c b/source/blender/python/api2_2x/Particle.c index 95de9757b87..2c2e724129e 100644 --- a/source/blender/python/api2_2x/Particle.c +++ b/source/blender/python/api2_2x/Particle.c @@ -40,6 +40,7 @@ #include "BKE_material.h" #include "BKE_utildefines.h" #include "BKE_pointcache.h" +#include "BKE_DerivedMesh.h" #include "BIF_editparticle.h" #include "BIF_space.h" #include "blendef.h" @@ -799,22 +800,27 @@ static PyObject *Part_freeEdit( BPy_PartSys * self, PyObject * args ){ Py_RETURN_NONE; } -static PyObject *Part_GetLoc( BPy_PartSys * self, PyObject * args ){ +static PyObject *Part_GetLoc( BPy_PartSys * self, PyObject * args ) +{ ParticleSystem *psys = 0L; Object *ob = 0L; PyObject *partlist,*seglist; - PyObject* loc = 0L; ParticleCacheKey **cache,*path; + PyObject* loc = 0L; ParticleKey state; - float cfra=bsystem_time(ob,(float)CFRA,0.0); + DerivedMesh* dm; + float cfra; int i,j,k; + float vm[4][4],wm[4][4]; int childexists = 0; int all = 0; int id = 0; + cfra = bsystem_time(ob,(float)CFRA,0.0); + if( !PyArg_ParseTuple( args, "|ii", &all,&id ) ) return EXPP_ReturnPyObjError( PyExc_TypeError, - "expected one optional integer as argument" ); + "expected two optional integers as arguments" ); psys = self->psys; ob = self->object; @@ -822,88 +828,118 @@ static PyObject *Part_GetLoc( BPy_PartSys * self, PyObject * args ){ if (!ob || !psys) Py_RETURN_NONE; - if (psys->part->type == 2){ - cache=psys->pathcache; + G.rendering = 1; - /* little hack to calculate hair steps in render mode */ - psys->renderdata = (void*)(int)1; + /* Just to create a valid rendering context */ + psys_render_set(ob,psys,vm,wm,0,0,0); - psys_cache_paths(ob, psys, cfra, 1); + dm = mesh_create_derived_render(ob,CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL); + dm->release(dm); - psys->renderdata = NULL; + if ( !psys_check_enabled(ob,psys) ){ + G.rendering = 0; + psys_render_restore(ob,psys); + Particle_Recalc(self,1); + Py_RETURN_NONE; + } - partlist = PyList_New( 0 ); - if( !partlist ) - return EXPP_ReturnPyObjError( PyExc_MemoryError, "PyList() failed" ); + partlist = PyList_New( 0 ); + if( !partlist ){ + PyErr_SetString( PyExc_MemoryError, "PyList_New() failed" ); + goto error; + } - for(i = 0; i < psys->totpart; i++){ - path=cache[i]; - seglist = PyList_New( 0 ); - k = path->steps+1; - for( j = 0; j < k ; j++){ - loc = PyTuple_New(3); + if (psys->part->type == PART_HAIR){ + cache = psys->pathcache; - PyTuple_SetItem(loc,0,PyFloat_FromDouble((double)path->co[0])); - PyTuple_SetItem(loc,1,PyFloat_FromDouble((double)path->co[1])); - PyTuple_SetItem(loc,2,PyFloat_FromDouble((double)path->co[2])); + if ( ((self->psys->part->draw & PART_DRAW_PARENT) && (self->psys->part->childtype != 0)) || (self->psys->part->childtype == 0) ){ - if ( (PyList_Append(seglist,loc) < 0) ){ - Py_DECREF(seglist); - Py_DECREF(partlist); - Py_XDECREF(loc); - return EXPP_ReturnPyObjError( PyExc_RuntimeError, - "Couldn't append item to PyList" ); + for(i = 0; i < psys->totpart; i++){ + seglist = PyList_New( 0 ); + if (!seglist){ + PyErr_SetString( PyExc_MemoryError, + "PyList_New() failed" ); + goto error; } - Py_DECREF(loc); /* PyList_Append increfs */ - path++; - } - if ( PyList_Append(partlist,seglist) < 0 ){ - Py_DECREF(seglist); - Py_DECREF(partlist); - return EXPP_ReturnPyObjError( PyExc_RuntimeError, - "Couldn't append item to PyList" ); + path=cache[i]; + k = path->steps+1; + for( j = 0; j < k ; j++, path++){ + loc = Py_BuildValue("(fff)",(double)path->co[0], + (double)path->co[1], (double)path->co[2]); + + if (!loc){ + PyErr_SetString( PyExc_RuntimeError, + "Couldn't build tuple" ); + goto error; + } + + if ( (PyList_Append(seglist,loc) < 0) ){ + PyErr_SetString( PyExc_RuntimeError, + "Couldn't append item to PyList" ); + goto error; + } + Py_DECREF(loc); /* PyList_Append increfs */ + loc = NULL; + } + + if ( PyList_Append(partlist,seglist) < 0 ){ + PyErr_SetString( PyExc_RuntimeError, + "Couldn't append item to PyList" ); + goto error; + } + Py_DECREF(seglist); /* PyList_Append increfs */ + seglist = NULL; } - Py_DECREF(seglist); /* PyList_Append increfs */ } cache=psys->childcache; for(i = 0; i < psys->totchild; i++){ - path=cache[i]; seglist = PyList_New( 0 ); - k = path->steps+1; - for( j = 0; j < k ; j++){ - loc = PyTuple_New(3); + if (!seglist){ + PyErr_SetString( PyExc_MemoryError, + "PyList_New() failed" ); + goto error; + } - PyTuple_SetItem(loc,0,PyFloat_FromDouble((double)path->co[0])); - PyTuple_SetItem(loc,1,PyFloat_FromDouble((double)path->co[1])); - PyTuple_SetItem(loc,2,PyFloat_FromDouble((double)path->co[2])); + path=cache[i]; + k = path->steps+1; + for( j = 0; j < k ; j++, path++ ){ + loc = Py_BuildValue("(fff)",(double)path->co[0], + (double)path->co[1], (double)path->co[2]); + + if (!loc){ + PyErr_SetString( PyExc_RuntimeError, + "Couldn't build tuple" ); + goto error; + } if ( PyList_Append(seglist,loc) < 0){ - Py_DECREF(partlist); - Py_XDECREF(loc); - return EXPP_ReturnPyObjError( PyExc_RuntimeError, + PyErr_SetString( PyExc_RuntimeError, "Couldn't append item to PyList" ); + goto error; } Py_DECREF(loc);/* PyList_Append increfs */ - path++; + loc = NULL; } if ( PyList_Append(partlist,seglist) < 0){ - Py_DECREF(partlist); - Py_XDECREF(loc); - return EXPP_ReturnPyObjError( PyExc_RuntimeError, + PyErr_SetString( PyExc_RuntimeError, "Couldn't append item to PyList" ); + goto error; } Py_DECREF(seglist); /* PyList_Append increfs */ + seglist = NULL; } - } else { int init; - partlist = PyList_New( 0 ); - if( !partlist ) - return EXPP_ReturnPyObjError( PyExc_MemoryError, "PyList() failed" ); + char *fmt = NULL; + + if(id) + fmt = "(fffi)"; + else + fmt = "(fff)"; if (psys->totchild > 0 && !(psys->part->draw & PART_DRAW_PARENT)) childexists = 1; @@ -919,55 +955,67 @@ static PyObject *Part_GetLoc( BPy_PartSys * self, PyObject * args ){ init = 1; if (init){ - if (!id) - loc = PyTuple_New(3); - else - loc = PyTuple_New(4); - PyTuple_SetItem(loc,0,PyFloat_FromDouble((double)state.co[0])); - PyTuple_SetItem(loc,1,PyFloat_FromDouble((double)state.co[1])); - PyTuple_SetItem(loc,2,PyFloat_FromDouble((double)state.co[2])); - if (id) - PyTuple_SetItem(loc,3,PyInt_FromLong(i)); + loc = Py_BuildValue(fmt,(double)state.co[0], + (double)state.co[1], (double)state.co[2],i); + + if (!loc){ + PyErr_SetString( PyExc_RuntimeError, + "Couldn't build tuple" ); + goto error; + } if ( PyList_Append(partlist,loc) < 0 ){ - Py_DECREF(partlist); - Py_XDECREF(loc); - return EXPP_ReturnPyObjError( PyExc_RuntimeError, - "Couldn't append item to PyList" ); + PyErr_SetString( PyExc_RuntimeError, + "Couldn't append item to PyList" ); + goto error; } - Py_DECREF(loc);/* PyList_Append increfs */ - } - else { - if ( all ){ - if ( PyList_Append(partlist,Py_None) < 0 ){ - Py_DECREF(partlist); - return EXPP_ReturnPyObjError( PyExc_RuntimeError, - "Couldn't append item to PyList" ); - } - Py_DECREF(Py_None); /* PyList_Append increfs */ + Py_DECREF(loc); + loc = NULL; + } else { + if ( all && PyList_Append(partlist,Py_None) < 0 ){ + PyErr_SetString( PyExc_RuntimeError, + "Couldn't append item to PyList" ); + goto error; } } } } + + psys_render_restore(ob,psys); + G.rendering = 0; + Particle_Recalc(self,1); return partlist; + +error: + Py_XDECREF(partlist); + Py_XDECREF(seglist); + Py_XDECREF(loc); + psys_render_restore(ob,psys); + G.rendering = 0; + Particle_Recalc(self,1); + return NULL; } -static PyObject *Part_GetRot( BPy_PartSys * self, PyObject * args ){ +static PyObject *Part_GetRot( BPy_PartSys * self, PyObject * args ) +{ ParticleSystem *psys = 0L; Object *ob = 0L; PyObject *partlist = 0L; PyObject* loc = 0L; ParticleKey state; + DerivedMesh* dm; + float vm[4][4],wm[4][4]; int i; int childexists = 0; int all = 0; int id = 0; + char *fmt = NULL; float cfra=bsystem_time(ob,(float)CFRA,0.0); if( !PyArg_ParseTuple( args, "|ii", &all, &id ) ) return EXPP_ReturnPyObjError( PyExc_TypeError, - "expected one optional integer as argument" ); + "expected two optional integers as arguments" ); psys = self->psys; ob = self->object; @@ -975,63 +1023,105 @@ static PyObject *Part_GetRot( BPy_PartSys * self, PyObject * args ){ if (!ob || !psys) Py_RETURN_NONE; - if (psys->part->type != 2){ + G.rendering = 1; + + /* Just to create a valid rendering context */ + psys_render_set(ob,psys,vm,wm,0,0,0); + + dm = mesh_create_derived_render(ob,CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL); + dm->release(dm); + + if ( !psys_check_enabled(ob,psys) ){ + G.rendering = 0; + psys_render_restore(ob,psys); + Particle_Recalc(self,1); + Py_RETURN_NONE; + } + + if (psys->part->type != PART_HAIR){ partlist = PyList_New( 0 ); + if( !partlist ){ + PyErr_SetString( PyExc_MemoryError, "PyList_New() failed" ); + goto error; + } + if (psys->totchild > 0 && !(psys->part->draw & PART_DRAW_PARENT)) childexists = 1; + if(id) + fmt = "(ffffi)"; + else + fmt = "(ffff)"; + for (i = 0; i < psys->totpart + psys->totchild; i++){ if (childexists && (i < psys->totpart)) continue; state.time = cfra; if(psys_get_particle_state(ob,psys,i,&state,0)==0){ - if ( all ){ - PyList_Append(partlist,Py_None); - Py_DECREF(Py_None); /* PyList_Append increfs */ - continue; - } else { - continue; + if ( all && PyList_Append(partlist,Py_None) < 0){ + PyErr_SetString( PyExc_RuntimeError, + "Couldn't append item to PyList" ); + goto error; } + } else { + loc = Py_BuildValue(fmt,(double)state.rot[0], (double)state.rot[1], + (double)state.rot[2], (double)state.rot[3], i); + + if (!loc){ + PyErr_SetString( PyExc_RuntimeError, + "Couldn't build tuple" ); + goto error; + } + if (PyList_Append(partlist,loc) < 0){ + PyErr_SetString ( PyExc_RuntimeError, + "Couldn't append item to PyList" ); + goto error; + } + Py_DECREF(loc); /* PyList_Append increfs */ + loc = NULL; } - if (!id) - loc = PyTuple_New(4); - else - loc = PyTuple_New(5); - PyTuple_SetItem(loc,0,PyFloat_FromDouble((double)state.rot[0])); - PyTuple_SetItem(loc,1,PyFloat_FromDouble((double)state.rot[1])); - PyTuple_SetItem(loc,2,PyFloat_FromDouble((double)state.rot[2])); - PyTuple_SetItem(loc,3,PyFloat_FromDouble((double)state.rot[3])); - if (id) - PyTuple_SetItem(loc,4,PyInt_FromLong(i)); - PyList_Append(partlist,loc); - Py_DECREF(loc); /* PyList_Append increfs */ } + } else { + partlist = EXPP_incr_ret( Py_None ); } + + psys_render_restore(ob,psys); + G.rendering = 0; + Particle_Recalc(self,1); return partlist; + +error: + Py_XDECREF(partlist); + Py_XDECREF(loc); + psys_render_restore(ob,psys); + G.rendering = 0; + Particle_Recalc(self,1); + return NULL; } -static PyObject *Part_GetSize( BPy_PartSys * self, PyObject * args ){ +static PyObject *Part_GetSize( BPy_PartSys * self, PyObject * args ) +{ ParticleKey state; ParticleSystem *psys = 0L; ParticleData *data; Object *ob = 0L; PyObject *partlist,*tuple; - PyObject* siz = 0L; + DerivedMesh* dm; + float vm[4][4],wm[4][4]; float size; int i; int childexists = 0; int all = 0; int id = 0; + char *fmt = NULL; float cfra=bsystem_time(ob,(float)CFRA,0.0); if( !PyArg_ParseTuple( args, "|ii", &all, &id ) ) return EXPP_ReturnPyObjError( PyExc_TypeError, - "expected one optional integer as argument" ); - - data = self->psys->particles; + "expected two optional integers as arguments" ); psys = self->psys; ob = self->object; @@ -1039,13 +1129,39 @@ static PyObject *Part_GetSize( BPy_PartSys * self, PyObject * args ){ if (!ob || !psys) Py_RETURN_NONE; - partlist = PyList_New( 0 ); + G.rendering = 1; - if (psys->totchild > 0 && !(psys->part->draw & PART_DRAW_PARENT)) - childexists = 1; + /* Just to create a valid rendering context */ + psys_render_set(ob,psys,vm,wm,0,0,0); - for (i = 0; i < psys->totpart + psys->totchild; i++, data++){ - if (psys->part->type != 2){ + dm = mesh_create_derived_render(ob,CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL); + dm->release(dm); + data = self->psys->particles; + + if ( !psys_check_enabled(ob,psys) ){ + psys_render_restore(ob,psys); + G.rendering = 0; + Particle_Recalc(self,1); + Py_RETURN_NONE; + } + + partlist = PyList_New( 0 ); + + if( !partlist ){ + PyErr_SetString( PyExc_MemoryError, "PyList_New() failed" ); + goto error; + } + + if (psys->totchild > 0 && !(psys->part->draw & PART_DRAW_PARENT)) + childexists = 1; + + if(id) + fmt = "(fi)"; + else + fmt = "f"; + + for (i = 0; i < psys->totpart + psys->totchild; i++, data++){ + if (psys->part->type != PART_HAIR){ if (childexists && (i < psys->totpart)) continue; @@ -1061,43 +1177,61 @@ static PyObject *Part_GetSize( BPy_PartSys * self, PyObject * args ){ ChildParticle *cpa= &psys->child[i-psys->totpart]; size = psys_get_child_size(psys,cpa,cfra,0); } - if (id){ - tuple = PyTuple_New(2); - PyTuple_SetItem(tuple,0,PyFloat_FromDouble((double)size)); - PyTuple_SetItem(tuple,1,PyInt_FromLong(i)); - PyList_Append(partlist,tuple); - Py_DECREF(tuple); - } else { - siz = PyFloat_FromDouble((double)size); - PyList_Append(partlist,siz); - Py_DECREF(siz); + + tuple = Py_BuildValue(fmt,(double)size,i); + + if (!tuple){ + PyErr_SetString( PyExc_RuntimeError, + "Couldn't build tuple" ); + goto error; } + + if (PyList_Append(partlist,tuple) < 0){ + PyErr_SetString( PyExc_RuntimeError, + "Couldn't append item to PyList" ); + goto error; + } + Py_DECREF(tuple); + tuple = NULL; } } + + psys_render_restore(ob,psys); + G.rendering = 0; + Particle_Recalc(self,1); return partlist; + +error: + Py_XDECREF(partlist); + Py_XDECREF(tuple); + psys_render_restore(ob,psys); + G.rendering = 0; + Particle_Recalc(self,1); + return NULL; } -static PyObject *Part_GetAge( BPy_PartSys * self, PyObject * args ){ +static PyObject *Part_GetAge( BPy_PartSys * self, PyObject * args ) +{ ParticleKey state; ParticleSystem *psys = 0L; ParticleData *data; Object *ob = 0L; PyObject *partlist,*tuple; - PyObject* lif = 0L; + DerivedMesh* dm; + float vm[4][4],wm[4][4]; float life; int i; int childexists = 0; int all = 0; int id = 0; + char *fmt = NULL; float cfra=bsystem_time(ob,(float)CFRA,0.0); if( !PyArg_ParseTuple( args, "|ii", &all, &id ) ) return EXPP_ReturnPyObjError( PyExc_TypeError, - "expected one optional integer as argument" ); - - data = self->psys->particles; + "expected two optional integers as arguments" ); psys = self->psys; ob = self->object; @@ -1105,13 +1239,37 @@ static PyObject *Part_GetAge( BPy_PartSys * self, PyObject * args ){ if (!ob || !psys) Py_RETURN_NONE; - partlist = PyList_New( 0 ); + G.rendering = 1; - if (psys->totchild > 0 && !(psys->part->draw & PART_DRAW_PARENT)) - childexists = 1; + /* Just to create a valid rendering context */ + psys_render_set(ob,psys,vm,wm,0,0,0); - for (i = 0; i < psys->totpart + psys->totchild; i++, data++){ - if (psys->part->type != 2){ + dm = mesh_create_derived_render(ob,CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL); + dm->release(dm); + data = self->psys->particles; + + if ( !psys_check_enabled(ob,psys) ){ + psys_render_restore(ob,psys); + G.rendering = 0; + Py_RETURN_NONE; + } + + partlist = PyList_New( 0 ); + if( !partlist ){ + PyErr_SetString( PyExc_MemoryError, "PyList_New() failed" ); + goto error; + } + + if (psys->totchild > 0 && !(psys->part->draw & PART_DRAW_PARENT)) + childexists = 1; + + if(id) + fmt = "(fi)"; + else + fmt = "f"; + + for (i = 0; i < psys->totpart + psys->totchild; i++, data++){ + if (psys->part->type != PART_HAIR){ if (childexists && (i < psys->totpart)) continue; @@ -1128,20 +1286,37 @@ static PyObject *Part_GetAge( BPy_PartSys * self, PyObject * args ){ ChildParticle *cpa= &psys->child[i-psys->totpart]; life = psys_get_child_time(psys,cpa,cfra); } - if (id){ - tuple = PyTuple_New(2); - PyTuple_SetItem(tuple,0,PyFloat_FromDouble((double)life)); - PyTuple_SetItem(tuple,1,PyInt_FromLong(i)); - PyList_Append(partlist,tuple); - Py_DECREF(tuple); - } else { - lif = PyFloat_FromDouble((double)life); - PyList_Append(partlist,lif); - Py_DECREF(lif); + + tuple = Py_BuildValue(fmt,(double)life,i); + + if (!tuple){ + PyErr_SetString( PyExc_RuntimeError, + "Couldn't build tuple" ); + goto error; } + + if (PyList_Append(partlist,tuple) < 0){ + PyErr_SetString( PyExc_RuntimeError, + "Couldn't append item to PyList" ); + goto error; + } + Py_DECREF(tuple); + tuple = NULL; } } + + psys_render_restore(ob,psys); + G.rendering = 0; + Particle_Recalc(self,1); return partlist; + +error: + Py_XDECREF(partlist); + Py_XDECREF(tuple); + psys_render_restore(ob,psys); + G.rendering = 0; + Particle_Recalc(self,1); + return NULL; } @@ -1376,11 +1551,8 @@ static int Part_set2d( BPy_PartSys * self, PyObject * args ) { int number; - if( !PyInt_Check( args ) ) { - char errstr[128]; - sprintf ( errstr, "expected int argument" ); - return EXPP_ReturnIntError( PyExc_TypeError, errstr ); - } + if( !PyInt_Check( args ) ) + return EXPP_ReturnIntError( PyExc_TypeError, "expected int argument" ); number = PyInt_AS_LONG( args ); @@ -1526,7 +1698,7 @@ static int Part_setRandEmission( BPy_PartSys * self, PyObject * args ) static PyObject *Part_getRandEmission( BPy_PartSys * self ) { - return PyInt_FromLong( ((long)( self->psys->part->flag & PART_BOIDS_2D )) > 0 ); + return PyInt_FromLong( ((long)( self->psys->part->flag & PART_TRAND )) > 0 ); } static int Part_setParticleDist( BPy_PartSys * self, PyObject * args ) @@ -1546,7 +1718,7 @@ static int Part_setParticleDist( BPy_PartSys * self, PyObject * args ) return EXPP_ReturnIntError( PyExc_TypeError, errstr ); } - self->psys->part->from = number; + self->psys->part->from = (short)number; Particle_RecalcPsys_distr(self,1); @@ -1603,7 +1775,7 @@ static int Part_setDist( BPy_PartSys * self, PyObject * args ) return EXPP_ReturnIntError( PyExc_TypeError, errstr ); } - self->psys->part->distr = number; + self->psys->part->distr = (short)number; Particle_RecalcPsys_distr(self,1); @@ -1731,7 +1903,7 @@ static int Part_setTargetPsys( BPy_PartSys * self, PyObject * args ){ res = EXPP_setIValueRange( args, &self->psys->target_psys, 0, tottpsys, 'h' ); - if((psys=psys_get_current(ob))){ + if( ( psys = psys_get_current(ob) ) ){ if(psys->keyed_ob==ob || psys->target_ob==ob){ if(psys->keyed_ob==ob) psys->keyed_ob=NULL; diff --git a/source/blender/python/api2_2x/doc/LibData.py b/source/blender/python/api2_2x/doc/LibData.py index 47bd7fdb763..daa6a186531 100644 --- a/source/blender/python/api2_2x/doc/LibData.py +++ b/source/blender/python/api2_2x/doc/LibData.py @@ -27,17 +27,37 @@ Example:: """ def load(filename,relative=False): - """ - Select an existing .blend file for use as a library. Unlike the - Library module, multiple libraries can be defined at the same time. - - @type filename: string - @param filename: The filename of a Blender file. Filenames starting with "//" will be loaded relative to the blend file's location. - @type relative: boolean - @param relative: Convert relative paths to absolute paths (default). Setting this parameter to True will leave paths relative. - @rtype: Library - @return: return a L{Library} object. - """ + """ + Select an existing .blend file for use as a library. Unlike the + Library module, multiple libraries can be defined at the same time. + + @type filename: string + @param filename: The filename of a Blender file. Filenames starting with "//" will be loaded relative to the blend file's location. + @type relative: boolean + @param relative: Convert relative paths to absolute paths (default). Setting this parameter to True will leave paths relative. + @rtype: Library + @return: return a L{Library} object. + """ + +def paths(link=0): + """ + Returns a list of paths used in the current blend file. + + @type link: int + @param link: 0 (default if no args given) for all library paths, 1 for directly linked library paths only, 2 for indirectly linked library paths only. + @rtype: List + @return: return a list of path strings. + """ + +def replace(pathFrom, pathTo): + """ + Replaces an existing directly linked path. + + @type pathFrom: string + @param pathFrom: An existing library path. + @type pathTo: string + @param pathTo: A new library path. + """ class Libraries: """ diff --git a/source/blender/python/api2_2x/doc/Particle.py b/source/blender/python/api2_2x/doc/Particle.py index 192ecd5355b..511ad81b45f 100644 --- a/source/blender/python/api2_2x/doc/Particle.py +++ b/source/blender/python/api2_2x/doc/Particle.py @@ -56,17 +56,17 @@ class Particle: @type type: int @ivar resolutionGrid: The resolution of the particle grid. @type resolutionGrid: int - @ivar startFrame: Frame # to start emitting particles. + @ivar startFrame: Frame number to start emitting particles. @type startFrame: float - @ivar endFrame: Frame # to stop emitting particles. + @ivar endFrame: Frame number to stop emitting particles. @type endFrame: float @ivar editable: Finalize hair to enable editing in particle mode. @type editable: int @ivar amount: The total number of particles. @type amount: int - @ivar multireact: React multiple times ( Paricle.REACTON[ 'NEAR' | 'COLLISION' | 'DEATH' ] ). + @ivar multireact: React multiple times ( Particle.REACTON[ 'NEAR' | 'COLLISION' | 'DEATH' ] ). @type multireact: int - @ivar reactshape: Power of reaction strength dependence on distance to target. + @ivar reactshape: Power of reaction strength, dependent on distance to target. @type reactshape: float @ivar hairSegments: Amount of hair segments. @type hairSegments: int @@ -74,13 +74,13 @@ class Particle: @type lifetime: float @ivar randlife: Give the particle life a random variation. @type randlife: float - @ivar randemission: Give the particle life a random variation + @ivar randemission: Emit particles in random order. @type randemission: int - @ivar particleDistribution: Where to emit particles from Paricle.EMITFROM[ 'PARTICLE' | 'VOLUME' | 'FACES' | 'VERTS' ] ) + @ivar particleDistribution: Where to emit particles from ( Particle.EMITFROM[ 'PARTICLE' | 'VOLUME' | 'FACES' | 'VERTS' ] ) @type particleDistribution: int @ivar evenDistribution: Use even distribution from faces based on face areas or edge lengths. @type evenDistribution: int - @ivar distribution: How to distribute particles on selected element Paricle.DISTRIBUTION[ 'GRID' | 'RANDOM' | 'JITTERED' ] ). + @ivar distribution: How to distribute particles on selected element ( Particle.DISTRIBUTION[ 'GRID' | 'RANDOM' | 'JITTERED' ] ). @type distribution: int @ivar jitterAmount: Amount of jitter applied to the sampling. @type jitterAmount: float @@ -131,237 +131,56 @@ class Particle: Get the particles locations. A list of tuple is returned in particle mode. A list of list of tuple is returned in hair mode. - The tuple is a vector list of 3 or 4 floats in world space (x,y,z, optionnaly the particle's id). + The tuple is a vector of 3 or 4 floats in world space (x,y,z, +optionally the particle's id). @type all: int @param all: if not 0 export all particles (uninitialized (unborn or died)particles exported as None). @type id: int @param id: add the particle id in the end of the vector tuple - @rtype: list of vectors (tuple of 3 floats and optionnaly the id) or list of list of vectors - @return: list of vectors or list of list of vectors (hair mode) + @rtype: list of vectors (tuple of 3 floats and optionally the id) or list of list of vectors + @return: list of vectors or list of list of vectors (hair mode) or None if system is disabled """ def getRot(all=0,id=0): """ - Get the particles rotations as quaternion. + Get the particles' rotations as quaternion. A list of tuple is returned in particle mode. - The tuple is a vector list of 4 or 5 floats (x,y,z,w, optionnaly the id of the particle). + The tuple is vector of 4 or 5 floats (x,y,z,w, optionally the id of the particle). @type all: int - @param all: if not 0 export all particles (uninitialized (unborn or died) particles exported as None). + @param all: if not 0, export all particles (uninitialized (unborn or died) particles exported as None). @type id: int @param id: add the particle id in the return tuple @rtype: list of tuple of 4 or 5 elements (if id is not zero) - @return: list of 4-tuples + @return: list of 4-tuples or None if system is disabled """ def getMat(): """ - Get the particles material. + Get the particles' material. @rtype: Blender Material - @return: The marterial assigned to particles + @return: The material assigned to particles """ def getSize(all=0,id=0): """ - Get the particles size. + Get the particles' size. A list of float or list of tuple (particle's size,particle's id). @type all: int - @param all: if not 0 export all particles (uninitialized (unborn or died) particles exported as None). + @param all: if not 0, export all particles (uninitialized (unborn or died) particles exported as None). @type id: int @param id: add the particle id in the return tuple @rtype: list of floats - @return: list of floats or list of tuples if id is not zero (size,id). + @return: list of floats or list of tuples if id is not zero (size,id) or None if system is disabled. """ def getAge(all=0,id=0): """ - Get the particles age. - A list of float or list of tuple (particle's age,particle's id). + Get the particles' age. + A list of float or list of tuple (particle's age, particle's id). @type all: int - @param all: if not 0 export all particles (uninitialized (unborn or died) particles exported as None). + @param all: if not 0, export all particles (uninitialized (unborn or died) particles exported as None). @type id: int @param id: add the particle id in the return tuple @rtype: list of floats - @return: list of floats or list of tuples if id is not zero (size,id). - """ -# Blender.Object module and the Object PyType object - -""" -The Blender.Particle submodule - - -Particle -======== - -This module provides access to the B{Particle} in Blender. - -@type TYPE: readonly dictionary -@var TYPE: Constant dict used for with L{Particle.TYPE} - - HAIR: set particle system to hair mode. - - REACTOR: set particle system to reactor mode. - - EMITTER: set particle system to emitter mode. -@type DISTRIBUTION: readonly dictionary -@var DISTRIBUTION: Constant dict used for with L{Particle.DISTRIBUTION} - - GRID: set grid distribution. - - RANDOM: set random distribution. - - JITTERED: set jittered distribution. -@type EMITFROM: readonly dictionary -@var EMITFROM: Constant dict used for with L{Particle.EMITFROM} - - VERTS: set particles emit from vertices - - FACES: set particles emit from faces - - VOLUME: set particles emit from volume - - PARTICLE: set particles emit from particles -@type REACTON: readonly dictionary -@var REACTON: Constant dict used for with L{Particle.REACTON} - - NEAR: react on near - - COLLISION: react on collision - - DEATH: react on death -@type DRAWAS: readonly dictionary -@var DRAWAS: Constant dict used for with L{Particle.DRAWAS} - - NONE: Don't draw - - POINT: Draw as point - - CIRCLE: Draw as circles - - CROSS: Draw as crosses - - AXIS: Draw as axis - - LINE: Draw as lines - - PATH: Draw pathes - - OBJECT: Draw object - - GROUP: Draw goup - - BILLBOARD: Draw as billboard -""" - -def Get(name): - """ - Get the particle system of the object "name". - @type name: string - @return: The particle system of the object. - """ -def New(name): - """ - Assign a new particle system to the object "name". - @type name: string - @return: The newly created particle system. - """ - -class Particle: - """ - The Particle object - =================== - This object gives access to paticles data. - - @ivar seed: Set an offset in the random table. - @type seed: int - @ivar type: Type of particle system ( Particle.TYPE[ 'HAIR' | 'REACTOR' | 'EMITTER' ] ). - @type type: int - @ivar resolutionGrid: The resolution of the particle grid. - @type resolutionGrid: int - @ivar startFrame: Frame # to start emitting particles. - @type startFrame: float - @ivar endFrame: Frame # to stop emitting particles. - @type endFrame: float - @ivar editable: Finalize hair to enable editing in particle mode. - @type editable: int - @ivar amount: The total number of particles. - @type amount: int - @ivar multireact: React multiple times ( Paricle.REACTON[ 'NEAR' | 'COLLISION' | 'DEATH' ] ). - @type multireact: int - @ivar reactshape: Power of reaction strength dependence on distance to target. - @type reactshape: float - @ivar hairSegments: Amount of hair segments. - @type hairSegments: int - @ivar lifetime: Specify the life span of the particles. - @type lifetime: float - @ivar randlife: Give the particle life a random variation. - @type randlife: float - @ivar randemission: Give the particle life a random variation - @type randemission: int - @ivar particleDistribution: Where to emit particles from Paricle.EMITFROM[ 'PARTICLE' | 'VOLUME' | 'FACES' | 'VERTS' ] ) - @type particleDistribution: int - @ivar evenDistribution: Use even distribution from faces based on face areas or edge lengths. - @type evenDistribution: int - @ivar distribution: How to distribute particles on selected element Paricle.DISTRIBUTION[ 'GRID' | 'RANDOM' | 'JITTERED' ] ). - @type distribution: int - @ivar jitterAmount: Amount of jitter applied to the sampling. - @type jitterAmount: float - @ivar pf: Emission locations / face (0 = automatic). - @type pf:int - @ivar invert: Invert what is considered object and what is not. - @type invert: int - @ivar targetObject: The object that has the target particle system (empty if same object). - @type targetObject: Blender object - @ivar targetpsys: The target particle system number in the object. - @type targetpsys: int - @ivar 2d: Constrain boids to a surface. - @type 2d: float - @ivar maxvel: Maximum velocity. - @type maxvel: float - @ivar avvel: The usual speed % of max velocity. - @type avvel: float - @ivar latacc: Lateral acceleration % of max velocity - @type latacc: float - @ivar tanacc: Tangential acceleration % of max velocity - @type tanacc: float - @ivar groundz: Default Z value. - @type groundz: float - @ivar object: Constrain boids to object's surface. - @type object: Blender Object - @ivar renderEmitter: Render emitter object. - @type renderEmitter: int - @ivar displayPercentage: Particle display percentage. - @type displayPercentage: int - @ivar hairDisplayStep: How many steps paths are drawn with (power of 2) in visu mode. - @type hairDisplayStep: int - @ivar hairRenderStep: How many steps paths are rendered with (power of 2) in render mode." - @type hairRenderStep: int - @ivar duplicateObject: Get the duplicate object. - @type duplicateObject: Blender Object - @ivar drawAs: Get draw type Particle.DRAWAS([ 'NONE' | 'OBJECT' | 'POINT' | ... ]). - @type drawAs: int - """ - def freeEdit(): - """ - Free edit mode. - @return: None - """ - - def getLoc(all=0,id=0): - """ - Get the particles locations. - A list of tuple is returned in particle mode. - A list of list of tuple is returned in hair mode. - The tuple is a vector list of 3 floats in world space. - @type all: int - @param all: if not 0 export all particles (uninitialized (unborn or died)particles exported as None). - @type id: int - @param id: add the particle id in the end of the vector tuple - @rtype: list of vectors (tuple of 3 floats and optionnaly the id) or list of list of vectors - @return: list of vectors or list of list of vectors (hair mode) - """ - def getRot(all=0,id=0): - """ - Get the particles rotations as quaternion. - A list of tuple is returned in particle mode. - The tuple is a vector list of 4 floats (quaternion). - @type all: int - @param all: if not 0 export all particles (uninitialized (unborn or died) particles exported as None). - @type id: int - @param id: add the particle id in the return tuple - @rtype: list of tuple of 4 or 5 elements (if id is not zero) - @return: list of 4-tuples - """ - def getMat(): - """ - Get the particles material. - @rtype: Blender Material - @return: The marterial assigned to particles - """ - def getSize(all=0,id=0): - """ - Get the particles size. - A list of float. - @type all: int - @param all: if not 0 export all particles (uninitialized (unborn or died) particles exported as None). - @type id: int - @param id: add the particle id in the return tuple - @rtype: list of floats - @return: list of floats or list of tuples if id is not zero (size,id). + @return: list of floats or list of tuples if id is not zero (size,id) or None if system is disabled. """ diff --git a/source/blender/python/api2_2x/doc/Render.py b/source/blender/python/api2_2x/doc/Render.py index 475a4fc5b10..d4dc83e84a0 100644 --- a/source/blender/python/api2_2x/doc/Render.py +++ b/source/blender/python/api2_2x/doc/Render.py @@ -833,9 +833,7 @@ class RenderData: def enableCropping(toggle): """ - Enable/disable exclusion of border rendering from total image. - @type toggle: int - @param toggle: pass 1 for on / 0 for off + Deprecated: see the L{crop} attribute. """ def setImageType(type): diff --git a/source/blender/python/api2_2x/sceneRender.c b/source/blender/python/api2_2x/sceneRender.c index b446af7efd4..d382d450970 100644 --- a/source/blender/python/api2_2x/sceneRender.c +++ b/source/blender/python/api2_2x/sceneRender.c @@ -985,7 +985,7 @@ PyObject *RenderData_EnableCropping( void ) /* return M_Render_BitToggleInt( args, R_MOVIECROP, &self->renderContext->mode ); */ - printf("cropping option is now default, obsolete\n"); + printf("obsolete: movie cropping option is now default\n"); Py_RETURN_NONE; } diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index 67be0ce4c00..4520e4c10bb 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -671,8 +671,10 @@ static void atm_tile(RenderPart *pa, RenderLayer *rl) RenderPass *zpass; GroupObject *go; LampRen *lar; - - int x, y; + RenderLayer *rlpp[RE_MAX_OSA]; + + int totsample, fullsample, sample; + int x, y,od; short first_lamp; float *zrect; float *rgbrect; @@ -683,7 +685,10 @@ static void atm_tile(RenderPart *pa, RenderLayer *rl) fac = 0.5; facm = 1.0 - fac; - + + totsample= get_sample_layers(pa, rl, rlpp); + fullsample= (totsample > 1); + /* check that z pass is enabled */ if(pa->rectz==NULL) return; for(zpass= rl->passes.first; zpass; zpass= zpass->next) @@ -708,9 +713,10 @@ static void atm_tile(RenderPart *pa, RenderLayer *rl) zrect = zpass->rect; rgbrect = rl->rectf; + od=0; /* for each x,y and sun lamp*/ for(y=pa->disprect.ymin; ydisprect.ymax; y++) { - for(x=pa->disprect.xmin; xdisprect.xmax; x++, zrect++, rgbrect+=4) { + for(x=pa->disprect.xmin; xdisprect.xmax; x++, zrect++, od++) { first_lamp = 1; for(go=R.lights.first; go; go= go->next) { @@ -724,7 +730,7 @@ static void atm_tile(RenderPart *pa, RenderLayer *rl) } if(lar->sunsky->effect_type & LA_SUN_EFFECT_AP){ - VECCOPY(tmp_rgb, rgbrect); + VECCOPY(tmp_rgb, (float*)(rgbrect+4*od)); shadeAtmPixel(lar->sunsky, tmp_rgb, x, y, *zrect); @@ -743,7 +749,16 @@ static void atm_tile(RenderPart *pa, RenderLayer *rl) /* if at least for one sun lamp aerial perspective was applied*/ if(first_lamp==0) - VECCOPY(rgbrect, rgb); + { + if(fullsample) { + for(sample=0; samplerectf + od*4), rgb); + } + } + else { + VECCOPY((float*)(rgbrect+4*od), rgb); + } + } } } } diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index 0928042729a..5b69323667e 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -1379,6 +1379,8 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int } /* specularity */ + shadfac[3]*= phongcorr; /* note, shadfac not allowed to be stored nonlocal */ + if(shadfac[3]>0.0f && shi->spec!=0.0f && !(lar->mode & LA_NO_SPEC) && !(lar->mode & LA_ONLYSHADOW)) { if(!(passflag & (SCE_PASS_COMBINED|SCE_PASS_SPEC))); diff --git a/source/blender/src/drawaction.c b/source/blender/src/drawaction.c index 6fe37c1c6e5..9b1af3f1a06 100644 --- a/source/blender/src/drawaction.c +++ b/source/blender/src/drawaction.c @@ -58,6 +58,7 @@ #include "DNA_constraint_types.h" #include "DNA_key_types.h" #include "DNA_userdef_types.h" +#include "DNA_gpencil_types.h" #include "BKE_action.h" #include "BKE_depsgraph.h" @@ -74,6 +75,7 @@ #include "BIF_editnla.h" #include "BIF_interface.h" #include "BIF_interface_icons.h" +#include "BIF_drawgpencil.h" #include "BIF_gl.h" #include "BIF_glutil.h" #include "BIF_resources.h" @@ -83,6 +85,7 @@ #include "BDR_drawaction.h" #include "BDR_editcurve.h" +#include "BDR_gpencil.h" #include "BSE_drawnla.h" #include "BSE_drawipo.h" @@ -622,6 +625,28 @@ static void draw_channel_names(void) sprintf(name, "Constraint"); } break; + case ACTTYPE_GPLAYER: /* gpencil layer */ + { + bGPDlayer *gpl = (bGPDlayer *)ale->data; + + indent = 0; + special = -1; + expand = -1; + + if (EDITABLE_GPL(gpl)) + protect = ICON_UNLOCKED; + else + protect = ICON_LOCKED; + + if (gpl->flag & GP_LAYER_HIDE) + mute = ICON_MUTE_IPO_ON; + else + mute = ICON_MUTE_IPO_OFF; + + sel = SEL_GPL(gpl); + BLI_snprintf(name, 32, gpl->info); + } + break; } /* now, start drawing based on this information */ @@ -827,6 +852,12 @@ static void draw_channel_strips(void) sel = SEL_ICU(icu); } break; + case ACTTYPE_GPLAYER: + { + bGPDlayer *gpl = (bGPDlayer *)ale->data; + sel = SEL_GPL(gpl); + } + break; } if (datatype == ACTCONT_ACTION) { @@ -865,6 +896,19 @@ static void draw_channel_strips(void) glColor4ub(col2[0], col2[1], col2[2], 0x44); glRectf(frame1_x, channel_y-CHANNELHEIGHT/2, G.v2d->hor.xmax, channel_y+CHANNELHEIGHT/2); } + else if (datatype == ACTCONT_GPENCIL) { + gla2DDrawTranslatePt(di, G.v2d->cur.xmin, y, &frame1_x, &channel_y); + + /* frames less than one get less saturated background */ + if (sel) glColor4ub(col1[0], col1[1], col1[2], 0x22); + else glColor4ub(col2[0], col2[1], col2[2], 0x22); + glRectf(0, channel_y-CHANNELHEIGHT/2, frame1_x, channel_y+CHANNELHEIGHT/2); + + /* frames one and higher get a saturated background */ + if (sel) glColor4ub(col1[0], col1[1], col1[2], 0x44); + else glColor4ub(col2[0], col2[1], col2[2], 0x44); + glRectf(frame1_x, channel_y-CHANNELHEIGHT/2, G.v2d->hor.xmax, channel_y+CHANNELHEIGHT/2); + } } /* Increment the step */ @@ -899,6 +943,9 @@ static void draw_channel_strips(void) case ALE_ICU: draw_icu_channel(di, ale->key_data, y); break; + case ALE_GPFRAME: + draw_gpl_channel(di, ale->data, y); + break; } } @@ -1075,6 +1122,7 @@ void drawactionspace(ScrArea *sa, void *spacedata) { bAction *act = NULL; Key *key = NULL; + bGPdata *gpd = NULL; void *data; short datatype; @@ -1090,18 +1138,38 @@ void drawactionspace(ScrArea *sa, void *spacedata) /* only try to refresh action that's displayed if not pinned */ if (G.saction->pin==0) { - if (OBACT) - G.saction->action = OBACT->action; - else - G.saction->action= NULL; + /* depends on mode */ + switch (G.saction->mode) { + case SACTCONT_ACTION: + { + if (OBACT) + G.saction->action = OBACT->action; + else + G.saction->action= NULL; + } + break; + case SACTCONT_GPENCIL: + { + /* this searching could be slow (so users should pin after this is found) */ + G.saction->gpd= gpencil_data_getetime(G.curscreen); + } + break; + } } /* get data */ data = get_action_context(&datatype); - if (datatype == ACTCONT_ACTION) - act = data; - else if (datatype == ACTCONT_SHAPEKEY) - key = data; + switch (datatype) { + case ACTCONT_ACTION: + act = data; + break; + case ACTCONT_SHAPEKEY: + key = data; + break; + case ACTCONT_GPENCIL: + gpd = data; + break; + } /* Lets make sure the width of the left hand of the screen * is set to an appropriate value based on whether sliders @@ -1450,10 +1518,15 @@ static ActKeysInc *init_aki_data() static ActKeysInc aki; /* init data of static struct here */ - if ((curarea->spacetype == SPACE_ACTION) && NLA_ACTION_SCALED) + if ((curarea->spacetype == SPACE_ACTION) && NLA_ACTION_SCALED && + (G.saction->mode == SACTCONT_ACTION)) + { aki.ob= OBACT; + } else if (curarea->spacetype == SPACE_NLA) + { aki.ob= NULL; // FIXME + } else aki.ob= NULL; @@ -1528,6 +1601,16 @@ void draw_action_channel(gla2DDrawInfo *di, bAction *act, float ypos) BLI_freelistN(&keys); } +void draw_gpl_channel(gla2DDrawInfo *di, bGPDlayer *gpl, float ypos) +{ + ListBase keys = {0, 0}; + ActKeysInc *aki = init_aki_data(); + + gpl_to_keylist(gpl, &keys, NULL, aki); + draw_keylist(di, &keys, NULL, ypos); + BLI_freelistN(&keys); +} + /* --------------- Conversion: data -> keyframe list ------------------ */ void ob_to_keylist(Object *ob, ListBase *keys, ListBase *blocks, ActKeysInc *aki) @@ -1674,3 +1757,26 @@ void action_to_keylist(bAction *act, ListBase *keys, ListBase *blocks, ActKeysIn } } +void gpl_to_keylist(bGPDlayer *gpl, ListBase *keys, ListBase *blocks, ActKeysInc *aki) +{ + bGPDframe *gpf; + ActKeyColumn *ak; + + if (gpl && keys) { + /* loop over frames, converting directly to 'keyframes' (should be in order too) */ + for (gpf= gpl->frames.first; gpf; gpf= gpf->next) { + ak= MEM_callocN(sizeof(ActKeyColumn), "ActKeyColumn"); + BLI_addtail(keys, ak); + + ak->cfra= gpf->framenum; + ak->modified = 1; + ak->handle_type= 0; + + if (gpf->flag & GP_FRAME_SELECT) + ak->sel = SELECT; + else + ak->sel = 0; + } + } +} + diff --git a/source/blender/src/drawgpencil.c b/source/blender/src/drawgpencil.c new file mode 100644 index 00000000000..55d0464b9af --- /dev/null +++ b/source/blender/src/drawgpencil.c @@ -0,0 +1,653 @@ +/** + * $Id: drawgpencil.c 14881 2008-05-18 10:41:42Z aligorith $ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2008, Blender Foundation + * This is a new part of Blender + * + * Contributor(s): Joshua Leung + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include +#include +#include +#include + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "MEM_guardedalloc.h" + +#include "BMF_Api.h" + +#include "BLI_arithb.h" +#include "BLI_blenlib.h" + +#include "DNA_listBase.h" +#include "DNA_gpencil_types.h" +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" +#include "DNA_space_types.h" +#include "DNA_userdef_types.h" +#include "DNA_view3d_types.h" + +#include "BKE_global.h" +#include "BKE_utildefines.h" +#include "BKE_blender.h" + +#include "BIF_gl.h" +#include "BIF_glutil.h" +#include "BIF_butspace.h" +#include "BIF_graphics.h" +#include "BIF_interface.h" +#include "BIF_mywindow.h" +#include "BIF_resources.h" +#include "BIF_space.h" +#include "BIF_screen.h" +#include "BIF_toolbox.h" +#include "BIF_toets.h" + +#include "BDR_gpencil.h" +#include "BIF_drawgpencil.h" + +#include "BSE_drawipo.h" +#include "BSE_headerbuttons.h" +#include "BSE_view.h" + +#include "blendef.h" +#include "butspace.h" + +#include "PIL_time.h" /* sleep */ +#include "mydevice.h" + +/* ************************************************** */ +/* GREASE PENCIL PANEL-UI DRAWING */ + +/* Every space which implements Grease-Pencil functionality should have a panel + * for the settings. All of the space-dependent parts should be coded in the panel + * code for that space, but the rest is all handled by generic panel here. + */ + +/* ------- Callbacks ----------- */ +/* These are just 'dummy wrappers' around gpencil api calls */ + +/* make layer active one after being clicked on */ +void gp_ui_activelayer_cb (void *gpd, void *gpl) +{ + gpencil_layer_setactive(gpd, gpl); +} + +/* rename layer and set active */ +void gp_ui_renamelayer_cb (void *gpd_arg, void *gpl_arg) +{ + bGPdata *gpd= (bGPdata *)gpd_arg; + bGPDlayer *gpl= (bGPDlayer *)gpl_arg; + + BLI_uniquename(&gpd->layers, gpl, "GP_Layer", offsetof(bGPDlayer, info[0]), 128); + gpencil_layer_setactive(gpd, gpl); +} + +/* add a new layer */ +void gp_ui_addlayer_cb (void *gpd, void *dummy) +{ + gpencil_layer_addnew(gpd); +} + +/* delete active layer */ +void gp_ui_dellayer_cb (void *gpd, void *dummy) +{ + gpencil_layer_delactive(gpd); +} + +/* delete last stroke of active layer */ +void gp_ui_delstroke_cb (void *gpd, void *gpl) +{ + bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0); + + gpencil_layer_setactive(gpd, gpl); + gpencil_frame_delete_laststroke(gpf); +} + +/* delete active frame of active layer */ +void gp_ui_delframe_cb (void *gpd, void *gpl) +{ + bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0); + + gpencil_layer_setactive(gpd, gpl); + gpencil_layer_delframe(gpl, gpf); +} + + +/* set this set of gpencil data for editing in action editor */ +void gp_ui_dotime_cb (void *gpd_arg, void *dummy) +{ + bGPdata *gpd= (bGPdata *)gpd_arg; + + /* check if setting or clearing (note: setting was just set...) */ + if (gpd->flag & GP_DATA_EDITTIME) + gpencil_data_setetime(G.curscreen, gpd); + else + gpencil_data_setetime(G.curscreen, NULL); +} + + +/* ------- Drawing Code ------- */ + +/* draw the controls for a given layer */ +static void gp_drawui_layer (uiBlock *block, bGPdata *gpd, bGPDlayer *gpl, short *xco, short *yco) +{ + uiBut *but; + short width= 314; + short height; + int rb_col; + + /* unless button has own callback, it adds this callback to button */ + uiBlockSetFunc(block, gp_ui_activelayer_cb, gpd, gpl); + + /* draw header */ + { + uiBlockSetEmboss(block, UI_EMBOSSN); + + /* rounded header */ + rb_col= (gpl->flag & GP_LAYER_ACTIVE)?50:20; + uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-8, *yco-2, width, 24, NULL, 5.0, 0.0, 15 , rb_col-20, ""); + + /* lock toggle */ + uiDefIconButBitI(block, ICONTOG, GP_LAYER_LOCKED, B_REDR, ICON_UNLOCKED, *xco-7, *yco-1, 20, 20, &gpl->flag, 0.0, 0.0, 0, 0, "Layer cannot be modified"); + } + + /* when layer is locked or hidden, don't draw the rest of its settings */ + if (gpl->flag & (GP_LAYER_LOCKED|GP_LAYER_HIDE)) { + height= 26; + + /* draw rest of header */ + { + /* visibility button (only if hidden but not locked!) */ + if ((gpl->flag & GP_LAYER_HIDE) && !(gpl->flag & GP_LAYER_LOCKED)) + uiDefIconButBitI(block, ICONTOG, GP_LAYER_HIDE, B_REDR, ICON_RESTRICT_VIEW_OFF, *xco+12, *yco-1, 20, 20, &gpl->flag, 0.0, 0.0, 0, 0, "Visibility of layer"); + + /* name */ + uiDefBut(block, LABEL, 1, gpl->info, *xco+35, *yco, 240, 20, NULL, 0.0, 0.0, 0, 0, "Short description of what this layer is for (optional)"); + } + + /* draw backdrop */ + uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-8, *yco-height, width, height-1, NULL, 5.0, 0.0, 12, rb_col, ""); + + /* draw settings... (i.e. just warning for this one) */ + if (gpl->flag & GP_LAYER_HIDE) + uiDefBut(block, LABEL, 1, "Grease Pencil Layer Hidden", *xco+60, *yco-26, 205, 20, NULL, 0.0, 0.0, 0, 0, ""); + else + uiDefBut(block, LABEL, 1, "Grease Pencil Layer Locked", *xco+60, *yco-26, 205, 20, NULL, 0.0, 0.0, 0, 0, ""); + + uiBlockSetEmboss(block, UI_EMBOSS); + } + else { + height= 100; + + /* draw rest of header */ + { + /* visibility button */ + uiDefIconButBitI(block, ICONTOG, GP_LAYER_HIDE, B_REDR, ICON_RESTRICT_VIEW_OFF, *xco+12, *yco-1, 20, 20, &gpl->flag, 0.0, 0.0, 0, 0, "Visibility of layer"); + + uiBlockSetEmboss(block, UI_EMBOSS); + + /* name */ + but= uiDefButC(block, TEX, B_REDR, "Info:", *xco+35, *yco, 240, 20, gpl->info, 0, 127, 0, 0, "Short description of what this layer is for (optional)"); + uiButSetFunc(but, gp_ui_renamelayer_cb, gpd, gpl); + + /* delete 'button' */ + uiBlockSetEmboss(block, UI_EMBOSSN); + + but= uiDefIconBut(block, BUT, B_REDR, ICON_X, *xco+(width-30), *yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer"); + uiButSetFunc(but, gp_ui_dellayer_cb, gpd, NULL); + + uiBlockSetEmboss(block, UI_EMBOSS); + } + + /* draw backdrop */ + uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-8, *yco-height, width, height-1, NULL, 5.0, 0.0, 12, rb_col, ""); + + /* draw settings */ + { + /* color */ + uiBlockBeginAlign(block); + uiDefButF(block, COL, B_REDR, "", *xco, *yco-26, 150, 19, gpl->color, 0, 0, 0, 0, "Color to use for all strokes on this Grease Pencil Layer"); + uiDefButF(block, NUMSLI, B_REDR, "Opacity: ", *xco,*yco-45,150,19, &gpl->color[3], 0.3, 1.0, 0, 0, "Visibility of stroke (0.3 to 1.0)"); + uiBlockEndAlign(block); + + /* stroke thickness */ + uiDefButS(block, NUMSLI, B_REDR, "Thickness:", *xco, *yco-75, 150, 20, &gpl->thickness, 1, 10, 0, 0, "Thickness of strokes (in pixels)"); + + + /* onion-skinning */ + uiBlockBeginAlign(block); + uiDefButBitI(block, TOG, GP_LAYER_ONIONSKIN, B_REDR, "Onion-Skin", *xco+160, *yco-26, 140, 20, &gpl->flag, 0, 0, 0, 0, "Ghost frames on either side of frame"); + uiDefButS(block, NUMSLI, B_REDR, "GStep:", *xco+160, *yco-46, 140, 20, &gpl->gstep, 0, 120, 0, 0, "Maximum frame range on either side of active frame to show (0 = just 'first' available frame on either side)"); + uiBlockEndAlign(block); + + /* options */ + but= uiDefBut(block, BUT, B_REDR, "Del Active Frame", *xco+160, *yco-75, 140, 20, NULL, 0, 0, 0, 0, "Erases the the active frame for this layer"); + uiButSetFunc(but, gp_ui_delframe_cb, gpd, gpl); + + but= uiDefBut(block, BUT, B_REDR, "Del Last Stroke", *xco+160, *yco-95, 140, 20, NULL, 0, 0, 0, 0, "Erases the last stroke from the active frame"); + uiButSetFunc(but, gp_ui_delstroke_cb, gpd, gpl); + + //uiDefButBitI(block, TOG, GP_LAYER_DRAWDEBUG, B_REDR, "Show Points", *xco+160, *yco-75, 130, 20, &gpl->flag, 0, 0, 0, 0, "Show points which form the strokes"); + } + } + + /* adjust height for new to start */ + (*yco) -= (height + 27); +} + +/* Draw the contents for a grease-pencil panel. This assumes several things: + * - that panel has been created, is 318 x 204. max yco is 225 + * - that a toggle for turning on/off gpencil drawing is 150 x 20, starting from (10,225) + * It will return the amount of extra space to extend the panel by + */ +short draw_gpencil_panel (uiBlock *block, bGPdata *gpd, ScrArea *sa) +{ + uiBut *but; + bGPDlayer *gpl; + short xco= 10, yco= 155; + + /* draw gpd settings first */ + { + /* show status info button */ + uiDefButBitI(block, TOG, GP_DATA_DISPINFO, B_REDR, "Show Status Info", 10, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "Display status info about current status of Grease Pencil"); + + /* add new/duplicate layer buttons */ + but= uiDefBut(block, BUT, B_REDR, "Add New Layer", 10,182,150,20, 0, 0, 0, 0, 0, "Adds a new Grease Pencil Layer"); + uiButSetFunc(but, gp_ui_addlayer_cb, gpd, NULL); + + + /* show override lmb-clicks button */ + uiDefButBitI(block, TOG, GP_DATA_EDITPAINT, B_REDR, "Draw Mode", 170, 225, 150, 20, &gpd->flag, 0, 0, 0, 0, "Interpret LMB-click as new strokes (same as holding Shift-Key per stroke)"); + + /* 'view align' button (naming depends on context) */ + if (sa->spacetype == SPACE_VIEW3D) + uiDefButBitI(block, TOG, GP_DATA_VIEWALIGN, B_REDR, "Draw in 3D", 170, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "New strokes are added in 3D-space"); + else if (sa->spacetype != SPACE_SEQ) /* not available for sequencer yet */ + uiDefButBitI(block, TOG, GP_DATA_VIEWALIGN, B_REDR, "Stick to View", 170, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "New strokes are added on 2d-canvas"); + + /* show edit-in-action button */ + but= uiDefButBitI(block, TOG, GP_DATA_EDITTIME, B_REDR, "Edit Timing", 170, 182, 150, 20, &gpd->flag, 0, 0, 0, 0, "Edit timing of frames for the Grease Pencil block"); + uiButSetFunc(but, gp_ui_dotime_cb, gpd, NULL); + } + + /* draw for each layer */ + for (gpl= gpd->layers.first; gpl; gpl= gpl->next) { + gp_drawui_layer(block, gpd, gpl, &xco, &yco); + } + + /* return new height if necessary */ + return (yco < 0) ? (204 - yco) : 204; +} + +/* ************************************************** */ +/* GREASE PENCIL DRAWING */ + +/* flags for sflag */ +enum { + GP_DRAWDATA_NOSTATUS = (1<<0), /* don't draw status info */ + GP_DRAWDATA_ONLY3D = (1<<1), /* only draw 3d-strokes */ + GP_DRAWDATA_ONLYV2D = (1<<2), /* only draw 'canvas' strokes */ +}; + +/* draw a given stroke */ +static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness, short dflag, short sflag, short debug, int winx, int winy) +{ + bGPDspoint *pt; + int i; + + /* error checking */ + if ((points == NULL) || (totpoints <= 0)) + return; + + /* check if stroke can be drawn */ + if ((dflag & GP_DRAWDATA_ONLY3D) && !(sflag & GP_STROKE_3DSPACE)) + return; + if (!(dflag & GP_DRAWDATA_ONLY3D) && (sflag & GP_STROKE_3DSPACE)) + return; + if ((dflag & GP_DRAWDATA_ONLYV2D) && !(sflag & GP_STROKE_2DSPACE)) + return; + if (!(dflag & GP_DRAWDATA_ONLYV2D) && (sflag & GP_STROKE_2DSPACE)) + return; + + /* if drawing a single point, draw it larger */ + if (totpoints == 1) { + /* draw point */ + if (sflag & GP_STROKE_3DSPACE) { + glBegin(GL_POINTS); + glVertex3f(points->x, points->y, points->z); + glEnd(); + } + else if (sflag & GP_STROKE_2DSPACE) { + glBegin(GL_POINTS); + glVertex2f(points->x, points->y); + glEnd(); + } + else { + const float x= (points->x / 1000 * winx); + const float y= (points->y / 1000 * winy); + + glBegin(GL_POINTS); + glVertex2f(x, y); + glEnd(); + } + } + else { + float oldpressure = 0.0f; + + /* draw stroke curve */ + glBegin(GL_LINE_STRIP); + for (i=0, pt=points; i < totpoints && pt; i++, pt++) { + float x, y, z; + + if (sflag & GP_STROKE_3DSPACE) { + x= pt->x; + y= pt->y; + z= pt->z; + } + else if (sflag & GP_STROKE_2DSPACE) { + x= pt->x; + y= pt->y; + z= 0; + } + else { + x= (pt->x / 1000 * winx); + y= (pt->y / 1000 * winy); + z= 0; + } + + if (fabs(pt->pressure - oldpressure) > 0.2f) { + glEnd(); + glLineWidth(pt->pressure * thickness); + glBegin(GL_LINE_STRIP); + + if (sflag & GP_STROKE_3DSPACE) + glVertex3f(x, y, z); + else + glVertex2f(x, y); + + oldpressure = pt->pressure; + } + else { + if (sflag & GP_STROKE_3DSPACE) + glVertex3f(x, y, z); + else + glVertex2f(x, y); + } + } + glEnd(); + + /* draw debug points of curve on top? */ + if (debug) { + glBegin(GL_POINTS); + for (i=0, pt=points; i < totpoints && pt; i++, pt++) { + if (sflag & GP_STROKE_3DSPACE) { + glVertex3f(pt->x, pt->y, pt->z); + } + else if (sflag & GP_STROKE_2DSPACE) { + glVertex2f(pt->x, pt->y); + } + else { + const float x= (pt->x / 1000 * winx); + const float y= (pt->y / 1000 * winy); + + glVertex2f(x, y); + } + } + glEnd(); + } + } +} + +/* draw grease-pencil datablock */ +static void gp_draw_data (bGPdata *gpd, int winx, int winy, int dflag) +{ + bGPDlayer *gpl, *actlay=NULL; + + /* turn on smooth lines (i.e. anti-aliasing) */ + glEnable(GL_LINE_SMOOTH); + + /* turn on alpha-blending */ + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + + /* loop over layers, drawing them */ + for (gpl= gpd->layers.first; gpl; gpl= gpl->next) { + bGPDframe *gpf; + bGPDstroke *gps; + + short debug = (gpl->flag & GP_LAYER_DRAWDEBUG) ? 1 : 0; + short lthick= gpl->thickness; + float color[4]; + + /* don't draw layer if hidden */ + if (gpl->flag & GP_LAYER_HIDE) + continue; + + /* if layer is active one, store pointer to it */ + if (gpl->flag & GP_LAYER_ACTIVE) + actlay= gpl; + + /* get frame to draw */ + gpf= gpencil_layer_getframe(gpl, CFRA, 0); + if (gpf == NULL) + continue; + + /* set color, stroke thickness, and point size */ + glLineWidth(lthick); + QUATCOPY(color, gpl->color); // just for copying 4 array elements + glColor4f(color[0], color[1], color[2], color[3]); + glPointSize(gpl->thickness + 2); + + /* draw 'onionskins' (frame left + right) */ + if (gpl->flag & GP_LAYER_ONIONSKIN) { + /* drawing method - only immediately surrounding (gstep = 0), or within a frame range on either side (gstep > 0)*/ + if (gpl->gstep) { + bGPDframe *gf; + short i; + + /* draw previous frames first */ + for (gf=gpf->prev, i=0; gf; gf=gf->prev, i++) { + /* check if frame is drawable */ + if ((gpf->framenum - gf->framenum) <= gpl->gstep) { + /* alpha decreases with distance from curframe index */ + glColor4f(color[0], color[1], color[2], (color[3]-(i*0.7))); + + for (gps= gf->strokes.first; gps; gps= gps->next) { + gp_draw_stroke(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, winx, winy); + } + } + else + break; + } + + /* now draw next frames */ + for (gf= gpf->next, i=0; gf; gf=gf->next, i++) { + /* check if frame is drawable */ + if ((gf->framenum - gpf->framenum) <= gpl->gstep) { + /* alpha decreases with distance from curframe index */ + glColor4f(color[0], color[1], color[2], (color[3]-(i*0.7))); + + for (gps= gf->strokes.first; gps; gps= gps->next) { + gp_draw_stroke(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, winx, winy); + } + } + else + break; + } + + /* restore alpha */ + glColor4f(color[0], color[1], color[2], color[3]); + } + else { + /* draw the strokes for the ghost frames (at half of the alpha set by user) */ + glColor4f(color[0], color[1], color[2], (color[3] / 7)); + + if (gpf->prev) { + for (gps= gpf->prev->strokes.first; gps; gps= gps->next) { + gp_draw_stroke(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, winx, winy); + } + } + + glColor4f(color[0], color[1], color[2], (color[3] / 4)); + if (gpf->next) { + for (gps= gpf->next->strokes.first; gps; gps= gps->next) { + gp_draw_stroke(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, winx, winy); + } + } + + /* restore alpha */ + glColor4f(color[0], color[1], color[2], color[3]); + } + } + + /* draw the strokes already in active frame */ + for (gps= gpf->strokes.first; gps; gps= gps->next) { + gp_draw_stroke(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, winx, winy); + } + + /* Check if may need to draw the active stroke cache, only if this layer is the active layer + * that is being edited. (Stroke cache is currently stored in gp-data) + */ + if ((G.f & G_GREASEPENCIL) && (gpl->flag & GP_LAYER_ACTIVE) && + (gpf->flag & GP_FRAME_PAINT)) + { + /* Buffer stroke needs to be drawn with a different linestyle to help differentiate them from normal strokes. */ + setlinestyle(2); + gp_draw_stroke(gpd->sbuffer, gpd->sbuffer_size, lthick, dflag, gpd->sbuffer_sflag, debug, winx, winy); + setlinestyle(0); + } + } + + /* turn off alpha blending, then smooth lines */ + glDisable(GL_BLEND); // alpha blending + glDisable(GL_LINE_SMOOTH); // smooth lines + + /* show info for debugging the status of gpencil */ + if ( ((dflag & GP_DRAWDATA_NOSTATUS)==0) && (gpd->flag & GP_DATA_DISPINFO) ) { + char printable[256]; + short xmax; + + /* get text to display */ + if (actlay) { + if (gpd->flag & GP_DATA_EDITPAINT) + BIF_ThemeColor(TH_BONE_POSE); // should be blue-ish + else if (actlay->actframe == NULL) + BIF_ThemeColor(TH_REDALERT); + else if (actlay->actframe->framenum == CFRA) + BIF_ThemeColor(TH_VERTEX_SELECT); // should be yellow + else + BIF_ThemeColor(TH_TEXT_HI); + + if (actlay->actframe) { + sprintf(printable, "GPencil: Layer ('%s'), Frame (%d) %s", + actlay->info, actlay->actframe->framenum, + ((gpd->flag & GP_DATA_EDITPAINT)?", Draw Mode On":"") ); + } + else { + sprintf(printable, "GPencil: Layer ('%s'), Frame %s", + actlay->info, ((gpd->flag & GP_DATA_EDITPAINT)?", Draw Mode On":"") ); + } + } + else { + BIF_ThemeColor(TH_REDALERT); + sprintf(printable, "GPencil: Layer "); + } + xmax= GetButStringLength(printable); + + /* only draw it if view is wide enough (assume padding of 20 is enough for now) */ + if (winx > (xmax + 20)) { + glRasterPos2i(winx-xmax, winy-20); + BMF_DrawString(G.fonts, printable); + } + } + + /* restore initial gl conditions */ + glLineWidth(1.0); + glPointSize(1.0); + glColor4f(0, 0, 0, 1); +} + +/* ----------- */ + +/* draw grease-pencil sketches to specified 2d-view assuming that matrices are already set correctly + * Note: this gets called twice - first time with onlyv2d=1 to draw 'canvas' strokes, second time with onlyv2d=0 for screen-aligned strokes + */ +void draw_gpencil_2dview (ScrArea *sa, short onlyv2d) +{ + bGPdata *gpd; + int dflag = 0; + + /* check that we have grease-pencil stuff to draw */ + if (sa == NULL) return; + gpd= gpencil_data_getactive(sa); + if (gpd == NULL) return; + + /* draw it! */ + if (onlyv2d) dflag |= (GP_DRAWDATA_ONLYV2D|GP_DRAWDATA_NOSTATUS); + gp_draw_data(gpd, sa->winx, sa->winy, dflag); +} + +/* draw grease-pencil sketches to specified 3d-view assuming that matrices are already set correctly + * Note: this gets called twice - first time with only3d=1 to draw 3d-strokes, second time with only3d=0 for screen-aligned strokes + */ +void draw_gpencil_3dview (ScrArea *sa, short only3d) +{ + bGPdata *gpd; + int dflag = 0; + + /* check that we have grease-pencil stuff to draw */ + gpd= gpencil_data_getactive(sa); + if (gpd == NULL) return; + + /* draw it! */ + if (only3d) dflag |= (GP_DRAWDATA_ONLY3D|GP_DRAWDATA_NOSTATUS); + gp_draw_data(gpd, sa->winx, sa->winy, dflag); +} + +/* draw grease-pencil sketches to opengl render window assuming that matrices are already set correctly */ +void draw_gpencil_oglrender (View3D *v3d, int winx, int winy) +{ + bGPdata *gpd; + + /* assume gpencil data comes from v3d */ + if (v3d == NULL) return; + gpd= v3d->gpd; + if (gpd == NULL) return; + + /* pass 1: draw 3d-strokes ------------ > */ + gp_draw_data(gpd, winx, winy, (GP_DRAWDATA_NOSTATUS|GP_DRAWDATA_ONLY3D)); + + /* pass 2: draw 2d-strokes ------------ > */ + /* adjust view matrices */ + myortho2(-0.375, (float)(winx)-0.375, -0.375, (float)(winy)-0.375); + glLoadIdentity(); + + /* draw it! */ + gp_draw_data(gpd, winx, winy, GP_DRAWDATA_NOSTATUS); +} + +/* ************************************************** */ diff --git a/source/blender/src/drawnode.c b/source/blender/src/drawnode.c index 1169062fdd0..3a73ee84ead 100644 --- a/source/blender/src/drawnode.c +++ b/source/blender/src/drawnode.c @@ -37,6 +37,7 @@ #include "DNA_action_types.h" #include "DNA_color_types.h" #include "DNA_customdata_types.h" +#include "DNA_gpencil_types.h" #include "DNA_ipo_types.h" #include "DNA_ID.h" #include "DNA_image_types.h" @@ -65,8 +66,11 @@ #include "CMP_node.h" #include "SHD_node.h" +#include "BDR_gpencil.h" + #include "BIF_gl.h" #include "BIF_glutil.h" +#include "BIF_drawgpencil.h" #include "BIF_interface.h" #include "BIF_interface_icons.h" #include "BIF_language.h" @@ -3300,6 +3304,66 @@ static void node_draw_group(ScrArea *sa, SpaceNode *snode, bNode *gnode) } + +static void nodes_panel_gpencil(short cntrl) // NODES_HANDLER_GREASEPENCIL +{ + uiBlock *block; + SpaceNode *snode; + + snode= curarea->spacedata.first; + + block= uiNewBlock(&curarea->uiblocks, "nodes_panel_gpencil", UI_EMBOSS, UI_HELV, curarea->win); + uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl); + uiSetPanelHandler(NODES_HANDLER_GREASEPENCIL); // for close and esc + if (uiNewPanel(curarea, block, "Grease Pencil", "SpaceNode", 100, 30, 318, 204)==0) return; + + /* we can only really draw stuff if there are nodes (otherwise no events are handled */ + if (snode->nodetree == NULL) + return; + + /* allocate memory for gpd if drawing enabled (this must be done first or else we crash) */ + if (snode->flag & SNODE_DISPGP) { + if (snode->gpd == NULL) + gpencil_data_setactive(curarea, gpencil_data_addnew()); + } + + if (snode->flag & SNODE_DISPGP) { + bGPdata *gpd= snode->gpd; + short newheight; + + /* this is a variable height panel, newpanel doesnt force new size on existing panels */ + /* so first we make it default height */ + uiNewPanelHeight(block, 204); + + /* draw button for showing gpencil settings and drawings */ + uiDefButBitS(block, TOG, SNODE_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &snode->flag, 0, 0, 0, 0, "Display freehand annotations overlay over this Node Editor"); + + /* extend the panel if the contents won't fit */ + newheight= draw_gpencil_panel(block, gpd, curarea); + uiNewPanelHeight(block, newheight); + } + else { + uiDefButBitS(block, TOG, SNODE_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &snode->flag, 0, 0, 0, 0, "Display freehand annotations overlay over this Node Editor"); + uiDefBut(block, LABEL, 1, " ", 160, 180, 150, 20, NULL, 0.0, 0.0, 0, 0, ""); + } +} + +static void nodes_blockhandlers(ScrArea *sa) +{ + SpaceNode *snode= sa->spacedata.first; + short a; + + for(a=0; ablockhandler[a]) { + case NODES_HANDLER_GREASEPENCIL: + nodes_panel_gpencil(snode->blockhandler[a+1]); + break; + } + } + uiDrawBlocksPanels(sa, 0); +} + void drawnodespace(ScrArea *sa, void *spacedata) { SpaceNode *snode= sa->spacedata.first; @@ -3354,13 +3418,26 @@ void drawnodespace(ScrArea *sa, void *spacedata) } } + /* draw grease-pencil ('canvas' strokes) */ + if ((snode->flag & SNODE_DISPGP) && (snode->nodetree)) + draw_gpencil_2dview(sa, 1); + /* restore viewport (not needed yet) */ mywinset(sa->win); /* ortho at pixel level curarea */ myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375); + + /* draw grease-pencil (screen strokes) */ + if ((snode->flag & SNODE_DISPGP) && (snode->nodetree)) + draw_gpencil_2dview(sa, 0); draw_area_emboss(sa); + + /* it is important to end a view in a transform compatible with buttons */ + bwin_scalematrix(sa->win, snode->blockscale, snode->blockscale, snode->blockscale); + nodes_blockhandlers(sa); + curarea->win_swap= WIN_BACK_OK; /* in the end, this is a delayed previewrender test, to allow buttons to be first */ diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index 045bf292446..1a469e8b366 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -1199,7 +1199,12 @@ static void drawlattice(Object *ob) int use_wcol= 0; lt= (ob==G.obedit)?editLatt:ob->data; + + /* now we default make displist, this will modifiers work for non animated case */ + if(ob->disp.first==NULL) + lattice_calc_modifiers(ob); dl= find_displist(&ob->disp, DL_VERTS); + if(ob==G.obedit) { cpack(0x004000); diff --git a/source/blender/src/drawseq.c b/source/blender/src/drawseq.c index e554b91dd52..c8c74ad8279 100644 --- a/source/blender/src/drawseq.c +++ b/source/blender/src/drawseq.c @@ -43,6 +43,7 @@ #include "IMB_imbuf_types.h" +#include "DNA_gpencil_types.h" #include "DNA_sequence_types.h" #include "DNA_scene_types.h" #include "DNA_screen_types.h" @@ -67,6 +68,9 @@ #include "BIF_space.h" #include "BIF_interface.h" +#include "BIF_drawgpencil.h" +#include "BDR_gpencil.h" + #include "BSE_view.h" #include "BSE_drawipo.h" #include "BSE_sequence.h" @@ -98,6 +102,70 @@ static void draw_seq_text(Sequence *seq, float x1, float x2, float y1, float y2) static void draw_shadedstrip(Sequence *seq, char *col, float x1, float y1, float x2, float y2); static void draw_seq_strip(struct Sequence *seq, struct ScrArea *sa, struct SpaceSeq *sseq, int outline_tint, float pixelx); + +static void seq_panel_gpencil(short cntrl) // SEQ_HANDLER_GREASEPENCIL +{ + uiBlock *block; + SpaceSeq *sseq; + + sseq= curarea->spacedata.first; + + block= uiNewBlock(&curarea->uiblocks, "seq_panel_gpencil", UI_EMBOSS, UI_HELV, curarea->win); + uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl); + uiSetPanelHandler(SEQ_HANDLER_GREASEPENCIL); // for close and esc + if (uiNewPanel(curarea, block, "Grease Pencil", "SpaceSeq", 100, 30, 318, 204)==0) return; + + /* only draw settings if right mode */ + if (sseq->mainb == 0) + return; + + /* allocate memory for gpd if drawing enabled (this must be done first or else we crash) */ + if (sseq->flag & SEQ_DRAW_GPENCIL) { + if (sseq->gpd == NULL) + gpencil_data_setactive(curarea, gpencil_data_addnew()); + } + + if (sseq->flag & SEQ_DRAW_GPENCIL) { + bGPdata *gpd= sseq->gpd; + short newheight; + + /* this is a variable height panel, newpanel doesnt force new size on existing panels */ + /* so first we make it default height */ + uiNewPanelHeight(block, 204); + + /* draw button for showing gpencil settings and drawings */ + uiDefButBitI(block, TOG, SEQ_DRAW_GPENCIL, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &sseq->flag, 0, 0, 0, 0, "Display freehand annotations overlay over this Sequencer View"); + + /* extend the panel if the contents won't fit */ + newheight= draw_gpencil_panel(block, gpd, curarea); + uiNewPanelHeight(block, newheight); + } + else { + uiDefButBitI(block, TOG, SEQ_DRAW_GPENCIL, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &sseq->flag, 0, 0, 0, 0, "Display freehand annotations overlay over this Sequencer View"); + uiDefBut(block, LABEL, 1, " ", 160, 180, 150, 20, NULL, 0.0, 0.0, 0, 0, ""); + } +} + +static void seq_blockhandlers(ScrArea *sa) +{ + SpaceSeq *sseq= sa->spacedata.first; + short a; + + /* warning; blocks need to be freed each time, handlers dont remove (for ipo moved to drawipospace) */ + uiFreeBlocksWin(&sa->uiblocks, sa->win); + + for(a=0; ablockhandler[a]) { + case SEQ_HANDLER_GREASEPENCIL: + seq_panel_gpencil(sseq->blockhandler[a+1]); + break; + } + } + uiDrawBlocksPanels(sa, 0); + +} + + static void draw_cfra_seq(void) { glColor3ub(0x30, 0x90, 0x50); @@ -907,6 +975,17 @@ static void draw_image_seq(ScrArea *sa) if (free_ibuf) { IMB_freeImBuf(ibuf); } + + /* draw grease-pencil (screen aligned) */ + if (sseq->flag & SEQ_DRAW_GPENCIL) + draw_gpencil_2dview(sa, 0); + + /* ortho at pixel level sa */ + myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375); + + /* it is important to end a view in a transform compatible with buttons */ + bwin_scalematrix(sa->win, sseq->blockscale, sseq->blockscale, sseq->blockscale); + seq_blockhandlers(sa); sa->win_swap= WIN_BACK_OK; } @@ -1023,24 +1102,6 @@ void seq_viewmove(SpaceSeq *sseq) window_set_cursor(win, oldcursor); } - - -static void seq_blockhandlers(ScrArea *sa) -{ - SpaceSeq *sseq= sa->spacedata.first; - short a; - - /* warning; blocks need to be freed each time, handlers dont remove (for ipo moved to drawipospace) */ - uiFreeBlocksWin(&sa->uiblocks, sa->win); - - for(a=0; ablockhandler[a+1]= 0; - } - uiDrawBlocksPanels(sa, 0); - -} - void drawprefetchseqspace(ScrArea *sa, void *spacedata) { SpaceSeq *sseq= sa->spacedata.first; diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index f595a101f63..14434504e7a 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -61,6 +61,7 @@ #include "DNA_constraint_types.h" #include "DNA_curve_types.h" #include "DNA_group_types.h" +#include "DNA_gpencil_types.h" #include "DNA_image_types.h" #include "DNA_key_types.h" #include "DNA_lattice_types.h" @@ -111,6 +112,7 @@ #include "BIF_butspace.h" #include "BIF_drawimage.h" +#include "BIF_drawgpencil.h" #include "BIF_editgroup.h" #include "BIF_editarmature.h" #include "BIF_editmesh.h" @@ -137,6 +139,7 @@ #include "BDR_editobject.h" #include "BDR_vpaint.h" #include "BDR_sculptmode.h" +#include "BDR_gpencil.h" #include "BSE_drawview.h" #include "BSE_filesel.h" @@ -2498,7 +2501,7 @@ static void view3d_panel_background(short cntrl) // VIEW3D_HANDLER_BACKGROUND uiSetPanelHandler(VIEW3D_HANDLER_BACKGROUND); // for close and esc if(uiNewPanel(curarea, block, "Background Image", "View3d", 340, 10, 318, 204)==0) return; - if(G.f & G_VERTEXPAINT || G.f & G_WEIGHTPAINT || G.f & G_TEXTUREPAINT) { + if(G.f & G_VERTEXPAINT || G.f & G_WEIGHTPAINT || G.f & G_TEXTUREPAINT || G.f & G_GREASEPENCIL) { uiBlockSetFlag(block, UI_BLOCK_FRONTBUFFER); // force old style frontbuffer draw } @@ -2546,7 +2549,7 @@ static void view3d_panel_properties(short cntrl) // VIEW3D_HANDLER_SETTINGS /* to force height */ uiNewPanelHeight(block, 264); - if(G.f & (G_VERTEXPAINT|G_FACESELECT|G_TEXTUREPAINT|G_WEIGHTPAINT)) { + if(G.f & (G_VERTEXPAINT|G_FACESELECT|G_TEXTUREPAINT|G_WEIGHTPAINT|G_GREASEPENCIL)) { uiBlockSetFlag(block, UI_BLOCK_FRONTBUFFER); // force old style frontbuffer draw } @@ -2620,6 +2623,49 @@ static void view3d_panel_preview(ScrArea *sa, short cntrl) // VIEW3D_HANDLER_PRE } } +static void view3d_panel_gpencil(short cntrl) // VIEW3D_HANDLER_GREASEPENCIL +{ + uiBlock *block; + View3D *vd; + + vd= G.vd; + + block= uiNewBlock(&curarea->uiblocks, "view3d_panel_gpencil", UI_EMBOSS, UI_HELV, curarea->win); + uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl); + uiSetPanelHandler(VIEW3D_HANDLER_GREASEPENCIL); // for close and esc + if (uiNewPanel(curarea, block, "Grease Pencil", "View3d", 100, 30, 318, 204)==0) return; + + if (G.f & (G_VERTEXPAINT|G_WEIGHTPAINT|G_TEXTUREPAINT|G_GREASEPENCIL)) { + uiBlockSetFlag(block, UI_BLOCK_FRONTBUFFER); // force old style frontbuffer draw + } + + /* allocate memory for gpd if drawing enabled (this must be done first or else we crash) */ + if (vd->flag2 & V3D_DISPGP) { + if (vd->gpd == NULL) + gpencil_data_setactive(curarea, gpencil_data_addnew()); + } + + if (vd->flag2 & V3D_DISPGP) { + bGPdata *gpd= vd->gpd; + short newheight; + + /* this is a variable height panel, newpanel doesnt force new size on existing panels */ + /* so first we make it default height */ + uiNewPanelHeight(block, 204); + + /* draw button for showing gpencil settings and drawings */ + uiDefButBitS(block, TOG, V3D_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &vd->flag2, 0, 0, 0, 0, "Display freehand annotations overlay over this 3D View"); + + /* extend the panel if the contents won't fit */ + newheight= draw_gpencil_panel(block, gpd, curarea); + uiNewPanelHeight(block, newheight); + } + else { + uiDefButBitS(block, TOG, V3D_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &vd->flag2, 0, 0, 0, 0, "Display freehand annotations overlay over this 3D View"); + uiDefBut(block, LABEL, 1, " ", 160, 180, 150, 20, NULL, 0.0, 0.0, 0, 0, ""); + } +} + static void view3d_blockhandlers(ScrArea *sa) { @@ -2634,9 +2680,7 @@ static void view3d_blockhandlers(ScrArea *sa) glDisable(GL_DEPTH_TEST); for(a=0; ablockhandler[a]) { - case VIEW3D_HANDLER_PROPERTIES: view3d_panel_properties(v3d->blockhandler[a+1]); break; @@ -2651,7 +2695,10 @@ static void view3d_blockhandlers(ScrArea *sa) break; case VIEW3D_HANDLER_TRANSFORM: view3d_panel_transform_spaces(v3d->blockhandler[a+1]); - break; + break; + case VIEW3D_HANDLER_GREASEPENCIL: + view3d_panel_gpencil(v3d->blockhandler[a+1]); + break; } /* clear action value for event */ v3d->blockhandler[a+1]= 0; @@ -3169,7 +3216,11 @@ void drawview3dspace(ScrArea *sa, void *spacedata) v3d->zbuf= FALSE; glDisable(GL_DEPTH_TEST); } - + + /* draw grease-pencil stuff */ + if (v3d->flag2 & V3D_DISPGP) + draw_gpencil_3dview(sa, 1); + persp(PERSP_WIN); // set ortho /* Draw Sculpt Mode brush */ @@ -3211,6 +3262,11 @@ void drawview3dspace(ScrArea *sa, void *spacedata) if(v3d->persp>1) drawviewborder(); if(v3d->flag2 & V3D_FLYMODE) drawviewborder_flymode(); + + /* draw grease-pencil stuff */ + if (v3d->flag2 & V3D_DISPGP) + draw_gpencil_3dview(sa, 0); + if(!(G.f & G_PLAYANIM)) drawcursor(v3d); if(U.uiflag & USER_SHOW_ROTVIEWICON) draw_view_axis(); @@ -3311,16 +3367,15 @@ void drawview3d_render(struct View3D *v3d, int winx, int winy, float winmat[][4] /* first draw set */ if(G.scene->set) { - for(SETLOOPER(G.scene->set, base)) { if(v3d->lay & base->lay) { if ELEM3(base->object->type, OB_LAMP, OB_CAMERA, OB_LATTICE); else { where_is_object(base->object); - + BIF_ThemeColorBlend(TH_WIRE, TH_BACK, 0.6f); draw_object(base, DRAW_CONSTCOLOR|DRAW_SCENESET); - + if(base->object->transflag & OB_DUPLI) { draw_dupli_objects(v3d, base); } @@ -3377,6 +3432,13 @@ void drawview3d_render(struct View3D *v3d, int winx, int winy, float winmat[][4] glDisable(GL_DEPTH_TEST); } + if(v3d->gpd) { + /* draw grease-pencil overlays + * WARNING: view matrices are altered here! + */ + draw_gpencil_oglrender(v3d, winx, winy); + } + G.f &= ~G_SIMULATION; glFlush(); diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c index 4cc0e52ce3f..3251cb33b53 100644 --- a/source/blender/src/editaction.c +++ b/source/blender/src/editaction.c @@ -52,6 +52,7 @@ #include "DNA_mesh_types.h" #include "DNA_nla_types.h" #include "DNA_lattice_types.h" +#include "DNA_gpencil_types.h" #include "BKE_action.h" #include "BKE_armature.h" @@ -90,6 +91,7 @@ #include "BDR_drawaction.h" #include "BDR_editobject.h" +#include "BDR_gpencil.h" #include "mydevice.h" #include "blendef.h" @@ -296,6 +298,16 @@ bActListElem *make_new_actlistelem (void *data, short datatype, void *owner, sho ale->datatype= ALE_IPO; } break; + case ACTTYPE_GPLAYER: + { + bGPDlayer *gpl= (bGPDlayer *)data; + + ale->flag= gpl->flag; + + ale->key_data= NULL; + ale->datatype= ALE_GPFRAME; + } + break; } } @@ -505,6 +517,29 @@ static void actdata_filter_shapekey (ListBase *act_data, Key *key, int filter_mo } } +static void actdata_filter_gpencil (ListBase *act_data, bGPdata *gpd, int filter_mode) +{ + bActListElem *ale; + bGPDlayer *gpl; + + /* check if filtering types are appropriate */ + if ( !(filter_mode & (ACTFILTER_IPOKEYS|ACTFILTER_ONLYICU|ACTFILTER_ACTGROUPED)) ) + { + /* loop over layers as the conditions are acceptable */ + for (gpl= gpd->layers.first; gpl; gpl= gpl->next) { + /* only if selected */ + if (!(filter_mode & ACTFILTER_SEL) || SEL_GPL(gpl)) { + /* only if editable */ + if (!(filter_mode & ACTFILTER_FOREDIT) || EDITABLE_GPL(gpl)) { + /* add to list */ + ale= make_new_actlistelem(gpl, ACTTYPE_GPLAYER, NULL, ACTTYPE_NONE); + if (ale) BLI_addtail(act_data, ale); + } + } + } + } +} + /* This function filters the active data source to leave only the desired * data types. 'Public' api call. * *act_data: is a pointer to a ListBase, to which the filtered action data @@ -525,6 +560,9 @@ void actdata_filter (ListBase *act_data, int filter_mode, void *data, short data case ACTCONT_SHAPEKEY: actdata_filter_shapekey(act_data, data, filter_mode); break; + case ACTCONT_GPENCIL: + actdata_filter_gpencil(act_data, data, filter_mode); + break; } /* remove any weedy entries */ @@ -743,6 +781,10 @@ static void *get_nearest_action_key (float *selx, short *sel, short *ret_type, b bActionGroup *agrp= (bActionGroup *)ale->data; agroup_to_keylist(agrp, &act_keys, NULL, NULL); } + else if (ale->type == ACTTYPE_GPLAYER) { + bGPDlayer *gpl= (bGPDlayer *)ale->data; + gpl_to_keylist(gpl, &act_keys, NULL, NULL); + } /* loop through keyframes, finding one that was clicked on */ for (ak= act_keys.first; ak; ak= ak->next) { @@ -766,6 +808,10 @@ static void *get_nearest_action_key (float *selx, short *sel, short *ret_type, b data = ale->key_data; *ret_type= ACTTYPE_ICU; } + else if (datatype == ACTCONT_GPENCIL) { + data = ale->data; + *ret_type= ACTTYPE_GPLAYER; + } /* cleanup tempolary lists */ BLI_freelistN(&act_keys); @@ -795,17 +841,43 @@ void *get_action_context (short *datatype) act = (G.saction)? G.saction->action: NULL; key = get_action_mesh_key(); - if (act) { - *datatype= ACTCONT_ACTION; - return act; - } - else if (key) { - *datatype= ACTCONT_SHAPEKEY; - return key; + /* check mode selector */ + if (G.saction) { + switch (G.saction->mode) { + case SACTCONT_ACTION: + *datatype= ACTCONT_ACTION; + return act; + + case SACTCONT_SHAPEKEY: + *datatype= ACTCONT_SHAPEKEY; + return key; + + case SACTCONT_GPENCIL: + *datatype= ACTCONT_GPENCIL; + if (G.saction->pin) + return G.saction->gpd; + else + return gpencil_data_getetime(G.curscreen); + + default: /* includes SACTCONT_DOPESHEET for now */ + *datatype= ACTCONT_NONE; + return NULL; + } } else { - *datatype= ACTCONT_NONE; - return NULL; + /* resort to guessing based on what is available */ + if (act) { + *datatype= ACTCONT_ACTION; + return act; + } + else if (key) { + *datatype= ACTCONT_SHAPEKEY; + return key; + } + else { + *datatype= ACTCONT_NONE; + return NULL; + } } } @@ -1307,12 +1379,18 @@ void duplicate_action_keys (void) if (data == NULL) return; /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS); + if (datatype == ACTCONT_GPENCIL) + filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT); + else + filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS); actdata_filter(&act_data, filter, data, datatype); /* loop through filtered data and duplicate selected keys */ for (ale= act_data.first; ale; ale= ale->next) { - duplicate_ipo_keys((Ipo *)ale->key_data); + if (ale->type == ACTTYPE_GPLAYER) + duplicate_gplayer_frames(ale->data); + else + duplicate_ipo_keys((Ipo *)ale->key_data); } /* free filtered list */ @@ -1398,7 +1476,10 @@ void snap_action_keys(short mode) } /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS); + if (datatype == ACTCONT_GPENCIL) + filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT); + else + filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS); actdata_filter(&act_data, filter, data, datatype); /* snap to frame */ @@ -1408,6 +1489,8 @@ void snap_action_keys(short mode) snap_ipo_keys(ale->key_data, mode); actstrip_map_ipo_keys(OBACT, ale->key_data, 1, 1); } + else if (ale->type == ACTTYPE_GPLAYER) + snap_gplayer_frames(ale->data, mode); else snap_ipo_keys(ale->key_data, mode); } @@ -1421,6 +1504,7 @@ void snap_action_keys(short mode) allqueue(REDRAWACTION, 0); allqueue(REDRAWIPO, 0); allqueue(REDRAWNLA, 0); + allqueue(REDRAWVIEW3D, 0); } /* this function is responsible for snapping keyframes to frame-times */ @@ -1456,7 +1540,10 @@ void mirror_action_keys(short mode) } /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS); + if (datatype == ACTCONT_GPENCIL) + filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT); + else + filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS); actdata_filter(&act_data, filter, data, datatype); /* mirror */ @@ -1466,6 +1553,8 @@ void mirror_action_keys(short mode) mirror_ipo_keys(ale->key_data, mode); actstrip_map_ipo_keys(OBACT, ale->key_data, 1, 1); } + else if (ale->type == ACTTYPE_GPLAYER) + mirror_gplayer_frames(ale->data, mode); else mirror_ipo_keys(ale->key_data, mode); } @@ -1550,6 +1639,10 @@ void insertkey_action(void) } } } + else { + /* this tool is not supported in this mode */ + return; + } BIF_undo_push("Insert Key"); allspace(REMAKEIPO, 0); @@ -1573,12 +1666,18 @@ void delete_action_keys (void) if (data == NULL) return; /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS); + if (datatype == ACTCONT_GPENCIL) + filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT); + else + filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS); actdata_filter(&act_data, filter, data, datatype); /* loop through filtered data and delete selected keys */ for (ale= act_data.first; ale; ale= ale->next) { - delete_ipo_keys((Ipo *)ale->key_data); + if (ale->type == ACTTYPE_GPLAYER) + delete_gplayer_frames((bGPDlayer *)ale->data); + else + delete_ipo_keys((Ipo *)ale->key_data); } /* free filtered list */ @@ -1699,6 +1798,7 @@ void clean_action (void) 0.0000001f, 1.0, 0.001, 0.1, "Clean Threshold"); if (!ok) return; + if (datatype == ACTCONT_GPENCIL) return; /* filter data */ filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_SEL | ACTFILTER_ONLYICU); @@ -1737,6 +1837,7 @@ void sample_action_keys (void) /* sanity checks */ data= get_action_context(&datatype); if (data == NULL) return; + if (datatype == ACTCONT_GPENCIL) return; /* filter data */ filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_ONLYICU); @@ -2096,6 +2197,7 @@ void action_set_ipo_flags (short mode, short event) /* determine what type of data we are operating on */ data = get_action_context(&datatype); if (data == NULL) return; + if (datatype == ACTCONT_GPENCIL) return; /* determine which set of processing we are doing */ switch (mode) { @@ -2194,6 +2296,7 @@ void sethandles_action_keys (int code) /* determine what type of data we are operating on */ data = get_action_context(&datatype); if (data == NULL) return; + if (datatype == ACTCONT_GPENCIL) return; /* filter data */ filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS); @@ -2232,11 +2335,12 @@ static void numbuts_action () bConstraintChannel *conchan= NULL; IpoCurve *icu= NULL; KeyBlock *kb= NULL; + bGPDlayer *gpl= NULL; short mval[2]; int but=0; - char str[64]; + char str[128]; short expand, protect, mute; float slidermin, slidermax; @@ -2345,6 +2449,18 @@ static void numbuts_action () add_numbut(but++, TOG|SHO, "Expanded", 0, 24, &expand, "Action Group is Expanded"); add_numbut(but++, TOG|SHO, "Protected", 0, 24, &protect, "Group is Protected"); } + else if (chantype == ACTTYPE_GPLAYER) { + /* Grease-Pencil Layer */ + gpl= (bGPDlayer *)act_channel; + + strcpy(str, gpl->info); + protect= (gpl->flag & GP_LAYER_LOCKED); + mute = (gpl->flag & GP_LAYER_HIDE); + + add_numbut(but++, TEX, "GP-Layer: ", 0, 128, str, "Name of Grease Pencil Layer"); + add_numbut(but++, TOG|SHO, "Hide", 0, 24, &mute, "Grease Pencil Layer is Visible"); + add_numbut(but++, TOG|SHO, "Protected", 0, 24, &protect, "Grease Pencil Layer is Protected"); + } else { /* nothing under-cursor */ return; @@ -2393,6 +2509,16 @@ static void numbuts_action () if (protect) agrp->flag |= AGRP_PROTECTED; else agrp->flag &= ~AGRP_PROTECTED; } + else if (gpl) { + strcpy(gpl->info, str); + BLI_uniquename(&( ((bGPdata *)data)->layers ), gpl, "GP_Layer", offsetof(bGPDlayer, info), 128); + + if (mute) gpl->flag |= GP_LAYER_HIDE; + else gpl->flag &= ~GP_LAYER_HIDE;; + + if (protect) gpl->flag |= GP_LAYER_LOCKED; + else gpl->flag &= ~GP_LAYER_LOCKED; + } allqueue(REDRAWACTION, 0); allspace(REMAKEIPO, 0); @@ -2524,6 +2650,31 @@ void setflag_action_channels (short mode) } } break; + case ACTTYPE_GPLAYER: + { + bGPDlayer *gpl= (bGPDlayer *)ale->data; + + /* 'protect' and 'mute' */ + if (val == 2) { + /* mute */ + if (mode == 2) + gpl->flag &= ~GP_LAYER_HIDE; + else if (mode == 1) + gpl->flag |= GP_LAYER_HIDE; + else + gpl->flag ^= GP_LAYER_HIDE; + } + else if (val == 1) { + /* protected */ + if (mode == 2) + gpl->flag &= ~GP_LAYER_LOCKED; + else if (mode == 1) + gpl->flag |= GP_LAYER_LOCKED; + else + gpl->flag ^= GP_LAYER_LOCKED; + } + } + break; } } BLI_freelistN(&act_data); @@ -2564,7 +2715,7 @@ static void select_action_group (bAction *act, bActionGroup *agrp, int selectmod set_active_actiongroup(act, agrp, select); } -static void hilight_channel(bAction *act, bActionChannel *achan, short select) +static void hilight_channel (bAction *act, bActionChannel *achan, short select) { bActionChannel *curchan; @@ -2637,7 +2788,7 @@ void select_actionchannel_by_name (bAction *act, char *name, int select) /* exported for outliner (ton) */ /* apparently within active object context */ -int select_channel(bAction *act, bActionChannel *achan, int selectmode) +int select_channel (bAction *act, bActionChannel *achan, int selectmode) { /* Select the channel based on the selection mode */ int flag; @@ -2661,9 +2812,9 @@ int select_channel(bAction *act, bActionChannel *achan, int selectmode) return flag; } -static int select_constraint_channel(bAction *act, - bConstraintChannel *conchan, - int selectmode) +static int select_constraint_channel (bAction *act, + bConstraintChannel *conchan, + int selectmode) { /* Select the constraint channel based on the selection mode */ int flag; @@ -2684,7 +2835,7 @@ static int select_constraint_channel(bAction *act, return flag; } -int select_icu_channel(bAction *act, IpoCurve *icu, int selectmode) +int select_icu_channel (bAction *act, IpoCurve *icu, int selectmode) { /* Select the channel based on the selection mode */ int flag; @@ -2704,6 +2855,29 @@ int select_icu_channel(bAction *act, IpoCurve *icu, int selectmode) return flag; } +int select_gplayer_channel (bGPdata *gpd, bGPDlayer *gpl, int selectmode) +{ + /* Select the channel based on the selection mode */ + int flag; + + switch (selectmode) { + case SELECT_ADD: + gpl->flag |= GP_LAYER_SELECT; + break; + case SELECT_SUBTRACT: + gpl->flag &= ~GP_LAYER_SELECT; + break; + case SELECT_INVERT: + gpl->flag ^= GP_LAYER_SELECT; + break; + } + flag = (gpl->flag & GP_LAYER_SELECT) ? 1 : 0; + + gpencil_layer_setactive(gpd, gpl); + + return flag; +} + /* select only the active action-group's action channels */ void select_action_group_channels (bAction *act, bActionGroup *agrp) @@ -2848,6 +3022,8 @@ void deselect_action_channels (short mode) /* based on type */ if (datatype == ACTCONT_ACTION) deselect_actionchannels(data, mode); + else if (datatype == ACTCONT_GPENCIL) + deselect_gpencil_layers(data, mode); // should shapekey channels be allowed to do this? } @@ -2863,24 +3039,40 @@ void deselect_action_keys (short test, short sel) /* determine what type of data we are operating on */ data = get_action_context(&datatype); if (data == NULL) return; - + + /* determine type-based settings */ + if (datatype == ACTCONT_GPENCIL) + filter= (ACTFILTER_VISIBLE); + else + filter= (ACTFILTER_VISIBLE | ACTFILTER_IPOKEYS); + /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_IPOKEYS); actdata_filter(&act_data, filter, data, datatype); /* See if we should be selecting or deselecting */ if (test) { for (ale= act_data.first; ale; ale= ale->next) { - if (is_ipo_key_selected(ale->key_data)) { - sel= 0; - break; + if (ale->type == ACTTYPE_GPLAYER) { + if (is_gplayer_frame_selected(ale->data)) { + sel= 0; + break; + } + } + else { + if (is_ipo_key_selected(ale->key_data)) { + sel= 0; + break; + } } } } /* Now set the flags */ for (ale= act_data.first; ale; ale= ale->next) { - set_ipo_key_selection(ale->key_data, sel); + if (ale->type == ACTTYPE_GPLAYER) + set_gplayer_frame_selection(ale->data, sel); + else + set_ipo_key_selection(ale->key_data, sel); } /* Cleanup */ @@ -2946,6 +3138,12 @@ void selectall_action_keys (short mval[], short mode, short select_mode) select_icu_bezier_keys(icu, select_mode); } break; + case ACTTYPE_GPLAYER: + { + bGPDlayer *gpl= (bGPDlayer *)act_channel; + select_gpencil_frames(gpl, select_mode); + } + break; } } break; @@ -2971,12 +3169,16 @@ void selectall_action_keys (short mval[], short mode, short select_mode) rectf.xmax = rectf.xmax + 0.5; /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_IPOKEYS); + if (datatype == ACTCONT_GPENCIL) + filter= (ACTFILTER_VISIBLE); + else + filter= (ACTFILTER_VISIBLE | ACTFILTER_IPOKEYS); actdata_filter(&act_data, filter, data, datatype); /* Now set the flags */ - for (ale= act_data.first; ale; ale= ale->next) + for (ale= act_data.first; ale; ale= ale->next) { borderselect_ipo_key(ale->key_data, rectf.xmin, rectf.xmax, select_mode); + } /* Cleanup */ BLI_freelistN(&act_data); @@ -3058,19 +3260,23 @@ void selectkeys_leftright (short leftright, short select_mode) } /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_IPOKEYS); + if (datatype == ACTCONT_GPENCIL) + filter= (ACTFILTER_VISIBLE); + else + filter= (ACTFILTER_VISIBLE | ACTFILTER_IPOKEYS); actdata_filter(&act_data, filter, data, datatype); /* select keys on the side where most data occurs */ for (ale= act_data.first; ale; ale= ale->next) { - if(NLA_ACTION_SCALED && datatype==ACTCONT_ACTION) { + if (NLA_ACTION_SCALED && datatype==ACTCONT_ACTION) { actstrip_map_ipo_keys(OBACT, ale->key_data, 0, 1); borderselect_ipo_key(ale->key_data, min, max, SELECT_ADD); actstrip_map_ipo_keys(OBACT, ale->key_data, 1, 1); } - else { + else if (ale->type == ACTTYPE_GPLAYER) + borderselect_gplayer_frames(ale->data, min, max, SELECT_ADD); + else borderselect_ipo_key(ale->key_data, min, max, SELECT_ADD); - } } /* Cleanup */ @@ -3108,7 +3314,10 @@ void nextprev_action_keyframe (short dir) return; /* get list of keyframes that can be used (in global-time) */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_IPOKEYS); + if (datatype == ACTCONT_GPENCIL) + filter= (ACTFILTER_VISIBLE); + else + filter= (ACTFILTER_VISIBLE | ACTFILTER_IPOKEYS); actdata_filter(&act_data, filter, data, datatype); for (ale= act_data.first; ale; ale= ale->next) { @@ -3117,6 +3326,8 @@ void nextprev_action_keyframe (short dir) make_cfra_list(ale->key_data, &elems); actstrip_map_ipo_keys(OBACT, ale->key_data, 1, 1); } + else if (ale->type == ACTTYPE_GPLAYER) + gplayer_make_cfra_list(ale->key_data, &elems, 0); else make_cfra_list(ale->key_data, &elems); } @@ -3199,11 +3410,20 @@ void column_select_action_keys (int mode) /* build list of columns */ switch (mode) { case 1: /* list of selected keys */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_IPOKEYS); - actdata_filter(&act_data, filter, data, datatype); - - for (ale= act_data.first; ale; ale= ale->next) - make_sel_cfra_list(ale->key_data, &elems); + if (datatype == ACTCONT_GPENCIL) { + filter= (ACTFILTER_VISIBLE); + actdata_filter(&act_data, filter, data, datatype); + + for (ale= act_data.first; ale; ale= ale->next) + gplayer_make_cfra_list(ale->data, &elems, 1); + } + else { + filter= (ACTFILTER_VISIBLE | ACTFILTER_IPOKEYS); + actdata_filter(&act_data, filter, data, datatype); + + for (ale= act_data.first; ale; ale= ale->next) + make_sel_cfra_list(ale->key_data, &elems); + } BLI_freelistN(&act_data); break; @@ -3231,19 +3451,34 @@ void column_select_action_keys (int mode) /* loop through all of the keys and select additional keyframes * based on the keys found to be selected above */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_ONLYICU); + if (datatype == ACTCONT_GPENCIL) + filter= (ACTFILTER_VISIBLE); + else + filter= (ACTFILTER_VISIBLE | ACTFILTER_ONLYICU); actdata_filter(&act_data, filter, data, datatype); for (ale= act_data.first; ale; ale= ale->next) { for (ce= elems.first; ce; ce= ce->next) { - for (icu= ale->key_data; icu; icu= icu->next) { - BezTriple *bezt; - int verts = 0; + /* select elements with frame number matching cfraelem */ + if (ale->type == ACTTYPE_GPLAYER) { + bGPDlayer *gpl= (bGPDlayer *)ale->data; + bGPDframe *gpf; - for (bezt=icu->bezt; vertstotvert; bezt++, verts++) { - if (bezt) { - if( (int)(ce->cfra) == (int)(bezt->vec[1][0]) ) - bezt->f2 |= 1; + for (gpf= gpl->frames.first; gpf; gpf= gpf->next) { + if ( (int)ce->cfra == gpf->framenum ) + gpf->flag |= GP_FRAME_SELECT; + } + } + else { + for (icu= ale->key_data; icu; icu= icu->next) { + BezTriple *bezt; + int verts = 0; + + for (bezt=icu->bezt; vertstotvert; bezt++, verts++) { + if (bezt) { + if( (int)(ce->cfra) == (int)(bezt->vec[1][0]) ) + bezt->f2 |= 1; + } } } } @@ -3272,7 +3507,7 @@ void borderselect_actionchannels (void) /* determine what type of data we are operating on */ data = get_action_context(&datatype); if (data == NULL) return; - if (datatype != ACTCONT_ACTION) return; + if (ELEM(datatype, ACTCONT_ACTION, ACTCONT_GPENCIL)==0) return; /* draw and handle the borderselect stuff (ui) and get the select rect */ if ( (val = get_border(&rect, 3)) ) { @@ -3344,6 +3579,16 @@ void borderselect_actionchannels (void) icu->flag &= ~IPO_SELECT; } break; + case ACTTYPE_GPLAYER: /* grease-pencil layer */ + { + bGPDlayer *gpl = (bGPDlayer *)ale->data; + + if (selectmode == SELECT_ADD) + gpl->flag |= GP_LAYER_SELECT; + else + gpl->flag &= ~GP_LAYER_SELECT; + } + break; } /* select action-channel 'owner' */ @@ -3460,6 +3705,9 @@ void borderselect_action (void) borderselect_ipo_key(conchan->ipo, rectf.xmin, rectf.xmax, selectmode); } } + else if (ale->type == ACTTYPE_GPLAYER) { + borderselect_gplayer_frames(ale->data, rectf.xmin, rectf.xmax, selectmode); + } break; case ACTEDIT_BORDERSEL_CHA: /* all in channel(s) */ if (!((ymax < rectf.ymin) || (ymin > rectf.ymax))) { @@ -3481,6 +3729,9 @@ void borderselect_action (void) select_ipo_bezier_keys(conchan->ipo, selectmode); } } + else if (ale->type == ACTTYPE_GPLAYER) { + select_gpencil_frames(ale->data, selectmode); + } } break; default: /* any keyframe inside region defined by region */ @@ -3503,6 +3754,9 @@ void borderselect_action (void) borderselect_ipo_key(conchan->ipo, rectf.xmin, rectf.xmax, selectmode); } } + else if (ale->type == ACTTYPE_GPLAYER) { + borderselect_gplayer_frames(ale->data, rectf.xmin, rectf.xmax, selectmode); + } } } @@ -3533,6 +3787,8 @@ static void mouse_action (int selectmode) bActionChannel *achan= NULL; bConstraintChannel *conchan= NULL; IpoCurve *icu= NULL; + bGPdata *gpd = NULL; + bGPDlayer *gpl = NULL; TimeMarker *marker, *pmarker; void *act_channel; @@ -3543,6 +3799,7 @@ static void mouse_action (int selectmode) data = get_action_context(&datatype); if (data == NULL) return; if (datatype == ACTCONT_ACTION) act= (bAction *)data; + if (datatype == ACTCONT_GPENCIL) gpd= (bGPdata *)data; act_channel= get_nearest_action_key(&selx, &sel, &act_type, &achan); marker= find_nearest_marker(SCE_MARKERS, 1); @@ -3615,6 +3872,9 @@ static void mouse_action (int selectmode) case ACTTYPE_GROUP: agrp= (bActionGroup *)act_channel; break; + case ACTTYPE_GPLAYER: + gpl= (bGPDlayer *)act_channel; + break; default: return; } @@ -3638,6 +3898,13 @@ static void mouse_action (int selectmode) set_active_actiongroup(act, agrp, 1); } } + else if (datatype == ACTCONT_GPENCIL) { + deselect_action_channels(0); + + /* Highlight gpencil layer */ + gpl->flag |= GP_LAYER_SELECT; + gpencil_layer_setactive(gpd, gpl); + } } if (icu) @@ -3654,6 +3921,8 @@ static void mouse_action (int selectmode) select_ipo_key(conchan->ipo, selx, selectmode); } } + else if (gpl) + select_gpencil_frame(gpl, selx, selectmode); std_rmouse_transform(transform_action_keys); @@ -3670,6 +3939,7 @@ static void mouse_action (int selectmode) static void mouse_actionchannels (short mval[]) { bAction *act= G.saction->action; + bGPdata *gpd= G.saction->gpd; void *data, *act_channel; short datatype, chantype; @@ -3816,6 +4086,24 @@ static void mouse_actionchannels (short mval[]) } } break; + case ACTTYPE_GPLAYER: + { + bGPDlayer *gpl= (bGPDlayer *)act_channel; + + if (mval[0] >= (NAMEWIDTH-16)) { + /* toggle lock */ + gpl->flag ^= GP_LAYER_LOCKED; + } + else if (mval[0] >= (NAMEWIDTH-32)) { + /* toggle hide */ + gpl->flag ^= GP_LAYER_HIDE; + } + else { + /* select/deselect */ + select_gplayer_channel(gpd, gpl, SELECT_INVERT); + } + } + break; default: return; } @@ -4482,7 +4770,7 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt) case RIGHTMOUSE: /* Clicking in the channel area */ if ((G.v2d->mask.xmin) && (mval[0] < NAMEWIDTH)) { - if (datatype == ACTCONT_ACTION) { + if (ELEM(datatype, ACTCONT_ACTION, ACTCONT_GPENCIL)) { /* mouse is over action channels */ if (G.qual == LR_CTRLKEY) numbuts_action(); @@ -4832,8 +5120,12 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt) case DELKEY: case XKEY: if (okee("Erase selected")) { - if (mval[0] < NAMEWIDTH) - delete_action_channels(); + if (mval[0] < NAMEWIDTH) { + if (datatype == ACTCONT_ACTION) + delete_action_channels(); + else if (datatype == ACTCONT_GPENCIL) + delete_gpencil_layers(); + } else delete_action_keys(); diff --git a/source/blender/src/editaction_gpencil.c b/source/blender/src/editaction_gpencil.c new file mode 100644 index 00000000000..b91c5a8b332 --- /dev/null +++ b/source/blender/src/editaction_gpencil.c @@ -0,0 +1,549 @@ +/** + * $Id: editaction_gpencil.c 14881 2008-05-18 10:41:42Z aligorith $ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2008, Blender Foundation + * This is a new part of Blender + * + * Contributor(s): Joshua Leung + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include +#include +#include +#include + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "MEM_guardedalloc.h" + +#include "BMF_Api.h" + +#include "BLI_arithb.h" +#include "BLI_blenlib.h" + +#include "DNA_listBase.h" +#include "DNA_action_types.h" +#include "DNA_gpencil_types.h" +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" +#include "DNA_space_types.h" +#include "DNA_userdef_types.h" +#include "DNA_view3d_types.h" +#include "DNA_view2d_types.h" + +#include "BKE_global.h" +#include "BKE_utildefines.h" +#include "BKE_blender.h" +#include "BKE_ipo.h" + +#include "BIF_gl.h" +#include "BIF_glutil.h" +#include "BIF_butspace.h" +#include "BIF_graphics.h" +#include "BIF_interface.h" +#include "BIF_mywindow.h" +#include "BIF_resources.h" +#include "BIF_space.h" +#include "BIF_screen.h" +#include "BIF_toolbox.h" +#include "BIF_toets.h" + +#include "BIF_editaction.h" +#include "BSE_editaction_types.h" + +#include "BDR_gpencil.h" +#include "BIF_drawgpencil.h" + +#include "BSE_drawipo.h" +#include "BSE_headerbuttons.h" +#include "BSE_time.h" +#include "BSE_view.h" + +#include "blendef.h" +#include "butspace.h" + +#include "PIL_time.h" /* sleep */ +#include "mydevice.h" + +/* ***************************************** */ +/* NOTE ABOUT THIS FILE: + * This file contains code for editing Grease Pencil data in the Action Editor + * as a 'keyframes', so that a user can adjust the timing of Grease Pencil drawings. + * Therefore, this file mostly contains functions for selecting Grease-Pencil frames. + */ +/* ***************************************** */ +/* Generics - Loopers */ + +/* Loops over the gp-frames for a gp-layer, and applies the given callback */ +short gplayer_frames_looper (bGPDlayer *gpl, short (*gpf_cb)(bGPDframe *)) +{ + bGPDframe *gpf; + + /* error checker */ + if (gpl == NULL) + return 0; + + /* do loop */ + for (gpf= gpl->frames.first; gpf; gpf= gpf->next) { + /* execute callback */ + if (gpf_cb(gpf)) + return 1; + } + + /* nothing to return */ + return 0; +} + +/* ****************************************** */ +/* Data Conversion Tools */ + +/* make a listing all the gp-frames in a layer as cfraelems */ +void gplayer_make_cfra_list (bGPDlayer *gpl, ListBase *elems, short onlysel) +{ + bGPDframe *gpf; + CfraElem *ce; + + /* error checking */ + if (ELEM(NULL, gpl, elems)) + return; + + /* loop through gp-frames, adding */ + for (gpf= gpl->frames.first; gpf; gpf= gpf->next) { + if ((onlysel == 0) || (gpf->flag & GP_FRAME_SELECT)) { + ce= MEM_callocN(sizeof(CfraElem), "CfraElem"); + + ce->cfra= gpf->framenum; + ce->sel= (gpf->flag & GP_FRAME_SELECT) ? 1 : 0; + + BLI_addtail(elems, ce); + } + } +} + +/* ***************************************** */ +/* Selection Tools */ + +/* check if one of the frames in this layer is selected */ +short is_gplayer_frame_selected (bGPDlayer *gpl) +{ + bGPDframe *gpf; + + /* error checking */ + if (gpl == NULL) + return 0; + + /* stop at the first one found */ + for (gpf= gpl->frames.first; gpf; gpf= gpf->next) { + if (gpf->flag & GP_FRAME_SELECT) + return 1; + } + + /* not found */ + return 0; +} + +/* helper function - select gp-frame based on SELECT_* mode */ +static void gpframe_select (bGPDframe *gpf, short select_mode) +{ + switch (select_mode) { + case SELECT_ADD: + gpf->flag |= GP_FRAME_SELECT; + break; + case SELECT_SUBTRACT: + gpf->flag &= ~GP_FRAME_SELECT; + break; + case SELECT_INVERT: + gpf->flag ^= GP_FRAME_SELECT; + break; + } +} + +/* set all/none/invert select (like above, but with SELECT_* modes) */ +void select_gpencil_frames (bGPDlayer *gpl, short select_mode) +{ + bGPDframe *gpf; + + /* error checking */ + if (gpl == NULL) + return; + + /* handle according to mode */ + for (gpf= gpl->frames.first; gpf; gpf= gpf->next) { + gpframe_select(gpf, select_mode); + } +} + +/* set all/none/invert select */ +void set_gplayer_frame_selection (bGPDlayer *gpl, short mode) +{ + /* error checking */ + if (gpl == NULL) + return; + + /* convert mode to select_mode */ + switch (mode) { + case 2: + mode= SELECT_INVERT; + break; + case 1: + mode= SELECT_ADD; + break; + case 0: + mode= SELECT_SUBTRACT; + break; + default: + return; + } + + /* now call the standard function */ + select_gpencil_frames (gpl, mode); +} + +void select_gpencil_frame (bGPDlayer *gpl, int selx, short select_mode) +{ + bGPDframe *gpf; + + /* search through frames for a match */ + for (gpf= gpl->frames.first; gpf; gpf= gpf->next) { + if (gpf->framenum == selx) + gpframe_select(gpf, select_mode); + } +} + +void borderselect_gplayer_frames (bGPDlayer *gpl, float min, float max, short select_mode) +{ + bGPDframe *gpf; + + /* only select those frames which are in bounds */ + for (gpf= gpl->frames.first; gpf; gpf= gpf->next) { + if (IN_RANGE(gpf->framenum, min, max)) + gpframe_select(gpf, select_mode); + } +} + + +/* De-selects or inverts the selection of Layers for a grease-pencil block + * mode: 0 = default behaviour (select all), 1 = test if (de)select all, 2 = invert all + */ +void deselect_gpencil_layers (bGPdata *gpd, short mode) +{ + ListBase act_data = {NULL, NULL}; + bActListElem *ale; + int filter, sel=1; + + /* filter data */ + filter= ACTFILTER_VISIBLE; + actdata_filter(&act_data, filter, gpd, ACTCONT_GPENCIL); + + /* See if we should be selecting or deselecting */ + if (mode == 1) { + for (ale= act_data.first; ale; ale= ale->next) { + if (sel == 0) + break; + + if (ale->flag & GP_LAYER_SELECT) + sel= 0; + } + } + else + sel= 0; + + /* Now set the flags */ + for (ale= act_data.first; ale; ale= ale->next) { + bGPDlayer *gpl= (bGPDlayer *)ale->data; + + if (mode == 2) + gpl->flag ^= GP_LAYER_SELECT; + else if (sel) + gpl->flag |= GP_LAYER_SELECT; + else + gpl->flag &= ~GP_LAYER_SELECT; + + gpl->flag &= ~GP_LAYER_ACTIVE; + } + + /* Cleanup */ + BLI_freelistN(&act_data); +} + +/* ***************************************** */ +/* Frame Editing Tools */ + +void delete_gpencil_layers (void) +{ + ListBase act_data = {NULL, NULL}; + bActListElem *ale, *next; + bGPdata *gpd; + void *data; + short datatype; + int filter; + + /* determine what type of data we are operating on */ + data = get_action_context(&datatype); + if (data == NULL) return; + if (datatype != ACTCONT_GPENCIL) return; + gpd= (bGPdata *)data; + + /* filter data */ + filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_CHANNELS | ACTFILTER_SEL); + actdata_filter(&act_data, filter, data, datatype); + + /* clean up grease-pencil layers */ + for (ale= act_data.first; ale; ale= next) { + bGPDlayer *gpl= (bGPDlayer *)ale->data; + next= ale->next; + + /* free layer and its data */ + if (SEL_GPL(gpl)) { + free_gpencil_frames(gpl); + BLI_freelinkN(&gpd->layers, gpl); + } + + /* free temp memory */ + BLI_freelinkN(&act_data, ale); + } + + BIF_undo_push("Delete GPencil Layers"); + allspace(REDRAWVIEW3D, 0); + allqueue(REDRAWACTION, 0); +} + +/* Delete selected frames */ +void delete_gplayer_frames (bGPDlayer *gpl) +{ + bGPDframe *gpf, *gpfn; + + /* error checking */ + if (gpl == NULL) + return; + + /* check for frames to delete */ + for (gpf= gpl->frames.first; gpf; gpf= gpfn) { + gpfn= gpf->next; + + if (gpf->flag & GP_FRAME_SELECT) + gpencil_layer_delframe(gpl, gpf); + } +} + +/* Duplicate selected frames from given gp-layer */ +void duplicate_gplayer_frames (bGPDlayer *gpl) +{ + bGPDframe *gpf, *gpfn; + + /* error checking */ + if (gpl == NULL) + return; + + /* duplicate selected frames */ + for (gpf= gpl->frames.first; gpf; gpf= gpfn) { + gpfn= gpf->next; + + /* duplicate this frame */ + if (gpf->flag & GP_FRAME_SELECT) { + bGPDframe *gpfd; + bGPDstroke *gps; + + /* duplicate frame, and deselect self */ + gpfd= MEM_dupallocN(gpf); + gpf->flag &= ~GP_FRAME_SELECT; + + /* duplicate list of strokes too */ + duplicatelist(&gpfd->strokes, &gpf->strokes); + + /* dupalloc only makes another copy of mem, but doesn't adjust pointers */ + for (gps= gpfd->strokes.first; gps; gps= gps->next) { + gps->points= MEM_dupallocN(gps->points); + } + + BLI_insertlinkafter(&gpl->frames, gpf, gpfd); + } + } +} + +/* -------------------------------------- */ +/* Snap Tools */ + +static short snap_gpf_nearest (bGPDframe *gpf) +{ + if (gpf->flag & GP_FRAME_SELECT) + gpf->framenum= (int)(floor(gpf->framenum+0.5)); + return 0; +} + +static short snap_gpf_nearestsec (bGPDframe *gpf) +{ + float secf = FPS; + if (gpf->flag & GP_FRAME_SELECT) + gpf->framenum= (int)(floor(gpf->framenum/secf + 0.5f) * secf); + return 0; +} + +static short snap_gpf_cframe (bGPDframe *gpf) +{ + if (gpf->flag & GP_FRAME_SELECT) + gpf->framenum= (int)CFRA; + return 0; +} + +static short snap_gpf_nearmarker (bGPDframe *gpf) +{ + if (gpf->flag & GP_FRAME_SELECT) + gpf->framenum= (int)find_nearest_marker_time(gpf->framenum); + return 0; +} + + +/* snap selected frames to ... */ +void snap_gplayer_frames (bGPDlayer *gpl, short mode) +{ + switch (mode) { + case 1: /* snap to nearest frame */ + gplayer_frames_looper(gpl, snap_gpf_nearest); + break; + case 2: /* snap to current frame */ + gplayer_frames_looper(gpl, snap_gpf_cframe); + break; + case 3: /* snap to nearest marker */ + gplayer_frames_looper(gpl, snap_gpf_nearmarker); + break; + case 4: /* snap to nearest second */ + gplayer_frames_looper(gpl, snap_gpf_nearestsec); + break; + default: /* just in case */ + gplayer_frames_looper(gpl, snap_gpf_nearest); + break; + } +} + +/* -------------------------------------- */ +/* Mirror Tools */ + +static short mirror_gpf_cframe (bGPDframe *gpf) +{ + float diff; + + if (gpf->flag & GP_FRAME_SELECT) { + diff= ((float)CFRA - gpf->framenum); + gpf->framenum= ((float)CFRA + diff); + } + + return 0; +} + +static short mirror_gpf_yaxis (bGPDframe *gpf) +{ + float diff; + + if (gpf->flag & GP_FRAME_SELECT) { + diff= (0.0f - gpf->framenum); + gpf->framenum= (0.0f + diff); + } + + return 0; +} + +static short mirror_gpf_xaxis (bGPDframe *gpf) +{ + float diff; + + if (gpf->flag & GP_FRAME_SELECT) { + diff= (0.0f - gpf->framenum); + gpf->framenum= (0.0f + diff); + } + + return 0; +} + +static short mirror_gpf_marker (bGPDframe *gpf) +{ + static TimeMarker *marker; + static short initialised = 0; + float diff; + + /* In order for this mirror function to work without + * any extra arguments being added, we use the case + * of bezt==NULL to denote that we should find the + * marker to mirror over. The static pointer is safe + * to use this way, as it will be set to null after + * each cycle in which this is called. + */ + + if (gpf) { + /* mirroring time */ + if ((gpf->flag & GP_FRAME_SELECT) && (marker)) { + diff= (marker->frame - gpf->framenum); + gpf->framenum= (marker->frame + diff); + } + } + else { + /* initialisation time */ + if (initialised) { + /* reset everything for safety */ + marker = NULL; + initialised = 0; + } + else { + /* try to find a marker */ + for (marker= G.scene->markers.first; marker; marker=marker->next) { + if (marker->flag & SELECT) { + initialised = 1; + break; + } + } + + if (initialised == 0) + marker = NULL; + } + } + + return 0; +} + + +/* mirror selected gp-frames on... */ +void mirror_gplayer_frames (bGPDlayer *gpl, short mode) +{ + switch (mode) { + case 1: /* mirror over current frame */ + gplayer_frames_looper(gpl, mirror_gpf_cframe); + break; + case 2: /* mirror over frame 0 */ + gplayer_frames_looper(gpl, mirror_gpf_yaxis); + break; + case 3: /* mirror over value 0 */ + gplayer_frames_looper(gpl, mirror_gpf_xaxis); + break; + case 4: /* mirror over marker */ + mirror_gpf_marker(NULL); + gplayer_frames_looper(gpl, mirror_gpf_marker); + mirror_gpf_marker(NULL); + break; + default: /* just in case */ + gplayer_frames_looper(gpl, mirror_gpf_yaxis); + break; + } +} + +/* ***************************************** */ diff --git a/source/blender/src/editmesh.c b/source/blender/src/editmesh.c index 9eef61e11f9..188f7476728 100644 --- a/source/blender/src/editmesh.c +++ b/source/blender/src/editmesh.c @@ -340,8 +340,9 @@ void free_editface(EditFace *efa) #endif EM_remove_selection(efa, EDITFACE); - if (G.editMesh->act_face==efa) - EM_set_actFace(NULL); + if (G.editMesh->act_face==efa) { + EM_set_actFace( G.editMesh->faces.first == efa ? NULL : G.editMesh->faces.first); + } CustomData_em_free_block(&G.editMesh->fdata, &efa->data); if(efa->fast==0) @@ -1059,7 +1060,11 @@ void make_editMesh() EM_hide_reset(); /* sets helper flags which arent saved */ EM_fgon_flags(); - + + if (EM_get_actFace(0)==NULL) { + EM_set_actFace( G.editMesh->faces.first ); /* will use the first face, this is so we alwats have an active face */ + } + /* vertex coordinates change with cache edit, need to recalc */ if(cacheedit) recalc_editnormals(); diff --git a/source/blender/src/editnode.c b/source/blender/src/editnode.c index 4c7334c55e0..5c137e67c1a 100644 --- a/source/blender/src/editnode.c +++ b/source/blender/src/editnode.c @@ -82,6 +82,7 @@ #include "BLI_storage_types.h" #include "BDR_editobject.h" +#include "BDR_gpencil.h" #include "RE_pipeline.h" #include "IMB_imbuf_types.h" @@ -2305,6 +2306,7 @@ static int node_uiDoBlocks(ScrArea *sa, short event) SpaceNode *snode= sa->spacedata.first; ListBase *lb= &sa->uiblocks; ListBase listb= *lb; + uiBlock *block; bNode *node; rctf rect; void *prev, *next; @@ -2319,13 +2321,36 @@ static int node_uiDoBlocks(ScrArea *sa, short event) return UI_NOTHING; } + /* evil hack: try to do grease-pencil floating panel (like for nodes) */ + block= uiGetBlock("nodes_panel_gpencil", sa); + if (block) { + /* try to process events here... if failed, just carry on */ + /* when there's menus, the prev pointer becomes zero! */ + prev= ((struct Link *)block)->prev; + next= ((struct Link *)block)->next; + ((struct Link *)block)->prev= NULL; + ((struct Link *)block)->next= NULL; + + lb->first= lb->last= block; + retval= uiDoBlocks(lb, event, 1); + + ((struct Link *)block)->prev= prev; + ((struct Link *)block)->next= next; + + *lb= listb; + + /* if something happened, get the heck outta here */ + if (retval != UI_NOTHING) + return retval; + } + + rect.xmin -= 2.0f; rect.ymin -= 2.0f; rect.xmax = rect.xmin + 4.0f; rect.ymax = rect.ymin + 4.0f; for(node= snode->edittree->nodes.first; node; node= node->next) { - uiBlock *block; char str[32]; /* retreive unique block name, see also drawnode.c */ @@ -2369,14 +2394,16 @@ void winqreadnodespace(ScrArea *sa, void *spacedata, BWinEvent *evt) if(snode->nodetree==NULL) return; if(val) { - - if( node_uiDoBlocks(sa, event)!=UI_NOTHING ) event= 0; - + if( node_uiDoBlocks(sa, event)!=UI_NOTHING ) event= 0; + fromlib= (snode->id && snode->id->lib); switch(event) { case LEFTMOUSE: - if(fromlib) { + if(gpencil_do_paint(sa)) { + return; + } + else if(fromlib) { if(node_mouse_groupheader(snode)==0) node_mouse_select(snode, event); } diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index 2e5785eaab8..6af4f47ed11 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -5505,6 +5505,7 @@ void selectlinks(int nr) allqueue(REDRAWDATASELECT, 0); allqueue(REDRAWOOPS, 0); BIF_undo_push("Select linked"); + countall(); } } diff --git a/source/blender/src/gpencil.c b/source/blender/src/gpencil.c new file mode 100644 index 00000000000..fa32b0ac7d4 --- /dev/null +++ b/source/blender/src/gpencil.c @@ -0,0 +1,1290 @@ +/** + * $Id: gpencil.c 14881 2008-05-18 10:41:42Z aligorith $ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2008, Blender Foundation + * This is a new part of Blender + * + * Contributor(s): Joshua Leung + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include +#include +#include +#include + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "MEM_guardedalloc.h" + +#include "BMF_Api.h" + +#include "BLI_arithb.h" +#include "BLI_blenlib.h" + +#include "DNA_listBase.h" +#include "DNA_gpencil_types.h" +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" +#include "DNA_space_types.h" +#include "DNA_userdef_types.h" +#include "DNA_view3d_types.h" + +#include "BKE_global.h" +#include "BKE_utildefines.h" +#include "BKE_blender.h" + +#include "BIF_gl.h" +#include "BIF_glutil.h" +#include "BIF_butspace.h" +#include "BIF_graphics.h" +#include "BIF_interface.h" +#include "BIF_mywindow.h" +#include "BIF_resources.h" +#include "BIF_space.h" +#include "BIF_screen.h" +#include "BIF_toolbox.h" +#include "BIF_toets.h" + +#include "BDR_gpencil.h" +#include "BIF_drawgpencil.h" + +#include "BSE_drawipo.h" +#include "BSE_headerbuttons.h" +#include "BSE_view.h" + +#include "blendef.h" + +#include "PIL_time.h" /* sleep */ +#include "mydevice.h" + +/* ************************************************** */ +/* GENERAL STUFF */ + +/* --------- Memory Management ------------ */ + +/* Free strokes belonging to a gp-frame */ +void free_gpencil_strokes (bGPDframe *gpf) +{ + bGPDstroke *gps, *gpsn; + + /* error checking */ + if (gpf == NULL) return; + + /* free strokes */ + for (gps= gpf->strokes.first; gps; gps= gpsn) { + gpsn= gps->next; + + /* free stroke memory arrays, then stroke itself */ + MEM_freeN(gps->points); + BLI_freelinkN(&gpf->strokes, gps); + } +} + +/* Free all of a gp-layer's frames */ +void free_gpencil_frames (bGPDlayer *gpl) +{ + bGPDframe *gpf, *gpfn; + + /* error checking */ + if (gpl == NULL) return; + + /* free frames */ + for (gpf= gpl->frames.first; gpf; gpf= gpfn) { + gpfn= gpf->next; + + /* free strokes and their associated memory */ + free_gpencil_strokes(gpf); + BLI_freelinkN(&gpl->frames, gpf); + } +} + +/* Free all of the gp-layers for a viewport (list should be &G.vd->gpd or so) */ +void free_gpencil_layers (ListBase *list) +{ + bGPDlayer *gpl, *gpln; + + /* error checking */ + if (list == NULL) return; + + /* delete layers*/ + for (gpl= list->first; gpl; gpl= gpln) { + gpln= gpl->next; + + /* free layers and their data */ + free_gpencil_frames(gpl); + BLI_freelinkN(list, gpl); + } +} + +/* Free gp-data and all it's related data */ +void free_gpencil_data (bGPdata *gpd) +{ + /* free layers then data itself */ + free_gpencil_layers(&gpd->layers); + MEM_freeN(gpd); +} + +/* -------- Container Creation ---------- */ + +/* add a new gp-frame to the given layer */ +bGPDframe *gpencil_frame_addnew (bGPDlayer *gpl, int cframe) +{ + bGPDframe *gpf, *gf; + short state=0; + + /* error checking */ + if ((gpl == NULL) || (cframe <= 0)) + return NULL; + + /* allocate memory for this frame */ + gpf= MEM_callocN(sizeof(bGPDframe), "bGPDframe"); + gpf->framenum= cframe; + + /* find appropriate place to add frame */ + if (gpl->frames.first) { + for (gf= gpl->frames.first; gf; gf= gf->next) { + /* check if frame matches one that is supposed to be added */ + if (gf->framenum == cframe) { + state= -1; + break; + } + + /* if current frame has already exceeded the frame to add, add before */ + if (gf->framenum > cframe) { + BLI_insertlinkbefore(&gpl->frames, gf, gpf); + state= 1; + break; + } + } + } + + /* check whether frame was added successfully */ + if (state == -1) { + MEM_freeN(gpf); + printf("Error: frame (%d) existed already for this layer \n", cframe); + } + else if (state == 0) { + /* add to end then! */ + BLI_addtail(&gpl->frames, gpf); + } + + /* return frame */ + return gpf; +} + +/* add a new gp-layer and make it the active layer */ +bGPDlayer *gpencil_layer_addnew (bGPdata *gpd) +{ + bGPDlayer *gpl; + + /* check that list is ok */ + if (gpd == NULL) + return NULL; + + /* allocate memory for frame and add to end of list */ + gpl= MEM_callocN(sizeof(bGPDlayer), "bGPDlayer"); + + /* add to datablock */ + BLI_addtail(&gpd->layers, gpl); + + /* set basic settings */ + gpl->color[3]= 1.0f; + gpl->thickness = 1; + + /* auto-name */ + sprintf(gpl->info, "GP_Layer"); + BLI_uniquename(&gpd->layers, gpl, "GP_Layer", offsetof(bGPDlayer, info[0]), 128); + + /* make this one the active one */ + gpencil_layer_setactive(gpd, gpl); + + /* return layer */ + return gpl; +} + +/* add a new gp-datablock */ +bGPdata *gpencil_data_addnew (void) +{ + bGPdata *gpd; + + /* allocate memory for a new block */ + gpd= MEM_callocN(sizeof(bGPdata), "GreasePencilData"); + + /* initial settings */ + /* it is quite useful to be able to see this info, so on by default */ + gpd->flag = GP_DATA_DISPINFO; + + return gpd; +} + +/* -------- Data Duplication ---------- */ + +/* make a copy of a given gpencil datablock */ +bGPdata *gpencil_data_duplicate (bGPdata *src) +{ + bGPdata *dst; + bGPDlayer *gpld, *gpls; + bGPDframe *gpfd, *gpfs; + bGPDstroke *gps; + + /* error checking */ + if (src == NULL) + return NULL; + + /* make a copy of the base-data */ + dst= MEM_dupallocN(src); + + /* copy layers */ + duplicatelist(&dst->layers, &src->layers); + + for (gpld=dst->layers.first, gpls=src->layers.first; gpld && gpls; + gpld=gpld->next, gpls=gpls->next) + { + /* copy frames */ + duplicatelist(&gpld->frames, &gpls->frames); + + for (gpfd=gpld->frames.first, gpfs=gpls->frames.first; gpfd && gpfs; + gpfd=gpfd->next, gpfs=gpfs->next) + { + /* copy strokes */ + duplicatelist(&gpfd->strokes, &gpfs->strokes); + + for (gps= gpfd->strokes.first; gps; gps= gps->next) + { + gps->points= MEM_dupallocN(gps->points); + } + } + } + + /* return new */ + return dst; +} + +/* ----------- GP-Datablock API ------------- */ + +/* get the appropriate bGPdata from the active/given context */ +bGPdata *gpencil_data_getactive (ScrArea *sa) +{ + /* error checking */ + if ((sa == NULL) && (curarea == NULL)) + return NULL; + if (sa == NULL) + sa= curarea; + + /* handle depending on spacetype */ + switch (sa->spacetype) { + case SPACE_VIEW3D: + { + View3D *v3d= sa->spacedata.first; + return v3d->gpd; + } + break; + case SPACE_NODE: + { + SpaceNode *snode= sa->spacedata.first; + return snode->gpd; + } + break; + case SPACE_SEQ: + { + SpaceSeq *sseq= sa->spacedata.first; + + /* only applicable for "Image Preview" mode */ + if (sseq->mainb) + return sseq->gpd; + } + break; + } + + /* nothing found */ + return NULL; +} + +/* set bGPdata for the active/given context, and return success/fail */ +short gpencil_data_setactive (ScrArea *sa, bGPdata *gpd) +{ + /* error checking */ + if ((sa == NULL) && (curarea == NULL)) + return 0; + if (gpd == NULL) + return 0; + if (sa == NULL) + sa= curarea; + + /* handle depending on spacetype */ + // TODO: someday we should have multi-user data, so no need to loose old data + switch (sa->spacetype) { + case SPACE_VIEW3D: + { + View3D *v3d= sa->spacedata.first; + + /* free the existing block */ + if (v3d->gpd) + free_gpencil_data(v3d->gpd); + v3d->gpd= gpd; + + return 1; + } + break; + case SPACE_NODE: + { + SpaceNode *snode= sa->spacedata.first; + + /* free the existing block */ + if (snode->gpd) + free_gpencil_data(snode->gpd); + snode->gpd= gpd; + + /* set special settings */ + gpd->flag |= GP_DATA_VIEWALIGN; + + return 1; + } + break; + case SPACE_SEQ: + { + SpaceSeq *sseq= sa->spacedata.first; + + /* only applicable if right mode */ + if (sseq->mainb) { + /* free the existing block */ + if (sseq->gpd) + free_gpencil_data(sseq->gpd); + sseq->gpd= gpd; + + return 1; + } + } + break; + } + + /* failed to add */ + return 0; +} + +/* Find gp-data destined for editing in animation editor (for editing time) */ +bGPdata *gpencil_data_getetime (bScreen *sc) +{ + bGPdata *gpd= NULL; + ScrArea *sa; + + /* error checking */ + if (sc == NULL) + return NULL; + + /* search through areas, checking if an appropriate gp-block is available + * (this assumes that only one will have the active flag set) + */ + for (sa= sc->areabase.first; sa; sa= sa->next) { + /* handle depending on space type */ + switch (sa->spacetype) { + case SPACE_VIEW3D: /* 3d-view */ + { + View3D *v3d= sa->spacedata.first; + gpd= v3d->gpd; + } + break; + case SPACE_NODE: /* Node Editor */ + { + SpaceNode *snode= sa->spacedata.first; + gpd= snode->gpd; + } + break; + case SPACE_SEQ: /* Sequence Editor - Image Preview */ + { + SpaceSeq *sseq= sa->spacedata.first; + + if (sseq->mainb) + gpd= sseq->gpd; + else + gpd= NULL; + } + break; + + default: /* unsupported space-type */ + gpd= NULL; + break; + } + + /* check if ok */ + if ((gpd) && (gpd->flag & GP_DATA_EDITTIME)) + return gpd; + } + + /* didn't find a match */ + return NULL; +} + +/* make sure only the specified view can have gp-data for time editing + * - gpd can be NULL, if we wish to make sure no gp-data is being edited + */ +void gpencil_data_setetime (bScreen *sc, bGPdata *gpd) +{ + bGPdata *gpdn= NULL; + ScrArea *sa; + + /* error checking */ + if (sc == NULL) + return; + + /* search through areas, checking if an appropriate gp-block is available + * (this assumes that only one will have the active flag set) + */ + for (sa= sc->areabase.first; sa; sa= sa->next) { + /* handle depending on space type */ + switch (sa->spacetype) { + case SPACE_VIEW3D: /* 3d-view */ + { + View3D *v3d= sa->spacedata.first; + gpdn= v3d->gpd; + } + break; + case SPACE_NODE: /* Node Editor */ + { + SpaceNode *snode= sa->spacedata.first; + gpdn= snode->gpd; + } + break; + case SPACE_SEQ: /* Sequence Editor - Image Preview */ + { + SpaceSeq *sseq= sa->spacedata.first; + gpdn= sseq->gpd; + } + break; + + default: /* unsupported space-type */ + gpdn= NULL; + break; + } + + /* clear flag if a gp-data block found */ + if (gpdn) + gpdn->flag &= ~GP_DATA_EDITTIME; + } + + /* set active flag for this block (if it is provided) */ + if (gpd) + gpd->flag |= GP_DATA_EDITTIME; +} + +/* -------- GP-Frame API ---------- */ + +/* delete the last stroke of the given frame */ +void gpencil_frame_delete_laststroke (bGPDframe *gpf) +{ + bGPDstroke *gps= (gpf) ? gpf->strokes.last : NULL; + + /* error checking */ + if (ELEM(NULL, gpf, gps)) + return; + + /* free the stroke and its data */ + MEM_freeN(gps->points); + BLI_freelinkN(&gpf->strokes, gps); +} + +/* -------- GP-Layer API ---------- */ + +/* get the appropriate gp-frame from a given layer + * - this sets the layer's actframe var (if allowed to) + * - extension beyond range (if first gp-frame is after all frame in interest and cannot add) + */ +bGPDframe *gpencil_layer_getframe (bGPDlayer *gpl, int cframe, short addnew) +{ + bGPDframe *gpf = NULL; + short found = 0; + + /* error checking */ + if (gpl == NULL) return NULL; + if (cframe <= 0) cframe = 1; + + /* check if there is already an active frame */ + if (gpl->actframe) { + gpf= gpl->actframe; + + /* do not allow any changes to layer's active frame if layer is locked */ + if (gpl->flag & GP_LAYER_LOCKED) + return gpf; + /* do not allow any changes to actframe if frame has painting tag attached to it */ + if (gpf->flag & GP_FRAME_PAINT) + return gpf; + + /* try to find matching frame */ + if (gpf->framenum < cframe) { + for (; gpf; gpf= gpf->next) { + if (gpf->framenum == cframe) { + found= 1; + break; + } + else if ((gpf->next) && (gpf->next->framenum > cframe)) { + found= 1; + break; + } + } + + /* set the appropriate frame */ + if (addnew) { + if ((found) && (gpf->framenum == cframe)) + gpl->actframe= gpf; + else + gpl->actframe= gpencil_frame_addnew(gpl, cframe); + } + else if (found) + gpl->actframe= gpf; + else + gpl->actframe= gpl->frames.last; + } + else { + for (; gpf; gpf= gpf->prev) { + if (gpf->framenum <= cframe) { + found= 1; + break; + } + } + + /* set the appropriate frame */ + if (addnew) { + if ((found) && (gpf->framenum == cframe)) + gpl->actframe= gpf; + else + gpl->actframe= gpencil_frame_addnew(gpl, cframe); + } + else if (found) + gpl->actframe= gpf; + else + gpl->actframe= gpl->frames.first; + } + } + else if (gpl->frames.first) { + /* check which of the ends to start checking from */ + const int first= ((bGPDframe *)(gpl->frames.first))->framenum; + const int last= ((bGPDframe *)(gpl->frames.last))->framenum; + + if (abs(cframe-first) > abs(cframe-last)) { + /* find gp-frame which is less than or equal to cframe */ + for (gpf= gpl->frames.last; gpf; gpf= gpf->prev) { + if (gpf->framenum <= cframe) { + found= 1; + break; + } + } + } + else { + /* find gp-frame which is less than or equal to cframe */ + for (gpf= gpl->frames.first; gpf; gpf= gpf->next) { + if (gpf->framenum <= cframe) { + found= 1; + break; + } + } + } + + /* set the appropriate frame */ + if (addnew) { + if ((found) && (gpf->framenum == cframe)) + gpl->actframe= gpf; + else + gpl->actframe= gpencil_frame_addnew(gpl, cframe); + } + else if (found) + gpl->actframe= gpf; + else { + /* unresolved errogenous situation! */ + printf("Error: cannot find appropriate gp-frame \n"); + } + } + else { + /* currently no frames (add if allowed to) */ + if (addnew) + gpl->actframe= gpencil_frame_addnew(gpl, cframe); + else { + /* don't do anything... this may be when no frames yet! */ + } + } + + /* return */ + return gpl->actframe; +} + +/* delete the given frame from a layer */ +void gpencil_layer_delframe (bGPDlayer *gpl, bGPDframe *gpf) +{ + /* error checking */ + if (ELEM(NULL, gpl, gpf)) + return; + + /* free the frame and its data */ + free_gpencil_strokes(gpf); + BLI_freelinkN(&gpl->frames, gpf); + gpl->actframe = NULL; +} + +/* get the active gp-layer for editing */ +bGPDlayer *gpencil_layer_getactive (bGPdata *gpd) +{ + bGPDlayer *gpl; + + /* error checking */ + if (ELEM(NULL, gpd, gpd->layers.first)) + return NULL; + + /* loop over layers until found (assume only one active) */ + for (gpl=gpd->layers.first; gpl; gpl=gpl->next) { + if (gpl->flag & GP_LAYER_ACTIVE) + return gpl; + } + + /* no active layer found */ + return NULL; +} + +/* set the active gp-layer */ +void gpencil_layer_setactive (bGPdata *gpd, bGPDlayer *active) +{ + bGPDlayer *gpl; + + /* error checking */ + if (ELEM3(NULL, gpd, gpd->layers.first, active)) + return; + + /* loop over layers deactivating all */ + for (gpl=gpd->layers.first; gpl; gpl=gpl->next) + gpl->flag &= ~GP_LAYER_ACTIVE; + + /* set as active one */ + active->flag |= GP_LAYER_ACTIVE; +} + +/* delete the active gp-layer */ +void gpencil_layer_delactive (bGPdata *gpd) +{ + bGPDlayer *gpl= gpencil_layer_getactive(gpd); + + /* error checking */ + if (ELEM(NULL, gpd, gpl)) + return; + + /* free layer */ + free_gpencil_frames(gpl); + BLI_freelinkN(&gpd->layers, gpl); + +} + +/* ************************************************** */ +/* GREASE-PENCIL EDITING MODE - Tools */ + +/* --------- Data Deletion ---------- */ + +/* delete the last stroke on the active layer */ +void gpencil_delete_laststroke (bGPdata *gpd) +{ + bGPDlayer *gpl= gpencil_layer_getactive(gpd); + bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0); + + gpencil_frame_delete_laststroke(gpf); +} + +/* delete the active frame */ +void gpencil_delete_actframe (bGPdata *gpd) +{ + bGPDlayer *gpl= gpencil_layer_getactive(gpd); + bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0); + + gpencil_layer_delframe(gpl, gpf); +} + + + +/* delete various grase-pencil elements + * mode: 1 - last stroke + * 2 - active frame + * 3 - active layer + */ +void gpencil_delete_operation (short mode) // unused +{ + bGPdata *gpd; + + /* get datablock to work on */ + gpd= gpencil_data_getactive(NULL); + if (gpd == NULL) return; + + switch (mode) { + case 1: /* last stroke */ + gpencil_delete_laststroke(gpd); + break; + case 2: /* active frame */ + gpencil_delete_actframe(gpd); + break; + case 3: /* active layer */ + gpencil_layer_delactive(gpd); + break; + } + + /* redraw and undo-push */ + BIF_undo_push("GPencil Delete"); + allqueue(REDRAWVIEW3D, 0); +} + +/* display a menu for deleting different grease-pencil elements */ +void gpencil_delete_menu (void) // unused +{ + short mode; + + mode= pupmenu("Erase...%t|Last Stroke%x1|Active Frame%x2|Active Layer%x3"); + if (mode <= 0) return; + + gpencil_delete_operation(mode); +} + +/* ************************************************** */ +/* GREASE-PENCIL EDITING MODE - Painting */ + +/* ---------- 'Globals' and Defines ----------------- */ + +/* maximum sizes of gp-session buffer */ +#define GP_STROKE_BUFFER_MAX 500 + +/* ------ */ + +/* Temporary 'Stroke' Operation data */ +typedef struct tGPsdata { + ScrArea *sa; /* area where painting originated */ + View2D *v2d; /* needed for GP_STROKE_2DSPACE */ + + bGPdata *gpd; /* gp-datablock layer comes from */ + bGPDlayer *gpl; /* layer we're working on */ + bGPDframe *gpf; /* frame we're working on */ + + short status; /* current status of painting */ + short paintmode; /* mode for painting (L_MOUSE or R_MOUSE for now) */ +} tGPsdata; + +/* values for tGPsdata->status */ +enum { + GP_STATUS_NORMAL = 0, /* running normally */ + GP_STATUS_ERROR, /* something wasn't correctly set up */ + GP_STATUS_DONE /* painting done */ +}; + +/* Return flags for adding points to stroke buffer */ +enum { + GP_STROKEADD_INVALID = -2, /* error occurred - insufficient info to do so */ + GP_STROKEADD_OVERFLOW = -1, /* error occurred - cannot fit any more points */ + GP_STROKEADD_NORMAL, /* point was successfully added */ + GP_STROKEADD_FULL /* cannot add any more points to buffer */ +}; + +/* ---------- Stroke Editing ------------ */ + +/* clear the session buffers (call this before AND after a paint operation) */ +static void gp_session_validatebuffer (tGPsdata *p) +{ + bGPdata *gpd= p->gpd; + + /* clear memory of buffer (or allocate it if starting a new session) */ + if (gpd->sbuffer) + memset(gpd->sbuffer, 0, sizeof(bGPDspoint)*GP_STROKE_BUFFER_MAX); + else + gpd->sbuffer= MEM_callocN(sizeof(bGPDspoint)*GP_STROKE_BUFFER_MAX, "gp_session_strokebuffer"); + + /* reset indices */ + gpd->sbuffer_size = 0; + + /* reset flags */ + gpd->sbuffer_sflag= 0; +} + +/* init new painting session */ +static void gp_session_initpaint (tGPsdata *p) +{ + /* clear previous data (note: is on stack) */ + memset(p, 0, sizeof(tGPsdata)); + + /* make sure the active view (at the starting time) is a 3d-view */ + if (curarea == NULL) { + p->status= GP_STATUS_ERROR; + if (G.f & G_DEBUG) + printf("Error: No active view for painting \n"); + return; + } + switch (curarea->spacetype) { + /* supported views first */ + case SPACE_VIEW3D: + { + View3D *v3d= curarea->spacedata.first; + + /* set current area */ + p->sa= curarea; + + /* check that gpencil data is allowed to be drawn */ + if ((v3d->flag2 & V3D_DISPGP)==0) { + p->status= GP_STATUS_ERROR; + if (G.f & G_DEBUG) + printf("Error: In active view, Grease Pencil not shown \n"); + return; + } + } + break; + case SPACE_NODE: + { + SpaceNode *snode= curarea->spacedata.first; + + /* set current area */ + p->sa= curarea; + p->v2d= &snode->v2d; + + /* check that gpencil data is allowed to be drawn */ + if ((snode->flag & SNODE_DISPGP)==0) { + p->status= GP_STATUS_ERROR; + if (G.f & G_DEBUG) + printf("Error: In active view, Grease Pencil not shown \n"); + return; + } + } + break; + case SPACE_SEQ: + { + SpaceSeq *sseq= curarea->spacedata.first; + + /* set current area */ + p->sa= curarea; + p->v2d= &sseq->v2d; + + /* check that gpencil data is allowed to be drawn */ + if (sseq->mainb == 0) { + p->status= GP_STATUS_ERROR; + if (G.f & G_DEBUG) + printf("Error: In active view (sequencer), active mode doesn't support Grease Pencil \n"); + return; + } + if ((sseq->flag & SEQ_DRAW_GPENCIL)==0) { + p->status= GP_STATUS_ERROR; + if (G.f & G_DEBUG) + printf("Error: In active view, Grease Pencil not shown \n"); + return; + } + } + break; + /* unsupported views */ + default: + { + p->status= GP_STATUS_ERROR; + if (G.f & G_DEBUG) + printf("Error: Active view not appropriate for Grease Pencil drawing \n"); + return; + } + break; + } + + /* get gp-data */ + p->gpd= gpencil_data_getactive(p->sa); + if (p->gpd == NULL) { + short ok; + + p->gpd= gpencil_data_addnew(); + ok= gpencil_data_setactive(p->sa, p->gpd); + + /* most of the time, the following check isn't needed */ + if (ok == 0) { + /* free gpencil data as it can't be used */ + free_gpencil_data(p->gpd); + p->gpd= NULL; + p->status= GP_STATUS_ERROR; + if (G.f & G_DEBUG) + printf("Error: Could not assign newly created Grease Pencil data to active area \n"); + return; + } + } + + /* set edit flags */ + G.f |= G_GREASEPENCIL; + + /* clear out buffer (stored in gp-data) in case something contaminated it */ + gp_session_validatebuffer(p); +} + +/* cleanup after a painting session */ +static void gp_session_cleanup (tGPsdata *p) +{ + bGPdata *gpd= p->gpd; + + /* error checking */ + if (gpd == NULL) + return; + + /* free stroke buffer */ + if (gpd->sbuffer) { + MEM_freeN(gpd->sbuffer); + gpd->sbuffer= NULL; + } + + /* clear flags */ + gpd->sbuffer_size= 0; + gpd->sbuffer_sflag= 0; +} + +/* convert screen-coordinates to buffer-coordinates */ +static void gp_stroke_convertcoords (tGPsdata *p, short mval[], float out[]) +{ + bGPdata *gpd= p->gpd; + + /* in 3d-space - pt->x/y/z are 3 side-by-side floats */ + if (gpd->sbuffer_sflag & GP_STROKE_3DSPACE) { + short mx=mval[0], my=mval[1]; + float *fp= give_cursor(); + float dvec[3]; + + /* method taken from editview.c - mouse_cursor() */ + project_short_noclip(fp, mval); + window_to_3d(dvec, mval[0]-mx, mval[1]-my); + VecSubf(out, fp, dvec); + } + + /* 2d - on 'canvas' (assume that p->v2d is set) */ + else if ((gpd->sbuffer_sflag & GP_STROKE_2DSPACE) && (p->v2d)) { + float x, y; + + areamouseco_to_ipoco(p->v2d, mval, &x, &y); + + out[0]= x; + out[1]= y; + } + + /* 2d - relative to screen (viewport area) */ + else { + out[0] = (float)(mval[0]) / (float)(p->sa->winx) * 1000; + out[1] = (float)(mval[1]) / (float)(p->sa->winy) * 1000; + } +} + +/* add current stroke-point to buffer (returns whether point was successfully added) */ +static short gp_stroke_addpoint (tGPsdata *p, short mval[], float pressure) +{ + bGPdata *gpd= p->gpd; + bGPDspoint *pt; + + /* check if still room in buffer */ + if (gpd->sbuffer_size >= GP_STROKE_BUFFER_MAX) + return GP_STROKEADD_OVERFLOW; + + + /* get pointer to destination point */ + pt= gpd->sbuffer + gpd->sbuffer_size; + + /* convert screen-coordinates to appropriate coordinates (and store them) */ + gp_stroke_convertcoords(p, mval, &pt->x); + + /* store other settings */ + pt->pressure= pressure; + + /* increment counters */ + gpd->sbuffer_size++; + + /* check if another operation can still occur */ + if (gpd->sbuffer_size == GP_STROKE_BUFFER_MAX) + return GP_STROKEADD_FULL; + else + return GP_STROKEADD_NORMAL; +} + +/* smooth a stroke (in buffer) before storing it */ +static void gp_stroke_smooth (tGPsdata *p) +{ + bGPdata *gpd= p->gpd; + int i=0, cmx=gpd->sbuffer_size; + + /* don't try if less than 2 points in buffer */ + if ((cmx <= 2) || (gpd->sbuffer == NULL)) + return; + + /* apply weighting-average (note doing this along path sequentially does introduce slight error) */ + for (i=0; i < gpd->sbuffer_size; i++) { + bGPDspoint *pc= (gpd->sbuffer + i); + bGPDspoint *pb= (i-1 > 0)?(pc-1):(pc); + bGPDspoint *pa= (i-2 > 0)?(pc-2):(pb); + bGPDspoint *pd= (i+1 < cmx)?(pc+1):(pc); + bGPDspoint *pe= (i+2 < cmx)?(pc+2):(pd); + + pc->x= (0.1*pa->x + 0.2*pb->x + 0.4*pc->x + 0.2*pd->x + 0.1*pe->x); + pc->y= (0.1*pa->y + 0.2*pb->y + 0.4*pc->y + 0.2*pd->y + 0.1*pe->y); + } +} + +/* make a new stroke from the buffer data */ +static void gp_stroke_newfrombuffer (tGPsdata *p) +{ + bGPdata *gpd= p->gpd; + bGPDstroke *gps; + bGPDspoint *pt, *ptc; + int i, totelem; + + /* get total number of points to allocate space for */ + totelem = gpd->sbuffer_size; + + /* exit with error if no valid points from this stroke */ + if (totelem == 0) { + if (G.f & G_DEBUG) + printf("Error: No valid points in stroke buffer to convert (tot=%d) \n", gpd->sbuffer_size); + return; + } + + /* allocate memory for a new stroke */ + gps= MEM_callocN(sizeof(bGPDstroke), "gp_stroke"); + + /* allocate enough memory for a continuous array for storage points */ + pt= gps->points= MEM_callocN(sizeof(bGPDspoint)*totelem, "gp_stroke_points"); + + /* copy appropriate settings for stroke */ + gps->totpoints= totelem; + gps->thickness= p->gpl->thickness; + gps->flag= gpd->sbuffer_sflag; + + /* copy points from the buffer to the stroke */ + for (i=0, ptc=gpd->sbuffer; i < gpd->sbuffer_size && ptc; i++, ptc++) { + memcpy(pt, ptc, sizeof(bGPDspoint)); + pt++; + } + + /* add stroke to frame */ + BLI_addtail(&p->gpf->strokes, gps); +} + +/* ---------- 'Paint' Tool ------------ */ + +/* init new stroke */ +static void gp_paint_initstroke (tGPsdata *p) +{ + /* get active layer (or add a new one if non-existent) */ + p->gpl= gpencil_layer_getactive(p->gpd); + if (p->gpl == NULL) + p->gpl= gpencil_layer_addnew(p->gpd); + if (p->gpl->flag & GP_LAYER_LOCKED) { + p->status= GP_STATUS_ERROR; + if (G.f & G_DEBUG) + printf("Error: Cannot paint on locked layer \n"); + return; + } + + /* get active frame (add a new one if not matching frame) */ + p->gpf= gpencil_layer_getframe(p->gpl, CFRA, 1); + if (p->gpf == NULL) { + p->status= GP_STATUS_ERROR; + if (G.f & G_DEBUG) + printf("Error: No frame created (gpencil_paint_init) \n"); + return; + } + else + p->gpf->flag |= GP_FRAME_PAINT; + + /* check if points will need to be made in 3d-space */ + if (p->gpd->flag & GP_DATA_VIEWALIGN) { + switch (p->sa->spacetype) { + case SPACE_VIEW3D: + { + float *fp= give_cursor(); + initgrabz(fp[0], fp[1], fp[2]); + + p->gpd->sbuffer_sflag |= GP_STROKE_3DSPACE; + } + break; + case SPACE_NODE: + { + p->gpd->sbuffer_sflag |= GP_STROKE_2DSPACE; + } + break; + case SPACE_SEQ: + { + /* for now, this is not applicable here... */ + } + break; + } + } +} + +/* finish off a stroke (clears buffer, but doesn't finish the paint operation) */ +static void gp_paint_strokeend (tGPsdata *p) +{ + /* sanitize stroke-points in buffer */ + gp_stroke_smooth(p); + + /* transfer stroke to frame */ + gp_stroke_newfrombuffer(p); + + /* clean up buffer now */ + gp_session_validatebuffer(p); +} + +/* finish off stroke painting operation */ +static void gp_paint_cleanup (tGPsdata *p) +{ + /* finish off a stroke */ + gp_paint_strokeend(p); + + /* "unlock" frame */ + p->gpf->flag &= ~GP_FRAME_PAINT; + + /* add undo-push so stroke can be undone */ + /* FIXME: currently disabled, as it's impossible to get this working nice + * as gpenci data is on currently screen-level (which isn't saved to undo files) + */ + //BIF_undo_push("GPencil Stroke"); + + /* force redraw after drawing action */ + force_draw(0); +} + +/* -------- */ + +/* main call to paint a new stroke */ +short gpencil_paint (short mousebutton) +{ + tGPsdata p; + short prevmval[2], mval[2]; + float opressure, pressure; + short ok = GP_STROKEADD_NORMAL; + + /* init paint-data */ + gp_session_initpaint(&p); + if (p.status == GP_STATUS_ERROR) { + gp_session_cleanup(&p); + return 0; + } + gp_paint_initstroke(&p); + if (p.status == GP_STATUS_ERROR) { + gp_session_cleanup(&p); + return 0; + } + + /* set cursor to indicate drawing */ + setcursor_space(p.sa->spacetype, CURSOR_VPAINT); + + /* init drawing-device settings */ + getmouseco_areawin(mval); + pressure = get_pressure(); + + prevmval[0]= mval[0]; + prevmval[1]= mval[1]; + opressure= pressure; + + /* only allow painting of single 'dots' if: + * - pressure is not excessive (as it can be on some windows tablets) + * - draw-mode for active datablock is turned on + */ + if (!(pressure >= 0.99f) || (p.gpd->flag & GP_DATA_EDITPAINT)) { + gp_stroke_addpoint(&p, mval, pressure); + } + + /* paint loop */ + do { + /* get current user input */ + getmouseco_areawin(mval); + pressure = get_pressure(); + + /* only add current point to buffer if mouse moved (otherwise wait until it does) */ + if ((mval[0] != prevmval[0]) || (mval[1] != prevmval[1])) { + /* try to add point */ + ok= gp_stroke_addpoint(&p, mval, pressure); + + /* handle errors while adding point */ + if ((ok == GP_STROKEADD_FULL) || (ok == GP_STROKEADD_OVERFLOW)) { + /* finish off old stroke */ + gp_paint_strokeend(&p); + + /* start a new stroke, starting from previous point */ + gp_stroke_addpoint(&p, prevmval, opressure); + ok= gp_stroke_addpoint(&p, mval, pressure); + } + else if (ok == GP_STROKEADD_INVALID) { + /* the painting operation cannot continue... */ + error("Cannot paint stroke"); + p.status = GP_STATUS_ERROR; + + if (G.f & G_DEBUG) + printf("Error: Grease-Pencil Paint - Add Point Invalid \n"); + break; + } + force_draw(0); + + prevmval[0]= mval[0]; + prevmval[1]= mval[1]; + opressure= pressure; + } + else + BIF_wait_for_statechange(); + + /* do mouse checking at the end, so don't check twice, and potentially + * miss a short tap + */ + } while (get_mbut() & mousebutton); + + /* clear edit flags */ + G.f &= ~G_GREASEPENCIL; + + /* restore cursor to indicate end of drawing */ + setcursor_space(p.sa->spacetype, CURSOR_STD); + + /* check size of buffer before cleanup, to determine if anything happened here */ + ok= p.gpd->sbuffer_size; + + /* cleanup */ + gp_paint_cleanup(&p); + gp_session_cleanup(&p); + + /* done! return if a stroke was successfully added */ + return ok; +} + + +/* All event (loops) handling checking if stroke drawing should be initiated + * should call this function. + */ +short gpencil_do_paint (ScrArea *sa) +{ + bGPdata *gpd = gpencil_data_getactive(sa); + short mousebutton = L_MOUSE; /* for now, this is always on L_MOUSE*/ + short retval= 0; + + /* check if possible to do painting */ + if (gpd == NULL) + return 0; + + /* currently, we will only paint if: + * 1. draw-mode on gpd is set (for accessibility reasons) + * (single 'dots' are only available via this method) + * 2. if shift-modifier is held + lmb -> 'quick paint' + */ + if (gpd->flag & GP_DATA_EDITPAINT) { + /* try to paint */ + retval = gpencil_paint(mousebutton); + } + else if (G.qual == LR_SHIFTKEY) { + /* try to paint */ + retval = gpencil_paint(mousebutton); + } + + /* return result of trying to paint */ + return retval; +} + +/* ************************************************** */ diff --git a/source/blender/src/header_action.c b/source/blender/src/header_action.c index 9c7046c5111..50d343ca470 100644 --- a/source/blender/src/header_action.c +++ b/source/blender/src/header_action.c @@ -50,8 +50,11 @@ #include "DNA_screen_types.h" #include "DNA_space_types.h" +#include "BIF_gl.h" +#include "BIF_glutil.h" #include "BIF_editaction.h" #include "BIF_interface.h" +#include "BIF_language.h" #include "BIF_poseobject.h" #include "BIF_resources.h" #include "BIF_screen.h" @@ -76,6 +79,7 @@ #include "blendef.h" #include "mydevice.h" +/* ------------------------------- */ /* enums declaring constants that are used as menu event codes */ enum { @@ -212,6 +216,16 @@ enum { ACTMENU_MARKERS_LOCALMOVE }; +/* ------------------------------- */ +/* macros for easier state testing (only for use here) */ + +/* test if active action editor is showing any markers */ +#define G_SACTION_HASMARKERS \ + ((G.saction->action && G.saction->action->markers.first) \ + || (G.scene->markers.first)) + +/* ------------------------------- */ + void do_action_buttons(unsigned short event) { Object *ob= OBACT; @@ -398,32 +412,41 @@ static uiBlock *action_viewmenu(void *arg_unused) uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_SLIDERS)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, - "Show Sliders|", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_SLIDERS, ""); - - uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_NOHIDE)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, - "Show Hidden Channels|", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_NOHIDE, ""); - - uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_NODRAWGCOLORS)?ICON_CHECKBOX_DEHLT:ICON_CHECKBOX_HLT, - "Use Group Colors|", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_GCOLORS, ""); - - // this option may get removed in future - uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_HORIZOPTIMISEON)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, - "Cull Out-of-View Keys (Time)|", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_HORIZOPTIMISE, ""); + if (G.saction->mode == SACTCONT_GPENCIL) { + // this option may get removed in future + uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_HORIZOPTIMISEON)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, + "Cull Out-of-View Keys (Time)|", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 1, + ACTMENU_VIEW_HORIZOPTIMISE, ""); + } + else { + uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_SLIDERS)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, + "Show Sliders|", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 1, + ACTMENU_VIEW_SLIDERS, ""); + + uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_NOHIDE)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, + "Show Hidden Channels|", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 1, + ACTMENU_VIEW_NOHIDE, ""); + + uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_NODRAWGCOLORS)?ICON_CHECKBOX_DEHLT:ICON_CHECKBOX_HLT, + "Use Group Colors|", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 1, + ACTMENU_VIEW_GCOLORS, ""); + + // this option may get removed in future + uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_HORIZOPTIMISEON)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, + "Cull Out-of-View Keys (Time)|", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 1, + ACTMENU_VIEW_HORIZOPTIMISE, ""); + + uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_NOTRANSKEYCULL)?ICON_CHECKBOX_DEHLT:ICON_CHECKBOX_HLT, + "AutoMerge Keyframes|", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 1, + ACTMENU_VIEW_TRANSDELDUPS, ""); + } - uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_NOTRANSKEYCULL)?ICON_CHECKBOX_DEHLT:ICON_CHECKBOX_HLT, - "AutoMerge Keyframes|", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_TRANSDELDUPS, ""); - uiDefIconTextBut(block, BUTM, 1, (G.v2d->flag & V2D_VIEWLOCK)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, "Lock Time to Other Windows|", 0, yco-=20, @@ -476,7 +499,7 @@ static uiBlock *action_viewmenu(void *arg_unused) menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_VIEW_PREVRANGECLEAR, ""); - if (G.saction->action) { + if ((G.saction->mode == SACTCONT_ACTION) && (G.saction->action)) { uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Preview Range from Action Length|Ctrl Alt P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, @@ -550,13 +573,15 @@ static uiBlock *action_selectmenu_columnmenu(void *arg_unused) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "On Current Frame|Ctrl K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_SEL_COLUMN_CFRA, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "On Selected Markers|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_COLUMN_MARKERSCOLUMN, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Between Selected Markers|Alt K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_COLUMN_MARKERSBETWEEN, ""); + if (G_SACTION_HASMARKERS) { + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, + "On Selected Markers|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, + ACTMENU_SEL_COLUMN_MARKERSCOLUMN, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, + "Between Selected Markers|Alt K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, + ACTMENU_SEL_COLUMN_MARKERSBETWEEN, ""); + } uiBlockSetDirection(block, UI_RIGHT); uiTextBoundsBlock(block, 60); @@ -659,14 +684,18 @@ static uiBlock *action_selectmenu(void *arg_unused) "Border Select Keys|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_SEL_BORDER, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Border Select Channels|B", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_BORDERC, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Border Select Markers|Ctrl B", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_BORDERM, ""); + if (G_SACTION_HASMARKERS) { + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, + "Border Select Markers|Ctrl B", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 0, + ACTMENU_SEL_BORDERM, ""); + } + if (G.saction->mode != SACTCONT_SHAPEKEY) { + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, + "Border Select Channels|B", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 0, + ACTMENU_SEL_BORDERC, ""); + } uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); @@ -675,14 +704,18 @@ static uiBlock *action_selectmenu(void *arg_unused) "Select/Deselect All Keys|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_SEL_ALL_KEYS, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Select/Deselect All Markers|Ctrl A", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_ALL_MARKERS, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Select/Deselect All Channels|A", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_ALL_CHAN, ""); + if (G_SACTION_HASMARKERS) { + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, + "Select/Deselect All Markers|Ctrl A", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 0, + ACTMENU_SEL_ALL_MARKERS, ""); + } + if (G.saction->mode != SACTCONT_SHAPEKEY) { + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, + "Select/Deselect All Channels|A", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 0, + ACTMENU_SEL_ALL_CHAN, ""); + } uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); @@ -691,14 +724,18 @@ static uiBlock *action_selectmenu(void *arg_unused) "Inverse Keys|Ctrl I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_SEL_INVERSE_KEYS, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Inverse Markers|Ctrl Shift I", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_INVERSE_MARKERS, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Inverse All Channels|Ctrl I", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_INVERSE_CHANNELS, ""); + if (G_SACTION_HASMARKERS) { + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, + "Inverse Markers|Ctrl Shift I", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 0, + ACTMENU_SEL_INVERSE_MARKERS, ""); + } + if (G.saction->mode != SACTCONT_SHAPEKEY) { + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, + "Inverse All Channels|Ctrl I", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 0, + ACTMENU_SEL_INVERSE_CHANNELS, ""); + } uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); @@ -971,6 +1008,40 @@ static uiBlock *action_channelmenu(void *arg_unused) return block; } +/* note: uses do_action_channelmenu too... */ +static uiBlock *action_gplayermenu(void *arg_unused) +{ + uiBlock *block; + short yco= 0, menuwidth=120; + + block= uiNewBlock(&curarea->uiblocks, "action_gplayermenu", + UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_action_channelmenu, NULL); + + uiDefIconTextBlockBut(block, action_channelmenu_settingsmenu, + NULL, ICON_RIGHTARROW_THIN, + "Settings", 0, yco-=20, 120, 20, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, + menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, + "Delete|X", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_CHANNELS_DELETE, ""); + + if (curarea->headertype==HEADERTOP) { + uiBlockSetDirection(block, UI_DOWN); + } + else { + uiBlockSetDirection(block, UI_TOP); + uiBlockFlipOrder(block); + } + + uiTextBoundsBlock(block, 50); + + return block; +} + static void do_action_keymenu_transformmenu(void *arg, int event) { switch (event) @@ -1400,6 +1471,51 @@ static uiBlock *action_keymenu(void *arg_unused) return block; } +/* note: uses do_action_keymenu too! */ +static uiBlock *action_framemenu(void *arg_unused) +{ + uiBlock *block; + short yco= 0, menuwidth=120; + + block= uiNewBlock(&curarea->uiblocks, "action_framemenu", + UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_action_keymenu, NULL); + + uiDefIconTextBlockBut(block, action_keymenu_transformmenu, + NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 20, ""); + + uiDefIconTextBlockBut(block, action_keymenu_snapmenu, + NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 20, ""); + + uiDefIconTextBlockBut(block, action_keymenu_mirrormenu, + NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, 120, 20, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, + menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, + "Duplicate|Shift D", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 0, + ACTMENU_KEY_DUPLICATE, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, + "Delete|X", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 0, + ACTMENU_KEY_DELETE, ""); + + if(curarea->headertype==HEADERTOP) { + uiBlockSetDirection(block, UI_DOWN); + } + else { + uiBlockSetDirection(block, UI_TOP); + uiBlockFlipOrder(block); + } + + uiTextBoundsBlock(block, 50); + + return block; +} + static void do_action_markermenu(void *arg, int event) { switch(event) @@ -1461,17 +1577,19 @@ static uiBlock *action_markermenu(void *arg_unused) menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_NAME, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Marker|Ctrl G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_MOVE, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Pose Marker|Shift L", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_LOCALADD, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rename Pose Marker|Ctrl Shift L", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_LOCALRENAME, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Pose Marker|Alt L", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_LOCALDELETE, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Pose Marker|Ctrl L", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_LOCALMOVE, ""); + + if (G.saction->mode == SACTCONT_ACTION) { + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Pose Marker|Shift L", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_LOCALADD, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rename Pose Marker|Ctrl Shift L", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_LOCALRENAME, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Pose Marker|Alt L", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_LOCALDELETE, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Pose Marker|Ctrl L", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_LOCALMOVE, ""); + } if(curarea->headertype==HEADERTOP) { uiBlockSetDirection(block, UI_DOWN); @@ -1498,6 +1616,7 @@ void action_buttons(void) return; /* copied from drawactionspace.... */ + // FIXME: do for gpencil too? if (!G.saction->pin) { if (OBACT) G.saction->action = OBACT->action; @@ -1558,67 +1677,111 @@ void action_buttons(void) "Select", xco, -2, xmax-3, 24, ""); xco+= xmax; - if (G.saction->action) { + if ((G.saction->action) && (G.saction->mode==SACTCONT_ACTION)) { xmax= GetButStringLength("Channel"); uiDefPulldownBut(block, action_channelmenu, NULL, "Channel", xco, -2, xmax-3, 24, ""); xco+= xmax; } + else if ((G.saction->gpd) && (G.saction->mode==SACTCONT_GPENCIL)) { + xmax= GetButStringLength("Channel"); + uiDefPulldownBut(block, action_gplayermenu, NULL, + "Channel", xco, -2, xmax-3, 24, ""); + xco+= xmax; + } xmax= GetButStringLength("Marker"); uiDefPulldownBut(block, action_markermenu, NULL, "Marker", xco, -2, xmax-3, 24, ""); xco+= xmax; - xmax= GetButStringLength("Key"); - uiDefPulldownBut(block, action_keymenu, NULL, - "Key", xco, -2, xmax-3, 24, ""); - xco+= xmax; + if (G.saction->mode == SACTCONT_GPENCIL) { + xmax= GetButStringLength("Frame"); + uiDefPulldownBut(block, action_framemenu, NULL, + "Frame", xco, -2, xmax-3, 24, ""); + xco+= xmax; + + } + else { + xmax= GetButStringLength("Key"); + uiDefPulldownBut(block, action_keymenu, NULL, + "Key", xco, -2, xmax-3, 24, ""); + xco+= xmax; + } } uiBlockSetEmboss(block, UI_EMBOSS); - /* NAME ETC */ - ob= OBACT; - from = (ID *)ob; + /* MODE SELECTOR */ + uiDefButC(block, MENU, B_REDR, + "Editor Mode %t|Action Editor %x0|ShapeKey Editor %x1|Grease Pencil %x2", + xco,0,90,YIC, &(G.saction->mode), 0, 1, 0, 0, + "Editing modes for this editor"); - xco= std_libbuttons(block, xco, 0, B_ACTPIN, &G.saction->pin, - B_ACTIONBROWSE, ID_AC, 0, (ID*)G.saction->action, - from, &(G.saction->actnr), B_ACTALONE, - B_ACTLOCAL, B_ACTIONDELETE, 0, B_KEEPDATA); - - uiClearButLock(); - - xco += 8; - /* COPY PASTE */ - uiBlockBeginAlign(block); - if (curarea->headertype==HEADERTOP) { - uiDefIconBut(block, BUT, B_ACTCOPYKEYS, ICON_COPYUP, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Copies the selected keyframes from the selected channel(s) to the buffer"); - uiDefIconBut(block, BUT, B_ACTPASTEKEYS, ICON_PASTEUP, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Pastes the keyframes from the buffer"); + xco += (90 + 8); + + /* MODE-DEPENDENT DRAWING */ + if (G.saction->mode == SACTCONT_GPENCIL) { + char gp_name[64]; + + /* pin button */ + uiDefIconButS(block, ICONTOG, B_ACTPIN, ICON_PIN_DEHLT, xco,0,XIC,YIC, &G.saction->pin, 0, 0, 0, 0, "Keeps this view displaying the current data regardless of what Grease Pencil set is active"); + xco += (XIC + 5); + + /* just a simple string to help identify if any content */ + glRasterPos2f((float)xco, 5.0); + BIF_RasterPos((float)xco, 5.0); // stupid texture fonts + BIF_ThemeColor(TH_TEXT); + + sprintf(gp_name, (G.saction->gpd)?"Grease Pencil Data":""); + xmax= GetButStringLength(gp_name); + BIF_DrawString(uiBlockGetCurFont(block), gp_name, (U.transopts & USER_TR_BUTTONS)); + xco += xmax; } else { - uiDefIconBut(block, BUT, B_ACTCOPYKEYS, ICON_COPYDOWN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Copies the selected keyframes from the selected channel(s) to the buffer"); - uiDefIconBut(block, BUT, B_ACTPASTEKEYS, ICON_PASTEDOWN, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Pastes the keyframes from the buffer"); + /* NAME ETC */ + ob= OBACT; + from = (ID *)ob; + + xco= std_libbuttons(block, xco, 0, B_ACTPIN, &G.saction->pin, + B_ACTIONBROWSE, ID_AC, 0, (ID*)G.saction->action, + from, &(G.saction->actnr), B_ACTALONE, + B_ACTLOCAL, B_ACTIONDELETE, 0, B_KEEPDATA); + + uiClearButLock(); + + xco += 8; + + /* COPY PASTE */ + uiBlockBeginAlign(block); + if (curarea->headertype==HEADERTOP) { + uiDefIconBut(block, BUT, B_ACTCOPYKEYS, ICON_COPYUP, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Copies the selected keyframes from the selected channel(s) to the buffer"); + uiDefIconBut(block, BUT, B_ACTPASTEKEYS, ICON_PASTEUP, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Pastes the keyframes from the buffer"); + } + else { + uiDefIconBut(block, BUT, B_ACTCOPYKEYS, ICON_COPYDOWN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Copies the selected keyframes from the selected channel(s) to the buffer"); + uiDefIconBut(block, BUT, B_ACTPASTEKEYS, ICON_PASTEDOWN, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Pastes the keyframes from the buffer"); + } + uiBlockEndAlign(block); + xco += (XIC + 8); + + /* draw AUTOSNAP */ + if (G.saction->flag & SACTION_DRAWTIME) { + uiDefButC(block, MENU, B_REDR, + "Auto-Snap Keyframes %t|No Snap %x0|Second Step %x1|Nearest Second %x2|Nearest Marker %x3", + xco,0,70,YIC, &(G.saction->autosnap), 0, 1, 0, 0, + "Auto-snapping mode for keyframes when transforming"); + } + else { + uiDefButC(block, MENU, B_REDR, + "Auto-Snap Keyframes %t|No Snap %x0|Frame Step %x1|Nearest Frame %x2|Nearest Marker %x3", + xco,0,70,YIC, &(G.saction->autosnap), 0, 1, 0, 0, + "Auto-snapping mode for keyframes when transforming"); + } + + xco += (70 + 8); } - uiBlockEndAlign(block); - xco += (XIC + 8); - - /* draw AUTOSNAP */ - if (G.saction->flag & SACTION_DRAWTIME) { - uiDefButS(block, MENU, B_REDR, - "Auto-Snap Keyframes %t|No Snap %x0|Second Step %x1|Nearest Second %x2|Nearest Marker %x3", - xco,0,70,YIC, &(G.saction->autosnap), 0, 1, 0, 0, - "Auto-snapping mode for keyframes when transforming"); - } - else { - uiDefButS(block, MENU, B_REDR, - "Auto-Snap Keyframes %t|No Snap %x0|Frame Step %x1|Nearest Frame %x2|Nearest Marker %x3", - xco,0,70,YIC, &(G.saction->autosnap), 0, 1, 0, 0, - "Auto-snapping mode for keyframes when transforming"); - } - - xco += (70 + 8); /* draw LOCK */ uiDefIconButS(block, ICONTOG, 1, ICON_UNLOCKED, xco, 0, XIC, YIC, diff --git a/source/blender/src/header_node.c b/source/blender/src/header_node.c index ec6bbc9044c..4c7b4aa80bc 100644 --- a/source/blender/src/header_node.c +++ b/source/blender/src/header_node.c @@ -110,12 +110,16 @@ static void do_node_viewmenu(void *arg, int event) case 3: /* View all */ snode_home(curarea, snode); break; + case 4: /* Grease Pencil */ + add_blockhandler(curarea, NODES_HANDLER_GREASEPENCIL, UI_PNL_UNSTOW); + break; } allqueue(REDRAWNODE, 0); } static uiBlock *node_viewmenu(void *arg_unused) { + SpaceNode *snode= curarea->spacedata.first; uiBlock *block; short yco= 0, menuwidth=120; @@ -123,6 +127,12 @@ static uiBlock *node_viewmenu(void *arg_unused) UI_EMBOSSP, UI_HELV, curarea->headwin); uiBlockSetButmFunc(block, do_node_viewmenu, NULL); + if (snode->nodetree) { + uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Grease Pencil...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + } + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom In|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Out|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); diff --git a/source/blender/src/header_seq.c b/source/blender/src/header_seq.c index 393830a61cf..e5a63b9fe45 100644 --- a/source/blender/src/header_seq.c +++ b/source/blender/src/header_seq.c @@ -100,6 +100,9 @@ static void do_seq_viewmenu(void *arg, int event) case 6: /* Draw time/frames */ sseq->flag ^= SEQ_DRAWFRAMES; break; + case 7: /* Grease Pencil */ + add_blockhandler(curarea, SEQ_HANDLER_GREASEPENCIL, UI_PNL_UNSTOW); + break; } } @@ -111,7 +114,15 @@ static uiBlock *seq_viewmenu(void *arg_unused) block= uiNewBlock(&curarea->uiblocks, "seq_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); uiBlockSetButmFunc(block, do_seq_viewmenu, NULL); - + + if (sseq->mainb) { + uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, + "Grease Pencil...", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + } + if (sseq->mainb == 0) { uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation " diff --git a/source/blender/src/header_view3d.c b/source/blender/src/header_view3d.c index 0f3a46c8a8c..71bf0cd9bd4 100644 --- a/source/blender/src/header_view3d.c +++ b/source/blender/src/header_view3d.c @@ -601,6 +601,9 @@ static void do_view3d_viewmenu(void *arg, int event) break; case 20: /* Transform Space Panel */ add_blockhandler(curarea, VIEW3D_HANDLER_TRANSFORM, UI_PNL_UNSTOW); + break; + case 21: /* Grease Pencil */ + add_blockhandler(curarea, VIEW3D_HANDLER_GREASEPENCIL, UI_PNL_UNSTOW); break; } allqueue(REDRAWVIEW3D, 1); @@ -619,6 +622,7 @@ static uiBlock *view3d_viewmenu(void *arg_unused) uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Render Preview...|Shift P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 18, ""); uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "View Properties...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 16, ""); uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Background Image...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 15, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Grease Pencil...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 21, ""); uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c index 4fbf92d646e..ba8649eaa86 100644 --- a/source/blender/src/interface.c +++ b/source/blender/src/interface.c @@ -618,6 +618,9 @@ void uiBoundsBlock(uiBlock *block, int addval) uiBut *bt; int xof; + if(block==NULL) + return; + if(block->buttons.first==NULL) { if(block->panel) { block->minx= 0.0; block->maxx= block->panel->sizex; @@ -5405,7 +5408,9 @@ uiBlock *uiNewBlock(ListBase *lb, char *name, short dt, short font, short win) int getsizex, getsizey; bwin_getsize(win, &getsizex, &getsizey); - block->aspect= 2.0/( (getsizex)*block->winmat[0][0]); + /* TODO - investigate why block->winmat[0][0] is negative + * in the image view when viewRedrawForce is called */ + block->aspect= 2.0/fabs( (getsizex)*block->winmat[0][0]); } uiSetCurFont(block, font); diff --git a/source/blender/src/space.c b/source/blender/src/space.c index 58420604c83..92efb477095 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -56,6 +56,7 @@ #include "DNA_armature_types.h" #include "DNA_curve_types.h" #include "DNA_group_types.h" /* used for select_same_group */ +#include "DNA_gpencil_types.h" #include "DNA_image_types.h" #include "DNA_ipo_types.h" #include "DNA_mesh_types.h" @@ -159,6 +160,7 @@ #include "BDR_imagepaint.h" #include "BDR_sculptmode.h" #include "BDR_unwrapper.h" +#include "BDR_gpencil.h" #include "BLO_readfile.h" /* for BLO_blendhandle_close */ @@ -1193,13 +1195,17 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt) if(event==UI_BUT_EVENT) do_butspace(val); /* temporal, view3d deserves own queue? */ - /* we consider manipulator a button, defaulting to leftmouse */ + /* - we consider manipulator a button, defaulting to leftmouse + * - grease-pencil also defaults to leftmouse + */ if(event==LEFTMOUSE) { /* run any view3d event handler script links */ - if (event && sa->scriptlink.totscript) + if (event && sa->scriptlink.totscript) { if (BPY_do_spacehandlers(sa, event, SPACEHANDLER_VIEW3D_EVENT)) return; /* return if event was processed (swallowed) by handler(s) */ - + } + + if(gpencil_do_paint(sa)) return; if(BIF_do_manipulator(sa)) return; } @@ -1207,7 +1213,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt) if (U.flag & USER_LMOUSESELECT) { /* only swap mouse button for selection, in modes where it is relevant. * painting/sculpting stays on LEFTMOUSE */ - if ( !((G.f & G_SCULPTMODE) || (G.f & G_WEIGHTPAINT) || + if ( !((G.f & G_SCULPTMODE) || (G.f & G_WEIGHTPAINT) || (G.f & G_GREASEPENCIL) || (G.f & G_VERTEXPAINT) || (G.f & G_TEXTUREPAINT) || (G.f & G_PARTICLEEDIT)) || (G.obedit) ) { @@ -1945,7 +1951,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt) adduplicate(0, 0); } else if(G.qual==LR_CTRLKEY) { - imagestodisplist(); + imagestodisplist(); // removed } else if((G.qual==0)){ pupval= pupmenu("Draw mode%t|BoundBox %x1|Wire %x2|OpenGL Solid %x3|Shaded Solid %x4|Textured Solid %x5"); @@ -4816,6 +4822,11 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt) if(val) { if( uiDoBlocks(&curarea->uiblocks, event, 1)!=UI_NOTHING ) event= 0; + /* grease-pencil defaults to leftmouse */ + if(event==LEFTMOUSE) { + if(gpencil_do_paint(sa)) return; + } + /* swap mouse buttons based on user preference */ if (U.flag & USER_LMOUSESELECT) { if (event == LEFTMOUSE) { @@ -4829,11 +4840,11 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt) switch(event) { case LEFTMOUSE: - if(sseq->mainb || view2dmove(event)==0) { + if(sseq->mainb==0 && view2dmove(event)==0) { first= 1; set_special_seq_update(1); - + do { getmouseco_areawin(mval); areamouseco_to_ipoco(v2d, mval, &dx, &dy); @@ -6241,6 +6252,7 @@ void freespacelist(ScrArea *sa) if(vd->bgpic->ima) vd->bgpic->ima->id.us--; MEM_freeN(vd->bgpic); } + if(vd->gpd) free_gpencil_data(vd->gpd); if(vd->localvd) MEM_freeN(vd->localvd); if(vd->clipbb) MEM_freeN(vd->clipbb); if(vd->depths) { @@ -6284,7 +6296,12 @@ void freespacelist(ScrArea *sa) curvemapping_free(sima->cumap); } else if(sl->spacetype==SPACE_NODE) { -/* SpaceNode *snode= (SpaceNode *)sl; */ + SpaceNode *snode= (SpaceNode *)sl; + if(snode->gpd) free_gpencil_data(snode->gpd); + } + else if(sl->spacetype==SPACE_SEQ) { + SpaceSeq *sseq= (SpaceSeq *)sl; + if(sseq->gpd) free_gpencil_data(sseq->gpd); } } @@ -6314,6 +6331,7 @@ void duplicatespacelist(ScrArea *newarea, ListBase *lb1, ListBase *lb2) BIF_view3d_previewrender_free(v3d); v3d->depths= NULL; v3d->retopo_view_data= NULL; + v3d->gpd= gpencil_data_duplicate(v3d->gpd); } else if(sl->spacetype==SPACE_OOPS) { SpaceOops *so= (SpaceOops *)sl; @@ -6333,11 +6351,16 @@ void duplicatespacelist(ScrArea *newarea, ListBase *lb1, ListBase *lb2) else if(sl->spacetype==SPACE_NODE) { SpaceNode *snode= (SpaceNode *)sl; snode->nodetree= NULL; + snode->gpd= gpencil_data_duplicate(snode->gpd); } else if(sl->spacetype==SPACE_SCRIPT) { SpaceScript *sc = ( SpaceScript * ) sl; sc->but_refs = NULL; } + else if(sl->spacetype==SPACE_SEQ) { + SpaceSeq *sseq= (SpaceSeq *)sl; + sseq->gpd= gpencil_data_duplicate(sseq->gpd); + } sl= sl->next; } diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c index 562d9a4934d..706b079432c 100644 --- a/source/blender/src/transform_conversions.c +++ b/source/blender/src/transform_conversions.c @@ -70,6 +70,7 @@ #include "DNA_vfont_types.h" #include "DNA_constraint_types.h" #include "DNA_listBase.h" +#include "DNA_gpencil_types.h" #include "BKE_action.h" #include "BKE_armature.h" @@ -125,6 +126,7 @@ #include "BDR_drawaction.h" // list of keyframes in action #include "BDR_editobject.h" // reset_slowparents() +#include "BDR_gpencil.h" #include "BDR_unwrapper.h" #include "BLI_arithb.h" @@ -2474,6 +2476,96 @@ void flushTransIpoData(TransInfo *t) /* ********************* ACTION/NLA EDITOR ****************** */ +/* Called by special_aftertrans_update to make sure selected gp-frames replace + * any other gp-frames which may reside on that frame (that are not selected). + * It also makes sure gp-frames are still stored in chronological order after + * transform. + */ +static void posttrans_gpd_clean (bGPdata *gpd) +{ + bGPDlayer *gpl; + + for (gpl= gpd->layers.first; gpl; gpl= gpl->next) { + ListBase sel_buffer = {NULL, NULL}; + bGPDframe *gpf, *gpfn; + bGPDframe *gfs, *gfsn; + + /* loop 1: loop through and isolate selected gp-frames to buffer + * (these need to be sorted as they are isolated) + */ + for (gpf= gpl->frames.first; gpf; gpf= gpfn) { + gpfn= gpf->next; + + if (gpf->flag & GP_FRAME_SELECT) { + BLI_remlink(&gpl->frames, gpf); + + /* find place to add them in buffer + * - go backwards as most frames will still be in order, + * so doing it this way will be faster + */ + for (gfs= sel_buffer.last; gfs; gfs= gfs->prev) { + /* if current (gpf) occurs after this one in buffer, add! */ + if (gfs->framenum < gpf->framenum) { + BLI_insertlinkafter(&sel_buffer, gfs, gpf); + break; + } + } + if (gfs == NULL) + BLI_addhead(&sel_buffer, gpf); + } + } + + /* error checking: it is unlikely, but may be possible to have none selected */ + if (sel_buffer.first == NULL) + continue; + + /* if all were selected (i.e. gpl->frames is empty), then just transfer sel-buf over */ + if (gpl->frames.first == NULL) { + gpl->frames.first= sel_buffer.first; + gpl->frames.last= sel_buffer.last; + + continue; + } + + /* loop 2: remove duplicates of frames in buffers */ + //gfs= sel_buffer.first; + //gfsn= gfs->next; + + for (gpf= gpl->frames.first; gpf && sel_buffer.first; gpf= gpfn) { + gpfn= gpf->next; + + /* loop through sel_buffer, emptying stuff from front of buffer if ok */ + for (gfs= sel_buffer.first; gfs && gpf; gfs= gfsn) { + gfsn= gfs->next; + + /* if this buffer frame needs to go before current, add it! */ + if (gfs->framenum < gpf->framenum) { + /* transfer buffer frame to frames list (before current) */ + BLI_remlink(&sel_buffer, gfs); + BLI_insertlinkbefore(&gpl->frames, gpf, gfs); + } + /* if this buffer frame is on same frame, replace current with it and stop */ + else if (gfs->framenum == gpf->framenum) { + /* transfer buffer frame to frames list (before current) */ + BLI_remlink(&sel_buffer, gfs); + BLI_insertlinkbefore(&gpl->frames, gpf, gfs); + + /* get rid of current frame */ + gpencil_layer_delframe(gpl, gpf); + } + } + } + + /* if anything is still in buffer, append to end */ + for (gfs= sel_buffer.first; gfs; gfs= gfsn) { + gfsn= gfs->next; + + BLI_remlink(&sel_buffer, gfs); + BLI_addtail(&gpl->frames, gfs); + } + } +} + /* Called by special_aftertrans_update to make sure selected keyframes replace * any other keyframes which may reside on that frame (that is not selected). */ @@ -2698,6 +2790,26 @@ static int count_ipo_keys(Ipo *ipo, char side, float cfra) return count; } +/* fully select selected beztriples, but only include if it's on the right side of cfra */ +static int count_gplayer_frames(bGPDlayer *gpl, char side, float cfra) +{ + bGPDframe *gpf; + int count = 0; + + if (gpl == NULL) + return count; + + /* only include points that occur on the right side of cfra */ + for (gpf= gpl->frames.first; gpf; gpf= gpf->next) { + if (gpf->flag & GP_FRAME_SELECT) { + if (FrameOnMouseSide(side, gpf->framenum, cfra)) + count++; + } + } + + return count; +} + /* This function assigns the information to transdata */ static void TimeToTransData(TransData *td, float *time, Object *ob) { @@ -2751,9 +2863,68 @@ static TransData *IpoToTransData(TransData *td, Ipo *ipo, Object *ob, char side, return td; } +/* helper struct for gp-frame transforms (only used here) */ +typedef struct tGPFtransdata { + float val; /* where transdata writes transform */ + int *sdata; /* pointer to gpf->framenum */ +} tGPFtransdata; + +/* This function helps flush transdata written to tempdata into the gp-frames */ +void flushTransGPactionData (TransInfo *t) +{ + tGPFtransdata *tfd; + int i; + + /* find the first one to start from */ + if (t->mode == TFM_TIME_SLIDE) + tfd= (tGPFtransdata *)( (float *)(t->customData) + 2 ); + else + tfd= (tGPFtransdata *)(t->customData); + + /* flush data! */ + for (i = 0; i < t->total; i++, tfd++) { + *(tfd->sdata)= (int)floor(tfd->val + 0.5); + } +} + +/* This function advances the address to which td points to, so it must return + * the new address so that the next time new transform data is added, it doesn't + * overwrite the existing ones... i.e. td = GPLayerToTransData(td, ipo, ob, side, cfra); + * + * The 'side' argument is needed for the extend mode. 'B' = both sides, 'R'/'L' mean only data + * on the named side are used. + */ +static int GPLayerToTransData (TransData *td, tGPFtransdata *tfd, bGPDlayer *gpl, short side, float cfra) +{ + bGPDframe *gpf; + int count= 0; + + /* check for select frames on right side of current frame */ + for (gpf= gpl->frames.first; gpf; gpf= gpf->next) { + if (gpf->flag & GP_FRAME_SELECT) { + if (FrameOnMouseSide(side, gpf->framenum, cfra)) { + /* memory is calloc'ed, so that should zero everything nicely for us */ + td->val= &tfd->val; + td->ival= gpf->framenum; + + tfd->val= gpf->framenum; + tfd->sdata= &gpf->framenum; + + /* advance td now */ + td++; + tfd++; + count++; + } + } + } + + return count; +} + static void createTransActionData(TransInfo *t) { TransData *td = NULL; + tGPFtransdata *tfd = NULL; Object *ob= NULL; ListBase act_data = {NULL, NULL}; @@ -2771,7 +2942,10 @@ static void createTransActionData(TransInfo *t) if (data == NULL) return; /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS); + if (datatype == ACTCONT_GPENCIL) + filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT); + else + filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS); actdata_filter(&act_data, filter, data, datatype); /* is the action scaled? if so, the it should belong to the active object */ @@ -2800,8 +2974,12 @@ static void createTransActionData(TransInfo *t) cfra = CFRA; /* loop 1: fully select ipo-keys and count how many BezTriples are selected */ - for (ale= act_data.first; ale; ale= ale->next) - count += count_ipo_keys(ale->key_data, side, cfra); + for (ale= act_data.first; ale; ale= ale->next) { + if (ale->type == ACTTYPE_GPLAYER) + count += count_gplayer_frames(ale->data, side, cfra); + else + count += count_ipo_keys(ale->key_data, side, cfra); + } /* stop if trying to build list if nothing selected */ if (count == 0) { @@ -2812,16 +2990,38 @@ static void createTransActionData(TransInfo *t) /* allocate memory for data */ t->total= count; + t->data= MEM_callocN(t->total*sizeof(TransData), "TransData(Action Editor)"); - if (t->mode == TFM_TIME_SLIDE) + td= t->data; + + if (datatype == ACTCONT_GPENCIL) { + if (t->mode == TFM_TIME_SLIDE) { + t->customData= MEM_callocN((sizeof(float)*2)+(sizeof(tGPFtransdata)*count), "TimeSlide + tGPFtransdata"); + tfd= (tGPFtransdata *)( (float *)(t->customData) + 2 ); + } + else { + t->customData= MEM_callocN(sizeof(tGPFtransdata)*count, "tGPFtransdata"); + tfd= (tGPFtransdata *)(t->customData); + } + } + else if (t->mode == TFM_TIME_SLIDE) t->customData= MEM_callocN(sizeof(float)*2, "TimeSlide Min/Max"); - td= t->data; /* loop 2: build transdata array */ for (ale= act_data.first; ale; ale= ale->next) { - Ipo *ipo= (Ipo *)ale->key_data; - - td= IpoToTransData(td, ipo, ob, side, cfra); + if (ale->type == ACTTYPE_GPLAYER) { + bGPDlayer *gpl= (bGPDlayer *)ale->data; + int i; + + i = GPLayerToTransData(td, tfd, gpl, side, cfra); + td += i; + tfd += i; + } + else { + Ipo *ipo= (Ipo *)ale->key_data; + + td= IpoToTransData(td, ipo, ob, side, cfra); + } } /* check if we're supposed to be setting minx/maxx for TimeSlide */ @@ -3673,6 +3873,13 @@ void special_aftertrans_update(TransInfo *t) DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); } + else if (datatype == ACTCONT_GPENCIL) { + /* remove duplicate frames and also make sure points are in order! */ + if ((cancelled == 0) || (duplicate)) + { + posttrans_gpd_clean(data); + } + } G.saction->flag &= ~SACTION_MOVING; } diff --git a/source/blender/src/transform_generics.c b/source/blender/src/transform_generics.c index 6cb7a34d1bc..c332fd723eb 100644 --- a/source/blender/src/transform_generics.c +++ b/source/blender/src/transform_generics.c @@ -278,6 +278,11 @@ void recalcData(TransInfo *t) data = get_action_context(&context); if (data == NULL) return; + /* always flush data if gpencil context */ + if (context == ACTCONT_GPENCIL) { + flushTransGPactionData(t); + } + if (G.saction->lock) { if (context == ACTCONT_ACTION) { if(ob) { @@ -753,6 +758,10 @@ void postTrans (TransInfo *t) if (G.sima->flag & SI_LIVE_UNWRAP) unwrap_lscm_live_end(t->state == TRANS_CANCEL); } + else if(t->spacetype==SPACE_ACTION) { + if (t->customData) + MEM_freeN(t->customData); + } } void applyTransObjects(TransInfo *t) diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c index 4aea0df74b9..92e49ab29fa 100644 --- a/source/blender/src/usiblender.c +++ b/source/blender/src/usiblender.c @@ -883,7 +883,7 @@ void BIF_write_file(char *target) if (G.f & G_DOSCRIPTLINKS) BPY_do_pyscript(&G.scene->id, SCRIPT_ONSAVE); for (li= G.main->library.first; li; li= li->id.next) { - if (BLI_streq(li->name, target)) { + if (li->parent==NULL && BLI_streq(li->name, target)) { error("Cannot overwrite used library"); return; } diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp index 5f37de24ed6..1604dfe5cce 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp @@ -101,6 +101,13 @@ int KX_BlenderCanvas::GetHeight( return scrarea_get_win_height(m_area); } +RAS_Rect & +KX_BlenderCanvas:: +GetWindowArea( +){ + return m_area_rect; +} + void KX_BlenderCanvas:: SetViewPort( @@ -112,6 +119,11 @@ SetViewPort( int minx = scrarea_get_win_x(m_area); int miny = scrarea_get_win_y(m_area); + m_area_rect.SetLeft(minx + x1); + m_area_rect.SetBottom(miny + y1); + m_area_rect.SetRight(minx + x2); + m_area_rect.SetTop(miny + y2); + glViewport(minx + x1, miny + y1, vp_width, vp_height); glScissor(minx + x1, miny + y1, vp_width, vp_height); } diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h index b155d39e149..bc202a8558c 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h @@ -117,6 +117,10 @@ public: return m_displayarea; }; + RAS_Rect & + GetWindowArea( + ); + void SetViewPort( int x1, int y1, @@ -159,6 +163,7 @@ public: private: /** Blender area the game engine is running within */ struct ScrArea* m_area; + RAS_Rect m_area_rect; }; #endif // __KX_BLENDERCANVAS diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index f3e22cd297a..1f1ac6da119 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1847,7 +1847,10 @@ void BL_ConvertBlenderObjects(struct Main* maggie, int aspect_width; int aspect_height; vector inivel,iniang; - + set grouplist; // list of groups to be converted + set allblobj; // all objects converted + set groupobj; // objects from groups (never in active layer) + if (alwaysUseExpandFraming) { frame_type = RAS_FrameSettings::e_frame_extend; aspect_width = canvas->GetWidth(); @@ -1919,6 +1922,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie, for (SETLOOPER(blenderscene, base)) { Object* blenderobject = base->object; + allblobj.insert(blenderobject); + KX_GameObject* gameobj = gameobject_from_blenderobject( base->object, kxscene, @@ -2046,7 +2051,9 @@ void BL_ConvertBlenderObjects(struct Main* maggie, gameobj->NodeUpdateGS(0,true); gameobj->Bucketize(); - + + if (gameobj->IsDupliGroup()) + grouplist.insert(blenderobject->dup_group); } else { @@ -2073,6 +2080,188 @@ void BL_ConvertBlenderObjects(struct Main* maggie, } + if (!grouplist.empty()) + { + // now convert the group referenced by dupli group object + // keep track of all groups already converted + set allgrouplist = grouplist; + set tempglist; + // recurse + while (!grouplist.empty()) + { + set::iterator git; + tempglist.clear(); + tempglist.swap(grouplist); + for (git=tempglist.begin(); git!=tempglist.end(); git++) + { + Group* group = *git; + GroupObject* go; + for(go=(GroupObject*)group->gobject.first; go; go=(GroupObject*)go->next) + { + Object* blenderobject = go->ob; + if (converter->FindGameObject(blenderobject) == NULL) + { + allblobj.insert(blenderobject); + groupobj.insert(blenderobject); + KX_GameObject* gameobj = gameobject_from_blenderobject( + blenderobject, + kxscene, + rendertools, + converter, + blenderscene); + + // this code is copied from above except that + // object from groups are never is active layer + bool isInActiveLayer = false; + bool addobj=true; + + if (converter->addInitFromFrame) + if (!isInActiveLayer) + addobj=false; + + if (gameobj&&addobj) + { + MT_Point3 posPrev; + MT_Matrix3x3 angor; + if (converter->addInitFromFrame) + blenderscene->r.cfra=blenderscene->r.sfra; + + MT_Point3 pos = MT_Point3( + blenderobject->loc[0]+blenderobject->dloc[0], + blenderobject->loc[1]+blenderobject->dloc[1], + blenderobject->loc[2]+blenderobject->dloc[2] + ); + MT_Vector3 eulxyz = MT_Vector3( + blenderobject->rot[0], + blenderobject->rot[1], + blenderobject->rot[2] + ); + MT_Vector3 scale = MT_Vector3( + blenderobject->size[0], + blenderobject->size[1], + blenderobject->size[2] + ); + if (converter->addInitFromFrame){//rcruiz + float eulxyzPrev[3]; + blenderscene->r.cfra=blenderscene->r.sfra-1; + update_for_newframe(); + MT_Vector3 tmp=pos-MT_Point3(blenderobject->loc[0]+blenderobject->dloc[0], + blenderobject->loc[1]+blenderobject->dloc[1], + blenderobject->loc[2]+blenderobject->dloc[2] + ); + eulxyzPrev[0]=blenderobject->rot[0]; + eulxyzPrev[1]=blenderobject->rot[1]; + eulxyzPrev[2]=blenderobject->rot[2]; + + double fps = (double) blenderscene->r.frs_sec/ + (double) blenderscene->r.frs_sec_base; + + tmp.scale(fps, fps, fps); + inivel.push_back(tmp); + tmp=eulxyz-eulxyzPrev; + tmp.scale(fps, fps, fps); + iniang.push_back(tmp); + blenderscene->r.cfra=blenderscene->r.sfra; + update_for_newframe(); + } + + gameobj->NodeSetLocalPosition(pos); + gameobj->NodeSetLocalOrientation(MT_Matrix3x3(eulxyz)); + gameobj->NodeSetLocalScale(scale); + gameobj->NodeUpdateGS(0,true); + + BL_ConvertIpos(blenderobject,gameobj,converter); + // TODO: expand to multiple ipos per mesh + Material *mat = give_current_material(blenderobject, 1); + if(mat) BL_ConvertMaterialIpos(mat, gameobj, converter); + + sumolist->Add(gameobj->AddRef()); + + BL_ConvertProperties(blenderobject,gameobj,timemgr,kxscene,isInActiveLayer); + + + gameobj->SetName(blenderobject->id.name); + + // templist to find Root Parents (object with no parents) + templist->Add(gameobj->AddRef()); + + // update children/parent hierarchy + if ((blenderobject->parent != 0)&&(!converter->addInitFromFrame)) + { + // blender has an additional 'parentinverse' offset in each object + SG_Node* parentinversenode = new SG_Node(NULL,NULL,SG_Callbacks()); + + // define a normal parent relationship for this node. + KX_NormalParentRelation * parent_relation = KX_NormalParentRelation::New(); + parentinversenode->SetParentRelation(parent_relation); + + parentChildLink pclink; + pclink.m_blenderchild = blenderobject; + pclink.m_gamechildnode = parentinversenode; + vec_parent_child.push_back(pclink); + + float* fl = (float*) blenderobject->parentinv; + MT_Transform parinvtrans(fl); + parentinversenode->SetLocalPosition(parinvtrans.getOrigin()); + parentinversenode->SetLocalOrientation(parinvtrans.getBasis()); + + parentinversenode->AddChild(gameobj->GetSGNode()); + } + + // needed for python scripting + logicmgr->RegisterGameObjectName(gameobj->GetName(),gameobj); + + // needed for dynamic object morphing + logicmgr->RegisterGameObj(gameobj, blenderobject); + for (int i = 0; i < gameobj->GetMeshCount(); i++) + logicmgr->RegisterGameMeshName(gameobj->GetMesh(i)->GetName(), blenderobject); + + converter->RegisterGameObject(gameobj, blenderobject); + // this was put in rapidly, needs to be looked at more closely + // only draw/use objects in active 'blender' layers + + logicbrick_conversionlist->Add(gameobj->AddRef()); + + if (converter->addInitFromFrame){ + posPrev=gameobj->NodeGetWorldPosition(); + angor=gameobj->NodeGetWorldOrientation(); + } + if (isInActiveLayer) + { + objectlist->Add(gameobj->AddRef()); + //tf.Add(gameobj->GetSGNode()); + + gameobj->NodeUpdateGS(0,true); + gameobj->Bucketize(); + + } + else + { + //we must store this object otherwise it will be deleted + //at the end of this function if it is not a root object + inactivelist->Add(gameobj->AddRef()); + + } + if (gameobj->IsDupliGroup()) + { + // check that the group is not already converted + if (allgrouplist.insert(blenderobject->dup_group).second) + grouplist.insert(blenderobject->dup_group); + } + if (converter->addInitFromFrame){ + gameobj->NodeSetLocalPosition(posPrev); + gameobj->NodeSetLocalOrientation(angor); + } + + } + if (gameobj) + gameobj->Release(); + } + } + } + } + } + if (blenderscene->camera) { KX_Camera *gamecamera= (KX_Camera*) converter->FindGameObject(blenderscene->camera); @@ -2081,15 +2270,18 @@ void BL_ConvertBlenderObjects(struct Main* maggie, } // Set up armatures - for(SETLOOPER(blenderscene, base)){ - if (base->object->type==OB_MESH){ - Mesh *me = (Mesh*)base->object->data; + set::iterator oit; + for(oit=allblobj.begin(); oit!=allblobj.end(); oit++) + { + Object* blenderobj = *oit; + if (blenderobj->type==OB_MESH){ + Mesh *me = (Mesh*)blenderobj->data; if (me->dvert){ - KX_GameObject *obj = converter->FindGameObject(base->object); + KX_GameObject *obj = converter->FindGameObject(blenderobj); - if (base->object->parent && base->object->parent->type==OB_ARMATURE && base->object->partype==PARSKEL){ - KX_GameObject *par = converter->FindGameObject(base->object->parent); + if (obj && blenderobj->parent && blenderobj->parent->type==OB_ARMATURE && blenderobj->partype==PARSKEL){ + KX_GameObject *par = converter->FindGameObject(blenderobj->parent); if (par) ((BL_SkinDeformer*)(((BL_DeformableGameObject*)obj)->m_pDeformer))->SetArmature((BL_ArmatureObject*) par); } @@ -2174,7 +2366,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie, { meshobj = gameobj->GetMesh(0); } - BL_CreatePhysicsObjectNew(gameobj,blenderobject,meshobj,kxscene,activeLayerBitInfo,physics_engine,converter,processCompoundChildren); + int layerMask = (groupobj.find(blenderobject) == groupobj.end()) ? activeLayerBitInfo : 0; + BL_CreatePhysicsObjectNew(gameobj,blenderobject,meshobj,kxscene,layerMask,physics_engine,converter,processCompoundChildren); } processCompoundChildren = true; @@ -2189,7 +2382,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie, { meshobj = gameobj->GetMesh(0); } - BL_CreatePhysicsObjectNew(gameobj,blenderobject,meshobj,kxscene,activeLayerBitInfo,physics_engine,converter,processCompoundChildren); + int layerMask = (groupobj.find(blenderobject) == groupobj.end()) ? activeLayerBitInfo : 0; + BL_CreatePhysicsObjectNew(gameobj,blenderobject,meshobj,kxscene,layerMask,physics_engine,converter,processCompoundChildren); } @@ -2311,22 +2505,25 @@ void BL_ConvertBlenderObjects(struct Main* maggie, { KX_GameObject* gameobj = static_cast(logicbrick_conversionlist->GetValue(i)); struct Object* blenderobj = converter->FindBlenderObject(gameobj); - bool isInActiveLayer = (blenderobj->lay & activeLayerBitInfo)!=0; - BL_ConvertActuators(maggie->name, blenderobj,gameobj,logicmgr,kxscene,ketsjiEngine,executePriority, activeLayerBitInfo,isInActiveLayer,rendertools,converter); + int layerMask = (groupobj.find(blenderobj) == groupobj.end()) ? activeLayerBitInfo : 0; + bool isInActiveLayer = (blenderobj->lay & layerMask)!=0; + BL_ConvertActuators(maggie->name, blenderobj,gameobj,logicmgr,kxscene,ketsjiEngine,executePriority, layerMask,isInActiveLayer,rendertools,converter); } for ( i=0;iGetCount();i++) { KX_GameObject* gameobj = static_cast(logicbrick_conversionlist->GetValue(i)); struct Object* blenderobj = converter->FindBlenderObject(gameobj); - bool isInActiveLayer = (blenderobj->lay & activeLayerBitInfo)!=0; - BL_ConvertControllers(blenderobj,gameobj,logicmgr,pythondictionary,executePriority,activeLayerBitInfo,isInActiveLayer,converter); + int layerMask = (groupobj.find(blenderobj) == groupobj.end()) ? activeLayerBitInfo : 0; + bool isInActiveLayer = (blenderobj->lay & layerMask)!=0; + BL_ConvertControllers(blenderobj,gameobj,logicmgr,pythondictionary,executePriority,layerMask,isInActiveLayer,converter); } for ( i=0;iGetCount();i++) { KX_GameObject* gameobj = static_cast(logicbrick_conversionlist->GetValue(i)); struct Object* blenderobj = converter->FindBlenderObject(gameobj); - bool isInActiveLayer = (blenderobj->lay & activeLayerBitInfo)!=0; - BL_ConvertSensors(blenderobj,gameobj,logicmgr,kxscene,keydev,executePriority,activeLayerBitInfo,isInActiveLayer,canvas,converter); + int layerMask = (groupobj.find(blenderobj) == groupobj.end()) ? activeLayerBitInfo : 0; + bool isInActiveLayer = (blenderobj->lay & layerMask)!=0; + BL_ConvertSensors(blenderobj,gameobj,logicmgr,kxscene,keydev,executePriority,layerMask,isInActiveLayer,canvas,converter); } // apply the initial state to controllers for ( i=0;iGetCount();i++) @@ -2344,5 +2541,19 @@ void BL_ConvertBlenderObjects(struct Main* maggie, // Calculate the scene btree - // too slow - commented out. //kxscene->SetNodeTree(tf.MakeTree()); + + // instantiate dupli group, we will loop trough the object + // that are in active layers. Note that duplicating group + // has the effect of adding objects at the end of objectlist. + // Only loop through the first part of the list. + int objcount = objectlist->GetCount(); + for (i=0;iGetValue(i); + if (gameobj->IsDupliGroup()) + { + kxscene->DupliGroupRecurse(gameobj, 0); + } + } } diff --git a/source/gameengine/Converter/BL_DeformableGameObject.h b/source/gameengine/Converter/BL_DeformableGameObject.h index 57a404ad72b..315ad18c42c 100644 --- a/source/gameengine/Converter/BL_DeformableGameObject.h +++ b/source/gameengine/Converter/BL_DeformableGameObject.h @@ -60,6 +60,7 @@ public: { if (m_pDeformer) m_pDeformer->Relink (map); + KX_GameObject::Relink(map); }; void ProcessReplica(KX_GameObject* replica); diff --git a/source/gameengine/Converter/BL_ShapeDeformer.cpp b/source/gameengine/Converter/BL_ShapeDeformer.cpp index eb5c1467ea5..b2e54539b19 100644 --- a/source/gameengine/Converter/BL_ShapeDeformer.cpp +++ b/source/gameengine/Converter/BL_ShapeDeformer.cpp @@ -109,6 +109,13 @@ bool BL_ShapeDeformer::ExecuteShapeDrivers(void) vector::iterator it; void *poin; int type; + // the shape drivers use the bone matrix as input. Must + // update the matrix now + Object* par_arma = m_armobj->GetArmatureObject(); + m_armobj->ApplyPose(); + where_is_pose( par_arma ); + PoseApplied(true); + for (it=m_shapeDrivers.begin(); it!=m_shapeDrivers.end(); it++) { // no need to set a specific time: this curve has a driver IpoCurve *icu = *it; diff --git a/source/gameengine/Converter/BL_SkinDeformer.cpp b/source/gameengine/Converter/BL_SkinDeformer.cpp index d3442fe5298..f96c40c098f 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.cpp +++ b/source/gameengine/Converter/BL_SkinDeformer.cpp @@ -66,7 +66,8 @@ BL_SkinDeformer::BL_SkinDeformer(BL_DeformableGameObject *gameobj, m_armobj(arma), m_lastArmaUpdate(-1), m_defbase(&bmeshobj->defbase), - m_releaseobject(false) + m_releaseobject(false), + m_poseApplied(false) { Mat4CpyMat4(m_obmat, bmeshobj->obmat); }; @@ -98,32 +99,28 @@ BL_SkinDeformer::~BL_SkinDeformer() m_armobj->Release(); } -bool BL_SkinDeformer::Apply(RAS_IPolyMaterial *) +bool BL_SkinDeformer::Apply(RAS_IPolyMaterial *mat) { size_t i, j; - if (!Update()) - // no need to update the cache - return false; + // update the vertex in m_transverts + Update(); - // Update all materials at once, so we can do the above update test - // without ending up with some materials not updated - for(RAS_MaterialBucket::Set::iterator mit = m_pMeshObject->GetFirstMaterial(); - mit != m_pMeshObject->GetLastMaterial(); ++ mit) { - RAS_IPolyMaterial *mat = (*mit)->GetPolyMaterial(); + // The vertex cache can only be updated for this deformer: + // Duplicated objects with more than one ploymaterial (=multiple mesh slot per object) + // share the same mesh (=the same cache). As the rendering is done per polymaterial + // cycling through the objects, the entire mesh cache cannot be updated in one shot. + vecVertexArray& vertexarrays = m_pMeshObject->GetVertexCache(mat); - vecVertexArray& vertexarrays = m_pMeshObject->GetVertexCache(mat); + // For each array + for (i=0; iGetArmatureObject(); - where_is_pose( par_arma ); + if (!PoseApplied()){ + m_armobj->ApplyPose(); + where_is_pose( par_arma ); + } /* store verts locally */ VerifyStorage(); @@ -180,7 +179,8 @@ bool BL_SkinDeformer::Update(void) /* Update the current frame */ m_lastArmaUpdate=m_armobj->GetLastFrame(); - + /* reset for next frame */ + PoseApplied(false); /* indicate that the m_transverts and normals are up to date */ return true; } diff --git a/source/gameengine/Converter/BL_SkinDeformer.h b/source/gameengine/Converter/BL_SkinDeformer.h index f35db8273c4..d3fc5ae2a81 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.h +++ b/source/gameengine/Converter/BL_SkinDeformer.h @@ -81,10 +81,13 @@ public: virtual ~BL_SkinDeformer(); bool Update (void); bool Apply (class RAS_IPolyMaterial *polymat); + bool PoseApplied() + { return m_poseApplied; } + void PoseApplied(bool applied) + { m_poseApplied = applied; } bool PoseUpdated(void) { if (m_armobj && m_lastArmaUpdate!=m_armobj->GetLastFrame()) { - m_armobj->ApplyPose(); return true; } return false; @@ -102,6 +105,7 @@ protected: ListBase* m_defbase; float m_obmat[4][4]; // the reference matrix for skeleton deform bool m_releaseobject; + bool m_poseApplied; }; diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index 1cc1b2e27a3..8739fb109fd 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -503,7 +503,7 @@ void BL_ConvertActuators(char* maggiename, case ACT_PROPERTY: { bPropertyActuator* propact = (bPropertyActuator*) bact->data; - CValue* destinationObj = NULL; + SCA_IObject* destinationObj = NULL; /* here the destinationobject is searched. problem with multiple scenes: other scenes diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp index f6efd485adb..e73358bc1e8 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp @@ -82,7 +82,10 @@ void SCA_ILogicBrick::ReParent(SCA_IObject* parent) m_gameobj = parent; } - +void SCA_ILogicBrick::Relink(GEN_Map *obj_map) +{ + // nothing to do +} CValue* SCA_ILogicBrick::Calc(VALUE_OPERATOR op, CValue *val) { diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.h b/source/gameengine/GameLogic/SCA_ILogicBrick.h index 80bc6ae3b86..c28711ac0f6 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.h +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.h @@ -32,6 +32,8 @@ #include "Value.h" #include "SCA_IObject.h" #include "BoolValue.h" +#include "GEN_Map.h" +#include "GEN_HashedPtr.h" class SCA_ILogicBrick : public CValue { @@ -59,6 +61,7 @@ public: SCA_IObject* GetParent(); virtual void ReParent(SCA_IObject* parent); + virtual void Relink(GEN_Map *obj_map); // act as a BoolValue (with value IsPositiveTrigger) virtual CValue* Calc(VALUE_OPERATOR op, CValue *val); diff --git a/source/gameengine/GameLogic/SCA_IObject.cpp b/source/gameengine/GameLogic/SCA_IObject.cpp index c5bb4a41552..25b4af696ea 100644 --- a/source/gameengine/GameLogic/SCA_IObject.cpp +++ b/source/gameengine/GameLogic/SCA_IObject.cpp @@ -306,7 +306,7 @@ const MT_Point3& SCA_IObject::ConvertPythonPylist(PyObject* pylist) } #endif -void SCA_IObject::Suspend(void) +void SCA_IObject::Suspend() { if ((!m_ignore_activity_culling) && (!m_suspended)) { diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp index ebe1cd51863..7062f2cef6a 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp @@ -42,7 +42,7 @@ /* Native functions */ /* ------------------------------------------------------------------------- */ -SCA_PropertyActuator::SCA_PropertyActuator(SCA_IObject* gameobj,CValue* sourceObj,const STR_String& propname,const STR_String& expr,int acttype,PyTypeObject* T ) +SCA_PropertyActuator::SCA_PropertyActuator(SCA_IObject* gameobj,SCA_IObject* sourceObj,const STR_String& propname,const STR_String& expr,int acttype,PyTypeObject* T ) : SCA_IActuator(gameobj,T), m_type(acttype), m_propname(propname), @@ -51,14 +51,14 @@ SCA_PropertyActuator::SCA_PropertyActuator(SCA_IObject* gameobj,CValue* sourceOb { // protect ourselves against someone else deleting the source object // don't protect against ourselves: it would create a dead lock - if (m_sourceObj && m_sourceObj != GetParent()) - m_sourceObj->AddRef(); + if (m_sourceObj) + m_sourceObj->RegisterActuator(this); } SCA_PropertyActuator::~SCA_PropertyActuator() { - if (m_sourceObj && m_sourceObj != GetParent()) - m_sourceObj->Release(); + if (m_sourceObj) + m_sourceObj->UnregisterActuator(this); } bool SCA_PropertyActuator::Update() @@ -185,10 +185,31 @@ void SCA_PropertyActuator::ProcessReplica() // no need to check for self reference like in the constructor: // the replica will always have a different parent if (m_sourceObj) - m_sourceObj->AddRef(); + m_sourceObj->RegisterActuator(this); SCA_IActuator::ProcessReplica(); } +bool SCA_PropertyActuator::UnlinkObject(SCA_IObject* clientobj) +{ + if (clientobj == m_sourceObj) + { + // this object is being deleted, we cannot continue to track it. + m_sourceObj = NULL; + return true; + } + return false; +} + +void SCA_PropertyActuator::Relink(GEN_Map *obj_map) +{ + void **h_obj = (*obj_map)[m_sourceObj]; + if (h_obj) { + if (m_sourceObj) + m_sourceObj->UnregisterActuator(this); + m_sourceObj = (SCA_IObject*)(*h_obj); + m_sourceObj->RegisterActuator(this); + } +} /* ------------------------------------------------------------------------- */ diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.h b/source/gameengine/GameLogic/SCA_PropertyActuator.h index f8305901c51..1e435684572 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.h +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.h @@ -52,7 +52,7 @@ class SCA_PropertyActuator : public SCA_IActuator int m_type; STR_String m_propname; STR_String m_exprtxt; - CValue* m_sourceObj; // for copy property actuator + SCA_IObject* m_sourceObj; // for copy property actuator public: @@ -60,7 +60,7 @@ public: SCA_PropertyActuator( SCA_IObject* gameobj, - CValue* sourceObj, + SCA_IObject* sourceObj, const STR_String& propname, const STR_String& expr, int acttype, @@ -74,7 +74,9 @@ public: GetReplica( ); - void ProcessReplica(); + virtual void ProcessReplica(); + virtual bool UnlinkObject(SCA_IObject* clientobj); + virtual void Relink(GEN_Map *obj_map); virtual bool Update(); diff --git a/source/gameengine/GamePlayer/common/GPC_Canvas.h b/source/gameengine/GamePlayer/common/GPC_Canvas.h index f82166dfa88..87719041f65 100644 --- a/source/gameengine/GamePlayer/common/GPC_Canvas.h +++ b/source/gameengine/GamePlayer/common/GPC_Canvas.h @@ -130,6 +130,12 @@ public: ) { return m_displayarea; }; + + RAS_Rect & + GetWindowArea( + ) { + return m_displayarea; + } void BeginFrame( diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp index 70443ced7a9..c7b2a671f78 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp @@ -13,11 +13,13 @@ #include "KX_ClientObjectInfo.h" #include "PHY_IPhysicsEnvironment.h" +#include "CcdPhysicsEnvironment.h" KX_BulletPhysicsController::KX_BulletPhysicsController (const CcdConstructionInfo& ci, bool dyna) : KX_IPhysicsController(dyna,(PHY_IPhysicsController*)this), -CcdPhysicsController(ci) +CcdPhysicsController(ci), +m_savedCollisionFlags(0) { } @@ -131,9 +133,10 @@ void KX_BulletPhysicsController::getOrientation(MT_Quaternion& orn) CcdPhysicsController::getOrientation(myorn[0],myorn[1],myorn[2],myorn[3]); orn = MT_Quaternion(myorn[0],myorn[1],myorn[2],myorn[3]); } -void KX_BulletPhysicsController::setOrientation(const MT_Quaternion& orn) +void KX_BulletPhysicsController::setOrientation(const MT_Matrix3x3& orn) { - CcdPhysicsController::setOrientation(orn.x(),orn.y(),orn.z(),orn.w()); + btMatrix3x3 btmat(orn[0][0], orn[0][1], orn[1][2], orn[1][0], orn[1][1], orn[1][2], orn[2][0], orn[2][1], orn[2][2]); + CcdPhysicsController::setWorldOrientation(btmat); } void KX_BulletPhysicsController::setPosition(const MT_Point3& pos) { @@ -161,14 +164,37 @@ void KX_BulletPhysicsController::setRigidBody(bool rigid) { } -void KX_BulletPhysicsController::SuspendDynamics() +void KX_BulletPhysicsController::SuspendDynamics(bool ghost) { - GetRigidBody()->setActivationState(DISABLE_SIMULATION); - + btRigidBody *body = GetRigidBody(); + if (body->getActivationState() != DISABLE_SIMULATION) + { + btBroadphaseProxy* handle = body->getBroadphaseHandle(); + m_savedCollisionFlags = body->getCollisionFlags(); + m_savedMass = GetMass(); + m_savedCollisionFilterGroup = handle->m_collisionFilterGroup; + m_savedCollisionFilterMask = handle->m_collisionFilterMask; + body->setActivationState(DISABLE_SIMULATION); + GetPhysicsEnvironment()->updateCcdPhysicsController(this, + 0.0, + btCollisionObject::CF_STATIC_OBJECT|((ghost)?btCollisionObject::CF_NO_CONTACT_RESPONSE:(m_savedCollisionFlags&btCollisionObject::CF_NO_CONTACT_RESPONSE)), + btBroadphaseProxy::StaticFilter, + btBroadphaseProxy::AllFilter ^ btBroadphaseProxy::StaticFilter); + } } + void KX_BulletPhysicsController::RestoreDynamics() { - GetRigidBody()->forceActivationState(ACTIVE_TAG); + btRigidBody *body = GetRigidBody(); + if (body->getActivationState() == DISABLE_SIMULATION) + { + GetPhysicsEnvironment()->updateCcdPhysicsController(this, + m_savedMass, + m_savedCollisionFlags, + m_savedCollisionFilterGroup, + m_savedCollisionFilterMask); + GetRigidBody()->forceActivationState(ACTIVE_TAG); + } } SG_Controller* KX_BulletPhysicsController::GetReplica(class SG_Node* destnode) diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.h b/source/gameengine/Ketsji/KX_BulletPhysicsController.h index 0853755dffa..2efe0474b30 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.h +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.h @@ -7,6 +7,11 @@ class KX_BulletPhysicsController : public KX_IPhysicsController ,public CcdPhysicsController { +private: + int m_savedCollisionFlags; + short int m_savedCollisionFilterGroup; + short int m_savedCollisionFilterMask; + MT_Scalar m_savedMass; public: @@ -30,7 +35,7 @@ public: virtual void SetAngularVelocity(const MT_Vector3& ang_vel,bool local); virtual void SetLinearVelocity(const MT_Vector3& lin_vel,bool local); virtual void getOrientation(MT_Quaternion& orn); - virtual void setOrientation(const MT_Quaternion& orn); + virtual void setOrientation(const MT_Matrix3x3& orn); virtual void setPosition(const MT_Point3& pos); virtual void setScaling(const MT_Vector3& scaling); virtual MT_Scalar GetMass(); @@ -39,7 +44,7 @@ public: virtual void resolveCombinedVelocities(float linvelX,float linvelY,float linvelZ,float angVelX,float angVelY,float angVelZ); - virtual void SuspendDynamics(); + virtual void SuspendDynamics(bool ghost); virtual void RestoreDynamics(); virtual SG_Controller* GetReplica(class SG_Node* destnode); diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp index 27f4870de10..0a97b6f0a2f 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.cpp +++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp @@ -49,7 +49,7 @@ STR_String KX_CameraActuator::Y_AXIS_STRING = "y"; KX_CameraActuator::KX_CameraActuator( SCA_IObject* gameobj, - CValue *obj, + SCA_IObject *obj, MT_Scalar hght, MT_Scalar minhght, MT_Scalar maxhght, @@ -63,11 +63,14 @@ KX_CameraActuator::KX_CameraActuator( m_maxHeight (maxhght), m_x (xytog) { + if (m_ob) + m_ob->RegisterActuator(this); } KX_CameraActuator::~KX_CameraActuator() { - //nothing to do + if (m_ob) + m_ob->UnregisterActuator(this); } CValue* @@ -81,8 +84,35 @@ GetReplica( return replica; }; +void KX_CameraActuator::ProcessReplica() +{ + if (m_ob) + m_ob->RegisterActuator(this); + SCA_IActuator::ProcessReplica(); +} + +bool KX_CameraActuator::UnlinkObject(SCA_IObject* clientobj) +{ + if (clientobj == m_ob) + { + // this object is being deleted, we cannot continue to track it. + m_ob = NULL; + return true; + } + return false; +} +void KX_CameraActuator::Relink(GEN_Map *obj_map) +{ + void **h_obj = (*obj_map)[m_ob]; + if (h_obj) { + if (m_ob) + m_ob->UnregisterActuator(this); + m_ob = (SCA_IObject*)(*h_obj); + m_ob->RegisterActuator(this); + } +} /* three functions copied from blender arith... don't know if there's an equivalent */ @@ -181,8 +211,14 @@ static void Kx_VecUpMat3(float *vec, float mat[][3], short axis) bool KX_CameraActuator::Update(double curtime, bool frame) { - bool result = true; + /* wondering... is it really neccesary/desirable to suppress negative */ + /* events here? */ + bool bNegativeEvent = IsNegativeEvent(); + RemoveAllEvents(); + if (bNegativeEvent || !m_ob) + return false; + KX_GameObject *obj = (KX_GameObject*) GetParent(); MT_Point3 from = obj->NodeGetWorldPosition(); MT_Matrix3x3 frommat = obj->NodeGetWorldOrientation(); @@ -195,13 +231,6 @@ bool KX_CameraActuator::Update(double curtime, bool frame) float mindistsq, maxdistsq, distsq; float mat[3][3]; - /* wondering... is it really neccesary/desirable to suppress negative */ - /* events here? */ - bool bNegativeEvent = IsNegativeEvent(); - RemoveAllEvents(); - - if (bNegativeEvent) return false; - /* The rules: */ /* CONSTRAINT 1: not implemented */ /* CONSTRAINT 2: can camera see actor? */ @@ -315,7 +344,7 @@ bool KX_CameraActuator::Update(double curtime, bool frame) actormat[2][0]= mat[0][2]; actormat[2][1]= mat[1][2]; actormat[2][2]= mat[2][2]; obj->NodeSetLocalOrientation(actormat); - return result; + return true; } CValue *KX_CameraActuator::findObject(char *obName) @@ -404,7 +433,11 @@ PyObject* KX_CameraActuator::PySetObject(PyObject* self, PyObject* gameobj; if (PyArg_ParseTuple(args, "O!", &KX_GameObject::Type, &gameobj)) { - m_ob = (CValue*)gameobj; + if (m_ob) + m_ob->UnregisterActuator(this); + m_ob = (SCA_IObject*)gameobj; + if (m_ob) + m_ob->RegisterActuator(this); Py_Return; } PyErr_Clear(); @@ -412,10 +445,13 @@ PyObject* KX_CameraActuator::PySetObject(PyObject* self, char* objectname; if (PyArg_ParseTuple(args, "s", &objectname)) { - CValue *object = (CValue*)SCA_ILogicBrick::m_sCurrentLogicManager->GetGameObjectByName(STR_String(objectname)); + SCA_IObject *object = (SCA_IObject*)SCA_ILogicBrick::m_sCurrentLogicManager->GetGameObjectByName(STR_String(objectname)); if(object) { + if (m_ob != NULL) + m_ob->UnregisterActuator(this); m_ob = object; + m_ob->RegisterActuator(this); Py_Return; } } diff --git a/source/gameengine/Ketsji/KX_CameraActuator.h b/source/gameengine/Ketsji/KX_CameraActuator.h index eb007e403ec..488b36922b0 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.h +++ b/source/gameengine/Ketsji/KX_CameraActuator.h @@ -49,7 +49,7 @@ class KX_CameraActuator : public SCA_IActuator Py_Header; private : /** Object that will be tracked. */ - CValue *m_ob; + SCA_IObject *m_ob; /** height (float), */ //const MT_Scalar m_height; @@ -87,7 +87,7 @@ private : SCA_IObject *gameobj, //const CValue *ob, - CValue *ob, + SCA_IObject *ob, MT_Scalar hght, MT_Scalar minhght, MT_Scalar maxhght, @@ -103,6 +103,7 @@ private : /** Methods Inherited from CValue */ CValue* GetReplica(); + virtual void ProcessReplica(); /** Methods inherited from SCA_IActuator */ @@ -110,7 +111,10 @@ private : double curtime, bool frame ); + virtual bool UnlinkObject(SCA_IObject* clientobj); + /** Methods inherited from SCA_ILogicBrick */ + virtual void Relink(GEN_Map *obj_map); /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp index 80288a72485..e0b2efb3a25 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp @@ -178,16 +178,18 @@ bool KX_ConstraintActuator::Update(double curtime, bool frame) direction[2] = rotation[2][1]; axis = 1; break; - case KX_ACT_CONSTRAINT_ORIZ: + default: direction[0] = rotation[0][2]; direction[1] = rotation[1][2]; direction[2] = rotation[2][2]; axis = 2; break; } - // apply damping on the direction if (m_posDampTime) { + // apply damping on the direction direction = filter*direction + (1.0-filter)*m_refDirection; + } else { + direction = m_refDirection; } obj->AlignAxisToVect(direction, axis); result = true; diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 2ac4f909077..d40fa1e2446 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -61,6 +61,8 @@ typedef unsigned long uint_ptr; #include "KX_RayCast.h" #include "KX_PythonInit.h" #include "KX_PyMath.h" +#include "SCA_IActuator.h" +#include "SCA_ISensor.h" // This file defines relationships between parents and children // in the game engine. @@ -222,6 +224,10 @@ void KX_GameObject::SetParent(KX_Scene *scene, KX_GameObject* obj) RemoveParent(scene); obj->GetSGNode()->AddChild(GetSGNode()); + if (m_pPhysicsController1) + { + m_pPhysicsController1->SuspendDynamics(true); + } // Set us to our new scale, position, and orientation scale1[0] = scale1[0]/scale2[0]; scale1[1] = scale1[1]/scale2[1]; @@ -258,6 +264,10 @@ void KX_GameObject::RemoveParent(KX_Scene *scene) if (!rootlist->SearchValue(this)) // object was not in root list, add it now and increment ref count rootlist->Add(AddRef()); + if (m_pPhysicsController1) + { + m_pPhysicsController1->RestoreDynamics(); + } } } @@ -714,8 +724,12 @@ MT_Vector3 KX_GameObject::GetAngularVelocity(bool local) void KX_GameObject::NodeSetLocalPosition(const MT_Point3& trans) { - if (m_pPhysicsController1) + if (m_pPhysicsController1 && (!GetSGNode() || !GetSGNode()->GetSGParent())) { + // don't update physic controller if the object is a child: + // 1) the transformation will not be right + // 2) in this case, the physic controller is necessarily a static object + // that is updated from the normal kinematic synchronization m_pPhysicsController1->setPosition(trans); } @@ -727,25 +741,22 @@ void KX_GameObject::NodeSetLocalPosition(const MT_Point3& trans) void KX_GameObject::NodeSetLocalOrientation(const MT_Matrix3x3& rot) { - if (m_pPhysicsController1) + if (m_pPhysicsController1 && (!GetSGNode() || !GetSGNode()->GetSGParent())) { - m_pPhysicsController1->setOrientation(rot.getRotation()); + // see note above + m_pPhysicsController1->setOrientation(rot); } if (GetSGNode()) GetSGNode()->SetLocalOrientation(rot); - else - { - int i; - i=0; - } } void KX_GameObject::NodeSetLocalScale(const MT_Vector3& scale) { - if (m_pPhysicsController1) + if (m_pPhysicsController1 && (!GetSGNode() || !GetSGNode()->GetSGParent())) { + // see note above m_pPhysicsController1->setScaling(scale); } @@ -832,7 +843,7 @@ void KX_GameObject::Resume(void) } } -void KX_GameObject::Suspend(void) +void KX_GameObject::Suspend() { if ((!m_ignore_activity_culling) && (!m_suspended)) { @@ -875,6 +886,8 @@ PyMethodDef KX_GameObject::Methods[] = { {"getParent", (PyCFunction)KX_GameObject::sPyGetParent,METH_NOARGS}, {"setParent", (PyCFunction)KX_GameObject::sPySetParent,METH_O}, {"removeParent", (PyCFunction)KX_GameObject::sPyRemoveParent,METH_NOARGS}, + {"getChildren", (PyCFunction)KX_GameObject::sPyGetChildren,METH_NOARGS}, + {"getChildrenRecursive", (PyCFunction)KX_GameObject::sPyGetChildrenRecursive,METH_NOARGS}, {"getMesh", (PyCFunction)KX_GameObject::sPyGetMesh,METH_VARARGS}, {"getPhysicsId", (PyCFunction)KX_GameObject::sPyGetPhysicsId,METH_NOARGS}, {"getPropertyNames", (PyCFunction)KX_GameObject::sPyGetPropertyNames,METH_NOARGS}, @@ -1292,6 +1305,43 @@ PyObject* KX_GameObject::PyRemoveParent(PyObject* self) Py_RETURN_NONE; } + +static void walk_children(SG_Node* node, PyObject *list, bool recursive) +{ + NodeList& children = node->GetSGChildren(); + + for (NodeList::iterator childit = children.begin();!(childit==children.end());++childit) + { + SG_Node* childnode = (*childit); + KX_GameObject* childobj = (KX_GameObject*)childnode->GetSGClientObject(); + if (childobj != NULL) // This is a GameObject + { + // add to the list + PyList_Append(list, (PyObject *)childobj); + } + + // if the childobj is NULL then this may be an inverse parent link + // so a non recursive search should still look down this node. + if (recursive || childobj==NULL) { + walk_children(childnode, list, recursive); + } + } +} + +PyObject* KX_GameObject::PyGetChildren(PyObject* self) +{ + PyObject * list = PyList_New(0); + walk_children(m_pSGNode, list, 0); + return list; +} + +PyObject* KX_GameObject::PyGetChildrenRecursive(PyObject* self) +{ + PyObject * list = PyList_New(0); + walk_children(m_pSGNode, list, 1); + return list; +} + PyObject* KX_GameObject::PyGetMesh(PyObject* self, PyObject* args, PyObject* kwds) @@ -1660,6 +1710,20 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCast, * --------------------------------------------------------------------- */ void KX_GameObject::Relink(GEN_Map *map_parameter) { - /* intentionally empty ? */ + // we will relink the sensors and actuators that use object references + // if the object is part of the replicated hierarchy, use the new + // object reference instead + SCA_SensorList& sensorlist = GetSensors(); + SCA_SensorList::iterator sit; + for (sit=sensorlist.begin(); sit != sensorlist.end(); sit++) + { + (*sit)->Relink(map_parameter); + } + SCA_ActuatorList& actuatorlist = GetActuators(); + SCA_ActuatorList::iterator ait; + for (ait=actuatorlist.begin(); ait != actuatorlist.end(); ait++) + { + (*ait)->Relink(map_parameter); + } } diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index ddbf863aa1a..6051cf850b5 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -47,6 +47,7 @@ #include "KX_Scene.h" #include "KX_KetsjiEngine.h" /* for m_anim_framerate */ #include "KX_IPhysicsController.h" /* for suspend/resume */ +#include "DNA_object_types.h" #define KX_OB_DYNAMIC 1 @@ -392,6 +393,13 @@ public: m_pBlenderObject = obj; } + bool IsDupliGroup() + { + return (m_pBlenderObject && + (m_pBlenderObject->transflag & OB_DUPLIGROUP) && + m_pBlenderObject->dup_group != NULL) ? true : false; + } + /** * Set the Scene graph node for this game object. * warning - it is your responsibility to make sure @@ -738,6 +746,8 @@ public: KX_PYMETHOD_NOARGS(KX_GameObject,GetParent); KX_PYMETHOD_O(KX_GameObject,SetParent); KX_PYMETHOD_NOARGS(KX_GameObject,RemoveParent); + KX_PYMETHOD_NOARGS(KX_GameObject,GetChildren); + KX_PYMETHOD_NOARGS(KX_GameObject,GetChildrenRecursive); KX_PYMETHOD(KX_GameObject,GetMesh); KX_PYMETHOD_NOARGS(KX_GameObject,GetPhysicsId); KX_PYMETHOD_NOARGS(KX_GameObject,GetPropertyNames); diff --git a/source/gameengine/Ketsji/KX_IPhysicsController.h b/source/gameengine/Ketsji/KX_IPhysicsController.h index 2ec66a883eb..ecfdb8c4275 100644 --- a/source/gameengine/Ketsji/KX_IPhysicsController.h +++ b/source/gameengine/Ketsji/KX_IPhysicsController.h @@ -71,14 +71,15 @@ public: virtual void resolveCombinedVelocities(float linvelX,float linvelY,float linvelZ,float angVelX,float angVelY,float angVelZ) = 0; virtual void getOrientation(MT_Quaternion& orn)=0; - virtual void setOrientation(const MT_Quaternion& orn)=0; + virtual void setOrientation(const MT_Matrix3x3& orn)=0; + //virtual void setOrientation(const MT_Quaternion& orn)=0; virtual void setPosition(const MT_Point3& pos)=0; virtual void setScaling(const MT_Vector3& scaling)=0; virtual MT_Scalar GetMass()=0; virtual MT_Vector3 getReactionForce()=0; virtual void setRigidBody(bool rigid)=0; - virtual void SuspendDynamics()=0; + virtual void SuspendDynamics(bool ghost=false)=0; virtual void RestoreDynamics()=0; virtual SG_Controller* GetReplica(class SG_Node* destnode)=0; diff --git a/source/gameengine/Ketsji/KX_OdePhysicsController.cpp b/source/gameengine/Ketsji/KX_OdePhysicsController.cpp index 4e45ce484e3..05feb11a2bc 100644 --- a/source/gameengine/Ketsji/KX_OdePhysicsController.cpp +++ b/source/gameengine/Ketsji/KX_OdePhysicsController.cpp @@ -133,8 +133,9 @@ void KX_OdePhysicsController::SetLinearVelocity(const MT_Vector3& lin_vel,bool l ODEPhysicsController::SetLinearVelocity(lin_vel[0],lin_vel[1],lin_vel[2],local); } -void KX_OdePhysicsController::setOrientation(const MT_Quaternion& orn) +void KX_OdePhysicsController::setOrientation(const MT_Matrix3x3& rot) { + MT_Quaternion orn = rot.getRotation(); ODEPhysicsController::setOrientation(orn[0],orn[1],orn[2],orn[3]); } @@ -177,7 +178,7 @@ void KX_OdePhysicsController::setRigidBody(bool rigid) } -void KX_OdePhysicsController::SuspendDynamics() +void KX_OdePhysicsController::SuspendDynamics(bool) { ODEPhysicsController::SuspendDynamics(); } diff --git a/source/gameengine/Ketsji/KX_OdePhysicsController.h b/source/gameengine/Ketsji/KX_OdePhysicsController.h index 07a0bee9775..18f9edc6835 100644 --- a/source/gameengine/Ketsji/KX_OdePhysicsController.h +++ b/source/gameengine/Ketsji/KX_OdePhysicsController.h @@ -67,14 +67,14 @@ public: virtual void SetLinearVelocity(const MT_Vector3& lin_vel,bool local); virtual void resolveCombinedVelocities(float linvelX,float linvelY,float linvelZ,float angVelX,float angVelY,float angVelZ); virtual void getOrientation(MT_Quaternion& orn); - virtual void setOrientation(const MT_Quaternion& orn); + virtual void setOrientation(const MT_Matrix3x3& orn); virtual void setPosition(const MT_Point3& pos); virtual void setScaling(const MT_Vector3& scaling); virtual MT_Scalar GetMass(); virtual MT_Vector3 getReactionForce(); virtual void setRigidBody(bool rigid); - virtual void SuspendDynamics(); + virtual void SuspendDynamics(bool); virtual void RestoreDynamics(); diff --git a/source/gameengine/Ketsji/KX_ParentActuator.cpp b/source/gameengine/Ketsji/KX_ParentActuator.cpp index 8b379bcd44f..fd1b56838e2 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.cpp +++ b/source/gameengine/Ketsji/KX_ParentActuator.cpp @@ -46,19 +46,22 @@ KX_ParentActuator::KX_ParentActuator(SCA_IObject *gameobj, int mode, - CValue *ob, + SCA_IObject *ob, PyTypeObject* T) : SCA_IActuator(gameobj, T), m_mode(mode), m_ob(ob) { + if (m_ob) + m_ob->RegisterActuator(this); } KX_ParentActuator::~KX_ParentActuator() { - /* intentionally empty */ + if (m_ob) + m_ob->UnregisterActuator(this); } @@ -73,6 +76,36 @@ CValue* KX_ParentActuator::GetReplica() return replica; } +void KX_ParentActuator::ProcessReplica() +{ + if (m_ob) + m_ob->RegisterActuator(this); + SCA_IActuator::ProcessReplica(); +} + + +bool KX_ParentActuator::UnlinkObject(SCA_IObject* clientobj) +{ + if (clientobj == m_ob) + { + // this object is being deleted, we cannot continue to track it. + m_ob = NULL; + return true; + } + return false; +} + +void KX_ParentActuator::Relink(GEN_Map *obj_map) +{ + void **h_obj = (*obj_map)[m_ob]; + if (h_obj) { + if (m_ob) + m_ob->UnregisterActuator(this); + m_ob = (SCA_IObject*)(*h_obj); + m_ob->RegisterActuator(this); + } +} + bool KX_ParentActuator::Update() @@ -87,7 +120,8 @@ bool KX_ParentActuator::Update() KX_Scene *scene = PHY_GetActiveScene(); switch (m_mode) { case KX_PARENT_SET: - obj->SetParent(scene, (KX_GameObject*)m_ob); + if (m_ob) + obj->SetParent(scene, (KX_GameObject*)m_ob); break; case KX_PARENT_REMOVE: obj->RemoveParent(scene); @@ -148,7 +182,11 @@ PyObject* KX_ParentActuator::PySetObject(PyObject* self, PyObject* args, PyObjec PyObject* gameobj; if (PyArg_ParseTuple(args, "O!", &KX_GameObject::Type, &gameobj)) { - m_ob = (CValue*)gameobj; + if (m_ob != NULL) + m_ob->UnregisterActuator(this); + m_ob = (SCA_IObject*)gameobj; + if (m_ob) + m_ob->RegisterActuator(this); Py_Return; } PyErr_Clear(); @@ -156,10 +194,13 @@ PyObject* KX_ParentActuator::PySetObject(PyObject* self, PyObject* args, PyObjec char* objectname; if (PyArg_ParseTuple(args, "s", &objectname)) { - CValue *object = (CValue*)SCA_ILogicBrick::m_sCurrentLogicManager->GetGameObjectByName(STR_String(objectname)); + SCA_IObject *object = (SCA_IObject*)SCA_ILogicBrick::m_sCurrentLogicManager->GetGameObjectByName(STR_String(objectname)); if(object) { + if (m_ob != NULL) + m_ob->UnregisterActuator(this); m_ob = object; + m_ob->RegisterActuator(this); Py_Return; } } diff --git a/source/gameengine/Ketsji/KX_ParentActuator.h b/source/gameengine/Ketsji/KX_ParentActuator.h index 86dcd4e6c12..93b07cd424b 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.h +++ b/source/gameengine/Ketsji/KX_ParentActuator.h @@ -47,7 +47,7 @@ class KX_ParentActuator : public SCA_IActuator int m_mode; /** Object to set as parent */ - CValue *m_ob; + SCA_IObject *m_ob; @@ -62,12 +62,15 @@ class KX_ParentActuator : public SCA_IActuator KX_ParentActuator(class SCA_IObject* gameobj, int mode, - CValue *ob, + SCA_IObject *ob, PyTypeObject* T=&Type); virtual ~KX_ParentActuator(); virtual bool Update(); virtual CValue* GetReplica(); + virtual void ProcessReplica(); + virtual void Relink(GEN_Map *obj_map); + virtual bool UnlinkObject(SCA_IObject* clientobj); /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ diff --git a/source/gameengine/Ketsji/KX_RadarSensor.cpp b/source/gameengine/Ketsji/KX_RadarSensor.cpp index 9dab09f8f2a..de4979ac4c9 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.cpp +++ b/source/gameengine/Ketsji/KX_RadarSensor.cpp @@ -80,10 +80,7 @@ CValue* KX_RadarSensor::GetReplica() { KX_RadarSensor* replica = new KX_RadarSensor(*this); replica->m_colliders = new CListValue(); - replica->m_bCollision = false; - replica->m_bTriggered= false; - replica->m_hitObject = NULL; - replica->m_bLastTriggered = false; + replica->Init(); // this will copy properties and so on... CValue::AddDataToReplica(replica); @@ -179,8 +176,10 @@ void KX_RadarSensor::SynchronizeTransform() if (m_physCtrl) { - m_physCtrl->setPosition(trans.getOrigin().x(),trans.getOrigin().y(),trans.getOrigin().z()); - m_physCtrl->setOrientation(trans.getRotation().x(),trans.getRotation().y(),trans.getRotation().z(),trans.getRotation().w()); + MT_Quaternion orn = trans.getRotation(); + MT_Point3 pos = trans.getOrigin(); + m_physCtrl->setPosition(pos[0],pos[1],pos[2]); + m_physCtrl->setOrientation(orn[0],orn[1],orn[2],orn[3]); m_physCtrl->calcXform(); } diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp index e5ee4cbddf1..e36891b56f4 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp @@ -137,6 +137,17 @@ bool KX_SCA_AddObjectActuator::UnlinkObject(SCA_IObject* clientobj) return false; } +void KX_SCA_AddObjectActuator::Relink(GEN_Map *obj_map) +{ + void **h_obj = (*obj_map)[m_OriginalObject]; + if (h_obj) { + if (m_OriginalObject) + m_OriginalObject->UnregisterActuator(this); + m_OriginalObject = (SCA_IObject*)(*h_obj); + m_OriginalObject->RegisterActuator(this); + } +} + /* ------------------------------------------------------------------------- */ /* Python functions */ diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h index 42123b94a68..1359f39278d 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h @@ -95,6 +95,9 @@ public: virtual bool UnlinkObject(SCA_IObject* clientobj); + virtual void + Relink(GEN_Map *obj_map); + virtual bool Update(); diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 065800379d8..c374b9d6fd1 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -66,6 +66,8 @@ #include "SG_Controller.h" #include "SG_IObject.h" #include "SG_Tree.h" +#include "DNA_group_types.h" +#include "BKE_anim.h" #include "KX_SG_NodeRelationships.h" @@ -429,6 +431,11 @@ void KX_Scene::RemoveNodeDestructObject(class SG_IObject* node,class CValue* gam KX_GameObject* KX_Scene::AddNodeReplicaObject(class SG_IObject* node, class CValue* gameobj) { + // for group duplication, limit the duplication of the hierarchy to the + // objects that are part of the group. + if (!IsObjectInGroup(gameobj)) + return NULL; + KX_GameObject* orgobj = (KX_GameObject*)gameobj; KX_GameObject* newobj = (KX_GameObject*)orgobj->GetReplica(); m_map_gameobject_to_replica.insert(orgobj, newobj); @@ -506,6 +513,11 @@ KX_GameObject* KX_Scene::AddNodeReplicaObject(class SG_IObject* node, class CVal // hierarchy that's because first ALL bricks must exist in the new // replica of the hierarchy in order to make cross-links work properly // ! +// It is VERY important that the order of sensors and actuators in +// the replicated object is preserved: it is is used to reconnect the logic. +// This method is more robust then using the bricks name in case of complex +// group replication. The replication of logic bricks is done in +// SCA_IObject::ReParentLogic(), make sure it preserves the order of the bricks. void KX_Scene::ReplicateLogic(KX_GameObject* newobj) { // also relink the controller to sensors/actuators @@ -528,37 +540,38 @@ void KX_Scene::ReplicateLogic(KX_GameObject* newobj) for (vector::iterator its = linkedsensors.begin();!(its==linkedsensors.end());its++) { SCA_ISensor* oldsensor = (*its); - STR_String name = oldsensor->GetName(); - //find this name in the list - SCA_ISensor* newsensor = newobj->FindSensor(name); + SCA_IObject* oldsensorobj = oldsensor->GetParent(); + SCA_IObject* newsensorobj = NULL; - if (newsensor) + // the original owner of the sensor has been replicated? + void **h_obj = m_map_gameobject_to_replica[oldsensorobj]; + if (h_obj) + newsensorobj = (SCA_IObject*)(*h_obj); + if (!newsensorobj) { - // relink this newsensor to the controller - m_logicmgr->RegisterToSensor(cont,newsensor); + // no, then the sensor points outside the hierachy, keep it the same + if (m_objectlist->SearchValue(oldsensorobj)) + // only replicate links that points to active objects + m_logicmgr->RegisterToSensor(cont,oldsensor); } else { - // it can be linked somewhere in the hierarchy or... - for (vector::iterator git = m_logicHierarchicalGameObjects.begin(); - !(git==m_logicHierarchicalGameObjects.end());++git) - { - newsensor = (*git)->FindSensor(name); - if (newsensor) - break; - } + // yes, then the new sensor has the same position + SCA_SensorList& sensorlist = oldsensorobj->GetSensors(); + SCA_SensorList::iterator sit; + SCA_ISensor* newsensor = NULL; + int sensorpos; - if (newsensor) + for (sensorpos=0, sit=sensorlist.begin(); sit!=sensorlist.end(); sit++, sensorpos++) { - // relink this newsensor to the controller somewhere else within this - // hierarchy - m_logicmgr->RegisterToSensor(cont,newsensor); - } - else - { - // must be an external sensor, so... - m_logicmgr->RegisterToSensor(cont,oldsensor); + if ((*sit) == oldsensor) + { + newsensor = newsensorobj->GetSensors().at(sensorpos); + break; + } } + assert(newsensor != NULL); + m_logicmgr->RegisterToSensor(cont,newsensor); } } @@ -566,38 +579,40 @@ void KX_Scene::ReplicateLogic(KX_GameObject* newobj) for (vector::iterator ita = linkedactuators.begin();!(ita==linkedactuators.end());ita++) { SCA_IActuator* oldactuator = (*ita); - STR_String name = oldactuator->GetName(); - //find this name in the list - SCA_IActuator* newactuator = newobj->FindActuator(name); - if (newactuator) + SCA_IObject* oldactuatorobj = oldactuator->GetParent(); + SCA_IObject* newactuatorobj = NULL; + + // the original owner of the sensor has been replicated? + void **h_obj = m_map_gameobject_to_replica[oldactuatorobj]; + if (h_obj) + newactuatorobj = (SCA_IObject*)(*h_obj); + + if (!newactuatorobj) { - // relink this newsensor to the controller - m_logicmgr->RegisterToActuator(cont,newactuator); - newactuator->SetUeberExecutePriority(m_ueberExecutionPriority); + // no, then the sensor points outside the hierachy, keep it the same + if (m_objectlist->SearchValue(oldactuatorobj)) + // only replicate links that points to active objects + m_logicmgr->RegisterToActuator(cont,oldactuator); } else { - // it can be linked somewhere in the hierarchy or... - for (vector::iterator git = m_logicHierarchicalGameObjects.begin(); - !(git==m_logicHierarchicalGameObjects.end());++git) - { - newactuator= (*git)->FindActuator(name); - if (newactuator) - break; - } + // yes, then the new sensor has the same position + SCA_ActuatorList& actuatorlist = oldactuatorobj->GetActuators(); + SCA_ActuatorList::iterator ait; + SCA_IActuator* newactuator = NULL; + int actuatorpos; - if (newactuator) + for (actuatorpos=0, ait=actuatorlist.begin(); ait!=actuatorlist.end(); ait++, actuatorpos++) { - // relink this actuator to the controller somewhere else within this - // hierarchy - m_logicmgr->RegisterToActuator(cont,newactuator); - newactuator->SetUeberExecutePriority(m_ueberExecutionPriority); - } - else - { - // must be an external actuator, so... - m_logicmgr->RegisterToActuator(cont,oldactuator); + if ((*ait) == oldactuator) + { + newactuator = newactuatorobj->GetActuators().at(actuatorpos); + break; + } } + assert(newactuator != NULL); + m_logicmgr->RegisterToActuator(cont,newactuator); + newactuator->SetUeberExecutePriority(m_ueberExecutionPriority); } } } @@ -605,6 +620,150 @@ void KX_Scene::ReplicateLogic(KX_GameObject* newobj) newobj->ResetState(); } +void KX_Scene::DupliGroupRecurse(CValue* obj, int level) +{ + KX_GameObject* groupobj = (KX_GameObject*) obj; + KX_GameObject* replica; + KX_GameObject* gameobj; + Object* blgroupobj = groupobj->GetBlenderObject(); + Group* group; + GroupObject *go; + vector duplilist; + + if (!groupobj->IsDupliGroup() || + level>MAX_DUPLI_RECUR) + return; + + // we will add one group at a time + m_logicHierarchicalGameObjects.clear(); + m_map_gameobject_to_replica.clear(); + m_ueberExecutionPriority++; + // for groups will do something special: + // we will force the creation of objects to those in the group only + // Again, this is match what Blender is doing (it doesn't care of parent relationship) + m_groupGameObjects.clear(); + + group = blgroupobj->dup_group; + for(go=(GroupObject*)group->gobject.first; go; go=(GroupObject*)go->next) + { + Object* blenderobj = go->ob; + if (blgroupobj == blenderobj) + // this check is also in group_duplilist() + continue; + gameobj = m_sceneConverter->FindGameObject(blenderobj); + if (gameobj == NULL) + { + // this object has not been converted!!! + // Should not happen as dupli group are created automatically + continue; + } + if (blenderobj->lay & group->layer==0) + { + // object is not visible in the 3D view, will not be instantiated + continue; + } + m_groupGameObjects.insert(gameobj); + } + + set::iterator oit; + for (oit=m_groupGameObjects.begin(); oit != m_groupGameObjects.end(); oit++) + { + gameobj = (KX_GameObject*)(*oit); + if (gameobj->GetParent() != NULL) + { + // this object is not a top parent. Either it is the child of another + // object in the group and it will be added automatically when the parent + // is added. Or it is the child of an object outside the group and the group + // is inconsistent, skip it anyway + continue; + } + replica = (KX_GameObject*) AddNodeReplicaObject(NULL,gameobj); + // add to 'rootparent' list (this is the list of top hierarchy objects, updated each frame) + m_parentlist->Add(replica->AddRef()); + + // recurse replication into children nodes + NodeList& children = gameobj->GetSGNode()->GetSGChildren(); + + replica->GetSGNode()->ClearSGChildren(); + for (NodeList::iterator childit = children.begin();!(childit==children.end());++childit) + { + SG_Node* orgnode = (*childit); + SG_Node* childreplicanode = orgnode->GetSGReplica(); + if (childreplicanode) + replica->GetSGNode()->AddChild(childreplicanode); + } + // don't replicate logic now: we assume that the objects in the group can have + // logic relationship, even outside parent relationship + // In order to match 3D view, the position of groupobj is used as a + // transformation matrix instead of the new position. This means that + // the group reference point is 0,0,0 + + // get the rootnode's scale + MT_Vector3 newscale = groupobj->NodeGetWorldScaling(); + // set the replica's relative scale with the rootnode's scale + replica->NodeSetRelativeScale(newscale); + + MT_Matrix3x3 newori = groupobj->NodeGetWorldOrientation() * gameobj->NodeGetWorldOrientation(); + replica->NodeSetLocalOrientation(newori); + + MT_Point3 newpos = groupobj->NodeGetWorldPosition() + + newscale*(groupobj->NodeGetWorldOrientation() * gameobj->NodeGetWorldPosition()); + replica->NodeSetLocalPosition(newpos); + + if (replica->GetPhysicsController()) + { + // not required, already done in NodeSetLocalOrientation.. + //replica->GetPhysicsController()->setPosition(newpos); + //replica->GetPhysicsController()->setOrientation(newori.getRotation()); + // Scaling has been set relatively hereabove, this does not + // set the scaling of the controller. I don't know why it's just the + // relative scale and not the full scale that has to be put here... + replica->GetPhysicsController()->setScaling(newscale); + } + + replica->GetSGNode()->UpdateWorldData(0); + replica->GetSGNode()->SetBBox(gameobj->GetSGNode()->BBox()); + replica->GetSGNode()->SetRadius(gameobj->GetSGNode()->Radius()); + // done with replica + replica->Release(); + } + + // the logic must be replicated first because we need + // the new logic bricks before relinking + vector::iterator git; + for (git = m_logicHierarchicalGameObjects.begin();!(git==m_logicHierarchicalGameObjects.end());++git) + { + (*git)->ReParentLogic(); + } + + // relink any pointers as necessary, sort of a temporary solution + for (git = m_logicHierarchicalGameObjects.begin();!(git==m_logicHierarchicalGameObjects.end());++git) + { + // this will also relink the actuator to objects within the hierarchy + (*git)->Relink(&m_map_gameobject_to_replica); + // add the object in the layer of the parent + (*git)->SetLayer(groupobj->GetLayer()); + } + + // replicate crosslinks etc. between logic bricks + for (git = m_logicHierarchicalGameObjects.begin();!(git==m_logicHierarchicalGameObjects.end());++git) + { + ReplicateLogic((*git)); + } + + // now look if object in the hierarchy have dupli group and recurse + for (git = m_logicHierarchicalGameObjects.begin();!(git==m_logicHierarchicalGameObjects.end());++git) + { + if ((*git) != groupobj && (*git)->IsDupliGroup()) + // can't instantiate group immediately as it destroys m_logicHierarchicalGameObjects + duplilist.push_back((*git)); + } + + for (git = duplilist.begin(); !(git == duplilist.end()); ++git) + { + DupliGroupRecurse((*git), level+1); + } +} SCA_IObject* KX_Scene::AddReplicaObject(class CValue* originalobject, @@ -614,6 +773,7 @@ SCA_IObject* KX_Scene::AddReplicaObject(class CValue* originalobject, m_logicHierarchicalGameObjects.clear(); m_map_gameobject_to_replica.clear(); + m_groupGameObjects.clear(); // todo: place a timebomb in the object, for temporarily objects :) // lifespan of zero means 'this object lives forever' @@ -647,24 +807,26 @@ SCA_IObject* KX_Scene::AddReplicaObject(class CValue* originalobject, { SG_Node* orgnode = (*childit); SG_Node* childreplicanode = orgnode->GetSGReplica(); - replica->GetSGNode()->AddChild(childreplicanode); - } - - // relink any pointers as necessary, sort of a temporary solution - vector::iterator git; - for (git = m_logicHierarchicalGameObjects.begin();!(git==m_logicHierarchicalGameObjects.end());++git) - { - (*git)->Relink(&m_map_gameobject_to_replica); - // add the object in the layer of the parent - (*git)->SetLayer(parentobj->GetLayer()); + if (childreplicanode) + replica->GetSGNode()->AddChild(childreplicanode); } // now replicate logic + vector::iterator git; for (git = m_logicHierarchicalGameObjects.begin();!(git==m_logicHierarchicalGameObjects.end());++git) { (*git)->ReParentLogic(); } + // relink any pointers as necessary, sort of a temporary solution + for (git = m_logicHierarchicalGameObjects.begin();!(git==m_logicHierarchicalGameObjects.end());++git) + { + // this will also relink the actuators in the hierarchy + (*git)->Relink(&m_map_gameobject_to_replica); + // add the object in the layer of the parent + (*git)->SetLayer(parentobj->GetLayer()); + } + // replicate crosslinks etc. between logic bricks for (git = m_logicHierarchicalGameObjects.begin();!(git==m_logicHierarchicalGameObjects.end());++git) { @@ -685,8 +847,9 @@ SCA_IObject* KX_Scene::AddReplicaObject(class CValue* originalobject, if (replica->GetPhysicsController()) { - replica->GetPhysicsController()->setPosition(newpos); - replica->GetPhysicsController()->setOrientation(newori.getRotation()); + // not needed, already done in NodeSetLocalPosition() + //replica->GetPhysicsController()->setPosition(newpos); + //replica->GetPhysicsController()->setOrientation(newori.getRotation()); replica->GetPhysicsController()->setScaling(newscale); } diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index 28dee1b5893..80a2abe287a 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -216,6 +216,16 @@ protected: */ std::vector m_logicHierarchicalGameObjects; + /** + * This temporary variable will contain the list of + * object that can be added during group instantiation. + * objects outside this list will not be added (can + * happen with children that are outside the group). + * Used in AddReplicaObject. If the list is empty, it + * means don't care. + */ + std::set m_groupGameObjects; + /** * Pointer to system variable passed in in constructor * only used in constructor so we do not need to keep it @@ -291,6 +301,12 @@ public: * Update all transforms according to the scenegraph. */ void UpdateParents(double curtime); + void DupliGroupRecurse(CValue* gameobj, int level); + bool IsObjectInGroup(CValue* gameobj) + { + return (m_groupGameObjects.empty() || + m_groupGameObjects.find(gameobj) != m_groupGameObjects.end()); + } SCA_IObject* AddReplicaObject(CValue* gameobj, CValue* locationobj, int lifespan=0); diff --git a/source/gameengine/Ketsji/KX_SceneActuator.cpp b/source/gameengine/Ketsji/KX_SceneActuator.cpp index 8f7cffd506f..d6164dc812a 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.cpp +++ b/source/gameengine/Ketsji/KX_SceneActuator.cpp @@ -58,13 +58,16 @@ KX_SceneActuator::KX_SceneActuator(SCA_IObject *gameobj, m_KetsjiEngine=ketsjiEngine; m_camera = camera; m_nextSceneName = nextSceneName; + if (m_camera) + m_camera->RegisterActuator(this); } /* End of constructor */ KX_SceneActuator::~KX_SceneActuator() { - // there's nothing to be done here, really.... + if (m_camera) + m_camera->UnregisterActuator(this); } /* end of destructor */ @@ -79,6 +82,34 @@ CValue* KX_SceneActuator::GetReplica() return replica; } +void KX_SceneActuator::ProcessReplica() +{ + if (m_camera) + m_camera->RegisterActuator(this); + SCA_IActuator::ProcessReplica(); +} + +bool KX_SceneActuator::UnlinkObject(SCA_IObject* clientobj) +{ + if (clientobj == (SCA_IObject*)m_camera) + { + // this object is being deleted, we cannot continue to track it. + m_camera = NULL; + return true; + } + return false; +} + +void KX_SceneActuator::Relink(GEN_Map *obj_map) +{ + void **h_obj = (*obj_map)[m_camera]; + if (h_obj) { + if (m_camera) + m_camera->UnregisterActuator(this); + m_camera = (KX_Camera*)(*h_obj); + m_camera->RegisterActuator(this); + } +} bool KX_SceneActuator::Update() @@ -332,7 +363,11 @@ PyObject* KX_SceneActuator::PySetCamera(PyObject* self, PyObject *cam; if (PyArg_ParseTuple(args, "O!", &KX_Camera::Type, &cam)) { + if (m_camera) + m_camera->UnregisterActuator(this); m_camera = (KX_Camera*) cam; + if (m_camera) + m_camera->RegisterActuator(this); Py_Return; } PyErr_Clear(); @@ -345,7 +380,13 @@ PyObject* KX_SceneActuator::PySetCamera(PyObject* self, } KX_Camera *camOb = FindCamera(camName); - if (camOb) m_camera = camOb; + if (camOb) + { + if (m_camera) + m_camera->UnregisterActuator(this); + m_camera = camOb; + m_camera->RegisterActuator(this); + } Py_Return; } diff --git a/source/gameengine/Ketsji/KX_SceneActuator.h b/source/gameengine/Ketsji/KX_SceneActuator.h index cfc79b93f8e..55aaf629d7c 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.h +++ b/source/gameengine/Ketsji/KX_SceneActuator.h @@ -82,6 +82,9 @@ class KX_SceneActuator : public SCA_IActuator virtual ~KX_SceneActuator(); virtual CValue* GetReplica(); + virtual void ProcessReplica(); + virtual bool UnlinkObject(SCA_IObject* clientobj); + virtual void Relink(GEN_Map *obj_map); virtual bool Update(); diff --git a/source/gameengine/Ketsji/KX_SumoPhysicsController.cpp b/source/gameengine/Ketsji/KX_SumoPhysicsController.cpp index 6ea5461dbaa..4032a795ce3 100644 --- a/source/gameengine/Ketsji/KX_SumoPhysicsController.cpp +++ b/source/gameengine/Ketsji/KX_SumoPhysicsController.cpp @@ -101,7 +101,7 @@ void KX_SumoPhysicsController::SetSumoTransform(bool nondynaonly) } -void KX_SumoPhysicsController::SuspendDynamics() +void KX_SumoPhysicsController::SuspendDynamics(bool) { SumoPhysicsController::SuspendDynamics(); } @@ -170,8 +170,9 @@ void KX_SumoPhysicsController::setMargin(float collisionMargin) } -void KX_SumoPhysicsController::setOrientation(const MT_Quaternion& orn) +void KX_SumoPhysicsController::setOrientation(const MT_Matrix3x3& rot) { + MT_Quaternion orn = rot.getRotation(); SumoPhysicsController::setOrientation( orn[0],orn[1],orn[2],orn[3]); diff --git a/source/gameengine/Ketsji/KX_SumoPhysicsController.h b/source/gameengine/Ketsji/KX_SumoPhysicsController.h index 8c061ae4056..1dd930bf3d9 100644 --- a/source/gameengine/Ketsji/KX_SumoPhysicsController.h +++ b/source/gameengine/Ketsji/KX_SumoPhysicsController.h @@ -76,10 +76,10 @@ public: void resolveCombinedVelocities(float linvelX,float linvelY,float linvelZ,float angVelX,float angVelY,float angVelZ); - void SuspendDynamics(); + void SuspendDynamics(bool); void RestoreDynamics(); virtual void getOrientation(MT_Quaternion& orn); - virtual void setOrientation(const MT_Quaternion& orn); + virtual void setOrientation(const MT_Matrix3x3& orn); virtual void setPosition(const MT_Point3& pos); virtual void setScaling(const MT_Vector3& scaling); diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.cpp b/source/gameengine/Ketsji/KX_TrackToActuator.cpp index 731a610c2eb..c580aa4d4e5 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.cpp +++ b/source/gameengine/Ketsji/KX_TrackToActuator.cpp @@ -210,6 +210,18 @@ bool KX_TrackToActuator::UnlinkObject(SCA_IObject* clientobj) return false; } +void KX_TrackToActuator::Relink(GEN_Map *obj_map) +{ + void **h_obj = (*obj_map)[m_object]; + if (h_obj) { + if (m_object) + m_object->UnregisterActuator(this); + m_object = (SCA_IObject*)(*h_obj); + m_object->RegisterActuator(this); + } +} + + bool KX_TrackToActuator::Update(double curtime, bool frame) { bool result = false; diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.h b/source/gameengine/Ketsji/KX_TrackToActuator.h index a03aa115baa..1d1cf46d21b 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.h +++ b/source/gameengine/Ketsji/KX_TrackToActuator.h @@ -68,6 +68,7 @@ class KX_TrackToActuator : public SCA_IActuator virtual void ProcessReplica(); virtual bool UnlinkObject(SCA_IObject* clientobj); + virtual void Relink(GEN_Map *obj_map); virtual bool Update(double curtime, bool frame); /* Python part */ diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index e444c4c73be..5c70b071661 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -337,12 +337,33 @@ void CcdPhysicsController::setOrientation(float quatImag0,float quatImag1,float { m_body->setCollisionFlags(m_body->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); } - - m_MotionState->setWorldOrientation(quatImag0,quatImag1,quatImag2,quatReal); + // not required + //m_MotionState->setWorldOrientation(quatImag0,quatImag1,quatImag2,quatReal); btTransform xform = m_body->getCenterOfMassTransform(); xform.setRotation(btQuaternion(quatImag0,quatImag1,quatImag2,quatReal)); m_body->setCenterOfMassTransform(xform); - m_bulletMotionState->setWorldTransform(xform); + // not required + //m_bulletMotionState->setWorldTransform(xform); + } + +} + +void CcdPhysicsController::setWorldOrientation(const btMatrix3x3& orn) +{ + if (m_body) + { + m_body->activate(true); + if (m_body->isStaticObject()) + { + m_body->setCollisionFlags(m_body->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); + } + // not required + //m_MotionState->setWorldOrientation(quatImag0,quatImag1,quatImag2,quatReal); + btTransform xform = m_body->getCenterOfMassTransform(); + xform.setBasis(orn); + m_body->setCenterOfMassTransform(xform); + // not required + //m_bulletMotionState->setWorldTransform(xform); } } @@ -356,12 +377,13 @@ void CcdPhysicsController::setPosition(float posX,float posY,float posZ) { m_body->setCollisionFlags(m_body->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); } - - m_MotionState->setWorldPosition(posX,posY,posZ); + // not required, this function is only used to update the physic controller + //m_MotionState->setWorldPosition(posX,posY,posZ); btTransform xform = m_body->getCenterOfMassTransform(); xform.setOrigin(btVector3(posX,posY,posZ)); m_body->setCenterOfMassTransform(xform); - m_bulletMotionState->setWorldTransform(xform); + // not required + //m_bulletMotionState->setWorldTransform(xform); } diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h index 37fa465351f..64f1876e199 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h @@ -106,6 +106,7 @@ class CcdPhysicsController : public PHY_IPhysicsController btRigidBody* m_body; class PHY_IMotionState* m_MotionState; btMotionState* m_bulletMotionState; + friend class CcdPhysicsEnvironment; // needed when updating the controller void* m_newClientInfo; @@ -115,6 +116,9 @@ class CcdPhysicsController : public PHY_IPhysicsController void CreateRigidbody(); + protected: + void setWorldOrientation(const btMatrix3x3& mat); + public: int m_collisionDelay; @@ -194,7 +198,6 @@ class CcdPhysicsController : public PHY_IPhysicsController return m_cci.m_collisionFilterMask; } - virtual void calcXform() {} ; virtual void SetMargin(float margin) {}; virtual float GetMargin() const {return 0.f;}; diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index c9d346e316d..b773f40650b 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -466,6 +466,38 @@ void CcdPhysicsEnvironment::removeCcdPhysicsController(CcdPhysicsController* ctr } +void CcdPhysicsEnvironment::updateCcdPhysicsController(CcdPhysicsController* ctrl, btScalar newMass, int newCollisionFlags, short int newCollisionGroup, short int newCollisionMask) +{ + // this function is used when the collisionning group of a controller is changed + // remove and add the collistioning object + btRigidBody* body = ctrl->GetRigidBody(); + btVector3 inertia; + + m_dynamicsWorld->removeCollisionObject(body); + body->setCollisionFlags(newCollisionFlags); + body->getCollisionShape()->calculateLocalInertia(newMass, inertia); + body->setMassProps(newMass, inertia); + m_dynamicsWorld->addCollisionObject(body, newCollisionGroup, newCollisionMask); + // to avoid nasty interaction, we must update the property of the controller as well + ctrl->m_cci.m_mass = newMass; + ctrl->m_cci.m_collisionFilterGroup = newCollisionGroup; + ctrl->m_cci.m_collisionFilterMask = newCollisionMask; + ctrl->m_cci.m_collisionFlags = newCollisionFlags; +} + +void CcdPhysicsEnvironment::enableCcdPhysicsController(CcdPhysicsController* ctrl) +{ + std::vector::iterator i = + std::find(m_controllers.begin(), m_controllers.end(), ctrl); + if (i == m_controllers.end()) + { + btRigidBody* body = ctrl->GetRigidBody(); + m_dynamicsWorld->addCollisionObject(body, + ctrl->GetCollisionFilterGroup(), ctrl->GetCollisionFilterMask()); + } +} + + void CcdPhysicsEnvironment::beginFrame() { diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h index 9f14cf6cbef..453749b27b3 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h @@ -183,6 +183,15 @@ protected: void removeCcdPhysicsController(CcdPhysicsController* ctrl); + void updateCcdPhysicsController(CcdPhysicsController* ctrl, btScalar newMass, int newCollisionFlags, short int newCollisionGroup, short int newCollisionMask); + + void disableCcdPhysicsController(CcdPhysicsController* ctrl) + { + removeCcdPhysicsController(ctrl); + } + + void enableCcdPhysicsController(CcdPhysicsController* ctrl); + btBroadphaseInterface* getBroadphase(); diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index 37c188b7f22..8f17cf26f15 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -214,6 +214,18 @@ class KX_GameObject: """ Removes this objects parent. """ + def getChildren(): + """ + Return a list of immediate children of this object. + @rtype: list + @return: a list of all this objects children. + """ + def getChildrenRecursive(): + """ + Return a list of children of this object, including all their childrens children. + @rtype: list + @return: a list of all this objects children recursivly. + """ def getMesh(mesh): """ Gets the mesh object for this object. diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp index 958fead33ce..ef206332057 100644 --- a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp +++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp @@ -43,6 +43,7 @@ #include "STR_String.h" #include "RAS_ICanvas.h" +#include "RAS_Rect.h" #include "RAS_2DFilterManager.h" #include @@ -158,7 +159,8 @@ void RAS_2DFilterManager::AnalyseShader(int passindex, vector& propN texflag[passindex] = 0; if(glGetUniformLocationARB(m_filters[passindex], "bgl_DepthTexture") != -1) { - texflag[passindex] |= 0x1; + if(GLEW_ARB_depth_texture) + texflag[passindex] |= 0x1; } if(glGetUniformLocationARB(m_filters[passindex], "bgl_LuminanceTexture") != -1) { @@ -261,7 +263,7 @@ void RAS_2DFilterManager::SetupTextures(bool depth, bool luminance) glGenTextures(1, (GLuint*)&texname[0]); glBindTexture(GL_TEXTURE_2D, texname[0]); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texturewidth, textureheight, 0, GL_RGB, + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texturewidth, textureheight, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); @@ -293,10 +295,13 @@ void RAS_2DFilterManager::SetupTextures(bool depth, bool luminance) } } -void RAS_2DFilterManager::UpdateOffsetMatrix(int width, int height) +void RAS_2DFilterManager::UpdateOffsetMatrix(RAS_ICanvas* canvas) { - canvaswidth = texturewidth = width; - canvasheight = textureheight = height; + RAS_Rect canvas_rect = canvas->GetWindowArea(); + canvaswidth = canvas->GetWidth(); + canvasheight = canvas->GetHeight(); + texturewidth = canvaswidth + canvas_rect.GetLeft(); + textureheight = canvasheight + canvas_rect.GetBottom(); GLint i,j; i = 0; @@ -352,7 +357,7 @@ void RAS_2DFilterManager::RenderFilters(RAS_ICanvas* canvas) if(canvaswidth != canvas->GetWidth() || canvasheight != canvas->GetHeight()) { - UpdateOffsetMatrix(canvas->GetWidth(), canvas->GetHeight()); + UpdateOffsetMatrix(canvas); SetupTextures(need_depth, need_luminance); } GLuint viewport[4]={0}; @@ -360,19 +365,21 @@ void RAS_2DFilterManager::RenderFilters(RAS_ICanvas* canvas) if(need_depth){ glActiveTextureARB(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, texname[1]); - glCopyTexImage2D(GL_TEXTURE_2D,0,GL_DEPTH_COMPONENT, 0,0, texturewidth,textureheight, 0); + glCopyTexImage2D(GL_TEXTURE_2D,0,GL_DEPTH_COMPONENT, 0, 0, texturewidth,textureheight, 0); } if(need_luminance){ glActiveTextureARB(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, texname[2]); - glCopyTexImage2D(GL_TEXTURE_2D,0,GL_LUMINANCE16, 0,0, texturewidth,textureheight, 0); + glCopyTexImage2D(GL_TEXTURE_2D,0,GL_LUMINANCE16, 0, 0 , texturewidth,textureheight, 0); } glGetIntegerv(GL_VIEWPORT,(GLint *)viewport); - glViewport(0, 0, texturewidth, textureheight); + glViewport(0,0, texturewidth, textureheight); glDisable(GL_DEPTH_TEST); + glMatrixMode(GL_TEXTURE); + glLoadIdentity(); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glMatrixMode(GL_MODELVIEW); diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.h b/source/gameengine/Rasterizer/RAS_2DFilterManager.h index 9d8326b96de..f5998e1f093 100644 --- a/source/gameengine/Rasterizer/RAS_2DFilterManager.h +++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.h @@ -42,7 +42,7 @@ private: void SetupTextures(bool depth, bool luminance); void FreeTextures(); - void UpdateOffsetMatrix(int width, int height); + void UpdateOffsetMatrix(RAS_ICanvas* canvas); float textureoffsets[18]; float view[4]; diff --git a/source/gameengine/Rasterizer/RAS_ICanvas.h b/source/gameengine/Rasterizer/RAS_ICanvas.h index d799dc9c9bb..f3f817a943d 100644 --- a/source/gameengine/Rasterizer/RAS_ICanvas.h +++ b/source/gameengine/Rasterizer/RAS_ICanvas.h @@ -136,6 +136,14 @@ public: GetDisplayArea( ) = 0; + /** + * Used to get canvas area within blender. + */ + virtual + RAS_Rect & + GetWindowArea( + ) = 0; + /** * Set the visible vieport */ diff --git a/source/gameengine/SceneGraph/SG_IObject.cpp b/source/gameengine/SceneGraph/SG_IObject.cpp index c347bbc6d9a..d0bdac5c8f0 100644 --- a/source/gameengine/SceneGraph/SG_IObject.cpp +++ b/source/gameengine/SceneGraph/SG_IObject.cpp @@ -104,7 +104,7 @@ SetSGClientObject( } - void + bool SG_IObject:: ActivateReplicationCallback( SG_IObject *replica @@ -112,8 +112,10 @@ ActivateReplicationCallback( if (m_callbacks.m_replicafunc) { // Call client provided replication func - m_callbacks.m_replicafunc(replica,m_SGclientObject,m_SGclientInfo); + if (m_callbacks.m_replicafunc(replica,m_SGclientObject,m_SGclientInfo) == NULL) + return false; } + return true; }; void diff --git a/source/gameengine/SceneGraph/SG_IObject.h b/source/gameengine/SceneGraph/SG_IObject.h index 438ab48c556..7f6bdfbbb1c 100644 --- a/source/gameengine/SceneGraph/SG_IObject.h +++ b/source/gameengine/SceneGraph/SG_IObject.h @@ -202,7 +202,7 @@ public: protected : - void + bool ActivateReplicationCallback( SG_IObject *replica ); diff --git a/source/gameengine/SceneGraph/SG_Node.cpp b/source/gameengine/SceneGraph/SG_Node.cpp index 4e90d7c4653..8de7ac83477 100644 --- a/source/gameengine/SceneGraph/SG_Node.cpp +++ b/source/gameengine/SceneGraph/SG_Node.cpp @@ -68,7 +68,7 @@ SG_Node* SG_Node::GetSGReplica() SG_Node* replica = new SG_Node(*this); if (replica == NULL) return NULL; - ProcessSGReplica(replica); + ProcessSGReplica(&replica); return replica; } @@ -76,25 +76,42 @@ SG_Node* SG_Node::GetSGReplica() void SG_Node:: ProcessSGReplica( - SG_Node* replica + SG_Node** replica ){ // Apply the replication call back function. - ActivateReplicationCallback(replica); + if (!ActivateReplicationCallback(*replica)) + { + delete (*replica); + *replica = NULL; + return; + } // clear the replica node of it's parent. - static_cast(replica)->m_SGparent = NULL; + static_cast(*replica)->m_SGparent = NULL; if (m_children.begin() != m_children.end()) { // if this node has children, the replica has too, so clear and clone children - replica->ClearSGChildren(); + (*replica)->ClearSGChildren(); NodeList::iterator childit; for (childit = m_children.begin();childit!=m_children.end();++childit) { - replica->AddChild((*childit)->GetSGReplica()); + SG_Node* childnode = (*childit)->GetSGReplica(); + if (childnode) + (*replica)->AddChild(childnode); } } + // Nodes without children and without client object are + // not worth to keep, they will just take up CPU + // This can happen in partial replication of hierarchy + // during group duplication. + if ((*replica)->m_children.empty() && + (*replica)->GetSGClientObject() == NULL) + { + delete (*replica); + *replica = NULL; + } } diff --git a/source/gameengine/SceneGraph/SG_Node.h b/source/gameengine/SceneGraph/SG_Node.h index f86e3046d93..ffaaad861e2 100644 --- a/source/gameengine/SceneGraph/SG_Node.h +++ b/source/gameengine/SceneGraph/SG_Node.h @@ -205,7 +205,7 @@ private: void ProcessSGReplica( - SG_Node* replica + SG_Node** replica ); /** From 1537e75cba4df5604b695be54bbae724df5d4095 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Fri, 25 Jul 2008 18:48:24 +0000 Subject: [PATCH 49/76] Converted shrinkwrap to a DeformOnly modifier *the options "remove faces", "merge" points were removed *made shrinkwrap work with CVs (curves and nurbs surfaces) *cleanup shrinkwrap code.. (removed bruteforces and raytree methods) --- source/blender/blenkernel/BKE_shrinkwrap.h | 20 +- source/blender/blenkernel/intern/modifier.c | 31 +- source/blender/blenkernel/intern/shrinkwrap.c | 581 ++++-------------- source/blender/makesdna/DNA_modifier_types.h | 4 +- source/blender/src/buttons_editing.c | 26 +- 5 files changed, 169 insertions(+), 493 deletions(-) diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h index f84b8fb6ec4..739027fc95f 100644 --- a/source/blender/blenkernel/BKE_shrinkwrap.h +++ b/source/blender/blenkernel/BKE_shrinkwrap.h @@ -53,7 +53,8 @@ typedef struct SpaceTransform } SpaceTransform; -void space_transform_setup(SpaceTransform *data, struct Object *local, struct Object *target); +void space_transform_from_matrixs(SpaceTransform *data, float local[][4], float target[][4]); +#define space_transform_setup(data, local, target) space_transform_from_matrixs(data, (local)->obmat, (target)->obmat) void space_transform_apply (const SpaceTransform *data, float *co); void space_transform_invert(const SpaceTransform *data, float *co); @@ -93,8 +94,7 @@ struct BVHTree* bvhtree_from_mesh_verts(struct BVHTreeFromMesh *data, struct Der // Builds a bvh tree where nodes are the faces of the given mesh. And configures BVHMesh if one is given. struct BVHTree* bvhtree_from_mesh_faces(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis); - - +int normal_projection_project_vertex(char options, const float *vert, const float *dir, const SpaceTransform *transf, BVHTree *tree, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata); /* Shrinkwrap stuff */ struct Object; @@ -109,18 +109,15 @@ typedef struct ShrinkwrapCalcData ShrinkwrapModifierData *smd; //shrinkwrap modifier data struct Object *ob; //object we are applying shrinkwrap to - struct DerivedMesh *original; //mesh before shrinkwrap (TODO clean this variable.. we don't really need it) - struct BVHTree *original_tree; //BVHTree build with the original mesh (to be used on kept volume) - struct BVHMeshCallbackUserdata *callback; + struct DerivedMesh *original; //mesh before shrinkwrap - struct DerivedMesh *final; //initially a copy of original mesh.. mesh thats going to be shrinkwrapped + float (*vertexCos)[3]; //vertexs being shrinkwraped + int numVerts; - struct DerivedMesh *target; //mesh we are shrinking to - - SpaceTransform local2target; + struct DerivedMesh *target; //mesh we are shrinking to + SpaceTransform local2target; //transform to move bettwem local and target space float keptDist; //Distance to kept from target (units are in local space) - //float *weights; //weights of vertexs BitSet moved; //BitSet indicating if vertex has moved } ShrinkwrapCalcData; @@ -130,6 +127,7 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *data); void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *data); struct DerivedMesh *shrinkwrapModifier_do(struct ShrinkwrapModifierData *smd, struct Object *ob, struct DerivedMesh *dm, int useRenderParams, int isFinalCalc); +void shrinkwrapModifier_deform(struct ShrinkwrapModifierData *smd, struct Object *ob, struct DerivedMesh *dm, float (*vertexCos)[3], int numVerts); #endif diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 124474ca09c..502be6b3af3 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -7198,7 +7198,6 @@ static void shrinkwrapModifier_initData(ModifierData *md) smd->shrinkType = MOD_SHRINKWRAP_NEAREST_SURFACE; smd->shrinkOpts = MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL; smd->keptDist = 0.0f; - smd->mergeDist = 0.0f; smd->target = 0; smd->cutPlane = 0; @@ -7213,7 +7212,6 @@ static void shrinkwrapModifier_copyData(ModifierData *md, ModifierData *target) tsmd->cutPlane = smd->cutPlane; strcpy(tsmd->vgroup_name, smd->vgroup_name); tsmd->keptDist = smd->keptDist; - tsmd->mergeDist = smd->mergeDist; tsmd->shrinkType = smd->shrinkType; tsmd->shrinkOpts = smd->shrinkOpts; } @@ -7243,7 +7241,7 @@ static void shrinkwrapModifier_foreachObjectLink(ModifierData *md, Object *ob, O walk(userData, ob, &smd->target); walk(userData, ob, &smd->cutPlane); } - +/* static DerivedMesh *shrinkwrapModifier_applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData, int useRenderParams, int isFinalCalc) { return shrinkwrapModifier_do((ShrinkwrapModifierData*)md,ob,derivedData,useRenderParams,isFinalCalc); @@ -7253,6 +7251,26 @@ static DerivedMesh *shrinkwrapModifier_applyModifierEM(ModifierData *md, Object { return shrinkwrapModifier_do((ShrinkwrapModifierData*)md,ob,derivedData,0,0); } +*/ +static void shrinkwrapModifier_deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) +{ + shrinkwrapModifier_deform((ShrinkwrapModifierData*)md, ob, derivedData, vertexCos, numVerts); +} + +static void shrinkwrapModifier_deformVertsEM(ModifierData *md, Object *ob, EditMesh *editData, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) +{ + DerivedMesh *dm; + + if(!derivedData && ob->type == OB_MESH) + dm = CDDM_from_editmesh(editData, ob->data); + else + dm = CDDM_copy(derivedData); //TODO: this is only needed if derevedData doenst supports getVertexArray + + shrinkwrapModifier_deform((ShrinkwrapModifierData*)md, ob, dm, vertexCos, numVerts); + + if(dm != derivedData) + dm->release(dm); +} static void shrinkwrapModifier_updateDepgraph(ModifierData *md, DagForest *forest, Object *ob, DagNode *obNode) { @@ -7645,8 +7663,9 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type) mti->applyModifier = explodeModifier_applyModifier; mti = INIT_TYPE(Shrinkwrap); - mti->type = eModifierTypeType_Nonconstructive; + mti->type = eModifierTypeType_OnlyDeform; mti->flags = eModifierTypeFlag_AcceptsMesh + | eModifierTypeFlag_AcceptsCVs | eModifierTypeFlag_SupportsEditmode | eModifierTypeFlag_EnableInEditmode; @@ -7655,8 +7674,8 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type) mti->requiredDataMask = shrinkwrapModifier_requiredDataMask; mti->isDisabled = shrinkwrapModifier_isDisabled; mti->foreachObjectLink = shrinkwrapModifier_foreachObjectLink; - mti->applyModifier = shrinkwrapModifier_applyModifier; - mti->applyModifierEM = shrinkwrapModifier_applyModifierEM; + mti->deformVerts = shrinkwrapModifier_deformVerts; + mti->deformVertsEM = shrinkwrapModifier_deformVertsEM; mti->updateDepgraph = shrinkwrapModifier_updateDepgraph; mti = INIT_TYPE(SimpleDeform); diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 648071b2c9f..53051b3cfd7 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -136,10 +136,11 @@ static float sphereray_tri_intersection(const BVHTreeRay *ray, float radius, con } /* Space transform */ -void space_transform_setup(SpaceTransform *data, struct Object *local, struct Object *target) +void space_transform_from_matrixs(SpaceTransform *data, float local[4][4], float target[4][4]) { - Mat4Invert(target->imat, target->obmat); //Invserse might be outdated - Mat4MulSerie(data->local2target, target->imat, local->obmat, 0, 0, 0, 0, 0, 0); + float itarget[4][4]; + Mat4Invert(itarget, target); //Invserse might be outdated + Mat4MulSerie(data->local2target, itarget, local, 0, 0, 0, 0, 0, 0); Mat4Invert(data->target2local, data->local2target); } @@ -348,142 +349,9 @@ static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *r t3 = NULL; } while(t2); - - //return hit->dist; } -/* - * Raytree from mesh - */ -static MVert *raytree_from_mesh_verts = NULL; -static MFace *raytree_from_mesh_faces = NULL; -static int raytree_check_always(Isect *is, int ob, RayFace *face) -{ - return TRUE; -} - -static void raytree_from_mesh_get_coords(RayFace *face, float **v1, float **v2, float **v3, float **v4) -{ - MFace *mface= raytree_from_mesh_faces + (int)face/2 - 1 ; - - if(face == (RayFace*)(-1)) - { - *v1 = NULL; - *v2 = NULL; - *v3 = NULL; - *v4 = NULL; - return; - } - - //Nasty quad splitting - if(((int)face) & 1) // we want the 2 triangle of the quad - { - *v1= raytree_from_mesh_verts[mface->v1].co; - *v2= raytree_from_mesh_verts[mface->v3].co; - *v3= raytree_from_mesh_verts[mface->v4].co; - *v4= NULL; - } - else - { - *v1= raytree_from_mesh_verts[mface->v1].co; - *v2= raytree_from_mesh_verts[mface->v2].co; - *v3= raytree_from_mesh_verts[mface->v3].co; - *v4= NULL; - } -} - -/* - * Creates a raytree from the given mesh - * No copy of the mesh is done, so it must exist and remain - * imutable as long the tree is intended to be used - * - * No more than 1 raytree can exist.. since this code uses a static variable - * to pass data to raytree_from_mesh_get_coords - */ -static RayTree* raytree_create_from_mesh(DerivedMesh *mesh) -{ - int i; - float min[3], max[3]; - - RayTree*tree= NULL; - - int numFaces= mesh->getNumFaces(mesh); - MFace *face = mesh->getFaceDataArray(mesh, CD_MFACE); - int numVerts= mesh->getNumVerts(mesh); - - //Initialize static vars - raytree_from_mesh_verts = mesh->getVertDataArray(mesh, CD_MVERT); - raytree_from_mesh_faces = face; - - - //calculate bounding box - INIT_MINMAX(min, max); - - for(i=0; igetNumFaces(target); - MVert *vert = target->getVertDataArray(target, CD_MVERT); - MFace *face = target->getFaceDataArray(target, CD_MFACE); - - VECCOPY(orig_co, co); - - for (i = 0; i < numFaces; i++) - { - float *v0, *v1, *v2, *v3; - - v0 = vert[ face[i].v1 ].co; - v1 = vert[ face[i].v2 ].co; - v2 = vert[ face[i].v3 ].co; - v3 = face[i].v4 ? vert[ face[i].v4 ].co : 0; - - while(v2) - { - float dist; - float tmp[3]; - - dist = nearest_point_in_tri_surface(orig_co, v0, v1, v2, tmp); - - if(dist < minDist) - { - minDist = dist; - VECCOPY(co, tmp); - } - - v1 = v2; - v2 = v3; - v3 = 0; - } - } -} - -/* - * Projects the vertex on the normal direction over the target mesh - */ -static void bruteforce_shrinkwrap_calc_normal_projection(DerivedMesh *target, float *co, float *vnormal) -{ - //TODO: this should use raycast code probably existent in blender - float minDist = FLT_MAX; - float orig_co[3]; - - int i; - int numFaces = target->getNumFaces(target); - MVert *vert = target->getVertDataArray(target, CD_MVERT); - MFace *face = target->getFaceDataArray(target, CD_MFACE); - - VECCOPY(orig_co, co); - - for (i = 0; i < numFaces; i++) - { - float *v0, *v1, *v2, *v3; - - v0 = vert[ face[i].v1 ].co; - v1 = vert[ face[i].v2 ].co; - v2 = vert[ face[i].v3 ].co; - v3 = face[i].v4 ? vert[ face[i].v4 ].co : 0; - - while(v2) - { - float dist; - float pnormal[3]; - - CalcNormFloat(v0, v1, v2, pnormal); - dist = ray_intersect_plane(orig_co, vnormal, v0, pnormal); - - if(fabs(dist) < minDist) - { - float tmp[3], nearest[3]; - VECADDFAC(tmp, orig_co, vnormal, dist); - - if( fabs(nearest_point_in_tri_surface(tmp, v0, v1, v2, nearest)) < 0.0001) - { - minDist = fabs(dist); - VECCOPY(co, nearest); - } - } - v1 = v2; - v2 = v3; - v3 = 0; - } - } -} - -/* - * Shrink to nearest vertex on target mesh - */ -static void bruteforce_shrinkwrap_calc_nearest_vertex(DerivedMesh *target, float *co, float *unused) -{ - float minDist = FLT_MAX; - float orig_co[3]; - - int i; - int numVerts = target->getNumVerts(target); - MVert *vert = target->getVertDataArray(target, CD_MVERT); - - VECCOPY(orig_co, co); - - for (i = 0; i < numVerts; i++) - { - float sdist = squared_dist( orig_co, vert[i].co); - - if(sdist < minDist) - { - minDist = sdist; - VECCOPY(co, vert[i].co); - } - } -} - - -static void shrinkwrap_calc_foreach_vertex(ShrinkwrapCalcData *calc, Shrinkwrap_ForeachVertexCallback callback) -{ - int i; - int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); - int numVerts = 0; - - MDeformVert *dvert = NULL; - MVert *vert = NULL; - - numVerts = calc->final->getNumVerts(calc->final); - dvert = calc->final->getVertDataArray(calc->final, CD_MDEFORMVERT); - vert = calc->final->getVertDataArray(calc->final, CD_MVERT); - - //Shrink (calculate each vertex final position) - for(i = 0; ilocal2target, final); - - //We also need to apply the rotation to normal - if(calc->smd->shrinkType == MOD_SHRINKWRAP_NORMAL) - { - NormalShortToFloat(normal, vert[i].no); - space_transform_apply_normal(&calc->local2target, normal); - } - (callback)(calc->target, final, normal); - - space_transform_invert(&calc->local2target, final); - - dist = VecLenf(vert[i].co, final); - if(dist > 1e-5) weight *= (dist - calc->keptDist)/dist; - VecLerpf(vert[i].co, vert[i].co, final, weight); //linear interpolation - } -} - - /* * This function removes Unused faces, vertexs and edges from calc->target * @@ -936,6 +636,7 @@ static void shrinkwrap_calc_foreach_vertex(ShrinkwrapCalcData *calc, Shrinkwrap_ * In case it creates a new DerivedMesh, the old calc->final is freed */ //TODO memory checks on allocs +/* static void shrinkwrap_removeUnused(ShrinkwrapCalcData *calc) { int i, t; @@ -1001,7 +702,7 @@ static void shrinkwrap_removeUnused(ShrinkwrapCalcData *calc) face[i].v4 = 0; //this quad turned on a tri } -/* +#if 0 if(face[i].v4 && res == 3) { if(!bitset_get(moved_verts, face[i].v1)) @@ -1020,7 +721,7 @@ static void shrinkwrap_removeUnused(ShrinkwrapCalcData *calc) face[i].v4 = 0; //this quad turned on a tri } -*/ +#endif bitset_set(used_faces, i); //Mark face to maintain numUsedFaces++; @@ -1159,9 +860,10 @@ void shrinkwrap_projectToCutPlane(ShrinkwrapCalcData *calc_data) } } - +*/ /* Main shrinkwrap function */ +/* DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, DerivedMesh *dm, int useRenderParams, int isFinalCalc) { @@ -1265,7 +967,76 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri return calc.final; } +*/ +/* Main shrinkwrap function */ +void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedMesh *dm, float (*vertexCos)[3], int numVerts) +{ + + ShrinkwrapCalcData calc; + memset(&calc, 0, sizeof(calc)); + + //Init Shrinkwrap calc data + calc.smd = smd; + + calc.ob = ob; + calc.original = dm; + + calc.numVerts = numVerts; + calc.vertexCos = vertexCos; + + //remove loop dependencies on derived meshs (TODO should this be done elsewhere?) + if(smd->target == ob) smd->target = NULL; + if(smd->cutPlane == ob) smd->cutPlane = NULL; + + + if(smd->target) + { + //TODO currently we need a copy in case object_get_derived_final returns an emDM that does not defines getVertArray or getFace array + calc.target = CDDM_copy( object_get_derived_final(smd->target, CD_MASK_BAREMESH) ); + + if(!calc.target) + { + printf("Target derived mesh is null! :S\n"); + } + + //TODO there might be several "bugs" on non-uniform scales matrixs.. because it will no longer be nearest surface, not sphere projection + //because space has been deformed + space_transform_setup(&calc.local2target, ob, smd->target); + + calc.keptDist = smd->keptDist; //TODO: smd->keptDist is in global units.. must change to local + } + + //Projecting target defined - lets work! + if(calc.target) + { + + printf("Shrinkwrap (%s)%d over (%s)%d\n", + calc.ob->id.name, calc.numVerts, + calc.smd->target->id.name, calc.target->getNumVerts(calc.target) + ); + + + switch(smd->shrinkType) + { + case MOD_SHRINKWRAP_NEAREST_SURFACE: + shrinkwrap_calc_nearest_surface_point(&calc); + break; + + case MOD_SHRINKWRAP_NORMAL: + shrinkwrap_calc_normal_projection(&calc); + break; + + case MOD_SHRINKWRAP_NEAREST_VERTEX: + shrinkwrap_calc_nearest_vertex(&calc); + break; + } + + //free derived mesh + calc.target->release( calc.target ); + calc.target = NULL; + } +} /* * Shrinkwrap to the nearest vertex @@ -1277,15 +1048,12 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) { int i; int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); - float tmp_co[3]; + float *co; BVHTreeFromMesh treeData; BVHTreeNearest nearest; - int numVerts; - MVert *vert = NULL; - MDeformVert *dvert = NULL; - + MDeformVert *dvert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MDEFORMVERT) : NULL; bvhtree_from_mesh_verts(&treeData, calc->target, 0.0, 2, 6); @@ -1295,26 +1063,21 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) nearest.index = -1; nearest.dist = FLT_MAX; - - //Find the nearest vertex - numVerts= calc->final->getNumVerts(calc->final); - vert = calc->final->getVertDataArray(calc->final, CD_MVERT); - dvert = calc->final->getVertDataArray(calc->final, CD_MDEFORMVERT); - - for(i=0; ivertexCos[i=0]; inumVerts; co = calc->vertexCos[++i]) { int index; + float tmp_co[3]; float weight = vertexgroup_get_vertex_weight(dvert, i, vgroup); if(weight == 0.0f) continue; - VECCOPY(tmp_co, vert[i].co); + VECCOPY(tmp_co, co); space_transform_apply(&calc->local2target, tmp_co); + //Use local proximity heuristics (to reduce the nearest search) if(nearest.index != -1) - { nearest.dist = squared_dist(tmp_co, nearest.co); - } - else nearest.dist = FLT_MAX; + else + nearest.dist = FLT_MAX; index = BLI_bvhtree_find_nearest(treeData.tree, tmp_co, &nearest, treeData.nearest_callback, &treeData); @@ -1323,113 +1086,16 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) float dist; VECCOPY(tmp_co, nearest.co); space_transform_invert(&calc->local2target, tmp_co); - dist = VecLenf(vert[i].co, tmp_co); + + dist = VecLenf(co, tmp_co); if(dist > 1e-5) weight *= (dist - calc->keptDist)/dist; - VecLerpf(vert[i].co, vert[i].co, tmp_co, weight); //linear interpolation + VecLerpf(co, co, tmp_co, weight); //linear interpolation } } BLI_bvhtree_free(treeData.tree); } -/* - * Shrinkwrap projecting vertexs allong their normals over the target - * - * it builds a RayTree from the target mesh and then performs a - * raycast for each vertex (ray direction = normal) - */ -/* -void shrinkwrap_calc_normal_projection_raytree(ShrinkwrapCalcData *calc) -{ - int i; - int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); - char use_normal = calc->smd->shrinkOpts; - RayTree *target = NULL; - - int numVerts; - MVert *vert = NULL; - MDeformVert *dvert = NULL; - float tmp_co[3], tmp_no[3]; - - if( (use_normal & (MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL | MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL)) == 0) - return; //Nothing todo - - //setup raytracing - BENCH(target = raytree_create_from_mesh(calc->target)); - if(target == NULL) return OUT_OF_MEMORY(); - - - - //Project each vertex along normal - numVerts= calc->final->getNumVerts(calc->final); - vert = calc->final->getVertDataArray(calc->final, CD_MVERT); - dvert = calc->final->getVertDataArray(calc->final, CD_MDEFORMVERT); - - for(i=0; itarget - VecMat4MulVecfl(tmp_co, calc->local2target, vert[i].co); - - NormalShortToFloat(tmp_no, vert[i].no); - Mat4Mul3Vecfl(calc->local2target, tmp_no); //Watch out for scaling on normal - Normalize(tmp_no); //(TODO: do we really needed a unit-len normal? and we could know the scale factor before hand?) - - if(use_normal & MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL) - { - dist = raytree_cast_ray(target, tmp_co, tmp_no, face_normal); - - if((calc->smd->shrinkOpts & MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE) && INPR(tmp_no, face_normal) < 0) - dist = FLT_MAX; - if((calc->smd->shrinkOpts & MOD_SHRINKWRAP_CULL_TARGET_BACKFACE) && INPR(tmp_no, face_normal) > 0) - dist = FLT_MAX; - } - - if(use_normal & MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL) - { - float inv[3]; // = {-tmp_no[0], -tmp_no[1], -tmp_no[2]}; - float tdist; - - inv[0] = -tmp_no[0]; - inv[1] = -tmp_no[1]; - inv[2] = -tmp_no[2]; - - tdist = raytree_cast_ray(target, tmp_co, inv, 0); - - if((calc->smd->shrinkOpts & MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE) && INPR(tmp_no, face_normal) < 0) - tdist = FLT_MAX; - if((calc->smd->shrinkOpts & MOD_SHRINKWRAP_CULL_TARGET_BACKFACE) && INPR(tmp_no, face_normal) > 0) - tdist = FLT_MAX; - - if(ABS(tdist) < ABS(dist)) - dist = -tdist; - } - - if(ABS(dist) != FLT_MAX) - { - float dist_t; - - VECADDFAC(tmp_co, tmp_co, tmp_no, dist); - VecMat4MulVecfl(tmp_co, calc->target2local, tmp_co); - - dist_t = VecLenf(vert[i].co, tmp_co); - if(dist_t > 1e-5) weight *= (dist_t - calc->keptDist)/dist_t; - VecLerpf(vert[i].co, vert[i].co, tmp_co, weight); //linear interpolation - - if(calc->moved) - bitset_set(calc->moved, i); - } - - } - - free_raytree_from_mesh(target); -} -*/ - /* * This function raycast a single vertex and updates the hit if the "hit" is considered valid. * Returns TRUE if "hit" was updated. @@ -1438,7 +1104,7 @@ void shrinkwrap_calc_normal_projection_raytree(ShrinkwrapCalcData *calc) * MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE (front faces hits are ignored) * MOD_SHRINKWRAP_CULL_TARGET_BACKFACE (back faces hits are ignored) */ -static int normal_projection_project_vertex(char options, const float *vert, const float *dir, const SpaceTransform *transf, BVHTree *tree, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata) +int normal_projection_project_vertex(char options, const float *vert, const float *dir, const SpaceTransform *transf, BVHTree *tree, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata) { float tmp_co[3], tmp_no[3]; const float *co, *no; @@ -1498,30 +1164,34 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) int i; int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); char use_normal = calc->smd->shrinkOpts; + float *co; //setup raytracing BVHTreeFromMesh treeData; BVHTreeRayHit hit; - -/* //cutTree DerivedMesh * limit_mesh = NULL; BVHTreeFromMesh limitData; SpaceTransform local2cut; -*/ - int numVerts; - MVert *vert = NULL; - MDeformVert *dvert = NULL; + MVert *vert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MVERT) : NULL; //Needed because of vertex normal + MDeformVert *dvert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MDEFORMVERT) : NULL; - if( (use_normal & (MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL | MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL)) == 0) + if(vert == NULL) + { + printf("Shrinkwrap cant normal project witouth normal information"); + return; + } + if((use_normal & (MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL | MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL)) == 0) return; //Nothing todo + CDDM_calc_normals(calc->original); //Normals maybe arent yet calculated + bvhtree_from_mesh_faces(&treeData, calc->target, calc->keptDist, 4, 6); if(treeData.tree == NULL) return OUT_OF_MEMORY(); -/* + if(calc->smd->cutPlane) { space_transform_setup( &local2cut, calc->ob, calc->smd->cutPlane); @@ -1533,14 +1203,8 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) else printf("CutPlane finalDerived mesh is null\n"); } -*/ - //Project each vertex along normal - numVerts= calc->final->getNumVerts(calc->final); - vert = calc->final->getVertDataArray(calc->final, CD_MVERT); - dvert = calc->final->getVertDataArray(calc->final, CD_MDEFORMVERT); - - for(i=0; ivertexCos[i=0]; inumVerts; co = calc->vertexCos[++i]) { float tmp_co[3], tmp_no[3]; float lim = 1000; //TODO: we should use FLT_MAX here, but sweepsphere code isnt prepared for that @@ -1549,7 +1213,7 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) if(weight == 0.0f) continue; - VECCOPY(tmp_co, vert[i].co); + VECCOPY(tmp_co, co); NormalShortToFloat(tmp_no, vert[i].no); @@ -1559,10 +1223,9 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) if(use_normal & MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL) { -/* - if(limit_tree) - normal_projection_project_vertex(0, tmp_co, tmp_no, &local2cut, limit_tree, &hit, limit_callback, &limit_userdata); -*/ + + if(limitData.tree) + normal_projection_project_vertex(0, tmp_co, tmp_no, &local2cut, limitData.tree, &hit, limitData.raycast_callback, &limitData); if(normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, tmp_no, &calc->local2target, treeData.tree, &hit, treeData.raycast_callback, &treeData)) moved = TRUE; @@ -1573,10 +1236,10 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) { float inv_no[3] = { -tmp_no[0], -tmp_no[1], -tmp_no[2] }; -/* - if(limit_tree) - normal_projection_project_vertex(0, tmp_co, inv_no, &local2cut, limit_tree, &hit, limit_callback, &limit_userdata); -*/ + + if(limitData.tree) + normal_projection_project_vertex(0, tmp_co, inv_no, &local2cut, limitData.tree, &hit, limitData.raycast_callback, &limitData); + if(normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, inv_no, &calc->local2target, treeData.tree, &hit, treeData.raycast_callback, &treeData)) moved = TRUE; } @@ -1584,7 +1247,7 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) if(hit.index != -1) { - VecLerpf(vert[i].co, vert[i].co, hit.co, weight); + VecLerpf(co, co, hit.co, weight); if(moved && calc->moved) bitset_set(calc->moved, i); @@ -1593,13 +1256,12 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) BLI_bvhtree_free(treeData.tree); -/* + if(limitData.tree) BLI_bvhtree_free(limitData.tree); if(limit_mesh) limit_mesh->release(limit_mesh); -*/ } /* @@ -1612,14 +1274,12 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) { int i; int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); - float tmp_co[3]; + float *co; BVHTreeFromMesh treeData; BVHTreeNearest nearest; - int numVerts; - MVert *vert = NULL; - MDeformVert *dvert = NULL; + MDeformVert *dvert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MDEFORMVERT) : NULL; //Create a bvh-tree of the given target @@ -1632,17 +1292,14 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) //Find the nearest vertex - numVerts= calc->final->getNumVerts(calc->final); - vert = calc->final->getVertDataArray(calc->final, CD_MVERT); - dvert = calc->final->getVertDataArray(calc->final, CD_MDEFORMVERT); - - for(i=0; ivertexCos[i=0]; inumVerts; co = calc->vertexCos[++i]) { int index; + float tmp_co[3]; float weight = vertexgroup_get_vertex_weight(dvert, i, vgroup); if(weight == 0.0f) continue; - VECCOPY(tmp_co, vert[i].co); + VECCOPY(tmp_co, co); space_transform_apply(&calc->local2target, tmp_co); if(nearest.index != -1) @@ -1665,7 +1322,7 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) VecLerpf(tmp_co, tmp_co, nearest.co, (dist - calc->keptDist)/dist); //linear interpolation } space_transform_invert(&calc->local2target, tmp_co); - VecLerpf(vert[i].co, vert[i].co, tmp_co, weight); //linear interpolation + VecLerpf(co, co, tmp_co, weight); //linear interpolation } } diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 40c3b223e01..44a7017158b 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -499,11 +499,9 @@ typedef struct ShrinkwrapModifierData { struct Object *cutPlane;/* shrink target */ char vgroup_name[32]; /* optional vertexgroup name */ float keptDist; /* distance offset from mesh/projection point */ - float mergeDist; /* distance to merge vertexs */ short shrinkType; /* shrink type projection */ short shrinkOpts; /* shrink options */ - int pad; } ShrinkwrapModifierData; /* Shrinkwrap->shrinkType */ @@ -514,7 +512,7 @@ typedef struct ShrinkwrapModifierData { /* Shrinkwrap->shrinkOpts */ #define MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL (1<<0) #define MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL (1<<1) -#define MOD_SHRINKWRAP_REMOVE_UNPROJECTED_FACES (1<<2) +/* #define MOD_SHRINKWRAP_REMOVE_UNPROJECTED_FACES (1<<2) / * Currently dropped to make shrinkwrap a deform only modifier */ #define MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE (1<<3) #define MOD_SHRINKWRAP_CULL_TARGET_BACKFACE (1<<4) diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 235463d5a75..d0b970bf5c6 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -1903,9 +1903,9 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco height = 94; } else if (md->type==eModifierType_Shrinkwrap) { ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; - height = 86; + height = 86 + 3; if (smd->shrinkType == MOD_SHRINKWRAP_NORMAL) - height += 19*5; + height += 19*3; else if (smd->shrinkType == MOD_SHRINKWRAP_NEAREST_SURFACE) height += 19; @@ -2535,31 +2535,35 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; char shrinktypemenu[]="Shrinkwrap type%t|nearest surface point %x0|normal projection %x1|nearest vertex %x2"; - uiDefButS(block, MENU, B_MODIFIER_RECALC, shrinktypemenu, lx,(cy-=19),buttonWidth,19, &smd->shrinkType, 0, 0, 0, 0, "Selects type of shrinkwrap algorithm for target position."); + uiDefIDPoinBut(block, modifier_testMeshObj, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &smd->target, "Target to shrink to"); + + but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &smd->vgroup_name, 0, 31, 0, 0, "Vertex Group name"); + uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob); + + uiDefButF(block, NUM, B_MODIFIER_RECALC, "Offset:", lx,(cy-=19),buttonWidth,19, &smd->keptDist, 0.0f, 100.0f, 1.0f, 0, "Specify distance to kept from the target"); + + cy -= 3; + uiDefButS(block, MENU, B_MODIFIER_RECALC, shrinktypemenu, lx,(cy-=19),buttonWidth,19, &smd->shrinkType, 0, 0, 0, 0, "Selects type of shrinkwrap algorithm for target position."); if (smd->shrinkType == MOD_SHRINKWRAP_NORMAL){ uiDefButBitS(block, TOG, MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL, B_MODIFIER_RECALC, "Default normal", lx,(cy-=19),buttonWidth/2,19, &smd->shrinkOpts, 0, 0, 0, 0, "Allows vertices to move in the normal direction"); uiDefButBitS(block, TOG, MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL, B_MODIFIER_RECALC, "Invert normal", lx + buttonWidth/2,cy,buttonWidth/2,19, &smd->shrinkOpts, 0, 0, 0, 0, "Allows vertices to move in the inverse direction of their normal"); - uiDefButBitS(block, TOG, MOD_SHRINKWRAP_REMOVE_UNPROJECTED_FACES, B_MODIFIER_RECALC, "Remove faces", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Remove faces where all vertices haven't been projected"); +/* uiDefButBitS(block, TOG, MOD_SHRINKWRAP_REMOVE_UNPROJECTED_FACES, B_MODIFIER_RECALC, "Remove faces", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Remove faces where all vertices haven't been projected"); */ uiDefButBitS(block, TOG, MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE, B_MODIFIER_RECALC, "Cull frontfaces",lx,(cy-=19),buttonWidth/2,19, &smd->shrinkOpts, 0, 0, 0, 0, "Controls whether a vertex can be projected to a front face on target"); uiDefButBitS(block, TOG, MOD_SHRINKWRAP_CULL_TARGET_BACKFACE, B_MODIFIER_RECALC, "Cull backfaces", lx+buttonWidth/2,cy,buttonWidth/2,19, &smd->shrinkOpts, 0, 0, 0, 0, "Controls whether a vertex can be projected to a back face on target"); - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Merge Dist:", lx,(cy-=19),buttonWidth,19, &smd->mergeDist, 0.0f, 0.01f, 0.01f, 0.01f, "Specify merge distance"); - uiDefIDPoinBut(block, modifier_testMeshObj, ID_OB, B_CHANGEDEP, "Ob2: ", lx, (cy-=19), buttonWidth,19, &smd->cutPlane, "Target to project points that didn't got projected over target"); +/* uiDefButF(block, NUM, B_MODIFIER_RECALC, "Merge Dist:", lx,(cy-=19),buttonWidth,19, &smd->mergeDist, 0.0f, 0.01f, 0.01f, 0.01f, "Specify merge distance"); */ + uiDefIDPoinBut(block, modifier_testMeshObj, ID_OB, B_CHANGEDEP, "Ob2: ", lx, (cy-=19), buttonWidth,19, &smd->cutPlane, "Aditional mesh to project over"); } else if (smd->shrinkType == MOD_SHRINKWRAP_NEAREST_SURFACE){ uiDefButBitS(block, TOG, MOD_SHRINKWRAP_KEPT_ABOVE_SURFACE, B_MODIFIER_RECALC, "Above surface", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Vertices are kept on the front side of faces"); } - but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &smd->vgroup_name, 0, 31, 0, 0, "Vertex Group name"); - uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob); - - uiDefIDPoinBut(block, modifier_testMeshObj, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &smd->target, "Target to shrink to"); - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Offset:", lx,(cy-=19),buttonWidth,19, &smd->keptDist, 0.0f, 100.0f, 1.0f, 0, "Specify distance to kept from the target"); uiBlockEndAlign(block); + } else if (md->type==eModifierType_SimpleDeform) { SimpleDeformModifierData *smd = (SimpleDeformModifierData*) md; From 9e1ca2c1bef2d0e8db5e22a284134c37b2f6a457 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Fri, 25 Jul 2008 23:52:16 +0000 Subject: [PATCH 50/76] Fixed simple deform strech/squash function --- .../blender/blenkernel/intern/simple_deform.c | 18 ++++++------------ source/blender/makesdna/DNA_modifier_types.h | 11 +++++------ source/blender/src/buttons_editing.c | 11 +++++------ 3 files changed, 16 insertions(+), 24 deletions(-) diff --git a/source/blender/blenkernel/intern/simple_deform.c b/source/blender/blenkernel/intern/simple_deform.c index 0c58543a58d..86fef7208a1 100644 --- a/source/blender/blenkernel/intern/simple_deform.c +++ b/source/blender/blenkernel/intern/simple_deform.c @@ -68,17 +68,17 @@ static void simpleDeform_tapperXY(const float factor, const float *dcut, float * } } -/* TODO strech and squash need review on function */ static void simpleDeform_strech(const float factor, const float dcut[3], float *co) { float x = co[0], y = co[1], z = co[2]; float scale; - scale = z*factor; - scale = scale*scale; + scale = (z*z*factor-factor + 1.0); + + co[0] = x*scale; + co[1] = y*scale; + co[2] = z*(1.0+factor); - co[0] += x+x*scale; - co[1] += y+y*scale; if(dcut) { @@ -86,7 +86,6 @@ static void simpleDeform_strech(const float factor, const float dcut[3], float * co[1] += dcut[0]*scale; co[2] += dcut[2]; } - } static void simpleDeform_squash(const float factor, const float dcut[3], float *co) @@ -237,15 +236,10 @@ void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object *ob, s simpleDeform_tapperXY(smd->factor[0], dcut, co); break; - case MOD_SIMPLEDEFORM_MODE_STRECH: + case MOD_SIMPLEDEFORM_MODE_STRECH_SQUASH: axis_limit(2, smd->factor+1, co, dcut); simpleDeform_strech(smd->factor[0], dcut, co); break; - - case MOD_SIMPLEDEFORM_MODE_SQUASH: - axis_limit(2, smd->factor+1, co, dcut); - simpleDeform_squash(smd->factor[0], dcut, co); - break; } //linear interpolation diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 44a7017158b..e63eb608295 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -531,11 +531,10 @@ typedef struct SimpleDeformModifierData { } SimpleDeformModifierData; -#define MOD_SIMPLEDEFORM_MODE_TWIST 1 -#define MOD_SIMPLEDEFORM_MODE_BEND 2 -#define MOD_SIMPLEDEFORM_MODE_TAPER_X 3 -#define MOD_SIMPLEDEFORM_MODE_TAPER_XY 4 -#define MOD_SIMPLEDEFORM_MODE_STRECH 5 -#define MOD_SIMPLEDEFORM_MODE_SQUASH 6 +#define MOD_SIMPLEDEFORM_MODE_TWIST 1 +#define MOD_SIMPLEDEFORM_MODE_BEND 2 +#define MOD_SIMPLEDEFORM_MODE_TAPER_X 3 +#define MOD_SIMPLEDEFORM_MODE_TAPER_XY 4 +#define MOD_SIMPLEDEFORM_MODE_STRECH_SQUASH 5 #endif diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index d0b970bf5c6..252350ea72b 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -982,12 +982,11 @@ static uiBlock *modifiers_select_simpledeform_typemenu(void *ob_v) block= uiNewBlock(&curarea->uiblocks, "modifiers_select_simpledeform_typemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); uiBlockSetButmFunc(block, do_modifiers_select_simpledeform_typemenu, ob_v); - uiDefBut(block, BUTM, B_MODIFIER_RECALC, "Twist", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_TWIST, ""); - uiDefBut(block, BUTM, B_MODIFIER_RECALC, "Bend", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_BEND, ""); - uiDefBut(block, BUTM, B_MODIFIER_RECALC, "Tapper X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_TAPER_X, ""); - uiDefBut(block, BUTM, B_MODIFIER_RECALC, "Tapper XY", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_TAPER_XY, ""); - uiDefBut(block, BUTM, B_MODIFIER_RECALC, "Strech", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_STRECH, ""); - uiDefBut(block, BUTM, B_MODIFIER_RECALC, "Squash", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_SQUASH, ""); + uiDefBut(block, BUTM, B_MODIFIER_RECALC, "Twist", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_TWIST, ""); + uiDefBut(block, BUTM, B_MODIFIER_RECALC, "Bend", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_BEND, ""); + uiDefBut(block, BUTM, B_MODIFIER_RECALC, "Tapper X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_TAPER_X, ""); + uiDefBut(block, BUTM, B_MODIFIER_RECALC, "Tapper XY", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_TAPER_XY, ""); + uiDefBut(block, BUTM, B_MODIFIER_RECALC, "Strech Squash", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_STRECH_SQUASH, ""); uiBlockSetDirection(block, UI_RIGHT); uiTextBoundsBlock(block, 50); From 289d875dfdd00165dacd92b554c472cc818dbd8f Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Fri, 1 Aug 2008 21:37:36 +0000 Subject: [PATCH 51/76] svn merge -r 15688:15908 https://svn.blender.org/svnroot/bf-blender/trunk/blender --- bin/.blender/.Blanguages | 1 + intern/boolop/intern/BOP_Edge.cpp | 43 + intern/boolop/intern/BOP_Edge.h | 13 + intern/boolop/intern/BOP_Face.cpp | 2 + intern/boolop/intern/BOP_Face.h | 3 + intern/boolop/intern/BOP_Interface.cpp | 30 +- intern/boolop/intern/BOP_Merge.cpp | 3 + intern/boolop/intern/BOP_Merge.h | 5 + intern/boolop/intern/BOP_Merge2.cpp | 944 ++++++++++++++++++ intern/boolop/intern/BOP_Merge2.h | 99 ++ intern/boolop/intern/BOP_Mesh.cpp | 11 +- intern/boolop/intern/BOP_Mesh.h | 7 - intern/boolop/intern/BOP_Misc.h | 54 + intern/boolop/intern/BOP_Tag.h | 2 +- intern/boolop/intern/BOP_Vertex.cpp | 19 + intern/boolop/intern/BOP_Vertex.h | 5 + .../blender/makesdna/DNA_makesdna.vcproj | 3 + projectfiles_vc7/blender/src/BL_src.vcproj | 15 + .../blenderhook/KX_blenderhook.vcproj | 6 - release/scripts/rvk1_torvk2.py | 64 +- source/blender/blenkernel/BKE_DerivedMesh.h | 2 + source/blender/blenkernel/BKE_blender.h | 2 +- source/blender/blenkernel/BKE_idprop.h | 1 + source/blender/blenkernel/BKE_shrinkwrap.h | 7 + source/blender/blenkernel/BKE_texture.h | 1 + .../blenkernel/bad_level_call_stubs/stubs.c | 4 +- .../blender/blenkernel/intern/DerivedMesh.c | 122 +++ source/blender/blenkernel/intern/collision.c | 2 +- source/blender/blenkernel/intern/constraint.c | 142 ++- source/blender/blenkernel/intern/customdata.c | 7 +- source/blender/blenkernel/intern/idprop.c | 15 +- source/blender/blenkernel/intern/scene.c | 2 +- source/blender/blenkernel/intern/softbody.c | 6 +- source/blender/blenkernel/intern/texture.c | 15 +- source/blender/blenlib/intern/arithb.c | 5 - source/blender/blenlib/intern/freetypefont.c | 2 +- source/blender/blenloader/intern/readfile.c | 90 +- source/blender/blenloader/intern/writefile.c | 1 + source/blender/include/BDR_gpencil.h | 13 +- source/blender/include/BIF_editaction.h | 10 +- source/blender/include/BIF_editarmature.h | 1 + source/blender/include/BIF_editview.h | 3 + source/blender/include/BSE_drawview.h | 1 + source/blender/include/butspace.h | 3 +- source/blender/makesdna/DNA_ID.h | 3 +- source/blender/makesdna/DNA_action_types.h | 1 - source/blender/makesdna/DNA_actuator_types.h | 6 +- source/blender/makesdna/DNA_armature_types.h | 3 +- .../blender/makesdna/DNA_constraint_types.h | 22 +- .../blender/makesdna/DNA_customdata_types.h | 4 +- source/blender/makesdna/DNA_gpencil_types.h | 12 +- source/blender/makesdna/DNA_meshdata_types.h | 2 +- source/blender/makesdna/DNA_object_types.h | 2 + source/blender/makesdna/DNA_sequence_types.h | 1 + .../nodes/intern/SHD_nodes/SHD_material.c | 3 - source/blender/nodes/intern/SHD_util.c | 4 +- source/blender/nodes/intern/SHD_util.h | 13 +- source/blender/python/BPY_interface.c | 2 + source/blender/python/api2_2x/Armature.c | 2 + source/blender/python/api2_2x/Bone.c | 10 +- source/blender/python/api2_2x/IDProp.c | 57 +- source/blender/python/api2_2x/doc/Armature.py | 3 + source/blender/python/api2_2x/doc/IDProp.py | 4 +- source/blender/python/api2_2x/doc/Ipo.py | 4 +- source/blender/python/api2_2x/sceneRender.c | 38 +- source/blender/src/buttons_editing.c | 14 +- source/blender/src/buttons_logic.c | 107 +- source/blender/src/buttons_object.c | 23 +- source/blender/src/drawaction.c | 117 ++- source/blender/src/drawgpencil.c | 231 +++-- source/blender/src/drawnode.c | 2 +- source/blender/src/drawseq.c | 2 +- source/blender/src/drawview.c | 44 +- source/blender/src/editaction.c | 95 +- source/blender/src/editaction_gpencil.c | 7 +- source/blender/src/editarmature.c | 26 + source/blender/src/editipo.c | 11 +- source/blender/src/editnode.c | 16 +- source/blender/src/editobject.c | 19 +- source/blender/src/editseq.c | 34 +- source/blender/src/editview.c | 4 +- source/blender/src/gpencil.c | 496 +++++---- source/blender/src/header_action.c | 21 +- source/blender/src/header_ipo.c | 2 +- source/blender/src/header_view3d.c | 1 + source/blender/src/interface.c | 4 +- source/blender/src/interface_draw.c | 2 +- source/blender/src/meshlaplacian.c | 2 +- source/blender/src/outliner.c | 61 +- source/blender/src/poseobject.c | 156 +-- source/blender/src/sequence.c | 4 +- source/blender/src/space.c | 23 +- source/blender/src/transform_conversions.c | 4 + source/blender/src/transform_manipulator.c | 10 + source/creator/creator.c | 22 + .../BlenderRoutines/KX_BlenderGL.cpp | 1 + .../KX_BlenderPolyMaterial.cpp | 114 --- .../BlenderRoutines/KX_BlenderPolyMaterial.h | 99 -- .../BlenderRoutines/KX_BlenderRenderTools.cpp | 1 - .../Converter/BL_ActionActuator.cpp | 24 +- .../Converter/BL_ArmatureObject.cpp | 9 +- .../Converter/BL_BlenderDataConversion.cpp | 695 ++++++------- .../Converter/BL_ShapeActionActuator.cpp | 59 +- .../Converter/BL_ShapeActionActuator.h | 16 +- .../Converter/KX_ConvertActuators.cpp | 14 +- .../Converter/KX_ConvertSensors.cpp | 6 +- source/gameengine/Converter/KX_IpoConvert.cpp | 59 +- source/gameengine/Converter/KX_IpoConvert.h | 2 +- .../GameLogic/SCA_ActuatorEventManager.cpp | 13 +- .../GameLogic/SCA_ActuatorEventManager.h | 1 - .../GameLogic/SCA_ActuatorSensor.cpp | 5 +- .../gameengine/GameLogic/SCA_ActuatorSensor.h | 2 +- .../GameLogic/SCA_AlwaysEventManager.cpp | 11 +- .../GameLogic/SCA_AlwaysEventManager.h | 1 - .../gameengine/GameLogic/SCA_EventManager.cpp | 13 +- .../gameengine/GameLogic/SCA_EventManager.h | 6 +- source/gameengine/GameLogic/SCA_IObject.cpp | 27 +- source/gameengine/GameLogic/SCA_ISensor.cpp | 36 +- source/gameengine/GameLogic/SCA_ISensor.h | 14 +- .../GameLogic/SCA_JoystickManager.cpp | 11 +- .../GameLogic/SCA_JoystickManager.h | 1 - .../GameLogic/SCA_KeyboardManager.cpp | 15 +- .../GameLogic/SCA_KeyboardManager.h | 1 - .../gameengine/GameLogic/SCA_LogicManager.cpp | 24 +- .../gameengine/GameLogic/SCA_LogicManager.h | 7 +- .../gameengine/GameLogic/SCA_MouseManager.cpp | 14 +- .../gameengine/GameLogic/SCA_MouseManager.h | 1 - .../GameLogic/SCA_PropertyEventManager.cpp | 11 +- .../GameLogic/SCA_PropertyEventManager.h | 1 - .../GameLogic/SCA_RandomEventManager.cpp | 11 +- .../GameLogic/SCA_RandomEventManager.h | 1 - .../GameLogic/SCA_TimeEventManager.cpp | 5 + .../GameLogic/SCA_TimeEventManager.h | 1 + source/gameengine/Ketsji/BL_BlenderShader.cpp | 85 +- source/gameengine/Ketsji/BL_BlenderShader.h | 14 +- source/gameengine/Ketsji/BL_Material.h | 5 +- source/gameengine/Ketsji/BL_Texture.cpp | 2 - .../KXNetwork/KX_NetworkEventManager.cpp | 17 +- .../Ketsji/KXNetwork/KX_NetworkEventManager.h | 3 - .../gameengine/Ketsji/KX_BlenderMaterial.cpp | 121 ++- source/gameengine/Ketsji/KX_BlenderMaterial.h | 9 +- .../Ketsji/KX_BulletPhysicsController.cpp | 2 +- .../Ketsji/KX_ConstraintActuator.cpp | 127 ++- .../gameengine/Ketsji/KX_ConstraintActuator.h | 28 +- source/gameengine/Ketsji/KX_GameObject.cpp | 64 +- source/gameengine/Ketsji/KX_GameObject.h | 1 + source/gameengine/Ketsji/KX_IpoActuator.cpp | 44 +- source/gameengine/Ketsji/KX_IpoActuator.h | 12 +- source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 3 +- .../Ketsji/KX_MaterialIpoController.cpp | 1 + .../Ketsji/KX_MaterialIpoController.h | 8 +- source/gameengine/Ketsji/KX_NearSensor.cpp | 8 + source/gameengine/Ketsji/KX_NearSensor.h | 1 + .../gameengine/Ketsji/KX_ObjectActuator.cpp | 77 +- source/gameengine/Ketsji/KX_ObjectActuator.h | 22 +- .../gameengine/Ketsji/KX_PolygonMaterial.cpp | 10 +- source/gameengine/Ketsji/KX_PolygonMaterial.h | 3 +- source/gameengine/Ketsji/KX_PyMath.h | 23 +- source/gameengine/Ketsji/KX_PythonInit.cpp | 9 + .../gameengine/Ketsji/KX_RayEventManager.cpp | 9 +- source/gameengine/Ketsji/KX_RayEventManager.h | 1 - source/gameengine/Ketsji/KX_Scene.cpp | 55 +- .../Ketsji/KX_TouchEventManager.cpp | 31 +- .../gameengine/Ketsji/KX_TouchEventManager.h | 2 +- source/gameengine/Ketsji/KX_TouchSensor.cpp | 8 + source/gameengine/Ketsji/KX_TouchSensor.h | 1 + .../gameengine/Ketsji/KX_TrackToActuator.cpp | 18 +- .../Physics/BlOde/OdePhysicsEnvironment.h | 1 + .../Physics/Bullet/CcdPhysicsEnvironment.cpp | 97 +- .../Physics/Bullet/CcdPhysicsEnvironment.h | 11 +- .../Physics/Dummy/DummyPhysicsEnvironment.h | 1 + .../Physics/Sumo/Fuzzics/src/SM_Scene.cpp | 17 +- .../Physics/Sumo/SumoPhysicsEnvironment.cpp | 6 + .../Physics/Sumo/SumoPhysicsEnvironment.h | 1 + .../Physics/common/PHY_IPhysicsEnvironment.h | 1 + .../PyDoc/BL_ShapeActionActuator.py | 158 +++ source/gameengine/PyDoc/KX_ActuatorSensor.py | 24 + .../gameengine/PyDoc/KX_ConstraintActuator.py | 120 ++- source/gameengine/PyDoc/KX_IpoActuator.py | 19 +- source/gameengine/PyDoc/KX_ObjectActuator.py | 104 +- source/gameengine/PyDoc/KX_StateActuator.py | 26 + source/gameengine/PyDoc/SCA_ISensor.py | 18 + .../Rasterizer/RAS_BucketManager.cpp | 43 +- .../gameengine/Rasterizer/RAS_BucketManager.h | 3 +- source/gameengine/Rasterizer/RAS_CameraData.h | 2 +- .../Rasterizer/RAS_IPolygonMaterial.cpp | 19 +- .../Rasterizer/RAS_IPolygonMaterial.h | 11 +- .../gameengine/Rasterizer/RAS_IRasterizer.h | 10 +- .../Rasterizer/RAS_MaterialBucket.cpp | 24 +- .../Rasterizer/RAS_MaterialBucket.h | 7 +- .../gameengine/Rasterizer/RAS_MeshObject.cpp | 203 ++-- source/gameengine/Rasterizer/RAS_MeshObject.h | 30 +- .../RAS_OpenGLRasterizer.cpp | 48 +- .../RAS_OpenGLRasterizer.h | 9 +- source/gameengine/Rasterizer/RAS_Polygon.cpp | 18 - 195 files changed, 4671 insertions(+), 2058 deletions(-) create mode 100644 intern/boolop/intern/BOP_Merge2.cpp create mode 100644 intern/boolop/intern/BOP_Merge2.h create mode 100644 intern/boolop/intern/BOP_Misc.h delete mode 100644 source/gameengine/BlenderRoutines/KX_BlenderPolyMaterial.cpp delete mode 100644 source/gameengine/BlenderRoutines/KX_BlenderPolyMaterial.h create mode 100644 source/gameengine/PyDoc/BL_ShapeActionActuator.py create mode 100644 source/gameengine/PyDoc/KX_ActuatorSensor.py create mode 100644 source/gameengine/PyDoc/KX_StateActuator.py diff --git a/bin/.blender/.Blanguages b/bin/.blender/.Blanguages index 0f98ce02247..de8d8c44550 100644 --- a/bin/.blender/.Blanguages +++ b/bin/.blender/.Blanguages @@ -20,3 +20,4 @@ Romanian:ro Arabic:ar Bulgarian:bg Greek:el +Korean:kr diff --git a/intern/boolop/intern/BOP_Edge.cpp b/intern/boolop/intern/BOP_Edge.cpp index ac302b530df..44e7d5cb567 100644 --- a/intern/boolop/intern/BOP_Edge.cpp +++ b/intern/boolop/intern/BOP_Edge.cpp @@ -75,4 +75,47 @@ void BOP_Edge::replaceVertexIndex(BOP_Index oldIndex, BOP_Index newIndex) else if (m_vertexs[1] == oldIndex) m_vertexs[1] = newIndex; } +#ifdef BOP_NEW_MERGE + +/** + * Returns if this edge contains the specified face index. + * @param i face index + * @return true if this edge contains the specified face index, false otherwise + */ +bool BOP_Edge::removeFace(BOP_Index i) +{ + int pos=0; + for(BOP_IT_Indexs it = m_faces.begin();it!=m_faces.end();pos++,it++) { + if ((*it) == i) { + m_faces.erase(it); + return true; + } + } + + return false; +} + +#endif + +#ifdef BOP_DEBUG + +#include +using namespace std; + +/** + * Implements operator <<. + */ +ostream &operator<<(ostream &stream, BOP_Edge *e) +{ + stream << "Edge[" << e->getVertex1() << "," << e->getVertex2(); +#ifdef BOP_NEW_MERGE + if(e->m_used) + stream << "] (used)"; + else + stream << "] (unused)"; +#endif + return stream; +} +#endif + diff --git a/intern/boolop/intern/BOP_Edge.h b/intern/boolop/intern/BOP_Edge.h index 13426f6e63c..a817b3d624f 100644 --- a/intern/boolop/intern/BOP_Edge.h +++ b/intern/boolop/intern/BOP_Edge.h @@ -29,12 +29,16 @@ #define BOP_EDGE_H #include "BOP_Indexs.h" +#include "BOP_Misc.h" class BOP_Edge { private: BOP_Index m_vertexs[2]; BOP_Indexs m_faces; +#ifdef BOP_NEW_MERGE + bool m_used; +#endif bool containsFace(BOP_Index i); @@ -47,6 +51,15 @@ public: inline unsigned int getNumFaces(){return m_faces.size();}; inline BOP_Indexs &getFaces(){return m_faces;}; void addFace(BOP_Index face); +#ifdef BOP_NEW_MERGE + bool removeFace(BOP_Index i); + bool getUsed() { return m_used;}; + void setUsed(bool setting) { m_used=setting;}; +#endif +#ifdef BOP_DEBUG + friend ostream &operator<<(ostream &stream, BOP_Edge *e); +#endif + }; #endif diff --git a/intern/boolop/intern/BOP_Face.cpp b/intern/boolop/intern/BOP_Face.cpp index 12c94624517..01308de3e5d 100644 --- a/intern/boolop/intern/BOP_Face.cpp +++ b/intern/boolop/intern/BOP_Face.cpp @@ -402,6 +402,7 @@ bool BOP_Face4::getEdgeIndex(BOP_Index v1, BOP_Index v2, unsigned int &e) return true; } +#ifdef BOP_DEBUG /** * Implements operator <<. */ @@ -421,3 +422,4 @@ ostream &operator<<(ostream &stream, BOP_Face *f) return stream; } +#endif diff --git a/intern/boolop/intern/BOP_Face.h b/intern/boolop/intern/BOP_Face.h index e16425f78b3..965882db732 100644 --- a/intern/boolop/intern/BOP_Face.h +++ b/intern/boolop/intern/BOP_Face.h @@ -32,6 +32,7 @@ #include "MT_Plane3.h" #include "BOP_Indexs.h" #include "BOP_BBox.h" +#include "BOP_Misc.h" #include #include using namespace std; @@ -80,7 +81,9 @@ public: virtual void replaceVertexIndex(BOP_Index oldIndex, BOP_Index newIndex) = 0; virtual bool containsVertex(BOP_Index v) = 0; +#ifdef BOP_DEBUG friend ostream &operator<<(ostream &stream, BOP_Face *f); +#endif }; class BOP_Face3: public BOP_Face diff --git a/intern/boolop/intern/BOP_Interface.cpp b/intern/boolop/intern/BOP_Interface.cpp index 2a198103931..898ca708204 100644 --- a/intern/boolop/intern/BOP_Interface.cpp +++ b/intern/boolop/intern/BOP_Interface.cpp @@ -33,9 +33,12 @@ #include "BOP_Mesh.h" #include "BOP_Face2Face.h" #include "BOP_Merge.h" +#include "BOP_Merge2.h" #include "BOP_Chrono.h" -//#define DEBUG +#if defined(BOP_ORIG_MERGE) && defined(BOP_NEW_MERGE) +#include "../../source/blender/blenkernel/BKE_global.h" +#endif BoolOpState BOP_intersectionBoolOp(BOP_Mesh* meshC, BOP_Faces* facesA, @@ -208,7 +211,32 @@ BoolOpState BOP_intersectionBoolOp(BOP_Mesh* meshC, #endif // Merge faces +#ifdef BOP_ORIG_MERGE +#ifndef BOP_NEW_MERGE BOP_Merge::getInstance().mergeFaces(meshC,numVertices); +#endif +#endif + +#ifdef BOP_NEW_MERGE +#ifndef BOP_ORIG_MERGE + BOP_Merge2::getInstance().mergeFaces(meshC,numVertices); +#else + static int state = -1; + if (G.rt == 100) { + if( state != 1 ) { + cout << "Boolean code using old merge technique." << endl; + state = 1; + } + BOP_Merge::getInstance().mergeFaces(meshC,numVertices); + } else { + if( state != 0 ) { + cout << "Boolean code using new merge technique." << endl; + state = 0; + } + BOP_Merge2::getInstance().mergeFaces(meshC,numVertices); + } +#endif +#endif #ifdef DEBUG c = chrono.stamp(); t += c; diff --git a/intern/boolop/intern/BOP_Merge.cpp b/intern/boolop/intern/BOP_Merge.cpp index 1e4139ab971..012d3409187 100644 --- a/intern/boolop/intern/BOP_Merge.cpp +++ b/intern/boolop/intern/BOP_Merge.cpp @@ -30,6 +30,7 @@ #include "BOP_Merge.h" +#ifdef BOP_ORIG_MERGE #ifdef _MSC_VER #if _MSC_VER < 1300 @@ -802,3 +803,5 @@ void BOP_Merge::getFaces(BOP_LFaces &facesByOriginalFace, BOP_Indexs vertices, B } } } + +#endif /* BOP_ORIG_MERGE */ diff --git a/intern/boolop/intern/BOP_Merge.h b/intern/boolop/intern/BOP_Merge.h index 88999b2e734..ceb8ec10690 100644 --- a/intern/boolop/intern/BOP_Merge.h +++ b/intern/boolop/intern/BOP_Merge.h @@ -28,6 +28,9 @@ #ifndef BOP_MERGE_H #define BOP_MERGE_H +#include "BOP_Misc.h" + +#ifdef BOP_ORIG_MERGE #include "BOP_Mesh.h" #include "BOP_Tag.h" #include "BOP_MathUtils.h" @@ -68,4 +71,6 @@ class BOP_Merge { void mergeFaces(BOP_Mesh *m, BOP_Index v); }; +#endif /* BOP_ORIG_MERGE */ + #endif diff --git a/intern/boolop/intern/BOP_Merge2.cpp b/intern/boolop/intern/BOP_Merge2.cpp new file mode 100644 index 00000000000..bbf3f8ba702 --- /dev/null +++ b/intern/boolop/intern/BOP_Merge2.cpp @@ -0,0 +1,944 @@ +/** + * + * $Id: BOP_Merge22.cpp 14444 2008-04-16 22:40:48Z hos $ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Marc Freixas, Ken Hughes + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include "BOP_Merge2.h" + +#ifdef BOP_NEW_MERGE + +static void deleteFace(BOP_Mesh *m, BOP_Face *face); + +/** + * SINGLETON (use method BOP_Merge2.getInstance). + */ +BOP_Merge2 BOP_Merge2::SINGLETON; + +#ifdef BOP_DEBUG +void dumpmesh ( BOP_Mesh *m, bool force ) +{ + unsigned int nonmanifold = 0; + { + BOP_Edges edges = m->getEdges(); + int count = 0; + for (BOP_IT_Edges edge = edges.begin(); edge != edges.end(); + ++count, ++edge) { + if (!(*edge)->getUsed() && (*edge)->getFaces().size() == 0 ) continue; + BOP_Vertex * v1 = m->getVertex((*edge)->getVertex1()); + BOP_Vertex * v2 = m->getVertex((*edge)->getVertex2()); + + if(v1->getTAG()!= BROKEN || v2->getTAG()!= BROKEN ) { + int fcount = 0; + BOP_Indexs faces = (*edge)->getFaces(); + for (BOP_IT_Indexs face = faces.begin(); face != faces.end(); face++) { + BOP_Face *f = m->getFace(*face); + if(f->getTAG()== UNCLASSIFIED) ++fcount; + } + + + if(fcount !=0 && fcount !=2 ) { + ++nonmanifold; + } + } + } + if (!force && nonmanifold == 0) return; + } + if( nonmanifold ) + cout << nonmanifold << " edges detected" << endl; +#ifdef DEBUG + cout << "---------------------------" << endl; + + BOP_Edges edges = m->getEdges(); + int count = 0; + for (BOP_IT_Edges edge = edges.begin(); edge != edges.end(); + ++count, ++edge) { + BOP_Vertex * v1 = m->getVertex((*edge)->getVertex1()); + BOP_Vertex * v2 = m->getVertex((*edge)->getVertex2()); + + if(v1->getTAG()!= BROKEN || v2->getTAG()!= BROKEN ) { + int fcount = 0; + BOP_Indexs faces = (*edge)->getFaces(); + cout << count << ", " << (*edge) << ", " << faces.size() << endl; + for (BOP_IT_Indexs face = faces.begin(); face != faces.end(); face++) { + BOP_Face *f = m->getFace(*face); + if(f->getTAG()== UNCLASSIFIED) ++fcount; + cout << " face " << f << endl; + } + + + if(fcount !=0 && fcount !=2 ) + cout << " NON-MANIFOLD" << endl; + } + } + + BOP_Faces faces = m->getFaces(); + count = 0; + for (BOP_IT_Faces face = faces.begin(); face != faces.end(); face++) { + if( count < 12*2 || (*face)->getTAG() != BROKEN ) { + cout << count << ", " << *face << endl; + } + ++count; + } + + BOP_Vertexs verts = m->getVertexs(); + count = 0; + for (BOP_IT_Vertexs vert = verts.begin(); vert != verts.end(); vert++) { + cout << count++ << ", " << *vert << " " << (*vert)->getNumEdges() << endl; + BOP_Indexs edges = (*vert)->getEdges(); + for( BOP_IT_Indexs it = edges.begin(); it != edges.end(); ++it) { + BOP_Edge *edge = m->getEdge(*it); + cout << " " << edge << endl; + } + } + cout << "===========================" << endl; +#endif +} +#endif + +/** + * Simplifies a mesh, merging its faces. + * @param m mesh + * @param v index of the first mergeable vertex (can be removed by merge) + */ + +void BOP_Merge2::mergeFaces(BOP_Mesh *m, BOP_Index v) +{ + m_mesh = m; + +#ifdef DEBUG + cout << "##############################" << endl; +#endif + cleanup( ); + + m_firstVertex = v; + bool cont = false; + + // Merge faces + mergeFaces(); + + do { + // Add quads ... + cont = createQuads(); + // ... and merge new faces + if( cont ) cont = mergeFaces(); + +#ifdef DEBUG + cout << "called mergeFaces " << cont << endl; +#endif + // ... until the merge is not succesful + } while(cont); +} + +void clean_nonmanifold( BOP_Mesh *m ) +{ + return; + + BOP_Edges nme; + BOP_Edges e = m->getEdges(); + for( BOP_IT_Edges it = e.begin(); it != e.end(); ++it ) { + BOP_Indexs faces = (*it)->getFaces(); + if( faces.size() & ~2 ) + nme.push_back(*it); + } + if (nme.size() == 0) return; + for( BOP_IT_Edges it = nme.begin(); it != nme.end(); ++it ) { + if( (*it)->getFaces().size() > 1 ) { + BOP_Indexs faces = (*it)->getFaces(); + for( BOP_IT_Indexs face = faces.begin(); face != faces.end(); ++face ) { + MT_Point3 vertex1 = m->getVertex(m->getFace(*face)->getVertex(0))->getPoint(); + MT_Point3 vertex2 = m->getVertex(m->getFace(*face)->getVertex(1))->getPoint(); + MT_Point3 vertex3 = m->getVertex(m->getFace(*face)->getVertex(2))->getPoint(); + if (BOP_collinear(vertex1,vertex2,vertex3)) // collinear triangle + deleteFace(m,m->getFace(*face)); + } + continue; + } + BOP_Face *oface1 = m->getFace((*it)->getFaces().front()); + BOP_Face *oface2, *tmpface; + BOP_Index first =(*it)->getVertex1(); + BOP_Index next =(*it)->getVertex2(); + BOP_Index last = first; + unsigned short facecount = 0; + bool found = false; + BOP_Indexs vertList; +#ifdef DEBUG + cout << " first edge is " << (*it) << endl; +#endif + vertList.push_back(first); + BOP_Edge *edge; + while(true) { + BOP_Vertex *vert = m->getVertex(next); + BOP_Indexs edges = vert->getEdges(); + edge = NULL; + for( BOP_IT_Indexs eit = edges.begin(); eit != edges.end(); ++eit) { + edge = m->getEdge(*eit); + if( edge->getFaces().size() > 1) { + edge = NULL; + continue; + } + if( edge->getVertex1() == next && edge->getVertex2() != last ) { + last = next; + next = edge->getVertex2(); + break; + } + if( edge->getVertex2() == next && edge->getVertex1() != last ) { + last = next; + next = edge->getVertex1(); + break; + } + edge = NULL; + } + if( !edge ) break; +#ifdef DEBUG + cout << " next edge is " << edge << endl; +#endif + tmpface = m->getFace(edge->getFaces().front()); + if( oface1->getOriginalFace() != tmpface->getOriginalFace() ) + oface2 = tmpface; + else + ++facecount; + vertList.push_back(last); + if( vertList.size() > 3 ) break; + if( next == first ) { + found = true; + break; + } + } + if(found) { + edge = *it; +#ifdef DEBUG + cout << " --> found a loop" << endl; +#endif + if( vertList.size() == 3 ) { + BOP_Face3 *face = (BOP_Face3 *)m->getFace(edge->getFaces().front()); + face->getNeighbours(first,last,next); + } else if( vertList.size() == 4 ) { + BOP_Face4 *face = (BOP_Face4 *)m->getFace(edge->getFaces().front()); + face->getNeighbours(first,last,next,last); + } else { +#ifdef DEBUG + cout << "loop has " << vertList.size() << "verts"; +#endif + continue; + } + if(facecount == 1) oface1 = oface2; + next = vertList[1]; + last = vertList[2]; + if( edge->getVertex2() == next ) { + BOP_Face3 *f = new BOP_Face3(next,first,last, + oface1->getPlane(),oface1->getOriginalFace()); + m->addFace( f ); +#ifdef DEBUG + cout << " face is backward: " << f << endl; +#endif + + } else { + BOP_Face3 *f = new BOP_Face3(last,first,next, + oface1->getPlane(),oface1->getOriginalFace()); + m->addFace( f ); +#ifdef DEBUG + cout << " face is forward: " << f << endl; +#endif + } + } + } +} + +/** + * Runs through mesh and makes sure vert/face/edge data is consistent. Most + * importantly: + * (1) mark edges which are no longer used + * (2) remove broken faces from edges + * (3) remove faces from mesh which have a single edge belonging to no other + * face (non-manifold edges) + */ + +void BOP_Merge2::cleanup( void ) +{ + BOP_Edges edges = m_mesh->getEdges(); + for (BOP_IT_Edges edge = edges.begin(); edge != edges.end(); ++edge) { + BOP_Indexs faces = (*edge)->getFaces(); + for (BOP_IT_Indexs face = faces.begin(); face != faces.end(); ++face) { + BOP_Face *f = m_mesh->getFace(*face); + if(f->getTAG()== UNCLASSIFIED) ; + else (*edge)->removeFace(*face); + } + if( (*edge)->getFaces().size() == 0) (*edge)->setUsed(false); + } + + BOP_Vertexs v = m_mesh->getVertexs(); + for( BOP_IT_Vertexs it = v.begin(); it != v.end(); ++it ) { + if( (*it)->getTAG() != BROKEN) { + BOP_Indexs edges = (*it)->getEdges(); + for(BOP_IT_Indexs i = edges.begin();i!=edges.end();i++) + if( m_mesh->getEdge((*i))->getUsed( ) == false) (*it)->removeEdge( *i ); + if( (*it)->getEdges().size() == 0 ) (*it)->setTAG(BROKEN); + } + } + // clean_nonmanifold( m_mesh ); +} + +/** + * Simplifies a mesh, merging its faces. + */ +bool BOP_Merge2::mergeFaces() +{ + BOP_Indexs mergeVertices; + BOP_Vertexs vertices = m_mesh->getVertexs(); + BOP_IT_Vertexs v = vertices.begin(); + const BOP_IT_Vertexs verticesEnd = vertices.end(); + + // Advance to first mergeable vertex + advance(v,m_firstVertex); + BOP_Index pos = m_firstVertex; + + // Add unbroken vertices to the list + while(v!=verticesEnd) { + if ((*v)->getTAG() != BROKEN) { + mergeVertices.push_back(pos); + } + + v++; + pos++; + } + + // Merge faces with that vertices + return mergeFaces(mergeVertices); +} + +/** + * remove edges from vertices when the vertex is removed + */ +void BOP_Merge2::freeVerts(BOP_Index v, BOP_Vertex *vert) +{ + BOP_Indexs edges = vert->getEdges(); + BOP_Vertex *other; + + for( BOP_IT_Indexs it = edges.begin(); it != edges.end(); ++it) { + BOP_Edge *edge = m_mesh->getEdge(*it); + BOP_Indexs edges2; + if( edge->getVertex1() != v ) + other = m_mesh->getVertex( edge->getVertex1() ); + else + other = m_mesh->getVertex( edge->getVertex2() ); + other->removeEdge(*it); + vert->removeEdge(*it); + } +} + +/** + * Simplifies a mesh, merging the faces with the specified vertices. + * @param mergeVertices vertices to test + * @return true if a face merge was performed + */ +bool BOP_Merge2::mergeFaces(BOP_Indexs &mergeVertices) +{ + // Check size > 0! + if (mergeVertices.size() == 0) return false; + bool didMerge = false; + + for( BOP_Index i = 0; i < mergeVertices.size(); ++i ) { + BOP_LFaces facesByOriginalFace; + BOP_Index v = mergeVertices[i]; + BOP_Vertex *vert = m_mesh->getVertex(v); +#ifdef DEBUG + cout << "i = " << i << ", v = " << v << ", vert = " << vert << endl; + if (v==48) + cout << "found vert 48" << endl; +#endif + if ( vert->getTAG() != BROKEN ) { + getFaces(facesByOriginalFace,v); + + switch (facesByOriginalFace.size()) { + case 0: + // v has no unbroken faces (so it's a new BROKEN vertex) + freeVerts( v, vert ); + vert->setTAG(BROKEN); + break; + case 2: { +#ifdef DEBUG + cout << "size of fBOF = " << facesByOriginalFace.size() << endl; +#endif + BOP_Faces ff = facesByOriginalFace.front(); + BOP_Faces fb = facesByOriginalFace.back(); + BOP_Index eindexs[2]; + int ecount = 0; + + // look for two edges adjacent to v which contain both ofaces + BOP_Indexs edges = vert->getEdges(); +#ifdef DEBUG + cout << " ff has " << ff.size() << " faces" << endl; + cout << " fb has " << fb.size() << " faces" << endl; + cout << " v has " << edges.size() << " edges" << endl; +#endif + for(BOP_IT_Indexs it = edges.begin(); it != edges.end(); + ++it ) { + BOP_Edge *edge = m_mesh->getEdge(*it); + BOP_Indexs faces = edge->getFaces(); +#ifdef DEBUG + cout << " " << edge << " has " << edge->getFaces().size() << " faces" << endl; +#endif + if( faces.size() == 2 ) { + BOP_Face *f0 = m_mesh->getFace(faces[0]); + BOP_Face *f1 = m_mesh->getFace(faces[1]); + if( f0->getOriginalFace() != f1->getOriginalFace() ) { +#ifdef DEBUG + cout << " " << f0 << endl; + cout << " " << f1 << endl; +#endif + eindexs[ecount++] = (*it); + } + } + } + if(ecount == 2) { +#ifdef DEBUG + cout << " edge indexes are " << eindexs[0]; + cout << " and " << eindexs[1] << endl; +#endif + BOP_Edge *edge = m_mesh->getEdge(eindexs[0]); + BOP_Index N = edge->getVertex1(); + if(N == v) N = edge->getVertex2(); +#ifdef DEBUG + cout << " ## OK, replace "<setTAG(BROKEN); + for(BOP_IT_Indexs it = edges.begin(); it != edges.end(); + ++it ) { + BOP_Edge *edge = m_mesh->getEdge(*it); + edge->setUsed(false); + } + didMerge = true; + } +#ifdef DEBUG + else { + cout << " HUH: ecount was " << ecount << endl; + } +#endif + } + break; + default: + break; + } + } + } + + return didMerge; +} + +void BOP_Merge2::mergeVertex(BOP_Faces &faces, BOP_Index v1, BOP_Index v2) +{ + for(BOP_IT_Faces face=faces.begin();face!=faces.end();face++) { + if( (*face)->size() == 3) + mergeVertex((BOP_Face3 *) *face, v1, v2); + else + mergeVertex((BOP_Face4 *) *face, v1, v2); + (*face)->setTAG(BROKEN); +#ifdef DEBUG + cout << " breaking " << (*face) << endl; +#endif + } +} + +/* + * Remove a face from the mesh and from each edges's face list + */ + +static void deleteFace(BOP_Mesh *m, BOP_Face *face) +{ + BOP_Index l2 = face->getVertex(0); + BOP_Faces faces = m->getFaces(); + for(int i = face->size(); i-- ; ) { + BOP_Indexs edges = m->getVertex(l2)->getEdges(); + BOP_Index l1 = face->getVertex(i); + for(BOP_IT_Indexs it1 = edges.begin(); it1 != edges.end(); ++it1 ) { + BOP_Edge *edge = m->getEdge(*it1); + if( ( edge->getVertex1() == l1 && edge->getVertex2() == l2 ) || + ( edge->getVertex1() == l2 && edge->getVertex2() == l1 ) ) { + BOP_Indexs ef = edge->getFaces(); + for(BOP_IT_Indexs it = ef.begin(); it != ef.end(); ++it ) { + if( m->getFace(*it) == face) { + edge->removeFace(*it); + break; + } + } + break; + } + } + l2 = l1; + } + face->setTAG(BROKEN); +} + +void BOP_Merge2::mergeVertex(BOP_Face3 *face, BOP_Index v1, BOP_Index v2) +{ + BOP_Index next, prev; + face->getNeighbours(v1,prev,next); + + // if new vertex is not already in the tri, make a new tri + if( prev != v2 && next != v2 ) { + m_mesh->addFace( new BOP_Face3(prev,v2,next, + face->getPlane(),face->getOriginalFace()) ); +#ifdef DEBUG + cout << "mv3: add " << prev << "," << v2 << "," << next << endl; + } else { + cout << "mv3: vertex already in tri: doing nothing" << endl; +#endif + } + deleteFace(m_mesh, face); +} + +void BOP_Merge2::mergeVertex(BOP_Face4 *face, BOP_Index v1, BOP_Index v2) +{ + BOP_Index next, prev, opp; + face->getNeighbours(v1,prev,next,opp); + + // if new vertex is already in the quad, replace quad with new tri + if( prev == v2 || next == v2 ) { + m_mesh->addFace( new BOP_Face3(prev,next,opp, + face->getPlane(),face->getOriginalFace()) ); +#ifdef DEBUG + cout << "mv4a: add " << prev << "," << next << "," << opp << endl; +#endif + } + // otherwise make a new quad + else { + m_mesh->addFace( new BOP_Face4(prev,v2,next,opp, + face->getPlane(),face->getOriginalFace()) ); +#ifdef DEBUG + cout << "mv4b: add "<getFaces(); + + // Merge mesh triangles + const BOP_IT_Faces facesIEnd = (faces.end()-1); + const BOP_IT_Faces facesJEnd = faces.end(); + for(BOP_IT_Faces faceI=faces.begin();faceI!=facesIEnd;faceI++) { +#ifdef OLD_QUAD + if ((*faceI)->getTAG() == BROKEN || (*faceI)->size() != 3) continue; + for(BOP_IT_Faces faceJ=(faceI+1);faceJ!=facesJEnd;faceJ++) { + if ((*faceJ)->getTAG() == BROKEN || (*faceJ)->size() != 3 || + (*faceJ)->getOriginalFace() != (*faceI)->getOriginalFace()) continue; + + + BOP_Face *faceK = createQuad((BOP_Face3*)*faceI,(BOP_Face3*)*faceJ); + if (faceK != NULL) { + // Set triangles to BROKEN + deleteFace(m_mesh, *faceI); + deleteFace(m_mesh, *faceJ); +#ifdef DEBUG + cout << "createQuad: del " << *faceI << endl; + cout << "createQuad: del " << *faceJ << endl; + cout << "createQuad: add " << faceK << endl; +#endif + quads.push_back(faceK); + break; + } + } +#else + if ((*faceI)->getTAG() == BROKEN ) continue; + for(BOP_IT_Faces faceJ=(faceI+1);faceJ!=facesJEnd;faceJ++) { + if ((*faceJ)->getTAG() == BROKEN || + (*faceJ)->getOriginalFace() != (*faceI)->getOriginalFace()) continue; + + BOP_Face *faceK = NULL; + if((*faceI)->size() == 3) { + if((*faceJ)->size() == 3) + faceK = createQuad((BOP_Face3*)*faceI,(BOP_Face3*)*faceJ); + else + faceK = createQuad((BOP_Face3*)*faceI,(BOP_Face4*)*faceJ); + } else { + if((*faceJ)->size() == 3) + faceK = createQuad((BOP_Face3*)*faceJ,(BOP_Face4*)*faceI); + else + faceK = createQuad((BOP_Face4*)*faceI,(BOP_Face4*)*faceJ); + } + + if (faceK != NULL) { + // Set triangles to BROKEN + deleteFace(m_mesh, *faceI); + deleteFace(m_mesh, *faceJ); +#ifdef DEBUG + cout << "createQuad: del " << *faceI << endl; + cout << "createQuad: del " << *faceJ << endl; + cout << "createQuad: add " << faceK << endl; +#endif + quads.push_back(faceK); + break; + } + } +#endif + } + + // Add quads to mesh + const BOP_IT_Faces quadsEnd = quads.end(); + for(BOP_IT_Faces quad=quads.begin();quad!=quadsEnd;quad++) m_mesh->addFace(*quad); + return (quads.size() > 0); +} + +/** + * Returns a new quad (convex) from the merge of two triangles that share the + * vertex index v. + * @param faceI mesh triangle + * @param faceJ mesh triangle + * @param v vertex index shared by both triangles + * @return a new convex quad if the merge is possible + */ +BOP_Face* BOP_Merge2::createQuad(BOP_Face3 *faceI, BOP_Face3 *faceJ) +{ + // Test if both triangles share a vertex index + BOP_Index v; + unsigned int i; + for(i=0;i<3 ;i++) { + v = faceI->getVertex(i); + if( faceJ->containsVertex(v) ) break; + } + if (i == 3) return NULL; + + BOP_Face *faceK = NULL; + + // Get faces data + BOP_Index prevI, nextI, prevJ, nextJ; + faceI->getNeighbours(v,prevI,nextI); + faceJ->getNeighbours(v,prevJ,nextJ); + MT_Point3 vertex = m_mesh->getVertex(v)->getPoint(); + MT_Point3 vPrevI = m_mesh->getVertex(prevI)->getPoint(); + MT_Point3 vNextI = m_mesh->getVertex(nextI)->getPoint(); + MT_Point3 vPrevJ = m_mesh->getVertex(prevJ)->getPoint(); + MT_Point3 vNextJ = m_mesh->getVertex(nextJ)->getPoint(); + + // Quad test + if (prevI == nextJ) { + if (!BOP_collinear(vNextI,vertex,vPrevJ) && !BOP_collinear(vNextI,vPrevI,vPrevJ) && + BOP_convex(vertex,vNextI,vPrevI,vPrevJ)) { + faceK = new BOP_Face4(v,nextI,prevI,prevJ,faceI->getPlane(),faceI->getOriginalFace()); + faceK->setTAG(faceI->getTAG()); + BOP_Index edge; + m_mesh->getIndexEdge(v,prevI,edge); + m_mesh->getVertex(v)->removeEdge(edge); + m_mesh->getVertex(prevI)->removeEdge(edge); + } + } + else if (nextI == prevJ) { + if (!BOP_collinear(vPrevI,vertex,vNextJ) && !BOP_collinear(vPrevI,vNextI,vNextJ) && + BOP_convex(vertex,vNextJ,vNextI,vPrevI)) { + faceK = new BOP_Face4(v,nextJ,nextI,prevI,faceI->getPlane(),faceI->getOriginalFace()); + faceK->setTAG(faceI->getTAG()); + BOP_Index edge; + m_mesh->getIndexEdge(v,nextI,edge); + m_mesh->getVertex(v)->removeEdge(edge); + m_mesh->getVertex(nextI)->removeEdge(edge); + } + } + return faceK; +} + +/** + * Returns a new quad (convex) from the merge of two triangles that share the + * vertex index v. + * @param faceI mesh triangle + * @param faceJ mesh triangle + * @param v vertex index shared by both triangles + * @return a new convex quad if the merge is possible + */ +BOP_Face* BOP_Merge2::createQuad(BOP_Face3 *faceI, BOP_Face4 *faceJ) +{ + // Test if triangle and quad share a vertex index + BOP_Index v; + unsigned int i; + for(i=0;i<3 ;i++) { + v = faceI->getVertex(i); + if( faceJ->containsVertex(v) ) break; + } + if (i == 3) return NULL; + + BOP_Face *faceK = NULL; + + // Get faces data + BOP_Index prevI, nextI, prevJ, nextJ, oppJ; + faceI->getNeighbours(v,prevI,nextI); + faceJ->getNeighbours(v,prevJ,nextJ,oppJ); + + // Quad test + BOP_Index edge; + if (nextI == prevJ) { + if (prevI == nextJ) { // v is in center + faceK = new BOP_Face3(nextJ,oppJ,prevJ,faceI->getPlane(),faceI->getOriginalFace()); + faceK->setTAG(faceI->getTAG()); + m_mesh->getIndexEdge(v,prevI,edge); + m_mesh->getVertex(v)->removeEdge(edge); + m_mesh->getVertex(prevI)->removeEdge(edge); + m_mesh->getIndexEdge(v,nextI,edge); + m_mesh->getVertex(v)->removeEdge(edge); + m_mesh->getVertex(nextI)->removeEdge(edge); + freeVerts(v, m_mesh->getVertex(v)); + } else if (prevI == oppJ) { // nextI is in center + faceK = new BOP_Face3(v,nextJ,oppJ,faceI->getPlane(),faceI->getOriginalFace()); + faceK->setTAG(faceI->getTAG()); + m_mesh->getIndexEdge(v,nextI,edge); + m_mesh->getVertex(v)->removeEdge(edge); + m_mesh->getVertex(nextI)->removeEdge(edge); + m_mesh->getIndexEdge(prevI,nextI,edge); + m_mesh->getVertex(prevI)->removeEdge(edge); + m_mesh->getVertex(nextI)->removeEdge(edge); + freeVerts(nextI, m_mesh->getVertex(nextI)); + } + } else if (nextI == oppJ && prevI == nextJ ) { // prevI is in center + faceK = new BOP_Face3(prevJ,v,oppJ,faceI->getPlane(),faceI->getOriginalFace()); + faceK->setTAG(faceI->getTAG()); + m_mesh->getIndexEdge(v,prevI,edge); + m_mesh->getVertex(v)->removeEdge(edge); + m_mesh->getVertex(prevI)->removeEdge(edge); + m_mesh->getIndexEdge(nextI,prevI,edge); + m_mesh->getVertex(nextI)->removeEdge(edge); + m_mesh->getVertex(prevI)->removeEdge(edge); + freeVerts(prevI, m_mesh->getVertex(prevI)); + } + return faceK; +} + +/** + * Returns a new quad (convex) from the merge of two triangles that share the + * vertex index v. + * @param faceI mesh triangle + * @param faceJ mesh triangle + * @param v vertex index shared by both triangles + * @return a new convex quad if the merge is possible + */ +BOP_Face* BOP_Merge2::createQuad(BOP_Face4 *faceI, BOP_Face4 *faceJ) +{ + BOP_Face *faceK = NULL; + // + // Test if both quads share a vertex index + // + BOP_Index v; + unsigned int i; + for(i=0;i<4 ;i++) { + v = faceI->getVertex(i); + if( faceJ->containsVertex(v) ) break; + } + if (i == 3) return NULL; + + + // Get faces data + BOP_Index prevI, nextI, oppI, prevJ, nextJ, oppJ; + faceI->getNeighbours(v,prevI,nextI,oppI); + faceJ->getNeighbours(v,prevJ,nextJ,oppJ); + + // Quad test + BOP_Index edge; + if (nextI == prevJ) { + if (prevI == nextJ) { // v is in center + faceK = new BOP_Face4(nextI,oppI,nextJ,oppJ,faceI->getPlane(),faceI->getOriginalFace()); + faceK->setTAG(faceI->getTAG()); + m_mesh->getIndexEdge(v,prevI,edge); + m_mesh->getVertex(v)->removeEdge(edge); + m_mesh->getVertex(prevI)->removeEdge(edge); + m_mesh->getIndexEdge(v,nextI,edge); + m_mesh->getVertex(v)->removeEdge(edge); + m_mesh->getVertex(nextI)->removeEdge(edge); + freeVerts(v, m_mesh->getVertex(v)); + } else if (oppI == oppJ) { // nextI is in center + faceK = new BOP_Face4(v,nextJ,oppJ,prevI,faceI->getPlane(),faceI->getOriginalFace()); + faceK->setTAG(faceI->getTAG()); + m_mesh->getIndexEdge(v,nextI,edge); + m_mesh->getVertex(v)->removeEdge(edge); + m_mesh->getVertex(nextI)->removeEdge(edge); + m_mesh->getIndexEdge(prevI,nextI,edge); + m_mesh->getVertex(prevI)->removeEdge(edge); + m_mesh->getVertex(nextI)->removeEdge(edge); + freeVerts(nextI, m_mesh->getVertex(nextI)); + } + } else if (prevI == nextJ && oppI == oppJ) { // prevI is in center + faceK = new BOP_Face4(v,nextI,oppJ,prevJ,faceI->getPlane(),faceI->getOriginalFace()); + faceK->setTAG(faceI->getTAG()); + m_mesh->getIndexEdge(v,prevI,edge); + m_mesh->getVertex(v)->removeEdge(edge); + m_mesh->getVertex(prevI)->removeEdge(edge); + m_mesh->getIndexEdge(nextI,prevI,edge); + m_mesh->getVertex(nextI)->removeEdge(edge); + m_mesh->getVertex(prevI)->removeEdge(edge); + freeVerts(prevI, m_mesh->getVertex(prevI)); + } + return faceK; +} + +/** + * Returns if a index is inside a set of indexs. + * @param indexs set of indexs + * @param i index + * @return true if the index is inside the set, false otherwise + */ +bool BOP_Merge2::containsIndex(BOP_Indexs indexs, BOP_Index i) +{ + const BOP_IT_Indexs indexsEnd = indexs.end(); + for(BOP_IT_Indexs it=indexs.begin();it!=indexsEnd;it++) { + if (*it == i) return true; + } + return false; +} + +/** + * Creates a list of lists L1, L2, ... LN where + * LX = mesh faces with vertex v that come from the same original face + * @param facesByOriginalFace list of faces lists + * @param v vertex index + */ +void BOP_Merge2::getFaces(BOP_LFaces &facesByOriginalFace, BOP_Index v) +{ + // Get edges with vertex v + + BOP_Indexs edgeIndexs = m_mesh->getVertex(v)->getEdges(); + const BOP_IT_Indexs edgeEnd = edgeIndexs.end(); + for(BOP_IT_Indexs edgeIndex = edgeIndexs.begin();edgeIndex != edgeEnd;edgeIndex++) { + // For each edge, add its no broken faces to the output list + BOP_Edge* edge = m_mesh->getEdge(*edgeIndex); + BOP_Indexs faceIndexs = edge->getFaces(); + const BOP_IT_Indexs faceEnd = faceIndexs.end(); + for(BOP_IT_Indexs faceIndex=faceIndexs.begin();faceIndex!=faceEnd;faceIndex++) { + BOP_Face* face = m_mesh->getFace(*faceIndex); + if (face->getTAG() != BROKEN) { + bool found = false; + // Search if we already have created a list for the + // faces that come from the same original face + const BOP_IT_LFaces lfEnd = facesByOriginalFace.end(); + for(BOP_IT_LFaces facesByOriginalFaceX=facesByOriginalFace.begin(); + facesByOriginalFaceX!=lfEnd; facesByOriginalFaceX++) { + if (((*facesByOriginalFaceX)[0])->getOriginalFace() == face->getOriginalFace()) { + // Search that the face has not been added to the list before + for(unsigned int i = 0;i<(*facesByOriginalFaceX).size();i++) { + if ((*facesByOriginalFaceX)[i] == face) { + found = true; + break; + } + } + if (!found) { + // Add the face to the list + if (face->getTAG()==OVERLAPPED) facesByOriginalFaceX->insert(facesByOriginalFaceX->begin(),face); + else facesByOriginalFaceX->push_back(face); + found = true; + } + break; + } + } + if (!found) { + // Create a new list and add the current face + BOP_Faces facesByOriginalFaceX; + facesByOriginalFaceX.push_back(face); + facesByOriginalFace.push_back(facesByOriginalFaceX); + } + } + } + } +} + +/** + * Creates a list of lists L1, L2, ... LN where + * LX = mesh faces with vertex v that come from the same original face + * and without any of the vertices that appear before v in vertices + * @param facesByOriginalFace list of faces lists + * @param vertices vector with vertices indexs that contains v + * @param v vertex index + */ +void BOP_Merge2::getFaces(BOP_LFaces &facesByOriginalFace, BOP_Indexs vertices, BOP_Index v) +{ + // Get edges with vertex v + BOP_Indexs edgeIndexs = m_mesh->getVertex(v)->getEdges(); + const BOP_IT_Indexs edgeEnd = edgeIndexs.end(); + for(BOP_IT_Indexs edgeIndex = edgeIndexs.begin();edgeIndex != edgeEnd;edgeIndex++) { + // Foreach edge, add its no broken faces to the output list + BOP_Edge* edge = m_mesh->getEdge(*edgeIndex); + BOP_Indexs faceIndexs = edge->getFaces(); + const BOP_IT_Indexs faceEnd = faceIndexs.end(); + for(BOP_IT_Indexs faceIndex=faceIndexs.begin();faceIndex!=faceEnd;faceIndex++) { + BOP_Face* face = m_mesh->getFace(*faceIndex); + if (face->getTAG() != BROKEN) { + // Search if the face contains any of the forbidden vertices + bool found = false; + for(BOP_IT_Indexs vertex = vertices.begin();*vertex!= v;vertex++) { + if (face->containsVertex(*vertex)) { + // face contains a forbidden vertex! + found = true; + break; + } + } + if (!found) { + // Search if we already have created a list with the + // faces that come from the same original face + const BOP_IT_LFaces lfEnd = facesByOriginalFace.end(); + for(BOP_IT_LFaces facesByOriginalFaceX=facesByOriginalFace.begin(); + facesByOriginalFaceX!=lfEnd; facesByOriginalFaceX++) { + if (((*facesByOriginalFaceX)[0])->getOriginalFace() == face->getOriginalFace()) { + // Search that the face has not been added to the list before + for(unsigned int i = 0;i<(*facesByOriginalFaceX).size();i++) { + if ((*facesByOriginalFaceX)[i] == face) { + found = true; + break; + } + } + if (!found) { + // Add face to the list + if (face->getTAG()==OVERLAPPED) facesByOriginalFaceX->insert(facesByOriginalFaceX->begin(),face); + else facesByOriginalFaceX->push_back(face); + found = true; + } + break; + } + } + if (!found) { + // Create a new list and add the current face + BOP_Faces facesByOriginalFaceX; + facesByOriginalFaceX.push_back(face); + facesByOriginalFace.push_back(facesByOriginalFaceX); + } + } + } + } + } +} + +#endif /* BOP_NEW_MERGE */ diff --git a/intern/boolop/intern/BOP_Merge2.h b/intern/boolop/intern/BOP_Merge2.h new file mode 100644 index 00000000000..1e5945a889f --- /dev/null +++ b/intern/boolop/intern/BOP_Merge2.h @@ -0,0 +1,99 @@ +/** + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef BOP_MERGE2_H +#define BOP_MERGE2_H + +#include "BOP_Misc.h" + +#ifdef BOP_NEW_MERGE + +#include "BOP_Mesh.h" +#include "BOP_Tag.h" +#include "BOP_MathUtils.h" +#include "MEM_SmartPtr.h" + +typedef vector< BOP_Faces > BOP_LFaces; +typedef vector< BOP_Faces >::iterator BOP_IT_LFaces; + +class BOP_Merge2 { + private: + BOP_Mesh* m_mesh; + BOP_Index m_firstVertex; + static BOP_Merge2 SINGLETON; + + BOP_Merge2() {}; + bool mergeFaces(); + bool mergeFaces(BOP_Indexs &mergeVertices); + bool mergeFaces(BOP_Faces &oldFaces, BOP_Faces &newFaces, BOP_Indexs &vertices, BOP_Index v); + bool mergeFaces(BOP_Faces &faces, BOP_Faces &oldFaces, BOP_Faces &newFaces, BOP_Indexs &vertices, BOP_Index v); + BOP_Face *mergeFaces(BOP_Face *faceI, BOP_Face *faceJ, BOP_Index v); + BOP_Face *mergeFaces(BOP_Face *faceI, BOP_Face *faceJ, BOP_Indexs &pending, BOP_Index v); + BOP_Face *mergeFaces(BOP_Face3 *faceI, BOP_Face3 *faceJ, BOP_Index v); + BOP_Face *mergeFaces(BOP_Face4 *faceI, BOP_Face3 *faceJ, BOP_Index v); + BOP_Face *mergeFaces(BOP_Face4 *faceI, BOP_Face3 *faceJ, BOP_Indexs &pending, BOP_Index v); + BOP_Face *mergeFaces(BOP_Face4 *faceI, BOP_Face4 *faceJ, BOP_Indexs &pending, BOP_Index v); + bool createQuads(); + bool containsIndex(BOP_Indexs indexs, BOP_Index index); + void getFaces(BOP_LFaces &facesByOriginalFace, BOP_Index v); + void getFaces(BOP_LFaces &facesByOriginalFace, BOP_Indexs vertices, BOP_Index v); + BOP_Face *createQuad(BOP_Face3 *faceI, BOP_Face3 *faceJ); + BOP_Face *createQuad(BOP_Face3 *faceI, BOP_Face4 *faceJ); + BOP_Face *createQuad(BOP_Face4 *faceI, BOP_Face4 *faceJ); + + bool mergeVertex(BOP_Face *faceI, BOP_Face *faceJ, BOP_Index v, + BOP_Indexs &mergeVertices); + bool mergeVertex(BOP_Face *faceI, BOP_Face *faceJ, BOP_Index v, + BOP_Indexs &pending, BOP_Faces &oldFaces, BOP_Faces &newFaces ); + BOP_Face *find3Neighbor(BOP_Face *faceI, BOP_Face *faceJ, + BOP_Index X, BOP_Index I, BOP_Index P, BOP_Index N ); + BOP_Face *find4Neighbor(BOP_Face *faceI, BOP_Face *faceJ, + BOP_Index X, BOP_Index I, BOP_Index P, BOP_Index N, + BOP_Face **faceL, BOP_Index &O); + BOP_Face3 *collapse(BOP_Face4 *faceC, BOP_Index X); + void mergeFaces(BOP_Face *A, BOP_Face *B, BOP_Index X, + BOP_Index I, BOP_Index N, BOP_Index P, BOP_Faces &newFaces ); + void freeVerts(BOP_Index v, BOP_Vertex *vert); + + void mergeVertex(BOP_Faces&, BOP_Index, BOP_Index); + void mergeVertex(BOP_Face3 *, BOP_Index, BOP_Index); + void mergeVertex(BOP_Face4 *, BOP_Index, BOP_Index); + void cleanup( void ); + + public: + + static BOP_Merge2 &getInstance() { + return SINGLETON; + } + + void mergeFaces(BOP_Mesh *m, BOP_Index v); +}; + +void dumpmesh(BOP_Mesh *, bool); + +#endif /* BOP_NEW_MERGE2 */ +#endif diff --git a/intern/boolop/intern/BOP_Mesh.cpp b/intern/boolop/intern/BOP_Mesh.cpp index 5659cd62a3f..075884a1920 100644 --- a/intern/boolop/intern/BOP_Mesh.cpp +++ b/intern/boolop/intern/BOP_Mesh.cpp @@ -449,6 +449,13 @@ bool BOP_Mesh::getIndexEdge(BOP_Index v1, BOP_Index v2, BOP_Index &e) printf ("found edge (%d %d)\n",v1,v2); #endif e = edge->index; +#ifdef BOP_NEW_MERGE + if( m_edges[e]->getUsed() == false ) { + m_edges[e]->setUsed(true); + m_vertexs[v1]->addEdge(e); + m_vertexs[v2]->addEdge(e); + } +#endif return true; } #ifdef HASH_PRINTF_DEBUG @@ -794,7 +801,8 @@ bool BOP_Mesh::isClosedMesh() } -/** *************************************************************************** +#ifdef BOP_DEBUG +/****************************************************************************** * DEBUG METHODS * * This functions are used to test the mesh state and debug program errors. * ******************************************************************************/ @@ -1075,3 +1083,4 @@ void BOP_Mesh::updatePlanes() } } +#endif diff --git a/intern/boolop/intern/BOP_Mesh.h b/intern/boolop/intern/BOP_Mesh.h index 9abff52545f..46c8fa53d20 100644 --- a/intern/boolop/intern/BOP_Mesh.h +++ b/intern/boolop/intern/BOP_Mesh.h @@ -1,10 +1,3 @@ -/* - * TEMPORARY defines to enable hashing support - */ - -#define HASH(x) ((x) >> 5) /* each "hash" covers 32 indices */ -// #define HASH_PRINTF_DEBUG /* uncomment to enable debug output */ - /** * * $Id$ diff --git a/intern/boolop/intern/BOP_Misc.h b/intern/boolop/intern/BOP_Misc.h new file mode 100644 index 00000000000..d021579d161 --- /dev/null +++ b/intern/boolop/intern/BOP_Misc.h @@ -0,0 +1,54 @@ +/** + * + * $Id: BOP_Misc.h 14444 2008-04-16 22:40:48Z khughes $ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Ken Hughes + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/* + * This file contains various definitions used across the modules + */ + +/* + * define operator>> for faces, edges and vertices, and also add some + * debugging functions for displaying various internal data structures + */ + +// #define BOP_DEBUG + +#define HASH(x) ((x) >> 5) /* each "hash" covers 32 indices */ +// #define HASH_PRINTF_DEBUG /* uncomment to enable debug output */ + +/* + * temporary: control which method is used to merge final triangles and + * quads back together after an operation. If both methods are included, + * the "rt" debugging button on the Scene panel (F10) is used to control + * which is active. Setting it to 100 enables the original method, any + * other value enables the new method. + */ + +#define BOP_ORIG_MERGE /* include original merge code */ +#define BOP_NEW_MERGE /* include new merge code */ diff --git a/intern/boolop/intern/BOP_Tag.h b/intern/boolop/intern/BOP_Tag.h index 705f4885866..ead10fa6040 100644 --- a/intern/boolop/intern/BOP_Tag.h +++ b/intern/boolop/intern/BOP_Tag.h @@ -39,7 +39,7 @@ #define OUTON_TAG 0x11 // Above and on the plane #define UNCLASSIFIED_TAG 0x0F // Expecting to be classified -#define PHANTOM_TAG 0x0C // Phantom face +#define PHANTOM_TAG 0x0C // Phantom face: verts form collinear triangle #define OVERLAPPED_TAG 0x0D // Overlapped face #define BROKEN_TAG 0x0B // Splitted and unused ... diff --git a/intern/boolop/intern/BOP_Vertex.cpp b/intern/boolop/intern/BOP_Vertex.cpp index a429c26d204..edb53ea6a59 100644 --- a/intern/boolop/intern/BOP_Vertex.cpp +++ b/intern/boolop/intern/BOP_Vertex.cpp @@ -89,3 +89,22 @@ bool BOP_Vertex::containsEdge(BOP_Index i) return false; } + +#ifdef BOP_DEBUG +/** + * Implements operator <<. + */ +#include + +ostream &operator<<(ostream &stream, BOP_Vertex *v) +{ + char aux[20]; + BOP_stringTAG(v->m_tag,aux); + MT_Point3 point = v->getPoint(); + stream << setprecision(6) << showpoint << fixed; + stream << "Vertex[" << point[0] << "," << point[1] << ","; + stream << point[2] << "] (" << aux << ")"; + return stream; +} +#endif + diff --git a/intern/boolop/intern/BOP_Vertex.h b/intern/boolop/intern/BOP_Vertex.h index 3a9895df6d3..18b2f168f8c 100644 --- a/intern/boolop/intern/BOP_Vertex.h +++ b/intern/boolop/intern/BOP_Vertex.h @@ -31,6 +31,7 @@ #include "BOP_Tag.h" #include "BOP_Indexs.h" #include "MT_Point3.h" +#include "BOP_Misc.h" class BOP_Vertex { @@ -52,6 +53,10 @@ public: inline MT_Point3 getPoint() const { return m_point;}; inline BOP_TAG getTAG() { return m_tag;}; inline void setTAG(BOP_TAG t) { m_tag = t;}; +#ifdef BOP_DEBUG + friend ostream &operator<<(ostream &stream, BOP_Vertex *v); +#endif + }; #endif diff --git a/projectfiles_vc7/blender/makesdna/DNA_makesdna.vcproj b/projectfiles_vc7/blender/makesdna/DNA_makesdna.vcproj index 04d964ba657..6ad16dec52c 100644 --- a/projectfiles_vc7/blender/makesdna/DNA_makesdna.vcproj +++ b/projectfiles_vc7/blender/makesdna/DNA_makesdna.vcproj @@ -471,6 +471,9 @@ DNA_makesdna.exe dna.c + + diff --git a/projectfiles_vc7/blender/src/BL_src.vcproj b/projectfiles_vc7/blender/src/BL_src.vcproj index 226bedbbfd8..153d9a90b23 100644 --- a/projectfiles_vc7/blender/src/BL_src.vcproj +++ b/projectfiles_vc7/blender/src/BL_src.vcproj @@ -181,6 +181,9 @@ + + @@ -232,6 +235,9 @@ + + @@ -349,6 +355,9 @@ + + @@ -617,6 +626,9 @@ + + @@ -635,6 +647,9 @@ + + diff --git a/projectfiles_vc7/gameengine/blenderhook/KX_blenderhook.vcproj b/projectfiles_vc7/gameengine/blenderhook/KX_blenderhook.vcproj index b020d88b2b3..edf0faf4ab7 100644 --- a/projectfiles_vc7/gameengine/blenderhook/KX_blenderhook.vcproj +++ b/projectfiles_vc7/gameengine/blenderhook/KX_blenderhook.vcproj @@ -142,9 +142,6 @@ - - @@ -170,9 +167,6 @@ - - diff --git a/release/scripts/rvk1_torvk2.py b/release/scripts/rvk1_torvk2.py index c723efb61a7..a48d065813a 100644 --- a/release/scripts/rvk1_torvk2.py +++ b/release/scripts/rvk1_torvk2.py @@ -14,7 +14,7 @@ __url__ = ("blender", "blenderartists.org", __version__ = "2007/04/27" __bpydoc__ = """\ -"DEFORM to RVK2" copies deform data (except EDGESPLIT,DECIMATE,SUBSURF,BOOLEAN, +"DEFORM to RVK2" copies deform data (except EDGESPLIT,DECIMATE,SUBSURF,BOOLEAN, BUILD,MIRROR,ARRAY) of the active object to the RVK (relative vertex key) of the other selected object. @@ -25,7 +25,7 @@ key. The new version of this scrit (Blender 2.43) manages the modifier changes. There are a lot of modifiers but only the ones which just deforms the shape can be used : LATTICE, CURVE, WAVE, ARMATURE. You can unset these modifiers -from the script. +from the script. Usage: @@ -35,7 +35,7 @@ the 3d View. If the active object has subsurf turned on and nonzero subdiv level, the script will ask if it should change that. Before copying data to the rvk it will also ask whether it should replace or add a new vertex group. - + """ #---------------------------------------------- @@ -70,7 +70,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA """ # Copy the rvk (1, or armature, lattice, or # any mesh deformation except surface @@ -83,7 +83,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # download the script : # http://jmsoler.free.fr/util/blenderfile/py/rvk1_torvk2.py # Communicate upon problems or errors: -# http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender +# http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender #---------------------------------------------- # Page officielle : # http://jmsoler.free.fr/util/blenderfile/py/rvk1_torvk2.py @@ -101,22 +101,22 @@ def Value(t): exec "t=Modifier.Types.%s"%t return t -def deform2rvk(): +def deform2rvk(): POSSMOD_list=['EDGESPLIT', 'DECIMATE', - 'SUBSURF', - 'BOOLEAN', + 'SUBSURF', + 'BOOLEAN', 'BUILD', - 'MIRROR', + 'MIRROR', 'ARRAY'] AUTHMOD_list=['LATTICE', - 'CURVE', + 'CURVE', 'WAVE', 'ARMATURE'] MODIFIERS=0 - + BMOD=[['Possible Modifiers'], ['Allowed Modifiers']] @@ -129,8 +129,8 @@ def deform2rvk(): # ============================================================= # must be 2 meshes ============================================ # ============================================================= - if RVK1.getType()=='Mesh' and RVK2.getType()=='Mesh': - FRAME=Blender.Get('curframe') + if RVK1.getType()=='Mesh' and RVK2.getType()=='Mesh': + FRAME=Blender.Get('curframe') DATA2=RVK2.getData() if DEBUG: print DATA2.getKey() # ============================================================ @@ -151,7 +151,7 @@ def deform2rvk(): # === Bloc Menu Modifiers ===1 doc ================= # =================================================== m=0 - for mod in MODRVK1: + for mod in MODRVK1: if DEBUG: print mod.type if mod.type in POSSMOD: BMOD[0].append([Draw.Create(0),mod.type, @@ -183,7 +183,7 @@ def deform2rvk(): retval = Blender.Draw.PupBlock("MESH 2 RVK", block) # =================================================== # === unset Modifiers ============================= - # =================================================== + # =================================================== for B in BMOD[0][1:]: if DEBUG: print B[2] MODRVK1[B[2]][Modifier.Settings.RENDER]=0 @@ -193,12 +193,12 @@ def deform2rvk(): # =================================================== # === update Modifiers ============================= # =================================================== - RVK1.makeDisplayList() + #RVK1.makeDisplayList() # ======================================================= # === get deformed mesh ================================ # ======================================================= RVK1NAME=Object.GetSelected()[0].getName() - meshrvk1=NMesh.GetRawFromObject(RVK1NAME) + meshrvk1=NMesh.GetRawFromObject(RVK1NAME) if DEBUG: print len(meshrvk1.verts) # ======================================================= # === get normal mesh for vertex group ================= @@ -209,18 +209,18 @@ def deform2rvk(): # ======================================================= DATA2=RVK2.getData() if DEBUG: print len(meshrvk1.verts) - if DEBUG: print len(DATA2.verts) + if DEBUG: print len(DATA2.verts) # ======================================================== # ===== is there the same number of vertices ============= # ======================================================== - if len(meshrvk1.verts)==len(DATA2.verts): - name = "Do you want to replace or add vertex groups ? %t| YES %x1| NO ? %x2 " + if len(meshrvk1.verts)==len(DATA2.verts): + name = "Do you want to replace or add vertex groups ? %t| YES %x1| NO ? %x2 " result = Draw.PupMenu(name) - if result==1: + if result==1: # ===================================================== # ===== Do we save vertex groups ? =================== # ===================================================== - GROUPNAME2=DATA2.getVertGroupNames() + GROUPNAME2=DATA2.getVertGroupNames() if len(GROUPNAME2)!=0: for GROUP2 in GROUPNAME2: DATA2.removeVertGroup(GROUP2) @@ -233,11 +233,11 @@ def deform2rvk(): # ===== now copy the vertices coords ===================== # ======================================================== for v in meshrvk1.verts: - i= meshrvk1.verts.index(v) + i= meshrvk1.verts.index(v) v1=DATA2.verts[i] for n in [0,1,2]: v1.co[n]=v.co[n] - DATA2.update() + DATA2.update() DATA2.insertKey(FRAME,'relative') DATA2.update() RVK2.makeDisplayList() @@ -251,23 +251,23 @@ def deform2rvk(): if not B[1]: MODRVK1[B[2]][Modifier.Settings.RENDER]|=B[-2] else: - name = "Meshes Objects must the same number of vertices %t| Ok. %x1" + name = "Meshes Objects must the same number of vertices %t| Ok. %x1" result = Draw.PupMenu(name) return else: - name = "Second Object must have at least a shape key %t| Ok. %x1" + name = "Second Object must have at least a shape key %t| Ok. %x1" result = Draw.PupMenu(name) return - else: - name = "Object must be Meshes %t| Ok. %x1" + else: + name = "Object must be Meshes %t| Ok. %x1" result = Draw.PupMenu(name) - return + return else : - name = "At least 2 Meshes as to be selected %t| Ok. %x1" + name = "At least 2 Meshes as to be selected %t| Ok. %x1" result = Draw.PupMenu(name) return - Blender.Redraw() + Blender.Redraw() EDITMODE=Blender.Window.EditMode() Blender.Window.EditMode(0) deform2rvk() -Blender.Window.EditMode(EDITMODE) +Blender.Window.EditMode(EDITMODE) \ No newline at end of file diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h index f61b300f708..7dc10c53e22 100644 --- a/source/blender/blenkernel/BKE_DerivedMesh.h +++ b/source/blender/blenkernel/BKE_DerivedMesh.h @@ -437,5 +437,7 @@ void weight_to_rgb(float input, float *fr, float *fg, float *fb); /* determines required DerivedMesh data according to view and edit modes */ CustomDataMask get_viewedit_datamask(); +void DM_add_tangent_layer(DerivedMesh *dm); + #endif diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index f76cdbc64b7..d951c8401e3 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -41,7 +41,7 @@ struct ListBase; struct MemFile; #define BLENDER_VERSION 246 -#define BLENDER_SUBVERSION 0 +#define BLENDER_SUBVERSION 1 #define BLENDER_MINVERSION 245 #define BLENDER_MINSUBVERSION 15 diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h index 2d7d0e9286f..2274c54ad3b 100644 --- a/source/blender/blenkernel/BKE_idprop.h +++ b/source/blender/blenkernel/BKE_idprop.h @@ -46,6 +46,7 @@ struct ID; typedef union { int i; float f; + double d; char *str; struct ID *id; struct { diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h index 739027fc95f..1b07ce50741 100644 --- a/source/blender/blenkernel/BKE_shrinkwrap.h +++ b/source/blender/blenkernel/BKE_shrinkwrap.h @@ -29,6 +29,13 @@ #ifndef BKE_SHRINKWRAP_H #define BKE_SHRINKWRAP_H +/* mesh util */ +//TODO move this somewhere else +#include "BKE_customdata.h" +struct DerivedMesh; +struct Object; +struct DerivedMesh *object_get_derived_final(struct Object *ob, CustomDataMask dataMask); + /* bitset stuff */ //TODO: should move this to other generic lib files? typedef char* BitSet; diff --git a/source/blender/blenkernel/BKE_texture.h b/source/blender/blenkernel/BKE_texture.h index 78a8f60caeb..fade0f8cbaa 100644 --- a/source/blender/blenkernel/BKE_texture.h +++ b/source/blender/blenkernel/BKE_texture.h @@ -62,6 +62,7 @@ struct Tex *copy_texture(struct Tex *tex); void make_local_texture(struct Tex *tex); void autotexname(struct Tex *tex); struct Tex *give_current_texture(struct Object *ob, int act); +struct Tex *give_current_world_texture(void); struct TexMapping *add_mapping(void); void init_mapping(struct TexMapping *texmap); diff --git a/source/blender/blenkernel/bad_level_call_stubs/stubs.c b/source/blender/blenkernel/bad_level_call_stubs/stubs.c index c913820205b..3ad11a61de3 100644 --- a/source/blender/blenkernel/bad_level_call_stubs/stubs.c +++ b/source/blender/blenkernel/bad_level_call_stubs/stubs.c @@ -1,4 +1,3 @@ - /** * $Id$ * @@ -355,7 +354,8 @@ TimeMarker *get_frame_marker(int frame){return 0;}; /* editseq.c */ Sequence *get_forground_frame_seq(int frame){return 0;}; -void set_last_seq(Sequence *seq){}; +void clear_last_seq(Sequence *seq){}; + /* modifier.c stub */ void harmonic_coordinates_bind(struct MeshDeformModifierData *mmd, diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 4d3f9143b85..67cf89d5ee2 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -59,6 +59,7 @@ #include "BLI_edgehash.h" #include "BLI_editVert.h" #include "BLI_linklist.h" +#include "BLI_memarena.h" #include "BKE_cdderivedmesh.h" #include "BKE_customdata.h" @@ -2844,6 +2845,127 @@ int editmesh_get_first_deform_matrices(float (**deformmats)[3][3], float (**defo return numleft; } +void DM_add_tangent_layer(DerivedMesh *dm) +{ + /* mesh vars */ + MTFace *mtface, *tf; + MFace *mface, *mf; + MVert *mvert, *v1, *v2, *v3, *v4; + MemArena *arena= NULL; + VertexTangent **vtangents= NULL; + float (*orco)[3]= NULL, (*tangent)[3]; + float *uv1, *uv2, *uv3, *uv4, *vtang; + float fno[3], tang[3], uv[4][2]; + int i, j, len, mf_vi[4], totvert, totface; + + if(CustomData_get_layer_index(&dm->faceData, CD_TANGENT) != -1) + return; + + /* check we have all the needed layers */ + totvert= dm->getNumVerts(dm); + totface= dm->getNumFaces(dm); + + mvert= dm->getVertArray(dm); + mface= dm->getFaceArray(dm); + mtface= dm->getFaceDataArray(dm, CD_MTFACE); + + if(!mtface) { + orco= dm->getVertDataArray(dm, CD_ORCO); + if(!orco) + return; + } + + /* create tangent layer */ + DM_add_face_layer(dm, CD_TANGENT, CD_CALLOC, NULL); + tangent= DM_get_face_data_layer(dm, CD_TANGENT); + + /* allocate some space */ + arena= BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE); + BLI_memarena_use_calloc(arena); + vtangents= MEM_callocN(sizeof(VertexTangent*)*totvert, "VertexTangent"); + + /* sum tangents at connected vertices */ + for(i=0, tf=mtface, mf=mface; i < totface; mf++, tf++, i++) { + v1= &mvert[mf->v1]; + v2= &mvert[mf->v2]; + v3= &mvert[mf->v3]; + + if (mf->v4) { + v4= &mvert[mf->v4]; + CalcNormFloat4(v4->co, v3->co, v2->co, v1->co, fno); + } + else { + v4= NULL; + CalcNormFloat(v3->co, v2->co, v1->co, fno); + } + + if(mtface) { + uv1= tf->uv[0]; + uv2= tf->uv[1]; + uv3= tf->uv[2]; + uv4= tf->uv[3]; + } + else { + uv1= uv[0]; uv2= uv[1]; uv3= uv[2]; uv4= uv[3]; + spheremap(orco[mf->v1][0], orco[mf->v1][1], orco[mf->v1][2], &uv[0][0], &uv[0][1]); + spheremap(orco[mf->v2][0], orco[mf->v2][1], orco[mf->v2][2], &uv[1][0], &uv[1][1]); + spheremap(orco[mf->v3][0], orco[mf->v3][1], orco[mf->v3][2], &uv[2][0], &uv[2][1]); + if(v4) + spheremap(orco[mf->v4][0], orco[mf->v4][1], orco[mf->v4][2], &uv[3][0], &uv[3][1]); + } + + tangent_from_uv(uv1, uv2, uv3, v1->co, v2->co, v3->co, fno, tang); + sum_or_add_vertex_tangent(arena, &vtangents[mf->v1], tang, uv1); + sum_or_add_vertex_tangent(arena, &vtangents[mf->v2], tang, uv2); + sum_or_add_vertex_tangent(arena, &vtangents[mf->v3], tang, uv3); + + if(mf->v4) { + v4= &mvert[mf->v4]; + + tangent_from_uv(uv1, uv3, uv4, v1->co, v3->co, v4->co, fno, tang); + sum_or_add_vertex_tangent(arena, &vtangents[mf->v1], tang, uv1); + sum_or_add_vertex_tangent(arena, &vtangents[mf->v3], tang, uv3); + sum_or_add_vertex_tangent(arena, &vtangents[mf->v4], tang, uv4); + } + } + + /* write tangent to layer */ + for(i=0, tf=mtface, mf=mface; i < totface; mf++, tf++, i++, tangent+=4) { + len= (mf->v4)? 4 : 3; + + if(mtface) { + uv1= tf->uv[0]; + uv2= tf->uv[1]; + uv3= tf->uv[2]; + uv4= tf->uv[3]; + } + else { + uv1= uv[0]; uv2= uv[1]; uv3= uv[2]; uv4= uv[3]; + spheremap(orco[mf->v1][0], orco[mf->v1][1], orco[mf->v1][2], &uv[0][0], &uv[0][1]); + spheremap(orco[mf->v2][0], orco[mf->v2][1], orco[mf->v2][2], &uv[1][0], &uv[1][1]); + spheremap(orco[mf->v3][0], orco[mf->v3][1], orco[mf->v3][2], &uv[2][0], &uv[2][1]); + if(len==4) + spheremap(orco[mf->v4][0], orco[mf->v4][1], orco[mf->v4][2], &uv[3][0], &uv[3][1]); + } + + mf_vi[0]= mf->v1; + mf_vi[1]= mf->v2; + mf_vi[2]= mf->v3; + mf_vi[3]= mf->v4; + + for(j=0; juv[j] : uv[j]); + + VECCOPY(tangent[j], vtang); + Normalize(tangent[j]); + } + } + + BLI_memarena_free(arena); + MEM_freeN(vtangents); +} + + /* ************************* fluidsim bobj file handling **************************** */ #ifndef DISABLE_ELBEEM diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index 6dfb77504fb..5b3cec25772 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -1547,7 +1547,7 @@ int cloth_bvh_objcollision ( Object *ob, ClothModifierData * clmd, float step, f { Cloth *cloth=NULL; BVHTree *cloth_bvh=NULL; - long i=0, numfaces = 0, numverts = 0; + int i=0, numfaces = 0, numverts = 0; int rounds = 0; // result counts applied collisions; ic is for debug output; ClothVertex *verts = NULL; int ret = 0, ret2 = 0; diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 068501780bc..93ba30f8c9b 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -40,6 +40,7 @@ #include "DNA_armature_types.h" #include "DNA_constraint_types.h" +#include "DNA_modifier_types.h" #include "DNA_object_types.h" #include "DNA_action_types.h" #include "DNA_curve_types.h" @@ -63,6 +64,7 @@ #include "BKE_global.h" #include "BKE_library.h" #include "BKE_idprop.h" +#include "BKE_shrinkwrap.h" #include "BPY_extern.h" @@ -457,7 +459,6 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4 Mat4CpyMat3(offs_bone, pchan->bone->bone_mat); VECCOPY(offs_bone[3], pchan->bone->head); offs_bone[3][1]+= pchan->bone->parent->length; - if (pchan->bone->flag & BONE_HINGE) { /* pose_mat = par_pose-space_location * chan_mat */ float tmat[4][4]; @@ -558,8 +559,8 @@ static void contarget_get_mesh_mat (Object *ob, char *substring, float mat[][4]) if (dgroup < 0) return; /* get DerivedMesh */ - if (G.obedit && G.editMesh) { - /* we are in editmode, so get a special derived mesh */ + if ((G.obedit == ob) && (G.editMesh)) { + /* target is in editmode, so get a special derived mesh */ dm = CDDM_from_editmesh(G.editMesh, ob->data); } else { @@ -3228,6 +3229,140 @@ static bConstraintTypeInfo CTI_TRANSFORM = { transform_evaluate /* evaluate */ }; +/* ---------- Shrinkwrap Constraint ----------- */ +static void shrinkwrap_new_data (void *cdata) +{ + bShrinkwrapConstraint *data= (bShrinkwrapConstraint *)cdata; + + data->target = NULL; + data->dist = 0.0f; + data->shrinkType = MOD_SHRINKWRAP_NEAREST_SURFACE; +} + +static int shrinkwrap_get_tars (bConstraint *con, ListBase *list) +{ + if (con && list) { + bShrinkwrapConstraint *data = con->data; + bConstraintTarget *ct; + + SINGLETARGETNS_GET_TARS(con, data->target, ct, list) + + return 1; + } + + return 0; +} + +static void shrinkwrap_flush_tars (bConstraint *con, ListBase *list, short nocopy) +{ + if (con && list) { + bShrinkwrapConstraint *data = con->data; + bConstraintTarget *ct= list->first; + + SINGLETARGETNS_FLUSH_TARS(con, data->target, ct, list, nocopy) + } +} + +static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float ctime) +{ + if (ct) + Mat4One(ct->matrix); +} + +static void shrinkwrap_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *targets) +{ + bShrinkwrapConstraint *scon = (bShrinkwrapConstraint *) con->data; + bConstraintTarget *ct = targets->first; + + if( VALID_CONS_TARGET(ct) && (ct->tar->type == OB_MESH) ) + { + float co[3] = {0.0f, 0.0f, 0.0f}; + float no[3] = {0.0f, 0.0f, 1.0f}; + float dist; + + SpaceTransform transform; + DerivedMesh *target = CDDM_copy( object_get_derived_final(ct->tar, CD_MASK_BAREMESH) ); + BVHTreeRayHit hit; + BVHTreeNearest nearest; + + //TODO + //Its stupid to create a bvhtree.. if we are only going to project one vertex + //But lets do it this way.. (so that in future maybe bvhtree gets a cache system and then the tree would already be build) + BVHTreeFromMesh treeData; + memset( &treeData, 0, sizeof(treeData) ); + + nearest.index = -1; + nearest.dist = 100000.0f; //TODO should use FLT_MAX.. but normal projection doenst yet supports it + + if(target != NULL) + { + + space_transform_from_matrixs(&transform, cob->matrix, ct->matrix); + + space_transform_apply(&transform, co); + space_transform_apply_normal(&transform, no); + + + switch(scon->shrinkType) + { + case MOD_SHRINKWRAP_NEAREST_SURFACE: + if(bvhtree_from_mesh_faces(&treeData, target, 0.0, 2, 6) == NULL) return; + BLI_bvhtree_find_nearest(treeData.tree, co, &nearest, treeData.nearest_callback, &treeData); + VECCOPY(co, nearest.co); + + dist = VecLenf(co, nearest.co); + VecLerpf(co, co, nearest.co, (dist - scon->dist)/dist); //linear interpolation + break; + + case MOD_SHRINKWRAP_NEAREST_VERTEX: + if(bvhtree_from_mesh_verts(&treeData, target, 0.0, 2, 6) == NULL) return; + BLI_bvhtree_find_nearest(treeData.tree, co, &nearest, treeData.nearest_callback, &treeData); + VECCOPY(co, nearest.co); + + dist = VecLenf(co, nearest.co); + VecLerpf(co, co, nearest.co, (dist - scon->dist)/dist); //linear interpolation + break; + + case MOD_SHRINKWRAP_NORMAL: + if(bvhtree_from_mesh_faces(&treeData, target, scon->dist, 4, 6) == NULL) return; + if(normal_projection_project_vertex(0, co, no, &transform, treeData.tree, &hit, treeData.raycast_callback, &treeData) == FALSE) + return; + + VECCOPY(co, hit.co); + break; + } + + space_transform_invert(&transform, co); + VECADD(cob->matrix[3], cob->matrix[3], co); + + + if(treeData.tree) + BLI_bvhtree_free(treeData.tree); + + target->release(target); + } + + + } +} + +static bConstraintTypeInfo CTI_SHRINKWRAP = { + CONSTRAINT_TYPE_SHRINKWRAP, /* type */ + sizeof(bShrinkwrapConstraint), /* size */ + "Shrinkwrap", /* name */ + "bShrinkwrapConstraint", /* struct name */ + NULL, /* free data */ + NULL, /* relink data */ + NULL, /* copy data */ + shrinkwrap_new_data, /* new data */ + shrinkwrap_get_tars, /* get constraint targets */ + shrinkwrap_flush_tars, /* flush constraint targets */ + shrinkwrap_get_tarmat, /* get a target matrix */ + shrinkwrap_evaluate /* evaluate */ +}; + + + /* ************************* Constraints Type-Info *************************** */ /* All of the constraints api functions use bConstraintTypeInfo structs to carry out * and operations that involve constraint specifc code. @@ -3259,6 +3394,7 @@ static void constraints_init_typeinfo () { constraintsTypeInfo[17]= &CTI_RIGIDBODYJOINT; /* RigidBody Constraint */ constraintsTypeInfo[18]= &CTI_CLAMPTO; /* ClampTo Constraint */ constraintsTypeInfo[19]= &CTI_TRANSFORM; /* Transformation Constraint */ + constraintsTypeInfo[20]= &CTI_SHRINKWRAP; /* Shrinkwrap Constraint */ } /* This function should be used for getting the appropriate type-info when only diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 501293ecd81..9012adb09b7 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -532,13 +532,14 @@ const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = { {sizeof(float)*3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL}, {sizeof(MTexPoly), "MTexPoly", 1, "Face Texture", NULL, NULL, NULL, NULL, NULL}, {sizeof(MLoopUV), "MLoopUV", 1, "UV coord", NULL, NULL, layerInterp_mloopuv, NULL, NULL}, - {sizeof(MLoopCol), "MLoopCol", 1, "Col", NULL, NULL, layerInterp_mloopcol, NULL, layerDefault_mloopcol} + {sizeof(MLoopCol), "MLoopCol", 1, "Col", NULL, NULL, layerInterp_mloopcol, NULL, layerDefault_mloopcol}, + {sizeof(float)*3*4, "", 0, NULL, NULL, NULL, NULL, NULL, NULL} }; const char *LAYERTYPENAMES[CD_NUMTYPES] = { "CDMVert", "CDMSticky", "CDMDeformVert", "CDMEdge", "CDMFace", "CDMTFace", "CDMCol", "CDOrigIndex", "CDNormal", "CDFlags","CDMFloatProperty", - "CDMIntProperty","CDMStringProperty", "CDOrigSpace", "CDOrco", "CDMTexPoly", "CDMLoopUV", "CDMloopCol"}; + "CDMIntProperty","CDMStringProperty", "CDOrigSpace", "CDOrco", "CDMTexPoly", "CDMLoopUV", "CDMloopCol", "CDTangent"}; const CustomDataMask CD_MASK_BAREMESH = CD_MASK_MVERT | CD_MASK_MEDGE | CD_MASK_MFACE; @@ -552,7 +553,7 @@ const CustomDataMask CD_MASK_EDITMESH = const CustomDataMask CD_MASK_DERIVEDMESH = CD_MASK_MSTICKY | CD_MASK_MDEFORMVERT | CD_MASK_MTFACE | CD_MASK_MCOL | CD_MASK_ORIGINDEX | CD_MASK_PROP_FLT | CD_MASK_PROP_INT | - CD_MASK_PROP_STR | CD_MASK_ORIGSPACE | CD_MASK_ORCO; + CD_MASK_PROP_STR | CD_MASK_ORIGSPACE | CD_MASK_ORCO | CD_MASK_TANGENT; const CustomDataMask CD_MASK_BMESH = CD_MASK_MSTICKY | CD_MASK_MDEFORMVERT | CD_MASK_PROP_FLT | CD_MASK_PROP_INT | CD_MASK_PROP_STR; const CustomDataMask CD_MASK_FACECORNERS = diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index 2ef2f3a1b77..b16f52571f6 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -54,7 +54,8 @@ static char idp_size_table[] = { sizeof(float)*16, /*Matrix type, deprecated*/ 0, /*arrays don't have a fixed size*/ sizeof(ListBase), /*Group type*/ - sizeof(void*) + sizeof(void*), + sizeof(double) }; @@ -365,10 +366,14 @@ IDProperty *IDP_New(int type, IDPropertyTemplate val, char *name) prop = MEM_callocN(sizeof(IDProperty), "IDProperty float"); *(float*)&prop->data.val = val.f; break; + case IDP_DOUBLE: + prop = MEM_callocN(sizeof(IDProperty), "IDProperty float"); + *(double*)&prop->data.val = val.d; + break; case IDP_ARRAY: { - /*for now, we only support float and int arrays*/ - if (val.array.type == IDP_FLOAT || val.array.type == IDP_INT) { + /*for now, we only support float and int and double arrays*/ + if (val.array.type == IDP_FLOAT || val.array.type == IDP_INT || val.array.type == IDP_DOUBLE) { prop = MEM_callocN(sizeof(IDProperty), "IDProperty array"); prop->len = prop->totallen = val.array.len; prop->subtype = val.array.type; @@ -411,6 +416,10 @@ IDProperty *IDP_New(int type, IDPropertyTemplate val, char *name) prop->type = type; strncpy(prop->name, name, MAX_IDPROP_NAME); + + /*security null byte*/ + prop->name[MAX_IDPROP_NAME-1] = 0; + return prop; } diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 2898dca767c..553107dd264 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -303,7 +303,7 @@ void set_scene_bg(Scene *sce) int flag; // Note: this here is defined in editseq.c (BIF_editseq.h), NOT in blenkernel! - set_last_seq(NULL); + clear_last_seq(); G.scene= sce; diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 9005db1312f..d5b5ab6d63e 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -2053,7 +2053,6 @@ static void softbody_calc_forces(Object *ob, float forcetime, float timenow, int /* check conditions for various options */ do_deflector= query_external_colliders(ob); - do_effector= pdInitEffectors(ob,NULL); do_selfcollision=((ob->softflag & OB_SB_EDGES) && (sb->bspring)&& (ob->softflag & OB_SB_SELF)); do_springcollision=do_deflector && (ob->softflag & OB_SB_EDGES) &&(ob->softflag & OB_SB_EDGECOLL); do_aero=((sb->aeroedge)&& (ob->softflag & OB_SB_EDGES)); @@ -2061,9 +2060,10 @@ static void softbody_calc_forces(Object *ob, float forcetime, float timenow, int iks = 1.0f/(1.0f-sb->inspring)-1.0f ;/* inner spring constants function */ bproot= sb->bpoint; /* need this for proper spring addressing */ - - if (do_springcollision || do_aero) scan_for_ext_spring_forces(ob,timenow); + /* after spring scan because it uses Effoctors too */ + do_effector= pdInitEffectors(ob,NULL); + if (do_deflector) { float defforce[3]; do_deflector = sb_detect_aabb_collisionCached(defforce,ob->lay,ob,timenow); diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 37804bf68ac..ad139220785 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -53,6 +53,7 @@ #include "DNA_world_types.h" #include "DNA_brush_types.h" #include "DNA_node_types.h" +#include "DNA_scene_types.h" #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" @@ -731,7 +732,7 @@ Tex *give_current_texture(Object *ob, int act) bNode *node; if(ob==0) return 0; - if(ob->totcol==0) return 0; + if(ob->totcol==0 && !(ob->type==OB_LAMP)) return 0; if(ob->type==OB_LAMP) { la=(Lamp *)ob->data; @@ -775,6 +776,18 @@ Tex *give_current_texture(Object *ob, int act) return tex; } +Tex *give_current_world_texture(void) +{ + MTex *mtex = 0; + Tex *tex = 0; + + if(!(G.scene->world)) return 0; + + mtex= G.scene->world->mtex[(int)(G.scene->world->texact)]; + if(mtex) tex= mtex->tex; + + return tex; +} /* ------------------------------------------------------------------------- */ diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index a31c769a5b3..c1edb7d3ac1 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -2535,11 +2535,6 @@ int IsectPQ2Df(float pt[2], float v1[2], float v2[2], float v3[2], float v4[2]) } - - /* copied from Geometry.c - todo - move to arithb.c or some other generic place we can reuse */ -#define SIDE_OF_LINE(pa,pb,pp) ((pa[0]-pp[0])*(pb[1]-pp[1]))-((pb[0]-pp[0])*(pa[1]-pp[1])) -#define POINT_IN_TRI(p0,p1,p2,p3) ((SIDE_OF_LINE(p1,p2,p0)>=0) && (SIDE_OF_LINE(p2,p3,p0)>=0) && (SIDE_OF_LINE(p3,p1,p0)>=0)) - /** * * @param min diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c index 8b979f9ed23..74f152ac635 100644 --- a/source/blender/blenlib/intern/freetypefont.c +++ b/source/blender/blenlib/intern/freetypefont.c @@ -405,7 +405,7 @@ static VFontData *objfnt_to_ftvfontdata(PackedFile * pf) lcode = charcode; } - err = FT_Set_Charmap( face, (FT_CharMap) FT_ENCODING_UNICODE ); + err = FT_Select_Charmap( face, FT_ENCODING_UNICODE ); return vfd; } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 090b1d7c6b6..ad19cde3c9b 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1347,8 +1347,14 @@ void IDP_DirectLinkArray(IDProperty *prop, int switch_endian, void *fd) prop->data.pointer = newdataadr(fd, prop->data.pointer); if (switch_endian) { - for (i=0; ilen; i++) { - SWITCH_INT(((int*)prop->data.pointer)[i]); + if (prop->subtype != IDP_DOUBLE) { + for (i=0; ilen; i++) { + SWITCH_INT(((int*)prop->data.pointer)[i]); + } + } else { + for (i=0; ilen; i++) { + SWITCH_LONGINT(((double*)prop->data.pointer)[i]); + } } } } @@ -1384,6 +1390,24 @@ void IDP_DirectLinkProperty(IDProperty *prop, int switch_endian, void *fd) break; case IDP_ARRAY: IDP_DirectLinkArray(prop, switch_endian, fd); + break; + case IDP_DOUBLE: + /*erg, stupid doubles. since I'm storing them + in the same field as int val; val2 in the + IDPropertyData struct, they have to deal with + endianness specifically + + in theory, val and val2 would've already been swapped + if switch_endian is true, so we have to first unswap + them then reswap them as a single 64-bit entity. + */ + + if (switch_endian) { + SWITCH_INT(prop->data.val); + SWITCH_INT(prop->data.val2); + SWITCH_LONGINT(prop->data.val); + } + break; } } @@ -4161,15 +4185,6 @@ static void direct_link_screen(FileData *fd, bScreen *sc) link_gpencil(fd, sseq->gpd); } } - else if(sl->spacetype==SPACE_ACTION) { - SpaceAction *sact= (SpaceAction *)sl; - - /* WARNING: action-editor doesn't have it's own gpencil data! - * so only adjust pointer, but DON'T LINK - */ - if (sact->gpd) - sact->gpd= newdataadr(fd, sact->gpd); - } } sa->v1= newdataadr(fd, sa->v1); @@ -4855,6 +4870,49 @@ void idproperties_fix_group_lengths(ListBase idlist) } } +void alphasort_version_246(FileData *fd, Library *lib, Mesh *me) +{ + Material *ma; + MFace *mf; + MTFace *tf; + int a, b, texalpha; + + /* verify we have a tface layer */ + for(b=0; bfdata.totlayer; b++) + if(me->fdata.layers[b].type == CD_MTFACE) + break; + + if(b == me->fdata.totlayer) + return; + + /* if we do, set alpha sort if the game engine did it before */ + for(a=0, mf=me->mface; atotface; a++, mf++) { + if(mf->mat_nr < me->totcol) { + ma= newlibadr(fd, lib, me->mat[mf->mat_nr]); + texalpha = 0; + + for(b=0; ma && bmtex && ma->mtex[b] && ma->mtex[b]->mapto & MAP_ALPHA) + texalpha = 1; + } + else { + ma= NULL; + texalpha = 0; + } + + for(b=0; bfdata.totlayer; b++) { + if(me->fdata.layers[b].type == CD_MTFACE) { + tf = ((MTFace*)me->fdata.layers[b].data) + a; + + tf->mode &= ~TF_ALPHASORT; + if(ma && (ma->mode & MA_ZTRA)) + if(ELEM(tf->transp, TF_ALPHA, TF_ADD) || (texalpha && (tf->transp != TF_CLIP))) + tf->mode |= TF_ALPHASORT; + } + } + } +} + static void do_versions(FileData *fd, Library *lib, Main *main) { /* WATCH IT!!!: pointers from libdata have not been converted */ @@ -7699,8 +7757,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } /* sun/sky */ - if ((main->versionfile < 246) ){ + if(main->versionfile < 246) { Lamp *la; + for(la=main->lamp.first; la; la= la->id.next) { la->sun_effect_type = 0; la->horizon_brightness = 1.0; @@ -7716,6 +7775,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } + if(main->versionfile <= 246 && main->subversionfile < 1){ + Mesh *me; + + for(me=main->mesh.first; me; me= me->id.next) + alphasort_version_246(fd, lib, me); + } + /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */ diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index b59dd851dfe..73abf362d12 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -533,6 +533,7 @@ static void write_particlesettings(WriteData *wd, ListBase *idbase) if(part->id.us>0 || wd->current) { /* write LibData */ writestruct(wd, ID_PA, "ParticleSettings", 1, part); + if (part->id.properties) IDP_WriteProperty(part->id.properties, wd); writestruct(wd, DATA, "PartDeflect", 1, part->pd); } part= part->id.next; diff --git a/source/blender/include/BDR_gpencil.h b/source/blender/include/BDR_gpencil.h index d0ebd096ecb..eb749cf28ec 100644 --- a/source/blender/include/BDR_gpencil.h +++ b/source/blender/include/BDR_gpencil.h @@ -38,6 +38,15 @@ struct bGPdata; struct bGPDlayer; struct bGPDframe; +/* ------------- Grease-Pencil Helpers -------------- */ + +/* Temporary 'Stroke Point' data */ +typedef struct tGPspoint { + short x, y; /* x and y coordinates of cursor (in relative to area) */ + float xf, yf; /* same as x and y, but as floats */ + float pressure; /* pressure of tablet at this point */ +} tGPspoint; + /* ------------ Grease-Pencil API ------------------ */ void free_gpencil_strokes(struct bGPDframe *gpf); @@ -53,8 +62,6 @@ struct bGPdata *gpencil_data_duplicate(struct bGPdata *gpd); struct bGPdata *gpencil_data_getactive(struct ScrArea *sa); short gpencil_data_setactive(struct ScrArea *sa, struct bGPdata *gpd); -struct bGPdata *gpencil_data_getetime(struct bScreen *sc); -void gpencil_data_setetime(struct bScreen *sc, struct bGPdata *gpd); void gpencil_frame_delete_laststroke(struct bGPDframe *gpf); @@ -71,6 +78,6 @@ void gpencil_delete_operation(short mode); void gpencil_delete_menu(void); //short gpencil_paint(short mousebutton); -short gpencil_do_paint(struct ScrArea *sa); +short gpencil_do_paint(struct ScrArea *sa, short mousebutton); #endif /* BDR_GPENCIL_H */ diff --git a/source/blender/include/BIF_editaction.h b/source/blender/include/BIF_editaction.h index 9f6751daeff..77c2f19bb9b 100644 --- a/source/blender/include/BIF_editaction.h +++ b/source/blender/include/BIF_editaction.h @@ -49,7 +49,9 @@ enum { ACTTYPE_FILLCON, ACTTYPE_IPO, ACTTYPE_SHAPEKEY, - ACTTYPE_GPLAYER + ACTTYPE_GPDATABLOCK, + ACTTYPE_GPLAYER, + ACTTYPE_SPECIALDATA }; /* Macros for easier/more consistant state testing */ @@ -70,6 +72,8 @@ enum { #define EDITABLE_ICU(icu) ((icu->flag & IPO_PROTECT)==0) #define SEL_ICU(icu) (icu->flag & IPO_SELECT) +#define EXPANDED_GPD(gpd) (gpd->flag & GP_DATA_EXPAND) + #define EDITABLE_GPL(gpl) ((gpl->flag & GP_LAYER_LOCKED)==0) #define SEL_GPL(gpl) ((gpl->flag & GP_LAYER_ACTIVE) || (gpl->flag & GP_LAYER_SELECT)) @@ -185,7 +189,7 @@ void action_remove_localmarkers(struct bAction *act); /* Grease-Pencil Data */ void gplayer_make_cfra_list(struct bGPDlayer *gpl, ListBase *elems, short onlysel); -void deselect_gpencil_layers(struct bGPdata *gpd, short select_mode); +void deselect_gpencil_layers(void *data, short select_mode); short is_gplayer_frame_selected(struct bGPDlayer *gpl); void set_gplayer_frame_selection(struct bGPDlayer *gpl, short mode); @@ -204,7 +208,7 @@ void mirror_gplayer_frames(struct bGPDlayer *gpl, short mode); struct Key *get_action_mesh_key(void); int get_nearest_key_num(struct Key *key, short *mval, float *x); -void *get_nearest_act_channel(short mval[], short *ret_type); +void *get_nearest_act_channel(short mval[], short *ret_type, void **owner); /* Action */ struct bActionChannel *get_hilighted_action_channel(struct bAction* action); diff --git a/source/blender/include/BIF_editarmature.h b/source/blender/include/BIF_editarmature.h index 24112c7f11a..da98eb3d4f1 100644 --- a/source/blender/include/BIF_editarmature.h +++ b/source/blender/include/BIF_editarmature.h @@ -134,6 +134,7 @@ void transform_armature_mirror_update(void); void hide_selected_armature_bones(void); void hide_unselected_armature_bones(void); void show_all_armature_bones(void); +void set_locks_armature_bones(short lock); #define BONESEL_ROOT 0x10000000 #define BONESEL_TIP 0x20000000 diff --git a/source/blender/include/BIF_editview.h b/source/blender/include/BIF_editview.h index 4ed3d0df367..d2c6c56d01a 100644 --- a/source/blender/include/BIF_editview.h +++ b/source/blender/include/BIF_editview.h @@ -34,9 +34,12 @@ struct Base; struct Object; struct Camera; struct View3D; +struct rcti; void arrows_move_cursor(unsigned short event); +void lasso_select_boundbox(struct rcti *rect, short mcords[][2], short moves); int lasso_inside(short mcords[][2], short moves, short sx, short sy); +int lasso_inside_edge(short mcords[][2], short moves, int x0, int y0, int x1, int y1); void borderselect(void); void circle_select(void); void deselectall(void); diff --git a/source/blender/include/BSE_drawview.h b/source/blender/include/BSE_drawview.h index 83031ff3bad..e6f22a4fb67 100644 --- a/source/blender/include/BSE_drawview.h +++ b/source/blender/include/BSE_drawview.h @@ -76,6 +76,7 @@ void inner_play_anim_loop(int init, int mode); int play_anim(int mode); void make_axis_color(char *col, char *col2, char axis); +char *view3d_get_name(struct View3D *v3d); /* SMOOTHVIEW */ void smooth_view(struct View3D *v3d, float *ofs, float *quat, float *dist, float *lens); diff --git a/source/blender/include/butspace.h b/source/blender/include/butspace.h index c0542e3f34c..af74946f0e6 100644 --- a/source/blender/include/butspace.h +++ b/source/blender/include/butspace.h @@ -721,7 +721,8 @@ enum { B_CONSTRAINT_ADD_PYTHON, B_CONSTRAINT_ADD_CLAMPTO, B_CONSTRAINT_ADD_TRANSFORM, - B_CONSTRAINT_INF + B_CONSTRAINT_INF, + B_CONSTRAINT_ADD_SHRINKWRAP }; /* *********************** */ diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index 60050ea010e..3054e038ba2 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -46,7 +46,7 @@ struct ID; typedef struct IDPropertyData { void *pointer; ListBase group; - int val, pad; + int val, val2; /*note, we actually fit a double into these two ints*/ } IDPropertyData; typedef struct IDProperty { @@ -77,6 +77,7 @@ typedef struct IDProperty { /*the ID link property type hasn't been implemented yet, this will require some cleanup of blenkernel, most likely.*/ #define IDP_ID 7 +#define IDP_DOUBLE 8 /*add any future new id property types here.*/ diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index d7969a7379b..2e8d95335cc 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -184,7 +184,6 @@ typedef struct SpaceAction { View2D v2d; bAction *action; /* the currently active action */ - bGPdata *gpd; /* the currently active gpencil block (for editing) */ char mode, autosnap; /* mode: editing context; autosnap: automatic keyframe snapping mode */ short flag, actnr; /* flag: bitmapped settings; */ diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h index ac9761f165d..7444ce95f56 100644 --- a/source/blender/makesdna/DNA_actuator_types.h +++ b/source/blender/makesdna/DNA_actuator_types.h @@ -368,9 +368,9 @@ typedef struct FreeCamera { #define ACT_CONST_DIRPX 1 #define ACT_CONST_DIRPY 2 #define ACT_CONST_DIRPZ 4 -#define ACT_CONST_DIRMX 8 -#define ACT_CONST_DIRMY 16 -#define ACT_CONST_DIRMZ 32 +#define ACT_CONST_DIRNX 8 +#define ACT_CONST_DIRNY 16 +#define ACT_CONST_DIRNZ 32 /* constraint type */ #define ACT_CONST_TYPE_LOC 0 diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h index 673855a6932..0648c535353 100644 --- a/source/blender/makesdna/DNA_armature_types.h +++ b/source/blender/makesdna/DNA_armature_types.h @@ -154,7 +154,8 @@ typedef enum eBone_Flag { BONE_NO_SCALE = (1<<15), /* No parent scale */ BONE_HIDDEN_PG = (1<<16), /* hidden bone when drawing PoseChannels (for ghost drawing) */ BONE_DRAWWIRE = (1<<17), /* bone should be drawn as OB_WIRE, regardless of draw-types of view+armature */ - BONE_NO_CYCLICOFFSET = (1<<18) /* when no parent, bone will not get cyclic offset */ + BONE_NO_CYCLICOFFSET = (1<<18), /* when no parent, bone will not get cyclic offset */ + BONE_EDITMODE_LOCKED = (1<<19), /* bone transforms are locked in EditMode */ } eBone_Flag; #endif diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h index 0fe0dace016..e78855b8de6 100644 --- a/source/blender/makesdna/DNA_constraint_types.h +++ b/source/blender/makesdna/DNA_constraint_types.h @@ -317,6 +317,13 @@ typedef struct bDistLimitConstraint { int pad; } bDistLimitConstraint; +typedef struct bShrinkwrapConstraint { + Object *target; + float dist; /* distance to kept from target */ + short shrinkType; /* shrink type (look on MOD shrinkwrap for values) */ + short pad[5]; +} bShrinkwrapConstraint; + /* ------------------------------------------ */ /* bConstraint->type @@ -344,10 +351,9 @@ typedef enum B_CONSTAINT_TYPES { CONSTRAINT_TYPE_RIGIDBODYJOINT, /* rigidbody constraint */ CONSTRAINT_TYPE_CLAMPTO, /* clampto constraint */ CONSTRAINT_TYPE_TRANSFORM, /* transformation (loc/rot/size -> loc/rot/size) constraint */ + CONSTRAINT_TYPE_SHRINKWRAP, /* shrinkwrap (loc/rot) constraint */ - - /* NOTE: everytime a new constraint is added, update this */ - NUM_CONSTRAINT_TYPES= CONSTRAINT_TYPE_TRANSFORM + NUM_CONSTRAINT_TYPES } B_CONSTRAINT_TYPES; /* bConstraint->flag */ @@ -375,11 +381,13 @@ typedef enum B_CONSTRAINT_SPACETYPES { /* for objects (relative to parent/without parent influence), * for bones (along normals of bone, without parent/restpositions) */ - CONSTRAINT_SPACE_LOCAL, + CONSTRAINT_SPACE_LOCAL, /* = 1 */ /* for posechannels - pose space */ - CONSTRAINT_SPACE_POSE, - /* for posechannels - local with parent */ - CONSTRAINT_SPACE_PARLOCAL, + CONSTRAINT_SPACE_POSE, /* = 2 */ + /* for posechannels - local with parent */ + CONSTRAINT_SPACE_PARLOCAL, /* = 3 */ + /* for files from between 2.43-2.46 (should have been parlocal) */ + CONSTRAINT_SPACE_INVALID, /* = 4. do not exchange for anything! */ } B_CONSTRAINT_SPACETYPES; /* bConstraintChannel.flag */ diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h index 72557145270..6c098e220bb 100644 --- a/source/blender/makesdna/DNA_customdata_types.h +++ b/source/blender/makesdna/DNA_customdata_types.h @@ -71,7 +71,8 @@ typedef struct CustomData { #define CD_MTEXPOLY 15 #define CD_MLOOPUV 16 #define CD_MLOOPCOL 17 -#define CD_NUMTYPES 18 +#define CD_TANGENT 18 +#define CD_NUMTYPES 19 /* Bits for CustomDataMask */ #define CD_MASK_MVERT (1 << CD_MVERT) @@ -92,6 +93,7 @@ typedef struct CustomData { #define CD_MASK_MTEXPOLY (1 << CD_MTEXPOLY) #define CD_MASK_MLOOPUV (1 << CD_MLOOPUV) #define CD_MASK_MLOOPCOL (1 << CD_MLOOPCOL) +#define CD_MASK_TANGENT (1 << CD_TANGENT) /* CustomData.flag */ diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h index eafd886981b..dca4e28688d 100644 --- a/source/blender/makesdna/DNA_gpencil_types.h +++ b/source/blender/makesdna/DNA_gpencil_types.h @@ -59,6 +59,8 @@ typedef struct bGPDstroke { #define GP_STROKE_3DSPACE (1<<0) /* stroke is in 2d-space */ #define GP_STROKE_2DSPACE (1<<1) + /* stroke is an "eraser" stroke */ +#define GP_STROKE_ERASER (1<<2) /* Grease-Pencil Annotations - 'Frame' @@ -123,16 +125,16 @@ typedef struct bGPdata { */ short sbuffer_size; /* number of elements currently in cache */ short sbuffer_sflag; /* flags for stroke that cache represents */ - bGPDspoint *sbuffer; /* stroke buffer (can hold GP_STROKE_BUFFER_MAX) */ + void *sbuffer; /* stroke buffer (can hold GP_STROKE_BUFFER_MAX) */ } bGPdata; /* bGPdata->flag */ - /* draw this datablock's data (not used) */ -#define GP_DATA_DISP (1<<0) + /* don't allow painting to occur at all */ +#define GP_DATA_LMBPLOCK (1<<0) /* show debugging info in viewport (i.e. status print) */ #define GP_DATA_DISPINFO (1<<1) - /* is the block being shown in Action Editor */ -#define GP_DATA_EDITTIME (1<<2) + /* in Action Editor, show as expanded channel */ +#define GP_DATA_EXPAND (1<<2) /* is the block overriding all clicks? */ #define GP_DATA_EDITPAINT (1<<3) /* new strokes are added in viewport space */ diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h index 6d025839ac8..4e427ed733c 100644 --- a/source/blender/makesdna/DNA_meshdata_types.h +++ b/source/blender/makesdna/DNA_meshdata_types.h @@ -228,7 +228,7 @@ typedef struct PartialVisibility { /* mtface->mode */ #define TF_DYNAMIC 1 -#define TF_DEPRECATED 2 +#define TF_ALPHASORT 2 #define TF_TEX 4 #define TF_SHAREDVERT 8 #define TF_LIGHT 16 diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index c4e8cb4925b..85c49a03569 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -466,9 +466,11 @@ extern Object workob; #define OB_LOCK_ROTX 8 #define OB_LOCK_ROTY 16 #define OB_LOCK_ROTZ 32 +#define OB_LOCK_ROT 56 #define OB_LOCK_SCALEX 64 #define OB_LOCK_SCALEY 128 #define OB_LOCK_SCALEZ 256 +#define OB_LOCK_SCALE 448 /* ob->softflag in DNA_object_force.h */ diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index c0b9a6b9590..7bad8ec3b44 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -257,6 +257,7 @@ typedef struct SpeedControlVars { #define SEQ_USE_CROP 131072 #define SEQ_USE_COLOR_BALANCE 262144 #define SEQ_USE_PROXY_CUSTOM_DIR 524288 +#define SEQ_ACTIVE 1048576 #define SEQ_COLOR_BALANCE_INVERSE_GAIN 1 #define SEQ_COLOR_BALANCE_INVERSE_GAMMA 2 diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_material.c b/source/blender/nodes/intern/SHD_nodes/SHD_material.c index bdceb134c0d..9396410f850 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_material.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_material.c @@ -54,7 +54,6 @@ static bNodeSocketType sh_node_material_ext_in[]= { { SOCK_VALUE, 1, "Refl", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, { SOCK_VECTOR, 1, "Normal", 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f}, { SOCK_RGBA, 1, "Mirror", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, - { SOCK_RGBA, 1, "AmbCol", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, { SOCK_VALUE, 1, "Ambient", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, { SOCK_VALUE, 1, "Emit", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, { SOCK_VALUE, 1, "SpecTra", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, @@ -117,8 +116,6 @@ static void node_shader_exec_material(void *data, bNode *node, bNodeStack **in, if (node->type == SH_NODE_MATERIAL_EXT) { if(in[MAT_IN_MIR]->hasinput) nodestack_get_vec(&shi->mirr, SOCK_VECTOR, in[MAT_IN_MIR]); - if(in[MAT_IN_AMBCOL]->hasinput) - nodestack_get_vec(&shi->ambr, SOCK_VECTOR, in[MAT_IN_AMBCOL]); if(in[MAT_IN_AMB]->hasinput) nodestack_get_vec(&shi->amb, SOCK_VALUE, in[MAT_IN_AMB]); if(in[MAT_IN_EMIT]->hasinput) diff --git a/source/blender/nodes/intern/SHD_util.c b/source/blender/nodes/intern/SHD_util.c index c9f58fbce49..f673834d2b7 100644 --- a/source/blender/nodes/intern/SHD_util.c +++ b/source/blender/nodes/intern/SHD_util.c @@ -164,7 +164,7 @@ void nodeShaderSynchronizeID(bNode *node, int copyto) case MAT_IN_MIR: VECCOPY(&ma->mirr, sock->ns.vec); break; case MAT_IN_AMB: - VECCOPY(&ma->ambr, sock->ns.vec); break; + ma->amb= sock->ns.vec[0]; break; case MAT_IN_EMIT: ma->emit= sock->ns.vec[0]; break; case MAT_IN_SPECTRA: @@ -188,7 +188,7 @@ void nodeShaderSynchronizeID(bNode *node, int copyto) case MAT_IN_MIR: VECCOPY(sock->ns.vec, &ma->mirr); break; case MAT_IN_AMB: - VECCOPY(sock->ns.vec, &ma->ambr); break; + sock->ns.vec[0]= ma->amb; break; case MAT_IN_EMIT: sock->ns.vec[0]= ma->emit; break; case MAT_IN_SPECTRA: diff --git a/source/blender/nodes/intern/SHD_util.h b/source/blender/nodes/intern/SHD_util.h index f75802b7c15..bdb2bb3707d 100644 --- a/source/blender/nodes/intern/SHD_util.h +++ b/source/blender/nodes/intern/SHD_util.h @@ -117,13 +117,12 @@ typedef struct ShaderCallData { #define MAT_IN_REFL 2 #define MAT_IN_NORMAL 3 #define MAT_IN_MIR 4 -#define MAT_IN_AMBCOL 5 -#define MAT_IN_AMB 6 -#define MAT_IN_EMIT 7 -#define MAT_IN_SPECTRA 8 -#define MAT_IN_RAY_MIRROR 9 -#define MAT_IN_ALPHA 10 -#define MAT_IN_TRANSLUCENCY 11 +#define MAT_IN_AMB 5 +#define MAT_IN_EMIT 6 +#define MAT_IN_SPECTRA 7 +#define MAT_IN_RAY_MIRROR 8 +#define MAT_IN_ALPHA 9 +#define MAT_IN_TRANSLUCENCY 10 /* output socket defines */ #define MAT_OUT_COLOR 0 diff --git a/source/blender/python/BPY_interface.c b/source/blender/python/BPY_interface.c index 226657655fa..7120e97a62f 100644 --- a/source/blender/python/BPY_interface.c +++ b/source/blender/python/BPY_interface.c @@ -410,12 +410,14 @@ void BPY_rebuild_syspath( void ) mod = PyImport_ImportModule( "sys" ); if (!mod) { printf("error: could not import python sys module. some modules may not import.\n"); + PyGILState_Release(gilstate); return; } if (!bpy_orig_syspath_List) { /* should never happen */ printf("error refershing python path\n"); Py_DECREF(mod); + PyGILState_Release(gilstate); return; } diff --git a/source/blender/python/api2_2x/Armature.c b/source/blender/python/api2_2x/Armature.c index e9dff098773..0db87c00dd2 100644 --- a/source/blender/python/api2_2x/Armature.c +++ b/source/blender/python/api2_2x/Armature.c @@ -1469,6 +1469,8 @@ PyObject *Armature_Init(void) PyConstant_NewInt("BONE_SELECTED", BONE_SELECTED)); PyModule_AddObject(module, "TIP_SELECTED", PyConstant_NewInt("TIP_SELECTED", BONE_TIPSEL)); + PyModule_AddObject(module, "LOCKED_EDIT", + PyConstant_NewInt("LOCKED_EDIT", BONE_EDITMODE_LOCKED)); PyModule_AddObject(module, "OCTAHEDRON", PyConstant_NewInt("OCTAHEDRON", ARM_OCTA)); diff --git a/source/blender/python/api2_2x/Bone.c b/source/blender/python/api2_2x/Bone.c index 84faf416c5f..948eb007803 100644 --- a/source/blender/python/api2_2x/Bone.c +++ b/source/blender/python/api2_2x/Bone.c @@ -368,6 +368,10 @@ static PyObject *EditBone_getOptions(BPy_EditBone *self, void *closure) if (PyList_Append(list, EXPP_GetModuleConstant("Blender.Armature", "TIP_SELECTED")) == -1) goto RuntimeError; + if(self->editbone->flag & BONE_EDITMODE_LOCKED) + if (PyList_Append(list, + EXPP_GetModuleConstant("Blender.Armature", "LOCKED_EDIT")) == -1) + goto RuntimeError; }else{ if(self->flag & BONE_CONNECTED) if (PyList_Append(list, @@ -401,6 +405,10 @@ static PyObject *EditBone_getOptions(BPy_EditBone *self, void *closure) if (PyList_Append(list, EXPP_GetModuleConstant("Blender.Armature", "TIP_SELECTED")) == -1) goto RuntimeError; + if(self->flag & BONE_EDITMODE_LOCKED) + if (PyList_Append(list, + EXPP_GetModuleConstant("Blender.Armature", "LOCKED_EDIT")) == -1) + goto RuntimeError; } return list; @@ -422,7 +430,7 @@ static int EditBone_CheckValidConstant(PyObject *constant) return 0; if (!STREQ3(PyString_AsString(name), "CONNECTED", "HINGE", "NO_DEFORM") && !STREQ3(PyString_AsString(name), "ROOT_SELECTED", "BONE_SELECTED", "TIP_SELECTED") && - !STREQ2(PyString_AsString(name), "MULTIPLY", "HIDDEN_EDIT")) + !STREQ3(PyString_AsString(name), "MULTIPLY", "HIDDEN_EDIT", "LOCKED_EDIT")) return 0; else return 1; diff --git a/source/blender/python/api2_2x/IDProp.c b/source/blender/python/api2_2x/IDProp.c index f60ebf8dee1..4a51619aec4 100644 --- a/source/blender/python/api2_2x/IDProp.c +++ b/source/blender/python/api2_2x/IDProp.c @@ -60,6 +60,8 @@ PyObject *BPy_IDGroup_WrapData( ID *id, IDProperty *prop ) return PyInt_FromLong( (long)prop->data.val ); case IDP_FLOAT: return PyFloat_FromDouble( (double)(*(float*)(&prop->data.val)) ); + case IDP_DOUBLE: + return PyFloat_FromDouble( (*(double*)(&prop->data.val)) ); case IDP_GROUP: /*blegh*/ { @@ -128,7 +130,19 @@ int BPy_IDGroup_SetData(BPy_IDProperty *self, IDProperty *prop, PyObject *value) Py_XDECREF(value); break; } - + case IDP_DOUBLE: + { + double dvalue; + if (!PyNumber_Check(value)) + return EXPP_ReturnIntError(PyExc_TypeError, "expected a float!"); + value = PyNumber_Float(value); + if (!value) + return EXPP_ReturnIntError(PyExc_TypeError, "expected a float!"); + dvalue = (float) PyFloat_AsDouble(value); + *(double*)&self->prop->data.val = dvalue; + Py_XDECREF(value); + break; + } default: return EXPP_ReturnIntError(PyExc_AttributeError, "attempt to set read-only attribute!"); } @@ -204,8 +218,8 @@ char *BPy_IDProperty_Map_ValidateAndCreate(char *name, IDProperty *group, PyObje IDPropertyTemplate val = {0}; if (PyFloat_Check(ob)) { - val.f = (float) PyFloat_AsDouble(ob); - prop = IDP_New(IDP_FLOAT, val, name); + val.d = PyFloat_AsDouble(ob); + prop = IDP_New(IDP_DOUBLE, val, name); } else if (PyInt_Check(ob)) { val.i = (int) PyInt_AsLong(ob); prop = IDP_New(IDP_INT, val, name); @@ -223,7 +237,7 @@ char *BPy_IDProperty_Map_ValidateAndCreate(char *name, IDProperty *group, PyObje val.array.len = PySequence_Length(ob); for (i=0; idata.pointer)[i] = (int)PyInt_AsLong(item); } else { item = PyNumber_Float(item); - ((float*)prop->data.pointer)[i] = (float)PyFloat_AsDouble(item); + ((double*)prop->data.pointer)[i] = (float)PyFloat_AsDouble(item); } Py_XDECREF(item); } @@ -334,6 +348,9 @@ PyObject *BPy_IDGroup_MapDataToPy(IDProperty *prop) case IDP_FLOAT: return PyFloat_FromDouble(*((float*)&prop->data.val)); break; + case IDP_DOUBLE: + return PyFloat_FromDouble(*((double*)&prop->data.val)); + break; case IDP_INT: return PyInt_FromLong( (long)prop->data.val ); break; @@ -347,12 +364,15 @@ PyObject *BPy_IDGroup_MapDataToPy(IDProperty *prop) "PyList_New() failed" ); for (i=0; ilen; i++) { - if (prop->subtype == IDP_FLOAT) + if (prop->subtype == IDP_FLOAT) { PyList_SetItem(seq, i, PyFloat_FromDouble(((float*)prop->data.pointer)[i])); - - else PyList_SetItem(seq, i, - PyInt_FromLong(((int*)prop->data.pointer)[i])); + } else if (prop->subtype == IDP_DOUBLE) { + PyList_SetItem(seq, i, + PyFloat_FromDouble(((double*)prop->data.pointer)[i])); + } else { PyList_SetItem(seq, i, + PyInt_FromLong(((int*)prop->data.pointer)[i])); + } } return seq; } @@ -451,7 +471,7 @@ PyObject *BPy_IDGroup_GetKeys(BPy_IDProperty *self) /*set correct group length*/ self->prop->len = i; - /*free the old list*/ + /*free the list*/ Py_DECREF(seq); /*call self again*/ @@ -688,6 +708,9 @@ PyObject *BPy_IDArray_GetItem(BPy_IDArray *self, int index) case IDP_FLOAT: return PyFloat_FromDouble( (double)(((float*)self->prop->data.pointer)[index])); break; + case IDP_DOUBLE: + return PyFloat_FromDouble( (((double*)self->prop->data.pointer)[index])); + break; case IDP_INT: return PyInt_FromLong( (long)((int*)self->prop->data.pointer)[index] ); break; @@ -700,7 +723,8 @@ int BPy_IDArray_SetItem(BPy_IDArray *self, int index, PyObject *val) { int i; float f; - + double d; + if (index < 0 || index >= self->prop->len) return EXPP_ReturnIntError( PyExc_RuntimeError, "index out of range!"); @@ -717,6 +741,17 @@ int BPy_IDArray_SetItem(BPy_IDArray *self, int index, PyObject *val) ((float*)self->prop->data.pointer)[index] = f; Py_XDECREF(val); break; + case IDP_DOUBLE: + if (!PyNumber_Check(val)) return EXPP_ReturnIntError( PyExc_TypeError, + "expected a float"); + val = PyNumber_Float(val); + if (!val) return EXPP_ReturnIntError( PyExc_TypeError, + "expected a float"); + + d = (double) PyFloat_AsDouble(val); + ((double*)self->prop->data.pointer)[index] = d; + Py_XDECREF(val); + break; case IDP_INT: if (!PyNumber_Check(val)) return EXPP_ReturnIntError( PyExc_TypeError, "expected an int"); diff --git a/source/blender/python/api2_2x/doc/Armature.py b/source/blender/python/api2_2x/doc/Armature.py index 68916af6166..9aceb0105e3 100644 --- a/source/blender/python/api2_2x/doc/Armature.py +++ b/source/blender/python/api2_2x/doc/Armature.py @@ -89,6 +89,8 @@ Example:: @type BONE_SELECTED: Constant @var TIP_SELECTED: Tip of the Bone is selected @type TIP_SELECTED: Constant +@var LOCKED_EDIT: Prevents the bone from being transformed in editmode +@type LOCKED_EDIT: Constant @var OCTAHEDRON: Bones drawn as octahedrons @type OCTAHEDRON: Constant @var STICK: Bones drawn as a line @@ -286,6 +288,7 @@ class Bone: - Armature.ROOT_SELECTED: Selection of root ball of bone - Armature.BONE_SELECTED: Selection of bone - Armature.TIP_SELECTED: Selection of tip ball of bone + - Armature.LOCKED_EDIT: Prevents the bone from being transformed in editmode @type options: List of Constants @ivar subdivision: The number of bone subdivisions. @type subdivision: Int diff --git a/source/blender/python/api2_2x/doc/IDProp.py b/source/blender/python/api2_2x/doc/IDProp.py index 0a0df335fa3..01d5136cd70 100644 --- a/source/blender/python/api2_2x/doc/IDProp.py +++ b/source/blender/python/api2_2x/doc/IDProp.py @@ -18,7 +18,9 @@ class IDGroup: Note that for arrays, the array type defaults to int unless a float is found while scanning the template list; if any floats are found, then the whole - array is float. + array is float. Note that double-precision floating point numbers are used for + python-created float ID properties and arrays (though the internal C api does + support single-precision floats, and the python code will read them). You can also delete properties with the del operator. For example: diff --git a/source/blender/python/api2_2x/doc/Ipo.py b/source/blender/python/api2_2x/doc/Ipo.py index c479926ccf3..d1c72f8cb86 100644 --- a/source/blender/python/api2_2x/doc/Ipo.py +++ b/source/blender/python/api2_2x/doc/Ipo.py @@ -250,7 +250,7 @@ class Ipo: OfsZ, SizeX, SizeY, SizeZ, texR, texG, texB, DefVar, Col, Nor, Var, Disp. 3. Object Ipo: LocX, LocY, LocZ, dLocX, dLocY, dLocZ, RotX, RotY, RotZ, - dRotX, dRotY, dRotZ, SizeX, SizeY, SizeZ, dSizeX, dSizeY, dSizeZ, + dRotX, dRotY, dRotZ, ScaleX, ScaleY, ScaleZ, dScaleX, dScaleY, dScaleZ, Layer, Time, ColR, ColG, ColB, ColA, FStreng, FFall, Damping, RDamp, Perm. 4. Lamp Ipo: Energ, R, G, B, Dist, SpoSi, SpoBl, Quad1, Quad2, HaInt. @@ -289,7 +289,7 @@ class Ipo: OfsZ, SizeX, SizeY, SizeZ, texR, texG, texB, DefVar, Col, Nor, Var, Disp. 3. Object Ipo: LocX, LocY, LocZ, dLocX, dLocY, dLocZ, RotX, RotY, RotZ, - dRotX, dRotY, dRotZ, SizeX, SizeY, SizeZ, dSizeX, dSizeY, dSizeZ, + dRotX, dRotY, dRotZ, ScaleX, ScaleY, ScaleZ, dScaleX, dScaleY, dScaleZ, Layer, Time, ColR, ColG, ColB, ColA, FStreng, FFall, Damping, RDamp, Perm. 4. Lamp Ipo: Energ, R, G, B, Dist, SpoSi, SpoBl, Quad1, Quad2, HaInt. diff --git a/source/blender/python/api2_2x/sceneRender.c b/source/blender/python/api2_2x/sceneRender.c index d382d450970..22e165cbe9f 100644 --- a/source/blender/python/api2_2x/sceneRender.c +++ b/source/blender/python/api2_2x/sceneRender.c @@ -56,6 +56,7 @@ struct View3D; /* keep me up here */ #include "gen_utils.h" #include "gen_library.h" +#include "../BPY_extern.h" /* for BPY_do_all_scripts() */ #include "Scene.h" #include "Group.h" @@ -469,19 +470,20 @@ PyObject *M_Render_EnableDispWin( PyObject * self ) PyObject *RenderData_Render( BPy_RenderData * self ) { Scene *oldsce; + /* unlock to prevent a deadlock when there are pynodes: */ + PyThreadState *tstate = NULL; if (!G.background) { oldsce = G.scene; set_scene( self->scene ); + tstate = PyEval_SaveThread(); BIF_do_render( 0 ); set_scene( oldsce ); } - else { /* background mode (blender -b file.blend -P script) */ + int slink_flag = 0; Render *re= RE_NewRender(G.scene->id.name); - - int end_frame = G.scene->r.efra; if (G.scene != self->scene) @@ -490,11 +492,25 @@ PyObject *RenderData_Render( BPy_RenderData * self ) G.scene->r.efra = G.scene->r.sfra; + if (G.f & G_DOSCRIPTLINKS) { + BPY_do_all_scripts(SCRIPT_RENDER); + G.f &= ~G_DOSCRIPTLINKS; /* avoid FRAMECHANGED events*/ + slink_flag = 1; + } + + tstate = PyEval_SaveThread(); + RE_BlenderAnim(re, G.scene, G.scene->r.sfra, G.scene->r.efra); + if (slink_flag) { + G.f |= G_DOSCRIPTLINKS; + BPY_do_all_scripts(SCRIPT_POSTRENDER); + } + G.scene->r.efra = end_frame; } + PyEval_RestoreThread(tstate); Py_RETURN_NONE; } @@ -565,10 +581,13 @@ PyObject *RenderData_SaveRenderedImage ( BPy_RenderData * self, PyObject *args ) PyObject *RenderData_RenderAnim( BPy_RenderData * self ) { Scene *oldsce; - + /* unlock to prevent a deadlock when there are pynodes: */ + PyThreadState *tstate = NULL; + if (!G.background) { oldsce = G.scene; set_scene( self->scene ); + tstate = PyEval_SaveThread(); BIF_do_render( 1 ); set_scene( oldsce ); } @@ -582,9 +601,18 @@ PyObject *RenderData_RenderAnim( BPy_RenderData * self ) if (G.scene->r.sfra > G.scene->r.efra) return EXPP_ReturnPyObjError (PyExc_RuntimeError, "start frame must be less or equal to end frame"); - + + if (G.f & G_DOSCRIPTLINKS) + BPY_do_all_scripts(SCRIPT_RENDER); + + tstate = PyEval_SaveThread(); RE_BlenderAnim(re, G.scene, G.scene->r.sfra, G.scene->r.efra); + + if (G.f & G_DOSCRIPTLINKS) + BPY_do_all_scripts(SCRIPT_POSTRENDER); } + + PyEval_RestoreThread(tstate); Py_RETURN_NONE; } diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 252350ea72b..31f4596c264 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -2013,7 +2013,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco uiBlockBeginAlign(block); uiDefButF(block, NUM, B_MODIFIER_RECALC, "Width: ", lx, (cy -= 19), buttonWidth, 19, &bmd->value, - 0.0, 0.5, 5, 2, + 0.0, 0.5, 5, 4, "Bevel value/amount"); /*uiDefButI(block, NUM, B_MODIFIER_RECALC, "Recurs", lx, (cy -= 19), buttonWidth, 19, &bmd->res, @@ -4518,11 +4518,12 @@ static void editing_panel_armature_bones(Object *ob, bArmature *arm) uiDefButF(block, NUM,B_ARM_RECALCDATA, "Weight:", 225, by-19,105, 18, &curBone->weight, 0.0F, 1000.0F, 10.0F, 0.0F, "Bone deformation weight"); /* bone types */ - uiDefButBitI(block, TOG, BONE_HINGE, B_ARM_RECALCDATA, "Hinge", -10,by-38,80,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Don't inherit rotation or scale from parent Bone"); - uiDefButBitI(block, TOG, BONE_NO_SCALE, B_ARM_RECALCDATA, "S", 70,by-38,20,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Don't inherit scale from parent Bone"); - uiDefButBitI(block, TOGN, BONE_NO_DEFORM, B_ARM_RECALCDATA, "Deform", 90, by-38, 80, 18, &curBone->flag, 0.0, 0.0, 0.0, 0.0, "Indicate if Bone deforms geometry"); - uiDefButBitI(block, TOG, BONE_MULT_VG_ENV, B_ARM_RECALCDATA, "Mult", 170,by-38,80,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Multiply Bone Envelope with VertexGroup"); - uiDefButBitI(block, TOG, BONE_HIDDEN_A, REDRAWVIEW3D, "Hide", 250,by-38,80,18, &curBone->flag, 0, 0, 0, 0, "Toggles display of this bone in Edit Mode"); + uiDefButBitI(block, TOG, BONE_HINGE, B_ARM_RECALCDATA, "Hinge", -10,by-38,60,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Don't inherit rotation or scale from parent Bone"); + uiDefButBitI(block, TOG, BONE_NO_SCALE, B_ARM_RECALCDATA, "S", 50,by-38,20,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Don't inherit scale from parent Bone"); + uiDefButBitI(block, TOGN, BONE_NO_DEFORM, B_ARM_RECALCDATA, "Deform", 70, by-38, 80, 18, &curBone->flag, 0.0, 0.0, 0.0, 0.0, "Indicate if Bone deforms geometry"); + uiDefButBitI(block, TOG, BONE_MULT_VG_ENV, B_ARM_RECALCDATA, "Mult", 150,by-38,60,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Multiply Bone Envelope with VertexGroup"); + uiDefButBitI(block, TOG, BONE_HIDDEN_A, REDRAWVIEW3D, "Hide", 210,by-38,60,18, &curBone->flag, 0, 0, 0, 0, "Toggles display of this bone in Edit Mode"); + uiDefButBitI(block, TOG, BONE_EDITMODE_LOCKED, REDRAWVIEW3D, "Lock", 270,by-38,60,18, &curBone->flag, 0, 0, 0, 0, "Prevents this bone from being transformed in Edit Mode"); /* layers */ uiBlockBeginAlign(block); @@ -6335,6 +6336,7 @@ static void editing_panel_mesh_texface(void) uiDefButBitS(block, TOG, TF_BILLBOARD2, B_TFACE_BILLB, "Billboard",660,110,60,19, &tf->mode, 0, 0, 0, 0, "Billboard with Z-axis constraint"); uiDefButBitS(block, TOG, TF_SHADOW, REDRAWVIEW3D, "Shadow", 720,110,60,19, &tf->mode, 0, 0, 0, 0, "Face is used for shadow"); uiDefButBitS(block, TOG, TF_BMFONT, REDRAWVIEW3D, "Text", 780,110,60,19, &tf->mode, 0, 0, 0, 0, "Enable bitmap text on face"); + uiDefButBitS(block, TOG, TF_ALPHASORT, REDRAWVIEW3D, "Sort", 840,110,60,19, &tf->mode, 0, 0, 0, 0, "Enable sorting of faces for correct alpha drawing (slow, use Clip Alpha instead when possible)"); uiBlockBeginAlign(block); uiBlockSetCol(block, TH_BUT_SETTING1); diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index 441d00ffc30..5cf1958678e 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -1654,53 +1654,66 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh wval = (width-100)/3; if (oa->type == ACT_OBJECT_NORMAL) { - ysize= 175; - + if ( ob->gameflag & OB_DYNAMIC ) + { + ysize= 175; + } + else + { + ysize= 72; + } + glRects(xco, yco-ysize, xco+width, yco); uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - uiDefBut(block, LABEL, 0, "Force", xco, yco-45, 55, 19, NULL, 0, 0, 0, 0, "Sets the force"); - uiDefButF(block, NUM, 0, "", xco+45, yco-45, wval, 19, oa->forceloc, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+wval, yco-45, wval, 19, oa->forceloc+1, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-45, wval, 19, oa->forceloc+2, -10000.0, 10000.0, 10, 0, ""); + uiDefBut(block, LABEL, 0, "Loc", xco, yco-45, 45, 19, NULL, 0, 0, 0, 0, "Sets the location"); + uiDefButF(block, NUM, 0, "", xco+45, yco-45, wval, 19, oa->dloc, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-45, wval, 19, oa->dloc+1, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-45, wval, 19, oa->dloc+2, -10000.0, 10000.0, 10, 0, ""); - uiDefBut(block, LABEL, 0, "Torque", xco, yco-64, 55, 19, NULL, 0, 0, 0, 0, "Sets the torque"); - uiDefButF(block, NUM, 0, "", xco+45, yco-64, wval, 19, oa->forcerot, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+wval, yco-64, wval, 19, oa->forcerot+1, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-64, wval, 19, oa->forcerot+2, -10000.0, 10000.0, 10, 0, ""); - - uiDefBut(block, LABEL, 0, "dLoc", xco, yco-87, 45, 19, NULL, 0, 0, 0, 0, "Sets the dLoc"); - uiDefButF(block, NUM, 0, "", xco+45, yco-87, wval, 19, oa->dloc, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+wval, yco-87, wval, 19, oa->dloc+1, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-87, wval, 19, oa->dloc+2, -10000.0, 10000.0, 10, 0, ""); - - uiDefBut(block, LABEL, 0, "dRot", xco, yco-106, 45, 19, NULL, 0, 0, 0, 0, "Sets the dRot"); - uiDefButF(block, NUM, 0, "", xco+45, yco-106, wval, 19, oa->drot, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+wval, yco-106, wval, 19, oa->drot+1, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-106, wval, 19, oa->drot+2, -10000.0, 10000.0, 10, 0, ""); - - uiDefBut(block, LABEL, 0, "linV", xco, yco-129, 45, 19, NULL, 0, 0, 0, 0, "Sets the linear velocity"); - uiDefButF(block, NUM, 0, "", xco+45, yco-129, wval, 19, oa->linearvelocity, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+wval, yco-129, wval, 19, oa->linearvelocity+1, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-129, wval, 19, oa->linearvelocity+2, -10000.0, 10000.0, 10, 0, ""); - - uiDefBut(block, LABEL, 0, "angV", xco, yco-148, 45, 19, NULL, 0, 0, 0, 0, "Sets the angular velocity"); - uiDefButF(block, NUM, 0, "", xco+45, yco-148, wval, 19, oa->angularvelocity, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+wval, yco-148, wval, 19, oa->angularvelocity+1, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-148, wval, 19, oa->angularvelocity+2, -10000.0, 10000.0, 10, 0, ""); - - uiDefBut(block, LABEL, 0, "damp", xco, yco-171, 45, 19, NULL, 0, 0, 0, 0, "Number of frames to reach the target velocity"); - uiDefButS(block, NUM, 0, "", xco+45, yco-171, wval, 19, &oa->damping, 0.0, 1000.0, 100, 0, ""); + uiDefBut(block, LABEL, 0, "Rot", xco, yco-64, 45, 19, NULL, 0, 0, 0, 0, "Sets the rotation"); + uiDefButF(block, NUM, 0, "", xco+45, yco-64, wval, 19, oa->drot, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-64, wval, 19, oa->drot+1, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-64, wval, 19, oa->drot+2, -10000.0, 10000.0, 10, 0, ""); - uiDefButBitS(block, TOG, ACT_FORCE_LOCAL, 0, "L", xco+45+3*wval, yco-45, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); - uiDefButBitS(block, TOG, ACT_TORQUE_LOCAL, 0, "L", xco+45+3*wval, yco-64, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); - uiDefButBitS(block, TOG, ACT_DLOC_LOCAL, 0, "L", xco+45+3*wval, yco-87, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); - uiDefButBitS(block, TOG, ACT_DROT_LOCAL, 0, "L", xco+45+3*wval, yco-106, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); - uiDefButBitS(block, TOG, ACT_LIN_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-129, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); - uiDefButBitS(block, TOG, ACT_ANG_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-148, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); + uiDefButBitS(block, TOG, ACT_DLOC_LOCAL, 0, "L", xco+45+3*wval, yco-45, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); + uiDefButBitS(block, TOG, ACT_DROT_LOCAL, 0, "L", xco+45+3*wval, yco-64, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); + + if ( ob->gameflag & OB_DYNAMIC ) + { + uiDefBut(block, LABEL, 0, "Force", xco, yco-87, 55, 19, NULL, 0, 0, 0, 0, "Sets the force"); + uiDefButF(block, NUM, 0, "", xco+45, yco-87, wval, 19, oa->forceloc, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-87, wval, 19, oa->forceloc+1, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-87, wval, 19, oa->forceloc+2, -10000.0, 10000.0, 10, 0, ""); - uiDefButBitS(block, TOG, ACT_ADD_LIN_VEL, 0, "add",xco+45+3*wval+15, yco-129, 35, 19, &oa->flag, 0.0, 0.0, 0, 0, "Toggles between ADD and SET linV"); + uiDefBut(block, LABEL, 0, "Torque", xco, yco-106, 55, 19, NULL, 0, 0, 0, 0, "Sets the torque"); + uiDefButF(block, NUM, 0, "", xco+45, yco-106, wval, 19, oa->forcerot, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-106, wval, 19, oa->forcerot+1, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-6106, wval, 19, oa->forcerot+2, -10000.0, 10000.0, 10, 0, ""); + } + if ( ob->gameflag & OB_DYNAMIC ) + { + uiDefBut(block, LABEL, 0, "LinV", xco, yco-129, 45, 19, NULL, 0, 0, 0, 0, "Sets the linear velocity"); + uiDefButF(block, NUM, 0, "", xco+45, yco-129, wval, 19, oa->linearvelocity, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-129, wval, 19, oa->linearvelocity+1, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-129, wval, 19, oa->linearvelocity+2, -10000.0, 10000.0, 10, 0, ""); + + uiDefBut(block, LABEL, 0, "AngV", xco, yco-148, 45, 19, NULL, 0, 0, 0, 0, "Sets the angular velocity"); + uiDefButF(block, NUM, 0, "", xco+45, yco-148, wval, 19, oa->angularvelocity, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-148, wval, 19, oa->angularvelocity+1, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-148, wval, 19, oa->angularvelocity+2, -10000.0, 10000.0, 10, 0, ""); + + uiDefBut(block, LABEL, 0, "Damp", xco, yco-171, 45, 19, NULL, 0, 0, 0, 0, "Number of frames to reach the target velocity"); + uiDefButS(block, NUM, 0, "", xco+45, yco-171, wval, 19, &oa->damping, 0.0, 1000.0, 100, 0, ""); + + uiDefButBitS(block, TOG, ACT_FORCE_LOCAL, 0, "L", xco+45+3*wval, yco-87, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); + uiDefButBitS(block, TOG, ACT_TORQUE_LOCAL, 0, "L", xco+45+3*wval, yco-106, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); + uiDefButBitS(block, TOG, ACT_LIN_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-129, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); + uiDefButBitS(block, TOG, ACT_ANG_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-148, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); + + uiDefButBitS(block, TOG, ACT_ADD_LIN_VEL, 0, "add",xco+45+3*wval+15, yco-129, 35, 19, &oa->flag, 0.0, 0.0, 0, 0, "Toggles between ADD and SET linV"); + } } else if (oa->type == ACT_OBJECT_SERVO) { ysize= 172; @@ -2062,7 +2075,7 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh coa->time = 0; uiDefButS(block, MENU, 1, str, xco+10, yco-65, 70, 19, &coa->flag, 0.0, 0.0, 0, 0, ""); - uiDefButS(block, NUM, 0, "Damp:", xco+10, yco-45, 70, 19, &coa->damp, 0.0, 100.0, 0, 0, ""); + uiDefButS(block, NUM, 0, "damp", xco+10, yco-45, 70, 19, &coa->damp, 0.0, 100.0, 0, 0, "Damping factor: time constant (in frame) of low pass filter"); uiDefBut(block, LABEL, 0, "Min", xco+80, yco-45, (width-90)/2, 19, NULL, 0.0, 0.0, 0, 0, ""); uiDefBut(block, LABEL, 0, "Max", xco+80+(width-90)/2, yco-45, (width-90)/2, 19, NULL, 0.0, 0.0, 0, 0, ""); @@ -2084,12 +2097,12 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh str= "Direction %t|None %x0|X axis %x1|Y axis %x2|Z axis %x4|-X axis %x8|-Y axis %x16|-Z axis %x32"; uiDefButS(block, MENU, B_REDR, str, xco+10, yco-65, 70, 19, &coa->mode, 0.0, 0.0, 0, 0, "Set the direction of the ray"); - uiDefButS(block, NUM, 0, "Damp:", xco+10, yco-45, 70, 19, &coa->damp, 0.0, 100.0, 0, 0, ""); + uiDefButS(block, NUM, 0, "damp", xco+10, yco-45, 70, 19, &coa->damp, 0.0, 100.0, 0, 0, "Damping factor: time constant (in frame) of low pass filter"); uiDefBut(block, LABEL, 0, "Range", xco+80, yco-45, (width-115)/2, 19, NULL, 0.0, 0.0, 0, 0, "Set the maximum length of ray"); uiDefButBitS(block, TOG, ACT_CONST_DISTANCE, B_REDR, "Dist", xco+80+(width-115)/2, yco-45, (width-115)/2, 19, &coa->flag, 0.0, 0.0, 0, 0, "Force distance of object to point of impact of ray"); - if(coa->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRMX)) fp= coa->minloc; - else if(coa->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRMY)) fp= coa->minloc+1; + if(coa->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= coa->minloc; + else if(coa->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= coa->minloc+1; else fp= coa->minloc+2; uiDefButF(block, NUM, 0, "", xco+80, yco-65, (width-115)/2, 19, fp+3, 0.0, 2000.0, 10, 0, "Maximum length of ray"); @@ -2124,7 +2137,7 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh str= "Direction %t|None %x0|X axis %x1|Y axis %x2|Z axis %x4"; uiDefButS(block, MENU, B_REDR, str, xco+10, yco-65, 70, 19, &coa->mode, 0.0, 0.0, 0, 0, "Select the axis to be aligned along the reference direction"); - uiDefButS(block, NUM, 0, "Damp:", xco+10, yco-45, 70, 19, &coa->damp, 0.0, 100.0, 0, 0, ""); + uiDefButS(block, NUM, 0, "damp", xco+10, yco-45, 70, 19, &coa->damp, 0.0, 100.0, 0, 0, "Damping factor: time constant (in frame) of low pass filter"); uiDefBut(block, LABEL, 0, "X", xco+80, yco-45, (width-115)/3, 19, NULL, 0.0, 0.0, 0, 0, ""); uiDefBut(block, LABEL, 0, "Y", xco+80+(width-115)/3, yco-45, (width-115)/3, 19, NULL, 0.0, 0.0, 0, 0, ""); uiDefBut(block, LABEL, 0, "Z", xco+80+2*(width-115)/3, yco-45, (width-115)/3, 19, NULL, 0.0, 0.0, 0, 0, ""); @@ -2133,7 +2146,9 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh uiDefButF(block, NUM, 0, "", xco+80+(width-115)/3, yco-65, (width-115)/3, 19, &coa->maxrot[1], -2000.0, 2000.0, 10, 0, "Y component of reference direction"); uiDefButF(block, NUM, 0, "", xco+80+2*(width-115)/3, yco-65, (width-115)/3, 19, &coa->maxrot[2], -2000.0, 2000.0, 10, 0, "Z component of reference direction"); - uiDefButS(block, NUM, 0, "time", xco+10, yco-84, 70+(width-115)/3, 19, &(coa->time), 0.0, 1000.0, 0, 0, "Maximum activation time in frame, 0 for unlimited"); + uiDefButS(block, NUM, 0, "time", xco+10, yco-84, 70, 19, &(coa->time), 0.0, 1000.0, 0, 0, "Maximum activation time in frame, 0 for unlimited"); + uiDefButF(block, NUM, 0, "min", xco+80, yco-84, (width-115)/2, 19, &(coa->minloc[0]), 0.0, 180.0, 10, 1, "Minimum angle (in degree) to maintain with target direction. No correction is done if angle with target direction is between min and max"); + uiDefButF(block, NUM, 0, "max", xco+80+(width-115)/2, yco-84, (width-115)/2, 19, &(coa->maxloc[0]), 0.0, 180.0, 10, 1, "Maximum angle (in degree) allowed with target direction. No correction is done if angle with target direction is between min and max"); } str= "Constraint Type %t|Location %x0|Distance %x1|Orientation %x2"; but = uiDefButS(block, MENU, B_REDR, str, xco+40, yco-23, (width-80), 19, &coa->type, 0.0, 0.0, 0, 0, ""); diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index ebe770c89e7..c2643aa479b 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -480,7 +480,7 @@ static void draw_constraint_spaceselect (uiBlock *block, bConstraint *con, short /* Target-Space */ if (target == 1) { - uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Target Space %t|World Space %x0|Pose Space %x3|Local with Parent %x4|Local Space %x1", + uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Target Space %t|World Space %x0|Pose Space %x2|Local with Parent %x3|Local Space %x1", tarx, yco, bwidth, 18, &con->tarspace, 0, 0, 0, 0, "Choose space that target is evaluated in"); } else if (target == 0) { @@ -490,7 +490,7 @@ static void draw_constraint_spaceselect (uiBlock *block, bConstraint *con, short /* Owner-Space */ if (owner == 1) { - uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Owner Space %t|World Space %x0|Pose Space %x3|Local with Parent %x4|Local Space %x1", + uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Owner Space %t|World Space %x0|Pose Space %x2|Local with Parent %x3|Local Space %x1", ownx, yco, bwidth, 18, &con->ownspace, 0, 0, 0, 0, "Choose space that owner is evaluated in"); } else if (owner == 0) { @@ -1739,6 +1739,16 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); } break; + + case CONSTRAINT_TYPE_SHRINKWRAP: + { + bShrinkwrapConstraint *data = con->data; + + height = 44; + uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->target, "Target Object"); + uiDefButF(block, NUM, B_CONSTRAINT_TEST, "dist", *xco+120, *yco-44, 135, 18, &data->dist, 0.0f, 100.0f, 1.0f, 0.0f, "Distance to target"); + } + break; default: height = 0; break; @@ -1800,6 +1810,7 @@ static uiBlock *add_constraintmenu(void *arg_unused) uiDefBut(block, BUTM, B_CONSTRAINT_ADD_MINMAX, "Floor", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); uiDefBut(block, BUTM, B_CONSTRAINT_ADD_LOCKTRACK, "Locked Track", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); uiDefBut(block, BUTM, B_CONSTRAINT_ADD_FOLLOWPATH, "Follow Path", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiDefBut(block, BUTM, B_CONSTRAINT_ADD_SHRINKWRAP, "Shrinkwrap" , 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); uiDefBut(block, SEPR, 0, "", 0, yco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, ""); @@ -2035,6 +2046,14 @@ void do_constraintbuts(unsigned short event) BIF_undo_push("Add constraint"); } break; + case B_CONSTRAINT_ADD_SHRINKWRAP: + { + con = add_new_constraint(CONSTRAINT_TYPE_SHRINKWRAP); + add_constraint_to_active(ob, con); + + BIF_undo_push("Add constraint"); + } + break; default: break; diff --git a/source/blender/src/drawaction.c b/source/blender/src/drawaction.c index 9b1af3f1a06..0782ccfc7ee 100644 --- a/source/blender/src/drawaction.c +++ b/source/blender/src/drawaction.c @@ -89,6 +89,7 @@ #include "BSE_drawnla.h" #include "BSE_drawipo.h" +#include "BSE_drawview.h" #include "BSE_editaction_types.h" #include "BSE_editipo.h" #include "BSE_time.h" @@ -467,7 +468,7 @@ static void draw_channel_names(void) bActionGroup *grp = NULL; short indent= 0, offset= 0, sel= 0, group=0; int expand= -1, protect = -1, special= -1, mute = -1; - char name[32]; + char name[64]; /* determine what needs to be drawn */ switch (ale->type) { @@ -625,6 +626,72 @@ static void draw_channel_names(void) sprintf(name, "Constraint"); } break; + case ACTTYPE_GPDATABLOCK: /* gpencil datablock */ + { + bGPdata *gpd = (bGPdata *)ale->data; + ScrArea *sa = (ScrArea *)ale->owner; + + indent = 0; + group= 3; + + /* only show expand if there are any channels */ + if (gpd->layers.first) { + if (gpd->flag & GP_DATA_EXPAND) + expand = ICON_TRIA_DOWN; + else + expand = ICON_TRIA_RIGHT; + } + + switch (sa->spacetype) { + case SPACE_VIEW3D: + { + /* this shouldn't cause any overflow... */ + sprintf(name, "3DView: %s", view3d_get_name(sa->spacedata.first)); + special= ICON_VIEW3D; + } + break; + case SPACE_NODE: + { + SpaceNode *snode= sa->spacedata.first; + char treetype[12]; + + if (snode->treetype == 1) + sprintf(treetype, "Composite"); + else + sprintf(treetype, "Material"); + sprintf(name, "Nodes: %s", treetype); + + special= ICON_NODE; + } + break; + case SPACE_SEQ: + { + SpaceSeq *sseq= sa->spacedata.first; + char imgpreview[10]; + + switch (sseq->mainb) { + case 1: sprintf(imgpreview, "Image..."); break; + case 2: sprintf(imgpreview, "Luma..."); break; + case 3: sprintf(imgpreview, "Chroma..."); break; + case 4: sprintf(imgpreview, "Histogram"); break; + + default: sprintf(imgpreview, "Sequence"); break; + } + sprintf(name, "Sequencer: %s", imgpreview); + + special= ICON_SEQUENCE; + } + break; + + default: + { + sprintf(name, ""); + special= -1; + } + break; + } + } + break; case ACTTYPE_GPLAYER: /* gpencil layer */ { bGPDlayer *gpl = (bGPDlayer *)ale->data; @@ -632,7 +699,8 @@ static void draw_channel_names(void) indent = 0; special = -1; expand = -1; - + group = 1; + if (EDITABLE_GPL(gpl)) protect = ICON_UNLOCKED; else @@ -651,8 +719,19 @@ static void draw_channel_names(void) /* now, start drawing based on this information */ /* draw backing strip behind channel name */ - if (group == 2) { - /* only for group-channels */ + if (group == 3) { + /* only for gp-data channels */ + if (ale->owner == curarea) // fixme... currently useless + BIF_ThemeColorShade(TH_GROUP_ACTIVE, 10); + else + BIF_ThemeColorShade(TH_GROUP, 20); + uiSetRoundBox((expand == ICON_TRIA_DOWN)? (1):(1|8)); + gl_round_box(GL_POLYGON, x, yminc, (float)NAMEWIDTH, ymaxc, 8); + + offset = 0; + } + else if (group == 2) { + /* only for action group channels */ if (ale->flag & AGRP_ACTIVE) BIF_ThemeColorShade(TH_GROUP_ACTIVE, 10); else @@ -698,13 +777,19 @@ static void draw_channel_names(void) offset += 17; } - /* draw special icon indicating type of ipo-blocktype? - * only for expand widgets for Ipo and Constraint Channels - */ - if (special > 0) { - offset = (group) ? 29 : 24; - BIF_icon_draw(x+offset, yminc, special); - offset += 17; + /* draw special icon indicating certain data-types */ + if (special > -1) { + if (group == 3) { + /* for gpdatablock channels */ + BIF_icon_draw(x+offset, yminc, special); + offset += 17; + } + else { + /* for ipo/constraint channels */ + offset = (group) ? 29 : 24; + BIF_icon_draw(x+offset, yminc, special); + offset += 17; + } } /* draw name */ @@ -720,13 +805,13 @@ static void draw_channel_names(void) offset = 0; /* draw protect 'lock' */ - if (protect > 0) { + if (protect > -1) { offset = 16; BIF_icon_draw(NAMEWIDTH-offset, yminc, protect); } /* draw mute 'eye' */ - if (mute > 0) { + if (mute > -1) { offset += 16; BIF_icon_draw(NAMEWIDTH-offset, yminc, mute); } @@ -1148,12 +1233,6 @@ void drawactionspace(ScrArea *sa, void *spacedata) G.saction->action= NULL; } break; - case SACTCONT_GPENCIL: - { - /* this searching could be slow (so users should pin after this is found) */ - G.saction->gpd= gpencil_data_getetime(G.curscreen); - } - break; } } diff --git a/source/blender/src/drawgpencil.c b/source/blender/src/drawgpencil.c index 55d0464b9af..733310bfda7 100644 --- a/source/blender/src/drawgpencil.c +++ b/source/blender/src/drawgpencil.c @@ -94,6 +94,7 @@ void gp_ui_activelayer_cb (void *gpd, void *gpl) { gpencil_layer_setactive(gpd, gpl); + allqueue(REDRAWACTION, 0); } /* rename layer and set active */ @@ -104,18 +105,21 @@ void gp_ui_renamelayer_cb (void *gpd_arg, void *gpl_arg) BLI_uniquename(&gpd->layers, gpl, "GP_Layer", offsetof(bGPDlayer, info[0]), 128); gpencil_layer_setactive(gpd, gpl); + allqueue(REDRAWACTION, 0); } /* add a new layer */ void gp_ui_addlayer_cb (void *gpd, void *dummy) { gpencil_layer_addnew(gpd); + allqueue(REDRAWACTION, 0); } /* delete active layer */ void gp_ui_dellayer_cb (void *gpd, void *dummy) { gpencil_layer_delactive(gpd); + allqueue(REDRAWACTION, 0); } /* delete last stroke of active layer */ @@ -134,28 +138,17 @@ void gp_ui_delframe_cb (void *gpd, void *gpl) gpencil_layer_setactive(gpd, gpl); gpencil_layer_delframe(gpl, gpf); -} - - -/* set this set of gpencil data for editing in action editor */ -void gp_ui_dotime_cb (void *gpd_arg, void *dummy) -{ - bGPdata *gpd= (bGPdata *)gpd_arg; - /* check if setting or clearing (note: setting was just set...) */ - if (gpd->flag & GP_DATA_EDITTIME) - gpencil_data_setetime(G.curscreen, gpd); - else - gpencil_data_setetime(G.curscreen, NULL); + allqueue(REDRAWACTION, 0); } - /* ------- Drawing Code ------- */ /* draw the controls for a given layer */ static void gp_drawui_layer (uiBlock *block, bGPdata *gpd, bGPDlayer *gpl, short *xco, short *yco) { uiBut *but; + short active= (gpl->flag & GP_LAYER_ACTIVE); short width= 314; short height; int rb_col; @@ -168,40 +161,41 @@ static void gp_drawui_layer (uiBlock *block, bGPdata *gpd, bGPDlayer *gpl, short uiBlockSetEmboss(block, UI_EMBOSSN); /* rounded header */ - rb_col= (gpl->flag & GP_LAYER_ACTIVE)?50:20; - uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-8, *yco-2, width, 24, NULL, 5.0, 0.0, 15 , rb_col-20, ""); + if (active) uiBlockSetCol(block, TH_BUT_ACTION); + rb_col= (active)?-20:20; + uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-8, *yco-2, width, 24, NULL, 5.0, 0.0, 15 , rb_col-20, ""); + if (active) uiBlockSetCol(block, TH_AUTO); /* lock toggle */ uiDefIconButBitI(block, ICONTOG, GP_LAYER_LOCKED, B_REDR, ICON_UNLOCKED, *xco-7, *yco-1, 20, 20, &gpl->flag, 0.0, 0.0, 0, 0, "Layer cannot be modified"); } - /* when layer is locked or hidden, don't draw the rest of its settings */ + /* when layer is locked or hidden, only draw header */ if (gpl->flag & (GP_LAYER_LOCKED|GP_LAYER_HIDE)) { + char name[256]; /* gpl->info is 128, but we need space for 'locked/hidden' as well */ + height= 26; - /* draw rest of header */ - { - /* visibility button (only if hidden but not locked!) */ - if ((gpl->flag & GP_LAYER_HIDE) && !(gpl->flag & GP_LAYER_LOCKED)) - uiDefIconButBitI(block, ICONTOG, GP_LAYER_HIDE, B_REDR, ICON_RESTRICT_VIEW_OFF, *xco+12, *yco-1, 20, 20, &gpl->flag, 0.0, 0.0, 0, 0, "Visibility of layer"); - - /* name */ - uiDefBut(block, LABEL, 1, gpl->info, *xco+35, *yco, 240, 20, NULL, 0.0, 0.0, 0, 0, "Short description of what this layer is for (optional)"); - } + /* visibility button (only if hidden but not locked!) */ + if ((gpl->flag & GP_LAYER_HIDE) && !(gpl->flag & GP_LAYER_LOCKED)) + uiDefIconButBitI(block, ICONTOG, GP_LAYER_HIDE, B_REDR, ICON_RESTRICT_VIEW_OFF, *xco+12, *yco-1, 20, 20, &gpl->flag, 0.0, 0.0, 0, 0, "Visibility of layer"); - /* draw backdrop */ - uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-8, *yco-height, width, height-1, NULL, 5.0, 0.0, 12, rb_col, ""); - - /* draw settings... (i.e. just warning for this one) */ + /* name */ if (gpl->flag & GP_LAYER_HIDE) - uiDefBut(block, LABEL, 1, "Grease Pencil Layer Hidden", *xco+60, *yco-26, 205, 20, NULL, 0.0, 0.0, 0, 0, ""); + sprintf(name, "%s (Hidden)", gpl->info); else - uiDefBut(block, LABEL, 1, "Grease Pencil Layer Locked", *xco+60, *yco-26, 205, 20, NULL, 0.0, 0.0, 0, 0, ""); + sprintf(name, "%s (Locked)", gpl->info); + uiDefBut(block, LABEL, 1, name, *xco+35, *yco, 240, 20, NULL, 0.0, 0.0, 0, 0, "Short description of what this layer is for (optional)"); + /* delete button (only if hidden but not locked!) */ + if ((gpl->flag & GP_LAYER_HIDE) & !(gpl->flag & GP_LAYER_LOCKED)) { + but= uiDefIconBut(block, BUT, B_REDR, ICON_X, *xco+(width-30), *yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer"); + uiButSetFunc(but, gp_ui_dellayer_cb, gpd, NULL); + } uiBlockSetEmboss(block, UI_EMBOSS); } else { - height= 100; + height= 97; /* draw rest of header */ { @@ -211,7 +205,7 @@ static void gp_drawui_layer (uiBlock *block, bGPdata *gpd, bGPDlayer *gpl, short uiBlockSetEmboss(block, UI_EMBOSS); /* name */ - but= uiDefButC(block, TEX, B_REDR, "Info:", *xco+35, *yco, 240, 20, gpl->info, 0, 127, 0, 0, "Short description of what this layer is for (optional)"); + but= uiDefButC(block, TEX, B_REDR, "Info:", *xco+36, *yco, 240, 19, gpl->info, 0, 127, 0, 0, "Short description of what this layer is for (optional)"); uiButSetFunc(but, gp_ui_renamelayer_cb, gpd, gpl); /* delete 'button' */ @@ -224,7 +218,9 @@ static void gp_drawui_layer (uiBlock *block, bGPdata *gpd, bGPDlayer *gpl, short } /* draw backdrop */ - uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-8, *yco-height, width, height-1, NULL, 5.0, 0.0, 12, rb_col, ""); + if (active) uiBlockSetCol(block, TH_BUT_ACTION); + uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-8, *yco-height, width, height-1, NULL, 5.0, 0.0, 12, rb_col, ""); + if (active) uiBlockSetCol(block, TH_AUTO); /* draw settings */ { @@ -237,21 +233,25 @@ static void gp_drawui_layer (uiBlock *block, bGPdata *gpd, bGPDlayer *gpl, short /* stroke thickness */ uiDefButS(block, NUMSLI, B_REDR, "Thickness:", *xco, *yco-75, 150, 20, &gpl->thickness, 1, 10, 0, 0, "Thickness of strokes (in pixels)"); + /* debugging options */ + if (G.f & G_DEBUG) { + uiDefButBitI(block, TOG, GP_LAYER_DRAWDEBUG, B_REDR, "Show Points", *xco, *yco-95, 150, 20, &gpl->flag, 0, 0, 0, 0, "Show points which form the strokes"); + } /* onion-skinning */ uiBlockBeginAlign(block); uiDefButBitI(block, TOG, GP_LAYER_ONIONSKIN, B_REDR, "Onion-Skin", *xco+160, *yco-26, 140, 20, &gpl->flag, 0, 0, 0, 0, "Ghost frames on either side of frame"); - uiDefButS(block, NUMSLI, B_REDR, "GStep:", *xco+160, *yco-46, 140, 20, &gpl->gstep, 0, 120, 0, 0, "Maximum frame range on either side of active frame to show (0 = just 'first' available frame on either side)"); + uiDefButS(block, NUMSLI, B_REDR, "GStep:", *xco+160, *yco-46, 140, 20, &gpl->gstep, 0, 120, 0, 0, "Max number of frames on either side of active frame to show (0 = just 'first' available sketch on either side)"); uiBlockEndAlign(block); /* options */ - but= uiDefBut(block, BUT, B_REDR, "Del Active Frame", *xco+160, *yco-75, 140, 20, NULL, 0, 0, 0, 0, "Erases the the active frame for this layer"); - uiButSetFunc(but, gp_ui_delframe_cb, gpd, gpl); - - but= uiDefBut(block, BUT, B_REDR, "Del Last Stroke", *xco+160, *yco-95, 140, 20, NULL, 0, 0, 0, 0, "Erases the last stroke from the active frame"); - uiButSetFunc(but, gp_ui_delstroke_cb, gpd, gpl); - - //uiDefButBitI(block, TOG, GP_LAYER_DRAWDEBUG, B_REDR, "Show Points", *xco+160, *yco-75, 130, 20, &gpl->flag, 0, 0, 0, 0, "Show points which form the strokes"); + uiBlockBeginAlign(block); + but= uiDefBut(block, BUT, B_REDR, "Del Active Frame", *xco+160, *yco-75, 140, 20, NULL, 0, 0, 0, 0, "Erases the the active frame for this layer (Hotkey = Alt-XKEY/DEL)"); + uiButSetFunc(but, gp_ui_delframe_cb, gpd, gpl); + + but= uiDefBut(block, BUT, B_REDR, "Del Last Stroke", *xco+160, *yco-95, 140, 20, NULL, 0, 0, 0, 0, "Erases the last stroke from the active frame (Hotkey = Alt-XKEY/DEL)"); + uiButSetFunc(but, gp_ui_delstroke_cb, gpd, gpl); + uiBlockEndAlign(block); } } @@ -262,36 +262,40 @@ static void gp_drawui_layer (uiBlock *block, bGPdata *gpd, bGPDlayer *gpl, short /* Draw the contents for a grease-pencil panel. This assumes several things: * - that panel has been created, is 318 x 204. max yco is 225 * - that a toggle for turning on/off gpencil drawing is 150 x 20, starting from (10,225) + * which is basically the top left-hand corner * It will return the amount of extra space to extend the panel by */ short draw_gpencil_panel (uiBlock *block, bGPdata *gpd, ScrArea *sa) { uiBut *but; bGPDlayer *gpl; - short xco= 10, yco= 155; + short xco= 10, yco= 170; /* draw gpd settings first */ { - /* show status info button */ - uiDefButBitI(block, TOG, GP_DATA_DISPINFO, B_REDR, "Show Status Info", 10, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "Display status info about current status of Grease Pencil"); - - /* add new/duplicate layer buttons */ - but= uiDefBut(block, BUT, B_REDR, "Add New Layer", 10,182,150,20, 0, 0, 0, 0, 0, "Adds a new Grease Pencil Layer"); + /* add new layer buttons */ + but= uiDefBut(block, BUT, B_REDR, "Add New Layer", 10,205,150,20, 0, 0, 0, 0, 0, "Adds a new Grease Pencil Layer"); uiButSetFunc(but, gp_ui_addlayer_cb, gpd, NULL); - /* show override lmb-clicks button */ - uiDefButBitI(block, TOG, GP_DATA_EDITPAINT, B_REDR, "Draw Mode", 170, 225, 150, 20, &gpd->flag, 0, 0, 0, 0, "Interpret LMB-click as new strokes (same as holding Shift-Key per stroke)"); + /* show override lmb-clicks button + painting lock */ + uiBlockBeginAlign(block); + if ((gpd->flag & GP_DATA_EDITPAINT)==0) { + uiDefButBitI(block, TOG, GP_DATA_EDITPAINT, B_REDR, "Draw Mode", 170, 225, 130, 20, &gpd->flag, 0, 0, 0, 0, "Interpret click-drag as new strokes"); + + uiBlockSetCol(block, TH_BUT_SETTING); + uiDefIconButBitI(block, ICONTOG, GP_DATA_LMBPLOCK, B_REDR, ICON_UNLOCKED, 300, 225, 20, 20, &gpd->flag, 0.0, 0.0, 0, 0, "Painting cannot occur with Shift-LMB (when making selections)"); + uiBlockSetCol(block, TH_AUTO); + } + else + uiDefButBitI(block, TOG, GP_DATA_EDITPAINT, B_REDR, "Draw Mode", 170, 225, 150, 20, &gpd->flag, 0, 0, 0, 0, "Interpret click-drag as new strokes"); + uiBlockEndAlign(block); /* 'view align' button (naming depends on context) */ if (sa->spacetype == SPACE_VIEW3D) - uiDefButBitI(block, TOG, GP_DATA_VIEWALIGN, B_REDR, "Draw in 3D", 170, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "New strokes are added in 3D-space"); + uiDefButBitI(block, TOG, GP_DATA_VIEWALIGN, B_REDR, "Sketch in 3D", 170, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "New strokes are added in 3D-space"); else if (sa->spacetype != SPACE_SEQ) /* not available for sequencer yet */ uiDefButBitI(block, TOG, GP_DATA_VIEWALIGN, B_REDR, "Stick to View", 170, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "New strokes are added on 2d-canvas"); - - /* show edit-in-action button */ - but= uiDefButBitI(block, TOG, GP_DATA_EDITTIME, B_REDR, "Edit Timing", 170, 182, 150, 20, &gpd->flag, 0, 0, 0, 0, "Edit timing of frames for the Grease Pencil block"); - uiButSetFunc(but, gp_ui_dotime_cb, gpd, NULL); } /* draw for each layer */ @@ -313,6 +317,66 @@ enum { GP_DRAWDATA_ONLYV2D = (1<<2), /* only draw 'canvas' strokes */ }; +/* draw stroke in buffer */ +static void gp_draw_stroke_buffer (tGPspoint *points, int totpoints, short thickness, short dflag, short sflag) +{ + tGPspoint *pt; + int i; + + /* error checking */ + if ((points == NULL) || (totpoints <= 0)) + return; + + /* check if buffer can be drawn */ + if (dflag & (GP_DRAWDATA_ONLY3D|GP_DRAWDATA_ONLYV2D)) + return; + + /* if drawing a single point, draw it larger */ + if (totpoints == 1) { + /* draw point */ + glBegin(GL_POINTS); + glVertex2f(points->x, points->y); + glEnd(); + } + else if (sflag & GP_STROKE_ERASER) { + /* draw stroke curve - just standard thickness */ + setlinestyle(4); + glLineWidth(1.0f); + + glBegin(GL_LINE_STRIP); + for (i=0, pt=points; i < totpoints && pt; i++, pt++) { + glVertex2f(pt->x, pt->y); + } + glEnd(); + + setlinestyle(0); + } + else { + float oldpressure = 0.0f; + + /* draw stroke curve */ + setlinestyle(2); + + glBegin(GL_LINE_STRIP); + for (i=0, pt=points; i < totpoints && pt; i++, pt++) { + if (fabs(pt->pressure - oldpressure) > 0.2f) { + glEnd(); + glLineWidth(pt->pressure * thickness); + glBegin(GL_LINE_STRIP); + + glVertex2f(pt->x, pt->y); + + oldpressure = pt->pressure; + } + else + glVertex2f(pt->x, pt->y); + } + glEnd(); + + setlinestyle(0); + } +} + /* draw a given stroke */ static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness, short dflag, short sflag, short debug, int winx, int winy) { @@ -422,6 +486,21 @@ static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness, } } +/* draw a set of strokes */ +static void gp_draw_strokes (bGPDframe *gpf, int winx, int winy, int dflag, short debug, + short lthick, float color[4]) +{ + bGPDstroke *gps; + + /* set color first (may need to reset it again later too) */ + glColor4f(color[0], color[1], color[2], color[3]); + + for (gps= gpf->strokes.first; gps; gps= gps->next) { + /* just draw the stroke once */ + gp_draw_stroke(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, winx, winy); + } +} + /* draw grease-pencil datablock */ static void gp_draw_data (bGPdata *gpd, int winx, int winy, int dflag) { @@ -437,11 +516,10 @@ static void gp_draw_data (bGPdata *gpd, int winx, int winy, int dflag) /* loop over layers, drawing them */ for (gpl= gpd->layers.first; gpl; gpl= gpl->next) { bGPDframe *gpf; - bGPDstroke *gps; short debug = (gpl->flag & GP_LAYER_DRAWDEBUG) ? 1 : 0; short lthick= gpl->thickness; - float color[4]; + float color[4], tcolor[4]; /* don't draw layer if hidden */ if (gpl->flag & GP_LAYER_HIDE) @@ -459,6 +537,7 @@ static void gp_draw_data (bGPdata *gpd, int winx, int winy, int dflag) /* set color, stroke thickness, and point size */ glLineWidth(lthick); QUATCOPY(color, gpl->color); // just for copying 4 array elements + QUATCOPY(tcolor, gpl->color); // additional copy of color (for ghosting) glColor4f(color[0], color[1], color[2], color[3]); glPointSize(gpl->thickness + 2); @@ -474,11 +553,8 @@ static void gp_draw_data (bGPdata *gpd, int winx, int winy, int dflag) /* check if frame is drawable */ if ((gpf->framenum - gf->framenum) <= gpl->gstep) { /* alpha decreases with distance from curframe index */ - glColor4f(color[0], color[1], color[2], (color[3]-(i*0.7))); - - for (gps= gf->strokes.first; gps; gps= gps->next) { - gp_draw_stroke(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, winx, winy); - } + tcolor[3] = color[3] - (i/gpl->gstep); + gp_draw_strokes(gf, winx, winy, dflag, debug, lthick, tcolor); } else break; @@ -489,11 +565,8 @@ static void gp_draw_data (bGPdata *gpd, int winx, int winy, int dflag) /* check if frame is drawable */ if ((gf->framenum - gpf->framenum) <= gpl->gstep) { /* alpha decreases with distance from curframe index */ - glColor4f(color[0], color[1], color[2], (color[3]-(i*0.7))); - - for (gps= gf->strokes.first; gps; gps= gps->next) { - gp_draw_stroke(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, winx, winy); - } + tcolor[3] = color[3] - (i/gpl->gstep); + gp_draw_strokes(gf, winx, winy, dflag, debug, lthick, tcolor); } else break; @@ -504,19 +577,14 @@ static void gp_draw_data (bGPdata *gpd, int winx, int winy, int dflag) } else { /* draw the strokes for the ghost frames (at half of the alpha set by user) */ - glColor4f(color[0], color[1], color[2], (color[3] / 7)); - if (gpf->prev) { - for (gps= gpf->prev->strokes.first; gps; gps= gps->next) { - gp_draw_stroke(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, winx, winy); - } + tcolor[3] = (color[3] / 7); + gp_draw_strokes(gpf->prev, winx, winy, dflag, debug, lthick, tcolor); } - glColor4f(color[0], color[1], color[2], (color[3] / 4)); if (gpf->next) { - for (gps= gpf->next->strokes.first; gps; gps= gps->next) { - gp_draw_stroke(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, winx, winy); - } + tcolor[3] = (color[3] / 4); + gp_draw_strokes(gpf->next, winx, winy, dflag, debug, lthick, tcolor); } /* restore alpha */ @@ -525,20 +593,17 @@ static void gp_draw_data (bGPdata *gpd, int winx, int winy, int dflag) } /* draw the strokes already in active frame */ - for (gps= gpf->strokes.first; gps; gps= gps->next) { - gp_draw_stroke(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, winx, winy); - } + tcolor[3]= color[3]; + gp_draw_strokes(gpf, winx, winy, dflag, debug, lthick, tcolor); /* Check if may need to draw the active stroke cache, only if this layer is the active layer - * that is being edited. (Stroke cache is currently stored in gp-data) + * that is being edited. (Stroke buffer is currently stored in gp-data) */ if ((G.f & G_GREASEPENCIL) && (gpl->flag & GP_LAYER_ACTIVE) && (gpf->flag & GP_FRAME_PAINT)) { /* Buffer stroke needs to be drawn with a different linestyle to help differentiate them from normal strokes. */ - setlinestyle(2); - gp_draw_stroke(gpd->sbuffer, gpd->sbuffer_size, lthick, dflag, gpd->sbuffer_sflag, debug, winx, winy); - setlinestyle(0); + gp_draw_stroke_buffer(gpd->sbuffer, gpd->sbuffer_size, lthick, dflag, gpd->sbuffer_sflag); } } diff --git a/source/blender/src/drawnode.c b/source/blender/src/drawnode.c index 3a73ee84ead..853df3bedfc 100644 --- a/source/blender/src/drawnode.c +++ b/source/blender/src/drawnode.c @@ -3336,7 +3336,7 @@ static void nodes_panel_gpencil(short cntrl) // NODES_HANDLER_GREASEPENCIL uiNewPanelHeight(block, 204); /* draw button for showing gpencil settings and drawings */ - uiDefButBitS(block, TOG, SNODE_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &snode->flag, 0, 0, 0, 0, "Display freehand annotations overlay over this Node Editor"); + uiDefButBitS(block, TOG, SNODE_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &snode->flag, 0, 0, 0, 0, "Display freehand annotations overlay over this Node Editor (draw using Shift-LMB)"); /* extend the panel if the contents won't fit */ newheight= draw_gpencil_panel(block, gpd, curarea); diff --git a/source/blender/src/drawseq.c b/source/blender/src/drawseq.c index c8c74ad8279..cc431c73a2e 100644 --- a/source/blender/src/drawseq.c +++ b/source/blender/src/drawseq.c @@ -134,7 +134,7 @@ static void seq_panel_gpencil(short cntrl) // SEQ_HANDLER_GREASEPENCIL uiNewPanelHeight(block, 204); /* draw button for showing gpencil settings and drawings */ - uiDefButBitI(block, TOG, SEQ_DRAW_GPENCIL, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &sseq->flag, 0, 0, 0, 0, "Display freehand annotations overlay over this Sequencer View"); + uiDefButBitI(block, TOG, SEQ_DRAW_GPENCIL, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &sseq->flag, 0, 0, 0, 0, "Display freehand annotations overlay over this Sequencer View (draw using Shift-LMB)"); /* extend the panel if the contents won't fit */ newheight= draw_gpencil_panel(block, gpd, curarea); diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index 14434504e7a..2030eb658de 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -1502,44 +1502,52 @@ static void draw_view_icon(void) glDisable(GL_BLEND); } -static void draw_viewport_name(ScrArea *sa) +char *view3d_get_name(View3D *v3d) { char *name = NULL; - char *printable = NULL; - switch(G.vd->view) { + switch (v3d->view) { case 1: - if (G.vd->persp == V3D_ORTHO) - name = (G.vd->flag2 & V3D_OPP_DIRECTION_NAME) ? "Back Ortho" : "Front Ortho"; + if (v3d->persp == V3D_ORTHO) + name = (v3d->flag2 & V3D_OPP_DIRECTION_NAME) ? "Back Ortho" : "Front Ortho"; else - name = (G.vd->flag2 & V3D_OPP_DIRECTION_NAME) ? "Back Persp" : "Front Persp"; + name = (v3d->flag2 & V3D_OPP_DIRECTION_NAME) ? "Back Persp" : "Front Persp"; break; case 3: - if (G.vd->persp == V3D_ORTHO) - name = (G.vd->flag2 & V3D_OPP_DIRECTION_NAME) ? "Left Ortho" : "Right Ortho"; + if (v3d->persp == V3D_ORTHO) + name = (v3d->flag2 & V3D_OPP_DIRECTION_NAME) ? "Left Ortho" : "Right Ortho"; else - name = (G.vd->flag2 & V3D_OPP_DIRECTION_NAME) ? "Left Persp" : "Right Persp"; + name = (v3d->flag2 & V3D_OPP_DIRECTION_NAME) ? "Left Persp" : "Right Persp"; break; case 7: - if (G.vd->persp == V3D_ORTHO) - name = (G.vd->flag2 & V3D_OPP_DIRECTION_NAME) ? "Bottom Ortho" : "Top Ortho"; + if (v3d->persp == V3D_ORTHO) + name = (v3d->flag2 & V3D_OPP_DIRECTION_NAME) ? "Bottom Ortho" : "Top Ortho"; else - name = (G.vd->flag2 & V3D_OPP_DIRECTION_NAME) ? "Bottom Persp" : "Top Persp"; + name = (v3d->flag2 & V3D_OPP_DIRECTION_NAME) ? "Bottom Persp" : "Top Persp"; break; default: - if (G.vd->persp==V3D_CAMOB) { - if ((G.vd->camera) && (G.vd->camera->type == OB_CAMERA)) { + if (v3d->persp==V3D_CAMOB) { + if ((v3d->camera) && (v3d->camera->type == OB_CAMERA)) { Camera *cam; - cam = G.vd->camera->data; + cam = v3d->camera->data; name = (cam->type != CAM_ORTHO) ? "Camera Persp" : "Camera Ortho"; } else { name = "Object as Camera"; } } else { - name = (G.vd->persp == V3D_ORTHO) ? "User Ortho" : "User Persp"; + name = (v3d->persp == V3D_ORTHO) ? "User Ortho" : "User Persp"; } + break; } + return name; +} + +static void draw_viewport_name(ScrArea *sa) +{ + char *name = view3d_get_name(sa->spacedata.first); + char *printable = NULL; + if (G.vd->localview) { printable = malloc(strlen(name) + strlen(" (Local)_")); /* '_' gives space for '\0' */ strcpy(printable, name); @@ -1987,6 +1995,8 @@ static void v3d_editarmature_buts(uiBlock *block, Object *ob, float lim) tfp->ob_eul[0]= 180.0*ebone->roll/M_PI; uiDefButF(block, NUM, B_ARMATUREPANEL1, "Roll:", 10, 100, 140, 19, tfp->ob_eul, -lim, lim, 1000, 3, ""); + uiDefButBitI(block, TOG, BONE_EDITMODE_LOCKED, REDRAWVIEW3D, "Lock", 160, 100, 140, 19, &(ebone->flag), 0, 0, 0, 0, "Prevents bone from being transformed in edit mode"); + uiBlockBeginAlign(block); uiDefButF(block, NUM, B_ARMATUREPANEL1, "TailRadius:", 10, 150, 140, 19, &ebone->rad_tail, 0, lim, 10, 3, ""); if (ebone->parent && ebone->flag & BONE_CONNECTED ) @@ -2654,7 +2664,7 @@ static void view3d_panel_gpencil(short cntrl) // VIEW3D_HANDLER_GREASEPENCIL uiNewPanelHeight(block, 204); /* draw button for showing gpencil settings and drawings */ - uiDefButBitS(block, TOG, V3D_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &vd->flag2, 0, 0, 0, 0, "Display freehand annotations overlay over this 3D View"); + uiDefButBitS(block, TOG, V3D_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &vd->flag2, 0, 0, 0, 0, "Display freehand annotations overlay over this 3D View (draw using Shift-LMB)"); /* extend the panel if the contents won't fit */ newheight= draw_gpencil_panel(block, gpd, curarea); diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c index 3251cb33b53..c454715b1df 100644 --- a/source/blender/src/editaction.c +++ b/source/blender/src/editaction.c @@ -517,23 +517,43 @@ static void actdata_filter_shapekey (ListBase *act_data, Key *key, int filter_mo } } -static void actdata_filter_gpencil (ListBase *act_data, bGPdata *gpd, int filter_mode) + +static void actdata_filter_gpencil (ListBase *act_data, bScreen *sc, int filter_mode) { bActListElem *ale; + ScrArea *sa; + bGPdata *gpd; bGPDlayer *gpl; /* check if filtering types are appropriate */ if ( !(filter_mode & (ACTFILTER_IPOKEYS|ACTFILTER_ONLYICU|ACTFILTER_ACTGROUPED)) ) { - /* loop over layers as the conditions are acceptable */ - for (gpl= gpd->layers.first; gpl; gpl= gpl->next) { - /* only if selected */ - if (!(filter_mode & ACTFILTER_SEL) || SEL_GPL(gpl)) { - /* only if editable */ - if (!(filter_mode & ACTFILTER_FOREDIT) || EDITABLE_GPL(gpl)) { - /* add to list */ - ale= make_new_actlistelem(gpl, ACTTYPE_GPLAYER, NULL, ACTTYPE_NONE); - if (ale) BLI_addtail(act_data, ale); + /* loop over spaces in current screen, finding gpd blocks (could be slow!) */ + for (sa= sc->areabase.first; sa; sa= sa->next) { + /* try to get gp data */ + gpd= gpencil_data_getactive(sa); + if (gpd == NULL) continue; + + /* add gpd as channel too (if for drawing, and it has layers) */ + if ((filter_mode & ACTFILTER_FORDRAWING) && (gpd->layers.first)) { + /* add to list */ + ale= make_new_actlistelem(gpd, ACTTYPE_GPDATABLOCK, sa, ACTTYPE_SPECIALDATA); + if (ale) BLI_addtail(act_data, ale); + } + + /* only add layers if they will be visible (if drawing channels) */ + if ( !(filter_mode & ACTFILTER_VISIBLE) || (EXPANDED_GPD(gpd)) ) { + /* loop over layers as the conditions are acceptable */ + for (gpl= gpd->layers.first; gpl; gpl= gpl->next) { + /* only if selected */ + if (!(filter_mode & ACTFILTER_SEL) || SEL_GPL(gpl)) { + /* only if editable */ + if (!(filter_mode & ACTFILTER_FOREDIT) || EDITABLE_GPL(gpl)) { + /* add to list */ + ale= make_new_actlistelem(gpl, ACTTYPE_GPLAYER, gpd, ACTTYPE_GPDATABLOCK); + if (ale) BLI_addtail(act_data, ale); + } + } } } } @@ -637,11 +657,8 @@ int get_nearest_key_num (Key *key, short *mval, float *x) return (num + 1); } -/* this function is used to get a pointer to an action or shapekey - * datablock, thus simplying that process. - */ -/* this function is intended for use */ -void *get_nearest_act_channel (short mval[], short *ret_type) +/* this function finds the channel that mouse is floating over */ +void *get_nearest_act_channel (short mval[], short *ret_type, void **owner) { ListBase act_data = {NULL, NULL}; bActListElem *ale; @@ -652,6 +669,9 @@ void *get_nearest_act_channel (short mval[], short *ret_type) int clickmin, clickmax; float x,y; + /* init 'owner' return val */ + *owner= NULL; + /* determine what type of data we are operating on */ data = get_action_context(&datatype); if (data == NULL) { @@ -679,6 +699,7 @@ void *get_nearest_act_channel (short mval[], short *ret_type) /* found match */ *ret_type= ale->type; data= ale->data; + *owner= ale->owner; BLI_freelistN(&act_data); @@ -854,10 +875,7 @@ void *get_action_context (short *datatype) case SACTCONT_GPENCIL: *datatype= ACTCONT_GPENCIL; - if (G.saction->pin) - return G.saction->gpd; - else - return gpencil_data_getetime(G.curscreen); + return G.curscreen; // FIXME: add that dopesheet type thing here! default: /* includes SACTCONT_DOPESHEET for now */ *datatype= ACTCONT_NONE; @@ -2327,7 +2345,7 @@ static void numbuts_action () void *data; short datatype; - void *act_channel; + void *act_channel, *channel_owner; short chantype; bActionGroup *agrp= NULL; @@ -2335,6 +2353,7 @@ static void numbuts_action () bConstraintChannel *conchan= NULL; IpoCurve *icu= NULL; KeyBlock *kb= NULL; + bGPdata *gpd= NULL; bGPDlayer *gpl= NULL; short mval[2]; @@ -2353,7 +2372,7 @@ static void numbuts_action () getmouseco_areawin(mval); if (mval[0] > NAMEWIDTH) return; - act_channel= get_nearest_act_channel(mval, &chantype); + act_channel= get_nearest_act_channel(mval, &chantype, &channel_owner); /* create items for clever-numbut */ if (chantype == ACTTYPE_ACHAN) { @@ -2451,6 +2470,7 @@ static void numbuts_action () } else if (chantype == ACTTYPE_GPLAYER) { /* Grease-Pencil Layer */ + gpd= (bGPdata *)channel_owner; gpl= (bGPDlayer *)act_channel; strcpy(str, gpl->info); @@ -2511,7 +2531,7 @@ static void numbuts_action () } else if (gpl) { strcpy(gpl->info, str); - BLI_uniquename(&( ((bGPdata *)data)->layers ), gpl, "GP_Layer", offsetof(bGPDlayer, info), 128); + BLI_uniquename(&gpd->layers, gpl, "GP_Layer", offsetof(bGPDlayer, info), 128); if (mute) gpl->flag |= GP_LAYER_HIDE; else gpl->flag &= ~GP_LAYER_HIDE;; @@ -2871,9 +2891,10 @@ int select_gplayer_channel (bGPdata *gpd, bGPDlayer *gpl, int selectmode) gpl->flag ^= GP_LAYER_SELECT; break; } + flag = (gpl->flag & GP_LAYER_SELECT) ? 1 : 0; - - gpencil_layer_setactive(gpd, gpl); + if (flag) + gpencil_layer_setactive(gpd, gpl); return flag; } @@ -3100,11 +3121,11 @@ void selectall_action_keys (short mval[], short mode, short select_mode) switch (mode) { case 0: /* all in channel*/ { - void *act_channel; + void *act_channel, *channel_owner; short chantype; /* get channel, and act according to type */ - act_channel= get_nearest_act_channel(mval, &chantype); + act_channel= get_nearest_act_channel(mval, &chantype, &channel_owner); switch (chantype) { case ACTTYPE_GROUP: { @@ -3939,8 +3960,7 @@ static void mouse_action (int selectmode) static void mouse_actionchannels (short mval[]) { bAction *act= G.saction->action; - bGPdata *gpd= G.saction->gpd; - void *data, *act_channel; + void *data, *act_channel, *channel_owner; short datatype, chantype; /* determine what type of data we are operating on */ @@ -3948,7 +3968,7 @@ static void mouse_actionchannels (short mval[]) if (data == NULL) return; /* get channel to work on */ - act_channel= get_nearest_act_channel(mval, &chantype); + act_channel= get_nearest_act_channel(mval, &chantype, &channel_owner); /* action to take depends on what channel we've got */ switch (chantype) { @@ -4086,8 +4106,17 @@ static void mouse_actionchannels (short mval[]) } } break; + case ACTTYPE_GPDATABLOCK: + { + bGPdata *gpd= (bGPdata *)act_channel; + + /* toggle expand */ + gpd->flag ^= GP_DATA_EXPAND; + } + break; case ACTTYPE_GPLAYER: { + bGPdata *gpd= (bGPdata *)channel_owner; bGPDlayer *gpl= (bGPDlayer *)act_channel; if (mval[0] >= (NAMEWIDTH-16)) { @@ -4100,7 +4129,13 @@ static void mouse_actionchannels (short mval[]) } else { /* select/deselect */ - select_gplayer_channel(gpd, gpl, SELECT_INVERT); + if (G.qual & LR_SHIFTKEY) { + select_gplayer_channel(gpd, gpl, SELECT_INVERT); + } + else { + deselect_gpencil_layers(data, 0); + select_gplayer_channel(gpd, gpl, SELECT_INVERT); + } } } break; diff --git a/source/blender/src/editaction_gpencil.c b/source/blender/src/editaction_gpencil.c index b91c5a8b332..14269080b1f 100644 --- a/source/blender/src/editaction_gpencil.c +++ b/source/blender/src/editaction_gpencil.c @@ -246,7 +246,7 @@ void borderselect_gplayer_frames (bGPDlayer *gpl, float min, float max, short se /* De-selects or inverts the selection of Layers for a grease-pencil block * mode: 0 = default behaviour (select all), 1 = test if (de)select all, 2 = invert all */ -void deselect_gpencil_layers (bGPdata *gpd, short mode) +void deselect_gpencil_layers (void *data, short mode) { ListBase act_data = {NULL, NULL}; bActListElem *ale; @@ -254,7 +254,7 @@ void deselect_gpencil_layers (bGPdata *gpd, short mode) /* filter data */ filter= ACTFILTER_VISIBLE; - actdata_filter(&act_data, filter, gpd, ACTCONT_GPENCIL); + actdata_filter(&act_data, filter, data, ACTCONT_GPENCIL); /* See if we should be selecting or deselecting */ if (mode == 1) { @@ -294,7 +294,6 @@ void delete_gpencil_layers (void) { ListBase act_data = {NULL, NULL}; bActListElem *ale, *next; - bGPdata *gpd; void *data; short datatype; int filter; @@ -303,7 +302,6 @@ void delete_gpencil_layers (void) data = get_action_context(&datatype); if (data == NULL) return; if (datatype != ACTCONT_GPENCIL) return; - gpd= (bGPdata *)data; /* filter data */ filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_CHANNELS | ACTFILTER_SEL); @@ -311,6 +309,7 @@ void delete_gpencil_layers (void) /* clean up grease-pencil layers */ for (ale= act_data.first; ale; ale= next) { + bGPdata *gpd= (bGPdata *)ale->owner; bGPDlayer *gpl= (bGPDlayer *)ale->data; next= ale->next; diff --git a/source/blender/src/editarmature.c b/source/blender/src/editarmature.c index 6310dd0a262..3d0f26960d6 100644 --- a/source/blender/src/editarmature.c +++ b/source/blender/src/editarmature.c @@ -2709,6 +2709,32 @@ void show_all_armature_bones(void) BIF_undo_push("Reveal Bones"); } +/* Sets editmode transform locks for bones (adds if lock==1, clears otherwise) */ +void set_locks_armature_bones(short lock) +{ + bArmature *arm= G.obedit->data; + EditBone *ebone; + + for (ebone = G.edbo.first; ebone; ebone=ebone->next) { + if (arm->layer & ebone->layer) { + if (ebone->flag & BONE_SELECTED) { + if (lock) + ebone->flag |= BONE_EDITMODE_LOCKED; + else + ebone->flag &= ~BONE_EDITMODE_LOCKED; + } + } + } + countall(); + allqueue(REDRAWVIEW3D, 0); + allqueue(REDRAWBUTSEDIT, 0); + + if (lock) + BIF_undo_push("Lock Bones"); + else + BIF_undo_push("Unlock Bones"); +} + /* check for null, before calling! */ static void bone_connect_to_existing_parent(EditBone *bone) { diff --git a/source/blender/src/editipo.c b/source/blender/src/editipo.c index c5dd41e16d5..63c301658f2 100644 --- a/source/blender/src/editipo.c +++ b/source/blender/src/editipo.c @@ -82,6 +82,7 @@ #include "BKE_group.h" #include "BKE_ipo.h" #include "BKE_key.h" +#include "BKE_main.h" #include "BKE_material.h" #include "BKE_particle.h" #include "BKE_texture.h" @@ -933,6 +934,9 @@ static void make_editipo(void) ob->ipowin= ID_TE; make_texture_editipo(G.sipo); } + else if(G.scene->world && give_current_world_texture()) { + make_texture_editipo(G.sipo); + } } else if(G.sipo->blocktype==ID_CA) { if (ob) { @@ -1120,6 +1124,11 @@ static void get_ipo_context(short blocktype, ID **from, Ipo **ipo, char *actname *from= (ID *)tex; if(tex) *ipo= tex->ipo; } + else if(G.scene->world) { + Tex *tex= give_current_world_texture(); + *from= (ID *)tex; + if(tex) *ipo= tex->ipo; + } } else if(blocktype==ID_MA) { if(ob) { @@ -6002,4 +6011,4 @@ void move_to_frame(void) } } BIF_undo_push("Set frame to selected Ipo vertex"); -} +} \ No newline at end of file diff --git a/source/blender/src/editnode.c b/source/blender/src/editnode.c index 5c137e67c1a..98f4f1bb46f 100644 --- a/source/blender/src/editnode.c +++ b/source/blender/src/editnode.c @@ -2400,7 +2400,7 @@ void winqreadnodespace(ScrArea *sa, void *spacedata, BWinEvent *evt) switch(event) { case LEFTMOUSE: - if(gpencil_do_paint(sa)) { + if(gpencil_do_paint(sa, L_MOUSE)) { return; } else if(fromlib) { @@ -2421,7 +2421,10 @@ void winqreadnodespace(ScrArea *sa, void *spacedata, BWinEvent *evt) break; case RIGHTMOUSE: - if(find_indicated_socket(snode, &actnode, &actsock, SOCK_IN)) { + if(gpencil_do_paint(sa, R_MOUSE)) { + return; + } + else if(find_indicated_socket(snode, &actnode, &actsock, SOCK_IN)) { if(actsock->flag & SOCK_SEL) { snode->edittree->selin= NULL; actsock->flag&= ~SOCK_SEL; @@ -2568,8 +2571,13 @@ void winqreadnodespace(ScrArea *sa, void *spacedata, BWinEvent *evt) break; case DELKEY: case XKEY: - if(fromlib) fromlib= -1; - else node_delete(snode); + if(G.qual==LR_ALTKEY) { + gpencil_delete_menu(); + } + else { + if(fromlib) fromlib= -1; + else node_delete(snode); + } break; } } diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index 6af4f47ed11..cbf7691754d 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -2760,7 +2760,7 @@ void special_editmenu(void) DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); } else if(G.obedit->type==OB_ARMATURE) { - nr= pupmenu("Specials%t|Subdivide %x1|Subdivide Multi%x2|Flip Left-Right Names%x3|%l|AutoName Left-Right%x4|AutoName Front-Back%x5|AutoName Top-Bottom%x6"); + nr= pupmenu("Specials%t|Subdivide %x1|Subdivide Multi%x2|Flip Left-Right Names%x3|%l|AutoName Left-Right%x4|AutoName Front-Back%x5|AutoName Top-Bottom%x6|%l|Lock%x7|Unlock%x8"); if(nr==1) subdivide_armature(1); if(nr==2) { @@ -2773,6 +2773,10 @@ void special_editmenu(void) else if(ELEM3(nr, 4, 5, 6)) { armature_autoside_names(nr-4); } + else if(nr==7) + set_locks_armature_bones(1); + else if(nr==8) + set_locks_armature_bones(0); } else if(G.obedit->type==OB_LATTICE) { static float weight= 1.0f; @@ -3502,6 +3506,17 @@ void copy_attr(short event) base->object->damping= ob->damping; base->object->rdamping= ob->rdamping; } + else if(event==11) { /* all physical attributes */ + base->object->gameflag = ob->gameflag; + base->object->inertia = ob->inertia; + base->object->formfactor = ob->formfactor; + base->object->damping= ob->damping; + base->object->rdamping= ob->rdamping; + base->object->mass= ob->mass; + if (ob->gameflag & OB_BOUNDS) { + base->object->boundtype = ob->boundtype; + } + } else if(event==17) { /* tex space */ copy_texture_space(base->object, ob); } @@ -3688,7 +3703,7 @@ void copy_attr_menu() * view3d_edit_object_copyattrmenu() and in toolbox.c */ - strcpy(str, "Copy Attributes %t|Location%x1|Rotation%x2|Size%x3|Draw Options%x4|Time Offset%x5|Dupli%x6|%l|Mass%x7|Damping%x8|Properties%x9|Logic Bricks%x10|Protected Transform%x29|%l"); + strcpy(str, "Copy Attributes %t|Location%x1|Rotation%x2|Size%x3|Draw Options%x4|Time Offset%x5|Dupli%x6|%l|Mass%x7|Damping%x8|All Physical Attributes%x11|Properties%x9|Logic Bricks%x10|Protected Transform%x29|%l"); strcat (str, "|Object Constraints%x22"); strcat (str, "|NLA Strips%x26"); diff --git a/source/blender/src/editseq.c b/source/blender/src/editseq.c index f9432f8e69a..12019a9dab9 100644 --- a/source/blender/src/editseq.c +++ b/source/blender/src/editseq.c @@ -122,13 +122,28 @@ Sequence *get_last_seq() if(!_last_seq_init) { Editing *ed; Sequence *seq; + Sequence *l_sel = NULL; + Sequence *l_act = NULL; ed= G.scene->ed; if(!ed) return NULL; - for(seq= ed->seqbasep->first; seq; seq=seq->next) + for(seq= ed->seqbasep->first; seq; seq=seq->next) { + if(seq->flag & SEQ_ACTIVE) + l_act = seq; if(seq->flag & SELECT) - _last_seq= seq; + l_sel = seq; + } + + if (l_act) { + _last_seq = l_act; + } else { + _last_seq = l_sel; + } + + if (_last_seq) { + _last_seq->flag |= SEQ_ACTIVE; + } _last_seq_init = 1; } @@ -138,12 +153,23 @@ Sequence *get_last_seq() void set_last_seq(Sequence *seq) { + if (_last_seq_init && _last_seq) { + _last_seq->flag &= ~SEQ_ACTIVE; + } + _last_seq = seq; _last_seq_init = 1; + + if (_last_seq) { + _last_seq->flag |= SEQ_ACTIVE; + } } -void clear_last_seq(Sequence *seq) +void clear_last_seq() { + if (_last_seq_init && _last_seq) { + _last_seq->flag &= ~SEQ_ACTIVE; + } _last_seq = NULL; _last_seq_init = 0; } @@ -2261,6 +2287,8 @@ static Sequence *dupli_seq(Sequence *seq) "handled in duplicate!\nExpect a crash" " now...\n"); } + + seqn->flag &= ~SEQ_ACTIVE; return seqn; } diff --git a/source/blender/src/editview.c b/source/blender/src/editview.c index e3ec69975de..a3fcad7885c 100644 --- a/source/blender/src/editview.c +++ b/source/blender/src/editview.c @@ -298,7 +298,7 @@ int lasso_inside(short mcords[][2], short moves, short sx, short sy) } /* edge version for lasso select. we assume boundbox check was done */ -static int lasso_inside_edge(short mcords[][2], short moves, int x0, int y0, int x1, int y1) +int lasso_inside_edge(short mcords[][2], short moves, int x0, int y0, int x1, int y1) { short v1[2], v2[2]; int a; @@ -371,7 +371,7 @@ static void do_lasso_select_objects(short mcords[][2], short moves, short select } } -static void lasso_select_boundbox(rcti *rect, short mcords[][2], short moves) +void lasso_select_boundbox(rcti *rect, short mcords[][2], short moves) { short a; diff --git a/source/blender/src/gpencil.c b/source/blender/src/gpencil.c index fa32b0ac7d4..eef21323a44 100644 --- a/source/blender/src/gpencil.c +++ b/source/blender/src/gpencil.c @@ -48,6 +48,7 @@ #include "DNA_screen_types.h" #include "DNA_space_types.h" #include "DNA_userdef_types.h" +#include "DNA_vec_types.h" #include "DNA_view3d_types.h" #include "BKE_global.h" @@ -57,6 +58,7 @@ #include "BIF_gl.h" #include "BIF_glutil.h" #include "BIF_butspace.h" +#include "BIF_editview.h" #include "BIF_graphics.h" #include "BIF_interface.h" #include "BIF_mywindow.h" @@ -383,111 +385,6 @@ short gpencil_data_setactive (ScrArea *sa, bGPdata *gpd) return 0; } -/* Find gp-data destined for editing in animation editor (for editing time) */ -bGPdata *gpencil_data_getetime (bScreen *sc) -{ - bGPdata *gpd= NULL; - ScrArea *sa; - - /* error checking */ - if (sc == NULL) - return NULL; - - /* search through areas, checking if an appropriate gp-block is available - * (this assumes that only one will have the active flag set) - */ - for (sa= sc->areabase.first; sa; sa= sa->next) { - /* handle depending on space type */ - switch (sa->spacetype) { - case SPACE_VIEW3D: /* 3d-view */ - { - View3D *v3d= sa->spacedata.first; - gpd= v3d->gpd; - } - break; - case SPACE_NODE: /* Node Editor */ - { - SpaceNode *snode= sa->spacedata.first; - gpd= snode->gpd; - } - break; - case SPACE_SEQ: /* Sequence Editor - Image Preview */ - { - SpaceSeq *sseq= sa->spacedata.first; - - if (sseq->mainb) - gpd= sseq->gpd; - else - gpd= NULL; - } - break; - - default: /* unsupported space-type */ - gpd= NULL; - break; - } - - /* check if ok */ - if ((gpd) && (gpd->flag & GP_DATA_EDITTIME)) - return gpd; - } - - /* didn't find a match */ - return NULL; -} - -/* make sure only the specified view can have gp-data for time editing - * - gpd can be NULL, if we wish to make sure no gp-data is being edited - */ -void gpencil_data_setetime (bScreen *sc, bGPdata *gpd) -{ - bGPdata *gpdn= NULL; - ScrArea *sa; - - /* error checking */ - if (sc == NULL) - return; - - /* search through areas, checking if an appropriate gp-block is available - * (this assumes that only one will have the active flag set) - */ - for (sa= sc->areabase.first; sa; sa= sa->next) { - /* handle depending on space type */ - switch (sa->spacetype) { - case SPACE_VIEW3D: /* 3d-view */ - { - View3D *v3d= sa->spacedata.first; - gpdn= v3d->gpd; - } - break; - case SPACE_NODE: /* Node Editor */ - { - SpaceNode *snode= sa->spacedata.first; - gpdn= snode->gpd; - } - break; - case SPACE_SEQ: /* Sequence Editor - Image Preview */ - { - SpaceSeq *sseq= sa->spacedata.first; - gpdn= sseq->gpd; - } - break; - - default: /* unsupported space-type */ - gpdn= NULL; - break; - } - - /* clear flag if a gp-data block found */ - if (gpdn) - gpdn->flag &= ~GP_DATA_EDITTIME; - } - - /* set active flag for this block (if it is provided) */ - if (gpd) - gpd->flag |= GP_DATA_EDITTIME; -} - /* -------- GP-Frame API ---------- */ /* delete the last stroke of the given frame */ @@ -721,7 +618,7 @@ void gpencil_delete_actframe (bGPdata *gpd) * 2 - active frame * 3 - active layer */ -void gpencil_delete_operation (short mode) // unused +void gpencil_delete_operation (short mode) { bGPdata *gpd; @@ -747,11 +644,15 @@ void gpencil_delete_operation (short mode) // unused } /* display a menu for deleting different grease-pencil elements */ -void gpencil_delete_menu (void) // unused +void gpencil_delete_menu (void) { + bGPdata *gpd= gpencil_data_getactive(NULL); short mode; - mode= pupmenu("Erase...%t|Last Stroke%x1|Active Frame%x2|Active Layer%x3"); + /* only show menu if it will be relevant */ + if (gpd == NULL) return; + + mode= pupmenu("Grease Pencil Erase...%t|Last Stroke%x1|Active Frame%x2|Active Layer%x3"); if (mode <= 0) return; gpencil_delete_operation(mode); @@ -763,7 +664,14 @@ void gpencil_delete_menu (void) // unused /* ---------- 'Globals' and Defines ----------------- */ /* maximum sizes of gp-session buffer */ -#define GP_STROKE_BUFFER_MAX 500 +#define GP_STROKE_BUFFER_MAX 5000 + +/* Hardcoded sensitivity thresholds... */ +// TODO: one day, these might be added to the UI if it is necessary + /* minimum number of pixels mouse should move before new point created */ +#define MIN_MANHATTEN_PX 3 + /* minimum length of new segment before new point can be added */ +#define MIN_EUCLIDEAN_PX 20 /* ------ */ @@ -777,7 +685,7 @@ typedef struct tGPsdata { bGPDframe *gpf; /* frame we're working on */ short status; /* current status of painting */ - short paintmode; /* mode for painting (L_MOUSE or R_MOUSE for now) */ + short paintmode; /* mode for painting */ } tGPsdata; /* values for tGPsdata->status */ @@ -787,6 +695,12 @@ enum { GP_STATUS_DONE /* painting done */ }; +/* values for tGPsdata->paintmode */ +enum { + GP_PAINTMODE_DRAW = 0, + GP_PAINTMODE_ERASER +}; + /* Return flags for adding points to stroke buffer */ enum { GP_STROKEADD_INVALID = -2, /* error occurred - insufficient info to do so */ @@ -804,9 +718,9 @@ static void gp_session_validatebuffer (tGPsdata *p) /* clear memory of buffer (or allocate it if starting a new session) */ if (gpd->sbuffer) - memset(gpd->sbuffer, 0, sizeof(bGPDspoint)*GP_STROKE_BUFFER_MAX); + memset(gpd->sbuffer, 0, sizeof(tGPspoint)*GP_STROKE_BUFFER_MAX); else - gpd->sbuffer= MEM_callocN(sizeof(bGPDspoint)*GP_STROKE_BUFFER_MAX, "gp_session_strokebuffer"); + gpd->sbuffer= MEM_callocN(sizeof(tGPspoint)*GP_STROKE_BUFFER_MAX, "gp_session_strokebuffer"); /* reset indices */ gpd->sbuffer_size = 0; @@ -944,6 +858,25 @@ static void gp_session_cleanup (tGPsdata *p) gpd->sbuffer_sflag= 0; } +/* check if the current mouse position is suitable for adding a new point */ +static short gp_stroke_filtermval (tGPsdata *p, short mval[2], short pmval[2]) +{ + short dx= abs(mval[0] - pmval[0]); + short dy= abs(mval[1] - pmval[1]); + + /* check if mouse moved at least certain distance on both axes (best case) */ + if ((dx > MIN_MANHATTEN_PX) && (dy > MIN_MANHATTEN_PX)) + return 1; + + /* check if the distance since the last point is significant enough */ + else if (sqrt(dx*dx + dy*dy) > MIN_EUCLIDEAN_PX) + return 1; + + /* mouse 'didn't move' */ + else + return 0; +} + /* convert screen-coordinates to buffer-coordinates */ static void gp_stroke_convertcoords (tGPsdata *p, short mval[], float out[]) { @@ -979,23 +912,23 @@ static void gp_stroke_convertcoords (tGPsdata *p, short mval[], float out[]) } /* add current stroke-point to buffer (returns whether point was successfully added) */ -static short gp_stroke_addpoint (tGPsdata *p, short mval[], float pressure) +static short gp_stroke_addpoint (tGPsdata *p, short mval[2], float pressure) { bGPdata *gpd= p->gpd; - bGPDspoint *pt; + tGPspoint *pt; /* check if still room in buffer */ if (gpd->sbuffer_size >= GP_STROKE_BUFFER_MAX) return GP_STROKEADD_OVERFLOW; - /* get pointer to destination point */ - pt= gpd->sbuffer + gpd->sbuffer_size; + pt= ((tGPspoint *)(gpd->sbuffer) + gpd->sbuffer_size); - /* convert screen-coordinates to appropriate coordinates (and store them) */ - gp_stroke_convertcoords(p, mval, &pt->x); - - /* store other settings */ + /* store settings */ + pt->x= mval[0]; + pt->y= mval[1]; + pt->xf= (float)mval[0]; + pt->yf= (float)mval[0]; pt->pressure= pressure; /* increment counters */ @@ -1008,35 +941,13 @@ static short gp_stroke_addpoint (tGPsdata *p, short mval[], float pressure) return GP_STROKEADD_NORMAL; } -/* smooth a stroke (in buffer) before storing it */ -static void gp_stroke_smooth (tGPsdata *p) -{ - bGPdata *gpd= p->gpd; - int i=0, cmx=gpd->sbuffer_size; - - /* don't try if less than 2 points in buffer */ - if ((cmx <= 2) || (gpd->sbuffer == NULL)) - return; - - /* apply weighting-average (note doing this along path sequentially does introduce slight error) */ - for (i=0; i < gpd->sbuffer_size; i++) { - bGPDspoint *pc= (gpd->sbuffer + i); - bGPDspoint *pb= (i-1 > 0)?(pc-1):(pc); - bGPDspoint *pa= (i-2 > 0)?(pc-2):(pb); - bGPDspoint *pd= (i+1 < cmx)?(pc+1):(pc); - bGPDspoint *pe= (i+2 < cmx)?(pc+2):(pd); - - pc->x= (0.1*pa->x + 0.2*pb->x + 0.4*pc->x + 0.2*pd->x + 0.1*pe->x); - pc->y= (0.1*pa->y + 0.2*pb->y + 0.4*pc->y + 0.2*pd->y + 0.1*pe->y); - } -} - /* make a new stroke from the buffer data */ static void gp_stroke_newfrombuffer (tGPsdata *p) { bGPdata *gpd= p->gpd; bGPDstroke *gps; - bGPDspoint *pt, *ptc; + bGPDspoint *pt; + tGPspoint *ptc; int i, totelem; /* get total number of points to allocate space for */ @@ -1062,7 +973,12 @@ static void gp_stroke_newfrombuffer (tGPsdata *p) /* copy points from the buffer to the stroke */ for (i=0, ptc=gpd->sbuffer; i < gpd->sbuffer_size && ptc; i++, ptc++) { - memcpy(pt, ptc, sizeof(bGPDspoint)); + /* convert screen-coordinates to appropriate coordinates (and store them) */ + gp_stroke_convertcoords(p, &ptc->x, &pt->x); + + /* copy pressure */ + pt->pressure= ptc->pressure; + pt++; } @@ -1070,10 +986,220 @@ static void gp_stroke_newfrombuffer (tGPsdata *p) BLI_addtail(&p->gpf->strokes, gps); } +/* --- 'Eraser' for 'Paint' Tool ------ */ +/* User should draw 'circles' around the parts of the sketches they wish to + * delete instead of drawing squiggles over existing lines. This should be + * easier to manage than if it was done otherwise. + */ + +/* convert gp-buffer stroke into mouse-coordinates array */ +static short (*gp_stroke_eraser_2mco (bGPdata *gpd))[2] +{ + tGPspoint *pt; + short (*mcoords)[2]; + int i; + + /* allocate memory for coordinates array */ + mcoords= MEM_mallocN(sizeof(*mcoords)*gpd->sbuffer_size,"gp_buf_mcords"); + + /* copy coordinates */ + for (pt=gpd->sbuffer, i=0; i < gpd->sbuffer_size; i++, pt++) { + mcoords[i][0]= pt->x; + mcoords[i][1]= pt->y; + } + + /* return */ + return mcoords; +} + +/* eraser tool - remove segment from stroke/split stroke (after lasso inside) */ +static short gp_stroke_eraser_splitdel (bGPDframe *gpf, bGPDstroke *gps, int i) +{ + bGPDspoint *pt_tmp= gps->points; + bGPDstroke *gsn = NULL; + + /* if stroke only had two points, get rid of stroke */ + if (gps->totpoints == 2) { + /* free stroke points, then stroke */ + MEM_freeN(pt_tmp); + BLI_freelinkN(&gpf->strokes, gps); + + /* nothing left in stroke, so stop */ + return 1; + } + + /* if last segment, just remove segment from the stroke */ + else if (i == gps->totpoints - 2) { + /* allocate new points array, and assign most of the old stroke there */ + gps->totpoints--; + gps->points= MEM_callocN(sizeof(bGPDspoint)*gps->totpoints, "gp_stroke_points"); + memcpy(gps->points, pt_tmp, sizeof(bGPDspoint)*gps->totpoints); + + /* free temp buffer */ + MEM_freeN(pt_tmp); + + /* nothing left in stroke, so stop */ + return 1; + } + + /* if first segment, just remove segment from the stroke */ + else if (i == 0) { + /* allocate new points array, and assign most of the old stroke there */ + gps->totpoints--; + gps->points= MEM_callocN(sizeof(bGPDspoint)*gps->totpoints, "gp_stroke_points"); + memcpy(gps->points, pt_tmp + 1, sizeof(bGPDspoint)*gps->totpoints); + + /* free temp buffer */ + MEM_freeN(pt_tmp); + + /* no break here, as there might still be stuff to remove in this stroke */ + return 0; + } + + /* segment occurs in 'middle' of stroke, so split */ + else { + /* duplicate stroke, and assign 'later' data to that stroke */ + gsn= MEM_dupallocN(gps); + gsn->prev= gsn->next= NULL; + BLI_insertlinkafter(&gpf->strokes, gps, gsn); + + gsn->totpoints= gps->totpoints - i; + gsn->points= MEM_callocN(sizeof(bGPDspoint)*gsn->totpoints, "gp_stroke_points"); + memcpy(gsn->points, pt_tmp + i, sizeof(bGPDspoint)*gsn->totpoints); + + /* adjust existing stroke */ + gps->totpoints= i; + gps->points= MEM_callocN(sizeof(bGPDspoint)*gps->totpoints, "gp_stroke_points"); + memcpy(gps->points, pt_tmp, sizeof(bGPDspoint)*i); + + /* free temp buffer */ + MEM_freeN(pt_tmp); + + /* nothing left in stroke, so stop */ + return 1; + } +} + +/* eraser tool - evaluation per stroke */ +static void gp_stroke_eraser_dostroke (tGPsdata *p, short mcoords[][2], short moves, rcti *rect, bGPDframe *gpf, bGPDstroke *gps) +{ + bGPDspoint *pt1, *pt2; + short x0=0, y0=0, x1=0, y1=0; + short xyval[2]; + int i; + + if (gps->totpoints == 0) { + /* just free stroke */ + if (gps->points) + MEM_freeN(gps->points); + BLI_freelinkN(&gpf->strokes, gps); + } + else if (gps->totpoints == 1) { + /* get coordinates */ + if (gps->flag & GP_STROKE_3DSPACE) { + // FIXME: this may not be the correct correction + project_short(&gps->points->x, xyval); + x0= xyval[0]; + x1= xyval[1]; + } + else if (gps->flag & GP_STROKE_2DSPACE) { + ipoco_to_areaco_noclip(p->v2d, &gps->points->x, xyval); + x0= xyval[0]; + y0= xyval[1]; + } + else { + x0= (gps->points->x / 1000 * p->sa->winx); + y0= (gps->points->y / 1000 * p->sa->winy); + } + + /* do boundbox check first */ + if (BLI_in_rcti(rect, x0, y0)) { + /* only check if point is inside */ + if (lasso_inside(mcoords, moves, x0, y0)) { + /* free stroke */ + MEM_freeN(gps->points); + BLI_freelinkN(&gpf->strokes, gps); + } + } + } + else { + /* loop over the points in the stroke, checking for intersections + * - an intersection will require the stroke to be split + */ + for (i=0; (i+1) < gps->totpoints; i++) { + /* get points to work with */ + pt1= gps->points + i; + pt2= gps->points + i + 1; + + /* get coordinates */ + if (gps->flag & GP_STROKE_3DSPACE) { + // FIXME: may not be correct correction + project_short(&gps->points->x, xyval); + x0= xyval[0]; + x1= xyval[1]; + } + else if (gps->flag & GP_STROKE_2DSPACE) { + ipoco_to_areaco_noclip(p->v2d, &pt1->x, xyval); + x0= xyval[0]; + y0= xyval[1]; + + ipoco_to_areaco_noclip(p->v2d, &pt2->x, xyval); + x1= xyval[0]; + y1= xyval[1]; + } + else { + x0= (pt1->x / 1000 * p->sa->winx); + y0= (pt1->y / 1000 * p->sa->winy); + x1= (pt2->x / 1000 * p->sa->winx); + y1= (pt2->y / 1000 * p->sa->winy); + } + + /* check that point segment of the boundbox of the eraser stroke */ + if (BLI_in_rcti(rect, x0, y0) || BLI_in_rcti(rect, x1, y1)) { + /* check if point segment of stroke had anything to do with + * eraser region (either within stroke painted, or on its lines) + * - this assumes that linewidth is irrelevant + * - handled using the lasso-select checking code + */ + if (lasso_inside_edge(mcoords, moves, x0, y0, x1, x1)) { + /* if function returns true, break this loop (as no more point to check) */ + if (gp_stroke_eraser_splitdel(gpf, gps, i)) + break; + } + } + } + } +} + +/* -------- */ + +/* erase strokes which fall under the eraser strokes */ +static void gp_stroke_doeraser (tGPsdata *p) +{ + bGPdata *gpd= p->gpd; + bGPDframe *gpf= p->gpf; + bGPDstroke *gps, *gpn; + short (*mcoords)[2]; + rcti rect; + + /* get buffer-stroke coordinates as shorts array, and then get bounding box */ + mcoords= gp_stroke_eraser_2mco(gpd); + lasso_select_boundbox(&rect, mcoords, gpd->sbuffer_size); + + /* loop over strokes, checking segments for intersections */ + for (gps= gpf->strokes.first; gps; gps= gpn) { + gpn= gps->next; + gp_stroke_eraser_dostroke(p, mcoords, gpd->sbuffer_size, &rect, gpf, gps); + } + + /* free mcoords array */ + MEM_freeN(mcoords); +} + /* ---------- 'Paint' Tool ------------ */ /* init new stroke */ -static void gp_paint_initstroke (tGPsdata *p) +static void gp_paint_initstroke (tGPsdata *p, short paintmode) { /* get active layer (or add a new one if non-existent) */ p->gpl= gpencil_layer_getactive(p->gpd); @@ -1096,8 +1222,13 @@ static void gp_paint_initstroke (tGPsdata *p) } else p->gpf->flag |= GP_FRAME_PAINT; - - /* check if points will need to be made in 3d-space */ + + /* set 'eraser' for this stroke if using eraser */ + p->paintmode= paintmode; + if (p->paintmode == GP_PAINTMODE_ERASER) + p->gpd->sbuffer_sflag |= GP_STROKE_ERASER; + + /* check if points will need to be made in view-aligned space */ if (p->gpd->flag & GP_DATA_VIEWALIGN) { switch (p->sa->spacetype) { case SPACE_VIEW3D: @@ -1125,11 +1256,15 @@ static void gp_paint_initstroke (tGPsdata *p) /* finish off a stroke (clears buffer, but doesn't finish the paint operation) */ static void gp_paint_strokeend (tGPsdata *p) { - /* sanitize stroke-points in buffer */ - gp_stroke_smooth(p); - - /* transfer stroke to frame */ - gp_stroke_newfrombuffer(p); + /* check if doing eraser or not */ + if (p->gpd->sbuffer_sflag & GP_STROKE_ERASER) { + /* get rid of relevant sections of strokes */ + gp_stroke_doeraser(p); + } + else { + /* transfer stroke to frame */ + gp_stroke_newfrombuffer(p); + } /* clean up buffer now */ gp_session_validatebuffer(p); @@ -1151,13 +1286,13 @@ static void gp_paint_cleanup (tGPsdata *p) //BIF_undo_push("GPencil Stroke"); /* force redraw after drawing action */ - force_draw(0); + force_draw_plus(SPACE_ACTION, 0); } /* -------- */ /* main call to paint a new stroke */ -short gpencil_paint (short mousebutton) +short gpencil_paint (short mousebutton, short paintmode) { tGPsdata p; short prevmval[2], mval[2]; @@ -1170,7 +1305,7 @@ short gpencil_paint (short mousebutton) gp_session_cleanup(&p); return 0; } - gp_paint_initstroke(&p); + gp_paint_initstroke(&p, paintmode); if (p.status == GP_STATUS_ERROR) { gp_session_cleanup(&p); return 0; @@ -1202,7 +1337,7 @@ short gpencil_paint (short mousebutton) pressure = get_pressure(); /* only add current point to buffer if mouse moved (otherwise wait until it does) */ - if ((mval[0] != prevmval[0]) || (mval[1] != prevmval[1])) { + if (gp_stroke_filtermval(&p, mval, prevmval)) { /* try to add point */ ok= gp_stroke_addpoint(&p, mval, pressure); @@ -1245,7 +1380,10 @@ short gpencil_paint (short mousebutton) setcursor_space(p.sa->spacetype, CURSOR_STD); /* check size of buffer before cleanup, to determine if anything happened here */ - ok= p.gpd->sbuffer_size; + if (paintmode == GP_PAINTMODE_ERASER) + ok= (p.gpd->sbuffer_size > 1); + else + ok= p.gpd->sbuffer_size; /* cleanup */ gp_paint_cleanup(&p); @@ -1259,28 +1397,52 @@ short gpencil_paint (short mousebutton) /* All event (loops) handling checking if stroke drawing should be initiated * should call this function. */ -short gpencil_do_paint (ScrArea *sa) +short gpencil_do_paint (ScrArea *sa, short mbut) { bGPdata *gpd = gpencil_data_getactive(sa); - short mousebutton = L_MOUSE; /* for now, this is always on L_MOUSE*/ short retval= 0; /* check if possible to do painting */ if (gpd == NULL) return 0; - /* currently, we will only paint if: + /* currently, we will only 'paint' if: * 1. draw-mode on gpd is set (for accessibility reasons) * (single 'dots' are only available via this method) * 2. if shift-modifier is held + lmb -> 'quick paint' + * + * OR + * + * draw eraser stroke if: + * 1. using the eraser on a tablet + * 2. draw-mode on gpd is set (for accessiblity reasons) + * (eraser is mapped to right-mouse) + * 3. Alt + 'select' mouse-button + * i.e. if LMB = select: Alt-LMB + * if RMB = select: Alt-RMB */ - if (gpd->flag & GP_DATA_EDITPAINT) { - /* try to paint */ - retval = gpencil_paint(mousebutton); + if (get_activedevice() == 2) { + /* eraser on a tablet - always try to erase strokes */ + retval = gpencil_paint(mbut, GP_PAINTMODE_ERASER); } - else if (G.qual == LR_SHIFTKEY) { - /* try to paint */ - retval = gpencil_paint(mousebutton); + else if (gpd->flag & GP_DATA_EDITPAINT) { + /* try to paint/erase */ + if (mbut == L_MOUSE) + retval = gpencil_paint(mbut, GP_PAINTMODE_DRAW); + else if (mbut == R_MOUSE) + retval = gpencil_paint(mbut, GP_PAINTMODE_ERASER); + } + else if (!(gpd->flag & GP_DATA_LMBPLOCK)) { + /* try to paint/erase as not locked */ + if ((G.qual == LR_SHIFTKEY) && (mbut == L_MOUSE)) { + retval = gpencil_paint(mbut, GP_PAINTMODE_DRAW); + } + else if (G.qual == LR_ALTKEY) { + if ((U.flag & USER_LMOUSESELECT) && (mbut == L_MOUSE)) + retval = gpencil_paint(mbut, GP_PAINTMODE_ERASER); + else if (!(U.flag & USER_LMOUSESELECT) && (mbut == R_MOUSE)) + retval = gpencil_paint(mbut, GP_PAINTMODE_ERASER); + } } /* return result of trying to paint */ diff --git a/source/blender/src/header_action.c b/source/blender/src/header_action.c index 50d343ca470..4bb7bb9677e 100644 --- a/source/blender/src/header_action.c +++ b/source/blender/src/header_action.c @@ -1683,7 +1683,7 @@ void action_buttons(void) "Channel", xco, -2, xmax-3, 24, ""); xco+= xmax; } - else if ((G.saction->gpd) && (G.saction->mode==SACTCONT_GPENCIL)) { + else if (G.saction->mode==SACTCONT_GPENCIL) { xmax= GetButStringLength("Channel"); uiDefPulldownBut(block, action_gplayermenu, NULL, "Channel", xco, -2, xmax-3, 24, ""); @@ -1722,24 +1722,7 @@ void action_buttons(void) xco += (90 + 8); /* MODE-DEPENDENT DRAWING */ - if (G.saction->mode == SACTCONT_GPENCIL) { - char gp_name[64]; - - /* pin button */ - uiDefIconButS(block, ICONTOG, B_ACTPIN, ICON_PIN_DEHLT, xco,0,XIC,YIC, &G.saction->pin, 0, 0, 0, 0, "Keeps this view displaying the current data regardless of what Grease Pencil set is active"); - xco += (XIC + 5); - - /* just a simple string to help identify if any content */ - glRasterPos2f((float)xco, 5.0); - BIF_RasterPos((float)xco, 5.0); // stupid texture fonts - BIF_ThemeColor(TH_TEXT); - - sprintf(gp_name, (G.saction->gpd)?"Grease Pencil Data":""); - xmax= GetButStringLength(gp_name); - BIF_DrawString(uiBlockGetCurFont(block), gp_name, (U.transopts & USER_TR_BUTTONS)); - xco += xmax; - } - else { + if (G.saction->mode != SACTCONT_GPENCIL) { /* NAME ETC */ ob= OBACT; from = (ID *)ob; diff --git a/source/blender/src/header_ipo.c b/source/blender/src/header_ipo.c index 15caf325ec6..59d542e72ec 100644 --- a/source/blender/src/header_ipo.c +++ b/source/blender/src/header_ipo.c @@ -970,7 +970,7 @@ static char *ipo_modeselect_pup(void) if(ob && ob->type==OB_LAMP) str += sprintf(str,formatstring, "Lamp",ID_LA, ICON_LAMP); - if(ob && give_current_texture(ob, ob->actcol)) + if((ob && give_current_texture(ob, ob->actcol))||(give_current_world_texture())) str += sprintf(str,formatstring, "Texture",ID_TE, ICON_TEXTURE); if(ob){ diff --git a/source/blender/src/header_view3d.c b/source/blender/src/header_view3d.c index 71bf0cd9bd4..0b48db461e6 100644 --- a/source/blender/src/header_view3d.c +++ b/source/blender/src/header_view3d.c @@ -2196,6 +2196,7 @@ static uiBlock *view3d_edit_object_copyattrmenu(void *arg_unused) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mass|Ctrl C, 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Damping|Ctrl C, 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "All Physical Attributes|Ctrl C, 11", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Properties|Ctrl C, 9", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Logic Bricks|Ctrl C, 10", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Protected Transform |Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 29, ""); diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c index ba8649eaa86..e7b5b176979 100644 --- a/source/blender/src/interface.c +++ b/source/blender/src/interface.c @@ -532,7 +532,7 @@ static int ui_but_copy_paste(uiBut *but, char mode) /* give butfunc the original text too */ /* feature used for bone renaming, channels, etc */ if(but->func_arg2==NULL) { - strncpy(backstr, but->drawstr, UI_MAX_DRAW_STR); + strncpy(backstr, but->poin, UI_MAX_DRAW_STR); but->func_arg2= backstr; } strncpy(but->poin, but_copypaste_str, but->max); @@ -5651,6 +5651,8 @@ static int ui_auto_themecol(uiBut *but) // (weak!) detect if it is a blockloop if(but->block->dt == UI_EMBOSSP) return TH_MENU_ITEM; return TH_BUT_POPUP; + case ROUNDBOX: + return TH_PANEL; default: return TH_BUT_NEUTRAL; } diff --git a/source/blender/src/interface_draw.c b/source/blender/src/interface_draw.c index e7041e60003..83ae449b989 100644 --- a/source/blender/src/interface_draw.c +++ b/source/blender/src/interface_draw.c @@ -2351,7 +2351,7 @@ static void ui_draw_roundbox(uiBut *but) { glEnable(GL_BLEND); - BIF_ThemeColorShadeAlpha(TH_PANEL, but->a2, but->a2); + BIF_ThemeColorShadeAlpha(but->themecol, but->a2, but->a2); uiSetRoundBox(but->a1); gl_round_box(GL_POLYGON, but->x1, but->y1, but->x2, but->y2, but->min); diff --git a/source/blender/src/meshlaplacian.c b/source/blender/src/meshlaplacian.c index 4d84672185a..60f569ecf0e 100644 --- a/source/blender/src/meshlaplacian.c +++ b/source/blender/src/meshlaplacian.c @@ -1281,9 +1281,9 @@ static int meshdeform_inside_cage(MeshDeformBind *mdb, float *co) outside[1] = co[1] + (mdb->max[1] - mdb->min[1] + 1.0f)*MESHDEFORM_OFFSET[i][1]; outside[2] = co[2] + (mdb->max[2] - mdb->min[2] + 1.0f)*MESHDEFORM_OFFSET[i][2]; + VECCOPY(start, co); VECSUB(dir, outside, start); Normalize(dir); - VECCOPY(start, co); isect = meshdeform_ray_tree_intersect(mdb, start, outside); if(isect && !isect->facing) diff --git a/source/blender/src/outliner.c b/source/blender/src/outliner.c index 683b06aafc4..3f328a0cfb2 100644 --- a/source/blender/src/outliner.c +++ b/source/blender/src/outliner.c @@ -68,6 +68,7 @@ #include "BKE_main.h" #include "BKE_material.h" #include "BKE_modifier.h" +#include "BKE_object.h" #include "BKE_screen.h" #include "BKE_scene.h" #include "BKE_utildefines.h" @@ -698,6 +699,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i for (index=0,md=ob->modifiers.first; md; index++,md=md->next) { TreeElement *te = outliner_add_element(soops, &temod->subtree, ob, temod, TSE_MODIFIER, index); te->name= md->name; + te->directdata = md; if (md->type==eModifierType_Lattice) { outliner_add_element(soops, &te->subtree, ((LatticeModifierData*) md)->object, te, TSE_LINKED_OB, 0); @@ -3523,6 +3525,27 @@ static void restrictbutton_r_lay_cb(void *poin, void *poin2) allqueue(REDRAWBUTSSCENE, 0); } +static void restrictbutton_modifier_cb(void *poin, void *poin2) +{ + Object *ob = (Object *)poin; + + DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); + object_handle_update(ob); + countall(); + + allqueue(REDRAWOOPS, 0); + allqueue(REDRAWVIEW3D, 0); + allqueue(REDRAWBUTSEDIT, 0); + allqueue(REDRAWBUTSOBJECT, 0); +} + +static void restrictbutton_bone_cb(void *poin, void *poin2) +{ + allqueue(REDRAWOOPS, 0); + allqueue(REDRAWVIEW3D, 0); + allqueue(REDRAWBUTSEDIT, 0); +} + static void namebutton_cb(void *tep, void *oldnamep) { SpaceOops *soops= curarea->spacedata.first; @@ -3631,7 +3654,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, SpaceOops *soops, ListBas uiBut *bt; TreeElement *te; TreeStoreElem *tselem; - Object *ob; + Object *ob = NULL; for(te= lb->first; te; te= te->next) { tselem= TREESTORE(te); @@ -3639,7 +3662,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, SpaceOops *soops, ListBas /* objects have toggle-able restriction flags */ if(tselem->type==0 && te->idcode==ID_OB) { ob = (Object *)tselem->id; - + uiBlockSetEmboss(block, UI_EMBOSSN); bt= uiDefIconButBitS(block, ICONTOG, OB_RESTRICT_VIEW, REDRAWALL, ICON_RESTRICT_VIEW_OFF, (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, te->ys, 17, OL_H-1, &(ob->restrictflag), 0, 0, 0, 0, "Restrict/Allow visibility in the 3D View"); @@ -3685,6 +3708,40 @@ static void outliner_draw_restrictbuts(uiBlock *block, SpaceOops *soops, ListBas uiBlockSetEmboss(block, UI_EMBOSS); } + else if(tselem->type==TSE_MODIFIER) { + ModifierData *md= (ModifierData *)te->directdata; + ob = (Object *)tselem->id; + + uiBlockSetEmboss(block, UI_EMBOSSN); + bt= uiDefIconButBitI(block, ICONTOGN, eModifierMode_Realtime, REDRAWALL, ICON_RESTRICT_VIEW_OFF, + (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, te->ys, 17, OL_H-1, &(md->mode), 0, 0, 0, 0, "Restrict/Allow visibility in the 3D View"); + uiButSetFunc(bt, restrictbutton_modifier_cb, ob, NULL); + uiButSetFlag(bt, UI_NO_HILITE); + + bt= uiDefIconButBitI(block, ICONTOGN, eModifierMode_Render, REDRAWALL, ICON_RESTRICT_RENDER_OFF, + (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_RENDERX, te->ys, 17, OL_H-1, &(md->mode), 0, 0, 0, 0, "Restrict/Allow renderability"); + uiButSetFunc(bt, restrictbutton_modifier_cb, ob, NULL); + uiButSetFlag(bt, UI_NO_HILITE); + } + else if(tselem->type==TSE_POSE_CHANNEL) { + bPoseChannel *pchan= (bPoseChannel *)te->directdata; + Bone *bone = pchan->bone; + + uiBlockSetEmboss(block, UI_EMBOSSN); + bt= uiDefIconButBitI(block, ICONTOG, BONE_HIDDEN_P, REDRAWALL, ICON_RESTRICT_VIEW_OFF, + (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, te->ys, 17, OL_H-1, &(bone->flag), 0, 0, 0, 0, "Restrict/Allow visibility in the 3D View"); + uiButSetFunc(bt, restrictbutton_bone_cb, NULL, NULL); + uiButSetFlag(bt, UI_NO_HILITE); + } + else if(tselem->type==TSE_EBONE) { + EditBone *ebone= (EditBone *)te->directdata; + + uiBlockSetEmboss(block, UI_EMBOSSN); + bt= uiDefIconButBitI(block, ICONTOG, BONE_HIDDEN_A, REDRAWALL, ICON_RESTRICT_VIEW_OFF, + (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, te->ys, 17, OL_H-1, &(ebone->flag), 0, 0, 0, 0, "Restrict/Allow visibility in the 3D View"); + uiButSetFunc(bt, restrictbutton_bone_cb, NULL, NULL); + uiButSetFlag(bt, UI_NO_HILITE); + } } if((tselem->flag & TSE_CLOSED)==0) outliner_draw_restrictbuts(block, soops, &te->subtree); diff --git a/source/blender/src/poseobject.c b/source/blender/src/poseobject.c index cc08bf53a72..b054b435002 100644 --- a/source/blender/src/poseobject.c +++ b/source/blender/src/poseobject.c @@ -180,27 +180,26 @@ bPoseChannel *get_active_posechannel (Object *ob) return NULL; } -/* if a selected or active bone is protected, throw error and return 1 */ +/* if a selected or active bone is protected, throw error (oonly if warn==1) and return 1 */ /* only_selected==1 : the active bone is allowed to be protected */ -static int pose_has_protected_selected(Object *ob, int only_selected) +static short pose_has_protected_selected(Object *ob, short only_selected, short warn) { - /* check protection */ - if(ob->proxy) { + if (ob->proxy) { bPoseChannel *pchan; bArmature *arm= ob->data; - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if(pchan->bone && (pchan->bone->layer & arm->layer)) { - if(pchan->bone->layer & arm->layer_protected) { - if(only_selected && (pchan->bone->flag & BONE_ACTIVE)); - else if(pchan->bone->flag & (BONE_ACTIVE|BONE_SELECTED)) + for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { + if (pchan->bone && (pchan->bone->layer & arm->layer)) { + if (pchan->bone->layer & arm->layer_protected) { + if (only_selected && (pchan->bone->flag & BONE_ACTIVE)); + else if (pchan->bone->flag & (BONE_ACTIVE|BONE_SELECTED)) break; } } } - if(pchan) { - error("Cannot change Proxy protected bones"); + if (pchan) { + if (warn) error("Cannot change Proxy protected bones"); return 1; } } @@ -540,7 +539,7 @@ void pose_clear_IK(void) if(!ob && !ob->pose) return; if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return; - if(pose_has_protected_selected(ob, 0)) + if(pose_has_protected_selected(ob, 0, 1)) return; if(okee("Remove IK constraint(s)")==0) return; @@ -581,7 +580,7 @@ void pose_clear_constraints(void) if(!ob && !ob->pose) return; if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return; - if(pose_has_protected_selected(ob, 0)) + if(pose_has_protected_selected(ob, 0, 1)) return; if(okee("Remove Constraints")==0) return; @@ -612,38 +611,49 @@ void pose_copy_menu(void) Object *ob= OBACT; bArmature *arm= ob->data; bPoseChannel *pchan, *pchanact; - short nr; + short nr=0; int i=0; /* paranoia checks */ - if(!ob && !ob->pose) return; - if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return; + if (ELEM(NULL, ob, ob->pose)) return; + if ((ob==G.obedit) || (ob->flag & OB_POSEMODE)==0) return; /* find active */ - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if(pchan->bone->flag & BONE_ACTIVE) break; + for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { + if (pchan->bone->flag & BONE_ACTIVE) + break; } - if(pchan==NULL) return; - - if(pose_has_protected_selected(ob, 1)) - return; - + if (pchan==NULL) return; pchanact= pchan; - i= BLI_countlist(&(pchanact->constraints)); /* if there are 24 or less, allow for the user to select constraints */ - if (i<25) - nr= pupmenu("Copy Pose Attributes %t|Local Location%x1|Local Rotation%x2|Local Size%x3|%l|Visual Location %x9|Visual Rotation%x10|Visual Size%x11|%l|Constraints (All)%x4|Constraints...%x5|%l|Transform Locks%x6|IK Limits%x7|Bone Shape%x8"); - else - nr= pupmenu("Copy Pose Attributes %t|Local Location%x1|Local Rotation%x2|Local Size%x3|%l|Visual Location %x9|Visual Rotation%x10|Visual Size%x11|%l|Constraints (All)%x4|%l|Transform Locks%x6|IK Limits%x7|Bone Shape%x8"); + /* if proxy-protected bones selected, some things (such as locks + displays) shouldn't be changable, + * but for constraints (just add local constraints) + */ + if (pose_has_protected_selected(ob, 1, 0)) { + i= BLI_countlist(&(pchanact->constraints)); /* if there are 24 or less, allow for the user to select constraints */ + if (i < 25) + nr= pupmenu("Copy Pose Attributes %t|Local Location%x1|Local Rotation%x2|Local Size%x3|%l|Visual Location %x9|Visual Rotation%x10|Visual Size%x11|%l|Constraints (All)%x4|Constraints...%x5"); + else + nr= pupmenu("Copy Pose Attributes %t|Local Location%x1|Local Rotation%x2|Local Size%x3|%l|Visual Location %x9|Visual Rotation%x10|Visual Size%x11|%l|Constraints (All)%x4"); + } + else { + i= BLI_countlist(&(pchanact->constraints)); /* if there are 24 or less, allow for the user to select constraints */ + if (i < 25) + nr= pupmenu("Copy Pose Attributes %t|Local Location%x1|Local Rotation%x2|Local Size%x3|%l|Visual Location %x9|Visual Rotation%x10|Visual Size%x11|%l|Constraints (All)%x4|Constraints...%x5|%l|Transform Locks%x6|IK Limits%x7|Bone Shape%x8"); + else + nr= pupmenu("Copy Pose Attributes %t|Local Location%x1|Local Rotation%x2|Local Size%x3|%l|Visual Location %x9|Visual Rotation%x10|Visual Size%x11|%l|Constraints (All)%x4|%l|Transform Locks%x6|IK Limits%x7|Bone Shape%x8"); + } - if(nr==-1) return; - if(nr!=5) { - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if( (arm->layer & pchan->bone->layer) && - (pchan->bone->flag & BONE_SELECTED) && - (pchan!=pchanact) - ) { + if (nr <= 0) + return; + + if (nr != 5) { + for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { + if ( (arm->layer & pchan->bone->layer) && + (pchan->bone->flag & BONE_SELECTED) && + (pchan != pchanact) ) + { switch (nr) { case 1: /* Local Location */ VECCOPY(pchan->loc, pchanact->loc); @@ -656,13 +666,26 @@ void pose_copy_menu(void) break; case 4: /* All Constraints */ { - free_constraints(&pchan->constraints); - copy_constraints(&pchan->constraints, &pchanact->constraints); - pchan->constflag = pchanact->constflag; + ListBase tmp_constraints = {NULL, NULL}; - if (ob->pose) { - ob->pose->flag |= POSE_RECALC; + /* copy constraints to tmpbase and apply 'local' tags before + * appending to list of constraints for this channel + */ + copy_constraints(&tmp_constraints, &pchanact->constraints); + if ((ob->proxy) && (pchan->bone->layer & arm->layer_protected)) { + bConstraint *con; + + /* add proxy-local tags */ + for (con= tmp_constraints.first; con; con= con->next) + con->flag |= CONSTRAINT_PROXY_LOCAL; } + addlisttolist(&pchan->constraints, &tmp_constraints); + + /* update flags (need to add here, not just copy) */ + pchan->constflag |= pchanact->constflag; + + if (ob->pose) + ob->pose->flag |= POSE_RECALC; } break; case 6: /* Transform Locks */ @@ -703,12 +726,13 @@ void pose_copy_menu(void) } } } - } else { /* constraints, optional */ + } + else { /* constraints, optional (note: max we can have is 24 constraints) */ bConstraint *con, *con_back; int const_toggle[24]; - ListBase const_copy={0, 0}; + ListBase const_copy = {NULL, NULL}; - duplicatelist (&const_copy, &(pchanact->constraints)); + duplicatelist(&const_copy, &(pchanact->constraints)); /* build the puplist of constraints */ for (con = pchanact->constraints.first, i=0; con; con=con->next, i++){ @@ -723,32 +747,46 @@ void pose_copy_menu(void) /* now build a new listbase from the options selected */ for (i=0, con=const_copy.first; con; i++) { + /* if not selected, free/remove it from the list */ if (!const_toggle[i]) { con_back= con->next; BLI_freelinkN(&const_copy, con); con= con_back; - } else { + } + else con= con->next; - } } /* Copy the temo listbase to the selected posebones */ - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if( (arm->layer & pchan->bone->layer) && - (pchan->bone->flag & BONE_SELECTED) && - (pchan!=pchanact) - ) { - free_constraints(&pchan->constraints); - copy_constraints(&pchan->constraints, &const_copy); - pchan->constflag = pchanact->constflag; + for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { + if ( (arm->layer & pchan->bone->layer) && + (pchan->bone->flag & BONE_SELECTED) && + (pchan!=pchanact) ) + { + ListBase tmp_constraints = {NULL, NULL}; + + /* copy constraints to tmpbase and apply 'local' tags before + * appending to list of constraints for this channel + */ + copy_constraints(&tmp_constraints, &const_copy); + if ((ob->proxy) && (pchan->bone->layer & arm->layer_protected)) { + bConstraint *con; + + /* add proxy-local tags */ + for (con= tmp_constraints.first; con; con= con->next) + con->flag |= CONSTRAINT_PROXY_LOCAL; + } + addlisttolist(&pchan->constraints, &tmp_constraints); + + /* update flags (need to add here, not just copy) */ + pchan->constflag |= pchanact->constflag; } } BLI_freelistN(&const_copy); update_pose_constraint_flags(ob->pose); /* we could work out the flags but its simpler to do this */ - if (ob->pose) { + if (ob->pose) ob->pose->flag |= POSE_RECALC; - } } DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); // and all its relations @@ -808,7 +846,7 @@ void paste_posebuf (int flip) /* // disabled until protected bones in proxies follow the rules everywhere else! - if(pose_has_protected_selected(ob, 1)) + if(pose_has_protected_selected(ob, 1, 1)) return; */ @@ -1249,7 +1287,7 @@ void pose_flip_names(void) if(!ob && !ob->pose) return; if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return; - if(pose_has_protected_selected(ob, 0)) + if(pose_has_protected_selected(ob, 0, 1)) return; for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { @@ -1282,7 +1320,7 @@ void pose_autoside_names(short axis) if (ELEM(NULL, ob, ob->pose)) return; if (ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return; - if (pose_has_protected_selected(ob, 0)) + if (pose_has_protected_selected(ob, 0, 1)) return; for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { @@ -1415,7 +1453,7 @@ void pose_movetolayer(void) /* pose-channel layers */ bPoseChannel *pchan; - if (pose_has_protected_selected(ob, 0)) + if (pose_has_protected_selected(ob, 0, 1)) return; for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { diff --git a/source/blender/src/sequence.c b/source/blender/src/sequence.c index 9426548dc38..7e2ffc3ba63 100644 --- a/source/blender/src/sequence.c +++ b/source/blender/src/sequence.c @@ -1473,8 +1473,8 @@ static void input_preprocess(Sequence * seq, TStripElem* se, int cfra) dy = sy; if (seq->flag & SEQ_USE_TRANSFORM) { - dx = seqrectx; - dy = seqrecty; + dx = G.scene->r.xsch; + dy = G.scene->r.ysch; } if (c.top + c.bottom >= se->ibuf->y || diff --git a/source/blender/src/space.c b/source/blender/src/space.c index 92efb477095..b4702788e0c 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -1205,9 +1205,12 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt) return; /* return if event was processed (swallowed) by handler(s) */ } - if(gpencil_do_paint(sa)) return; + if(gpencil_do_paint(sa, L_MOUSE)) return; if(BIF_do_manipulator(sa)) return; } + else if(event==RIGHTMOUSE) { + if(gpencil_do_paint(sa, R_MOUSE)) return; + } /* swap mouse buttons based on user preference */ if (U.flag & USER_LMOUSESELECT) { @@ -2711,6 +2714,8 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt) case DELKEY: if(G.qual==0 || G.qual==LR_SHIFTKEY) delete_context_selected(); + if(G.qual==LR_ALTKEY) + gpencil_delete_menu(); break; case YKEY: if((G.qual==0) && (G.obedit)) { @@ -4823,8 +4828,11 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt) if( uiDoBlocks(&curarea->uiblocks, event, 1)!=UI_NOTHING ) event= 0; /* grease-pencil defaults to leftmouse */ - if(event==LEFTMOUSE) { - if(gpencil_do_paint(sa)) return; + if (event == LEFTMOUSE) { + if(gpencil_do_paint(sa, L_MOUSE)) return; + } + else if (event == RIGHTMOUSE) { + if(gpencil_do_paint(sa, R_MOUSE)) return; } /* swap mouse buttons based on user preference */ @@ -5099,6 +5107,10 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt) if((G.qual==0)) del_seq(); } + else if(G.qual==LR_ALTKEY) { + if(sseq->mainb) + gpencil_delete_menu(); + } break; case PAD1: case PAD2: case PAD4: case PAD8: seq_viewzoom(event, (G.qual & LR_SHIFTKEY)==0); @@ -5107,7 +5119,10 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt) } } - if(doredraw) scrarea_queue_winredraw(curarea); + if(doredraw) { + scrarea_queue_winredraw(curarea); + scrarea_queue_headredraw(curarea); + } } diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c index 706b079432c..8f83434e528 100644 --- a/source/blender/src/transform_conversions.c +++ b/source/blender/src/transform_conversions.c @@ -1089,6 +1089,8 @@ static void createTransArmatureVerts(TransInfo *t) VECCOPY (td->center, td->iloc); td->loc= ebo->tail; td->flag= TD_SELECTED; + if (ebo->flag & BONE_EDITMODE_LOCKED) + td->protectflag = OB_LOCK_LOC|OB_LOCK_ROT|OB_LOCK_SCALE; Mat3CpyMat3(td->smtx, smtx); Mat3CpyMat3(td->mtx, mtx); @@ -1104,6 +1106,8 @@ static void createTransArmatureVerts(TransInfo *t) VECCOPY (td->center, td->iloc); td->loc= ebo->head; td->flag= TD_SELECTED; + if (ebo->flag & BONE_EDITMODE_LOCKED) + td->protectflag = OB_LOCK_LOC|OB_LOCK_ROT|OB_LOCK_SCALE; Mat3CpyMat3(td->smtx, smtx); Mat3CpyMat3(td->mtx, mtx); diff --git a/source/blender/src/transform_manipulator.c b/source/blender/src/transform_manipulator.c index 050360887b4..709879f142b 100644 --- a/source/blender/src/transform_manipulator.c +++ b/source/blender/src/transform_manipulator.c @@ -170,6 +170,13 @@ static void stats_pose(View3D *v3d, bPoseChannel *pchan) } } +/* for editmode*/ +static void stats_editbone(View3D *v3d, EditBone *ebo) +{ + if (ebo->flag & BONE_EDITMODE_LOCKED) + protectflag_to_drawflags(OB_LOCK_LOC|OB_LOCK_ROT|OB_LOCK_SCALE, &v3d->twdrawflag); +} + /* only counts the parent selection, and tags transform flag */ /* bad call... should re-use method from transform_conversion once */ static void count_bone_select(TransInfo *t, bArmature *arm, ListBase *lb, int do_it) @@ -258,6 +265,9 @@ int calc_manipulator_stats(ScrArea *sa) calc_tw_center(ebo->head); totsel++; } + if (ebo->flag & BONE_SELECTED) { + stats_editbone(v3d, ebo); + } } } } diff --git a/source/creator/creator.c b/source/creator/creator.c index 9589f1e3e94..e17b0f66977 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -618,8 +618,23 @@ int main(int argc, char **argv) if (G.scene) { if (a < argc) { int frame= MIN2(MAXFRAME, MAX2(1, atoi(argv[a]))); + int slink_flag= 0; Render *re= RE_NewRender(G.scene->id.name); + + if (G.f & G_DOSCRIPTLINKS) { + BPY_do_all_scripts(SCRIPT_RENDER); + /* avoid FRAMECHANGED slink event + * (should only be triggered in anims): */ + G.f &= ~G_DOSCRIPTLINKS; + slink_flag= 1; + } + RE_BlenderAnim(re, G.scene, frame, frame); + + if (slink_flag) { + G.f |= G_DOSCRIPTLINKS; + BPY_do_all_scripts(SCRIPT_POSTRENDER); + } } } else { printf("\nError: no blend loaded. cannot use '-f'.\n"); @@ -628,7 +643,14 @@ int main(int argc, char **argv) case 'a': if (G.scene) { Render *re= RE_NewRender(G.scene->id.name); + + if (G.f & G_DOSCRIPTLINKS) + BPY_do_all_scripts(SCRIPT_RENDER); + RE_BlenderAnim(re, G.scene, G.scene->r.sfra, G.scene->r.efra); + + if (G.f & G_DOSCRIPTLINKS) + BPY_do_all_scripts(SCRIPT_POSTRENDER); } else { printf("\nError: no blend loaded. cannot use '-a'.\n"); } diff --git a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp index ed6ea7c5f6a..da52be56d1b 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp @@ -170,6 +170,7 @@ void BL_RenderText(int mode,const char* textstr,int textlen,struct MTFace* tface void DisableForText() { if(glIsEnabled(GL_BLEND)) glDisable(GL_BLEND); + if(glIsEnabled(GL_ALPHA_TEST)) glDisable(GL_ALPHA_TEST); if(glIsEnabled(GL_LIGHTING)) { glDisable(GL_LIGHTING); diff --git a/source/gameengine/BlenderRoutines/KX_BlenderPolyMaterial.cpp b/source/gameengine/BlenderRoutines/KX_BlenderPolyMaterial.cpp deleted file mode 100644 index d173b1c66d9..00000000000 --- a/source/gameengine/BlenderRoutines/KX_BlenderPolyMaterial.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/** - * $Id$ - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#include "KX_BlenderPolyMaterial.h" -#include "BKE_mesh.h" - -#ifdef HAVE_CONFIG_H -#include -#endif -#if 0 -KX_BlenderPolyMaterial::KX_BlenderPolyMaterial(const STR_String &texname, - bool ba, - const STR_String& matname, - int tile, - int tilexrep, - int tileyrep, - int mode, - bool transparant, - bool zsort, - int lightlayer, - bool bIsTriangle, - void* clientobject, - struct MTFace* tface) - : RAS_IPolyMaterial(texname, - false, - matname, - tile, - tilexrep, - tileyrep, - mode, - transparant, - zsort, - lightlayer, - bIsTriangle, - clientobject), - m_tface(tface) -{ -} - -void KX_BlenderPolyMaterial::Activate(RAS_IRasterizer* rasty, TCachingInfo& cachingInfo) const -{ - - - if (GetCachingInfo() != cachingInfo) - { - if (!cachingInfo) - { - set_tpage(NULL); - } - cachingInfo = GetCachingInfo(); - - if ((m_drawingmode & 4)&& (rasty->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED)) - { - update_realtime_texture((struct MTFace*) m_tface, rasty->GetTime()); - set_tpage(m_tface); - rasty->EnableTextures(true); - } - else - { - set_tpage(NULL); - rasty->EnableTextures(false); - } - - if(m_drawingmode & RAS_IRasterizer::KX_TWOSIDE) - { - rasty->SetCullFace(false); - } - else - { - rasty->SetCullFace(true); - } - - if (m_drawingmode & RAS_IRasterizer::KX_LINES) { - rasty->SetLines(true); - } - else { - rasty->SetLines(false); - } - } - - rasty->SetSpecularity(m_specular[0],m_specular[1],m_specular[2],m_specularity); - rasty->SetShinyness(m_shininess); - rasty->SetDiffuse(m_diffuse[0], m_diffuse[1],m_diffuse[2], 1.0); -} - - -#endif - - diff --git a/source/gameengine/BlenderRoutines/KX_BlenderPolyMaterial.h b/source/gameengine/BlenderRoutines/KX_BlenderPolyMaterial.h deleted file mode 100644 index 35823b2125b..00000000000 --- a/source/gameengine/BlenderRoutines/KX_BlenderPolyMaterial.h +++ /dev/null @@ -1,99 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ -#ifndef __KX_BLENDERPOLYMATERIAL -#define __KX_BLENDERPOLYMATERIAL - -#include "RAS_MaterialBucket.h" -#include "RAS_IRasterizer.h" - -struct MTFace; -extern "C" int set_tpage(MTFace* tface); /* Worst hack ever */ - -#if 0 -class KX_BlenderPolyMaterial : public RAS_IPolyMaterial -{ - /** Blender texture face structure. */ - MTFace* m_tface; - -public: - - KX_BlenderPolyMaterial(const STR_String &texname, - bool ba, - const STR_String& matname, - int tile, - int tilexrep, - int tileyrep, - int mode, - bool transparant, - bool zsort, - int lightlayer, - bool bIsTriangle, - void* clientobject, - struct MTFace* tface); - - /** - * Returns the caching information for this material, - * This can be used to speed up the rasterizing process. - * @return The caching information. - */ - virtual TCachingInfo GetCachingInfo(void) const; - - /** - * Activates the material in the (OpenGL) rasterizer. - * On entry, the cachingInfo contains info about the last activated material. - * On exit, the cachingInfo should contain updated info about this material. - * @param rasty The rasterizer in which the material should be active. - * @param cachingInfo The information about the material used to speed up rasterizing. - */ - virtual void Activate(RAS_IRasterizer* rasty, TCachingInfo& cachingInfo) const; - - /** - * Returns the Blender texture face structure that is used for this material. - * @return The material's texture face. - */ - MTFace* GetMTFace(void) const; -protected: -private: -}; - - -inline MTFace* KX_BlenderPolyMaterial::GetMTFace(void) const -{ - return m_tface; -} - -inline RAS_IPolyMaterial::TCachingInfo KX_BlenderPolyMaterial::GetCachingInfo(void) const -{ - return GetMTFace(); -} - -#endif - -#endif // __KX_BLENDERPOLYMATERIAL - diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp index 220d174d464..e4eff163d5b 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp @@ -40,7 +40,6 @@ // it needs the gameobject and the sumo physics scene for a raycast #include "KX_GameObject.h" -#include "KX_BlenderPolyMaterial.h" #include "KX_PolygonMaterial.h" #include "KX_BlenderMaterial.h" diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index 5d6dd694765..2ee8b54a014 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -57,24 +57,12 @@ BL_ActionActuator::~BL_ActionActuator() { - - if (m_pose) { - free_pose_channels(m_pose); - MEM_freeN(m_pose); - m_pose = NULL; - }; - - if (m_userpose){ - free_pose_channels(m_userpose); - MEM_freeN(m_userpose); - m_userpose=NULL; - } - if (m_blendpose) { - free_pose_channels(m_blendpose); - MEM_freeN(m_blendpose); - m_blendpose = NULL; - }; - + if (m_pose) + free_pose(m_pose); + if (m_userpose) + free_pose(m_userpose); + if (m_blendpose) + free_pose(m_blendpose); } void BL_ActionActuator::ProcessReplica(){ diff --git a/source/gameengine/Converter/BL_ArmatureObject.cpp b/source/gameengine/Converter/BL_ArmatureObject.cpp index f73d5b42a01..09f1d9d4d87 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.cpp +++ b/source/gameengine/Converter/BL_ArmatureObject.cpp @@ -82,10 +82,8 @@ void BL_ArmatureObject::ProcessReplica(BL_ArmatureObject *replica) BL_ArmatureObject::~BL_ArmatureObject() { - if (m_mrdPose){ - free_pose_channels(m_mrdPose); - MEM_freeN(m_mrdPose); - } + if (m_mrdPose) + free_pose(m_mrdPose); } /* note, you can only call this for exisiting Armature objects, and not mix it with other Armatures */ @@ -172,12 +170,13 @@ void BL_ArmatureObject::GetMRDPose(bPose **pose) // copy_pose (&m_mrdPose, m_pose, 0); //} - if (!*pose) + if (!*pose) { // must duplicate the constraints too otherwise we have corruption in free_pose_channels() // because it will free the blender constraints. // Ideally, blender should rememeber that the constraints were not copied so that // free_pose_channels() would not free them. copy_pose(pose, m_objArma->pose, 1); + } else extract_pose_from_pose(*pose, m_objArma->pose); diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 1f1ac6da119..f44318120e8 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -136,8 +136,12 @@ #include "BKE_mesh.h" #include "MT_Point3.h" +#include "BLI_arithb.h" + extern "C" { - #include "BKE_customdata.h" +#include "BKE_customdata.h" +#include "BKE_cdderivedmesh.h" +#include "BKE_DerivedMesh.h" } #include "BKE_material.h" /* give_current_material */ @@ -309,7 +313,6 @@ typedef struct MTF_localLayer // ------------------------------------ BL_Material* ConvertMaterial( - Mesh* mesh, Material *mat, MTFace* tface, const char *tfaceName, @@ -323,15 +326,16 @@ BL_Material* ConvertMaterial( //this needs some type of manager BL_Material *material = new BL_Material(); - int numchan = -1; + int numchan = -1, texalpha = 0; bool validmat = (mat!=0); - bool validface = (mesh->mtface && tface); + bool validface = (tface!=0); short type = 0; if( validmat ) type = 1; // material color material->IdMode = DEFAULT_BLENDER; + material->glslmat = (validmat)? glslmat: false; // -------------------------------- if(validmat) { @@ -367,12 +371,13 @@ BL_Material* ConvertMaterial( if(i==0 && facetex ) { Image*tmp = (Image*)(tface->tpage); + if(tmp) { material->img[i] = tmp; material->texname[i] = material->img[i]->id.name; material->flag[i] |= ( tface->transp &TF_ALPHA )?USEALPHA:0; material->flag[i] |= ( tface->transp &TF_ADD )?CALCALPHA:0; - material->ras_mode|= ( tface->transp &(TF_ADD | TF_ALPHA))?TRANSP:0; + if(material->img[i]->flag & IMA_REFLECT) material->mapping[i].mapping |= USEREFL; else @@ -430,6 +435,8 @@ BL_Material* ConvertMaterial( material->flag[i] |= ( mttmp->mapto & MAP_ALPHA )?TEXALPHA:0; material->flag[i] |= ( mttmp->texflag& MTEX_NEGATIVE )?TEXNEG:0; + if(!glslmat && (material->flag[i] & TEXALPHA)) + texalpha = 1; } } else if(mttmp->tex->type == TEX_ENVMAP) { @@ -546,17 +553,7 @@ BL_Material* ConvertMaterial( material->ref = mat->ref; material->amb = mat->amb; - // set alpha testing without z-sorting - if( ( validface && (!(tface->transp &~ TF_CLIP))) && mat->mode & MA_ZTRA) { - // sets the RAS_IPolyMaterial::m_flag |RAS_FORCEALPHA - // this is so we don't have the overhead of the z-sorting code - material->ras_mode|=ALPHA_TEST; - } - else{ - // use regular z-sorting - material->ras_mode |= ((mat->mode & MA_ZTRA) != 0)?ZSORT:0; - } - material->ras_mode |= ((mat->mode & MA_WIRE) != 0)?WIRE:0; + material->ras_mode |= (mat->mode & MA_WIRE)? WIRE: 0; } else { int valid = 0; @@ -574,7 +571,6 @@ BL_Material* ConvertMaterial( material->mapping[0].mapping |= ( (material->img[0]->flag & IMA_REFLECT)!=0 )?USEREFL:0; material->flag[0] |= ( tface->transp &TF_ALPHA )?USEALPHA:0; material->flag[0] |= ( tface->transp &TF_ADD )?CALCALPHA:0; - material->ras_mode|= ( tface->transp & (TF_ADD|TF_ALPHA))?TRANSP:0; valid++; } } @@ -607,10 +603,6 @@ BL_Material* ConvertMaterial( material->ras_mode |= ( (tface->mode & TF_DYNAMIC)!= 0 )?COLLIDER:0; material->transp = tface->transp; - - if(tface->transp&~TF_CLIP) - material->ras_mode |= TRANSP; - material->tile = tface->tile; material->mode = tface->mode; @@ -631,7 +623,16 @@ BL_Material* ConvertMaterial( material->tile = 0; } + // with ztransp enabled, enforce alpha blending mode + if(validmat && (mat->mode & MA_ZTRA) && (material->transp == TF_SOLID)) + material->transp = TF_ALPHA; + // always zsort alpha + add + if((material->transp == TF_ALPHA || material->transp == TF_ADD || texalpha) + && (material->transp != TF_CLIP)) { + material->ras_mode |= ALPHA; + material->ras_mode |= (material->mode & TF_ALPHASORT)? ZSORT: 0; + } // get uv sets if(validmat) @@ -711,132 +712,54 @@ BL_Material* ConvertMaterial( } -static void BL_ComputeTriTangentSpace(const MT_Vector3 &v1, const MT_Vector3 &v2, const MT_Vector3 &v3, - const MT_Vector2 &uv1, const MT_Vector2 &uv2, const MT_Vector2 &uv3, - MFace* mface, MT_Vector3 *tan1, MT_Vector3 *tan2) -{ - MT_Vector3 dx1(v2 - v1), dx2(v3 - v1); - MT_Vector2 duv1(uv2 - uv1), duv2(uv3 - uv1); - - MT_Scalar r = 1.0 / (duv1.x() * duv2.y() - duv2.x() * duv1.y()); - duv1 *= r; - duv2 *= r; - MT_Vector3 sdir(duv2.y() * dx1 - duv1.y() * dx2); - MT_Vector3 tdir(duv1.x() * dx2 - duv2.x() * dx1); - - tan1[mface->v1] += sdir; - tan1[mface->v2] += sdir; - tan1[mface->v3] += sdir; - - tan2[mface->v1] += tdir; - tan2[mface->v2] += tdir; - tan2[mface->v3] += tdir; -} - -static MT_Vector4* BL_ComputeMeshTangentSpace(Mesh* mesh) -{ - MFace* mface = static_cast(mesh->mface); - MTFace* tface = static_cast(mesh->mtface); - - MT_Vector3 *tan1 = new MT_Vector3[mesh->totvert]; - MT_Vector3 *tan2 = new MT_Vector3[mesh->totvert]; - - int v; - for (v = 0; v < mesh->totvert; v++) - { - tan1[v] = MT_Vector3(0.0, 0.0, 0.0); - tan2[v] = MT_Vector3(0.0, 0.0, 0.0); - } - - for (int p = 0; p < mesh->totface; p++, mface++, tface++) - { - MT_Vector3 v1(mesh->mvert[mface->v1].co), - v2(mesh->mvert[mface->v2].co), - v3(mesh->mvert[mface->v3].co); - - MT_Vector2 uv1(tface->uv[0]), - uv2(tface->uv[1]), - uv3(tface->uv[2]); - - BL_ComputeTriTangentSpace(v1, v2, v3, uv1, uv2, uv3, mface, tan1, tan2); - if (mface->v4) - { - MT_Vector3 v4(mesh->mvert[mface->v4].co); - MT_Vector2 uv4(tface->uv[3]); - - BL_ComputeTriTangentSpace(v1, v3, v4, uv1, uv3, uv4, mface, tan1, tan2); - } - } - - MT_Vector4 *tangent = new MT_Vector4[mesh->totvert]; - for (v = 0; v < mesh->totvert; v++) - { - const MT_Vector3 no(mesh->mvert[v].no[0]/32767.0, - mesh->mvert[v].no[1]/32767.0, - mesh->mvert[v].no[2]/32767.0); - // Gram-Schmidt orthogonalize - MT_Vector3 t(tan1[v] - no.cross(no.cross(tan1[v]))); - if (!MT_fuzzyZero(t)) - t /= t.length(); - - tangent[v].x() = t.x(); - tangent[v].y() = t.y(); - tangent[v].z() = t.z(); - // Calculate handedness - tangent[v].w() = no.dot(tan1[v].cross(tan2[v])) < 0.0 ? -1.0 : 1.0; - } - - delete [] tan1; - delete [] tan2; - - return tangent; -} - RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* rendertools, KX_Scene* scene, KX_BlenderSceneConverter *converter) { RAS_MeshObject *meshobj; - bool skinMesh = false; - + bool skinMesh = false; int lightlayer = blenderobj->lay; - - MFace* mface = static_cast(mesh->mface); - MTFace* tface = static_cast(mesh->mtface); - const char *tfaceName = ""; - MCol* mmcol = mesh->mcol; - MT_assert(mface || mesh->totface == 0); + // Get DerivedMesh data + DerivedMesh *dm = CDDM_from_mesh(mesh, blenderobj); + + MVert *mvert = dm->getVertArray(dm); + int totvert = dm->getNumVerts(dm); + + MFace *mface = dm->getFaceArray(dm); + MTFace *tface = static_cast(dm->getFaceDataArray(dm, CD_MTFACE)); + MCol *mcol = static_cast(dm->getFaceDataArray(dm, CD_MCOL)); + float (*tangent)[3] = NULL; + int totface = dm->getNumFaces(dm); + const char *tfaceName = ""; + + if(tface) { + DM_add_tangent_layer(dm); + tangent = (float(*)[3])dm->getFaceDataArray(dm, CD_TANGENT); + } // Determine if we need to make a skinned mesh - if (mesh->dvert || mesh->key){ + if (mesh->dvert || mesh->key) { meshobj = new BL_SkinMeshObject(mesh, lightlayer); skinMesh = true; } - else { + else meshobj = new RAS_MeshObject(mesh, lightlayer); - } - MT_Vector4 *tangent = 0; - if (tface) - tangent = BL_ComputeMeshTangentSpace(mesh); - // Extract avaiable layers MTF_localLayer *layers = new MTF_localLayer[MAX_MTFACE]; - for (int lay=0; layfdata.totlayer; i++) + for (int i=0; ifaceData.totlayer; i++) { - if (mesh->fdata.layers[i].type == CD_MTFACE) + if (dm->faceData.layers[i].type == CD_MTFACE) { assert(validLayers <= 8); - layers[validLayers].face = (MTFace*)mesh->fdata.layers[i].data;; - layers[validLayers].name = mesh->fdata.layers[i].name; + layers[validLayers].face = (MTFace*)(dm->faceData.layers[i].data); + layers[validLayers].name = dm->faceData.layers[i].name; if(tface == layers[validLayers].face) tfaceName = layers[validLayers].name; validLayers++; @@ -844,271 +767,269 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* } meshobj->SetName(mesh->id.name); - meshobj->m_xyz_index_to_vertex_index_mapping.resize(mesh->totvert); - for (int f=0;ftotface;f++,mface++) + meshobj->m_xyz_index_to_vertex_index_mapping.resize(totvert); + + for (int f=0;fv3) - { - MT_Point2 uv0(0.0,0.0),uv1(0.0,0.0),uv2(0.0,0.0),uv3(0.0,0.0); - MT_Point2 uv20(0.0,0.0),uv21(0.0,0.0),uv22(0.0,0.0),uv23(0.0,0.0); - // rgb3 is set from the adjoint face in a square - unsigned int rgb0,rgb1,rgb2,rgb3 = 0; - MT_Vector3 no0(mesh->mvert[mface->v1].no[0], mesh->mvert[mface->v1].no[1], mesh->mvert[mface->v1].no[2]), - no1(mesh->mvert[mface->v2].no[0], mesh->mvert[mface->v2].no[1], mesh->mvert[mface->v2].no[2]), - no2(mesh->mvert[mface->v3].no[0], mesh->mvert[mface->v3].no[1], mesh->mvert[mface->v3].no[2]), - no3(0.0, 0.0, 0.0); - MT_Point3 pt0(mesh->mvert[mface->v1].co), - pt1(mesh->mvert[mface->v2].co), - pt2(mesh->mvert[mface->v3].co), - pt3(0.0, 0.0, 0.0); - MT_Vector4 tan0(0.0, 0.0, 0.0, 0.0), - tan1(0.0, 0.0, 0.0, 0.0), - tan2(0.0, 0.0, 0.0, 0.0), - tan3(0.0, 0.0, 0.0, 0.0); + MT_Point2 uv0(0.0,0.0),uv1(0.0,0.0),uv2(0.0,0.0),uv3(0.0,0.0); + MT_Point2 uv20(0.0,0.0),uv21(0.0,0.0),uv22(0.0,0.0),uv23(0.0,0.0); + unsigned int rgb0,rgb1,rgb2,rgb3 = 0; + + MT_Vector3 no0, no1, no2, no3; + MT_Point3 pt0, pt1, pt2, pt3; + MT_Vector4 tan0, tan1, tan2, tan3; + + /* get coordinates, normals and tangents */ + pt0 = MT_Point3(mvert[mface->v1].co); + pt1 = MT_Point3(mvert[mface->v2].co); + pt2 = MT_Point3(mvert[mface->v3].co); + pt3 = (mface->v4)? MT_Point3(mvert[mface->v4].co): MT_Point3(0.0, 0.0, 0.0); + + if(mface->flag & ME_SMOOTH) { + float n0[3], n1[3], n2[3], n3[3]; + + NormalShortToFloat(n0, mvert[mface->v1].no); + NormalShortToFloat(n1, mvert[mface->v2].no); + NormalShortToFloat(n2, mvert[mface->v3].no); + no0 = n0; + no1 = n1; + no2 = n2; + + if(mface->v4) { + NormalShortToFloat(n3, mvert[mface->v4].no); + no3 = n3; + } + else + no3 = MT_Vector3(0.0, 0.0, 0.0); + } + else { + float fno[3]; + + if(mface->v4) + CalcNormFloat4(mvert[mface->v1].co, mvert[mface->v2].co, + mvert[mface->v3].co, mvert[mface->v4].co, fno); + else + CalcNormFloat(mvert[mface->v1].co, mvert[mface->v2].co, + mvert[mface->v3].co, fno); + + no0 = no1 = no2 = no3 = MT_Vector3(fno); + } + + if(tangent) { + tan0 = tangent[f*4 + 0]; + tan1 = tangent[f*4 + 1]; + tan2 = tangent[f*4 + 2]; - no0 /= 32767.0; - no1 /= 32767.0; - no2 /= 32767.0; if (mface->v4) - { - pt3 = MT_Point3(mesh->mvert[mface->v4].co); - no3 = MT_Vector3(mesh->mvert[mface->v4].no[0], mesh->mvert[mface->v4].no[1], mesh->mvert[mface->v4].no[2]); - no3 /= 32767.0; - } + tan3 = tangent[f*4 + 3]; + } + + /* get material */ + ma = give_current_material(blenderobj, mface->mat_nr+1); - if(!(mface->flag & ME_SMOOTH)) - { - MT_Vector3 norm = ((pt1-pt0).cross(pt2-pt0)).safe_normalized(); - norm[0] = ((int) (10*norm[0]))/10.0; - norm[1] = ((int) (10*norm[1]))/10.0; - norm[2] = ((int) (10*norm[2]))/10.0; - no0=no1=no2=no3= norm; - - } - - { - Material* ma = 0; - bool polyvisible = true; - RAS_IPolyMaterial* polymat = NULL; - BL_Material *bl_mat = NULL; + { + bool polyvisible = true; + RAS_IPolyMaterial* polymat = NULL; + BL_Material *bl_mat = NULL; - if(converter->GetMaterials()) - { - if(mesh->totcol > 1) - ma = mesh->mat[mface->mat_nr]; - else - ma = give_current_material(blenderobj, 1); + if(converter->GetMaterials()) { + /* do Blender Multitexture and Blender GLSL materials */ + unsigned int rgb[4]; + MT_Point2 uv[4]; - bl_mat = ConvertMaterial(mesh, ma, tface, tfaceName, mface, mmcol, lightlayer, blenderobj, layers, converter->GetGLSLMaterials()); - // set the index were dealing with - bl_mat->material_index = (int)mface->mat_nr; + /* first is the BL_Material */ + bl_mat = ConvertMaterial(ma, tface, tfaceName, mface, mcol, + lightlayer, blenderobj, layers, converter->GetGLSLMaterials()); - polyvisible = ((bl_mat->ras_mode & POLY_VIS)!=0); - collider = ((bl_mat->ras_mode & COLLIDER)!=0); - - polymat = new KX_BlenderMaterial(scene, bl_mat, skinMesh, lightlayer, blenderobj ); - - unsigned int rgb[4]; - bl_mat->GetConversionRGB(rgb); - rgb0 = rgb[0]; rgb1 = rgb[1]; - rgb2 = rgb[2]; rgb3 = rgb[3]; - MT_Point2 uv[4]; - bl_mat->GetConversionUV(uv); - uv0 = uv[0]; uv1 = uv[1]; - uv2 = uv[2]; uv3 = uv[3]; + bl_mat->material_index = (int)mface->mat_nr; - bl_mat->GetConversionUV2(uv); - uv20 = uv[0]; uv21 = uv[1]; - uv22 = uv[2]; uv23 = uv[3]; + polyvisible = ((bl_mat->ras_mode & POLY_VIS)!=0); + collider = ((bl_mat->ras_mode & COLLIDER)!=0); - if(tangent){ - tan0 = tangent[mface->v1]; - tan1 = tangent[mface->v2]; - tan2 = tangent[mface->v3]; - if (mface->v4) - tan3 = tangent[mface->v4]; - } - } - else - { - ma = give_current_material(blenderobj, 1); + /* vertex colors and uv's were stored in bl_mat temporarily */ + bl_mat->GetConversionRGB(rgb); + rgb0 = rgb[0]; rgb1 = rgb[1]; + rgb2 = rgb[2]; rgb3 = rgb[3]; - Image* bima = ((mesh->mtface && tface) ? (Image*) tface->tpage : NULL); - - STR_String imastr = - ((mesh->mtface && tface) ? - (bima? (bima)->id.name : "" ) : "" ); - - char transp=0; - short mode=0, tile=0; - int tilexrep=4,tileyrep = 4; - - if (bima) - { - tilexrep = bima->xrep; - tileyrep = bima->yrep; + bl_mat->GetConversionUV(uv); + uv0 = uv[0]; uv1 = uv[1]; + uv2 = uv[2]; uv3 = uv[3]; + + bl_mat->GetConversionUV2(uv); + uv20 = uv[0]; uv21 = uv[1]; + uv22 = uv[2]; uv23 = uv[3]; - } - - if (mesh->mtface && tface) - { - // Use texface colors if available - //TF_DYNAMIC means the polygon is a collision face - collider = ((tface->mode & TF_DYNAMIC) != 0); - transp = tface->transp &~ TF_CLIP; - tile = tface->tile; - mode = tface->mode; - - polyvisible = !((mface->flag & ME_HIDE)||(tface->mode & TF_INVISIBLE)); - - uv0 = MT_Point2(tface->uv[0]); - uv1 = MT_Point2(tface->uv[1]); - uv2 = MT_Point2(tface->uv[2]); + /* then the KX_BlenderMaterial */ + polymat = new KX_BlenderMaterial(scene, bl_mat, skinMesh, lightlayer, blenderobj ); + } + else { + /* do Texture Face materials */ + Image* bima = (tface)? (Image*)tface->tpage: NULL; + STR_String imastr = (tface)? (bima? (bima)->id.name : "" ) : ""; - if (mface->v4) - uv3 = MT_Point2(tface->uv[3]); - } - else - { - // no texfaces, set COLLSION true and everything else FALSE - - mode = default_face_mode; - transp = TF_SOLID; - tile = 0; - } + char transp=0; + short mode=0, tile=0; + int tilexrep=4,tileyrep = 4; + + if (bima) { + tilexrep = bima->xrep; + tileyrep = bima->yrep; + } - if (mmcol) - { - // Use vertex colors - rgb0 = KX_Mcol2uint_new(mmcol[0]); - rgb1 = KX_Mcol2uint_new(mmcol[1]); - rgb2 = KX_Mcol2uint_new(mmcol[2]); - - if (mface->v4) - rgb3 = KX_Mcol2uint_new(mmcol[3]); - } - else { - // no vertex colors: take from material if we have one, - // otherwise set to white - unsigned int color = 0xFFFFFFFFL; - - if (ma) - { - union - { - unsigned char cp[4]; - unsigned int integer; - } col_converter; - - col_converter.cp[3] = (unsigned char) (ma->r*255.0); - col_converter.cp[2] = (unsigned char) (ma->g*255.0); - col_converter.cp[1] = (unsigned char) (ma->b*255.0); - col_converter.cp[0] = (unsigned char) (ma->alpha*255.0); - - color = col_converter.integer; - } + /* get tface properties if available */ + if(tface) { + /* TF_DYNAMIC means the polygon is a collision face */ + collider = ((tface->mode & TF_DYNAMIC) != 0); + transp = tface->transp; + tile = tface->tile; + mode = tface->mode; + + polyvisible = !((mface->flag & ME_HIDE)||(tface->mode & TF_INVISIBLE)); + + uv0 = MT_Point2(tface->uv[0]); + uv1 = MT_Point2(tface->uv[1]); + uv2 = MT_Point2(tface->uv[2]); - rgb0 = KX_rgbaint2uint_new(color); - rgb1 = KX_rgbaint2uint_new(color); - rgb2 = KX_rgbaint2uint_new(color); - - if (mface->v4) - rgb3 = KX_rgbaint2uint_new(color); - } + if (mface->v4) + uv3 = MT_Point2(tface->uv[3]); + } + else { + /* no texfaces, set COLLSION true and everything else FALSE */ + mode = default_face_mode; + transp = TF_SOLID; + tile = 0; + } + + /* get vertex colors */ + if (mcol) { + /* we have vertex colors */ + rgb0 = KX_Mcol2uint_new(mcol[0]); + rgb1 = KX_Mcol2uint_new(mcol[1]); + rgb2 = KX_Mcol2uint_new(mcol[2]); - bool istriangle = (mface->v4==0); - bool zsort = ma?(ma->mode & MA_ZTRA) != 0:false; - - polymat = new KX_PolygonMaterial(imastr, ma, - tile, tilexrep, tileyrep, - mode, transp, zsort, lightlayer, istriangle, blenderobj, tface, (unsigned int*)mmcol); - + if (mface->v4) + rgb3 = KX_Mcol2uint_new(mcol[3]); + } + else { + /* no vertex colors, take from material, otherwise white */ + unsigned int color = 0xFFFFFFFFL; + if (ma) { - polymat->m_specular = MT_Vector3(ma->specr, ma->specg, ma->specb)*ma->spec; - polymat->m_shininess = (float)ma->har/4.0; // 0 < ma->har <= 512 - polymat->m_diffuse = MT_Vector3(ma->r, ma->g, ma->b)*(ma->emit + ma->ref); - - } else - { - polymat->m_specular = MT_Vector3(0.0f,0.0f,0.0f); - polymat->m_shininess = 35.0; + union + { + unsigned char cp[4]; + unsigned int integer; + } col_converter; + + col_converter.cp[3] = (unsigned char) (ma->r*255.0); + col_converter.cp[2] = (unsigned char) (ma->g*255.0); + col_converter.cp[1] = (unsigned char) (ma->b*255.0); + col_converter.cp[0] = (unsigned char) (ma->alpha*255.0); + + color = col_converter.integer; } - } - - // see if a bucket was reused or a new one was created - // this way only one KX_BlenderMaterial object has to exist per bucket - bool bucketCreated; - RAS_MaterialBucket* bucket = scene->FindBucket(polymat, bucketCreated); - if (bucketCreated) { - // this is needed to free up memory afterwards - converter->RegisterPolyMaterial(polymat); - if(converter->GetMaterials()) { - converter->RegisterBlenderMaterial(bl_mat); - } - } else { - // delete the material objects since they are no longer needed - // from now on, use the polygon material from the material bucket - delete polymat; - if(converter->GetMaterials()) { - delete bl_mat; - } - polymat = bucket->GetPolyMaterial(); - } - - int nverts = mface->v4?4:3; - int vtxarray = meshobj->FindVertexArray(nverts,polymat); - RAS_Polygon* poly = new RAS_Polygon(bucket,polyvisible,nverts,vtxarray); - bool flat; - - if (skinMesh) { - /* If the face is set to solid, all fnors are the same */ - if (mface->flag & ME_SMOOTH) - flat = false; - else - flat = true; - } - else - flat = false; - - poly->SetVertex(0,meshobj->FindOrAddVertex(vtxarray,pt0,uv0,uv20,tan0,rgb0,no0,flat,polymat,mface->v1)); - poly->SetVertex(1,meshobj->FindOrAddVertex(vtxarray,pt1,uv1,uv21,tan1,rgb1,no1,flat,polymat,mface->v2)); - poly->SetVertex(2,meshobj->FindOrAddVertex(vtxarray,pt2,uv2,uv22,tan2,rgb2,no2,flat,polymat,mface->v3)); - if (nverts==4) - poly->SetVertex(3,meshobj->FindOrAddVertex(vtxarray,pt3,uv3,uv23,tan3,rgb3,no3,flat,polymat,mface->v4)); - - meshobj->AddPolygon(poly); - if (poly->IsCollider()) - { - RAS_TriangleIndex idx; - idx.m_index[0] = mface->v1; - idx.m_index[1] = mface->v2; - idx.m_index[2] = mface->v3; - idx.m_collider = collider; - meshobj->m_triangle_indices.push_back(idx); - if (nverts==4) - { - idx.m_index[0] = mface->v1; - idx.m_index[1] = mface->v3; - idx.m_index[2] = mface->v4; - idx.m_collider = collider; - meshobj->m_triangle_indices.push_back(idx); - } + rgb0 = KX_rgbaint2uint_new(color); + rgb1 = KX_rgbaint2uint_new(color); + rgb2 = KX_rgbaint2uint_new(color); + + if (mface->v4) + rgb3 = KX_rgbaint2uint_new(color); } -// poly->SetVisibleWireframeEdges(mface->edcode); - poly->SetCollider(collider); + bool istriangle = (mface->v4==0); + + // only zsort alpha + add + bool alpha = (transp == TF_ALPHA || transp == TF_ADD); + bool zsort = (mode & TF_ALPHASORT)? alpha: 0; + + polymat = new KX_PolygonMaterial(imastr, ma, + tile, tilexrep, tileyrep, + mode, transp, alpha, zsort, lightlayer, istriangle, blenderobj, tface, (unsigned int*)mcol); + + if (ma) { + polymat->m_specular = MT_Vector3(ma->specr, ma->specg, ma->specb)*ma->spec; + polymat->m_shininess = (float)ma->har/4.0; // 0 < ma->har <= 512 + polymat->m_diffuse = MT_Vector3(ma->r, ma->g, ma->b)*(ma->emit + ma->ref); + } + else { + polymat->m_specular = MT_Vector3(0.0f,0.0f,0.0f); + polymat->m_shininess = 35.0; + } } + + // see if a bucket was reused or a new one was created + // this way only one KX_BlenderMaterial object has to exist per bucket + bool bucketCreated; + RAS_MaterialBucket* bucket = scene->FindBucket(polymat, bucketCreated); + if (bucketCreated) { + // this is needed to free up memory afterwards + converter->RegisterPolyMaterial(polymat); + if(converter->GetMaterials()) { + converter->RegisterBlenderMaterial(bl_mat); + } + } else { + // delete the material objects since they are no longer needed + // from now on, use the polygon material from the material bucket + delete polymat; + if(converter->GetMaterials()) { + delete bl_mat; + } + polymat = bucket->GetPolyMaterial(); + } + + int nverts = mface->v4?4:3; + int vtxarray = meshobj->FindVertexArray(nverts,polymat); + RAS_Polygon* poly = new RAS_Polygon(bucket,polyvisible,nverts,vtxarray); + + bool flat; + + if (skinMesh) { + /* If the face is set to solid, all fnors are the same */ + if (mface->flag & ME_SMOOTH) + flat = false; + else + flat = true; + } + else + flat = false; + + poly->SetVertex(0,meshobj->FindOrAddVertex(vtxarray,pt0,uv0,uv20,tan0,rgb0,no0,flat,polymat,mface->v1)); + poly->SetVertex(1,meshobj->FindOrAddVertex(vtxarray,pt1,uv1,uv21,tan1,rgb1,no1,flat,polymat,mface->v2)); + poly->SetVertex(2,meshobj->FindOrAddVertex(vtxarray,pt2,uv2,uv22,tan2,rgb2,no2,flat,polymat,mface->v3)); + if (nverts==4) + poly->SetVertex(3,meshobj->FindOrAddVertex(vtxarray,pt3,uv3,uv23,tan3,rgb3,no3,flat,polymat,mface->v4)); + + meshobj->AddPolygon(poly); + if (poly->IsCollider()) + { + RAS_TriangleIndex idx; + idx.m_index[0] = mface->v1; + idx.m_index[1] = mface->v2; + idx.m_index[2] = mface->v3; + idx.m_collider = collider; + meshobj->m_triangle_indices.push_back(idx); + if (nverts==4) + { + idx.m_index[0] = mface->v1; + idx.m_index[1] = mface->v3; + idx.m_index[2] = mface->v4; + idx.m_collider = collider; + meshobj->m_triangle_indices.push_back(idx); + } + } + +// poly->SetVisibleWireframeEdges(mface->edcode); + poly->SetCollider(collider); } + if (tface) tface++; - if (mmcol) - mmcol+=4; + if (mcol) + mcol+=4; for (int lay=0; layGetPolyMaterial()->OnConstruction(); } - if(tangent) - delete [] tangent; - if (layers) delete []layers; + + dm->release(dm); return meshobj; } @@ -1819,7 +1739,7 @@ KX_GameObject* getGameOb(STR_String busc,CListValue* sumolist){ return 0; } -#include "BLI_arithb.h" + // convert blender objects into ketsji gameobjects void BL_ConvertBlenderObjects(struct Main* maggie, const STR_String& scenename, @@ -1937,7 +1857,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, if (converter->addInitFromFrame) if (!isInActiveLayer) addobj=false; - + if (gameobj&&addobj) { MT_Point3 posPrev; @@ -1989,10 +1909,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie, gameobj->NodeUpdateGS(0,true); BL_ConvertIpos(blenderobject,gameobj,converter); - // TODO: expand to multiple ipos per mesh - Material *mat = give_current_material(blenderobject, 1); - if(mat) BL_ConvertMaterialIpos(mat, gameobj, converter); - + BL_ConvertMaterialIpos(blenderobject, gameobj, converter); + sumolist->Add(gameobj->AddRef()); BL_ConvertProperties(blenderobject,gameobj,timemgr,kxscene,isInActiveLayer); @@ -2029,8 +1947,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie, // needed for python scripting logicmgr->RegisterGameObjectName(gameobj->GetName(),gameobj); - // needed for dynamic object morphing - logicmgr->RegisterGameObj(gameobj, blenderobject); + // needed for group duplication + logicmgr->RegisterGameObj(blenderobject, gameobj); for (int i = 0; i < gameobj->GetMeshCount(); i++) logicmgr->RegisterGameMeshName(gameobj->GetMesh(i)->GetName(), blenderobject); @@ -2052,8 +1970,6 @@ void BL_ConvertBlenderObjects(struct Main* maggie, gameobj->NodeUpdateGS(0,true); gameobj->Bucketize(); - if (gameobj->IsDupliGroup()) - grouplist.insert(blenderobject->dup_group); } else { @@ -2061,6 +1977,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie, //at the end of this function if it is not a root object inactivelist->Add(gameobj->AddRef()); } + if (gameobj->IsDupliGroup()) + grouplist.insert(blenderobject->dup_group); if (converter->addInitFromFrame){ gameobj->NodeSetLocalPosition(posPrev); gameobj->NodeSetLocalOrientation(angor); @@ -2111,7 +2029,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, blenderscene); // this code is copied from above except that - // object from groups are never is active layer + // object from groups are never in active layer bool isInActiveLayer = false; bool addobj=true; @@ -2171,9 +2089,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, gameobj->NodeUpdateGS(0,true); BL_ConvertIpos(blenderobject,gameobj,converter); - // TODO: expand to multiple ipos per mesh - Material *mat = give_current_material(blenderobject, 1); - if(mat) BL_ConvertMaterialIpos(mat, gameobj, converter); + BL_ConvertMaterialIpos(blenderobject,gameobj, converter); sumolist->Add(gameobj->AddRef()); @@ -2211,8 +2127,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie, // needed for python scripting logicmgr->RegisterGameObjectName(gameobj->GetName(),gameobj); - // needed for dynamic object morphing - logicmgr->RegisterGameObj(gameobj, blenderobject); + // needed for group duplication + logicmgr->RegisterGameObj(blenderobject, gameobj); for (int i = 0; i < gameobj->GetMeshCount(); i++) logicmgr->RegisterGameMeshName(gameobj->GetMesh(i)->GetName(), blenderobject); @@ -2262,7 +2178,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie, } } - if (blenderscene->camera) { + // non-camera objects not supported as camera currently + if (blenderscene->camera && blenderscene->camera->type == OB_CAMERA) { KX_Camera *gamecamera= (KX_Camera*) converter->FindGameObject(blenderscene->camera); if(gamecamera) @@ -2524,13 +2441,13 @@ void BL_ConvertBlenderObjects(struct Main* maggie, int layerMask = (groupobj.find(blenderobj) == groupobj.end()) ? activeLayerBitInfo : 0; bool isInActiveLayer = (blenderobj->lay & layerMask)!=0; BL_ConvertSensors(blenderobj,gameobj,logicmgr,kxscene,keydev,executePriority,layerMask,isInActiveLayer,canvas,converter); - } - // apply the initial state to controllers - for ( i=0;iGetCount();i++) - { - KX_GameObject* gameobj = static_cast(logicbrick_conversionlist->GetValue(i)); - struct Object* blenderobj = converter->FindBlenderObject(gameobj); + // set the init state to all objects gameobj->SetInitState((blenderobj->init_state)?blenderobj->init_state:blenderobj->state); + } + // apply the initial state to controllers, only on the active objects as this registers the sensors + for ( i=0;iGetCount();i++) + { + KX_GameObject* gameobj = static_cast(objectlist->GetValue(i)); gameobj->ResetState(); } diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp index 7196b393ed4..242d648b062 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp +++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp @@ -442,15 +442,15 @@ PyMethodDef BL_ShapeActionActuator::Methods[] = { {"setProperty", (PyCFunction) BL_ShapeActionActuator::sPySetProperty, METH_VARARGS, SetProperty_doc}, {"setBlendtime", (PyCFunction) BL_ShapeActionActuator::sPySetBlendtime, METH_VARARGS, SetBlendtime_doc}, - {"getAction", (PyCFunction) BL_ShapeActionActuator::sPyGetAction, METH_VARARGS, GetAction_doc}, - {"getStart", (PyCFunction) BL_ShapeActionActuator::sPyGetStart, METH_VARARGS, GetStart_doc}, - {"getEnd", (PyCFunction) BL_ShapeActionActuator::sPyGetEnd, METH_VARARGS, GetEnd_doc}, - {"getBlendin", (PyCFunction) BL_ShapeActionActuator::sPyGetBlendin, METH_VARARGS, GetBlendin_doc}, - {"getPriority", (PyCFunction) BL_ShapeActionActuator::sPyGetPriority, METH_VARARGS, GetPriority_doc}, - {"getFrame", (PyCFunction) BL_ShapeActionActuator::sPyGetFrame, METH_VARARGS, GetFrame_doc}, - {"getProperty", (PyCFunction) BL_ShapeActionActuator::sPyGetProperty, METH_VARARGS, GetProperty_doc}, - {"getType", (PyCFunction) BL_ShapeActionActuator::sPyGetType, METH_VARARGS, GetType_doc}, - {"setType", (PyCFunction) BL_ShapeActionActuator::sPySetType, METH_VARARGS, SetType_doc}, + {"getAction", (PyCFunction) BL_ShapeActionActuator::sPyGetAction, METH_NOARGS, GetAction_doc}, + {"getStart", (PyCFunction) BL_ShapeActionActuator::sPyGetStart, METH_NOARGS, GetStart_doc}, + {"getEnd", (PyCFunction) BL_ShapeActionActuator::sPyGetEnd, METH_NOARGS, GetEnd_doc}, + {"getBlendin", (PyCFunction) BL_ShapeActionActuator::sPyGetBlendin, METH_NOARGS, GetBlendin_doc}, + {"getPriority", (PyCFunction) BL_ShapeActionActuator::sPyGetPriority, METH_NOARGS, GetPriority_doc}, + {"getFrame", (PyCFunction) BL_ShapeActionActuator::sPyGetFrame, METH_NOARGS, GetFrame_doc}, + {"getProperty", (PyCFunction) BL_ShapeActionActuator::sPyGetProperty, METH_NOARGS, GetProperty_doc}, + {"getType", (PyCFunction) BL_ShapeActionActuator::sPyGetType, METH_NOARGS, GetType_doc}, + {"setType", (PyCFunction) BL_ShapeActionActuator::sPySetType, METH_NOARGS, SetType_doc}, {NULL,NULL} //Sentinel }; @@ -463,9 +463,7 @@ char BL_ShapeActionActuator::GetAction_doc[] = "getAction()\n" "\tReturns a string containing the name of the current action.\n"; -PyObject* BL_ShapeActionActuator::PyGetAction(PyObject* self, - PyObject* args, - PyObject* kwds) { +PyObject* BL_ShapeActionActuator::PyGetAction(PyObject* self) { PyObject *result; if (m_action){ @@ -484,9 +482,7 @@ char BL_ShapeActionActuator::GetProperty_doc[] = "getProperty()\n" "\tReturns the name of the property to be used in FromProp mode.\n"; -PyObject* BL_ShapeActionActuator::PyGetProperty(PyObject* self, - PyObject* args, - PyObject* kwds) { +PyObject* BL_ShapeActionActuator::PyGetProperty(PyObject* self) { PyObject *result; result = Py_BuildValue("s", (const char *)m_propname); @@ -499,9 +495,7 @@ char BL_ShapeActionActuator::GetFrame_doc[] = "getFrame()\n" "\tReturns the current frame number.\n"; -PyObject* BL_ShapeActionActuator::PyGetFrame(PyObject* self, - PyObject* args, - PyObject* kwds) { +PyObject* BL_ShapeActionActuator::PyGetFrame(PyObject* self) { PyObject *result; result = Py_BuildValue("f", m_localtime); @@ -514,9 +508,7 @@ char BL_ShapeActionActuator::GetEnd_doc[] = "getEnd()\n" "\tReturns the last frame of the action.\n"; -PyObject* BL_ShapeActionActuator::PyGetEnd(PyObject* self, - PyObject* args, - PyObject* kwds) { +PyObject* BL_ShapeActionActuator::PyGetEnd(PyObject* self) { PyObject *result; result = Py_BuildValue("f", m_endframe); @@ -529,9 +521,7 @@ char BL_ShapeActionActuator::GetStart_doc[] = "getStart()\n" "\tReturns the starting frame of the action.\n"; -PyObject* BL_ShapeActionActuator::PyGetStart(PyObject* self, - PyObject* args, - PyObject* kwds) { +PyObject* BL_ShapeActionActuator::PyGetStart(PyObject* self) { PyObject *result; result = Py_BuildValue("f", m_startframe); @@ -545,9 +535,7 @@ char BL_ShapeActionActuator::GetBlendin_doc[] = "\tReturns the number of interpolation animation frames to be\n" "\tgenerated when this actuator is triggered.\n"; -PyObject* BL_ShapeActionActuator::PyGetBlendin(PyObject* self, - PyObject* args, - PyObject* kwds) { +PyObject* BL_ShapeActionActuator::PyGetBlendin(PyObject* self) { PyObject *result; result = Py_BuildValue("f", m_blendin); @@ -561,9 +549,7 @@ char BL_ShapeActionActuator::GetPriority_doc[] = "\tReturns the priority for this actuator. Actuators with lower\n" "\tPriority numbers will override actuators with higher numbers.\n"; -PyObject* BL_ShapeActionActuator::PyGetPriority(PyObject* self, - PyObject* args, - PyObject* kwds) { +PyObject* BL_ShapeActionActuator::PyGetPriority(PyObject* self) { PyObject *result; result = Py_BuildValue("i", m_priority); @@ -605,6 +591,7 @@ PyObject* BL_ShapeActionActuator::PySetAction(PyObject* self, } } else { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -627,6 +614,7 @@ PyObject* BL_ShapeActionActuator::PySetStart(PyObject* self, m_startframe = start; } else { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -649,6 +637,7 @@ PyObject* BL_ShapeActionActuator::PySetEnd(PyObject* self, m_endframe = end; } else { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -672,6 +661,7 @@ PyObject* BL_ShapeActionActuator::PySetBlendin(PyObject* self, m_blendin = blendin; } else { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -700,6 +690,7 @@ PyObject* BL_ShapeActionActuator::PySetBlendtime(PyObject* self, m_blendframe = m_blendin; } else { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -724,6 +715,7 @@ PyObject* BL_ShapeActionActuator::PySetPriority(PyObject* self, m_priority = priority; } else { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -750,6 +742,7 @@ PyObject* BL_ShapeActionActuator::PySetFrame(PyObject* self, m_localtime=m_endframe; } else { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -773,6 +766,7 @@ PyObject* BL_ShapeActionActuator::PySetProperty(PyObject* self, m_propname = string; } else { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -784,9 +778,7 @@ PyObject* BL_ShapeActionActuator::PySetProperty(PyObject* self, char BL_ShapeActionActuator::GetType_doc[] = "getType()\n" "\tReturns the operation mode of the actuator.\n"; -PyObject* BL_ShapeActionActuator::PyGetType(PyObject* self, - PyObject* args, - PyObject* kwds) { +PyObject* BL_ShapeActionActuator::PyGetType(PyObject* self) { return Py_BuildValue("h", m_playtype); } @@ -801,6 +793,7 @@ PyObject* BL_ShapeActionActuator::PySetType(PyObject* self, short typeArg; if (!PyArg_ParseTuple(args, "h", &typeArg)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.h b/source/gameengine/Converter/BL_ShapeActionActuator.h index 434a62a1233..a9b9ad8fa86 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.h +++ b/source/gameengine/Converter/BL_ShapeActionActuator.h @@ -87,15 +87,15 @@ public: KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetBlendtime); KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetChannel); - KX_PYMETHOD_DOC(BL_ShapeActionActuator,GetAction); - KX_PYMETHOD_DOC(BL_ShapeActionActuator,GetBlendin); - KX_PYMETHOD_DOC(BL_ShapeActionActuator,GetPriority); - KX_PYMETHOD_DOC(BL_ShapeActionActuator,GetStart); - KX_PYMETHOD_DOC(BL_ShapeActionActuator,GetEnd); - KX_PYMETHOD_DOC(BL_ShapeActionActuator,GetFrame); - KX_PYMETHOD_DOC(BL_ShapeActionActuator,GetProperty); + KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetAction); + KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetBlendin); + KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetPriority); + KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetStart); + KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetEnd); + KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetFrame); + KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetProperty); // KX_PYMETHOD(BL_ActionActuator,GetChannel); - KX_PYMETHOD_DOC(BL_ShapeActionActuator,GetType); + KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetType); KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetType); virtual PyObject* _getattr(const STR_String& attr); diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index 8739fb109fd..53ac730d203 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -628,6 +628,8 @@ void BL_ConvertActuators(char* maggiename, /* convert settings... degrees in the ui become radians */ /* internally */ if (conact->type == ACT_CONST_TYPE_ORI) { + min = (MT_2_PI * conact->minloc[0])/360.0; + max = (MT_2_PI * conact->maxloc[0])/360.0; switch (conact->mode) { case ACT_CONST_DIRPX: locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_ORIX; @@ -656,18 +658,18 @@ void BL_ConvertActuators(char* maggiename, min = conact->minloc[2]; max = conact->maxloc[2]; break; - case ACT_CONST_DIRMX: - locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRMX; + case ACT_CONST_DIRNX: + locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRNX; min = conact->minloc[0]; max = conact->maxloc[0]; break; - case ACT_CONST_DIRMY: - locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRMY; + case ACT_CONST_DIRNY: + locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRNY; min = conact->minloc[1]; max = conact->maxloc[1]; break; - case ACT_CONST_DIRMZ: - locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRMZ; + case ACT_CONST_DIRNZ: + locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRNZ; min = conact->minloc[2]; max = conact->maxloc[2]; break; diff --git a/source/gameengine/Converter/KX_ConvertSensors.cpp b/source/gameengine/Converter/KX_ConvertSensors.cpp index 7c9df688d45..5e433bb821b 100644 --- a/source/gameengine/Converter/KX_ConvertSensors.cpp +++ b/source/gameengine/Converter/KX_ConvertSensors.cpp @@ -733,9 +733,9 @@ void BL_ConvertSensors(struct Object* blenderobject, gameobj->AddSensor(gamesensor); // only register to manager if it's in an active layer - - if (isInActiveLayer) - gamesensor->RegisterToManager(); + // Make registration dynamic: only when sensor is activated + //if (isInActiveLayer) + // gamesensor->RegisterToManager(); for (int i=0;itotlinks;i++) diff --git a/source/gameengine/Converter/KX_IpoConvert.cpp b/source/gameengine/Converter/KX_IpoConvert.cpp index 75ca59d01e7..7410beecaf4 100644 --- a/source/gameengine/Converter/KX_IpoConvert.cpp +++ b/source/gameengine/Converter/KX_IpoConvert.cpp @@ -36,6 +36,7 @@ #pragma warning (disable:4786) #endif +#include "BKE_material.h" /* give_current_material */ #include "KX_GameObject.h" #include "KX_IpoConvert.h" @@ -68,6 +69,8 @@ #include "SG_Node.h" +#include "STR_HashedString.h" + static BL_InterpolatorList *GetIpoList(struct Ipo *for_ipo, KX_BlenderSceneConverter *converter) { BL_InterpolatorList *ipoList= converter->FindInterpolatorList(for_ipo); @@ -560,16 +563,15 @@ void BL_ConvertWorldIpos(struct World* blenderworld,KX_BlenderSceneConverter *co } } - -void BL_ConvertMaterialIpos( - Material* blendermaterial, +static void ConvertMaterialIpos( + Material* blendermaterial, + dword matname_hash, KX_GameObject* gameobj, KX_BlenderSceneConverter *converter ) { if (blendermaterial->ipo) { - - KX_MaterialIpoController* ipocontr = new KX_MaterialIpoController(); + KX_MaterialIpoController* ipocontr = new KX_MaterialIpoController(matname_hash); gameobj->GetSGNode()->AddSGController(ipocontr); ipocontr->SetObject(gameobj->GetSGNode()); @@ -596,7 +598,7 @@ void BL_ConvertMaterialIpos( ipo = ipoList->GetScalarInterpolator(MA_COL_R); if (ipo) { if (!ipocontr) { - ipocontr = new KX_MaterialIpoController(); + ipocontr = new KX_MaterialIpoController(matname_hash); gameobj->GetSGNode()->AddSGController(ipocontr); ipocontr->SetObject(gameobj->GetSGNode()); } @@ -610,7 +612,7 @@ void BL_ConvertMaterialIpos( ipo = ipoList->GetScalarInterpolator(MA_COL_G); if (ipo) { if (!ipocontr) { - ipocontr = new KX_MaterialIpoController(); + ipocontr = new KX_MaterialIpoController(matname_hash); gameobj->GetSGNode()->AddSGController(ipocontr); ipocontr->SetObject(gameobj->GetSGNode()); } @@ -624,7 +626,7 @@ void BL_ConvertMaterialIpos( ipo = ipoList->GetScalarInterpolator(MA_COL_B); if (ipo) { if (!ipocontr) { - ipocontr = new KX_MaterialIpoController(); + ipocontr = new KX_MaterialIpoController(matname_hash); gameobj->GetSGNode()->AddSGController(ipocontr); ipocontr->SetObject(gameobj->GetSGNode()); } @@ -638,7 +640,7 @@ void BL_ConvertMaterialIpos( ipo = ipoList->GetScalarInterpolator(MA_ALPHA); if (ipo) { if (!ipocontr) { - ipocontr = new KX_MaterialIpoController(); + ipocontr = new KX_MaterialIpoController(matname_hash); gameobj->GetSGNode()->AddSGController(ipocontr); ipocontr->SetObject(gameobj->GetSGNode()); } @@ -653,7 +655,7 @@ void BL_ConvertMaterialIpos( ipo = ipoList->GetScalarInterpolator(MA_SPEC_R ); if (ipo) { if (!ipocontr) { - ipocontr = new KX_MaterialIpoController(); + ipocontr = new KX_MaterialIpoController(matname_hash); gameobj->GetSGNode()->AddSGController(ipocontr); ipocontr->SetObject(gameobj->GetSGNode()); } @@ -667,7 +669,7 @@ void BL_ConvertMaterialIpos( ipo = ipoList->GetScalarInterpolator(MA_SPEC_G); if (ipo) { if (!ipocontr) { - ipocontr = new KX_MaterialIpoController(); + ipocontr = new KX_MaterialIpoController(matname_hash); gameobj->GetSGNode()->AddSGController(ipocontr); ipocontr->SetObject(gameobj->GetSGNode()); } @@ -681,7 +683,7 @@ void BL_ConvertMaterialIpos( ipo = ipoList->GetScalarInterpolator(MA_SPEC_B); if (ipo) { if (!ipocontr) { - ipocontr = new KX_MaterialIpoController(); + ipocontr = new KX_MaterialIpoController(matname_hash); gameobj->GetSGNode()->AddSGController(ipocontr); ipocontr->SetObject(gameobj->GetSGNode()); } @@ -696,7 +698,7 @@ void BL_ConvertMaterialIpos( ipo = ipoList->GetScalarInterpolator(MA_HARD); if (ipo) { if (!ipocontr) { - ipocontr = new KX_MaterialIpoController(); + ipocontr = new KX_MaterialIpoController(matname_hash); gameobj->GetSGNode()->AddSGController(ipocontr); ipocontr->SetObject(gameobj->GetSGNode()); } @@ -710,7 +712,7 @@ void BL_ConvertMaterialIpos( ipo = ipoList->GetScalarInterpolator(MA_SPEC); if (ipo) { if (!ipocontr) { - ipocontr = new KX_MaterialIpoController(); + ipocontr = new KX_MaterialIpoController(matname_hash); gameobj->GetSGNode()->AddSGController(ipocontr); ipocontr->SetObject(gameobj->GetSGNode()); } @@ -725,7 +727,7 @@ void BL_ConvertMaterialIpos( ipo = ipoList->GetScalarInterpolator(MA_REF); if (ipo) { if (!ipocontr) { - ipocontr = new KX_MaterialIpoController(); + ipocontr = new KX_MaterialIpoController(matname_hash); gameobj->GetSGNode()->AddSGController(ipocontr); ipocontr->SetObject(gameobj->GetSGNode()); } @@ -739,7 +741,7 @@ void BL_ConvertMaterialIpos( ipo = ipoList->GetScalarInterpolator(MA_EMIT); if (ipo) { if (!ipocontr) { - ipocontr = new KX_MaterialIpoController(); + ipocontr = new KX_MaterialIpoController(matname_hash); gameobj->GetSGNode()->AddSGController(ipocontr); ipocontr->SetObject(gameobj->GetSGNode()); } @@ -752,3 +754,28 @@ void BL_ConvertMaterialIpos( } } +void BL_ConvertMaterialIpos( + struct Object* blenderobject, + KX_GameObject* gameobj, + KX_BlenderSceneConverter *converter + ) +{ + if (blenderobject->totcol==1) + { + Material *mat = give_current_material(blenderobject, 1); + // if there is only one material attached to the mesh then set material_index in BL_ConvertMaterialIpos to NULL + // --> this makes the UpdateMaterialData function in KX_GameObject.cpp use the old hack of using SetObjectColor + // because this yields a better performance as not all the vertex colors need to be edited + if(mat) ConvertMaterialIpos(mat, NULL, gameobj, converter); + } + else + { + for (int material_index=1; material_index <= blenderobject->totcol; material_index++) + { + Material *mat = give_current_material(blenderobject, material_index); + STR_HashedString matname = mat->id.name; + if(mat) ConvertMaterialIpos(mat, matname.hash(), gameobj, converter); + } + } +} + diff --git a/source/gameengine/Converter/KX_IpoConvert.h b/source/gameengine/Converter/KX_IpoConvert.h index afcb1b22821..4ec9bd31062 100644 --- a/source/gameengine/Converter/KX_IpoConvert.h +++ b/source/gameengine/Converter/KX_IpoConvert.h @@ -46,7 +46,7 @@ void BL_ConvertCameraIpos(struct Camera* blendercamera, class KX_GameObject* cameraobj, class KX_BlenderSceneConverter *converter); -void BL_ConvertMaterialIpos(struct Material* blendermaterial, +void BL_ConvertMaterialIpos(struct Object* blenderobject, class KX_GameObject* materialobj, class KX_BlenderSceneConverter *converter); diff --git a/source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp b/source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp index 28ca1fd673f..768a3a45937 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp +++ b/source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp @@ -48,19 +48,10 @@ SCA_ActuatorEventManager::~SCA_ActuatorEventManager() } - - -void SCA_ActuatorEventManager::RegisterSensor(SCA_ISensor* sensor) -{ - m_sensors.push_back(sensor); -} - - - void SCA_ActuatorEventManager::NextFrame() { // check for changed actuator - for (vector::const_iterator it = m_sensors.begin();!(it==m_sensors.end());it++) + for (set::const_iterator it = m_sensors.begin();!(it==m_sensors.end());it++) { (*it)->Activate(m_logicmgr,NULL); } @@ -69,7 +60,7 @@ void SCA_ActuatorEventManager::NextFrame() void SCA_ActuatorEventManager::UpdateFrame() { // update the state of actuator before executing them - for (vector::const_iterator it = m_sensors.begin();!(it==m_sensors.end());it++) + for (set::const_iterator it = m_sensors.begin();!(it==m_sensors.end());it++) { ((SCA_ActuatorSensor*)(*it))->Update(); } diff --git a/source/gameengine/GameLogic/SCA_ActuatorEventManager.h b/source/gameengine/GameLogic/SCA_ActuatorEventManager.h index b5108764197..a7d61627c23 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorEventManager.h +++ b/source/gameengine/GameLogic/SCA_ActuatorEventManager.h @@ -44,7 +44,6 @@ public: virtual ~SCA_ActuatorEventManager(); virtual void NextFrame(); virtual void UpdateFrame(); - virtual void RegisterSensor(SCA_ISensor* sensor); //SCA_LogicManager* GetLogicManager() { return m_logicmgr;} }; diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp index e1c8ef87dd1..099cb8eebd0 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp @@ -149,7 +149,7 @@ PyParentObject SCA_ActuatorSensor::Parents[] = { }; PyMethodDef SCA_ActuatorSensor::Methods[] = { - {"getActuator", (PyCFunction) SCA_ActuatorSensor::sPyGetActuator, METH_VARARGS, GetActuator_doc}, + {"getActuator", (PyCFunction) SCA_ActuatorSensor::sPyGetActuator, METH_NOARGS, GetActuator_doc}, {"setActuator", (PyCFunction) SCA_ActuatorSensor::sPySetActuator, METH_VARARGS, SetActuator_doc}, {NULL,NULL} //Sentinel }; @@ -162,7 +162,7 @@ PyObject* SCA_ActuatorSensor::_getattr(const STR_String& attr) { char SCA_ActuatorSensor::GetActuator_doc[] = "getActuator()\n" "\tReturn the Actuator with which the sensor operates.\n"; -PyObject* SCA_ActuatorSensor::PyGetActuator(PyObject* self, PyObject* args, PyObject* kwds) +PyObject* SCA_ActuatorSensor::PyGetActuator(PyObject* self) { return PyString_FromString(m_checkactname); } @@ -180,6 +180,7 @@ PyObject* SCA_ActuatorSensor::PySetActuator(PyObject* self, PyObject* args, PyOb char *actNameArg = NULL; if (!PyArg_ParseTuple(args, "s", &actNameArg)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.h b/source/gameengine/GameLogic/SCA_ActuatorSensor.h index 6086c5bfce0..a71145f6852 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.h +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.h @@ -66,7 +66,7 @@ public: /* 3. setProperty */ KX_PYMETHOD_DOC(SCA_ActuatorSensor,SetActuator); /* 4. getProperty */ - KX_PYMETHOD_DOC(SCA_ActuatorSensor,GetActuator); + KX_PYMETHOD_DOC_NOARGS(SCA_ActuatorSensor,GetActuator); }; diff --git a/source/gameengine/GameLogic/SCA_AlwaysEventManager.cpp b/source/gameengine/GameLogic/SCA_AlwaysEventManager.cpp index ab3bc2cc4ee..4cd2dfba994 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysEventManager.cpp +++ b/source/gameengine/GameLogic/SCA_AlwaysEventManager.cpp @@ -51,16 +51,9 @@ SCA_AlwaysEventManager::SCA_AlwaysEventManager(class SCA_LogicManager* logicmgr) void SCA_AlwaysEventManager::NextFrame() { - for (vector::const_iterator i= m_sensors.begin();!(i==m_sensors.end());i++) + for (set::const_iterator i= m_sensors.begin();!(i==m_sensors.end());i++) { - SCA_ISensor* sensor = *i; - sensor->Activate(m_logicmgr, NULL); + (*i)->Activate(m_logicmgr, NULL); } } - - -void SCA_AlwaysEventManager::RegisterSensor(SCA_ISensor* sensor) -{ - m_sensors.push_back(sensor); -} diff --git a/source/gameengine/GameLogic/SCA_AlwaysEventManager.h b/source/gameengine/GameLogic/SCA_AlwaysEventManager.h index 28c71512875..a619eecddd4 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysEventManager.h +++ b/source/gameengine/GameLogic/SCA_AlwaysEventManager.h @@ -39,7 +39,6 @@ class SCA_AlwaysEventManager : public SCA_EventManager public: SCA_AlwaysEventManager(class SCA_LogicManager* logicmgr); virtual void NextFrame(); - virtual void RegisterSensor(SCA_ISensor* sensor); }; diff --git a/source/gameengine/GameLogic/SCA_EventManager.cpp b/source/gameengine/GameLogic/SCA_EventManager.cpp index 0169864a133..e4fd0379597 100644 --- a/source/gameengine/GameLogic/SCA_EventManager.cpp +++ b/source/gameengine/GameLogic/SCA_EventManager.cpp @@ -45,17 +45,14 @@ SCA_EventManager::~SCA_EventManager() { } - +void SCA_EventManager::RegisterSensor(class SCA_ISensor* sensor) +{ + m_sensors.insert(sensor); +} void SCA_EventManager::RemoveSensor(class SCA_ISensor* sensor) { - std::vector::iterator i = - std::find(m_sensors.begin(), m_sensors.end(), sensor); - if (!(i == m_sensors.end())) - { - std::swap(*i, m_sensors.back()); - m_sensors.pop_back(); - } + m_sensors.erase(sensor); } void SCA_EventManager::NextFrame(double curtime, double fixedtime) diff --git a/source/gameengine/GameLogic/SCA_EventManager.h b/source/gameengine/GameLogic/SCA_EventManager.h index 9cc1718cd1e..9dbb5a6d24f 100644 --- a/source/gameengine/GameLogic/SCA_EventManager.h +++ b/source/gameengine/GameLogic/SCA_EventManager.h @@ -30,12 +30,14 @@ #define __KX_EVENTMANAGER #include +#include #include class SCA_EventManager { protected: - std::vector m_sensors; + // use a set to speed-up insertion/removal + std::set m_sensors; public: enum EVENT_MANAGER_TYPE { @@ -61,7 +63,7 @@ public: virtual void NextFrame(); virtual void UpdateFrame(); virtual void EndFrame(); - virtual void RegisterSensor(class SCA_ISensor* sensor)=0; + virtual void RegisterSensor(class SCA_ISensor* sensor); int GetType(); protected: diff --git a/source/gameengine/GameLogic/SCA_IObject.cpp b/source/gameengine/GameLogic/SCA_IObject.cpp index 25b4af696ea..b0f8decee26 100644 --- a/source/gameengine/GameLogic/SCA_IObject.cpp +++ b/source/gameengine/GameLogic/SCA_IObject.cpp @@ -337,12 +337,31 @@ void SCA_IObject::Resume(void) void SCA_IObject::SetState(unsigned int state) { - m_state = state; - // update the status of the controllers + unsigned int tmpstate; SCA_ControllerList::iterator contit; - for (contit = m_controllers.begin(); contit != m_controllers.end(); contit++) + + // we will update the state in two steps: + // 1) set the new state bits that are 1 + // 2) clr the new state bits that are 0 + // This to ensure continuity if a sensor is attached to two states + // that are switching state: no need to deactive and reactive the sensor + + tmpstate = m_state | state; + if (tmpstate != m_state) { - (*contit)->ApplyState(m_state); + // update the status of the controllers + for (contit = m_controllers.begin(); contit != m_controllers.end(); contit++) + { + (*contit)->ApplyState(tmpstate); + } + } + m_state = state; + if (m_state != tmpstate) + { + for (contit = m_controllers.begin(); contit != m_controllers.end(); contit++) + { + (*contit)->ApplyState(m_state); + } } } diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp index 68341b57435..2dc49924062 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.cpp +++ b/source/gameengine/GameLogic/SCA_ISensor.cpp @@ -41,7 +41,8 @@ void SCA_ISensor::ReParent(SCA_IObject* parent) { SCA_ILogicBrick::ReParent(parent); - m_eventmgr->RegisterSensor(this); + // will be done when the sensor is activated + //m_eventmgr->RegisterSensor(this); this->SetActive(false); } @@ -133,6 +134,7 @@ void SCA_ISensor::DecLink() { { // sensor is detached from all controllers, initialize it so that it // is fresh as at startup when it is reattached again. + UnregisterToManager(); Init(); } } @@ -168,23 +170,23 @@ PyMethodDef SCA_ISensor::Methods[] = { {"isPositive", (PyCFunction) SCA_ISensor::sPyIsPositive, METH_VARARGS, IsPositive_doc}, {"getUsePosPulseMode", (PyCFunction) SCA_ISensor::sPyGetUsePosPulseMode, - METH_VARARGS, GetUsePosPulseMode_doc}, + METH_NOARGS, GetUsePosPulseMode_doc}, {"setUsePosPulseMode", (PyCFunction) SCA_ISensor::sPySetUsePosPulseMode, METH_VARARGS, SetUsePosPulseMode_doc}, {"getFrequency", (PyCFunction) SCA_ISensor::sPyGetFrequency, - METH_VARARGS, GetFrequency_doc}, + METH_NOARGS, GetFrequency_doc}, {"setFrequency", (PyCFunction) SCA_ISensor::sPySetFrequency, METH_VARARGS, SetFrequency_doc}, {"getUseNegPulseMode", (PyCFunction) SCA_ISensor::sPyGetUseNegPulseMode, - METH_VARARGS, GetUseNegPulseMode_doc}, + METH_NOARGS, GetUseNegPulseMode_doc}, {"setUseNegPulseMode", (PyCFunction) SCA_ISensor::sPySetUseNegPulseMode, METH_VARARGS, SetUseNegPulseMode_doc}, {"getInvert", (PyCFunction) SCA_ISensor::sPyGetInvert, - METH_VARARGS, GetInvert_doc}, + METH_NOARGS, GetInvert_doc}, {"setInvert", (PyCFunction) SCA_ISensor::sPySetInvert, METH_VARARGS, SetInvert_doc}, {"getLevel", (PyCFunction) SCA_ISensor::sPyGetLevel, - METH_VARARGS, GetLevel_doc}, + METH_NOARGS, GetLevel_doc}, {"setLevel", (PyCFunction) SCA_ISensor::sPySetLevel, METH_VARARGS, SetLevel_doc}, {NULL,NULL} //Sentinel @@ -203,6 +205,11 @@ void SCA_ISensor::RegisterToManager() m_eventmgr->RegisterSensor(this); } +void SCA_ISensor::UnregisterToManager() +{ + m_eventmgr->RemoveSensor(this); +} + void SCA_ISensor::Activate(class SCA_LogicManager* logicmgr, CValue* event) { @@ -259,7 +266,7 @@ PyObject* SCA_ISensor::PyIsPositive(PyObject* self, PyObject* args, PyObject* kw char SCA_ISensor::GetUsePosPulseMode_doc[] = "getUsePosPulseMode()\n" "\tReturns whether positive pulse mode is active.\n"; -PyObject* SCA_ISensor::PyGetUsePosPulseMode(PyObject* self, PyObject* args, PyObject* kwds) +PyObject* SCA_ISensor::PyGetUsePosPulseMode(PyObject* self) { return BoolToPyArg(m_pos_pulsemode); } @@ -286,7 +293,7 @@ PyObject* SCA_ISensor::PySetUsePosPulseMode(PyObject* self, PyObject* args, PyOb char SCA_ISensor::GetFrequency_doc[] = "getFrequency()\n" "\tReturns the frequency of the updates in pulse mode.\n" ; -PyObject* SCA_ISensor::PyGetFrequency(PyObject* self, PyObject* args, PyObject* kwds) +PyObject* SCA_ISensor::PyGetFrequency(PyObject* self) { return PyInt_FromLong(m_pulse_frequency); } @@ -321,7 +328,7 @@ PyObject* SCA_ISensor::PySetFrequency(PyObject* self, PyObject* args, PyObject* char SCA_ISensor::GetInvert_doc[] = "getInvert()\n" "\tReturns whether or not pulses from this sensor are inverted.\n" ; -PyObject* SCA_ISensor::PyGetInvert(PyObject* self, PyObject* args, PyObject* kwds) +PyObject* SCA_ISensor::PyGetInvert(PyObject* self) { return BoolToPyArg(m_invert); } @@ -342,11 +349,10 @@ char SCA_ISensor::GetLevel_doc[] = "getLevel()\n" "\tReturns whether this sensor is a level detector or a edge detector.\n" "\tIt makes a difference only in case of logic state transition (state actuator).\n" -"\tA level detector will immediately generate a pulse if the condition for the\n" -"\tdetector is met when entering the state. A edge detector will wait for an off-on\n" -"\ttransition to occur.\n" -"\tOnly some sensors implement this feature: keyboard.\n"; -PyObject* SCA_ISensor::PyGetLevel(PyObject* self, PyObject* args, PyObject* kwds) +"\tA level detector will immediately generate a pulse, negative or positive\n" +"\tdepending on the sensor condition, as soon as the state is activated.\n" +"\tA edge detector will wait for a state change before generating a pulse.\n"; +PyObject* SCA_ISensor::PyGetLevel(PyObject* self) { return BoolToPyArg(m_level); } @@ -366,7 +372,7 @@ PyObject* SCA_ISensor::PySetLevel(PyObject* self, PyObject* args, PyObject* kwds char SCA_ISensor::GetUseNegPulseMode_doc[] = "getUseNegPulseMode()\n" "\tReturns whether negative pulse mode is active.\n"; -PyObject* SCA_ISensor::PyGetUseNegPulseMode(PyObject* self, PyObject* args, PyObject* kwds) +PyObject* SCA_ISensor::PyGetUseNegPulseMode(PyObject* self) { return BoolToPyArg(m_neg_pulsemode); } diff --git a/source/gameengine/GameLogic/SCA_ISensor.h b/source/gameengine/GameLogic/SCA_ISensor.h index 4ce49e71507..d5dabbce3ee 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.h +++ b/source/gameengine/GameLogic/SCA_ISensor.h @@ -115,6 +115,8 @@ public: void SetLevel(bool lvl); void RegisterToManager(); + void UnregisterToManager(); + virtual float GetNumber(); /** Stop sensing for a while. */ @@ -129,22 +131,22 @@ public: void ClrLink() { m_links = 0; } void IncLink() - { m_links++; } + { if (!m_links++) RegisterToManager(); } void DecLink(); bool IsNoLink() const { return !m_links; } /* Python functions: */ KX_PYMETHOD_DOC(SCA_ISensor,IsPositive); - KX_PYMETHOD_DOC(SCA_ISensor,GetUsePosPulseMode); + KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetUsePosPulseMode); KX_PYMETHOD_DOC(SCA_ISensor,SetUsePosPulseMode); - KX_PYMETHOD_DOC(SCA_ISensor,GetFrequency); + KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetFrequency); KX_PYMETHOD_DOC(SCA_ISensor,SetFrequency); - KX_PYMETHOD_DOC(SCA_ISensor,GetUseNegPulseMode); + KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetUseNegPulseMode); KX_PYMETHOD_DOC(SCA_ISensor,SetUseNegPulseMode); - KX_PYMETHOD_DOC(SCA_ISensor,GetInvert); + KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetInvert); KX_PYMETHOD_DOC(SCA_ISensor,SetInvert); - KX_PYMETHOD_DOC(SCA_ISensor,GetLevel); + KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetLevel); KX_PYMETHOD_DOC(SCA_ISensor,SetLevel); }; diff --git a/source/gameengine/GameLogic/SCA_JoystickManager.cpp b/source/gameengine/GameLogic/SCA_JoystickManager.cpp index 7bf2049e56e..8ff28ba0b51 100644 --- a/source/gameengine/GameLogic/SCA_JoystickManager.cpp +++ b/source/gameengine/GameLogic/SCA_JoystickManager.cpp @@ -52,9 +52,10 @@ SCA_JoystickManager::~SCA_JoystickManager() void SCA_JoystickManager::NextFrame(double curtime,double deltatime) { - for (unsigned int i = 0; i < m_sensors.size(); i++) + set::iterator it; + for (it = m_sensors.begin(); it != m_sensors.end(); it++) { - SCA_JoystickSensor* joysensor = (SCA_JoystickSensor*) m_sensors[i]; + SCA_JoystickSensor* joysensor = (SCA_JoystickSensor*)(*it); if(!joysensor->IsSuspended()) { m_joystick->HandleEvents(); @@ -64,12 +65,6 @@ void SCA_JoystickManager::NextFrame(double curtime,double deltatime) } -void SCA_JoystickManager::RegisterSensor(SCA_ISensor* sensor) -{ - m_sensors.push_back(sensor); -} - - SCA_Joystick *SCA_JoystickManager::GetJoystickDevice() { /* diff --git a/source/gameengine/GameLogic/SCA_JoystickManager.h b/source/gameengine/GameLogic/SCA_JoystickManager.h index 3c4df64677e..f2bb27965fa 100644 --- a/source/gameengine/GameLogic/SCA_JoystickManager.h +++ b/source/gameengine/GameLogic/SCA_JoystickManager.h @@ -45,7 +45,6 @@ public: SCA_JoystickManager(class SCA_LogicManager* logicmgr); virtual ~SCA_JoystickManager(); virtual void NextFrame(double curtime,double deltatime); - virtual void RegisterSensor(SCA_ISensor* sensor); SCA_Joystick* GetJoystickDevice(void); }; diff --git a/source/gameengine/GameLogic/SCA_KeyboardManager.cpp b/source/gameengine/GameLogic/SCA_KeyboardManager.cpp index 259b06134d7..6a96442b124 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardManager.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardManager.cpp @@ -62,23 +62,14 @@ void SCA_KeyboardManager::NextFrame() { //const SCA_InputEvent& event = GetEventValue(SCA_IInputDevice::KX_EnumInputs inputcode)=0; // cerr << "SCA_KeyboardManager::NextFrame"<< endl; - for (unsigned int i=0;i::iterator it; + for (it=m_sensors.begin(); it != m_sensors.end(); it++) { - SCA_KeyboardSensor* keysensor = (SCA_KeyboardSensor*)m_sensors[i]; - keysensor->Activate(m_logicmanager,NULL); + (*it)->Activate(m_logicmanager,NULL); } } - - -void SCA_KeyboardManager::RegisterSensor(SCA_ISensor* keysensor) -{ - m_sensors.push_back(keysensor); -} - - - bool SCA_KeyboardManager::IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode) { return false; diff --git a/source/gameengine/GameLogic/SCA_KeyboardManager.h b/source/gameengine/GameLogic/SCA_KeyboardManager.h index b4a50f56025..8f3cc0ab715 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardManager.h +++ b/source/gameengine/GameLogic/SCA_KeyboardManager.h @@ -55,7 +55,6 @@ public: bool IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode); virtual void NextFrame(); - virtual void RegisterSensor(class SCA_ISensor* sensor); SCA_IInputDevice* GetInputDevice(); }; diff --git a/source/gameengine/GameLogic/SCA_LogicManager.cpp b/source/gameengine/GameLogic/SCA_LogicManager.cpp index f50161cbecb..91e66aea359 100644 --- a/source/gameengine/GameLogic/SCA_LogicManager.cpp +++ b/source/gameengine/GameLogic/SCA_LogicManager.cpp @@ -127,12 +127,17 @@ void SCA_LogicManager::RegisterGameMeshName(const STR_String& gamemeshname, void -void SCA_LogicManager::RegisterGameObj(CValue* gameobj, void* blendobj) +void SCA_LogicManager::RegisterGameObj(void* blendobj, CValue* gameobj) { - m_map_gameobj_to_blendobj.insert(CHashedPtr(gameobj), blendobj); + m_map_blendobj_to_gameobj.insert(CHashedPtr(blendobj), gameobj); } - +void SCA_LogicManager::UnregisterGameObj(void* blendobj, CValue* gameobj) +{ + void **obp = m_map_blendobj_to_gameobj[CHashedPtr(blendobj)]; + if (obp && (CValue*)(*obp) == gameobj) + m_map_blendobj_to_gameobj.remove(CHashedPtr(blendobj)); +} CValue* SCA_LogicManager::GetGameObjectByName(const STR_String& gameobjname) { @@ -146,10 +151,10 @@ CValue* SCA_LogicManager::GetGameObjectByName(const STR_String& gameobjname) } -void* SCA_LogicManager::FindBlendObjByGameObj(CValue* gameobject) +CValue* SCA_LogicManager::FindGameObjByBlendObj(void* blendobj) { - void **obp= m_map_gameobj_to_blendobj[CHashedPtr(gameobject)]; - return obp?*obp:NULL; + void **obp= m_map_blendobj_to_gameobj[CHashedPtr(blendobj)]; + return obp?(CValue*)(*obp):NULL; } @@ -171,12 +176,7 @@ void SCA_LogicManager::RemoveSensor(SCA_ISensor* sensor) (*c)->UnlinkSensor(sensor); } m_sensorcontrollermapje.erase(sensor); - - for (vector::const_iterator ie=m_eventmanagers.begin(); - !(ie==m_eventmanagers.end());ie++) - { - (*ie)->RemoveSensor(sensor); - } + sensor->UnregisterToManager(); } void SCA_LogicManager::RemoveController(SCA_IController* controller) diff --git a/source/gameengine/GameLogic/SCA_LogicManager.h b/source/gameengine/GameLogic/SCA_LogicManager.h index 39d8b865977..e0d3d506702 100644 --- a/source/gameengine/GameLogic/SCA_LogicManager.h +++ b/source/gameengine/GameLogic/SCA_LogicManager.h @@ -109,7 +109,7 @@ class SCA_LogicManager GEN_Map m_mapStringToActions; GEN_Map m_map_gamemeshname_to_blendobj; - GEN_Map m_map_gameobj_to_blendobj; + GEN_Map m_map_blendobj_to_gameobj; vector m_removedActuators; public: @@ -152,8 +152,9 @@ public: void RegisterGameMeshName(const STR_String& gamemeshname, void* blendobj); void* FindBlendObjByGameMeshName(const STR_String& gamemeshname); - void RegisterGameObj(CValue* gameobj, void* blendobj); - void* FindBlendObjByGameObj(CValue* gameobj); + void RegisterGameObj(void* blendobj, CValue* gameobj); + void UnregisterGameObj(void* blendobj, CValue* gameobj); + CValue* FindGameObjByBlendObj(void* blendobj); }; #endif //__KX_LOGICMANAGER diff --git a/source/gameengine/GameLogic/SCA_MouseManager.cpp b/source/gameengine/GameLogic/SCA_MouseManager.cpp index b4251d8ab53..ca875dad07c 100644 --- a/source/gameengine/GameLogic/SCA_MouseManager.cpp +++ b/source/gameengine/GameLogic/SCA_MouseManager.cpp @@ -75,9 +75,10 @@ void SCA_MouseManager::NextFrame() { if (m_mousedevice) { - for (unsigned int i = 0; i < m_sensors.size(); i++) + set::iterator it; + for (it=m_sensors.begin(); it!=m_sensors.end(); it++) { - SCA_MouseSensor* mousesensor = (SCA_MouseSensor*) m_sensors[i]; + SCA_MouseSensor* mousesensor = (SCA_MouseSensor*)(*it); // (0,0) is the Upper Left corner in our local window // coordinates if (!mousesensor->IsSuspended()) @@ -98,15 +99,6 @@ void SCA_MouseManager::NextFrame() } } - - -void SCA_MouseManager::RegisterSensor(SCA_ISensor* keysensor) -{ - m_sensors.push_back(keysensor); -} - - - bool SCA_MouseManager::IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode) { /* We should guard for non-mouse events maybe? A rather silly side */ diff --git a/source/gameengine/GameLogic/SCA_MouseManager.h b/source/gameengine/GameLogic/SCA_MouseManager.h index bc8254486ad..efa4c639ce7 100644 --- a/source/gameengine/GameLogic/SCA_MouseManager.h +++ b/source/gameengine/GameLogic/SCA_MouseManager.h @@ -62,7 +62,6 @@ public: */ bool IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode); virtual void NextFrame(); - virtual void RegisterSensor(class SCA_ISensor* sensor); SCA_IInputDevice* GetInputDevice(); }; diff --git a/source/gameengine/GameLogic/SCA_PropertyEventManager.cpp b/source/gameengine/GameLogic/SCA_PropertyEventManager.cpp index fc56d101728..e5e3f9cced5 100644 --- a/source/gameengine/GameLogic/SCA_PropertyEventManager.cpp +++ b/source/gameengine/GameLogic/SCA_PropertyEventManager.cpp @@ -47,19 +47,10 @@ SCA_PropertyEventManager::~SCA_PropertyEventManager() } - - -void SCA_PropertyEventManager::RegisterSensor(SCA_ISensor* sensor) -{ - m_sensors.push_back(sensor); -} - - - void SCA_PropertyEventManager::NextFrame() { // check for changed properties - for (vector::const_iterator it = m_sensors.begin();!(it==m_sensors.end());it++) + for (set::const_iterator it = m_sensors.begin();!(it==m_sensors.end());it++) { (*it)->Activate(m_logicmgr,NULL); } diff --git a/source/gameengine/GameLogic/SCA_PropertyEventManager.h b/source/gameengine/GameLogic/SCA_PropertyEventManager.h index aaa303a52c8..f166065b198 100644 --- a/source/gameengine/GameLogic/SCA_PropertyEventManager.h +++ b/source/gameengine/GameLogic/SCA_PropertyEventManager.h @@ -43,7 +43,6 @@ public: SCA_PropertyEventManager(class SCA_LogicManager* logicmgr); virtual ~SCA_PropertyEventManager(); virtual void NextFrame(); - virtual void RegisterSensor(SCA_ISensor* sensor); //SCA_LogicManager* GetLogicManager() { return m_logicmgr;} }; diff --git a/source/gameengine/GameLogic/SCA_RandomEventManager.cpp b/source/gameengine/GameLogic/SCA_RandomEventManager.cpp index 02020a52a17..156478d866d 100644 --- a/source/gameengine/GameLogic/SCA_RandomEventManager.cpp +++ b/source/gameengine/GameLogic/SCA_RandomEventManager.cpp @@ -50,16 +50,9 @@ SCA_RandomEventManager::SCA_RandomEventManager(class SCA_LogicManager* logicmgr) void SCA_RandomEventManager::NextFrame() { - for (vector::const_iterator i= m_sensors.begin();!(i==m_sensors.end());i++) + for (set::const_iterator i= m_sensors.begin();!(i==m_sensors.end());i++) { - SCA_ISensor *sensor = *i; - sensor->Activate(m_logicmgr, NULL); + (*i)->Activate(m_logicmgr, NULL); } } - - -void SCA_RandomEventManager::RegisterSensor(SCA_ISensor* sensor) -{ - m_sensors.push_back(sensor); -}; diff --git a/source/gameengine/GameLogic/SCA_RandomEventManager.h b/source/gameengine/GameLogic/SCA_RandomEventManager.h index 8c75ef665fa..79138c23c62 100644 --- a/source/gameengine/GameLogic/SCA_RandomEventManager.h +++ b/source/gameengine/GameLogic/SCA_RandomEventManager.h @@ -45,7 +45,6 @@ public: SCA_RandomEventManager(class SCA_LogicManager* logicmgr); virtual void NextFrame(); - virtual void RegisterSensor(SCA_ISensor* sensor); }; #endif //__KX_RANDOMEVENTMGR diff --git a/source/gameengine/GameLogic/SCA_TimeEventManager.cpp b/source/gameengine/GameLogic/SCA_TimeEventManager.cpp index 643f1247a52..b7fadd3d62c 100644 --- a/source/gameengine/GameLogic/SCA_TimeEventManager.cpp +++ b/source/gameengine/GameLogic/SCA_TimeEventManager.cpp @@ -65,6 +65,11 @@ void SCA_TimeEventManager::RegisterSensor(SCA_ISensor* sensor) // not yet } +void SCA_TimeEventManager::RemoveSensor(SCA_ISensor* sensor) +{ + // empty +} + void SCA_TimeEventManager::NextFrame(double curtime, double fixedtime) diff --git a/source/gameengine/GameLogic/SCA_TimeEventManager.h b/source/gameengine/GameLogic/SCA_TimeEventManager.h index 2fd39661a2d..bd57e12eb44 100644 --- a/source/gameengine/GameLogic/SCA_TimeEventManager.h +++ b/source/gameengine/GameLogic/SCA_TimeEventManager.h @@ -45,6 +45,7 @@ public: virtual void NextFrame(double curtime, double fixedtime); virtual void RegisterSensor(class SCA_ISensor* sensor); + virtual void RemoveSensor(class SCA_ISensor* sensor); void AddTimeProperty(CValue* timeval); void RemoveTimeProperty(CValue* timeval); }; diff --git a/source/gameengine/Ketsji/BL_BlenderShader.cpp b/source/gameengine/Ketsji/BL_BlenderShader.cpp index dd45d522b9f..a9a0771936c 100644 --- a/source/gameengine/Ketsji/BL_BlenderShader.cpp +++ b/source/gameengine/Ketsji/BL_BlenderShader.cpp @@ -1,6 +1,10 @@ #include "DNA_customdata_types.h" #include "DNA_material_types.h" +#include "DNA_scene_types.h" + +#include "BKE_global.h" +#include "BKE_main.h" #include "BL_BlenderShader.h" #include "BL_Material.h" @@ -10,30 +14,51 @@ #include "GPU_material.h" #endif +#include "RAS_BucketManager.h" #include "RAS_MeshObject.h" #include "RAS_IRasterizer.h" + + /* this is evil, but we need the scene to create materials with + * lights from the correct scene .. */ +static struct Scene *GetSceneForName(const STR_String& scenename) +{ + Scene *sce; -const bool BL_BlenderShader::Ok()const + for (sce= (Scene*)G.main->scene.first; sce; sce= (Scene*)sce->id.next) + if (scenename == (sce->id.name+2)) + return sce; + + return (Scene*)G.main->scene.first; +} + +bool BL_BlenderShader::Ok() { #ifdef BLENDER_GLSL - return (mGPUMat != 0); + VerifyShader(); + + return (mMat && mMat->gpumaterial); #else return 0; #endif } -BL_BlenderShader::BL_BlenderShader(struct Material *ma, int lightlayer) +BL_BlenderShader::BL_BlenderShader(KX_Scene *scene, struct Material *ma, int lightlayer) : #ifdef BLENDER_GLSL - mGPUMat(0), + mScene(scene), + mMat(ma), + mGPUMat(NULL), #endif mBound(false), mLightLayer(lightlayer) { #ifdef BLENDER_GLSL - if(ma) { - GPU_material_from_blender(ma); - mGPUMat = ma->gpumaterial; + mBlenderScene = GetSceneForName(scene->GetName()); + mBlendMode = GPU_BLEND_SOLID; + + if(mMat) { + GPU_material_from_blender(mBlenderScene, mMat); + mGPUMat = mMat->gpumaterial; } #endif } @@ -41,17 +66,29 @@ BL_BlenderShader::BL_BlenderShader(struct Material *ma, int lightlayer) BL_BlenderShader::~BL_BlenderShader() { #ifdef BLENDER_GLSL - if(mGPUMat) { - GPU_material_unbind(mGPUMat); - mGPUMat = 0; - } + if(mMat && mMat->gpumaterial) + GPU_material_unbind(mMat->gpumaterial); +#endif +} + +bool BL_BlenderShader::VerifyShader() +{ +#ifdef BLENDER_GLSL + if(mMat && !mMat->gpumaterial) + GPU_material_from_blender(mBlenderScene, mMat); + + mGPUMat = mMat->gpumaterial; + + return (mMat && mGPUMat); +#else + return false; #endif } void BL_BlenderShader::SetProg(bool enable) { #ifdef BLENDER_GLSL - if(mGPUMat) { + if(VerifyShader()) { if(enable) { GPU_material_bind(mGPUMat, mLightLayer); mBound = true; @@ -70,7 +107,7 @@ int BL_BlenderShader::GetAttribNum() GPUVertexAttribs attribs; int i, enabled = 0; - if(!mGPUMat) + if(!VerifyShader()) return enabled; GPU_material_vertex_attributes(mGPUMat, &attribs); @@ -96,7 +133,7 @@ void BL_BlenderShader::SetAttribs(RAS_IRasterizer* ras, const BL_Material *mat) ras->SetAttribNum(0); - if(!mGPUMat) + if(!VerifyShader()) return; if(ras->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED) { @@ -142,9 +179,11 @@ void BL_BlenderShader::SetAttribs(RAS_IRasterizer* ras, const BL_Material *mat) void BL_BlenderShader::Update( const KX_MeshSlot & ms, RAS_IRasterizer* rasty ) { #ifdef BLENDER_GLSL - float obmat[4][4], viewmat[4][4], viewinvmat[4][4]; + float obmat[4][4], viewmat[4][4], viewinvmat[4][4], obcol[4]; - if(!mGPUMat || !mBound) + VerifyShader(); + + if(!mGPUMat) // || !mBound) return; MT_Matrix4x4 model; @@ -158,10 +197,22 @@ void BL_BlenderShader::Update( const KX_MeshSlot & ms, RAS_IRasterizer* rasty ) view.invert(); view.getValue((float*)viewinvmat); - GPU_material_bind_uniforms(mGPUMat, obmat, viewmat, viewinvmat); + if(ms.m_bObjectColor) + ms.m_RGBAcolor.getValue((float*)obcol); + else + obcol[0]= obcol[1]= obcol[2]= obcol[3]= 1.0f; + + GPU_material_bind_uniforms(mGPUMat, obmat, viewmat, viewinvmat, obcol); + + mBlendMode = GPU_material_blend_mode(mGPUMat, obcol); #endif } +int BL_BlenderShader::GetBlendMode() +{ + return mBlendMode; +} + bool BL_BlenderShader::Equals(BL_BlenderShader *blshader) { #ifdef BLENDER_GLSL diff --git a/source/gameengine/Ketsji/BL_BlenderShader.h b/source/gameengine/Ketsji/BL_BlenderShader.h index b758d1a9cba..da9765dafa4 100644 --- a/source/gameengine/Ketsji/BL_BlenderShader.h +++ b/source/gameengine/Ketsji/BL_BlenderShader.h @@ -14,7 +14,10 @@ #include "RAS_IPolygonMaterial.h" +#include "KX_Scene.h" + struct Material; +struct Scene; class BL_Material; #define BL_MAX_ATTRIB 16 @@ -27,21 +30,28 @@ class BL_BlenderShader { private: #ifdef BLENDER_GLSL + KX_Scene *mScene; + struct Scene *mBlenderScene; + struct Material *mMat; GPUMaterial *mGPUMat; #endif bool mBound; int mLightLayer; + int mBlendMode; + + bool VerifyShader(); public: - BL_BlenderShader(struct Material *ma, int lightlayer); + BL_BlenderShader(KX_Scene *scene, struct Material *ma, int lightlayer); virtual ~BL_BlenderShader(); - const bool Ok()const; + bool Ok(); void SetProg(bool enable); int GetAttribNum(); void SetAttribs(class RAS_IRasterizer* ras, const BL_Material *mat); void Update(const class KX_MeshSlot & ms, class RAS_IRasterizer* rasty); + int GetBlendMode(); bool Equals(BL_BlenderShader *blshader); }; diff --git a/source/gameengine/Ketsji/BL_Material.h b/source/gameengine/Ketsji/BL_Material.h index 568f7e171de..dcb66ea2579 100644 --- a/source/gameengine/Ketsji/BL_Material.h +++ b/source/gameengine/Ketsji/BL_Material.h @@ -129,8 +129,7 @@ enum BL_flag TEXALPHA=8, // use alpha combiner functions TEXNEG=16, // negate blending HASIPO=32, - USENEGALPHA=64, - ALPHA_TEST=128 + USENEGALPHA=64 }; // BL_Material::ras_mode @@ -139,7 +138,7 @@ enum BL_ras_mode POLY_VIS=1, COLLIDER=2, ZSORT=4, - TRANSP=8, + ALPHA=8, TRIANGLE=16, USE_LIGHT=32, WIRE=64 diff --git a/source/gameengine/Ketsji/BL_Texture.cpp b/source/gameengine/Ketsji/BL_Texture.cpp index f24ef4322f0..f0ef84032f7 100644 --- a/source/gameengine/Ketsji/BL_Texture.cpp +++ b/source/gameengine/Ketsji/BL_Texture.cpp @@ -384,8 +384,6 @@ void BL_Texture::DisableUnit() void BL_Texture::DisableAllTextures() { - glDisable(GL_BLEND); - for(int i=0; i::iterator it; + set::iterator it; for (it = m_sensors.begin(); !(it==m_sensors.end()); it++) { // printf("KX_NetworkEventManager::proceed sensor %.2f\n", curtime); diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.h b/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.h index 0b097ba2ef6..ae88f1d4987 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.h +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.h @@ -42,9 +42,6 @@ public: class NG_NetworkDeviceInterface *ndi); virtual ~KX_NetworkEventManager (); - virtual void RegisterSensor(class SCA_ISensor* sensor); - virtual void RemoveSensor(class SCA_ISensor* sensor); - virtual void NextFrame(); virtual void EndFrame(); diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index 0f445a9f32e..a67e5b26667 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -38,6 +38,7 @@ extern "C" { // ------------------------------------ #define spit(x) std::cout << x << std::endl; +BL_Shader *KX_BlenderMaterial::mLastShader = NULL; BL_BlenderShader *KX_BlenderMaterial::mLastBlenderShader = NULL; //static PyObject *gTextureDict = 0; @@ -58,7 +59,8 @@ KX_BlenderMaterial::KX_BlenderMaterial( data->tilexrep[0], data->tileyrep[0], data->mode, - ((data->ras_mode &TRANSP)!=0), + data->transp, + ((data->ras_mode &ALPHA)!=0), ((data->ras_mode &ZSORT)!=0), lightlayer, ((data->ras_mode &TRIANGLE)!=0), @@ -79,7 +81,6 @@ KX_BlenderMaterial::KX_BlenderMaterial( m_flag |=RAS_BLENDERMAT; m_flag |=(mMaterial->IdMode>=ONETEX)?RAS_MULTITEX:0; m_flag |=(mMaterial->ras_mode & USE_LIGHT)!=0?RAS_MULTILIGHT:0; - m_flag |=(mMaterial->ras_mode &ALPHA_TEST)!=0?RAS_FORCEALPHA:0; // figure max int enabled = mMaterial->num_enabled; @@ -158,12 +159,29 @@ void KX_BlenderMaterial::OnConstruction() mConstructed = true; } +void KX_BlenderMaterial::EndFrame() +{ + if(mLastBlenderShader) { + mLastBlenderShader->SetProg(false); + mLastBlenderShader = NULL; + } + + if(mLastShader) { + mLastShader->SetProg(false); + mLastShader = NULL; + } +} + void KX_BlenderMaterial::OnExit() { if( mShader ) { - //note, the shader here is allocated, per unique material - //and this function is called per face - mShader->SetProg(false); + //note, the shader here is allocated, per unique material + //and this function is called per face + if(mShader == mLastShader) { + mShader->SetProg(false); + mLastShader = NULL; + } + delete mShader; mShader = 0; } @@ -197,13 +215,19 @@ void KX_BlenderMaterial::setShaderData( bool enable, RAS_IRasterizer *ras) int i; if( !enable || !mShader->Ok() ) { // frame cleanup. - mShader->SetProg(false); + if(mShader == mLastShader) { + mShader->SetProg(false); + mLastShader = NULL; + } + + ras->SetBlendingMode(TF_SOLID); BL_Texture::DisableAllTextures(); return; } BL_Texture::DisableAllTextures(); mShader->SetProg(true); + mLastShader = mShader; BL_Texture::ActivateFirst(); @@ -217,9 +241,12 @@ void KX_BlenderMaterial::setShaderData( bool enable, RAS_IRasterizer *ras) } if(!mUserDefBlend) { - setDefaultBlending(); + ras->SetBlendingMode(mMaterial->transp); } else { + ras->SetBlendingMode(TF_SOLID); + ras->SetBlendingMode(-1); // indicates custom mode + // tested to be valid enums glEnable(GL_BLEND); glBlendFunc(mBlendFunc[0], mBlendFunc[1]); @@ -234,11 +261,14 @@ void KX_BlenderMaterial::setBlenderShaderData( bool enable, RAS_IRasterizer *ras mLastBlenderShader->SetProg(false); mLastBlenderShader= NULL; } + + ras->SetBlendingMode(TF_SOLID); BL_Texture::DisableAllTextures(); return; } if(!mBlenderShader->Equals(mLastBlenderShader)) { + ras->SetBlendingMode(mMaterial->transp); BL_Texture::DisableAllTextures(); if(mLastBlenderShader) @@ -251,17 +281,17 @@ void KX_BlenderMaterial::setBlenderShaderData( bool enable, RAS_IRasterizer *ras void KX_BlenderMaterial::setTexData( bool enable, RAS_IRasterizer *ras) { - if(GLEW_ARB_shader_objects && mShader) - mShader->SetProg(false); - BL_Texture::DisableAllTextures(); - if( !enable ) + + if( !enable ) { + ras->SetBlendingMode(TF_SOLID); return; + } BL_Texture::ActivateFirst(); if( mMaterial->IdMode == DEFAULT_BLENDER ) { - setDefaultBlending(); + ras->SetBlendingMode(mMaterial->transp); return; } @@ -271,7 +301,7 @@ void KX_BlenderMaterial::setTexData( bool enable, RAS_IRasterizer *ras) mTextures[0].ActivateTexture(); mTextures[0].setTexEnv(0, true); mTextures[0].SetMapping(mMaterial->mapping[0].mapping); - setDefaultBlending(); + ras->SetBlendingMode(mMaterial->transp); } return; } @@ -294,9 +324,12 @@ void KX_BlenderMaterial::setTexData( bool enable, RAS_IRasterizer *ras) } if(!mUserDefBlend) { - setDefaultBlending(); + ras->SetBlendingMode(mMaterial->transp); } else { + ras->SetBlendingMode(TF_SOLID); + ras->SetBlendingMode(-1); // indicates custom mode + glEnable(GL_BLEND); glBlendFunc(mBlendFunc[0], mBlendFunc[1]); } @@ -356,6 +389,11 @@ KX_BlenderMaterial::ActivateBlenderShaders( { KX_BlenderMaterial *tmp = const_cast(this); + if(mLastShader) { + mLastShader->SetProg(false); + mLastShader= NULL; + } + // reset... if(tmp->mMaterial->IsShared()) cachingInfo =0; @@ -402,6 +440,11 @@ KX_BlenderMaterial::ActivateMat( { KX_BlenderMaterial *tmp = const_cast(this); + if(mLastShader) { + mLastShader->SetProg(false); + mLastShader= NULL; + } + if(mLastBlenderShader) { mLastBlenderShader->SetProg(false); mLastBlenderShader= NULL; @@ -451,7 +494,10 @@ KX_BlenderMaterial::Activate( return dopass; } else { - mShader->SetProg(false); + if(mShader == mLastShader) { + mShader->SetProg(false); + mLastShader = NULL; + } mPass = 0; dopass = false; return dopass; @@ -499,10 +545,22 @@ bool KX_BlenderMaterial::UsesLighting(RAS_IRasterizer *rasty) const void KX_BlenderMaterial::ActivateMeshSlot(const KX_MeshSlot & ms, RAS_IRasterizer* rasty) const { - if(mShader && GLEW_ARB_shader_objects) + if(mShader && GLEW_ARB_shader_objects) { mShader->Update(ms, rasty); - else if(mBlenderShader && GLEW_ARB_shader_objects) + } + else if(mBlenderShader && GLEW_ARB_shader_objects) { + int blendmode; + mBlenderShader->Update(ms, rasty); + + /* we do blend modes here, because they can change per object + * with the same material due to obcolor */ + blendmode = mBlenderShader->GetBlendMode(); + if((blendmode == TF_SOLID || blendmode == TF_ALPHA) && mMaterial->transp != TF_SOLID) + blendmode = mMaterial->transp; + + rasty->SetBlendingMode(blendmode); + } } void KX_BlenderMaterial::ActivatGLMaterials( RAS_IRasterizer* rasty )const @@ -582,31 +640,6 @@ void KX_BlenderMaterial::ActivateTexGen(RAS_IRasterizer *ras) const ras->EnableTextures(false); } -bool KX_BlenderMaterial::setDefaultBlending() -{ - if( mMaterial->transp &TF_ADD) { - glEnable(GL_BLEND); - glBlendFunc(GL_ONE, GL_ONE); - glDisable ( GL_ALPHA_TEST ); - return true; - } - - if( mMaterial->transp & TF_ALPHA ) { - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glDisable ( GL_ALPHA_TEST ); - return true; - } - - if( mMaterial->transp & TF_CLIP ) { - glDisable(GL_BLEND); - glEnable ( GL_ALPHA_TEST ); - glAlphaFunc(GL_GREATER, 0.5f); - return false; - } - return false; -} - void KX_BlenderMaterial::setTexMatrixData(int i) { glMatrixMode(GL_TEXTURE); @@ -831,12 +864,14 @@ KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getShader , "getShader()") void KX_BlenderMaterial::SetBlenderGLSLShader(void) { if(!mBlenderShader) - mBlenderShader = new BL_BlenderShader(mMaterial->material, m_lightlayer); + mBlenderShader = new BL_BlenderShader(mScene, mMaterial->material, m_lightlayer); if(!mBlenderShader->Ok()) { delete mBlenderShader; mBlenderShader = 0; } + else + m_flag |= RAS_BLENDERGLSL; } KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getMaterialIndex, "getMaterialIndex()") diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h index bf6d2095e7c..0d7657b8cdb 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.h +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h @@ -90,11 +90,13 @@ public: // -------------------------------- // pre calculate to avoid pops/lag at startup virtual void OnConstruction( ); + + static void EndFrame(); + private: BL_Material* mMaterial; BL_Shader* mShader; BL_BlenderShader* mBlenderShader; - static BL_BlenderShader *mLastBlenderShader; KX_Scene* mScene; BL_Texture mTextures[MAXTEX]; // texture array bool mUserDefBlend; @@ -114,7 +116,6 @@ private: void setBlenderShaderData( bool enable, RAS_IRasterizer *ras); void setShaderData( bool enable, RAS_IRasterizer *ras); - bool setDefaultBlending(); void setObjectMatrixData(int i, RAS_IRasterizer *ras); void setTexMatrixData(int i); @@ -123,6 +124,10 @@ private: // cleanup stuff void OnExit(); + // shader chacing + static BL_BlenderShader *mLastBlenderShader; + static BL_Shader *mLastShader; + mutable int mPass; }; diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp index c7b2a671f78..539eaec4a7b 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp @@ -135,7 +135,7 @@ void KX_BulletPhysicsController::getOrientation(MT_Quaternion& orn) } void KX_BulletPhysicsController::setOrientation(const MT_Matrix3x3& orn) { - btMatrix3x3 btmat(orn[0][0], orn[0][1], orn[1][2], orn[1][0], orn[1][1], orn[1][2], orn[2][0], orn[2][1], orn[2][2]); + btMatrix3x3 btmat(orn[0][0], orn[0][1], orn[0][2], orn[1][0], orn[1][1], orn[1][2], orn[2][0], orn[2][1], orn[2][2]); CcdPhysicsController::setWorldOrientation(btmat); } void KX_BulletPhysicsController::setPosition(const MT_Point3& pos) diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp index e0b2efb3a25..2401d69d3a3 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp @@ -88,11 +88,17 @@ KX_ConstraintActuator::KX_ConstraintActuator(SCA_IObject *gameobj, } else { m_refDirection /= len; } + m_minimumBound = cos(minBound); + m_maximumBound = cos(maxBound); + m_minimumSine = sin(minBound); + m_maximumSine = sin(maxBound); } break; default: m_minimumBound = minBound; m_maximumBound = maxBound; + m_minimumSine = 0.f; + m_maximumSine = 0.f; break; } @@ -153,9 +159,9 @@ bool KX_ConstraintActuator::Update(double curtime, bool frame) KX_GameObject *obj = (KX_GameObject*) GetParent(); MT_Point3 position = obj->NodeGetWorldPosition(); MT_Point3 newposition; - MT_Vector3 direction; + MT_Vector3 direction, refDirection; MT_Matrix3x3 rotation = obj->NodeGetWorldOrientation(); - MT_Scalar filter, newdistance; + MT_Scalar filter, newdistance, cosangle; int axis, sign; if (m_posDampTime) { @@ -185,11 +191,45 @@ bool KX_ConstraintActuator::Update(double curtime, bool frame) axis = 2; break; } + if ((m_maximumBound < (1.0f-FLT_EPSILON)) || (m_minimumBound < (1.0f-FLT_EPSILON))) { + // reference direction needs to be evaluated + // 1. get the cosine between current direction and target + cosangle = direction.dot(m_refDirection); + if (cosangle >= (m_maximumBound-FLT_EPSILON) && cosangle <= (m_minimumBound+FLT_EPSILON)) { + // no change to do + result = true; + goto CHECK_TIME; + } + // 2. define a new reference direction + // compute local axis with reference direction as X and + // Y in direction X refDirection plane + MT_Vector3 zaxis = m_refDirection.cross(direction); + if (MT_fuzzyZero2(zaxis.length2())) { + // direction and refDirection are identical, + // choose any other direction to define plane + if (direction[0] < 0.9999) + zaxis = m_refDirection.cross(MT_Vector3(1.0,0.0,0.0)); + else + zaxis = m_refDirection.cross(MT_Vector3(0.0,1.0,0.0)); + } + MT_Vector3 yaxis = zaxis.cross(m_refDirection); + yaxis.normalize(); + if (cosangle > m_minimumBound) { + // angle is too close to reference direction, + // choose a new reference that is exactly at minimum angle + refDirection = m_minimumBound * m_refDirection + m_minimumSine * yaxis; + } else { + // angle is too large, choose new reference direction at maximum angle + refDirection = m_maximumBound * m_refDirection + m_maximumSine * yaxis; + } + } else { + refDirection = m_refDirection; + } if (m_posDampTime) { // apply damping on the direction - direction = filter*direction + (1.0-filter)*m_refDirection; + direction = filter*direction + (1.0-filter)*refDirection; } else { - direction = m_refDirection; + direction = refDirection; } obj->AlignAxisToVect(direction, axis); result = true; @@ -197,9 +237,9 @@ bool KX_ConstraintActuator::Update(double curtime, bool frame) case KX_ACT_CONSTRAINT_DIRPX: case KX_ACT_CONSTRAINT_DIRPY: case KX_ACT_CONSTRAINT_DIRPZ: - case KX_ACT_CONSTRAINT_DIRMX: - case KX_ACT_CONSTRAINT_DIRMY: - case KX_ACT_CONSTRAINT_DIRMZ: + case KX_ACT_CONSTRAINT_DIRNX: + case KX_ACT_CONSTRAINT_DIRNY: + case KX_ACT_CONSTRAINT_DIRNZ: switch (m_locrot) { case KX_ACT_CONSTRAINT_DIRPX: direction[0] = rotation[0][0]; @@ -222,21 +262,21 @@ bool KX_ConstraintActuator::Update(double curtime, bool frame) axis = 2; sign = 1; break; - case KX_ACT_CONSTRAINT_DIRMX: + case KX_ACT_CONSTRAINT_DIRNX: direction[0] = -rotation[0][0]; direction[1] = -rotation[1][0]; direction[2] = -rotation[2][0]; axis = 0; sign = 0; break; - case KX_ACT_CONSTRAINT_DIRMY: + case KX_ACT_CONSTRAINT_DIRNY: direction[0] = -rotation[0][1]; direction[1] = -rotation[1][1]; direction[2] = -rotation[2][1]; axis = 1; sign = 0; break; - case KX_ACT_CONSTRAINT_DIRMZ: + case KX_ACT_CONSTRAINT_DIRNZ: direction[0] = -rotation[0][2]; direction[1] = -rotation[1][2]; direction[2] = -rotation[2][2]; @@ -397,27 +437,27 @@ PyParentObject KX_ConstraintActuator::Parents[] = { PyMethodDef KX_ConstraintActuator::Methods[] = { {"setDamp", (PyCFunction) KX_ConstraintActuator::sPySetDamp, METH_VARARGS, SetDamp_doc}, - {"getDamp", (PyCFunction) KX_ConstraintActuator::sPyGetDamp, METH_VARARGS, GetDamp_doc}, + {"getDamp", (PyCFunction) KX_ConstraintActuator::sPyGetDamp, METH_NOARGS, GetDamp_doc}, {"setRotDamp", (PyCFunction) KX_ConstraintActuator::sPySetRotDamp, METH_VARARGS, SetRotDamp_doc}, - {"getRotDamp", (PyCFunction) KX_ConstraintActuator::sPyGetRotDamp, METH_VARARGS, GetRotDamp_doc}, + {"getRotDamp", (PyCFunction) KX_ConstraintActuator::sPyGetRotDamp, METH_NOARGS, GetRotDamp_doc}, {"setDirection", (PyCFunction) KX_ConstraintActuator::sPySetDirection, METH_VARARGS, SetDirection_doc}, - {"getDirection", (PyCFunction) KX_ConstraintActuator::sPyGetDirection, METH_VARARGS, GetDirection_doc}, + {"getDirection", (PyCFunction) KX_ConstraintActuator::sPyGetDirection, METH_NOARGS, GetDirection_doc}, {"setOption", (PyCFunction) KX_ConstraintActuator::sPySetOption, METH_VARARGS, SetOption_doc}, - {"getOption", (PyCFunction) KX_ConstraintActuator::sPyGetOption, METH_VARARGS, GetOption_doc}, + {"getOption", (PyCFunction) KX_ConstraintActuator::sPyGetOption, METH_NOARGS, GetOption_doc}, {"setTime", (PyCFunction) KX_ConstraintActuator::sPySetTime, METH_VARARGS, SetTime_doc}, - {"getTime", (PyCFunction) KX_ConstraintActuator::sPyGetTime, METH_VARARGS, GetTime_doc}, + {"getTime", (PyCFunction) KX_ConstraintActuator::sPyGetTime, METH_NOARGS, GetTime_doc}, {"setProperty", (PyCFunction) KX_ConstraintActuator::sPySetProperty, METH_VARARGS, SetProperty_doc}, - {"getProperty", (PyCFunction) KX_ConstraintActuator::sPyGetProperty, METH_VARARGS, GetProperty_doc}, + {"getProperty", (PyCFunction) KX_ConstraintActuator::sPyGetProperty, METH_NOARGS, GetProperty_doc}, {"setMin", (PyCFunction) KX_ConstraintActuator::sPySetMin, METH_VARARGS, SetMin_doc}, - {"getMin", (PyCFunction) KX_ConstraintActuator::sPyGetMin, METH_VARARGS, GetMin_doc}, + {"getMin", (PyCFunction) KX_ConstraintActuator::sPyGetMin, METH_NOARGS, GetMin_doc}, {"setDistance", (PyCFunction) KX_ConstraintActuator::sPySetMin, METH_VARARGS, SetDistance_doc}, - {"getDistance", (PyCFunction) KX_ConstraintActuator::sPyGetMin, METH_VARARGS, GetDistance_doc}, + {"getDistance", (PyCFunction) KX_ConstraintActuator::sPyGetMin, METH_NOARGS, GetDistance_doc}, {"setMax", (PyCFunction) KX_ConstraintActuator::sPySetMax, METH_VARARGS, SetMax_doc}, - {"getMax", (PyCFunction) KX_ConstraintActuator::sPyGetMax, METH_VARARGS, GetMax_doc}, + {"getMax", (PyCFunction) KX_ConstraintActuator::sPyGetMax, METH_NOARGS, GetMax_doc}, {"setRayLength", (PyCFunction) KX_ConstraintActuator::sPySetMax, METH_VARARGS, SetRayLength_doc}, - {"getRayLength", (PyCFunction) KX_ConstraintActuator::sPyGetMax, METH_VARARGS, GetRayLength_doc}, + {"getRayLength", (PyCFunction) KX_ConstraintActuator::sPyGetMax, METH_NOARGS, GetRayLength_doc}, {"setLimit", (PyCFunction) KX_ConstraintActuator::sPySetLimit, METH_VARARGS, SetLimit_doc}, - {"getLimit", (PyCFunction) KX_ConstraintActuator::sPyGetLimit, METH_VARARGS, GetLimit_doc}, + {"getLimit", (PyCFunction) KX_ConstraintActuator::sPyGetLimit, METH_NOARGS, GetLimit_doc}, {NULL,NULL} //Sentinel }; @@ -436,6 +476,7 @@ PyObject* KX_ConstraintActuator::PySetDamp(PyObject* self, PyObject* kwds) { int dampArg; if(!PyArg_ParseTuple(args, "i", &dampArg)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -448,9 +489,7 @@ PyObject* KX_ConstraintActuator::PySetDamp(PyObject* self, char KX_ConstraintActuator::GetDamp_doc[] = "getDamp()\n" "\tReturns the damping parameter.\n"; -PyObject* KX_ConstraintActuator::PyGetDamp(PyObject* self, - PyObject* args, - PyObject* kwds){ +PyObject* KX_ConstraintActuator::PyGetDamp(PyObject* self){ return PyInt_FromLong(m_posDampTime); } @@ -465,6 +504,7 @@ PyObject* KX_ConstraintActuator::PySetRotDamp(PyObject* self, PyObject* kwds) { int dampArg; if(!PyArg_ParseTuple(args, "i", &dampArg)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -477,9 +517,7 @@ PyObject* KX_ConstraintActuator::PySetRotDamp(PyObject* self, char KX_ConstraintActuator::GetRotDamp_doc[] = "getRotDamp()\n" "\tReturns the damping time for application of the constraint.\n"; -PyObject* KX_ConstraintActuator::PyGetRotDamp(PyObject* self, - PyObject* args, - PyObject* kwds){ +PyObject* KX_ConstraintActuator::PyGetRotDamp(PyObject* self){ return PyInt_FromLong(m_rotDampTime); } @@ -496,6 +534,7 @@ PyObject* KX_ConstraintActuator::PySetDirection(PyObject* self, MT_Vector3 dir; if(!PyArg_ParseTuple(args, "(fff)", &x, &y, &z)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } dir[0] = x; @@ -514,9 +553,7 @@ PyObject* KX_ConstraintActuator::PySetDirection(PyObject* self, char KX_ConstraintActuator::GetDirection_doc[] = "getDirection()\n" "\tReturns the reference direction of the orientation constraint as a 3-tuple.\n"; -PyObject* KX_ConstraintActuator::PyGetDirection(PyObject* self, - PyObject* args, - PyObject* kwds){ +PyObject* KX_ConstraintActuator::PyGetDirection(PyObject* self){ PyObject *retVal = PyList_New(3); PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_refDirection[0])); @@ -540,6 +577,7 @@ PyObject* KX_ConstraintActuator::PySetOption(PyObject* self, PyObject* kwds) { int option; if(!PyArg_ParseTuple(args, "i", &option)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -551,9 +589,7 @@ PyObject* KX_ConstraintActuator::PySetOption(PyObject* self, char KX_ConstraintActuator::GetOption_doc[] = "getOption()\n" "\tReturns the option parameter.\n"; -PyObject* KX_ConstraintActuator::PyGetOption(PyObject* self, - PyObject* args, - PyObject* kwds){ +PyObject* KX_ConstraintActuator::PyGetOption(PyObject* self){ return PyInt_FromLong(m_option); } @@ -569,6 +605,7 @@ PyObject* KX_ConstraintActuator::PySetTime(PyObject* self, PyObject* kwds) { int t; if(!PyArg_ParseTuple(args, "i", &t)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -582,9 +619,7 @@ PyObject* KX_ConstraintActuator::PySetTime(PyObject* self, char KX_ConstraintActuator::GetTime_doc[] = "getTime()\n" "\tReturns the time parameter.\n"; -PyObject* KX_ConstraintActuator::PyGetTime(PyObject* self, - PyObject* args, - PyObject* kwds){ +PyObject* KX_ConstraintActuator::PyGetTime(PyObject* self){ return PyInt_FromLong(m_activeTime); } @@ -599,6 +634,7 @@ PyObject* KX_ConstraintActuator::PySetProperty(PyObject* self, PyObject* kwds) { char *property; if (!PyArg_ParseTuple(args, "s", &property)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } if (property == NULL) { @@ -614,9 +650,7 @@ PyObject* KX_ConstraintActuator::PySetProperty(PyObject* self, char KX_ConstraintActuator::GetProperty_doc[] = "getProperty()\n" "\tReturns the property parameter.\n"; -PyObject* KX_ConstraintActuator::PyGetProperty(PyObject* self, - PyObject* args, - PyObject* kwds){ +PyObject* KX_ConstraintActuator::PyGetProperty(PyObject* self){ return PyString_FromString(m_property); } @@ -636,6 +670,7 @@ PyObject* KX_ConstraintActuator::PySetMin(PyObject* self, PyObject* kwds) { float minArg; if(!PyArg_ParseTuple(args, "f", &minArg)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -661,9 +696,7 @@ char KX_ConstraintActuator::GetMin_doc[] = "getMin()\n" "\tReturns the lower value of the interval to which the value\n" "\tis clipped.\n"; -PyObject* KX_ConstraintActuator::PyGetMin(PyObject* self, - PyObject* args, - PyObject* kwds) { +PyObject* KX_ConstraintActuator::PyGetMin(PyObject* self) { return PyFloat_FromDouble(m_minimumBound); } @@ -683,6 +716,7 @@ PyObject* KX_ConstraintActuator::PySetMax(PyObject* self, PyObject* kwds){ float maxArg; if(!PyArg_ParseTuple(args, "f", &maxArg)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -708,9 +742,7 @@ char KX_ConstraintActuator::GetMax_doc[] = "getMax()\n" "\tReturns the upper value of the interval to which the value\n" "\tis clipped.\n"; -PyObject* KX_ConstraintActuator::PyGetMax(PyObject* self, - PyObject* args, - PyObject* kwds) { +PyObject* KX_ConstraintActuator::PyGetMax(PyObject* self) { return PyFloat_FromDouble(m_maximumBound); } @@ -738,6 +770,7 @@ PyObject* KX_ConstraintActuator::PySetLimit(PyObject* self, PyObject* kwds) { int locrotArg; if(!PyArg_ParseTuple(args, "i", &locrotArg)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -749,9 +782,7 @@ PyObject* KX_ConstraintActuator::PySetLimit(PyObject* self, char KX_ConstraintActuator::GetLimit_doc[] = "getLimit()\n" "\tReturns the type of constraint.\n"; -PyObject* KX_ConstraintActuator::PyGetLimit(PyObject* self, - PyObject* args, - PyObject* kwds) { +PyObject* KX_ConstraintActuator::PyGetLimit(PyObject* self) { return PyInt_FromLong(m_locrot); } diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.h b/source/gameengine/Ketsji/KX_ConstraintActuator.h index 5a1d4d23217..d9f39124cac 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.h +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.h @@ -48,6 +48,10 @@ protected: float m_minimumBound; // max (float) float m_maximumBound; + // sinus of minimum angle + float m_minimumSine; + // sinus of maximum angle + float m_maximumSine; // reference direction MT_Vector3 m_refDirection; // locrotxyz choice (pick one): only one choice allowed at a time! @@ -80,9 +84,9 @@ protected: KX_ACT_CONSTRAINT_DIRPX, KX_ACT_CONSTRAINT_DIRPY, KX_ACT_CONSTRAINT_DIRPZ, - KX_ACT_CONSTRAINT_DIRMX, - KX_ACT_CONSTRAINT_DIRMY, - KX_ACT_CONSTRAINT_DIRMZ, + KX_ACT_CONSTRAINT_DIRNX, + KX_ACT_CONSTRAINT_DIRNY, + KX_ACT_CONSTRAINT_DIRNZ, KX_ACT_CONSTRAINT_ORIX, KX_ACT_CONSTRAINT_ORIY, KX_ACT_CONSTRAINT_ORIZ, @@ -127,27 +131,27 @@ protected: virtual PyObject* _getattr(const STR_String& attr); KX_PYMETHOD_DOC(KX_ConstraintActuator,SetDamp); - KX_PYMETHOD_DOC(KX_ConstraintActuator,GetDamp); + KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetDamp); KX_PYMETHOD_DOC(KX_ConstraintActuator,SetRotDamp); - KX_PYMETHOD_DOC(KX_ConstraintActuator,GetRotDamp); + KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetRotDamp); KX_PYMETHOD_DOC(KX_ConstraintActuator,SetDirection); - KX_PYMETHOD_DOC(KX_ConstraintActuator,GetDirection); + KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetDirection); KX_PYMETHOD_DOC(KX_ConstraintActuator,SetOption); - KX_PYMETHOD_DOC(KX_ConstraintActuator,GetOption); + KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetOption); KX_PYMETHOD_DOC(KX_ConstraintActuator,SetTime); - KX_PYMETHOD_DOC(KX_ConstraintActuator,GetTime); + KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetTime); KX_PYMETHOD_DOC(KX_ConstraintActuator,SetProperty); - KX_PYMETHOD_DOC(KX_ConstraintActuator,GetProperty); + KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetProperty); KX_PYMETHOD_DOC(KX_ConstraintActuator,SetMin); - KX_PYMETHOD_DOC(KX_ConstraintActuator,GetMin); + KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetMin); static char SetDistance_doc[]; static char GetDistance_doc[]; KX_PYMETHOD_DOC(KX_ConstraintActuator,SetMax); - KX_PYMETHOD_DOC(KX_ConstraintActuator,GetMax); + KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetMax); static char SetRayLength_doc[]; static char GetRayLength_doc[]; KX_PYMETHOD_DOC(KX_ConstraintActuator,SetLimit); - KX_PYMETHOD_DOC(KX_ConstraintActuator,GetLimit); + KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetLimit); }; #endif //__KX_CONSTRAINTACTUATOR diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index d40fa1e2446..02d1ad1b12b 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -77,10 +77,10 @@ KX_GameObject::KX_GameObject( SCA_IObject(T), m_bDyna(false), m_layer(0), + m_pBlenderObject(NULL), m_bSuspendDynamics(false), m_bUseObjectColor(false), m_bIsNegativeScaling(false), - m_pBlenderObject(NULL), m_bVisible(true), m_pPhysicsController1(NULL), m_pPhysicsEnvironment(NULL), @@ -96,12 +96,9 @@ KX_GameObject::KX_GameObject( KX_NormalParentRelation * parent_relation = KX_NormalParentRelation::New(); m_pSGNode->SetParentRelation(parent_relation); - - }; - KX_GameObject::~KX_GameObject() { // is this delete somewhere ? @@ -165,6 +162,7 @@ STR_String KX_GameObject::GetName() void KX_GameObject::SetName(STR_String name) { m_name = name; + }; // Set the name of the value @@ -277,6 +275,7 @@ void KX_GameObject::ProcessReplica(KX_GameObject* replica) replica->m_pSGNode = NULL; replica->m_pClient_info = new KX_ClientObjectInfo(*m_pClient_info); replica->m_pClient_info->m_gameobject = replica; + replica->m_state = 0; } @@ -442,6 +441,7 @@ void KX_GameObject::UpdateIPO(float curframetime, // IPO update void KX_GameObject::UpdateMaterialData( + dword matname_hash, MT_Vector4 rgba, MT_Vector3 specrgb, MT_Scalar hard, @@ -453,16 +453,35 @@ KX_GameObject::UpdateMaterialData( ) { int mesh = 0; + if (((unsigned int)mesh < m_meshes.size()) && mesh >= 0) { RAS_MaterialBucket::Set::iterator mit = m_meshes[mesh]->GetFirstMaterial(); for(; mit != m_meshes[mesh]->GetLastMaterial(); ++mit) { RAS_IPolyMaterial* poly = (*mit)->GetPolyMaterial(); - if(poly->GetFlag() & RAS_BLENDERMAT ) + if(poly->GetFlag() & RAS_BLENDERMAT) { - SetObjectColor(rgba); KX_BlenderMaterial *m = static_cast(poly); - m->UpdateIPO(rgba, specrgb,hard,spec,ref,emit, alpha); + + if (matname_hash == NULL) + { + m->UpdateIPO(rgba, specrgb,hard,spec,ref,emit, alpha); + // if mesh has only one material attached to it then use original hack with no need to edit vertices (better performance) + if(!(poly->GetFlag() & RAS_BLENDERGLSL)) + SetObjectColor(rgba); + } + else + { + if (matname_hash == poly->GetMaterialNameHash()) + { + m->UpdateIPO(rgba, specrgb,hard,spec,ref,emit, alpha); + m_meshes[mesh]->SetVertexColor(poly,rgba); + + // no break here, because one blender material can be split into several game engine materials + // (e.g. one uvsphere material is split into one material at poles with ras_mode TRIANGLE and one material for the body + // if here was a break then would miss some vertices if material was split + } + } } } } @@ -1306,18 +1325,18 @@ PyObject* KX_GameObject::PyRemoveParent(PyObject* self) } -static void walk_children(SG_Node* node, PyObject *list, bool recursive) +static void walk_children(SG_Node* node, CListValue* list, bool recursive) { NodeList& children = node->GetSGChildren(); for (NodeList::iterator childit = children.begin();!(childit==children.end());++childit) { SG_Node* childnode = (*childit); - KX_GameObject* childobj = (KX_GameObject*)childnode->GetSGClientObject(); + CValue* childobj = (CValue*)childnode->GetSGClientObject(); if (childobj != NULL) // This is a GameObject { // add to the list - PyList_Append(list, (PyObject *)childobj); + list->Add(childobj->AddRef()); } // if the childobj is NULL then this may be an inverse parent link @@ -1330,14 +1349,14 @@ static void walk_children(SG_Node* node, PyObject *list, bool recursive) PyObject* KX_GameObject::PyGetChildren(PyObject* self) { - PyObject * list = PyList_New(0); + CListValue* list = new CListValue(); walk_children(m_pSGNode, list, 0); return list; } PyObject* KX_GameObject::PyGetChildrenRecursive(PyObject* self) { - PyObject * list = PyList_New(0); + CListValue* list = new CListValue(); walk_children(m_pSGNode, list, 1); return list; } @@ -1470,6 +1489,7 @@ PyObject* KX_GameObject::PyAlignAxisToVect(PyObject* self, if (PyVecTo(pyvect, vect)) { AlignAxisToVect(vect,axis,fac); + NodeUpdateGS(0.f,true); Py_RETURN_NONE; } } @@ -1567,8 +1587,10 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCastTo, float dist = 0.0f; char *propName = NULL; - if (!PyArg_ParseTuple(args,"O|fs", &pyarg, &dist, &propName)) + if (!PyArg_ParseTuple(args,"O|fs", &pyarg, &dist, &propName)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; + } if (!PyVecTo(pyarg, toPoint)) { @@ -1615,11 +1637,11 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCastTo, } KX_PYMETHODDEF_DOC(KX_GameObject, rayCast, -"rayCast(to,from,dist,prop): cast a ray and return tuple (object,hit,normal) of contact point with object within dist that matches prop or None if no hit\n" + "rayCast(to,from,dist,prop): cast a ray and return tuple (object,hit,normal) of contact point with object within dist that matches prop or (None,None,None) tuple if no hit\n" " prop = property name that object must have; can be omitted => detect any object\n" " dist = max distance to look (can be negative => look behind); 0 or omitted => detect up to to\n" " from = 3-tuple or object reference for origin of ray (if object, use center of object)\n" -" Can None or omitted => start from self object center\n" +" Can be None or omitted => start from self object center\n" " to = 3-tuple or object reference for destination of ray (if object, use center of object)\n" "Note: the object on which you call this method matters: the ray will ignore it if it goes through it\n") { @@ -1631,8 +1653,10 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCast, char *propName = NULL; KX_GameObject *other; - if (!PyArg_ParseTuple(args,"O|Ofs", &pyto, &pyfrom, &dist, &propName)) + if (!PyArg_ParseTuple(args,"O|Ofs", &pyto, &pyfrom, &dist, &propName)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; + } if (!PyVecTo(pyto, toPoint)) { @@ -1690,16 +1714,14 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCast, if (m_pHitObject) { PyObject* returnValue = PyTuple_New(3); - if (!returnValue) + if (!returnValue) { + PyErr_SetString(PyExc_TypeError, "PyTuple_New() failed"); return NULL; + } PyTuple_SET_ITEM(returnValue, 0, m_pHitObject->AddRef()); PyTuple_SET_ITEM(returnValue, 1, PyObjectFrom(resultPoint)); PyTuple_SET_ITEM(returnValue, 2, PyObjectFrom(resultNormal)); return returnValue; - //return Py_BuildValue("(O,(fff),(fff))", - // m_pHitObject->AddRef(), // trick: KX_GameObject are not true Python object, they use a difference reference count system - // resultPoint[0], resultPoint[1], resultPoint[2], - // resultNormal[0], resultNormal[1], resultNormal[2]); } return Py_BuildValue("OOO", Py_None, Py_None, Py_None); //Py_RETURN_NONE; diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 6051cf850b5..1d36798b12f 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -521,6 +521,7 @@ public: */ void UpdateMaterialData( + dword matname_hash, MT_Vector4 rgba, MT_Vector3 specrgb, MT_Scalar hard, diff --git a/source/gameengine/Ketsji/KX_IpoActuator.cpp b/source/gameengine/Ketsji/KX_IpoActuator.cpp index b7103f49aee..af3add8a323 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.cpp +++ b/source/gameengine/Ketsji/KX_IpoActuator.cpp @@ -430,27 +430,27 @@ PyMethodDef KX_IpoActuator::Methods[] = { {"setStart", (PyCFunction) KX_IpoActuator::sPySetStart, METH_VARARGS, SetStart_doc}, {"getStart", (PyCFunction) KX_IpoActuator::sPyGetStart, - METH_VARARGS, GetStart_doc}, + METH_NOARGS, GetStart_doc}, {"setEnd", (PyCFunction) KX_IpoActuator::sPySetEnd, METH_VARARGS, SetEnd_doc}, {"getEnd", (PyCFunction) KX_IpoActuator::sPyGetEnd, - METH_VARARGS, GetEnd_doc}, + METH_NOARGS, GetEnd_doc}, {"setIpoAsForce", (PyCFunction) KX_IpoActuator::sPySetIpoAsForce, METH_VARARGS, SetIpoAsForce_doc}, {"getIpoAsForce", (PyCFunction) KX_IpoActuator::sPyGetIpoAsForce, - METH_VARARGS, GetIpoAsForce_doc}, + METH_NOARGS, GetIpoAsForce_doc}, {"setIpoAdd", (PyCFunction) KX_IpoActuator::sPySetIpoAdd, METH_VARARGS, SetIpoAdd_doc}, {"getIpoAdd", (PyCFunction) KX_IpoActuator::sPyGetIpoAdd, - METH_VARARGS, GetIpoAdd_doc}, + METH_NOARGS, GetIpoAdd_doc}, {"setType", (PyCFunction) KX_IpoActuator::sPySetType, METH_VARARGS, SetType_doc}, {"getType", (PyCFunction) KX_IpoActuator::sPyGetType, - METH_VARARGS, GetType_doc}, + METH_NOARGS, GetType_doc}, {"setForceIpoActsLocal", (PyCFunction) KX_IpoActuator::sPySetForceIpoActsLocal, METH_VARARGS, SetForceIpoActsLocal_doc}, {"getForceIpoActsLocal", (PyCFunction) KX_IpoActuator::sPyGetForceIpoActsLocal, - METH_VARARGS, GetForceIpoActsLocal_doc}, + METH_NOARGS, GetForceIpoActsLocal_doc}, {NULL,NULL} //Sentinel }; @@ -480,6 +480,7 @@ PyObject* KX_IpoActuator::PySet(PyObject* self, int startFrame, stopFrame; if(!PyArg_ParseTuple(args, "siii", &mode, &startFrame, &stopFrame, &forceToggle)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } modenum = string2mode(mode); @@ -515,6 +516,7 @@ PyObject* KX_IpoActuator::PySetProperty(PyObject* self, /* args: property */ char *propertyName; if(!PyArg_ParseTuple(args, "s", &propertyName)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -533,6 +535,7 @@ PyObject* KX_IpoActuator::PySetStart(PyObject* self, PyObject* kwds) { float startArg; if(!PyArg_ParseTuple(args, "f", &startArg)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -544,9 +547,7 @@ PyObject* KX_IpoActuator::PySetStart(PyObject* self, char KX_IpoActuator::GetStart_doc[] = "getStart()\n" "\tReturns the frame from which the ipo starts playing.\n"; -PyObject* KX_IpoActuator::PyGetStart(PyObject* self, - PyObject* args, - PyObject* kwds) { +PyObject* KX_IpoActuator::PyGetStart(PyObject* self) { return PyFloat_FromDouble(m_startframe); } @@ -560,6 +561,7 @@ PyObject* KX_IpoActuator::PySetEnd(PyObject* self, PyObject* kwds) { float endArg; if(!PyArg_ParseTuple(args, "f", &endArg)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -571,9 +573,7 @@ PyObject* KX_IpoActuator::PySetEnd(PyObject* self, char KX_IpoActuator::GetEnd_doc[] = "getEnd()\n" "\tReturns the frame at which the ipo stops playing.\n"; -PyObject* KX_IpoActuator::PyGetEnd(PyObject* self, - PyObject* args, - PyObject* kwds) { +PyObject* KX_IpoActuator::PyGetEnd(PyObject* self) { return PyFloat_FromDouble(m_endframe); } @@ -588,6 +588,7 @@ PyObject* KX_IpoActuator::PySetIpoAsForce(PyObject* self, int boolArg; if (!PyArg_ParseTuple(args, "i", &boolArg)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -601,9 +602,7 @@ PyObject* KX_IpoActuator::PySetIpoAsForce(PyObject* self, char KX_IpoActuator::GetIpoAsForce_doc[] = "getIpoAsForce()\n" "\tReturns whether to interpret the ipo as a force rather than a displacement.\n"; -PyObject* KX_IpoActuator::PyGetIpoAsForce(PyObject* self, - PyObject* args, - PyObject* kwds) { +PyObject* KX_IpoActuator::PyGetIpoAsForce(PyObject* self) { return BoolToPyArg(m_ipo_as_force); } @@ -618,6 +617,7 @@ PyObject* KX_IpoActuator::PySetIpoAdd(PyObject* self, int boolArg; if (!PyArg_ParseTuple(args, "i", &boolArg)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -631,9 +631,7 @@ PyObject* KX_IpoActuator::PySetIpoAdd(PyObject* self, char KX_IpoActuator::GetIpoAdd_doc[] = "getIpoAsAdd()\n" "\tReturns whether to interpret the ipo as additive rather than absolute.\n"; -PyObject* KX_IpoActuator::PyGetIpoAdd(PyObject* self, - PyObject* args, - PyObject* kwds) { +PyObject* KX_IpoActuator::PyGetIpoAdd(PyObject* self) { return BoolToPyArg(m_ipo_add); } @@ -648,6 +646,7 @@ PyObject* KX_IpoActuator::PySetType(PyObject* self, int typeArg; if (!PyArg_ParseTuple(args, "i", &typeArg)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -662,9 +661,7 @@ PyObject* KX_IpoActuator::PySetType(PyObject* self, char KX_IpoActuator::GetType_doc[] = "getType()\n" "\tReturns the operation mode of the actuator.\n"; -PyObject* KX_IpoActuator::PyGetType(PyObject* self, - PyObject* args, - PyObject* kwds) { +PyObject* KX_IpoActuator::PyGetType(PyObject* self) { return PyInt_FromLong(m_type); } @@ -681,6 +678,7 @@ PyObject* KX_IpoActuator::PySetForceIpoActsLocal(PyObject* self, int boolArg; if (!PyArg_ParseTuple(args, "i", &boolArg)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -693,9 +691,7 @@ char KX_IpoActuator::GetForceIpoActsLocal_doc[] = "getForceIpoActsLocal()\n" "\tReturn whether to apply the force in the object's local\n" "\tcoordinates rather than the world global coordinates.\n"; -PyObject* KX_IpoActuator::PyGetForceIpoActsLocal(PyObject* self, - PyObject* args, - PyObject* kwds) { +PyObject* KX_IpoActuator::PyGetForceIpoActsLocal(PyObject* self) { return BoolToPyArg(m_ipo_local); } diff --git a/source/gameengine/Ketsji/KX_IpoActuator.h b/source/gameengine/Ketsji/KX_IpoActuator.h index ae554fb0fce..d6f52f8d59d 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.h +++ b/source/gameengine/Ketsji/KX_IpoActuator.h @@ -143,17 +143,17 @@ public: KX_PYMETHOD_DOC(KX_IpoActuator,SetProperty); /* KX_PYMETHOD_DOC(KX_IpoActuator,SetKey2Key); */ KX_PYMETHOD_DOC(KX_IpoActuator,SetStart); - KX_PYMETHOD_DOC(KX_IpoActuator,GetStart); + KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetStart); KX_PYMETHOD_DOC(KX_IpoActuator,SetEnd); - KX_PYMETHOD_DOC(KX_IpoActuator,GetEnd); + KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetEnd); KX_PYMETHOD_DOC(KX_IpoActuator,SetIpoAsForce); - KX_PYMETHOD_DOC(KX_IpoActuator,GetIpoAsForce); + KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetIpoAsForce); KX_PYMETHOD_DOC(KX_IpoActuator,SetIpoAdd); - KX_PYMETHOD_DOC(KX_IpoActuator,GetIpoAdd); + KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetIpoAdd); KX_PYMETHOD_DOC(KX_IpoActuator,SetType); - KX_PYMETHOD_DOC(KX_IpoActuator,GetType); + KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetType); KX_PYMETHOD_DOC(KX_IpoActuator,SetForceIpoActsLocal); - KX_PYMETHOD_DOC(KX_IpoActuator,GetForceIpoActsLocal); + KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetForceIpoActsLocal); }; diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index db099d56b55..1d6cc975ab5 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -118,7 +118,6 @@ KX_KetsjiEngine::KX_KetsjiEngine(KX_ISystem* system) m_bInitialized(false), m_activecam(0), m_bFixedTime(false), - m_game2ipo(false), m_firstframe(true), @@ -148,6 +147,8 @@ KX_KetsjiEngine::KX_KetsjiEngine(KX_ISystem* system) m_showBackground(false), m_show_debug_properties(false), + m_game2ipo(false), + // Default behavior is to hide the cursor every frame. m_hideCursor(false), diff --git a/source/gameengine/Ketsji/KX_MaterialIpoController.cpp b/source/gameengine/Ketsji/KX_MaterialIpoController.cpp index c0757a32b9c..2ce5d469380 100644 --- a/source/gameengine/Ketsji/KX_MaterialIpoController.cpp +++ b/source/gameengine/Ketsji/KX_MaterialIpoController.cpp @@ -37,6 +37,7 @@ bool KX_MaterialIpoController::Update(double currentTime) //kxgameobj->SetObjectColor(m_rgba); kxgameobj->UpdateMaterialData( + m_matname_hash, m_rgba, m_specrgb, m_hard, diff --git a/source/gameengine/Ketsji/KX_MaterialIpoController.h b/source/gameengine/Ketsji/KX_MaterialIpoController.h index e76ddeefb04..4d2e258bf94 100644 --- a/source/gameengine/Ketsji/KX_MaterialIpoController.h +++ b/source/gameengine/Ketsji/KX_MaterialIpoController.h @@ -7,6 +7,8 @@ #include "SG_Spatial.h" #include "KX_IInterpolator.h" +#include "STR_String.h" //typedef dword + class KX_MaterialIpoController : public SG_Controller { public: @@ -23,10 +25,12 @@ private: bool m_modified; double m_ipotime; + dword m_matname_hash; public: - KX_MaterialIpoController() : + KX_MaterialIpoController(dword matname_hash) : m_modified(true), - m_ipotime(0.0) + m_ipotime(0.0), + m_matname_hash(matname_hash) {} virtual ~KX_MaterialIpoController(); virtual SG_Controller* GetReplica(class SG_Node* destnode); diff --git a/source/gameengine/Ketsji/KX_NearSensor.cpp b/source/gameengine/Ketsji/KX_NearSensor.cpp index 89699d80031..140dd37f5c6 100644 --- a/source/gameengine/Ketsji/KX_NearSensor.cpp +++ b/source/gameengine/Ketsji/KX_NearSensor.cpp @@ -98,6 +98,14 @@ void KX_NearSensor::RegisterSumo(KX_TouchEventManager *touchman) } } +void KX_NearSensor::UnregisterSumo(KX_TouchEventManager* touchman) +{ + if (m_physCtrl) + { + touchman->GetPhysicsEnvironment()->removeSensor(m_physCtrl); + } +} + CValue* KX_NearSensor::GetReplica() { KX_NearSensor* replica = new KX_NearSensor(*this); diff --git a/source/gameengine/Ketsji/KX_NearSensor.h b/source/gameengine/Ketsji/KX_NearSensor.h index c6724caccc3..3f7078ef9fd 100644 --- a/source/gameengine/Ketsji/KX_NearSensor.h +++ b/source/gameengine/Ketsji/KX_NearSensor.h @@ -77,6 +77,7 @@ public: const PHY_CollData * coll_data); virtual bool BroadPhaseFilterCollision(void*obj1,void*obj2); virtual void RegisterSumo(KX_TouchEventManager *touchman); + virtual void UnregisterSumo(KX_TouchEventManager* touchman); virtual PyObject* _getattr(const STR_String& attr); diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index 9ac0b4d4703..5cd4d089c14 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -304,27 +304,27 @@ PyParentObject KX_ObjectActuator::Parents[] = { }; PyMethodDef KX_ObjectActuator::Methods[] = { - {"getForce", (PyCFunction) KX_ObjectActuator::sPyGetForce, METH_VARARGS}, + {"getForce", (PyCFunction) KX_ObjectActuator::sPyGetForce, METH_NOARGS}, {"setForce", (PyCFunction) KX_ObjectActuator::sPySetForce, METH_VARARGS}, - {"getTorque", (PyCFunction) KX_ObjectActuator::sPyGetTorque, METH_VARARGS}, + {"getTorque", (PyCFunction) KX_ObjectActuator::sPyGetTorque, METH_NOARGS}, {"setTorque", (PyCFunction) KX_ObjectActuator::sPySetTorque, METH_VARARGS}, - {"getDLoc", (PyCFunction) KX_ObjectActuator::sPyGetDLoc, METH_VARARGS}, + {"getDLoc", (PyCFunction) KX_ObjectActuator::sPyGetDLoc, METH_NOARGS}, {"setDLoc", (PyCFunction) KX_ObjectActuator::sPySetDLoc, METH_VARARGS}, - {"getDRot", (PyCFunction) KX_ObjectActuator::sPyGetDRot, METH_VARARGS}, + {"getDRot", (PyCFunction) KX_ObjectActuator::sPyGetDRot, METH_NOARGS}, {"setDRot", (PyCFunction) KX_ObjectActuator::sPySetDRot, METH_VARARGS}, - {"getLinearVelocity", (PyCFunction) KX_ObjectActuator::sPyGetLinearVelocity, METH_VARARGS}, + {"getLinearVelocity", (PyCFunction) KX_ObjectActuator::sPyGetLinearVelocity, METH_NOARGS}, {"setLinearVelocity", (PyCFunction) KX_ObjectActuator::sPySetLinearVelocity, METH_VARARGS}, - {"getAngularVelocity", (PyCFunction) KX_ObjectActuator::sPyGetAngularVelocity, METH_VARARGS}, + {"getAngularVelocity", (PyCFunction) KX_ObjectActuator::sPyGetAngularVelocity, METH_NOARGS}, {"setAngularVelocity", (PyCFunction) KX_ObjectActuator::sPySetAngularVelocity, METH_VARARGS}, {"setDamping", (PyCFunction) KX_ObjectActuator::sPySetDamping, METH_VARARGS}, - {"getDamping", (PyCFunction) KX_ObjectActuator::sPyGetDamping, METH_VARARGS}, + {"getDamping", (PyCFunction) KX_ObjectActuator::sPyGetDamping, METH_NOARGS}, {"setForceLimitX", (PyCFunction) KX_ObjectActuator::sPySetForceLimitX, METH_VARARGS}, - {"getForceLimitX", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitX, METH_VARARGS}, + {"getForceLimitX", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitX, METH_NOARGS}, {"setForceLimitY", (PyCFunction) KX_ObjectActuator::sPySetForceLimitY, METH_VARARGS}, - {"getForceLimitY", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitY, METH_VARARGS}, + {"getForceLimitY", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitY, METH_NOARGS}, {"setForceLimitZ", (PyCFunction) KX_ObjectActuator::sPySetForceLimitZ, METH_VARARGS}, - {"getForceLimitZ", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitZ, METH_VARARGS}, - {"setPID", (PyCFunction) KX_ObjectActuator::sPyGetPID, METH_VARARGS}, + {"getForceLimitZ", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitZ, METH_NOARGS}, + {"setPID", (PyCFunction) KX_ObjectActuator::sPyGetPID, METH_NOARGS}, {"getPID", (PyCFunction) KX_ObjectActuator::sPySetPID, METH_VARARGS}, @@ -340,9 +340,7 @@ PyObject* KX_ObjectActuator::_getattr(const STR_String& attr) { /* Removed! */ /* 2. getForce */ -PyObject* KX_ObjectActuator::PyGetForce(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_ObjectActuator::PyGetForce(PyObject* self) { PyObject *retVal = PyList_New(4); @@ -362,6 +360,7 @@ PyObject* KX_ObjectActuator::PySetForce(PyObject* self, int bToggle = 0; if (!PyArg_ParseTuple(args, "fffi", &vecArg[0], &vecArg[1], &vecArg[2], &bToggle)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_force.setValue(vecArg); @@ -371,9 +370,7 @@ PyObject* KX_ObjectActuator::PySetForce(PyObject* self, } /* 4. getTorque */ -PyObject* KX_ObjectActuator::PyGetTorque(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_ObjectActuator::PyGetTorque(PyObject* self) { PyObject *retVal = PyList_New(4); @@ -393,6 +390,7 @@ PyObject* KX_ObjectActuator::PySetTorque(PyObject* self, int bToggle = 0; if (!PyArg_ParseTuple(args, "fffi", &vecArg[0], &vecArg[1], &vecArg[2], &bToggle)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_torque.setValue(vecArg); @@ -402,9 +400,7 @@ PyObject* KX_ObjectActuator::PySetTorque(PyObject* self, } /* 6. getDLoc */ -PyObject* KX_ObjectActuator::PyGetDLoc(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_ObjectActuator::PyGetDLoc(PyObject* self) { PyObject *retVal = PyList_New(4); @@ -424,6 +420,7 @@ PyObject* KX_ObjectActuator::PySetDLoc(PyObject* self, int bToggle = 0; if(!PyArg_ParseTuple(args, "fffi", &vecArg[0], &vecArg[1], &vecArg[2], &bToggle)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_dloc.setValue(vecArg); @@ -433,9 +430,7 @@ PyObject* KX_ObjectActuator::PySetDLoc(PyObject* self, } /* 8. getDRot */ -PyObject* KX_ObjectActuator::PyGetDRot(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_ObjectActuator::PyGetDRot(PyObject* self) { PyObject *retVal = PyList_New(4); @@ -455,6 +450,7 @@ PyObject* KX_ObjectActuator::PySetDRot(PyObject* self, int bToggle = 0; if (!PyArg_ParseTuple(args, "fffi", &vecArg[0], &vecArg[1], &vecArg[2], &bToggle)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_drot.setValue(vecArg); @@ -464,9 +460,7 @@ PyObject* KX_ObjectActuator::PySetDRot(PyObject* self, } /* 10. getLinearVelocity */ -PyObject* KX_ObjectActuator::PyGetLinearVelocity(PyObject* self, - PyObject* args, - PyObject* kwds) { +PyObject* KX_ObjectActuator::PyGetLinearVelocity(PyObject* self) { PyObject *retVal = PyList_New(4); PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_linear_velocity[0])); @@ -485,6 +479,7 @@ PyObject* KX_ObjectActuator::PySetLinearVelocity(PyObject* self, int bToggle = 0; if (!PyArg_ParseTuple(args, "fffi", &vecArg[0], &vecArg[1], &vecArg[2], &bToggle)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_linear_velocity.setValue(vecArg); @@ -495,9 +490,7 @@ PyObject* KX_ObjectActuator::PySetLinearVelocity(PyObject* self, /* 12. getAngularVelocity */ -PyObject* KX_ObjectActuator::PyGetAngularVelocity(PyObject* self, - PyObject* args, - PyObject* kwds) { +PyObject* KX_ObjectActuator::PyGetAngularVelocity(PyObject* self) { PyObject *retVal = PyList_New(4); PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_angular_velocity[0])); @@ -515,6 +508,7 @@ PyObject* KX_ObjectActuator::PySetAngularVelocity(PyObject* self, int bToggle = 0; if (!PyArg_ParseTuple(args, "fffi", &vecArg[0], &vecArg[1], &vecArg[2], &bToggle)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_angular_velocity.setValue(vecArg); @@ -529,6 +523,7 @@ PyObject* KX_ObjectActuator::PySetDamping(PyObject* self, PyObject* kwds) { int damping = 0; if (!PyArg_ParseTuple(args, "i", &damping) || damping < 0 || damping > 1000) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_damping = damping; @@ -536,15 +531,11 @@ PyObject* KX_ObjectActuator::PySetDamping(PyObject* self, } /* 13. getVelocityDamping */ -PyObject* KX_ObjectActuator::PyGetDamping(PyObject* self, - PyObject* args, - PyObject* kwds) { +PyObject* KX_ObjectActuator::PyGetDamping(PyObject* self) { return Py_BuildValue("i",m_damping); } /* 6. getForceLimitX */ -PyObject* KX_ObjectActuator::PyGetForceLimitX(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_ObjectActuator::PyGetForceLimitX(PyObject* self) { PyObject *retVal = PyList_New(3); @@ -562,6 +553,7 @@ PyObject* KX_ObjectActuator::PySetForceLimitX(PyObject* self, float vecArg[2]; int bToggle = 0; if(!PyArg_ParseTuple(args, "ffi", &vecArg[0], &vecArg[1], &bToggle)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_drot[0] = vecArg[0]; @@ -571,9 +563,7 @@ PyObject* KX_ObjectActuator::PySetForceLimitX(PyObject* self, } /* 6. getForceLimitY */ -PyObject* KX_ObjectActuator::PyGetForceLimitY(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_ObjectActuator::PyGetForceLimitY(PyObject* self) { PyObject *retVal = PyList_New(3); @@ -591,6 +581,7 @@ PyObject* KX_ObjectActuator::PySetForceLimitY(PyObject* self, float vecArg[2]; int bToggle = 0; if(!PyArg_ParseTuple(args, "ffi", &vecArg[0], &vecArg[1], &bToggle)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_drot[1] = vecArg[0]; @@ -600,9 +591,7 @@ PyObject* KX_ObjectActuator::PySetForceLimitY(PyObject* self, } /* 6. getForceLimitZ */ -PyObject* KX_ObjectActuator::PyGetForceLimitZ(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_ObjectActuator::PyGetForceLimitZ(PyObject* self) { PyObject *retVal = PyList_New(3); @@ -620,6 +609,7 @@ PyObject* KX_ObjectActuator::PySetForceLimitZ(PyObject* self, float vecArg[2]; int bToggle = 0; if(!PyArg_ParseTuple(args, "ffi", &vecArg[0], &vecArg[1], &bToggle)) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_drot[2] = vecArg[0]; @@ -629,9 +619,7 @@ PyObject* KX_ObjectActuator::PySetForceLimitZ(PyObject* self, } /* 4. getPID */ -PyObject* KX_ObjectActuator::PyGetPID(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_ObjectActuator::PyGetPID(PyObject* self) { PyObject *retVal = PyList_New(3); @@ -648,6 +636,7 @@ PyObject* KX_ObjectActuator::PySetPID(PyObject* self, { float vecArg[3]; if (!PyArg_ParseTuple(args, "fff", &vecArg[0], &vecArg[1], &vecArg[2])) { + PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_torque.setValue(vecArg); diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.h b/source/gameengine/Ketsji/KX_ObjectActuator.h index bb74756551f..aa686f41233 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.h +++ b/source/gameengine/Ketsji/KX_ObjectActuator.h @@ -155,27 +155,27 @@ public: virtual PyObject* _getattr(const STR_String& attr); - KX_PYMETHOD(KX_ObjectActuator,GetForce); + KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForce); KX_PYMETHOD(KX_ObjectActuator,SetForce); - KX_PYMETHOD(KX_ObjectActuator,GetTorque); + KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetTorque); KX_PYMETHOD(KX_ObjectActuator,SetTorque); - KX_PYMETHOD(KX_ObjectActuator,GetDLoc); + KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetDLoc); KX_PYMETHOD(KX_ObjectActuator,SetDLoc); - KX_PYMETHOD(KX_ObjectActuator,GetDRot); + KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetDRot); KX_PYMETHOD(KX_ObjectActuator,SetDRot); - KX_PYMETHOD(KX_ObjectActuator,GetLinearVelocity); + KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetLinearVelocity); KX_PYMETHOD(KX_ObjectActuator,SetLinearVelocity); - KX_PYMETHOD(KX_ObjectActuator,GetAngularVelocity); + KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetAngularVelocity); KX_PYMETHOD(KX_ObjectActuator,SetAngularVelocity); KX_PYMETHOD(KX_ObjectActuator,SetDamping); - KX_PYMETHOD(KX_ObjectActuator,GetDamping); - KX_PYMETHOD(KX_ObjectActuator,GetForceLimitX); + KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetDamping); + KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForceLimitX); KX_PYMETHOD(KX_ObjectActuator,SetForceLimitX); - KX_PYMETHOD(KX_ObjectActuator,GetForceLimitY); + KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForceLimitY); KX_PYMETHOD(KX_ObjectActuator,SetForceLimitY); - KX_PYMETHOD(KX_ObjectActuator,GetForceLimitZ); + KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForceLimitZ); KX_PYMETHOD(KX_ObjectActuator,SetForceLimitZ); - KX_PYMETHOD(KX_ObjectActuator,GetPID); + KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetPID); KX_PYMETHOD(KX_ObjectActuator,SetPID); }; diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp index 93d6d5bb70d..144f74a1a4c 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp @@ -59,7 +59,8 @@ KX_PolygonMaterial::KX_PolygonMaterial(const STR_String &texname, int tilexrep, int tileyrep, int mode, - bool transparant, + int transp, + bool alpha, bool zsort, int lightlayer, bool bIsTriangle, @@ -74,7 +75,8 @@ KX_PolygonMaterial::KX_PolygonMaterial(const STR_String &texname, tilexrep, tileyrep, mode, - transparant, + transp, + alpha, zsort, lightlayer, bIsTriangle, @@ -245,7 +247,7 @@ PyObject* KX_PolygonMaterial::_getattr(const STR_String& attr) if (attr == "drawingmode") return PyInt_FromLong(m_drawingmode); if (attr == "transparent") - return PyInt_FromLong(m_transparant); + return PyInt_FromLong(m_alpha); if (attr == "zsort") return PyInt_FromLong(m_zsort); if (attr == "lightlayer") @@ -312,7 +314,7 @@ int KX_PolygonMaterial::_setattr(const STR_String &attr, PyObject *pyvalue) if (attr == "transparent") { - m_transparant = value; + m_alpha = value; return 0; } diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.h b/source/gameengine/Ketsji/KX_PolygonMaterial.h index 19015494e06..11c8baa8b1f 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.h +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.h @@ -64,7 +64,8 @@ public: int tilexrep, int tileyrep, int mode, - bool transparant, + int transp, + bool alpha, bool zsort, int lightlayer, bool bIsTriangle, diff --git a/source/gameengine/Ketsji/KX_PyMath.h b/source/gameengine/Ketsji/KX_PyMath.h index e1715c9275f..4e383e9b3d4 100644 --- a/source/gameengine/Ketsji/KX_PyMath.h +++ b/source/gameengine/Ketsji/KX_PyMath.h @@ -84,7 +84,10 @@ bool PyMatTo(PyObject* pymat, T& mat) } } else noerror = false; - + + if (noerror==false) + PyErr_SetString(PyExc_TypeError, "could not be converted to a matrix (sequence of sequences)"); + return noerror; } @@ -97,9 +100,13 @@ bool PyVecTo(PyObject* pyval, T& vec) if (PySequence_Check(pyval)) { unsigned int numitems = PySequence_Size(pyval); - if (numitems != Size(vec)) + if (numitems != Size(vec)) { + char err[128]; + sprintf(err, "error setting vector, %d args, should be %d", numitems, Size(vec)); + PyErr_SetString(PyExc_AttributeError, err); return false; - + } + for (unsigned int x = 0; x < numitems; x++) { PyObject *item = PySequence_GetItem(pyval, x); /* new ref */ @@ -107,7 +114,17 @@ bool PyVecTo(PyObject* pyval, T& vec) Py_DECREF(item); } + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_AttributeError, "one or more of the items in the sequence was not a float"); + return false; + } + return true; + } else + { + char err[128]; + sprintf(err, "not a sequence type, expected a sequence of numbers size %d", Size(vec)); + PyErr_SetString(PyExc_AttributeError, err); } return false; diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 61ed8b6a8e4..b66c3e42606 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -756,6 +756,15 @@ PyObject* initGameLogic(KX_Scene* scene) // quick hack to get gravity hook KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ROTX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ROTX); KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ROTY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ROTY); KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ROTZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ROTZ); + KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRPX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRPX); + KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRPY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRPY); + KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRPY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRPY); + KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRNX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRNX); + KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRNY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRNY); + KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRNY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRNY); + KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ORIX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ORIX); + KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ORIY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ORIY); + KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ORIZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ORIZ); /* 4. Ipo actuator, simple part */ KX_MACRO_addTypesToDict(d, KX_IPOACT_PLAY, KX_IpoActuator::KX_ACT_IPO_PLAY); diff --git a/source/gameengine/Ketsji/KX_RayEventManager.cpp b/source/gameengine/Ketsji/KX_RayEventManager.cpp index 4101c6b547e..1af29151adf 100644 --- a/source/gameengine/Ketsji/KX_RayEventManager.cpp +++ b/source/gameengine/Ketsji/KX_RayEventManager.cpp @@ -44,14 +44,9 @@ using namespace std; void KX_RayEventManager::NextFrame() { - for (vector::const_iterator i= m_sensors.begin();!(i==m_sensors.end());i++) + for (set::const_iterator i= m_sensors.begin();!(i==m_sensors.end());i++) { - SCA_ISensor *sensor = *i; - sensor->Activate(m_logicmgr, NULL); + (*i)->Activate(m_logicmgr, NULL); } } -void KX_RayEventManager::RegisterSensor(SCA_ISensor* sensor) -{ - m_sensors.push_back(sensor); -}; diff --git a/source/gameengine/Ketsji/KX_RayEventManager.h b/source/gameengine/Ketsji/KX_RayEventManager.h index 3630f9682b9..b816d4d5250 100644 --- a/source/gameengine/Ketsji/KX_RayEventManager.h +++ b/source/gameengine/Ketsji/KX_RayEventManager.h @@ -45,7 +45,6 @@ public: m_logicmgr(logicmgr) {} virtual void NextFrame(); - virtual void RegisterSensor(SCA_ISensor* sensor); }; #endif //__KX_RAYEVENTMGR diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index c374b9d6fd1..2828663c63d 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -37,6 +37,7 @@ #include "MT_assert.h" #include "KX_KetsjiEngine.h" +#include "KX_BlenderMaterial.h" #include "RAS_IPolygonMaterial.h" #include "ListValue.h" #include "SCA_LogicManager.h" @@ -92,6 +93,9 @@ void* KX_SceneReplicationFunc(SG_IObject* node,void* gameobj,void* scene) { KX_GameObject* replica = ((KX_Scene*)scene)->AddNodeReplicaObject(node,(KX_GameObject*)gameobj); + if(replica) + replica->Release(); + return (void*)replica; } @@ -116,13 +120,13 @@ KX_Scene::KX_Scene(class SCA_IInputDevice* keyboarddevice, PyObjectPlus(&KX_Scene::Type), m_keyboardmgr(NULL), m_mousemgr(NULL), + m_sceneConverter(NULL), m_physicsEnvironment(0), m_sceneName(sceneName), m_adi(adi), m_networkDeviceInterface(ndi), m_active_camera(NULL), - m_ueberExecutionPriority(0), - m_sceneConverter(NULL) + m_ueberExecutionPriority(0) { m_suspendedtime = 0.0; m_suspendeddelta = 0.0; @@ -650,14 +654,14 @@ void KX_Scene::DupliGroupRecurse(CValue* obj, int level) if (blgroupobj == blenderobj) // this check is also in group_duplilist() continue; - gameobj = m_sceneConverter->FindGameObject(blenderobj); + gameobj = (KX_GameObject*)m_logicmgr->FindGameObjByBlendObj(blenderobj); if (gameobj == NULL) { // this object has not been converted!!! // Should not happen as dupli group are created automatically continue; } - if (blenderobj->lay & group->layer==0) + if ((blenderobj->lay & group->layer)==0) { // object is not visible in the 3D view, will not be instantiated continue; @@ -669,8 +673,12 @@ void KX_Scene::DupliGroupRecurse(CValue* obj, int level) for (oit=m_groupGameObjects.begin(); oit != m_groupGameObjects.end(); oit++) { gameobj = (KX_GameObject*)(*oit); - if (gameobj->GetParent() != NULL) + + KX_GameObject *parent = gameobj->GetParent(); + if (parent != NULL) { + parent->Release(); // GetParent() increased the refcount + // this object is not a top parent. Either it is the child of another // object in the group and it will be added automatically when the parent // is added. Or it is the child of an object outside the group and the group @@ -860,6 +868,20 @@ SCA_IObject* KX_Scene::AddReplicaObject(class CValue* originalobject, replica->GetSGNode()->UpdateWorldData(0); replica->GetSGNode()->SetBBox(originalobj->GetSGNode()->BBox()); replica->GetSGNode()->SetRadius(originalobj->GetSGNode()->Radius()); + // check if there are objects with dupligroup in the hierarchy + vector duplilist; + for (git = m_logicHierarchicalGameObjects.begin();!(git==m_logicHierarchicalGameObjects.end());++git) + { + if ((*git)->IsDupliGroup()) + { + // separate list as m_logicHierarchicalGameObjects is also used by DupliGroupRecurse() + duplilist.push_back(*git); + } + } + for (git = duplilist.begin();!(git==duplilist.end());++git) + { + DupliGroupRecurse(*git, 0); + } // don't release replica here because we are returning it, not done with it... return replica; } @@ -906,6 +928,12 @@ int KX_Scene::NewRemoveObject(class CValue* gameobj) int ret; KX_GameObject* newobj = (KX_GameObject*) gameobj; + // keep the blender->game object association up to date + // note that all the replicas of an object will have the same + // blender object, that's why we need to check the game object + // as only the deletion of the original object must be recorded + m_logicmgr->UnregisterGameObj(newobj->GetBlenderObject(), gameobj); + //todo: look at this //GetPhysicsEnvironment()->RemovePhysicsController(gameobj->getPhysicsController()); @@ -964,6 +992,7 @@ int KX_Scene::NewRemoveObject(class CValue* gameobj) //m_active_camera->Release(); m_active_camera = NULL; } + // in case this is a camera m_cameras.remove((KX_Camera*)newobj); @@ -1220,14 +1249,10 @@ void KX_Scene::MarkSubTreeVisible(SG_Tree *node, RAS_IRasterizer* rasty, bool vi if (visible) { int nummeshes = gameobj->GetMeshCount(); - MT_Transform t( cam->GetWorldToCamera() * gameobj->GetSGNode()->GetWorldTransform()); - + // this adds the vertices to the display list for (int m=0;mGetMesh(m))->SchedulePolygons(t, rasty->GetDrawingMode()); - } + (gameobj->GetMesh(m))->SchedulePolygons(rasty->GetDrawingMode()); } gameobj->MarkVisible(visible); } @@ -1284,12 +1309,11 @@ void KX_Scene::MarkVisible(RAS_IRasterizer* rasty, KX_GameObject* gameobj,KX_Cam if (vis) { int nummeshes = gameobj->GetMeshCount(); - MT_Transform t(cam->GetWorldToCamera() * gameobj->GetSGNode()->GetWorldTransform()); for (int m=0;mGetMesh(m))->SchedulePolygons(t, rasty->GetDrawingMode()); + (gameobj->GetMesh(m))->SchedulePolygons(rasty->GetDrawingMode()); } // Visibility/ non-visibility are marked // elsewhere now. @@ -1402,7 +1426,7 @@ void KX_Scene::UpdateParents(double curtime) RAS_MaterialBucket* KX_Scene::FindBucket(class RAS_IPolyMaterial* polymat, bool &bucketCreated) { - return m_bucketmanager->RAS_BucketManagerFindBucket(polymat, bucketCreated); + return m_bucketmanager->FindBucket(polymat, bucketCreated); } @@ -1412,10 +1436,9 @@ void KX_Scene::RenderBuckets(const MT_Transform & cameratransform, class RAS_IRenderTools* rendertools) { m_bucketmanager->Renderbuckets(cameratransform,rasty,rendertools); + KX_BlenderMaterial::EndFrame(); } - - void KX_Scene::UpdateObjectActivity(void) { if (m_activity_culling) { diff --git a/source/gameengine/Ketsji/KX_TouchEventManager.cpp b/source/gameengine/Ketsji/KX_TouchEventManager.cpp index 423543eef5c..7528fdbbc34 100644 --- a/source/gameengine/Ketsji/KX_TouchEventManager.cpp +++ b/source/gameengine/Ketsji/KX_TouchEventManager.cpp @@ -100,16 +100,24 @@ bool KX_TouchEventManager::newBroadphaseResponse(void *client_data, void KX_TouchEventManager::RegisterSensor(SCA_ISensor* sensor) { KX_TouchSensor* touchsensor = static_cast(sensor); - m_sensors.push_back(touchsensor); + m_sensors.insert(touchsensor); touchsensor->RegisterSumo(this); } +void KX_TouchEventManager::RemoveSensor(SCA_ISensor* sensor) +{ + KX_TouchSensor* touchsensor = static_cast(sensor); + m_sensors.erase(touchsensor); + + touchsensor->UnregisterSumo(this); +} + void KX_TouchEventManager::EndFrame() { - vector::iterator it; + set::iterator it; for ( it = m_sensors.begin(); !(it==m_sensors.end());it++) { @@ -124,7 +132,7 @@ void KX_TouchEventManager::NextFrame() { if (m_sensors.size() > 0) { - vector::iterator it; + set::iterator it; for (it = m_sensors.begin();!(it==m_sensors.end());++it) static_cast(*it)->SynchronizeTransform(); @@ -157,20 +165,3 @@ void KX_TouchEventManager::NextFrame() (*it)->Activate(m_logicmgr,NULL); } } - - - -void KX_TouchEventManager::RemoveSensor(class SCA_ISensor* sensor) -{ - std::vector::iterator i = - std::find(m_sensors.begin(), m_sensors.end(), sensor); - if (!(i == m_sensors.end())) - { - std::swap(*i, m_sensors.back()); - m_sensors.pop_back(); - } - - // remove the sensor forever :) - SCA_EventManager::RemoveSensor(sensor); -} - diff --git a/source/gameengine/Ketsji/KX_TouchEventManager.h b/source/gameengine/Ketsji/KX_TouchEventManager.h index 20ed6126bd0..cc77bccfc31 100644 --- a/source/gameengine/Ketsji/KX_TouchEventManager.h +++ b/source/gameengine/Ketsji/KX_TouchEventManager.h @@ -71,8 +71,8 @@ public: PHY_IPhysicsEnvironment* physEnv); virtual void NextFrame(); virtual void EndFrame(); - virtual void RemoveSensor(class SCA_ISensor* sensor); virtual void RegisterSensor(SCA_ISensor* sensor); + virtual void RemoveSensor(SCA_ISensor* sensor); SCA_LogicManager* GetLogicManager() { return m_logicmgr;} PHY_IPhysicsEnvironment *GetPhysicsEnvironment() { return m_physEnv; } diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp index ce3aa1de2ef..60e1d87d318 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.cpp +++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp @@ -153,6 +153,14 @@ void KX_TouchSensor::RegisterSumo(KX_TouchEventManager *touchman) } } +void KX_TouchSensor::UnregisterSumo(KX_TouchEventManager* touchman) +{ + if (m_physCtrl) + { + touchman->GetPhysicsEnvironment()->removeCollisionCallback(m_physCtrl); + } +} + bool KX_TouchSensor::NewHandleCollision(void*object1,void*object2,const PHY_CollData* colldata) { // KX_TouchEventManager* toucheventmgr = (KX_TouchEventManager*)m_eventmgr; diff --git a/source/gameengine/Ketsji/KX_TouchSensor.h b/source/gameengine/Ketsji/KX_TouchSensor.h index 056440ccd6c..b611d296939 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.h +++ b/source/gameengine/Ketsji/KX_TouchSensor.h @@ -76,6 +76,7 @@ public: virtual void ReParent(SCA_IObject* parent); virtual void RegisterSumo(KX_TouchEventManager* touchman); + virtual void UnregisterSumo(KX_TouchEventManager* touchman); // virtual DT_Bool HandleCollision(void* obj1,void* obj2, // const DT_CollData * coll_data); diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.cpp b/source/gameengine/Ketsji/KX_TrackToActuator.cpp index c580aa4d4e5..f5b463abf02 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.cpp +++ b/source/gameengine/Ketsji/KX_TrackToActuator.cpp @@ -146,19 +146,19 @@ void compatible_eulFast(float *eul, float *oldrot) { float dx, dy, dz; - /* verschillen van ong 360 graden corrigeren */ + /* angular difference of 360 degrees */ dx= eul[0] - oldrot[0]; dy= eul[1] - oldrot[1]; dz= eul[2] - oldrot[2]; - if( fabs(dx) > 5.1) { + if( fabs(dx) > MT_PI) { if(dx > 0.0) eul[0] -= MT_2_PI; else eul[0]+= MT_2_PI; } - if( fabs(dy) > 5.1) { + if( fabs(dy) > MT_PI) { if(dy > 0.0) eul[1] -= MT_2_PI; else eul[1]+= MT_2_PI; } - if( fabs(dz) > 5.1 ) { + if( fabs(dz) > MT_PI ) { if(dz > 0.0) eul[2] -= MT_2_PI; else eul[2]+= MT_2_PI; } } @@ -195,6 +195,8 @@ void KX_TrackToActuator::ProcessReplica() // the replica is tracking the same object => register it if (m_object) m_object->RegisterActuator(this); + if (m_parentobj) + m_parentobj->AddRef(); SCA_IActuator::ProcessReplica(); } @@ -219,6 +221,14 @@ void KX_TrackToActuator::Relink(GEN_Map *obj_map) m_object = (SCA_IObject*)(*h_obj); m_object->RegisterActuator(this); } + + void **h_parobj = (*obj_map)[m_parentobj]; + if (h_parobj) { + if (m_parentobj) + m_parentobj->Release(); + m_parentobj= (KX_GameObject*)(*h_parobj); + m_parentobj->AddRef(); + } } diff --git a/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h b/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h index ec1b7702ffd..7c61902f8e2 100644 --- a/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h +++ b/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h @@ -65,6 +65,7 @@ public: { } virtual void requestCollisionCallback(PHY_IPhysicsController* ctrl) {} + virtual void removeCollisionCallback(PHY_IPhysicsController* ctrl) {} virtual PHY_IPhysicsController* CreateSphereController(float radius,const PHY__Vector3& position) {return 0;} virtual PHY_IPhysicsController* CreateConeController(float coneradius,float coneheight) { return 0;} diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index b773f40650b..ea14c5430e2 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -368,7 +368,7 @@ void CcdPhysicsEnvironment::addCcdPhysicsController(CcdPhysicsController* ctrl) body->setUserPointer(ctrl); body->setGravity( m_gravity ); - m_controllers.push_back(ctrl); + m_controllers.insert(ctrl); //use explicit group/filter for finer control over collision in bullet => near/radar sensor m_dynamicsWorld->addRigidBody(body, ctrl->GetCollisionFilterGroup(), ctrl->GetCollisionFilterMask()); @@ -434,36 +434,13 @@ void CcdPhysicsEnvironment::addCcdPhysicsController(CcdPhysicsController* ctrl) void CcdPhysicsEnvironment::removeCcdPhysicsController(CcdPhysicsController* ctrl) { - //also remove constraint - - m_dynamicsWorld->removeRigidBody(ctrl->GetRigidBody()); - - - { - std::vector::iterator i = - std::find(m_controllers.begin(), m_controllers.end(), ctrl); - if (!(i == m_controllers.end())) - { - std::swap(*i, m_controllers.back()); - m_controllers.pop_back(); - } - } + m_controllers.erase(ctrl); //remove it from the triggers - { - std::vector::iterator i = - std::find(m_triggerControllers.begin(), m_triggerControllers.end(), ctrl); - if (!(i == m_triggerControllers.end())) - { - std::swap(*i, m_triggerControllers.back()); - m_triggerControllers.pop_back(); - } - } - - + m_triggerControllers.erase(ctrl); } void CcdPhysicsEnvironment::updateCcdPhysicsController(CcdPhysicsController* ctrl, btScalar newMass, int newCollisionFlags, short int newCollisionGroup, short int newCollisionMask) @@ -487,11 +464,10 @@ void CcdPhysicsEnvironment::updateCcdPhysicsController(CcdPhysicsController* ctr void CcdPhysicsEnvironment::enableCcdPhysicsController(CcdPhysicsController* ctrl) { - std::vector::iterator i = - std::find(m_controllers.begin(), m_controllers.end(), ctrl); - if (i == m_controllers.end()) + if (m_controllers.insert(ctrl).second) { btRigidBody* body = ctrl->GetRigidBody(); + body->setUserPointer(ctrl); m_dynamicsWorld->addCollisionObject(body, ctrl->GetCollisionFilterGroup(), ctrl->GetCollisionFilterMask()); } @@ -507,12 +483,12 @@ void CcdPhysicsEnvironment::beginFrame() bool CcdPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep) { + std::set::iterator it; + int i; - int i,numCtrl = GetNumControllers(); - for (i=0;iSynchronizeMotionStates(timeStep); + (*it)->SynchronizeMotionStates(timeStep); } float subStep = timeStep / float(m_numTimeSubSteps); @@ -521,11 +497,9 @@ bool CcdPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep) m_dynamicsWorld->stepSimulation(subStep,0);//perform always a full simulation step } - numCtrl = GetNumControllers(); - for (i=0;iSynchronizeMotionStates(timeStep); + (*it)->SynchronizeMotionStates(timeStep); } for (i=0;i::iterator i = - std::find(m_controllers.begin(), m_controllers.end(), ctrl); - if ((i == m_controllers.end())) - { - addCcdPhysicsController(ctrl1); - } + // addSensor() is a "light" function for bullet because it is used + // dynamically when the sensor is activated. Use enableCcdPhysicsController() instead + //if (m_controllers.insert(ctrl1).second) + //{ + // addCcdPhysicsController(ctrl1); + //} + enableCcdPhysicsController(ctrl1); + //Collision filter/mask is now set at the time of the creation of the controller //force collision detection with everything, including static objects (might hurt performance!) //ctrl1->GetRigidBody()->getBroadphaseHandle()->m_collisionFilterMask = btBroadphaseProxy::AllFilter ^ btBroadphaseProxy::SensorTrigger; @@ -923,21 +885,15 @@ void CcdPhysicsEnvironment::addSensor(PHY_IPhysicsController* ctrl) void CcdPhysicsEnvironment::removeCollisionCallback(PHY_IPhysicsController* ctrl) { - std::vector::iterator i = - std::find(m_triggerControllers.begin(), m_triggerControllers.end(), ctrl); - if (!(i == m_triggerControllers.end())) - { - std::swap(*i, m_triggerControllers.back()); - m_triggerControllers.pop_back(); - } + m_triggerControllers.erase((CcdPhysicsController*)ctrl); } void CcdPhysicsEnvironment::removeSensor(PHY_IPhysicsController* ctrl) { - removeCollisionCallback(ctrl); - //printf("removeSensor\n"); + removeCcdPhysicsController((CcdPhysicsController*)ctrl); } + void CcdPhysicsEnvironment::addTouchCallback(int response_class, PHY_ResponseCallback callback, void *user) { /* printf("addTouchCallback\n(response class = %i)\n",response_class); @@ -975,10 +931,9 @@ void CcdPhysicsEnvironment::requestCollisionCallback(PHY_IPhysicsController* ctr CcdPhysicsController* ccdCtrl = static_cast(ctrl); //printf("requestCollisionCallback\n"); - m_triggerControllers.push_back(ccdCtrl); + m_triggerControllers.insert(ccdCtrl); } - void CcdPhysicsEnvironment::CallbackTriggers() { @@ -1011,11 +966,10 @@ void CcdPhysicsEnvironment::CallbackTriggers() CcdPhysicsController* ctrl0 = static_cast(obj0->getUserPointer()); CcdPhysicsController* ctrl1 = static_cast(obj1->getUserPointer()); - std::vector::iterator i = - std::find(m_triggerControllers.begin(), m_triggerControllers.end(), ctrl0); + std::set::const_iterator i = m_triggerControllers.find(ctrl0); if (i == m_triggerControllers.end()) { - i = std::find(m_triggerControllers.begin(), m_triggerControllers.end(), ctrl1); + i = m_triggerControllers.find(ctrl1); } if (!(i == m_triggerControllers.end())) @@ -1125,7 +1079,6 @@ PHY_IPhysicsController* CcdPhysicsEnvironment::CreateSphereController(float radi CcdPhysicsController* sphereController = new CcdPhysicsController(cinfo); - return sphereController; } diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h index 453749b27b3..fd96522037e 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h @@ -18,6 +18,7 @@ subject to the following restrictions: #include "PHY_IPhysicsEnvironment.h" #include +#include class CcdPhysicsController; #include "LinearMath/btVector3.h" #include "LinearMath/btTransform.h" @@ -209,12 +210,6 @@ protected: } - int GetNumControllers(); - - CcdPhysicsController* GetPhysicsController( int index); - - - const btPersistentManifold* GetManifold(int index) const; @@ -229,9 +224,9 @@ protected: - std::vector m_controllers; + std::set m_controllers; - std::vector m_triggerControllers; + std::set m_triggerControllers; PHY_ResponseCallback m_triggerCallbacks[PHY_NUM_RESPONSE]; void* m_triggerCallbacksUserPtrs[PHY_NUM_RESPONSE]; diff --git a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h index f0761618e4e..b5a61f72e4a 100644 --- a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h +++ b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h @@ -80,6 +80,7 @@ public: { } virtual void requestCollisionCallback(PHY_IPhysicsController* ctrl) {} + virtual void removeCollisionCallback(PHY_IPhysicsController* ctrl) {} virtual PHY_IPhysicsController* CreateSphereController(float radius,const PHY__Vector3& position) {return 0;} virtual PHY_IPhysicsController* CreateConeController(float coneradius,float coneheight) { return 0;} diff --git a/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp b/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp index b5bf67b14ea..f0791bbf89f 100644 --- a/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp +++ b/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp @@ -98,12 +98,17 @@ void SM_Scene::addTouchCallback(int response_class, DT_ResponseCallback callback void SM_Scene::addSensor(SM_Object& object) { - object.calcXform(); - m_objectList.push_back(&object); - DT_AddObject(m_scene, object.getObjectHandle()); - DT_SetResponseClass(m_respTable, object.getObjectHandle(), m_ResponseClass[SENSOR_RESPONSE]); - DT_SetResponseClass(m_secondaryRespTable, object.getObjectHandle(), m_secondaryResponseClass[SENSOR_RESPONSE]); - DT_SetResponseClass(m_fixRespTable, object.getObjectHandle(), m_fixResponseClass[SENSOR_RESPONSE]); + T_ObjectList::iterator i = + std::find(m_objectList.begin(), m_objectList.end(), &object); + if (i == m_objectList.end()) + { + object.calcXform(); + m_objectList.push_back(&object); + DT_AddObject(m_scene, object.getObjectHandle()); + DT_SetResponseClass(m_respTable, object.getObjectHandle(), m_ResponseClass[SENSOR_RESPONSE]); + DT_SetResponseClass(m_secondaryRespTable, object.getObjectHandle(), m_secondaryResponseClass [SENSOR_RESPONSE]); + DT_SetResponseClass(m_fixRespTable, object.getObjectHandle(), m_fixResponseClass[SENSOR_RESPONSE]); + } } void SM_Scene::add(SM_Object& object) { diff --git a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp b/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp index 16ba45a0be5..65018d2523e 100644 --- a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp @@ -228,6 +228,12 @@ void SumoPhysicsEnvironment::requestCollisionCallback(PHY_IPhysicsController* ct m_sumoScene->requestCollisionCallback(*smObject); } } + +void SumoPhysicsEnvironment::removeCollisionCallback(PHY_IPhysicsController* ctrl) +{ + // intentionally empty +} + PHY_IPhysicsController* SumoPhysicsEnvironment::CreateSphereController(float radius,const PHY__Vector3& position) { DT_ShapeHandle shape = DT_NewSphere(0.0); diff --git a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h b/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h index ce5cd70e8cc..8b9fb463034 100644 --- a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h +++ b/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h @@ -84,6 +84,7 @@ public: virtual void removeSensor(PHY_IPhysicsController* ctrl); virtual void addTouchCallback(int response_class, PHY_ResponseCallback callback, void *user); virtual void requestCollisionCallback(PHY_IPhysicsController* ctrl); + virtual void removeCollisionCallback(PHY_IPhysicsController* ctrl); virtual PHY_IPhysicsController* CreateSphereController(float radius,const PHY__Vector3& position); virtual PHY_IPhysicsController* CreateConeController(float coneradius,float coneheight); diff --git a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h index c148210903f..5b275066665 100644 --- a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h +++ b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h @@ -104,6 +104,7 @@ class PHY_IPhysicsEnvironment virtual void removeSensor(PHY_IPhysicsController* ctrl)=0; virtual void addTouchCallback(int response_class, PHY_ResponseCallback callback, void *user)=0; virtual void requestCollisionCallback(PHY_IPhysicsController* ctrl)=0; + virtual void removeCollisionCallback(PHY_IPhysicsController* ctrl)=0; //These two methods are *solely* used to create controllers for sensor! Don't use for anything else virtual PHY_IPhysicsController* CreateSphereController(float radius,const PHY__Vector3& position) =0; virtual PHY_IPhysicsController* CreateConeController(float coneradius,float coneheight)=0; diff --git a/source/gameengine/PyDoc/BL_ShapeActionActuator.py b/source/gameengine/PyDoc/BL_ShapeActionActuator.py new file mode 100644 index 00000000000..63cce253fa4 --- /dev/null +++ b/source/gameengine/PyDoc/BL_ShapeActionActuator.py @@ -0,0 +1,158 @@ +# $Id$ +# Documentation for BL_ShapeActionActuator +from SCA_IActuator import * + +class BL_ShapeActionActuator(SCA_IActuator): + """ + ShapeAction Actuators apply an shape action to an mesh object. + """ + def setAction(action, reset = True): + """ + Sets the current action. + + @param action: The name of the action to set as the current action. + @type action: string + @param reset: Optional parameter indicating whether to reset the + blend timer or not. A value of 1 indicates that the + timer should be reset. A value of 0 will leave it + unchanged. If reset is not specified, the timer will + be reset. + """ + + def setStart(start): + """ + Specifies the starting frame of the animation. + + @param start: the starting frame of the animation + @type start: float + """ + + def setEnd(end): + """ + Specifies the ending frame of the animation. + + @param end: the ending frame of the animation + @type end: float + """ + def setBlendin(blendin): + """ + Specifies the number of frames of animation to generate + when making transitions between actions. + + @param blendin: the number of frames in transition. + @type blendin: float + """ + + def setPriority(priority): + """ + Sets the priority of this actuator. + + @param priority: Specifies the new priority. Actuators will lower + priority numbers will override actuators with higher + numbers. + @type priority: integer + """ + def setFrame(frame): + """ + Sets the current frame for the animation. + + @param frame: Specifies the new current frame for the animation + @type frame: float + """ + + def setProperty(prop): + """ + Sets the property to be used in FromProp playback mode. + + @param prop: the name of the property to use. + @type prop: string. + """ + + def setBlendtime(blendtime): + """ + Sets the internal frame timer. + + Allows the script to directly modify the internal timer + used when generating transitions between actions. + + @param blendtime: The new time. This parameter must be in the range from 0.0 to 1.0. + @type blendtime: float + """ + + def setType(mode): + """ + Sets the operation mode of the actuator + + @param mode: KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND + @type mode: integer + """ + + def setContinue(cont): + """ + Set the actions continue option True or False. see getContinue. + + @param cont: The continue option. + @type cont: bool + """ + + def getType(): + """ + Returns the operation mode of the actuator + + @rtype: integer + @return: KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND + """ + + def getContinue(): + """ + When True, the action will always play from where last left off, otherwise negative events to this actuator will reset it to its start frame. + + @rtype: bool + """ + + def getAction(): + """ + getAction() returns the name of the action associated with this actuator. + + @rtype: string + """ + + def getStart(): + """ + Returns the starting frame of the action. + + @rtype: float + """ + def getEnd(): + """ + Returns the last frame of the action. + + @rtype: float + """ + def getBlendin(): + """ + Returns the number of interpolation animation frames to be generated when this actuator is triggered. + + @rtype: float + """ + def getPriority(): + """ + Returns the priority for this actuator. Actuators with lower Priority numbers will + override actuators with higher numbers. + + @rtype: integer + """ + def getFrame(): + """ + Returns the current frame number. + + @rtype: float + """ + def getProperty(): + """ + Returns the name of the property to be used in FromProp mode. + + @rtype: string + """ + + diff --git a/source/gameengine/PyDoc/KX_ActuatorSensor.py b/source/gameengine/PyDoc/KX_ActuatorSensor.py new file mode 100644 index 00000000000..f9aef86f7f0 --- /dev/null +++ b/source/gameengine/PyDoc/KX_ActuatorSensor.py @@ -0,0 +1,24 @@ +# $Id$ +# Documentation for KX_ActuatorSensor +from SCA_IActuator import * + +class KX_ActuatorSensor(SCA_ISensor): + """ + Actuator sensor detect change in actuator state of the parent object. + It generates a positive pulse if the corresponding actuator is activated + and a negative pulse if the actuator is deactivated. + """ + def getActuator(): + """ + Return the Actuator with which the sensor operates. + + @rtype: string + """ + def setActuator(name): + """ + Sets the Actuator with which to operate. If there is no Actuator + of this name, the function has no effect. + + @param name: actuator name + @type name: string + """ diff --git a/source/gameengine/PyDoc/KX_ConstraintActuator.py b/source/gameengine/PyDoc/KX_ConstraintActuator.py index 9630690e572..b1c6f3c0f4e 100644 --- a/source/gameengine/PyDoc/KX_ConstraintActuator.py +++ b/source/gameengine/PyDoc/KX_ConstraintActuator.py @@ -4,7 +4,7 @@ from SCA_IActuator import * class KX_ConstraintActuator(SCA_IActuator): """ - A constraint actuator limits the position or orientation of an object. + A constraint actuator limits the position, rotation, distance or orientation of an object. """ def setDamp(time): """ @@ -24,7 +24,7 @@ class KX_ConstraintActuator(SCA_IActuator): """ Sets the lower bound of the constraint. - For rotational constraints, lower is specified in degrees. + For rotational and orientation constraints, lower is specified in degrees. @type lower: float """ @@ -32,7 +32,7 @@ class KX_ConstraintActuator(SCA_IActuator): """ Gets the lower bound of the constraint. - For rotational constraints, the lower bound is returned in radians. + For rotational and orientation constraints, the lower bound is returned in radians. @rtype: float """ @@ -40,7 +40,7 @@ class KX_ConstraintActuator(SCA_IActuator): """ Sets the upper bound of the constraint. - For rotational constraints, upper is specified in degrees. + For rotational and orientation constraints, upper is specified in degrees. @type upper: float """ @@ -48,7 +48,7 @@ class KX_ConstraintActuator(SCA_IActuator): """ Gets the upper bound of the constraint. - For rotational constraints, the upper bound is returned in radians. + For rotational and orientation constraints, the upper bound is returned in radians. @rtype: float """ @@ -60,6 +60,9 @@ class KX_ConstraintActuator(SCA_IActuator): @param limit: Position constraints: KX_CONSTRAINTACT_LOCX, KX_CONSTRAINTACT_LOCY, KX_CONSTRAINTACT_LOCZ, Rotation constraints: KX_CONSTRAINTACT_ROTX, KX_CONSTRAINTACT_ROTY or KX_CONSTRAINTACT_ROTZ + Distance contraints: KX_ACT_CONSTRAINT_DIRPX, KX_ACT_CONSTRAINT_DIRPY, KX_ACT_CONSTRAINT_DIRPZ, + KX_ACT_CONSTRAINT_DIRNX, KX_ACT_CONSTRAINT_DIRNY, KX_ACT_CONSTRAINT_DIRNZ, + Orientation constraints: KX_ACT_CONSTRAINT_ORIX, KX_ACT_CONSTRAINT_ORIY, KX_ACT_CONSTRAINT_ORIZ """ def getLimit(): """ @@ -68,5 +71,110 @@ class KX_ConstraintActuator(SCA_IActuator): See module L{GameLogic} for valid constraints. @return: Position constraints: KX_CONSTRAINTACT_LOCX, KX_CONSTRAINTACT_LOCY, KX_CONSTRAINTACT_LOCZ, - Rotation constraints: KX_CONSTRAINTACT_ROTX, KX_CONSTRAINTACT_ROTY or KX_CONSTRAINTACT_ROTZ + Rotation constraints: KX_CONSTRAINTACT_ROTX, KX_CONSTRAINTACT_ROTY, KX_CONSTRAINTACT_ROTZ, + Distance contraints: KX_ACT_CONSTRAINT_DIRPX, KX_ACT_CONSTRAINT_DIRPY, KX_ACT_CONSTRAINT_DIRPZ, + KX_ACT_CONSTRAINT_DIRNX, KX_ACT_CONSTRAINT_DIRNY, KX_ACT_CONSTRAINT_DIRNZ, + Orientation constraints: KX_ACT_CONSTRAINT_ORIX, KX_ACT_CONSTRAINT_ORIY, KX_ACT_CONSTRAINT_ORIZ """ + def setRotDamp(duration): + """ + Sets the time constant of the orientation constraint. + + @param duration: If the duration is negative, it is set to 0. + @type duration: integer + """ + def getRotDamp(): + """ + Returns the damping time for application of the constraint. + + @rtype: integer + """ + def setDirection(vector): + """ + Sets the reference direction in world coordinate for the orientation constraint + + @type vector: 3-tuple + """ + def getDirection(): + """ + Returns the reference direction of the orientation constraint in world coordinate. + + @rtype: 3-tuple + """ + def setOption(option): + """ + Sets several options of the distance constraint. + + @type option: integer + @param option: Binary combination of the following values: + 64 : Activate alignment to surface + 128 : Detect material rather than property + 256 : No deactivation if ray does not hit target + 512 : Activate distance control + """ + def getOption(): + """ + Returns the option parameter. + + @rtype: integer + """ + def setTime(duration): + """ + Sets the activation time of the actuator. + + @type duration: integer + @param duration: The actuator disables itself after this many frame. + If set to 0 or negative, the actuator is not limited in time. + """ + def getTime(): + """ + Returns the time parameter. + + @rtype: integer + """ + def setProperty(property): + """ + Sets the name of the property or material for the ray detection of the distance constraint. + + @type property: string + @param property: If empty, the ray will detect any collisioning object. + """ + def getProperty(): + """ + Returns the property parameter. + + @rtype: string + """ + def setDistance(distance): + """ + Sets the target distance in distance constraint. + + @type distance: float + """ + def getDistance(): + """ + Returns the distance parameter. + + @rtype: float + """ + def setRayLength(length): + """ + Sets the maximum ray length of the distance constraint. + + @type length: float + """ + def getRayLength(): + """ + Returns the length of the ray + + @rtype: float + """ + + + + + + + + + diff --git a/source/gameengine/PyDoc/KX_IpoActuator.py b/source/gameengine/PyDoc/KX_IpoActuator.py index da8d05ddd5e..1cdab829385 100644 --- a/source/gameengine/PyDoc/KX_IpoActuator.py +++ b/source/gameengine/PyDoc/KX_IpoActuator.py @@ -6,7 +6,7 @@ class KX_IpoActuator(SCA_IActuator): """ IPO actuator activates an animation. """ - def set(mode, startframe, endframe, force): + def set(mode, startframe, endframe, mode): """ Sets the properties of the actuator. @@ -16,8 +16,8 @@ class KX_IpoActuator(SCA_IActuator): @type startframe: integer @param endframe: last frame to use @type endframe: integer - @param force: interpret this ipo as a force - @type force: boolean (KX_TRUE, KX_FALSE) + @param mode: special mode + @type mode: integer (0=normal, 1=interpret location as force, 2=additive) """ def setProperty(property): """ @@ -60,6 +60,19 @@ class KX_IpoActuator(SCA_IActuator): """ Returns whether to interpret the ipo as a force rather than a displacement. + @rtype: boolean + """ + def setIpoAdd(add): + """ + Set whether to interpret the ipo as additive rather than absolute. + + @type add: boolean + @param add: KX_TRUE or KX_FALSE + """ + def getIpoAdd(): + """ + Returns whether to interpret the ipo as additive rather than absolute. + @rtype: boolean """ def setType(mode): diff --git a/source/gameengine/PyDoc/KX_ObjectActuator.py b/source/gameengine/PyDoc/KX_ObjectActuator.py index 532c18eea5c..db577d21e6f 100644 --- a/source/gameengine/PyDoc/KX_ObjectActuator.py +++ b/source/gameengine/PyDoc/KX_ObjectActuator.py @@ -6,6 +6,7 @@ class KX_ObjectActuator(SCA_IActuator): """ The object actuator ("Motion Actuator") applies force, torque, displacement, angular displacement, velocity, or angular velocity to an object. + Servo control allows to regulate force to achieve a certain speed target. """ def getForce(): """ @@ -107,15 +108,17 @@ class KX_ObjectActuator(SCA_IActuator): def getLinearVelocity(): """ Returns the linear velocity applied by the actuator. + For the servo control actuator, this is the target speed. @rtype: list [vx, vy, vz, local] @return: A four item list, containing the vector velocity, and whether the velocity is applied in local coordinates (True) or world - coordinates (False) + coordinates (False) """ def setLinearVelocity(vx, vy, vz, local): """ Sets the linear velocity applied by the actuator. + For the servo control actuator, sets the target speed. @type vx: float @param vx: the x component of the velocity vector. @@ -124,8 +127,8 @@ class KX_ObjectActuator(SCA_IActuator): @type vz: float @param vz: the z component of the velocity vector. @type local: boolean - @param local: - False: the velocity vector is applied in world coordinates. - - True: the velocity vector is applied in local coordinates. + @param local: - False: the velocity vector is in world coordinates. + - True: the velocity vector is in local coordinates. """ def getAngularVelocity(): """ @@ -150,5 +153,100 @@ class KX_ObjectActuator(SCA_IActuator): @param local: - False: the velocity vector is applied in world coordinates. - True: the velocity vector is applied in local coordinates. """ + def getDamping(): + """ + Returns the damping parameter of the servo controller. + + @rtype: integer + @return: the time constant of the servo controller in frame unit. + """ + def setDamping(damp): + """ + Sets the damping parameter of the servo controller. + + @type damp: integer + @param damp: the damping parameter in frame unit. + """ + def getForceLimitX(): + """ + Returns the min/max force limit along the X axis used by the servo controller. + + @rtype: list [min, max, enabled] + @return: A three item list, containing the min and max limits of the force as float + and whether the limits are active(true) or inactive(true) + """ + def setForceLimitX(min, max, enable): + """ + Sets the min/max force limit along the X axis and activates or deactivates the limits in the servo controller. + + @type min: float + @param min: the minimum value of the force along the X axis. + @type max: float + @param max: the maximum value of the force along the X axis. + @type enable: boolean + @param enable: - True: the force will be limited to the min/max + - False: the force will not be limited + """ + def getForceLimitY(): + """ + Returns the min/max force limit along the Y axis used by the servo controller. + + @rtype: list [min, max, enabled] + @return: A three item list, containing the min and max limits of the force as float + and whether the limits are active(true) or inactive(true) + """ + def setForceLimitY(min, max, enable): + """ + Sets the min/max force limit along the Y axis and activates or deactivates the limits in the servo controller. + + @type min: float + @param min: the minimum value of the force along the Y axis. + @type max: float + @param max: the maximum value of the force along the Y axis. + @type enable: boolean + @param enable: - True: the force will be limited to the min/max + - False: the force will not be limited + """ + def getForceLimitZ(): + """ + Returns the min/max force limit along the Z axis used by the servo controller. + + @rtype: list [min, max, enabled] + @return: A three item list, containing the min and max limits of the force as float + and whether the limits are active(true) or inactive(true) + """ + def setForceLimitZ(min, max, enable): + """ + Sets the min/max force limit along the Z axis and activates or deactivates the limits in the servo controller. + + @type min: float + @param min: the minimum value of the force along the Z axis. + @type max: float + @param max: the maximum value of the force along the Z axis. + @type enable: boolean + @param enable: - True: the force will be limited to the min/max + - False: the force will not be limited + """ + def getPID(): + """ + Returns the PID coefficient of the servo controller. + + @rtype: list [P, I, D] + @return: A three item list, containing the PID coefficient as floats: + P : proportional coefficient + I : Integral coefficient + D : Derivate coefficient + """ + def setPID(P, I, D): + """ + Sets the PID coefficients of the servo controller. + + @type P: flat + @param P: proportional coefficient + @type I: float + @param I: Integral coefficient + @type D: float + @param D: Derivate coefficient + """ diff --git a/source/gameengine/PyDoc/KX_StateActuator.py b/source/gameengine/PyDoc/KX_StateActuator.py new file mode 100644 index 00000000000..fb6ae5a3621 --- /dev/null +++ b/source/gameengine/PyDoc/KX_StateActuator.py @@ -0,0 +1,26 @@ +# $Id$ +# Documentation for KX_StateActuator +from SCA_IActuator import * + +class KX_StateActuator(SCA_IActuator): + """ + State actuator changes the state mask of parent object. + """ + def setOperation(op): + """ + Set the type of bit operation to be applied on object state mask. + Use setMask() to specify the bits that will be modified. + + @param op: bit operation (0=Copy, 1=Add, 2=Substract, 3=Invert) + @type op: integer + """ + def setMask(mask): + """ + Set the value that defines the bits that will be modified by the operation. + The bits that are 1 in the value will be updated in the object state, + the bits that are 0 are will be left unmodified expect for the Copy operation + which copies the value to the object state. + + @param mask: bits that will be modified + @type mask: integer + """ diff --git a/source/gameengine/PyDoc/SCA_ISensor.py b/source/gameengine/PyDoc/SCA_ISensor.py index b96d8c8c075..0ebc2debb31 100644 --- a/source/gameengine/PyDoc/SCA_ISensor.py +++ b/source/gameengine/PyDoc/SCA_ISensor.py @@ -59,4 +59,22 @@ class SCA_ISensor(SCA_ILogicBrick): @type invert: boolean @param invert: true if activates on negative events; false if activates on positive events. """ + def getLevel(): + """ + Returns whether this sensor is a level detector or a edge detector. + It makes a difference only in case of logic state transition (state actuator). + A level detector will immediately generate a pulse, negative or positive + depending on the sensor condition, as soon as the state is activated. + A edge detector will wait for a state change before generating a pulse. + + @rtype: boolean + @return: true if sensor is level sensitive, false if it is edge sensitive + """ + def setLevel(level): + """ + Set whether to detect level or edge transition when entering a state. + + @param level: Detect level instead of edge? (KX_TRUE, KX_FALSE) + @type level: boolean + """ diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.cpp b/source/gameengine/Rasterizer/RAS_BucketManager.cpp index b4492ca03a9..82bdce44519 100644 --- a/source/gameengine/Rasterizer/RAS_BucketManager.cpp +++ b/source/gameengine/Rasterizer/RAS_BucketManager.cpp @@ -94,7 +94,6 @@ void RAS_BucketManager::RenderAlphaBuckets( const MT_Scalar cam_origin = cameratrans.getOrigin()[2]; for (bit = m_AlphaBuckets.begin(); bit != m_AlphaBuckets.end(); ++bit) { - (*bit)->ClearScheduledPolygons(); for (mit = (*bit)->msBegin(); mit != (*bit)->msEnd(); ++mit) { if ((*mit).m_bVisible) @@ -133,28 +132,15 @@ void RAS_BucketManager::Renderbuckets( rasty->ClearCachingInfo(); RAS_MaterialBucket::StartFrame(); - for (bucket = m_MaterialBuckets.begin(); bucket != m_MaterialBuckets.end(); ++bucket) - { - (*bucket)->ClearScheduledPolygons(); - } for (bucket = m_MaterialBuckets.begin(); bucket != m_MaterialBuckets.end(); ++bucket) - { - RAS_IPolyMaterial *tmp = (*bucket)->GetPolyMaterial(); - if(tmp->IsZSort() || tmp->GetFlag() &RAS_FORCEALPHA ) - rasty->SetAlphaTest(true); - else - rasty->SetAlphaTest(false); - (*bucket)->Render(cameratrans,rasty,rendertools); - } - rasty->SetAlphaTest(false); RenderAlphaBuckets(cameratrans, rasty, rendertools); RAS_MaterialBucket::EndFrame(); } -RAS_MaterialBucket* RAS_BucketManager::RAS_BucketManagerFindBucket(RAS_IPolyMaterial * material, bool &bucketCreated) +RAS_MaterialBucket* RAS_BucketManager::FindBucket(RAS_IPolyMaterial * material, bool &bucketCreated) { bucketCreated = false; BucketList::iterator it; @@ -172,7 +158,7 @@ RAS_MaterialBucket* RAS_BucketManager::RAS_BucketManagerFindBucket(RAS_IPolyMate RAS_MaterialBucket *bucket = new RAS_MaterialBucket(material); bucketCreated = true; - if (bucket->IsTransparant()) + if (bucket->IsAlpha()) m_AlphaBuckets.push_back(bucket); else m_MaterialBuckets.push_back(bucket); @@ -195,3 +181,28 @@ void RAS_BucketManager::RAS_BucketManagerClearAll() m_MaterialBuckets.clear(); m_AlphaBuckets.clear(); } + +void RAS_BucketManager::ReleaseDisplayLists() +{ + BucketList::iterator bit; + RAS_MaterialBucket::T_MeshSlotList::iterator mit; + + for (bit = m_MaterialBuckets.begin(); bit != m_MaterialBuckets.end(); ++bit) { + for (mit = (*bit)->msBegin(); mit != (*bit)->msEnd(); ++mit) { + if(mit->m_DisplayList) { + mit->m_DisplayList->Release(); + mit->m_DisplayList = NULL; + } + } + } + + for (bit = m_AlphaBuckets.begin(); bit != m_AlphaBuckets.end(); ++bit) { + for (mit = (*bit)->msBegin(); mit != (*bit)->msEnd(); ++mit) { + if(mit->m_DisplayList) { + mit->m_DisplayList->Release(); + mit->m_DisplayList = NULL; + } + } + } +} + diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.h b/source/gameengine/Rasterizer/RAS_BucketManager.h index 010478b1d5b..08b67ed022f 100644 --- a/source/gameengine/Rasterizer/RAS_BucketManager.h +++ b/source/gameengine/Rasterizer/RAS_BucketManager.h @@ -58,8 +58,9 @@ public: RAS_IRasterizer* rasty, class RAS_IRenderTools* rendertools); - RAS_MaterialBucket* RAS_BucketManagerFindBucket(RAS_IPolyMaterial * material, bool &bucketCreated); + RAS_MaterialBucket* FindBucket(RAS_IPolyMaterial * material, bool &bucketCreated); + void ReleaseDisplayLists(); private: void RAS_BucketManagerClearAll(); diff --git a/source/gameengine/Rasterizer/RAS_CameraData.h b/source/gameengine/Rasterizer/RAS_CameraData.h index 0327a3f4763..e3af43fb839 100644 --- a/source/gameengine/Rasterizer/RAS_CameraData.h +++ b/source/gameengine/Rasterizer/RAS_CameraData.h @@ -42,7 +42,7 @@ struct RAS_CameraData int m_viewporttop; float m_focallength; - RAS_CameraData(float lens = 35., float clipstart = 0.1, float clipend = 100., bool perspective = true, + RAS_CameraData(float lens = 35.0, float clipstart = 0.1, float clipend = 5000.0, bool perspective = true, float focallength = 0.0f, bool viewport = false, int viewportleft = 0, int viewportbottom = 0, int viewportright = 0, int viewporttop = 0) : m_lens(lens), diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp index cb10ba6bf37..4ee06d96603 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp @@ -39,7 +39,8 @@ RAS_IPolyMaterial::RAS_IPolyMaterial(const STR_String& texname, int tilexrep, int tileyrep, int mode, - bool transparant, + int transp, + bool alpha, bool zsort, int lightlayer, bool bIsTriangle, @@ -51,7 +52,8 @@ RAS_IPolyMaterial::RAS_IPolyMaterial(const STR_String& texname, m_tilexrep(tilexrep), m_tileyrep(tileyrep), m_drawingmode (mode), - m_transparant(transparant), + m_transp(transp), + m_alpha(alpha), m_zsort(zsort), m_lightlayer(lightlayer), m_bIsTriangle(bIsTriangle), @@ -74,6 +76,7 @@ bool RAS_IPolyMaterial::Equals(const RAS_IPolyMaterial& lhs) const this->m_multimode == lhs.m_multimode && this->m_flag == lhs.m_flag && this->m_drawingmode == lhs.m_drawingmode && + this->m_transp == lhs.m_transp && this->m_lightlayer == lhs.m_lightlayer && this->m_texturename.hash() == lhs.m_texturename.hash() && this->m_materialname.hash() == lhs.m_materialname.hash() @@ -85,7 +88,8 @@ bool RAS_IPolyMaterial::Equals(const RAS_IPolyMaterial& lhs) const this->m_tile == lhs.m_tile && this->m_tilexrep == lhs.m_tilexrep && this->m_tileyrep == lhs.m_tileyrep && - this->m_transparant == lhs.m_transparant && + this->m_transp == lhs.m_transp && + this->m_alpha == lhs.m_alpha && this->m_zsort == lhs.m_zsort && this->m_drawingmode == lhs.m_drawingmode && this->m_bIsTriangle == lhs.m_bIsTriangle && @@ -109,9 +113,9 @@ int RAS_IPolyMaterial::GetLightLayer() const return m_lightlayer; } -bool RAS_IPolyMaterial::IsTransparant() const +bool RAS_IPolyMaterial::IsAlpha() const { - return m_transparant; + return m_alpha || m_zsort; } bool RAS_IPolyMaterial::IsZSort() const @@ -139,6 +143,11 @@ const STR_String& RAS_IPolyMaterial::GetMaterialName() const return m_materialname; } +dword RAS_IPolyMaterial::GetMaterialNameHash() const +{ + return m_materialname.hash(); +} + const STR_String& RAS_IPolyMaterial::GetTextureName() const { return m_texturename; diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h index d2d1dba99d9..8fc53e6b038 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h @@ -52,7 +52,7 @@ enum MaterialProps RAS_AUTOGEN =128, RAS_NORMAL =256, RAS_DEFMULTI =512, - RAS_FORCEALPHA =1024 + RAS_BLENDERGLSL =1024 }; /** @@ -67,7 +67,8 @@ protected: int m_tile; int m_tilexrep,m_tileyrep; int m_drawingmode; // tface->mode - bool m_transparant; + int m_transp; + bool m_alpha; bool m_zsort; int m_lightlayer; bool m_bIsTriangle; @@ -102,7 +103,8 @@ public: int tilexrep, int tileyrep, int mode, - bool transparant, + int transp, + bool alpha, bool zsort, int lightlayer, bool bIsTriangle, @@ -132,12 +134,13 @@ public: virtual bool Equals(const RAS_IPolyMaterial& lhs) const; bool Less(const RAS_IPolyMaterial& rhs) const; int GetLightLayer() const; - bool IsTransparant() const; + bool IsAlpha() const; bool IsZSort() const; bool UsesTriangles() const; unsigned int hash() const; int GetDrawingMode() const; const STR_String& GetMaterialName() const; + dword GetMaterialNameHash() const; const STR_String& GetTextureName() const; const unsigned int GetFlag() const; diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h index d4a9177a85d..9e03212283e 100644 --- a/source/gameengine/Rasterizer/RAS_IRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h @@ -372,10 +372,6 @@ public: virtual void SetAmbientColor(float red, float green, float blue)=0; virtual void SetAmbient(float factor)=0; - /** - * Sets alpha testing - */ - virtual void SetAlphaTest(bool enable)=0; /** * Sets a polygon offset. z depth will be: z1 = mult*z0 + add @@ -398,8 +394,10 @@ public: virtual void DisableMotionBlur()=0; virtual float GetMotionBlurValue()=0; - virtual int GetMotionBlurState()=0; - virtual void SetMotionBlurState(int newstate)=0; + virtual int GetMotionBlurState()=0; + virtual void SetMotionBlurState(int newstate)=0; + + virtual void SetBlendingMode(int blendmode)=0; }; #endif //__RAS_IRASTERIZER diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp index e295d69e48e..0015b6a251f 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp @@ -76,26 +76,11 @@ KX_MeshSlot::~KX_MeshSlot() RAS_MaterialBucket::RAS_MaterialBucket(RAS_IPolyMaterial* mat) :m_bModified(true) { - m_bScheduled=true; m_material = mat; } -void RAS_MaterialBucket::SchedulePolygons(int drawingmode) -{ - m_bScheduled = true; -} - - - -void RAS_MaterialBucket::ClearScheduledPolygons() -{ - m_bScheduled = false; -} - - - RAS_IPolyMaterial* RAS_MaterialBucket::GetPolyMaterial() const { return m_material; @@ -134,9 +119,14 @@ void RAS_MaterialBucket::MarkVisibleMeshSlot(KX_MeshSlot& ms, (*it).m_RGBAcolor= rgbavec; } -bool RAS_MaterialBucket::IsTransparant() const +bool RAS_MaterialBucket::IsAlpha() const { - return (m_material->IsTransparant()); + return (m_material->IsAlpha()); +} + +bool RAS_MaterialBucket::IsZSort() const +{ + return (m_material->IsZSort()); } diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.h b/source/gameengine/Rasterizer/RAS_MaterialBucket.h index 13d8a53714a..4eef889c533 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.h +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.h @@ -125,11 +125,9 @@ public: class RAS_IRasterizer* rasty, class RAS_IRenderTools* rendertools); - void SchedulePolygons(int drawingmode); - void ClearScheduledPolygons(); - RAS_IPolyMaterial* GetPolyMaterial() const; - bool IsTransparant() const; + bool IsAlpha() const; + bool IsZSort() const; static void StartFrame(); static void EndFrame(); @@ -162,7 +160,6 @@ public: private: T_MeshSlotList m_meshSlots; - bool m_bScheduled; bool m_bModified; RAS_IPolyMaterial* m_material; double* m_pOGLMatrix; diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.cpp b/source/gameengine/Rasterizer/RAS_MeshObject.cpp index 4420f16c56d..af5228e4c35 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.cpp +++ b/source/gameengine/Rasterizer/RAS_MeshObject.cpp @@ -35,6 +35,8 @@ #include "MT_MinMax.h" #include "MT_Point3.h" +#include + STR_String RAS_MeshObject::s_emptyname = ""; @@ -201,26 +203,33 @@ void RAS_MeshObject::DebugColor(unsigned int abgr) m_debugcolor = abgr; } - +void RAS_MeshObject::SetVertexColor(RAS_IPolyMaterial* mat,MT_Vector4 rgba) +{ + const vecVertexArray & vertexvec = GetVertexCache(mat); + + for (vector::const_iterator it = vertexvec.begin(); it != vertexvec.end(); ++it) + { + KX_VertexArray::iterator vit; + for (vit=(*it)->begin(); vit != (*it)->end(); vit++) + { + vit->SetRGBA(rgba); + } + } +} void RAS_MeshObject::SchedulePoly(const KX_VertexIndex& idx, int numverts, RAS_IPolyMaterial* mat) { - //int indexpos = m_IndexArrayCount[idx.m_vtxarray]; - //m_IndexArrayCount[idx.m_vtxarray] = indexpos + 3; - KX_ArrayOptimizer* ao = GetArrayOptimizer(mat); + ao->m_IndexArrayCache1[idx.m_vtxarray]->push_back(idx.m_indexarray[0]); ao->m_IndexArrayCache1[idx.m_vtxarray]->push_back(idx.m_indexarray[1]); ao->m_IndexArrayCache1[idx.m_vtxarray]->push_back(idx.m_indexarray[2]); - if (!mat->UsesTriangles()) //if (!m_bUseTriangles) - { - //m_IndexArrayCount[idx.m_vtxarray] = indexpos+4; - ao->m_IndexArrayCache1[idx.m_vtxarray]->push_back(idx.m_indexarray[3]); - } -} + if (!mat->UsesTriangles()) + ao->m_IndexArrayCache1[idx.m_vtxarray]->push_back(idx.m_indexarray[3]); +} void RAS_MeshObject::ScheduleWireframePoly(const KX_VertexIndex& idx, @@ -409,7 +418,6 @@ void RAS_MeshObject::Bucketize(double* oglmatrix, for (RAS_MaterialBucket::Set::iterator it = m_materials.begin();it!=m_materials.end();++it) { RAS_MaterialBucket* bucket = *it; - bucket->SchedulePolygons(0); // KX_ArrayOptimizer* oa = GetArrayOptimizer(bucket->GetPolyMaterial()); bucket->SetMeshSlot(ms); } @@ -434,7 +442,6 @@ void RAS_MeshObject::MarkVisible(double* oglmatrix, for (RAS_MaterialBucket::Set::iterator it = m_materials.begin();it!=m_materials.end();++it) { RAS_MaterialBucket* bucket = *it; - bucket->SchedulePolygons(0); // KX_ArrayOptimizer* oa = GetArrayOptimizer(bucket->GetPolyMaterial()); bucket->MarkVisibleMeshSlot(ms,visible,useObjectColor,rgbavec); } @@ -453,7 +460,6 @@ void RAS_MeshObject::RemoveFromBuckets(double* oglmatrix, { RAS_MaterialBucket* bucket = *it; // RAS_IPolyMaterial* polymat = bucket->GetPolyMaterial(); - bucket->SchedulePolygons(0); //KX_ArrayOptimizer* oa = GetArrayOptimizer(polymat); bucket->RemoveMeshSlot(ms); } @@ -572,31 +578,36 @@ void RAS_MeshObject::UpdateMaterialList() struct RAS_MeshObject::polygonSlot { - float m_z; - RAS_Polygon *m_poly; - - polygonSlot(float z, RAS_Polygon* poly) : - m_z(z), - m_poly(poly) - {} - /** - * pnorm and pval form the plane equation that the distance from is used to - * sort against. - */ - polygonSlot(const MT_Vector3 &pnorm, const MT_Scalar &pval, RAS_MeshObject *mesh, RAS_Polygon* poly) : - m_poly(poly) + float m_z; + int m_index[4]; + + polygonSlot() {} + + /* pnorm is the normal from the plane equation that the distance from is + * used to sort again. */ + void get(const KX_VertexArray& vertexarray, const KX_IndexArray& indexarray, + int offset, int nvert, const MT_Vector3& pnorm) { - const KX_VertexIndex &base = m_poly->GetIndexBase(); - RAS_TexVert *vert = mesh->GetVertex(base.m_vtxarray, base.m_indexarray[0], poly->GetMaterial()->GetPolyMaterial()); - m_z = MT_dot(pnorm, vert->getLocalXYZ()) + pval; - - for(int i = 1; i < m_poly->VertexCount(); i++) - { - vert = mesh->GetVertex(base.m_vtxarray, base.m_indexarray[i], poly->GetMaterial()->GetPolyMaterial()); - float z = MT_dot(pnorm, vert->getLocalXYZ()) + pval; - m_z += z; + MT_Vector3 center(0, 0, 0); + int i; + + for(i=0; iVertexCount(); + + /* note we don't divide center by the number of vertices, since all + * polygons have the same number of vertices, and that we leave out + * the 4-th component of the plane equation since it is constant. */ + m_z = MT_dot(pnorm, center); + } + + void set(KX_IndexArray& indexarray, int offset, int nvert) + { + int i; + + for(i=0; i alphapolyset; - std::multiset solidpolyset; - - for (unsigned int p = 0; p < numpolys; p++) - { - RAS_Polygon* poly = m_Polygons[p]; - if (poly->IsVisible()) - { - if (poly->GetMaterial()->GetPolyMaterial()->IsTransparant()) - { - alphapolyset.insert(polygonSlot(pnorm, pval, this, poly)); - } else { - solidpolyset.insert(polygonSlot(pnorm, pval, this, poly)); - } - } - } - - // Clear current array data. + // unneeded: const MT_Scalar pval = transform.getOrigin()[2]; + for (RAS_MaterialBucket::Set::iterator it = m_materials.begin();it!=m_materials.end();++it) { - vector *indexcache = &GetArrayOptimizer((*it)->GetPolyMaterial())->m_IndexArrayCache1; - for (vector::iterator iit = indexcache->begin(); iit != indexcache->end(); ++iit) - (*iit)->clear(); - } + if(!(*it)->IsZSort()) + continue; - std::multiset::iterator sit = solidpolyset.begin(); - for (; sit != solidpolyset.end(); ++sit) - SchedulePoly((*sit).m_poly->GetVertexIndexBase(), (*sit).m_poly->VertexCount(), (*sit).m_poly->GetMaterial()->GetPolyMaterial()); - - std::multiset::iterator ait = alphapolyset.begin(); - for (; ait != alphapolyset.end(); ++ait) - SchedulePoly((*ait).m_poly->GetVertexIndexBase(), (*ait).m_poly->VertexCount(), (*ait).m_poly->GetMaterial()->GetPolyMaterial()); + RAS_IPolyMaterial *mat = (*it)->GetPolyMaterial(); + KX_ArrayOptimizer* ao = GetArrayOptimizer(mat); + + vecIndexArrays& indexarrays = ao->m_IndexArrayCache1; + vecVertexArray& vertexarrays = ao->m_VertexArrayCache1; + unsigned int i, j, nvert = (mat->UsesTriangles())? 3: 4; + + for(i=0; i slots(totpoly); + + /* get indices and z into temporary array */ + for(j=0; jSchedulePolygons(drawingmode); - if (bucket->GetPolyMaterial()->IsZSort()) + if ((*it)->IsZSort()) m_zsort = true; - } - - int numpolys = m_Polygons.size(); - if ((drawingmode > RAS_IRasterizer::KX_BOUNDINGBOX) && - (drawingmode < RAS_IRasterizer::KX_SOLID)) + if (drawingmode == RAS_IRasterizer::KX_WIREFRAME) { for (i=0;iIsVisible()) - ScheduleWireframePoly(poly->GetVertexIndexBase(),poly->VertexCount(),poly->GetEdgeCode() - ,poly->GetMaterial()->GetPolyMaterial()); + ScheduleWireframePoly(poly->GetVertexIndexBase(),poly->VertexCount(),poly->GetEdgeCode(), + poly->GetMaterial()->GetPolyMaterial()); } m_zsort = false; } else { - if (!m_zsort) + for (i=0;iIsVisible()) - { - SchedulePoly(poly->GetVertexIndexBase(),poly->VertexCount(),poly->GetMaterial()->GetPolyMaterial()); - } - } + RAS_Polygon* poly = m_Polygons[i]; + if (poly->IsVisible()) + SchedulePoly(poly->GetVertexIndexBase(),poly->VertexCount(), + poly->GetMaterial()->GetPolyMaterial()); } } m_bModified = false; - m_MeshMod = true; } } + diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.h b/source/gameengine/Rasterizer/RAS_MeshObject.h index 0d06748f91f..99806666fa6 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.h +++ b/source/gameengine/Rasterizer/RAS_MeshObject.h @@ -137,6 +137,18 @@ class RAS_MeshObject struct backtofront; struct fronttoback; + void SchedulePoly( + const KX_VertexIndex& idx, + int numverts, + RAS_IPolyMaterial* mat + ); + + void ScheduleWireframePoly( + const KX_VertexIndex& idx, + int numverts, + int edgecode, + RAS_IPolyMaterial* mat + ); protected: enum { BUCKET_MAX_INDICES = 65535 };//2048};//8192}; @@ -189,16 +201,14 @@ public: ); void DebugColor(unsigned int abgr); + void SetVertexColor(RAS_IPolyMaterial* mat,MT_Vector4 rgba); /** * Sorts the polygons by their transformed z values. */ void SortPolygons(const MT_Transform &transform); - void SchedulePolygons( - const MT_Transform &transform, - int drawingmode - ); + void SchedulePolygons(int drawingmode); void ClearArrayData(); @@ -215,19 +225,7 @@ public: int numverts, RAS_IPolyMaterial* polymat ); - - void SchedulePoly( - const KX_VertexIndex& idx, - int numverts, - RAS_IPolyMaterial* mat - ); - void ScheduleWireframePoly( - const KX_VertexIndex& idx, - int numverts, - int edgecode, - RAS_IPolyMaterial* mat - ); // find (and share) or add vertices // for some speedup, only the last 20 added vertices are searched for equality diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp index dcc36bf5a39..1dcc6e70934 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp @@ -67,6 +67,7 @@ RAS_OpenGLRasterizer::RAS_OpenGLRasterizer(RAS_ICanvas* canvas) m_motionblurvalue(-1.0), m_texco_num(0), m_attrib_num(0), + m_last_blendmode(0), m_materialCachingInfo(0) { m_viewmatrix.Identity(); @@ -171,6 +172,8 @@ bool RAS_OpenGLRasterizer::Init() m_ambg = 0.0f; m_ambb = 0.0f; + SetBlendingMode(0); + glClearColor(m_redback,m_greenback,m_blueback,m_alphaback); glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); @@ -189,18 +192,6 @@ void RAS_OpenGLRasterizer::SetAmbientColor(float red, float green, float blue) } -void RAS_OpenGLRasterizer::SetAlphaTest(bool enable) -{ - if (enable) - { - glEnable(GL_ALPHA_TEST); - glAlphaFunc(GL_GREATER, 0.6f); - } - else glDisable(GL_ALPHA_TEST); -} - - - void RAS_OpenGLRasterizer::SetAmbient(float factor) { float ambient[] = { m_ambr*factor, m_ambg*factor, m_ambb*factor, 1.0f }; @@ -353,6 +344,8 @@ bool RAS_OpenGLRasterizer::BeginFrame(int drawingmode, double time) glEnable (GL_CULL_FACE); } + SetBlendingMode(0); + glShadeModel(GL_SMOOTH); m_2DCanvas->BeginFrame(); @@ -1389,3 +1382,34 @@ void RAS_OpenGLRasterizer::DisableMotionBlur() m_motionblur = 0; m_motionblurvalue = -1.0; } + +void RAS_OpenGLRasterizer::SetBlendingMode(int blendmode) +{ + if(blendmode == m_last_blendmode) + return; + + if(blendmode == 0) { + glDisable(GL_BLEND); + glDisable(GL_ALPHA_TEST); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + } + else if(blendmode == 1) { + glBlendFunc(GL_ONE, GL_ONE); + glEnable(GL_BLEND); + glDisable(GL_ALPHA_TEST); + } + else if(blendmode == 2) { + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + glEnable(GL_ALPHA_TEST); + glAlphaFunc(GL_GREATER, 0.0f); + } + else if(blendmode == 4) { + glDisable(GL_BLEND); + glEnable(GL_ALPHA_TEST); + glAlphaFunc(GL_GREATER, 0.5f); + } + + m_last_blendmode = blendmode; +} + diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h index 0d54552db05..02056cce446 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h @@ -99,6 +99,7 @@ protected: TexCoGen m_attrib[RAS_MAX_ATTRIB]; int m_texco_num; int m_attrib_num; + int m_last_blendmode; /** Stores the caching information for the last material activated. */ RAS_IPolyMaterial::TCachingInfo m_materialCachingInfo; @@ -142,8 +143,6 @@ public: virtual void SetFocalLength(const float focallength); virtual float GetFocalLength(); - virtual void SetAlphaTest(bool enable); - virtual void SwapBuffers(); virtual void IndexPrimitives( const vecVertexArray& vertexarrays, @@ -282,8 +281,8 @@ public: virtual void EnableMotionBlur(float motionblurvalue); virtual void DisableMotionBlur(); virtual float GetMotionBlurValue(){return m_motionblurvalue;}; - virtual int GetMotionBlurState(){return m_motionblur;}; - virtual void SetMotionBlurState(int newstate) + virtual int GetMotionBlurState(){return m_motionblur;}; + virtual void SetMotionBlurState(int newstate) { if(newstate<0) m_motionblur = 0; @@ -292,6 +291,8 @@ public: else m_motionblur = newstate; }; + + virtual void SetBlendingMode(int blendmode); }; #endif //__RAS_OPENGLRASTERIZER diff --git a/source/gameengine/Rasterizer/RAS_Polygon.cpp b/source/gameengine/Rasterizer/RAS_Polygon.cpp index 852c94def3f..b74cb9cfcac 100644 --- a/source/gameengine/Rasterizer/RAS_Polygon.cpp +++ b/source/gameengine/Rasterizer/RAS_Polygon.cpp @@ -37,24 +37,6 @@ #include "RAS_Polygon.h" -/* -RAS_TexVert* RAS_Polygon::GetVertex(int index) -{ - if (m_bucket) - return m_bucket->GetVertex(m_vertexindexbase.m_vtxarray, m_vertexindexbase.m_indexarray[index]); - else - return NULL; -} -*/ - -/*void RAS_Polygon::Bucketize(double* oglmatrix) -{ - //Transform(trans); - if (m_bucket) - m_bucket->AddPolygon(this,oglmatrix); -} -*/ - RAS_Polygon::RAS_Polygon(RAS_MaterialBucket* bucket, bool visible, int numverts, From ae5217733d9203e42d5a8cd432edacf5c846ff21 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Sun, 3 Aug 2008 02:02:15 +0000 Subject: [PATCH 52/76] Added shrinkwrap as a constraint. All modes are available: nearest surface nearest vertex normal projection (along X,Y or Z axis) --- source/blender/blenkernel/intern/constraint.c | 71 +++++++++++++------ source/blender/blenloader/intern/readfile.c | 12 ++++ .../blender/makesdna/DNA_constraint_types.h | 5 +- source/blender/src/buttons_object.c | 28 +++++++- 4 files changed, 89 insertions(+), 27 deletions(-) diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 93ba30f8c9b..fdb272171bf 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -3253,6 +3253,7 @@ static int shrinkwrap_get_tars (bConstraint *con, ListBase *list) return 0; } + static void shrinkwrap_flush_tars (bConstraint *con, ListBase *list, short nocopy) { if (con && list) { @@ -3263,21 +3264,18 @@ static void shrinkwrap_flush_tars (bConstraint *con, ListBase *list, short nocop } } + static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float ctime) -{ - if (ct) - Mat4One(ct->matrix); -} - -static void shrinkwrap_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *targets) { bShrinkwrapConstraint *scon = (bShrinkwrapConstraint *) con->data; - bConstraintTarget *ct = targets->first; + if (ct) + Mat4CpyMat4(ct->matrix, cob->startmat); + if( VALID_CONS_TARGET(ct) && (ct->tar->type == OB_MESH) ) { float co[3] = {0.0f, 0.0f, 0.0f}; - float no[3] = {0.0f, 0.0f, 1.0f}; + float no[3] = {0.0f, 0.0f, 0.0f}; float dist; SpaceTransform transform; @@ -3292,23 +3290,35 @@ static void shrinkwrap_evaluate (bConstraint *con, bConstraintOb *cob, ListBase memset( &treeData, 0, sizeof(treeData) ); nearest.index = -1; - nearest.dist = 100000.0f; //TODO should use FLT_MAX.. but normal projection doenst yet supports it + nearest.dist = FLT_MAX; + + hit.index = -1; + hit.dist = 100000.0f; //TODO should use FLT_MAX.. but normal projection doenst yet supports it + + switch(scon->normalAxis) + { + case UP_X: no[0] = 1.0f; break; + case UP_Y: no[1] = 1.0f; break; + case UP_Z: no[2] = 1.0f; break; + } if(target != NULL) { - space_transform_from_matrixs(&transform, cob->matrix, ct->matrix); - - space_transform_apply(&transform, co); - space_transform_apply_normal(&transform, no); + space_transform_from_matrixs(&transform, cob->startmat, ct->tar->obmat); + //Normal projection applies the transform later + if(scon->shrinkType != MOD_SHRINKWRAP_NORMAL) + { + space_transform_apply(&transform, co); + space_transform_apply_normal(&transform, no); + } switch(scon->shrinkType) { case MOD_SHRINKWRAP_NEAREST_SURFACE: if(bvhtree_from_mesh_faces(&treeData, target, 0.0, 2, 6) == NULL) return; BLI_bvhtree_find_nearest(treeData.tree, co, &nearest, treeData.nearest_callback, &treeData); - VECCOPY(co, nearest.co); dist = VecLenf(co, nearest.co); VecLerpf(co, co, nearest.co, (dist - scon->dist)/dist); //linear interpolation @@ -3317,7 +3327,6 @@ static void shrinkwrap_evaluate (bConstraint *con, bConstraintOb *cob, ListBase case MOD_SHRINKWRAP_NEAREST_VERTEX: if(bvhtree_from_mesh_verts(&treeData, target, 0.0, 2, 6) == NULL) return; BLI_bvhtree_find_nearest(treeData.tree, co, &nearest, treeData.nearest_callback, &treeData); - VECCOPY(co, nearest.co); dist = VecLenf(co, nearest.co); VecLerpf(co, co, nearest.co, (dist - scon->dist)/dist); //linear interpolation @@ -3325,27 +3334,43 @@ static void shrinkwrap_evaluate (bConstraint *con, bConstraintOb *cob, ListBase case MOD_SHRINKWRAP_NORMAL: if(bvhtree_from_mesh_faces(&treeData, target, scon->dist, 4, 6) == NULL) return; - if(normal_projection_project_vertex(0, co, no, &transform, treeData.tree, &hit, treeData.raycast_callback, &treeData) == FALSE) - return; + if(normal_projection_project_vertex(0, co, no, &transform, treeData.tree, &hit, treeData.raycast_callback, &treeData) == FALSE) + { + if(treeData.tree) + BLI_bvhtree_free(treeData.tree); + + target->release(target); + + return; + } VECCOPY(co, hit.co); break; } - space_transform_invert(&transform, co); - VECADD(cob->matrix[3], cob->matrix[3], co); - - if(treeData.tree) BLI_bvhtree_free(treeData.tree); target->release(target); - } - + if(scon->shrinkType != MOD_SHRINKWRAP_NORMAL) + { + space_transform_invert(&transform, co); + } + VECADD(ct->matrix[3], ct->matrix[3], co); + } } } +static void shrinkwrap_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *targets) +{ + bConstraintTarget *ct= targets->first; + + /* only evaluate if there is a target */ + if (VALID_CONS_TARGET(ct)) + Mat4CpyMat4(cob->matrix, ct->matrix); +} + static bConstraintTypeInfo CTI_SHRINKWRAP = { CONSTRAINT_TYPE_SHRINKWRAP, /* type */ sizeof(bShrinkwrapConstraint), /* size */ diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index ad19cde3c9b..70ead610cc3 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1819,6 +1819,13 @@ static void lib_link_constraints(FileData *fd, ID *id, ListBase *conlist) data->tar = newlibadr(fd, id->lib, data->tar); } break; + case CONSTRAINT_TYPE_SHRINKWRAP: + { + bShrinkwrapConstraint *data; + data= ((bShrinkwrapConstraint*)con->data); + data->target = newlibadr(fd, id->lib, data->target); + } + break; case CONSTRAINT_TYPE_NULL: break; } @@ -8351,6 +8358,11 @@ static void expand_constraints(FileData *fd, Main *mainvar, ListBase *lb) expand_doit(fd, mainvar, data->tar); } break; + case CONSTRAINT_TYPE_SHRINKWRAP: + { + bShrinkwrapConstraint *data = (bShrinkwrapConstraint*)curcon->data; + expand_doit(fd, mainvar, data->target); + } default: break; } diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h index e78855b8de6..7b686106ae5 100644 --- a/source/blender/makesdna/DNA_constraint_types.h +++ b/source/blender/makesdna/DNA_constraint_types.h @@ -321,9 +321,12 @@ typedef struct bShrinkwrapConstraint { Object *target; float dist; /* distance to kept from target */ short shrinkType; /* shrink type (look on MOD shrinkwrap for values) */ - short pad[5]; + char normalAxis; /* axis to project over UP_X, UP_Y, UP_Z */ + char pad[9]; } bShrinkwrapConstraint; +#define SHRINKWRAP + /* ------------------------------------------ */ /* bConstraint->type diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index c2643aa479b..efa82e03d5f 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -1743,10 +1743,32 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s case CONSTRAINT_TYPE_SHRINKWRAP: { bShrinkwrapConstraint *data = con->data; + char shrinktypemenu[]="Shrinkwrap type%t|nearest surface point %x0|normal projection %x1|nearest vertex %x2"; - height = 44; - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->target, "Target Object"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "dist", *xco+120, *yco-44, 135, 18, &data->dist, 0.0f, 100.0f, 1.0f, 0.0f, "Distance to target"); + height = 60; + if(data->shrinkType == MOD_SHRINKWRAP_NORMAL) + height += 18; + + uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); + + /* Draw parameters */ + uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+65, *yco-24, 90, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); + uiDefIDPoinBut(block, test_meshobpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->target, "Target Object"); + + uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Dist:", *xco + 75, *yco-42, 90, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); + uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+120, *yco-42, 135, 18, &data->dist, 0.0f, 100.0f, 1.0f, 0.0f, "Distance to target"); + + uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Type:", *xco + 70, *yco-60, 90, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); + uiDefButS(block, MENU, B_MODIFIER_RECALC, shrinktypemenu, *xco+120, *yco-60, 135, 18, &data->shrinkType, 0, 0, 0, 0, "Selects type of shrinkwrap algorithm for target position."); + + if(data->shrinkType == MOD_SHRINKWRAP_NORMAL) + { + /* Draw XYZ toggles */ + uiDefBut(block, LABEL,B_CONSTRAINT_TEST, "Axis:", *xco+ 75, *yco-78, 90, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); + uiDefButC(block, ROW, B_CONSTRAINT_TEST, "X" , *xco+120, *yco-78, 45, 18, &data->normalAxis, 18.0, UP_X, 0, 0, "Direction of normal projection is x-axis"); + uiDefButC(block, ROW, B_CONSTRAINT_TEST, "Y" , *xco+165, *yco-78, 45, 18, &data->normalAxis, 18.0, UP_Y, 0, 0, "Direction of normal projection is y-axis"); + uiDefButC(block, ROW, B_CONSTRAINT_TEST, "Z" , *xco+210, *yco-78, 45, 18, &data->normalAxis, 18.0, UP_Z, 0, 0, "Direction of normal projection is z-axis"); + } } break; default: From c2cd6bebe609db6b8079b30ee90b3d9f9abb0e2d Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Sun, 3 Aug 2008 15:37:24 +0000 Subject: [PATCH 53/76] added openmp support for bvhtree build (max processes = tree_type) --- source/blender/blenkernel/intern/shrinkwrap.c | 2 +- source/blender/blenlib/intern/BLI_kdopbvh.c | 196 ++++++++++++------ .../blender/makesdna/DNA_constraint_types.h | 1 - 3 files changed, 136 insertions(+), 63 deletions(-) diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 53051b3cfd7..481d5f680db 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -1024,7 +1024,7 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedM break; case MOD_SHRINKWRAP_NORMAL: - shrinkwrap_calc_normal_projection(&calc); + BENCH(shrinkwrap_calc_normal_projection(&calc)); break; case MOD_SHRINKWRAP_NEAREST_VERTEX: diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index d9c24853236..7c79381c5cd 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -28,8 +28,9 @@ #include "math.h" #include -#include +#include #include +#include #include "MEM_guardedalloc.h" @@ -294,10 +295,32 @@ void BLI_bvhtree_free(BVHTree *tree) } } +// calculate max number of branches +int needed_branches(int tree_type, int leafs) +{ +#if 1 + //Worst case scenary ( return max(0, leafs-tree_type)+1 ) + if(leafs <= tree_type) + return 1; + else + return leafs-tree_type+1; + +#else + //If our bvh kdop is "almost perfect" + //TODO i dont trust the float arithmetic in here (and I am not sure this formula is according to our splitting method) + int i, numbranches = 0; + for(i = 1; i <= (int)ceil((float)((float)log(leafs)/(float)log(tree_type))); i++) + numbranches += (pow(tree_type, i) / tree_type); + + return numbranches; +#endif +} + + BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis) { BVHTree *tree; - int numbranches=0, i; + int numnodes, i; // theres not support for trees below binary-trees :P if(tree_type < 2) @@ -343,11 +366,10 @@ BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis) } - // calculate max number of branches, our bvh kdop is "almost perfect" - for(i = 1; i <= (int)ceil((float)((float)log(maxsize)/(float)log(tree_type))); i++) - numbranches += (pow(tree_type, i) / tree_type); - - tree->nodes = (BVHNode **)MEM_callocN(sizeof(BVHNode *)*(numbranches+maxsize + tree_type), "BVHNodes"); + //Allocate arrays + numnodes = maxsize + needed_branches(tree_type, maxsize) + tree_type; + + tree->nodes = (BVHNode **)MEM_callocN(sizeof(BVHNode *)*numnodes, "BVHNodes"); if(!tree->nodes) { @@ -355,14 +377,14 @@ BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis) return NULL; } - tree->nodebv = (float*)MEM_callocN(sizeof(float)* axis * (numbranches+maxsize + tree_type), "BVHNodeBV"); + tree->nodebv = (float*)MEM_callocN(sizeof(float)* axis * numnodes, "BVHNodeBV"); if(!tree->nodebv) { MEM_freeN(tree->nodes); MEM_freeN(tree); } - tree->nodechild = (BVHNode**)MEM_callocN(sizeof(BVHNode*) * tree_type * (numbranches+maxsize + tree_type), "BVHNodeBV"); + tree->nodechild = (BVHNode**)MEM_callocN(sizeof(BVHNode*) * tree_type * numnodes, "BVHNodeBV"); if(!tree->nodechild) { MEM_freeN(tree->nodebv); @@ -370,7 +392,7 @@ BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis) MEM_freeN(tree); } - tree->nodearray = (BVHNode *)MEM_callocN(sizeof(BVHNode)*(numbranches+maxsize + tree_type), "BVHNodeArray"); + tree->nodearray = (BVHNode *)MEM_callocN(sizeof(BVHNode)* numnodes, "BVHNodeArray"); if(!tree->nodearray) { @@ -382,7 +404,7 @@ BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis) } //link the dynamic bv and child links - for(i=0; i< numbranches+maxsize + tree_type; i++) + for(i=0; i< numnodes; i++) { tree->nodearray[i].bv = tree->nodebv + i * axis; tree->nodearray[i].children = tree->nodechild + i * tree_type; @@ -422,6 +444,13 @@ static void create_kdop_hull(BVHTree *tree, BVHNode *node, float *co, int numpoi bv[(2 * i) + 1] = newminmax; } } + + // inflate the bv with some epsilon + for (i = tree->start_axis; i < tree->stop_axis; i++) + { + bv[(2 * i)] -= tree->epsilon; // minimum + bv[(2 * i) + 1] += tree->epsilon; // maximum + } } // depends on the fact that the BVH's for each face is already build @@ -457,14 +486,13 @@ static void refit_kdop_hull(BVHTree *tree, BVHNode *node, int start, int end) int BLI_bvhtree_insert(BVHTree *tree, int index, float *co, int numpoints) { - BVHNode *node= NULL; - int i; + BVHNode *node = NULL; // insert should only possible as long as tree->totbranch is 0 if(tree->totbranch > 0) return 0; - if(tree->totleaf+1 >= MEM_allocN_len(tree->nodes)) + if(tree->totleaf+1 >= MEM_allocN_len(tree->nodes)/sizeof(*(tree->nodes))) return 0; // TODO check if have enough nodes in array @@ -473,14 +501,6 @@ int BLI_bvhtree_insert(BVHTree *tree, int index, float *co, int numpoints) tree->totleaf++; create_kdop_hull(tree, node, co, numpoints, 0); - - // inflate the bv with some epsilon - for (i = tree->start_axis; i < tree->stop_axis; i++) - { - node->bv[(2 * i)] -= tree->epsilon; // minimum - node->bv[(2 * i) + 1] += tree->epsilon; // maximum - } - node->index= index; return 1; @@ -511,25 +531,24 @@ static char get_largest_axis(float *bv) } } -static void bvh_div_nodes(BVHTree *tree, BVHNode *node, int start, int end, char lastaxis) +static void bvh_div_nodes(BVHTree *tree, BVHNode *node, int start, int end, int free_node_index) { - char laxis; - int i, tend; - BVHNode *tnode; - int slice = (end-start+tree->tree_type-1)/tree->tree_type; //division rounded up + int i; + + const char laxis = get_largest_axis(node->bv); //determine longest axis to split along + const int slice = (end-start)/tree->tree_type; //division rounded down + const int rest = (end-start)%tree->tree_type; //remainder of division - // Determine which axis to split along - laxis = get_largest_axis(node->bv); - //laxis = (lastaxis + 2) % tree->axis; // XYZ split + assert( node->totnode == 0 ); node->main_axis = laxis/2; // split nodes along longest axis - for (i=0; start < end; start += slice, i++) //i counts the current child + for (i=0; start < end; node->totnode = ++i) //i counts the current child { - tend = start + slice; + int tend = start + slice + (i < rest ? 1 : 0); - if(tend > end) tend = end; + assert( tend <= end); if(tend-start == 1) // ok, we have 1 left for this node { @@ -538,21 +557,86 @@ static void bvh_div_nodes(BVHTree *tree, BVHNode *node, int start, int end, char } else { - tnode = node->children[i] = tree->nodes[tree->totleaf + tree->totbranch] = &(tree->nodearray[tree->totbranch + tree->totleaf]); - tree->totbranch++; + BVHNode *tnode = node->children[i] = tree->nodes[free_node_index] = &(tree->nodearray[free_node_index]); +// printf("Used %d (%d)\n", free_node_index, tend-start); tnode->parent = node; if(tend != end) partition_nth_element(tree->nodes, start, end, tend, laxis); + refit_kdop_hull(tree, tnode, start, tend); - bvh_div_nodes(tree, tnode, start, tend, laxis); // not called on XYZ split + + bvh_div_nodes(tree, tnode, start, tend, free_node_index+1); + free_node_index += needed_branches(tree->tree_type, tend-start); } - node->totnode++; + start = tend; } return; } +static void omp_bvh_div_nodes(BVHTree *tree, BVHNode *node, int start, int end, int free_node_index) +{ + int i; + + const char laxis = get_largest_axis(node->bv); //determine longest axis to split along + const int slice = (end-start)/tree->tree_type; //division rounded down + const int rest = (end-start)%tree->tree_type; //remainder of division + + int omp_data_start[tree->tree_type]; + int omp_data_end [tree->tree_type]; + int omp_data_index[tree->tree_type]; + + assert( node->totnode == 0 ); + + node->main_axis = laxis/2; + + // split nodes along longest axis + for (i=0; start < end; node->totnode = ++i) //i counts the current child + { + //Split the rest from left to right (TODO: this doenst makes an optimal tree) + int tend = start + slice + (i < rest ? 1 : 0); + + assert( tend <= end); + + //save data for later OMP + omp_data_start[i] = start; + omp_data_end [i] = tend; + omp_data_index[i] = free_node_index; + + if(tend-start == 1) + { + node->children[i] = tree->nodes[start]; + node->children[i]->parent = node; + } + else + { + node->children[i] = tree->nodes[free_node_index] = &(tree->nodearray[free_node_index]); + + if(tend != end) + partition_nth_element(tree->nodes, start, end, tend, laxis); + + free_node_index += needed_branches(tree->tree_type, tend-start); + } + + start = tend; + } + +#pragma omp parallel for private(i) schedule(static) + for( i = 0; i < node->totnode; i++) + { + if(omp_data_end[i]-omp_data_start[i] > 1) + { + BVHNode *tnode = node->children[i]; + refit_kdop_hull(tree, tnode, omp_data_start[i], omp_data_end[i]); + bvh_div_nodes (tree, tnode, omp_data_start[i], omp_data_end[i], omp_data_index[i]+1); + } + } + + return; +} + + #if 0 static void verify_tree(BVHTree *tree) { @@ -604,23 +688,21 @@ static void verify_tree(BVHTree *tree) void BLI_bvhtree_balance(BVHTree *tree) { - int i; - BVHNode *node; + assert(tree->totbranch == 0); + if(tree->totleaf != 0) + { + // create root node + BVHNode *node = tree->nodes[tree->totleaf] = &(tree->nodearray[tree->totleaf]); + tree->totbranch++; - if(tree->totleaf == 0) - return; - - // create root node - node = tree->nodes[tree->totleaf] = &(tree->nodearray[tree->totleaf]); - tree->totbranch++; - - // refit root bvh node - refit_kdop_hull(tree, tree->nodes[tree->totleaf], 0, tree->totleaf); // not called on XYZ split - // create + balance tree - bvh_div_nodes(tree, tree->nodes[tree->totleaf], 0, tree->totleaf, 0); - //BLI_bvhtree_update_tree(tree); // XYZ split - - // verify_tree(tree); + // refit root bvh node + refit_kdop_hull(tree, node, 0, tree->totleaf); + + // create + balance tree + omp_bvh_div_nodes(tree, node, 0, tree->totleaf, tree->totleaf+1); + tree->totbranch = needed_branches( tree->tree_type, tree->totleaf ); + // verify_tree(tree); + } } // overlap - is it possbile for 2 bv's to collide ? @@ -796,7 +878,6 @@ static void node_join(BVHTree *tree, BVHNode *node) int BLI_bvhtree_update_node(BVHTree *tree, int index, float *co, float *co_moving, int numpoints) { BVHNode *node= NULL; - int i = 0; // check if index exists if(index > tree->totleaf) @@ -809,13 +890,6 @@ int BLI_bvhtree_update_node(BVHTree *tree, int index, float *co, float *co_movin if(co_moving) create_kdop_hull(tree, node, co_moving, numpoints, 1); - // inflate the bv with some epsilon - for (i = tree->start_axis; i < tree->stop_axis; i++) - { - node->bv[(2 * i)] -= tree->epsilon; // minimum - node->bv[(2 * i) + 1] += tree->epsilon; // maximum - } - return 1; } diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h index 7b686106ae5..cc7bdeef0de 100644 --- a/source/blender/makesdna/DNA_constraint_types.h +++ b/source/blender/makesdna/DNA_constraint_types.h @@ -325,7 +325,6 @@ typedef struct bShrinkwrapConstraint { char pad[9]; } bShrinkwrapConstraint; -#define SHRINKWRAP /* ------------------------------------------ */ From d786fead104fc4ce1a42286631fb74a3b0dfd620 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Mon, 4 Aug 2008 11:50:36 +0000 Subject: [PATCH 54/76] Fixed double inflation in case of co_moving points --- source/blender/blenlib/intern/BLI_kdopbvh.c | 23 ++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index 7c79381c5cd..a65d2ca6ea0 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -444,13 +444,6 @@ static void create_kdop_hull(BVHTree *tree, BVHNode *node, float *co, int numpoi bv[(2 * i) + 1] = newminmax; } } - - // inflate the bv with some epsilon - for (i = tree->start_axis; i < tree->stop_axis; i++) - { - bv[(2 * i)] -= tree->epsilon; // minimum - bv[(2 * i) + 1] += tree->epsilon; // maximum - } } // depends on the fact that the BVH's for each face is already build @@ -486,6 +479,7 @@ static void refit_kdop_hull(BVHTree *tree, BVHNode *node, int start, int end) int BLI_bvhtree_insert(BVHTree *tree, int index, float *co, int numpoints) { + int i; BVHNode *node = NULL; // insert should only possible as long as tree->totbranch is 0 @@ -503,6 +497,13 @@ int BLI_bvhtree_insert(BVHTree *tree, int index, float *co, int numpoints) create_kdop_hull(tree, node, co, numpoints, 0); node->index= index; + // inflate the bv with some epsilon + for (i = tree->start_axis; i < tree->stop_axis; i++) + { + node->bv[(2 * i)] -= tree->epsilon; // minimum + node->bv[(2 * i) + 1] += tree->epsilon; // maximum + } + return 1; } @@ -877,6 +878,7 @@ static void node_join(BVHTree *tree, BVHNode *node) // call before BLI_bvhtree_update_tree() int BLI_bvhtree_update_node(BVHTree *tree, int index, float *co, float *co_moving, int numpoints) { + int i; BVHNode *node= NULL; // check if index exists @@ -890,6 +892,13 @@ int BLI_bvhtree_update_node(BVHTree *tree, int index, float *co, float *co_movin if(co_moving) create_kdop_hull(tree, node, co_moving, numpoints, 1); + // inflate the bv with some epsilon + for (i = tree->start_axis; i < tree->stop_axis; i++) + { + node->bv[(2 * i)] -= tree->epsilon; // minimum + node->bv[(2 * i) + 1] += tree->epsilon; // maximum + } + return 1; } From 919eba04de19fbf5edbfdf3d4cbfec446645e5ac Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Mon, 4 Aug 2008 13:12:35 +0000 Subject: [PATCH 55/76] SimpleDeform modifications: * Added "Lock axis" options on taper and strech/squash (suggested by ZanQdo) * Better control of deform factor (suggested by ZanQdo) * Added eModifierTypeFlag_AcceptsCVs (so it now accepts both curves and meshes) --- source/blender/blenkernel/intern/modifier.c | 15 ++- .../blender/blenkernel/intern/simple_deform.c | 93 ++++++------------- source/blender/makesdna/DNA_modifier_types.h | 20 ++-- source/blender/src/buttons_editing.c | 33 ++++--- 4 files changed, 71 insertions(+), 90 deletions(-) diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 502be6b3af3..89de5ee9e45 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -7289,10 +7289,12 @@ static void simpledeformModifier_initData(ModifierData *md) SimpleDeformModifierData *smd = (SimpleDeformModifierData*) md; smd->mode = MOD_SIMPLEDEFORM_MODE_TWIST; - smd->origin = 0; - smd->factor[0] = 0.35; - smd->factor[1] = -1000.0; - smd->factor[2] = 1000.0; + smd->axis = 0; + + smd->origin = NULL; + smd->factor = 0.35; + smd->limit[0] = -1000.0f; + smd->limit[1] = 1000.0f; } static void simpledeformModifier_copyData(ModifierData *md, ModifierData *target) @@ -7301,8 +7303,10 @@ static void simpledeformModifier_copyData(ModifierData *md, ModifierData *target SimpleDeformModifierData *tsmd = (SimpleDeformModifierData*)target; tsmd->mode = smd->mode; + tsmd->axis = smd->axis; tsmd->origin= smd->origin; - memcpy(tsmd->factor, smd->factor, sizeof(tsmd->factor)); + tsmd->factor= smd->factor; + memcpy(tsmd->limit, smd->limit, sizeof(tsmd->limit)); } static void simpledeformModifier_deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) @@ -7681,6 +7685,7 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type) mti = INIT_TYPE(SimpleDeform); mti->type = eModifierTypeType_OnlyDeform; mti->flags = eModifierTypeFlag_AcceptsMesh + | eModifierTypeFlag_AcceptsCVs | eModifierTypeFlag_SupportsEditmode | eModifierTypeFlag_EnableInEditmode; mti->initData = simpledeformModifier_initData; diff --git a/source/blender/blenkernel/intern/simple_deform.c b/source/blender/blenkernel/intern/simple_deform.c index 86fef7208a1..20cba28ab5a 100644 --- a/source/blender/blenkernel/intern/simple_deform.c +++ b/source/blender/blenkernel/intern/simple_deform.c @@ -40,7 +40,9 @@ #include -static void axis_limit(int axis, const float limits[2], float *co, float *dcut) +//Clamps/Limits the given coordinate to: limits[0] <= co[axis] <= limits[1] +//The ammount of clamp is saved on dcut +static void axis_limit(int axis, const float limits[2], float co[3], float dcut[3]) { float val = co[axis]; if(limits[0] > val) val = limits[0]; @@ -50,10 +52,9 @@ static void axis_limit(int axis, const float limits[2], float *co, float *dcut) co[axis] = val; } -static void simpleDeform_tapperXY(const float factor, const float *dcut, float *co) +static void simpleDeform_taper(const float factor, const float dcut[3], float *co) { float x = co[0], y = co[1], z = co[2]; - float scale = z*factor; co[0] = x + x*scale; @@ -62,13 +63,13 @@ static void simpleDeform_tapperXY(const float factor, const float *dcut, float * if(dcut) { - co[0] += dcut[0]*scale; - co[1] += dcut[1]*scale; + co[0] += dcut[0]; + co[1] += dcut[1]; co[2] += dcut[2]; } } -static void simpleDeform_strech(const float factor, const float dcut[3], float *co) +static void simpleDeform_stretch(const float factor, const float dcut[3], float *co) { float x = co[0], y = co[1], z = co[2]; float scale; @@ -82,46 +83,9 @@ static void simpleDeform_strech(const float factor, const float dcut[3], float * if(dcut) { - co[0] += dcut[0]*scale; - co[1] += dcut[0]*scale; - co[2] += dcut[2]; - } -} - -static void simpleDeform_squash(const float factor, const float dcut[3], float *co) -{ - float x = co[0], y = co[1], z = co[2]; - float scale; - - scale = z*factor; - scale = -scale*scale; - - co[0] += x+x*scale; - co[1] += y+y*scale; - - if(dcut) - { - co[0] += dcut[0]*scale; - co[1] += dcut[0]*scale; - co[2] += dcut[2]; - } -} - -static void simpleDeform_tapperX(const float factor, const float *dcut, float *co) -{ - float x = co[0], y = co[1], z = co[2]; - - float scale = z*factor; - - co[0] = x+ x*scale; - co[1] = y; - co[2] = z; - - if(dcut) - { - co[0] += dcut[0]*scale; + co[0] += dcut[0]; co[1] += dcut[1]; - co[2] += dcut[2]; + co[2] += dcut[2]; } } @@ -179,6 +143,7 @@ void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object *ob, s int i; float (*ob2mod)[4] = NULL, (*mod2ob)[4] = NULL; float tmp_matrix[2][4][4]; + static const float lock_axis[2] = {0.0f, 0.0f}; int vgroup = get_named_vertexgroup_num(ob, smd->vgroup_name); @@ -205,41 +170,41 @@ void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object *ob, s { float co[3], dcut[3]; float weight = vertexgroup_get_vertex_weight(dvert, i, vgroup); + float factor = smd->factor; if(weight == 0) continue; if(ob2mod) Mat4MulVecfl(ob2mod, vertexCos[i]); - dcut[0] = dcut[1] = dcut[2] = 0.0f; VECCOPY(co, vertexCos[i]); + dcut[0] = dcut[1] = dcut[2] = 0.0f; + if(smd->axis & MOD_SIMPLEDEFORM_LOCK_AXIS_X) axis_limit(0, lock_axis, co, dcut); + if(smd->axis & MOD_SIMPLEDEFORM_LOCK_AXIS_Y) axis_limit(1, lock_axis, co, dcut); + switch(smd->mode) { case MOD_SIMPLEDEFORM_MODE_TWIST: - axis_limit(2, smd->factor+1, co, dcut); - simpleDeform_twist (smd->factor[0], dcut, co); - break; + axis_limit(2, smd->limit, co, dcut); + simpleDeform_twist(factor, dcut, co); + break; case MOD_SIMPLEDEFORM_MODE_BEND: - axis_limit(0, smd->factor+1, co, dcut); - simpleDeform_bend (smd->factor[0], dcut, co); - break; + axis_limit(0, smd->limit, co, dcut); + simpleDeform_bend(factor, dcut, co); + break; - case MOD_SIMPLEDEFORM_MODE_TAPER_X: - axis_limit(2, smd->factor+1, co, dcut); - simpleDeform_tapperX (smd->factor[0], dcut, co); - break; + case MOD_SIMPLEDEFORM_MODE_TAPER: + axis_limit(2, smd->limit, co, dcut); + simpleDeform_taper(factor, dcut, co); + break; - case MOD_SIMPLEDEFORM_MODE_TAPER_XY: - axis_limit(2, smd->factor+1, co, dcut); - simpleDeform_tapperXY(smd->factor[0], dcut, co); - break; - case MOD_SIMPLEDEFORM_MODE_STRECH_SQUASH: - axis_limit(2, smd->factor+1, co, dcut); - simpleDeform_strech(smd->factor[0], dcut, co); - break; + case MOD_SIMPLEDEFORM_MODE_STRETCH: + axis_limit(2, smd->limit, co, dcut); + simpleDeform_stretch(factor, dcut, co); + break; } //linear interpolation diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index e63eb608295..b3d80f2e554 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -524,17 +524,21 @@ typedef struct SimpleDeformModifierData { struct Object *origin; /* object to control the origin of modifier space coordinates */ char vgroup_name[32]; /* optional vertexgroup name */ - float factor[4]; /* factors to control simple deforms */ + float factor; /* factors to control simple deforms */ + float limit[2]; /* lower and upper limit */ - char mode; - char pad[7]; + char mode; /* deform function */ + char axis; /* lock axis (for taper and strech) */ + char pad[2]; } SimpleDeformModifierData; -#define MOD_SIMPLEDEFORM_MODE_TWIST 1 -#define MOD_SIMPLEDEFORM_MODE_BEND 2 -#define MOD_SIMPLEDEFORM_MODE_TAPER_X 3 -#define MOD_SIMPLEDEFORM_MODE_TAPER_XY 4 -#define MOD_SIMPLEDEFORM_MODE_STRECH_SQUASH 5 +#define MOD_SIMPLEDEFORM_MODE_TWIST 1 +#define MOD_SIMPLEDEFORM_MODE_BEND 2 +#define MOD_SIMPLEDEFORM_MODE_TAPER 3 +#define MOD_SIMPLEDEFORM_MODE_STRETCH 4 + +#define MOD_SIMPLEDEFORM_LOCK_AXIS_X (1<<0) +#define MOD_SIMPLEDEFORM_LOCK_AXIS_Y (1<<1) #endif diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 31f4596c264..63ef31b6062 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -962,7 +962,7 @@ static void modifiers_add(void *ob_v, int type) static void do_modifiers_select_simpledeform_typemenu(void *ob_v, int event) { - static const char *default_name[] = { "", "Twist", "Bend", "Taper X", "Taper XY", "Strech", "Squash" }; + static const char *default_name[] = { "", "Twist", "Bend", "Taper", "Strech" }; SimpleDeformModifierData *smd = (SimpleDeformModifierData*)modifier_new(eModifierType_SimpleDeform); smd->mode = event; @@ -984,9 +984,8 @@ static uiBlock *modifiers_select_simpledeform_typemenu(void *ob_v) uiDefBut(block, BUTM, B_MODIFIER_RECALC, "Twist", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_TWIST, ""); uiDefBut(block, BUTM, B_MODIFIER_RECALC, "Bend", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_BEND, ""); - uiDefBut(block, BUTM, B_MODIFIER_RECALC, "Tapper X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_TAPER_X, ""); - uiDefBut(block, BUTM, B_MODIFIER_RECALC, "Tapper XY", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_TAPER_XY, ""); - uiDefBut(block, BUTM, B_MODIFIER_RECALC, "Strech Squash", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_STRECH_SQUASH, ""); + uiDefBut(block, BUTM, B_MODIFIER_RECALC, "Taper", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_TAPER, ""); + uiDefBut(block, BUTM, B_MODIFIER_RECALC, "Stretch", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, MOD_SIMPLEDEFORM_MODE_STRETCH, ""); uiBlockSetDirection(block, UI_RIGHT); uiTextBoundsBlock(block, 50); @@ -1909,7 +1908,13 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco height += 19; } else if (md->type==eModifierType_SimpleDeform) { - height += 19*5; + SimpleDeformModifierData *smd = (SimpleDeformModifierData*) md; + + height += 19*4; + + if(smd->mode == MOD_SIMPLEDEFORM_MODE_STRETCH + || smd->mode == MOD_SIMPLEDEFORM_MODE_TAPER ) + height += 19; } /* roundbox 4 free variables: corner-rounding, nop, roundbox type, shade */ uiDefBut(block, ROUNDBOX, 0, "", x-10, y-height-2, width, height-2, NULL, 5.0, 0.0, 12, 40, ""); @@ -2566,11 +2571,6 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco } else if (md->type==eModifierType_SimpleDeform) { SimpleDeformModifierData *smd = (SimpleDeformModifierData*) md; -/* - char simpledeform_typemenu[]="Deform type%t|Twist %x1|Bend %x2|Taper %x3|TaperXY %x4|Strech %x5|Squash %x6"; - uiDefButC(block, MENU, B_MODIFIER_RECALC, simpledeform_typemenu, lx,(cy-=19),buttonWidth,19, &smd->mode, 0, 0, 0, 0, "Selects type of deform"); -*/ - but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &smd->vgroup_name, 0, 31, 0, 0, "Vertex Group name"); uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob); @@ -2588,10 +2588,17 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco bt= uiDefIconBut(block, BUT, B_CHANGEDEP, ICON_ZOOMIN, lx+buttonWidth-17, cy, 17, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Creates a new empty"); uiButSetFunc(bt, modifier_link_new_empty, &smd->origin, ob); } - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Factor:", lx,(cy-=19),buttonWidth,19, &smd->factor[0], -3000.0f, 3000.0f, 1.0f, 0, "Deform Factor"); + uiDefButF(block, NUM, B_MODIFIER_RECALC, "Factor:", lx,(cy-=19),buttonWidth,19, &smd->factor, -10.0f, 10.0f, 0.5f, 0, "Deform Factor"); - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Upper Limit:", lx,(cy-=19),buttonWidth,19, &smd->factor[2], -3000.0f, 3000.0f, 1.0f, 0, "Upper Limit Bend on X"); - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Lower Limit:", lx,(cy-=19),buttonWidth,19, &smd->factor[1], -3000.0f, 3000.0f, 1.0f, 0, "Lower Limit Bend on X"); + uiDefButF(block, NUM, B_MODIFIER_RECALC, "Upper Limit:", lx,(cy-=19),buttonWidth,19, &smd->limit[1], -1000.0f, 1000.0f, 5.0f, 0, "Upper Limit Bend on X"); + uiDefButF(block, NUM, B_MODIFIER_RECALC, "Lower Limit:", lx,(cy-=19),buttonWidth,19, &smd->limit[0], -1000.0f, 1000.0f, 5.0f, 0, "Lower Limit Bend on X"); + + if(smd->mode == MOD_SIMPLEDEFORM_MODE_STRETCH + || smd->mode == MOD_SIMPLEDEFORM_MODE_TAPER ) + { + uiDefButBitC(block, TOG, MOD_SIMPLEDEFORM_LOCK_AXIS_X, B_MODIFIER_RECALC, "Loc X", lx, (cy-=19),buttonWidth/2,19, &smd->axis, 0, 0, 0, 0, "Disallow changes on the X coordinate"); + uiDefButBitC(block, TOG, MOD_SIMPLEDEFORM_LOCK_AXIS_Y, B_MODIFIER_RECALC, "Loc Y", lx+(buttonWidth/2), (cy),buttonWidth/2,19, &smd->axis, 0, 0, 0, 0, "Disallow changes on the Y coordinate"); + } } From a0f39107fdf9de8b0a21702d64301a06fab20713 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Mon, 4 Aug 2008 14:27:25 +0000 Subject: [PATCH 56/76] Made shrinkwrap variables be initialized when declared --- source/blender/blenkernel/BKE_shrinkwrap.h | 5 +++++ source/blender/blenkernel/intern/shrinkwrap.c | 19 ++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h index 1b07ce50741..6e154536072 100644 --- a/source/blender/blenkernel/BKE_shrinkwrap.h +++ b/source/blender/blenkernel/BKE_shrinkwrap.h @@ -136,6 +136,11 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *data); struct DerivedMesh *shrinkwrapModifier_do(struct ShrinkwrapModifierData *smd, struct Object *ob, struct DerivedMesh *dm, int useRenderParams, int isFinalCalc); void shrinkwrapModifier_deform(struct ShrinkwrapModifierData *smd, struct Object *ob, struct DerivedMesh *dm, float (*vertexCos)[3], int numVerts); +#define NULL_ShrinkwrapCalcData {NULL, } +#define NULL_BVHTreeFromMesh {NULL, } +#define NULL_BVHTreeRayHit {NULL, } +#define NULL_BVHTreeNearest {NULL, } + #endif diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 481d5f680db..f53c7c30390 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -973,8 +973,7 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedMesh *dm, float (*vertexCos)[3], int numVerts) { - ShrinkwrapCalcData calc; - memset(&calc, 0, sizeof(calc)); + ShrinkwrapCalcData calc = NULL_ShrinkwrapCalcData; //Init Shrinkwrap calc data calc.smd = smd; @@ -1050,8 +1049,8 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); float *co; - BVHTreeFromMesh treeData; - BVHTreeNearest nearest; + BVHTreeFromMesh treeData = NULL_BVHTreeFromMesh; + BVHTreeNearest nearest = NULL_BVHTreeNearest; MDeformVert *dvert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MDEFORMVERT) : NULL; @@ -1109,6 +1108,8 @@ int normal_projection_project_vertex(char options, const float *vert, const floa float tmp_co[3], tmp_no[3]; const float *co, *no; BVHTreeRayHit hit_tmp; + + //Copy from hit (we need to convert hit rays from one space coordinates to the other memcpy( &hit_tmp, hit, sizeof(hit_tmp) ); //Apply space transform (TODO readjust dist) @@ -1167,12 +1168,12 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) float *co; //setup raytracing - BVHTreeFromMesh treeData; - BVHTreeRayHit hit; + BVHTreeFromMesh treeData = NULL_BVHTreeFromMesh; + BVHTreeRayHit hit = NULL_BVHTreeRayHit; //cutTree DerivedMesh * limit_mesh = NULL; - BVHTreeFromMesh limitData; + BVHTreeFromMesh limitData= NULL_BVHTreeFromMesh; SpaceTransform local2cut; MVert *vert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MVERT) : NULL; //Needed because of vertex normal @@ -1276,8 +1277,8 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); float *co; - BVHTreeFromMesh treeData; - BVHTreeNearest nearest; + BVHTreeFromMesh treeData = NULL_BVHTreeFromMesh; + BVHTreeNearest nearest = NULL_BVHTreeNearest; MDeformVert *dvert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MDEFORMVERT) : NULL; From 0008b1d424647f7f174fa94c6309a7a4a00fb486 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Mon, 4 Aug 2008 20:30:57 +0000 Subject: [PATCH 57/76] Shrink BVHNode by 16bits --- source/blender/blenlib/intern/BLI_kdopbvh.c | 38 ++++++--------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index a65d2ca6ea0..96eb42136fb 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -45,12 +45,10 @@ typedef struct BVHNode { - struct BVHNode **children; // max 8 children - struct BVHNode *parent; // needed for bottom - top update - float *bv; // Bounding volume of all nodes, max 13 axis - int index; /* face, edge, vertex index */ - char totnode; // how many nodes are used, used for speedup - char traversed; // how many nodes already traversed until this level? + struct BVHNode **children; // max 8 children + float *bv; // Bounding volume of all nodes, max 13 axis + int index; // face, edge, vertex index + char totnode; // how many nodes are used, used for speedup char main_axis; } BVHNode; @@ -554,13 +552,10 @@ static void bvh_div_nodes(BVHTree *tree, BVHNode *node, int start, int end, int if(tend-start == 1) // ok, we have 1 left for this node { node->children[i] = tree->nodes[start]; - node->children[i]->parent = node; } else { BVHNode *tnode = node->children[i] = tree->nodes[free_node_index] = &(tree->nodearray[free_node_index]); -// printf("Used %d (%d)\n", free_node_index, tend-start); - tnode->parent = node; if(tend != end) partition_nth_element(tree->nodes, start, end, tend, laxis); @@ -608,7 +603,6 @@ static void omp_bvh_div_nodes(BVHTree *tree, BVHNode *node, int start, int end, if(tend-start == 1) { node->children[i] = tree->nodes[start]; - node->children[i]->parent = node; } else { @@ -905,23 +899,13 @@ int BLI_bvhtree_update_node(BVHTree *tree, int index, float *co, float *co_movin // call BLI_bvhtree_update_node() first for every node/point/triangle void BLI_bvhtree_update_tree(BVHTree *tree) { - BVHNode *leaf, *parent; - - // reset tree traversing flag - for (leaf = tree->nodearray + tree->totleaf; leaf != tree->nodearray + tree->totleaf + tree->totbranch; leaf++) - leaf->traversed = 0; - - for (leaf = tree->nodearray; leaf != tree->nodearray + tree->totleaf; leaf++) - { - for (parent = leaf->parent; parent; parent = parent->parent) - { - parent->traversed++; // we tried to go up in hierarchy - if (parent->traversed < parent->totnode) - break; // we do not need to check further - else - node_join(tree, parent); - } - } + BVHNode** root = tree->nodes + tree->totleaf; + BVHNode** index = tree->nodes + tree->totleaf + tree->totbranch-1; + + //Update bottom=>top + //TRICKY: the way we build the tree the parent of a child has an index < then the child index + for (; index != root; index--) + node_join(tree, *index); } float BLI_bvhtree_getepsilon(BVHTree *tree) From 2d04b641d4eb6d6e20a72067c1f55f2d4a6cdd9a Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Tue, 5 Aug 2008 18:49:51 +0000 Subject: [PATCH 58/76] Just a tmp commit about bvhtree build Theres something broken with BVHtree queries.. updates are not advised at all --- source/blender/blenlib/intern/BLI_kdopbvh.c | 139 +++++++++++++++++++- 1 file changed, 138 insertions(+), 1 deletion(-) diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index 96eb42136fb..9b36051e59f 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -680,10 +680,146 @@ static void verify_tree(BVHTree *tree) printf("branches: %d, leafs: %d, total: %d\n", tree->totbranch, tree->totleaf, tree->totbranch + tree->totleaf); } #endif - + +//Helper data and structures to build generalized implicit trees +//This code can be easily reduced +typedef struct BVHBuildHelper +{ + int tree_type; // + int totleafs; // + + int leafs_per_child [32]; //Min number of leafs that are archievable from a node at depth N + int branches_on_level[32]; //Number of nodes at depth N (tree_type^N) + + int remain_leafs; //Number of leafs that are placed on the level that is not 100% filled + +} BVHBuildHelper; + +static void build_implicit_tree_helper(BVHTree *tree, BVHBuildHelper *data) +{ + int depth = 0; + int remain; + int nnodes; + + data->totleafs = tree->totleaf; + data->tree_type= tree->tree_type; + + //Calculate the smallest tree_type^n such that tree_type^n >= num_leafs + for( + data->leafs_per_child[0] = 1; + data->leafs_per_child[0] < data->totleafs; + data->leafs_per_child[0] *= data->tree_type + ); + + + data->branches_on_level[0] = 1; + + + //We could stop the loop first (but I am lazy to find out when) + for(depth = 1; depth < 32; depth++) + { + data->branches_on_level[depth] = data->branches_on_level[depth-1] * data->tree_type; + data->leafs_per_child [depth] = data->leafs_per_child [depth-1] / data->tree_type; + } + + remain = data->totleafs - data->leafs_per_child[1]; + nnodes = (remain + data->tree_type - 2) / (data->tree_type - 1); + data->remain_leafs = remain + nnodes; +} + +// return the min index of all the leafs archivable with the given branch +static int implicit_leafs_index(BVHBuildHelper *data, int depth, int child_index) +{ + int min_leaf_index = child_index * data->leafs_per_child[depth-1]; + if(min_leaf_index < data->remain_leafs) + return min_leaf_index; + else + return data->totleafs - (data->branches_on_level[depth-1] - child_index) * data->leafs_per_child[depth]; +} + +//WARNING: Beautifull/tricky code starts here :P +//Generalized implicit trees +static void non_recursive_bvh_div_nodes(BVHTree *tree) +{ + int i; + + const int tree_type = tree->tree_type; + const int tree_offset = 2 - tree->tree_type; //this value is 0 (on binary trees) and negative on the others + const int num_leafs = tree->totleaf; + const int num_branches= MAX2(1, (num_leafs + tree_type - 3) / (tree_type-1) ); + + BVHNode* branches_array = tree->nodearray + tree->totleaf - 1; // This ocde uses 1 index arrays + BVHNode** leafs_array = tree->nodes; + + BVHBuildHelper data; + int depth = 0; + + build_implicit_tree_helper(tree, &data); + + //YAY this could be 1 loop.. but had to split in 2 to remove OMP dependencies + for(i=1; i <= num_branches; i = i*tree_type + tree_offset) + { + const int first_of_next_level = i*tree_type + tree_offset; + const int end_j = MIN2(first_of_next_level, num_branches + 1); //index of last branch on this level + int j; + + depth++; + +//#pragma omp parallel for private(j) schedule(static) + for(j = i; j < end_j; j++) + { + int k; + const int parent_level_index= j-i; + BVHNode* parent = branches_array + j; + char split_axis; + + int parent_leafs_begin = implicit_leafs_index(&data, depth, parent_level_index); + int parent_leafs_end = implicit_leafs_index(&data, depth, parent_level_index+1); + + refit_kdop_hull(tree, parent, parent_leafs_begin, parent_leafs_end); + split_axis = get_largest_axis(parent->bv); + parent->main_axis = split_axis / 2; + + for(k = 0; k < tree_type; k++) + { + int child_index = j * tree_type + tree_offset + k; + int child_level_index = child_index - first_of_next_level; //child level index + + int child_leafs_begin = implicit_leafs_index(&data, depth+1, child_level_index); + int child_leafs_end = implicit_leafs_index(&data, depth+1, child_level_index+1); + + assert( k != 0 || child_leafs_begin == parent_leafs_begin); + + if(child_leafs_end - child_leafs_begin > 1) + { + parent->children[k] = branches_array + child_index; + partition_nth_element(leafs_array, child_leafs_begin, parent_leafs_end, child_leafs_end, split_axis); + } + else if(child_leafs_end - child_leafs_begin == 1) + { + parent->children[k] = leafs_array[ child_leafs_begin ]; + } + else + { + parent->children[k] = NULL; + } + } + } + } + tree->nodes[tree->totleaf] = branches_array+0; + tree->totbranch = num_branches; + + +} + void BLI_bvhtree_balance(BVHTree *tree) { assert(tree->totbranch == 0); + assert(tree->totleaf != 0); + + non_recursive_bvh_div_nodes(tree); + printf("here\n"); +/* if(tree->totleaf != 0) { // create root node @@ -698,6 +834,7 @@ void BLI_bvhtree_balance(BVHTree *tree) tree->totbranch = needed_branches( tree->tree_type, tree->totleaf ); // verify_tree(tree); } +*/ } // overlap - is it possbile for 2 bv's to collide ? From e57c5ef56c306fe495346525fb9d1f9bcf8cfd2b Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Wed, 6 Aug 2008 15:46:38 +0000 Subject: [PATCH 59/76] Fixed non_recursive BVHbuild with openmp CHanged the BENCH functions to use: gettimeofday (wall time) instead of clock (cpu time) This was to test if the openmp was working right. --- source/blender/blenkernel/BKE_deform.h | 4 +- source/blender/blenkernel/intern/deform.c | 6 +- source/blender/blenkernel/intern/shrinkwrap.c | 58 ++++++++++++---- source/blender/blenlib/intern/BLI_kdopbvh.c | 66 +++++++++++++++---- 4 files changed, 102 insertions(+), 32 deletions(-) diff --git a/source/blender/blenkernel/BKE_deform.h b/source/blender/blenkernel/BKE_deform.h index b0570e8bd45..73a9b2b5d4e 100644 --- a/source/blender/blenkernel/BKE_deform.h +++ b/source/blender/blenkernel/BKE_deform.h @@ -46,8 +46,8 @@ int get_defgroup_num (struct Object *ob, struct bDeformGroup *dg); int get_named_vertexgroup_num (Object *ob, char *name); void unique_vertexgroup_name (struct bDeformGroup *dg, struct Object *ob); -float deformvert_get_weight(struct MDeformVert *dvert, int group_num); -float vertexgroup_get_vertex_weight(struct MDeformVert *dvert, int index, int group_num); +float deformvert_get_weight(const struct MDeformVert *dvert, int group_num); +float vertexgroup_get_vertex_weight(const struct MDeformVert *dvert, int index, int group_num); #endif diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c index 888432005d0..3143c5e4df2 100644 --- a/source/blender/blenkernel/intern/deform.c +++ b/source/blender/blenkernel/intern/deform.c @@ -221,11 +221,11 @@ void unique_vertexgroup_name (bDeformGroup *dg, Object *ob) } } -float deformvert_get_weight(struct MDeformVert *dvert, int group_num) +float deformvert_get_weight(const struct MDeformVert *dvert, int group_num) { if(dvert) { - MDeformWeight *dw = dvert->dw; + const MDeformWeight *dw = dvert->dw; int i; for(i=dvert->totweight; i>0; i--, dw++) @@ -237,7 +237,7 @@ float deformvert_get_weight(struct MDeformVert *dvert, int group_num) return 0.0; } -float vertexgroup_get_vertex_weight(struct MDeformVert *dvert, int index, int group_num) +float vertexgroup_get_vertex_weight(const struct MDeformVert *dvert, int index, int group_num) { if(group_num == -1) return 1.0; diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index f53c7c30390..292bdbebcc6 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -62,6 +62,8 @@ /* Benchmark macros */ #if 1 + +#if 0 #define BENCH(a) \ do { \ clock_t _clock_init = clock(); \ @@ -75,6 +77,30 @@ #define BENCH_RESET(name) JOIN(_bench_total, name) = 0 #define BENCH_REPORT(name) printf("%s: %fms\n", TO_STR(name), JOIN(_bench_total,name)*1000.0f/CLOCKS_PER_SEC) +#else +#include + +#define BENCH(a) \ + do { \ + double _t1, _t2; \ + struct timeval _tstart, _tend; \ + gettimeofday ( &_tstart, NULL); \ + (a); \ + gettimeofday ( &_tend, NULL); \ + _t1 = ( double ) _tstart.tv_sec + ( double ) _tstart.tv_usec/ ( 1000*1000 ); \ + _t2 = ( double ) _tend.tv_sec + ( double ) _tend.tv_usec/ ( 1000*1000 ); \ + printf("%s: %fms\n", #a, _t2-_t1);\ + } while(0) + +#define BENCH_VAR(name) clock_t JOIN(_bench_step,name) = 0, JOIN(_bench_total,name) = 0 +#define BENCH_BEGIN(name) JOIN(_bench_step, name) = clock() +#define BENCH_END(name) JOIN(_bench_total,name) += clock() - JOIN(_bench_step,name) +#define BENCH_RESET(name) JOIN(_bench_total, name) = 0 +#define BENCH_REPORT(name) printf("%s: %fms\n", TO_STR(name), JOIN(_bench_total,name)*1000.0f/CLOCKS_PER_SEC) + + +#endif + #else #define BENCH(a) (a) @@ -1019,7 +1045,7 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedM switch(smd->shrinkType) { case MOD_SHRINKWRAP_NEAREST_SURFACE: - shrinkwrap_calc_nearest_surface_point(&calc); + BENCH(shrinkwrap_calc_nearest_surface_point(&calc)); break; case MOD_SHRINKWRAP_NORMAL: @@ -1027,7 +1053,7 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedM break; case MOD_SHRINKWRAP_NEAREST_VERTEX: - shrinkwrap_calc_nearest_vertex(&calc); + BENCH(shrinkwrap_calc_nearest_vertex(&calc)); break; } @@ -1047,7 +1073,6 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) { int i; int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); - float *co; BVHTreeFromMesh treeData = NULL_BVHTreeFromMesh; BVHTreeNearest nearest = NULL_BVHTreeNearest; @@ -1055,15 +1080,17 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) MDeformVert *dvert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MDEFORMVERT) : NULL; - bvhtree_from_mesh_verts(&treeData, calc->target, 0.0, 2, 6); + BENCH(bvhtree_from_mesh_verts(&treeData, calc->target, 0.0, 2, 6)); if(treeData.tree == NULL) return OUT_OF_MEMORY(); //Setup nearest nearest.index = -1; nearest.dist = FLT_MAX; - for(co = calc->vertexCos[i=0]; inumVerts; co = calc->vertexCos[++i]) +//#pragma omp parallel for private(i) private(nearest) schedule(static) + for(i = 0; inumVerts; ++i) { + float *co = calc->vertexCos[i]; int index; float tmp_co[3]; float weight = vertexgroup_get_vertex_weight(dvert, i, vgroup); @@ -1165,7 +1192,6 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) int i; int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); char use_normal = calc->smd->shrinkOpts; - float *co; //setup raytracing BVHTreeFromMesh treeData = NULL_BVHTreeFromMesh; @@ -1189,7 +1215,7 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) CDDM_calc_normals(calc->original); //Normals maybe arent yet calculated - bvhtree_from_mesh_faces(&treeData, calc->target, calc->keptDist, 4, 6); + BENCH(bvhtree_from_mesh_faces(&treeData, calc->target, calc->keptDist, 4, 6)); if(treeData.tree == NULL) return OUT_OF_MEMORY(); @@ -1200,13 +1226,15 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) //TODO currently we need a copy in case object_get_derived_final returns an emDM that does not defines getVertArray or getFace array limit_mesh = CDDM_copy( object_get_derived_final(calc->smd->cutPlane, CD_MASK_BAREMESH) ); if(limit_mesh) - bvhtree_from_mesh_faces(&limitData, limit_mesh, 0.0, 4, 6); + BENCH(bvhtree_from_mesh_faces(&limitData, limit_mesh, 0.0, 4, 6)); else printf("CutPlane finalDerived mesh is null\n"); } - for(co = calc->vertexCos[i=0]; inumVerts; co = calc->vertexCos[++i]) +//#pragma omp parallel for private(i) private(hit) schedule(static) + for(i = 0; inumVerts; ++i) { + float *co = calc->vertexCos[i]; float tmp_co[3], tmp_no[3]; float lim = 1000; //TODO: we should use FLT_MAX here, but sweepsphere code isnt prepared for that float weight = vertexgroup_get_vertex_weight(dvert, i, vgroup); @@ -1274,17 +1302,17 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) { int i; - int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); - float *co; + + const int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); + const MDeformVert *dvert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MDEFORMVERT) : NULL; BVHTreeFromMesh treeData = NULL_BVHTreeFromMesh; BVHTreeNearest nearest = NULL_BVHTreeNearest; - MDeformVert *dvert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MDEFORMVERT) : NULL; //Create a bvh-tree of the given target - bvhtree_from_mesh_faces( &treeData, calc->target, 0.0, 2, 6); + BENCH(bvhtree_from_mesh_faces( &treeData, calc->target, 0.0, 2, 6)); if(treeData.tree == NULL) return OUT_OF_MEMORY(); //Setup nearest @@ -1293,8 +1321,10 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) //Find the nearest vertex - for(co = calc->vertexCos[i=0]; inumVerts; co = calc->vertexCos[++i]) +//#pragma omp parallel for private(i) private(nearest) schedule(static) + for(i = 0; inumVerts; ++i) { + float *co = calc->vertexCos[i]; int index; float tmp_co[3]; float weight = vertexgroup_get_vertex_weight(dvert, i, vgroup); diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index 9b36051e59f..fcac5df934e 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -632,7 +632,22 @@ static void omp_bvh_div_nodes(BVHTree *tree, BVHNode *node, int start, int end, } +static void print_tree(BVHTree *tree, BVHNode *node, int depth) +{ + int i; + for(i=0; iindex, node - tree->nodearray); + for(i=2*tree->start_axis; i<2*tree->stop_axis; i++) + printf("%.3f ", node->bv[i]); + printf("\n"); + + for(i=0; itree_type; i++) + if(node->children[i]) + print_tree(tree, node->children[i], depth+1); +} + #if 0 + static void verify_tree(BVHTree *tree) { int i, j, check = 0; @@ -711,10 +726,8 @@ static void build_implicit_tree_helper(BVHTree *tree, BVHBuildHelper *data) data->leafs_per_child[0] *= data->tree_type ); - data->branches_on_level[0] = 1; - //We could stop the loop first (but I am lazy to find out when) for(depth = 1; depth < 32; depth++) { @@ -731,13 +744,15 @@ static void build_implicit_tree_helper(BVHTree *tree, BVHBuildHelper *data) static int implicit_leafs_index(BVHBuildHelper *data, int depth, int child_index) { int min_leaf_index = child_index * data->leafs_per_child[depth-1]; - if(min_leaf_index < data->remain_leafs) + if(min_leaf_index <= data->remain_leafs) return min_leaf_index; - else + else if(data->leafs_per_child[depth]) return data->totleafs - (data->branches_on_level[depth-1] - child_index) * data->leafs_per_child[depth]; + else + return data->remain_leafs; } -//WARNING: Beautifull/tricky code starts here :P +//WARNING: Beautiful/tricky code starts here :P //Generalized implicit trees static void non_recursive_bvh_div_nodes(BVHTree *tree) { @@ -748,7 +763,7 @@ static void non_recursive_bvh_div_nodes(BVHTree *tree) const int num_leafs = tree->totleaf; const int num_branches= MAX2(1, (num_leafs + tree_type - 3) / (tree_type-1) ); - BVHNode* branches_array = tree->nodearray + tree->totleaf - 1; // This ocde uses 1 index arrays + BVHNode* branches_array = tree->nodearray + tree->totleaf - 1; // This code uses 1 index arrays BVHNode** leafs_array = tree->nodes; BVHBuildHelper data; @@ -765,7 +780,7 @@ static void non_recursive_bvh_div_nodes(BVHTree *tree) depth++; -//#pragma omp parallel for private(j) schedule(static) +#pragma omp parallel for private(j) schedule(static) for(j = i; j < end_j; j++) { int k; @@ -776,8 +791,11 @@ static void non_recursive_bvh_div_nodes(BVHTree *tree) int parent_leafs_begin = implicit_leafs_index(&data, depth, parent_level_index); int parent_leafs_end = implicit_leafs_index(&data, depth, parent_level_index+1); + //split_axis = (depth*2 % 6); //use this instead of the 2 following lines for XYZ splitting + refit_kdop_hull(tree, parent, parent_leafs_begin, parent_leafs_end); split_axis = get_largest_axis(parent->bv); + parent->main_axis = split_axis / 2; for(k = 0; k < tree_type; k++) @@ -792,33 +810,55 @@ static void non_recursive_bvh_div_nodes(BVHTree *tree) if(child_leafs_end - child_leafs_begin > 1) { - parent->children[k] = branches_array + child_index; + parent->children[k] = branches_array + child_index; + +/* + printf("Add child %d (%d) to branch %d\n", + branches_array + child_index - tree->nodearray, + branches_array[ child_index ].index, + parent - tree->nodearray + ); +*/ + partition_nth_element(leafs_array, child_leafs_begin, parent_leafs_end, child_leafs_end, split_axis); } else if(child_leafs_end - child_leafs_begin == 1) { +/* + printf("Add child %d (%d) to branch %d\n", + leafs_array[ child_leafs_begin ] - tree->nodearray, + leafs_array[ child_leafs_begin ]->index, + parent - tree->nodearray + ); +*/ parent->children[k] = leafs_array[ child_leafs_begin ]; } else { parent->children[k] = NULL; + break; } + parent->totnode = k+1; } } } - tree->nodes[tree->totleaf] = branches_array+0; + + + for(i = 0; inodes[tree->totleaf + i] = branches_array + 1 + i; + tree->totbranch = num_branches; - +// BLI_bvhtree_update_tree(tree); //Uncoment this for XYZ splitting } void BLI_bvhtree_balance(BVHTree *tree) { - assert(tree->totbranch == 0); - assert(tree->totleaf != 0); + if(tree->totleaf == 0) return; + assert(tree->totbranch == 0); non_recursive_bvh_div_nodes(tree); - printf("here\n"); + /* if(tree->totleaf != 0) { From 523634ca17a392a49e324244ee6f35ac2359544b Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Wed, 6 Aug 2008 16:50:07 +0000 Subject: [PATCH 60/76] svn merge -r 15908:15988 https://svn.blender.org/svnroot/bf-blender/trunk/blender --- SConstruct | 9 +- intern/boolop/SConscript | 2 +- intern/boolop/intern/BOP_Interface.cpp | 2 +- intern/boolop/make/msvc_7_0/boolop.vcproj | 9 + intern/bsp/SConscript | 2 +- .../blender/BPY_python/BPY_python.vcproj | 108 +++ projectfiles_vc7/blender/blender.sln | 9 +- .../gameengine/ketsji/KX_ketsji.vcproj | 9 +- .../PHY_Physics/PHY_Sumo/PHY_Sumo.vcproj | 1 + release/scripts/import_dxf.py | 916 +++++++++++------- release/scripts/weightpaint_clean.py | 7 +- source/blender/blenkernel/BKE_texture.h | 1 + .../blenkernel/bad_level_call_stubs/stubs.c | 4 + source/blender/blenkernel/intern/collision.c | 221 ++--- source/blender/blenkernel/intern/customdata.c | 24 +- source/blender/blenkernel/intern/modifier.c | 39 +- source/blender/blenkernel/intern/particle.c | 3 + source/blender/blenkernel/intern/texture.c | 16 + source/blender/blenlib/intern/BLI_kdopbvh.c | 3 +- source/blender/blenlib/intern/boxpack2d.c | 10 +- source/blender/blenloader/intern/writefile.c | 2 +- source/blender/imbuf/intern/anim.c | 15 +- source/blender/include/BIF_editarmature.h | 7 +- source/blender/include/BIF_poseobject.h | 2 + source/blender/python/BPY_interface.c | 64 +- source/blender/python/api2_2x/Blender.c | 2 +- source/blender/python/api2_2x/Constraint.c | 29 +- source/blender/python/api2_2x/Material.c | 12 +- source/blender/python/api2_2x/Mathutils.c | 8 +- source/blender/python/api2_2x/Mathutils.h | 2 +- .../render/intern/source/convertblender.c | 14 +- source/blender/src/buttons_object.c | 3 +- source/blender/src/buttons_scene.c | 11 +- source/blender/src/drawgpencil.c | 330 +++++-- source/blender/src/drawseq.c | 24 +- source/blender/src/editarmature.c | 164 ++-- source/blender/src/editimasel.c | 6 + source/blender/src/editseq.c | 1 + source/blender/src/header_info.c | 53 +- source/blender/src/header_view3d.c | 81 +- source/blender/src/poseobject.c | 61 ++ source/blender/src/space.c | 17 +- source/blender/src/toolbox.c | 9 +- .../BlenderRoutines/BL_KetsjiEmbedStart.cpp | 3 +- source/gameengine/Converter/KX_IpoConvert.cpp | 9 +- .../GamePlayer/common/windows/GPW_Canvas.h | 2 +- .../GamePlayer/ghost/GPG_Application.cpp | 8 +- source/gameengine/Ketsji/KX_GameObject.cpp | 81 +- source/gameengine/Ketsji/KX_GameObject.h | 1 + source/gameengine/Ketsji/KX_PythonInit.cpp | 13 +- source/gameengine/Ketsji/KX_PythonInit.h | 1 + .../Ketsji/KX_TouchEventManager.cpp | 12 +- source/gameengine/Ketsji/SConscript | 16 +- .../Physics/Bullet/CcdPhysicsController.cpp | 5 +- .../Physics/Bullet/CcdPhysicsController.h | 9 +- .../Physics/Bullet/CcdPhysicsEnvironment.cpp | 22 +- .../Physics/Bullet/CcdPhysicsEnvironment.h | 5 +- source/gameengine/PyDoc/KX_GameObject.py | 10 + 58 files changed, 1678 insertions(+), 831 deletions(-) diff --git a/SConstruct b/SConstruct index 869ba6454c8..4c3bbf8fad7 100644 --- a/SConstruct +++ b/SConstruct @@ -184,15 +184,16 @@ if env['WITH_BF_OPENMP'] == 1: env['CPPFLAGS'].append('/openmp') env['CXXFLAGS'].append('/openmp') else: - if env['CC'] == 'icc': + if env['CC'][-3:] == 'icc': # to be able to handle CC=/opt/bla/icc case env.Append(LINKFLAGS=['-openmp', '-static-intel']) env['CCFLAGS'].append('-openmp') env['CPPFLAGS'].append('-openmp') env['CXXFLAGS'].append('-openmp') else: - env['CCFLAGS'].append('-fopenmp') - env['CPPFLAGS'].append('-fopenmp') - env['CXXFLAGS'].append('-fopenmp') + env.Append(CCFLAGS=['-fopenmp']) + env.Append(CPPFLAGS=['-fopenmp']) + env.Append(CXXFLAGS=['-fopenmp']) + # env.Append(LINKFLAGS=['-fprofile-generate']) #check for additional debug libnames diff --git a/intern/boolop/SConscript b/intern/boolop/SConscript index a3f3c0b6433..bec263f251f 100644 --- a/intern/boolop/SConscript +++ b/intern/boolop/SConscript @@ -8,7 +8,7 @@ incs += ' ../../source/blender/makesdna ../../intern/guardedalloc' incs += ' ../../source/blender/blenlib' if (env['OURPLATFORM'] == 'win32-mingw'): - env.BlenderLib ('blender_bop', sources, Split(incs) , [], libtype=['common','intern'], priority = [5,50] ) + env.BlenderLib ('blender_bop', sources, Split(incs) , [], libtype=['common','intern'], priority = [30,85] ) else: env.BlenderLib ('blender_bop', sources, Split(incs) , [], libtype='common', priority = 5 ) diff --git a/intern/boolop/intern/BOP_Interface.cpp b/intern/boolop/intern/BOP_Interface.cpp index 898ca708204..c6bcb4a74ce 100644 --- a/intern/boolop/intern/BOP_Interface.cpp +++ b/intern/boolop/intern/BOP_Interface.cpp @@ -37,7 +37,7 @@ #include "BOP_Chrono.h" #if defined(BOP_ORIG_MERGE) && defined(BOP_NEW_MERGE) -#include "../../source/blender/blenkernel/BKE_global.h" +#include "../../../source/blender/blenkernel/BKE_global.h" #endif BoolOpState BOP_intersectionBoolOp(BOP_Mesh* meshC, diff --git a/intern/boolop/make/msvc_7_0/boolop.vcproj b/intern/boolop/make/msvc_7_0/boolop.vcproj index 7ae417e42d5..6e6d6abeb43 100644 --- a/intern/boolop/make/msvc_7_0/boolop.vcproj +++ b/intern/boolop/make/msvc_7_0/boolop.vcproj @@ -278,6 +278,9 @@ ECHO Done + + @@ -330,9 +333,15 @@ ECHO Done + + + + diff --git a/intern/bsp/SConscript b/intern/bsp/SConscript index 88d2529ae59..39f278625a9 100644 --- a/intern/bsp/SConscript +++ b/intern/bsp/SConscript @@ -6,7 +6,7 @@ sources = env.Glob('intern/*.cpp') incs = 'intern ../container ../moto/include ../memutil' if (env['OURPLATFORM'] == 'win32-mingw'): - env.BlenderLib ('blender_BSP', sources, Split(incs), [], libtype=['common','intern'], priority=[26,26] ) + env.BlenderLib ('blender_BSP', sources, Split(incs), [], libtype=['common','intern'], priority=[26,69] ) else: env.BlenderLib ('blender_BSP', sources, Split(incs), [], libtype='core', priority=26 ) diff --git a/projectfiles_vc7/blender/BPY_python/BPY_python.vcproj b/projectfiles_vc7/blender/BPY_python/BPY_python.vcproj index a31b9130db3..97f70a26db4 100644 --- a/projectfiles_vc7/blender/BPY_python/BPY_python.vcproj +++ b/projectfiles_vc7/blender/BPY_python/BPY_python.vcproj @@ -118,6 +118,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/projectfiles_vc7/blender/blender.sln b/projectfiles_vc7/blender/blender.sln index 60c2d8f2d4c..1b069fa4677 100644 --- a/projectfiles_vc7/blender/blender.sln +++ b/projectfiles_vc7/blender/blender.sln @@ -152,6 +152,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GP_ghost", "..\gameengine\g {E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B} = {E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B} {727F90AC-ABE6-40BF-8937-C2F2F1D13DEA} = {727F90AC-ABE6-40BF-8937-C2F2F1D13DEA} {E90C7BC2-CF30-4A60-A8F2-0050D592E358} = {E90C7BC2-CF30-4A60-A8F2-0050D592E358} + {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA} = {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA} {32CC75E2-EE85-45E6-8E3D-513F58464F43} = {32CC75E2-EE85-45E6-8E3D-513F58464F43} {9A307EE5-CD77-47BC-BD87-62508C7E19D8} = {9A307EE5-CD77-47BC-BD87-62508C7E19D8} {AB590CED-F71F-4A17-A89B-18583ECD633D} = {AB590CED-F71F-4A17-A89B-18583ECD633D} @@ -248,6 +249,8 @@ Global Debug = Debug Release = Release EndGlobalSection + GlobalSection(ProjectDependencies) = postSolution + EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.3D Plugin Debug.ActiveCfg = Blender Debug|Win32 {F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.3D Plugin Release.ActiveCfg = Blender Release|Win32 @@ -387,8 +390,10 @@ Global {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.Blender Debug.Build.0 = Blender Debug|Win32 {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.Blender Release.ActiveCfg = Blender Release|Win32 {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.Blender Release.Build.0 = Blender Release|Win32 - {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.BlenderPlayer Debug.ActiveCfg = Blender Debug|Win32 - {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.BlenderPlayer Release.ActiveCfg = Blender Release|Win32 + {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.BlenderPlayer Debug.ActiveCfg = BlenderPlayer Debug|Win32 + {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.BlenderPlayer Debug.Build.0 = BlenderPlayer Debug|Win32 + {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.BlenderPlayer Release.ActiveCfg = BlenderPlayer Release|Win32 + {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.BlenderPlayer Release.Build.0 = BlenderPlayer Release|Win32 {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.Debug.ActiveCfg = Blender Debug|Win32 {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.Debug.Build.0 = Blender Debug|Win32 {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.Release.ActiveCfg = Blender Release|Win32 diff --git a/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj b/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj index 9d5a9f55074..c046d434cb3 100644 --- a/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj +++ b/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj @@ -126,7 +126,7 @@ r12 objects: ELLIPSE, -LWPOLYLINE (LightWeight Polylines), -(wip v1.0.12) SPLINE, -(wip v1.0.13) MLINE, -(wip v1.0.13) MTEXT +LWPOLYLINE (LightWeight Polyline), +SPLINE, +(wip v1.13) MLINE, +(wip v1.13) MTEXT Unsupported objects: DXF r12: DIMENSION. @@ -60,7 +60,7 @@ Supported layout modes: Supported scene definition objescts produced with AVE_RENDER: scene: selection of lights assigned to the camera, lights: DIRECT, OVERHEAD, SH_SPOT, -(wip v1.0.13 import of AVE_RENDER material definitions) +(wip v1.13 import of AVE_RENDER material definitions) Hierarchy: Entire DXF BLOCK hierarchy is preserved after import into Blender @@ -73,7 +73,7 @@ thickness, width, color, layer, -(wip v1.0.12: XDATA, grouped status) +(wip v1.13: XDATA, grouped status) It is recommended to use DXF-object properties for assign Blender materials. Notes: @@ -109,9 +109,22 @@ History: -- bug: Registry recall from hd_cache ?? only win32 bug?? -- support DXF-definitions of scene, lights and cameras -- support ortho mode for VIEWs and VPORTs as cameras - -- add support for SPLINEs - v1.0.12: 2008.06.05 by migius + + v1.12 - 2008.08.03 by migius + c2 warningfix: relocating of globals: layersmap, oblist + c2 modif UI: buttons newScene+targetLayer moved to start panel + v1.12 - 2008.07.04 by migius + c1 added control Curve's OrderU parameter + c1 modif UI: preset buttons X-2D-3D moved to start panel + b6 added handling exception of not registered LAYERs (Hammer-HL-editor DXF output) + b5 rebuild UI: global preset 2D for Curve-Import + b5 added UI-options: PL-MESH N+N plmesh_flip and normals_out + b5 added support for SPLINEs, added control OrderU parameter + b5 rewrote draw module for NURBS_curve and Bezier_curve + v1.12 - 2008.06.22 by migius + b4 change versioning system 1.0.12 -> 1.12 + b4 print at start version-info to console b3 bugfix: ob.name conflict with existing meshes (different ob.name/mesh.name) v1.0.12: 2008.05.24 by migius b2 added support for LWPOLYLINEs @@ -310,16 +323,16 @@ except ImportError: #print 'psyco not imported' pass -print '\n\n\n\n' -print 'DXF-Importer *** start ***' #--------------------- +#try: Curve.orderU + +print '\n\n\n' +print 'DXF-Importer v%s *** start ***' %(__version__) #--------------------- SCENE = None WORLDX = Mathutils.Vector((1,0,0)) WORLDY = Mathutils.Vector((1,1,0)) WORLDZ = Mathutils.Vector((0,0,1)) -oblist = [] #to be sure, it is an empty list - G_SCALE = 1.0 #(0.0001-1000) global scaling factor for all dxf data G_ORIGIN_X = 0.0 #global translation-vector (x,y,z) in DXF units G_ORIGIN_Y = 0.0 @@ -335,12 +348,15 @@ MIN_WIDTH = MIN_DIST * 10.0 #minimal width by forced width TRIM_LIMIT = 3.0 #limit for triming of polylines-wide-segments (values:0.0 - 5.0) ELEVATION = 0.0 #standard elevation = coordinate Z -TARGET_LAYER = 3 #target blender_layer -GROUP_BYLAYER = 0 #(0/1) all entities from same layer import into one blender-group -cur_COUNTER = 0 #counter for progress_bar -M_OBJ = False BYBLOCK = 0 BYLAYER = 256 +TARGET_LAYER = 3 #target blender_layer +GROUP_BYLAYER = 0 #(0/1) all entities from same layer import into one blender-group +LAYER_DEF_NAME = 'AAAA' #default layer name +LAYER_DEF_COLOR = 4 #default layer color +E_M = 0 +LAB = "*) parts under construction" +M_OBJ = 0 FILENAME_MAX = 180 #max length of path+file_name string (FILE_MAXDIR + FILE_MAXFILE) MAX_NAMELENGTH = 17 #max_effective_obnamelength in blender =21=17+(.001) @@ -366,27 +382,27 @@ class View: #----------------------------------------------------------------- self.type = obj.type self.name = obj.get_type(2)[0] - self.data = obj.data[:] +# self.data = obj.data[:] - self.centerX = getit(obj.data, 10, 0.0) #view center pointX (in DCS) - self.centerY = getit(obj.data, 20, 0.0) #view center pointY (in DCS) + self.centerX = getit(obj, 10, 0.0) #view center pointX (in DCS) + self.centerY = getit(obj, 20, 0.0) #view center pointY (in DCS) self.height = obj.get_type(40)[0] #view height (in DCS) self.width = obj.get_type(41)[0] #view width (in DCS) self.dir = [0,0,0] - self.dir[0] = getit(obj.data, 11, 0.0) #view directionX from target (in WCS) - self.dir[1] = getit(obj.data, 21, 0.0) # - self.dir[2] = getit(obj.data, 31, 0.0) # + self.dir[0] = getit(obj, 11, 0.0) #view directionX from target (in WCS) + self.dir[1] = getit(obj, 21, 0.0) # + self.dir[2] = getit(obj, 31, 0.0) # self.target = [0,0,0] - self.target[0] = getit(obj.data, 12, 0.0) #target pointX(in WCS) - self.target[1] = getit(obj.data, 22, 0.0) # - self.target[2] = getit(obj.data, 32, 0.0) # + self.target[0] = getit(obj, 12, 0.0) #target pointX(in WCS) + self.target[1] = getit(obj, 22, 0.0) # + self.target[2] = getit(obj, 32, 0.0) # self.length = obj.get_type(42)[0] #Lens length - self.clip_front = getit(obj.data, 43) #Front clipping plane (offset from target point) - self.clip_back = getit(obj.data, 44) #Back clipping plane (offset from target point) + self.clip_front = getit(obj, 43) #Front clipping plane (offset from target point) + self.clip_back = getit(obj, 44) #Back clipping plane (offset from target point) self.twist = obj.get_type(50)[0] #view twist angle in degrees self.flags = getit(obj, 70, 0) @@ -450,28 +466,28 @@ class Vport: #----------------------------------------------------------------- self.type = obj.type self.name = obj.get_type(2)[0] - self.data = obj.data[:] +# self.data = obj.data[:] #print 'deb:vport name, data:', self.name #------- #print 'deb:vport data:', self.data #------- self.height = obj.get_type(40)[0] #vport height (in DCS) - self.centerX = getit(obj.data, 12, 0.0) #vport center pointX (in DCS) - self.centerY = getit(obj.data, 22, 0.0) #vport center pointY (in DCS) + self.centerX = getit(obj, 12, 0.0) #vport center pointX (in DCS) + self.centerY = getit(obj, 22, 0.0) #vport center pointY (in DCS) self.width = self.height * obj.get_type(41)[0] #vport aspect ratio - width (in DCS) self.dir = [0,0,0] - self.dir[0] = getit(obj.data, 16, 0.0) #vport directionX from target (in WCS) - self.dir[1] = getit(obj.data, 26, 0.0) # - self.dir[2] = getit(obj.data, 36, 0.0) # + self.dir[0] = getit(obj, 16, 0.0) #vport directionX from target (in WCS) + self.dir[1] = getit(obj, 26, 0.0) # + self.dir[2] = getit(obj, 36, 0.0) # self.target = [0,0,0] - self.target[0] = getit(obj.data, 17, 0.0) #target pointX(in WCS) - self.target[1] = getit(obj.data, 27, 0.0) # - self.target[2] = getit(obj.data, 37, 0.0) # + self.target[0] = getit(obj, 17, 0.0) #target pointX(in WCS) + self.target[1] = getit(obj, 27, 0.0) # + self.target[2] = getit(obj, 37, 0.0) # self.length = obj.get_type(42)[0] #Lens length - self.clip_front = getit(obj.data, 43) #Front clipping plane (offset from target point) - self.clip_back = getit(obj.data, 44) #Back clipping plane (offset from target point) + self.clip_front = getit(obj, 43) #Front clipping plane (offset from target point) + self.clip_back = getit(obj, 44) #Back clipping plane (offset from target point) self.twist = obj.get_type(51)[0] #view twist angle self.flags = getit(obj, 70, 0) @@ -528,29 +544,36 @@ class Layer: #----------------------------------------------------------------- """Class for objects representing dxf LAYERs. """ def __init__(self, obj, name=None, color=None, frozen=None): - """Expects an object of type layer as input. + """Expects an dxfobject of type layer as input. + if no dxfobject - creates surogate layer with default parameters """ - self.type = obj.type - self.data = obj.data[:] - if name: - self.name = name - #self.bfname = name #--todo---see layernamesmap in f_getLayersmap --- - else: - self.name = obj.get_type(2)[0] #layer name of object - - if color: - self.color = color - else: - self.color = obj.get_type(62)[0] #color of object - - if frozen: - self.frozen = frozen - else: - self.flags = obj.get_type(70)[0] - self.frozen = self.flags & 1 + if obj==None: + self.type = 'layer' + if name: self.name = name + else: self.name = LAYER_DEF_NAME + if color: self.color = color + else: self.color = LAYER_DEF_COLOR + if frozen!=None: self.frozen = frozen + else: self.frozen = 0 + else: + if obj.type=='layer': + self.type = obj.type + #self.data = obj.data[:] + if name: self.name = name + #self.bfname = name #--todo---see layernamesmap in f_getLayersmap --- + else: self.name = obj.get_type(2)[0] #layer name of object + + if color: self.color = color + else: self.color = obj.get_type(62)[0] #color of object + + if frozen!=None: self.frozen = frozen + else: + self.flags = obj.get_type(70)[0] + self.frozen = self.flags & 1 + def __repr__(self): return "%s: name - %s, color - %s" %(self.__class__.__name__, self.name, self.color) @@ -615,15 +638,15 @@ class Solid: #----------------------------------------------------------------- raise TypeError, "Wrong type \'%s\' for solid/trace object!" %obj.type self.type = obj.type - self.data = obj.data[:] +# self.data = obj.data[:] self.space = getit(obj, 67, 0) self.thic = getit(obj, 39, 0) self.color_index = getit(obj, 62, BYLAYER) - self.layer = getit(obj.data, 8, None) - self.extrusion = get_extrusion(obj.data) - self.points = self.get_points(obj.data) + self.layer = getit(obj, 8, None) + self.extrusion = get_extrusion(obj) + self.points = self.get_points(obj) @@ -736,16 +759,16 @@ class Line: #----------------------------------------------------------------- if not obj.type == 'line': raise TypeError, "Wrong type \'%s\' for line object!" %obj.type self.type = obj.type - self.data = obj.data[:] +# self.data = obj.data[:] self.space = getit(obj, 67, 0) self.thic = getit(obj, 39, 0) #print 'deb:self.thic: ', self.thic #--------------------- self.color_index = getit(obj, 62, BYLAYER) - self.layer = getit(obj.data, 8, None) - self.extrusion = get_extrusion(obj.data) - self.points = self.get_points(obj.data) + self.layer = getit(obj, 8, None) + self.extrusion = get_extrusion(obj) + self.points = self.get_points(obj) def get_points(self, data): @@ -883,16 +906,16 @@ class Point: #----------------------------------------------------------------- if not obj.type == 'point': raise TypeError, "Wrong type %s for point object!" %obj.type self.type = obj.type - self.data = obj.data[:] +# self.data = obj.data[:] self.space = getit(obj, 67, 0) self.thic = getit(obj, 39, 0) #print 'deb:self.thic: ', self.thic #--------------------- self.color_index = getit(obj, 62, BYLAYER) - self.layer = getit(obj.data, 8, None) - self.extrusion = get_extrusion(obj.data) - self.points = self.get_points(obj.data) + self.layer = getit(obj, 8, None) + self.extrusion = get_extrusion(obj) + self.points = self.get_points(obj) def get_points(self, data): @@ -922,7 +945,7 @@ class Point: #----------------------------------------------------------------- thic = settings.var['thick_min'] if thic < settings.var['dist_min']: thic = settings.var['dist_min'] - if True: #--todo-- points_as in [1,3,4,5]: + if points_as in [1,3,4,5]: if True: # points_as in [1,5]: # as 'empty' c = 'Empty' elif points_as == 3: # as 'thin sphere' @@ -969,11 +992,8 @@ class Polyline: #-------------------------------------------------------------- if not obj.type == 'polyline': raise TypeError, "Wrong type %s for polyline object!" %obj.type self.type = obj.type - self.data = obj.data[:] - #print 'deb:polyline.obj.data[:]:\n', obj.data[:] #------------------------ - self.points = [] +# self.data = obj.data[:] - # optional data (with defaults) self.space = getit(obj, 67, 0) self.elevation = getit(obj, 30, 0) #print 'deb:elevation: ', self.elevation #--------------- @@ -983,7 +1003,7 @@ class Polyline: #-------------------------------------------------------------- self.flags = getit(obj, 70, 0) self.closed = self.flags & 1 # closed in the M direction self.curved = self.flags & 2 # Bezier-curve-fit vertices have been added - self.spline = self.flags & 4 # Bspline-fit vertices have been added + self.spline = self.flags & 4 # NURBS-curve-fit vertices have been added self.poly3d = self.flags & 8 # 3D-polyline self.plmesh = self.flags & 16 # 3D-polygon mesh self.closeN = self.flags & 32 # closed in the N direction @@ -1002,18 +1022,18 @@ class Polyline: #-------------------------------------------------------------- self.vectorsN = getit(obj, 72, None) # PolyMesh: expansion in M-direction / PolyFace: number of faces #self.resolM = getit(obj, 73, None) # resolution of surface in M direction #self.resolN = getit(obj, 74, None) # resolution of surface in N direction - self.curvetyp = getit(obj, 75, 0) # type of curve/surface: 0=None/5=Quadric/6=Cubic/8=Bezier - self.curvNormal = False - self.curvQBspline = False - self.curvCBspline = False + self.curvNoFitted = False + self.curvQuadrati = False + self.curvCubicBsp = False self.curvBezier = False - if self.curvetyp == 0: self.curvNormal = True - elif self.curvetyp == 5: self.curvQBspline = True - elif self.curvetyp == 6: self.curvCBspline = True - elif self.curvetyp == 8: self.curvBezier = True + curvetype = getit(obj, 75, 0) # type of curve/surface: 0=None/5=Quadric/6=Cubic/8=Bezier + if curvetype == 0: self.curvNoFitted = True + elif curvetype == 5: self.curvQuadrati = True + elif curvetype == 6: self.curvCubicBsp = True + elif curvetype == 8: self.curvBezier = True - self.layer = getit(obj.data, 8, None) - self.extrusion = get_extrusion(obj.data) + self.layer = getit(obj, 8, None) + self.extrusion = get_extrusion(obj) self.points = [] #list with vertices coordinats self.faces = [] #list with vertices assigment to faces @@ -1026,9 +1046,65 @@ class Polyline: #-------------------------------------------------------------- + def doubles_out(self, settings, d_points): + """routine to sort out of double.vertices----------------------------- + """ + minimal_dist = settings.var['dist_min'] * 0.1 + dv_count = 0 + temp_points = [] + for i in xrange(len(d_points)-1): + point = d_points[i] + point2 = d_points[i+1] + #print 'deb:double.vertex p1,p2', point, point2 #------------------------ + delta = Mathutils.Vector(point2.loc) - Mathutils.Vector(point.loc) + if delta.length > minimal_dist: + temp_points.append(point) + else: + dv_count+=1 + #print 'deb:drawPoly2d double.vertex sort out! count=', dv_count #------------------------ + temp_points.append(d_points[-1]) #------ incl. last vertex ------------- + #if self.closed: temp_points.append(d_points[1]) #------ loop start vertex ------------- + d_points = temp_points #-----vertex.list without "double.vertices" + #print 'deb:drawPoly2d d_pointsList =after DV-outsorting=====:\n ', d_points #------------------------ + return d_points + + + def tribles_out(self, settings, d_points): + """routine to sort out of three_in_place.vertices----------------------------- + """ + minimal_dist = settings.var['dist_min'] * 0.1 + dv_count = 0 + temp_points = [] + for i in xrange(len(d_points)-2): + point1 = d_points[i] + point2 = d_points[i+1] + point3 = d_points[i+2] + #print 'deb:double.vertex p1,p2', point, point2 #------------------------ + delta12 = Mathutils.Vector(point2.loc) - Mathutils.Vector(point1.loc) + delta23 = Mathutils.Vector(point3.loc) - Mathutils.Vector(point2.loc) + if delta12.length < minimal_dist and delta23.length < minimal_dist: + dv_count+=1 + else: + temp_points.append(point1) + #print 'deb:drawPoly2d double.vertex sort out! count=', dv_count #------------------------ + point1 = d_points[-2] + point2 = d_points[-1] + delta12 = Mathutils.Vector(point2.loc) - Mathutils.Vector(point1.loc) + if delta12.length > minimal_dist: + temp_points.append(d_points[-2]) #------ incl. 2last vertex ------------- + temp_points.append(d_points[-1]) #------ incl. 1last vertex ------------- + #if self.closed: temp_points.append(d_points[1]) #------ loop start vertex ------------- + d_points = temp_points #-----vertex.list without "double.vertices" + #print 'deb:drawPoly2d d_pointsList =after DV-outsorting=====:\n ', d_points #------------------------ + return d_points + + def draw(self, settings): #-------------%%%% DRAW POLYLINE %%%--------------- """for POLYLINE: generate Blender_geometry. """ + #print 'deb:drawPOLYLINE.START:----------------' #------------------------ + #print 'deb:POLYLINEdraw self.pltype:', self.pltype #------------------------ + #print 'deb:POLYLINEdraw self.points:\n', self.points #------------------------ ob = [] #---- 3dPolyFace - mesh with free topology if self.pltype=='plface' and settings.drawTypes['plmesh']: @@ -1036,22 +1112,30 @@ class Polyline: #-------------------------------------------------------------- #---- 3dPolyMesh - mesh with ortogonal topology elif self.pltype=='plmesh' and settings.drawTypes['plmesh']: ob = self.drawPlMesh(settings) + #---- 2dPolyline - plane polyline with arc/wide/thic segments elif self.pltype=='poly2d' and settings.drawTypes['polyline']: - if settings.var['plines_as'] == 5: # and self.spline: + if settings.var['plines_as'] in [5,6]: # and self.spline: ob = self.drawPolyCurve(settings) else: ob = self.drawPoly2d(settings) + #---- 3dPolyline - non-plane polyline (thin segments = without arc/wide/thic) elif self.pltype=='poly3d' and settings.drawTypes['pline3']: - if settings.var['plines3_as'] == 5: # and self.spline: + if settings.var['plines3_as'] in [5,6]: # and self.spline: + ob = self.drawPolyCurve(settings) + else: + ob = self.drawPoly2d(settings) + + #---- Spline - curved polyline (thin segments = without arc/wide/thic) + elif self.pltype=='spline' and settings.drawTypes['spline']: + if settings.var['splines_as'] in [5,6]: ob = self.drawPolyCurve(settings) else: ob = self.drawPoly2d(settings) return ob - def drawPlFace(self, settings): #---- 3dPolyFace - mesh with free topology """Generate the geometery of polyface. """ @@ -1065,6 +1149,10 @@ class Polyline: #-------------------------------------------------------------- else: points.append(point.loc) + if settings.var['plmesh_flip']: # ---------------------- + for face in faces: + face.reverse() + face = [face[-1]] + face[:-1] #print 'deb:drawPlFace: len of points_list:\n', len(points) #----------------------- #print 'deb:drawPlFace: len of faces_list:\n', len(faces) #----------------------- @@ -1076,6 +1164,10 @@ class Polyline: #-------------------------------------------------------------- ob = SCENE.objects.new(me) # create a new mesh_object me.verts.extend(points) # add vertices to mesh me.faces.extend(faces) # add faces to the mesh + if settings.var['normals_out']: # ---------------------- + #me.flipNormals() + me.recalcNormals(0) + #me.update() #print 'deb:drawPlFace: len of me.faces:\n', len(me.faces) #----------------------- if settings.var['meshSmooth_on']: # ---------------------- @@ -1123,7 +1215,10 @@ class Polyline: #-------------------------------------------------------------- ob = SCENE.objects.new(me) # create a new mesh_object me.verts.extend([point.loc for point in self.points]) # add vertices to mesh me.faces.extend(faces) # add faces to the mesh - + if settings.var['normals_out']: # ---------------------- + #me.flipNormals() + me.recalcNormals(0) + #me.update() if settings.var['meshSmooth_on']: # ---------------------- for i in xrange(len(faces)): me.faces[i].smooth = True @@ -1142,9 +1237,9 @@ class Polyline: #-------------------------------------------------------------- #print 'deb:drawPoly2d exit, cause POLYLINE has less than 2 vertices' #--------- return - if self.spline: pline_typ = 'ps' # Polyline-nurbSpline - elif self.curved: pline_typ = 'pc' # Polyline-bezierCurve - else: pline_typ = 'pl' # Polyline + if self.spline: pline_typ = 'ps' # Polyline-NURBSpline + elif self.curved: pline_typ = 'pc' # Polyline-BezierCurve + else: pline_typ = 'pl' # Polyline classic obname = '%s_%s' %(pline_typ, self.layer) # create object_name from layer name obname = obname[:MAX_NAMELENGTH] d_points = [] @@ -1160,6 +1255,10 @@ class Polyline: #-------------------------------------------------------------- point.loc[2] = self.elevation d_points.append(point) + #d_points = self.tribles_out(settings, d_points) + #d_points = self.doubles_out(settings, d_points) + #print 'deb:drawPolyCurve d_pointsList =after DV-outsorting=====:\n ', d_points #------------------------ + thic = set_thick(self.thic, settings) if thic != 0.0: #hack: Blender<2.45 curve-extrusion LocZ = d_points[0].loc[2] @@ -1173,12 +1272,14 @@ class Polyline: #-------------------------------------------------------------- pline = Curve.New(obname) # create new curve data #pline.setResolu(24) #--todo----- - if self.spline: # NURBSplines-----OK----- + if False: #old self.spline: # NURBSplines-----OK----- #print 'deb:polyline2dCurve.draw self.spline!' #--------------- weight1 = 0.5 weight2 = 1.0 - # generate middlepoints except start/end-segments --- - if self.curvQBspline: + if self.curvQuadrati: + # Bezier-curve form simulated in NURBS-curve + # generate middlepoints except start/end-segments --- + #print 'deb:polyline2dCurve.draw extraQBspline!' #--------------- temp_points = [] point = d_points[0].loc point.append(weight1) @@ -1231,7 +1332,27 @@ class Polyline: #-------------------------------------------------------------- else: curve.flagU = 0 # Set curve not cyclic=open - elif self.curved: #--Bezier-curves---OK------- + if self.spline: # NURBSplines-----OK----- + #print 'deb:polyline2dCurve.draw self.spline!' #--------------- + nurbs_points = [] + for d in d_points: + pkt = d.loc + pkt.append(d.weight) + nurbs_points.append(pkt) + firstpoint = nurbs_points[0] + curve = pline.appendNurb(firstpoint) + curve.setType(4) # set curvetype NURBS + for point in nurbs_points[1:]: + curve.append(point) + if self.closed: + curve.flagU = 1+0 # Set curve cyclic=close and uni + else: + curve.flagU = 0+2 # Set curve not cyclic=open + try: curve.orderU = 5 # works only with >2.46svn080625 + except AttributeError: pass + #print 'deb: dir(curve):', dir(curve) #---------------- + + elif False: #orig self.curved: #--Bezier-curves---OK------- #print 'deb:polyline2dCurve.draw self.curved!' #--------------- curve = pline.appendNurb(BezTriple.New(d_points[0])) for p in d_points[1:]: @@ -1245,7 +1366,45 @@ class Polyline: #-------------------------------------------------------------- curve[0].handleTypes = [FREE, ALIGN] #remi--todo----- curve[-1].handleTypes = [ALIGN, FREE] #remi--todo----- - else: #--straight line- and arc-segments----OK------ + elif self.curved: #--SPLINE as Bezier-curves---wip------ + #print 'deb:polyline2dCurve.draw self.curved!' #--------------- + begtangent, endtangent = None, None + if d_points[0].tangent: + begtangent = d_points[0] + d_points = d_points[1:] + if d_points[-1].tangent: + endtangent = d_points[-1] + d_points = d_points[:-1] + curve = pline.appendNurb(BezTriple.New(d_points[0])) + for p in d_points[1:]: + curve.append(BezTriple.New(p)) + for point in curve: + point.handleTypes = [AUTO, AUTO] + #curve.setType(1) #Bezier curve + if self.closed: + curve.flagU = 5 #1 # Set curve cyclic=close + else: + curve.flagU = 4 #0 # Set curve not cyclic=open + if begtangent: + #print 'deb:polyline2dCurve.draw curve[0].vec:', curve[0].vec #----- + #print 'deb:polyline2dCurve.draw begtangent:', begtangent #----- + p0h1,p0,p0h2 = curve[0].vec + p0h1 = [p0h1[i]+begtangent[i] for i in range(3)] + curve.__setitem__(0,BezTriple.New(p0h1+p0+p0h2)) + curve[0].handleTypes = [FREE, ALIGN] #remi--todo----- + if endtangent: + #print 'deb:polyline2dCurve.draw curve[-1].vec:', curve[-1].vec #----- + #print 'deb:polyline2dCurve.draw endtangent:', endtangent #----- + p0h1,p0,p0h2 = curve[-1].vec + p0h2 = [p0h2[i]+endtangent[i] for i in range(3)] + #print 'deb:drawPlineCurve: p0h2:', p0h2 #---------- + curve.__setitem__(-1,BezTriple.New(p0h1+p0+p0h2)) + #print 'deb:polyline2dCurve.draw curve[-1].vec:', curve[-1].vec #----- + curve[-1].handleTypes = [ALIGN, FREE] #remi--todo----- + + + + else: #-- only straight line- and arc-segments----OK------ #print 'deb:polyline2dCurve.draw curve:', curve #----- points = [] arc_res = settings.var['curve_arc'] @@ -1403,8 +1562,10 @@ class Polyline: #-------------------------------------------------------------- #print 'deb:drawPoly2d len of d_pointsList ====== ', len(d_points) #------------------------ #print 'deb:drawPoly2d d_pointsList ======:\n ', d_points #------------------------ + d_points = self.doubles_out(settings, d_points) + #print 'deb:drawPolyCurve d_pointsList =after DV-outsorting=====:\n ', d_points #------------------------ - # routine to sort out of "double.vertices" ------------------------------------ + """# routine to sort out of "double.vertices" ------------------------------------ minimal_dist = settings.var['dist_min'] * 0.1 temp_points = [] for i in xrange(len(d_points)-1): @@ -1419,6 +1580,7 @@ class Polyline: #-------------------------------------------------------------- #if self.closed: temp_points.append(d_points[1]) #------ loop start vertex ------------- d_points = temp_points #-----vertex.list without "double.vertices" #print 'deb:drawPoly2d d_pointsList =after DV-outsorting=====:\n ', d_points #------------------------ + """ #print 'deb:drawPoly2d len of d_pointsList ====== ', len(d_points) #------------------------ if len(d_points) < 2: #if too few vertex, then return @@ -1836,12 +1998,16 @@ class Vertex(object): #-------------------------------------------------------- self.swidth = None #0 self.ewidth = None #0 self.bulge = 0 + self.tangent = False + self.weight = 1.0 if obj is not None: if not obj.type == 'vertex': raise TypeError, "Wrong type %s for vertex object!" %obj.type self.type = obj.type - self.data = obj.data[:] - self.get_props(obj.data) +# self.data = obj.data[:] + self.get_props(obj) + else: + pass #print 'deb:Vertex.init.END:----------------' #------------------------ @@ -1862,18 +2028,22 @@ class Vertex(object): #-------------------------------------------------------- self.flags = getit(data, 70, 0) # flags self.curved = self.flags&1 # Bezier-curve-fit:additional-vertex - self.curv_t = self.flags&2 # Bezier-curve-fit:tangent exists - self.spline = self.flags&8 # Bspline-fit:additional-vertex - self.splin2 = self.flags&16 # Bspline-fit:control-vertex + self.curved_t = self.flags&2 # Bezier-curve-fit:tangent exists + self.spline = self.flags&8 # NURBSpline-fit:additional-vertex + self.spline_c = self.flags&16 # NURBSpline-fit:control-vertex self.poly3d = self.flags&32 # polyline3d:control-vertex self.plmesh = self.flags&64 # polymesh3d:control-vertex self.plface = self.flags&128 # polyface # if PolyFace.Vertex with Face_definition - if self.curv_t: - self.curv_tangent = getit(data, 50, None) # curve_tangent + if self.curved_t: + self.curve_tangent = getit(data, 50, None) # curve_tangent + if not self.curve_tangent==None: + self.tangent = True + #elif self.spline_c: # NURBSpline:control-vertex + # self.weight = getit(data, 41, 1.0) # weight od control point - if self.plface and not self.plmesh: + elif self.plface and not self.plmesh: v1 = getit(data, 71, 0) # polyface:Face.vertex 1. v2 = getit(data, 72, 0) # polyface:Face.vertex 2. v3 = getit(data, 73, 0) # polyface:Face.vertex 3. @@ -1938,8 +2108,7 @@ class Vertex(object): #-------------------------------------------------------- class Spline(Polyline): #----------------------------------------------------------------- """Class for objects representing dxf SPLINEs. """ - def __init__(self, obj): - """Expects an entity object of type spline as input. + """Expects an entity object of type spline as input. 100 - Subclass marker (AcDbSpline) 210,220, 230 - Normal vector (omitted if the spline is nonplanar) X,Y,Z values of normal vector 70 - Spline flag (bit coded): @@ -1963,12 +2132,13 @@ class Spline(Polyline): #------------------------------------------------------ DXF: X value; APP: 3D point, Y and Z values of control points (in WCS) (one entry per control point) 11,21, 31 - Fit points (in WCS) one entry per fit point. X,Y,Z values of fit points (in WCS) (one entry per fit point) - """ + """ + def __init__(self, obj): #print 'deb:Spline.START:----------------' #------------------------ if not obj.type == 'spline': raise TypeError, "Wrong type %s for spline object!" %obj.type self.type = obj.type - self.data = obj.data[:] +# self.data = obj.data[:] # required data self.num_points = obj.get_type(73)[0] @@ -1992,30 +2162,42 @@ DXF: X value; APP: 3D point, Y and Z values of control points (in WCS) (one entr self.planar = self.flags & 8 # Planar self.linear = self.flags & 16 # Linear (and Planar) - self.degree = getit(obj, 71, 0) # Degree of the spline curve - self.curvNormal = False - self.curvQBspline = False - self.curvCBspline = False + self.curvNoFitted = False + self.curvQuadrati = False + self.curvCubicBsp = False self.curvBezier = False - if self.degree == 0: self.curvNormal = True - elif self.degree == 1: self.curvQBspline = True - elif self.degree == 2: self.curvCBspline = True + self.degree = getit(obj, 71, 0) # Degree of the spline curve + if self.degree == 0: self.curvNoFitted = True + elif self.degree == 1: self.curvQuadrati = True + elif self.degree == 2: self.curvCubicBsp = True #elif self.degree == 3: self.curvBezier = True - elif self.degree == 3: self.spline = True + #elif self.degree == 3: self.spline = True - self.num_knots = getit(obj, 72, 0) # Number of knots - self.num_contr = getit(obj, 73, 0) # Number of control points - self.num_fitpk = getit(obj, 74, 0) # Number of fit points (if any) + self.knotpk_len = getit(obj, 72, 0) # Number of knots + self.ctrlpk_len = getit(obj, 73, 0) # Number of control points + self.fit_pk_len = getit(obj, 74, 0) # Number of fit points (if any) - self.layer = getit(obj.data, 8, None) - self.extrusion = get_extrusion(obj.data) + #print 'deb:Spline self.fit_pk_len=', self.fit_pk_len #------------------------ + #self.fit_pk_len = 0 # temp for debug + if self.fit_pk_len and 'spline_as'==5: + self.spline = False + self.curved = True + else: + self.spline = True + self.curved = False + + self.knotpk_tol = getit(obj, 42, 0.0000001) # Knot tolerance (default = 0.0000001) + self.ctrlpk_tol = getit(obj, 43, 0.0000001) # Control-point tolerance (default = 0.0000001) + self.fit_pk_tol = getit(obj, 44, 0.0000000001) # Fit tolerance (default = 0.0000000001) + + self.layer = getit(obj, 8, None) + self.extrusion = get_extrusion(obj) + + self.pltype = 'spline' # spline is a 2D- or 3D-polyline self.points = self.get_points(obj.data) - - if self.planar: self.pltype = 'poly2d' - else: self.pltype = 'poly3d' - self.curved = False - #self.curved = False + #self.knots_val = self.get_knots_val(obj.data) # 40 - Knot value (one entry per knot) + #self.knots_wgh = self.get_knots_wgh(obj.data) # 41 - Weight (default 1) #print 'deb:Spline obj.data:\n', obj.data #------------------------ #print 'deb:Spline self.points:\n', self.points #------------------------ @@ -2032,61 +2214,70 @@ DXF: X value; APP: 3D point, Y and Z values of control points (in WCS) (one entr 20:yvalue for each vert """ - num = self.num_contr point = None points = [] + pointend = None #point = Vertex() - for item in data: - #print 'deb:Spline item:', item #------------------------ - if item[0] == 10: # control point - if point: points.append(point) - point = Vertex() - point.curved = True - point.x = item[1] - elif item[0] == 20: # 20 = y - point.y = item[1] - elif item[0] == 30: # 30 = z - point.z = item[1] + if self.spline: # NURBSpline definition + for item in data: + #print 'deb:Spline.get_points spilne_item:', item #------------------------ + if item[0] == 10: # control point + if point: points.append(point) + point = Vertex() + point.curved = True + point.x = item[1] + elif item[0] == 20: # 20 = y + point.y = item[1] + elif item[0] == 30: # 30 = z + point.z = item[1] + elif item[0] == 41: # 41 = weight + point.weight = item[1] + #print 'deb:Spline.get_points control point:', point #------------------------ - elif item[0] == 11: # fit point - if point: points.append(point) - point = Vertex() - point.curved = True - point.x = item[1] - elif item[0] == 21: # 20 = y - point.y = item[1] - elif item[0] == 31: # 30 = z - point.z = item[1] + elif self.curved: # Bezier definition + for item in data: + #print 'deb:Spline.get_points curved_item:', item #------------------------ + if item[0] == 11: # fit point + if point: points.append(point) + point = Vertex() + point.tangent = False + point.x = item[1] + elif item[0] == 21: # 20 = y + point.y = item[1] + elif item[0] == 31: # 30 = z + point.z = item[1] + #print 'deb:Spline.get_points fit point:', point #------------------------ - elif item[0] == 12: # start tangent - if point: points.append(point) - point = Vertex() - point.curved = True - point.x = item[1] - elif item[0] == 22: # = y - point.y = item[1] - elif item[0] == 32: # = z - point.z = item[1] + elif item[0] == 12: # start tangent + if point: points.append(point) + point = Vertex() + point.tangent = True + point.x = item[1] + elif item[0] == 22: # = y + point.y = item[1] + elif item[0] == 32: # = z + point.z = item[1] + #print 'deb:Spline.get_points fit begtangent:', point #------------------------ - elif item[0] == 13: # end tangent - if point: points.append(point) - point = Vertex() - point.curved = True - point.x = item[1] - elif item[0] == 23: # 20 = y - point.y = item[1] - elif item[0] == 33: # 30 = z - point.z = item[1] + elif item[0] == 13: # end tangent + if point: points.append(point) + pointend = Vertex() + pointend.tangent = True + pointend.x = item[1] + elif item[0] == 23: # 20 = y + pointend.y = item[1] + elif item[0] == 33: # 30 = z + pointend.z = item[1] + #print 'deb:Spline.get_points fit endtangent:', pointend #------------------------ points.append(point) + if self.curved and pointend: + points.append(pointend) #print 'deb:Spline points:\n', points #------------------------ return points - - def __repr__(self): return "%s: layer - %s, points - %s" %(self.__class__.__name__, self.layer, self.points) - class LWpolyline(Polyline): #------------------------------------------------------------- @@ -2099,7 +2290,7 @@ class LWpolyline(Polyline): #-------------------------------------------------- if not obj.type == 'lwpolyline': raise TypeError, "Wrong type %s for polyline object!" %obj.type self.type = obj.type - self.data = obj.data[:] +# self.data = obj.data[:] # required data self.num_points = obj.get_type(90)[0] @@ -2118,8 +2309,8 @@ class LWpolyline(Polyline): #-------------------------------------------------- self.flags = getit(obj, 70, 0) self.closed = self.flags&1 # byte coded, 1 = closed, 128 = plinegen - self.layer = getit(obj.data, 8, None) - self.extrusion = get_extrusion(obj.data) + self.layer = getit(obj, 8, None) + self.extrusion = get_extrusion(obj) self.points = self.get_points(obj.data) @@ -2167,72 +2358,10 @@ class LWpolyline(Polyline): #-------------------------------------------------- return points - def __repr__(self): return "%s: layer - %s, points - %s" %(self.__class__.__name__, self.layer, self.points) - def draw_old(self, settings): - """for LWPOLYLINE: generate Blender_geometry. - """ - #print 'deb:LWpolyline.draw.START:----------------' #------------------------ - points = [] - obname = 'lw_%s' %self.layer # create object name from layer name - obname = obname[:MAX_NAMELENGTH] - #settings.var['curves_on'] == True - #print 'deb:index_len: ', len(self.points) #------------------ - for i, point in enumerate(self.points): - #print 'deb:index: ', i #------------------ - if not point.bulge: - points.append(point.loc) - elif point.bulge and not self.closed and i == len(self.points)-1: - points.append(point.loc) - elif point.bulge: # - if i == len(self.points)-1: - point2 = self.points[0] - else: - point2 = self.points[i+1] - arc_res = settings.var['arc_res']/sqrt(settings.var['arc_rad']) - verts, center = calcBulge(point, point2, arc_res) -# if i == len(self.points)-1: -# if self.closed: -# verts.pop() #remove last(=first) vertex -# else: -# verts.pop() #remove last vertex, because this point will be writen as the next vertex - points.extend(verts) - - thic = self.thic - if settings.var['thick_force'] and thic == 0: thic = settings.var['thick_min'] - if settings.var['thick_on'] and thic != 0: - len1 = len(points) - points.extend([[point[0], point[1], point[2]+thic] for point in points]) - faces = [] - #print 'deb:len1:', len1 #----------------------- - faces = [[num, num+1, num+len1+1, num+len1] for num in xrange(len1 - 1)] - if self.closed: - faces.append([len1-1, 0, len1, 2*len1-1]) - #print 'deb:faces_list:\n', faces #----------------------- - me = Mesh.New(obname) # create a new mesh - ob = SCENE.objects.new(me) # create a new mesh_object - me.verts.extend(points) # add vertices to mesh - me.faces.extend(faces) # add faces to the mesh - else: - edges = [[num, num+1] for num in xrange(len(points)-1)] - if self.closed: - edges.append([len(points)-1, 0]) - #print 'deb:edges_list:\n', edges #----------------------- - me = Mesh.New(obname) # create a new mesh - ob = SCENE.objects.new(me) # create a new mesh_object - me.verts.extend(points) # add vertices to mesh - me.edges.extend(edges) # add edges to the mesh - - ob.LocZ = self.elevation - transform(self.extrusion, 0, ob) - - #print 'deb:LWpolyline.draw.END:----------------' #------------------------ - return ob - - class Text: #----------------------------------------------------------------- """Class for objects representing dxf TEXT. """ @@ -2242,7 +2371,7 @@ class Text: #----------------------------------------------------------------- if not obj.type == 'text': raise TypeError, "Wrong type %s for text object!" %obj.type self.type = obj.type - self.data = obj.data[:] +# self.data = obj.data[:] # required data self.height = 1.7 * obj.get_type(40)[0] #text.height @@ -2274,14 +2403,13 @@ class Text: #----------------------------------------------------------------- #3=aligned, 4=middle, 5=fit self.halignment = getit(obj, 72, 0) - self.layer = getit(obj.data, 8, None) - self.loc1, self.loc2 = self.get_loc(obj.data) + self.layer = getit(obj, 8, None) + self.loc1, self.loc2 = self.get_loc(obj) if self.loc2[0] != None and self.halignment != 5: self.loc = self.loc2 else: self.loc = self.loc1 - self.extrusion = get_extrusion(obj.data) - + self.extrusion = get_extrusion(obj) def get_loc(self, data): @@ -2390,13 +2518,13 @@ class Mtext: #----------------------------------------------------------------- if not obj.type == 'mtext': raise TypeError, "Wrong type %s for mtext object!" %obj.type self.type = obj.type - self.data = obj.data[:] +# self.data = obj.data[:] # required data self.height = obj.get_type(40)[0] self.width = obj.get_type(41)[0] self.alignment = obj.get_type(71)[0] # alignment 1=TL, 2=TC, 3=TR, 4=ML, 5=MC, 6=MR, 7=BL, 8=BC, 9=BR - self.value = self.get_text(obj.data) # The text string value + self.value = self.get_text(obj) # The text string value # optional data (with defaults) self.space = getit(obj, 67, 0) @@ -2406,9 +2534,9 @@ class Mtext: #----------------------------------------------------------------- self.width_factor = getit(obj, 42, 1) # Scaling factor along local x axis self.line_space = getit(obj, 44, 1) # percentage of default - self.layer = getit(obj.data, 8, None) - self.loc = self.get_loc(obj.data) - self.extrusion = get_extrusion(obj.data) + self.layer = getit(obj, 8, None) + self.loc = self.get_loc(obj) + self.extrusion = get_extrusion(obj) def get_text(self, data): @@ -2487,7 +2615,7 @@ class Circle: #---------------------------------------------------------------- if not obj.type == 'circle': raise TypeError, "Wrong type %s for circle object!" %obj.type self.type = obj.type - self.data = obj.data[:] +# self.data = obj.data[:] # required data self.radius = obj.get_type(40)[0] @@ -2497,9 +2625,9 @@ class Circle: #---------------------------------------------------------------- self.thic = getit(obj, 39, 0) self.color_index = getit(obj, 62, BYLAYER) - self.layer = getit(obj.data, 8, None) - self.loc = self.get_loc(obj.data) - self.extrusion = get_extrusion(obj.data) + self.layer = getit(obj, 8, None) + self.loc = self.get_loc(obj) + self.extrusion = get_extrusion(obj) @@ -2700,7 +2828,7 @@ class Arc: #----------------------------------------------------------------- if not obj.type == 'arc': raise TypeError, "Wrong type %s for arc object!" %obj.type self.type = obj.type - self.data = obj.data[:] +# self.data = obj.data[:] # required data self.radius = obj.get_type(40)[0] @@ -2712,9 +2840,9 @@ class Arc: #----------------------------------------------------------------- self.thic = getit(obj, 39, 0) self.color_index = getit(obj, 62, BYLAYER) - self.layer = getit(obj.data, 8, None) - self.loc = self.get_loc(obj.data) - self.extrusion = get_extrusion(obj.data) + self.layer = getit(obj, 8, None) + self.loc = self.get_loc(obj) + self.extrusion = get_extrusion(obj) #print 'deb:Arc__init__: center, radius, start, end:\n', self.loc, self.radius, self.start_angle, self.end_angle #--------- @@ -2898,7 +3026,7 @@ class BlockRecord: #----------------------------------------------------------- if not obj.type == 'block_record': raise TypeError, "Wrong type %s for block_record object!" %obj.type self.type = obj.type - self.data = obj.data[:] +# self.data = obj.data[:] # required data self.name = getit(obj, 2, None) @@ -2954,8 +3082,8 @@ class Block: #----------------------------------------------------------------- self.entities = dxfObject('block_contents') #creates empty entities_container for this block self.entities.data = objectify([ent for ent in obj.data if type(ent) != list]) - self.layer = getit(obj.data, 8, None) - self.loc = self.get_loc(obj.data) + self.layer = getit(obj, 8, None) + self.loc = self.get_loc(obj) #print 'deb:Block %s data:\n%s' %(self.name, self.data) #------------ #print 'deb:Block %s self.entities.data:\n%s' %(self.name, self.entities.data) #------------ @@ -2999,11 +3127,11 @@ class Insert: #---------------------------------------------------------------- self.space = getit(obj, 67, 0) self.color_index = getit(obj, 62, BYLAYER) - self.layer = getit(obj.data, 8, None) - self.loc = self.get_loc(obj.data) - self.scale = self.get_scale(obj.data) - self.rows, self.columns = self.get_array(obj.data) - self.extrusion = get_extrusion(obj.data) + self.layer = getit(obj, 8, None) + self.loc = self.get_loc(obj) + self.scale = self.get_scale(obj) + self.rows, self.columns = self.get_array(obj) + self.extrusion = get_extrusion(obj) #self.flags = getit(obj.data, 66, 0) # #self.attrib = self.flags & 1 @@ -3205,7 +3333,7 @@ class Ellipse: #--------------------------------------------------------------- if not obj.type == 'ellipse': raise TypeError, "Wrong type %s for ellipse object!" %obj.type self.type = obj.type - self.data = obj.data[:] +# self.data = obj.data[:] # required data self.ratio = obj.get_type(40)[0] # Ratio of minor axis to major axis @@ -3217,10 +3345,10 @@ class Ellipse: #--------------------------------------------------------------- self.thic = getit(obj, 39, 0.0) self.color_index = getit(obj, 62, BYLAYER) - self.layer = getit(obj.data, 8, None) - self.loc = self.get_loc(obj.data) - self.major = self.get_major(obj.data) - self.extrusion = get_extrusion(obj.data) + self.layer = getit(obj, 8, None) + self.loc = self.get_loc(obj) + self.major = self.get_major(obj) + self.extrusion = get_extrusion(obj) def get_loc(self, data): @@ -3468,14 +3596,14 @@ class Face: #----------------------------------------------------------------- if not obj.type == '3dface': raise TypeError, "Wrong type %s for 3dface object!" %obj.type self.type = obj.type - self.data = obj.data[:] +# self.data = obj.data[:] # optional data (with defaults) self.space = getit(obj, 67, 0) self.color_index = getit(obj, 62, BYLAYER) - self.layer = getit(obj.data, 8, None) - self.points = self.get_points(obj.data) + self.layer = getit(obj, 8, None) + self.points = self.get_points(obj) def get_points(self, data): @@ -3582,11 +3710,11 @@ type_map = { 'point':Point, '3dface':Face, 'line':Line, -# 'mline':MLine, +# 'mline':MLine, 'polyline':Polyline, 'lwpolyline':LWpolyline, 'spline':Spline, -# 'region':Region, +# 'region':Region, 'trace':Solid, 'solid':Solid, 'text':Text, @@ -3623,12 +3751,12 @@ def objectify(data): #--------------------------------------------------------- if item.type == 'vertex': #print 'deb:objectify gosub Vertex--------' #------------- v = Vertex(item) - if pline.spline: # if Bspline-curve + if pline.spline: # if NURBSpline-curve # then for Blender-mesh filter only additional_vertices # OR # then for Blender-curve filter only spline_control_vertices - if (v.spline and not curves_on) or (curves_on and v.splin2): #correct for real NURBS-import - #if (v.spline and not curves_on) or (curves_on and not v.splin2): #fake for Bezier-emulation of NURBS-import + if (v.spline and not curves_on) or (curves_on and v.spline_c): #correct for real NURBS-import + #if (v.spline and not curves_on) or (curves_on and not v.spline_c): #fake for Bezier-emulation of NURBS-import pline.points.append(v) elif pline.curved: # if Bezier-curve # then for Blender-mesh filter only curve_additional_vertices @@ -3685,7 +3813,7 @@ class MatColors: #------------------------------------------------------------- the material. """ - def __init__(self, layersmap): + def __init__(self): """Expects a map - a dictionary mapping layer names to layers. """ #self.layersmap = layersmap # a dictionary of layername:layerobject @@ -3709,8 +3837,9 @@ class MatColors: #------------------------------------------------------------- #layer = Layer(name=color, color=256, frozen=False) #layersmap[color] = layer #color = 0 - if layersmap: color = layersmap[color].color - if color == 256: # color 0 = BYLAYER + if color in layersmap.keys(): + color = layersmap[color].color + if color == 256: # color 256 = BYLAYER #--todo-- should looking for color of LAYER #if layersmap: color = layersmap[color].color color = 3 @@ -3749,7 +3878,7 @@ class MatLayers: #------------------------------------------------------------- the material. """ - def __init__(self, layersmap): + def __init__(self): """Expects a map - a dictionary mapping layer names to layers. """ #self.layersmap = layersmap # a dictionary of layername:layer @@ -3896,6 +4025,11 @@ class Settings: #-------------------------------------------------------------- '0' ] + self.var['groupFilter_on'] = False #deb:remi------------ + self.acceptedLayers = ['3', + '0' + ] + #self.var['blockFilter_on'] = 0 #deb:remi------------ self.acceptedBlocks = ['WALL_1871', 'BOX02' @@ -3953,8 +4087,8 @@ class Settings: #-------------------------------------------------------------- if self.var['optimization'] == 0: self.var['one_mesh_on'] = 0 # The section:tables may be partialy or completely missing. self.layersTable = False - self.colMaterials = MatColors({}) #A container for dxf-color based materials - self.layMaterials = MatLayers({}) #A container for dxf-layer based materials + self.colMaterials = MatColors() #A container for dxf-color based materials + self.layMaterials = MatLayers() #A container for dxf-layer based materials #self.collayMaterials = MatColLayers({}) #A container for dxf-color+layer based materials global layersmap, layernamesmap layersmap, layernamesmap = {}, {} @@ -3974,8 +4108,8 @@ class Settings: #-------------------------------------------------------------- if layers: #---------------------------------- # Read the layers table and get the layer colors layersmap, layernamesmap = getLayersmap(layers) - self.colMaterials = MatColors(layersmap) - self.layMaterials = MatLayers(layersmap) + #self.colMaterials = MatColors() + #self.layMaterials = MatLayers() else: self.write("File contains no table:layers!") @@ -4441,19 +4575,20 @@ def rotXY_Vec(rotation, vec): #------------------------------------------------ -def getLayersmap(layers): #------------------------------------------------------ +def getLayersmap(dxflayers): #------------------------------------------------------ """Build two dictionaries: 1.layername:layer object, and 2.layername:layername_short + gets set of layers from TABLES SECTION LAYERS """ layersmap = {} layernamesmap = {} - for item in layers.data: + for item in dxflayers.data: if type(item) != list and item.type == 'layer': layersmap[item.name] = item layername_short = item.name[:MAX_NAMELENGTH-1] i = 0 #sufix for layernames cause Blender-objectnames-limits while layername_short in layernamesmap.keys(): i += 1 - suffix = str(i) + suffix = str(i) #--todo--set zero-leading number format layername_short = layername_short[:-2] + suffix layernamesmap[item.name] = layername_short @@ -4546,6 +4681,7 @@ def drawer(_type, entities, settings, block_def): #---------------------------- If 'block_def': the entities are to be added to the Blender 'group'. """ + global layersmap, layersmapshort #print 'deb:drawer _type, entities:\n ', _type, entities #----------------------- if entities: @@ -4579,6 +4715,21 @@ def drawer(_type, entities, settings, block_def): #---------------------------- #entities = [entity for entity in entities if entity.layer[0] in ['M','3','0'] and not entity.layer.endswith('H')] entities = [entity for entity in entities if entity.layer in settings.acceptedLayers] + # patch for incomplete layer table in HL2-DXF-files + if layersmap: + for entity in entities: + oblayer = entity.layer + if oblayer not in layersmap.keys(): + layer_obj = Layer(None, name=oblayer) + layersmap[oblayer] = layer_obj + layername_short = oblayer[:MAX_NAMELENGTH-1] + i = 0 #sufix for layernames cause Blender-objectnames-limits + while layername_short in layernamesmap.keys(): + i += 1 + suffix = str(i) #--todo--set zero-leading number format + layername_short = layername_short[:-2] + suffix + layernamesmap[oblayer] = layername_short + # filtering only objects on not-frozen layers if layersmap and not settings.var['layFrozen_on']: entities = [entity for entity in entities if not layersmap[entity.layer].frozen] @@ -4785,7 +4936,7 @@ def setMaterial_from(entity, ob, settings, block_def): #----------------------- mat = settings.colMaterials(entity.color_index) elif settings.var['material_from'] == 2: # 2= material from layer_name - mat = settings.layMaterials(layername = entity.layer) + mat = settings.layMaterials(layername=entity.layer) elif settings.var['material_from'] == 3: # 3= material from layer+color mat = settings.layMaterials(layername=entity.layer, color=entity.color_index) @@ -5104,7 +5255,7 @@ EVENT_HELP = 9 EVENT_PRESETCURV = 10 EVENT_PRESETS = 11 EVENT_DXF_DIR = 12 -EVENT_DXF_NAME = 13 +# = 13 EVENT_LIST = 14 EVENT_ORIGIN = 15 EVENT_SCALE = 16 @@ -5119,12 +5270,12 @@ GUI_B = {} # GUI-buttons dictionary for drawingTypes # settings default, initialize ------------------------ points_as_menu = "convert to: %t|empty %x1|mesh.vertex %x2|thin sphere %x3|thin box %x4|*curve.vertex %x5" -lines_as_menu = "convert to: %t|*edge %x1|mesh %x2|*thin cylinder %x3|thin box %x4|curve %x5" +lines_as_menu = "convert to: %t|*edge %x1|mesh %x2|*thin cylinder %x3|thin box %x4|Bezier-curve %x5|NURBS-curve %x6" mlines_as_menu = "convert to: %t|*edge %x1|*mesh %x2|*thin cylinder %x3|*thin box %x|*curve %x5" -plines_as_menu = "convert to: %t|*edge %x1|mesh %x2|*thin cylinder %x3|*thin box %x4|curve %x5" -splines_as_menu = "convert to: %t|*edge %x1|mesh %x2|*thin cylinder %x3|*thin box %x4|curve %x5" -plines3_as_menu = "convert to: %t|*edge %x1|mesh %x2|*thin cylinder %x3|*thin box %x4|curve %x5" -plmesh_as_menu = "convert to: %t|*edge %x1|mesh %x2" +plines_as_menu = "convert to: %t|*edge %x1|mesh %x2|*thin cylinder %x3|*thin box %x4|Bezier-curve %x5|NURBS-curve %x6" +splines_as_menu = "convert to: %t|mesh %x2|*thin cylinder %x3|*thin box %x4|Bezier-curve %x5|NURBS-curve %x6" +plines3_as_menu = "convert to: %t|*edge %x1|mesh %x2|*thin cylinder %x3|*thin box %x4|Bezier-curve %x5|NURBS-curve %x6" +plmesh_as_menu = "convert to: %t|*edge %x1|mesh %x2|NURBS-surface %x6" solids_as_menu = "convert to: %t|*edge %x1|mesh %x2" blocks_as_menu = "convert to: %t|dupliGroup %x1|*real.Group %x2|*exploded %x3" texts_as_menu = "convert to: %t|text %x1|*mesh %x2|*curve %x5" @@ -5166,6 +5317,9 @@ keywords_org = { 'xref_on' : 1, 'block_nn': 0, 'blockFilter_on': 0, + 'layerFilter_on': 0, + 'colorFilter_on': 0, + 'groupFilter_on': 0, 'newScene_on' : 1, 'target_layer' : TARGET_LAYER, 'group_bylayer_on' : GROUP_BYLAYER, @@ -5187,7 +5341,6 @@ keywords_org = { 'dist_force': 0, 'material_on': 1, 'material_from': 2, - 'pl_3d' : 1, 'fill_on' : 1, 'meshSmooth_on': 1, 'curve_res' : CURV_RESOLUTION, @@ -5197,6 +5350,8 @@ keywords_org = { 'thin_res' : THIN_RESOLUTION, 'pl_trim_max' : TRIM_LIMIT, 'pl_trim_on': 1, + 'plmesh_flip': 0, + 'normals_out': 0, 'paper_space_on': 0, 'layFrozen_on': 0, 'Z_force_on': 0, @@ -5205,7 +5360,7 @@ keywords_org = { 'lines_as' : 2, 'mlines_as' : 2, 'plines_as' : 2, - 'splines_as' : 2, + 'splines_as' : 5, 'plines3_as': 2, 'plmesh_as' : 2, 'solids_as' : 2, @@ -5221,7 +5376,7 @@ drawTypes_org = { 'ellipse': 1, 'mline' : 0, 'polyline': 1, - 'spline': 0, + 'spline': 1, 'plmesh': 1, 'pline3': 1, 'lwpolyline': 1, @@ -5244,6 +5399,9 @@ for k, v in drawTypes_org.iteritems(): GUI_B[k] = Draw.Create(v) #print 'deb:init GUI_A: ', GUI_A #--------------- #print 'deb:init GUI_B: ', GUI_B #--------------- + +model_space_on = Draw.Create(1) + # initialize settings-object controls how dxf entities are drawn settings = Settings(keywords_org, drawTypes_org) @@ -5397,12 +5555,13 @@ def resetDefaultConfig(): #----------------------------------------------- updateConfig(keywords_org, drawTypes_org) -def presetConfig_curv(): #----------------------------------------------- +def presetConfig_curv(activate): #----------------------------------------------- """Sets settings/config/materials for curve representation. """ global GUI_A - if GUI_A['curves_on'].val == 1: + if activate: + GUI_A['curves_on'].val = 1 GUI_A['points_as'].val = 5 GUI_A['lines_as'].val = 5 GUI_A['mlines_as'].val = 5 @@ -5410,11 +5569,12 @@ def presetConfig_curv(): #----------------------------------------------- GUI_A['splines_as'].val = 5 GUI_A['plines3_as'].val = 5 else: + GUI_A['curves_on'].val = 0 GUI_A['points_as'].val = 2 GUI_A['lines_as'].val = 2 GUI_A['mlines_as'].val = 2 GUI_A['plines_as'].val = 2 - GUI_A['splines_as'].val = 2 + GUI_A['splines_as'].val = 6 GUI_A['plines3_as'].val = 2 @@ -5422,7 +5582,7 @@ def resetDefaultConfig_2D(): #----------------------------------------------- """Sets settings/config/materials to defaults 2D. """ -# presetConfig_curv() + presetConfig_curv(1) keywords2d = { 'views_on' : 0, 'cams_on' : 0, @@ -5434,7 +5594,6 @@ def resetDefaultConfig_2D(): #----------------------------------------------- 'width_force': 0, 'dist_on' : 1, 'dist_force': 0, - 'pl_3d' : 0, 'fill_on' : 0, 'pl_trim_on': 1, 'Z_force_on': 0, @@ -5452,9 +5611,9 @@ def resetDefaultConfig_2D(): #----------------------------------------------- 'ellipse': 1, 'mline' : 0, 'polyline': 1, - 'spline': 0, + 'spline': 1, 'plmesh': 0, - 'pline3': 0, + 'pline3': 1, 'lwpolyline': 1, 'text' : 1, 'mtext' : 0, @@ -5472,8 +5631,11 @@ def resetDefaultConfig_3D(): #----------------------------------------------- """Sets settings/config/materials to defaults 3D. """ -# presetConfig_curv() + presetConfig_curv(0) keywords3d = { +# 'views_on' : 1, +# 'cams_on' : 1, +# 'lights_on' : 1, 'vGroup_on' : 1, 'thick_on' : 1, 'thick_force': 0, @@ -5481,7 +5643,6 @@ def resetDefaultConfig_3D(): #----------------------------------------------- 'width_force': 0, 'dist_on' : 1, 'dist_force': 0, - 'pl_3d' : 0, 'fill_on' : 1, 'pl_trim_on': 1, 'Z_force_on': 0, @@ -5499,11 +5660,11 @@ def resetDefaultConfig_3D(): #----------------------------------------------- 'ellipse': 1, 'mline' : 0, 'polyline': 1, - 'spline': 0, + 'spline': 1, 'plmesh': 1, 'pline3': 1, 'lwpolyline': 1, - 'text' : 1, + 'text' : 0, 'mtext' : 0, 'block' : 1, 'insert': 1, @@ -5557,6 +5718,7 @@ def draw_UI(): #--------------------------------------------------------------- """ global GUI_A, GUI_B #__version__ global user_preset, iniFileName, dxfFileName, config_UI, g_scale_as + global model_space_on # This is for easy layout changes but_0c = 70 #button 1.column width @@ -5567,8 +5729,8 @@ def draw_UI(): #--------------------------------------------------------------- butt_margin = 10 menu_w = (3 * butt_margin) + but_0c + but_1c + but_2c + but_3c #menu width - simple_menu_h = 80 - extend_menu_h = 370 + simple_menu_h = 100 + extend_menu_h = 350 y = simple_menu_h # y is menu upper.y if config_UI.val: y += extend_menu_h x = 20 #menu left.x @@ -5584,7 +5746,7 @@ def draw_UI(): #--------------------------------------------------------------- y += 30 colorbox(x, y+20, x+menu_w+menu_margin*2, menu_margin) - Draw.Label("DXF-Importer ver." + __version__, but0c, y, menu_w, 20) + Draw.Label("DXF-Importer v" + __version__, but0c, y, menu_w, 20) if config_UI.val: b0, b0_ = but0c, but_0c + butt_margin @@ -5645,25 +5807,23 @@ def draw_UI(): #--------------------------------------------------------------- y -= 10 y -= 20 Draw.BeginAlign() - GUI_B['plmesh'] = Draw.Toggle('POLY-MESH/FACE', EVENT_NONE, b0, y, b0_+b1_, 20, GUI_B['plmesh'].val, "support dxf-POLYMESH/POLYFACE on/off") + GUI_B['plmesh'] = Draw.Toggle('PL-MESH/FACE', EVENT_NONE, b0, y, b0_+b1_-40, 20, GUI_B['plmesh'].val, "support dxf-POLYMESH/POLYFACE on/off") # GUI_A['plmesh_as'] = Draw.Menu(plmesh_as_menu, EVENT_NONE, but1c, y, but_1c, 20, GUI_A['plmesh_as'].val, "select target Blender-object") + GUI_A['plmesh_flip'] = Draw.Toggle('N', EVENT_NONE, b1+b1_-40, y, 20, 20, GUI_A['plmesh_flip'].val, "flip DXF normals on/off") + GUI_A['normals_out'] = Draw.Toggle('N', EVENT_NONE, b1+b1_-20, y, 20, 20, GUI_A['normals_out'].val, "force Blender normals to outside on/off") Draw.EndAlign() y -= 20 - Draw.BeginAlign() GUI_B['solid'] = Draw.Toggle('SOLID', EVENT_NONE, b0, y, b0_, 20, GUI_B['solid'].val, "support dxf-SOLID and TRACE on/off") GUI_B['face'] = Draw.Toggle('3DFACE', EVENT_NONE, b1, y, b1_, 20, GUI_B['face'].val, "support dxf-3DFACE on/off") # GUI_A['solids_as'] = Draw.Menu(solids_as_menu, EVENT_NONE, but3c, y, but_3c, 20, GUI_A['solids_as'].val, "select target Blender-object") - Draw.EndAlign() #print 'deb:support solid, trace', GUI_B['trace'].val, GUI_B['solid'].val # ------------ y -= 20 - Draw.BeginAlign() GUI_B['text'] = Draw.Toggle('TEXT', EVENT_NONE, b0, y, b0_, 20, GUI_B['text'].val, "support dxf-TEXT on/off") GUI_B['mtext'] = Draw.Toggle('*MTEXT', EVENT_NONE, b1, y, b1_, 20, GUI_B['mtext'].val, "(*wip)support dxf-MTEXT on/off") # GUI_A['texts_as'] = Draw.Menu(texts_as_menu, EVENT_NONE, but3c, y, but_3c, 20, GUI_A['texts_as'].val, "select target Blender-object") - Draw.EndAlign() y -= 20 Draw.BeginAlign() @@ -5671,13 +5831,14 @@ def draw_UI(): #--------------------------------------------------------------- GUI_B['insert'].val = GUI_B['block'].val if GUI_B['block'].val: GUI_A['block_nn'] = Draw.Toggle('n', EVENT_NONE, b1-30, y, 15, 20, GUI_A['block_nn'].val, "support hatch/noname BLOCKs *X... on/off") - GUI_A['blockFilter_on'] = Draw.Toggle('F', EVENT_NONE, b1-15, y, 15, 20, GUI_A['blockFilter_on'].val, "(*wip) support name filtering of BLOCKs on/off") - GUI_A['xref_on'] = Draw.Toggle('Xref', EVENT_NONE, b1, y, 20, 20, GUI_A['xref_on'].val, "support place holder for XREF-BLOCKs on/off") + GUI_A['xref_on'] = Draw.Toggle('Xref', EVENT_NONE, b1-15, y, 35, 20, GUI_A['xref_on'].val, "support for XREF-BLOCKs (place holders) on/off") GUI_A['blocks_as'] = Draw.Menu(blocks_as_menu, EVENT_NONE, b1+20, y, b1_-20, 20, GUI_A['blocks_as'].val, "select target representation for imported BLOCKs") Draw.EndAlign() y -= 20 + y -= 20 + Draw.BeginAlign() GUI_A['views_on'] = Draw.Toggle('views', EVENT_NONE, b0, y, b0_-25, 20, GUI_A['views_on'].val, "imports VIEWs and VIEWPORTs as cameras on/off") GUI_A['cams_on'] = Draw.Toggle('*cams', EVENT_NONE, b1-25, y, b1_-25, 20, GUI_A['cams_on'].val, "(*wip) support ASHADE cameras on/off") @@ -5688,19 +5849,28 @@ def draw_UI(): #--------------------------------------------------------------- if y < y_down: y_down = y # -----end supported objects-------------------------------------- - b0, b0_ = but0c, but_0c + butt_margin - b1, b1_ = but1c, but_1c - y_top = y_down y = y_top y -= 10 y -= 20 + but_ = menu_w / 6 + b0 = but0c + (menu_w - but_*6)/2 Draw.BeginAlign() - GUI_A['material_on'] = Draw.Toggle('material', EVENT_REDRAW, b0, y, b0_-20, 20, GUI_A['material_on'].val, "support for material assignment on/off") - if GUI_A['material_on'].val: - GUI_A['material_from'] = Draw.Menu(material_from_menu, EVENT_NONE, b1-20, y, b1_+20, 20, GUI_A['material_from'].val, "material assignment from?") + GUI_A['paper_space_on'] = Draw.Toggle('paper', EVENT_NONE, b0+but_*0, y, but_, 20, GUI_A['paper_space_on'].val, "import only from Paper-Space on/off") + GUI_A['layFrozen_on'] = Draw.Toggle ('frozen', EVENT_NONE, b0+but_*1, y, but_, 20, GUI_A['layFrozen_on'].val, "import also from frozen LAYERs on/off") + GUI_A['layerFilter_on'] = Draw.Toggle('layer', EVENT_NONE, b0+but_*2, y, but_, 20, GUI_A['layerFilter_on'].val, "(*wip) LAYER filtering on/off") + GUI_A['colorFilter_on'] = Draw.Toggle('color', EVENT_NONE, b0+but_*3, y, but_, 20, GUI_A['colorFilter_on'].val, "(*wip) COLOR filtering on/off") + GUI_A['groupFilter_on'] = Draw.Toggle('group', EVENT_NONE, b0+but_*4, y, but_, 20, GUI_A['groupFilter_on'].val, "(*wip) GROUP filtering on/off") + GUI_A['blockFilter_on'] = Draw.Toggle('block', EVENT_NONE, b0+but_*5, y, but_, 20, GUI_A['blockFilter_on'].val, "(*wip) BLOCK filtering on/off") + #GUI_A['dummy_on'] = Draw.Toggle('-', EVENT_NONE, but3c, y, but_3c, 20, GUI_A['dummy_on'].val, "dummy on/off") Draw.EndAlign() + # -----end filters-------------------------------------- + + b0, b0_ = but0c, but_0c + butt_margin + b1, b1_ = but1c, but_1c + + y -= 10 y -= 20 Draw.BeginAlign() GUI_A['g_origin_on'] = Draw.Toggle('glob.reLoc', EVENT_REDRAW, b0, y, b0_, 20, GUI_A['g_origin_on'].val, "global relocate all DXF objects on/off") @@ -5750,9 +5920,9 @@ def draw_UI(): #--------------------------------------------------------------- y -= 10 y -= 20 Draw.BeginAlign() - GUI_A['meshSmooth_on'] = Draw.Toggle('smooth', EVENT_NONE, b0, y, b0_-20, 20, GUI_A['meshSmooth_on'].val, "mesh smooth for circles/arcsegments on/off") - GUI_A['pl_trim_on'] = Draw.Toggle('trim', EVENT_NONE, b1-20, y, 32, 20, GUI_A['pl_trim_on'].val, "intersection of POLYLINE-wide-segments on/off") - GUI_A['pl_trim_max'] = Draw.Number('', EVENT_NONE, b1+12, y, b1_-12, 20, GUI_A['pl_trim_max'].val, 0, 5, "limit for intersection of POLYLINE-wide-segments: 0.0-5.0") + GUI_A['meshSmooth_on'] = Draw.Toggle('smooth', EVENT_NONE, b0, y, b0_-20, 20, GUI_A['meshSmooth_on'].val, "mesh smooth for circles/arc-segments on/off") + GUI_A['pl_trim_on'] = Draw.Toggle('trim', EVENT_NONE, b1-20, y, 32, 20, GUI_A['pl_trim_on'].val, "clean intersection of POLYLINE-wide-segments on/off") + GUI_A['pl_trim_max'] = Draw.Number('', EVENT_NONE, b1+12, y, b1_-12, 20, GUI_A['pl_trim_max'].val, 0, 5, "threshold intersection of POLYLINE-wide-segments: 0.0-5.0") Draw.EndAlign() y -= 20 @@ -5765,21 +5935,21 @@ def draw_UI(): #--------------------------------------------------------------- y -= 20 Draw.BeginAlign() - GUI_A['curves_on'] = Draw.Toggle('to Curves', EVENT_PRESETCURV, b0, y, b0_, 20, GUI_A['curves_on'].val, "import into curves instead into meshes on/off") - GUI_A['curve_arc'] = Draw.Number('', EVENT_NONE, b1, y, b1_/2, 20, GUI_A['curve_arc'].val, 3, 32, "Bezier circle: amount of segments: 3-32") - GUI_A['curve_res'] = Draw.Number('', EVENT_NONE, b1+b1_/2, y, b1_/2, 20, GUI_A['curve_res'].val, 1, 128, "Set the Curve's U-resolution value: 1-128") + GUI_A['curve_arc'] = Draw.Number('', EVENT_NONE, b0, y, b0_/2, 20, GUI_A['curve_arc'].val, 3, 32, "Bezier circle: amount of segments: 3-32") + GUI_A['curve_res'] = Draw.Number('', EVENT_NONE, b0+b0_/2, y, b0_/2, 20, GUI_A['curve_res'].val, 1, 128, "Set the Curve's U-resolution value: 1-128") + GUI_A['curves_on'] = Draw.Toggle('to Curves', EVENT_PRESETCURV, b1, y, b1_, 20, GUI_A['curves_on'].val, "set Curve as target object type on/off") Draw.EndAlign() y -= 20 - GUI_A['group_bylayer_on'] = Draw.Toggle('Lay', EVENT_NONE, b0, y, 30, 20, GUI_A['group_bylayer_on'].val, "grouping entities from the same layer on/off") - GUI_A['vGroup_on'] = Draw.Toggle('vGroups', EVENT_NONE, b0+30, y, b1_-10, 20, GUI_A['vGroup_on'].val, "support Blender-VertexGroups on/off") + GUI_A['group_bylayer_on'] = Draw.Toggle('Layer', EVENT_NONE, b0, y, 30, 20, GUI_A['group_bylayer_on'].val, "DXF-entities group by layer on/off") + GUI_A['vGroup_on'] = Draw.Toggle('vGroups', EVENT_NONE, b0+30, y, b1_-10, 20, GUI_A['vGroup_on'].val, "sort faces into VertexGroups on/off") GUI_A['one_mesh_on'] = Draw.Toggle('oneMesh', EVENT_NONE, b1+10, y, b1_-10, 20, GUI_A['one_mesh_on'].val, "draw DXF-entities into one mesh-object. Recommended for big DXF-files. on/off") y -= 30 Draw.BeginAlign() - GUI_A['paper_space_on'] = Draw.Toggle('paper space', EVENT_NONE, b0, y, b0_+20, 20, GUI_A['paper_space_on'].val, "import only layout (paper space) on/off") - GUI_A['layFrozen_on'] = Draw.Toggle('frozen', EVENT_NONE, b1+20, y, b1_-20, 20, GUI_A['layFrozen_on'].val, "import also from frozen layers on/off") - #GUI_A['dummy_on'] = Draw.Toggle('-', EVENT_NONE, but3c, y, but_3c, 20, GUI_A['dummy_on'].val, "dummy on/off") + GUI_A['material_on'] = Draw.Toggle('material', EVENT_REDRAW, b0, y, b0_-20, 20, GUI_A['material_on'].val, "support for material assignment on/off") + if GUI_A['material_on'].val: + GUI_A['material_from'] = Draw.Menu(material_from_menu, EVENT_NONE, b1-20, y, b1_+20, 20, GUI_A['material_from'].val, "material assignment from?") Draw.EndAlign() y_down = y @@ -5821,8 +5991,9 @@ def draw_UI(): #--------------------------------------------------------------- Draw.EndAlign() y -= 30 - GUI_A['newScene_on'] = Draw.Toggle('newScene', EVENT_NONE, b0, y, b0_, 20, GUI_A['newScene_on'].val, "creates new Blender-Scene for each import on/off") - GUI_A['target_layer'] = Draw.Number('layer', EVENT_NONE, b1, y, b1_, 20, GUI_A['target_layer'].val, 1, 18, "imports into this Blender-layer (<19> reserved for block_definitions)") + but, but_ = but2c, 25 + Draw.BeginAlign() + Draw.EndAlign() if y < y_down: y_down = y # -----end options -------------------------------------- @@ -5835,45 +6006,60 @@ def draw_UI(): #--------------------------------------------------------------- y -= 30 Draw.BeginAlign() Draw.PushButton('INI file >', EVENT_CHOOSE_INI, but0c, y, but_0c, 20, 'Select INI-file from project directory') - iniFileName = Draw.String(' :', EVENT_NONE, but1c, y, menu_w-but_0c-butt_margin, 20, iniFileName.val, FILENAME_MAX, "write here the name of the INI-file") + iniFileName = Draw.String(' :', EVENT_NONE, but1c, y, menu_w-but_1c-60, 20, iniFileName.val, FILENAME_MAX, "write here the name of the INI-file") + but = but4c-60 + Draw.PushButton('#', EVENT_PRESETS, but, y, 20, 20, "toggle Preset-INI-files") + Draw.PushButton('L', EVENT_LOAD_INI, but+20, y, 20, 20, 'Loads configuration from ini-file: %s' % iniFileName.val) + Draw.PushButton('S', EVENT_SAVE_INI, but+40, y, 20, 20, 'Saves configuration to ini-file: %s' % iniFileName.val) Draw.EndAlign() - y -= 20 - Draw.BeginAlign() - Draw.PushButton('#', EVENT_PRESETS, but0c, y, 20, 20, "tipist for Preset-INI-files") - Draw.PushButton('Load', EVENT_LOAD_INI, but0c+20, y, but_0c-20, 20, '.Loads configuration from ini-file: %s' % iniFileName.val) - Draw.PushButton('Save', EVENT_SAVE_INI, but1c, y, but_1c-20, 20, 'Saves configuration to ini-file: %s' % iniFileName.val) - Draw.EndAlign() - but_ = (but_2c+but_3c)/4 - but = but2c - Draw.PushButton('reset', EVENT_RESET, but, y, but_, 20, "reset configuration to defaults") - Draw.PushButton('2D', EVENT_PRESET2D, but+but_, y, but_, 20, 'set configuration for 2D import') - Draw.PushButton('3D', EVENT_PRESET3D, but+but_*2, y, but_, 20, 'set configuration for 3D import') - GUI_A['optimization'] = Draw.Number('', EVENT_NONE, but4c-35, y, 35, 20, GUI_A['optimization'].val, 0, 3, "Optimization Level: 0=Debug/directDrawing, 1=Verbose, 2=ProgressBar, 3=silentMode/fastest") + b0, b0_ = but2c, but_2c + butt_margin + b1, b1_ = but3c, but_3c y = simple_menu_h + bm = butt_margin/2 + + #y -= 10 Draw.BeginAlign() Draw.PushButton('DXFfile >', EVENT_CHOOSE_DXF, but0c, y, but_0c, 20, 'Select DXF-file from project directory') dxfFileName = Draw.String(' :', EVENT_NONE, but1c, y, but_1c+but_2c+but_3c-20, 20, dxfFileName.val, FILENAME_MAX, "type the name of DXF-file or type *.dxf for multi-import") - Draw.PushButton('*.*', EVENT_DXF_DIR, but3c+but_3c-20, y, 20, 20, 'Set asterisk * as filter') + Draw.PushButton('*.*', EVENT_DXF_DIR, but3c+but_3c-20, y, 20, 20, 'import all dxf files from this directory') Draw.EndAlign() - - y -= 50 + y -= 30 + config_UI = Draw.Toggle('CONFIG', EVENT_REDRAW, but0c, y, but_0c+bm, 20, config_UI.val, 'Advanced configuration on/off' ) Draw.BeginAlign() - Draw.PushButton('EXIT', EVENT_EXIT, but0c, y, but_0c, 40, '' ) - Draw.PushButton('HELP', EVENT_HELP, but1c, y, but_1c-20, 20, 'calls BlenderWiki for Manual, Updates and Support.') - Draw.PushButton('?', EVENT_LIST, but1c+but_1c-20, y, 20, 20, 'DXF analyze tool: print listing of LAYERs and BLOCKs into the text file .INF') - Draw.PushButton('START IMPORT', EVENT_START, but2c, y, but_2c+but_3c+butt_margin, 40, 'Start the import procedure') + but, but_ = but1c, but_1c+bm + but_ /= 3 + Draw.PushButton('X', EVENT_RESET, but, y, 15, 20, "reset configuration to defaults") + Draw.PushButton('2D', EVENT_PRESET2D, but+but_, y, but_, 20, 'set configuration for 2D import') + Draw.PushButton('3D', EVENT_PRESET3D, but+(but_*2), y, but_, 20, 'set configuration for 3D import') Draw.EndAlign() - config_UI = Draw.Toggle('CONFIG', EVENT_REDRAW, but1c-butt_margin/2, y+20, but_1c+butt_margin, 20, config_UI.val, 'Advanced configuration on/off' ) + Draw.BeginAlign() + GUI_A['newScene_on'] = Draw.Toggle('newScene', EVENT_NONE, but2c, y, but_2c, 20, GUI_A['newScene_on'].val, "create new Scene for each imported dxf file on/off") + GUI_A['target_layer'] = Draw.Number('layer', EVENT_NONE, but3c, y, but_3c, 20, GUI_A['target_layer'].val, 1, 18, "target Blender-layer (<19> reserved for block_definitions)") + Draw.EndAlign() + + y -= 40 + Draw.PushButton('EXIT', EVENT_EXIT, but0c, y, but_0c+bm, 20, '' ) + Draw.PushButton('HELP', EVENT_HELP, but1c, y, but_1c+bm, 20, 'calls DXF-Importer Manual Page on Wiki.Blender.org') + Draw.BeginAlign() + GUI_A['optimization'] = Draw.Number('', EVENT_NONE, but2c, y+20, 40, 20, GUI_A['optimization'].val, 0, 3, "Optimization Level: 0=Debug/directDrawing, 1=Verbose, 2=ProgressBar, 3=SilentMode") + Draw.EndAlign() + Draw.BeginAlign() + Draw.PushButton('TEST', EVENT_LIST, but2c, y, 40, 20, 'DXF-Analyze-Tool: reads data from selected dxf file and writes report in project_directory/dxf_blendname.INF') + Draw.PushButton('START IMPORT', EVENT_START, but2c+40, y, but_2c-40+but_3c+butt_margin, 40, 'Start the import process. For Cancel go to console and hit Ctrl-C') + Draw.EndAlign() + + + y -= 20 Draw.BeginAlign() Draw.Label(' ', but0c-menu_margin, y, menu_margin, 20) - Draw.Label("*) parts under construction", but0c, y, menu_w, 20) + Draw.Label(LAB, but0c, y, menu_w, 20) Draw.Label(' ', but0c+menu_w, y, menu_margin, 20) Draw.EndAlign() @@ -5930,7 +6116,7 @@ def bevent(evt): resetDefaultConfig_3D() Draw.Redraw() elif (evt==EVENT_PRESETCURV): - presetConfig_curv() + presetConfig_curv(GUI_A['curves_on'].val) Draw.Redraw() elif (evt==EVENT_PRESETS): user_preset += 1 @@ -5974,11 +6160,6 @@ http://wiki.blender.org/index.php?title=Scripts/Manual/Import/DXF-3D') # update_RegistryKey('dxfFileName', dxfFileName.val) GUI_A['newScene_on'].val = 1 Draw.Redraw() -# elif (evt==EVENT_DXF_NAME): -# dirname == Blender.sys.dirname(Blender.Get('filename')) -# update_RegistryKey('DirName', dirname) -# #print 'deb:EVENT_DXF_NAME dxfFileName.val:', dxfFileName.val #-------------- -# update_RegistryKey('dxfFileName', dxfFileName.val) elif (evt==EVENT_CHOOSE_DXF): filename = '' # '*.dxf' if dxfFileName.val: filename = dxfFileName.val @@ -5986,6 +6167,7 @@ http://wiki.blender.org/index.php?title=Scripts/Manual/Import/DXF-3D') elif (evt==EVENT_START): dxfFile = dxfFileName.val #print 'deb: dxfFile file: ', dxfFile #---------------------- + if E_M: dxfFileName.val, dxfFile = e_mode(dxfFile) #evaluation mode update_RegistryKey('dxfFileName', dxfFileName.val) if dxfFile.lower().endswith('*.dxf'): if Draw.PupMenu('DXF importer: OK?|will import all DXF-files from:|%s' % dxfFile) == 1: diff --git a/release/scripts/weightpaint_clean.py b/release/scripts/weightpaint_clean.py index ba1896f011e..ca2184bade4 100644 --- a/release/scripts/weightpaint_clean.py +++ b/release/scripts/weightpaint_clean.py @@ -25,7 +25,7 @@ It removes very low weighted verts from the current group with a weight option. # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -51,13 +51,14 @@ def weightClean(me, PREF_THRESH, PREF_KEEP_SINGLE, PREF_OTHER_GROUPS): for wd in vWeightDict: l = len(wd) if not PREF_KEEP_SINGLE or l > 1: + # cant use iteritems because the dict is having items removed for group in wd.keys(): w= wd[group] if w <= PREF_THRESH: # small weight, remove. del wd[group] rem_count +=1 - l-=1 + l-=1 if PREF_KEEP_SINGLE and l == 1: break @@ -117,4 +118,4 @@ def main(): Draw.PupMenu('Removed %i verts from groups' % rem_count) if __name__=='__main__': - main() \ No newline at end of file + main() diff --git a/source/blender/blenkernel/BKE_texture.h b/source/blender/blenkernel/BKE_texture.h index fade0f8cbaa..c162a04e055 100644 --- a/source/blender/blenkernel/BKE_texture.h +++ b/source/blender/blenkernel/BKE_texture.h @@ -73,6 +73,7 @@ void BKE_free_envmap(struct EnvMap *env); struct EnvMap *BKE_add_envmap(void); struct EnvMap *BKE_copy_envmap(struct EnvMap *env); +int BKE_texture_dependsOnTime(const struct Tex *texture); #endif diff --git a/source/blender/blenkernel/bad_level_call_stubs/stubs.c b/source/blender/blenkernel/bad_level_call_stubs/stubs.c index 3ad11a61de3..561d8d7c2a6 100644 --- a/source/blender/blenkernel/bad_level_call_stubs/stubs.c +++ b/source/blender/blenkernel/bad_level_call_stubs/stubs.c @@ -117,10 +117,14 @@ float BPY_pydriver_eval(struct IpoDriver *driver) { return 0; } + +/* int EXPP_dict_set_item_str(struct PyObject *dict, char *key, struct PyObject *value) { return 0; } +*/ + void Node_SetStack(struct BPy_Node *self, struct bNodeStack **stack, int type){} void InitNode(struct BPy_Node *self, struct bNode *node){} void Node_SetShi(struct BPy_Node *self, struct ShadeInput *shi){} diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index 5b3cec25772..cfcab54058d 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -1291,116 +1291,6 @@ int cloth_collision_moving ( ClothModifierData *clmd, CollisionModifierData *col return 1; } -int cloth_do_selfcollisions(ClothModifierData * clmd) -{ - int ret2 = 0, l; - Cloth *cloth = clmd->clothObject; - - if ( clmd->clothObject->bvhselftree ) - { - for(l = 0; l < clmd->coll_parms->self_loop_count; l++) - { - BVHTreeOverlap *overlap = NULL; - ClothVertex *verts = clmd->clothObject->verts; // needed for openMP - int k; - int ret = 0, result = 0; - - // search for overlapping collision pairs - overlap = BLI_bvhtree_overlap ( cloth->bvhselftree, cloth->bvhselftree, &result ); - -// #pragma omp parallel for private(k, i, j) schedule(static) - for ( k = 0; k < result; k++ ) - { - float temp[3]; - float length = 0; - float mindistance; - int i, j; - - i = overlap[k].indexA; - j = overlap[k].indexB; - - mindistance = clmd->coll_parms->selfepsilon* ( cloth->verts[i].avg_spring_len + cloth->verts[j].avg_spring_len ); - - if ( clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL ) - { - if ( ( cloth->verts [i].flags & CLOTH_VERT_FLAG_PINNED ) - && ( cloth->verts [j].flags & CLOTH_VERT_FLAG_PINNED ) ) - { - continue; - } - } - - VECSUB ( temp, verts[i].tx, verts[j].tx ); - - if ( ( ABS ( temp[0] ) > mindistance ) || ( ABS ( temp[1] ) > mindistance ) || ( ABS ( temp[2] ) > mindistance ) ) continue; - - // check for adjacent points (i must be smaller j) - if ( BLI_edgehash_haskey ( cloth->edgehash, MIN2(i, j), MAX2(i, j) ) ) - { - continue; - } - - length = Normalize ( temp ); - - if ( length < mindistance ) - { - float correction = mindistance - length; - - if ( cloth->verts [i].flags & CLOTH_VERT_FLAG_PINNED ) - { - VecMulf ( temp, -correction ); - VECADD ( verts[j].tx, verts[j].tx, temp ); - } - else if ( cloth->verts [j].flags & CLOTH_VERT_FLAG_PINNED ) - { - VecMulf ( temp, correction ); - VECADD ( verts[i].tx, verts[i].tx, temp ); - } - else - { - VecMulf ( temp, -correction*0.5 ); - VECADD ( verts[j].tx, verts[j].tx, temp ); - - VECSUB ( verts[i].tx, verts[i].tx, temp ); - } - ret = 1; - ret2 += ret; - } - else - { - // check for approximated time collisions - } - } - - if ( overlap ) - MEM_freeN ( overlap ); - - if(!ret) - break; - - } - //////////////////////////////////////////////////////////// - - //////////////////////////////////////////////////////////// - // SELFCOLLISIONS: update velocities - //////////////////////////////////////////////////////////// - if ( ret2 ) - { - int i; - ClothVertex *verts = clmd->clothObject->verts; // needed for openMP - - for ( i = 0; i < cloth->numverts; i++ ) - { - if ( ! ( verts [i].flags & CLOTH_VERT_FLAG_PINNED ) ) - { - VECSUB ( verts[i].tv, verts[i].tx, verts[i].txold ); - } - } - } - //////////////////////////////////////////////////////////// - } - return ret2; -} // return all collision objects in scene // collision object will exclude self @@ -1547,7 +1437,7 @@ int cloth_bvh_objcollision ( Object *ob, ClothModifierData * clmd, float step, f { Cloth *cloth=NULL; BVHTree *cloth_bvh=NULL; - int i=0, numfaces = 0, numverts = 0; + int i=0, numfaces = 0, numverts = 0, k, l, j; int rounds = 0; // result counts applied collisions; ic is for debug output; ClothVertex *verts = NULL; int ret = 0, ret2 = 0; @@ -1647,21 +1537,122 @@ int cloth_bvh_objcollision ( Object *ob, ClothModifierData * clmd, float step, f VECADD ( verts[i].tx, verts[i].txold, verts[i].tv ); } //////////////////////////////////////////////////////////// - + //////////////////////////////////////////////////////////// // Test on *simple* selfcollisions //////////////////////////////////////////////////////////// if ( clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_SELF ) { - ret2 += cloth_do_selfcollisions(clmd); + for(l = 0; l < clmd->coll_parms->self_loop_count; l++) + { + // TODO: add coll quality rounds again + BVHTreeOverlap *overlap = NULL; + int result = 0; + + // collisions = 1; + verts = cloth->verts; // needed for openMP + + numfaces = clmd->clothObject->numfaces; + numverts = clmd->clothObject->numverts; + + verts = cloth->verts; + + if ( cloth->bvhselftree ) + { + // search for overlapping collision pairs + overlap = BLI_bvhtree_overlap ( cloth->bvhselftree, cloth->bvhselftree, &result ); + + // #pragma omp parallel for private(k, i, j) schedule(static) + for ( k = 0; k < result; k++ ) + { + float temp[3]; + float length = 0; + float mindistance; + + i = overlap[k].indexA; + j = overlap[k].indexB; + + mindistance = clmd->coll_parms->selfepsilon* ( cloth->verts[i].avg_spring_len + cloth->verts[j].avg_spring_len ); + + if ( clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL ) + { + if ( ( cloth->verts [i].flags & CLOTH_VERT_FLAG_PINNED ) + && ( cloth->verts [j].flags & CLOTH_VERT_FLAG_PINNED ) ) + { + continue; + } + } + + VECSUB ( temp, verts[i].tx, verts[j].tx ); + + if ( ( ABS ( temp[0] ) > mindistance ) || ( ABS ( temp[1] ) > mindistance ) || ( ABS ( temp[2] ) > mindistance ) ) continue; + + // check for adjacent points (i must be smaller j) + if ( BLI_edgehash_haskey ( cloth->edgehash, MIN2(i, j), MAX2(i, j) ) ) + { + continue; + } + + length = Normalize ( temp ); + + if ( length < mindistance ) + { + float correction = mindistance - length; + + if ( cloth->verts [i].flags & CLOTH_VERT_FLAG_PINNED ) + { + VecMulf ( temp, -correction ); + VECADD ( verts[j].tx, verts[j].tx, temp ); + } + else if ( cloth->verts [j].flags & CLOTH_VERT_FLAG_PINNED ) + { + VecMulf ( temp, correction ); + VECADD ( verts[i].tx, verts[i].tx, temp ); + } + else + { + VecMulf ( temp, -correction*0.5 ); + VECADD ( verts[j].tx, verts[j].tx, temp ); + + VECSUB ( verts[i].tx, verts[i].tx, temp ); + } + ret = 1; + ret2 += ret; + } + else + { + // check for approximated time collisions + } + } + + if ( overlap ) + MEM_freeN ( overlap ); + + } + } + //////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////// + // SELFCOLLISIONS: update velocities + //////////////////////////////////////////////////////////// + if ( ret2 ) + { + for ( i = 0; i < cloth->numverts; i++ ) + { + if ( ! ( verts [i].flags & CLOTH_VERT_FLAG_PINNED ) ) + { + VECSUB ( verts[i].tv, verts[i].tx, verts[i].txold ); + } + } + } + //////////////////////////////////////////////////////////// } - //////////////////////////////////////////////////////////// } while ( ret2 && ( clmd->coll_parms->loop_count>rounds ) ); if(collobjs) - + MEM_freeN(collobjs); + MEM_freeN(collobjs); return MIN2 ( ret, 1 ); } diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 9012adb09b7..2c1f6bb84c1 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -265,14 +265,34 @@ static void layerSwap_tface(void *data, int *corner_indices) { MTFace *tf = data; float uv[4][2]; + const static short pin_flags[4] = + { TF_PIN1, TF_PIN2, TF_PIN3, TF_PIN4 }; + const static char sel_flags[4] = + { TF_SEL1, TF_SEL2, TF_SEL3, TF_SEL4 }; + short unwrap = tf->unwrap & ~(TF_PIN1 | TF_PIN2 | TF_PIN3 | TF_PIN4); + char flag = tf->flag & ~(TF_SEL1 | TF_SEL2 | TF_SEL3 | TF_SEL4); int j; for(j = 0; j < 4; ++j) { - uv[j][0] = tf->uv[corner_indices[j]][0]; - uv[j][1] = tf->uv[corner_indices[j]][1]; + int source_index = corner_indices[j]; + + uv[j][0] = tf->uv[source_index][0]; + uv[j][1] = tf->uv[source_index][1]; + + // swap pinning flags around + if(tf->unwrap & pin_flags[source_index]) { + unwrap |= pin_flags[j]; + } + + // swap selection flags around + if(tf->flag & sel_flags[source_index]) { + flag |= sel_flags[j]; + } } memcpy(tf->uv, uv, sizeof(tf->uv)); + tf->unwrap = unwrap; + tf->flag = flag; } static void layerDefault_tface(void *data, int count) diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 89de5ee9e45..0eb01e823aa 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -97,6 +97,7 @@ #include "BKE_material.h" #include "BKE_particle.h" #include "BKE_pointcache.h" +#include "BKE_texture.h" #include "BKE_utildefines.h" #include "depsgraph_private.h" #include "BKE_bmesh.h" @@ -1133,8 +1134,18 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, mface[numFaces].v1 = vert_map[mface[numFaces].v1]; mface[numFaces].v2 = vert_map[mface[numFaces].v2]; mface[numFaces].v3 = vert_map[mface[numFaces].v3]; - if(mface[numFaces].v4) + if(mface[numFaces].v4) { mface[numFaces].v4 = vert_map[mface[numFaces].v4]; + + test_index_face(&mface[numFaces], &result->faceData, + numFaces, 4); + } + else + { + test_index_face(&mface[numFaces], &result->faceData, + numFaces, 3); + } + origindex[numFaces] = ORIGINDEX_NONE; numFaces++; @@ -1224,8 +1235,17 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, mface[numFaces].v1 = vert_map[mface[numFaces].v1]; mface[numFaces].v2 = vert_map[mface[numFaces].v2]; mface[numFaces].v3 = vert_map[mface[numFaces].v3]; - if(mface[numFaces].v4) + if(mface[numFaces].v4) { mface[numFaces].v4 = vert_map[mface[numFaces].v4]; + + test_index_face(&mface[numFaces], &result->faceData, + numFaces, 4); + } + else + { + test_index_face(&mface[numFaces], &result->faceData, + numFaces, 3); + } origindex[numFaces] = ORIGINDEX_NONE; numFaces++; @@ -2983,6 +3003,20 @@ CustomDataMask displaceModifier_requiredDataMask(ModifierData *md) return dataMask; } +static int displaceModifier_dependsOnTime(ModifierData *md) +{ + DisplaceModifierData *dmd = (DisplaceModifierData *)md; + + if(dmd->texture) + { + return BKE_texture_dependsOnTime(dmd->texture); + } + else + { + return 0; + } +} + static void displaceModifier_foreachObjectLink(ModifierData *md, Object *ob, ObjectWalkFunc walk, void *userData) { @@ -7479,6 +7513,7 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type) mti->initData = displaceModifier_initData; mti->copyData = displaceModifier_copyData; mti->requiredDataMask = displaceModifier_requiredDataMask; + mti->dependsOnTime = displaceModifier_dependsOnTime; mti->foreachObjectLink = displaceModifier_foreachObjectLink; mti->foreachIDLink = displaceModifier_foreachIDLink; mti->updateDepgraph = displaceModifier_updateDepgraph; diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 24a3d348ae7..643f90637ad 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3744,6 +3744,9 @@ int psys_get_particle_state(Object *ob, ParticleSystem *psys, int p, ParticleKey /* TODO: pa_clump vgroup */ do_clump(state,key1,t,part->clumpfac,part->clumppow,1.0); + + if(psys->lattice) + calc_latt_deform(state->co,1.0f); } else{ if (pa) { /* TODO PARTICLE - should this ever be NULL? - Campbell */ diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index ad139220785..da1dcfa6c5b 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -845,3 +845,19 @@ void BKE_free_envmap(EnvMap *env) } /* ------------------------------------------------------------------------- */ +int BKE_texture_dependsOnTime(const struct Tex *texture) +{ + if(texture->plugin) { + // assume all plugins depend on time + return 1; + } else if( texture->ima && + ELEM(texture->ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) { + return 1; + } else if(texture->ipo) { + // assume any ipo means the texture is animated + return 1; + } + return 0; +} + +/* ------------------------------------------------------------------------- */ diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index fcac5df934e..ebc0fb70863 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -865,7 +865,7 @@ void BLI_bvhtree_balance(BVHTree *tree) // create root node BVHNode *node = tree->nodes[tree->totleaf] = &(tree->nodearray[tree->totleaf]); tree->totbranch++; - +< // refit root bvh node refit_kdop_hull(tree, node, 0, tree->totleaf); @@ -875,6 +875,7 @@ void BLI_bvhtree_balance(BVHTree *tree) // verify_tree(tree); } */ + } // overlap - is it possbile for 2 bv's to collide ? diff --git a/source/blender/blenlib/intern/boxpack2d.c b/source/blender/blenlib/intern/boxpack2d.c index acd53e5d516..db7bae8a91d 100644 --- a/source/blender/blenlib/intern/boxpack2d.c +++ b/source/blender/blenlib/intern/boxpack2d.c @@ -42,6 +42,8 @@ #define TRF 2 #define TLF 4 #define BRF 8 +#define CORNERFLAGS (BLF|TRF|TLF|BRF) + #define BL 0 #define TR 1 #define TL 2 @@ -159,7 +161,7 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height) vert->blb = vert->brb = vert->tlb =\ vert->isect_cache[0] = vert->isect_cache[1] =\ vert->isect_cache[2] = vert->isect_cache[3] = NULL; - vert->free = 15 &~ TRF; + vert->free = CORNERFLAGS &~ TRF; vert->trb = box; vert->index = i; i++; box->v[BL] = vert; vert++; @@ -167,7 +169,7 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height) vert->trb= vert->brb = vert->tlb =\ vert->isect_cache[0] = vert->isect_cache[1] =\ vert->isect_cache[2] = vert->isect_cache[3] = NULL; - vert->free = 15 &~ BLF; + vert->free = CORNERFLAGS &~ BLF; vert->blb = box; vert->index = i; i++; box->v[TR] = vert; vert++; @@ -175,7 +177,7 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height) vert->trb = vert->blb = vert->tlb =\ vert->isect_cache[0] = vert->isect_cache[1] =\ vert->isect_cache[2] = vert->isect_cache[3] = NULL; - vert->free = 15 &~ BRF; + vert->free = CORNERFLAGS &~ BRF; vert->brb = box; vert->index = i; i++; box->v[TL] = vert; vert++; @@ -183,7 +185,7 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height) vert->trb = vert->blb = vert->brb =\ vert->isect_cache[0] = vert->isect_cache[1] =\ vert->isect_cache[2] = vert->isect_cache[3] = NULL; - vert->free = 15 &~ TLF; + vert->free = CORNERFLAGS &~ TLF; vert->tlb = box; vert->index = i; i++; box->v[BR] = vert; vert++; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 73abf362d12..3a70438dd13 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2275,7 +2275,7 @@ static int handle_append_runtime(int handle, char *exename, char **cause_r) { unsigned char buf[1024]; int count, progfd= -1; - if (!runtime) { + if (!BLI_exists(runtime)) { cause= "Unable to find runtime"; goto cleanup; } diff --git a/source/blender/imbuf/intern/anim.c b/source/blender/imbuf/intern/anim.c index 720f5b0f7c8..c0e84b73e47 100644 --- a/source/blender/imbuf/intern/anim.c +++ b/source/blender/imbuf/intern/anim.c @@ -612,6 +612,7 @@ static int startffmpeg(struct anim * anim) { av_free(anim->pFrameRGB); av_free(anim->pFrameDeinterlaced); av_free(anim->pFrame); + anim->pCodecCtx = NULL; return -1; } @@ -639,7 +640,19 @@ static int startffmpeg(struct anim * anim) { PIX_FMT_BGR32, SWS_FAST_BILINEAR | SWS_PRINT_INFO, NULL, NULL, NULL); - + + if (!anim->img_convert_ctx) { + fprintf (stderr, + "Can't transform color space??? Bailing out...\n"); + avcodec_close(anim->pCodecCtx); + av_close_input_file(anim->pFormatCtx); + av_free(anim->pFrameRGB); + av_free(anim->pFrameDeinterlaced); + av_free(anim->pFrame); + anim->pCodecCtx = NULL; + return -1; + } + return (0); } diff --git a/source/blender/include/BIF_editarmature.h b/source/blender/include/BIF_editarmature.h index da98eb3d4f1..13c16749612 100644 --- a/source/blender/include/BIF_editarmature.h +++ b/source/blender/include/BIF_editarmature.h @@ -108,7 +108,8 @@ void mouse_armature(void); void remake_editArmature(void); void selectconnected_armature(void); void selectconnected_posearmature(void); -void select_bone_parent(void); +void armature_select_hierarchy(short direction, short add_to_sel); + void setflag_armature(short mode); void unique_editbone_name (struct ListBase *ebones, char *name); @@ -143,6 +144,10 @@ void set_locks_armature_bones(short lock); #define BONESEL_NOSEL 0x80000000 /* Indicates a negative number */ +/* used in bone_select_hierachy() */ +#define BONE_SELECT_PARENT 0 +#define BONE_SELECT_CHILD 1 + #endif diff --git a/source/blender/include/BIF_poseobject.h b/source/blender/include/BIF_poseobject.h index 58c67ff102a..ab96f7ec03e 100644 --- a/source/blender/include/BIF_poseobject.h +++ b/source/blender/include/BIF_poseobject.h @@ -65,6 +65,8 @@ void pose_assign_to_posegroup(short active); void pose_remove_from_posegroups(void); void pgroup_operation_with_menu(void); +void pose_select_hierarchy(short direction, short add_to_sel); + void pose_select_grouped(short nr); void pose_select_grouped_menu(void); diff --git a/source/blender/python/BPY_interface.c b/source/blender/python/BPY_interface.c index 7120e97a62f..69bff059356 100644 --- a/source/blender/python/BPY_interface.c +++ b/source/blender/python/BPY_interface.c @@ -160,11 +160,10 @@ ScriptError g_script_error; * Function prototypes ***************************************************************************/ PyObject *RunPython( Text * text, PyObject * globaldict ); -char *GetName( Text * text ); PyObject *CreateGlobalDictionary( void ); void ReleaseGlobalDictionary( PyObject * dict ); void DoAllScriptsFromList( ListBase * list, short event ); -PyObject *importText( char *name ); +static PyObject *importText( char *name ); void init_ourImport( void ); void init_ourReload( void ); PyObject *blender_import( PyObject * self, PyObject * args ); @@ -651,7 +650,7 @@ int BPY_txt_do_python_Text( struct Text *text ) } /* Create a new script structure and initialize it: */ - script = alloc_libblock( &G.main->script, ID_SCRIPT, GetName( text ) ); + script = alloc_libblock( &G.main->script, ID_SCRIPT, text->id.name+2 ); if( !script ) { printf( "couldn't allocate memory for Script struct!" ); @@ -662,8 +661,7 @@ int BPY_txt_do_python_Text( struct Text *text ) * an error after it will call BPY_Err_Handle below, but the text struct * will have been deallocated already, so we need to copy its name here. */ - BLI_strncpy( textname, GetName( text ), - strlen( GetName( text ) ) + 1 ); + BLI_strncpy( textname, text->id.name+2, 21 ); script->id.us = 1; script->flags = SCRIPT_RUNNING; @@ -1106,12 +1104,10 @@ int BPY_menu_do_python( short menutype, int event ) *****************************************************************************/ void BPY_free_compiled_text( struct Text *text ) { - if( !text->compiled ) - return; - Py_DECREF( ( PyObject * ) text->compiled ); - text->compiled = NULL; - - return; + if( text->compiled ) { + Py_DECREF( ( PyObject * ) text->compiled ); + text->compiled = NULL; + } } /***************************************************************************** @@ -2724,8 +2720,7 @@ PyObject *RunPython( Text * text, PyObject * globaldict ) buf = txt_to_buf( text ); text->compiled = - Py_CompileString( buf, GetName( text ), - Py_file_input ); + Py_CompileString( buf, text->id.name+2, Py_file_input ); MEM_freeN( buf ); @@ -2739,15 +2734,6 @@ PyObject *RunPython( Text * text, PyObject * globaldict ) return PyEval_EvalCode( text->compiled, globaldict, globaldict ); } -/***************************************************************************** -* Description: This function returns the value of the name field of the -* given Text struct. -*****************************************************************************/ -char *GetName( Text * text ) -{ - return ( text->id.name + 2 ); -} - /***************************************************************************** * Description: This function creates a new Python dictionary object. *****************************************************************************/ @@ -2792,49 +2778,38 @@ void DoAllScriptsFromList( ListBase * list, short event ) return; } -PyObject *importText( char *name ) +static PyObject *importText( char *name ) { Text *text; - char *txtname; + char txtname[22]; /* 21+NULL */ char *buf = NULL; int namelen = strlen( name ); - - txtname = malloc( namelen + 3 + 1 ); - if( !txtname ) - return NULL; - + + if (namelen>21-3) return NULL; /* we know this cant be importable, the name is too long for blender! */ + memcpy( txtname, name, namelen ); memcpy( &txtname[namelen], ".py", 4 ); - text = ( Text * ) & ( G.main->text.first ); - - while( text ) { - if( !strcmp( txtname, GetName( text ) ) ) + for(text = G.main->text.first; text; text = text->id.next) { + if( !strcmp( txtname, text->id.name+2 ) ) break; - text = text->id.next; } - if( !text ) { - free( txtname ); + if( !text ) return NULL; - } if( !text->compiled ) { buf = txt_to_buf( text ); - text->compiled = - Py_CompileString( buf, GetName( text ), - Py_file_input ); + text->compiled = Py_CompileString( buf, text->id.name+2, Py_file_input ); MEM_freeN( buf ); if( PyErr_Occurred( ) ) { PyErr_Print( ); BPY_free_compiled_text( text ); - free( txtname ); return NULL; } } - free( txtname ); return PyImport_ExecCodeModule( name, text->compiled ); } @@ -2905,7 +2880,7 @@ static PyObject *reimportText( PyObject *module ) /* look up the text object */ text = ( Text * ) & ( G.main->text.first ); while( text ) { - if( !strcmp( txtname, GetName( text ) ) ) + if( !strcmp( txtname, text->id.name+2 ) ) break; text = text->id.next; } @@ -2922,8 +2897,7 @@ static PyObject *reimportText( PyObject *module ) /* compile the buffer */ buf = txt_to_buf( text ); - text->compiled = Py_CompileString( buf, GetName( text ), - Py_file_input ); + text->compiled = Py_CompileString( buf, text->id.name+2, Py_file_input ); MEM_freeN( buf ); /* if compile failed.... return this error */ diff --git a/source/blender/python/api2_2x/Blender.c b/source/blender/python/api2_2x/Blender.c index 420d292cdce..2b190a6c828 100644 --- a/source/blender/python/api2_2x/Blender.c +++ b/source/blender/python/api2_2x/Blender.c @@ -1074,7 +1074,7 @@ void M_Blender_Init(void) PyDict_SetItemString(dict, "Material", Material_Init()); PyDict_SetItemString(dict, "Mesh", Mesh_Init()); PyDict_SetItemString(dict, "Metaball", Metaball_Init()); - PyDict_SetItemString(dict, "Mathutils", Mathutils_Init()); + PyDict_SetItemString(dict, "Mathutils", Mathutils_Init("Blender.Mathutils")); PyDict_SetItemString(dict, "Geometry", Geometry_Init()); PyDict_SetItemString(dict, "Modifier", Modifier_Init()); PyDict_SetItemString(dict, "NMesh", NMesh_Init()); diff --git a/source/blender/python/api2_2x/Constraint.c b/source/blender/python/api2_2x/Constraint.c index 8db6a49465e..a62a5ee7ed8 100644 --- a/source/blender/python/api2_2x/Constraint.c +++ b/source/blender/python/api2_2x/Constraint.c @@ -29,6 +29,7 @@ #include "Constraint.h" /*This must come first*/ +#include "DNA_armature_types.h" #include "DNA_object_types.h" #include "DNA_effect_types.h" #include "DNA_vec_types.h" @@ -43,6 +44,7 @@ #include "BKE_constraint.h" #include "BLI_blenlib.h" #include "BIF_editconstraint.h" +#include "BIF_poseobject.h" #include "BSE_editipo.h" #include "MEM_guardedalloc.h" #include "butspace.h" @@ -2286,19 +2288,32 @@ static PyObject *ConstraintSeq_moveDown( BPy_ConstraintSeq *self, BPy_Constraint static PyObject *ConstraintSeq_remove( BPy_ConstraintSeq *self, BPy_Constraint *value ) { - bConstraint *con = locate_constr( self, value ); + bConstraint *con = locate_constr(self, value); + bPoseChannel *active= NULL; /* if we can't locate the constraint, return (exception already set) */ - if( !con ) + if (!con) return (PyObject *)NULL; - /* do the actual removal */ - if( self->pchan ) - BLI_remlink( &self->pchan->constraints, con ); - else - BLI_remlink( &self->obj->constraints, con); + /* check if we need to set temporary 'active' flag for pchan */ + if (self->pchan) { + active= get_active_posechannel(self->obj); + + if (active != self->pchan) { + if (active) active->bone->flag &= ~BONE_ACTIVE; + self->pchan->bone->flag |= BONE_ACTIVE; + } + } + + /* del_constr_func() frees constraint + its data */ del_constr_func( self->obj, con ); + /* reset active pchan (if applicable) */ + if (self->pchan && self->pchan!=active) { + if (active) active->bone->flag |= BONE_ACTIVE; + self->pchan->bone->flag &= ~BONE_ACTIVE; + } + /* erase the link to the constraint */ value->con = NULL; diff --git a/source/blender/python/api2_2x/Material.c b/source/blender/python/api2_2x/Material.c index c36213950b0..ccd24a437b5 100644 --- a/source/blender/python/api2_2x/Material.c +++ b/source/blender/python/api2_2x/Material.c @@ -131,11 +131,11 @@ #define EXPP_MAT_RAYMIRRGLOSS_MIN 0.0 #define EXPP_MAT_RAYMIRRGLOSS_MAX 1.0 #define EXPP_MAT_RAYMIRRGLOSSSAMPLES_MIN 0 -#define EXPP_MAT_RAYMIRRGLOSSSAMPLES_MAX 255 +#define EXPP_MAT_RAYMIRRGLOSSSAMPLES_MAX 1024 #define EXPP_MAT_RAYTRANSPGLOSS_MIN 0.0 #define EXPP_MAT_RAYTRANSPGLOSS_MAX 1.0 #define EXPP_MAT_RAYTRANSPGLOSSSAMPLES_MIN 0 -#define EXPP_MAT_RAYTRANSPGLOSSSAMPLES_MAX 255 +#define EXPP_MAT_RAYTRANSPGLOSSSAMPLES_MAX 1024 #define EXPP_MAT_FILTER_MIN 0.0 #define EXPP_MAT_FILTER_MAX 1.0 #define EXPP_MAT_TRANSLUCENCY_MIN 0.0 @@ -738,8 +738,10 @@ static PyMethodDef BPy_Material_methods[] = { "() - Return fresnel power for refractions factor"}, {"getRayTransGloss", ( PyCFunction ) Material_getGlossTrans, METH_NOARGS, "() - Return amount refraction glossiness"}, + {"getRayTransGlossSamples", ( PyCFunction ) Material_getGlossTransSamples, METH_NOARGS, + "() - Return number of sampels for transparent glossiness"}, {"getRayMirrGlossSamples", ( PyCFunction ) Material_getGlossMirrSamples, METH_NOARGS, - "() - Return amount mirror glossiness"}, + "() - Return number of sampels for mirror glossiness"}, {"getFilter", ( PyCFunction ) Material_getFilter, METH_NOARGS, "() - Return the amount of filtering when transparent raytrace is enabled"}, {"getTranslucency", ( PyCFunction ) Material_getTranslucency, METH_NOARGS, @@ -847,8 +849,10 @@ static PyMethodDef BPy_Material_methods[] = { "(f) - Set blend fac for mirror fresnel - [1.0, 5.0]"}, {"setRayTransGloss", ( PyCFunction ) Material_setGlossTrans, METH_VARARGS, "(f) - Set amount refraction glossiness - [0.0, 1.0]"}, + {"setRayTransGlossSamples", ( PyCFunction ) Material_setGlossTransSamples, METH_VARARGS, + "(i) - Set number transparent gloss samples - [1, 1024]"}, {"setRayMirrGlossSamples", ( PyCFunction ) Material_setGlossMirrSamples, METH_VARARGS, - "(f) - Set amount mirror glossiness - [0.0, 1.0]"}, + "(i) - Set number mirror gloss samples - [1, 1024]"}, {"setFilter", ( PyCFunction ) Matr_oldsetFilter, METH_VARARGS, "(f) - Set the amount of filtering when transparent raytrace is enabled"}, {"setTranslucency", ( PyCFunction ) Matr_oldsetTranslucency, METH_VARARGS, diff --git a/source/blender/python/api2_2x/Mathutils.c b/source/blender/python/api2_2x/Mathutils.c index 85c56a61628..217e096060f 100644 --- a/source/blender/python/api2_2x/Mathutils.c +++ b/source/blender/python/api2_2x/Mathutils.c @@ -106,8 +106,9 @@ struct PyMethodDef M_Mathutils_methods[] = { {"Point", (PyCFunction) M_Mathutils_Point, METH_VARARGS, M_Mathutils_Point_doc}, {NULL, NULL, 0, NULL} }; -//----------------------------MODULE INIT------------------------- -PyObject *Mathutils_Init(void) +/*----------------------------MODULE INIT-------------------------*/ +/* from can be Blender.Mathutils or GameLogic.Mathutils for the BGE */ +PyObject *Mathutils_Init(char *from) { PyObject *submodule; @@ -125,8 +126,7 @@ PyObject *Mathutils_Init(void) if( PyType_Ready( &quaternion_Type ) < 0 ) return NULL; - submodule = Py_InitModule3("Blender.Mathutils", - M_Mathutils_methods, M_Mathutils_doc); + submodule = Py_InitModule3(from, M_Mathutils_methods, M_Mathutils_doc); return (submodule); } //-----------------------------METHODS---------------------------- diff --git a/source/blender/python/api2_2x/Mathutils.h b/source/blender/python/api2_2x/Mathutils.h index dd9aae2abed..76d53cb6c4c 100644 --- a/source/blender/python/api2_2x/Mathutils.h +++ b/source/blender/python/api2_2x/Mathutils.h @@ -38,7 +38,7 @@ #include "euler.h" #include "point.h" -PyObject *Mathutils_Init( void ); +PyObject *Mathutils_Init( char * from ); PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat); PyObject *column_vector_multiplication(MatrixObject * mat, VectorObject* vec); PyObject *row_point_multiplication(PointObject* pt, MatrixObject * mat); diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index faa7a68f754..e4a5ad67631 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -1865,9 +1865,17 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem num= cpa->num; /* get orco */ - psys_particle_on_emitter(ob, psmd, - (part->childtype == PART_CHILD_FACES)? PART_FROM_FACE: PART_FROM_PARTICLE, - cpa->num,DMCACHE_ISCHILD,cpa->fuv,cpa->foffset,co,nor,0,0,orco,0); + if(part->childtype == PART_CHILD_FACES) { + psys_particle_on_emitter(ob, psmd, + PART_FROM_FACE, cpa->num,DMCACHE_ISCHILD, + cpa->fuv,cpa->foffset,co,nor,0,0,orco,0); + } + else { + ParticleData *par = psys->particles + cpa->parent; + psys_particle_on_emitter(ob, psmd, part->from, + par->num,DMCACHE_ISCHILD,par->fuv, + par->foffset,co,nor,0,0,orco,0); + } if(uvco){ if(part->from!=PART_FROM_PARTICLE && part->childtype==PART_CHILD_FACES){ diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index efa82e03d5f..524a18a9f3d 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -173,6 +173,7 @@ static void constraint_active_func(void *ob_v, void *con_v) } lb= get_active_constraints(ob); + if (lb == NULL) return; for(con= lb->first; con; con= con->next) { if(con==con_v) con->flag |= CONSTRAINT_ACTIVE; @@ -307,7 +308,7 @@ void del_constr_func (void *ob_v, void *con_v) } /* remove constraint itself */ lb= get_active_constraints(ob_v); - free_constraint_data (con); + free_constraint_data(con); BLI_freelinkN(lb, con); constraint_active_func(ob_v, NULL); diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index 3b0167d673c..fb6a7636e16 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -763,7 +763,16 @@ static void seq_panel_input() } if (last_seq->type == SEQ_IMAGE) { - StripElem * se = give_stripelem(last_seq, CFRA); + int cfra = CFRA; + StripElem * se; + + if(last_seq->startdisp >cfra) { + cfra = last_seq->startdisp; + } else if (last_seq->enddisp <= cfra) { + cfra = last_seq->enddisp - 1; + } + + se = give_stripelem(last_seq, cfra); if (se) { uiDefBut(block, TEX, diff --git a/source/blender/src/drawgpencil.c b/source/blender/src/drawgpencil.c index 733310bfda7..ee28049e2c0 100644 --- a/source/blender/src/drawgpencil.c +++ b/source/blender/src/drawgpencil.c @@ -310,6 +310,8 @@ short draw_gpencil_panel (uiBlock *block, bGPdata *gpd, ScrArea *sa) /* ************************************************** */ /* GREASE PENCIL DRAWING */ +/* ----- General Defines ------ */ + /* flags for sflag */ enum { GP_DRAWDATA_NOSTATUS = (1<<0), /* don't draw status info */ @@ -317,7 +319,9 @@ enum { GP_DRAWDATA_ONLYV2D = (1<<2), /* only draw 'canvas' strokes */ }; -/* draw stroke in buffer */ +/* ----- Tool Buffer Drawing ------ */ + +/* draw stroke defined in buffer (simple ogl lines/points for now, as dotted lines) */ static void gp_draw_stroke_buffer (tGPspoint *points, int totpoints, short thickness, short dflag, short sflag) { tGPspoint *pt; @@ -377,115 +381,232 @@ static void gp_draw_stroke_buffer (tGPspoint *points, int totpoints, short thick } } -/* draw a given stroke */ -static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness, short dflag, short sflag, short debug, int winx, int winy) +/* ----- Existing Strokes Drawing (3D and Point) ------ */ + +/* draw a given stroke - just a single dot (only one point) */ +static void gp_draw_stroke_point (bGPDspoint *points, short sflag, int winx, int winy) { - bGPDspoint *pt; - int i; - - /* error checking */ - if ((points == NULL) || (totpoints <= 0)) - return; - - /* check if stroke can be drawn */ - if ((dflag & GP_DRAWDATA_ONLY3D) && !(sflag & GP_STROKE_3DSPACE)) - return; - if (!(dflag & GP_DRAWDATA_ONLY3D) && (sflag & GP_STROKE_3DSPACE)) - return; - if ((dflag & GP_DRAWDATA_ONLYV2D) && !(sflag & GP_STROKE_2DSPACE)) - return; - if (!(dflag & GP_DRAWDATA_ONLYV2D) && (sflag & GP_STROKE_2DSPACE)) - return; - - /* if drawing a single point, draw it larger */ - if (totpoints == 1) { - /* draw point */ - if (sflag & GP_STROKE_3DSPACE) { - glBegin(GL_POINTS); - glVertex3f(points->x, points->y, points->z); - glEnd(); - } - else if (sflag & GP_STROKE_2DSPACE) { - glBegin(GL_POINTS); - glVertex2f(points->x, points->y); - glEnd(); - } - else { - const float x= (points->x / 1000 * winx); - const float y= (points->y / 1000 * winy); - - glBegin(GL_POINTS); - glVertex2f(x, y); - glEnd(); - } + /* draw point */ + if (sflag & GP_STROKE_3DSPACE) { + glBegin(GL_POINTS); + glVertex3f(points->x, points->y, points->z); + glEnd(); + } + else if (sflag & GP_STROKE_2DSPACE) { + glBegin(GL_POINTS); + glVertex2f(points->x, points->y); + glEnd(); } else { - float oldpressure = 0.0f; + const float x= (points->x / 1000 * winx); + const float y= (points->y / 1000 * winy); + + glBegin(GL_POINTS); + glVertex2f(x, y); + glEnd(); + } +} + +/* draw a given stroke in 3d (i.e. in 3d-space), using simple ogl lines */ +static void gp_draw_stroke_3d (bGPDspoint *points, int totpoints, short thickness, short dflag, short sflag, short debug, int winx, int winy) +{ + bGPDspoint *pt; + float oldpressure = 0.0f; + int i; + + /* draw stroke curve */ + glBegin(GL_LINE_STRIP); + for (i=0, pt=points; i < totpoints && pt; i++, pt++) { + if (fabs(pt->pressure - oldpressure) > 0.2f) { + glEnd(); + glLineWidth(pt->pressure * thickness); + glBegin(GL_LINE_STRIP); + + glVertex3f(pt->x, pt->y, pt->z); + + oldpressure = pt->pressure; + } + else + glVertex3f(pt->x, pt->y, pt->z); + } + glEnd(); + + /* draw debug points of curve on top? */ + if (debug) { + glBegin(GL_POINTS); + for (i=0, pt=points; i < totpoints && pt; i++, pt++) + glVertex3f(pt->x, pt->y, pt->z); + glEnd(); + } +} + +/* ----- Fancy 2D-Stroke Drawing ------ */ + +/* draw a given stroke in 2d */ +static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness, short dflag, short sflag, short debug, int winx, int winy) +{ + /* if thickness is less than 3, 'smooth' opengl lines look better */ + if ((thickness < 3) || (G.rt==0)) { + bGPDspoint *pt; + int i; - /* draw stroke curve */ glBegin(GL_LINE_STRIP); for (i=0, pt=points; i < totpoints && pt; i++, pt++) { - float x, y, z; - - if (sflag & GP_STROKE_3DSPACE) { - x= pt->x; - y= pt->y; - z= pt->z; - } - else if (sflag & GP_STROKE_2DSPACE) { - x= pt->x; - y= pt->y; - z= 0; + if (sflag & GP_STROKE_2DSPACE) { + glVertex2f(pt->x, pt->y); } else { - x= (pt->x / 1000 * winx); - y= (pt->y / 1000 * winy); - z= 0; - } - - if (fabs(pt->pressure - oldpressure) > 0.2f) { - glEnd(); - glLineWidth(pt->pressure * thickness); - glBegin(GL_LINE_STRIP); + const float x= (pt->x / 1000 * winx); + const float y= (pt->y / 1000 * winy); - if (sflag & GP_STROKE_3DSPACE) - glVertex3f(x, y, z); - else - glVertex2f(x, y); - - oldpressure = pt->pressure; - } - else { - if (sflag & GP_STROKE_3DSPACE) - glVertex3f(x, y, z); - else - glVertex2f(x, y); + glVertex2f(x, y); } } glEnd(); + } + else { /* tesselation code: currently only enabled with rt != 0 */ + bGPDspoint *pt1, *pt2; + float p0[2], p1[2], pm[2]; + int i; - /* draw debug points of curve on top? */ - if (debug) { - glBegin(GL_POINTS); - for (i=0, pt=points; i < totpoints && pt; i++, pt++) { - if (sflag & GP_STROKE_3DSPACE) { - glVertex3f(pt->x, pt->y, pt->z); - } - else if (sflag & GP_STROKE_2DSPACE) { - glVertex2f(pt->x, pt->y); - } - else { - const float x= (pt->x / 1000 * winx); - const float y= (pt->y / 1000 * winy); - - glVertex2f(x, y); - } + glShadeModel(GL_FLAT); + glBegin(GL_QUAD_STRIP); + + for (i=0, pt1=points, pt2=points+1; i < (totpoints-1); i++, pt1++, pt2++) { + float s0[2], s1[2]; /* segment 'center' points */ + float t0[2], t1[2]; /* tesselated coordinates */ + float m1[2], m2[2]; /* gradient and normal */ + float pthick, dist; /* thickness at segment point, and length of segment */ + float sminorang; /* minor angle between strokes */ + + /* get x and y coordinates from points */ + if (sflag & GP_STROKE_2DSPACE) { + s0[0]= pt1->x; s0[1]= pt1->y; + s1[0]= pt2->x; s1[1]= pt2->y; } - glEnd(); + else { + s0[0]= (pt1->x / 1000 * winx); + s0[1]= (pt1->y / 1000 * winy); + s1[0]= (pt2->x / 1000 * winx); + s1[1]= (pt2->y / 1000 * winy); + } + + /* calculate gradient and normal - 'angle'=(ny/nx) */ + m1[1]= s1[1] - s0[1]; + m1[0]= s1[0] - s0[0]; + dist = Vec2Lenf(s0, s1); + m2[1]= -(m1[0]) / dist; + m2[0]= m1[1] / dist; + + /* if the first segment, initialise the first segment using segment's normal */ + if (i == 0) { + pthick= (pt1->pressure * thickness); + + // TODO: also draw/do a round end-cap first + + p0[0]= s0[0] - (pthick * m2[0]); + p0[1]= s0[1] - (pthick * m2[1]); + p1[0]= s1[0] + (pthick * m2[0]); + p1[1]= s1[1] + (pthick * m2[1]); + + Vec2Copyf(pm, m1); + } + + /* if the minor angle between the current segment and the previous one is less than 90 degrees */ + if (i) + sminorang= NormalizedVecAngle2_2D(pm, m1); + else + sminorang= 0.0f; + + if ((IS_EQ(sminorang, 0)==0) && (abs(sminorang) < M_PI_2) ) + { + float closep[2]; + + /* recalculate startpoint of segment, where the new start-line: + * - starts a new gl-quad-strip + * - uses the vert of old startpoint closer to our endpoint + * - distance between new startpoints = distance between old startpoints + * - new startpoints occur on same gradient as old segment does (has potential for some 'minor' overlap, but ok) + */ + + /* find the closer vertex, and distance between startpoints */ + if (Vec2Lenf(p0, s1) > Vec2Lenf(p1, s1)) + Vec2Copyf(closep, p1); + else + Vec2Copyf(closep, p0); + + /* determine which side this closer vertex should be on */ + pthick= (pt1->pressure * thickness * 2); + if ( ((closep[0] - s0[0]) > 0) || ((closep[1] - s0[1]) > 0) ) { + /* assumes this is the 'second' point, (i.e. the 'plus' one), so the other is subtracting */ + p0[0]= closep[0] - (pthick * pm[0]); + p0[1]= closep[1] - (pthick * pm[1]); + p1[0]= closep[0]; + p1[1]= closep[1]; + } + else if ( ((closep[0] - s0[0]) < 0) || ((closep[1] - s0[1]) < 0) ) { + /* assumes this is the 'first' point, (i.e. the 'minus' one), so the other is adding */ + p0[0]= closep[0]; + p0[1]= closep[1]; + p1[0]= closep[0] + (pthick * pm[0]); + p1[1]= closep[1] + (pthick * pm[1]); + } + + /* reset gl-states! */ + glEnd(); + glBegin(GL_QUAD_STRIP); + } + + /* do the end of this segment */ + pthick= (pt2->pressure * thickness); + t0[0] = s1[0] - (pthick * m2[0]); + t0[1] = s1[1] - (pthick * m2[1]); + t1[0] = s1[0] + (pthick * m2[0]); + t1[1] = s1[1] + (pthick * m2[1]); + + /* draw this segment */ + glVertex2f(p0[0], p0[1]); + glVertex2f(p1[0], p1[1]); + glVertex2f(t0[0], t0[1]); + glVertex2f(t1[0], t1[1]); + + // TODO: draw end cap if last segment + if (i == totpoints-2) { + + } + + /* store current points for next segment to use */ + Vec2Copyf(p0, t0); + Vec2Copyf(p1, t1); + Vec2Copyf(pm, m1); } + + glEnd(); + } + + /* draw debug points of curve on top? (original stroke points) */ + if (debug) { + bGPDspoint *pt; + int i; + + glBegin(GL_POINTS); + for (i=0, pt=points; i < totpoints && pt; i++, pt++) { + if (sflag & GP_STROKE_2DSPACE) { + glVertex2f(pt->x, pt->y); + } + else { + const float x= (pt->x / 1000 * winx); + const float y= (pt->y / 1000 * winy); + + glVertex2f(x, y); + } + } + glEnd(); } } +/* ----- General Drawing ------ */ + /* draw a set of strokes */ static void gp_draw_strokes (bGPDframe *gpf, int winx, int winy, int dflag, short debug, short lthick, float color[4]) @@ -495,9 +616,26 @@ static void gp_draw_strokes (bGPDframe *gpf, int winx, int winy, int dflag, shor /* set color first (may need to reset it again later too) */ glColor4f(color[0], color[1], color[2], color[3]); - for (gps= gpf->strokes.first; gps; gps= gps->next) { - /* just draw the stroke once */ - gp_draw_stroke(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, winx, winy); + for (gps= gpf->strokes.first; gps; gps= gps->next) { + /* check if stroke can be drawn */ + if ((dflag & GP_DRAWDATA_ONLY3D) && !(gps->flag & GP_STROKE_3DSPACE)) + continue; + if (!(dflag & GP_DRAWDATA_ONLY3D) && (gps->flag & GP_STROKE_3DSPACE)) + continue; + if ((dflag & GP_DRAWDATA_ONLYV2D) && !(gps->flag & GP_STROKE_2DSPACE)) + continue; + if (!(dflag & GP_DRAWDATA_ONLYV2D) && (gps->flag & GP_STROKE_2DSPACE)) + continue; + if ((gps->points == 0) || (gps->totpoints < 1)) + continue; + + /* check which stroke-drawer to use */ + if (gps->totpoints == 1) + gp_draw_stroke_point(gps->points, gps->flag, winx, winy); + else if (dflag & GP_DRAWDATA_ONLY3D) + gp_draw_stroke_3d(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, winx, winy); + else if (gps->totpoints > 1) + gp_draw_stroke(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, winx, winy); } } @@ -656,7 +794,7 @@ static void gp_draw_data (bGPdata *gpd, int winx, int winy, int dflag) glColor4f(0, 0, 0, 1); } -/* ----------- */ +/* ----- Grease Pencil Sketches Drawing API ------ */ /* draw grease-pencil sketches to specified 2d-view assuming that matrices are already set correctly * Note: this gets called twice - first time with onlyv2d=1 to draw 'canvas' strokes, second time with onlyv2d=0 for screen-aligned strokes diff --git a/source/blender/src/drawseq.c b/source/blender/src/drawseq.c index cc431c73a2e..71a777c9056 100644 --- a/source/blender/src/drawseq.c +++ b/source/blender/src/drawseq.c @@ -98,7 +98,7 @@ int no_rightbox=0, no_leftbox= 0; static void draw_seq_handle(Sequence *seq, SpaceSeq *sseq, float pixelx, short direction); static void draw_seq_extensions(Sequence *seq, SpaceSeq *sseq); -static void draw_seq_text(Sequence *seq, float x1, float x2, float y1, float y2); +static void draw_seq_text(Sequence *seq, float x1, float x2, float y1, float y2, char *background_col); static void draw_shadedstrip(Sequence *seq, char *col, float x1, float y1, float x2, float y2); static void draw_seq_strip(struct Sequence *seq, struct ScrArea *sa, struct SpaceSeq *sseq, int outline_tint, float pixelx); @@ -604,7 +604,7 @@ static void draw_seq_extensions(Sequence *seq, SpaceSeq *sseq) } /* draw info text on a sequence strip */ -static void draw_seq_text(Sequence *seq, float x1, float x2, float y1, float y2) +static void draw_seq_text(Sequence *seq, float x1, float x2, float y1, float y2, char *background_col) { float v1[2], v2[2]; int len, size; @@ -670,8 +670,13 @@ static void draw_seq_text(Sequence *seq, float x1, float x2, float y1, float y2) mval[1]= 1; areamouseco_to_ipoco(G.v2d, mval, &x1, &x2); - if(seq->flag & SELECT) cpack(0xFFFFFF); - else cpack(0); + if(seq->flag & SELECT){ + cpack(0xFFFFFF); + }else if ((((int)background_col[0] + (int)background_col[1] + (int)background_col[2]) / 3) < 50){ + cpack(0x505050); /* use lighter text colour for dark background */ + }else{ + cpack(0); + } glRasterPos3f(x1, y1+SEQ_STRIP_OFSBOTTOM, 0.0); BMF_DrawString(G.font, strp); } @@ -740,7 +745,7 @@ so wave file sample drawing precission is zoom adjusted static void draw_seq_strip(Sequence *seq, ScrArea *sa, SpaceSeq *sseq, int outline_tint, float pixelx) { float x1, x2, y1, y2; - char col[3], is_single_image; + char col[3], background_col[3], is_single_image; /* we need to know if this is a single image/color or not for drawing */ is_single_image = (char)check_single_seq(seq); @@ -755,13 +760,14 @@ static void draw_seq_strip(Sequence *seq, ScrArea *sa, SpaceSeq *sseq, int outli /* get the correct color per strip type*/ - get_seq_color3ubv(seq, col); + //get_seq_color3ubv(seq, col); + get_seq_color3ubv(seq, background_col); /* draw the main strip body */ if (is_single_image) /* single image */ - draw_shadedstrip(seq, col, seq_tx_get_final_left(seq, 0), y1, seq_tx_get_final_right(seq, 0), y2); + draw_shadedstrip(seq, background_col, seq_tx_get_final_left(seq, 0), y1, seq_tx_get_final_right(seq, 0), y2); else /* normal operation */ - draw_shadedstrip(seq, col, x1, y1, x2, y2); + draw_shadedstrip(seq, background_col, x1, y1, x2, y2); /* draw additional info and controls */ if (seq->type == SEQ_RAM_SOUND) @@ -814,7 +820,7 @@ static void draw_seq_strip(Sequence *seq, ScrArea *sa, SpaceSeq *sseq, int outli /* nice text here would require changing the view matrix for texture text */ if( (x2-x1) / pixelx > 32) { - draw_seq_text(seq, x1, x2, y1, y2); + draw_seq_text(seq, x1, x2, y1, y2, background_col); } } diff --git a/source/blender/src/editarmature.c b/source/blender/src/editarmature.c index 3d0f26960d6..80c24f3a989 100644 --- a/source/blender/src/editarmature.c +++ b/source/blender/src/editarmature.c @@ -1033,87 +1033,6 @@ static void *get_nearest_bone (short findunsel) return NULL; } -/* used by posemode and editmode */ -void select_bone_parent (void) -{ - Object *ob; - bArmature *arm; - - /* get data */ - if (G.obedit) - ob= G.obedit; - else if (OBACT) - ob= OBACT; - else - return; - arm= (bArmature *)ob->data; - - /* determine which mode armature is in */ - if ((!G.obedit) && (ob->flag & OB_POSEMODE)) { - /* deal with pose channels */ - /* channels are sorted on dependency, so the loop below won't result in a flood-select */ - bPoseChannel *pchan=NULL; - - for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - /* check if bone in original selection */ - if (pchan->bone->flag & BONE_SELECTED) { - bPoseChannel *chanpar= pchan->parent; - - /* check if any parent */ - if ((chanpar) && ((chanpar->bone->flag & BONE_SELECTED)==0)) { - chanpar->bone->flag |= BONE_SELECTED; - select_actionchannel_by_name (ob->action, pchan->name, 1); - } - } - } - } - else if (G.obedit) { - /* deal with editbones */ - EditBone *curbone, *parbone, *parpar; - - /* prevent floods */ - for (curbone= G.edbo.first; curbone; curbone= curbone->next) - curbone->temp= NULL; - - for (curbone= G.edbo.first; curbone; curbone= curbone->next) { - /* check if bone selected */ - if ((curbone->flag & BONE_SELECTED) && curbone->temp==NULL) { - parbone= curbone->parent; - - /* check if any parent */ - if ((parbone) && ((parbone->flag & BONE_SELECTED)==0)) { - /* select the parent bone */ - parbone->flag |= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL); - - /* check if parent has parent */ - parpar= parbone->parent; - - if ((parpar) && (parbone->flag & BONE_CONNECTED)) { - parpar->flag |= BONE_TIPSEL; - } - /* tag this bone to not flood selection */ - parbone->temp= parbone; - } - } - } - - /* to be sure... */ - for (curbone= G.edbo.first; curbone; curbone= curbone->next) - curbone->temp= NULL; - - } - - /* undo + redraw pushes */ - countall(); // flushes selection! - - allqueue (REDRAWVIEW3D, 0); - allqueue (REDRAWBUTSEDIT, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWOOPS, 0); - - BIF_undo_push("Select Parent"); -} - /* helper for setflag_sel_bone() */ static void bone_setflag (int *bone, int flag, short mode) { @@ -1139,6 +1058,89 @@ static void bone_setflag (int *bone, int flag, short mode) } } +/* Get the first available child of an editbone */ +static EditBone *editbone_get_child(EditBone *pabone, short use_visibility) +{ + Object *ob; + bArmature *arm; + EditBone *curbone, *chbone=NULL; + + if (!G.obedit) return NULL; + else ob= G.obedit; + arm= (bArmature *)ob->data; + + for (curbone= G.edbo.first; curbone; curbone= curbone->next) { + if (curbone->parent == pabone) { + if (use_visibility) { + if ((arm->layer & curbone->layer) && !(pabone->flag & BONE_HIDDEN_A)) + chbone = curbone; + } + else + chbone = curbone; + } + } + + return chbone; +} + +void armature_select_hierarchy(short direction, short add_to_sel) +{ + Object *ob; + bArmature *arm; + EditBone *curbone, *pabone, *chbone; + + if (!G.obedit) return; + else ob= G.obedit; + arm= (bArmature *)ob->data; + + for (curbone= G.edbo.first; curbone; curbone= curbone->next) { + if (arm->layer & curbone->layer) { + if (curbone->flag & (BONE_ACTIVE)) { + if (direction == BONE_SELECT_PARENT) { + if (curbone->parent == NULL) continue; + else pabone = curbone->parent; + + if ((arm->layer & pabone->layer) && !(pabone->flag & BONE_HIDDEN_A)) { + pabone->flag |= (BONE_ACTIVE|BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL); + if (pabone->parent) pabone->parent->flag |= BONE_TIPSEL; + + if (!add_to_sel) curbone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL); + curbone->flag &= ~BONE_ACTIVE; + break; + } + + } else { // BONE_SELECT_CHILD + chbone = editbone_get_child(curbone, 1); + if (chbone == NULL) continue; + + if ((arm->layer & chbone->layer) && !(chbone->flag & BONE_HIDDEN_A)) { + chbone->flag |= (BONE_ACTIVE|BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL); + + if (!add_to_sel) { + curbone->flag &= ~(BONE_SELECTED|BONE_ROOTSEL); + if (curbone->parent) curbone->parent->flag &= ~BONE_TIPSEL; + } + curbone->flag &= ~BONE_ACTIVE; + break; + } + } + } + } + } + + countall(); // flushes selection! + + allqueue (REDRAWVIEW3D, 0); + allqueue (REDRAWBUTSEDIT, 0); + allqueue (REDRAWBUTSOBJECT, 0); + allqueue (REDRAWOOPS, 0); + + if (direction==BONE_SELECT_PARENT) + BIF_undo_push("Select edit bone parent"); + if (direction==BONE_SELECT_CHILD) + BIF_undo_push("Select edit bone child"); +} + /* used by posemode and editmode */ void setflag_armature (short mode) { diff --git a/source/blender/src/editimasel.c b/source/blender/src/editimasel.c index 67e10d771e0..97ddc2e0f1d 100644 --- a/source/blender/src/editimasel.c +++ b/source/blender/src/editimasel.c @@ -1076,6 +1076,12 @@ void winqreadimaselspace(ScrArea *sa, void *spacedata, BWinEvent *evt) toggle_blockhandler(sa, IMASEL_HANDLER_IMAGE, UI_PNL_UNSTOW); scrarea_queue_winredraw(sa); break; + case HKEY: + simasel->flag ^= FILE_HIDE_DOT; + BIF_filelist_free(simasel->files); + do_draw= 1; + do_headdraw= 1; + break; case PKEY: if(G.qual & LR_SHIFTKEY) { extern char bprogname[]; /* usiblender.c */ diff --git a/source/blender/src/editseq.c b/source/blender/src/editseq.c index 12019a9dab9..e9d0b57a166 100644 --- a/source/blender/src/editseq.c +++ b/source/blender/src/editseq.c @@ -644,6 +644,7 @@ static int seq_is_parent(Sequence *par, Sequence *seq) static int seq_is_predecessor(Sequence *pred, Sequence *seq) { + if (!pred) return 0; if(pred == seq) return 0; else if(seq_is_parent(pred, seq)) return 1; else if(pred->seq1 && seq_is_predecessor(pred->seq1, seq)) return 1; diff --git a/source/blender/src/header_info.c b/source/blender/src/header_info.c index dac7c7bc2c6..a9280d9dd19 100644 --- a/source/blender/src/header_info.c +++ b/source/blender/src/header_info.c @@ -540,6 +540,42 @@ static void check_packAll() } } +#ifdef _WIN32 +static void copy_game_dll(char *dll_filename, char *source_dir, char *dest_dir) +{ + char source_filename[FILE_MAX]; + char dest_filename[FILE_MAX]; + + strcpy( source_filename, source_dir ); + strcat( source_filename, dll_filename ); + + strcpy( dest_filename, dest_dir ); + strcat( dest_filename, dll_filename ); + + if(!BLI_exists(dest_filename)) { + BLI_copy_fileops( source_filename, dest_filename ); + } +} + +static void copy_all_game_dlls(char *str) +{ +#define GAME_DLL_COUNT 7 + char *game_dll_list[GAME_DLL_COUNT]={"gnu_gettext.dll", "libpng.dll", "libtiff.dll", "pthreadVC2.dll", "python25.dll", "SDL.dll", "zlib.dll"}; + + char dest_dir[FILE_MAX]; + char source_dir[FILE_MAX]; + int i; + + strcpy(source_dir, get_install_dir()); + strcat(source_dir, "\\"); + BLI_split_dirfile_basic(str, dest_dir, NULL); + + for (i= 0; i< GAME_DLL_COUNT; i++) { + copy_game_dll(game_dll_list[i], source_dir, dest_dir ); + }; +} +#endif + static int write_runtime(char *str, char *exename) { char *freestr= NULL; @@ -587,7 +623,14 @@ static void write_runtime_check(char *str) #endif write_runtime(str, player); + +#ifdef _WIN32 + // get a list of the .DLLs in the Blender folder and copy all of these to the destination folder if they don't exist + copy_all_game_dlls(str); +#endif } + + /* end keyed functions */ /************************** MAIN MENU *****************************/ @@ -1026,7 +1069,7 @@ static uiBlock *info_externalfiles(void *arg_unused) block= uiNewBlock(&curarea->uiblocks, "info_externalfiles", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); uiBlockSetButmFunc(block, do_info_externalfiles, NULL); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pack into Blend", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pack into .blend file", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, ""); #if 0 uiDefBut(block, BUTM, 1, "Unpack Data to current dir", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, "Removes all packed files from the project and saves them to the current directory"); #endif @@ -1036,8 +1079,8 @@ static uiBlock *info_externalfiles(void *arg_unused) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make all Paths Relative", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 10, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make all Paths Absolute", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 11, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Report Missing Files", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 12, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find Missing Files", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 13, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Report Missing Files...", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 12, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find Missing Files...", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 13, ""); uiBlockSetDirection(block, UI_RIGHT); uiTextBoundsBlock(block, 60); @@ -1078,9 +1121,9 @@ static uiBlock *info_filemenu(void *arg_unused) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Screenshot Subwindow|Ctrl F3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 24, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Screenshot All|Ctrl Shift F3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 25, ""); #if GAMEBLENDER == 1 - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Runtime...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 22, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Game As Runtime...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 22, ""); #ifdef _WIN32 - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Dynamic Runtime...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 23, ""); +// uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Dynamic Runtime...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 23, ""); #endif #endif uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); diff --git a/source/blender/src/header_view3d.c b/source/blender/src/header_view3d.c index 0b48db461e6..948023bebfb 100644 --- a/source/blender/src/header_view3d.c +++ b/source/blender/src/header_view3d.c @@ -166,9 +166,9 @@ void do_layer_buttons(short event) if(event==-1 && (G.qual & LR_CTRLKEY)) { G.vd->scenelock= !G.vd->scenelock; do_view3d_buttons(B_SCENELOCK); - } else if (event==-1) { + } else if (event<0) { if(G.vd->lay== (1<<20)-1) { - if(G.qual & LR_SHIFTKEY) G.vd->lay= oldlay; + if(event==-2 || G.qual & LR_SHIFTKEY) G.vd->lay= oldlay; } else { oldlay= G.vd->lay; @@ -605,6 +605,9 @@ static void do_view3d_viewmenu(void *arg, int event) case 21: /* Grease Pencil */ add_blockhandler(curarea, VIEW3D_HANDLER_GREASEPENCIL, UI_PNL_UNSTOW); break; + case 22: /* View all layers */ + do_layer_buttons(-2); + break; } allqueue(REDRAWVIEW3D, 1); } @@ -648,6 +651,11 @@ static uiBlock *view3d_viewmenu(void *arg_unused) uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + if(G.vd->lay== (1<<20)-1) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Previous Layers|Shift ~", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 22, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show All Layers| ~", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 22, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + if(G.vd->localview) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); if(!G.vd->localview) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Global View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); @@ -726,6 +734,9 @@ void do_view3d_select_object_typemenu(void *arg, int event) case 10: /* Lamp */ selectall_type(OB_LAMP); break; + case 20: + do_layer_buttons(-2); + break; } allqueue(REDRAWVIEW3D, 0); } @@ -1314,12 +1325,21 @@ static void do_view3d_select_armaturemenu(void *arg, int event) case 2: /* Select/Deselect all */ deselectall_armature(1, 1); break; - case 3: /* Select Parent(s) */ - select_bone_parent(); - break; - case 4: /* Swap Select All */ + case 3: /* Swap Select All */ deselectall_armature(3, 1); break; + case 4: /* Select parent */ + armature_select_hierarchy(BONE_SELECT_PARENT, 0); + break; + case 5: /* Select child */ + armature_select_hierarchy(BONE_SELECT_CHILD, 0); + break; + case 6: /* Extend Select parent */ + armature_select_hierarchy(BONE_SELECT_PARENT, 1); + break; + case 7: /* Extend Select child */ + armature_select_hierarchy(BONE_SELECT_CHILD, 1); + break; } allqueue(REDRAWVIEW3D, 0); } @@ -1337,11 +1357,18 @@ static uiBlock *view3d_select_armaturemenu(void *arg_unused) uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Inverse|Ctrl I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Swap Select All|Ctrl I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Parent|[", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Child|]", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Select Parent|Shift [", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Select Child|Shift ]", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Parent(s)|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - if(curarea->headertype==HEADERTOP) { uiBlockSetDirection(block, UI_DOWN); } @@ -1368,12 +1395,21 @@ static void do_view3d_select_pose_armaturemenu(void *arg, int event) case 3: /* Select Target(s) of Constraint(s) */ pose_select_constraint_target(); break; - case 4: /* Select Bone's Parent */ - select_bone_parent(); - break; case 5: /* Swap Select All */ deselectall_posearmature(OBACT, 3, 1); break; + case 6: /* Select parent */ + pose_select_hierarchy(BONE_SELECT_PARENT, 0); + break; + case 7: /* Select child */ + pose_select_hierarchy(BONE_SELECT_CHILD, 0); + break; + case 8: /* Extend Select parent */ + pose_select_hierarchy(BONE_SELECT_PARENT, 1); + break; + case 9: /* Extend Select child */ + pose_select_hierarchy(BONE_SELECT_CHILD, 1); + break; } allqueue(REDRAWVIEW3D, 0); } @@ -1393,8 +1429,17 @@ static uiBlock *view3d_select_pose_armaturemenu(void *arg_unused) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Swap Select All|Ctrl I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Constraint Target|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Parent(s)|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Parent|[", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Child|]", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Select Parent|Shift [", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Select Child|Shift ]", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); + if(curarea->headertype==HEADERTOP) { uiBlockSetDirection(block, UI_DOWN); } @@ -2467,8 +2512,11 @@ static void do_view3d_edit_objectmenu(void *arg, int event) case 15: /* Object Panel */ add_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, UI_PNL_UNSTOW); break; + case 16: /* make proxy object*/ + make_proxy(); + break; #ifdef WITH_VERSE - case 16: /* Share Object at Verse server */ + case 17: /* Share Object at Verse server */ if(session_list.first != session_list.last) session = session_menu(); else session = session_list.first; if(session) b_verse_push_object(session, ob); @@ -2493,7 +2541,7 @@ static uiBlock *view3d_edit_objectmenu(void *arg_unused) if (base) ob= base->object; if(ob && (ob->type == OB_MESH) && (!ob->vnode)) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Share at Verse Server", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Share at Verse Server", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, ""); uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); } } @@ -2519,6 +2567,7 @@ static uiBlock *view3d_edit_objectmenu(void *arg_unused) uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Proxy|Ctrl Alt P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); uiDefIconTextBlockBut(block, view3d_edit_object_makelinksmenu, NULL, ICON_RIGHTARROW_THIN, "Make Links", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, view3d_edit_object_singleusermenu, NULL, ICON_RIGHTARROW_THIN, "Make Single User", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, view3d_edit_object_makelocalmenu, NULL, ICON_RIGHTARROW_THIN, "Make Local", 0, yco-=20, 120, 19, ""); diff --git a/source/blender/src/poseobject.c b/source/blender/src/poseobject.c index b054b435002..28b8729a247 100644 --- a/source/blender/src/poseobject.c +++ b/source/blender/src/poseobject.c @@ -479,6 +479,67 @@ void pose_select_constraint_target(void) } +void pose_select_hierarchy(short direction, short add_to_sel) +{ + Object *ob= OBACT; + bArmature *arm= ob->data; + bPoseChannel *pchan; + Bone *curbone, *pabone, *chbone; + + /* paranoia checks */ + if (!ob && !ob->pose) return; + if (ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return; + + for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { + curbone= pchan->bone; + + if (arm->layer & curbone->layer) { + if (curbone->flag & (BONE_ACTIVE)) { + if (direction == BONE_SELECT_PARENT) { + + if (pchan->parent == NULL) continue; + else pabone= pchan->parent->bone; + + if ((arm->layer & pabone->layer) && !(pabone->flag & BONE_HIDDEN_P)) { + + if (!add_to_sel) curbone->flag &= ~BONE_SELECTED; + curbone->flag &= ~BONE_ACTIVE; + pabone->flag |= (BONE_ACTIVE|BONE_SELECTED); + + select_actionchannel_by_name (ob->action, pchan->name, 0); + select_actionchannel_by_name (ob->action, pchan->parent->name, 1); + break; + } + } else { // BONE_SELECT_CHILD + + if (pchan->child == NULL) continue; + else chbone = pchan->child->bone; + + if ((arm->layer & chbone->layer) && !(chbone->flag & BONE_HIDDEN_P)) { + + if (!add_to_sel) curbone->flag &= ~BONE_SELECTED; + curbone->flag &= ~BONE_ACTIVE; + chbone->flag |= (BONE_ACTIVE|BONE_SELECTED); + + select_actionchannel_by_name (ob->action, pchan->name, 0); + select_actionchannel_by_name (ob->action, pchan->child->name, 1); + break; + } + } + } + } + } + + allqueue (REDRAWVIEW3D, 0); + allqueue (REDRAWBUTSOBJECT, 0); + allqueue (REDRAWOOPS, 0); + + if (direction==BONE_SELECT_PARENT) + BIF_undo_push("Select pose bone parent"); + if (direction==BONE_SELECT_CHILD) + BIF_undo_push("Select pose bone child"); +} + /* context: active channel */ void pose_special_editmenu(void) { diff --git a/source/blender/src/space.c b/source/blender/src/space.c index b4702788e0c..8d86336e12e 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -2428,7 +2428,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt) else if(G.qual==LR_ALTKEY && G.obedit->type==OB_ARMATURE) clear_bone_parent(); else if((G.qual==0) && (G.obedit->type==OB_ARMATURE)) - select_bone_parent(); + armature_select_hierarchy(BONE_SELECT_PARENT, 1); // 1 = add to selection else if((G.qual==(LR_CTRLKEY|LR_ALTKEY)) && (G.obedit->type==OB_ARMATURE)) separate_armature(); else if((G.qual==0) && G.obedit->type==OB_MESH) @@ -2458,7 +2458,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt) start_RBSimulation(); } else if((G.qual==0) && (OBACT) && (OBACT->type==OB_ARMATURE) && (OBACT->flag & OB_POSEMODE)) - select_bone_parent(); + pose_select_hierarchy(BONE_SELECT_PARENT, 1); // 1 = add to selection else if((G.qual==0)) { start_game(); } @@ -2761,6 +2761,19 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt) scrarea_queue_winredraw(curarea); break; + case LEFTBRACKETKEY: + if ((G.obedit) && (G.obedit->type == OB_ARMATURE)) + armature_select_hierarchy(BONE_SELECT_PARENT, (G.qual == LR_SHIFTKEY)); + else if ((ob) && (ob->flag & OB_POSEMODE)) + pose_select_hierarchy(BONE_SELECT_PARENT, (G.qual == LR_SHIFTKEY)); + break; + case RIGHTBRACKETKEY: + if ((G.obedit) && (G.obedit->type == OB_ARMATURE)) + armature_select_hierarchy(BONE_SELECT_CHILD, (G.qual == LR_SHIFTKEY)); + if ((ob) && (ob->flag & OB_POSEMODE)) + pose_select_hierarchy(BONE_SELECT_CHILD, (G.qual == LR_SHIFTKEY)); + break; + case PADSLASHKEY: if(G.qual==0) { if(G.vd->localview) { diff --git a/source/blender/src/toolbox.c b/source/blender/src/toolbox.c index 94d38ee1635..8a8d7c8cec7 100644 --- a/source/blender/src/toolbox.c +++ b/source/blender/src/toolbox.c @@ -125,8 +125,6 @@ void asciitoraw(int ch, unsigned short *event, unsigned short *qual) { - if( isalpha(ch)==0 ) return; - if( isupper(ch) ) { *qual= LEFTSHIFTKEY; ch= tolower(ch); @@ -804,7 +802,10 @@ static void tb_do_hotkey(void *arg, int event) case 'd': key= PAGEDOWNKEY; break; } } - else asciitoraw(event, &key, &qual[3]); + else if (isalpha(event)) + asciitoraw(event, &key, &qual[3]); + else if (event == '~') + key = ACCENTGRAVEKEY; for (i=0;i<4;i++) { @@ -1213,6 +1214,8 @@ static TBitem tb_view[]= { { 0, "Ortho/Perspective|NumPad 5", TB_PAD|'5', NULL}, { 0, "Local/Global View|NumPad /", TB_PAD|'/', NULL}, { 0, "SEPR", 0, NULL}, +{ 0, "Show All Layers|Shift ~", TB_SHIFT|'~', NULL}, +{ 0, "SEPR", 0, NULL}, { 0, "Align View", 0, tb_view_alignview}, { 0, "SEPR", 0, NULL}, { 0, "View Selected|NumPad .", TB_PAD|'.', NULL}, diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index b3a3a47152a..7de3056e382 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -335,7 +335,7 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, PyDict_SetItemString(dictionaryobject, "GameLogic", gameLogic); // Same as importing the module. initGameKeys(); initPythonConstraintBinding(); - + initMathutils(); if (sceneconverter) { @@ -602,6 +602,7 @@ extern "C" void StartKetsjiShellSimulation(struct ScrArea *area, PyDict_SetItemString(dictionaryobject, "GameLogic", gameLogic); // Same as importing the module initGameKeys(); initPythonConstraintBinding(); + initMathutils(); if (sceneconverter) { diff --git a/source/gameengine/Converter/KX_IpoConvert.cpp b/source/gameengine/Converter/KX_IpoConvert.cpp index 7410beecaf4..ce004fa0504 100644 --- a/source/gameengine/Converter/KX_IpoConvert.cpp +++ b/source/gameengine/Converter/KX_IpoConvert.cpp @@ -766,15 +766,18 @@ void BL_ConvertMaterialIpos( // if there is only one material attached to the mesh then set material_index in BL_ConvertMaterialIpos to NULL // --> this makes the UpdateMaterialData function in KX_GameObject.cpp use the old hack of using SetObjectColor // because this yields a better performance as not all the vertex colors need to be edited - if(mat) ConvertMaterialIpos(mat, NULL, gameobj, converter); + if(mat) ConvertMaterialIpos(mat, 0, gameobj, converter); } else { for (int material_index=1; material_index <= blenderobject->totcol; material_index++) { Material *mat = give_current_material(blenderobject, material_index); - STR_HashedString matname = mat->id.name; - if(mat) ConvertMaterialIpos(mat, matname.hash(), gameobj, converter); + STR_HashedString matname; + if(mat) { + matname= mat->id.name; + ConvertMaterialIpos(mat, matname.hash(), gameobj, converter); + } } } } diff --git a/source/gameengine/GamePlayer/common/windows/GPW_Canvas.h b/source/gameengine/GamePlayer/common/windows/GPW_Canvas.h index bb1abd71505..bf8cb720811 100644 --- a/source/gameengine/GamePlayer/common/windows/GPW_Canvas.h +++ b/source/gameengine/GamePlayer/common/windows/GPW_Canvas.h @@ -36,7 +36,7 @@ #include #include -#include +//#include #include "GPC_Canvas.h" diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp index b5ebffb9378..7be3b94d8ae 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -56,6 +56,7 @@ extern "C" #include "BLO_readfile.h" #include "BKE_global.h" #include "BKE_main.h" +#include "DNA_scene_types.h" #ifdef __cplusplus } #endif // __cplusplus @@ -647,7 +648,7 @@ bool GPG_Application::startEngine(void) PyDict_SetItemString(dictionaryobject, "GameLogic", initGameLogic(startscene)); // Same as importing the module initGameKeys(); initPythonConstraintBinding(); - + initMathutils(); @@ -669,6 +670,11 @@ bool GPG_Application::startEngine(void) m_ketsjiengine->StartEngine(true); m_engineRunning = true; + // Set the animation playback rate for ipo's and actions + // the framerate below should patch with FPS macro defined in blendef.h + // Could be in StartEngine set the framerate, we need the scene to do this + m_ketsjiengine->SetAnimFrameRate( (((double) G.scene->r.frs_sec) / G.scene->r.frs_sec_base) ); + } if (!m_engineRunning) diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 02d1ad1b12b..661bf17ef23 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -914,6 +914,7 @@ PyMethodDef KX_GameObject::Methods[] = { KX_PYMETHODTABLE(KX_GameObject, rayCastTo), KX_PYMETHODTABLE(KX_GameObject, rayCast), KX_PYMETHODTABLE(KX_GameObject, getDistanceTo), + KX_PYMETHODTABLE(KX_GameObject, getVectTo), {NULL,NULL} //Sentinel }; @@ -1367,14 +1368,15 @@ PyObject* KX_GameObject::PyGetMesh(PyObject* self, { int mesh = 0; - if (PyArg_ParseTuple(args, "|i", &mesh)) + if (!PyArg_ParseTuple(args, "|i", &mesh)) + return NULL; // python sets a simple error + + if (((unsigned int)mesh < m_meshes.size()) && mesh >= 0) { - if (((unsigned int)mesh < m_meshes.size()) && mesh >= 0) - { - KX_MeshProxy* meshproxy = new KX_MeshProxy(m_meshes[mesh]); - return meshproxy; - } + KX_MeshProxy* meshproxy = new KX_MeshProxy(m_meshes[mesh]); + return meshproxy; } + Py_RETURN_NONE; } @@ -1488,6 +1490,9 @@ PyObject* KX_GameObject::PyAlignAxisToVect(PyObject* self, MT_Vector3 vect; if (PyVecTo(pyvect, vect)) { + if (fac<=0.0) Py_RETURN_NONE; // Nothing to do. + if (fac< 1.0) fac= 1.0; + AlignAxisToVect(vect,axis,fac); NodeUpdateGS(0.f,true); Py_RETURN_NONE; @@ -1555,6 +1560,54 @@ KX_PYMETHODDEF_DOC(KX_GameObject, getDistanceTo, return NULL; } +KX_PYMETHODDEF_DOC(KX_GameObject, getVectTo, +"getVectTo(other): get vector and the distance to another point/KX_GameObject\n" +"Returns a 3-tuple with (distance,worldVector,localVector)\n") +{ + MT_Point3 toPoint, fromPoint; + MT_Vector3 toDir, locToDir; + MT_Scalar distance; + + PyObject *returnValue; + PyObject *pyother; + + if (!PyVecArgTo(args, toPoint)) + { + PyErr_Clear(); + if (PyArg_ParseTuple(args, "O!", &KX_GameObject::Type, &pyother)) + { + KX_GameObject *other = static_cast(pyother); + toPoint = other->NodeGetWorldPosition(); + }else + { + PyErr_SetString(PyExc_TypeError, "Expected a 3D Vector or GameObject type"); + return NULL; + } + } + + fromPoint = NodeGetWorldPosition(); + toDir = toPoint-fromPoint; + distance = toDir.length(); + + if (MT_fuzzyZero(distance)) + { + //cout << "getVectTo() Error: Null vector!\n"; + locToDir = toDir = MT_Vector3(0.0,0.0,0.0); + distance = 0.0; + } else { + toDir.normalize(); + locToDir = toDir * NodeGetWorldOrientation(); + } + + returnValue = PyTuple_New(3); + if (returnValue) { // very unlikely to fail, python sets a memory error here. + PyTuple_SET_ITEM(returnValue, 0, PyFloat_FromDouble(distance)); + PyTuple_SET_ITEM(returnValue, 1, PyObjectFrom(toDir)); + PyTuple_SET_ITEM(returnValue, 2, PyObjectFrom(locToDir)); + } + return returnValue; +} + bool KX_GameObject::RayHit(KX_ClientObjectInfo* client, MT_Point3& hit_point, MT_Vector3& hit_normal, void * const data) { @@ -1588,8 +1641,7 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCastTo, char *propName = NULL; if (!PyArg_ParseTuple(args,"O|fs", &pyarg, &dist, &propName)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); - return NULL; + return NULL; // python sets simple error } if (!PyVecTo(pyarg, toPoint)) @@ -1654,8 +1706,7 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCast, KX_GameObject *other; if (!PyArg_ParseTuple(args,"O|Ofs", &pyto, &pyfrom, &dist, &propName)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); - return NULL; + return NULL; // Python sets a simple error } if (!PyVecTo(pyto, toPoint)) @@ -1714,13 +1765,11 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCast, if (m_pHitObject) { PyObject* returnValue = PyTuple_New(3); - if (!returnValue) { - PyErr_SetString(PyExc_TypeError, "PyTuple_New() failed"); - return NULL; + if (returnValue) { // unlikely this would ever fail, if it does python sets an error + PyTuple_SET_ITEM(returnValue, 0, m_pHitObject->AddRef()); + PyTuple_SET_ITEM(returnValue, 1, PyObjectFrom(resultPoint)); + PyTuple_SET_ITEM(returnValue, 2, PyObjectFrom(resultNormal)); } - PyTuple_SET_ITEM(returnValue, 0, m_pHitObject->AddRef()); - PyTuple_SET_ITEM(returnValue, 1, PyObjectFrom(resultPoint)); - PyTuple_SET_ITEM(returnValue, 2, PyObjectFrom(resultNormal)); return returnValue; } return Py_BuildValue("OOO", Py_None, Py_None, Py_None); diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 1d36798b12f..4e435e9ddf4 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -756,6 +756,7 @@ public: KX_PYMETHOD_DOC(KX_GameObject,rayCastTo); KX_PYMETHOD_DOC(KX_GameObject,rayCast); KX_PYMETHOD_DOC(KX_GameObject,getDistanceTo); + KX_PYMETHOD_DOC(KX_GameObject,getVectTo); private : diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index b66c3e42606..db4793de23d 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -62,6 +62,10 @@ #include "KX_PyMath.h" +extern "C" { + #include "Mathutils.h" // Blender.Mathutils module copied here so the blenderlayer can use. +} + #include "PHY_IPhysicsEnvironment.h" // FIXME: Enable for access to blender python modules. This is disabled because // python has dependencies on a lot of other modules and is a pain to link. @@ -733,7 +737,7 @@ PyObject* initGameLogic(KX_Scene* scene) // quick hack to get gravity hook ErrorObject = PyString_FromString("GameLogic.error"); PyDict_SetItemString(d, "error", ErrorObject); - + // XXXX Add constants here /* To use logic bricks, we need some sort of constants. Here, we associate */ /* constants and sumbolic names. Add them to dictionary d. */ @@ -876,7 +880,7 @@ PyObject *KXpy_import(PyObject *self, PyObject *args) /* quick hack for GamePython modules TODO: register builtin modules properly by ExtendInittab */ if (!strcmp(name, "GameLogic") || !strcmp(name, "GameKeys") || !strcmp(name, "PhysicsConstraints") || - !strcmp(name, "Rasterizer")) { + !strcmp(name, "Rasterizer") || !strcmp(name, "Mathutils")) { return PyImport_ImportModuleEx(name, globals, locals, fromlist); } @@ -1169,6 +1173,11 @@ PyObject* initGameKeys() return d; } +PyObject* initMathutils() +{ + return Mathutils_Init("Mathutils"); // Use as a top level module in BGE +} + void PHY_SetActiveScene(class KX_Scene* scene) { gp_KetsjiScene = scene; diff --git a/source/gameengine/Ketsji/KX_PythonInit.h b/source/gameengine/Ketsji/KX_PythonInit.h index 41cf7fd67b3..f094a1ca575 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.h +++ b/source/gameengine/Ketsji/KX_PythonInit.h @@ -44,6 +44,7 @@ PyObject* initGameLogic(class KX_Scene* ketsjiscene); PyObject* initGameKeys(); PyObject* initRasterizer(class RAS_IRasterizer* rasty,class RAS_ICanvas* canvas); PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecurityLevel level); +PyObject* initMathutils(); void exitGamePlayerPythonScripting(); PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLevel level); void exitGamePythonScripting(); diff --git a/source/gameengine/Ketsji/KX_TouchEventManager.cpp b/source/gameengine/Ketsji/KX_TouchEventManager.cpp index 7528fdbbc34..48d4cf59a2b 100644 --- a/source/gameengine/Ketsji/KX_TouchEventManager.cpp +++ b/source/gameengine/Ketsji/KX_TouchEventManager.cpp @@ -100,17 +100,17 @@ bool KX_TouchEventManager::newBroadphaseResponse(void *client_data, void KX_TouchEventManager::RegisterSensor(SCA_ISensor* sensor) { KX_TouchSensor* touchsensor = static_cast(sensor); - m_sensors.insert(touchsensor); - - touchsensor->RegisterSumo(this); + if (m_sensors.insert(touchsensor).second) + // the sensor was effectively inserted, register it + touchsensor->RegisterSumo(this); } void KX_TouchEventManager::RemoveSensor(SCA_ISensor* sensor) { KX_TouchSensor* touchsensor = static_cast(sensor); - m_sensors.erase(touchsensor); - - touchsensor->UnregisterSumo(this); + if (m_sensors.erase(touchsensor)) + // the sensor was effectively removed, unregister it + touchsensor->UnregisterSumo(this); } diff --git a/source/gameengine/Ketsji/SConscript b/source/gameengine/Ketsji/SConscript index fdac5a71071..f6f744b199a 100644 --- a/source/gameengine/Ketsji/SConscript +++ b/source/gameengine/Ketsji/SConscript @@ -5,7 +5,21 @@ Import ('env') sources = env.Glob('*.cpp') -incs = '. #source/kernel/gen_system #intern/string #intern/guardedalloc' +# Mathutils C files. +sources.extend([\ + '#source/blender/python/api2_2x/Mathutils.c',\ + '#source/blender/python/api2_2x/constant.c',\ + '#source/blender/python/api2_2x/euler.c',\ + '#source/blender/python/api2_2x/gen_utils.c',\ + '#source/blender/python/api2_2x/matrix.c',\ + '#source/blender/python/api2_2x/point.c',\ + '#source/blender/python/api2_2x/quat.c',\ + '#source/blender/python/api2_2x/vector.c',\ +]) + +incs = '. #source/blender/python/api2_2x' # Only for Mathutils! - no other deps + +incs += ' #source/kernel/gen_system #intern/string #intern/guardedalloc' incs += ' #source/gameengine/Rasterizer/RAS_OpenGLRasterizer #intern/bmfont' incs += ' #intern/SoundSystem #intern/SoundSystem/include #intern/SoundSystem/openal' incs += ' #intern/SoundSystem/dummy #intern/SoundSystem/intern #source/gameengine/Converter' diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index 5c70b071661..b872fae6138 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -42,7 +42,8 @@ CcdPhysicsController::CcdPhysicsController (const CcdConstructionInfo& ci) { m_collisionDelay = 0; m_newClientInfo = 0; - + m_registerCount = 0; + m_MotionState = ci.m_MotionState; m_bulletMotionState = 0; @@ -217,7 +218,7 @@ void CcdPhysicsController::WriteDynamicsToMotionState() void CcdPhysicsController::PostProcessReplica(class PHY_IMotionState* motionstate,class PHY_IPhysicsController* parentctrl) { m_MotionState = motionstate; - + m_registerCount = 0; m_body = 0; diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h index 64f1876e199..448e5622eff 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h @@ -110,12 +110,19 @@ class CcdPhysicsController : public PHY_IPhysicsController void* m_newClientInfo; - + int m_registerCount; // needed when multiple sensors use the same controller CcdConstructionInfo m_cci;//needed for replication void GetWorldOrientation(btMatrix3x3& mat); void CreateRigidbody(); + bool Register() { + return (m_registerCount++ == 0) ? true : false; + } + bool Unregister() { + return (--m_registerCount == 0) ? true : false; + } + protected: void setWorldOrientation(const btMatrix3x3& mat); diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index ea14c5430e2..08f40424323 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -439,6 +439,9 @@ void CcdPhysicsEnvironment::removeCcdPhysicsController(CcdPhysicsController* ctr m_dynamicsWorld->removeRigidBody(ctrl->GetRigidBody()); m_controllers.erase(ctrl); + if (ctrl->m_registerCount != 0) + printf("Warning: removing controller with non-zero m_registerCount: %d\n", ctrl->m_registerCount); + //remove it from the triggers m_triggerControllers.erase(ctrl); } @@ -473,6 +476,13 @@ void CcdPhysicsEnvironment::enableCcdPhysicsController(CcdPhysicsController* ctr } } +void CcdPhysicsEnvironment::disableCcdPhysicsController(CcdPhysicsController* ctrl) +{ + if (m_controllers.erase(ctrl)) + { + m_dynamicsWorld->removeRigidBody(ctrl->GetRigidBody()); + } +} void CcdPhysicsEnvironment::beginFrame() @@ -885,13 +895,17 @@ void CcdPhysicsEnvironment::addSensor(PHY_IPhysicsController* ctrl) void CcdPhysicsEnvironment::removeCollisionCallback(PHY_IPhysicsController* ctrl) { - m_triggerControllers.erase((CcdPhysicsController*)ctrl); + CcdPhysicsController* ccdCtrl = (CcdPhysicsController*)ctrl; + if (ccdCtrl->Unregister()) + m_triggerControllers.erase(ccdCtrl); } void CcdPhysicsEnvironment::removeSensor(PHY_IPhysicsController* ctrl) { - removeCcdPhysicsController((CcdPhysicsController*)ctrl); + removeCollisionCallback(ctrl); + + disableCcdPhysicsController((CcdPhysicsController*)ctrl); } void CcdPhysicsEnvironment::addTouchCallback(int response_class, PHY_ResponseCallback callback, void *user) @@ -930,8 +944,8 @@ void CcdPhysicsEnvironment::requestCollisionCallback(PHY_IPhysicsController* ctr { CcdPhysicsController* ccdCtrl = static_cast(ctrl); - //printf("requestCollisionCallback\n"); - m_triggerControllers.insert(ccdCtrl); + if (ccdCtrl->Register()) + m_triggerControllers.insert(ccdCtrl); } void CcdPhysicsEnvironment::CallbackTriggers() diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h index fd96522037e..825a5e525f2 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h @@ -186,10 +186,7 @@ protected: void updateCcdPhysicsController(CcdPhysicsController* ctrl, btScalar newMass, int newCollisionFlags, short int newCollisionGroup, short int newCollisionMask); - void disableCcdPhysicsController(CcdPhysicsController* ctrl) - { - removeCcdPhysicsController(ctrl); - } + void disableCcdPhysicsController(CcdPhysicsController* ctrl); void enableCcdPhysicsController(CcdPhysicsController* ctrl); diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index 8f17cf26f15..a5ba5b1d634 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -253,6 +253,16 @@ class KX_GameObject: @type other: L{KX_GameObject} or list [x, y, z] @rtype: float """ + def getVectTo(other): + """ + Returns the vector and the distance to another object or point. + The vector is normalized unless the distance is 0, in which a NULL vector is returned. + + @param other: a point or another L{KX_GameObject} to get the vector and distance to. + @type other: L{KX_GameObject} or list [x, y, z] + @rtype: 3-tuple (float, 3-tuple (x,y,z), 3-tuple (x,y,z)) + @return: (distance, globalVector(3), localVector(3)) + """ def rayCastTo(other,dist,prop): """ Look towards another point/object and find first object hit within dist that matches prop. From 0b533d022d75063efa1e23f3cdad28a0ffa31513 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Thu, 7 Aug 2008 14:26:27 +0000 Subject: [PATCH 61/76] Added several comments to BLI_kdopbvh Changed BENCH to print both wall-clock/real time and cpu time --- source/blender/blenkernel/intern/shrinkwrap.c | 32 +- source/blender/blenlib/intern/BLI_kdopbvh.c | 788 +++++++++--------- 2 files changed, 384 insertions(+), 436 deletions(-) diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 292bdbebcc6..7c9da6344e3 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -63,43 +63,26 @@ #if 1 -#if 0 -#define BENCH(a) \ - do { \ - clock_t _clock_init = clock(); \ - (a); \ - printf("%s: %fms\n", #a, (float)(clock()-_clock_init)*1000/CLOCKS_PER_SEC); \ - } while(0) - -#define BENCH_VAR(name) clock_t JOIN(_bench_step,name) = 0, JOIN(_bench_total,name) = 0 -#define BENCH_BEGIN(name) JOIN(_bench_step, name) = clock() -#define BENCH_END(name) JOIN(_bench_total,name) += clock() - JOIN(_bench_step,name) -#define BENCH_RESET(name) JOIN(_bench_total, name) = 0 -#define BENCH_REPORT(name) printf("%s: %fms\n", TO_STR(name), JOIN(_bench_total,name)*1000.0f/CLOCKS_PER_SEC) - -#else #include #define BENCH(a) \ do { \ double _t1, _t2; \ struct timeval _tstart, _tend; \ + clock_t _clock_init = clock(); \ gettimeofday ( &_tstart, NULL); \ (a); \ gettimeofday ( &_tend, NULL); \ _t1 = ( double ) _tstart.tv_sec + ( double ) _tstart.tv_usec/ ( 1000*1000 ); \ _t2 = ( double ) _tend.tv_sec + ( double ) _tend.tv_usec/ ( 1000*1000 ); \ - printf("%s: %fms\n", #a, _t2-_t1);\ + printf("%s: %fs (real) %fs (cpu)\n", #a, _t2-_t1, (float)(clock()-_clock_init)/CLOCKS_PER_SEC);\ } while(0) #define BENCH_VAR(name) clock_t JOIN(_bench_step,name) = 0, JOIN(_bench_total,name) = 0 #define BENCH_BEGIN(name) JOIN(_bench_step, name) = clock() #define BENCH_END(name) JOIN(_bench_total,name) += clock() - JOIN(_bench_step,name) #define BENCH_RESET(name) JOIN(_bench_total, name) = 0 -#define BENCH_REPORT(name) printf("%s: %fms\n", TO_STR(name), JOIN(_bench_total,name)*1000.0f/CLOCKS_PER_SEC) - - -#endif +#define BENCH_REPORT(name) printf("%s: %fms (cpu) \n", TO_STR(name), JOIN(_bench_total,name)*1000.0f/CLOCKS_PER_SEC) #else @@ -1109,12 +1092,11 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) if(index != -1) { - float dist; + float dist = nearest.dist; + if(dist > 1e-5) weight *= (dist - calc->keptDist)/dist; + VECCOPY(tmp_co, nearest.co); space_transform_invert(&calc->local2target, tmp_co); - - dist = VecLenf(co, tmp_co); - if(dist > 1e-5) weight *= (dist - calc->keptDist)/dist; VecLerpf(co, co, tmp_co, weight); //linear interpolation } } @@ -1349,7 +1331,7 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) } else { - float dist = VecLenf(tmp_co, nearest.co); + float dist = sasqrt( nearest.dist ); VecLerpf(tmp_co, tmp_co, nearest.co, (dist - calc->keptDist)/dist); //linear interpolation } space_transform_invert(&calc->local2target, tmp_co); diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index ebc0fb70863..7f634def386 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -45,11 +45,11 @@ typedef struct BVHNode { - struct BVHNode **children; // max 8 children + struct BVHNode **children; float *bv; // Bounding volume of all nodes, max 13 axis int index; // face, edge, vertex index char totnode; // how many nodes are used, used for speedup - char main_axis; + char main_axis; // Axis used to split this node } BVHNode; struct BVHTree @@ -281,139 +281,9 @@ int partition_nth_element(BVHNode **a, int _begin, int _end, int n, int axis){ ////////////////////////////////////////////////////////////////////////////////////////////////////// -void BLI_bvhtree_free(BVHTree *tree) -{ - if(tree) - { - MEM_freeN(tree->nodes); - MEM_freeN(tree->nodearray); - MEM_freeN(tree->nodebv); - MEM_freeN(tree->nodechild); - MEM_freeN(tree); - } -} - -// calculate max number of branches -int needed_branches(int tree_type, int leafs) -{ -#if 1 - //Worst case scenary ( return max(0, leafs-tree_type)+1 ) - if(leafs <= tree_type) - return 1; - else - return leafs-tree_type+1; - -#else - //If our bvh kdop is "almost perfect" - //TODO i dont trust the float arithmetic in here (and I am not sure this formula is according to our splitting method) - int i, numbranches = 0; - for(i = 1; i <= (int)ceil((float)((float)log(leafs)/(float)log(tree_type))); i++) - numbranches += (pow(tree_type, i) / tree_type); - - return numbranches; -#endif -} - - -BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis) -{ - BVHTree *tree; - int numnodes, i; - - // theres not support for trees below binary-trees :P - if(tree_type < 2) - return NULL; - - tree = (BVHTree *)MEM_callocN(sizeof(BVHTree), "BVHTree"); - - if(tree) - { - tree->epsilon = epsilon; - tree->tree_type = tree_type; - tree->axis = axis; - - if(axis == 26) - { - tree->start_axis = 0; - tree->stop_axis = 13; - } - else if(axis == 18) - { - tree->start_axis = 7; - tree->stop_axis = 13; - } - else if(axis == 14) - { - tree->start_axis = 0; - tree->stop_axis = 7; - } - else if(axis == 8) // AABB - { - tree->start_axis = 0; - tree->stop_axis = 4; - } - else if(axis == 6) // OBB - { - tree->start_axis = 0; - tree->stop_axis = 3; - } - else - { - MEM_freeN(tree); - return NULL; - } - - - //Allocate arrays - numnodes = maxsize + needed_branches(tree_type, maxsize) + tree_type; - - tree->nodes = (BVHNode **)MEM_callocN(sizeof(BVHNode *)*numnodes, "BVHNodes"); - - if(!tree->nodes) - { - MEM_freeN(tree); - return NULL; - } - - tree->nodebv = (float*)MEM_callocN(sizeof(float)* axis * numnodes, "BVHNodeBV"); - if(!tree->nodebv) - { - MEM_freeN(tree->nodes); - MEM_freeN(tree); - } - - tree->nodechild = (BVHNode**)MEM_callocN(sizeof(BVHNode*) * tree_type * numnodes, "BVHNodeBV"); - if(!tree->nodechild) - { - MEM_freeN(tree->nodebv); - MEM_freeN(tree->nodes); - MEM_freeN(tree); - } - - tree->nodearray = (BVHNode *)MEM_callocN(sizeof(BVHNode)* numnodes, "BVHNodeArray"); - - if(!tree->nodearray) - { - MEM_freeN(tree->nodechild); - MEM_freeN(tree->nodebv); - MEM_freeN(tree->nodes); - MEM_freeN(tree); - return NULL; - } - - //link the dynamic bv and child links - for(i=0; i< numnodes; i++) - { - tree->nodearray[i].bv = tree->nodebv + i * axis; - tree->nodearray[i].children = tree->nodechild + i * tree_type; - } - - } - - return tree; -} - - +/* + * BVHTree bounding volumes functions + */ static void create_kdop_hull(BVHTree *tree, BVHNode *node, float *co, int numpoints, int moving) { float newminmax; @@ -475,36 +345,6 @@ static void refit_kdop_hull(BVHTree *tree, BVHNode *node, int start, int end) } -int BLI_bvhtree_insert(BVHTree *tree, int index, float *co, int numpoints) -{ - int i; - BVHNode *node = NULL; - - // insert should only possible as long as tree->totbranch is 0 - if(tree->totbranch > 0) - return 0; - - if(tree->totleaf+1 >= MEM_allocN_len(tree->nodes)/sizeof(*(tree->nodes))) - return 0; - - // TODO check if have enough nodes in array - - node = tree->nodes[tree->totleaf] = &(tree->nodearray[tree->totleaf]); - tree->totleaf++; - - create_kdop_hull(tree, node, co, numpoints, 0); - node->index= index; - - // inflate the bv with some epsilon - for (i = tree->start_axis; i < tree->stop_axis; i++) - { - node->bv[(2 * i)] -= tree->epsilon; // minimum - node->bv[(2 * i) + 1] += tree->epsilon; // maximum - } - - return 1; -} - // only supports x,y,z axis in the moment // but we should use a plain and simple function here for speed sake static char get_largest_axis(float *bv) @@ -530,109 +370,42 @@ static char get_largest_axis(float *bv) } } -static void bvh_div_nodes(BVHTree *tree, BVHNode *node, int start, int end, int free_node_index) +// bottom-up update of bvh node BV +// join the children on the parent BV +static void node_join(BVHTree *tree, BVHNode *node) { - int i; - - const char laxis = get_largest_axis(node->bv); //determine longest axis to split along - const int slice = (end-start)/tree->tree_type; //division rounded down - const int rest = (end-start)%tree->tree_type; //remainder of division + int i, j; - assert( node->totnode == 0 ); - - node->main_axis = laxis/2; - - // split nodes along longest axis - for (i=0; start < end; node->totnode = ++i) //i counts the current child - { - int tend = start + slice + (i < rest ? 1 : 0); - - assert( tend <= end); - - if(tend-start == 1) // ok, we have 1 left for this node - { - node->children[i] = tree->nodes[start]; - } - else - { - BVHNode *tnode = node->children[i] = tree->nodes[free_node_index] = &(tree->nodearray[free_node_index]); - - if(tend != end) - partition_nth_element(tree->nodes, start, end, tend, laxis); - - refit_kdop_hull(tree, tnode, start, tend); - - bvh_div_nodes(tree, tnode, start, tend, free_node_index+1); - free_node_index += needed_branches(tree->tree_type, tend-start); - } - start = tend; - } - - return; -} - -static void omp_bvh_div_nodes(BVHTree *tree, BVHNode *node, int start, int end, int free_node_index) -{ - int i; - - const char laxis = get_largest_axis(node->bv); //determine longest axis to split along - const int slice = (end-start)/tree->tree_type; //division rounded down - const int rest = (end-start)%tree->tree_type; //remainder of division - - int omp_data_start[tree->tree_type]; - int omp_data_end [tree->tree_type]; - int omp_data_index[tree->tree_type]; - - assert( node->totnode == 0 ); - - node->main_axis = laxis/2; - - // split nodes along longest axis - for (i=0; start < end; node->totnode = ++i) //i counts the current child - { - //Split the rest from left to right (TODO: this doenst makes an optimal tree) - int tend = start + slice + (i < rest ? 1 : 0); - - assert( tend <= end); - - //save data for later OMP - omp_data_start[i] = start; - omp_data_end [i] = tend; - omp_data_index[i] = free_node_index; - - if(tend-start == 1) - { - node->children[i] = tree->nodes[start]; - } - else - { - node->children[i] = tree->nodes[free_node_index] = &(tree->nodearray[free_node_index]); - - if(tend != end) - partition_nth_element(tree->nodes, start, end, tend, laxis); - - free_node_index += needed_branches(tree->tree_type, tend-start); - } - - start = tend; - } - -#pragma omp parallel for private(i) schedule(static) - for( i = 0; i < node->totnode; i++) + for (i = tree->start_axis; i < tree->stop_axis; i++) { - if(omp_data_end[i]-omp_data_start[i] > 1) - { - BVHNode *tnode = node->children[i]; - refit_kdop_hull(tree, tnode, omp_data_start[i], omp_data_end[i]); - bvh_div_nodes (tree, tnode, omp_data_start[i], omp_data_end[i], omp_data_index[i]+1); - } + node->bv[2*i] = FLT_MAX; + node->bv[2*i + 1] = -FLT_MAX; } - return; + for (i = 0; i < tree->tree_type; i++) + { + if (node->children[i]) + { + for (j = tree->start_axis; j < tree->stop_axis; j++) + { + // update minimum + if (node->children[i]->bv[(2 * j)] < node->bv[(2 * j)]) + node->bv[(2 * j)] = node->children[i]->bv[(2 * j)]; + + // update maximum + if (node->children[i]->bv[(2 * j) + 1] > node->bv[(2 * j) + 1]) + node->bv[(2 * j) + 1] = node->children[i]->bv[(2 * j) + 1]; + } + } + else + break; + } } - -static void print_tree(BVHTree *tree, BVHNode *node, int depth) +/* + * Debug and information functions + */ +static void bvhtree_print_tree(BVHTree *tree, BVHNode *node, int depth) { int i; for(i=0; itree_type; i++) if(node->children[i]) - print_tree(tree, node->children[i], depth+1); + bvhtree_print_tree(tree, node->children[i], depth+1); +} + +static void bvhtree_info(BVHTree *tree) +{ + printf("BVHTree info\n"); + printf("tree_type = %d, axis = %d, epsilon = %f\n", tree->tree_type, tree->axis, tree->epsilon); + printf("nodes = %d, branches = %d, leafs = %d\n", tree->totbranch + tree->totleaf, tree->totbranch, tree->totleaf); + printf("Memory per node = %dbytes\n", sizeof(BVHNode) + sizeof(BVHNode*)*tree->tree_type + sizeof(float)*tree->axis); + printf("BV memory = %dbytes\n", MEM_allocN_len(tree->nodebv)); + + printf("Total memory = %dbytes\n", sizeof(BVHTree) + + MEM_allocN_len(tree->nodes) + + MEM_allocN_len(tree->nodearray) + + MEM_allocN_len(tree->nodechild) + + MEM_allocN_len(tree->nodebv) + ); + +// bvhtree_print_tree(tree, tree->nodes[tree->totleaf], 0); } #if 0 + static void verify_tree(BVHTree *tree) { int i, j, check = 0; @@ -696,8 +488,8 @@ static void verify_tree(BVHTree *tree) } #endif -//Helper data and structures to build generalized implicit trees -//This code can be easily reduced +//Helper data and structures to build a min-leaf generalized implicit tree +//This code can be easily reduced (basicly this is only method to calculate pow(k, n) in O(1).. and sutff like that) typedef struct BVHBuildHelper { int tree_type; // @@ -752,52 +544,141 @@ static int implicit_leafs_index(BVHBuildHelper *data, int depth, int child_index return data->remain_leafs; } -//WARNING: Beautiful/tricky code starts here :P -//Generalized implicit trees -static void non_recursive_bvh_div_nodes(BVHTree *tree) +/** + * Generalized implicit tree build + * + * An implicit tree is a tree where its structure is implied, thus there is no need to store child pointers or indexs. + * Its possible to find the position of the child or the parent with simple maths (multiplication and adittion). This type + * of tree is for example used on heaps.. where node N has its childs at indexs N*2 and N*2+1. + * + * Altought in this case the tree type is general.. and not know until runtime. + * tree_type stands for the maximum number of childs that a tree node can have. + * All tree types >= 2 are supported. + * + * Advantages of the used trees include: + * - No need to store child/parent relations (they are implicit); + * - Any node child always has an index greater than the parent; + * - Brother nodes are sequencial in memory; + * + * + * Some math relations derived for general implicit trees: + * + * K = tree_type, ( 2 <= K ) + * ROOT = 1 + * N child of node A = A * K + (2 - K) + N, (0 <= N < K) + * + * Util methods: + * TODO... + * (looping elements, knowing if its a leaf or not.. etc...) + */ + +// This functions returns the number of branches needed to have the requested number of leafs. +static int implicit_needed_branches(int tree_type, int leafs) +{ + return MAX2(1, (leafs + tree_type - 3) / (tree_type-1) ); +} + +/* + * This function handles the problem of "sorting" the leafs (along the split_axis). + * + * It arranges the elements in the given partitions such that: + * - any element in partition N is less or equal to any element in partition N+1. + * - if all elements are diferent all partition will get the same subset of elements + * as if the array was sorted. + * + * partition P is described as the elements in the range ( nth[P] , nth[P+1] ] + * + * TODO: This can be optimized a bit by doing a specialized nth_element instead of K nth_elements + */ +static void split_leafs(BVHNode **leafs_array, int *nth, int partitions, int split_axis) +{ + int i; + for(i=0; i < partitions-1; i++) + { + if(nth[i] >= nth[partitions]) + break; + + partition_nth_element(leafs_array, nth[i], nth[partitions], nth[i+1], split_axis); + } +} + +/* + * This functions builds an optimal implicit tree from the given leafs. + * Where optimal stands for: + * - The resulting tree will have the smallest number of branches; + * - At most only one branch will have NULL childs; + * - All leafs will be stored at level N or N+1. + * + * This function creates an implicit tree on branches_array, the leafs are given on the leafs_array. + * + * The tree is built per depth levels. First branchs at depth 1.. then branches at depth 2.. etc.. + * The reason is that we can build level N+1 from level N witouth any data dependencies.. thus it allows + * to use multithread building. + * + * To archieve this is necessary to find how much leafs are accessible from a certain branch, BVHBuildHelper + * implicit_needed_branches and implicit_leafs_index are auxiliar functions to solve that "optimal-split". + */ +static void non_recursive_bvh_div_nodes(BVHTree *tree, BVHNode *branches_array, BVHNode **leafs_array, int num_leafs) { int i; const int tree_type = tree->tree_type; const int tree_offset = 2 - tree->tree_type; //this value is 0 (on binary trees) and negative on the others - const int num_leafs = tree->totleaf; - const int num_branches= MAX2(1, (num_leafs + tree_type - 3) / (tree_type-1) ); - - BVHNode* branches_array = tree->nodearray + tree->totleaf - 1; // This code uses 1 index arrays - BVHNode** leafs_array = tree->nodes; + const int num_branches= implicit_needed_branches(tree_type, num_leafs); BVHBuildHelper data; - int depth = 0; + int depth; + branches_array--; //Implicit trees use 1-based indexs + build_implicit_tree_helper(tree, &data); - //YAY this could be 1 loop.. but had to split in 2 to remove OMP dependencies - for(i=1; i <= num_branches; i = i*tree_type + tree_offset) + //Loop tree levels (log N) loops + for(i=1, depth = 1; i <= num_branches; i = i*tree_type + tree_offset, depth++) { const int first_of_next_level = i*tree_type + tree_offset; const int end_j = MIN2(first_of_next_level, num_branches + 1); //index of last branch on this level int j; - depth++; - + //Loop all branches on this level #pragma omp parallel for private(j) schedule(static) for(j = i; j < end_j; j++) { int k; const int parent_level_index= j-i; BVHNode* parent = branches_array + j; + int nth_positions[ tree_type + 1 ]; char split_axis; int parent_leafs_begin = implicit_leafs_index(&data, depth, parent_level_index); int parent_leafs_end = implicit_leafs_index(&data, depth, parent_level_index+1); - //split_axis = (depth*2 % 6); //use this instead of the 2 following lines for XYZ splitting - + //This calculates the bounding box of this branch + //and chooses the largest axis as the axis to divide leafs refit_kdop_hull(tree, parent, parent_leafs_begin, parent_leafs_end); split_axis = get_largest_axis(parent->bv); + //Save split axis (this can be used on raytracing to speedup the query time) parent->main_axis = split_axis / 2; + //Split the childs along the split_axis, note: its not needed to sort the whole leafs array + //Only to assure that the elements are partioned on a way that each child takes the elements + //it would take in case the whole array was sorted. + //Split_leafs takes care of that "sort" problem. + nth_positions[ 0] = parent_leafs_begin; + nth_positions[tree_type] = parent_leafs_end; + for(k = 1; k < tree_type; k++) + { + int child_index = j * tree_type + tree_offset + k; + int child_level_index = child_index - first_of_next_level; //child level index + nth_positions[k] = implicit_leafs_index(&data, depth+1, child_level_index); + } + + split_leafs(leafs_array, nth_positions, tree_type, split_axis); + + + //Setup children and totnode counters + //Not really needed but currently most of BVH code relies on having an explicit children structure for(k = 0; k < tree_type; k++) { int child_index = j * tree_type + tree_offset + k; @@ -806,78 +687,236 @@ static void non_recursive_bvh_div_nodes(BVHTree *tree) int child_leafs_begin = implicit_leafs_index(&data, depth+1, child_level_index); int child_leafs_end = implicit_leafs_index(&data, depth+1, child_level_index+1); - assert( k != 0 || child_leafs_begin == parent_leafs_begin); - if(child_leafs_end - child_leafs_begin > 1) - { parent->children[k] = branches_array + child_index; - -/* - printf("Add child %d (%d) to branch %d\n", - branches_array + child_index - tree->nodearray, - branches_array[ child_index ].index, - parent - tree->nodearray - ); -*/ - - partition_nth_element(leafs_array, child_leafs_begin, parent_leafs_end, child_leafs_end, split_axis); - } else if(child_leafs_end - child_leafs_begin == 1) - { -/* - printf("Add child %d (%d) to branch %d\n", - leafs_array[ child_leafs_begin ] - tree->nodearray, - leafs_array[ child_leafs_begin ]->index, - parent - tree->nodearray - ); -*/ parent->children[k] = leafs_array[ child_leafs_begin ]; - } else - { - parent->children[k] = NULL; break; - } + parent->totnode = k+1; } } } +} - for(i = 0; inodes[tree->totleaf + i] = branches_array + 1 + i; +/* + * BLI_bvhtree api + */ +BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis) +{ + BVHTree *tree; + int numnodes, i; + + // theres not support for trees below binary-trees :P + if(tree_type < 2) + return NULL; - tree->totbranch = num_branches; + tree = (BVHTree *)MEM_callocN(sizeof(BVHTree), "BVHTree"); + + if(tree) + { + tree->epsilon = epsilon; + tree->tree_type = tree_type; + tree->axis = axis; + + if(axis == 26) + { + tree->start_axis = 0; + tree->stop_axis = 13; + } + else if(axis == 18) + { + tree->start_axis = 7; + tree->stop_axis = 13; + } + else if(axis == 14) + { + tree->start_axis = 0; + tree->stop_axis = 7; + } + else if(axis == 8) // AABB + { + tree->start_axis = 0; + tree->stop_axis = 4; + } + else if(axis == 6) // OBB + { + tree->start_axis = 0; + tree->stop_axis = 3; + } + else + { + MEM_freeN(tree); + return NULL; + } -// BLI_bvhtree_update_tree(tree); //Uncoment this for XYZ splitting + + //Allocate arrays + numnodes = maxsize + implicit_needed_branches(tree_type, maxsize) + tree_type; + + tree->nodes = (BVHNode **)MEM_callocN(sizeof(BVHNode *)*numnodes, "BVHNodes"); + + if(!tree->nodes) + { + MEM_freeN(tree); + return NULL; + } + + tree->nodebv = (float*)MEM_callocN(sizeof(float)* axis * numnodes, "BVHNodeBV"); + if(!tree->nodebv) + { + MEM_freeN(tree->nodes); + MEM_freeN(tree); + } + + tree->nodechild = (BVHNode**)MEM_callocN(sizeof(BVHNode*) * tree_type * numnodes, "BVHNodeBV"); + if(!tree->nodechild) + { + MEM_freeN(tree->nodebv); + MEM_freeN(tree->nodes); + MEM_freeN(tree); + } + + tree->nodearray = (BVHNode *)MEM_callocN(sizeof(BVHNode)* numnodes, "BVHNodeArray"); + + if(!tree->nodearray) + { + MEM_freeN(tree->nodechild); + MEM_freeN(tree->nodebv); + MEM_freeN(tree->nodes); + MEM_freeN(tree); + return NULL; + } + + //link the dynamic bv and child links + for(i=0; i< numnodes; i++) + { + tree->nodearray[i].bv = tree->nodebv + i * axis; + tree->nodearray[i].children = tree->nodechild + i * tree_type; + } + + } + + return tree; +} + +void BLI_bvhtree_free(BVHTree *tree) +{ + if(tree) + { + MEM_freeN(tree->nodes); + MEM_freeN(tree->nodearray); + MEM_freeN(tree->nodebv); + MEM_freeN(tree->nodechild); + MEM_freeN(tree); + } } void BLI_bvhtree_balance(BVHTree *tree) { - if(tree->totleaf == 0) return; + int i; + BVHNode* branches_array = tree->nodearray + tree->totleaf; + BVHNode** leafs_array = tree->nodes; + + //This function should only be called once (some big bug goes here if its being called more than once per tree) assert(tree->totbranch == 0); - non_recursive_bvh_div_nodes(tree); -/* - if(tree->totleaf != 0) - { - // create root node - BVHNode *node = tree->nodes[tree->totleaf] = &(tree->nodearray[tree->totleaf]); - tree->totbranch++; -< - // refit root bvh node - refit_kdop_hull(tree, node, 0, tree->totleaf); + //Build the implicit tree + non_recursive_bvh_div_nodes(tree, branches_array, leafs_array, tree->totleaf); - // create + balance tree - omp_bvh_div_nodes(tree, node, 0, tree->totleaf, tree->totleaf+1); - tree->totbranch = needed_branches( tree->tree_type, tree->totleaf ); - // verify_tree(tree); - } -*/ + //current code expects the branches to be linked to the nodes array + //we perform that linkage here + tree->totbranch = implicit_needed_branches(tree->tree_type, tree->totleaf); + for(i = 0; i < tree->totbranch; i++) + tree->nodes[tree->totleaf + i] = branches_array + i; + //bvhtree_info(tree); } +int BLI_bvhtree_insert(BVHTree *tree, int index, float *co, int numpoints) +{ + int i; + BVHNode *node = NULL; + + // insert should only possible as long as tree->totbranch is 0 + if(tree->totbranch > 0) + return 0; + + if(tree->totleaf+1 >= MEM_allocN_len(tree->nodes)/sizeof(*(tree->nodes))) + return 0; + + // TODO check if have enough nodes in array + + node = tree->nodes[tree->totleaf] = &(tree->nodearray[tree->totleaf]); + tree->totleaf++; + + create_kdop_hull(tree, node, co, numpoints, 0); + node->index= index; + + // inflate the bv with some epsilon + for (i = tree->start_axis; i < tree->stop_axis; i++) + { + node->bv[(2 * i)] -= tree->epsilon; // minimum + node->bv[(2 * i) + 1] += tree->epsilon; // maximum + } + + return 1; +} + + +// call before BLI_bvhtree_update_tree() +int BLI_bvhtree_update_node(BVHTree *tree, int index, float *co, float *co_moving, int numpoints) +{ + int i; + BVHNode *node= NULL; + + // check if index exists + if(index > tree->totleaf) + return 0; + + node = tree->nodearray + index; + + create_kdop_hull(tree, node, co, numpoints, 0); + + if(co_moving) + create_kdop_hull(tree, node, co_moving, numpoints, 1); + + // inflate the bv with some epsilon + for (i = tree->start_axis; i < tree->stop_axis; i++) + { + node->bv[(2 * i)] -= tree->epsilon; // minimum + node->bv[(2 * i) + 1] += tree->epsilon; // maximum + } + + return 1; +} + +// call BLI_bvhtree_update_node() first for every node/point/triangle +void BLI_bvhtree_update_tree(BVHTree *tree) +{ + //Update bottom=>top + //TRICKY: the way we build the tree all the childs have an index greater than the parent + //This allows us todo a bottom up update by starting on the biger numbered branch + + BVHNode** root = tree->nodes + tree->totleaf; + BVHNode** index = tree->nodes + tree->totleaf + tree->totbranch-1; + + for (; index != root; index--) + node_join(tree, *index); +} + +float BLI_bvhtree_getepsilon(BVHTree *tree) +{ + return tree->epsilon; +} + + +/* + * BLI_bvhtree_overlap + */ // overlap - is it possbile for 2 bv's to collide ? static int tree_overlap(BVHNode *node1, BVHNode *node2, int start_axis, int stop_axis) { @@ -1015,86 +1054,8 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, int *result) } -// bottom up update of bvh tree: -// join the 4 children here -static void node_join(BVHTree *tree, BVHNode *node) -{ - int i, j; - - for (i = tree->start_axis; i < tree->stop_axis; i++) - { - node->bv[2*i] = FLT_MAX; - node->bv[2*i + 1] = -FLT_MAX; - } - - for (i = 0; i < tree->tree_type; i++) - { - if (node->children[i]) - { - for (j = tree->start_axis; j < tree->stop_axis; j++) - { - // update minimum - if (node->children[i]->bv[(2 * j)] < node->bv[(2 * j)]) - node->bv[(2 * j)] = node->children[i]->bv[(2 * j)]; - - // update maximum - if (node->children[i]->bv[(2 * j) + 1] > node->bv[(2 * j) + 1]) - node->bv[(2 * j) + 1] = node->children[i]->bv[(2 * j) + 1]; - } - } - else - break; - } -} - -// call before BLI_bvhtree_update_tree() -int BLI_bvhtree_update_node(BVHTree *tree, int index, float *co, float *co_moving, int numpoints) -{ - int i; - BVHNode *node= NULL; - - // check if index exists - if(index > tree->totleaf) - return 0; - - node = tree->nodearray + index; - - create_kdop_hull(tree, node, co, numpoints, 0); - - if(co_moving) - create_kdop_hull(tree, node, co_moving, numpoints, 1); - - // inflate the bv with some epsilon - for (i = tree->start_axis; i < tree->stop_axis; i++) - { - node->bv[(2 * i)] -= tree->epsilon; // minimum - node->bv[(2 * i) + 1] += tree->epsilon; // maximum - } - - return 1; -} - -// call BLI_bvhtree_update_node() first for every node/point/triangle -void BLI_bvhtree_update_tree(BVHTree *tree) -{ - BVHNode** root = tree->nodes + tree->totleaf; - BVHNode** index = tree->nodes + tree->totleaf + tree->totbranch-1; - - //Update bottom=>top - //TRICKY: the way we build the tree the parent of a child has an index < then the child index - for (; index != root; index--) - node_join(tree, *index); -} - -float BLI_bvhtree_getepsilon(BVHTree *tree) -{ - return tree->epsilon; -} - - - /* - * Nearest neighbour + * Nearest neighbour - BLI_bvhtree_find_nearest */ static float squared_dist(const float *a, const float *b) { @@ -1103,6 +1064,7 @@ static float squared_dist(const float *a, const float *b) return INPR(tmp, tmp); } +//Determines the nearest point of the given node BV. Returns the squared distance to that point. static float calc_nearest_point(BVHNearestData *data, BVHNode *node, float *nearest) { int i; @@ -1174,6 +1136,7 @@ int BLI_bvhtree_find_nearest(BVHTree *tree, const float *co, BVHTreeNearest *nea int i; BVHNearestData data; + BVHNode* root = tree->nodes[tree->totleaf]; //init data to search data.tree = tree; @@ -1198,7 +1161,8 @@ int BLI_bvhtree_find_nearest(BVHTree *tree, const float *co, BVHTreeNearest *nea } //dfs search - dfs_find_nearest(&data, tree->nodes[tree->totleaf] ); + if(root) + dfs_find_nearest(&data, root); //copy back results if(nearest) @@ -1210,11 +1174,13 @@ int BLI_bvhtree_find_nearest(BVHTree *tree, const float *co, BVHTreeNearest *nea } - /* - * Ray cast + * Raycast - BLI_bvhtree_ray_cast + * + * raycast is done by performing a DFS on the BVHTree and saving the closest hit */ +//Determines the distance that the ray must travel to hit the bounding volume of the given node static float ray_nearest_hit(BVHRayCastData *data, BVHNode *node) { int i; @@ -1293,12 +1259,11 @@ static void dfs_raycast(BVHRayCastData *data, BVHNode *node) } } - - int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata) { int i; BVHRayCastData data; + BVHNode * root = tree->nodes[tree->totleaf]; data.tree = tree; @@ -1327,7 +1292,8 @@ int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, BVHTr data.hit.dist = FLT_MAX; } - dfs_raycast(&data, tree->nodes[tree->totleaf]); + if(root) + dfs_raycast(&data, root); if(hit) From 29a44ca927144bc7b99683fb7807c8d6afbdd190 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Thu, 7 Aug 2008 15:18:47 +0000 Subject: [PATCH 62/76] Moved bvhtree_from_mesh api to its own files BKE_bvhutils.h and intern/bvhutils.c --- source/blender/blenkernel/BKE_bvhutils.h | 96 ++++ source/blender/blenkernel/BKE_shrinkwrap.h | 38 +- source/blender/blenkernel/intern/bvhutils.c | 425 ++++++++++++++++++ source/blender/blenkernel/intern/constraint.c | 17 +- source/blender/blenkernel/intern/shrinkwrap.c | 420 +---------------- 5 files changed, 539 insertions(+), 457 deletions(-) create mode 100644 source/blender/blenkernel/BKE_bvhutils.h create mode 100644 source/blender/blenkernel/intern/bvhutils.c diff --git a/source/blender/blenkernel/BKE_bvhutils.h b/source/blender/blenkernel/BKE_bvhutils.h new file mode 100644 index 00000000000..5a0c4ad5545 --- /dev/null +++ b/source/blender/blenkernel/BKE_bvhutils.h @@ -0,0 +1,96 @@ +/** + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2006 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): André Pinto + * + * ***** END GPL LICENSE BLOCK ***** + */ +#ifndef BKE_BVHUTILS_H +#define BKE_BVHUTILS_H + +#include "BLI_kdopbvh.h" + +/* + * This header encapsulates necessary code to buld a BVH + */ + +struct DerivedMesh; +struct MVert; +struct MFace; + +/* + * struct that kepts basic information about a BVHTree build from a mesh + */ +typedef struct BVHTreeFromMesh +{ + struct BVHTree *tree; + + /* default callbacks to bvh nearest and raycast */ + BVHTree_NearestPointCallback nearest_callback; + BVHTree_RayCastCallback raycast_callback; + + /* Mesh represented on this BVHTree */ + struct DerivedMesh *mesh; + + /* Vertex array, so that callbacks have instante access to data */ + struct MVert *vert; + struct MFace *face; + + /* radius for raycast */ + float sphere_radius; + +} BVHTreeFromMesh; + +/* + * Builds a bvh tree where nodes are the vertexs of the given mesh. + * Configures BVHTreeFromMesh. + * + * The tree is build in mesh space coordinates, this means special care must be made on queries + * so that the coordinates and rays are first translated on the mesh local coordinates. + * Reason for this is that later bvh_from_mesh_* might use a cache system and so it becames possible to reuse + * a BVHTree. + * + * free_bvhtree_from_mesh should be called when the tree is no longer needed. + */ +void bvhtree_from_mesh_verts(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis); + +/* + * Builds a bvh tree where nodes are the faces of the given mesh. + * Configures BVHTreeFromMesh. + * + * The tree is build in mesh space coordinates, this means special care must be made on queries + * so that the coordinates and rays are first translated on the mesh local coordinates. + * Reason for this is that later bvh_from_mesh_* might use a cache system and so it becames possible to reuse + * a BVHTree. + * + * free_bvhtree_from_mesh should be called when the tree is no longer needed. + */ +void bvhtree_from_mesh_faces(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis); + +/* + * Frees data allocated by a call to bvhtree_from_mesh_*. + */ +void free_bvhtree_from_mesh(struct BVHTreeFromMesh *data); + +#endif + diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h index 6e154536072..dec9635f14c 100644 --- a/source/blender/blenkernel/BKE_shrinkwrap.h +++ b/source/blender/blenkernel/BKE_shrinkwrap.h @@ -69,46 +69,16 @@ void space_transform_invert(const SpaceTransform *data, float *co); void space_transform_apply_normal (const SpaceTransform *data, float *co); void space_transform_invert_normal(const SpaceTransform *data, float *co); -/* BVH from mesh */ -#include "BLI_kdopbvh.h" - -struct DerivedMesh; -struct MVert; -struct MFace; - -//struct that kepts basic information about a BVHTree build from a mesh -typedef struct BVHTreeFromMesh -{ - struct BVHTree *tree; - - //Callbacks - BVHTree_NearestPointCallback nearest_callback; - BVHTree_RayCastCallback raycast_callback; - - //Mesh represented on this BVH - struct DerivedMesh *mesh; - struct MVert *vert; - struct MFace *face; - - //radius for sphere cast - float sphere_radius; - -} BVHTreeFromMesh; - -// Builds a bvh tree where nodes are the vertexs of the given mesh. And configures BVHMesh if one given. -struct BVHTree* bvhtree_from_mesh_verts(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis); - -// Builds a bvh tree where nodes are the faces of the given mesh. And configures BVHMesh if one is given. -struct BVHTree* bvhtree_from_mesh_faces(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis); - -int normal_projection_project_vertex(char options, const float *vert, const float *dir, const SpaceTransform *transf, BVHTree *tree, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata); - /* Shrinkwrap stuff */ +#include "BKE_bvhutils.h" + struct Object; struct DerivedMesh; struct ShrinkwrapModifierData; struct BVHTree; +/* maybe move to bvh util */ +int normal_projection_project_vertex(char options, const float *vert, const float *dir, const SpaceTransform *transf, BVHTree *tree, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata); typedef struct ShrinkwrapCalcData diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c new file mode 100644 index 00000000000..edf4593d24c --- /dev/null +++ b/source/blender/blenkernel/intern/bvhutils.c @@ -0,0 +1,425 @@ +/** + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): André Pinto. + * + * ***** END GPL LICENSE BLOCK ***** + */ +#include +#include +#include + +#include "BKE_bvhutils.h" + +#include "DNA_object_types.h" +#include "DNA_modifier_types.h" +#include "DNA_meshdata_types.h" + +#include "BKE_shrinkwrap.h" +#include "BKE_DerivedMesh.h" +#include "BKE_utildefines.h" +#include "BKE_deform.h" +#include "BKE_cdderivedmesh.h" +#include "BKE_displist.h" +#include "BKE_global.h" + +#include "BLI_arithb.h" + +/* Math stuff for ray casting on mesh faces and for nearest surface */ + +static float nearest_point_in_tri_surface(const float *point, const float *v0, const float *v1, const float *v2, float *nearest); + +#define ISECT_EPSILON 1e-6 +static float ray_tri_intersection(const BVHTreeRay *ray, const float m_dist, const float *v0, const float *v1, const float *v2) +{ + float dist; + + if(RayIntersectsTriangle(ray->origin, ray->direction, v0, v1, v2, &dist, NULL)) + return dist; + + return FLT_MAX; +} + +static float sphereray_tri_intersection(const BVHTreeRay *ray, float radius, const float m_dist, const float *v0, const float *v1, const float *v2) +{ + + float idist; + float p1[3]; + float plane_normal[3], hit_point[3]; + + CalcNormFloat((float*)v0, (float*)v1, (float*)v2, plane_normal); + + VECADDFAC( p1, ray->origin, ray->direction, m_dist); + if(SweepingSphereIntersectsTriangleUV(ray->origin, p1, radius, v0, v1, v2, &idist, &hit_point)) + { + return idist * m_dist; + } + + return FLT_MAX; +} + +/* + * This calculates the distance from point to the plane + * Distance is negative if point is on the back side of plane + */ +static float point_plane_distance(const float *point, const float *plane_point, const float *plane_normal) +{ + float pp[3]; + VECSUB(pp, point, plane_point); + return INPR(pp, plane_normal); +} +static float choose_nearest(const float v0[2], const float v1[2], const float point[2], float closest[2]) +{ + float d[2][2], sdist[2]; + VECSUB2D(d[0], v0, point); + VECSUB2D(d[1], v1, point); + + sdist[0] = d[0][0]*d[0][0] + d[0][1]*d[0][1]; + sdist[1] = d[1][0]*d[1][0] + d[1][1]*d[1][1]; + + if(sdist[0] < sdist[1]) + { + if(closest) + VECCOPY2D(closest, v0); + return sdist[0]; + } + else + { + if(closest) + VECCOPY2D(closest, v1); + return sdist[1]; + } +} +/* + * calculates the closest point between point-tri (2D) + * returns that tri must be right-handed + * Returns square distance + */ +static float closest_point_in_tri2D(const float point[2], /*const*/ float tri[3][2], float closest[2]) +{ + float edge_di[2]; + float v_point[2]; + float proj[2]; //point projected over edge-dir, edge-normal (witouth normalized edge) + const float *v0 = tri[2], *v1; + float edge_slen, d; //edge squared length + int i; + const float *nearest_vertex = NULL; + + + //for each edge + for(i=0, v0=tri[2], v1=tri[0]; i < 3; v0=tri[i++], v1=tri[i]) + { + VECSUB2D(edge_di, v1, v0); + VECSUB2D(v_point, point, v0); + + proj[1] = v_point[0]*edge_di[1] - v_point[1]*edge_di[0]; //dot product with edge normal + + //point inside this edge + if(proj[1] < 0) + continue; + + proj[0] = v_point[0]*edge_di[0] + v_point[1]*edge_di[1]; + + //closest to this edge is v0 + if(proj[0] < 0) + { + if(nearest_vertex == NULL || nearest_vertex == v0) + nearest_vertex = v0; + else + { + //choose nearest + return choose_nearest(nearest_vertex, v0, point, closest); + } + i++; //We can skip next edge + continue; + } + + edge_slen = edge_di[0]*edge_di[0] + edge_di[1]*edge_di[1]; //squared edge len + //closest to this edge is v1 + if(proj[0] > edge_slen) + { + if(nearest_vertex == NULL || nearest_vertex == v1) + nearest_vertex = v1; + else + { + return choose_nearest(nearest_vertex, v1, point, closest); + } + continue; + } + + //nearest is on this edge + d= proj[1] / edge_slen; + closest[0] = point[0] - edge_di[1] * d; + closest[1] = point[1] + edge_di[0] * d; + + return proj[1]*proj[1]/edge_slen; + } + + if(nearest_vertex) + { + VECSUB2D(v_point, nearest_vertex, point); + VECCOPY2D(closest, nearest_vertex); + return v_point[0]*v_point[0] + v_point[1]*v_point[1]; + } + else + { + VECCOPY(closest, point); //point is already inside + return 0.0f; + } +} + +/* + * Returns the square of the minimum distance between the point and a triangle surface + * If nearest is not NULL the nearest surface point is written on it + */ +static float nearest_point_in_tri_surface(const float *point, const float *v0, const float *v1, const float *v2, float *nearest) +{ + //Lets solve the 2D problem (closest point-tri) + float normal_dist, plane_sdist, plane_offset; + float du[3], dv[3], dw[3]; //orthogonal axis (du=(v0->v1), dw=plane normal) + + float p_2d[2], tri_2d[3][2], nearest_2d[2]; + + CalcNormFloat((float*)v0, (float*)v1, (float*)v2, dw); + + //point-plane distance and calculate axis + normal_dist = point_plane_distance(point, v0, dw); + + // OPTIMIZATION + // if we are only interested in nearest distance if its closer than some distance already found + // we can: + // if(normal_dist*normal_dist >= best_dist_so_far) return FLOAT_MAX; + // + + VECSUB(du, v1, v0); + Normalize(du); + Crossf(dv, dw, du); + plane_offset = INPR(v0, dw); + + //project stuff to 2d + tri_2d[0][0] = INPR(du, v0); + tri_2d[0][1] = INPR(dv, v0); + + tri_2d[1][0] = INPR(du, v1); + tri_2d[1][1] = INPR(dv, v1); + + tri_2d[2][0] = INPR(du, v2); + tri_2d[2][1] = INPR(dv, v2); + + p_2d[0] = INPR(du, point); + p_2d[1] = INPR(dv, point); + + //we always have a right-handed tri + //this should always happen because of the way normal is calculated + plane_sdist = closest_point_in_tri2D(p_2d, tri_2d, nearest_2d); + + //project back to 3d + if(nearest) + { + nearest[0] = du[0]*nearest_2d[0] + dv[0] * nearest_2d[1] + dw[0] * plane_offset; + nearest[1] = du[1]*nearest_2d[0] + dv[1] * nearest_2d[1] + dw[1] * plane_offset; + nearest[2] = du[2]*nearest_2d[0] + dv[2] * nearest_2d[1] + dw[2] * plane_offset; + } + + return plane_sdist + normal_dist*normal_dist; +} + + +/* + * BVH from meshs callbacks + */ + +// Callback to bvh tree nearest point. The tree must bust have been built using bvhtree_from_mesh_faces. +// userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree. +static void mesh_faces_nearest_point(void *userdata, int index, const float *co, BVHTreeNearest *nearest) +{ + const BVHTreeFromMesh *data = (BVHTreeFromMesh*) userdata; + MVert *vert = data->vert; + MFace *face = data->face + index; + + float *t0, *t1, *t2, *t3; + t0 = vert[ face->v1 ].co; + t1 = vert[ face->v2 ].co; + t2 = vert[ face->v3 ].co; + t3 = face->v4 ? vert[ face->v4].co : NULL; + + + do + { + float nearest_tmp[3], dist; + + dist = nearest_point_in_tri_surface(co,t0, t1, t2, nearest_tmp); + if(dist < nearest->dist) + { + nearest->index = index; + nearest->dist = dist; + VECCOPY(nearest->co, nearest_tmp); + CalcNormFloat((float*)t0, (float*)t1, (float*)t2, nearest->no); //TODO.. (interpolate normals from the vertexs coordinates? + } + + + t1 = t2; + t2 = t3; + t3 = NULL; + + } while(t2); +} + +// Callback to bvh tree raycast. The tree must bust have been built using bvhtree_from_mesh_faces. +// userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree. +static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) +{ + const BVHTreeFromMesh *data = (BVHTreeFromMesh*) userdata; + MVert *vert = data->vert; + MFace *face = data->face + index; + + float *t0, *t1, *t2, *t3; + t0 = vert[ face->v1 ].co; + t1 = vert[ face->v2 ].co; + t2 = vert[ face->v3 ].co; + t3 = face->v4 ? vert[ face->v4].co : NULL; + + + do + { + float dist; + if(data->sphere_radius == 0.0f) + dist = ray_tri_intersection(ray, hit->dist, t0, t1, t2); + else + dist = sphereray_tri_intersection(ray, data->sphere_radius, hit->dist, t0, t1, t2); + + if(dist >= 0 && dist < hit->dist) + { + hit->index = index; + hit->dist = dist; + VECADDFAC(hit->co, ray->origin, ray->direction, dist); + + CalcNormFloat(t0, t1, t2, hit->no); + } + + t1 = t2; + t2 = t3; + t3 = NULL; + + } while(t2); +} + +/* + * BVH builders + */ +// Builds a bvh tree.. where nodes are the vertexs of the given mesh +void bvhtree_from_mesh_verts(BVHTreeFromMesh *data, DerivedMesh *mesh, float epsilon, int tree_type, int axis) +{ + int i; + int numVerts= mesh->getNumVerts(mesh); + MVert *vert = mesh->getVertDataArray(mesh, CD_MVERT); + BVHTree *tree = NULL; + + memset(data, 0, sizeof(*data)); + + if(vert == NULL) + { + printf("bvhtree cant be build: cant get a vertex array"); + return; + } + + tree = BLI_bvhtree_new(numVerts, epsilon, tree_type, axis); + if(tree != NULL) + { + for(i = 0; i < numVerts; i++) + BLI_bvhtree_insert(tree, i, vert[i].co, 1); + + BLI_bvhtree_balance(tree); + + data->tree = tree; + + //a NULL nearest callback works fine + //remeber the min distance to point is the same as the min distance to BV of point + data->nearest_callback = NULL; + data->raycast_callback = NULL; + + data->mesh = mesh; + data->vert = mesh->getVertDataArray(mesh, CD_MVERT); + data->face = mesh->getFaceDataArray(mesh, CD_MFACE); + + data->sphere_radius = epsilon; + } +} + +// Builds a bvh tree.. where nodes are the faces of the given mesh. +void bvhtree_from_mesh_faces(BVHTreeFromMesh *data, DerivedMesh *mesh, float epsilon, int tree_type, int axis) +{ + int i; + int numFaces= mesh->getNumFaces(mesh); + MVert *vert = mesh->getVertDataArray(mesh, CD_MVERT); + MFace *face = mesh->getFaceDataArray(mesh, CD_MFACE); + BVHTree *tree = NULL; + + memset(data, 0, sizeof(*data)); + + if(vert == NULL && face == NULL) + { + printf("bvhtree cant be build: cant get a vertex/face array"); + return; + } + + /* Create a bvh-tree of the given target */ + tree = BLI_bvhtree_new(numFaces, epsilon, tree_type, axis); + if(tree != NULL) + { + for(i = 0; i < numFaces; i++) + { + float co[4][3]; + VECCOPY(co[0], vert[ face[i].v1 ].co); + VECCOPY(co[1], vert[ face[i].v2 ].co); + VECCOPY(co[2], vert[ face[i].v3 ].co); + if(face[i].v4) + VECCOPY(co[3], vert[ face[i].v4 ].co); + + BLI_bvhtree_insert(tree, i, co[0], face[i].v4 ? 4 : 3); + } + BLI_bvhtree_balance(tree); + + data->tree = tree; + data->nearest_callback = mesh_faces_nearest_point; + data->raycast_callback = mesh_faces_spherecast; + + data->mesh = mesh; + data->vert = mesh->getVertDataArray(mesh, CD_MVERT); + data->face = mesh->getFaceDataArray(mesh, CD_MFACE); + + data->sphere_radius = epsilon; + } +} + +// Frees data allocated by a call to bvhtree_from_mesh_*. +void free_bvhtree_from_mesh(struct BVHTreeFromMesh *data) +{ + if(data->tree) + { + BLI_bvhtree_free(data->tree); + memset( data, 0, sizeof(data) ); + } +} + + diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index fdb272171bf..2456472d94a 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -3317,7 +3317,9 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr switch(scon->shrinkType) { case MOD_SHRINKWRAP_NEAREST_SURFACE: - if(bvhtree_from_mesh_faces(&treeData, target, 0.0, 2, 6) == NULL) return; + bvhtree_from_mesh_faces(&treeData, target, 0.0, 2, 6); + if(treeData.tree == NULL) return; + BLI_bvhtree_find_nearest(treeData.tree, co, &nearest, treeData.nearest_callback, &treeData); dist = VecLenf(co, nearest.co); @@ -3325,7 +3327,9 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr break; case MOD_SHRINKWRAP_NEAREST_VERTEX: - if(bvhtree_from_mesh_verts(&treeData, target, 0.0, 2, 6) == NULL) return; + bvhtree_from_mesh_verts(&treeData, target, 0.0, 2, 6); + if(treeData.tree == NULL) return; + BLI_bvhtree_find_nearest(treeData.tree, co, &nearest, treeData.nearest_callback, &treeData); dist = VecLenf(co, nearest.co); @@ -3333,12 +3337,12 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr break; case MOD_SHRINKWRAP_NORMAL: - if(bvhtree_from_mesh_faces(&treeData, target, scon->dist, 4, 6) == NULL) return; + bvhtree_from_mesh_faces(&treeData, target, scon->dist, 4, 6); + if(treeData.tree == NULL) return; if(normal_projection_project_vertex(0, co, no, &transform, treeData.tree, &hit, treeData.raycast_callback, &treeData) == FALSE) { - if(treeData.tree) - BLI_bvhtree_free(treeData.tree); + free_bvhtree_from_mesh(&treeData); target->release(target); @@ -3348,8 +3352,7 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr break; } - if(treeData.tree) - BLI_bvhtree_free(treeData.tree); + free_bvhtree_from_mesh(&treeData); target->release(target); diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 7c9da6344e3..27442128483 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -97,9 +97,6 @@ typedef void ( *Shrinkwrap_ForeachVertexCallback) (DerivedMesh *target, float *co, float *normal); -static float nearest_point_in_tri_surface(const float *point, const float *v0, const float *v1, const float *v2, float *nearest); -static float ray_intersect_plane(const float *point, const float *dir, const float *plane_point, const float *plane_normal); - /* get derived mesh */ //TODO is anyfunction that does this? returning the derivedFinal witouth we caring if its in edit mode or not? DerivedMesh *object_get_derived_final(Object *ob, CustomDataMask dataMask) @@ -114,36 +111,6 @@ DerivedMesh *object_get_derived_final(Object *ob, CustomDataMask dataMask) return mesh_get_derived_final(ob, dataMask); } -/* ray - triangle */ -#define ISECT_EPSILON 1e-6 -static float ray_tri_intersection(const BVHTreeRay *ray, const float m_dist, const float *v0, const float *v1, const float *v2) -{ - float dist; - - if(RayIntersectsTriangle(ray->origin, ray->direction, v0, v1, v2, &dist, NULL)) - return dist; - - return FLT_MAX; -} - -static float sphereray_tri_intersection(const BVHTreeRay *ray, float radius, const float m_dist, const float *v0, const float *v1, const float *v2) -{ - - float idist; - float p1[3]; - float plane_normal[3], hit_point[3]; - - CalcNormFloat((float*)v0, (float*)v1, (float*)v2, plane_normal); - - VECADDFAC( p1, ray->origin, ray->direction, m_dist); - if(SweepingSphereIntersectsTriangleUV(ray->origin, p1, radius, v0, v1, v2, &idist, &hit_point)) - { - return idist * m_dist; - } - - return FLT_MAX; -} - /* Space transform */ void space_transform_from_matrixs(SpaceTransform *data, float local[4][4], float target[4][4]) { @@ -175,193 +142,6 @@ void space_transform_invert_normal(const SpaceTransform *data, float *no) Normalize(no); // TODO: could we just determine de scale value from the matrix? } - -/* - * BVH Tree from Mesh - */ -//callbacks -static void mesh_faces_nearest_point(void *userdata, int index, const float *co, BVHTreeNearest *nearest); -static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit); - -/* - * Builds a bvh tree.. where nodes are the vertexs of the given mesh - */ -BVHTree* bvhtree_from_mesh_verts(BVHTreeFromMesh *data, DerivedMesh *mesh, float epsilon, int tree_type, int axis) -{ - int i; - int numVerts= mesh->getNumVerts(mesh); - MVert *vert = mesh->getVertDataArray(mesh, CD_MVERT); - BVHTree *tree = NULL; - - if(data) - memset(data, 0, sizeof(*data)); - - if(vert == NULL) - { - printf("bvhtree cant be build: cant get a vertex array"); - return NULL; - } - - tree = BLI_bvhtree_new(numVerts, epsilon, tree_type, axis); - if(tree != NULL) - { - for(i = 0; i < numVerts; i++) - BLI_bvhtree_insert(tree, i, vert[i].co, 1); - - BLI_bvhtree_balance(tree); - - if(data) - { - data->tree = tree; - data->nearest_callback = NULL; - data->raycast_callback = NULL; - - data->mesh = mesh; - data->vert = mesh->getVertDataArray(mesh, CD_MVERT); - data->face = mesh->getFaceDataArray(mesh, CD_MFACE); - - data->sphere_radius = epsilon; - } - } - - return tree; -} - -/* - * Builds a bvh tree.. where nodes are the faces of the given mesh. - */ -BVHTree* bvhtree_from_mesh_faces(BVHTreeFromMesh *data, DerivedMesh *mesh, float epsilon, int tree_type, int axis) -{ - int i; - int numFaces= mesh->getNumFaces(mesh); - MVert *vert = mesh->getVertDataArray(mesh, CD_MVERT); - MFace *face = mesh->getFaceDataArray(mesh, CD_MFACE); - BVHTree *tree = NULL; - - if(data) - memset(data, 0, sizeof(*data)); - - if(vert == NULL && face == NULL) - { - printf("bvhtree cant be build: cant get a vertex/face array"); - return NULL; - } - - /* Create a bvh-tree of the given target */ - tree = BLI_bvhtree_new(numFaces, epsilon, tree_type, axis); - if(tree != NULL) - { - for(i = 0; i < numFaces; i++) - { - float co[4][3]; - VECCOPY(co[0], vert[ face[i].v1 ].co); - VECCOPY(co[1], vert[ face[i].v2 ].co); - VECCOPY(co[2], vert[ face[i].v3 ].co); - if(face[i].v4) - VECCOPY(co[3], vert[ face[i].v4 ].co); - - BLI_bvhtree_insert(tree, i, co[0], face[i].v4 ? 4 : 3); - } - BLI_bvhtree_balance(tree); - - if(data) - { - data->tree = tree; - data->nearest_callback = mesh_faces_nearest_point; - data->raycast_callback = mesh_faces_spherecast; - - data->mesh = mesh; - data->vert = mesh->getVertDataArray(mesh, CD_MVERT); - data->face = mesh->getFaceDataArray(mesh, CD_MFACE); - - data->sphere_radius = epsilon; - } - } - - return tree; -} - -/* - * Callback to bvh tree nearest point. The tree must bust have been built using bvhtree_from_mesh_faces. - * userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree. - */ -static void mesh_faces_nearest_point(void *userdata, int index, const float *co, BVHTreeNearest *nearest) -{ - const BVHTreeFromMesh *data = (BVHTreeFromMesh*) userdata; - MVert *vert = data->vert; - MFace *face = data->face + index; - - float *t0, *t1, *t2, *t3; - t0 = vert[ face->v1 ].co; - t1 = vert[ face->v2 ].co; - t2 = vert[ face->v3 ].co; - t3 = face->v4 ? vert[ face->v4].co : NULL; - - - do - { - float nearest_tmp[3], dist; - - dist = nearest_point_in_tri_surface(co,t0, t1, t2, nearest_tmp); - if(dist < nearest->dist) - { - nearest->index = index; - nearest->dist = dist; - VECCOPY(nearest->co, nearest_tmp); - CalcNormFloat((float*)t0, (float*)t1, (float*)t2, nearest->no); //TODO.. (interpolate normals from the vertexs coordinates? - } - - - t1 = t2; - t2 = t3; - t3 = NULL; - - } while(t2); -} - -/* - * Callback to bvh tree raycast. The tree must bust have been built using bvhtree_from_mesh_faces. - * userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree. - */ -static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) -{ - const BVHTreeFromMesh *data = (BVHTreeFromMesh*) userdata; - MVert *vert = data->vert; - MFace *face = data->face + index; - - float *t0, *t1, *t2, *t3; - t0 = vert[ face->v1 ].co; - t1 = vert[ face->v2 ].co; - t2 = vert[ face->v3 ].co; - t3 = face->v4 ? vert[ face->v4].co : NULL; - - - do - { - float dist; - if(data->sphere_radius == 0.0f) - dist = ray_tri_intersection(ray, hit->dist, t0, t1, t2); - else - dist = sphereray_tri_intersection(ray, data->sphere_radius, hit->dist, t0, t1, t2); - - if(dist >= 0 && dist < hit->dist) - { - hit->index = index; - hit->dist = dist; - VECADDFAC(hit->co, ray->origin, ray->direction, dist); - - CalcNormFloat(t0, t1, t2, hit->no); - } - - t1 = t2; - t2 = t3; - t3 = NULL; - - } while(t2); -} - - - /* * Returns the squared distance between two given points */ @@ -448,195 +228,6 @@ static void derivedmesh_mergeNearestPoints(DerivedMesh *dm, float mdist, BitSet } -/* - * This calculates the distance (in dir units) that the ray must travel to intersect plane - * It can return negative values - * - * TODO theres probably something like this on blender code - * - * Returns FLT_MIN in parallel case - */ -static float ray_intersect_plane(const float *point, const float *dir, const float *plane_point, const float *plane_normal) -{ - float pp[3]; - float a, pp_dist; - - a = INPR(dir, plane_normal); - - if(fabs(a) < 1e-5f) return FLT_MIN; - - VECSUB(pp, point, plane_point); - pp_dist = INPR(pp, plane_normal); - - return -pp_dist/a; -} - -/* - * This calculates the distance from point to the plane - * Distance is negative if point is on the back side of plane - */ -static float point_plane_distance(const float *point, const float *plane_point, const float *plane_normal) -{ - float pp[3]; - VECSUB(pp, point, plane_point); - return INPR(pp, plane_normal); -} -static float choose_nearest(const float v0[2], const float v1[2], const float point[2], float closest[2]) -{ - float d[2][2], sdist[2]; - VECSUB2D(d[0], v0, point); - VECSUB2D(d[1], v1, point); - - sdist[0] = d[0][0]*d[0][0] + d[0][1]*d[0][1]; - sdist[1] = d[1][0]*d[1][0] + d[1][1]*d[1][1]; - - if(sdist[0] < sdist[1]) - { - if(closest) - VECCOPY2D(closest, v0); - return sdist[0]; - } - else - { - if(closest) - VECCOPY2D(closest, v1); - return sdist[1]; - } -} -/* - * calculates the closest point between point-tri (2D) - * returns that tri must be right-handed - * Returns square distance - */ -static float closest_point_in_tri2D(const float point[2], /*const*/ float tri[3][2], float closest[2]) -{ - float edge_di[2]; - float v_point[2]; - float proj[2]; //point projected over edge-dir, edge-normal (witouth normalized edge) - const float *v0 = tri[2], *v1; - float edge_slen, d; //edge squared length - int i; - const float *nearest_vertex = NULL; - - - //for each edge - for(i=0, v0=tri[2], v1=tri[0]; i < 3; v0=tri[i++], v1=tri[i]) - { - VECSUB2D(edge_di, v1, v0); - VECSUB2D(v_point, point, v0); - - proj[1] = v_point[0]*edge_di[1] - v_point[1]*edge_di[0]; //dot product with edge normal - - //point inside this edge - if(proj[1] < 0) - continue; - - proj[0] = v_point[0]*edge_di[0] + v_point[1]*edge_di[1]; - - //closest to this edge is v0 - if(proj[0] < 0) - { - if(nearest_vertex == NULL || nearest_vertex == v0) - nearest_vertex = v0; - else - { - //choose nearest - return choose_nearest(nearest_vertex, v0, point, closest); - } - i++; //We can skip next edge - continue; - } - - edge_slen = edge_di[0]*edge_di[0] + edge_di[1]*edge_di[1]; //squared edge len - //closest to this edge is v1 - if(proj[0] > edge_slen) - { - if(nearest_vertex == NULL || nearest_vertex == v1) - nearest_vertex = v1; - else - { - return choose_nearest(nearest_vertex, v1, point, closest); - } - continue; - } - - //nearest is on this edge - d= proj[1] / edge_slen; - closest[0] = point[0] - edge_di[1] * d; - closest[1] = point[1] + edge_di[0] * d; - - return proj[1]*proj[1]/edge_slen; - } - - if(nearest_vertex) - { - VECSUB2D(v_point, nearest_vertex, point); - VECCOPY2D(closest, nearest_vertex); - return v_point[0]*v_point[0] + v_point[1]*v_point[1]; - } - else - { - VECCOPY(closest, point); //point is already inside - return 0.0f; - } -} - -/* - * Returns the square of the minimum distance between the point and a triangle surface - * If nearest is not NULL the nearest surface point is written on it - */ -static float nearest_point_in_tri_surface(const float *point, const float *v0, const float *v1, const float *v2, float *nearest) -{ - //Lets solve the 2D problem (closest point-tri) - float normal_dist, plane_sdist, plane_offset; - float du[3], dv[3], dw[3]; //orthogonal axis (du=(v0->v1), dw=plane normal) - - float p_2d[2], tri_2d[3][2], nearest_2d[2]; - - CalcNormFloat((float*)v0, (float*)v1, (float*)v2, dw); - - //point-plane distance and calculate axis - normal_dist = point_plane_distance(point, v0, dw); - - // OPTIMIZATION - // if we are only interested in nearest distance if its closer than some distance already found - // we can: - // if(normal_dist*normal_dist >= best_dist_so_far) return FLOAT_MAX; - // - - VECSUB(du, v1, v0); - Normalize(du); - Crossf(dv, dw, du); - plane_offset = INPR(v0, dw); - - //project stuff to 2d - tri_2d[0][0] = INPR(du, v0); - tri_2d[0][1] = INPR(dv, v0); - - tri_2d[1][0] = INPR(du, v1); - tri_2d[1][1] = INPR(dv, v1); - - tri_2d[2][0] = INPR(du, v2); - tri_2d[2][1] = INPR(dv, v2); - - p_2d[0] = INPR(du, point); - p_2d[1] = INPR(dv, point); - - //we always have a right-handed tri - //this should always happen because of the way normal is calculated - plane_sdist = closest_point_in_tri2D(p_2d, tri_2d, nearest_2d); - - //project back to 3d - if(nearest) - { - nearest[0] = du[0]*nearest_2d[0] + dv[0] * nearest_2d[1] + dw[0] * plane_offset; - nearest[1] = du[1]*nearest_2d[0] + dv[1] * nearest_2d[1] + dw[1] * plane_offset; - nearest[2] = du[2]*nearest_2d[0] + dv[2] * nearest_2d[1] + dw[2] * plane_offset; - } - - return plane_sdist + normal_dist*normal_dist; -} - /* * This function removes Unused faces, vertexs and edges from calc->target * @@ -1101,7 +692,7 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) } } - BLI_bvhtree_free(treeData.tree); + free_bvhtree_from_mesh(&treeData); } /* @@ -1265,11 +856,8 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) } } - BLI_bvhtree_free(treeData.tree); - - - if(limitData.tree) - BLI_bvhtree_free(limitData.tree); + free_bvhtree_from_mesh(&treeData); + free_bvhtree_from_mesh(&limitData); if(limit_mesh) limit_mesh->release(limit_mesh); @@ -1339,6 +927,6 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) } } - BLI_bvhtree_free(treeData.tree); + free_bvhtree_from_mesh(&treeData); } From 991539d1c896adb7e11d0964f953506b91d964ef Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Mon, 11 Aug 2008 13:16:06 +0000 Subject: [PATCH 63/76] preparing to merge trunk (those files were sent to trunk) --- source/blender/blenkernel/BKE_bvhutils.h | 96 ----- source/blender/blenkernel/intern/bvhutils.c | 425 -------------------- 2 files changed, 521 deletions(-) delete mode 100644 source/blender/blenkernel/BKE_bvhutils.h delete mode 100644 source/blender/blenkernel/intern/bvhutils.c diff --git a/source/blender/blenkernel/BKE_bvhutils.h b/source/blender/blenkernel/BKE_bvhutils.h deleted file mode 100644 index 5a0c4ad5545..00000000000 --- a/source/blender/blenkernel/BKE_bvhutils.h +++ /dev/null @@ -1,96 +0,0 @@ -/** - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2006 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): André Pinto - * - * ***** END GPL LICENSE BLOCK ***** - */ -#ifndef BKE_BVHUTILS_H -#define BKE_BVHUTILS_H - -#include "BLI_kdopbvh.h" - -/* - * This header encapsulates necessary code to buld a BVH - */ - -struct DerivedMesh; -struct MVert; -struct MFace; - -/* - * struct that kepts basic information about a BVHTree build from a mesh - */ -typedef struct BVHTreeFromMesh -{ - struct BVHTree *tree; - - /* default callbacks to bvh nearest and raycast */ - BVHTree_NearestPointCallback nearest_callback; - BVHTree_RayCastCallback raycast_callback; - - /* Mesh represented on this BVHTree */ - struct DerivedMesh *mesh; - - /* Vertex array, so that callbacks have instante access to data */ - struct MVert *vert; - struct MFace *face; - - /* radius for raycast */ - float sphere_radius; - -} BVHTreeFromMesh; - -/* - * Builds a bvh tree where nodes are the vertexs of the given mesh. - * Configures BVHTreeFromMesh. - * - * The tree is build in mesh space coordinates, this means special care must be made on queries - * so that the coordinates and rays are first translated on the mesh local coordinates. - * Reason for this is that later bvh_from_mesh_* might use a cache system and so it becames possible to reuse - * a BVHTree. - * - * free_bvhtree_from_mesh should be called when the tree is no longer needed. - */ -void bvhtree_from_mesh_verts(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis); - -/* - * Builds a bvh tree where nodes are the faces of the given mesh. - * Configures BVHTreeFromMesh. - * - * The tree is build in mesh space coordinates, this means special care must be made on queries - * so that the coordinates and rays are first translated on the mesh local coordinates. - * Reason for this is that later bvh_from_mesh_* might use a cache system and so it becames possible to reuse - * a BVHTree. - * - * free_bvhtree_from_mesh should be called when the tree is no longer needed. - */ -void bvhtree_from_mesh_faces(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis); - -/* - * Frees data allocated by a call to bvhtree_from_mesh_*. - */ -void free_bvhtree_from_mesh(struct BVHTreeFromMesh *data); - -#endif - diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c deleted file mode 100644 index edf4593d24c..00000000000 --- a/source/blender/blenkernel/intern/bvhutils.c +++ /dev/null @@ -1,425 +0,0 @@ -/** - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) Blender Foundation. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): André Pinto. - * - * ***** END GPL LICENSE BLOCK ***** - */ -#include -#include -#include - -#include "BKE_bvhutils.h" - -#include "DNA_object_types.h" -#include "DNA_modifier_types.h" -#include "DNA_meshdata_types.h" - -#include "BKE_shrinkwrap.h" -#include "BKE_DerivedMesh.h" -#include "BKE_utildefines.h" -#include "BKE_deform.h" -#include "BKE_cdderivedmesh.h" -#include "BKE_displist.h" -#include "BKE_global.h" - -#include "BLI_arithb.h" - -/* Math stuff for ray casting on mesh faces and for nearest surface */ - -static float nearest_point_in_tri_surface(const float *point, const float *v0, const float *v1, const float *v2, float *nearest); - -#define ISECT_EPSILON 1e-6 -static float ray_tri_intersection(const BVHTreeRay *ray, const float m_dist, const float *v0, const float *v1, const float *v2) -{ - float dist; - - if(RayIntersectsTriangle(ray->origin, ray->direction, v0, v1, v2, &dist, NULL)) - return dist; - - return FLT_MAX; -} - -static float sphereray_tri_intersection(const BVHTreeRay *ray, float radius, const float m_dist, const float *v0, const float *v1, const float *v2) -{ - - float idist; - float p1[3]; - float plane_normal[3], hit_point[3]; - - CalcNormFloat((float*)v0, (float*)v1, (float*)v2, plane_normal); - - VECADDFAC( p1, ray->origin, ray->direction, m_dist); - if(SweepingSphereIntersectsTriangleUV(ray->origin, p1, radius, v0, v1, v2, &idist, &hit_point)) - { - return idist * m_dist; - } - - return FLT_MAX; -} - -/* - * This calculates the distance from point to the plane - * Distance is negative if point is on the back side of plane - */ -static float point_plane_distance(const float *point, const float *plane_point, const float *plane_normal) -{ - float pp[3]; - VECSUB(pp, point, plane_point); - return INPR(pp, plane_normal); -} -static float choose_nearest(const float v0[2], const float v1[2], const float point[2], float closest[2]) -{ - float d[2][2], sdist[2]; - VECSUB2D(d[0], v0, point); - VECSUB2D(d[1], v1, point); - - sdist[0] = d[0][0]*d[0][0] + d[0][1]*d[0][1]; - sdist[1] = d[1][0]*d[1][0] + d[1][1]*d[1][1]; - - if(sdist[0] < sdist[1]) - { - if(closest) - VECCOPY2D(closest, v0); - return sdist[0]; - } - else - { - if(closest) - VECCOPY2D(closest, v1); - return sdist[1]; - } -} -/* - * calculates the closest point between point-tri (2D) - * returns that tri must be right-handed - * Returns square distance - */ -static float closest_point_in_tri2D(const float point[2], /*const*/ float tri[3][2], float closest[2]) -{ - float edge_di[2]; - float v_point[2]; - float proj[2]; //point projected over edge-dir, edge-normal (witouth normalized edge) - const float *v0 = tri[2], *v1; - float edge_slen, d; //edge squared length - int i; - const float *nearest_vertex = NULL; - - - //for each edge - for(i=0, v0=tri[2], v1=tri[0]; i < 3; v0=tri[i++], v1=tri[i]) - { - VECSUB2D(edge_di, v1, v0); - VECSUB2D(v_point, point, v0); - - proj[1] = v_point[0]*edge_di[1] - v_point[1]*edge_di[0]; //dot product with edge normal - - //point inside this edge - if(proj[1] < 0) - continue; - - proj[0] = v_point[0]*edge_di[0] + v_point[1]*edge_di[1]; - - //closest to this edge is v0 - if(proj[0] < 0) - { - if(nearest_vertex == NULL || nearest_vertex == v0) - nearest_vertex = v0; - else - { - //choose nearest - return choose_nearest(nearest_vertex, v0, point, closest); - } - i++; //We can skip next edge - continue; - } - - edge_slen = edge_di[0]*edge_di[0] + edge_di[1]*edge_di[1]; //squared edge len - //closest to this edge is v1 - if(proj[0] > edge_slen) - { - if(nearest_vertex == NULL || nearest_vertex == v1) - nearest_vertex = v1; - else - { - return choose_nearest(nearest_vertex, v1, point, closest); - } - continue; - } - - //nearest is on this edge - d= proj[1] / edge_slen; - closest[0] = point[0] - edge_di[1] * d; - closest[1] = point[1] + edge_di[0] * d; - - return proj[1]*proj[1]/edge_slen; - } - - if(nearest_vertex) - { - VECSUB2D(v_point, nearest_vertex, point); - VECCOPY2D(closest, nearest_vertex); - return v_point[0]*v_point[0] + v_point[1]*v_point[1]; - } - else - { - VECCOPY(closest, point); //point is already inside - return 0.0f; - } -} - -/* - * Returns the square of the minimum distance between the point and a triangle surface - * If nearest is not NULL the nearest surface point is written on it - */ -static float nearest_point_in_tri_surface(const float *point, const float *v0, const float *v1, const float *v2, float *nearest) -{ - //Lets solve the 2D problem (closest point-tri) - float normal_dist, plane_sdist, plane_offset; - float du[3], dv[3], dw[3]; //orthogonal axis (du=(v0->v1), dw=plane normal) - - float p_2d[2], tri_2d[3][2], nearest_2d[2]; - - CalcNormFloat((float*)v0, (float*)v1, (float*)v2, dw); - - //point-plane distance and calculate axis - normal_dist = point_plane_distance(point, v0, dw); - - // OPTIMIZATION - // if we are only interested in nearest distance if its closer than some distance already found - // we can: - // if(normal_dist*normal_dist >= best_dist_so_far) return FLOAT_MAX; - // - - VECSUB(du, v1, v0); - Normalize(du); - Crossf(dv, dw, du); - plane_offset = INPR(v0, dw); - - //project stuff to 2d - tri_2d[0][0] = INPR(du, v0); - tri_2d[0][1] = INPR(dv, v0); - - tri_2d[1][0] = INPR(du, v1); - tri_2d[1][1] = INPR(dv, v1); - - tri_2d[2][0] = INPR(du, v2); - tri_2d[2][1] = INPR(dv, v2); - - p_2d[0] = INPR(du, point); - p_2d[1] = INPR(dv, point); - - //we always have a right-handed tri - //this should always happen because of the way normal is calculated - plane_sdist = closest_point_in_tri2D(p_2d, tri_2d, nearest_2d); - - //project back to 3d - if(nearest) - { - nearest[0] = du[0]*nearest_2d[0] + dv[0] * nearest_2d[1] + dw[0] * plane_offset; - nearest[1] = du[1]*nearest_2d[0] + dv[1] * nearest_2d[1] + dw[1] * plane_offset; - nearest[2] = du[2]*nearest_2d[0] + dv[2] * nearest_2d[1] + dw[2] * plane_offset; - } - - return plane_sdist + normal_dist*normal_dist; -} - - -/* - * BVH from meshs callbacks - */ - -// Callback to bvh tree nearest point. The tree must bust have been built using bvhtree_from_mesh_faces. -// userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree. -static void mesh_faces_nearest_point(void *userdata, int index, const float *co, BVHTreeNearest *nearest) -{ - const BVHTreeFromMesh *data = (BVHTreeFromMesh*) userdata; - MVert *vert = data->vert; - MFace *face = data->face + index; - - float *t0, *t1, *t2, *t3; - t0 = vert[ face->v1 ].co; - t1 = vert[ face->v2 ].co; - t2 = vert[ face->v3 ].co; - t3 = face->v4 ? vert[ face->v4].co : NULL; - - - do - { - float nearest_tmp[3], dist; - - dist = nearest_point_in_tri_surface(co,t0, t1, t2, nearest_tmp); - if(dist < nearest->dist) - { - nearest->index = index; - nearest->dist = dist; - VECCOPY(nearest->co, nearest_tmp); - CalcNormFloat((float*)t0, (float*)t1, (float*)t2, nearest->no); //TODO.. (interpolate normals from the vertexs coordinates? - } - - - t1 = t2; - t2 = t3; - t3 = NULL; - - } while(t2); -} - -// Callback to bvh tree raycast. The tree must bust have been built using bvhtree_from_mesh_faces. -// userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree. -static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) -{ - const BVHTreeFromMesh *data = (BVHTreeFromMesh*) userdata; - MVert *vert = data->vert; - MFace *face = data->face + index; - - float *t0, *t1, *t2, *t3; - t0 = vert[ face->v1 ].co; - t1 = vert[ face->v2 ].co; - t2 = vert[ face->v3 ].co; - t3 = face->v4 ? vert[ face->v4].co : NULL; - - - do - { - float dist; - if(data->sphere_radius == 0.0f) - dist = ray_tri_intersection(ray, hit->dist, t0, t1, t2); - else - dist = sphereray_tri_intersection(ray, data->sphere_radius, hit->dist, t0, t1, t2); - - if(dist >= 0 && dist < hit->dist) - { - hit->index = index; - hit->dist = dist; - VECADDFAC(hit->co, ray->origin, ray->direction, dist); - - CalcNormFloat(t0, t1, t2, hit->no); - } - - t1 = t2; - t2 = t3; - t3 = NULL; - - } while(t2); -} - -/* - * BVH builders - */ -// Builds a bvh tree.. where nodes are the vertexs of the given mesh -void bvhtree_from_mesh_verts(BVHTreeFromMesh *data, DerivedMesh *mesh, float epsilon, int tree_type, int axis) -{ - int i; - int numVerts= mesh->getNumVerts(mesh); - MVert *vert = mesh->getVertDataArray(mesh, CD_MVERT); - BVHTree *tree = NULL; - - memset(data, 0, sizeof(*data)); - - if(vert == NULL) - { - printf("bvhtree cant be build: cant get a vertex array"); - return; - } - - tree = BLI_bvhtree_new(numVerts, epsilon, tree_type, axis); - if(tree != NULL) - { - for(i = 0; i < numVerts; i++) - BLI_bvhtree_insert(tree, i, vert[i].co, 1); - - BLI_bvhtree_balance(tree); - - data->tree = tree; - - //a NULL nearest callback works fine - //remeber the min distance to point is the same as the min distance to BV of point - data->nearest_callback = NULL; - data->raycast_callback = NULL; - - data->mesh = mesh; - data->vert = mesh->getVertDataArray(mesh, CD_MVERT); - data->face = mesh->getFaceDataArray(mesh, CD_MFACE); - - data->sphere_radius = epsilon; - } -} - -// Builds a bvh tree.. where nodes are the faces of the given mesh. -void bvhtree_from_mesh_faces(BVHTreeFromMesh *data, DerivedMesh *mesh, float epsilon, int tree_type, int axis) -{ - int i; - int numFaces= mesh->getNumFaces(mesh); - MVert *vert = mesh->getVertDataArray(mesh, CD_MVERT); - MFace *face = mesh->getFaceDataArray(mesh, CD_MFACE); - BVHTree *tree = NULL; - - memset(data, 0, sizeof(*data)); - - if(vert == NULL && face == NULL) - { - printf("bvhtree cant be build: cant get a vertex/face array"); - return; - } - - /* Create a bvh-tree of the given target */ - tree = BLI_bvhtree_new(numFaces, epsilon, tree_type, axis); - if(tree != NULL) - { - for(i = 0; i < numFaces; i++) - { - float co[4][3]; - VECCOPY(co[0], vert[ face[i].v1 ].co); - VECCOPY(co[1], vert[ face[i].v2 ].co); - VECCOPY(co[2], vert[ face[i].v3 ].co); - if(face[i].v4) - VECCOPY(co[3], vert[ face[i].v4 ].co); - - BLI_bvhtree_insert(tree, i, co[0], face[i].v4 ? 4 : 3); - } - BLI_bvhtree_balance(tree); - - data->tree = tree; - data->nearest_callback = mesh_faces_nearest_point; - data->raycast_callback = mesh_faces_spherecast; - - data->mesh = mesh; - data->vert = mesh->getVertDataArray(mesh, CD_MVERT); - data->face = mesh->getFaceDataArray(mesh, CD_MFACE); - - data->sphere_radius = epsilon; - } -} - -// Frees data allocated by a call to bvhtree_from_mesh_*. -void free_bvhtree_from_mesh(struct BVHTreeFromMesh *data) -{ - if(data->tree) - { - BLI_bvhtree_free(data->tree); - memset( data, 0, sizeof(data) ); - } -} - - From 7e7d416f4d4f7bdf4e31f7bf87eabbd9fe26c16d Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Mon, 11 Aug 2008 13:29:38 +0000 Subject: [PATCH 64/76] svn merge -r 15988:16055 https://svn.blender.org/svnroot/bf-blender/trunk/blender --- CMakeLists.txt | 6 +- config/linux2-config.py | 2 +- intern/bmfont/intern/BDF2BMF.py | 177 +++++ .../blender/blenkernel/BKE_blenkernel.vcproj | 6 + release/scripts/flt_export.py | 29 +- release/scripts/flt_palettemanager.py | 149 +++- release/scripts/import_dxf.py | 4 +- release/scripts/ply_export.py | 7 +- source/blender/blenkernel/BKE_bvhutils.h | 98 +++ source/blender/blenkernel/intern/anim.c | 12 +- source/blender/blenkernel/intern/bvhutils.c | 433 +++++++++++ .../blenkernel/intern/particle_system.c | 18 +- source/blender/blenkernel/intern/texture.c | 2 + source/blender/blenlib/BLI_kdopbvh.h | 2 + source/blender/blenlib/intern/BLI_kdopbvh.c | 18 +- source/blender/include/BIF_editarmature.h | 6 +- source/blender/include/BIF_editmesh.h | 2 +- source/blender/include/butspace.h | 2 +- source/blender/python/api2_2x/doc/Render.py | 15 +- .../blender/render/intern/source/rayshade.c | 7 +- source/blender/src/buttons_editing.c | 88 +-- source/blender/src/editarmature.c | 151 ++-- source/blender/src/editmesh_mods.c | 703 +++++++++--------- source/blender/src/editobject.c | 8 +- source/blender/src/poselib.c | 7 +- source/blender/src/transform_conversions.c | 4 +- .../Converter/BL_BlenderDataConversion.cpp | 12 +- source/gameengine/Ketsji/CMakeLists.txt | 14 +- source/gameengine/Ketsji/KX_GameObject.cpp | 2 +- source/gameengine/Ketsji/KX_RadarSensor.cpp | 14 +- .../Physics/Bullet/CcdPhysicsEnvironment.cpp | 20 +- tools/btools.py | 2 + 32 files changed, 1481 insertions(+), 539 deletions(-) create mode 100644 intern/bmfont/intern/BDF2BMF.py create mode 100644 source/blender/blenkernel/BKE_bvhutils.h create mode 100644 source/blender/blenkernel/intern/bvhutils.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a23e77d9f8..0ea26750ec1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -183,9 +183,9 @@ IF(UNIX) SET(LLIBS "-lXi -lutil -lc -lm -lpthread -lstdc++") IF(WITH_OPENMP) - SET(LLIBS "${LLIBS} -lgomp ") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp ") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp ") + SET(LLIBS "${LLIBS} -lgomp") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp") ENDIF(WITH_OPENMP) diff --git a/config/linux2-config.py b/config/linux2-config.py index 6bde0664fe5..fe4325361a8 100644 --- a/config/linux2-config.py +++ b/config/linux2-config.py @@ -139,7 +139,7 @@ BF_OPENJPEG_LIB = '' BF_OPENJPEG_INC = '${BF_OPENJPEG}/include' BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib' -WITH_BF_REDCODE = 'true' +WITH_BF_REDCODE = 'false' BF_REDCODE = '#extern/libredcode' BF_REDCODE_LIB = '' # Uncomment the following two lines to use system's ffmpeg diff --git a/intern/bmfont/intern/BDF2BMF.py b/intern/bmfont/intern/BDF2BMF.py new file mode 100644 index 00000000000..15b9e5b8eb4 --- /dev/null +++ b/intern/bmfont/intern/BDF2BMF.py @@ -0,0 +1,177 @@ +#!/usr/bin/python + +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# ***** END GPL LICENCE BLOCK ***** +# -------------------------------------------------------------------------- + +HELP_TXT = \ +''' +Convert BDF pixmap fonts into C++ files Blender can read. +Use to replace bitmap fonts or add new ones. + +Usage + python bdf2bmf.py -name=SomeName myfile.bdf + +Blender currently supports fonts with a maximum width of 8 pixels. +''' + +# -------- Simple BDF parser +import sys +def parse_bdf(f, MAX_CHARS=256): + lines = [l.strip().upper().split() for l in f.readlines()] + + is_bitmap = False + dummy = {'BITMAP':[]} + char_data = [dummy.copy() for i in xrange(MAX_CHARS)] + context_bitmap = [] + + for l in lines: + if l[0]=='ENCODING': enc = int(l[1]) + elif l[0]=='BBX': bbx = [int(c) for c in l[1:]] + elif l[0]=='DWIDTH': dwidth = int(l[1]) + elif l[0]=='BITMAP': is_bitmap = True + elif l[0]=='ENDCHAR': + if enc < MAX_CHARS: + char_data[enc]['BBX'] = bbx + char_data[enc]['DWIDTH'] = dwidth + char_data[enc]['BITMAP'] = context_bitmap + + context_bitmap = [] + enc = bbx = None + is_bitmap = False + else: + # None of the above, Ok, were reading a bitmap + if is_bitmap and enc < MAX_CHARS: + context_bitmap.append( int(l[0], 16) ) + + return char_data +# -------- end simple BDF parser + +def bdf2cpp_name(path): + return path.split('.')[0] + '.cpp' + +def convert_to_blender(bdf_dict, font_name, origfilename, MAX_CHARS=256): + + # first get a global width/height, also set the offsets + xmin = ymin = 10000000 + xmax = ymax = -10000000 + + bitmap_offsets = [-1] * MAX_CHARS + bitmap_tot = 0 + for i, c in enumerate(bdf_dict): + if c.has_key('BBX'): + bbx = c['BBX'] + xmax = max(bbx[0], xmax) + ymax = max(bbx[1], ymax) + xmin = min(bbx[2], xmin) + ymin = min(bbx[3], ymin) + + bitmap_offsets[i] = bitmap_tot + bitmap_tot += len(c['BITMAP']) + + c['BITMAP'].reverse() + + # Now we can write. Ok if we have no .'s in the path. + f = open(bdf2cpp_name(origfilename), 'w') + + f.write(''' +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "BMF_FontData.h" + +#include "BMF_Settings.h" +''') + + f.write('#if BMF_INCLUDE_%s\n\n' % font_name.upper()) + f.write('static unsigned char bitmap_data[]= {') + newline = 8 + + for i, c in enumerate(bdf_dict): + + for cdata in c['BITMAP']: + # Just formatting + newline+=1 + if newline >= 8: + newline = 0 + f.write('\n\t') + # End formatting + + f.write('0x%.2hx,' % cdata) # 0x80 <- format + + f.write("\n};\n") + + f.write("BMF_FontData BMF_font_%s = {\n" % font_name) + f.write('\t%d, %d,\n' % (xmin, ymin)) + f.write('\t%d, %d,\n' % (xmax, ymax)) + + f.write('\t{\n') + + + for i, c in enumerate(bdf_dict): + if bitmap_offsets[i] == -1 or c.has_key('BBX') == False: + f.write('\t\t{0,0,0,0,0, -1},\n') + else: + bbx = c['BBX'] + f.write('\t\t{%d,%d,%d,%d,%d, %d},\n' % (bbx[0], bbx[1], -bbx[2], -bbx[3], c['DWIDTH'], bitmap_offsets[i])) + + f.write(''' + }, + bitmap_data +}; + +#endif +''') + +def main(): + # replace "[-name=foo]" with "[-name] [foo]" + args = [] + for arg in sys.argv: + for a in arg.replace('=', ' ').split(): + args.append(a) + + name = 'untitled' + done_anything = False + for i, arg in enumerate(args): + if arg == '-name': + if i==len(args)-1: + print 'no arg given for -name, aborting' + return + else: + name = args[i+1] + + elif arg.lower().endswith('.bdf'): + try: + f = open(arg) + print '...Writing to:', bdf2cpp_name(arg) + except: + print 'could not open "%s", aborting' % arg + + + bdf_dict = parse_bdf(f) + convert_to_blender(bdf_dict, name, arg) + done_anything = True + + if not done_anything: + print HELP_TXT + print '...nothing to do' + +if __name__ == '__main__': + main() + diff --git a/projectfiles_vc7/blender/blenkernel/BKE_blenkernel.vcproj b/projectfiles_vc7/blender/blenkernel/BKE_blenkernel.vcproj index 8efff1742b0..0ea3503a289 100644 --- a/projectfiles_vc7/blender/blenkernel/BKE_blenkernel.vcproj +++ b/projectfiles_vc7/blender/blenkernel/BKE_blenkernel.vcproj @@ -365,6 +365,9 @@ + + @@ -576,6 +579,9 @@ + + diff --git a/release/scripts/flt_export.py b/release/scripts/flt_export.py index 2b9db74c770..c099c8e62d1 100644 --- a/release/scripts/flt_export.py +++ b/release/scripts/flt_export.py @@ -525,8 +525,8 @@ class FaceDesc: def __init__(self): self.vertex_index_lst = [] self.mface = None - self.texture_index = -1 - self.material_index = -1 + self.texture_index = 65535 + self.material_index = 65535 self.color_index = 127 self.renderstyle = 0 self.twoside = 0 @@ -979,8 +979,14 @@ class FLTNode(Node): self.header.fw.write_char(0) # Reserved self.header.fw.write_char(alpha) # Template self.header.fw.write_short(-1) # Detail tex pat index - self.header.fw.write_short(face_desc.texture_index) # Tex pattern index - self.header.fw.write_short(face_desc.material_index) # material index + if face_desc.texture_index == -1: + self.header.fw.write_ushort(65535) + else: + self.header.fw.write_ushort(face_desc.texture_index) # Tex pattern index + if face_desc.material_index == -1: + self.header.fw.write_ushort(65535) + else: + self.header.fw.write_ushort(face_desc.material_index) # material index self.header.fw.write_short(0) # SMC code self.header.fw.write_short(0) # Feature code self.header.fw.write_int(0) # IR material code @@ -1015,7 +1021,10 @@ class FLTNode(Node): self.header.fw.write_ushort(8 + (mtex * 8)) # Length self.header.fw.write_uint(uvmask) # UV mask for i in xrange(mtex): - self.header.fw.write_ushort(face_desc.images[i]) # Tex pattern index + if face_desc.images[i] == -1: + self.header.fw.write_ushort(65535) + else: + self.header.fw.write_ushort(face_desc.images[i]) # Tex pattern index self.header.fw.write_ushort(0) # Tex effect self.header.fw.write_ushort(0) # Tex Mapping index self.header.fw.write_ushort(0) # Tex data. User defined @@ -1070,7 +1079,7 @@ class FLTNode(Node): if self.opcode == 63 and options.state['externalspath']: try: - exportdict['3t200!filename'] = os.path.join(options.state['externalspath'],self.object.DupGroup.name+'.flt') + exportdict['3t200!filename'] = os.path.join(options.state['externalspath'],self.object.DupGroup.name+'.flt').replace("\\", "/") self.header.xrefnames.append(self.object.DupGroup.name) except: pass @@ -1092,7 +1101,7 @@ class FLTNode(Node): write_prop(self.header.fw,ftype,self.object.properties['FLT']['EXT'][propname],length) #write extension data for i in xrange(datalen): - self.header.fw.write_char(self.object.properties['FLT']['EXT']['data'][i]) + self.header.fw.write_uchar(struct.unpack('>B', struct.pack('>B', self.object.properties['FLT']['EXT']['data'][i]))[0]) self.write_pop_extension() @@ -1180,8 +1189,8 @@ class Database(Node): desc = self.GRR.request_vertex_desc(i) self.fw.write_short(70) # Vertex with color normal and uv opcode. self.fw.write_ushort(64) # Length of record - self.fw.write_ushort(0) # Color name index - self.fw.write_short(0x20000000) # Flags + self.fw.write_ushort(0) # Color name index + self.fw.write_short(1 << 14) # Frozen Normal self.fw.write_double(desc.x) self.fw.write_double(desc.y) self.fw.write_double(desc.z) @@ -1245,7 +1254,7 @@ class Database(Node): cpalette = defaultp.pal count = len(cpalette) for i in xrange(count): - color = struct.unpack('>BBBB',struct.pack('>I',cpalette[i])) + color = struct.unpack('>BBBB',struct.pack('>i',cpalette[i])) self.fw.write_uchar(color[3]) # alpha self.fw.write_uchar(color[2]) # b self.fw.write_uchar(color[1]) # g diff --git a/release/scripts/flt_palettemanager.py b/release/scripts/flt_palettemanager.py index 6edaf2974ab..c2f1380a6fa 100644 --- a/release/scripts/flt_palettemanager.py +++ b/release/scripts/flt_palettemanager.py @@ -25,7 +25,7 @@ http://wiki.blender.org/index.php/Scripts/Manual/FLTools """ # -------------------------------------------------------------------------- -# flt_palettemanager.py version 0.1 2005/04/08 +# flt_palettemanager.py version 1.0 2005/04/08 # -------------------------------------------------------------------------- # ***** BEGIN GPL LICENSE BLOCK ***** # @@ -55,6 +55,75 @@ import flt_properties import flt_defaultp as defaultp from flt_properties import * +def RGBtoHSV( r, g, b): + minc = min( r, g, b ) + maxc = max( r, g, b ) + v = maxc + + delta = maxc - minc + + if( max != 0 ): + s = delta / maxc + else: + s = 0 + h = -1 + return (h,s,v) + + if( r == maxc ): + h = ( g - b ) / delta + elif( g == maxc ): + h = 2 + ( b - r ) / delta + else: + h = 4 + ( r - g ) / delta + + h *= 60 + if( h < 0 ): + h += 360 + + return(h,s,v) + +def HSVtoRGB(h,s,v): + + if( s == 0 ): + return (v,v,v) + + + h /= 60 + i = math.floor( h) + f = h - i + p = v * ( 1 - s ) + q = v * ( 1 - s * f ) + t = v * ( 1 - s * ( 1 - f ) ) + + if i == 0: + r = v + g = t + b = p + elif i == 1: + r = q + g = v + b = p + + elif i== 2: + r = p + g = v + b = t + elif i==3: + r = p + g = q + b = v + elif i==4: + r = t + g = p + b = v + + else: + r = v + g = p + b = q + + return(r,g,b) + palette_size = 12 palette_x = 0 @@ -68,6 +137,14 @@ cinc = 1.0 / 1024.0 cstep = 0.0 picker = None ptt = "" + + +ts1=None +ts2=None +ts3=None +ts4=None +ts5=None + for i in xrange(1024): colors.append([cstep,cstep,cstep]) cstep = cstep + cinc @@ -128,7 +205,7 @@ def event(evt,val): Draw.Redraw(1) #copy current color and intensity to selected faces. - elif evt == Draw.CKEY: + elif evt == Draw.VKEY: if Blender.Window.EditMode(): Blender.Window.EditMode(0) @@ -136,7 +213,7 @@ def event(evt,val): state = update_state() #retrieve color from palette - color = struct.unpack('>BBBB',struct.pack('>I',colors[curswatch])) + color = struct.unpack('>BBBB',struct.pack('>i',colors[curswatch])) actmesh = state["activeMesh"] if actmesh: if(Blender.Window.GetKeyQualifiers() != Blender.Window.Qual["CTRL"]): @@ -182,7 +259,7 @@ def event(evt,val): Blender.Window.RedrawAll() #grab color and intensity from active face - elif evt == Draw.VKEY: + elif evt == Draw.CKEY: if Blender.Window.EditMode(): Blender.Window.EditMode(0) editmode = 1 @@ -211,6 +288,23 @@ def event(evt,val): Blender.Window.EditMode(1) Blender.Window.RedrawAll() + + elif evt == Draw.GKEY: + if Blender.Window.EditMode(): + Blender.Window.EditMode(0) + editmode =1 + state = update_state() + + actmesh = state["activeMesh"] + activeFace = state["activeFace"] + + if activeFace and "FLT_COL" in actmesh.faces.properties: + (index,intensity) = unpack_face_index(activeFace.getProperty("FLT_COL")) + for face in actmesh.faces: + (index2, intensity2) = unpack_face_index(face.getProperty("FLT_COL")) + if index == index2: + face.sel = 1 + elif evt == Draw.ESCKEY: Draw.Exit() @@ -225,11 +319,11 @@ def update_all(): for object in state["activeScene"].objects: if object.type == "Mesh": mesh = object.getData(mesh=True) - if 'FLT_COL' in mesh.faces.properties: + if 'FLT_COL' in mesh.faces.properties and "FLT_Fcol" in mesh.getColorLayerNames(): mesh.activeColorLayer = "FLT_Fcol" for face in mesh.faces: (index,intensity) = unpack_face_index(face.getProperty('FLT_COL')) - color = struct.unpack('>BBBB',struct.pack('>I',colors[index])) + color = struct.unpack('>BBBB',struct.pack('>i',colors[index])) #update the vertex colors for this face for col in face.col: col.r = int(color[0] * intensity) @@ -284,8 +378,13 @@ def draw_palette(): global colors global curint global curswatch - global picker - + global picker + global ts1 + global ts2 + global ts3 + global ts4 + global ts5 + state = update_state() init_pal() @@ -297,7 +396,7 @@ def draw_palette(): for x in xrange(32): ypos = palette_y for y in xrange(32): - color = struct.unpack('>BBBB',struct.pack('>I',colors[cid])) + color = struct.unpack('>BBBB',struct.pack('>i',colors[cid])) glColor3f(color[0]/255.0,color[1]/255.0,color[2]/255.0) glBegin(GL_POLYGON) glVertex2i(xpos,ypos) @@ -328,7 +427,7 @@ def draw_palette(): xpos = xpos + ssize #draw intensity gradient - color = struct.unpack('>BBBB',struct.pack('>I',colors[curswatch])) + color = struct.unpack('>BBBB',struct.pack('>i',colors[curswatch])) color = [color[0]/255.0,color[1]/255.0,color[2]/255.0] colsteps = [color[0]/255.0,color[1]/255.0,color[2]/255.0] stripwidth = (palette_size * 32.0) / 256 @@ -355,15 +454,15 @@ def draw_palette(): xpos = ((palette_size*32) * (1.0 - curint)) + palette_x glColor3f(1.0,1.0,1.0) glBegin(GL_LINE_LOOP) - glVertex2i(xpos-6,grady-1) - glVertex2i(xpos+6,grady-1) - glVertex2i(xpos+6,grady+palette_size+1) - glVertex2i(xpos-6,grady+palette_size+1) + glVertex2i(int(xpos-6),int(grady-1)) + glVertex2i(int(xpos+6),int(grady-1)) + glVertex2i(int(xpos+6),int(grady+palette_size+1)) + glVertex2i(int(xpos-6),int(grady+palette_size+1)) #glVertex2i(xpos-6,grady+7) glEnd() #draw color picker - color = struct.unpack('>BBBB',struct.pack('>I',colors[curswatch])) + color = struct.unpack('>BBBB',struct.pack('>i',colors[curswatch])) pickcol = (color[0]/255.0,color[1]/255.0,color[2]/255.0) picker = Blender.Draw.ColorPicker(1,highlight[0][0]+1,highlight[0][1]+1,ssize-2,ssize-2,pickcol,ptt) @@ -377,6 +476,24 @@ def draw_palette(): glVertex2i(highlight[0][0],highlight[0][1]) glEnd() + #draw text string explanations + xpos = palette_size*32+20 + ypos = palette_size*32+10 + glRasterPos2d(xpos,ypos) + ts1 = Blender.Draw.Text("FLT Palette Manager V 1.0") + ypos = ypos - 20 + glRasterPos2d(xpos,ypos) + ts3 = Blender.Draw.Text("CKEY - Copy Active Face Color*") + ypos = ypos - 20 + glRasterPos2d(xpos,ypos) + ts2 = Blender.Draw.Text("VKEY - Paste Color to Selected Faces") + ypos = ypos - 20 + glRasterPos2d(xpos,ypos) + ts4 = Blender.Draw.Text("GKEY - Select Faces With Same Color") + ypos = ypos - 15 + glRasterPos2d(xpos,ypos) + ts5 = Blender.Draw.Text("(*Requires mesh with UV coordinates)", 'small') + def gui(): glClearColor(0.5,0.5,0.5,1.0) glClear(GL_COLOR_BUFFER_BIT) @@ -385,4 +502,4 @@ def gui(): init_pal() Draw.Register(gui,event,but_event) - + \ No newline at end of file diff --git a/release/scripts/import_dxf.py b/release/scripts/import_dxf.py index 09e51c22a9f..bb0119a9a81 100644 --- a/release/scripts/import_dxf.py +++ b/release/scripts/import_dxf.py @@ -7,7 +7,7 @@ Group: 'Import' Tooltip: 'Import for DXF geometry data (Drawing eXchange Format).' """ __author__ = 'Kitsu(Ed Blake) & migius(Remigiusz Fiedler)' -__version__ = '1.12 - 2008.07.04 by migius' +__version__ = '1.12 - 2008.08.03 by migius' __url__ = ["http://blenderartists.org/forum/showthread.php?t=84319", "http://wiki.blender.org/index.php/Scripts/Manual/Import/DXF-3D"] __email__ = ["migius(at)4d-vectors.de","Kitsune_e(at)yahoo.com"] @@ -88,7 +88,7 @@ in creating new objects in scene database - probably a database management probl """ History: - v1.0 - 2008.01. by migius + v1.0 - 2007/2008 by migius planned tasks: -- (to see more, search for "--todo--" in script code) -- command-line-mode/batch-mode diff --git a/release/scripts/ply_export.py b/release/scripts/ply_export.py index cecde5a0b59..19a4a60674e 100644 --- a/release/scripts/ply_export.py +++ b/release/scripts/ply_export.py @@ -13,7 +13,7 @@ from Blender import Mesh, Scene, Window, sys, Image, Draw import BPyMesh __author__ = "Bruce Merry" -__version__ = "0.92" +__version__ = "0.93" __bpydoc__ = """\ This script exports Stanford PLY files from Blender. It supports normals, colours, and texture coordinates per face or per vertex. @@ -37,6 +37,8 @@ Only one mesh can be exported at a time. # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Vector rounding se we can use as keys # +# Updated on Aug 11, 2008 by Campbell Barton +# - added 'comment' prefix to comments - Needed to comply with the PLY spec. # # Updated on Jan 1, 2007 by Gabe Ghearing # - fixed normals so they are correctly smooth/flat @@ -162,7 +164,7 @@ def file_callback(filename): file.write('ply\n') file.write('format ascii 1.0\n') - file.write('Created by Blender3D %s - www.blender.org, source file: %s\n' % (Blender.Get('version'), Blender.Get('filename').split('/')[-1].split('\\')[-1] )) + file.write('comment Created by Blender3D %s - www.blender.org, source file: %s\n' % (Blender.Get('version'), Blender.Get('filename').split('/')[-1].split('\\')[-1] )) file.write('element vertex %d\n' % len(verts)) @@ -210,7 +212,6 @@ def file_callback(filename): if faceUV: uvcoord= rvec2d(uv[j]) elif vertexUV: uvcoord= rvec2d(v.uvco) if vertexColors: color= col[j].r, col[j].g, col[j].b - co = v.co file.write('%d ' % vdict[v.index][normal, uvcoord, color]) diff --git a/source/blender/blenkernel/BKE_bvhutils.h b/source/blender/blenkernel/BKE_bvhutils.h new file mode 100644 index 00000000000..dd9ea61f24b --- /dev/null +++ b/source/blender/blenkernel/BKE_bvhutils.h @@ -0,0 +1,98 @@ +/** + * + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2006 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): André Pinto + * + * ***** END GPL LICENSE BLOCK ***** + */ +#ifndef BKE_BVHUTILS_H +#define BKE_BVHUTILS_H + +#include "BLI_kdopbvh.h" + +/* + * This header encapsulates necessary code to buld a BVH + */ + +struct DerivedMesh; +struct MVert; +struct MFace; + +/* + * struct that kepts basic information about a BVHTree build from a mesh + */ +typedef struct BVHTreeFromMesh +{ + struct BVHTree *tree; + + /* default callbacks to bvh nearest and raycast */ + BVHTree_NearestPointCallback nearest_callback; + BVHTree_RayCastCallback raycast_callback; + + /* Mesh represented on this BVHTree */ + struct DerivedMesh *mesh; + + /* Vertex array, so that callbacks have instante access to data */ + struct MVert *vert; + struct MFace *face; + + /* radius for raycast */ + float sphere_radius; + +} BVHTreeFromMesh; + +/* + * Builds a bvh tree where nodes are the vertexs of the given mesh. + * Configures BVHTreeFromMesh. + * + * The tree is build in mesh space coordinates, this means special care must be made on queries + * so that the coordinates and rays are first translated on the mesh local coordinates. + * Reason for this is that later bvh_from_mesh_* might use a cache system and so it becames possible to reuse + * a BVHTree. + * + * free_bvhtree_from_mesh should be called when the tree is no longer needed. + */ +void bvhtree_from_mesh_verts(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis); + +/* + * Builds a bvh tree where nodes are the faces of the given mesh. + * Configures BVHTreeFromMesh. + * + * The tree is build in mesh space coordinates, this means special care must be made on queries + * so that the coordinates and rays are first translated on the mesh local coordinates. + * Reason for this is that later bvh_from_mesh_* might use a cache system and so it becames possible to reuse + * a BVHTree. + * + * free_bvhtree_from_mesh should be called when the tree is no longer needed. + */ +void bvhtree_from_mesh_faces(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis); + +/* + * Frees data allocated by a call to bvhtree_from_mesh_*. + */ +void free_bvhtree_from_mesh(struct BVHTreeFromMesh *data); + +#endif + diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 1f8dd74a6eb..1592c3e5504 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -734,9 +734,8 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Object *par, float par_ ParticleCacheKey *cache; ParticleSystemModifierData *psmd; float ctime, pa_time, scale = 1.0f; - float tmat[4][4], mat[4][4], obrotmat[4][4], pamat[4][4], size=0.0; + float tmat[4][4], mat[4][4], pamat[4][4], size=0.0; float (*obmat)[4], (*oldobmat)[4]; - float xvec[3] = {-1.0, 0.0, 0.0}, q[4]; int lay, a, b, k, step_nbr = 0, counter, hair = 0; int totpart, totchild, totgroup=0, pa_num; @@ -898,14 +897,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Object *par, float par_ /* to give ipos in object correct offset */ where_is_object_time(ob, ctime-pa_time); - if(!hair) { - vectoquat(xvec, ob->trackflag, ob->upflag, q); - QuatToMat4(q, obrotmat); - obrotmat[3][3]= 1.0f; - Mat4MulMat4(mat, obrotmat, pamat); - } - else - Mat4CpyMat4(mat, pamat); + Mat4CpyMat4(mat, pamat); Mat4MulMat4(tmat, obmat, mat); Mat4MulFloat3((float *)tmat, size*scale); diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c new file mode 100644 index 00000000000..10e92b8b705 --- /dev/null +++ b/source/blender/blenkernel/intern/bvhutils.c @@ -0,0 +1,433 @@ +/** + * + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): André Pinto. + * + * ***** END GPL LICENSE BLOCK ***** + */ +#include +#include +#include + +#include "BKE_bvhutils.h" + +#include "DNA_object_types.h" +#include "DNA_modifier_types.h" +#include "DNA_meshdata_types.h" + +#include "BKE_DerivedMesh.h" +#include "BKE_utildefines.h" +#include "BKE_deform.h" +#include "BKE_cdderivedmesh.h" +#include "BKE_displist.h" +#include "BKE_global.h" + +#include "BLI_arithb.h" + +/* Math stuff for ray casting on mesh faces and for nearest surface */ + +static float nearest_point_in_tri_surface(const float *point, const float *v0, const float *v1, const float *v2, float *nearest); + +#define ISECT_EPSILON 1e-6 +static float ray_tri_intersection(const BVHTreeRay *ray, const float m_dist, const float *v0, const float *v1, const float *v2) +{ + float dist; + + if(RayIntersectsTriangle((float*)ray->origin, (float*)ray->direction, (float*)v0, (float*)v1, (float*)v2, &dist, NULL)) + return dist; + + return FLT_MAX; +} + +static float sphereray_tri_intersection(const BVHTreeRay *ray, float radius, const float m_dist, const float *v0, const float *v1, const float *v2) +{ + + float idist; + float p1[3]; + float plane_normal[3], hit_point[3]; + + CalcNormFloat((float*)v0, (float*)v1, (float*)v2, plane_normal); + + VECADDFAC( p1, ray->origin, ray->direction, m_dist); + if(SweepingSphereIntersectsTriangleUV((float*)ray->origin, p1, radius, (float*)v0, (float*)v1, (float*)v2, &idist, hit_point)) + { + return idist * m_dist; + } + + return FLT_MAX; +} + +/* + * This calculates the distance from point to the plane + * Distance is negative if point is on the back side of plane + */ +static float point_plane_distance(const float *point, const float *plane_point, const float *plane_normal) +{ + float pp[3]; + VECSUB(pp, point, plane_point); + return INPR(pp, plane_normal); +} +static float choose_nearest(const float v0[2], const float v1[2], const float point[2], float closest[2]) +{ + float d[2][2], sdist[2]; + VECSUB2D(d[0], v0, point); + VECSUB2D(d[1], v1, point); + + sdist[0] = d[0][0]*d[0][0] + d[0][1]*d[0][1]; + sdist[1] = d[1][0]*d[1][0] + d[1][1]*d[1][1]; + + if(sdist[0] < sdist[1]) + { + if(closest) + VECCOPY2D(closest, v0); + return sdist[0]; + } + else + { + if(closest) + VECCOPY2D(closest, v1); + return sdist[1]; + } +} +/* + * calculates the closest point between point-tri (2D) + * returns that tri must be right-handed + * Returns square distance + */ +static float closest_point_in_tri2D(const float point[2], /*const*/ float tri[3][2], float closest[2]) +{ + float edge_di[2]; + float v_point[2]; + float proj[2]; //point projected over edge-dir, edge-normal (witouth normalized edge) + const float *v0 = tri[2], *v1; + float edge_slen, d; //edge squared length + int i; + const float *nearest_vertex = NULL; + + + //for each edge + for(i=0, v0=tri[2], v1=tri[0]; i < 3; v0=tri[i++], v1=tri[i]) + { + VECSUB2D(edge_di, v1, v0); + VECSUB2D(v_point, point, v0); + + proj[1] = v_point[0]*edge_di[1] - v_point[1]*edge_di[0]; //dot product with edge normal + + //point inside this edge + if(proj[1] < 0) + continue; + + proj[0] = v_point[0]*edge_di[0] + v_point[1]*edge_di[1]; + + //closest to this edge is v0 + if(proj[0] < 0) + { + if(nearest_vertex == NULL || nearest_vertex == v0) + nearest_vertex = v0; + else + { + //choose nearest + return choose_nearest(nearest_vertex, v0, point, closest); + } + i++; //We can skip next edge + continue; + } + + edge_slen = edge_di[0]*edge_di[0] + edge_di[1]*edge_di[1]; //squared edge len + //closest to this edge is v1 + if(proj[0] > edge_slen) + { + if(nearest_vertex == NULL || nearest_vertex == v1) + nearest_vertex = v1; + else + { + return choose_nearest(nearest_vertex, v1, point, closest); + } + continue; + } + + //nearest is on this edge + d= proj[1] / edge_slen; + closest[0] = point[0] - edge_di[1] * d; + closest[1] = point[1] + edge_di[0] * d; + + return proj[1]*proj[1]/edge_slen; + } + + if(nearest_vertex) + { + VECSUB2D(v_point, nearest_vertex, point); + VECCOPY2D(closest, nearest_vertex); + return v_point[0]*v_point[0] + v_point[1]*v_point[1]; + } + else + { + VECCOPY(closest, point); //point is already inside + return 0.0f; + } +} + +/* + * Returns the square of the minimum distance between the point and a triangle surface + * If nearest is not NULL the nearest surface point is written on it + */ +static float nearest_point_in_tri_surface(const float *point, const float *v0, const float *v1, const float *v2, float *nearest) +{ + //Lets solve the 2D problem (closest point-tri) + float normal_dist, plane_sdist, plane_offset; + float du[3], dv[3], dw[3]; //orthogonal axis (du=(v0->v1), dw=plane normal) + + float p_2d[2], tri_2d[3][2], nearest_2d[2]; + + CalcNormFloat((float*)v0, (float*)v1, (float*)v2, dw); + + //point-plane distance and calculate axis + normal_dist = point_plane_distance(point, v0, dw); + + // OPTIMIZATION + // if we are only interested in nearest distance if its closer than some distance already found + // we can: + // if(normal_dist*normal_dist >= best_dist_so_far) return FLOAT_MAX; + // + + VECSUB(du, v1, v0); + Normalize(du); + Crossf(dv, dw, du); + plane_offset = INPR(v0, dw); + + //project stuff to 2d + tri_2d[0][0] = INPR(du, v0); + tri_2d[0][1] = INPR(dv, v0); + + tri_2d[1][0] = INPR(du, v1); + tri_2d[1][1] = INPR(dv, v1); + + tri_2d[2][0] = INPR(du, v2); + tri_2d[2][1] = INPR(dv, v2); + + p_2d[0] = INPR(du, point); + p_2d[1] = INPR(dv, point); + + //we always have a right-handed tri + //this should always happen because of the way normal is calculated + plane_sdist = closest_point_in_tri2D(p_2d, tri_2d, nearest_2d); + + //project back to 3d + if(nearest) + { + nearest[0] = du[0]*nearest_2d[0] + dv[0] * nearest_2d[1] + dw[0] * plane_offset; + nearest[1] = du[1]*nearest_2d[0] + dv[1] * nearest_2d[1] + dw[1] * plane_offset; + nearest[2] = du[2]*nearest_2d[0] + dv[2] * nearest_2d[1] + dw[2] * plane_offset; + } + + return plane_sdist + normal_dist*normal_dist; +} + + +/* + * BVH from meshs callbacks + */ + +// Callback to bvh tree nearest point. The tree must bust have been built using bvhtree_from_mesh_faces. +// userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree. +static void mesh_faces_nearest_point(void *userdata, int index, const float *co, BVHTreeNearest *nearest) +{ + const BVHTreeFromMesh *data = (BVHTreeFromMesh*) userdata; + MVert *vert = data->vert; + MFace *face = data->face + index; + + float *t0, *t1, *t2, *t3; + t0 = vert[ face->v1 ].co; + t1 = vert[ face->v2 ].co; + t2 = vert[ face->v3 ].co; + t3 = face->v4 ? vert[ face->v4].co : NULL; + + + do + { + float nearest_tmp[3], dist; + float vec[3][3]; + + // only insert valid triangles / quads with area > 0 + VECSUB(vec[0], t2, t1); + VECSUB(vec[1], t0, t1); + Crossf(vec[2], vec[0], vec[1]); + if(INPR(vec[2], vec[2]) >= FLT_EPSILON) + { + dist = nearest_point_in_tri_surface(co,t0, t1, t2, nearest_tmp); + if(dist < nearest->dist) + { + nearest->index = index; + nearest->dist = dist; + VECCOPY(nearest->co, nearest_tmp); + CalcNormFloat((float*)t0, (float*)t1, (float*)t2, nearest->no); //TODO.. (interpolate normals from the vertexs coordinates? + } + } + + t1 = t2; + t2 = t3; + t3 = NULL; + + } while(t2); +} + +// Callback to bvh tree raycast. The tree must bust have been built using bvhtree_from_mesh_faces. +// userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree. +static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) +{ + const BVHTreeFromMesh *data = (BVHTreeFromMesh*) userdata; + MVert *vert = data->vert; + MFace *face = data->face + index; + + float *t0, *t1, *t2, *t3; + t0 = vert[ face->v1 ].co; + t1 = vert[ face->v2 ].co; + t2 = vert[ face->v3 ].co; + t3 = face->v4 ? vert[ face->v4].co : NULL; + + + do + { + float dist; + if(data->sphere_radius == 0.0f) + dist = ray_tri_intersection(ray, hit->dist, t0, t1, t2); + else + dist = sphereray_tri_intersection(ray, data->sphere_radius, hit->dist, t0, t1, t2); + + if(dist >= 0 && dist < hit->dist) + { + hit->index = index; + hit->dist = dist; + VECADDFAC(hit->co, ray->origin, ray->direction, dist); + + CalcNormFloat(t0, t1, t2, hit->no); + } + + t1 = t2; + t2 = t3; + t3 = NULL; + + } while(t2); +} + +/* + * BVH builders + */ +// Builds a bvh tree.. where nodes are the vertexs of the given mesh +void bvhtree_from_mesh_verts(BVHTreeFromMesh *data, DerivedMesh *mesh, float epsilon, int tree_type, int axis) +{ + int i; + int numVerts= mesh->getNumVerts(mesh); + MVert *vert = mesh->getVertDataArray(mesh, CD_MVERT); + BVHTree *tree = NULL; + + memset(data, 0, sizeof(*data)); + + if(vert == NULL) + { + printf("bvhtree cant be build: cant get a vertex array"); + return; + } + + tree = BLI_bvhtree_new(numVerts, epsilon, tree_type, axis); + if(tree != NULL) + { + for(i = 0; i < numVerts; i++) + BLI_bvhtree_insert(tree, i, vert[i].co, 1); + + BLI_bvhtree_balance(tree); + + data->tree = tree; + + //a NULL nearest callback works fine + //remeber the min distance to point is the same as the min distance to BV of point + data->nearest_callback = NULL; + data->raycast_callback = NULL; + + data->mesh = mesh; + data->vert = mesh->getVertDataArray(mesh, CD_MVERT); + data->face = mesh->getFaceDataArray(mesh, CD_MFACE); + + data->sphere_radius = epsilon; + } +} + +// Builds a bvh tree.. where nodes are the faces of the given mesh. +void bvhtree_from_mesh_faces(BVHTreeFromMesh *data, DerivedMesh *mesh, float epsilon, int tree_type, int axis) +{ + int i; + int numFaces= mesh->getNumFaces(mesh); + MVert *vert = mesh->getVertDataArray(mesh, CD_MVERT); + MFace *face = mesh->getFaceDataArray(mesh, CD_MFACE); + BVHTree *tree = NULL; + + memset(data, 0, sizeof(*data)); + + if(vert == NULL && face == NULL) + { + printf("bvhtree cant be build: cant get a vertex/face array"); + return; + } + + /* Create a bvh-tree of the given target */ + tree = BLI_bvhtree_new(numFaces, epsilon, tree_type, axis); + if(tree != NULL) + { + for(i = 0; i < numFaces; i++) + { + float co[4][3]; + VECCOPY(co[0], vert[ face[i].v1 ].co); + VECCOPY(co[1], vert[ face[i].v2 ].co); + VECCOPY(co[2], vert[ face[i].v3 ].co); + if(face[i].v4) + VECCOPY(co[3], vert[ face[i].v4 ].co); + + BLI_bvhtree_insert(tree, i, co[0], face[i].v4 ? 4 : 3); + } + BLI_bvhtree_balance(tree); + + data->tree = tree; + data->nearest_callback = mesh_faces_nearest_point; + data->raycast_callback = mesh_faces_spherecast; + + data->mesh = mesh; + data->vert = mesh->getVertDataArray(mesh, CD_MVERT); + data->face = mesh->getFaceDataArray(mesh, CD_MFACE); + + data->sphere_radius = epsilon; + } +} + +// Frees data allocated by a call to bvhtree_from_mesh_*. +void free_bvhtree_from_mesh(struct BVHTreeFromMesh *data) +{ + if(data->tree) + { + BLI_bvhtree_free(data->tree); + memset( data, 0, sizeof(data) ); + } +} + + diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 7dca87d5c13..d1c0cdec71d 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -4653,7 +4653,7 @@ static void system_step(Object *ob, ParticleSystem *psys, ParticleSystemModifier PTCacheID pid; int totpart, oldtotpart, totchild, oldtotchild, p; float disp, *vg_vel= 0, *vg_tan= 0, *vg_rot= 0, *vg_size= 0; - int init= 0, distr= 0, alloc= 0, usecache= 0; + int init= 0, distr= 0, alloc= 0, usecache= 0, only_children_changed= 0; int framenr, framedelta, startframe, endframe; part= psys->part; @@ -4720,6 +4720,7 @@ static void system_step(Object *ob, ParticleSystem *psys, ParticleSystemModifier totchild = get_psys_tot_child(psys); if(oldtotpart != totpart || (psys->part->childtype && oldtotchild != totchild)) { + only_children_changed = (oldtotpart == totpart); realloc_particles(ob, psys, totpart); alloc = 1; distr= 1; @@ -4740,14 +4741,17 @@ static void system_step(Object *ob, ParticleSystem *psys, ParticleSystemModifier if((psys->part->type == PART_HAIR) && !(psys->flag & PSYS_HAIR_DONE)) /* don't generate children while growing hair - waste of time */ - psys_free_children(psys); - else if(get_psys_tot_child(psys)) - distribute_particles(ob, psys, PART_FROM_CHILD); + psys_free_children(psys); + else if(get_psys_tot_child(psys)) + distribute_particles(ob, psys, PART_FROM_CHILD); } - initialize_all_particles(ob, psys, psmd); - if(alloc) - reset_all_particles(ob, psys, psmd, 0.0, cfra, oldtotpart); + if(only_children_changed==0) { + initialize_all_particles(ob, psys, psmd); + + if(alloc) + reset_all_particles(ob, psys, psmd, 0.0, cfra, oldtotpart); + } /* flag for possible explode modifiers after this system */ psmd->flag |= eParticleSystemFlag_Pars; diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index da1dcfa6c5b..936381c85cc 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -545,6 +545,8 @@ Tex *copy_texture(Tex *tex) if(texn->type==TEX_IMAGE) id_us_plus((ID *)texn->ima); else texn->ima= 0; + id_us_plus((ID *)texn->ipo); + if(texn->plugin) { texn->plugin= MEM_dupallocN(texn->plugin); open_plugin_tex(texn->plugin); diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h index 6d9c82a9626..6d9a17efebf 100644 --- a/source/blender/blenlib/BLI_kdopbvh.h +++ b/source/blender/blenlib/BLI_kdopbvh.h @@ -1,4 +1,6 @@ /** + * + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index 7f634def386..9671551a7f1 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -43,6 +43,10 @@ #include #endif + + +#define MAX_TREETYPE 32 + typedef struct BVHNode { struct BVHNode **children; @@ -71,6 +75,7 @@ typedef struct BVHOverlapData BVHTree *tree1, *tree2; BVHTreeOverlap *overlap; int i, max_overlap; /* i is number of overlaps */ + int start_axis, stop_axis; } BVHOverlapData; typedef struct BVHNearestData @@ -489,7 +494,7 @@ static void verify_tree(BVHTree *tree) #endif //Helper data and structures to build a min-leaf generalized implicit tree -//This code can be easily reduced (basicly this is only method to calculate pow(k, n) in O(1).. and sutff like that) +//This code can be easily reduced (basicly this is only method to calculate pow(k, n) in O(1).. and stuff like that) typedef struct BVHBuildHelper { int tree_type; // @@ -647,7 +652,7 @@ static void non_recursive_bvh_div_nodes(BVHTree *tree, BVHNode *branches_array, int k; const int parent_level_index= j-i; BVHNode* parent = branches_array + j; - int nth_positions[ tree_type + 1 ]; + int nth_positions[ MAX_TREETYPE + 1]; char split_axis; int parent_leafs_begin = implicit_leafs_index(&data, depth, parent_level_index); @@ -712,6 +717,9 @@ BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis) // theres not support for trees below binary-trees :P if(tree_type < 2) return NULL; + + if(tree_type > MAX_TREETYPE) + return NULL; tree = (BVHTree *)MEM_callocN(sizeof(BVHTree), "BVHTree"); @@ -904,7 +912,7 @@ void BLI_bvhtree_update_tree(BVHTree *tree) BVHNode** root = tree->nodes + tree->totleaf; BVHNode** index = tree->nodes + tree->totleaf + tree->totbranch-1; - for (; index != root; index--) + for (; index >= root; index--) node_join(tree, *index); } @@ -942,7 +950,7 @@ static void traverse(BVHOverlapData *data, BVHNode *node1, BVHNode *node2) { int j; - if(tree_overlap(node1, node2, MIN2(data->tree1->start_axis, data->tree2->start_axis), MIN2(data->tree1->stop_axis, data->tree2->stop_axis))) + if(tree_overlap(node1, node2, data->start_axis, data->stop_axis)) { // check if node1 is a leaf if(!node1->totnode) @@ -1023,6 +1031,8 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, int *result) data[j]->tree2 = tree2; data[j]->max_overlap = MAX2(tree1->totleaf, tree2->totleaf); data[j]->i = 0; + data[j]->start_axis = MIN2(tree1->start_axis, tree2->start_axis); + data[j]->stop_axis = MIN2(tree1->stop_axis, tree2->stop_axis ); } #pragma omp parallel for private(j) schedule(static) diff --git a/source/blender/include/BIF_editarmature.h b/source/blender/include/BIF_editarmature.h index 13c16749612..07fc8f08b4a 100644 --- a/source/blender/include/BIF_editarmature.h +++ b/source/blender/include/BIF_editarmature.h @@ -114,6 +114,7 @@ void setflag_armature(short mode); void unique_editbone_name (struct ListBase *ebones, char *name); void auto_align_armature(short mode); +void switch_direction_armature(void); void create_vgroups_from_armature(struct Object *ob, struct Object *par); void add_verts_to_dgroups(struct Object *ob, struct Object *par, int heat, int mirror); @@ -135,7 +136,6 @@ void transform_armature_mirror_update(void); void hide_selected_armature_bones(void); void hide_unselected_armature_bones(void); void show_all_armature_bones(void); -void set_locks_armature_bones(short lock); #define BONESEL_ROOT 0x10000000 #define BONESEL_TIP 0x20000000 @@ -144,6 +144,10 @@ void set_locks_armature_bones(short lock); #define BONESEL_NOSEL 0x80000000 /* Indicates a negative number */ +/* useful macros */ +#define EBONE_VISIBLE(arm, ebone) ((arm->layer & ebone->layer) && !(ebone->flag & BONE_HIDDEN_A)) +#define EBONE_EDITABLE(ebone) ((ebone->flag & BONE_SELECTED) && !(ebone->flag & BONE_EDITMODE_LOCKED)) + /* used in bone_select_hierachy() */ #define BONE_SELECT_PARENT 0 #define BONE_SELECT_CHILD 1 diff --git a/source/blender/include/BIF_editmesh.h b/source/blender/include/BIF_editmesh.h index ca9f3d6a378..9354a577ac1 100644 --- a/source/blender/include/BIF_editmesh.h +++ b/source/blender/include/BIF_editmesh.h @@ -132,7 +132,7 @@ extern int EM_check_backbuf(unsigned int index); extern void EM_free_backbuf(void); extern void EM_selectmode_menu(void); - +extern void EM_mesh_copy_face(short type); extern void vertexnoise(void); extern void vertexsmooth(void); diff --git a/source/blender/include/butspace.h b/source/blender/include/butspace.h index af74946f0e6..b8c3584a45e 100644 --- a/source/blender/include/butspace.h +++ b/source/blender/include/butspace.h @@ -593,7 +593,7 @@ void curvemap_buttons(struct uiBlock *block, struct CurveMapping *cumap, char la #define B_VPCOLSLI 2801 #define B_VPGAMMA 2802 - +#define B_COPY_TF_TRANSP 2803 #define B_COPY_TF_MODE 2804 #define B_COPY_TF_UV 2805 #define B_COPY_TF_COL 2806 diff --git a/source/blender/python/api2_2x/doc/Render.py b/source/blender/python/api2_2x/doc/Render.py index d4dc83e84a0..5300fdab808 100644 --- a/source/blender/python/api2_2x/doc/Render.py +++ b/source/blender/python/api2_2x/doc/Render.py @@ -170,17 +170,6 @@ def SetRenderWinPos(locationList): the location of the Render window on the screen. """ -def EnableEdgeShift(): - """ - Globally with the unified renderer enabled the outlines of the render - are shifted a bit. - """ - -def EnableEdgeAll(): - """ - Globally consider transparent faces for edge-rendering with the unified renderer. - """ - class RenderData: """ The RenderData object @@ -772,7 +761,7 @@ class RenderData: """ Get/set the starting frame for sequence rendering. @type frame: int (optional) - @param frame: must be between 1 - 18000 + @param frame: must be a valid Blender frame number. @rtype: int (if prototype is empty) @return: Current starting frame for the scene. """ @@ -781,7 +770,7 @@ class RenderData: """ Get/set the ending frame for sequence rendering. @type frame: int (optional) - @param frame: must be between 1 - 18000 + @param frame: must be a valid Blender frame number. @rtype: int (if prototype is empty) @return: Current ending frame for the scene. """ diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index 1155d2ea817..c352a83d0f4 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -263,7 +263,12 @@ static void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr) shade_input_set_shade_texco(shi); if(is->mode==RE_RAY_SHADOW_TRA) - shade_color(shi, shr); + if(shi->mat->nodetree && shi->mat->use_nodes) { + ntreeShaderExecTree(shi->mat->nodetree, shi, shr); + shi->mat= vlr->mat; /* shi->mat is being set in nodetree */ + } + else + shade_color(shi, shr); else { if(shi->mat->nodetree && shi->mat->use_nodes) { ntreeShaderExecTree(shi->mat->nodetree, shi, shr); diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 63ef31b6062..bfdd4f0c9a0 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -5825,13 +5825,9 @@ void sculptmode_draw_interface_textures(uiBlock *block, unsigned short cx, unsig void do_fpaintbuts(unsigned short event) { - Mesh *me; Object *ob; bDeformGroup *defGroup; - MTFace *activetf, *tf; - MFace *mf; - MCol *activemcol; - int a; + MTFace *activetf; SculptData *sd= &G.scene->sculptdata; ID *id, *idtest; extern VPaint Gwp; /* from vpaint */ @@ -5849,45 +5845,19 @@ void do_fpaintbuts(unsigned short event) vpaint_dogamma(); break; case B_COPY_TF_MODE: + EM_mesh_copy_face(4); /* todo, get rid of magic numbers */ + break; + case B_COPY_TF_TRANSP: + EM_mesh_copy_face(5); + break; case B_COPY_TF_UV: + EM_mesh_copy_face(3); + break; case B_COPY_TF_COL: + EM_mesh_copy_face(6); + break; case B_COPY_TF_TEX: - me= get_mesh(OBACT); - activetf= get_active_mtface(NULL, &activemcol, 0); - - if(me && activetf) { - for (a=0, tf=me->mtface, mf=me->mface; a < me->totface; a++, tf++, mf++) { - if(tf!=activetf && (mf->flag & ME_FACE_SEL)) { - if(event==B_COPY_TF_MODE) { - tf->mode= activetf->mode; - tf->transp= activetf->transp; - } - else if(event==B_COPY_TF_UV) { - memcpy(tf->uv, activetf->uv, sizeof(tf->uv)); - tf->tpage= activetf->tpage; - tf->tile= activetf->tile; - - if(activetf->mode & TF_TILES) tf->mode |= TF_TILES; - else tf->mode &= ~TF_TILES; - - } - else if(event==B_COPY_TF_TEX) { - tf->tpage= activetf->tpage; - tf->tile= activetf->tile; - - if(activetf->mode & TF_TILES) tf->mode |= TF_TILES; - else tf->mode &= ~TF_TILES; - } - else if(event==B_COPY_TF_COL && activemcol) - memcpy(&me->mcol[a*4], activemcol, sizeof(MCol)*4); - } - } - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - do_shared_vertexcol(me); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIMAGE, 0); - } + EM_mesh_copy_face(2); break; case B_SET_VCOL: if(FACESEL_PAINT_TEST) @@ -6324,8 +6294,20 @@ static void editing_panel_mesh_texface(void) if(uiNewPanel(curarea, block, "Texture Face", "Editing", 960, 0, 318, 204)==0) return; tf = get_active_mtface(NULL, NULL, 0); + if(tf) { + uiDefBut(block, LABEL, B_NOP, "Active Face Mode", 600,185,300,19, NULL, 0.0, 0.0, 0, 0, "Face mode its used for TexFace display and the game engine "); + uiDefBut(block, BUT,B_COPY_TF_MODE, "Copy", 850,185,50,19, 0, 0, 0, 0, 0, "Copy active faces mode to other selected (View3D Ctrl+C)"); + + /* Other copy buttons, layout isnt that nice */ uiBlockBeginAlign(block); + uiDefBut(block, BUT,B_COPY_TF_UV, "CopyUV", 600,15,100,19, 0, 0, 0, 0, 0, "Copy active faces UVs to other selected (View3D Ctrl+C)"); + uiDefBut(block, BUT,B_COPY_TF_TEX, "CopyTex", 700,15,100,19, 0, 0, 0, 0, 0, "Copy active faces Texture to other selected (View3D Ctrl+C)"); + uiDefBut(block, BUT,B_COPY_TF_COL, "CopyColor", 800,15,100,19, 0, 0, 0, 0, 0, "Copy active faces Color to other selected (View3D Ctrl+C)"); + uiBlockEndAlign(block); + + uiBlockBeginAlign(block); + uiDefButBitS(block, TOG, TF_TEX, B_REDR_3D_IMA, "Tex", 600,160,60,19, &tf->mode, 0, 0, 0, 0, "Render face with texture"); uiDefButBitS(block, TOG, TF_TILES, B_REDR_3D_IMA, "Tiles", 660,160,60,19, &tf->mode, 0, 0, 0, 0, "Use tilemode for face"); uiDefButBitS(block, TOG, TF_LIGHT, REDRAWVIEW3D, "Light", 720,160,60,19, &tf->mode, 0, 0, 0, 0, "Use light for face"); @@ -6336,24 +6318,30 @@ static void editing_panel_mesh_texface(void) uiDefButBitS(block, TOG, TF_SHAREDCOL, REDRAWVIEW3D, "Shared", 600,135,60,19, &tf->mode, 0, 0, 0, 0, "Blend vertex colors across face when vertices are shared"); uiDefButBitS(block, TOG, TF_TWOSIDE, REDRAWVIEW3D, "Twoside",660,135,60,19, &tf->mode, 0, 0, 0, 0, "Render face twosided"); uiDefButBitS(block, TOG, TF_OBCOL, REDRAWVIEW3D, "ObColor",720,135,60,19, &tf->mode, 0, 0, 0, 0, "Use ObColor instead of vertex colors"); - - uiBlockBeginAlign(block); + uiBlockEndAlign(block); + uiBlockBeginAlign(block); uiDefButBitS(block, TOG, TF_BILLBOARD, B_TFACE_HALO, "Halo", 600,110,60,19, &tf->mode, 0, 0, 0, 0, "Screen aligned billboard"); uiDefButBitS(block, TOG, TF_BILLBOARD2, B_TFACE_BILLB, "Billboard",660,110,60,19, &tf->mode, 0, 0, 0, 0, "Billboard with Z-axis constraint"); uiDefButBitS(block, TOG, TF_SHADOW, REDRAWVIEW3D, "Shadow", 720,110,60,19, &tf->mode, 0, 0, 0, 0, "Face is used for shadow"); uiDefButBitS(block, TOG, TF_BMFONT, REDRAWVIEW3D, "Text", 780,110,60,19, &tf->mode, 0, 0, 0, 0, "Enable bitmap text on face"); uiDefButBitS(block, TOG, TF_ALPHASORT, REDRAWVIEW3D, "Sort", 840,110,60,19, &tf->mode, 0, 0, 0, 0, "Enable sorting of faces for correct alpha drawing (slow, use Clip Alpha instead when possible)"); - + uiBlockEndAlign(block); + + uiDefBut(block, LABEL, B_NOP, "Active Face Alpha Blending (Transp)", 600,75,300,19, NULL, 0.0, 0.0, 0, 0, "Face mode its used for TexFace display and the game engine"); + uiDefBut(block, BUT,B_COPY_TF_TRANSP, "Copy", 850,75,50,19, 0, 0, 0, 0, 0, "Copy active faces transp to other selected (View3D Ctrl+C)"); + uiBlockBeginAlign(block); uiBlockSetCol(block, TH_BUT_SETTING1); - uiDefButC(block, ROW, REDRAWVIEW3D, "Opaque", 600,80,60,19, &tf->transp, 2.0, (float)TF_SOLID,0, 0, "Render color of textured face as color"); - uiDefButC(block, ROW, REDRAWVIEW3D, "Add", 660,80,60,19, &tf->transp, 2.0, (float)TF_ADD, 0, 0, "Render face transparent and add color of face"); - uiDefButC(block, ROW, REDRAWVIEW3D, "Alpha", 720,80,60,19, &tf->transp, 2.0, (float)TF_ALPHA,0, 0, "Render polygon transparent, depending on alpha channel of the texture"); - uiDefButC(block, ROW, REDRAWVIEW3D, "Clip Alpha", 780,80,80,19, &tf->transp, 2.0, (float)TF_CLIP,0, 0, "Use the images alpha values clipped with no blending (binary alpha)"); - } - else + uiDefButC(block, ROW, REDRAWVIEW3D, "Opaque", 600,50,60,19, &tf->transp, 2.0, (float)TF_SOLID,0, 0, "Render color of textured face as color"); + uiDefButC(block, ROW, REDRAWVIEW3D, "Add", 660,50,60,19, &tf->transp, 2.0, (float)TF_ADD, 0, 0, "Render face transparent and add color of face"); + uiDefButC(block, ROW, REDRAWVIEW3D, "Alpha", 720,50,60,19, &tf->transp, 2.0, (float)TF_ALPHA,0, 0, "Render polygon transparent, depending on alpha channel of the texture"); + uiDefButC(block, ROW, REDRAWVIEW3D, "Clip Alpha", 780,50,80,19, &tf->transp, 2.0, (float)TF_CLIP,0, 0, "Use the images alpha values clipped with no blending (binary alpha)"); + uiBlockEndAlign(block); + + } else { uiDefBut(block,LABEL,B_NOP, "(No Active Face)", 10,200,150,19,0,0,0,0,0,""); + } } diff --git a/source/blender/src/editarmature.c b/source/blender/src/editarmature.c index 80c24f3a989..35986fcff4a 100644 --- a/source/blender/src/editarmature.c +++ b/source/blender/src/editarmature.c @@ -854,6 +854,7 @@ static void separate_armature_bones (Object *ob, short sel) BLI_freelistN(&edbo); } +/* separate selected bones into their armature */ void separate_armature (void) { Object *oldob, *newob; @@ -1094,13 +1095,13 @@ void armature_select_hierarchy(short direction, short add_to_sel) arm= (bArmature *)ob->data; for (curbone= G.edbo.first; curbone; curbone= curbone->next) { - if (arm->layer & curbone->layer) { + if (EBONE_VISIBLE(arm, curbone)) { if (curbone->flag & (BONE_ACTIVE)) { if (direction == BONE_SELECT_PARENT) { if (curbone->parent == NULL) continue; else pabone = curbone->parent; - if ((arm->layer & pabone->layer) && !(pabone->flag & BONE_HIDDEN_A)) { + if (EBONE_VISIBLE(arm, pabone)) { pabone->flag |= (BONE_ACTIVE|BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL); if (pabone->parent) pabone->parent->flag |= BONE_TIPSEL; @@ -1109,11 +1110,12 @@ void armature_select_hierarchy(short direction, short add_to_sel) break; } - } else { // BONE_SELECT_CHILD + } + else { // BONE_SELECT_CHILD chbone = editbone_get_child(curbone, 1); if (chbone == NULL) continue; - if ((arm->layer & chbone->layer) && !(chbone->flag & BONE_HIDDEN_A)) { + if (EBONE_VISIBLE(arm, chbone)) { chbone->flag |= (BONE_ACTIVE|BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL); if (!add_to_sel) { @@ -1159,17 +1161,18 @@ void setflag_armature (short mode) /* get flag to set (sync these with the ones used in eBone_Flag */ if (mode == 2) - flag= pupmenu("Disable Setting%t|Draw Wire%x1|Deform%x2|Mult VG%x3|Hinge%x4|No Scale%x5"); + flag= pupmenu("Disable Setting%t|Draw Wire%x1|Deform%x2|Mult VG%x3|Hinge%x4|No Scale%x5|Locked%x6"); else if (mode == 1) - flag= pupmenu("Enable Setting%t|Draw Wire%x1|Deform%x2|Mult VG%x3|Hinge%x4|No Scale%x5"); + flag= pupmenu("Enable Setting%t|Draw Wire%x1|Deform%x2|Mult VG%x3|Hinge%x4|No Scale%x5|Locked%x6"); else - flag= pupmenu("Toggle Setting%t|Draw Wire%x1|Deform%x2|Mult VG%x3|Hinge%x4|No Scale%x5"); + flag= pupmenu("Toggle Setting%t|Draw Wire%x1|Deform%x2|Mult VG%x3|Hinge%x4|No Scale%x5|Locked%x6"); switch (flag) { case 1: flag = BONE_DRAWWIRE; break; case 2: flag = BONE_NO_DEFORM; break; case 3: flag = BONE_MULT_VG_ENV; break; case 4: flag = BONE_HINGE; break; case 5: flag = BONE_NO_SCALE; break; + case 6: flag = BONE_EDITMODE_LOCKED; break; default: return; } @@ -1725,12 +1728,12 @@ void auto_align_armature(short mode) float *cursor= give_cursor(); for (ebone = G.edbo.first; ebone; ebone=ebone->next) { - if (arm->layer & ebone->layer) { + if (EBONE_VISIBLE(arm, ebone)) { if (arm->flag & ARM_MIRROR_EDIT) flipbone = armature_bone_get_mirrored(ebone); if ((ebone->flag & BONE_SELECTED) || - (flipbone && flipbone->flag & BONE_SELECTED)) + (flipbone && (flipbone->flag & BONE_SELECTED))) { /* specific method used to calculate roll depends on mode */ if (mode == 1) { @@ -1975,7 +1978,7 @@ void addvert_armature(void) /* find the active or selected bone */ for (ebone = G.edbo.first; ebone; ebone=ebone->next) { - if (arm->layer & ebone->layer) { + if (EBONE_VISIBLE(arm, ebone)) { if (ebone->flag & (BONE_ACTIVE|BONE_TIPSEL)) break; } @@ -1983,7 +1986,7 @@ void addvert_armature(void) if (ebone==NULL) { for (ebone = G.edbo.first; ebone; ebone=ebone->next) { - if (arm->layer & ebone->layer) { + if (EBONE_VISIBLE(arm, ebone)) { if (ebone->flag & (BONE_ACTIVE|BONE_ROOTSEL)) break; } @@ -2066,11 +2069,12 @@ static EditBone *get_named_editbone(char *name) { EditBone *eBone; - if (name) + if (name) { for (eBone=G.edbo.first; eBone; eBone=eBone->next) { if (!strcmp(name, eBone->name)) return eBone; } + } return NULL; } @@ -2136,7 +2140,7 @@ void adduplicate_armature(void) /* Select mirrored bones */ if (arm->flag & ARM_MIRROR_EDIT) { for (curBone=G.edbo.first; curBone; curBone=curBone->next) { - if (arm->layer & curBone->layer) { + if (EBONE_VISIBLE(arm, curBone)) { if (curBone->flag & BONE_SELECTED) { eBone = armature_bone_get_mirrored(curBone); if (eBone) @@ -2148,13 +2152,13 @@ void adduplicate_armature(void) /* Find the selected bones and duplicate them as needed */ for (curBone=G.edbo.first; curBone && curBone!=firstDup; curBone=curBone->next) { - if (arm->layer & curBone->layer) { + if (EBONE_VISIBLE(arm, curBone)) { if (curBone->flag & BONE_SELECTED) { eBone=MEM_callocN(sizeof(EditBone), "addup_editbone"); eBone->flag |= BONE_SELECTED; /* Copy data from old bone to new bone */ - memcpy (eBone, curBone, sizeof(EditBone)); + memcpy(eBone, curBone, sizeof(EditBone)); curBone->temp = eBone; eBone->temp = curBone; @@ -2204,7 +2208,7 @@ void adduplicate_armature(void) /* Run though the list and fix the pointers */ for (curBone=G.edbo.first; curBone && curBone!=firstDup; curBone=curBone->next) { - if (arm->layer & curBone->layer) { + if (EBONE_VISIBLE(arm, curBone)) { if (curBone->flag & BONE_SELECTED) { eBone=(EditBone*) curBone->temp; @@ -2236,7 +2240,7 @@ void adduplicate_armature(void) /* Deselect the old bones and select the new ones */ for (curBone=G.edbo.first; curBone && curBone!=firstDup; curBone=curBone->next) { - if (arm->layer & curBone->layer) + if (EBONE_VISIBLE(arm, curBone)) curBone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL | BONE_ACTIVE); } @@ -2373,7 +2377,7 @@ void fill_bones_armature(void) /* loop over all bones, and only consider if visible */ for (ebo= G.edbo.first; ebo; ebo= ebo->next) { - if ((arm->layer & ebo->layer) && !(ebo->flag & BONE_HIDDEN_A)) { + if (EBONE_VISIBLE(arm, ebo)) { if (!(ebo->flag & BONE_CONNECTED) && (ebo->flag & BONE_ROOTSEL)) fill_add_joint(ebo, 0, &points); if (ebo->flag & BONE_TIPSEL) @@ -2608,7 +2612,7 @@ void merge_armature(void) /* only consider bones that are visible and selected */ for (ebo=chain->data; ebo; child=ebo, ebo=ebo->parent) { /* check if visible + selected */ - if ( (arm->layer & ebo->layer) && !(ebo->flag & BONE_HIDDEN_A) && + if ( EBONE_VISIBLE(arm, ebo) && ((ebo->flag & BONE_CONNECTED) || (ebo->parent==NULL)) && (ebo->flag & (BONE_SELECTED|BONE_ACTIVE)) ) { @@ -2659,7 +2663,7 @@ void hide_selected_armature_bones(void) EditBone *ebone; for (ebone = G.edbo.first; ebone; ebone=ebone->next) { - if (arm->layer & ebone->layer) { + if (EBONE_VISIBLE(arm, ebone)) { if (ebone->flag & (BONE_SELECTED)) { ebone->flag &= ~(BONE_TIPSEL|BONE_SELECTED|BONE_ROOTSEL|BONE_ACTIVE); ebone->flag |= BONE_HIDDEN_A; @@ -2678,7 +2682,7 @@ void hide_unselected_armature_bones(void) for (ebone = G.edbo.first; ebone; ebone=ebone->next) { bArmature *arm= G.obedit->data; - if (arm->layer & ebone->layer) { + if (EBONE_VISIBLE(arm, ebone)) { if (ebone->flag & (BONE_TIPSEL|BONE_SELECTED|BONE_ROOTSEL)); else { ebone->flag &= ~BONE_ACTIVE; @@ -2711,32 +2715,6 @@ void show_all_armature_bones(void) BIF_undo_push("Reveal Bones"); } -/* Sets editmode transform locks for bones (adds if lock==1, clears otherwise) */ -void set_locks_armature_bones(short lock) -{ - bArmature *arm= G.obedit->data; - EditBone *ebone; - - for (ebone = G.edbo.first; ebone; ebone=ebone->next) { - if (arm->layer & ebone->layer) { - if (ebone->flag & BONE_SELECTED) { - if (lock) - ebone->flag |= BONE_EDITMODE_LOCKED; - else - ebone->flag &= ~BONE_EDITMODE_LOCKED; - } - } - } - countall(); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - - if (lock) - BIF_undo_push("Lock Bones"); - else - BIF_undo_push("Unlock Bones"); -} - /* check for null, before calling! */ static void bone_connect_to_existing_parent(EditBone *bone) { @@ -2803,7 +2781,7 @@ void make_bone_parent(void) /* find active bone to parent to */ for (actbone = G.edbo.first; actbone; actbone=actbone->next) { - if (arm->layer & actbone->layer) { + if (EBONE_VISIBLE(arm, actbone)) { if (actbone->flag & BONE_ACTIVE) break; } @@ -2815,7 +2793,7 @@ void make_bone_parent(void) /* find selected bones */ for (ebone = G.edbo.first; ebone; ebone=ebone->next) { - if (arm->layer & ebone->layer) { + if (EBONE_VISIBLE(arm, ebone)) { if ((ebone->flag & BONE_SELECTED) && (ebone != actbone)) { foundselbone++; if (ebone->parent != actbone) allchildbones= 1; @@ -2851,7 +2829,7 @@ void make_bone_parent(void) else { /* loop through all editbones, parenting all selected bones to the active bone */ for (selbone = G.edbo.first; selbone; selbone=selbone->next) { - if (arm->layer & selbone->layer) { + if (EBONE_VISIBLE(arm, selbone)) { if ((selbone->flag & BONE_SELECTED) && (selbone!=actbone)) { /* parent selbone to actbone */ bone_connect_to_new_parent(selbone, actbone, val); @@ -2909,7 +2887,7 @@ void clear_bone_parent(void) if (val<1) return; for (ebone = G.edbo.first; ebone; ebone=ebone->next) { - if (arm->layer & ebone->layer) { + if (EBONE_VISIBLE(arm, ebone)) { if (ebone->flag & BONE_SELECTED) { if (arm->flag & ARM_MIRROR_EDIT) flipbone = armature_bone_get_mirrored(ebone); @@ -2959,7 +2937,7 @@ void unique_editbone_name (ListBase *ebones, char *name) } for (number = 1; number <=999; number++) { - sprintf (tempname, "%s.%03d", name, number); + sprintf(tempname, "%s.%03d", name, number); if (!editbone_name_exists(ebones, tempname)) { BLI_strncpy(name, tempname, 32); return; @@ -2980,7 +2958,7 @@ void extrude_armature(int forked) /* since we allow root extrude too, we have to make sure selection is OK */ for (ebone = G.edbo.first; ebone; ebone=ebone->next) { - if (arm->layer & ebone->layer) { + if (EBONE_VISIBLE(arm, ebone)) { if (ebone->flag & BONE_ROOTSEL) { if (ebone->parent && (ebone->flag & BONE_CONNECTED)) { if (ebone->parent->flag & BONE_TIPSEL) @@ -2992,7 +2970,7 @@ void extrude_armature(int forked) /* Duplicate the necessary bones */ for (ebone = G.edbo.first; ((ebone) && (ebone!=first)); ebone=ebone->next) { - if (arm->layer & ebone->layer) { + if (EBONE_VISIBLE(arm, ebone)) { /* we extrude per definition the tip */ do_extrude= 0; if (ebone->flag & (BONE_TIPSEL|BONE_SELECTED)) @@ -3006,7 +2984,7 @@ void extrude_armature(int forked) if (do_extrude) { /* we re-use code for mirror editing... */ flipbone= NULL; - if(arm->flag & ARM_MIRROR_EDIT) { + if (arm->flag & ARM_MIRROR_EDIT) { flipbone= armature_bone_get_mirrored(ebone); if (flipbone) { forked= 0; // we extrude 2 different bones @@ -3036,7 +3014,7 @@ void extrude_armature(int forked) newbone->parent = ebone; newbone->flag = ebone->flag & BONE_TIPSEL; // copies it, in case mirrored bone - + if (newbone->parent) newbone->flag |= BONE_CONNECTED; } else { @@ -3046,7 +3024,7 @@ void extrude_armature(int forked) newbone->flag= BONE_TIPSEL; - if (newbone->parent && ebone->flag & BONE_CONNECTED) { + if (newbone->parent && (ebone->flag & BONE_CONNECTED)) { newbone->flag |= BONE_CONNECTED; } } @@ -3065,8 +3043,8 @@ void extrude_armature(int forked) BLI_strncpy (newbone->name, ebone->name, 32); if (flipbone && forked) { // only set if mirror edit - if(strlen(newbone->name)<30) { - if(a==0) strcat(newbone->name, "_L"); + if (strlen(newbone->name)<30) { + if (a==0) strcat(newbone->name, "_L"); else strcat(newbone->name, "_R"); } } @@ -3111,7 +3089,7 @@ void subdivide_armature(int numcuts) if (numcuts < 1) return; for (mbone = G.edbo.last; mbone; mbone= mbone->prev) { - if (arm->layer & mbone->layer) { + if (EBONE_VISIBLE(arm, mbone)) { if (mbone->flag & BONE_SELECTED) { for (i=numcuts+1; i>1; i--) { /* compute cut ratio first */ @@ -3176,6 +3154,59 @@ void subdivide_armature(int numcuts) else BIF_undo_push("Subdivide multi"); } +/* switch direction of bone chains */ +void switch_direction_armature (void) +{ + bArmature *arm= (G.obedit) ? G.obedit->data : NULL; + ListBase chains = {NULL, NULL}; + LinkData *chain; + + /* error checking paranoia */ + if (arm == NULL) + return; + + /* get chains of bones (ends on chains) */ + chains_find_tips(&chains); + if (chains.first == NULL) return; + + /* loop over chains, only considering selected and visible bones */ + for (chain= chains.first; chain; chain= chain->next) { + EditBone *ebo, *child=NULL, *parent=NULL; + + /* loop over bones in chain */ + for (ebo= chain->data; ebo; child= ebo, ebo=parent) { + parent= ebo->parent; + + /* only if selected and editable */ + if (EBONE_VISIBLE(arm, ebo) && EBONE_EDITABLE(ebo)) { + /* swap head and tail coordinates */ + SWAP(float, ebo->head[0], ebo->tail[0]); + SWAP(float, ebo->head[1], ebo->tail[1]); + SWAP(float, ebo->head[2], ebo->tail[2]); + + /* do parent swapping: + * - use 'child' as new parent + * - connected flag is only set if points are coincidental + */ + ebo->parent= child; + if ((child) && VecEqual(ebo->head, child->tail)) + ebo->flag |= BONE_CONNECTED; + else + ebo->flag &= ~BONE_CONNECTED; + + /* FIXME: other things that need fixing? + * i.e. roll? + */ + } + } + } + + /* free chains */ + BLI_freelistN(&chains); + + BIF_undo_push("Switch Direction"); +} + /* ***************** Pose tools ********************* */ void clear_armature(Object *ob, char mode) diff --git a/source/blender/src/editmesh_mods.c b/source/blender/src/editmesh_mods.c index c7a75b32df1..6dfbd67720b 100644 --- a/source/blender/src/editmesh_mods.c +++ b/source/blender/src/editmesh_mods.c @@ -1432,348 +1432,78 @@ int mesh_layers_menu(CustomData *data, int type) { return ret; } -/* ctrl+c in mesh editmode */ -void mesh_copy_menu(void) +void EM_mesh_copy_edge(short type) { EditMesh *em = G.editMesh; EditSelection *ese; - short ret, change=0; + short change=0; + + EditEdge *eed, *eed_act; + float vec[3], vec_mid[3], eed_len, eed_len_act; if (!em) return; ese = em->selected.last; + if (!ese) return; - /* Faces can have a NULL ese, so dont return on a NULL ese here */ + eed_act = (EditEdge*)ese->data; - if(ese && ese->type == EDITVERT) { - - if (!ese) return; - /*EditVert *ev, *ev_act = (EditVert*)ese->data; - ret= pupmenu("");*/ - } else if(ese && ese->type == EDITEDGE) { - EditEdge *eed, *eed_act; - float vec[3], vec_mid[3], eed_len, eed_len_act; - - if (!ese) return; - - eed_act = (EditEdge*)ese->data; - - ret= pupmenu("Copy Active Edge to Selected%t|Crease%x1|Bevel Weight%x2|Length%x3"); - if (ret<1) return; - + switch (type) { + case 1: /* copy crease */ + for(eed=em->edges.first; eed; eed=eed->next) { + if (eed->f & SELECT && eed != eed_act && eed->crease != eed_act->crease) { + eed->crease = eed_act->crease; + change = 1; + } + } + break; + case 2: /* copy bevel weight */ + for(eed=em->edges.first; eed; eed=eed->next) { + if (eed->f & SELECT && eed != eed_act && eed->bweight != eed_act->bweight) { + eed->bweight = eed_act->bweight; + change = 1; + } + } + break; + + case 3: /* copy length */ eed_len_act = VecLenf(eed_act->v1->co, eed_act->v2->co); - - switch (ret) { - case 1: /* copy crease */ - for(eed=em->edges.first; eed; eed=eed->next) { - if (eed->f & SELECT && eed != eed_act && eed->crease != eed_act->crease) { - eed->crease = eed_act->crease; - change = 1; + for(eed=em->edges.first; eed; eed=eed->next) { + if (eed->f & SELECT && eed != eed_act) { + + eed_len = VecLenf(eed->v1->co, eed->v2->co); + + if (eed_len == eed_len_act) continue; + /* if this edge is zero length we cont do anything with it*/ + if (eed_len == 0.0f) continue; + if (eed_len_act == 0.0f) { + VecAddf(vec_mid, eed->v1->co, eed->v2->co); + VecMulf(vec_mid, 0.5); + VECCOPY(eed->v1->co, vec_mid); + VECCOPY(eed->v2->co, vec_mid); + } else { + /* copy the edge length */ + VecAddf(vec_mid, eed->v1->co, eed->v2->co); + VecMulf(vec_mid, 0.5); + + /* SCALE 1 */ + VecSubf(vec, eed->v1->co, vec_mid); + VecMulf(vec, eed_len_act/eed_len); + VecAddf(eed->v1->co, vec, vec_mid); + + /* SCALE 2 */ + VecSubf(vec, eed->v2->co, vec_mid); + VecMulf(vec, eed_len_act/eed_len); + VecAddf(eed->v2->co, vec, vec_mid); } + change = 1; } - break; - case 2: /* copy bevel weight */ - for(eed=em->edges.first; eed; eed=eed->next) { - if (eed->f & SELECT && eed != eed_act && eed->bweight != eed_act->bweight) { - eed->bweight = eed_act->bweight; - change = 1; - } - } - break; - - case 3: /* copy length */ - - for(eed=em->edges.first; eed; eed=eed->next) { - if (eed->f & SELECT && eed != eed_act) { - - eed_len = VecLenf(eed->v1->co, eed->v2->co); - - if (eed_len == eed_len_act) continue; - /* if this edge is zero length we cont do anything with it*/ - if (eed_len == 0.0f) continue; - if (eed_len_act == 0.0f) { - VecAddf(vec_mid, eed->v1->co, eed->v2->co); - VecMulf(vec_mid, 0.5); - VECCOPY(eed->v1->co, vec_mid); - VECCOPY(eed->v2->co, vec_mid); - } else { - /* copy the edge length */ - VecAddf(vec_mid, eed->v1->co, eed->v2->co); - VecMulf(vec_mid, 0.5); - - /* SCALE 1 */ - VecSubf(vec, eed->v1->co, vec_mid); - VecMulf(vec, eed_len_act/eed_len); - VecAddf(eed->v1->co, vec, vec_mid); - - /* SCALE 2 */ - VecSubf(vec, eed->v2->co, vec_mid); - VecMulf(vec, eed_len_act/eed_len); - VecAddf(eed->v2->co, vec, vec_mid); - } - change = 1; - } - } - - if (change) - recalc_editnormals(); - - - break; } - - } else if(ese==NULL || ese->type == EDITFACE) { - EditFace *efa, *efa_act; - MTFace *tf, *tf_act = NULL; - MCol *mcol, *mcol_act = NULL; - - efa_act = EM_get_actFace(0); - - if (efa_act) { - ret= pupmenu( - "Copy Face Selected%t|" - "Active Material%x1|Active Image%x2|Active UV Coords%x3|" - "Active Mode%x4|Active Transp%x5|Active Vertex Colors%x6|%l|" - - "TexFace UVs from layer%x7|" - "TexFace Images from layer%x8|" - "TexFace All from layer%x9|" - "Vertex Colors from layer%x10"); - if (ret<1) return; - tf_act = CustomData_em_get(&em->fdata, efa_act->data, CD_MTFACE); - mcol_act = CustomData_em_get(&em->fdata, efa_act->data, CD_MCOL); - } else { - ret= pupmenu( - "Copy Face Selected%t|" - - /* Make sure these are always the same as above */ - "TexFace UVs from layer%x7|" - "TexFace Images from layer%x8|" - "TexFace All from layer%x9|" - "Vertex Colors from layer%x10"); - if (ret<1) return; - } - - switch (ret) { - case 1: /* copy material */ - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT && efa->mat_nr != efa_act->mat_nr) { - efa->mat_nr = efa_act->mat_nr; - change = 1; - } - } - break; - case 2: /* copy image */ - if (!tf_act) { - error("mesh has no uv/image layers"); - return; - } - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT && efa != efa_act) { - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (tf_act->tpage) { - tf->tpage = tf_act->tpage; - tf->mode |= TF_TEX; - } else { - tf->tpage = NULL; - tf->mode &= ~TF_TEX; - } - tf->tile= tf_act->tile; - change = 1; - } - } - break; - - case 3: /* copy UV's */ - if (!tf_act) { - error("mesh has no uv/image layers"); - return; - } - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT && efa != efa_act) { - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - memcpy(tf->uv, tf_act->uv, sizeof(tf->uv)); - change = 1; - } - } - break; - case 4: /* mode's */ - if (!tf_act) { - error("mesh has no uv/image layers"); - return; - } - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT && efa != efa_act) { - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - tf->mode= tf_act->mode; - change = 1; - } - } - break; - case 5: /* copy transp's */ - if (!tf_act) { - error("mesh has no uv/image layers"); - return; - } - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT && efa != efa_act) { - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - tf->transp= tf_act->transp; - change = 1; - } - } - break; - - case 6: /* copy vcols's */ - if (!mcol_act) { - error("mesh has no color layers"); - return; - } else { - /* guess the 4th color if needs be */ - float val =- 1; - - if (!efa_act->v4) { - /* guess the othe vale, we may need to use it - * - * Modifying the 4th value of the mcol is ok here since its not seen - * on a triangle - * */ - val = ((float)(mcol_act->r + (mcol_act+1)->r + (mcol_act+2)->r)) / 3; CLAMP(val, 0, 255); - (mcol_act+3)->r = (char)val; - - val = ((float)(mcol_act->g + (mcol_act+1)->g + (mcol_act+2)->g)) / 3; CLAMP(val, 0, 255); - (mcol_act+3)->g = (char)val; - - val = ((float)(mcol_act->b + (mcol_act+1)->b + (mcol_act+2)->b)) / 3; CLAMP(val, 0, 255); - (mcol_act+3)->b = (char)val; - } - - - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT && efa != efa_act) { - /* TODO - make copy from tri to quad guess the 4th vert */ - mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL); - memcpy(mcol, mcol_act, sizeof(MCol)*4); - change = 1; - } - } - } - - break; - - /* Copy from layer - Warning! tf_act and mcol_act will be NULL here */ - case 7: - case 8: - case 9: - if (CustomData_number_of_layers(&em->fdata, CD_MTFACE)<2) { - error("mesh does not have multiple uv/image layers"); - return; - } else { - int layer_orig_idx, layer_idx; - - layer_idx = mesh_layers_menu(&em->fdata, CD_MTFACE); - if (layer_idx<0) return; - - /* warning, have not updated mesh pointers however this is not needed since we swicth back */ - layer_orig_idx = CustomData_get_active_layer(&em->fdata, CD_MTFACE); - if (layer_idx==layer_orig_idx) - return; - - /* get the tfaces */ - CustomData_set_layer_active(&em->fdata, CD_MTFACE, (int)layer_idx); - /* store the tfaces in our temp */ - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT) { - efa->tmp.p = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - } - } - CustomData_set_layer_active(&em->fdata, CD_MTFACE, layer_orig_idx); - } - break; - - case 10: /* select vcol layers - make sure this stays in sync with above code */ - if (CustomData_number_of_layers(&em->fdata, CD_MCOL)<2) { - error("mesh does not have multiple color layers"); - return; - } else { - int layer_orig_idx, layer_idx; - - layer_idx = mesh_layers_menu(&em->fdata, CD_MCOL); - if (layer_idx<0) return; - - /* warning, have not updated mesh pointers however this is not needed since we swicth back */ - layer_orig_idx = CustomData_get_active_layer(&em->fdata, CD_MCOL); - if (layer_idx==layer_orig_idx) - return; - - /* get the tfaces */ - CustomData_set_layer_active(&em->fdata, CD_MCOL, (int)layer_idx); - /* store the tfaces in our temp */ - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT) { - efa->tmp.p = CustomData_em_get(&em->fdata, efa->data, CD_MCOL); - } - } - CustomData_set_layer_active(&em->fdata, CD_MCOL, layer_orig_idx); - - } - break; - } - - /* layer copy only - sanity checks done above */ - switch (ret) { - case 7: /* copy UV's only */ - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT) { - tf_act = (MTFace *)efa->tmp.p; /* not active but easier to use this way */ - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - memcpy(tf->uv, tf_act->uv, sizeof(tf->uv)); - change = 1; - } - } - break; - case 8: /* copy image settings only */ - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT) { - tf_act = (MTFace *)efa->tmp.p; /* not active but easier to use this way */ - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (tf_act->tpage) { - tf->tpage = tf_act->tpage; - tf->mode |= TF_TEX; - } else { - tf->tpage = NULL; - tf->mode &= ~TF_TEX; - } - tf->tile= tf_act->tile; - change = 1; - } - } - break; - case 9: /* copy all tface info */ - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT) { - tf_act = (MTFace *)efa->tmp.p; /* not active but easier to use this way */ - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - memcpy(tf->uv, ((MTFace *)efa->tmp.p)->uv, sizeof(tf->uv)); - tf->tpage = tf_act->tpage; - tf->mode = tf_act->mode; - tf->transp = tf_act->transp; - change = 1; - } - } - break; - case 10: - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT) { - mcol_act = (MCol *)efa->tmp.p; - mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL); - memcpy(mcol, mcol_act, sizeof(MCol)*4); - change = 1; - } - } - break; - } - + + if (change) + recalc_editnormals(); + + break; } if (change) { @@ -1781,12 +1511,319 @@ void mesh_copy_menu(void) allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWBUTSEDIT, 0); - if (ese==NULL || ese->type == EDITFACE) BIF_undo_push("Copy Face Attribute"); - else if ( ese->type == EDITEDGE) BIF_undo_push("Copy Edge Attribute"); - else if ( ese->type == EDITVERT) BIF_undo_push("Copy Vert Attribute"); - + BIF_undo_push("Copy Edge Attribute"); + } +} + +void EM_mesh_copy_face(short type) +{ + EditMesh *em = G.editMesh; + short change=0; + + EditFace *efa, *efa_act; + MTFace *tf, *tf_act = NULL; + MCol *mcol, *mcol_act = NULL; + if (!em) return; + efa_act = EM_get_actFace(0); + + if (!efa_act) return; + + tf_act = CustomData_em_get(&em->fdata, efa_act->data, CD_MTFACE); + mcol_act = CustomData_em_get(&em->fdata, efa_act->data, CD_MCOL); + + switch (type) { + case 1: /* copy material */ + for(efa=em->faces.first; efa; efa=efa->next) { + if (efa->f & SELECT && efa->mat_nr != efa_act->mat_nr) { + efa->mat_nr = efa_act->mat_nr; + change = 1; + } + } + break; + case 2: /* copy image */ + if (!tf_act) { + error("mesh has no uv/image layers"); + return; + } + for(efa=em->faces.first; efa; efa=efa->next) { + if (efa->f & SELECT && efa != efa_act) { + tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); + if (tf_act->tpage) { + tf->tpage = tf_act->tpage; + tf->mode |= TF_TEX; + } else { + tf->tpage = NULL; + tf->mode &= ~TF_TEX; + } + tf->tile= tf_act->tile; + change = 1; + } + } + break; + + case 3: /* copy UV's */ + if (!tf_act) { + error("mesh has no uv/image layers"); + return; + } + for(efa=em->faces.first; efa; efa=efa->next) { + if (efa->f & SELECT && efa != efa_act) { + tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); + memcpy(tf->uv, tf_act->uv, sizeof(tf->uv)); + change = 1; + } + } + break; + case 4: /* mode's */ + if (!tf_act) { + error("mesh has no uv/image layers"); + return; + } + for(efa=em->faces.first; efa; efa=efa->next) { + if (efa->f & SELECT && efa != efa_act) { + tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); + tf->mode= tf_act->mode; + change = 1; + } + } + break; + case 5: /* copy transp's */ + if (!tf_act) { + error("mesh has no uv/image layers"); + return; + } + for(efa=em->faces.first; efa; efa=efa->next) { + if (efa->f & SELECT && efa != efa_act) { + tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); + tf->transp= tf_act->transp; + change = 1; + } + } + break; + + case 6: /* copy vcols's */ + if (!mcol_act) { + error("mesh has no color layers"); + return; + } else { + /* guess the 4th color if needs be */ + float val =- 1; + + if (!efa_act->v4) { + /* guess the othe vale, we may need to use it + * + * Modifying the 4th value of the mcol is ok here since its not seen + * on a triangle + * */ + val = ((float)(mcol_act->r + (mcol_act+1)->r + (mcol_act+2)->r)) / 3; CLAMP(val, 0, 255); + (mcol_act+3)->r = (char)val; + + val = ((float)(mcol_act->g + (mcol_act+1)->g + (mcol_act+2)->g)) / 3; CLAMP(val, 0, 255); + (mcol_act+3)->g = (char)val; + + val = ((float)(mcol_act->b + (mcol_act+1)->b + (mcol_act+2)->b)) / 3; CLAMP(val, 0, 255); + (mcol_act+3)->b = (char)val; + } + + + for(efa=em->faces.first; efa; efa=efa->next) { + if (efa->f & SELECT && efa != efa_act) { + /* TODO - make copy from tri to quad guess the 4th vert */ + mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL); + memcpy(mcol, mcol_act, sizeof(MCol)*4); + change = 1; + } + } + } + break; } + if (change) { + DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); + allqueue(REDRAWVIEW3D, 0); + allqueue(REDRAWBUTSEDIT, 0); + if (type==3) { + allqueue(REDRAWIMAGE, 0); + } + + BIF_undo_push("Copy Face Attribute"); + } +} + + +void EM_mesh_copy_face_layer(short type) +{ + EditMesh *em = G.editMesh; + short change=0; + + EditFace *efa; + MTFace *tf, *tf_from; + MCol *mcol, *mcol_from; + + if (!em) return; + + switch(type) { + case 7: + case 8: + case 9: + if (CustomData_number_of_layers(&em->fdata, CD_MTFACE)<2) { + error("mesh does not have multiple uv/image layers"); + return; + } else { + int layer_orig_idx, layer_idx; + + layer_idx = mesh_layers_menu(&em->fdata, CD_MTFACE); + if (layer_idx<0) return; + + /* warning, have not updated mesh pointers however this is not needed since we swicth back */ + layer_orig_idx = CustomData_get_active_layer(&em->fdata, CD_MTFACE); + if (layer_idx==layer_orig_idx) + return; + + /* get the tfaces */ + CustomData_set_layer_active(&em->fdata, CD_MTFACE, (int)layer_idx); + /* store the tfaces in our temp */ + for(efa=em->faces.first; efa; efa=efa->next) { + if (efa->f & SELECT) { + efa->tmp.p = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); + } + } + CustomData_set_layer_active(&em->fdata, CD_MTFACE, layer_orig_idx); + } + break; + + case 10: /* select vcol layers - make sure this stays in sync with above code */ + if (CustomData_number_of_layers(&em->fdata, CD_MCOL)<2) { + error("mesh does not have multiple color layers"); + return; + } else { + int layer_orig_idx, layer_idx; + + layer_idx = mesh_layers_menu(&em->fdata, CD_MCOL); + if (layer_idx<0) return; + + /* warning, have not updated mesh pointers however this is not needed since we swicth back */ + layer_orig_idx = CustomData_get_active_layer(&em->fdata, CD_MCOL); + if (layer_idx==layer_orig_idx) + return; + + /* get the tfaces */ + CustomData_set_layer_active(&em->fdata, CD_MCOL, (int)layer_idx); + /* store the tfaces in our temp */ + for(efa=em->faces.first; efa; efa=efa->next) { + if (efa->f & SELECT) { + efa->tmp.p = CustomData_em_get(&em->fdata, efa->data, CD_MCOL); + } + } + CustomData_set_layer_active(&em->fdata, CD_MCOL, layer_orig_idx); + + } + break; + } + + /* layer copy only - sanity checks done above */ + switch (type) { + case 7: /* copy UV's only */ + for(efa=em->faces.first; efa; efa=efa->next) { + if (efa->f & SELECT) { + tf_from = (MTFace *)efa->tmp.p; /* not active but easier to use this way */ + tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); + memcpy(tf->uv, tf_from->uv, sizeof(tf->uv)); + change = 1; + } + } + break; + case 8: /* copy image settings only */ + for(efa=em->faces.first; efa; efa=efa->next) { + if (efa->f & SELECT) { + tf_from = (MTFace *)efa->tmp.p; /* not active but easier to use this way */ + tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); + if (tf_from->tpage) { + tf->tpage = tf_from->tpage; + tf->mode |= TF_TEX; + } else { + tf->tpage = NULL; + tf->mode &= ~TF_TEX; + } + tf->tile= tf_from->tile; + change = 1; + } + } + break; + case 9: /* copy all tface info */ + for(efa=em->faces.first; efa; efa=efa->next) { + if (efa->f & SELECT) { + tf_from = (MTFace *)efa->tmp.p; /* not active but easier to use this way */ + tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); + memcpy(tf->uv, ((MTFace *)efa->tmp.p)->uv, sizeof(tf->uv)); + tf->tpage = tf_from->tpage; + tf->mode = tf_from->mode; + tf->transp = tf_from->transp; + change = 1; + } + } + break; + case 10: + for(efa=em->faces.first; efa; efa=efa->next) { + if (efa->f & SELECT) { + mcol_from = (MCol *)efa->tmp.p; + mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL); + memcpy(mcol, mcol_from, sizeof(MCol)*4); + change = 1; + } + } + break; + } + + if (change) { + DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); + allqueue(REDRAWVIEW3D, 0); + allqueue(REDRAWBUTSEDIT, 0); + + BIF_undo_push("Copy Face Layer"); + } +} + + +/* ctrl+c in mesh editmode */ +void mesh_copy_menu(void) +{ + EditMesh *em = G.editMesh; + EditSelection *ese; + int ret; + if (!em) return; + + ese = em->selected.last; + + /* Faces can have a NULL ese, so dont return on a NULL ese here */ + + if(ese && ese->type == EDITVERT) { + /* EditVert *ev, *ev_act = (EditVert*)ese->data; + ret= pupmenu(""); */ + } else if(ese && ese->type == EDITEDGE) { + ret= pupmenu("Copy Active Edge to Selected%t|Crease%x1|Bevel Weight%x2|Length%x3"); + if (ret<1) return; + + EM_mesh_copy_edge(ret); + + } else if(ese==NULL || ese->type == EDITFACE) { + ret= pupmenu( + "Copy Face Selected%t|" + "Active Material%x1|Active Image%x2|Active UV Coords%x3|" + "Active Mode%x4|Active Transp%x5|Active Vertex Colors%x6|%l|" + + "TexFace UVs from layer%x7|" + "TexFace Images from layer%x8|" + "TexFace All from layer%x9|" + "Vertex Colors from layer%x10"); + if (ret<1) return; + + if (ret<=6) { + EM_mesh_copy_face(ret); + } else { + EM_mesh_copy_face_layer(ret); + } + } } diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index cbf7691754d..fee967bcd9a 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -2760,7 +2760,7 @@ void special_editmenu(void) DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); } else if(G.obedit->type==OB_ARMATURE) { - nr= pupmenu("Specials%t|Subdivide %x1|Subdivide Multi%x2|Flip Left-Right Names%x3|%l|AutoName Left-Right%x4|AutoName Front-Back%x5|AutoName Top-Bottom%x6|%l|Lock%x7|Unlock%x8"); + nr= pupmenu("Specials%t|Subdivide %x1|Subdivide Multi%x2|Switch Direction%x7|Flip Left-Right Names%x3|%l|AutoName Left-Right%x4|AutoName Front-Back%x5|AutoName Top-Bottom%x6"); if(nr==1) subdivide_armature(1); if(nr==2) { @@ -2773,10 +2773,8 @@ void special_editmenu(void) else if(ELEM3(nr, 4, 5, 6)) { armature_autoside_names(nr-4); } - else if(nr==7) - set_locks_armature_bones(1); - else if(nr==8) - set_locks_armature_bones(0); + else if(nr == 7) + switch_direction_armature(); } else if(G.obedit->type==OB_LATTICE) { static float weight= 1.0f; diff --git a/source/blender/src/poselib.c b/source/blender/src/poselib.c index fb2bfe5b605..6aeef7c75c2 100644 --- a/source/blender/src/poselib.c +++ b/source/blender/src/poselib.c @@ -312,7 +312,7 @@ void poselib_add_current_pose (Object *ob, int val) /* mode - add new or replace existing */ if (val == 0) { if ((ob->poselib) && (ob->poselib->markers.first)) { - val= pupmenu("PoseLib Add Current Pose%t|Add New%x1|Replace Existing%x2"); + val= pupmenu("PoseLib Add Current Pose%t|Add New%x1|Add New (Current Frame)%x3|Replace Existing%x2"); if (val <= 0) return; } else @@ -347,7 +347,10 @@ void poselib_add_current_pose (Object *ob, int val) act= poselib_validate(ob); /* get frame */ - frame= poselib_get_free_index(act); + if (val == 3) + frame= CFRA; + else /* if (val == 1) */ + frame= poselib_get_free_index(act); /* add pose to poselib - replaces any existing pose there */ for (marker= act->markers.first; marker; marker= marker->next) { diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c index 8f83434e528..9f2f58d0cdb 100644 --- a/source/blender/src/transform_conversions.c +++ b/source/blender/src/transform_conversions.c @@ -913,8 +913,8 @@ static void createTransPose(TransInfo *t, Object *ob) if (arm==NULL || ob->pose==NULL) return; if (arm->flag & ARM_RESTPOS) { - if(t->mode!=TFM_BONESIZE) { - notice ("Pose edit not possible while Rest Position is enabled"); + if(ELEM(t->mode, TFM_DUMMY, TFM_BONESIZE)==0) { + notice("Pose edit not possible while Rest Position is enabled"); return; } } diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index f44318120e8..a6337403cd1 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1939,7 +1939,17 @@ void BL_ConvertBlenderObjects(struct Main* maggie, float* fl = (float*) blenderobject->parentinv; MT_Transform parinvtrans(fl); parentinversenode->SetLocalPosition(parinvtrans.getOrigin()); - parentinversenode->SetLocalOrientation(parinvtrans.getBasis()); + // problem here: the parent inverse transform combines scaling and rotation + // in the basis but the scenegraph needs separate rotation and scaling. + // This is not important for OpenGL (it uses 4x4 matrix) but it is important + // for the physic engine that needs a separate scaling + //parentinversenode->SetLocalOrientation(parinvtrans.getBasis()); + + // Extract the rotation and the scaling from the basis + MT_Matrix3x3 inverseOrientation(parinvtrans.getRotation()); + parentinversenode->SetLocalOrientation(inverseOrientation); + MT_Matrix3x3 scale(inverseOrientation.transposed()*parinvtrans.getBasis()); + parentinversenode->SetLocalScale(MT_Vector3(scale[0][0], scale[1][1], scale[2][2])); parentinversenode->AddChild(gameobj->GetSGNode()); } diff --git a/source/gameengine/Ketsji/CMakeLists.txt b/source/gameengine/Ketsji/CMakeLists.txt index 3b907d8d530..be009d94701 100644 --- a/source/gameengine/Ketsji/CMakeLists.txt +++ b/source/gameengine/Ketsji/CMakeLists.txt @@ -25,6 +25,17 @@ # ***** END GPL LICENSE BLOCK ***** FILE(GLOB SRC *.cpp) +SET(SRC + ${SRC} + ../../../source/blender/python/api2_2x/Mathutils.c + ../../../source/blender/python/api2_2x/constant.c + ../../../source/blender/python/api2_2x/euler.c + ../../../source/blender/python/api2_2x/gen_utils.c + ../../../source/blender/python/api2_2x/matrix.c + ../../../source/blender/python/api2_2x/point.c + ../../../source/blender/python/api2_2x/quat.c + ../../../source/blender/python/api2_2x/vector.c +) SET(INC . @@ -39,7 +50,8 @@ SET(INC ../../../intern/moto/include ../../../source/gameengine/Ketsji ../../../source/blender/blenlib - ../../../source/blender/blenkernel + ../../../source/blender/blenkernel + ../../../source/blender/python/api2_2x ../../../source/blender ../../../source/blender/include ../../../source/blender/makesdna diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 661bf17ef23..989cdabd491 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1491,7 +1491,7 @@ PyObject* KX_GameObject::PyAlignAxisToVect(PyObject* self, if (PyVecTo(pyvect, vect)) { if (fac<=0.0) Py_RETURN_NONE; // Nothing to do. - if (fac< 1.0) fac= 1.0; + if (fac> 1.0) fac= 1.0; AlignAxisToVect(vect,axis,fac); NodeUpdateGS(0.f,true); diff --git a/source/gameengine/Ketsji/KX_RadarSensor.cpp b/source/gameengine/Ketsji/KX_RadarSensor.cpp index de4979ac4c9..d371626b597 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.cpp +++ b/source/gameengine/Ketsji/KX_RadarSensor.cpp @@ -147,23 +147,23 @@ void KX_RadarSensor::SynchronizeTransform() }; case 3: // -X Axis { - MT_Quaternion rotquatje(MT_Vector3(0,0,1),MT_radians(90)); + MT_Quaternion rotquatje(MT_Vector3(0,0,1),MT_radians(-90)); trans.rotate(rotquatje); - trans.translate(MT_Vector3 (0, m_coneheight/2.0 ,0)); + trans.translate(MT_Vector3 (0, -m_coneheight/2.0 ,0)); break; }; case 4: // -Y Axis { - MT_Quaternion rotquatje(MT_Vector3(1,0,0),MT_radians(-180)); - trans.rotate(rotquatje); - trans.translate(MT_Vector3 (0, m_coneheight/2.0 ,0)); + //MT_Quaternion rotquatje(MT_Vector3(1,0,0),MT_radians(-180)); + //trans.rotate(rotquatje); + trans.translate(MT_Vector3 (0, -m_coneheight/2.0 ,0)); break; }; case 5: // -Z Axis { - MT_Quaternion rotquatje(MT_Vector3(1,0,0),MT_radians(-90)); + MT_Quaternion rotquatje(MT_Vector3(1,0,0),MT_radians(90)); trans.rotate(rotquatje); - trans.translate(MT_Vector3 (0, m_coneheight/2.0 ,0)); + trans.translate(MT_Vector3 (0, -m_coneheight/2.0 ,0)); break; }; default: diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index 08f40424323..dfbcf115fd7 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -956,13 +956,16 @@ void CcdPhysicsEnvironment::CallbackTriggers() if (m_triggerCallbacks[PHY_OBJECT_RESPONSE] || (m_debugDrawer && (m_debugDrawer->getDebugMode() & btIDebugDraw::DBG_DrawContactPoints))) { //walk over all overlapping pairs, and if one of the involved bodies is registered for trigger callback, perform callback - int numManifolds = m_dynamicsWorld->getDispatcher()->getNumManifolds(); + btDispatcher* dispatcher = m_dynamicsWorld->getDispatcher(); + int numManifolds = dispatcher->getNumManifolds(); for (int i=0;igetDispatcher()->getManifoldByIndexInternal(i); + btPersistentManifold* manifold = dispatcher->getManifoldByIndexInternal(i); int numContacts = manifold->getNumContacts(); if (numContacts) { + btRigidBody* rb0 = static_cast(manifold->getBody0()); + btRigidBody* rb1 = static_cast(manifold->getBody1()); if (m_debugDrawer && (m_debugDrawer->getDebugMode() & btIDebugDraw::DBG_DrawContactPoints)) { for (int j=0;jdrawContactPoint(cp.m_positionWorldOnB,cp.m_normalWorldOnB,cp.getDistance(),cp.getLifeTime(),color); } } - btRigidBody* obj0 = static_cast(manifold->getBody0()); - btRigidBody* obj1 = static_cast(manifold->getBody1()); + btRigidBody* obj0 = rb0; + btRigidBody* obj1 = rb1; //m_internalOwner is set in 'addPhysicsController' CcdPhysicsController* ctrl0 = static_cast(obj0->getUserPointer()); @@ -991,6 +994,15 @@ void CcdPhysicsEnvironment::CallbackTriggers() m_triggerCallbacks[PHY_OBJECT_RESPONSE](m_triggerCallbacksUserPtrs[PHY_OBJECT_RESPONSE], ctrl0,ctrl1,0); } + // Bullet does not refresh the manifold contact point for object without contact response + // may need to remove this when a newer Bullet version is integrated + if (!dispatcher->needsResponse(rb0, rb1)) + { + // Refresh algorithm fails sometimes when there is penetration + // (usuall the case with ghost and sensor objects) + // Let's just clear the manifold, in any case, it is recomputed on each frame. + manifold->clearManifold(); //refreshContactPoints(rb0->getCenterOfMassTransform(),rb1->getCenterOfMassTransform()); + } } } diff --git a/tools/btools.py b/tools/btools.py index ad4cf71c3e8..a25120f6c4b 100755 --- a/tools/btools.py +++ b/tools/btools.py @@ -332,6 +332,8 @@ def read_opts(cfg, args): ('BF_X264_CONFIG', 'configuration flags for x264', ''), ('BF_XVIDCORE_CONFIG', 'configuration flags for xvidcore', ''), + + ('BF_CONFIG', 'SCons python config file used to set default options', 'user_config.py'), ) # end of opts.AddOptions() From c6de35e55880774812294880f3d908871ff3b7cf Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Tue, 12 Aug 2008 20:43:10 +0000 Subject: [PATCH 65/76] *Added documentation mainly at shrinkwrap.c *removed commented code about the dropped shrinkwrap options *Removed references to "cut plane", "limitMesh".. its now called "auxiliar target" *Added option to shrinkwrap over an selected axis *"Normal projection" mode is now called "projection" since it can now project over "normal, and any combination X, Y, Z" --- source/blender/blenkernel/BKE_shrinkwrap.h | 75 ++- source/blender/blenkernel/intern/constraint.c | 68 +- source/blender/blenkernel/intern/modifier.c | 34 +- source/blender/blenkernel/intern/shrinkwrap.c | 611 ++++-------------- .../blender/makesdna/DNA_constraint_types.h | 2 +- source/blender/makesdna/DNA_modifier_types.h | 23 +- source/blender/src/buttons_editing.c | 27 +- source/blender/src/buttons_object.c | 12 +- 8 files changed, 255 insertions(+), 597 deletions(-) diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h index dec9635f14c..4fa52f12566 100644 --- a/source/blender/blenkernel/BKE_shrinkwrap.h +++ b/source/blender/blenkernel/BKE_shrinkwrap.h @@ -30,27 +30,36 @@ #define BKE_SHRINKWRAP_H /* mesh util */ -//TODO move this somewhere else +//TODO: move this somewhere else #include "BKE_customdata.h" struct DerivedMesh; struct Object; struct DerivedMesh *object_get_derived_final(struct Object *ob, CustomDataMask dataMask); -/* bitset stuff */ -//TODO: should move this to other generic lib files? -typedef char* BitSet; -#define bitset_memsize(size) (sizeof(char)*((size+7)>>3)) - -#define bitset_new(size,name) ((BitSet)MEM_callocN( bitset_memsize(size) , name)) -#define bitset_free(set) (MEM_freeN((void*)set)) - -#define bitset_get(set,index) ((set)[(index)>>3] & (1 << ((index)&0x7))) -#define bitset_set(set,index) ((set)[(index)>>3] |= (1 << ((index)&0x7))) -#define bitset_unset(set,index) ((set)[(index)>>3] &= ~(1 << ((index)&0x7))) - /* SpaceTransform stuff */ -//TODO: should move to other generic space? +/* + * TODO: move this somewhere else + * + * this structs encapsulates all needed data to convert between 2 coordinate spaces + * (where conversion can be represented by a matrix multiplication) + * + * This is used to reduce the number of arguments to pass to functions that need to perform + * this kind of operation and make it easier for the coder, as he/she doenst needs to recode + * the matrix calculation. + * + * A SpaceTransform is initialized using: + * space_transform_setup( &data, ob1, ob2 ) + * + * After that the following calls can be used: + * space_transform_apply (&data, co); //converts a coordinate in ob1 coords space to the corresponding ob2 coords + * space_transform_invert(&data, co); //converts a coordinate in ob2 coords space to the corresponding ob1 coords + * + * //Same Concept as space_transform_apply and space_transform_invert, but no is normalized after conversion + * space_transform_apply_normal (&data, &no); + * space_transform_invert_normal(&data, &no); + * + */ struct Object; typedef struct SpaceTransform @@ -66,20 +75,29 @@ void space_transform_from_matrixs(SpaceTransform *data, float local[][4], float void space_transform_apply (const SpaceTransform *data, float *co); void space_transform_invert(const SpaceTransform *data, float *co); -void space_transform_apply_normal (const SpaceTransform *data, float *co); -void space_transform_invert_normal(const SpaceTransform *data, float *co); +void space_transform_apply_normal (const SpaceTransform *data, float *no); +void space_transform_invert_normal(const SpaceTransform *data, float *no); /* Shrinkwrap stuff */ #include "BKE_bvhutils.h" +/* + * Shrinkwrap is composed by a set of functions and options that define the type of shrink. + * + * 3 modes are available: + * - Nearest vertex + * - Nearest surface + * - Normal projection + * + * ShrinkwrapCalcData encapsulates all needed data for shrinkwrap functions. + * (So that you dont have to pass an enormous ammount of arguments to functions) + */ + struct Object; struct DerivedMesh; struct ShrinkwrapModifierData; struct BVHTree; -/* maybe move to bvh util */ -int normal_projection_project_vertex(char options, const float *vert, const float *dir, const SpaceTransform *transf, BVHTree *tree, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata); - typedef struct ShrinkwrapCalcData { @@ -95,7 +113,6 @@ typedef struct ShrinkwrapCalcData SpaceTransform local2target; //transform to move bettwem local and target space float keptDist; //Distance to kept from target (units are in local space) - BitSet moved; //BitSet indicating if vertex has moved } ShrinkwrapCalcData; @@ -103,15 +120,27 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *data); void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *data); void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *data); -struct DerivedMesh *shrinkwrapModifier_do(struct ShrinkwrapModifierData *smd, struct Object *ob, struct DerivedMesh *dm, int useRenderParams, int isFinalCalc); void shrinkwrapModifier_deform(struct ShrinkwrapModifierData *smd, struct Object *ob, struct DerivedMesh *dm, float (*vertexCos)[3], int numVerts); +/* + * This function casts a ray in the given BVHTree.. but it takes into consideration the space_transform, that is: + * + * if transf was configured with "space_transform_setup( &transf, ob1, ob2 )" + * then the input (vert, dir, BVHTreeRayHit) must be defined in ob1 coordinates space + * and the BVHTree must be built in ob2 coordinate space. + * + * Thus it provides an easy way to cast the same ray across several trees (where each tree was built on its own coords space) + */ +int normal_projection_project_vertex(char options, const float *vert, const float *dir, const SpaceTransform *transf, BVHTree *tree, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata); + +/* + * NULL initializers to local data + */ #define NULL_ShrinkwrapCalcData {NULL, } #define NULL_BVHTreeFromMesh {NULL, } #define NULL_BVHTreeRayHit {NULL, } -#define NULL_BVHTreeNearest {NULL, } +#define NULL_BVHTreeNearest {0, } #endif - diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 2456472d94a..1d7d4d1fda0 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -3274,6 +3274,7 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr if( VALID_CONS_TARGET(ct) && (ct->tar->type == OB_MESH) ) { + int fail = FALSE; float co[3] = {0.0f, 0.0f, 0.0f}; float no[3] = {0.0f, 0.0f, 0.0f}; float dist; @@ -3295,58 +3296,72 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr hit.index = -1; hit.dist = 100000.0f; //TODO should use FLT_MAX.. but normal projection doenst yet supports it - switch(scon->normalAxis) - { - case UP_X: no[0] = 1.0f; break; - case UP_Y: no[1] = 1.0f; break; - case UP_Z: no[2] = 1.0f; break; - } - if(target != NULL) { space_transform_from_matrixs(&transform, cob->startmat, ct->tar->obmat); - //Normal projection applies the transform later - if(scon->shrinkType != MOD_SHRINKWRAP_NORMAL) - { - space_transform_apply(&transform, co); - space_transform_apply_normal(&transform, no); - } - switch(scon->shrinkType) { case MOD_SHRINKWRAP_NEAREST_SURFACE: bvhtree_from_mesh_faces(&treeData, target, 0.0, 2, 6); - if(treeData.tree == NULL) return; + if(treeData.tree == NULL) + { + fail = TRUE; + break; + } + + space_transform_apply(&transform, co); BLI_bvhtree_find_nearest(treeData.tree, co, &nearest, treeData.nearest_callback, &treeData); dist = VecLenf(co, nearest.co); VecLerpf(co, co, nearest.co, (dist - scon->dist)/dist); //linear interpolation + space_transform_invert(&transform, co); break; case MOD_SHRINKWRAP_NEAREST_VERTEX: bvhtree_from_mesh_verts(&treeData, target, 0.0, 2, 6); - if(treeData.tree == NULL) return; + if(treeData.tree == NULL) + { + fail = TRUE; + break; + } + + space_transform_apply_normal(&transform, no); BLI_bvhtree_find_nearest(treeData.tree, co, &nearest, treeData.nearest_callback, &treeData); dist = VecLenf(co, nearest.co); VecLerpf(co, co, nearest.co, (dist - scon->dist)/dist); //linear interpolation + space_transform_invert(&transform, co); break; - case MOD_SHRINKWRAP_NORMAL: + case MOD_SHRINKWRAP_PROJECT: + if(scon->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS) no[0] = 1.0f; + if(scon->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS) no[1] = 1.0f; + if(scon->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS) no[2] = 1.0f; + + if(INPR(no,no) < FLT_EPSILON) + { + fail = TRUE; + break; + } + + Normalize(no); + + bvhtree_from_mesh_faces(&treeData, target, scon->dist, 4, 6); - if(treeData.tree == NULL) return; + if(treeData.tree == NULL) + { + fail = TRUE; + break; + } if(normal_projection_project_vertex(0, co, no, &transform, treeData.tree, &hit, treeData.raycast_callback, &treeData) == FALSE) { - free_bvhtree_from_mesh(&treeData); - - target->release(target); - - return; + fail = TRUE; + break; } VECCOPY(co, hit.co); break; @@ -3356,11 +3371,8 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr target->release(target); - if(scon->shrinkType != MOD_SHRINKWRAP_NORMAL) - { - space_transform_invert(&transform, co); - } - VECADD(ct->matrix[3], ct->matrix[3], co); + if(fail == FALSE) + VECADD(ct->matrix[3], ct->matrix[3], co); } } } diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 0eb01e823aa..75e6b69a3d9 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -7230,11 +7230,11 @@ static void shrinkwrapModifier_initData(ModifierData *md) { ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; smd->shrinkType = MOD_SHRINKWRAP_NEAREST_SURFACE; - smd->shrinkOpts = MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL; + smd->shrinkOpts = MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR; smd->keptDist = 0.0f; - smd->target = 0; - smd->cutPlane = 0; + smd->target = NULL; + smd->auxTarget = NULL; } static void shrinkwrapModifier_copyData(ModifierData *md, ModifierData *target) @@ -7242,12 +7242,14 @@ static void shrinkwrapModifier_copyData(ModifierData *md, ModifierData *target) ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*)md; ShrinkwrapModifierData *tsmd = (ShrinkwrapModifierData*)target; - tsmd->target = smd->target; - tsmd->cutPlane = smd->cutPlane; + tsmd->target = smd->target; + tsmd->auxTarget = smd->auxTarget; + strcpy(tsmd->vgroup_name, smd->vgroup_name); - tsmd->keptDist = smd->keptDist; - tsmd->shrinkType = smd->shrinkType; - tsmd->shrinkOpts = smd->shrinkOpts; + + tsmd->keptDist = smd->keptDist; + tsmd->shrinkType= smd->shrinkType; + tsmd->shrinkOpts= smd->shrinkOpts; } CustomDataMask shrinkwrapModifier_requiredDataMask(ModifierData *md) @@ -7273,19 +7275,9 @@ static void shrinkwrapModifier_foreachObjectLink(ModifierData *md, Object *ob, O ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; walk(userData, ob, &smd->target); - walk(userData, ob, &smd->cutPlane); -} -/* -static DerivedMesh *shrinkwrapModifier_applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData, int useRenderParams, int isFinalCalc) -{ - return shrinkwrapModifier_do((ShrinkwrapModifierData*)md,ob,derivedData,useRenderParams,isFinalCalc); + walk(userData, ob, &smd->auxTarget); } -static DerivedMesh *shrinkwrapModifier_applyModifierEM(ModifierData *md, Object *ob, EditMesh *editData, DerivedMesh *derivedData) -{ - return shrinkwrapModifier_do((ShrinkwrapModifierData*)md,ob,derivedData,0,0); -} -*/ static void shrinkwrapModifier_deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { shrinkwrapModifier_deform((ShrinkwrapModifierData*)md, ob, derivedData, vertexCos, numVerts); @@ -7313,8 +7305,8 @@ static void shrinkwrapModifier_updateDepgraph(ModifierData *md, DagForest *fores if (smd->target) dag_add_relation(forest, dag_get_node(forest, smd->target), obNode, DAG_RL_OB_DATA | DAG_RL_DATA_DATA, "Shrinkwrap Modifier"); - if (smd->cutPlane) - dag_add_relation(forest, dag_get_node(forest, smd->cutPlane), obNode, DAG_RL_OB_DATA | DAG_RL_DATA_DATA, "Shrinkwrap Modifier"); + if (smd->auxTarget) + dag_add_relation(forest, dag_get_node(forest, smd->auxTarget), obNode, DAG_RL_OB_DATA | DAG_RL_DATA_DATA, "Shrinkwrap Modifier"); } /* SimpleDeform */ diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 27442128483..d8ed67855c7 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -62,7 +62,6 @@ /* Benchmark macros */ #if 1 - #include #define BENCH(a) \ @@ -78,20 +77,9 @@ printf("%s: %fs (real) %fs (cpu)\n", #a, _t2-_t1, (float)(clock()-_clock_init)/CLOCKS_PER_SEC);\ } while(0) -#define BENCH_VAR(name) clock_t JOIN(_bench_step,name) = 0, JOIN(_bench_total,name) = 0 -#define BENCH_BEGIN(name) JOIN(_bench_step, name) = clock() -#define BENCH_END(name) JOIN(_bench_total,name) += clock() - JOIN(_bench_step,name) -#define BENCH_RESET(name) JOIN(_bench_total, name) = 0 -#define BENCH_REPORT(name) printf("%s: %fms (cpu) \n", TO_STR(name), JOIN(_bench_total,name)*1000.0f/CLOCKS_PER_SEC) - #else #define BENCH(a) (a) -#define BENCH_VAR(name) -#define BENCH_BEGIN(name) -#define BENCH_END(name) -#define BENCH_RESET(name) -#define BENCH_REPORT(name) #endif @@ -115,7 +103,7 @@ DerivedMesh *object_get_derived_final(Object *ob, CustomDataMask dataMask) void space_transform_from_matrixs(SpaceTransform *data, float local[4][4], float target[4][4]) { float itarget[4][4]; - Mat4Invert(itarget, target); //Invserse might be outdated + Mat4Invert(itarget, target); Mat4MulSerie(data->local2target, itarget, local, 0, 0, 0, 0, 0, 0); Mat4Invert(data->target2local, data->local2target); } @@ -152,443 +140,24 @@ static float squared_dist(const float *a, const float *b) return INPR(tmp, tmp); } -/* - * - */ -static void derivedmesh_mergeNearestPoints(DerivedMesh *dm, float mdist, BitSet skipVert) -{ - if(mdist > 0.0f) - { - int i, j, merged; - int numVerts = dm->getNumVerts(dm); - int *translate_vert = MEM_mallocN( sizeof(int)*numVerts, "merge points array"); - - MVert *vert = dm->getVertDataArray(dm, CD_MVERT); - - if(!translate_vert) return; - - merged = 0; - for(i=0; i 0) - { - int numFaces = dm->getNumFaces(dm); - int freeVert; - MFace *face = dm->getFaceDataArray(dm, CD_MFACE); - - - //Adjust vertexs using the translation_table.. only translations to back indexs are allowed - //which means t[i] <= i must always verify - for(i=0, freeVert = 0; iv1 = translate_vert[f->v1]; - f->v2 = translate_vert[f->v2]; - f->v3 = translate_vert[f->v3]; - //TODO be carefull with vertexs v4 being translated to 0 - f->v4 = translate_vert[f->v4]; - } - - //TODO: maybe update edges could be done outside this function - CDDM_calc_edges(dm); - //CDDM_calc_normals(dm); - } - - if(translate_vert) MEM_freeN( translate_vert ); - } -} - - -/* - * This function removes Unused faces, vertexs and edges from calc->target - * - * This function may modify calc->final. As so no data retrieved from - * it before the call to this function can be considered valid - * In case it creates a new DerivedMesh, the old calc->final is freed - */ -//TODO memory checks on allocs -/* -static void shrinkwrap_removeUnused(ShrinkwrapCalcData *calc) -{ - int i, t; - - DerivedMesh *old = calc->final, *new = NULL; - MFace *new_face = NULL; - MVert *new_vert = NULL; - - int numVerts= old->getNumVerts(old); - MVert *vert = old->getVertDataArray(old, CD_MVERT); - - int numFaces= old->getNumFaces(old); - MFace *face = old->getFaceDataArray(old, CD_MFACE); - - BitSet moved_verts = calc->moved; - - //Arrays to translate to new vertexs indexs - int *vert_index = (int*)MEM_callocN(sizeof(int)*(numVerts), "shrinkwrap used verts"); - BitSet used_faces = bitset_new(numFaces, "shrinkwrap used faces"); - int numUsedFaces = 0; - - - //calculate which vertexs need to be used - //even unmoved vertices might need to be used if theres a face that needs it - //calc real number of faces, and vertices - //Count used faces - for(i=0; igetVertDataArray(new, CD_MVERT); - for(i=0, t=0; igetFaceDataArray(new, CD_MFACE); - for(i=0, t=0; iv1 = vert_index[new_face->v1]-1; - new_face->v2 = vert_index[new_face->v2]-1; - new_face->v3 = vert_index[new_face->v3]-1; - if(new_face->v4) - { - new_face->v4 = vert_index[new_face->v4]-1; - - //Ups translated vertex ended on 0 .. TODO fix this - if(new_face->v4 == 0) - { - } - } - new_face++; - } - } - - //Free memory - bitset_free(used_faces); - MEM_freeN(vert_index); - old->release(old); - - //Update edges - CDDM_calc_edges(new); - CDDM_calc_normals(new); - - calc->final = new; -} - - -void shrinkwrap_projectToCutPlane(ShrinkwrapCalcData *calc_data) -{ - if(calc_data->smd->cutPlane && calc_data->moved) - { - int i; - int unmoved = 0; - int numVerts= 0; - MVert *vert = NULL; - MVert *vert_unmoved = NULL; - - ShrinkwrapCalcData calc; - memcpy(&calc, calc_data, sizeof(calc)); - - calc.moved = 0; - - if(calc.smd->cutPlane) - { - //TODO currently we need a copy in case object_get_derived_final returns an emDM that does not defines getVertArray or getFace array - calc.target = CDDM_copy( object_get_derived_final(calc.smd->cutPlane, CD_MASK_BAREMESH) ); - - if(!calc.target) - { - return; - } - - space_transform_setup(&calc.local2target, calc.ob, calc.smd->cutPlane); - calc.keptDist = 0; - } - - - //Make a mesh with the points we want to project - numVerts = calc_data->final->getNumVerts(calc_data->final); - - unmoved = 0; - for(i=0; imoved, i)) - unmoved++; - - calc.final = CDDM_new(unmoved, 0, 0); - if(!calc.final) return; - - - vert = calc_data->final->getVertDataArray(calc_data->final, CD_MVERT); - vert_unmoved = calc.final->getVertDataArray(calc.final, CD_MVERT); - - for(i=0; imoved, i)) - memcpy(vert_unmoved++, vert+i, sizeof(*vert_unmoved)); - - //use shrinkwrap projection - shrinkwrap_calc_normal_projection(&calc); - - //Copy the points back to the mesh - vert = calc_data->final->getVertDataArray(calc_data->final, CD_MVERT); - vert_unmoved = calc.final->getVertDataArray(calc.final, CD_MVERT); - for(i=0; imoved, i)) - memcpy(vert+i, vert_unmoved++, sizeof(*vert_unmoved) ); - - //free memory - calc.final->release(calc.final); - calc.target->release(calc.target); - } - -} -*/ - -/* Main shrinkwrap function */ -/* -DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, DerivedMesh *dm, int useRenderParams, int isFinalCalc) -{ - - ShrinkwrapCalcData calc; - memset(&calc, 0, sizeof(calc)); - - //Init Shrinkwrap calc data - calc.smd = smd; - - calc.ob = ob; - calc.original = dm; - calc.final = CDDM_copy(calc.original); - - if(!calc.final) - { - OUT_OF_MEMORY(); - return dm; - } - - CDDM_calc_normals(calc.final); //Normals maybe not be calculated yet - - //remove loop dependencies on derived meshs (TODO should this be done elsewhere?) - if(smd->target == ob) smd->target = NULL; - if(smd->cutPlane == ob) smd->cutPlane = NULL; - - - if(smd->target) - { - //TODO currently we need a copy in case object_get_derived_final returns an emDM that does not defines getVertArray or getFace array - calc.target = CDDM_copy( object_get_derived_final(smd->target, CD_MASK_BAREMESH) ); - - if(!calc.target) - { - printf("Target derived mesh is null! :S\n"); - } - - //TODO there might be several "bugs" on non-uniform scales matrixs.. because it will no longer be nearest surface, not sphere projection - //because space has been deformed - space_transform_setup(&calc.local2target, ob, smd->target); - - calc.keptDist = smd->keptDist; //TODO: smd->keptDist is in global units.. must change to local - } - - //Projecting target defined - lets work! - if(calc.target) - { - - printf("Shrinkwrap (%s)%d over (%s)%d\n", - calc.ob->id.name, calc.final->getNumVerts(calc.final), - calc.smd->target->id.name, calc.target->getNumVerts(calc.target) - ); - - - switch(smd->shrinkType) - { - case MOD_SHRINKWRAP_NEAREST_SURFACE: - BENCH(shrinkwrap_calc_nearest_surface_point(&calc)); -// BENCH(shrinkwrap_calc_foreach_vertex(&calc, bruteforce_shrinkwrap_calc_nearest_surface_point)); - break; - - case MOD_SHRINKWRAP_NORMAL: - - if(calc.smd->shrinkOpts & MOD_SHRINKWRAP_REMOVE_UNPROJECTED_FACES) - calc.moved = bitset_new( calc.final->getNumVerts(calc.final), "shrinkwrap bitset data"); - - -// BENCH(shrinkwrap_calc_normal_projection_raytree(&calc)); -// calc.final->release( calc.final ); -// calc.final = CDDM_copy(calc.original); - - BENCH(shrinkwrap_calc_normal_projection(&calc)); -// BENCH(shrinkwrap_calc_foreach_vertex(&calc, bruteforce_shrinkwrap_calc_normal_projection)); - - if(calc.moved) - { - //Adjust vertxs that didn't moved (project to cut plane) - shrinkwrap_projectToCutPlane(&calc); - - //Destroy faces, edges and stuff - shrinkwrap_removeUnused(&calc); - - //Merge points that didn't moved - derivedmesh_mergeNearestPoints(calc.final, calc.smd->mergeDist, calc.moved); - bitset_free(calc.moved); - } - break; - - case MOD_SHRINKWRAP_NEAREST_VERTEX: - - BENCH(shrinkwrap_calc_nearest_vertex(&calc)); -// BENCH(shrinkwrap_calc_foreach_vertex(&calc, bruteforce_shrinkwrap_calc_nearest_vertex)); - break; - } - - //free derived mesh - calc.target->release( calc.target ); - calc.target = NULL; - } - - CDDM_calc_normals(calc.final); - - return calc.final; -} -*/ - /* Main shrinkwrap function */ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedMesh *dm, float (*vertexCos)[3], int numVerts) { ShrinkwrapCalcData calc = NULL_ShrinkwrapCalcData; - //Init Shrinkwrap calc data - calc.smd = smd; - - calc.ob = ob; - calc.original = dm; - - calc.numVerts = numVerts; - calc.vertexCos = vertexCos; - //remove loop dependencies on derived meshs (TODO should this be done elsewhere?) if(smd->target == ob) smd->target = NULL; - if(smd->cutPlane == ob) smd->cutPlane = NULL; + if(smd->auxTarget == ob) smd->auxTarget = NULL; + //Configure Shrinkwrap calc data + calc.smd = smd; + calc.ob = ob; + calc.original = dm; + calc.numVerts = numVerts; + calc.vertexCos = vertexCos; + if(smd->target) { //TODO currently we need a copy in case object_get_derived_final returns an emDM that does not defines getVertArray or getFace array @@ -606,6 +175,7 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedM calc.keptDist = smd->keptDist; //TODO: smd->keptDist is in global units.. must change to local } + //Projecting target defined - lets work! if(calc.target) { @@ -615,14 +185,13 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedM calc.smd->target->id.name, calc.target->getNumVerts(calc.target) ); - switch(smd->shrinkType) { case MOD_SHRINKWRAP_NEAREST_SURFACE: BENCH(shrinkwrap_calc_nearest_surface_point(&calc)); break; - case MOD_SHRINKWRAP_NORMAL: + case MOD_SHRINKWRAP_PROJECT: BENCH(shrinkwrap_calc_normal_projection(&calc)); break; @@ -630,18 +199,18 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedM BENCH(shrinkwrap_calc_nearest_vertex(&calc)); break; } - - //free derived mesh - calc.target->release( calc.target ); - calc.target = NULL; } + + //free memory + if(calc.target) + calc.target->release( calc.target ); } /* * Shrinkwrap to the nearest vertex * * it builds a kdtree of vertexs we can attach to and then - * for each vertex on performs a nearest vertex search on the tree + * for each vertex performs a nearest vertex search on the tree */ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) { @@ -653,7 +222,6 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) MDeformVert *dvert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MDEFORMVERT) : NULL; - BENCH(bvhtree_from_mesh_verts(&treeData, calc->target, 0.0, 2, 6)); if(treeData.tree == NULL) return OUT_OF_MEMORY(); @@ -665,29 +233,37 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) for(i = 0; inumVerts; ++i) { float *co = calc->vertexCos[i]; - int index; float tmp_co[3]; float weight = vertexgroup_get_vertex_weight(dvert, i, vgroup); if(weight == 0.0f) continue; VECCOPY(tmp_co, co); - space_transform_apply(&calc->local2target, tmp_co); + space_transform_apply(&calc->local2target, tmp_co); //Convert the coordinates to the tree coordinates //Use local proximity heuristics (to reduce the nearest search) + // + //If we already had an hit before.. we assume this vertex is going to have a close hit to that other vertex + //so we can initiate the "nearest.dist" with the expected value to that last hit. + //This will lead in prunning of the search tree. if(nearest.index != -1) nearest.dist = squared_dist(tmp_co, nearest.co); else nearest.dist = FLT_MAX; - index = BLI_bvhtree_find_nearest(treeData.tree, tmp_co, &nearest, treeData.nearest_callback, &treeData); + BLI_bvhtree_find_nearest(treeData.tree, tmp_co, &nearest, treeData.nearest_callback, &treeData); - if(index != -1) + + //Found the nearest vertex + if(nearest.index != -1) { - float dist = nearest.dist; - if(dist > 1e-5) weight *= (dist - calc->keptDist)/dist; + //Adjusting the vertex weight, so that after interpolating it kepts a certain distance from the nearest position + float dist = sasqrt(nearest.dist); + if(dist > FLT_EPSILON) weight *= (dist - calc->keptDist)/dist; + //Convert the coordinates back to mesh coordinates VECCOPY(tmp_co, nearest.co); space_transform_invert(&calc->local2target, tmp_co); + VecLerpf(co, co, tmp_co, weight); //linear interpolation } } @@ -763,104 +339,132 @@ int normal_projection_project_vertex(char options, const float *vert, const floa void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) { int i; - int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); - char use_normal = calc->smd->shrinkOpts; - //setup raytracing - BVHTreeFromMesh treeData = NULL_BVHTreeFromMesh; - BVHTreeRayHit hit = NULL_BVHTreeRayHit; + //Options about projection direction + char use_normal = calc->smd->shrinkOpts; + float proj_axis[3] = {0.0f, 0.0f, 0.0f}; + MVert *vert = NULL; //Needed in case of vertex normal - //cutTree - DerivedMesh * limit_mesh = NULL; - BVHTreeFromMesh limitData= NULL_BVHTreeFromMesh; - SpaceTransform local2cut; - - MVert *vert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MVERT) : NULL; //Needed because of vertex normal + //Vertex group data + int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); MDeformVert *dvert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MDEFORMVERT) : NULL; - if(vert == NULL) + + //Raycast and tree stuff + BVHTreeRayHit hit; + BVHTreeFromMesh treeData = NULL_BVHTreeFromMesh; //target + + //auxiliar target + DerivedMesh * aux_mesh = NULL; + BVHTreeFromMesh auxData= NULL_BVHTreeFromMesh; + SpaceTransform local2aux; + + + //Prepare data to retrieve the direction in which we should project each vertex + if(calc->smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL) { - printf("Shrinkwrap cant normal project witouth normal information"); + vert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MVERT) : NULL; + if(vert) CDDM_calc_normals(calc->original); //Maybe normals aren't yet calculated + } + else + { + //The code supports any axis that is a combination of X,Y,Z.. altought currently UI only allows to set the 3 diferent axis + if(calc->smd->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS) proj_axis[0] = 1.0f; + if(calc->smd->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS) proj_axis[1] = 1.0f; + if(calc->smd->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS) proj_axis[2] = 1.0f; + + Normalize(proj_axis); + } + + if(vert == NULL && (INPR(proj_axis, proj_axis) < FLT_EPSILON)) + { + printf("Shrinkwrap can't project witouth normal information"); return; } - if((use_normal & (MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL | MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL)) == 0) - return; //Nothing todo - CDDM_calc_normals(calc->original); //Normals maybe arent yet calculated + //If the user doesn't allows to project in any direction of projection axis... then theres nothing todo. + if((use_normal & (MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR | MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR)) == 0) + return; + + //Build target tree BENCH(bvhtree_from_mesh_faces(&treeData, calc->target, calc->keptDist, 4, 6)); if(treeData.tree == NULL) return OUT_OF_MEMORY(); - - if(calc->smd->cutPlane) + //Build auxiliar target + if(calc->smd->auxTarget) { - space_transform_setup( &local2cut, calc->ob, calc->smd->cutPlane); + space_transform_setup( &local2aux, calc->ob, calc->smd->auxTarget); - //TODO currently we need a copy in case object_get_derived_final returns an emDM that does not defines getVertArray or getFace array - limit_mesh = CDDM_copy( object_get_derived_final(calc->smd->cutPlane, CD_MASK_BAREMESH) ); - if(limit_mesh) - BENCH(bvhtree_from_mesh_faces(&limitData, limit_mesh, 0.0, 4, 6)); + aux_mesh = CDDM_copy( object_get_derived_final(calc->smd->auxTarget, CD_MASK_BAREMESH) ); //TODO currently we need a copy in case object_get_derived_final returns an emDM that does not defines getVertArray or getFace array + if(aux_mesh) + BENCH(bvhtree_from_mesh_faces(&auxData, aux_mesh, 0.0, 4, 6)); else - printf("CutPlane finalDerived mesh is null\n"); + printf("Auxiliar target finalDerived mesh is null\n"); } + + //Now, everything is ready to project the vertexs! + //#pragma omp parallel for private(i) private(hit) schedule(static) for(i = 0; inumVerts; ++i) { float *co = calc->vertexCos[i]; float tmp_co[3], tmp_no[3]; - float lim = 1000; //TODO: we should use FLT_MAX here, but sweepsphere code isnt prepared for that + float lim = 1000; //TODO: we should use FLT_MAX here, but sweepsphere code isnt prepared for that float weight = vertexgroup_get_vertex_weight(dvert, i, vgroup); - char moved = FALSE; if(weight == 0.0f) continue; VECCOPY(tmp_co, co); - NormalShortToFloat(tmp_no, vert[i].no); + + if(vert) + NormalShortToFloat(tmp_no, vert[i].no); + else + VECCOPY( tmp_no, proj_axis ); hit.index = -1; hit.dist = lim; - if(use_normal & MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL) + //Project over positive direction of axis + if(use_normal & MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR) { - if(limitData.tree) - normal_projection_project_vertex(0, tmp_co, tmp_no, &local2cut, limitData.tree, &hit, limitData.raycast_callback, &limitData); + if(auxData.tree) + normal_projection_project_vertex(0, tmp_co, tmp_no, &local2aux, auxData.tree, &hit, auxData.raycast_callback, &auxData); - if(normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, tmp_no, &calc->local2target, treeData.tree, &hit, treeData.raycast_callback, &treeData)) - moved = TRUE; + normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, tmp_no, &calc->local2target, treeData.tree, &hit, treeData.raycast_callback, &treeData); } - - if(use_normal & MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL) + //Project over negative direction of axis + if(use_normal & MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR) { float inv_no[3] = { -tmp_no[0], -tmp_no[1], -tmp_no[2] }; - if(limitData.tree) - normal_projection_project_vertex(0, tmp_co, inv_no, &local2cut, limitData.tree, &hit, limitData.raycast_callback, &limitData); + if(auxData.tree) + normal_projection_project_vertex(0, tmp_co, inv_no, &local2aux, auxData.tree, &hit, auxData.raycast_callback, &auxData); - if(normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, inv_no, &calc->local2target, treeData.tree, &hit, treeData.raycast_callback, &treeData)) - moved = TRUE; + normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, inv_no, &calc->local2target, treeData.tree, &hit, treeData.raycast_callback, &treeData); } if(hit.index != -1) { VecLerpf(co, co, hit.co, weight); - - if(moved && calc->moved) - bitset_set(calc->moved, i); } } - free_bvhtree_from_mesh(&treeData); - free_bvhtree_from_mesh(&limitData); - if(limit_mesh) - limit_mesh->release(limit_mesh); + //free data structures + + free_bvhtree_from_mesh(&treeData); + free_bvhtree_from_mesh(&auxData); + + if(aux_mesh) + aux_mesh->release(aux_mesh); } /* @@ -920,7 +524,14 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) else { float dist = sasqrt( nearest.dist ); - VecLerpf(tmp_co, tmp_co, nearest.co, (dist - calc->keptDist)/dist); //linear interpolation + if(dist > FLT_EPSILON) + { + VecLerpf(tmp_co, tmp_co, nearest.co, (dist - calc->keptDist)/dist); //linear interpolation + } + else + { + VECCOPY( tmp_co, nearest.co ); + } } space_transform_invert(&calc->local2target, tmp_co); VecLerpf(co, co, tmp_co, weight); //linear interpolation diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h index cc7bdeef0de..48bacdefcf6 100644 --- a/source/blender/makesdna/DNA_constraint_types.h +++ b/source/blender/makesdna/DNA_constraint_types.h @@ -321,7 +321,7 @@ typedef struct bShrinkwrapConstraint { Object *target; float dist; /* distance to kept from target */ short shrinkType; /* shrink type (look on MOD shrinkwrap for values) */ - char normalAxis; /* axis to project over UP_X, UP_Y, UP_Z */ + char projAxis; /* axis to project over UP_X, UP_Y, UP_Z */ char pad[9]; } bShrinkwrapConstraint; diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index b3d80f2e554..c8db1164dc9 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -496,28 +496,35 @@ typedef struct ShrinkwrapModifierData { ModifierData modifier; struct Object *target; /* shrink target */ - struct Object *cutPlane;/* shrink target */ + struct Object *auxTarget; /* additional shrink target */ char vgroup_name[32]; /* optional vertexgroup name */ float keptDist; /* distance offset from mesh/projection point */ short shrinkType; /* shrink type projection */ short shrinkOpts; /* shrink options */ + char projAxis; /* axis to project over */ + char pad[7]; } ShrinkwrapModifierData; /* Shrinkwrap->shrinkType */ #define MOD_SHRINKWRAP_NEAREST_SURFACE 0 -#define MOD_SHRINKWRAP_NORMAL 1 +#define MOD_SHRINKWRAP_PROJECT 1 #define MOD_SHRINKWRAP_NEAREST_VERTEX 2 /* Shrinkwrap->shrinkOpts */ -#define MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL (1<<0) -#define MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL (1<<1) -/* #define MOD_SHRINKWRAP_REMOVE_UNPROJECTED_FACES (1<<2) / * Currently dropped to make shrinkwrap a deform only modifier */ +#define MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR (1<<0) /* allow shrinkwrap to move the vertex in the positive direction of axis */ +#define MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR (1<<1) /* allow shrinkwrap to move the vertex in the negative direction of axis */ -#define MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE (1<<3) -#define MOD_SHRINKWRAP_CULL_TARGET_BACKFACE (1<<4) +#define MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE (1<<3) /* ignore vertex moves if a vertex ends projected on a front face of the target */ +#define MOD_SHRINKWRAP_CULL_TARGET_BACKFACE (1<<4) /* ignore vertex moves if a vertex ends projected on a back face of the target */ + +#define MOD_SHRINKWRAP_KEPT_ABOVE_SURFACE (1<<5) /* distance is measure to the front face of the target */ + +#define MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS (1<<0) +#define MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS (1<<1) +#define MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS (1<<2) +#define MOD_SHRINKWRAP_PROJECT_OVER_NORMAL 0 /* projection over normal is used if no axis is selected */ -#define MOD_SHRINKWRAP_KEPT_ABOVE_SURFACE (1<<5) typedef struct SimpleDeformModifierData { ModifierData modifier; diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index bfdd4f0c9a0..583532b6ec8 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -1902,8 +1902,8 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco } else if (md->type==eModifierType_Shrinkwrap) { ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; height = 86 + 3; - if (smd->shrinkType == MOD_SHRINKWRAP_NORMAL) - height += 19*3; + if (smd->shrinkType == MOD_SHRINKWRAP_PROJECT) + height += 19*5; else if (smd->shrinkType == MOD_SHRINKWRAP_NEAREST_SURFACE) height += 19; @@ -2538,7 +2538,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco } else if (md->type==eModifierType_Shrinkwrap) { ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; - char shrinktypemenu[]="Shrinkwrap type%t|nearest surface point %x0|normal projection %x1|nearest vertex %x2"; + char shrinktypemenu[]="Shrinkwrap type%t|nearest surface point %x0|projection %x1|nearest vertex %x2"; uiDefIDPoinBut(block, modifier_testMeshObj, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &smd->target, "Target to shrink to"); @@ -2549,18 +2549,25 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco cy -= 3; uiDefButS(block, MENU, B_MODIFIER_RECALC, shrinktypemenu, lx,(cy-=19),buttonWidth,19, &smd->shrinkType, 0, 0, 0, 0, "Selects type of shrinkwrap algorithm for target position."); - if (smd->shrinkType == MOD_SHRINKWRAP_NORMAL){ - uiDefButBitS(block, TOG, MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL, B_MODIFIER_RECALC, "Default normal", lx,(cy-=19),buttonWidth/2,19, &smd->shrinkOpts, 0, 0, 0, 0, "Allows vertices to move in the normal direction"); - uiDefButBitS(block, TOG, MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL, B_MODIFIER_RECALC, "Invert normal", lx + buttonWidth/2,cy,buttonWidth/2,19, &smd->shrinkOpts, 0, 0, 0, 0, "Allows vertices to move in the inverse direction of their normal"); + if (smd->shrinkType == MOD_SHRINKWRAP_PROJECT){ -/* uiDefButBitS(block, TOG, MOD_SHRINKWRAP_REMOVE_UNPROJECTED_FACES, B_MODIFIER_RECALC, "Remove faces", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Remove faces where all vertices haven't been projected"); */ + + /* UI for projection axis */ + uiBlockBeginAlign(block); + uiDefButC(block, ROW, B_MODIFIER_RECALC, "Normal" , lx,(cy-=19),buttonWidth,19, &smd->projAxis, 18.0, MOD_SHRINKWRAP_PROJECT_OVER_NORMAL, 0, 0, "Projection over X axis"); + uiDefButBitC(block, TOG, MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS, B_MODIFIER_RECALC, "X", lx+buttonWidth/3*0,(cy-=19),buttonWidth/3,19, &smd->projAxis, 0, 0, 0, 0, "Projection over X axis"); + uiDefButBitC(block, TOG, MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS, B_MODIFIER_RECALC, "Y", lx+buttonWidth/3*1,cy,buttonWidth/3,19, &smd->projAxis, 0, 0, 0, 0, "Projection over Y axis"); + uiDefButBitC(block, TOG, MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS, B_MODIFIER_RECALC, "Z", lx+buttonWidth/3*2,cy,buttonWidth/3,19, &smd->projAxis, 0, 0, 0, 0, "Projection over Z axis"); + + + /* allowed directions of projection axis */ + uiDefButBitS(block, TOG, MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR, B_MODIFIER_RECALC, "Negative", lx,(cy-=19),buttonWidth/2,19, &smd->shrinkOpts, 0, 0, 0, 0, "Allows to move the vertex in the negative direction of axis"); + uiDefButBitS(block, TOG, MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR, B_MODIFIER_RECALC, "Positive", lx + buttonWidth/2,cy,buttonWidth/2,19, &smd->shrinkOpts, 0, 0, 0, 0, "Allows to move the vertex in the positive direction of axis"); uiDefButBitS(block, TOG, MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE, B_MODIFIER_RECALC, "Cull frontfaces",lx,(cy-=19),buttonWidth/2,19, &smd->shrinkOpts, 0, 0, 0, 0, "Controls whether a vertex can be projected to a front face on target"); uiDefButBitS(block, TOG, MOD_SHRINKWRAP_CULL_TARGET_BACKFACE, B_MODIFIER_RECALC, "Cull backfaces", lx+buttonWidth/2,cy,buttonWidth/2,19, &smd->shrinkOpts, 0, 0, 0, 0, "Controls whether a vertex can be projected to a back face on target"); - -/* uiDefButF(block, NUM, B_MODIFIER_RECALC, "Merge Dist:", lx,(cy-=19),buttonWidth,19, &smd->mergeDist, 0.0f, 0.01f, 0.01f, 0.01f, "Specify merge distance"); */ - uiDefIDPoinBut(block, modifier_testMeshObj, ID_OB, B_CHANGEDEP, "Ob2: ", lx, (cy-=19), buttonWidth,19, &smd->cutPlane, "Aditional mesh to project over"); + uiDefIDPoinBut(block, modifier_testMeshObj, ID_OB, B_CHANGEDEP, "Ob2: ", lx, (cy-=19), buttonWidth,19, &smd->auxTarget, "Aditional mesh to project over"); } else if (smd->shrinkType == MOD_SHRINKWRAP_NEAREST_SURFACE){ uiDefButBitS(block, TOG, MOD_SHRINKWRAP_KEPT_ABOVE_SURFACE, B_MODIFIER_RECALC, "Above surface", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Vertices are kept on the front side of faces"); diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index 524a18a9f3d..370f6999dfc 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -1744,10 +1744,10 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s case CONSTRAINT_TYPE_SHRINKWRAP: { bShrinkwrapConstraint *data = con->data; - char shrinktypemenu[]="Shrinkwrap type%t|nearest surface point %x0|normal projection %x1|nearest vertex %x2"; + char shrinktypemenu[]="Shrinkwrap type%t|nearest surface point %x0|projection %x1|nearest vertex %x2"; height = 60; - if(data->shrinkType == MOD_SHRINKWRAP_NORMAL) + if(data->shrinkType == MOD_SHRINKWRAP_PROJECT) height += 18; uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); @@ -1762,13 +1762,13 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Type:", *xco + 70, *yco-60, 90, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); uiDefButS(block, MENU, B_MODIFIER_RECALC, shrinktypemenu, *xco+120, *yco-60, 135, 18, &data->shrinkType, 0, 0, 0, 0, "Selects type of shrinkwrap algorithm for target position."); - if(data->shrinkType == MOD_SHRINKWRAP_NORMAL) + if(data->shrinkType == MOD_SHRINKWRAP_PROJECT) { /* Draw XYZ toggles */ uiDefBut(block, LABEL,B_CONSTRAINT_TEST, "Axis:", *xco+ 75, *yco-78, 90, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - uiDefButC(block, ROW, B_CONSTRAINT_TEST, "X" , *xco+120, *yco-78, 45, 18, &data->normalAxis, 18.0, UP_X, 0, 0, "Direction of normal projection is x-axis"); - uiDefButC(block, ROW, B_CONSTRAINT_TEST, "Y" , *xco+165, *yco-78, 45, 18, &data->normalAxis, 18.0, UP_Y, 0, 0, "Direction of normal projection is y-axis"); - uiDefButC(block, ROW, B_CONSTRAINT_TEST, "Z" , *xco+210, *yco-78, 45, 18, &data->normalAxis, 18.0, UP_Z, 0, 0, "Direction of normal projection is z-axis"); + uiDefButBitC(block, TOG, MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS, B_CONSTRAINT_TEST, "X",*xco+120, *yco-78, 45, 18, &data->projAxis, 0, 0, 0, 0, "Projection over X axis"); + uiDefButBitC(block, TOG, MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS, B_CONSTRAINT_TEST, "Y",*xco+165, *yco-78, 45, 18, &data->projAxis, 0, 0, 0, 0, "Projection over Y axis"); + uiDefButBitC(block, TOG, MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS, B_CONSTRAINT_TEST, "Z",*xco+210, *yco-78, 45, 18, &data->projAxis, 0, 0, 0, 0, "Projection over Z axis"); } } break; From 1e7e8ceaac2330e085a034e09a77bbe40af4dece Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Wed, 13 Aug 2008 01:38:13 +0000 Subject: [PATCH 66/76] fixed a bug related with "cullfaces" option on shrinkwrap enabled openmp during the tree queries (before it was only enabled during tree building) --- source/blender/blenkernel/intern/modifier.c | 7 ++- source/blender/blenkernel/intern/shrinkwrap.c | 51 ++++++++++--------- 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 75e6b69a3d9..d173ff661be 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -7258,8 +7258,13 @@ CustomDataMask shrinkwrapModifier_requiredDataMask(ModifierData *md) CustomDataMask dataMask = 0; /* ask for vertexgroups if we need them */ - if(smd->vgroup_name[0]) dataMask |= (1 << CD_MDEFORMVERT); + if(smd->vgroup_name[0]) + dataMask |= (1 << CD_MDEFORMVERT); + if(smd->shrinkType == MOD_SHRINKWRAP_PROJECT + && smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL) + dataMask |= (1 << CD_MVERT); + return dataMask; } diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index d8ed67855c7..193612074bc 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -215,12 +215,12 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedM void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) { int i; - int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); + const int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); + MDeformVert *const dvert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MDEFORMVERT) : NULL; BVHTreeFromMesh treeData = NULL_BVHTreeFromMesh; BVHTreeNearest nearest = NULL_BVHTreeNearest; - MDeformVert *dvert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MDEFORMVERT) : NULL; BENCH(bvhtree_from_mesh_verts(&treeData, calc->target, 0.0, 2, 6)); if(treeData.tree == NULL) return OUT_OF_MEMORY(); @@ -229,7 +229,7 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) nearest.index = -1; nearest.dist = FLT_MAX; -//#pragma omp parallel for private(i) private(nearest) schedule(static) +#pragma omp parallel for default(none) private(i) firstprivate(nearest) shared(treeData,calc) schedule(static) for(i = 0; inumVerts; ++i) { float *co = calc->vertexCos[i]; @@ -315,8 +315,8 @@ int normal_projection_project_vertex(char options, const float *vert, const floa { float dot = INPR( dir, hit_tmp.no); - if(((options & MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE) && dot < 0) - || ((options & MOD_SHRINKWRAP_CULL_TARGET_BACKFACE) && dot > 0)) + if(((options & MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE) && dot <= 0.0f) + || ((options & MOD_SHRINKWRAP_CULL_TARGET_BACKFACE) && dot >= 0.0f)) return FALSE; //Ignore hit @@ -341,13 +341,13 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) int i; //Options about projection direction - char use_normal = calc->smd->shrinkOpts; + const char use_normal = calc->smd->shrinkOpts; float proj_axis[3] = {0.0f, 0.0f, 0.0f}; MVert *vert = NULL; //Needed in case of vertex normal //Vertex group data - int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); - MDeformVert *dvert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MDEFORMVERT) : NULL; + const int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); + const MDeformVert *dvert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MDEFORMVERT) : NULL; //Raycast and tree stuff @@ -405,8 +405,7 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) //Now, everything is ready to project the vertexs! - -//#pragma omp parallel for private(i) private(hit) schedule(static) +//#pragma omp parallel for private(i,hit) schedule(static) for(i = 0; inumVerts; ++i) { float *co = calc->vertexCos[i]; @@ -477,8 +476,8 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) { int i; - const int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); - const MDeformVert *dvert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MDEFORMVERT) : NULL; + const int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); + const MDeformVert *const dvert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MDEFORMVERT) : NULL; BVHTreeFromMesh treeData = NULL_BVHTreeFromMesh; BVHTreeNearest nearest = NULL_BVHTreeNearest; @@ -495,49 +494,55 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) //Find the nearest vertex -//#pragma omp parallel for private(i) private(nearest) schedule(static) +#pragma omp parallel for default(none) private(i) firstprivate(nearest) shared(calc,treeData) schedule(static) for(i = 0; inumVerts; ++i) { float *co = calc->vertexCos[i]; - int index; float tmp_co[3]; float weight = vertexgroup_get_vertex_weight(dvert, i, vgroup); if(weight == 0.0f) continue; + //Convert the vertex to tree coordinates VECCOPY(tmp_co, co); space_transform_apply(&calc->local2target, tmp_co); + //Use local proximity heuristics (to reduce the nearest search) + // + //If we already had an hit before.. we assume this vertex is going to have a close hit to that other vertex + //so we can initiate the "nearest.dist" with the expected value to that last hit. + //This will lead in prunning of the search tree. if(nearest.index != -1) - { nearest.dist = squared_dist(tmp_co, nearest.co); - } - else nearest.dist = FLT_MAX; + else + nearest.dist = FLT_MAX; - index = BLI_bvhtree_find_nearest(treeData.tree, tmp_co, &nearest, treeData.nearest_callback, &treeData); + BLI_bvhtree_find_nearest(treeData.tree, tmp_co, &nearest, treeData.nearest_callback, &treeData); - if(index != -1) + //Found the nearest vertex + if(nearest.index) { if(calc->smd->shrinkOpts & MOD_SHRINKWRAP_KEPT_ABOVE_SURFACE) { + //Make the vertex stay on the front side of the face VECADDFAC(tmp_co, nearest.co, nearest.no, calc->keptDist); } else { + //Adjusting the vertex weight, so that after interpolating it kepts a certain distance from the nearest position float dist = sasqrt( nearest.dist ); if(dist > FLT_EPSILON) - { VecLerpf(tmp_co, tmp_co, nearest.co, (dist - calc->keptDist)/dist); //linear interpolation - } else - { VECCOPY( tmp_co, nearest.co ); - } } + + //Convert the coordinates back to mesh coordinates space_transform_invert(&calc->local2target, tmp_co); VecLerpf(co, co, tmp_co, weight); //linear interpolation } } + free_bvhtree_from_mesh(&treeData); } From 3713470204b4ca342f15254a04a1e2779b57e6e5 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Wed, 13 Aug 2008 13:36:09 +0000 Subject: [PATCH 67/76] Fixed compile for windows --- source/blender/blenkernel/intern/shrinkwrap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 193612074bc..1ccfdfc42e5 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -60,7 +60,7 @@ #define OUT_OF_MEMORY() ((void)printf("Shrinkwrap: Out of memory\n")) /* Benchmark macros */ -#if 1 +#ifndef _WIN32 #include From 6a8236a8da3a5f440c406a0c4b5cc8f902f4da3a Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Wed, 13 Aug 2008 17:34:09 +0000 Subject: [PATCH 68/76] Fixed a typo I was using the word "kept" (past tense) instead of "keep" (basic form). I hope my english teachter dont sees this commit xD --- source/blender/blenkernel/BKE_shrinkwrap.h | 2 +- source/blender/blenkernel/intern/modifier.c | 4 ++-- source/blender/blenkernel/intern/shrinkwrap.c | 16 ++++++++-------- source/blender/makesdna/DNA_modifier_types.h | 4 ++-- source/blender/src/buttons_editing.c | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h index 4fa52f12566..e8276238ff2 100644 --- a/source/blender/blenkernel/BKE_shrinkwrap.h +++ b/source/blender/blenkernel/BKE_shrinkwrap.h @@ -112,7 +112,7 @@ typedef struct ShrinkwrapCalcData struct DerivedMesh *target; //mesh we are shrinking to SpaceTransform local2target; //transform to move bettwem local and target space - float keptDist; //Distance to kept from target (units are in local space) + float keepDist; //Distance to kept from target (units are in local space) } ShrinkwrapCalcData; diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index d173ff661be..750a86e302a 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -7231,7 +7231,7 @@ static void shrinkwrapModifier_initData(ModifierData *md) ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; smd->shrinkType = MOD_SHRINKWRAP_NEAREST_SURFACE; smd->shrinkOpts = MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR; - smd->keptDist = 0.0f; + smd->keepDist = 0.0f; smd->target = NULL; smd->auxTarget = NULL; @@ -7247,7 +7247,7 @@ static void shrinkwrapModifier_copyData(ModifierData *md, ModifierData *target) strcpy(tsmd->vgroup_name, smd->vgroup_name); - tsmd->keptDist = smd->keptDist; + tsmd->keepDist = smd->keepDist; tsmd->shrinkType= smd->shrinkType; tsmd->shrinkOpts= smd->shrinkOpts; } diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 1ccfdfc42e5..1c4d5e323ee 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -172,7 +172,7 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedM //because space has been deformed space_transform_setup(&calc.local2target, ob, smd->target); - calc.keptDist = smd->keptDist; //TODO: smd->keptDist is in global units.. must change to local + calc.keepDist = smd->keepDist; //TODO: smd->keepDist is in global units.. must change to local } @@ -256,9 +256,9 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) //Found the nearest vertex if(nearest.index != -1) { - //Adjusting the vertex weight, so that after interpolating it kepts a certain distance from the nearest position + //Adjusting the vertex weight, so that after interpolating it keeps a certain distance from the nearest position float dist = sasqrt(nearest.dist); - if(dist > FLT_EPSILON) weight *= (dist - calc->keptDist)/dist; + if(dist > FLT_EPSILON) weight *= (dist - calc->keepDist)/dist; //Convert the coordinates back to mesh coordinates VECCOPY(tmp_co, nearest.co); @@ -388,7 +388,7 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) //Build target tree - BENCH(bvhtree_from_mesh_faces(&treeData, calc->target, calc->keptDist, 4, 6)); + BENCH(bvhtree_from_mesh_faces(&treeData, calc->target, calc->keepDist, 4, 6)); if(treeData.tree == NULL) return OUT_OF_MEMORY(); //Build auxiliar target @@ -521,17 +521,17 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) //Found the nearest vertex if(nearest.index) { - if(calc->smd->shrinkOpts & MOD_SHRINKWRAP_KEPT_ABOVE_SURFACE) + if(calc->smd->shrinkOpts & MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE) { //Make the vertex stay on the front side of the face - VECADDFAC(tmp_co, nearest.co, nearest.no, calc->keptDist); + VECADDFAC(tmp_co, nearest.co, nearest.no, calc->keepDist); } else { - //Adjusting the vertex weight, so that after interpolating it kepts a certain distance from the nearest position + //Adjusting the vertex weight, so that after interpolating it keeps a certain distance from the nearest position float dist = sasqrt( nearest.dist ); if(dist > FLT_EPSILON) - VecLerpf(tmp_co, tmp_co, nearest.co, (dist - calc->keptDist)/dist); //linear interpolation + VecLerpf(tmp_co, tmp_co, nearest.co, (dist - calc->keepDist)/dist); //linear interpolation else VECCOPY( tmp_co, nearest.co ); } diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index c8db1164dc9..ac12a09c0ee 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -498,7 +498,7 @@ typedef struct ShrinkwrapModifierData { struct Object *target; /* shrink target */ struct Object *auxTarget; /* additional shrink target */ char vgroup_name[32]; /* optional vertexgroup name */ - float keptDist; /* distance offset from mesh/projection point */ + float keepDist; /* distance offset to keep from mesh/projection point */ short shrinkType; /* shrink type projection */ short shrinkOpts; /* shrink options */ char projAxis; /* axis to project over */ @@ -518,7 +518,7 @@ typedef struct ShrinkwrapModifierData { #define MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE (1<<3) /* ignore vertex moves if a vertex ends projected on a front face of the target */ #define MOD_SHRINKWRAP_CULL_TARGET_BACKFACE (1<<4) /* ignore vertex moves if a vertex ends projected on a back face of the target */ -#define MOD_SHRINKWRAP_KEPT_ABOVE_SURFACE (1<<5) /* distance is measure to the front face of the target */ +#define MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE (1<<5) /* distance is measure to the front face of the target */ #define MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS (1<<0) #define MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS (1<<1) diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 583532b6ec8..139943ae5ba 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -2545,7 +2545,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &smd->vgroup_name, 0, 31, 0, 0, "Vertex Group name"); uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob); - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Offset:", lx,(cy-=19),buttonWidth,19, &smd->keptDist, 0.0f, 100.0f, 1.0f, 0, "Specify distance to kept from the target"); + uiDefButF(block, NUM, B_MODIFIER_RECALC, "Offset:", lx,(cy-=19),buttonWidth,19, &smd->keepDist, 0.0f, 100.0f, 1.0f, 0, "Specify distance to keep from the target"); cy -= 3; uiDefButS(block, MENU, B_MODIFIER_RECALC, shrinktypemenu, lx,(cy-=19),buttonWidth,19, &smd->shrinkType, 0, 0, 0, 0, "Selects type of shrinkwrap algorithm for target position."); @@ -2570,7 +2570,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco uiDefIDPoinBut(block, modifier_testMeshObj, ID_OB, B_CHANGEDEP, "Ob2: ", lx, (cy-=19), buttonWidth,19, &smd->auxTarget, "Aditional mesh to project over"); } else if (smd->shrinkType == MOD_SHRINKWRAP_NEAREST_SURFACE){ - uiDefButBitS(block, TOG, MOD_SHRINKWRAP_KEPT_ABOVE_SURFACE, B_MODIFIER_RECALC, "Above surface", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Vertices are kept on the front side of faces"); + uiDefButBitS(block, TOG, MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE, B_MODIFIER_RECALC, "Above surface", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Vertices are kept on the front side of faces"); } uiBlockEndAlign(block); From 43bf03580ff857cde6e64becab446c1c3f016e83 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Wed, 13 Aug 2008 19:22:35 +0000 Subject: [PATCH 69/76] svn merge -r 15988:16077 https://svn.blender.org/svnroot/bf-blender/trunk/blender To have the 50% faster nearest_surface point. Changed mesh_faces_nearest_point to return the face normal instead of collision normal --- source/blender/blenkernel/intern/bvhutils.c | 458 ++++++--- source/blender/blenkernel/intern/shrinkwrap.c | 2 +- source/blender/blenkernel/intern/softbody.c | 937 +++++++++++++----- source/blender/python/api2_2x/Texture.c | 40 + source/blender/python/api2_2x/doc/Texture.py | 6 + source/blender/src/buttons_editing.c | 1 + source/gameengine/Expressions/Value.cpp | 28 +- .../GameLogic/SCA_PythonController.cpp | 31 +- 8 files changed, 1046 insertions(+), 457 deletions(-) diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c index 10e92b8b705..ae449843d2a 100644 --- a/source/blender/blenkernel/intern/bvhutils.c +++ b/source/blender/blenkernel/intern/bvhutils.c @@ -48,9 +48,6 @@ /* Math stuff for ray casting on mesh faces and for nearest surface */ -static float nearest_point_in_tri_surface(const float *point, const float *v0, const float *v1, const float *v2, float *nearest); - -#define ISECT_EPSILON 1e-6 static float ray_tri_intersection(const BVHTreeRay *ray, const float m_dist, const float *v0, const float *v1, const float *v2) { float dist; @@ -79,170 +76,324 @@ static float sphereray_tri_intersection(const BVHTreeRay *ray, float radius, con return FLT_MAX; } + /* - * This calculates the distance from point to the plane - * Distance is negative if point is on the back side of plane + * Function adapted from David Eberly's distance tools (LGPL) + * http://www.geometrictools.com/LibFoundation/Distance/Distance.html */ -static float point_plane_distance(const float *point, const float *plane_point, const float *plane_normal) +static float nearest_point_in_tri_surface(const float *v0,const float *v1,const float *v2,const float *p, int *v, int *e, float *nearest ) { - float pp[3]; - VECSUB(pp, point, plane_point); - return INPR(pp, plane_normal); -} -static float choose_nearest(const float v0[2], const float v1[2], const float point[2], float closest[2]) -{ - float d[2][2], sdist[2]; - VECSUB2D(d[0], v0, point); - VECSUB2D(d[1], v1, point); + float diff[3]; + float e0[3]; + float e1[3]; + float A00; + float A01; + float A11; + float B0; + float B1; + float C; + float Det; + float S; + float T; + float sqrDist; + int lv = -1, le = -1; + + VECSUB(diff, v0, p); + VECSUB(e0, v1, v0); + VECSUB(e1, v2, v0); + + A00 = INPR ( e0, e0 ); + A01 = INPR( e0, e1 ); + A11 = INPR ( e1, e1 ); + B0 = INPR( diff, e0 ); + B1 = INPR( diff, e1 ); + C = INPR( diff, diff ); + Det = fabs( A00 * A11 - A01 * A01 ); + S = A01 * B1 - A11 * B0; + T = A01 * B0 - A00 * B1; - sdist[0] = d[0][0]*d[0][0] + d[0][1]*d[0][1]; - sdist[1] = d[1][0]*d[1][0] + d[1][1]*d[1][1]; - - if(sdist[0] < sdist[1]) + if ( S + T <= Det ) { - if(closest) - VECCOPY2D(closest, v0); - return sdist[0]; + if ( S < 0.0f ) + { + if ( T < 0.0f ) // Region 4 + { + if ( B0 < 0.0f ) + { + T = 0.0f; + if ( -B0 >= A00 ) + { + S = (float)1.0; + sqrDist = A00 + 2.0f * B0 + C; + lv = 1; + } + else + { + if(fabs(A00) > FLT_EPSILON) + S = -B0/A00; + else + S = 0.0f; + sqrDist = B0 * S + C; + le = 0; + } + } + else + { + S = 0.0f; + if ( B1 >= 0.0f ) + { + T = 0.0f; + sqrDist = C; + lv = 0; + } + else if ( -B1 >= A11 ) + { + T = 1.0f; + sqrDist = A11 + 2.0f * B1 + C; + lv = 2; + } + else + { + if(fabs(A11) > FLT_EPSILON) + T = -B1 / A11; + else + T = 0.0f; + sqrDist = B1 * T + C; + le = 1; + } + } + } + else // Region 3 + { + S = 0.0f; + if ( B1 >= 0.0f ) + { + T = 0.0f; + sqrDist = C; + lv = 0; + } + else if ( -B1 >= A11 ) + { + T = 1.0f; + sqrDist = A11 + 2.0f * B1 + C; + lv = 2; + } + else + { + if(fabs(A11) > FLT_EPSILON) + T = -B1 / A11; + else + T = 0.0; + sqrDist = B1 * T + C; + le = 1; + } + } + } + else if ( T < 0.0f ) // Region 5 + { + T = 0.0f; + if ( B0 >= 0.0f ) + { + S = 0.0f; + sqrDist = C; + lv = 0; + } + else if ( -B0 >= A00 ) + { + S = 1.0f; + sqrDist = A00 + 2.0f * B0 + C; + lv = 1; + } + else + { + if(fabs(A00) > FLT_EPSILON) + S = -B0 / A00; + else + S = 0.0f; + sqrDist = B0 * S + C; + le = 0; + } + } + else // Region 0 + { + // Minimum at interior lv + float invDet; + if(fabs(Det) > FLT_EPSILON) + invDet = 1.0f / Det; + else + invDet = 0.0f; + S *= invDet; + T *= invDet; + sqrDist = S * ( A00 * S + A01 * T + 2.0f * B0) + + T * ( A01 * S + A11 * T + 2.0f * B1 ) + C; + } } else { - if(closest) - VECCOPY2D(closest, v1); - return sdist[1]; - } -} -/* - * calculates the closest point between point-tri (2D) - * returns that tri must be right-handed - * Returns square distance - */ -static float closest_point_in_tri2D(const float point[2], /*const*/ float tri[3][2], float closest[2]) -{ - float edge_di[2]; - float v_point[2]; - float proj[2]; //point projected over edge-dir, edge-normal (witouth normalized edge) - const float *v0 = tri[2], *v1; - float edge_slen, d; //edge squared length - int i; - const float *nearest_vertex = NULL; + float tmp0, tmp1, numer, denom; - - //for each edge - for(i=0, v0=tri[2], v1=tri[0]; i < 3; v0=tri[i++], v1=tri[i]) - { - VECSUB2D(edge_di, v1, v0); - VECSUB2D(v_point, point, v0); - - proj[1] = v_point[0]*edge_di[1] - v_point[1]*edge_di[0]; //dot product with edge normal - - //point inside this edge - if(proj[1] < 0) - continue; - - proj[0] = v_point[0]*edge_di[0] + v_point[1]*edge_di[1]; - - //closest to this edge is v0 - if(proj[0] < 0) + if ( S < 0.0f ) // Region 2 { - if(nearest_vertex == NULL || nearest_vertex == v0) - nearest_vertex = v0; + tmp0 = A01 + B0; + tmp1 = A11 + B1; + if ( tmp1 > tmp0 ) + { + numer = tmp1 - tmp0; + denom = A00 - 2.0f * A01 + A11; + if ( numer >= denom ) + { + S = 1.0f; + T = 0.0f; + sqrDist = A00 + 2.0f * B0 + C; + lv = 1; + } + else + { + if(fabs(denom) > FLT_EPSILON) + S = numer / denom; + else + S = 0.0f; + T = 1.0f - S; + sqrDist = S * ( A00 * S + A01 * T + 2.0f * B0 ) + + T * ( A01 * S + A11 * T + 2.0f * B1 ) + C; + le = 2; + } + } else { - //choose nearest - return choose_nearest(nearest_vertex, v0, point, closest); + S = 0.0f; + if ( tmp1 <= 0.0f ) + { + T = 1.0f; + sqrDist = A11 + 2.0f * B1 + C; + lv = 2; + } + else if ( B1 >= 0.0f ) + { + T = 0.0f; + sqrDist = C; + lv = 0; + } + else + { + if(fabs(A11) > FLT_EPSILON) + T = -B1 / A11; + else + T = 0.0f; + sqrDist = B1 * T + C; + le = 1; + } } - i++; //We can skip next edge - continue; } - - edge_slen = edge_di[0]*edge_di[0] + edge_di[1]*edge_di[1]; //squared edge len - //closest to this edge is v1 - if(proj[0] > edge_slen) + else if ( T < 0.0f ) // Region 6 { - if(nearest_vertex == NULL || nearest_vertex == v1) - nearest_vertex = v1; + tmp0 = A01 + B1; + tmp1 = A00 + B0; + if ( tmp1 > tmp0 ) + { + numer = tmp1 - tmp0; + denom = A00 - 2.0f * A01 + A11; + if ( numer >= denom ) + { + T = 1.0f; + S = 0.0f; + sqrDist = A11 + 2.0f * B1 + C; + lv = 2; + } + else + { + if(fabs(denom) > FLT_EPSILON) + T = numer / denom; + else + T = 0.0f; + S = 1.0f - T; + sqrDist = S * ( A00 * S + A01 * T + 2.0f * B0 ) + + T * ( A01 * S + A11 * T + 2.0f * B1 ) + C; + le = 2; + } + } else { - return choose_nearest(nearest_vertex, v1, point, closest); + T = 0.0f; + if ( tmp1 <= 0.0f ) + { + S = 1.0f; + sqrDist = A00 + 2.0f * B0 + C; + lv = 1; + } + else if ( B0 >= 0.0f ) + { + S = 0.0f; + sqrDist = C; + lv = 0; + } + else + { + if(fabs(A00) > FLT_EPSILON) + S = -B0 / A00; + else + S = 0.0f; + sqrDist = B0 * S + C; + le = 0; + } + } + } + else // Region 1 + { + numer = A11 + B1 - A01 - B0; + if ( numer <= 0.0f ) + { + S = 0.0f; + T = 1.0f; + sqrDist = A11 + 2.0f * B1 + C; + lv = 2; + } + else + { + denom = A00 - 2.0f * A01 + A11; + if ( numer >= denom ) + { + S = 1.0f; + T = 0.0f; + sqrDist = A00 + 2.0f * B0 + C; + lv = 1; + } + else + { + if(fabs(denom) > FLT_EPSILON) + S = numer / denom; + else + S = 0.0f; + T = 1.0f - S; + sqrDist = S * ( A00 * S + A01 * T + 2.0f * B0 ) + + T * ( A01 * S + A11 * T + 2.0f * B1 ) + C; + le = 2; + } } - continue; } - - //nearest is on this edge - d= proj[1] / edge_slen; - closest[0] = point[0] - edge_di[1] * d; - closest[1] = point[1] + edge_di[0] * d; - - return proj[1]*proj[1]/edge_slen; } - if(nearest_vertex) + // Account for numerical round-off error + if ( sqrDist < FLT_EPSILON ) + sqrDist = 0.0f; + { - VECSUB2D(v_point, nearest_vertex, point); - VECCOPY2D(closest, nearest_vertex); - return v_point[0]*v_point[0] + v_point[1]*v_point[1]; + float w[3], x[3], y[3], z[3]; + VECCOPY(w, v0); + VECCOPY(x, e0); + VecMulf(x, S); + VECCOPY(y, e1); + VecMulf(y, T); + VECADD(z, w, x); + VECADD(z, z, y); + //VECSUB(d, p, z); + VECCOPY(nearest, z); + // d = p - ( v0 + S * e0 + T * e1 ); } - else - { - VECCOPY(closest, point); //point is already inside - return 0.0f; - } -} + *v = lv; + *e = le; -/* - * Returns the square of the minimum distance between the point and a triangle surface - * If nearest is not NULL the nearest surface point is written on it - */ -static float nearest_point_in_tri_surface(const float *point, const float *v0, const float *v1, const float *v2, float *nearest) -{ - //Lets solve the 2D problem (closest point-tri) - float normal_dist, plane_sdist, plane_offset; - float du[3], dv[3], dw[3]; //orthogonal axis (du=(v0->v1), dw=plane normal) - - float p_2d[2], tri_2d[3][2], nearest_2d[2]; - - CalcNormFloat((float*)v0, (float*)v1, (float*)v2, dw); - - //point-plane distance and calculate axis - normal_dist = point_plane_distance(point, v0, dw); - - // OPTIMIZATION - // if we are only interested in nearest distance if its closer than some distance already found - // we can: - // if(normal_dist*normal_dist >= best_dist_so_far) return FLOAT_MAX; - // - - VECSUB(du, v1, v0); - Normalize(du); - Crossf(dv, dw, du); - plane_offset = INPR(v0, dw); - - //project stuff to 2d - tri_2d[0][0] = INPR(du, v0); - tri_2d[0][1] = INPR(dv, v0); - - tri_2d[1][0] = INPR(du, v1); - tri_2d[1][1] = INPR(dv, v1); - - tri_2d[2][0] = INPR(du, v2); - tri_2d[2][1] = INPR(dv, v2); - - p_2d[0] = INPR(du, point); - p_2d[1] = INPR(dv, point); - - //we always have a right-handed tri - //this should always happen because of the way normal is calculated - plane_sdist = closest_point_in_tri2D(p_2d, tri_2d, nearest_2d); - - //project back to 3d - if(nearest) - { - nearest[0] = du[0]*nearest_2d[0] + dv[0] * nearest_2d[1] + dw[0] * plane_offset; - nearest[1] = du[1]*nearest_2d[0] + dv[1] * nearest_2d[1] + dw[1] * plane_offset; - nearest[2] = du[2]*nearest_2d[0] + dv[2] * nearest_2d[1] + dw[2] * plane_offset; - } - - return plane_sdist + normal_dist*normal_dist; + return sqrDist; } @@ -268,22 +419,15 @@ static void mesh_faces_nearest_point(void *userdata, int index, const float *co, do { float nearest_tmp[3], dist; - float vec[3][3]; + int vertex, edge; - // only insert valid triangles / quads with area > 0 - VECSUB(vec[0], t2, t1); - VECSUB(vec[1], t0, t1); - Crossf(vec[2], vec[0], vec[1]); - if(INPR(vec[2], vec[2]) >= FLT_EPSILON) + dist = nearest_point_in_tri_surface(t0, t1, t2, co, &vertex, &edge, nearest_tmp); + if(dist < nearest->dist) { - dist = nearest_point_in_tri_surface(co,t0, t1, t2, nearest_tmp); - if(dist < nearest->dist) - { - nearest->index = index; - nearest->dist = dist; - VECCOPY(nearest->co, nearest_tmp); - CalcNormFloat((float*)t0, (float*)t1, (float*)t2, nearest->no); //TODO.. (interpolate normals from the vertexs coordinates? - } + nearest->index = index; + nearest->dist = dist; + VECCOPY(nearest->co, nearest_tmp); + CalcNormFloat(t0, t1, t2, nearest->no); } t1 = t2; diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 1c4d5e323ee..d8535e10be5 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -405,7 +405,7 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) //Now, everything is ready to project the vertexs! -//#pragma omp parallel for private(i,hit) schedule(static) +#pragma omp parallel for private(i,hit) schedule(static) for(i = 0; inumVerts; ++i) { float *co = calc->vertexCos[i]; diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index d5b5ab6d63e..d465c058d30 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -69,6 +69,8 @@ variables on the UI for now #include "BLI_blenlib.h" #include "BLI_arithb.h" #include "BLI_ghash.h" +#include "BLI_threads.h" + #include "BKE_curve.h" #include "BKE_effect.h" #include "BKE_global.h" @@ -118,6 +120,20 @@ typedef struct SBScratch { float aabbmin[3],aabbmax[3]; }SBScratch; +typedef struct SB_thread_context{ + Object *ob; + float forcetime; + float timenow; + int ifirst; + int ilast; + ListBase *do_effector; + int do_deflector; + float fieldfactor; + float windfactor; + int nr; + int tot; +}SB_thread_context; + #define NLF_BUILD 1 #define NLF_SOLVE 2 @@ -1514,17 +1530,15 @@ int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],float *damp -void scan_for_ext_spring_forces(Object *ob,float timenow) +void _scan_for_ext_spring_forces(Object *ob,float timenow,int ifirst,int ilast, struct ListBase *do_effector) { SoftBody *sb = ob->soft; - ListBase *do_effector; int a; float damp; float feedback[3]; - do_effector= pdInitEffectors(ob,NULL); if (sb && sb->totspring){ - for(a=0; atotspring; a++) { + for(a=ifirst; abspring[a]; bs->ext_force[0]=bs->ext_force[1]=bs->ext_force[2]=0.0f; feedback[0]=feedback[1]=feedback[2]=0.0f; @@ -1584,9 +1598,88 @@ void scan_for_ext_spring_forces(Object *ob,float timenow) } } } - if(do_effector) - pdEndEffectors(do_effector); } + + +void scan_for_ext_spring_forces(Object *ob,float timenow) +{ + SoftBody *sb = ob->soft; + ListBase *do_effector= NULL; + do_effector= pdInitEffectors(ob,NULL); + if (sb){ + _scan_for_ext_spring_forces(ob,timenow,0,sb->totspring,do_effector); + } + if(do_effector) + pdEndEffectors(do_effector); +} + +void *exec_scan_for_ext_spring_forces(void *data) +{ + SB_thread_context *pctx = (SB_thread_context*)data; + _scan_for_ext_spring_forces(pctx->ob,pctx->timenow,pctx->ifirst,pctx->ilast,pctx->do_effector); + return 0; +} + +void sb_sfesf_threads_run(struct Object *ob, float timenow,int totsprings,int *ptr_to_break_func()) +{ + ListBase *do_effector = NULL; + ListBase threads; + SB_thread_context *sb_threads; + int i, totthread,left,dec; + int lowsprings =10; /* wild guess .. may increase with better thread management 'above' or even be UI option sb->spawn_cf_threads_nopts */ + + do_effector= pdInitEffectors(ob,NULL); + + /* figure the number of threads while preventing pretty pointless threading overhead */ + if(totsprings < lowsprings) {totthread=1;} + else{ + if(G.scene->r.mode & R_FIXED_THREADS) + totthread= G.scene->r.threads; + else + totthread= BLI_system_thread_count(); + } + /*left to do--> what if we got zillions of CPUs running but 'totsprings' tasks to spread*/ + + sb_threads= MEM_callocN(sizeof(SB_thread_context)*totthread, "SBSpringsThread"); + memset(sb_threads, 0, sizeof(SB_thread_context)*totthread); + left = totsprings; + dec = totsprings/totthread +1; + for(i=0; i0){ + sb_threads[i].ifirst = left; + } + else + sb_threads[i].ifirst = 0; + sb_threads[i].do_effector = do_effector; + sb_threads[i].do_deflector = 0;// not used here + sb_threads[i].fieldfactor = 0.0f;// not used here + sb_threads[i].windfactor = 0.0f;// not used here + sb_threads[i].nr= i; + sb_threads[i].tot= totthread; + } + if(totthread > 1) { + BLI_init_threads(&threads, exec_scan_for_ext_spring_forces, totthread); + + for(i=0; isoft; /* is supposed to be there */ + BodyPoint *bp; + /* intitialize */ + if (sb) { + /* check conditions for various options */ + /* +++ could be done on object level to squeeze out the last bits of it */ + do_selfcollision=((ob->softflag & OB_SB_EDGES) && (sb->bspring)&& (ob->softflag & OB_SB_SELF)); + do_springcollision=do_deflector && (ob->softflag & OB_SB_EDGES) &&(ob->softflag & OB_SB_EDGECOLL); + do_aero=((sb->aeroedge)&& (ob->softflag & OB_SB_EDGES)); + /* --- could be done on object level to squeeze out the last bits of it */ + } + else { + printf("Error expected a SB here \n"); + return (999); + } + +/* debugerin */ + if (sb->totpoint < ifirst) { + printf("Aye 998"); + return (998); + } +/* debugerin */ + + + bp = &sb->bpoint[ifirst]; + for(bb=number_of_points_here; bb>0; bb--, bp++) { + /* clear forces accumulator */ + bp->force[0]= bp->force[1]= bp->force[2]= 0.0; + /* naive ball self collision */ + /* needs to be done if goal snaps or not */ + if(do_selfcollision){ + int attached; + BodyPoint *obp; + BodySpring *bs; + int c,b; + float velcenter[3],dvel[3],def[3]; + float distance; + float compare; + float bstune = sb->ballstiff; + + for(c=sb->totpoint, obp= sb->bpoint; c>=ifirst+bb; c--, obp++) { + compare = (obp->colball + bp->colball); + VecSubf(def, bp->pos, obp->pos); + /* rather check the AABBoxes before ever calulating the real distance */ + /* mathematically it is completly nuts, but performace is pretty much (3) times faster */ + if ((ABS(def[0]) > compare) || (ABS(def[1]) > compare) || (ABS(def[2]) > compare)) continue; + distance = Normalize(def); + if (distance < compare ){ + /* exclude body points attached with a spring */ + attached = 0; + for(b=obp->nofsprings;b>0;b--){ + bs = sb->bspring + obp->springs[b-1]; + if (( ilast-bb == bs->v2) || ( ilast-bb == bs->v1)){ + attached=1; + continue;} + } + if (!attached){ + float f = bstune/(distance) + bstune/(compare*compare)*distance - 2.0f*bstune/compare ; + + VecMidf(velcenter, bp->vec, obp->vec); + VecSubf(dvel,velcenter,bp->vec); + VecMulf(dvel,sb->nodemass); + + Vec3PlusStVec(bp->force,f*(1.0f-sb->balldamp),def); + Vec3PlusStVec(bp->force,sb->balldamp,dvel); + + /* exploit force(a,b) == -force(b,a) part2/2 */ + VecSubf(dvel,velcenter,obp->vec); + VecMulf(dvel,sb->nodemass); + + Vec3PlusStVec(obp->force,sb->balldamp,dvel); + Vec3PlusStVec(obp->force,-f*(1.0f-sb->balldamp),def); + } + } + } + } + /* naive ball self collision done */ + + if(bp->goal < SOFTGOALSNAP){ /* ommit this bp when it snaps */ + float auxvect[3]; + float velgoal[3]; + + /* do goal stuff */ + if(ob->softflag & OB_SB_GOAL) { + /* true elastic goal */ + float ks,kd; + VecSubf(auxvect,bp->pos,bp->origT); + ks = 1.0f/(1.0f- bp->goal*sb->goalspring)-1.0f ; + bp->force[0]+= -ks*(auxvect[0]); + bp->force[1]+= -ks*(auxvect[1]); + bp->force[2]+= -ks*(auxvect[2]); + + /* calulate damping forces generated by goals*/ + VecSubf(velgoal,bp->origS, bp->origE); + kd = sb->goalfrict * sb_fric_force_scale(ob) ; + VecAddf(auxvect,velgoal,bp->vec); + + if (forcetime > 0.0 ) { /* make sure friction does not become rocket motor on time reversal */ + bp->force[0]-= kd * (auxvect[0]); + bp->force[1]-= kd * (auxvect[1]); + bp->force[2]-= kd * (auxvect[2]); + } + else { + bp->force[0]-= kd * (velgoal[0] - bp->vec[0]); + bp->force[1]-= kd * (velgoal[1] - bp->vec[1]); + bp->force[2]-= kd * (velgoal[2] - bp->vec[2]); + } + } + /* done goal stuff */ + + /* gravitation */ + if (sb){ + float gravity = sb->grav * sb_grav_force_scale(ob); + bp->force[2]-= gravity*sb->nodemass; /* individual mass of node here */ + } + + /* particle field & vortex */ + if(do_effector) { + float kd; + float force[3]= {0.0f, 0.0f, 0.0f}; + float speed[3]= {0.0f, 0.0f, 0.0f}; + float eval_sb_fric_force_scale = sb_fric_force_scale(ob); /* just for calling function once */ + + pdDoEffectors(do_effector, bp->pos, force, speed, (float)G.scene->r.cfra, 0.0f, PE_WIND_AS_SPEED); + + /* apply forcefield*/ + VecMulf(force,fieldfactor* eval_sb_fric_force_scale); + VECADD(bp->force, bp->force, force); + + /* BP friction in moving media */ + kd= sb->mediafrict* eval_sb_fric_force_scale; + bp->force[0] -= kd * (bp->vec[0] + windfactor*speed[0]/eval_sb_fric_force_scale); + bp->force[1] -= kd * (bp->vec[1] + windfactor*speed[1]/eval_sb_fric_force_scale); + bp->force[2] -= kd * (bp->vec[2] + windfactor*speed[2]/eval_sb_fric_force_scale); + /* now we'll have nice centrifugal effect for vortex */ + + } + else { + /* BP friction in media (not) moving*/ + float kd = sb->mediafrict* sb_fric_force_scale(ob); + /* assume it to be proportional to actual velocity */ + bp->force[0]-= bp->vec[0]*kd; + bp->force[1]-= bp->vec[1]*kd; + bp->force[2]-= bp->vec[2]*kd; + /* friction in media done */ + } + /* +++cached collision targets */ + bp->choke = 0.0f; + bp->choke2 = 0.0f; + bp->flag &= ~SBF_DOFUZZY; + if(do_deflector) { + float cfforce[3],defforce[3] ={0.0f,0.0f,0.0f}, vel[3] = {0.0f,0.0f,0.0f}, facenormal[3], cf = 1.0f,intrusion; + float kd = 1.0f; + + if (sb_deflect_face(ob,bp->pos,facenormal,defforce,&cf,timenow,vel,&intrusion)){ + + VECSUB(cfforce,bp->vec,vel); + Vec3PlusStVec(bp->force,-cf*50.0f,cfforce); + + Vec3PlusStVec(bp->force,kd,defforce); + } + + } + /* ---cached collision targets */ + + /* +++springs */ + iks = 1.0f/(1.0f-sb->inspring)-1.0f ;/* inner spring constants function */ + if(ob->softflag & OB_SB_EDGES) { + if (sb->bspring){ /* spring list exists at all ? */ + int b; + BodySpring *bs; + for(b=bp->nofsprings;b>0;b--){ + bs = sb->bspring + bp->springs[b-1]; + if (do_springcollision || do_aero){ + VecAddf(bp->force,bp->force,bs->ext_force); + if (bs->flag & BSF_INTERSECT) + bp->choke = bs->cf; + + } + // sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float forcetime,int nl_flags) + sb_spring_force(ob,ilast-bb,bs,iks,forcetime,0); + }/* loop springs */ + }/* existing spring list */ + }/*any edges*/ + /* ---springs */ + }/*omit on snap */ + }/*loop all bp's*/ +return 0; /*done fine*/ +} + +void *exec_softbody_calc_forces(void *data) +{ + SB_thread_context *pctx = (SB_thread_context*)data; + _softbody_calc_forces_slice_in_a_thread(pctx->ob,pctx->forcetime,pctx->timenow,pctx->ifirst,pctx->ilast,NULL,pctx->do_effector,pctx->do_deflector,pctx->fieldfactor,pctx->windfactor); + return 0; +} + +void sb_cf_threads_run(struct Object *ob, float forcetime, float timenow,int totpoint,int *ptr_to_break_func(),struct ListBase *do_effector,int do_deflector,float fieldfactor, float windfactor) +{ + ListBase threads; + SB_thread_context *sb_threads; + int i, totthread,left,dec; + int lowpoints =10; /* wild guess .. may increase with better thread management 'above' or even be UI option sb->spawn_cf_threads_nopts */ + + /* figure the number of threads while preventing pretty pointless threading overhead */ + if(totpoint < lowpoints) {totthread=1;} + else{ + if(G.scene->r.mode & R_FIXED_THREADS) + totthread= G.scene->r.threads; + else + totthread= BLI_system_thread_count(); + } + /*left to do--> what if we got zillions of CPUs running but 'totpoint' tasks to spread*/ + + sb_threads= MEM_callocN(sizeof(SB_thread_context)*totthread, "SBThread"); + memset(sb_threads, 0, sizeof(SB_thread_context)*totthread); + left = totpoint; + dec = totpoint/totthread +1; + for(i=0; i0){ + sb_threads[i].ifirst = left; + } + else + sb_threads[i].ifirst = 0; + sb_threads[i].do_effector = do_effector; + sb_threads[i].do_deflector = do_deflector; + sb_threads[i].fieldfactor = fieldfactor; + sb_threads[i].windfactor = windfactor; + sb_threads[i].nr= i; + sb_threads[i].tot= totthread; + } + + + if(totthread > 1) { + BLI_init_threads(&threads, exec_softbody_calc_forces, totthread); + + for(i=0; ivec bp->pos in here ! * this will ruin adaptive stepsize AKA heun! (BM) */ SoftBody *sb= ob->soft; /* is supposed to be there */ - BodyPoint *bp; BodyPoint *bproot; - BodySpring *bs; ListBase *do_effector; - float iks, ks, kd, gravity; + float iks, gravity; float fieldfactor = 1000.0f, windfactor = 250.0f; - float tune = sb->ballstiff; - int a, b, do_deflector,do_selfcollision,do_springcollision,do_aero; - - -/* jacobian - NLboolean success; - - if(nl_flags){ - nlBegin(NL_SYSTEM); - nlBegin(NL_MATRIX); - } -*/ - + int do_deflector,do_selfcollision,do_springcollision,do_aero; gravity = sb->grav * sb_grav_force_scale(ob); @@ -2060,7 +2399,9 @@ static void softbody_calc_forces(Object *ob, float forcetime, float timenow, int iks = 1.0f/(1.0f-sb->inspring)-1.0f ;/* inner spring constants function */ bproot= sb->bpoint; /* need this for proper spring addressing */ - if (do_springcollision || do_aero) scan_for_ext_spring_forces(ob,timenow); + if (do_springcollision || do_aero) + sb_sfesf_threads_run(ob,timenow,sb->totspring,NULL); + /* after spring scan because it uses Effoctors too */ do_effector= pdInitEffectors(ob,NULL); @@ -2069,34 +2410,102 @@ static void softbody_calc_forces(Object *ob, float forcetime, float timenow, int do_deflector = sb_detect_aabb_collisionCached(defforce,ob->lay,ob,timenow); } - for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { - /* clear forces accumulator */ - bp->force[0]= bp->force[1]= bp->force[2]= 0.0; - if(nl_flags & NLF_BUILD){ - //int ia =3*(sb->totpoint-a); - //int op =3*sb->totpoint; - /* dF/dV = v */ - /* jacobioan - nlMatrixAdd(op+ia,ia,-forcetime); - nlMatrixAdd(op+ia+1,ia+1,-forcetime); - nlMatrixAdd(op+ia+2,ia+2,-forcetime); - - nlMatrixAdd(ia,ia,1); - nlMatrixAdd(ia+1,ia+1,1); - nlMatrixAdd(ia+2,ia+2,1); + sb_cf_threads_run(ob,forcetime,timenow,sb->totpoint,NULL,do_effector,do_deflector,fieldfactor,windfactor); - nlMatrixAdd(op+ia,op+ia,1); - nlMatrixAdd(op+ia+1,op+ia+1,1); - nlMatrixAdd(op+ia+2,op+ia+2,1); - */ + /* finally add forces caused by face collision */ + if (ob->softflag & OB_SB_FACECOLL) scan_for_ext_face_forces(ob,timenow); + + /* finish matrix and solve */ + if(do_effector) pdEndEffectors(do_effector); +} + + +static void softbody_calc_forces(Object *ob, float forcetime, float timenow, int nl_flags) +{ + /* redirection to the new threaded Version */ + if (G.rt !=16){ + softbody_calc_forcesEx(ob, forcetime, timenow, nl_flags); + return; + } + else{ + /* so the following will die */ + /* |||||||||||||||||||||||||| */ + /* VVVVVVVVVVVVVVVVVVVVVVVVVV */ + + /* rule we never alter free variables :bp->vec bp->pos in here ! + * this will ruin adaptive stepsize AKA heun! (BM) + */ + SoftBody *sb= ob->soft; /* is supposed to be there */ + BodyPoint *bp; + BodyPoint *bproot; + BodySpring *bs; + ListBase *do_effector; + float iks, ks, kd, gravity; + float fieldfactor = 1000.0f, windfactor = 250.0f; + float tune = sb->ballstiff; + int a, b, do_deflector,do_selfcollision,do_springcollision,do_aero; + + + /* jacobian + NLboolean success; + + if(nl_flags){ + nlBegin(NL_SYSTEM); + nlBegin(NL_MATRIX); + } + */ + + + gravity = sb->grav * sb_grav_force_scale(ob); + + /* check conditions for various options */ + do_deflector= query_external_colliders(ob); + do_selfcollision=((ob->softflag & OB_SB_EDGES) && (sb->bspring)&& (ob->softflag & OB_SB_SELF)); + do_springcollision=do_deflector && (ob->softflag & OB_SB_EDGES) &&(ob->softflag & OB_SB_EDGECOLL); + do_aero=((sb->aeroedge)&& (ob->softflag & OB_SB_EDGES)); + + iks = 1.0f/(1.0f-sb->inspring)-1.0f ;/* inner spring constants function */ + bproot= sb->bpoint; /* need this for proper spring addressing */ + + if (do_springcollision || do_aero) scan_for_ext_spring_forces(ob,timenow); + /* after spring scan because it uses Effoctors too */ + do_effector= pdInitEffectors(ob,NULL); + + if (do_deflector) { + float defforce[3]; + do_deflector = sb_detect_aabb_collisionCached(defforce,ob->lay,ob,timenow); } - /* naive ball self collision */ - /* needs to be done if goal snaps or not */ - if(do_selfcollision){ - int attached; + for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { + /* clear forces accumulator */ + bp->force[0]= bp->force[1]= bp->force[2]= 0.0; + if(nl_flags & NLF_BUILD){ + //int ia =3*(sb->totpoint-a); + //int op =3*sb->totpoint; + /* dF/dV = v */ + /* jacobioan + nlMatrixAdd(op+ia,ia,-forcetime); + nlMatrixAdd(op+ia+1,ia+1,-forcetime); + nlMatrixAdd(op+ia+2,ia+2,-forcetime); + + nlMatrixAdd(ia,ia,1); + nlMatrixAdd(ia+1,ia+1,1); + nlMatrixAdd(ia+2,ia+2,1); + + nlMatrixAdd(op+ia,op+ia,1); + nlMatrixAdd(op+ia+1,op+ia+1,1); + nlMatrixAdd(op+ia+2,op+ia+2,1); + */ + + + } + + /* naive ball self collision */ + /* needs to be done if goal snaps or not */ + if(do_selfcollision){ + int attached; BodyPoint *obp; int c,b; float velcenter[3],dvel[3],def[3]; @@ -2104,7 +2513,7 @@ static void softbody_calc_forces(Object *ob, float forcetime, float timenow, int float compare; for(c=sb->totpoint, obp= sb->bpoint; c>=a; c--, obp++) { - + //if ((bp->octantflag & obp->octantflag) == 0) continue; compare = (obp->colball + bp->colball); @@ -2114,7 +2523,7 @@ static void softbody_calc_forces(Object *ob, float forcetime, float timenow, int /* mathematically it is completly nuts, but performace is pretty much (3) times faster */ if ((ABS(def[0]) > compare) || (ABS(def[1]) > compare) || (ABS(def[2]) > compare)) continue; - distance = Normalize(def); + distance = Normalize(def); if (distance < compare ){ /* exclude body points attached with a spring */ attached = 0; @@ -2146,8 +2555,8 @@ static void softbody_calc_forces(Object *ob, float forcetime, float timenow, int /* exploit force(a,b) == -force(b,a) part1/2 */ //dfdx_goal(ic,ic,op,mpos); //dfdv_goal(ic,ic,mvel); - - + + /*TODO sit down an X-out the true jacobian entries*/ /*well does not make to much sense because the eigenvalues of the jacobian go negative; and negative eigenvalues @@ -2169,236 +2578,239 @@ static void softbody_calc_forces(Object *ob, float forcetime, float timenow, int } } } - } - /* naive ball self collision done */ + } + /* naive ball self collision done */ - if(bp->goal < SOFTGOALSNAP){ /* ommit this bp when it snaps */ - float auxvect[3]; - float velgoal[3]; + if(bp->goal < SOFTGOALSNAP){ /* ommit this bp when it snaps */ + float auxvect[3]; + float velgoal[3]; - /* do goal stuff */ - if(ob->softflag & OB_SB_GOAL) { - /* true elastic goal */ - VecSubf(auxvect,bp->pos,bp->origT); - ks = 1.0f/(1.0f- bp->goal*sb->goalspring)-1.0f ; - bp->force[0]+= -ks*(auxvect[0]); - bp->force[1]+= -ks*(auxvect[1]); - bp->force[2]+= -ks*(auxvect[2]); + /* do goal stuff */ + if(ob->softflag & OB_SB_GOAL) { + /* true elastic goal */ + VecSubf(auxvect,bp->pos,bp->origT); + ks = 1.0f/(1.0f- bp->goal*sb->goalspring)-1.0f ; + bp->force[0]+= -ks*(auxvect[0]); + bp->force[1]+= -ks*(auxvect[1]); + bp->force[2]+= -ks*(auxvect[2]); - if(nl_flags & NLF_BUILD){ - //int ia =3*(sb->totpoint-a); - //int op =3*(sb->totpoint); - /* depending on my pos */ - //dfdx_goal(ia,ia,op,ks*forcetime); - } - - - /* calulate damping forces generated by goals*/ - VecSubf(velgoal,bp->origS, bp->origE); - kd = sb->goalfrict * sb_fric_force_scale(ob) ; - VecAddf(auxvect,velgoal,bp->vec); - - if (forcetime > 0.0 ) { /* make sure friction does not become rocket motor on time reversal */ - bp->force[0]-= kd * (auxvect[0]); - bp->force[1]-= kd * (auxvect[1]); - bp->force[2]-= kd * (auxvect[2]); if(nl_flags & NLF_BUILD){ //int ia =3*(sb->totpoint-a); - Normalize(auxvect); - /* depending on my vel */ - //dfdv_goal(ia,ia,kd*forcetime); + //int op =3*(sb->totpoint); + /* depending on my pos */ + //dfdx_goal(ia,ia,op,ks*forcetime); } + + /* calulate damping forces generated by goals*/ + VecSubf(velgoal,bp->origS, bp->origE); + kd = sb->goalfrict * sb_fric_force_scale(ob) ; + VecAddf(auxvect,velgoal,bp->vec); + + if (forcetime > 0.0 ) { /* make sure friction does not become rocket motor on time reversal */ + bp->force[0]-= kd * (auxvect[0]); + bp->force[1]-= kd * (auxvect[1]); + bp->force[2]-= kd * (auxvect[2]); + if(nl_flags & NLF_BUILD){ + //int ia =3*(sb->totpoint-a); + Normalize(auxvect); + /* depending on my vel */ + //dfdv_goal(ia,ia,kd*forcetime); + } + + } + else { + bp->force[0]-= kd * (velgoal[0] - bp->vec[0]); + bp->force[1]-= kd * (velgoal[1] - bp->vec[1]); + bp->force[2]-= kd * (velgoal[2] - bp->vec[2]); + } + } + /* done goal stuff */ + + + /* gravitation */ + bp->force[2]-= gravity*sb->nodemass; /* individual mass of node here */ + //bp->force[1]-= gravity*sb->nodemass; /* individual mass of node here */ + + + /* particle field & vortex */ + if(do_effector) { + float force[3]= {0.0f, 0.0f, 0.0f}; + float speed[3]= {0.0f, 0.0f, 0.0f}; + float eval_sb_fric_force_scale = sb_fric_force_scale(ob); /* just for calling function once */ + + pdDoEffectors(do_effector, bp->pos, force, speed, (float)G.scene->r.cfra, 0.0f, PE_WIND_AS_SPEED); + + /* apply forcefield*/ + VecMulf(force,fieldfactor* eval_sb_fric_force_scale); + VECADD(bp->force, bp->force, force); + + /* BP friction in moving media */ + kd= sb->mediafrict* eval_sb_fric_force_scale; + bp->force[0] -= kd * (bp->vec[0] + windfactor*speed[0]/eval_sb_fric_force_scale); + bp->force[1] -= kd * (bp->vec[1] + windfactor*speed[1]/eval_sb_fric_force_scale); + bp->force[2] -= kd * (bp->vec[2] + windfactor*speed[2]/eval_sb_fric_force_scale); + /* now we'll have nice centrifugal effect for vortex */ + } else { - bp->force[0]-= kd * (velgoal[0] - bp->vec[0]); - bp->force[1]-= kd * (velgoal[1] - bp->vec[1]); - bp->force[2]-= kd * (velgoal[2] - bp->vec[2]); - } - } - /* done goal stuff */ - - - /* gravitation */ - bp->force[2]-= gravity*sb->nodemass; /* individual mass of node here */ - //bp->force[1]-= gravity*sb->nodemass; /* individual mass of node here */ + /* BP friction in media (not) moving*/ + kd= sb->mediafrict* sb_fric_force_scale(ob); + /* assume it to be proportional to actual velocity */ + bp->force[0]-= bp->vec[0]*kd; + bp->force[1]-= bp->vec[1]*kd; + bp->force[2]-= bp->vec[2]*kd; + /* friction in media done */ + if(nl_flags & NLF_BUILD){ + //int ia =3*(sb->totpoint-a); + /* da/dv = */ - - /* particle field & vortex */ - if(do_effector) { - float force[3]= {0.0f, 0.0f, 0.0f}; - float speed[3]= {0.0f, 0.0f, 0.0f}; - float eval_sb_fric_force_scale = sb_fric_force_scale(ob); /* just for calling function once */ - - pdDoEffectors(do_effector, bp->pos, force, speed, (float)G.scene->r.cfra, 0.0f, PE_WIND_AS_SPEED); - - /* apply forcefield*/ - VecMulf(force,fieldfactor* eval_sb_fric_force_scale); - VECADD(bp->force, bp->force, force); - - /* BP friction in moving media */ - kd= sb->mediafrict* eval_sb_fric_force_scale; - bp->force[0] -= kd * (bp->vec[0] + windfactor*speed[0]/eval_sb_fric_force_scale); - bp->force[1] -= kd * (bp->vec[1] + windfactor*speed[1]/eval_sb_fric_force_scale); - bp->force[2] -= kd * (bp->vec[2] + windfactor*speed[2]/eval_sb_fric_force_scale); - /* now we'll have nice centrifugal effect for vortex */ - - } - else { - /* BP friction in media (not) moving*/ - kd= sb->mediafrict* sb_fric_force_scale(ob); - /* assume it to be proportional to actual velocity */ - bp->force[0]-= bp->vec[0]*kd; - bp->force[1]-= bp->vec[1]*kd; - bp->force[2]-= bp->vec[2]*kd; - /* friction in media done */ - if(nl_flags & NLF_BUILD){ - //int ia =3*(sb->totpoint-a); - /* da/dv = */ - -// nlMatrixAdd(ia,ia,forcetime*kd); -// nlMatrixAdd(ia+1,ia+1,forcetime*kd); -// nlMatrixAdd(ia+2,ia+2,forcetime*kd); - } - - } - /* +++cached collision targets */ - bp->choke = 0.0f; - bp->choke2 = 0.0f; - bp->flag &= ~SBF_DOFUZZY; - if(do_deflector) { - float cfforce[3],defforce[3] ={0.0f,0.0f,0.0f}, vel[3] = {0.0f,0.0f,0.0f}, facenormal[3], cf = 1.0f,intrusion; - kd = 1.0f; - - if (sb_deflect_face(ob,bp->pos,facenormal,defforce,&cf,timenow,vel,&intrusion)){ - if ((!nl_flags)&&(intrusion < 0.0f)){ - /*bjornmose: uugh.. what an evil hack - violation of the 'don't touch bp->pos in here' rule - but works nice, like this--> - we predict the solution beeing out of the collider - in heun step No1 and leave the heun step No2 adapt to it - so we kind of introduced a implicit solver for this case - */ - Vec3PlusStVec(bp->pos,-intrusion,facenormal); - - sb->scratch->flag |= SBF_DOFUZZY; - bp->flag |= SBF_DOFUZZY; - bp->choke = sb->choke*0.01f; + // nlMatrixAdd(ia,ia,forcetime*kd); + // nlMatrixAdd(ia+1,ia+1,forcetime*kd); + // nlMatrixAdd(ia+2,ia+2,forcetime*kd); } - else{ + + } + /* +++cached collision targets */ + bp->choke = 0.0f; + bp->choke2 = 0.0f; + bp->flag &= ~SBF_DOFUZZY; + if(do_deflector) { + float cfforce[3],defforce[3] ={0.0f,0.0f,0.0f}, vel[3] = {0.0f,0.0f,0.0f}, facenormal[3], cf = 1.0f,intrusion; + kd = 1.0f; + + if (sb_deflect_face(ob,bp->pos,facenormal,defforce,&cf,timenow,vel,&intrusion)){ + if ((!nl_flags)&&(intrusion < 0.0f)){ + /*bjornmose: uugh.. what an evil hack + violation of the 'don't touch bp->pos in here' rule + but works nice, like this--> + we predict the solution beeing out of the collider + in heun step No1 and leave the heun step No2 adapt to it + so we kind of introduced a implicit solver for this case + */ + Vec3PlusStVec(bp->pos,-intrusion,facenormal); + + sb->scratch->flag |= SBF_DOFUZZY; + bp->flag |= SBF_DOFUZZY; + bp->choke = sb->choke*0.01f; + } + else{ VECSUB(cfforce,bp->vec,vel); Vec3PlusStVec(bp->force,-cf*50.0f,cfforce); - } - Vec3PlusStVec(bp->force,kd,defforce); - if (nl_flags & NLF_BUILD){ - // int ia =3*(sb->totpoint-a); - // int op =3*sb->totpoint; - //dfdx_goal(ia,ia,op,mpos); // don't do unless you know - //dfdv_goal(ia,ia,-cf); - - } - - } - - } - /* ---cached collision targets */ - - /* +++springs */ - if(ob->softflag & OB_SB_EDGES) { - if (sb->bspring){ /* spring list exists at all ? */ - for(b=bp->nofsprings;b>0;b--){ - bs = sb->bspring + bp->springs[b-1]; - if (do_springcollision || do_aero){ - VecAddf(bp->force,bp->force,bs->ext_force); - if (bs->flag & BSF_INTERSECT) - bp->choke = bs->cf; + } + Vec3PlusStVec(bp->force,kd,defforce); + if (nl_flags & NLF_BUILD){ + // int ia =3*(sb->totpoint-a); + // int op =3*sb->totpoint; + //dfdx_goal(ia,ia,op,mpos); // don't do unless you know + //dfdv_goal(ia,ia,-cf); } - // sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float forcetime,int nl_flags) - sb_spring_force(ob,sb->totpoint-a,bs,iks,forcetime,nl_flags); - }/* loop springs */ - }/* existing spring list */ - }/*any edges*/ - /* ---springs */ - }/*omit on snap */ - }/*loop all bp's*/ + + } + + } + /* ---cached collision targets */ + + /* +++springs */ + if(ob->softflag & OB_SB_EDGES) { + if (sb->bspring){ /* spring list exists at all ? */ + for(b=bp->nofsprings;b>0;b--){ + bs = sb->bspring + bp->springs[b-1]; + if (do_springcollision || do_aero){ + VecAddf(bp->force,bp->force,bs->ext_force); + if (bs->flag & BSF_INTERSECT) + bp->choke = bs->cf; + + } + // sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float forcetime,int nl_flags) + // rather remove nl_falgs from code .. will make things a lot cleaner + sb_spring_force(ob,sb->totpoint-a,bs,iks,forcetime,0); + }/* loop springs */ + }/* existing spring list */ + }/*any edges*/ + /* ---springs */ + }/*omit on snap */ + }/*loop all bp's*/ - /* finally add forces caused by face collision */ - if (ob->softflag & OB_SB_FACECOLL) scan_for_ext_face_forces(ob,timenow); - - /* finish matrix and solve */ + /* finally add forces caused by face collision */ + if (ob->softflag & OB_SB_FACECOLL) scan_for_ext_face_forces(ob,timenow); + + /* finish matrix and solve */ #if (0) // remove onl linking for now .. still i am not sure .. the jacobian can be usefull .. so keep that BM - if(nl_flags & NLF_SOLVE){ - //double sct,sst=PIL_check_seconds_timer(); - for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { - int iv =3*(sb->totpoint-a); - int ip =3*(2*sb->totpoint-a); - int n; - for (n=0;n<3;n++) {nlRightHandSideSet(0, iv+n, bp->force[0+n]);} - for (n=0;n<3;n++) {nlRightHandSideSet(0, ip+n, bp->vec[0+n]);} - } - nlEnd(NL_MATRIX); - nlEnd(NL_SYSTEM); - - if ((G.rt >0) && (nl_flags & NLF_BUILD)) - { - printf("####MEE#####\n"); - nlPrintMatrix(); - } - - success= nlSolveAdvanced(NULL, 1); - - // nlPrintMatrix(); /* for debug purpose .. anyhow cropping B vector looks like working */ - if(success){ - float f; - int index =0; - /* for debug purpose .. anyhow cropping B vector looks like working */ - if (G.rt >0) - for(a=2*sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { - f=nlGetVariable(0,index); - printf("(%f ",f);index++; - f=nlGetVariable(0,index); - printf("%f ",f);index++; - f=nlGetVariable(0,index); - printf("%f)",f);index++; - } - - index =0; - for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { - f=nlGetVariable(0,index); - bp->impdv[0] = f; index++; - f=nlGetVariable(0,index); - bp->impdv[1] = f; index++; - f=nlGetVariable(0,index); - bp->impdv[2] = f; index++; - } - /* - for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { - f=nlGetVariable(0,index); - bp->impdx[0] = f; index++; - f=nlGetVariable(0,index); - bp->impdx[1] = f; index++; - f=nlGetVariable(0,index); - bp->impdx[2] = f; index++; - } - */ - } - else{ - printf("Matrix inversion failed \n"); + if(nl_flags & NLF_SOLVE){ + //double sct,sst=PIL_check_seconds_timer(); for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { - VECCOPY(bp->impdv,bp->force); + int iv =3*(sb->totpoint-a); + int ip =3*(2*sb->totpoint-a); + int n; + for (n=0;n<3;n++) {nlRightHandSideSet(0, iv+n, bp->force[0+n]);} + for (n=0;n<3;n++) {nlRightHandSideSet(0, ip+n, bp->vec[0+n]);} + } + nlEnd(NL_MATRIX); + nlEnd(NL_SYSTEM); + + if ((G.rt == 32) && (nl_flags & NLF_BUILD)) + { + printf("####MEE#####\n"); + nlPrintMatrix(); } - } + success= nlSolveAdvanced(NULL, 1); - //sct=PIL_check_seconds_timer(); - //if (sct-sst > 0.01f) printf(" implicit solver time %f %s \r",sct-sst,ob->id.name); - } - /* cleanup */ + // nlPrintMatrix(); /* for debug purpose .. anyhow cropping B vector looks like working */ + if(success){ + float f; + int index =0; + /* for debug purpose .. anyhow cropping B vector looks like working */ + if (G.rt ==32) + for(a=2*sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { + f=nlGetVariable(0,index); + printf("(%f ",f);index++; + f=nlGetVariable(0,index); + printf("%f ",f);index++; + f=nlGetVariable(0,index); + printf("%f)",f);index++; + } + + index =0; + for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { + f=nlGetVariable(0,index); + bp->impdv[0] = f; index++; + f=nlGetVariable(0,index); + bp->impdv[1] = f; index++; + f=nlGetVariable(0,index); + bp->impdv[2] = f; index++; + } + /* + for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { + f=nlGetVariable(0,index); + bp->impdx[0] = f; index++; + f=nlGetVariable(0,index); + bp->impdx[1] = f; index++; + f=nlGetVariable(0,index); + bp->impdx[2] = f; index++; + } + */ + } + else{ + printf("Matrix inversion failed \n"); + for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { + VECCOPY(bp->impdv,bp->force); + } + + } + + //sct=PIL_check_seconds_timer(); + //if (sct-sst > 0.01f) printf(" implicit solver time %f %s \r",sct-sst,ob->id.name); + } + /* cleanup */ #endif - if(do_effector) pdEndEffectors(do_effector); + if(do_effector) pdEndEffectors(do_effector); + } } + static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *err, int mid_flags) { /* time evolution */ @@ -2458,7 +2870,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float * /* x(t + dt) = x(t) + v(t~) * dt */ VecMulf(dx,forcetime); - /* the freezer */ + /* the freezer coming sooner or later */ /* if ((Inpf(dx,dx)force,bp->force)frozen /=2; @@ -3529,6 +3941,7 @@ static void softbody_step(Object *ob, SoftBody *sb, float dtime) * we don't want to lock up the system if physics fail */ int loops =0 ; + SoftHeunTol = sb->rklimit; /* humm .. this should be calculated from sb parameters and sizes */ if (sb->minloops > 0) forcetimemax = 1.0f / sb->minloops; @@ -3546,13 +3959,13 @@ static void softbody_step(Object *ob, SoftBody *sb, float dtime) sb->scratch->flag &= ~SBF_DOFUZZY; /* do predictive euler step */ softbody_calc_forces(ob, forcetime,timedone/dtime,0); - softbody_apply_forces(ob, forcetime, 1, NULL,mid_flags); + softbody_apply_forces(ob, forcetime, 1, NULL,mid_flags); /* crop new slope values to do averaged slope step */ softbody_calc_forces(ob, forcetime,timedone/dtime,0); - softbody_apply_forces(ob, forcetime, 2, &err,mid_flags); + softbody_apply_forces(ob, forcetime, 2, &err,mid_flags); softbody_apply_goalsnap(ob); if (err > SoftHeunTol) { /* error needs to be scaled to some quantity */ @@ -3603,7 +4016,7 @@ static void softbody_step(Object *ob, SoftBody *sb, float dtime) // if(G.f & G_DEBUG){ if(sb->solverflags & SBSO_MONITOR ){ if (loops > HEUNWARNLIMIT) /* monitor high loop counts */ - printf("\r needed %d steps/frame ",loops); + printf("\r needed %d steps/frame",loops); } } @@ -3627,7 +4040,7 @@ static void softbody_step(Object *ob, SoftBody *sb, float dtime) if(sb->solverflags & SBSO_MONITOR ){ sct=PIL_check_seconds_timer(); - if (sct-sst > 0.5f) printf(" solver time %f %s \r",sct-sst,ob->id.name); + if (sct-sst > 0.5f) printf(" solver time %f sec %s \n",sct-sst,ob->id.name); } } diff --git a/source/blender/python/api2_2x/Texture.c b/source/blender/python/api2_2x/Texture.c index 696c78f2bac..7ba8ad88ea6 100644 --- a/source/blender/python/api2_2x/Texture.c +++ b/source/blender/python/api2_2x/Texture.c @@ -105,6 +105,10 @@ #define EXPP_TEX_LACUNARITY_MAX 6.0f #define EXPP_TEX_OCTS_MIN 0.0f #define EXPP_TEX_OCTS_MAX 8.0f +#define EXPP_TEX_OFST_MIN 0.0f +#define EXPP_TEX_OFST_MAX 6.0f +#define EXPP_TEX_GAIN_MIN 0.0f +#define EXPP_TEX_GAIN_MAX 6.0f #define EXPP_TEX_ISCALE_MIN 0.0f #define EXPP_TEX_ISCALE_MAX 10.0f #define EXPP_TEX_EXP_MIN 0.010f @@ -430,6 +434,8 @@ GETFUNC( getNoiseDepth ); GETFUNC( getNoiseSize ); GETFUNC( getNoiseType ); GETFUNC( getOcts ); +GETFUNC( getOffset ); +GETFUNC( getGain ); GETFUNC( getRepeat ); GETFUNC( getRGBCol ); GETFUNC( getSType ); @@ -478,6 +484,8 @@ SETFUNC( setNoiseDepth ); SETFUNC( setNoiseSize ); SETFUNC( setNoiseType ); SETFUNC( setOcts ); +SETFUNC( setOffset ); +SETFUNC( setGain ); SETFUNC( setRepeat ); SETFUNC( setRGBCol ); SETFUNC( setSType ); @@ -646,6 +654,14 @@ static PyGetSetDef BPy_Texture_getseters[] = { (getter)Texture_getLacunarity, (setter)Texture_setLacunarity, "Gap between succesive frequencies (for Musgrave textures)", NULL}, + {"offset", + (getter)Texture_getOffset, (setter)Texture_setOffset, + "Fractal offset (for Musgrave textures)", + NULL}, + {"gain", + (getter)Texture_getGain, (setter)Texture_setGain, + "Gain multiplier (for Musgrave textures)", + NULL}, {"noiseBasis", (getter)Texture_getNoiseBasis, (setter)Texture_setNoiseBasis, "Noise basis type (wood, stucci, marble, clouds, Musgrave, distorted noise)", @@ -1837,6 +1853,20 @@ static int Texture_setLacunarity( BPy_Texture * self, PyObject * value ) EXPP_TEX_LACUNARITY_MAX ); } +static int Texture_setOffset( BPy_Texture * self, PyObject * value ) +{ + return EXPP_setFloatClamped ( value, &self->texture->mg_offset, + EXPP_TEX_OFST_MIN, + EXPP_TEX_OFST_MAX ); +} + +static int Texture_setGain( BPy_Texture * self, PyObject * value ) +{ + return EXPP_setFloatClamped ( value, &self->texture->mg_gain, + EXPP_TEX_GAIN_MIN, + EXPP_TEX_GAIN_MAX ); +} + static int Texture_setOcts( BPy_Texture * self, PyObject * value ) { return EXPP_setFloatClamped ( value, &self->texture->mg_octaves, @@ -2168,6 +2198,16 @@ static PyObject *Texture_getOcts( BPy_Texture *self ) return PyFloat_FromDouble( self->texture->mg_octaves ); } +static PyObject *Texture_getOffset( BPy_Texture *self ) +{ + return PyFloat_FromDouble( self->texture->mg_offset ); +} + +static PyObject *Texture_getGain( BPy_Texture *self ) +{ + return PyFloat_FromDouble( self->texture->mg_gain ); +} + static PyObject *Texture_getRepeat( BPy_Texture *self ) { return Py_BuildValue( "(i,i)", self->texture->xrepeat, diff --git a/source/blender/python/api2_2x/doc/Texture.py b/source/blender/python/api2_2x/doc/Texture.py index 7f42d06240b..cebb7de7011 100644 --- a/source/blender/python/api2_2x/doc/Texture.py +++ b/source/blender/python/api2_2x/doc/Texture.py @@ -344,6 +344,12 @@ class Texture: @ivar octs: Number of frequencies (for Musgrave textures). Value is clamped to the range [0.0,8.0]. @type octs: float + @ivar offset: Fractal offset (for hetero terrain and multifractal Musgrave textures). + Value is clamped to the range [0.0,6.0]. + @type offset: float + @ivar gain: Gain multiplier (for multifractal Musgrave textures). + Value is clamped to the range [0.0,6.0]. + @type gain: float @ivar repeat: Repetition multiplier (for image textures). @type repeat: tuple of 2 ints @ivar rgbCol: RGB color tuple. diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 139943ae5ba..f7606884f29 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -6720,3 +6720,4 @@ void editing_panels() } uiClearButLock(); } + diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index 48136eb9dc3..b4694740679 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -700,9 +700,7 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj) CValue* vallie = NULL; - PyTypeObject* type = pyobj->ob_type; - - if (type == &PyList_Type) + if (PyList_Check(pyobj)) { CListValue* listval = new CListValue(); bool error = false; @@ -732,26 +730,25 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj) } } else - if (type == &PyFloat_Type) + if (PyFloat_Check(pyobj)) { - float fl; - PyArg_Parse(pyobj,"f",&fl); - vallie = new CFloatValue(fl); + vallie = new CFloatValue( (float)PyFloat_AsDouble(pyobj) ); } else - if (type==&PyInt_Type) + if (PyInt_Check(pyobj)) { - int innie; - PyArg_Parse(pyobj,"i",&innie); - vallie = new CIntValue(innie); + vallie = new CIntValue( (int)PyInt_AS_LONG(pyobj) ); } else - - if (type==&PyString_Type) + if (PyString_Check(pyobj)) { vallie = new CStringValue(PyString_AsString(pyobj),""); } else - if (type==&CValue::Type || type==&CListValue::Type) + if (pyobj->ob_type==&CValue::Type || pyobj->ob_type==&CListValue::Type) { vallie = ((CValue*) pyobj)->AddRef(); + } else + { + /* return an error value from the caller */ + PyErr_SetString(PyExc_TypeError, "This python value could not be assigned to a game engine property"); } return vallie; @@ -778,6 +775,9 @@ int CValue::_setattr(const STR_String& attr,PyObject* pyobj) SetProperty(attr,vallie); } vallie->Release(); + } else + { + return 1; /* ConvertPythonToValue sets the error message */ } //PyObjectPlus::_setattr(attr,value); diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index 01ae4072335..cd1b029fc34 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -273,36 +273,16 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr) * break it by hand, then DECREF (which in this case * should always ensure excdict is cleared). */ -/* PyObject *excdict= myPyDict_Copy(m_pythondictionary); - struct _object* resultobj = PyEval_EvalCode((PyCodeObject*)m_bytecode, - excdict, - excdict - ); - PyDict_Clear(excdict); - Py_DECREF(excdict);*/ - -#if 1 PyObject *excdict= PyDict_Copy(m_pythondictionary); PyObject* resultobj = PyEval_EvalCode((PyCodeObject*)m_bytecode, - excdict, - excdict - ); - PyDict_Clear(excdict); - Py_DECREF(excdict); -#else - - PyObject* resultobj = PyEval_EvalCode((PyCodeObject*)m_bytecode, - m_pythondictionary, - m_pythondictionary - ); - -#endif + excdict, excdict); if (resultobj) { Py_DECREF(resultobj); - } else + } + else { // something is wrong, tell the user what went wrong printf("PYTHON SCRIPT ERROR:\n"); @@ -310,6 +290,11 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr) //PyRun_SimpleString(m_scriptText.Ptr()); } + // clear after PyErrPrint - seems it can be using + // something in this dictionary and crash? + PyDict_Clear(excdict); + Py_DECREF(excdict); + m_sCurrentController = NULL; } From 89be876f965426a352bb03a7b99660da6d1638ca Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Wed, 13 Aug 2008 20:18:56 +0000 Subject: [PATCH 70/76] Fixed problem of "lack of normal information" --- source/blender/blenkernel/intern/modifier.c | 43 ++++++++++++++++--- source/blender/blenkernel/intern/shrinkwrap.c | 1 - 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 750a86e302a..d74013f7acb 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -7285,21 +7285,50 @@ static void shrinkwrapModifier_foreachObjectLink(ModifierData *md, Object *ob, O static void shrinkwrapModifier_deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { - shrinkwrapModifier_deform((ShrinkwrapModifierData*)md, ob, derivedData, vertexCos, numVerts); + DerivedMesh *dm = NULL; + CustomDataMask dataMask = shrinkwrapModifier_requiredDataMask(md); + + /* We implement requiredDataMask but thats not really usefull since mesh_calc_modifiers pass a NULL derivedData or without the modified vertexs applied */ + if(shrinkwrapModifier_requiredDataMask(md)) + { + if(derivedData) dm = CDDM_copy(derivedData); + else if(ob->type==OB_MESH) dm = CDDM_from_mesh(ob->data, ob); + else return; + + if(dataMask & CD_MVERT) + { + CDDM_apply_vert_coords(dm, vertexCos); + CDDM_calc_normals(dm); + } + } + + shrinkwrapModifier_deform((ShrinkwrapModifierData*)md, ob, dm, vertexCos, numVerts); + + if(dm) + dm->release(dm); } static void shrinkwrapModifier_deformVertsEM(ModifierData *md, Object *ob, EditMesh *editData, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { - DerivedMesh *dm; + DerivedMesh *dm = NULL; + CustomDataMask dataMask = shrinkwrapModifier_requiredDataMask(md); - if(!derivedData && ob->type == OB_MESH) - dm = CDDM_from_editmesh(editData, ob->data); - else - dm = CDDM_copy(derivedData); //TODO: this is only needed if derevedData doenst supports getVertexArray + if(dataMask) + { + if(derivedData) dm = CDDM_copy(derivedData); + else if(ob->type==OB_MESH) dm = CDDM_from_editmesh(editData, ob); + else return; + + if(dataMask & CD_MVERT) + { + CDDM_apply_vert_coords(dm, vertexCos); + CDDM_calc_normals(dm); + } + } shrinkwrapModifier_deform((ShrinkwrapModifierData*)md, ob, dm, vertexCos, numVerts); - if(dm != derivedData) + if(dm) dm->release(dm); } diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index d8535e10be5..fda1fbeab56 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -364,7 +364,6 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) if(calc->smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL) { vert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MVERT) : NULL; - if(vert) CDDM_calc_normals(calc->original); //Maybe normals aren't yet calculated } else { From 8da4ad74e9592cbc1b18838d62046924c5f8442c Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Thu, 14 Aug 2008 03:05:13 +0000 Subject: [PATCH 71/76] Added subsurface levels option to normal projection. Now when doing normal projeciton is possible to ask it to project along the normals that the vertex would have if it was subsurfaced... this gives "better" projections on low polys. Point of this commit is to add the feature request from Eclectiel http://blenderartists.org/forum/showpost.php?p=1181531&postcount=9 workflow as Eclectiel wanted is now possible: to archieve a nice low-res retopology that aproximates a high-res mesh when subsurfaced: 1 - make base low-poly retopo 2 - apply a shrinkwrap with projection along normal.. and with SS level = N (where N>0) 3 - add a Subsurface with level N 4 - run bretch's script (ss_fit) --- source/blender/blenkernel/intern/modifier.c | 2 +- source/blender/blenkernel/intern/shrinkwrap.c | 74 ++++++++++++++++--- source/blender/makesdna/DNA_modifier_types.h | 10 ++- source/blender/src/buttons_editing.c | 8 ++ 4 files changed, 81 insertions(+), 13 deletions(-) diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index d74013f7acb..d08f30ff995 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -7316,7 +7316,7 @@ static void shrinkwrapModifier_deformVertsEM(ModifierData *md, Object *ob, EditM if(dataMask) { if(derivedData) dm = CDDM_copy(derivedData); - else if(ob->type==OB_MESH) dm = CDDM_from_editmesh(editData, ob); + else if(ob->type==OB_MESH) dm = CDDM_from_editmesh(editData, ob->data); else return; if(dataMask & CD_MVERT) diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index fda1fbeab56..5c020bf2339 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -32,10 +32,12 @@ #include #include #include +#include #include "DNA_object_types.h" #include "DNA_modifier_types.h" #include "DNA_meshdata_types.h" +#include "DNA_mesh_types.h" #include "BKE_shrinkwrap.h" #include "BKE_DerivedMesh.h" @@ -44,6 +46,7 @@ #include "BKE_cdderivedmesh.h" #include "BKE_displist.h" #include "BKE_global.h" +#include "BKE_subsurf.h" #include "BLI_arithb.h" #include "BLI_kdtree.h" @@ -344,6 +347,7 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) const char use_normal = calc->smd->shrinkOpts; float proj_axis[3] = {0.0f, 0.0f, 0.0f}; MVert *vert = NULL; //Needed in case of vertex normal + DerivedMesh* ss_mesh = NULL; //Vertex group data const int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); @@ -359,11 +363,46 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) BVHTreeFromMesh auxData= NULL_BVHTreeFromMesh; SpaceTransform local2aux; +do +{ //Prepare data to retrieve the direction in which we should project each vertex if(calc->smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL) { - vert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MVERT) : NULL; + //No Mvert information: jump to "free memory and return" part + if(calc->original == NULL) break; + + if(calc->smd->subsurfLevels) + { + SubsurfModifierData smd; + memset(&smd, 0, sizeof(smd)); + smd.subdivType = ME_CC_SUBSURF; //catmull clark + smd.levels = calc->smd->subsurfLevels; //levels + + ss_mesh = subsurf_make_derived_from_derived(calc->original, &smd, FALSE, NULL, 0, 0); + + if(ss_mesh) + { + vert = ss_mesh->getVertDataArray(ss_mesh, CD_MVERT); + if(vert) + { + //TRICKY: this code assumes subsurface will have the transformed original vertices + //in their original order at the end of the vert array. + vert = vert + + ss_mesh->getNumVerts(ss_mesh) + - calc->original->getNumVerts(calc->original); + } + } + + //To make sure we are not letting any memory behind + assert(smd.emCache == NULL); + assert(smd.mCache == NULL); + } + else + vert = calc->original->getVertDataArray(calc->original, CD_MVERT); + + //Not able to get vert information: jump to "free memory and return" part + if(vert == NULL) break; } else { @@ -373,22 +412,21 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) if(calc->smd->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS) proj_axis[2] = 1.0f; Normalize(proj_axis); - } - if(vert == NULL && (INPR(proj_axis, proj_axis) < FLT_EPSILON)) - { - printf("Shrinkwrap can't project witouth normal information"); - return; + //Invalid projection direction: jump to "free memory and return" part + if(INPR(proj_axis, proj_axis) < FLT_EPSILON) break; } //If the user doesn't allows to project in any direction of projection axis... then theres nothing todo. if((use_normal & (MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR | MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR)) == 0) - return; + break; //jump to "free memory and return" part //Build target tree BENCH(bvhtree_from_mesh_faces(&treeData, calc->target, calc->keepDist, 4, 6)); - if(treeData.tree == NULL) return OUT_OF_MEMORY(); + if(treeData.tree == NULL) + break; //jump to "free memory and return" part + //Build auxiliar target if(calc->smd->auxTarget) @@ -414,7 +452,15 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) if(weight == 0.0f) continue; - VECCOPY(tmp_co, co); + if(ss_mesh) + { + VECCOPY(tmp_co, vert[i].co); + } + else + { + VECCOPY(tmp_co, co); + } + if(vert) NormalShortToFloat(tmp_no, vert[i].no); @@ -456,6 +502,9 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) } +//Simple do{} while(0) structure to allow to easily jump to the "free memory and return" part +} while(0); + //free data structures free_bvhtree_from_mesh(&treeData); @@ -463,6 +512,9 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) if(aux_mesh) aux_mesh->release(aux_mesh); + + if(ss_mesh) + ss_mesh->release(ss_mesh); } /* @@ -492,7 +544,7 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) nearest.dist = FLT_MAX; - //Find the nearest vertex + //Find the nearest vertex #pragma omp parallel for default(none) private(i) firstprivate(nearest) shared(calc,treeData) schedule(static) for(i = 0; inumVerts; ++i) { @@ -518,7 +570,7 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) BLI_bvhtree_find_nearest(treeData.tree, tmp_co, &nearest, treeData.nearest_callback, &treeData); //Found the nearest vertex - if(nearest.index) + if(nearest.index != -1) { if(calc->smd->shrinkOpts & MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE) { diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index ac12a09c0ee..30bec07f5fc 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -502,7 +502,15 @@ typedef struct ShrinkwrapModifierData { short shrinkType; /* shrink type projection */ short shrinkOpts; /* shrink options */ char projAxis; /* axis to project over */ - char pad[7]; + + /* + * if using projection over vertex normal this controls the + * the level of subsurface that must be done before getting the + * vertex coordinates and normal + */ + char subsurfLevels; + + char pad[6]; } ShrinkwrapModifierData; diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index f7606884f29..8ea6a6c191a 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -1903,7 +1903,10 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; height = 86 + 3; if (smd->shrinkType == MOD_SHRINKWRAP_PROJECT) + { height += 19*5; + if(smd->projAxis == 0) height += 19; + } else if (smd->shrinkType == MOD_SHRINKWRAP_NEAREST_SURFACE) height += 19; @@ -2556,6 +2559,11 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco /* UI for projection axis */ uiBlockBeginAlign(block); uiDefButC(block, ROW, B_MODIFIER_RECALC, "Normal" , lx,(cy-=19),buttonWidth,19, &smd->projAxis, 18.0, MOD_SHRINKWRAP_PROJECT_OVER_NORMAL, 0, 0, "Projection over X axis"); + if(smd->projAxis == 0) + { + uiDefButC(block, NUM, B_MODIFIER_RECALC, "SS Levels:", lx, (cy-=19), buttonWidth,19, &smd->subsurfLevels, 0, 6, 0, 0, "This indicates the number of CCSubdivisions that must be performed before extracting vertexs positions and normals"); + } + uiDefButBitC(block, TOG, MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS, B_MODIFIER_RECALC, "X", lx+buttonWidth/3*0,(cy-=19),buttonWidth/3,19, &smd->projAxis, 0, 0, 0, 0, "Projection over X axis"); uiDefButBitC(block, TOG, MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS, B_MODIFIER_RECALC, "Y", lx+buttonWidth/3*1,cy,buttonWidth/3,19, &smd->projAxis, 0, 0, 0, 0, "Projection over Y axis"); uiDefButBitC(block, TOG, MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS, B_MODIFIER_RECALC, "Z", lx+buttonWidth/3*2,cy,buttonWidth/3,19, &smd->projAxis, 0, 0, 0, 0, "Projection over Z axis"); From c37923c7a386f8cdb8ad61e475821253e793da95 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Thu, 14 Aug 2008 15:37:47 +0000 Subject: [PATCH 72/76] Fixed bug related to some missed rays-hits.. just a lack of a FLT_EPSILON --- source/blender/blenlib/intern/BLI_kdopbvh.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index 9671551a7f1..d0db13371b0 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -722,6 +722,11 @@ BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis) return NULL; tree = (BVHTree *)MEM_callocN(sizeof(BVHTree), "BVHTree"); + + //tree epsilon must be >= FLT_EPSILON + //so that tangent rays can still hit a bounding volume.. + //this bug would show up when casting a ray aligned with a kdop-axis and with an edge of 2 faces + epsilon = MAX2(FLT_EPSILON, epsilon); if(tree) { @@ -1212,7 +1217,7 @@ static float ray_nearest_hit(BVHRayCastData *data, BVHNode *node) float ll = (bv[0] - data->ray.origin[i]) / data->ray_dot_axis[i]; float lu = (bv[1] - data->ray.origin[i]) / data->ray_dot_axis[i]; - if(data->ray_dot_axis[i] > 0) + if(data->ray_dot_axis[i] > 0.0f) { if(ll > low) low = ll; if(lu < upper) upper = lu; @@ -1252,7 +1257,7 @@ static void dfs_raycast(BVHRayCastData *data, BVHNode *node) else { //pick loop direction to dive into the tree (based on ray direction and split axis) - if(data->ray_dot_axis[ node->main_axis ] > 0) + if(data->ray_dot_axis[ node->main_axis ] > 0.0f) { for(i=0; i != node->totnode; i++) { @@ -1289,7 +1294,7 @@ int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, BVHTr { data.ray_dot_axis[i] = INPR( data.ray.direction, KDOP_AXES[i]); - if(fabs(data.ray_dot_axis[i]) < 1e-7) + if(fabs(data.ray_dot_axis[i]) < FLT_EPSILON) data.ray_dot_axis[i] = 0.0; } From a88eb64f70750de50fe153c147382261867ae1be Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Fri, 15 Aug 2008 00:51:44 +0000 Subject: [PATCH 73/76] Simpledeform origin is no longer attache to parent by default That was due to a current limitation on dag system.. that leads to cyclic dependencies. So now you can attach the origin of a simpledeform to an empty and mark whether its affected by the relative position of empty or the global one. brecht found a workarround to solve the cyclic dependency by using a parent of both the mesh and the control empty: empty_parent | |-> empty controlling simpledeform |-> mesh with simpledeform modifier --- .../blender/blenkernel/intern/simple_deform.c | 23 +++++++--- source/blender/makesdna/DNA_modifier_types.h | 7 ++- source/blender/src/buttons_editing.c | 45 ++----------------- 3 files changed, 27 insertions(+), 48 deletions(-) diff --git a/source/blender/blenkernel/intern/simple_deform.c b/source/blender/blenkernel/intern/simple_deform.c index 20cba28ab5a..2984b8fe9d8 100644 --- a/source/blender/blenkernel/intern/simple_deform.c +++ b/source/blender/blenkernel/intern/simple_deform.c @@ -153,13 +153,24 @@ void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object *ob, s if(smd->origin) { //inverse is outdated - Mat4Invert(smd->origin->imat, smd->origin->obmat); - Mat4Invert(ob->imat, ob->obmat); - ob2mod = tmp_matrix[0]; - mod2ob = tmp_matrix[1]; - Mat4MulSerie(ob2mod, smd->origin->imat, ob->obmat, 0, 0, 0, 0, 0, 0); - Mat4Invert(mod2ob, ob2mod); + if(smd->originOpts & MOD_SIMPLEDEFORM_ORIGIN_LOCAL) + { + Mat4Invert(smd->origin->imat, smd->origin->obmat); + Mat4Invert(ob->imat, ob->obmat); + + ob2mod = tmp_matrix[0]; + mod2ob = tmp_matrix[1]; + Mat4MulSerie(ob2mod, smd->origin->imat, ob->obmat, 0, 0, 0, 0, 0, 0); + Mat4Invert(mod2ob, ob2mod); + } + else + { + Mat4Invert(smd->origin->imat, smd->origin->obmat); + ob2mod = smd->origin->obmat; + mod2ob = smd->origin->imat; + } + } diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 30bec07f5fc..9ce04c1c272 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -544,7 +544,8 @@ typedef struct SimpleDeformModifierData { char mode; /* deform function */ char axis; /* lock axis (for taper and strech) */ - char pad[2]; + char originOpts; /* originOptions */ + char pad; } SimpleDeformModifierData; @@ -556,4 +557,8 @@ typedef struct SimpleDeformModifierData { #define MOD_SIMPLEDEFORM_LOCK_AXIS_X (1<<0) #define MOD_SIMPLEDEFORM_LOCK_AXIS_Y (1<<1) +/* indicates whether simple deform should use the local + coordinates or global coordinates of origin */ +#define MOD_SIMPLEDEFORM_ORIGIN_LOCAL (1<<0) + #endif diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 8ea6a6c191a..63303467856 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -1711,32 +1711,6 @@ static int modifier_is_fluid_particles(ModifierData *md) { return 0; } -static void modifier_link_new_empty(void *pp_empty, void *p_parent) -{ - Object **empty = (Object**)pp_empty; - Object *parent = (Object*) p_parent; - - /* Add object but witouth chaing layers and or changing active object */ - Base *base= BASACT, *newbase; - - (*empty) = add_object(OB_EMPTY); - - newbase= BASACT; - newbase->lay= base->lay; - (*empty)->lay= newbase->lay; - - /* restore, add_object sets active */ - BASACT= base; - - /* Makes parent relation and positions empty on center of object */ - (*empty)->partype= PAROBJECT; - (*empty)->parent = parent; - Mat4CpyMat4( (*empty)->obmat, parent->obmat ); - Mat4Invert( (*empty)->parentinv, parent->obmat); - apply_obmat( (*empty) ); - DAG_scene_sort(G.scene); -} - static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco, int *yco, int index, int cageIndex, int lastCageIndex) { ModifierTypeInfo *mti = modifierType_getInfo(md->type); @@ -1912,9 +1886,8 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco } else if (md->type==eModifierType_SimpleDeform) { SimpleDeformModifierData *smd = (SimpleDeformModifierData*) md; - height += 19*4; - + if(smd->origin != NULL) height += 19; if(smd->mode == MOD_SIMPLEDEFORM_MODE_STRETCH || smd->mode == MOD_SIMPLEDEFORM_MODE_TAPER ) height += 19; @@ -2589,20 +2562,10 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &smd->vgroup_name, 0, 31, 0, 0, "Vertex Group name"); uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth-17,19, &smd->origin, "Origin of modifier space coordinates"); + uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &smd->origin, "Origin of modifier space coordinates"); + if(smd->origin != NULL) + uiDefButBitC(block, TOG, MOD_SIMPLEDEFORM_ORIGIN_LOCAL, B_MODIFIER_RECALC, "Relative",lx,(cy-=19),buttonWidth,19, &smd->originOpts, 0, 0, 0, 0, "Sets the origin of deform space to be relative to the object"); - if(smd->origin) - { - uiDefIconButBitS(block, ICONTOG, OB_RESTRICT_VIEW, REDRAWALL, ICON_RESTRICT_VIEW_OFF, - lx + buttonWidth-17, cy, 17, 19, - &(smd->origin->restrictflag), 0, 0, 0, 0, "Restrict/Allow visibility in the 3D View"); - } - else - { - uiBut *bt; - bt= uiDefIconBut(block, BUT, B_CHANGEDEP, ICON_ZOOMIN, lx+buttonWidth-17, cy, 17, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Creates a new empty"); - uiButSetFunc(bt, modifier_link_new_empty, &smd->origin, ob); - } uiDefButF(block, NUM, B_MODIFIER_RECALC, "Factor:", lx,(cy-=19),buttonWidth,19, &smd->factor, -10.0f, 10.0f, 0.5f, 0, "Deform Factor"); uiDefButF(block, NUM, B_MODIFIER_RECALC, "Upper Limit:", lx,(cy-=19),buttonWidth,19, &smd->limit[1], -1000.0f, 1000.0f, 5.0f, 0, "Upper Limit Bend on X"); From 2ce338f7e80094ad50cf1b30cc47ad6b85ae55b3 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Mon, 18 Aug 2008 14:33:26 +0000 Subject: [PATCH 74/76] svn merge -r 16077:16174 https://svn.blender.org/svnroot/bf-blender/trunk/blender --- CMakeLists.txt | 1 - intern/guardedalloc/BLO_sys_types.h | 125 + intern/guardedalloc/intern/mallocn.c | 12 +- intern/guardedalloc/intern/mmap_win.c | 2 +- .../make/msvc_7_0/guardedalloc.vcproj | 3 + intern/guardedalloc/mmap_win.h | 4 +- intern/opennl/make/msvc_7_0/opennl.vcproj | 3 + intern/opennl/superlu/BLO_sys_types.h | 125 + intern/opennl/superlu/smemory.c | 10 +- .../gameengine/gamelogic/SCA_GameLogic.vcproj | 6 + .../kernel/system/SYS_system.vcproj | 8 +- release/VERSION | 2 +- release/datafiles/datatoc.c | 2 +- release/datafiles/splash.jpg | Bin 95515 -> 50665 bytes source/blender/blenkernel/BKE_blender.h | 4 +- source/blender/blenkernel/BKE_customdata.h | 4 +- source/blender/blenkernel/BKE_effect.h | 6 + source/blender/blenkernel/BKE_endian.h | 6 +- source/blender/blenkernel/BKE_utildefines.h | 4 +- source/blender/blenkernel/intern/CCGSubSurf.c | 4 +- .../blender/blenkernel/intern/DerivedMesh.c | 20 +- source/blender/blenkernel/intern/cloth.c | 22 +- source/blender/blenkernel/intern/displist.c | 8 +- source/blender/blenkernel/intern/effect.c | 372 +- source/blender/blenkernel/intern/icons.c | 2 + source/blender/blenkernel/intern/image.c | 8 +- source/blender/blenkernel/intern/implicit.c | 141 +- source/blender/blenkernel/intern/ipo.c | 8 +- .../blenkernel/intern/particle_system.c | 222 +- source/blender/blenkernel/intern/sca.c | 3 + source/blender/blenlib/BLI_editVert.h | 8 +- source/blender/blenlib/BLI_rand.h | 1 + source/blender/blenlib/intern/BLI_ghash.c | 8 +- source/blender/blenlib/intern/BLI_kdopbvh.c | 12 + source/blender/blenlib/intern/fileops.c | 6 +- source/blender/blenlib/intern/psfont.c | 4 +- source/blender/blenlib/intern/rand.c | 18 +- source/blender/blenlib/intern/util.c | 8 +- source/blender/blenloader/BLO_sys_types.h | 17 +- source/blender/blenloader/intern/genfile.c | 10 +- .../blender/blenloader/intern/readblenentry.c | 4 +- source/blender/blenloader/intern/readfile.c | 61 +- source/blender/blenloader/intern/writefile.c | 3 + .../blender/blenpluginapi/intern/pluginapi.c | 4 +- .../blender/imbuf/intern/cineon/cineonlib.c | 32 +- source/blender/imbuf/intern/cineon/dpxlib.c | 36 +- .../imbuf/intern/cineon/logImageCore.h | 6 +- .../blender/imbuf/intern/cineon/logmemfile.c | 6 +- .../blender/imbuf/intern/cineon/logmemfile.h | 2 +- source/blender/imbuf/intern/scaling.c | 74 +- source/blender/include/BIF_meshtools.h | 2 +- source/blender/makesdna/DNA_ipo_types.h | 8 +- source/blender/makesdna/DNA_object_force.h | 3 + source/blender/makesdna/DNA_sensor_types.h | 10 + source/blender/makesdna/intern/makesdna.c | 8 +- source/blender/python/api2_2x/Draw.c | 6 + source/blender/python/api2_2x/Text3d.c | 46 + .../blender/python/api2_2x/doc/Mathutils.py | 9 + source/blender/python/api2_2x/doc/Text3d.py | 20 + source/blender/python/api2_2x/vector.c | 52 +- source/blender/python/api2_2x/vector.h | 1 + source/blender/radiosity/CMakeLists.txt | 2 +- source/blender/radiosity/SConscript | 2 +- .../blender/radiosity/intern/source/Makefile | 1 + .../blender/radiosity/intern/source/radnode.c | 10 +- .../radiosity/intern/source/radpreprocess.c | 4 +- source/blender/render/CMakeLists.txt | 2 +- source/blender/render/SConscript | 2 +- .../render/intern/include/render_types.h | 8 +- .../blender/render/intern/source/occlusion.c | 2 +- .../blender/render/intern/source/pipeline.c | 2 +- .../blender/render/intern/source/rendercore.c | 22 +- source/blender/render/intern/source/shadbuf.c | 16 +- source/blender/render/intern/source/strand.c | 4 +- source/blender/render/intern/source/zbuf.c | 8 +- source/blender/src/buttons_editing.c | 2 +- source/blender/src/buttons_logic.c | 54 +- source/blender/src/buttons_object.c | 2 + source/blender/src/buttons_scene.c | 7 +- source/blender/src/drawmesh.c | 8 +- source/blender/src/drawobject.c | 12 +- source/blender/src/editipo_lib.c | 2 +- source/blender/src/editkey.c | 6 +- source/blender/src/editmesh_mods.c | 5 +- source/blender/src/editmesh_tools.c | 8 +- source/blender/src/header_info.c | 4 +- source/blender/src/header_script.c | 8 +- source/blender/src/header_view3d.c | 4 +- source/blender/src/interface.c | 6 +- source/blender/src/meshlaplacian.c | 8 +- source/blender/src/meshtools.c | 16 +- source/blender/src/parametrizer.c | 4 +- source/blender/src/parametrizer.h | 4 +- source/blender/src/parametrizer_intern.h | 2 +- source/blender/src/renderwin.c | 4 +- source/blender/src/space.c | 6 +- source/blender/src/splash.jpg.c | 4574 ++++++----------- source/blender/src/toolbox.c | 22 +- source/blender/src/transform_conversions.c | 20 +- source/blender/src/transform_generics.c | 2 + .../blender/yafray/intern/export_Plugin.cpp | 2 +- .../Converter/BL_ActionActuator.cpp | 44 +- .../Converter/BL_BlenderDataConversion.cpp | 39 +- .../Converter/BL_ShapeActionActuator.cpp | 44 +- .../Converter/KX_ConvertActuators.cpp | 13 +- .../Converter/KX_ConvertSensors.cpp | 37 +- source/gameengine/Expressions/InputParser.cpp | 5 +- source/gameengine/Expressions/ListValue.cpp | 13 +- .../gameengine/Expressions/PyObjectPlus.cpp | 12 +- source/gameengine/Expressions/PyObjectPlus.h | 22 +- source/gameengine/Expressions/Value.cpp | 16 +- source/gameengine/Expressions/Value.h | 2 +- .../GameLogic/SCA_ActuatorSensor.cpp | 1 - .../gameengine/GameLogic/SCA_DelaySensor.cpp | 257 + source/gameengine/GameLogic/SCA_DelaySensor.h | 77 + .../gameengine/GameLogic/SCA_ILogicBrick.cpp | 3 +- source/gameengine/GameLogic/SCA_ISensor.cpp | 13 + source/gameengine/GameLogic/SCA_ISensor.h | 1 + .../GameLogic/SCA_PythonController.cpp | 4 +- source/gameengine/Ketsji/BL_Shader.cpp | 50 +- .../gameengine/Ketsji/KX_CameraActuator.cpp | 67 +- source/gameengine/Ketsji/KX_CameraActuator.h | 4 +- .../Ketsji/KX_ConstraintActuator.cpp | 9 - .../Ketsji/KX_ConstraintWrapper.cpp | 3 +- source/gameengine/Ketsji/KX_GameObject.cpp | 86 +- source/gameengine/Ketsji/KX_GameObject.h | 4 + source/gameengine/Ketsji/KX_IpoActuator.cpp | 8 - .../Ketsji/KX_MaterialIpoController.cpp | 10 +- source/gameengine/Ketsji/KX_MeshProxy.cpp | 2 +- .../gameengine/Ketsji/KX_ObjectActuator.cpp | 11 - .../gameengine/Ketsji/KX_ParentActuator.cpp | 68 +- source/gameengine/Ketsji/KX_ParentActuator.h | 4 +- .../Ketsji/KX_PhysicsObjectWrapper.cpp | 8 +- .../Ketsji/KX_PyConstraintBinding.cpp | 36 +- source/gameengine/Ketsji/KX_PythonInit.cpp | 3 +- .../Ketsji/KX_SCA_AddObjectActuator.cpp | 71 +- .../Ketsji/KX_SCA_AddObjectActuator.h | 4 +- .../gameengine/Ketsji/KX_TrackToActuator.cpp | 60 +- source/gameengine/Ketsji/KX_TrackToActuator.h | 4 +- .../gameengine/Ketsji/KX_VehicleWrapper.cpp | 27 +- source/gameengine/PyDoc/GameLogic.py | 1 + source/gameengine/PyDoc/KX_CameraActuator.py | 8 +- source/gameengine/PyDoc/KX_ParentActuator.py | 9 +- .../PyDoc/KX_SCA_AddObjectActuator.py | 13 +- source/gameengine/PyDoc/KX_TrackToActuator.py | 8 +- source/gameengine/PyDoc/SCA_DelaySensor.py | 56 + source/gameengine/PyDoc/SCA_ISensor.py | 6 + source/kernel/CMakeLists.txt | 2 +- source/kernel/SConscript | 2 +- source/kernel/gen_system/GEN_HashedPtr.cpp | 8 +- source/kernel/gen_system/Makefile | 1 + 151 files changed, 3599 insertions(+), 4156 deletions(-) create mode 100644 intern/guardedalloc/BLO_sys_types.h create mode 100644 intern/opennl/superlu/BLO_sys_types.h create mode 100644 source/gameengine/GameLogic/SCA_DelaySensor.cpp create mode 100644 source/gameengine/GameLogic/SCA_DelaySensor.h create mode 100644 source/gameengine/PyDoc/SCA_DelaySensor.py diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ea26750ec1..5b86ca8f21e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,7 +63,6 @@ OPTION(WITH_QUICKTIME "Enable Quicktime Support" OFF) OPTION(WITH_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON) OPTION(WITH_FFMPEG "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)" OFF) OPTION(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON) -OPTION(YESIAMSTUPID "Enable execution on 64-bit platforms" OFF) OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" OFF) IF(NOT WITH_GAMEENGINE AND WITH_PLAYER) diff --git a/intern/guardedalloc/BLO_sys_types.h b/intern/guardedalloc/BLO_sys_types.h new file mode 100644 index 00000000000..5ed3117c890 --- /dev/null +++ b/intern/guardedalloc/BLO_sys_types.h @@ -0,0 +1,125 @@ +/** + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + * A platform-independent definition of [u]intXX_t + * Plus the accompanying header include for htonl/ntohl + * + * This file includes to define [u]intXX_t types, where + * XX can be 8, 16, 32 or 64. Unfortunately, not all systems have this + * file. + * - Windows uses __intXX compiler-builtin types. These are signed, + * so we have to flip the signs. + * For these rogue platforms, we make the typedefs ourselves. + * + */ + +/* +// DG: original BLO_sys_types.h is in source/blender/blenkernel +// but is not allowed be accessed here because of bad-level-call +*/ + +#ifndef BLO_SYS_TYPES_H +#define BLO_SYS_TYPES_H + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_WIN32) && !defined(FREE_WINDOWS) + +/* The __intXX are built-in types of the visual complier! So we don't + * need to include anything else here. */ + +typedef signed __int8 int8_t; +typedef signed __int16 int16_t; +typedef signed __int32 int32_t; +typedef signed __int64 int64_t; + +typedef unsigned __int8 uint8_t; +typedef unsigned __int16 uint16_t; +typedef unsigned __int32 uint32_t; +typedef unsigned __int64 uint64_t; + +#ifndef _INTPTR_T_DEFINED +#ifdef _WIN64 +typedef __int64 intptr_t; +#else +typedef long intptr_t; +#endif +#define _INTPTR_T_DEFINED +#endif + +#ifndef _UINTPTR_T_DEFINED +#ifdef _WIN64 +typedef unsigned __int64 uintptr_t; +#else +typedef unsigned long uintptr_t; +#endif +#define _UINTPTR_T_DEFINED +#endif + +#elif defined(__linux__) + + /* Linux-i386, Linux-Alpha, Linux-ppc */ +#include + +#elif defined (__APPLE__) + +#include + +#elif defined(FREE_WINDOWS) + +#include + +#else + + /* FreeBSD, Irix, Solaris */ +#include + +#endif /* ifdef platform for types */ + +#ifdef _WIN32 +#ifndef htonl +#define htonl(x) correctByteOrder(x) +#endif +#ifndef ntohl +#define ntohl(x) correctByteOrder(x) +#endif +#elif defined (__FreeBSD__) || defined (__OpenBSD__) +#include +#elif defined (__APPLE__) +#include +#else /* irix sun linux */ +#include +#endif /* ifdef platform for htonl/ntohl */ + +#ifdef __cplusplus +} +#endif + +#endif /* eof */ + diff --git a/intern/guardedalloc/intern/mallocn.c b/intern/guardedalloc/intern/mallocn.c index 25f2fd8d269..a36549d0cc7 100644 --- a/intern/guardedalloc/intern/mallocn.c +++ b/intern/guardedalloc/intern/mallocn.c @@ -49,6 +49,8 @@ #include "MEM_guardedalloc.h" +#include "BLO_sys_types.h" // needed for intptr_t + /* --------------------------------------------------------------------- */ /* Data definition */ /* --------------------------------------------------------------------- */ @@ -112,7 +114,7 @@ static const char *check_memlist(MemHead *memh); volatile int totblock= 0; -volatile unsigned long mem_in_use= 0, mmap_in_use= 0; +volatile uintptr_t mem_in_use= 0, mmap_in_use= 0; static volatile struct localListBase _membase; static volatile struct localListBase *membase = &_membase; @@ -335,7 +337,7 @@ void *MEM_mapallocN(unsigned int len, const char *str) /* Memory statistics print */ typedef struct MemPrintBlock { const char *name; - unsigned long len; + uintptr_t len; int items; } MemPrintBlock; @@ -485,14 +487,14 @@ short MEM_freeN(void *vmemh) /* anders compileertie niet meer */ return(-1); } - if(sizeof(long)==8) { - if (((long) memh) & 0x7) { + if(sizeof(intptr_t)==8) { + if (((intptr_t) memh) & 0x7) { MemorY_ErroR("free","attempt to free illegal pointer"); return(-1); } } else { - if (((long) memh) & 0x3) { + if (((intptr_t) memh) & 0x3) { MemorY_ErroR("free","attempt to free illegal pointer"); return(-1); } diff --git a/intern/guardedalloc/intern/mmap_win.c b/intern/guardedalloc/intern/mmap_win.c index 436c99344a7..642cc16296e 100644 --- a/intern/guardedalloc/intern/mmap_win.c +++ b/intern/guardedalloc/intern/mmap_win.c @@ -151,7 +151,7 @@ void *mmap(void *start, size_t len, int prot, int flags, int fd, off_t offset) } /* munmap for windows */ -long munmap(void *ptr, long size) +intptr_t munmap(void *ptr, intptr_t size) { MemMap *mm = mmap_findlink(mmapbase, ptr); if (!mm) { diff --git a/intern/guardedalloc/make/msvc_7_0/guardedalloc.vcproj b/intern/guardedalloc/make/msvc_7_0/guardedalloc.vcproj index 40e88511d5d..974acef4e70 100644 --- a/intern/guardedalloc/make/msvc_7_0/guardedalloc.vcproj +++ b/intern/guardedalloc/make/msvc_7_0/guardedalloc.vcproj @@ -261,6 +261,9 @@ ECHO Done + + diff --git a/intern/guardedalloc/mmap_win.h b/intern/guardedalloc/mmap_win.h index f83a2d64b18..443c3b6f4ce 100644 --- a/intern/guardedalloc/mmap_win.h +++ b/intern/guardedalloc/mmap_win.h @@ -45,8 +45,10 @@ #define MAP_FAILED ((void *)-1) +#include "BLO_sys_types.h" // needed for intptr_t + void *mmap(void *start, size_t len, int prot, int flags, int fd, off_t offset); -long munmap(void *ptr, long size); +intptr_t munmap(void *ptr, intptr_t size); #endif diff --git a/intern/opennl/make/msvc_7_0/opennl.vcproj b/intern/opennl/make/msvc_7_0/opennl.vcproj index ec999b0c252..d302a2508ab 100644 --- a/intern/opennl/make/msvc_7_0/opennl.vcproj +++ b/intern/opennl/make/msvc_7_0/opennl.vcproj @@ -715,6 +715,9 @@ ECHO Done + + diff --git a/intern/opennl/superlu/BLO_sys_types.h b/intern/opennl/superlu/BLO_sys_types.h new file mode 100644 index 00000000000..5ed3117c890 --- /dev/null +++ b/intern/opennl/superlu/BLO_sys_types.h @@ -0,0 +1,125 @@ +/** + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + * A platform-independent definition of [u]intXX_t + * Plus the accompanying header include for htonl/ntohl + * + * This file includes to define [u]intXX_t types, where + * XX can be 8, 16, 32 or 64. Unfortunately, not all systems have this + * file. + * - Windows uses __intXX compiler-builtin types. These are signed, + * so we have to flip the signs. + * For these rogue platforms, we make the typedefs ourselves. + * + */ + +/* +// DG: original BLO_sys_types.h is in source/blender/blenkernel +// but is not allowed be accessed here because of bad-level-call +*/ + +#ifndef BLO_SYS_TYPES_H +#define BLO_SYS_TYPES_H + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_WIN32) && !defined(FREE_WINDOWS) + +/* The __intXX are built-in types of the visual complier! So we don't + * need to include anything else here. */ + +typedef signed __int8 int8_t; +typedef signed __int16 int16_t; +typedef signed __int32 int32_t; +typedef signed __int64 int64_t; + +typedef unsigned __int8 uint8_t; +typedef unsigned __int16 uint16_t; +typedef unsigned __int32 uint32_t; +typedef unsigned __int64 uint64_t; + +#ifndef _INTPTR_T_DEFINED +#ifdef _WIN64 +typedef __int64 intptr_t; +#else +typedef long intptr_t; +#endif +#define _INTPTR_T_DEFINED +#endif + +#ifndef _UINTPTR_T_DEFINED +#ifdef _WIN64 +typedef unsigned __int64 uintptr_t; +#else +typedef unsigned long uintptr_t; +#endif +#define _UINTPTR_T_DEFINED +#endif + +#elif defined(__linux__) + + /* Linux-i386, Linux-Alpha, Linux-ppc */ +#include + +#elif defined (__APPLE__) + +#include + +#elif defined(FREE_WINDOWS) + +#include + +#else + + /* FreeBSD, Irix, Solaris */ +#include + +#endif /* ifdef platform for types */ + +#ifdef _WIN32 +#ifndef htonl +#define htonl(x) correctByteOrder(x) +#endif +#ifndef ntohl +#define ntohl(x) correctByteOrder(x) +#endif +#elif defined (__FreeBSD__) || defined (__OpenBSD__) +#include +#elif defined (__APPLE__) +#include +#else /* irix sun linux */ +#include +#endif /* ifdef platform for htonl/ntohl */ + +#ifdef __cplusplus +} +#endif + +#endif /* eof */ + diff --git a/intern/opennl/superlu/smemory.c b/intern/opennl/superlu/smemory.c index 79da748671a..7eefb900673 100644 --- a/intern/opennl/superlu/smemory.c +++ b/intern/opennl/superlu/smemory.c @@ -8,6 +8,8 @@ */ #include "ssp_defs.h" +#include "BLO_sys_types.h" // needed for intptr_t + /* Constants */ #define NO_MEMTYPE 4 /* 0: lusup; 1: ucol; @@ -49,8 +51,8 @@ static int no_expand; /* Macros to manipulate stack */ #define StackFull(x) ( x + stack.used >= stack.size ) -#define NotDoubleAlign(addr) ( (long int)addr & 7 ) -#define DoubleAlign(addr) ( ((long int)addr + 7) & ~7L ) +#define NotDoubleAlign(addr) ( (intptr_t)addr & 7 ) +#define DoubleAlign(addr) ( ((intptr_t)addr + 7) & ~7L ) #define TempSpace(m, w) ( (2*w + 4 + NO_MARKER) * m * sizeof(int) + \ (w + 1) * m * sizeof(float) ) #define Reduce(alpha) ((alpha + 1) / 2) /* i.e. (alpha-1)/2 + 1 */ @@ -611,8 +613,8 @@ sStackCompress(GlobalLU_t *Glu) last = (char*)usub + xusub[ndim] * iword; fragment = (char*) (((char*)stack.array + stack.top1) - last); - stack.used -= (long int) fragment; - stack.top1 -= (long int) fragment; + stack.used -= (intptr_t) fragment; + stack.top1 -= (intptr_t) fragment; Glu->ucol = ucol; Glu->lsub = lsub; diff --git a/projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj b/projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj index 7e2db4f564f..5f14b5a09a1 100644 --- a/projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj +++ b/projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj @@ -347,6 +347,9 @@ + + @@ -465,6 +468,9 @@ + + diff --git a/projectfiles_vc7/kernel/system/SYS_system.vcproj b/projectfiles_vc7/kernel/system/SYS_system.vcproj index 50ffc1fbb99..3b239d9088b 100644 --- a/projectfiles_vc7/kernel/system/SYS_system.vcproj +++ b/projectfiles_vc7/kernel/system/SYS_system.vcproj @@ -125,7 +125,7 @@ *i`2Tqk5I?~qAR@rSe?tC*i1Z(Pe4!vC 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 YzI^PB&x@-g0Z5 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
L?&uPG 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 HNU#6d_4g2R diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index d951c8401e3..e1eb6718a30 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -40,8 +40,8 @@ extern "C" { struct ListBase; struct MemFile; -#define BLENDER_VERSION 246 -#define BLENDER_SUBVERSION 1 +#define BLENDER_VERSION 247 +#define BLENDER_SUBVERSION 0 #define BLENDER_MINVERSION 245 #define BLENDER_MINSUBVERSION 15 diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h index e84c7d30956..c84b690bc49 100644 --- a/source/blender/blenkernel/BKE_customdata.h +++ b/source/blender/blenkernel/BKE_customdata.h @@ -32,9 +32,11 @@ #ifndef BKE_CUSTOMDATA_H #define BKE_CUSTOMDATA_H +#include "BLO_sys_types.h" // for intptr_t support + struct CustomData; struct CustomDataLayer; -typedef long CustomDataMask; +typedef intptr_t CustomDataMask; extern const CustomDataMask CD_MASK_BAREMESH; extern const CustomDataMask CD_MASK_MESH; diff --git a/source/blender/blenkernel/BKE_effect.h b/source/blender/blenkernel/BKE_effect.h index 3763a659f2f..3b4c3198179 100644 --- a/source/blender/blenkernel/BKE_effect.h +++ b/source/blender/blenkernel/BKE_effect.h @@ -37,6 +37,7 @@ struct Effect; struct ListBase; struct Particle; struct Group; +struct RNG; typedef struct pEffectorCache { struct pEffectorCache *next, *prev; @@ -64,6 +65,11 @@ struct ListBase *pdInitEffectors(struct Object *obsrc, struct Group *group); void pdEndEffectors(struct ListBase *lb); void pdDoEffectors(struct ListBase *lb, float *opco, float *force, float *speed, float cur_time, float loc_time, unsigned int flags); +/* required for particle_system.c */ +void do_physical_effector(short type, float force_val, float distance, float falloff, float size, float damp, float *eff_velocity, float *vec_to_part, float *velocity, float *field, int planar, struct RNG *rng, float noise); +float effector_falloff(struct PartDeflect *pd, float *eff_velocity, float *vec_to_part); + + #endif diff --git a/source/blender/blenkernel/BKE_endian.h b/source/blender/blenkernel/BKE_endian.h index 1757103eaf6..dc5efd5ea46 100644 --- a/source/blender/blenkernel/BKE_endian.h +++ b/source/blender/blenkernel/BKE_endian.h @@ -33,11 +33,11 @@ #define BKE_ENDIANNESS(a) { \ union { \ - long l; \ - char c[sizeof (long)]; \ + intptr_t l; \ + char c[sizeof (intptr_t)]; \ } u; \ u.l = 1; \ - a = (u.c[sizeof (long) - 1] == 1) ? 1 : 0; \ + a = (u.c[sizeof (intptr_t) - 1] == 1) ? 1 : 0; \ } #endif diff --git a/source/blender/blenkernel/BKE_utildefines.h b/source/blender/blenkernel/BKE_utildefines.h index a96a3e10f40..f389521ffa0 100644 --- a/source/blender/blenkernel/BKE_utildefines.h +++ b/source/blender/blenkernel/BKE_utildefines.h @@ -197,8 +197,8 @@ /* Warning-free macros for storing ints in pointers. Use these _only_ * for storing an int in a pointer, not a pointer in an int (64bit)! */ -#define SET_INT_IN_POINTER(i) ((void*)(long)(i)) -#define GET_INT_FROM_POINTER(i) ((int)(long)(i)) +#define SET_INT_IN_POINTER(i) ((void*)(intptr_t)(i)) +#define GET_INT_FROM_POINTER(i) ((int)(intptr_t)(i)) #endif diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c index 9dcb6b6e7fa..1652b24e1e5 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf.c +++ b/source/blender/blenkernel/intern/CCGSubSurf.c @@ -7,6 +7,8 @@ #include "CCGSubSurf.h" +#include "BLO_sys_types.h" // for intptr_t support + /***/ typedef unsigned char byte; @@ -35,7 +37,7 @@ typedef struct _EHash { #define EHASH_alloc(eh, nb) ((eh)->allocatorIFC.alloc((eh)->allocator, nb)) #define EHASH_free(eh, ptr) ((eh)->allocatorIFC.free((eh)->allocator, ptr)) -#define EHASH_hash(eh, item) (((unsigned long) (item))%((unsigned int) (eh)->curSize)) +#define EHASH_hash(eh, item) (((uintptr_t) (item))%((unsigned int) (eh)->curSize)) static EHash *_ehash_new(int estimatedNumEntries, CCGAllocatorIFC *allocatorIFC, CCGAllocatorHDL allocator) { EHash *eh = allocatorIFC->alloc(allocator, sizeof(*eh)); diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 67cf89d5ee2..1dabab98a6e 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -79,6 +79,8 @@ #include "BKE_utildefines.h" #include "BKE_particle.h" +#include "BLO_sys_types.h" // for intptr_t support + #ifdef WITH_VERSE #include "BKE_verse.h" #endif @@ -479,7 +481,7 @@ static void emDM_foreachMappedEdge(DerivedMesh *dm, void (*func)(void *userData, EditVert *eve; for (i=0,eve=emdm->em->verts.first; eve; eve= eve->next) - eve->tmp.l = (long) i++; + eve->tmp.l = (intptr_t) i++; for(i=0,eed= emdm->em->edges.first; eed; i++,eed= eed->next) func(userData, i, emdm->vertexCos[(int) eed->v1->tmp.l], emdm->vertexCos[(int) eed->v2->tmp.l]); } else { @@ -497,7 +499,7 @@ static void emDM_drawMappedEdges(DerivedMesh *dm, int (*setDrawOptions)(void *us EditVert *eve; for (i=0,eve=emdm->em->verts.first; eve; eve= eve->next) - eve->tmp.l = (long) i++; + eve->tmp.l = (intptr_t) i++; glBegin(GL_LINES); for(i=0,eed= emdm->em->edges.first; eed; i++,eed= eed->next) { @@ -532,7 +534,7 @@ static void emDM_drawMappedEdgesInterp(DerivedMesh *dm, int (*setDrawOptions)(vo EditVert *eve; for (i=0,eve=emdm->em->verts.first; eve; eve= eve->next) - eve->tmp.l = (long) i++; + eve->tmp.l = (intptr_t) i++; glBegin(GL_LINES); for (i=0,eed= emdm->em->edges.first; eed; i++,eed= eed->next) { @@ -619,7 +621,7 @@ static void emDM_foreachMappedFaceCenter(DerivedMesh *dm, void (*func)(void *use if (emdm->vertexCos) { for (i=0,eve=emdm->em->verts.first; eve; eve= eve->next) - eve->tmp.l = (long) i++; + eve->tmp.l = (intptr_t) i++; } for(i=0,efa= emdm->em->faces.first; efa; i++,efa= efa->next) { @@ -637,7 +639,7 @@ static void emDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us EditVert *eve; for (i=0,eve=emdm->em->verts.first; eve; eve= eve->next) - eve->tmp.l = (long) i++; + eve->tmp.l = (intptr_t) i++; for (i=0,efa= emdm->em->faces.first; efa; i++,efa= efa->next) { int drawSmooth = (efa->flag & ME_SMOOTH); @@ -733,7 +735,7 @@ static void emDM_drawFacesTex_common(DerivedMesh *dm, EditVert *eve; for (i=0,eve=em->verts.first; eve; eve= eve->next) - eve->tmp.l = (long) i++; + eve->tmp.l = (intptr_t) i++; for (i=0,efa= em->faces.first; efa; i++,efa= efa->next) { MTFace *tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); @@ -1053,7 +1055,7 @@ void emDM_copyEdgeArray(DerivedMesh *dm, MEdge *edge_r) /* store vertex indices in tmp union */ for(ev = em->verts.first, i = 0; ev; ev = ev->next, ++i) - ev->tmp.l = (long) i; + ev->tmp.l = (intptr_t) i; for( ; ee; ee = ee->next, ++edge_r) { edge_r->crease = (unsigned char) (ee->crease*255.0f); @@ -1081,7 +1083,7 @@ void emDM_copyFaceArray(DerivedMesh *dm, MFace *face_r) /* store vertexes indices in tmp union */ for(ev = em->verts.first, i = 0; ev; ev = ev->next, ++i) - ev->tmp.l = (long) i; + ev->tmp.l = (intptr_t) i; for( ; ef; ef = ef->next, ++face_r) { face_r->mat_nr = ef->mat_nr; @@ -1168,7 +1170,7 @@ static DerivedMesh *getEditMeshDerivedMesh(EditMesh *em, Object *ob, int i; for (i=0,eve=em->verts.first; eve; eve= eve->next) - eve->tmp.l = (long) i++; + eve->tmp.l = (intptr_t) i++; emdm->vertexNos = MEM_callocN(sizeof(*emdm->vertexNos)*i, "emdm_vno"); emdm->faceNos = MEM_mallocN(sizeof(*emdm->faceNos)*totface, "emdm_vno"); diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index c7817b017ef..dbc94571cad 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -155,7 +155,7 @@ void cloth_init ( ClothModifierData *clmd ) BVHTree *bvhselftree_build_from_cloth (ClothModifierData *clmd, float epsilon) { - int i; + unsigned int i; BVHTree *bvhtree; Cloth *cloth = clmd->clothObject; ClothVertex *verts; @@ -196,7 +196,7 @@ BVHTree *bvhselftree_build_from_cloth (ClothModifierData *clmd, float epsilon) BVHTree *bvhtree_build_from_cloth (ClothModifierData *clmd, float epsilon) { - int i; + unsigned int i; BVHTree *bvhtree; Cloth *cloth = clmd->clothObject; ClothVertex *verts; @@ -782,11 +782,11 @@ static void cloth_to_object (Object *ob, ClothModifierData *clmd, DerivedMesh * /* can be optimized to do all groups in one loop */ static void cloth_apply_vgroup ( ClothModifierData *clmd, DerivedMesh *dm ) { - unsigned int i = 0; - unsigned int j = 0; + int i = 0; + int j = 0; MDeformVert *dvert = NULL; Cloth *clothObj = NULL; - unsigned int numverts = dm->getNumVerts ( dm ); + int numverts = dm->getNumVerts ( dm ); float goalfac = 0; ClothVertex *verts = NULL; @@ -857,7 +857,7 @@ static void cloth_apply_vgroup ( ClothModifierData *clmd, DerivedMesh *dm ) static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *dm, float framenr, int first) { - unsigned int i = 0; + int i = 0; MVert *mvert = NULL; ClothVertex *verts = NULL; float tnull[3] = {0,0,0}; @@ -1082,13 +1082,13 @@ int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm ) Cloth *cloth = clmd->clothObject; ClothSpring *spring = NULL, *tspring = NULL, *tspring2 = NULL; unsigned int struct_springs = 0, shear_springs=0, bend_springs = 0; - unsigned int i = 0; - unsigned int numverts = dm->getNumVerts ( dm ); - unsigned int numedges = dm->getNumEdges ( dm ); - unsigned int numfaces = dm->getNumFaces ( dm ); + int i = 0; + int numverts = dm->getNumVerts ( dm ); + int numedges = dm->getNumEdges ( dm ); + int numfaces = dm->getNumFaces ( dm ); MEdge *medge = CDDM_get_edges ( dm ); MFace *mface = CDDM_get_faces ( dm ); - unsigned int index2 = 0; // our second vertex index + int index2 = 0; // our second vertex index LinkNode **edgelist = NULL; EdgeHash *edgehash = NULL; LinkNode *search = NULL, *search2 = NULL; diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 298e4b81d5b..3b79f6689c0 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -88,6 +88,8 @@ #include "RE_pipeline.h" #include "RE_shader_ext.h" +#include "BLO_sys_types.h" // for intptr_t support + static void boundbox_displist(Object *ob); @@ -986,9 +988,9 @@ void filldisplist(ListBase *dispbase, ListBase *to) efa= fillfacebase.first; index= dlnew->index; while(efa) { - index[0]= (long)efa->v1->tmp.l; - index[1]= (long)efa->v2->tmp.l; - index[2]= (long)efa->v3->tmp.l; + index[0]= (intptr_t)efa->v1->tmp.l; + index[1]= (intptr_t)efa->v2->tmp.l; + index[2]= (intptr_t)efa->v3->tmp.l; index+= 3; efa= efa->next; diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 4588ef800e1..7620edac126 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -157,6 +157,13 @@ static void add_to_effectorcache(ListBase *lb, Object *ob, Object *obsrc) } } else if(pd->forcefield) { + + if(pd->forcefield == PFIELD_WIND) + { + pd->rng = rng_new(1); + rng_srandom(pd->rng, (unsigned int)(ceil(PIL_check_seconds_timer()))); // use better seed + } + ec= MEM_callocN(sizeof(pEffectorCache), "effector cache"); ec->ob= ob; BLI_addtail(lb, ec); @@ -205,13 +212,189 @@ void pdEndEffectors(ListBase *lb) pEffectorCache *ec; /* restore full copy */ for(ec= lb->first; ec; ec= ec->next) + { + if(ec->ob->pd && (ec->ob->pd->forcefield == PFIELD_WIND)) + rng_free(ec->ob->pd->rng); + *(ec->ob)= ec->obcopy; + } BLI_freelistN(lb); } } +/************************************************/ +/* Effectors */ +/************************************************/ + +// noise function for wind e.g. +static float wind_func(struct RNG *rng, float strength) +{ + int random = (rng_getInt(rng)+1) % 65535; // max 2357 + float force = rng_getFloat(rng) + 1.0f; + float ret; + float sign = 0; + + sign = (random > 32000.0) ? 1.0: -1.0; // dividing by 2 is not giving equal sign distribution + + ret = sign*((float)random / force)*strength/65535.0f; + + return ret; +} + + +static float falloff_func(float fac, int usemin, float mindist, int usemax, float maxdist, float power) +{ + if(!usemin) + mindist= 0.0f; + + if(fac < mindist) { + return 1.0f; + } + else if(usemax) { + if(fac>maxdist || (maxdist-mindist)<=0.0f) + return 0.0f; + + fac= (fac-mindist)/(maxdist-mindist); + return 1.0f - (float)pow((double)fac, (double)power); + } + else + return pow((double)1.0f+fac-mindist, (double)-power); +} + +static float falloff_func_dist(PartDeflect *pd, float fac) +{ + return falloff_func(fac, pd->flag&PFIELD_USEMIN, pd->mindist, pd->flag&PFIELD_USEMAX, pd->maxdist, pd->f_power); +} + +static float falloff_func_rad(PartDeflect *pd, float fac) +{ + return falloff_func(fac, pd->flag&PFIELD_USEMINR, pd->minrad, pd->flag&PFIELD_USEMAXR, pd->maxrad, pd->f_power_r); +} + +float effector_falloff(PartDeflect *pd, float *eff_velocity, float *vec_to_part) +{ + float eff_dir[3], temp[3]; + float falloff=1.0, fac, r_fac; + + VecCopyf(eff_dir,eff_velocity); + Normalize(eff_dir); + + if(pd->flag & PFIELD_POSZ && Inpf(eff_dir,vec_to_part)<0.0f) + falloff=0.0f; + else switch(pd->falloff){ + case PFIELD_FALL_SPHERE: + fac=VecLength(vec_to_part); + falloff= falloff_func_dist(pd, fac); + break; + + case PFIELD_FALL_TUBE: + fac=Inpf(vec_to_part,eff_dir); + falloff= falloff_func_dist(pd, ABS(fac)); + if(falloff == 0.0f) + break; + + VECADDFAC(temp,vec_to_part,eff_dir,-fac); + r_fac=VecLength(temp); + falloff*= falloff_func_rad(pd, r_fac); + break; + case PFIELD_FALL_CONE: + fac=Inpf(vec_to_part,eff_dir); + falloff= falloff_func_dist(pd, ABS(fac)); + if(falloff == 0.0f) + break; + + r_fac=saacos(fac/VecLength(vec_to_part))*180.0f/(float)M_PI; + falloff*= falloff_func_rad(pd, r_fac); + + break; + } + + return falloff; +} + +void do_physical_effector(short type, float force_val, float distance, float falloff, float size, float damp, float *eff_velocity, float *vec_to_part, float *velocity, float *field, int planar, struct RNG *rng, float noise) +{ + float mag_vec[3]={0,0,0}; + float temp[3], temp2[3]; + float eff_vel[3]; + float wind = 0; + + VecCopyf(eff_vel,eff_velocity); + Normalize(eff_vel); + + switch(type){ + case PFIELD_WIND: + VECCOPY(mag_vec,eff_vel); + + // add wind noise here + if(noise> 0.0f) + wind = wind_func(rng, noise); + + VecMulf(mag_vec,(force_val+wind)*falloff); + VecAddf(field,field,mag_vec); + break; + + case PFIELD_FORCE: + if(planar) + Projf(mag_vec,vec_to_part,eff_vel); + else + VecCopyf(mag_vec,vec_to_part); + + VecMulf(mag_vec,force_val*falloff); + VecAddf(field,field,mag_vec); + break; + + case PFIELD_VORTEX: + Crossf(mag_vec,eff_vel,vec_to_part); + Normalize(mag_vec); + + VecMulf(mag_vec,force_val*distance*falloff); + VecAddf(field,field,mag_vec); + + break; + case PFIELD_MAGNET: + if(planar) + VecCopyf(temp,eff_vel); + else + /* magnetic field of a moving charge */ + Crossf(temp,eff_vel,vec_to_part); + + Crossf(temp2,velocity,temp); + VecAddf(mag_vec,mag_vec,temp2); + + VecMulf(mag_vec,force_val*falloff); + VecAddf(field,field,mag_vec); + break; + case PFIELD_HARMONIC: + if(planar) + Projf(mag_vec,vec_to_part,eff_vel); + else + VecCopyf(mag_vec,vec_to_part); + + VecMulf(mag_vec,force_val*falloff); + VecSubf(field,field,mag_vec); + + VecCopyf(mag_vec,velocity); + /* 1.9 is an experimental value to get critical damping at damp=1.0 */ + VecMulf(mag_vec,damp*1.9f*(float)sqrt(force_val)); + VecSubf(field,field,mag_vec); + break; + case PFIELD_NUCLEAR: + /*pow here is root of cosine expression below*/ + //rad=(float)pow(2.0,-1.0/power)*distance/size; + //VECCOPY(mag_vec,vec_to_part); + //Normalize(mag_vec); + //VecMulf(mag_vec,(float)cos(3.0*M_PI/2.0*(1.0-1.0/(pow(rad,power)+1.0)))/(rad+0.2f)); + //VECADDFAC(field,field,mag_vec,force_val); + break; + } +} + + + + /* -------- pdDoEffectors() -------- generic force/speed system, now used for particles and softbodies lb = listbase with objects that take part in effecting @@ -244,13 +427,10 @@ void pdDoEffectors(ListBase *lb, float *opco, float *force, float *speed, float pEffectorCache *ec; PartDeflect *pd; float vect_to_vert[3]; - float f_force, force_vec[3]; float *obloc; - float distance, force_val, ffall_val; - float guidecollect[3], guidedist= 0.0f; - int cur_frame; - guidecollect[0]= guidecollect[1]= guidecollect[2]=0.0f; + float distance, vec_to_part[3]; + float falloff; /* Cycle through collected objects, get total of (1/(gravity_strength * dist^gravity_power)) */ /* Check for min distance here? (yes would be cool to add that, ton) */ @@ -261,178 +441,32 @@ void pdDoEffectors(ListBase *lb, float *opco, float *force, float *speed, float pd= ob->pd; /* Get IPO force strength and fall off values here */ - if (has_ipo_code(ob->ipo, OB_PD_FSTR)) - force_val = IPO_GetFloatValue(ob->ipo, OB_PD_FSTR, cur_time); - else - force_val = pd->f_strength; - - if (has_ipo_code(ob->ipo, OB_PD_FFALL)) - ffall_val = IPO_GetFloatValue(ob->ipo, OB_PD_FFALL, cur_time); - else - ffall_val = pd->f_power; - - /* Need to set r.cfra for paths (investigate, ton) (uses ob->ctime now, ton) */ - if(ob->ctime!=cur_time) { - cur_frame = G.scene->r.cfra; - G.scene->r.cfra = (int)cur_time; - where_is_object_time(ob, cur_time); - G.scene->r.cfra = cur_frame; - } + where_is_object_time(ob,cur_time); /* use center of object for distance calculus */ obloc= ob->obmat[3]; VECSUB(vect_to_vert, obloc, opco); distance = VecLength(vect_to_vert); - - if((pd->flag & PFIELD_USEMAX) && distance>pd->maxdist && pd->forcefield != PFIELD_GUIDE) + + VecSubf(vec_to_part, opco, ob->obmat[3]); + distance = VecLength(vec_to_part); + + falloff=effector_falloff(pd,ob->obmat[2],vec_to_part); + + if(falloff<=0.0f) ; /* don't do anything */ - else if((pd->flag & PFIELD_USEMIN) && distancemindist && pd->forcefield != PFIELD_GUIDE) - ; /* don't do anything */ - else if(pd->forcefield == PFIELD_WIND) { - VECCOPY(force_vec, ob->obmat[2]); + else { + float field[3]={0,0,0}, tmp[3]; + VECCOPY(field, force); + do_physical_effector(pd->forcefield,pd->f_strength,distance, + falloff,pd->f_dist,pd->f_damp,ob->obmat[2],vec_to_part, + speed,force,pd->flag&PFIELD_PLANAR, pd->rng, pd->f_noise); - /* wind works harder perpendicular to normal, would be nice for softbody later (ton) */ - - /* Limit minimum distance to vertex so that */ - /* the force is not too big */ - if (distance < 0.001) distance = 0.001f; - f_force = (force_val)*(1/(1000 * (float)pow((double)distance, (double)ffall_val))); - /* this option for softbody only */ - if(flags && PE_WIND_AS_SPEED){ - speed[0] -= (force_vec[0] * f_force ); - speed[1] -= (force_vec[1] * f_force ); - speed[2] -= (force_vec[2] * f_force ); - } - else{ - force[0] += force_vec[0]*f_force; - force[1] += force_vec[1]*f_force; - force[2] += force_vec[2]*f_force; + // for softbody backward compatibility + if(flags & PE_WIND_AS_SPEED){ + VECSUB(tmp, force, field); + VECSUB(speed, speed, tmp); } } - else if(pd->forcefield == PFIELD_FORCE) { - - /* only use center of object */ - obloc= ob->obmat[3]; - - /* Now calculate the gravitational force */ - VECSUB(vect_to_vert, obloc, opco); - distance = VecLength(vect_to_vert); - - /* Limit minimum distance to vertex so that */ - /* the force is not too big */ - if (distance < 0.001) distance = 0.001f; - f_force = (force_val)*(1.0/(1000.0 * (float)pow((double)distance, (double)ffall_val))); - force[0] += (vect_to_vert[0] * f_force ); - force[1] += (vect_to_vert[1] * f_force ); - force[2] += (vect_to_vert[2] * f_force ); - } - else if(pd->forcefield == PFIELD_VORTEX) { - float vortexvec[3]; - - /* only use center of object */ - obloc= ob->obmat[3]; - - /* Now calculate the vortex force */ - VECSUB(vect_to_vert, obloc, opco); - distance = VecLength(vect_to_vert); - - Crossf(force_vec, ob->obmat[2], vect_to_vert); - Normalize(force_vec); - - /* Limit minimum distance to vertex so that */ - /* the force is not too big */ - if (distance < 0.001) distance = 0.001f; - f_force = (force_val)*(1.0/(100.0 * (float)pow((double)distance, (double)ffall_val))); - vortexvec[0]= -(force_vec[0] * f_force ); - vortexvec[1]= -(force_vec[1] * f_force ); - vortexvec[2]= -(force_vec[2] * f_force ); - - /* this option for softbody only */ - if(flags &&PE_WIND_AS_SPEED) { - speed[0]+= vortexvec[0]; - speed[1]+= vortexvec[1]; - speed[2]+= vortexvec[2]; - } - else { - /* since vortex alters the speed, we have to correct for the previous vortex result */ - speed[0]+= vortexvec[0] - ec->oldspeed[0]; - speed[1]+= vortexvec[1] - ec->oldspeed[1]; - speed[2]+= vortexvec[2] - ec->oldspeed[2]; - - VECCOPY(ec->oldspeed, vortexvec); - } - } - else if(pd->forcefield == PFIELD_GUIDE) { - float guidevec[4], guidedir[3]; - float mindist= force_val; /* force_val is actually mindist in the UI */ - - distance= ec->guide_dist; - - /* WARNING: bails out with continue here */ - if((pd->flag & PFIELD_USEMAX) && distance>pd->maxdist) continue; - - /* calculate contribution factor for this guide */ - if(distance<=mindist) f_force= 1.0f; - else if(pd->flag & PFIELD_USEMAX) { - if(distance>pd->maxdist || mindist>=pd->maxdist) f_force= 0.0f; - else { - f_force= 1.0f - (distance-mindist)/(pd->maxdist - mindist); - if(ffall_val!=0.0f) - f_force = (float)pow(f_force, ffall_val+1.0); - } - } - else { - f_force= 1.0f/(1.0f + distance-mindist); - if(ffall_val!=0.0f) - f_force = (float)pow(f_force, ffall_val+1.0); - } - - /* now derive path point from loc_time */ - if(pd->flag & PFIELD_GUIDE_PATH_ADD) - where_on_path(ob, f_force*loc_time*ec->time_scale, guidevec, guidedir); - else - where_on_path(ob, loc_time*ec->time_scale, guidevec, guidedir); - - VECSUB(guidedir, guidevec, ec->oldloc); - VECCOPY(ec->oldloc, guidevec); - - Mat4Mul3Vecfl(ob->obmat, guidedir); - VecMulf(guidedir, ec->scale); /* correction for lifetime and speed */ - - /* we subtract the speed we gave it previous step */ - VECCOPY(guidevec, guidedir); - VECSUB(guidedir, guidedir, ec->oldspeed); - VECCOPY(ec->oldspeed, guidevec); - - /* if it fully contributes, we stop */ - if(f_force==1.0) { - VECCOPY(guidecollect, guidedir); - guidedist= 1.0f; - break; - } - else if(guidedist<1.0f) { - VecMulf(guidedir, f_force); - VECADD(guidecollect, guidecollect, guidedir); - guidedist += f_force; - } - } - } - - /* all guides are accumulated here */ - if(guidedist!=0.0f) { - if(guidedist!=1.0f) VecMulf(guidecollect, 1.0f/guidedist); - VECADD(speed, speed, guidecollect); } } - - -/* for paf start to end, store all matrices for objects */ -typedef struct pMatrixCache { - float obmat[4][4]; - float imat[3][3]; -} pMatrixCache; - -/* for fluidsim win32 debug messages */ -#if defined(WIN32) && (!(defined snprintf)) -#define snprintf _snprintf -#endif diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c index cab7865c1b6..b9e3c593ddf 100644 --- a/source/blender/blenkernel/intern/icons.c +++ b/source/blender/blenkernel/intern/icons.c @@ -50,6 +50,8 @@ #include "BKE_icons.h" #include "BKE_utildefines.h" +#include "BLO_sys_types.h" // for intptr_t support + #define GS(a) (*((short *)(a))) /* GLOBALS */ diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index b6c8ad59e08..07537e3a81c 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -86,6 +86,8 @@ #include "blendef.h" #include "BSE_time.h" +#include "BLO_sys_types.h" // for intptr_t support + /* max int, to indicate we don't store sequences in ibuf */ #define IMA_NO_INDEX 0x7FEFEFEF @@ -630,11 +632,11 @@ void free_old_images() } } -static unsigned long image_mem_size(Image *ima) +static uintptr_t image_mem_size(Image *ima) { ImBuf *ibuf, *ibufm; int level; - unsigned long size = 0; + uintptr_t size = 0; size= 0; for(ibuf= ima->ibufs.first; ibuf; ibuf= ibuf->next) { @@ -656,7 +658,7 @@ static unsigned long image_mem_size(Image *ima) void BKE_image_print_memlist(void) { Image *ima; - unsigned long size, totsize= 0; + uintptr_t size, totsize= 0; for(ima= G.main->image.first; ima; ima= ima->id.next) totsize += image_mem_size(ima); diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c index 297ac0b1530..0375ab22909 100644 --- a/source/blender/blenkernel/intern/implicit.c +++ b/source/blender/blenkernel/intern/implicit.c @@ -1354,25 +1354,57 @@ DO_INLINE void cloth_apply_spring_force(ClothModifierData *clmd, ClothSpring *s, } } + +static void CalcFloat( float *v1, float *v2, float *v3, float *n) +{ + float n1[3],n2[3]; + + n1[0]= v1[0]-v2[0]; + n2[0]= v2[0]-v3[0]; + n1[1]= v1[1]-v2[1]; + n2[1]= v2[1]-v3[1]; + n1[2]= v1[2]-v2[2]; + n2[2]= v2[2]-v3[2]; + n[0]= n1[1]*n2[2]-n1[2]*n2[1]; + n[1]= n1[2]*n2[0]-n1[0]*n2[2]; + n[2]= n1[0]*n2[1]-n1[1]*n2[0]; +} + +static void CalcFloat4( float *v1, float *v2, float *v3, float *v4, float *n) +{ + /* real cross! */ + float n1[3],n2[3]; + + n1[0]= v1[0]-v3[0]; + n1[1]= v1[1]-v3[1]; + n1[2]= v1[2]-v3[2]; + + n2[0]= v2[0]-v4[0]; + n2[1]= v2[1]-v4[1]; + n2[2]= v2[2]-v4[2]; + + n[0]= n1[1]*n2[2]-n1[2]*n2[1]; + n[1]= n1[2]*n2[0]-n1[0]*n2[2]; + n[2]= n1[0]*n2[1]-n1[1]*n2[0]; +} + float calculateVertexWindForce(float wind[3], float vertexnormal[3]) { - return fabs(INPR(wind, vertexnormal)); + return (INPR(wind, vertexnormal)); } void cloth_calc_force(ClothModifierData *clmd, lfVector *lF, lfVector *lX, lfVector *lV, fmatrix3x3 *dFdV, fmatrix3x3 *dFdX, ListBase *effectors, float time, fmatrix3x3 *M) { /* Collect forces and derivatives: F,dFdX,dFdV */ Cloth *cloth = clmd->clothObject; - long i = 0; + int i = 0; float spring_air = clmd->sim_parms->Cvi * 0.01f; /* viscosity of air scaled in percent */ float gravity[3]; float tm2[3][3] = {{-spring_air,0,0}, {0,-spring_air,0},{0,0,-spring_air}}; MFace *mfaces = cloth->mfaces; - //ClothVertex *verts = cloth->verts; - float wind_normalized[3]; unsigned int numverts = cloth->numverts; LinkNode *search = cloth->springs; - + lfVector *winvec; VECCOPY(gravity, clmd->sim_parms->gravity); mul_fvector_S(gravity, gravity, 0.001f); /* scale gravity force */ @@ -1387,7 +1419,7 @@ void cloth_calc_force(ClothModifierData *clmd, lfVector *lF, lfVector *lX, lfVec /* multiply lF with mass matrix // force = mass * acceleration (in this case: gravity) */ - for(i = 0; i < (long)numverts; i++) + for(i = 0; i < numverts; i++) { float temp[3]; VECCOPY(temp, lF[i]); @@ -1399,70 +1431,61 @@ void cloth_calc_force(ClothModifierData *clmd, lfVector *lF, lfVector *lX, lfVec /* handle external forces like wind */ if(effectors) { + // 0 = force, 1 = normalized force + winvec = create_lfvector(cloth->numverts); + + if(!winvec) + printf("winvec: out of memory in implicit.c\n"); + + // precalculate wind forces + for(i = 0; i < cloth->numverts; i++) + { + float speed[3] = {0.0f, 0.0f,0.0f}; + + pdDoEffectors(effectors, lX[i], winvec[i], speed, (float)G.scene->r.cfra, 0.0f, 0); + } + for(i = 0; i < cloth->numfaces; i++) { - float vertexnormal[3]={0,0,0}; - float speed[3] = {0.0f, 0.0f,0.0f}; - float force[3]= {0.0f, 0.0f, 0.0f}; + float trinormal[3]={0,0,0}; // normalized triangle normal + float triunnormal[3]={0,0,0}; // not-normalized-triangle normal + float tmp[3]={0,0,0}; + float factor = (mfaces[i].v4) ? 0.25 : 1.0 / 3.0; + factor *= 0.05; + // calculate face normal if(mfaces[i].v4) - CalcNormFloat4(lX[mfaces[i].v1],lX[mfaces[i].v2],lX[mfaces[i].v3],lX[mfaces[i].v4],vertexnormal); + CalcFloat4(lX[mfaces[i].v1],lX[mfaces[i].v2],lX[mfaces[i].v3],lX[mfaces[i].v4],triunnormal); else - CalcNormFloat(lX[mfaces[i].v1],lX[mfaces[i].v2],lX[mfaces[i].v3],vertexnormal); + CalcFloat(lX[mfaces[i].v1],lX[mfaces[i].v2],lX[mfaces[i].v3],triunnormal); - pdDoEffectors(effectors, lX[mfaces[i].v1], force, speed, (float)G.scene->r.cfra, 0.0f, PE_WIND_AS_SPEED); - VECCOPY(wind_normalized, speed); - Normalize(wind_normalized); - VecMulf(wind_normalized, -calculateVertexWindForce(speed, vertexnormal)); + VECCOPY(trinormal, triunnormal); + Normalize(trinormal); + // add wind from v1 + VECCOPY(tmp, trinormal); + VecMulf(tmp, calculateVertexWindForce(winvec[mfaces[i].v1], triunnormal)); + VECADDS(lF[mfaces[i].v1], lF[mfaces[i].v1], tmp, factor); + + // add wind from v2 + VECCOPY(tmp, trinormal); + VecMulf(tmp, calculateVertexWindForce(winvec[mfaces[i].v2], triunnormal)); + VECADDS(lF[mfaces[i].v2], lF[mfaces[i].v2], tmp, factor); + + // add wind from v3 + VECCOPY(tmp, trinormal); + VecMulf(tmp, calculateVertexWindForce(winvec[mfaces[i].v3], triunnormal)); + VECADDS(lF[mfaces[i].v3], lF[mfaces[i].v3], tmp, factor); + + // add wind from v4 if(mfaces[i].v4) { - VECADDS(lF[mfaces[i].v1], lF[mfaces[i].v1], wind_normalized, 0.25); + VECCOPY(tmp, trinormal); + VecMulf(tmp, calculateVertexWindForce(winvec[mfaces[i].v4], triunnormal)); + VECADDS(lF[mfaces[i].v4], lF[mfaces[i].v4], tmp, factor); } - else - { - VECADDS(lF[mfaces[i].v1], lF[mfaces[i].v1], wind_normalized, 1.0 / 3.0); - } - - speed[0] = speed[1] = speed[2] = 0.0; - pdDoEffectors(effectors, lX[mfaces[i].v2], force, speed, (float)G.scene->r.cfra, 0.0f, PE_WIND_AS_SPEED); - VECCOPY(wind_normalized, speed); - Normalize(wind_normalized); - VecMulf(wind_normalized, -calculateVertexWindForce(speed, vertexnormal)); - if(mfaces[i].v4) - { - VECADDS(lF[mfaces[i].v2], lF[mfaces[i].v2], wind_normalized, 0.25); - } - else - { - VECADDS(lF[mfaces[i].v2], lF[mfaces[i].v2], wind_normalized, 1.0 / 3.0); - } - - speed[0] = speed[1] = speed[2] = 0.0; - pdDoEffectors(effectors, lX[mfaces[i].v3], force, speed, (float)G.scene->r.cfra, 0.0f, PE_WIND_AS_SPEED); - VECCOPY(wind_normalized, speed); - Normalize(wind_normalized); - VecMulf(wind_normalized, -calculateVertexWindForce(speed, vertexnormal)); - if(mfaces[i].v4) - { - VECADDS(lF[mfaces[i].v3], lF[mfaces[i].v3], wind_normalized, 0.25); - } - else - { - VECADDS(lF[mfaces[i].v3], lF[mfaces[i].v3], wind_normalized, 1.0 / 3.0); - } - - speed[0] = speed[1] = speed[2] = 0.0; - if(mfaces[i].v4) - { - pdDoEffectors(effectors, lX[mfaces[i].v4], force, speed, (float)G.scene->r.cfra, 0.0f, PE_WIND_AS_SPEED); - VECCOPY(wind_normalized, speed); - Normalize(wind_normalized); - VecMulf(wind_normalized, -calculateVertexWindForce(speed, vertexnormal)); - VECADDS(lF[mfaces[i].v4], lF[mfaces[i].v4], wind_normalized, 0.25); - } - } + del_lfvector(winvec); } // calculate spring forces diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 59eb3837aab..fe92edfbbd5 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -182,7 +182,7 @@ int part_ar[PART_TOTIPO]= { PART_EMIT_FREQ, PART_EMIT_LIFE, PART_EMIT_VEL, PART_EMIT_AVE, PART_EMIT_SIZE, PART_AVE, PART_SIZE, PART_DRAG, PART_BROWN, PART_DAMP, PART_LENGTH, PART_CLUMP, PART_GRAV_X, PART_GRAV_Y, PART_GRAV_Z, PART_KINK_AMP, PART_KINK_FREQ, PART_KINK_SHAPE, - PART_BB_TILT + PART_BB_TILT, PART_PD_FSTR, PART_PD_FFALL, PART_PD_FMAXD }; @@ -1608,6 +1608,12 @@ void *get_ipo_poin(ID *id, IpoCurve *icu, int *type) poin= &(part->kink_shape); break; case PART_BB_TILT: poin= &(part->bb_tilt); break; + case PART_PD_FSTR: + poin= (part->pd?(&(part->pd->f_strength)):NULL); break; + case PART_PD_FFALL: + poin= (part->pd?(&(part->pd->f_power)):NULL); break; + case PART_PD_FMAXD: + poin= (part->pd?(&(part->pd->maxdist)):NULL); break; } } diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index d1c0cdec71d..60fdbca2021 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -2205,177 +2205,6 @@ static int get_particles_from_cache(Object *ob, ParticleSystem *psys, int cfra) return 1; } -/************************************************/ -/* Effectors */ -/************************************************/ -static float falloff_func(float fac, int usemin, float mindist, int usemax, float maxdist, float power) -{ - if(!usemin) - mindist= 0.0f; - - if(fac < mindist) { - return 1.0f; - } - else if(usemax) { - if(fac>maxdist || (maxdist-mindist)<=0.0f) - return 0.0f; - - fac= (fac-mindist)/(maxdist-mindist); - return 1.0f - (float)pow((double)fac, (double)power); - } - else - return pow((double)1.0f+fac-mindist, (double)-power); -} - -static float falloff_func_dist(PartDeflect *pd, float fac) -{ - return falloff_func(fac, pd->flag&PFIELD_USEMIN, pd->mindist, pd->flag&PFIELD_USEMAX, pd->maxdist, pd->f_power); -} - -static float falloff_func_rad(PartDeflect *pd, float fac) -{ - return falloff_func(fac, pd->flag&PFIELD_USEMINR, pd->minrad, pd->flag&PFIELD_USEMAXR, pd->maxrad, pd->f_power_r); -} - -static float effector_falloff(PartDeflect *pd, float *eff_velocity, float *vec_to_part) -{ - float eff_dir[3], temp[3]; - float falloff=1.0, fac, r_fac; - - VecCopyf(eff_dir,eff_velocity); - Normalize(eff_dir); - - if(pd->flag & PFIELD_POSZ && Inpf(eff_dir,vec_to_part)<0.0f) - falloff=0.0f; - else switch(pd->falloff){ - case PFIELD_FALL_SPHERE: - fac=VecLength(vec_to_part); - falloff= falloff_func_dist(pd, fac); - break; - - case PFIELD_FALL_TUBE: - fac=Inpf(vec_to_part,eff_dir); - falloff= falloff_func_dist(pd, ABS(fac)); - if(falloff == 0.0f) - break; - - VECADDFAC(temp,vec_to_part,eff_dir,-fac); - r_fac=VecLength(temp); - falloff*= falloff_func_rad(pd, r_fac); - break; - case PFIELD_FALL_CONE: - fac=Inpf(vec_to_part,eff_dir); - falloff= falloff_func_dist(pd, ABS(fac)); - if(falloff == 0.0f) - break; - - r_fac=saacos(fac/VecLength(vec_to_part))*180.0f/(float)M_PI; - falloff*= falloff_func_rad(pd, r_fac); - - break; -// case PFIELD_FALL_INSIDE: - //for(i=0; iv1].co); - // VECCOPY(v2,mvert[mface->v2].co); - // VECCOPY(v3,mvert[mface->v3].co); - - // if(AxialLineIntersectsTriangle(a,co1, co2, v2, v3, v1, &lambda)){ - // if(from==PART_FROM_FACE) - // (pa+(int)(lambda*size[a])*a0mul)->flag &= ~PARS_UNEXIST; - // else /* store number of intersections */ - // (pa+(int)(lambda*size[a])*a0mul)->loop++; - // } - // - // if(mface->v4){ - // VECCOPY(v4,mvert[mface->v4].co); - - // if(AxialLineIntersectsTriangle(a,co1, co2, v4, v1, v3, &lambda)){ - // if(from==PART_FROM_FACE) - // (pa+(int)(lambda*size[a])*a0mul)->flag &= ~PARS_UNEXIST; - // else - // (pa+(int)(lambda*size[a])*a0mul)->loop++; - // } - // } - //} - -// break; - } - - return falloff; -} -static void do_physical_effector(short type, float force_val, float distance, float falloff, float size, float damp, - float *eff_velocity, float *vec_to_part, float *velocity, float *field, int planar) -{ - float mag_vec[3]={0,0,0}; - float temp[3], temp2[3]; - float eff_vel[3]; - - VecCopyf(eff_vel,eff_velocity); - Normalize(eff_vel); - - switch(type){ - case PFIELD_WIND: - VECCOPY(mag_vec,eff_vel); - - VecMulf(mag_vec,force_val*falloff); - VecAddf(field,field,mag_vec); - break; - - case PFIELD_FORCE: - if(planar) - Projf(mag_vec,vec_to_part,eff_vel); - else - VecCopyf(mag_vec,vec_to_part); - - VecMulf(mag_vec,force_val*falloff); - VecAddf(field,field,mag_vec); - break; - - case PFIELD_VORTEX: - Crossf(mag_vec,eff_vel,vec_to_part); - Normalize(mag_vec); - - VecMulf(mag_vec,force_val*distance*falloff); - VecAddf(field,field,mag_vec); - - break; - case PFIELD_MAGNET: - if(planar) - VecCopyf(temp,eff_vel); - else - /* magnetic field of a moving charge */ - Crossf(temp,eff_vel,vec_to_part); - - Crossf(temp2,velocity,temp); - VecAddf(mag_vec,mag_vec,temp2); - - VecMulf(mag_vec,force_val*falloff); - VecAddf(field,field,mag_vec); - break; - case PFIELD_HARMONIC: - if(planar) - Projf(mag_vec,vec_to_part,eff_vel); - else - VecCopyf(mag_vec,vec_to_part); - - VecMulf(mag_vec,force_val*falloff); - VecSubf(field,field,mag_vec); - - VecCopyf(mag_vec,velocity); - /* 1.9 is an experimental value to get critical damping at damp=1.0 */ - VecMulf(mag_vec,damp*1.9f*(float)sqrt(force_val)); - VecSubf(field,field,mag_vec); - break; - case PFIELD_NUCLEAR: - /*pow here is root of cosine expression below*/ - //rad=(float)pow(2.0,-1.0/power)*distance/size; - //VECCOPY(mag_vec,vec_to_part); - //Normalize(mag_vec); - //VecMulf(mag_vec,(float)cos(3.0*M_PI/2.0*(1.0-1.0/(pow(rad,power)+1.0)))/(rad+0.2f)); - //VECADDFAC(field,field,mag_vec,force_val); - break; - } -} static void do_texture_effector(Tex *tex, short mode, short is_2d, float nabla, short object, float *pa_co, float obmat[4][4], float force_val, float falloff, float *field) { TexResult result[4]; @@ -2788,7 +2617,7 @@ void do_effectors(int pa_no, ParticleData *pa, ParticleKey *state, Object *ob, P } else { do_physical_effector(pd->forcefield,pd->f_strength,distance, falloff,pd->f_dist,pd->f_damp,eob->obmat[2],vec_to_part, - pa->state.vel,force_field,pd->flag&PFIELD_PLANAR); + pa->state.vel,force_field,pd->flag&PFIELD_PLANAR, pd->rng, pd->f_noise); } } if(ec->type & PSYS_EC_PARTICLE){ @@ -2837,7 +2666,7 @@ void do_effectors(int pa_no, ParticleData *pa, ParticleKey *state, Object *ob, P else do_physical_effector(pd->forcefield,pd->f_strength,distance, falloff,epart->size,pd->f_damp,estate.vel,vec_to_part, - state->vel,force_field,0); + state->vel,force_field,0, pd->rng, pd->f_noise); } else if(pd->forcefield==PFIELD_HARMONIC && cfra-framestep <= epa->dietime && cfra>epa->dietime){ /* first step after key release */ @@ -3948,27 +3777,44 @@ static void boid_body(BoidVecFunc *bvf, ParticleData *pa, ParticleSystem *psys, bvf->Addf(dvec,dvec,bvec); bvf->Addf(state->co,state->co,dvec); - /* air speed from wind effectors */ - if(psys->effectors.first){ + /* air speed from wind and vortex effectors */ + if(psys->effectors.first) { ParticleEffectorCache *ec; - for(ec=psys->effectors.first; ec; ec=ec->next){ - if(ec->type & PSYS_EC_EFFECTOR){ + for(ec=psys->effectors.first; ec; ec=ec->next) { + if(ec->type & PSYS_EC_EFFECTOR) { Object *eob = ec->ob; PartDeflect *pd = eob->pd; + float direction[3], vec_to_part[3]; + float falloff; - if(pd->forcefield==PFIELD_WIND && pd->f_strength!=0.0){ - float distance, wind[3]; - VecCopyf(wind,eob->obmat[2]); - distance=VecLenf(state->co,eob->obmat[3]); + if(pd->f_strength != 0.0f) { + VecCopyf(direction, eob->obmat[2]); + VecSubf(vec_to_part, state->co, eob->obmat[3]); - if (distance < 0.001) distance = 0.001f; + falloff=effector_falloff(pd, direction, vec_to_part); - if(pd->flag&PFIELD_USEMAX && distance > pd->maxdist) - ; - else{ - Normalize(wind); - VecMulf(wind,pd->f_strength/(float)pow((double)distance,(double)pd->f_power)); - bvf->Addf(state->co,state->co,wind); + switch(pd->forcefield) { + case PFIELD_WIND: + if(falloff <= 0.0f) + ; /* don't do anything */ + else { + Normalize(direction); + VecMulf(direction, pd->f_strength * falloff); + bvf->Addf(state->co, state->co, direction); + } + break; + case PFIELD_VORTEX: + { + float distance, mag_vec[3]; + Crossf(mag_vec, direction, vec_to_part); + Normalize(mag_vec); + + distance = VecLength(vec_to_part); + + VecMulf(mag_vec, pd->f_strength * distance * falloff); + bvf->Addf(state->co, state->co, mag_vec); + break; + } } } } diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c index fcf1c7ce311..47d11bb9d29 100644 --- a/source/blender/blenkernel/intern/sca.c +++ b/source/blender/blenkernel/intern/sca.c @@ -153,6 +153,9 @@ void init_sensor(bSensor *sens) case SENS_ACTUATOR: sens->data= MEM_callocN(sizeof(bActuatorSensor), "actsens"); break; + case SENS_DELAY: + sens->data= MEM_callocN(sizeof(bDelaySensor), "delaysens"); + break; case SENS_MOUSE: ms=sens->data= MEM_callocN(sizeof(bMouseSensor), "mousesens"); ms->type= LEFTMOUSE; diff --git a/source/blender/blenlib/BLI_editVert.h b/source/blender/blenlib/BLI_editVert.h index d42663e17c7..447f6a2a485 100644 --- a/source/blender/blenlib/BLI_editVert.h +++ b/source/blender/blenlib/BLI_editVert.h @@ -38,6 +38,8 @@ #include "DNA_customdata_types.h" #include "DNA_mesh_types.h" +#include "BLO_sys_types.h" // for intptr_t support + struct DerivedMesh; struct RetopoPaintData; @@ -53,7 +55,7 @@ typedef struct EditVert struct EditEdge *e; struct EditFace *f; void *p; - long l; + intptr_t l; float fp; } tmp; float no[3]; /*vertex normal */ @@ -95,7 +97,7 @@ typedef struct EditEdge struct EditEdge *e; struct EditFace *f; void *p; - long l; + intptr_t l; float fp; } tmp; short f1, f2; /* short, f1 is (ab)used in subdiv */ @@ -122,7 +124,7 @@ typedef struct EditFace struct EditEdge *e; struct EditFace *f; void *p; - long l; + intptr_t l; float fp; } tmp; float n[3], cent[3]; diff --git a/source/blender/blenlib/BLI_rand.h b/source/blender/blenlib/BLI_rand.h index 0e534783c17..266aa347aff 100644 --- a/source/blender/blenlib/BLI_rand.h +++ b/source/blender/blenlib/BLI_rand.h @@ -44,6 +44,7 @@ struct RNG* rng_new (unsigned int seed); void rng_free (struct RNG* rng); void rng_seed (struct RNG* rng, unsigned int seed); +void rng_srandom(struct RNG *rng, unsigned int seed); int rng_getInt (struct RNG* rng); double rng_getDouble (struct RNG* rng); float rng_getFloat (struct RNG* rng); diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c index 227cb8f5e9a..e9271ca3bb5 100644 --- a/source/blender/blenlib/intern/BLI_ghash.c +++ b/source/blender/blenlib/intern/BLI_ghash.c @@ -34,6 +34,8 @@ #include "MEM_guardedalloc.h" #include "BLI_ghash.h" +#include "BLO_sys_types.h" // for intptr_t support + #ifdef HAVE_CONFIG_H #include #endif @@ -256,11 +258,7 @@ int BLI_ghashutil_ptrcmp(void *a, void *b) { } unsigned int BLI_ghashutil_inthash(void *ptr) { -#if defined(_WIN64) - unsigned __int64 key = (unsigned __int64)ptr; -#else - unsigned long key = (unsigned long)ptr; -#endif + uintptr_t key = (uintptr_t)ptr; key += ~(key << 16); key ^= (key >> 5); diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index d0db13371b0..d20143f80e7 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -634,6 +634,18 @@ static void non_recursive_bvh_div_nodes(BVHTree *tree, BVHNode *branches_array, BVHBuildHelper data; int depth; + //Most of bvhtree code relies on 1-leaf trees having at least one branch + //We handle that special case here + if(num_leafs == 1) + { + BVHNode *root = branches_array+0; + refit_kdop_hull(tree, root, 0, num_leafs); + root->main_axis = get_largest_axis(root->bv) / 2; + root->totnode = 1; + root->children[0] = leafs_array[0]; + return; + } + branches_array--; //Implicit trees use 1-based indexs build_implicit_tree_helper(tree, &data); diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index 96de5e99f4f..2acbbbe6712 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -62,6 +62,8 @@ #include "BKE_utildefines.h" #include +#include "BLO_sys_types.h" // for intptr_t support + /* implementations: */ char *first_slash(char *string) { char *ffslash, *fbslash; @@ -72,7 +74,7 @@ char *first_slash(char *string) { if (!ffslash) return fbslash; else if (!fbslash) return ffslash; - if ((long)ffslash < (long)fbslash) return ffslash; + if ((intptr_t)ffslash < (intptr_t)fbslash) return ffslash; else return fbslash; } @@ -85,7 +87,7 @@ char *BLI_last_slash(const char *string) { if (!lfslash) return lbslash; else if (!lbslash) return lfslash; - if ((long)lfslash < (long)lbslash) return lbslash; + if ((intptr_t)lfslash < (intptr_t)lbslash) return lbslash; else return lfslash; } diff --git a/source/blender/blenlib/intern/psfont.c b/source/blender/blenlib/intern/psfont.c index 498c87cdef9..216246dcdd7 100644 --- a/source/blender/blenlib/intern/psfont.c +++ b/source/blender/blenlib/intern/psfont.c @@ -43,6 +43,8 @@ #include "DNA_packedFile_types.h" #include "DNA_curve_types.h" +#include "BLO_sys_types.h" // for intptr_t support + #ifdef HAVE_CONFIG_H #include #endif @@ -54,7 +56,7 @@ typedef struct chardesc { short llx, lly; /* bounding box */ short urx, ury; short *data; /* char data */ - long datalen; + intptr_t datalen; } chardesc; typedef struct objfnt { diff --git a/source/blender/blenlib/intern/rand.c b/source/blender/blenlib/intern/rand.c index ccc478203fe..c484a307393 100644 --- a/source/blender/blenlib/intern/rand.c +++ b/source/blender/blenlib/intern/rand.c @@ -81,6 +81,16 @@ void rng_seed(RNG *rng, unsigned int seed) { rng->X= (((r_uint64) seed)<<16) | LOWSEED; } +void rng_srandom(RNG *rng, unsigned int seed) { + extern unsigned char hash[]; // noise.c + + rng_seed(rng, seed + hash[seed & 255]); + seed= rng_getInt(rng); + rng_seed(rng, seed + hash[seed & 255]); + seed= rng_getInt(rng); + rng_seed(rng, seed + hash[seed & 255]); +} + int rng_getInt(RNG *rng) { rng->X= (MULTIPLIER*rng->X + ADDEND)&MASK; return (int) (rng->X>>17); @@ -132,13 +142,7 @@ void BLI_srand(unsigned int seed) { /* using hash table to create better seed */ void BLI_srandom(unsigned int seed) { - extern unsigned char hash[]; // noise.c - - rng_seed(&theBLI_rng, seed + hash[seed & 255]); - seed= rng_getInt(&theBLI_rng); - rng_seed(&theBLI_rng, seed + hash[seed & 255]); - seed= rng_getInt(&theBLI_rng); - rng_seed(&theBLI_rng, seed + hash[seed & 255]); + rng_srandom(&theBLI_rng, seed); } int BLI_rand(void) { diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index 48ebf770e1b..a31121148e3 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -1970,7 +1970,7 @@ void BLI_timestr(double _time, char *str) int BLI_int_from_pointer(void *poin) { - long lval= (long)poin; + intptr_t lval= (intptr_t)poin; return (int)(lval>>3); } @@ -1978,17 +1978,17 @@ int BLI_int_from_pointer(void *poin) void *BLI_pointer_from_int(int val) { static int firsttime= 1; - static long basevalue= 0; + static intptr_t basevalue= 0; if(firsttime) { void *poin= malloc(10000); - basevalue= (long)poin; + basevalue= (intptr_t)poin; basevalue &= ~PMASK; printf("base: %d pointer %p\n", basevalue, poin); /* debug */ firsttime= 0; free(poin); } - return (void *)(basevalue | (((long)val)<<3)); + return (void *)(basevalue | (((intptr_t)val)<<3)); } #else diff --git a/source/blender/blenloader/BLO_sys_types.h b/source/blender/blenloader/BLO_sys_types.h index a1885894fe3..a9d29375eac 100644 --- a/source/blender/blenloader/BLO_sys_types.h +++ b/source/blender/blenloader/BLO_sys_types.h @@ -43,11 +43,6 @@ #ifdef __cplusplus extern "C" { #endif - -#ifdef FREE_WINDOWS -typedef unsigned char uint8_t; -typedef unsigned int uint32_t; -#endif #if defined(_WIN32) && !defined(FREE_WINDOWS) @@ -64,6 +59,14 @@ typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; typedef unsigned __int64 uint64_t; +#ifdef _WIN64 +typedef __int64 intptr_t; +typedef unsigned __int64 uintptr_t; +#else +typedef long intptr_t; +typedef unsigned long uintptr_t; +#endif + #elif defined(__linux__) /* Linux-i386, Linux-Alpha, Linux-ppc */ @@ -73,6 +76,10 @@ typedef unsigned __int64 uint64_t; #include +#elif defined(FREE_WINDOWS) + +#include + #else /* FreeBSD, Irix, Solaris */ diff --git a/source/blender/blenloader/intern/genfile.c b/source/blender/blenloader/intern/genfile.c index 87c859de839..86338ca9e89 100644 --- a/source/blender/blenloader/intern/genfile.c +++ b/source/blender/blenloader/intern/genfile.c @@ -58,6 +58,8 @@ #include "genfile.h" +#include "BLO_sys_types.h" // for intptr_t support + /* gcc 4.1 on mingw was complaining that __int64 was alredy defined actually is saw the line below as typedef long long long long... Anyhow, since its alredy defined, its safe to do an ifndef here- Cambpell*/ @@ -315,7 +317,7 @@ static void init_structDNA(struct SDNA *sdna, int do_endian_swap) /* in sdna->data the data, now we convert that to something understandable */ { int *data, *verg; - long nr; + intptr_t nr; short *sp; char str[8], *cp; @@ -351,7 +353,7 @@ static void init_structDNA(struct SDNA *sdna, int do_endian_swap) cp++; nr++; } - nr= (long)cp; /* prevent BUS error */ + nr= (intptr_t)cp; /* prevent BUS error */ nr= (nr+3) & ~3; cp= (char *)nr; @@ -389,7 +391,7 @@ static void init_structDNA(struct SDNA *sdna, int do_endian_swap) cp++; nr++; } - nr= (long)cp; /* prevent BUS error */ + nr= (intptr_t)cp; /* prevent BUS error */ nr= (nr+3) & ~3; cp= (char *)nr; @@ -1098,7 +1100,7 @@ int dna_elem_offset(struct SDNA *sdna, char *stype, char *vartype, char *name) int SDNAnr= dna_findstruct_nr(sdna, stype); short *spo= sdna->structs[SDNAnr]; char *cp= find_elem(sdna, vartype, name, spo, NULL, NULL); - return (int)((long)cp); + return (int)((intptr_t)cp); } diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c index f56b261efe2..5a75b5c8b11 100644 --- a/source/blender/blenloader/intern/readblenentry.c +++ b/source/blender/blenloader/intern/readblenentry.c @@ -63,6 +63,8 @@ #include "BLO_readblenfile.h" +#include "BLO_sys_types.h" // needed for intptr_t + /** * IDType stuff, I plan to move this * out into its own file + prefix, and @@ -193,7 +195,7 @@ void BLO_blendhandle_print_sizes(BlendHandle *bh, void *fp) buf[2]= buf[2]?buf[2]:' '; buf[3]= buf[3]?buf[3]:' '; - fprintf(fp, "['%.4s', '%s', %d, %ld ], \n", buf, name, bhead->nr, (long)bhead->len+sizeof(BHead)); + fprintf(fp, "['%.4s', '%s', %d, %ld ], \n", buf, name, bhead->nr, (intptr_t)bhead->len+sizeof(BHead)); } } fprintf(fp, "]\n"); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 70ead610cc3..9d7a0302d45 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2949,11 +2949,9 @@ static void lib_link_object(FileData *fd, Main *main) sens= ob->sensors.first; while(sens) { - if(ob->id.lib==NULL) { // done in expand_main - for(a=0; atotlinks; a++) { - sens->links[a]= newglobadr(fd, sens->links[a]); - } - } + for(a=0; atotlinks; a++) + sens->links[a]= newglobadr(fd, sens->links[a]); + if(sens->type==SENS_TOUCH) { bTouchSensor *ts= sens->data; ts->ma= newlibadr(fd, ob->id.lib, ts->ma); @@ -2968,11 +2966,9 @@ static void lib_link_object(FileData *fd, Main *main) cont= ob->controllers.first; while(cont) { - if(ob->id.lib==NULL) { // done in expand_main - for(a=0; atotlinks; a++) { - cont->links[a]= newglobadr(fd, cont->links[a]); - } - } + for(a=0; atotlinks; a++) + cont->links[a]= newglobadr(fd, cont->links[a]); + if(cont->type==CONT_PYTHON) { bPythonCont *pc= cont->data; pc->text= newlibadr(fd, ob->id.lib, pc->text); @@ -3600,9 +3596,9 @@ static void direct_link_scene(FileData *fd, Scene *sce) { Sequence temp; char *poin; - long offset; + intptr_t offset; - offset= ((long)&(temp.seqbase)) - ((long)&temp); + offset= ((intptr_t)&(temp.seqbase)) - ((intptr_t)&temp); /* root pointer */ if(ed->seqbasep == old_seqbasep) { @@ -4101,7 +4097,7 @@ static void direct_link_screen(FileData *fd, bScreen *sc) while(se) { se->v1= newdataadr(fd, se->v1); se->v2= newdataadr(fd, se->v2); - if( (long)se->v1 > (long)se->v2) { + if( (intptr_t)se->v1 > (intptr_t)se->v2) { sv= se->v1; se->v1= se->v2; se->v2= sv; @@ -7737,31 +7733,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main) idproperties_fix_group_lengths(main->brush); idproperties_fix_group_lengths(main->particle); } - - /* only needed until old bad svn/RC1,2 files are saved with a > 17 version -dg */ - if(main->versionfile == 245 && main->subversionfile < 17) { - ModifierData *md; - Object *ob; - - for(ob = main->object.first; ob; ob= ob->id.next) { - for(md=ob->modifiers.first; md; ) { - if(md->type==eModifierType_Cloth) { - ModifierData *next; - MEM_freeN(((ClothModifierData *)md)->sim_parms); - MEM_freeN(((ClothModifierData *)md)->coll_parms); - MEM_freeN(((ClothModifierData *)md)->point_cache); - ((ClothModifierData *)md)->sim_parms = NULL; - ((ClothModifierData *)md)->coll_parms = NULL; - ((ClothModifierData *)md)->point_cache = NULL; - next=md->next; - BLI_remlink(&ob->modifiers, md); - md = next; - } - else - md = md->next; - } - } - } /* sun/sky */ if(main->versionfile < 246) { @@ -7788,6 +7759,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main) for(me=main->mesh.first; me; me= me->id.next) alphasort_version_246(fd, lib, me); } + + if(main->versionfile <= 246 && main->subversionfile < 1){ + Object *ob; + for(ob = main->object.first; ob; ob= ob->id.next) { + if(ob->pd && (ob->pd->forcefield == PFIELD_WIND)) + ob->pd->f_noise = 0.0; + } + } /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */ @@ -8510,9 +8489,6 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob) sens= ob->sensors.first; while(sens) { - for(a=0; atotlinks; a++) { - sens->links[a]= newglobadr(fd, sens->links[a]); - } if(sens->type==SENS_TOUCH) { bTouchSensor *ts= sens->data; expand_doit(fd, mainvar, ts->ma); @@ -8526,9 +8502,6 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob) cont= ob->controllers.first; while(cont) { - for(a=0; atotlinks; a++) { - cont->links[a]= newglobadr(fd, cont->links[a]); - } if(cont->type==CONT_PYTHON) { bPythonCont *pc= cont->data; expand_doit(fd, mainvar, pc->text); diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 3a70438dd13..b462233528a 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -608,6 +608,9 @@ static void write_sensors(WriteData *wd, ListBase *lb) case SENS_ACTUATOR: writestruct(wd, DATA, "bActuatorSensor", 1, sens->data); break; + case SENS_DELAY: + writestruct(wd, DATA, "bDelaySensor", 1, sens->data); + break; case SENS_COLLISION: writestruct(wd, DATA, "bCollisionSensor", 1, sens->data); break; diff --git a/source/blender/blenpluginapi/intern/pluginapi.c b/source/blender/blenpluginapi/intern/pluginapi.c index e65148a0b04..9c08a0b2f9d 100644 --- a/source/blender/blenpluginapi/intern/pluginapi.c +++ b/source/blender/blenpluginapi/intern/pluginapi.c @@ -50,10 +50,12 @@ #include "plugin.h" #include "MEM_guardedalloc.h" +#include "BLO_sys_types.h" // needed for intptr_t + #include "BLI_blenlib.h" /* util and noise functions */ #include "BLI_threads.h" /* For threadsfe guardedalloc malloc/calloc/free */ #include "IMB_imbuf.h" /* image buffer stuff */ -#define GET_INT_FROM_POINTER(i) ((int)(long)(i)) /* should use BKE_utildefines.h */ +#define GET_INT_FROM_POINTER(i) ((int)(intptr_t)(i)) /* should use BKE_utildefines.h */ /* -------------------------------------------------------------------------- */ /* stuff from util.h */ diff --git a/source/blender/imbuf/intern/cineon/cineonlib.c b/source/blender/imbuf/intern/cineon/cineonlib.c index 3b45a9de822..ecee3c7d6c0 100644 --- a/source/blender/imbuf/intern/cineon/cineonlib.c +++ b/source/blender/imbuf/intern/cineon/cineonlib.c @@ -67,12 +67,12 @@ fillCineonFileInfo(CineonFile* cineon, CineonFileInformation* fileInfo, const ch static void dumpCineonFileInfo(CineonFileInformation* fileInfo) { d_printf("\n--File Information--\n"); - d_printf("Magic: %8.8lX\n", (unsigned long)ntohl(fileInfo->magic_num)); - d_printf("Image Offset %ld\n", (long)ntohl(fileInfo->image_offset)); - d_printf("Generic Header size %ld\n", (long)ntohl(fileInfo->gen_hdr_size)); - d_printf("Industry Header size %ld\n", (long)ntohl(fileInfo->ind_hdr_size)); - d_printf("User Data size %ld\n", (long)ntohl(fileInfo->user_data_size)); - d_printf("File size %ld\n", (long)ntohl(fileInfo->file_size)); + d_printf("Magic: %8.8lX\n", (uintptr_t)ntohl(fileInfo->magic_num)); + d_printf("Image Offset %ld\n", (intptr_t)ntohl(fileInfo->image_offset)); + d_printf("Generic Header size %ld\n", (intptr_t)ntohl(fileInfo->gen_hdr_size)); + d_printf("Industry Header size %ld\n", (intptr_t)ntohl(fileInfo->ind_hdr_size)); + d_printf("User Data size %ld\n", (intptr_t)ntohl(fileInfo->user_data_size)); + d_printf("File size %ld\n", (intptr_t)ntohl(fileInfo->file_size)); d_printf("Version \"%s\"\n", fileInfo->vers); d_printf("File name \"%s\"\n", fileInfo->file_name); d_printf("Creation date \"%s\"\n", fileInfo->create_date); @@ -112,11 +112,11 @@ dumpCineonChannelInfo(CineonChannelInformation* chan) { default: d_printf(" (unknown)\n"); break; } d_printf(" Bits per pixel %d\n", chan->bits_per_pixel); - d_printf(" Pixels per line %ld\n", (long)ntohl(chan->pixels_per_line)); - d_printf(" Lines per image %ld\n", (long)ntohl(chan->lines_per_image)); - d_printf(" Ref low data %ld\n", (long)ntohl(chan->ref_low_data)); + d_printf(" Pixels per line %ld\n", (intptr_t)ntohl(chan->pixels_per_line)); + d_printf(" Lines per image %ld\n", (intptr_t)ntohl(chan->lines_per_image)); + d_printf(" Ref low data %ld\n", (intptr_t)ntohl(chan->ref_low_data)); d_printf(" Ref low quantity %f\n", ntohf(chan->ref_low_quantity)); - d_printf(" Ref high data %ld\n", (long)ntohl(chan->ref_high_data)); + d_printf(" Ref high data %ld\n", (intptr_t)ntohl(chan->ref_high_data)); d_printf(" Ref high quantity %f\n", ntohf(chan->ref_high_quantity)); } @@ -231,8 +231,8 @@ dumpCineonFormatInfo(CineonFormatInformation* formatInfo) { } else { d_printf(" positive\n"); } - d_printf("End of line padding %ld\n", (long)ntohl(formatInfo->line_padding)); - d_printf("End of channel padding %ld\n", (long)ntohl(formatInfo->channel_padding)); + d_printf("End of line padding %ld\n", (intptr_t)ntohl(formatInfo->line_padding)); + d_printf("End of channel padding %ld\n", (intptr_t)ntohl(formatInfo->channel_padding)); } static void @@ -256,8 +256,8 @@ fillCineonOriginationInfo(CineonFile* cineon, static void dumpCineonOriginationInfo(CineonOriginationInformation* originInfo) { d_printf("\n--Origination Information--\n"); - d_printf("X offset %ld\n", (long)ntohl(originInfo->x_offset)); - d_printf("Y offset %ld\n", (long)ntohl(originInfo->y_offset)); + d_printf("X offset %ld\n", (intptr_t)ntohl(originInfo->x_offset)); + d_printf("Y offset %ld\n", (intptr_t)ntohl(originInfo->y_offset)); d_printf("File name \"%s\"\n", originInfo->file_name); d_printf("Creation date \"%s\"\n", originInfo->create_date); d_printf("Creation time \"%s\"\n", originInfo->create_time); @@ -529,7 +529,7 @@ cineonOpen(const char* filename) { /* let's assume cineon files are always network order */ if (header.fileInfo.magic_num != ntohl(CINEON_FILE_MAGIC)) { if (verbose) d_printf("Bad magic number %8.8lX in \"%s\".\n", - (unsigned long)ntohl(header.fileInfo.magic_num), filename); + (uintptr_t)ntohl(header.fileInfo.magic_num), filename); cineonClose(cineon); return 0; } @@ -628,7 +628,7 @@ cineonOpenFromMem(unsigned char *mem, unsigned int size) { /* let's assume cineon files are always network order */ if (header.fileInfo.magic_num != ntohl(CINEON_FILE_MAGIC)) { - if (verbose) d_printf("Bad magic number %8.8lX in\n", (unsigned long)ntohl(header.fileInfo.magic_num)); + if (verbose) d_printf("Bad magic number %8.8lX in\n", (uintptr_t)ntohl(header.fileInfo.magic_num)); cineonClose(cineon); return 0; diff --git a/source/blender/imbuf/intern/cineon/dpxlib.c b/source/blender/imbuf/intern/cineon/dpxlib.c index 500c09ba265..1710cdde501 100644 --- a/source/blender/imbuf/intern/cineon/dpxlib.c +++ b/source/blender/imbuf/intern/cineon/dpxlib.c @@ -58,15 +58,15 @@ fillDpxChannelInfo(DpxFile* dpx, DpxChannelInformation* chan, int des) { static void dumpDpxChannelInfo(DpxChannelInformation* chan) { - d_printf(" Signage %ld", (long)ntohl(chan->signage)); - d_printf(" Ref low data %ld\n", (long)ntohl(chan->ref_low_data)); + d_printf(" Signage %ld", (intptr_t)ntohl(chan->signage)); + d_printf(" Ref low data %ld\n", (intptr_t)ntohl(chan->ref_low_data)); d_printf(" Ref low quantity %f\n", ntohf(chan->ref_low_quantity)); - d_printf(" Ref high data %ld\n", (long)ntohl(chan->ref_high_data)); + d_printf(" Ref high data %ld\n", (intptr_t)ntohl(chan->ref_high_data)); d_printf(" Ref high quantity %f\n", ntohf(chan->ref_high_quantity)); d_printf(" Designator1: %d,", chan->designator1); d_printf(" Bits per pixel %d\n", chan->bits_per_pixel); d_printf(" Packing: %d,", ntohs(chan->packing)); - d_printf(" Data Offset: %ld,", (long)ntohl(chan->data_offset)); + d_printf(" Data Offset: %ld,", (intptr_t)ntohl(chan->data_offset)); } static void @@ -110,19 +110,19 @@ static void dumpDpxFileInfo(DpxFileInformation* fileInfo) { d_printf("\n--File Information--\n"); d_printf("Magic: %8.8lX\n", (unsigned long)ntohl(fileInfo->magic_num)); - d_printf("Image Offset %ld\n", (long)ntohl(fileInfo->offset)); + d_printf("Image Offset %ld\n", (intptr_t)ntohl(fileInfo->offset)); d_printf("Version \"%s\"\n", fileInfo->vers); - d_printf("File size %ld\n", (long)ntohl(fileInfo->file_size)); - d_printf("Ditto key %ld\n", (long)ntohl(fileInfo->ditto_key)); - d_printf("Generic Header size %ld\n", (long)ntohl(fileInfo->gen_hdr_size)); - d_printf("Industry Header size %ld\n", (long)ntohl(fileInfo->ind_hdr_size)); - d_printf("User Data size %ld\n", (long)ntohl(fileInfo->user_data_size)); + d_printf("File size %ld\n", (intptr_t)ntohl(fileInfo->file_size)); + d_printf("Ditto key %ld\n", (intptr_t)ntohl(fileInfo->ditto_key)); + d_printf("Generic Header size %ld\n", (intptr_t)ntohl(fileInfo->gen_hdr_size)); + d_printf("Industry Header size %ld\n", (intptr_t)ntohl(fileInfo->ind_hdr_size)); + d_printf("User Data size %ld\n", (intptr_t)ntohl(fileInfo->user_data_size)); d_printf("File name \"%s\"\n", fileInfo->file_name); d_printf("Creation date \"%s\"\n", fileInfo->create_date); d_printf("Creator \"%s\"\n", fileInfo->creator); d_printf("Project \"%s\"\n", fileInfo->project); d_printf("Copyright \"%s\"\n", fileInfo->copyright); - d_printf("Key %ld\n", (long)ntohl(fileInfo->key)); + d_printf("Key %ld\n", (intptr_t)ntohl(fileInfo->key)); } static void @@ -150,8 +150,8 @@ dumpDpxImageInfo(DpxImageInformation* imageInfo) { d_printf("Image orientation %d,", ntohs(imageInfo->orientation)); n = ntohs(imageInfo->channels_per_image); d_printf("Channels %d\n", n); - d_printf("Pixels per line %ld\n", (long)ntohl(imageInfo->pixels_per_line)); - d_printf("Lines per image %ld\n", (long)ntohl(imageInfo->lines_per_image)); + d_printf("Pixels per line %ld\n", (intptr_t)ntohl(imageInfo->pixels_per_line)); + d_printf("Lines per image %ld\n", (intptr_t)ntohl(imageInfo->lines_per_image)); for (i = 0; i < n; ++i) { d_printf(" --Channel %d--\n", i); dumpDpxChannelInfo(&imageInfo->channel[i]); @@ -166,12 +166,12 @@ fillDpxOriginationInfo( static void dumpDpxOriginationInfo(DpxOriginationInformation* originInfo) { d_printf("\n--Origination Information--\n"); - d_printf("X offset %ld\n", (long)ntohl(originInfo->x_offset)); - d_printf("Y offset %ld\n", (long)ntohl(originInfo->y_offset)); + d_printf("X offset %ld\n", (intptr_t)ntohl(originInfo->x_offset)); + d_printf("Y offset %ld\n", (intptr_t)ntohl(originInfo->y_offset)); d_printf("X centre %f\n", ntohf(originInfo->x_centre)); d_printf("Y centre %f\n", ntohf(originInfo->y_centre)); - d_printf("Original X %ld\n", (long)ntohl(originInfo->x_original_size)); - d_printf("Original Y %ld\n", (long)ntohl(originInfo->y_original_size)); + d_printf("Original X %ld\n", (intptr_t)ntohl(originInfo->x_original_size)); + d_printf("Original Y %ld\n", (intptr_t)ntohl(originInfo->y_original_size)); d_printf("File name \"%s\"\n", originInfo->file_name); d_printf("Creation time \"%s\"\n", originInfo->creation_time); d_printf("Input device \"%s\"\n", originInfo->input_device); @@ -417,7 +417,7 @@ intern_dpxOpen(int mode, const char* bytestuff, int bufsize) { /* let's assume dpx files are always network order */ if (header.fileInfo.magic_num != ntohl(DPX_FILE_MAGIC)) { if (verbose) d_printf("Bad magic number %8.8lX in \"%s\".\n", - (unsigned long)ntohl(header.fileInfo.magic_num), filename); + (uintptr_t)ntohl(header.fileInfo.magic_num), filename); dpxClose(dpx); return 0; } diff --git a/source/blender/imbuf/intern/cineon/logImageCore.h b/source/blender/imbuf/intern/cineon/logImageCore.h index 01eff8d570d..2646e8b3c12 100644 --- a/source/blender/imbuf/intern/cineon/logImageCore.h +++ b/source/blender/imbuf/intern/cineon/logImageCore.h @@ -34,7 +34,9 @@ extern "C" { #endif - +#include "BLO_sys_types.h" // for intptr_t support +#undef ntohl +#undef htonl typedef int (GetRowFn)(LogImageFile* logImage, unsigned short* row, int lineNum); typedef int (SetRowFn)(LogImageFile* logImage, const unsigned short* row, int lineNum); typedef void (CloseFn)(LogImageFile* logImage); @@ -80,7 +82,7 @@ struct _Log_Image_File_t_ CloseFn* close; unsigned char *membuffer; - unsigned long membuffersize; + uintptr_t membuffersize; unsigned char *memcursor; }; diff --git a/source/blender/imbuf/intern/cineon/logmemfile.c b/source/blender/imbuf/intern/cineon/logmemfile.c index 20359335933..160e8453713 100644 --- a/source/blender/imbuf/intern/cineon/logmemfile.c +++ b/source/blender/imbuf/intern/cineon/logmemfile.c @@ -24,10 +24,10 @@ #include "logImageCore.h" -int logimage_fseek(void* logfile, long offsett, int origin) +int logimage_fseek(void* logfile, intptr_t offsett, int origin) { struct _Log_Image_File_t_ *file = (struct _Log_Image_File_t_*) logfile; - long offset = offsett; + intptr_t offset = offsett; if (file->file) fseek(file->file, offset, origin); else { /*we're seeking in memory*/ @@ -38,7 +38,7 @@ int logimage_fseek(void* logfile, long offsett, int origin) if (offset > file->membuffersize) return 1; file->memcursor = (file->membuffer + file->membuffersize) - offset; } else if (origin==SEEK_CUR) { - unsigned long pos = (unsigned long)file->membuffer - (unsigned long)file->memcursor; + uintptr_t pos = (uintptr_t)file->membuffer - (uintptr_t)file->memcursor; if (pos + offset > file->membuffersize) return 1; if (pos < 0) return 1; file->memcursor += offset; diff --git a/source/blender/imbuf/intern/cineon/logmemfile.h b/source/blender/imbuf/intern/cineon/logmemfile.h index 6e82cf2b145..39e2f36dad9 100644 --- a/source/blender/imbuf/intern/cineon/logmemfile.h +++ b/source/blender/imbuf/intern/cineon/logmemfile.h @@ -22,7 +22,7 @@ #ifndef _LOGMEMFILE_H #define _LOGMEMFILE_H -int logimage_fseek(void* logfile, long offsett, int origin); +int logimage_fseek(void* logfile, intptr_t offsett, int origin); int logimage_fwrite(void *buffer, unsigned int size, unsigned int count, void *logfile); int logimage_fread(void *buffer, unsigned int size, unsigned int count, void *logfile); diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c index 40c1f83c98c..8257eb4643e 100644 --- a/source/blender/imbuf/intern/scaling.c +++ b/source/blender/imbuf/intern/scaling.c @@ -39,6 +39,8 @@ #include "IMB_allocimbuf.h" #include "IMB_filter.h" +#include "BLO_sys_types.h" // for intptr_t support + /************************************************************************/ /* SCALING */ /************************************************************************/ @@ -490,8 +492,8 @@ static void enlarge_picture_byte( / (double) (src_width - 1.001); double ratioy = (double) (dst_height - 1.0) / (double) (src_height - 1.001); - unsigned long x_src, dx_src, x_dst; - unsigned long y_src, dy_src, y_dst; + uintptr_t x_src, dx_src, x_dst; + uintptr_t y_src, dy_src, y_dst; dx_src = 65536.0 / ratiox; dy_src = 65536.0 / ratioy; @@ -500,8 +502,8 @@ static void enlarge_picture_byte( for (y_dst = 0; y_dst < dst_height; y_dst++) { unsigned char* line1 = src + (y_src >> 16) * 4 * src_width; unsigned char* line2 = line1 + 4 * src_width; - unsigned long weight1y = 65536 - (y_src & 0xffff); - unsigned long weight2y = 65536 - weight1y; + uintptr_t weight1y = 65536 - (y_src & 0xffff); + uintptr_t weight2y = 65536 - weight1y; if ((y_src >> 16) == src_height - 1) { line2 = line1; @@ -509,8 +511,8 @@ static void enlarge_picture_byte( x_src = 0; for (x_dst = 0; x_dst < dst_width; x_dst++) { - unsigned long weight1x = 65536 - (x_src & 0xffff); - unsigned long weight2x = 65536 - weight1x; + uintptr_t weight1x = 65536 - (x_src & 0xffff); + uintptr_t weight2x = 65536 - weight1x; unsigned long x = (x_src >> 16) * 4; @@ -557,12 +559,12 @@ static void enlarge_picture_byte( } struct scale_outpix_byte { - unsigned long r; - unsigned long g; - unsigned long b; - unsigned long a; + uintptr_t r; + uintptr_t g; + uintptr_t b; + uintptr_t a; - unsigned long weight; + uintptr_t weight; }; static void shrink_picture_byte( @@ -571,9 +573,9 @@ static void shrink_picture_byte( { double ratiox = (double) (dst_width) / (double) (src_width); double ratioy = (double) (dst_height) / (double) (src_height); - unsigned long x_src, dx_dst, x_dst; - unsigned long y_src, dy_dst, y_dst; - long y_counter; + uintptr_t x_src, dx_dst, x_dst; + uintptr_t y_src, dy_dst, y_dst; + intptr_t y_counter; unsigned char * dst_begin = dst; struct scale_outpix_byte * dst_line1 = NULL; @@ -593,16 +595,16 @@ static void shrink_picture_byte( y_counter = 65536; for (y_src = 0; y_src < src_height; y_src++) { unsigned char* line = src + y_src * 4 * src_width; - unsigned long weight1y = 65536 - (y_dst & 0xffff); - unsigned long weight2y = 65536 - weight1y; + uintptr_t weight1y = 65536 - (y_dst & 0xffff); + uintptr_t weight2y = 65536 - weight1y; x_dst = 0; for (x_src = 0; x_src < src_width; x_src++) { - unsigned long weight1x = 65536 - (x_dst & 0xffff); - unsigned long weight2x = 65536 - weight1x; + uintptr_t weight1x = 65536 - (x_dst & 0xffff); + uintptr_t weight2x = 65536 - weight1x; - unsigned long x = x_dst >> 16; + uintptr_t x = x_dst >> 16; - unsigned long w; + uintptr_t w; w = (weight1y * weight1x) >> 16; @@ -643,13 +645,13 @@ static void shrink_picture_byte( y_dst += dy_dst; y_counter -= dy_dst; if (y_counter < 0) { - unsigned long x; + uintptr_t x; struct scale_outpix_byte * temp; y_counter += 65536; for (x=0; x < dst_width; x++) { - unsigned long f = 0x80000000UL + uintptr_t f = 0x80000000UL / dst_line1[x].weight; *dst++ = (dst_line1[x].r * f) >> 15; *dst++ = (dst_line1[x].g * f) >> 15; @@ -664,9 +666,9 @@ static void shrink_picture_byte( } } if (dst - dst_begin < dst_width * dst_height * 4) { - unsigned long x; + uintptr_t x; for (x = 0; x < dst_width; x++) { - unsigned long f = 0x80000000UL / dst_line1[x].weight; + uintptr_t f = 0x80000000UL / dst_line1[x].weight; *dst++ = (dst_line1[x].r * f) >> 15; *dst++ = (dst_line1[x].g * f) >> 15; *dst++ = (dst_line1[x].b * f) >> 15; @@ -698,8 +700,8 @@ static void enlarge_picture_float( / (double) (src_width - 1.001); double ratioy = (double) (dst_height - 1.0) / (double) (src_height - 1.001); - unsigned long x_dst; - unsigned long y_dst; + uintptr_t x_dst; + uintptr_t y_dst; double x_src, dx_src; double y_src, dy_src; @@ -727,7 +729,7 @@ static void enlarge_picture_float( float w12 = weight1y * weight2x; float w22 = weight2y * weight2x; - unsigned long x = ((int) x_src) * 4; + uintptr_t x = ((int) x_src) * 4; *dst++ = line1[x] * w11 + line2[x] * w21 @@ -770,8 +772,8 @@ static void shrink_picture_float( { double ratiox = (double) (dst_width) / (double) (src_width); double ratioy = (double) (dst_height) / (double) (src_height); - unsigned long x_src; - unsigned long y_src; + uintptr_t x_src; + uintptr_t y_src; float dx_dst, x_dst; float dy_dst, y_dst; float y_counter; @@ -794,14 +796,14 @@ static void shrink_picture_float( y_counter = 1.0; for (y_src = 0; y_src < src_height; y_src++) { float* line = src + y_src * 4 * src_width; - unsigned long weight1y = 1.0 - (y_dst - (int) y_dst); - unsigned long weight2y = 1.0 - weight1y; + uintptr_t weight1y = 1.0 - (y_dst - (int) y_dst); + uintptr_t weight2y = 1.0 - weight1y; x_dst = 0; for (x_src = 0; x_src < src_width; x_src++) { - unsigned long weight1x = 1.0 - (x_dst - (int) x_dst); - unsigned long weight2x = 1.0 - weight1x; + uintptr_t weight1x = 1.0 - (x_dst - (int) x_dst); + uintptr_t weight2x = 1.0 - weight1x; - unsigned long x = (int) x_dst; + uintptr_t x = (int) x_dst; float w; @@ -844,7 +846,7 @@ static void shrink_picture_float( y_dst += dy_dst; y_counter -= dy_dst; if (y_counter < 0) { - unsigned long x; + uintptr_t x; struct scale_outpix_float * temp; y_counter += 1.0; @@ -864,7 +866,7 @@ static void shrink_picture_float( } } if (dst - dst_begin < dst_width * dst_height * 4) { - unsigned long x; + uintptr_t x; for (x = 0; x < dst_width; x++) { float f = 1.0 / dst_line1[x].weight; *dst++ = dst_line1[x].r * f; diff --git a/source/blender/include/BIF_meshtools.h b/source/blender/include/BIF_meshtools.h index b08c66fd16e..d809d1f21f9 100644 --- a/source/blender/include/BIF_meshtools.h +++ b/source/blender/include/BIF_meshtools.h @@ -40,7 +40,7 @@ extern void objects_bake_render_menu(void); extern void objects_bake_render_ui(short event); extern void objects_bake_render(short event, char **error_msg); -extern long mesh_octree_table(struct Object *ob, float *co, char mode); +extern intptr_t mesh_octree_table(struct Object *ob, float *co, char mode); extern int mesh_get_x_mirror_vert(struct Object *ob, int index); extern struct EditVert *editmesh_get_x_mirror_vert(struct Object *ob, float *co); extern int *mesh_get_x_mirror_faces(struct Object *ob); diff --git a/source/blender/makesdna/DNA_ipo_types.h b/source/blender/makesdna/DNA_ipo_types.h index 3954a500dc7..03ffef3cd55 100644 --- a/source/blender/makesdna/DNA_ipo_types.h +++ b/source/blender/makesdna/DNA_ipo_types.h @@ -354,8 +354,8 @@ typedef short IPO_Channel; /* ******************** */ /* particle ipos */ -#define PART_TOTIPO 19 -#define PART_TOTNAM 19 +#define PART_TOTIPO 22 +#define PART_TOTNAM 22 #define PART_EMIT_FREQ 1 #define PART_EMIT_LIFE 2 @@ -381,6 +381,10 @@ typedef short IPO_Channel; #define PART_BB_TILT 19 +#define PART_PD_FSTR 20 +#define PART_PD_FFALL 21 +#define PART_PD_FMAXD 22 + /* these are IpoCurve specific */ /* **************** IPO ********************* */ diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h index dc6c2bcbcc0..5f6ae7c7f06 100644 --- a/source/blender/makesdna/DNA_object_force.h +++ b/source/blender/makesdna/DNA_object_force.h @@ -67,6 +67,9 @@ typedef struct PartDeflect { float tex_nabla; short tex_mode, kink, kink_axis, rt2; struct Tex *tex; /* Texture of the texture effector */ + struct RNG *rng; /* random noise generator for e.g. wind */ + float f_noise; /* noise of force (currently used for wind) */ + int pad; } PartDeflect; typedef struct PointCache { diff --git a/source/blender/makesdna/DNA_sensor_types.h b/source/blender/makesdna/DNA_sensor_types.h index c0306f43730..b5d8511c698 100644 --- a/source/blender/makesdna/DNA_sensor_types.h +++ b/source/blender/makesdna/DNA_sensor_types.h @@ -88,6 +88,13 @@ typedef struct bActuatorSensor { char name[32]; } bActuatorSensor; +typedef struct bDelaySensor { + short delay; + short duration; + short flag; + short pad; +} bDelaySensor; + typedef struct bCollisionSensor { char name[32]; /* property name */ char materialName[32]; /* material */ @@ -204,6 +211,7 @@ typedef struct bJoystickSensor { #define SENS_MESSAGE 10 #define SENS_JOYSTICK 11 #define SENS_ACTUATOR 12 +#define SENS_DELAY 13 /* sensor->flag */ #define SENS_SHOW 1 #define SENS_DEL 2 @@ -254,5 +262,7 @@ typedef struct bJoystickSensor { #define SENS_JOY_HAT 2 #define SENS_JOY_HAT_DIR 0 +#define SENS_DELAY_REPEAT 1 + #endif diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index 3818d66b39c..b4deb1f2b60 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -55,6 +55,8 @@ #include "MEM_guardedalloc.h" #include "DNA_sdna_types.h" +#include "BLO_sys_types.h" // for intptr_t support + #ifdef HAVE_CONFIG_H #include #endif @@ -955,7 +957,7 @@ int make_structDNA(char *baseDirectory, FILE *file) /* calculate size of datablock with strings */ cp= names[nr_names-1]; cp+= strlen(names[nr_names-1]) + 1; /* +1: null-terminator */ - len= (long) (cp - (char*) names[0]); + len= (intptr_t) (cp - (char*) names[0]); len= (len+3) & ~3; dna_write(file, names[0], len); @@ -968,7 +970,7 @@ int make_structDNA(char *baseDirectory, FILE *file) /* calculate datablock size */ cp= types[nr_types-1]; cp+= strlen(types[nr_types-1]) + 1; /* +1: null-terminator */ - len= (long) (cp - (char*) types[0]); + len= (intptr_t) (cp - (char*) types[0]); len= (len+3) & ~3; dna_write(file, types[0], len); @@ -990,7 +992,7 @@ int make_structDNA(char *baseDirectory, FILE *file) /* calc datablock size */ sp= structs[nr_structs-1]; sp+= 2+ 2*( sp[1] ); - len= (long) ((char*) sp - (char*) structs[0]); + len= (intptr_t) ((char*) sp - (char*) structs[0]); len= (len+3) & ~3; dna_write(file, structs[0], len); diff --git a/source/blender/python/api2_2x/Draw.c b/source/blender/python/api2_2x/Draw.c index 047a035fb8b..bd19a6a6a3e 100644 --- a/source/blender/python/api2_2x/Draw.c +++ b/source/blender/python/api2_2x/Draw.c @@ -1554,6 +1554,12 @@ static PyObject *Method_Number( PyObject * self, PyObject * args ) UI_METHOD_ERRORCHECK; + if ( !PyNumber_Check(inio) || !PyNumber_Check(mino) || + !PyNumber_Check(maxo) ) { + return EXPP_ReturnPyObjError( PyExc_TypeError, + "expected ints or floats for the initial, min and max values" ); + } + but = newbutton( ); if (tip) strncpy(but->tooltip, tip, BPY_MAX_TOOLTIP); block = Get_uiBlock( ); diff --git a/source/blender/python/api2_2x/Text3d.c b/source/blender/python/api2_2x/Text3d.c index 5137e989b8d..202195cdcb4 100644 --- a/source/blender/python/api2_2x/Text3d.c +++ b/source/blender/python/api2_2x/Text3d.c @@ -132,9 +132,12 @@ static PyObject *Text3d_getAlignment( BPy_Text3d * self ); static PyObject *Text3d_setAlignment( BPy_Text3d * self, PyObject * args ); static PyObject *Text3d_getFont( BPy_Text3d * self ); static PyObject *Text3d_setFont( BPy_Text3d * self, PyObject * args ); +static PyObject *Text3d_getMaterial( BPy_Text3d * self, PyObject * value ); +static PyObject *Text3d_setMaterial( BPy_Text3d * self, PyObject * args ); static PyObject *Text3d_addFrame( BPy_Text3d * self ); static PyObject *Text3d_removeFrame( BPy_Text3d * self, PyObject * args ); + /*****************************************************************************/ /* Python BPy_Text3d methods table: */ /*****************************************************************************/ @@ -210,6 +213,10 @@ static PyMethodDef BPy_Text3d_methods[] = { METH_NOARGS, "() - Gets font list for Text3d"}, {"setFont", ( PyCFunction ) Text3d_setFont, METH_VARARGS, "() - Sets font for Text3d"}, + {"getMaterial", ( PyCFunction ) Text3d_getMaterial, + METH_O, "() - Gets font list for Text3d"}, + {"setMaterial", ( PyCFunction ) Text3d_setMaterial, + METH_VARARGS, "() - Sets font for Text3d"}, {"addFrame", ( PyCFunction ) Text3d_addFrame, METH_NOARGS, "() - adds a new text frame"}, {"removeFrame", ( PyCFunction ) Text3d_removeFrame, @@ -1132,6 +1139,45 @@ static PyObject *Text3d_setFont( BPy_Text3d * self, PyObject * args ) Py_RETURN_NONE; } +/* todo, add style access, will be almost exact copy of these 2 */ +static PyObject *Text3d_getMaterial( BPy_Text3d * self, PyObject * value ) +{ + int index = PyInt_AsLong( value ); + if (index == -1 && PyErr_Occurred()) + return EXPP_ReturnPyObjError( PyExc_TypeError, "expected a character index" ); + + if (index < 0) + index = self->curve->len + index; + + if ( index < 0 || index >= self->curve->len ) + return EXPP_ReturnPyObjError( PyExc_IndexError, "character index out of range" ); + + return PyInt_FromLong( self->curve->strinfo[index].mat_nr ); +} + +static PyObject *Text3d_setMaterial( BPy_Text3d * self, PyObject * args ) +{ + int index, mat_nr; + if( !PyArg_ParseTuple( args, "ii",&index, &mat_nr) ) + return NULL; /* Python error is ok */ + + if (index < 0) + index = self->curve->len + index; + + if ( index < 0 || index >= self->curve->len ) + return EXPP_ReturnPyObjError( PyExc_IndexError, "character index out of range" ); + + if (mat_nr < 0) + mat_nr = self->curve->totcol + mat_nr; + + if ( mat_nr < 0 || mat_nr >= self->curve->totcol ) + return EXPP_ReturnPyObjError( PyExc_IndexError, "material index out of range" ); + + self->curve->strinfo[index].mat_nr = mat_nr; + + Py_RETURN_NONE; +} + static PyObject *Text3d_addFrame( BPy_Text3d * self ) { Curve *cu = self->curve; diff --git a/source/blender/python/api2_2x/doc/Mathutils.py b/source/blender/python/api2_2x/doc/Mathutils.py index 8b0c41b9a69..524d1fb6d4c 100644 --- a/source/blender/python/api2_2x/doc/Mathutils.py +++ b/source/blender/python/api2_2x/doc/Mathutils.py @@ -521,6 +521,15 @@ class Vector: @return: Return a quaternion rotation from the vector and the track and up axis. """ + def reflect(mirror): + """ + Return the reflection vector from the mirror vector argument. + @type mirror: Vector object + @param mirror: This vector could be a normal from the reflecting surface. + @rtype: Vector object matching the size of this vector. + @return: The reflected vector. + """ + class Euler: """ The Euler object diff --git a/source/blender/python/api2_2x/doc/Text3d.py b/source/blender/python/api2_2x/doc/Text3d.py index a7d8c585078..4bd989014f4 100644 --- a/source/blender/python/api2_2x/doc/Text3d.py +++ b/source/blender/python/api2_2x/doc/Text3d.py @@ -287,6 +287,26 @@ class Text3d: @param align: The new text3d's Alignment value. """ + def getMaterial(index): + """ + get the material index of a character. + @rtype: int + @return: the material index if the character + @type index: int + @param index: the index of the character in a string + """ + + def setMaterial(index, material_index): + """ + Set a characters material. + @note: after changing this youll need to update the object with object.makeDisplayList() to see the changes. + @rtype: None + @type index: int + @param index: the index of the character in a string + @type material_index: int + @param material_index: the material index set set the character. + """ + def addFrame(): """ Adds a text frame. maximum number of frames is 255. diff --git a/source/blender/python/api2_2x/vector.c b/source/blender/python/api2_2x/vector.c index 33ca993fb49..fe28f0fac42 100644 --- a/source/blender/python/api2_2x/vector.c +++ b/source/blender/python/api2_2x/vector.c @@ -42,6 +42,7 @@ char Vector_Resize3D_doc[] = "() - resize a vector to [x,y,z]"; char Vector_Resize4D_doc[] = "() - resize a vector to [x,y,z,w]"; char Vector_toPoint_doc[] = "() - create a new Point Object from this vector"; char Vector_ToTrackQuat_doc[] = "(track, up) - extract a quaternion from the vector and the track and up axis"; +char Vector_reflect_doc[] = "(mirror) - return a vector reflected on the mirror normal"; char Vector_copy_doc[] = "() - return a copy of the vector"; /*-----------------------METHOD DEFINITIONS ----------------------*/ struct PyMethodDef Vector_methods[] = { @@ -53,6 +54,7 @@ struct PyMethodDef Vector_methods[] = { {"resize4D", (PyCFunction) Vector_Resize4D, METH_NOARGS, Vector_Resize2D_doc}, {"toPoint", (PyCFunction) Vector_toPoint, METH_NOARGS, Vector_toPoint_doc}, {"toTrackQuat", ( PyCFunction ) Vector_ToTrackQuat, METH_VARARGS, Vector_ToTrackQuat_doc}, + {"reflect", ( PyCFunction ) Vector_reflect, METH_O, Vector_reflect_doc}, {"copy", (PyCFunction) Vector_copy, METH_NOARGS, Vector_copy_doc}, {"__copy__", (PyCFunction) Vector_copy, METH_NOARGS, Vector_copy_doc}, {NULL, NULL, 0, NULL} @@ -273,7 +275,55 @@ PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args ) return newQuaternionObject(quat, Py_NEW); } - +/*----------------------------Vector.reflect(mirror) ---------------------- + return a reflected vector on the mirror normal + ((2 * DotVecs(vec, mirror)) * mirror) - vec + using arithb.c would be nice here */ +PyObject *Vector_reflect( VectorObject * self, PyObject * value ) +{ + VectorObject *mirrvec; + float mirror[3]; + float vec[3]; + float reflect[4] = {0.0f, 0.0f, 0.0f, 0.0f}; + float dot2; + + /* for normalizing */ + int i; + float norm = 0.0f; + + if (!VectorObject_Check(value)) + return EXPP_ReturnPyObjError( PyExc_TypeError, "expected a vector argument" ); + + mirrvec = (VectorObject *)value; + + mirror[0] = mirrvec->vec[0]; + mirror[1] = mirrvec->vec[1]; + if (mirrvec->size > 2) mirror[2] = mirrvec->vec[2]; + else mirror[2] = 0.0; + + /* normalize, whos idea was it not to use arithb.c? :-/ */ + for(i = 0; i < 3; i++) { + norm += mirror[i] * mirror[i]; + } + norm = (float) sqrt(norm); + for(i = 0; i < 3; i++) { + mirror[i] /= norm; + } + /* done */ + + vec[0] = self->vec[0]; + vec[1] = self->vec[1]; + if (self->size > 2) vec[2] = self->vec[2]; + else vec[2] = 0.0; + + dot2 = 2 * vec[0]*mirror[0]+vec[1]*mirror[1]+vec[2]*mirror[2]; + + reflect[0] = (dot2 * mirror[0]) - vec[0]; + reflect[1] = (dot2 * mirror[1]) - vec[1]; + reflect[2] = (dot2 * mirror[2]) - vec[2]; + + return newVectorObject(reflect, self->size, Py_NEW); +} /*----------------------------Vector.copy() -------------------------------------- return a copy of the vector */ diff --git a/source/blender/python/api2_2x/vector.h b/source/blender/python/api2_2x/vector.h index a86f2ddfe42..61b50d5f458 100644 --- a/source/blender/python/api2_2x/vector.h +++ b/source/blender/python/api2_2x/vector.h @@ -52,6 +52,7 @@ PyObject *Vector_Resize3D( VectorObject * self ); PyObject *Vector_Resize4D( VectorObject * self ); PyObject *Vector_toPoint( VectorObject * self ); PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args ); +PyObject *Vector_reflect( VectorObject * self, PyObject * value ); PyObject *Vector_copy( VectorObject * self ); PyObject *newVectorObject(float *vec, int size, int type); diff --git a/source/blender/radiosity/CMakeLists.txt b/source/blender/radiosity/CMakeLists.txt index 36e9ad19770..941da41a5b2 100644 --- a/source/blender/radiosity/CMakeLists.txt +++ b/source/blender/radiosity/CMakeLists.txt @@ -29,7 +29,7 @@ FILE(GLOB SRC intern/source/*.c) SET(INC extern/include ../blenlib ../blenkernel ../makesdna ../include ../../../intern/guardedalloc ../render/extern/include - ../render/intern/include + ../render/intern/include ../blenloader ) BLENDERLIB_NOLIST(blender_radiosity "${SRC}" "${INC}") diff --git a/source/blender/radiosity/SConscript b/source/blender/radiosity/SConscript index 102f79683f9..a86b76bb4b1 100644 --- a/source/blender/radiosity/SConscript +++ b/source/blender/radiosity/SConscript @@ -5,7 +5,7 @@ sources = env.Glob('intern/source/*.c') incs = 'extern/include ../blenlib ../blenkernel ../makesdna ../include' incs += ' #/intern/guardedalloc ../render/extern/include' -incs += ' ../render/intern/include' +incs += ' ../render/intern/include ../blenloader' incs += ' ' + env['BF_OPENGL_INC'] diff --git a/source/blender/radiosity/intern/source/Makefile b/source/blender/radiosity/intern/source/Makefile index 19768c959c7..e5ff8c40d08 100644 --- a/source/blender/radiosity/intern/source/Makefile +++ b/source/blender/radiosity/intern/source/Makefile @@ -44,6 +44,7 @@ CPPFLAGS += -I../../../blenlib CPPFLAGS += -I../../../makesdna CPPFLAGS += -I../../../imbuf CPPFLAGS += -I../../../ +CPPFLAGS += -I../../../blenloader CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include # first /include is my own includes, second are the external includes diff --git a/source/blender/radiosity/intern/source/radnode.c b/source/blender/radiosity/intern/source/radnode.c index 5517a22eb93..042fe6840fc 100644 --- a/source/blender/radiosity/intern/source/radnode.c +++ b/source/blender/radiosity/intern/source/radnode.c @@ -50,6 +50,8 @@ #include "radio.h" +#include "BLO_sys_types.h" // for intptr_t support + #ifdef HAVE_CONFIG_H #include #endif @@ -167,14 +169,14 @@ void *calloc_fast(int size) void free_fast(void *poin, int size) { MallocGroup *mg; - long val; + intptr_t val; mg= MallocBase.last; while(mg) { if(mg->size==size) { - if( ((long)poin) >= ((long)mg->data) ) { - if( ((long)poin) < ((long)(mg->data+MAL_GROUPSIZE*size)) ) { - val= ((long)poin) - ((long)mg->data); + if( ((intptr_t)poin) >= ((intptr_t)mg->data) ) { + if( ((intptr_t)poin) < ((intptr_t)(mg->data+MAL_GROUPSIZE*size)) ) { + val= ((intptr_t)poin) - ((intptr_t)mg->data); val/= size; mg->curfree= val; mg->flags[val]= 0; diff --git a/source/blender/radiosity/intern/source/radpreprocess.c b/source/blender/radiosity/intern/source/radpreprocess.c index 5f8a39786c1..07b933b6db9 100644 --- a/source/blender/radiosity/intern/source/radpreprocess.c +++ b/source/blender/radiosity/intern/source/radpreprocess.c @@ -68,6 +68,8 @@ #include "radio.h" +#include "BLO_sys_types.h" // for intptr_t support + #ifdef HAVE_CONFIG_H #include #endif @@ -179,7 +181,7 @@ int vergedge(const void *v1,const void *v2) void addedge(float *v1, float *v2, EdSort *es) { - if( ((long)v1)<((long)v2) ) { + if( ((intptr_t)v1)<((intptr_t)v2) ) { es->v1= v1; es->v2= v2; } diff --git a/source/blender/render/CMakeLists.txt b/source/blender/render/CMakeLists.txt index b543dff49ff..0b659554d1a 100644 --- a/source/blender/render/CMakeLists.txt +++ b/source/blender/render/CMakeLists.txt @@ -29,7 +29,7 @@ FILE(GLOB SRC intern/source/*.c) SET(INC intern/include ../../../intern/guardedalloc ../blenlib ../makesdna extern/include ../blenkernel ../radiosity/extern/include ../imbuf - ../quicktime ../include ../../kernel/gen_messaging ../yafray + ../quicktime ../include ../../kernel/gen_messaging ../yafray ../blenloader ) IF(WITH_OPENEXR) diff --git a/source/blender/render/SConscript b/source/blender/render/SConscript index b1bc9673f23..f0d1353b0d3 100644 --- a/source/blender/render/SConscript +++ b/source/blender/render/SConscript @@ -6,7 +6,7 @@ sources = env.Glob('intern/source/*.c') incs = 'intern/include #/intern/guardedalloc ../blenlib ../makesdna' incs += ' extern/include ../blenkernel ../radiosity/extern/include ../imbuf' -incs += ' ../quicktime ../include ../../kernel/gen_messaging' +incs += ' ../quicktime ../include ../../kernel/gen_messaging ../blenloader' defs = [] diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index 2f97b19f75c..f83bbd7e8b2 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -44,6 +44,8 @@ #include "RE_shader_ext.h" /* TexResult, ShadeResult, ShadeInput */ #include "sunsky.h" +#include "BLO_sys_types.h" // for intptr_t support + struct Object; struct MemArena; struct VertTableNode; @@ -89,11 +91,11 @@ typedef struct RenderPart int *rectp; /* polygon index table */ int *rectz; /* zbuffer */ int *rectmask; /* negative zmask */ - long *rectdaps; /* delta acum buffer for pixel structs */ + intptr_t *rectdaps; /* delta acum buffer for pixel structs */ int *rectbacko; /* object table for backside sss */ int *rectbackp; /* polygon index table for backside sss */ int *rectbackz; /* zbuffer for backside sss */ - long *rectall; /* buffer for all faces for sss */ + intptr_t *rectall; /* buffer for all faces for sss */ rcti disprect; /* part coordinates within total picture */ int rectx, recty; /* the size */ @@ -226,7 +228,7 @@ struct ISBData; typedef struct ShadSampleBuf { struct ShadSampleBuf *next, *prev; - long *zbuf; + intptr_t *zbuf; char *cbuf; } ShadSampleBuf; diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c index d70c51b83bc..15c57eb9362 100644 --- a/source/blender/render/intern/source/occlusion.c +++ b/source/blender/render/intern/source/occlusion.c @@ -1670,7 +1670,7 @@ void cache_occ_samples(Render *re, RenderPart *pa, ShadeSample *ssamp) OcclusionCacheSample *sample; OccFace exclude; ShadeInput *shi; - long *rd=NULL; + intptr_t *rd=NULL; int *ro=NULL, *rp=NULL, *rz=NULL, onlyshadow; int x, y, step = CACHE_STEP; diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 6a0af82b4d7..3cd7bdc6772 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -138,7 +138,7 @@ static void print_error(char *str) {printf("ERROR: %s\n", str);} static void stats_background(RenderStats *rs) { - extern unsigned long mem_in_use; + extern uintptr_t mem_in_use; float megs_used_memory= mem_in_use/(1024.0*1024.0); char str[400], *spos= str; diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index 4520e4c10bb..4a2ad995b39 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -243,7 +243,7 @@ static void halo_tile(RenderPart *pa, RenderLayer *rl) rcti disprect= pa->disprect, testrect= pa->disprect; float dist, xsq, ysq, xn, yn; float col[4]; - long *rd= NULL; + intptr_t *rd= NULL; int a, *rz, zz, y, sample, totsample, od; short minx, maxx, miny, maxy, x; unsigned int lay= rl->lay; @@ -324,7 +324,7 @@ static void lamphalo_tile(RenderPart *pa, RenderLayer *rl) ShadeInput shi; float *pass; float fac, col[4]; - long *rd= pa->rectdaps; + intptr_t *rd= pa->rectdaps; int *rz= pa->rectz; int x, y, sample, totsample, fullsample, od; @@ -767,7 +767,7 @@ static void shadeDA_tile(RenderPart *pa, RenderLayer *rl) { RenderResult *rr= pa->result; ShadeSample ssamp; - long *rd, *rectdaps= pa->rectdaps; + intptr_t *rd, *rectdaps= pa->rectdaps; int samp; int x, y, seed, crop=0, offs=0, od; @@ -874,7 +874,7 @@ static void freeps(ListBase *lb) lb->first= lb->last= NULL; } -static void addps(ListBase *lb, long *rd, int obi, int facenr, int z, int maskz, unsigned short mask) +static void addps(ListBase *lb, intptr_t *rd, int obi, int facenr, int z, int maskz, unsigned short mask) { PixStrMain *psm; PixStr *ps, *last= NULL; @@ -901,7 +901,7 @@ static void addps(ListBase *lb, long *rd, int obi, int facenr, int z, int maskz, ps= psm->ps + psm->counter++; if(last) last->next= ps; - else *rd= (long)ps; + else *rd= (intptr_t)ps; ps->next= NULL; ps->obi= obi; @@ -1027,7 +1027,7 @@ static void reset_sky_speed(RenderPart *pa, RenderLayer *rl) static unsigned short *make_solid_mask(RenderPart *pa) { - long *rd= pa->rectdaps; + intptr_t *rd= pa->rectdaps; unsigned short *solidmask, *sp; int x; @@ -1092,7 +1092,7 @@ void make_pixelstructs(RenderPart *pa, ZSpan *zspan, int sample, void *data) { ZbufSolidData *sdata= (ZbufSolidData*)data; ListBase *lb= sdata->psmlist; - long *rd= pa->rectdaps; + intptr_t *rd= pa->rectdaps; int *ro= zspan->recto; int *rp= zspan->rectp; int *rz= zspan->rectz; @@ -1133,7 +1133,7 @@ void zbufshadeDA_tile(RenderPart *pa) /* initialize pixelstructs and edge buffer */ addpsmain(&psmlist); - pa->rectdaps= MEM_callocN(sizeof(long)*pa->rectx*pa->recty+4, "zbufDArectd"); + pa->rectdaps= MEM_callocN(sizeof(intptr_t)*pa->rectx*pa->recty+4, "zbufDArectd"); if(rl->layflag & SCE_LAY_EDGE) if(R.r.mode & R_EDGE) @@ -1433,7 +1433,7 @@ static void addps_sss(void *cb_handle, int obi, int facenr, int x, int y, int z) return; if(pa->rectall) { - long *rs= pa->rectall + pa->rectx*y + x; + intptr_t *rs= pa->rectall + pa->rectx*y + x; addps(&handle->psmlist, rs, obi, facenr, z, 0, 0); handle->totps++; @@ -1569,7 +1569,7 @@ void zbufshade_sss_tile(RenderPart *pa) int *ro, *rz, *rp, *rbo, *rbz, *rbp, lay; #if 0 PixStr *ps; - long *rs; + intptr_t *rs; int z; #endif @@ -1581,7 +1581,7 @@ void zbufshade_sss_tile(RenderPart *pa) handle.psmlist.first= handle.psmlist.last= NULL; addpsmain(&handle.psmlist); - pa->rectall= MEM_callocN(sizeof(long)*pa->rectx*pa->recty+4, "rectall"); + pa->rectall= MEM_callocN(sizeof(intptr_t)*pa->rectx*pa->recty+4, "rectall"); #else pa->recto= MEM_mallocN(sizeof(int)*pa->rectx*pa->recty, "recto"); pa->rectp= MEM_mallocN(sizeof(int)*pa->rectx*pa->recty, "rectp"); diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c index f3258b601de..f477df3ed8c 100644 --- a/source/blender/render/intern/source/shadbuf.c +++ b/source/blender/render/intern/source/shadbuf.c @@ -171,7 +171,7 @@ static void compress_shadowbuf(ShadBuf *shb, int *rectz, int square) { ShadSampleBuf *shsample; float dist; - unsigned long *ztile; + uintptr_t *ztile; int *rz, *rz1, verg, verg1, size= shb->size; int a, x, y, minx, miny, byt1, byt2; char *rc, *rcline, *ctile, *zt; @@ -179,10 +179,10 @@ static void compress_shadowbuf(ShadBuf *shb, int *rectz, int square) shsample= MEM_mallocN( sizeof(ShadSampleBuf), "shad sample buf"); BLI_addtail(&shb->buffers, shsample); - shsample->zbuf= MEM_mallocN( sizeof(unsigned long)*(size*size)/256, "initshadbuf2"); + shsample->zbuf= MEM_mallocN( sizeof(uintptr_t)*(size*size)/256, "initshadbuf2"); shsample->cbuf= MEM_callocN( (size*size)/256, "initshadbuf3"); - ztile= (unsigned long *)shsample->zbuf; + ztile= (uintptr_t *)shsample->zbuf; ctile= shsample->cbuf; /* help buffer */ @@ -237,7 +237,7 @@ static void compress_shadowbuf(ShadBuf *shb, int *rectz, int square) } if(byt1 && byt2) { /* only store byte */ *ctile= 1; - *ztile= (unsigned long)MEM_mallocN(256+4, "tile1"); + *ztile= (uintptr_t)MEM_mallocN(256+4, "tile1"); rz= (int *)*ztile; *rz= *rz1; @@ -247,7 +247,7 @@ static void compress_shadowbuf(ShadBuf *shb, int *rectz, int square) } else if(byt1) { /* only store short */ *ctile= 2; - *ztile= (unsigned long)MEM_mallocN(2*256+4,"Tile2"); + *ztile= (uintptr_t)MEM_mallocN(2*256+4,"Tile2"); rz= (int *)*ztile; *rz= *rz1; @@ -260,7 +260,7 @@ static void compress_shadowbuf(ShadBuf *shb, int *rectz, int square) } else { /* store triple */ *ctile= 3; - *ztile= (unsigned long)MEM_mallocN(3*256,"Tile3"); + *ztile= (uintptr_t)MEM_mallocN(3*256,"Tile3"); zt= (char *)*ztile; rc= rcline; @@ -542,7 +542,7 @@ void freeshadowbuf(LampRen *lar) v= (shb->size*shb->size)/256; for(shsample= shb->buffers.first; shsample; shsample= shsample->next) { - long *ztile= shsample->zbuf; + intptr_t *ztile= shsample->zbuf; char *ctile= shsample->cbuf; for(b=0; brectdaps) { /* find the z of the sample */ PixStr *ps; - long *rd= spart->rectdaps + offset; + intptr_t *rd= spart->rectdaps + offset; bufferz= 0x7FFFFFFF; if(spart->rectmask) maskz= 0x7FFFFFFF; diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index c91c9e2f799..29aa6e3be29 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -2278,7 +2278,7 @@ static int hashlist_projectvert(float *v1, float winmat[][4], float *hoco) return 0; } - buck= &bucket[ (((long)v1)/16) & 255 ]; + buck= &bucket[ (((intptr_t)v1)/16) & 255 ]; if(buck->vert==v1) { QUATCOPY(hoco, buck->hoco); return buck->clip; @@ -3263,7 +3263,7 @@ static void copyto_abufz(RenderPart *pa, int *arectz, int *rectmask, int sample) { PixStr *ps; int x, y, *rza, *rma; - long *rd; + intptr_t *rd; if(R.osa==0) { memcpy(arectz, pa->rectz, sizeof(int)*pa->rectx*pa->recty); @@ -3484,7 +3484,7 @@ static int zbuffer_abuf(RenderPart *pa, APixstr *APixbuf, ListBase *apsmbase, Re /* speed pointer NULL = sky, we clear */ /* else if either alpha is full or no solid was filled in: copy speed */ /* else fill in minimum speed */ -void add_transp_speed(RenderLayer *rl, int offset, float *speed, float alpha, long *rdrect) +void add_transp_speed(RenderLayer *rl, int offset, float *speed, float alpha, intptr_t *rdrect) { RenderPass *rpass; @@ -3958,7 +3958,7 @@ unsigned short *zbuffer_transp_shade(RenderPart *pa, RenderLayer *rl, float *pas ZTranspRow zrow[MAX_ZROW]; StrandShadeCache *sscache= NULL; float sampalpha, alpha, *passrect= pass; - long *rdrect; + intptr_t *rdrect; int x, y, crop=0, a, b, totface, totsample, doztra; int addpassflag, offs= 0, od, addzbuf, osa = (R.osa? R.osa: 1); unsigned short *ztramask= NULL, filled; diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 63303467856..4682549297a 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -4277,7 +4277,7 @@ static void validate_posebonebutton_cb(void *bonev, void *namev) static void armature_layer_cb(void *lay_v, void *value_v) { short *layer= lay_v; - int value= (long)value_v; + int value= (intptr_t)value_v; if(*layer==0 || G.qual==0) *layer= value; allqueue(REDRAWBUTSEDIT, 0); diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index 5cf1958678e..2dd6d705a9e 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -683,6 +683,8 @@ static char *sensor_name(int type) return "Property"; case SENS_ACTUATOR: return "Actuator"; + case SENS_DELAY: + return "Delay"; case SENS_MOUSE: return "Mouse"; case SENS_COLLISION: @@ -704,7 +706,7 @@ static char *sensor_name(int type) static char *sensor_pup(void) { /* the number needs to match defines in game.h */ - return "Sensors %t|Always %x0|Keyboard %x3|Mouse %x5|" + return "Sensors %t|Always %x0|Delay %x13|Keyboard %x3|Mouse %x5|" "Touch %x1|Collision %x6|Near %x2|Radar %x7|" "Property %x4|Random %x8|Ray %x9|Message %x10|Joystick %x11|Actuator %x12"; } @@ -1000,6 +1002,7 @@ static int get_col_sensor(int type) { switch(type) { case SENS_ALWAYS: return TH_BUT_ACTION; + case SENS_DELAY: return TH_BUT_ACTION; case SENS_TOUCH: return TH_BUT_NEUTRAL; case SENS_COLLISION: return TH_BUT_SETTING; case SENS_NEAR: return TH_BUT_SETTING1; @@ -1070,8 +1073,8 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short bRaySensor *raySens = NULL; bMessageSensor *mes = NULL; bJoystickSensor *joy = NULL; - bActuatorSensor *as = NULL; - + bActuatorSensor *as = NULL; + bDelaySensor *ds = NULL; short ysize; char *str; @@ -1297,6 +1300,27 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short yco-= ysize; break; } + case SENS_DELAY: + { + ysize= 48; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, + (float)xco+width, (float)yco, 1); + + draw_default_sensor_header(sens, block, xco, yco, width); + ds = sens->data; + + uiDefButS(block, NUM, 0, "Delay",(short)(10+xco),(short)(yco-44),(short)((width-22)*0.4+10), 19, + &ds->delay, 0.0, 5000.0, 0, 0, "Delay in number of frames before the positive trigger"); + uiDefButS(block, NUM, 0, "Dur",(short)(10+xco+(width-22)*0.4+10),(short)(yco-44),(short)((width-22)*0.4-10), 19, + &ds->duration, 0.0, 5000.0, 0, 0, "If >0, delay in number of frames before the negative trigger following the positive trigger"); + uiDefButBitS(block, TOG, SENS_DELAY_REPEAT, 0, "REP",(short)(xco + 10 + (width-22)*0.8),(short)(yco - 44), + (short)(0.20 * (width-22)), 19, &ds->flag, 0.0, 0.0, 0, 0, + "Toggle repeat option. If selected, the sensor restarts after Delay+Dur frames"); + yco-= ysize; + break; + } case SENS_MOUSE: { ms= sens->data; @@ -1689,7 +1713,7 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh uiDefBut(block, LABEL, 0, "Torque", xco, yco-106, 55, 19, NULL, 0, 0, 0, 0, "Sets the torque"); uiDefButF(block, NUM, 0, "", xco+45, yco-106, wval, 19, oa->forcerot, -10000.0, 10000.0, 10, 0, ""); uiDefButF(block, NUM, 0, "", xco+45+wval, yco-106, wval, 19, oa->forcerot+1, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-6106, wval, 19, oa->forcerot+2, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-106, wval, 19, oa->forcerot+2, -10000.0, 10000.0, 10, 0, ""); } if ( ob->gameflag & OB_DYNAMIC ) @@ -3183,7 +3207,8 @@ void logic_buts(void) while(cont) { for (iact=0; iacttotlinks; iact++) { act = cont->links[iact]; - act->flag |= ACT_LINKED; + if (act) + act->flag |= ACT_LINKED; } controller_state_mask |= cont->state_mask; cont = cont->next; @@ -3231,7 +3256,8 @@ void logic_buts(void) /* this controller is visible, mark all its actuator */ for (iact=0; iacttotlinks; iact++) { act = cont->links[iact]; - act->flag |= ACT_VISIBLE; + if (act) + act->flag |= ACT_VISIBLE; } uiBlockSetEmboss(block, UI_EMBOSSM); uiDefIconButBitS(block, TOG, CONT_DEL, B_DEL_CONT, ICON_X, xco, yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Delete Controller"); @@ -3323,8 +3349,8 @@ void logic_buts(void) ycoo= yco; if(sens->flag & SENS_SHOW) { - uiDefButS(block, MENU, B_CHANGE_SENS, sensor_pup(), (short)(xco+22), yco, 100, 19, &sens->type, 0, 0, 0, 0, "Sensor type"); - but= uiDefBut(block, TEX, 1, "", (short)(xco+122), yco, (short)(width-144), 19, sens->name, 0, 31, 0, 0, "Sensor name"); + uiDefButS(block, MENU, B_CHANGE_SENS, sensor_pup(), (short)(xco+22), yco, 80, 19, &sens->type, 0, 0, 0, 0, "Sensor type"); + but= uiDefBut(block, TEX, 1, "", (short)(xco+102), yco, (short)(width-124), 19, sens->name, 0, 31, 0, 0, "Sensor name"); uiButSetFunc(but, make_unique_prop_names_cb, sens->name, (void*) 0); sens->otype= sens->type; @@ -3334,9 +3360,9 @@ void logic_buts(void) else { set_col_sensor(sens->type, 1); glRecti(xco+22, yco, xco+width-22,yco+19); - but= uiDefBut(block, LABEL, 0, sensor_name(sens->type), (short)(xco+22), yco, 100, 19, sens, 0, 0, 0, 0, ""); + but= uiDefBut(block, LABEL, 0, sensor_name(sens->type), (short)(xco+22), yco, 80, 19, sens, 0, 0, 0, 0, ""); uiButSetFunc(but, sca_move_sensor, sens, NULL); - but= uiDefBut(block, LABEL, 0, sens->name, (short)(xco+122), yco, (short)(width-144), 19, sens, 0, 31, 0, 0, ""); + but= uiDefBut(block, LABEL, 0, sens->name, (short)(xco+102), yco, (short)(width-124), 19, sens, 0, 31, 0, 0, ""); uiButSetFunc(but, sca_move_sensor, sens, NULL); } @@ -3393,8 +3419,8 @@ void logic_buts(void) if(act->flag & ACT_SHOW) { act->otype= act->type; - uiDefButS(block, MENU, B_CHANGE_ACT, actuator_pup(ob), (short)(xco+22), yco, 100, 19, &act->type, 0, 0, 0, 0, "Actuator type"); - but= uiDefBut(block, TEX, 1, "", (short)(xco+122), yco, (short)(width-144), 19, act->name, 0, 31, 0, 0, "Actuator name"); + uiDefButS(block, MENU, B_CHANGE_ACT, actuator_pup(ob), (short)(xco+22), yco, 90, 19, &act->type, 0, 0, 0, 0, "Actuator type"); + but= uiDefBut(block, TEX, 1, "", (short)(xco+112), yco, (short)(width-134), 19, act->name, 0, 31, 0, 0, "Actuator name"); uiButSetFunc(but, make_unique_prop_names_cb, act->name, (void*) 0); ycoo= yco; @@ -3404,9 +3430,9 @@ void logic_buts(void) else { set_col_actuator(act->type, 1); glRecti((short)(xco+22), yco, (short)(xco+width-22),(short)(yco+19)); - but= uiDefBut(block, LABEL, 0, actuator_name(act->type), (short)(xco+22), yco, 100, 19, act, 0, 0, 0, 0, "Actuator type"); + but= uiDefBut(block, LABEL, 0, actuator_name(act->type), (short)(xco+22), yco, 90, 19, act, 0, 0, 0, 0, "Actuator type"); uiButSetFunc(but, sca_move_actuator, act, NULL); - but= uiDefBut(block, LABEL, 0, act->name, (short)(xco+122), yco, (short)(width-144), 19, act, 0, 0, 0, 0, "Actuator name"); + but= uiDefBut(block, LABEL, 0, act->name, (short)(xco+112), yco, (short)(width-134), 19, act, 0, 0, 0, 0, "Actuator name"); uiButSetFunc(but, sca_move_actuator, act, NULL); ycoo= yco; } diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index 370f6999dfc..132bae8b7b8 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -3452,6 +3452,8 @@ static void object_panel_fields(Object *ob) } else if(pd->forcefield == PFIELD_HARMONIC) uiDefButF(block, NUM, B_FIELD_CHANGE, "Damp: ", 10,120,140,20, &pd->f_damp, 0, 10, 10, 0, "Damping of the harmonic force"); + else if(pd->forcefield == PFIELD_WIND) + uiDefButF(block, NUM, B_FIELD_CHANGE, "Noise: ",10,120,140,20, &pd->f_noise, 0, 10, 100, 0, "Noise of the wind force"); } uiBlockEndAlign(block); diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index fb6a7636e16..5205be3e1b0 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -33,6 +33,7 @@ #include #include "MEM_guardedalloc.h" +#include "BLO_sys_types.h" // for intptr_t support #include "DNA_node_types.h" #include "DNA_screen_types.h" #include "DNA_space_types.h" @@ -3261,7 +3262,7 @@ static void layer_copy_func(void *lay_v, void *lay_p) static void delete_scene_layer_func(void *srl_v, void *act_i) { if(BLI_countlist(&G.scene->r.layers)>1) { - long act= (long)act_i; + intptr_t act= (intptr_t)act_i; BLI_remlink(&G.scene->r.layers, srl_v); MEM_freeN(srl_v); @@ -3322,7 +3323,7 @@ static char *scene_layer_menu(void) static void draw_3d_layer_buttons(uiBlock *block, int type, unsigned int *poin, short xco, short yco, short dx, short dy, char *tip) { uiBut *bt; - long a; + intptr_t a; uiBlockBeginAlign(block); for(a=0; a<5; a++) { @@ -3381,7 +3382,7 @@ static void render_panel_layers(void) uiDefButBitI(block, TOG, R_SINGLE_LAYER, B_NOP, "Single", 230,145,60,20, &G.scene->r.scemode, 0, 0, 0, 0, "Only render this layer"); bt=uiDefIconBut(block, BUT, B_NOP, ICON_X, 285, 145, 25, 20, 0, 0, 0, 0, 0, "Deletes current Render Layer"); - uiButSetFunc(bt, delete_scene_layer_func, srl, (void *)(long)G.scene->r.actlay); + uiButSetFunc(bt, delete_scene_layer_func, srl, (void *)(intptr_t)G.scene->r.actlay); uiBlockEndAlign(block); /* RenderLayer visible-layers */ diff --git a/source/blender/src/drawmesh.c b/source/blender/src/drawmesh.c index dd512595ebc..09f74c01c71 100644 --- a/source/blender/src/drawmesh.c +++ b/source/blender/src/drawmesh.c @@ -664,7 +664,7 @@ static int draw_tfaces3D__setHiddenOpts(void *userData, int index) { struct { Mesh *me; EdgeHash *eh; } *data = userData; MEdge *med = &data->me->medge[index]; - unsigned long flags = (long) BLI_edgehash_lookup(data->eh, med->v1, med->v2); + uintptr_t flags = (intptr_t) BLI_edgehash_lookup(data->eh, med->v1, med->v2); if((G.f & G_DRAWSEAMS) && (med->flag&ME_SEAM)) { return 0; @@ -682,7 +682,7 @@ static int draw_tfaces3D__setSeamOpts(void *userData, int index) { struct { Mesh *me; EdgeHash *eh; } *data = userData; MEdge *med = &data->me->medge[index]; - unsigned long flags = (long) BLI_edgehash_lookup(data->eh, med->v1, med->v2); + uintptr_t flags = (intptr_t) BLI_edgehash_lookup(data->eh, med->v1, med->v2); if (med->flag&ME_SEAM) { if (G.f&G_HIDDENEDGES) { @@ -698,7 +698,7 @@ static int draw_tfaces3D__setSelectOpts(void *userData, int index) { struct { Mesh *me; EdgeHash *eh; } *data = userData; MEdge *med = &data->me->medge[index]; - unsigned long flags = (long) BLI_edgehash_lookup(data->eh, med->v1, med->v2); + uintptr_t flags = (intptr_t) BLI_edgehash_lookup(data->eh, med->v1, med->v2); return flags & eEdge_Select; } @@ -706,7 +706,7 @@ static int draw_tfaces3D__setActiveOpts(void *userData, int index) { struct { Mesh *me; EdgeHash *eh; } *data = userData; MEdge *med = &data->me->medge[index]; - unsigned long flags = (long) BLI_edgehash_lookup(data->eh, med->v1, med->v2); + uintptr_t flags = (intptr_t) BLI_edgehash_lookup(data->eh, med->v1, med->v2); if (flags & eEdge_Select) { return 1; diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index 1a469e8b366..213f49528f0 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -5315,7 +5315,7 @@ void draw_object_ext(Base *base) static void bbs_mesh_verts__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s) { - int offset = (long) userData; + int offset = (intptr_t) userData; EditVert *eve = EM_get_vert_for_index(index); if (eve->h==0) { @@ -5327,7 +5327,7 @@ static int bbs_mesh_verts(DerivedMesh *dm, int offset) { glPointSize( BIF_GetThemeValuef(TH_VERTEX_SIZE) ); bglBegin(GL_POINTS); - dm->foreachMappedVert(dm, bbs_mesh_verts__mapFunc, (void*)(long) offset); + dm->foreachMappedVert(dm, bbs_mesh_verts__mapFunc, (void*)(intptr_t) offset); bglEnd(); glPointSize(1.0); @@ -5336,7 +5336,7 @@ static int bbs_mesh_verts(DerivedMesh *dm, int offset) static int bbs_mesh_wire__setDrawOptions(void *userData, int index) { - int offset = (long) userData; + int offset = (intptr_t) userData; EditEdge *eed = EM_get_edge_for_index(index); if (eed->h==0) { @@ -5348,7 +5348,7 @@ static int bbs_mesh_wire__setDrawOptions(void *userData, int index) } static int bbs_mesh_wire(DerivedMesh *dm, int offset) { - dm->drawMappedEdges(dm, bbs_mesh_wire__setDrawOptions, (void*)(long) offset); + dm->drawMappedEdges(dm, bbs_mesh_wire__setDrawOptions, (void*)(intptr_t) offset); return offset + G.totedge; } @@ -5382,7 +5382,7 @@ static int bbs_mesh_solid_EM(DerivedMesh *dm, int facecol) cpack(0); if (facecol) { - dm->drawMappedFaces(dm, bbs_mesh_solid__setSolidDrawOptions, (void*)(long) 1, 0); + dm->drawMappedFaces(dm, bbs_mesh_solid__setSolidDrawOptions, (void*)(intptr_t) 1, 0); if( CHECK_OB_DRAWFACEDOT(G.scene, G.vd, G.obedit->dt) ) { glPointSize(BIF_GetThemeValuef(TH_FACEDOT_SIZE)); @@ -5415,7 +5415,7 @@ static int bbs_mesh_wire__setDrawOpts(void *userData, int index) { struct { Mesh *me; EdgeHash *eh; int offset; } *data = userData; MEdge *med = data->me->medge + index; - unsigned long flags = (long)BLI_edgehash_lookup(data->eh, med->v1, med->v2); + uintptr_t flags = (intptr_t)BLI_edgehash_lookup(data->eh, med->v1, med->v2); if (flags & 1) { set_framebuffer_index_color(data->offset+index); diff --git a/source/blender/src/editipo_lib.c b/source/blender/src/editipo_lib.c index 41044ad13d7..7b3d439833e 100644 --- a/source/blender/src/editipo_lib.c +++ b/source/blender/src/editipo_lib.c @@ -103,7 +103,7 @@ char *ic_name_empty[1] ={ "" }; char *fluidsim_ic_names[FLUIDSIM_TOTNAM] = { "Fac-Visc", "Fac-Time", "GravX","GravY","GravZ", "VelX","VelY","VelZ", "Active" }; char *part_ic_names[PART_TOTNAM] = { "E_Freq", "E_Life", "E_Speed", "E_Angular", "E_Size", "Angular", "Size", "Drag", "Brown", "Damp", "Length", "Clump", -"GravX", "GravY", "GravZ", "KinkAmp", "KinkFreq", "KinkShape", "BBTilt"}; +"GravX", "GravY", "GravZ", "KinkAmp", "KinkFreq", "KinkShape", "BBTilt", "FStreng", "FFall", "FMaxD"}; /* gets the appropriate icon for the given blocktype */ int geticon_ipo_blocktype(short blocktype) diff --git a/source/blender/src/editkey.c b/source/blender/src/editkey.c index 1f24fb07667..ce798064632 100644 --- a/source/blender/src/editkey.c +++ b/source/blender/src/editkey.c @@ -84,6 +84,8 @@ #include "blendef.h" #include "mydevice.h" +#include "BLO_sys_types.h" // for intptr_t support + extern ListBase editNurb; /* in editcurve.c */ /* temporary storage for slider values */ @@ -162,7 +164,7 @@ static void rvk_slider_func(void *voidob, void *voidkeynum) IpoCurve *icu=NULL; BezTriple *bezt=NULL; float cfra, rvkval; - int keynum = (long) voidkeynum; + int keynum = (intptr_t) voidkeynum; cfra = frame_to_float(CFRA); @@ -275,7 +277,7 @@ void make_rvk_slider(uiBlock *block, Object *ob, int keynum, x, y , w, h, meshslidervals+keynum, min, max, 10, 2, tip); - uiButSetFunc(but, rvk_slider_func, ob, (void *)(long)keynum); + uiButSetFunc(but, rvk_slider_func, ob, (void *)(intptr_t)keynum); // no hilite, the winmatrix is not correct later on... uiButSetFlag(but, UI_NO_HILITE); diff --git a/source/blender/src/editmesh_mods.c b/source/blender/src/editmesh_mods.c index 6dfbd67720b..c162c904776 100644 --- a/source/blender/src/editmesh_mods.c +++ b/source/blender/src/editmesh_mods.c @@ -109,6 +109,7 @@ editmesh_mods.c, UI level access, no geometry changes #include "editmesh.h" +#include "BLO_sys_types.h" // for intptr_t support /* ****************************** MIRROR **************** */ @@ -2937,7 +2938,7 @@ void select_sharp_edges(void) EditFace *efa; EditFace **efa1; EditFace **efa2; - long edgecount = 0, i; + intptr_t edgecount = 0, i; static short sharpness = 135; float fsharpness; @@ -3041,7 +3042,7 @@ void select_linked_flat_faces(void) EditFace *efa; EditFace **efa1; EditFace **efa2; - long edgecount = 0, i, faceselcount=0, faceselcountold=0; + intptr_t edgecount = 0, i, faceselcount=0, faceselcountold=0; static short sharpness = 135; float fsharpness; diff --git a/source/blender/src/editmesh_tools.c b/source/blender/src/editmesh_tools.c index f9bb14a08c6..3615a4ad851 100644 --- a/source/blender/src/editmesh_tools.c +++ b/source/blender/src/editmesh_tools.c @@ -110,6 +110,8 @@ editmesh_tool.c: UI called tools for editmesh, geometry changes here, otherwise #include "PIL_time.h" +#include "BLO_sys_types.h" // for intptr_t support + /* local prototypes ---------------*/ void bevel_menu(void); static void free_tagged_edges_faces(EditEdge *eed, EditFace *efa); @@ -132,7 +134,7 @@ static int vergxco(const void *v1, const void *v2) } struct facesort { - unsigned long x; + uintptr_t x; struct EditFace *efa; }; @@ -433,8 +435,8 @@ int removedoublesflag(short flag, short automerge, float limit) /* return amoun efa= em->faces.first; while(efa) { if(efa->f1 & 1) { - if(efa->v4) vsb->x= (unsigned long) MIN4( (unsigned long)efa->v1, (unsigned long)efa->v2, (unsigned long)efa->v3, (unsigned long)efa->v4); - else vsb->x= (unsigned long) MIN3( (unsigned long)efa->v1, (unsigned long)efa->v2, (unsigned long)efa->v3); + if(efa->v4) vsb->x= (uintptr_t) MIN4( (uintptr_t)efa->v1, (uintptr_t)efa->v2, (uintptr_t)efa->v3, (uintptr_t)efa->v4); + else vsb->x= (uintptr_t) MIN3( (uintptr_t)efa->v1, (uintptr_t)efa->v2, (uintptr_t)efa->v3); vsb->efa= efa; vsb++; diff --git a/source/blender/src/header_info.c b/source/blender/src/header_info.c index a9280d9dd19..8b8fd9ef266 100644 --- a/source/blender/src/header_info.c +++ b/source/blender/src/header_info.c @@ -39,6 +39,8 @@ #include #endif +#include "BLO_sys_types.h" // for intptr_t support + #include "DNA_group_types.h" #include "DNA_ID.h" #include "DNA_image_types.h" @@ -2106,7 +2108,7 @@ static void info_text(int x, int y) { Object *ob= OBACT; extern float hashvectf[]; - extern unsigned long mem_in_use, mmap_in_use; + extern uintptr_t mem_in_use, mmap_in_use; unsigned int swatch_color; float fac1, fac2, fac3; char infostr[300], memstr[64]; diff --git a/source/blender/src/header_script.c b/source/blender/src/header_script.c index 3c96e1692bf..53c4b9b5953 100644 --- a/source/blender/src/header_script.c +++ b/source/blender/src/header_script.c @@ -63,12 +63,14 @@ #include "blendef.h" #include "mydevice.h" +#include "BLO_sys_types.h" // for intptr_t support + /* ********************** SCRIPT ****************************** */ /* action executed after clicking in Scripts menu */ static void do_scripts_submenus(void *int_arg, int event) { - int menutype = (long)int_arg; + int menutype = (intptr_t)int_arg; BPY_menu_do_python (menutype, event); @@ -80,7 +82,7 @@ static uiBlock *script_scripts_submenus(void *int_menutype) uiBlock *block; short yco = 20, menuwidth = 120; BPyMenu *pym; - int i = 0, menutype = (long)int_menutype; + int i = 0, menutype = (intptr_t)int_menutype; if ((menutype < 0) || (menutype > PYMENU_SCRIPTS_MENU_TOTAL)) return NULL; @@ -132,7 +134,7 @@ static uiBlock *script_scriptsmenu(void *arg_unused) uiBlockSetButmFunc(block, do_script_scriptsmenu, NULL); for (i = 0; i < PYMENU_SCRIPTS_MENU_TOTAL; i++) { - uiDefIconTextBlockBut(block, script_scripts_submenus, (void *)(long)i, ICON_RIGHTARROW_THIN, BPyMenu_group_itoa(i), 0, yco-=20, menuwidth, 19, ""); + uiDefIconTextBlockBut(block, script_scripts_submenus, (void *)(intptr_t)i, ICON_RIGHTARROW_THIN, BPyMenu_group_itoa(i), 0, yco-=20, menuwidth, 19, ""); } uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); diff --git a/source/blender/src/header_view3d.c b/source/blender/src/header_view3d.c index 948023bebfb..fcf4caf4522 100644 --- a/source/blender/src/header_view3d.c +++ b/source/blender/src/header_view3d.c @@ -5139,7 +5139,7 @@ static char *snapmode_pup(void) static char string[512]; char *str = string; - str += sprintf(str, "%s", "Snap Mode: %t"); + str += sprintf(str, "%s", "Snap Element: %t"); str += sprintf(str, "%s", "|Vertex%x0"); str += sprintf(str, "%s", "|Edge%x1"); str += sprintf(str, "%s", "|Face%x2"); @@ -5777,7 +5777,7 @@ void view3d_buttons(void) xco+= XIC; uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_VERTEXSEL, snapmode_pup(), xco,0,XIC+10,YIC, &(G.scene->snap_mode), 0.0, 0.0, 0, 0, "Snapping mode"); xco+= XIC; - uiDefButS(block, MENU, B_NOP, "Mode%t|Closest%x0|Center%x1|Median%x2|Active%x3",xco,0,70,YIC, &G.scene->snap_target, 0, 0, 0, 0, "Snap Target Mode"); + uiDefButS(block, MENU, B_NOP, "Snap Mode%t|Closest%x0|Center%x1|Median%x2|Active%x3",xco,0,70,YIC, &G.scene->snap_target, 0, 0, 0, 0, "Snap Target Mode"); xco+= 70; } else { uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEAR,xco,0,XIC,YIC, &G.scene->snap_flag, 0, 0, 0, 0, "Snap while Ctrl is held during transform (Shift Tab)"); diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c index e7b5b176979..a2b2af05083 100644 --- a/source/blender/src/interface.c +++ b/source/blender/src/interface.c @@ -105,6 +105,8 @@ #include "blendef.h" #include "winlay.h" +#include "BLO_sys_types.h" // for intptr_t support + #define INSIDE_BLOCK 1 #define INSIDE_PANEL_HEADER 2 #define INSIDE_PANEL_SCALE 3 @@ -6039,7 +6041,7 @@ void autocomplete_end(AutoComplete *autocpl, char *autoname) /* autocomplete callback for ID buttons */ static void autocomplete_id(char *str, void *arg_v) { - int blocktype= (long)arg_v; + int blocktype= (intptr_t)arg_v; ListBase *listb= wich_libbase(G.main, blocktype); if(listb==NULL) return; @@ -6370,7 +6372,7 @@ uiBut *uiDefIDPoinBut(uiBlock *block, uiIDPoinFuncFP func, short blocktype, int ui_check_but(but); if(blocktype) - uiButSetCompleteFunc(but, autocomplete_id, (void *)(long)blocktype); + uiButSetCompleteFunc(but, autocomplete_id, (void *)(intptr_t)blocktype); return but; } diff --git a/source/blender/src/meshlaplacian.c b/source/blender/src/meshlaplacian.c index 60f569ecf0e..2de6367c9ad 100644 --- a/source/blender/src/meshlaplacian.c +++ b/source/blender/src/meshlaplacian.c @@ -63,6 +63,8 @@ #include "ONL_opennl.h" +#include "BLO_sys_types.h" // for intptr_t support + /************************** Laplacian System *****************************/ struct LaplacianSystem { @@ -126,14 +128,14 @@ static void laplacian_increase_edge_count(EdgeHash *edgehash, int v1, int v2) void **p = BLI_edgehash_lookup_p(edgehash, v1, v2); if(p) - *p = (void*)((long)*p + (long)1); + *p = (void*)((intptr_t)*p + (intptr_t)1); else - BLI_edgehash_insert(edgehash, v1, v2, (void*)(long)1); + BLI_edgehash_insert(edgehash, v1, v2, (void*)(intptr_t)1); } static int laplacian_edge_count(EdgeHash *edgehash, int v1, int v2) { - return (int)(long)BLI_edgehash_lookup(edgehash, v1, v2); + return (int)(intptr_t)BLI_edgehash_lookup(edgehash, v1, v2); } static float cotan_weight(float *v1, float *v2, float *v3) diff --git a/source/blender/src/meshtools.c b/source/blender/src/meshtools.c index 0f30aef04df..99833625baa 100644 --- a/source/blender/src/meshtools.c +++ b/source/blender/src/meshtools.c @@ -107,6 +107,8 @@ void sort_faces(void); #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" +#include "BLO_sys_types.h" // for intptr_t support + /* from rendercode.c */ #define VECMUL(dest, f) dest[0]*= f; dest[1]*= f; dest[2]*= f @@ -592,7 +594,7 @@ void sort_faces(void) typedef struct MocNode { struct MocNode *next; - long index[MOC_NODE_RES]; + intptr_t index[MOC_NODE_RES]; } MocNode; static int mesh_octree_get_base_offs(float *co, float *offs, float *div) @@ -610,7 +612,7 @@ static int mesh_octree_get_base_offs(float *co, float *offs, float *div) return (vx*MOC_RES*MOC_RES) + vy*MOC_RES + vz; } -static void mesh_octree_add_node(MocNode **bt, long index) +static void mesh_octree_add_node(MocNode **bt, intptr_t index) { if(*bt==NULL) { *bt= MEM_callocN(sizeof(MocNode), "MocNode"); @@ -642,7 +644,7 @@ static void mesh_octree_free_node(MocNode **bt) /* temporal define, just to make nicer code below */ #define MOC_ADDNODE(vx, vy, vz) mesh_octree_add_node(basetable + ((vx)*MOC_RES*MOC_RES) + (vy)*MOC_RES + (vz), index) -static void mesh_octree_add_nodes(MocNode **basetable, float *co, float *offs, float *div, long index) +static void mesh_octree_add_nodes(MocNode **basetable, float *co, float *offs, float *div, intptr_t index) { float fx, fy, fz; int vx, vy, vz; @@ -690,7 +692,7 @@ static void mesh_octree_add_nodes(MocNode **basetable, float *co, float *offs, f } -static long mesh_octree_find_index(MocNode **bt, float (*orco)[3], MVert *mvert, float *co) +static intptr_t mesh_octree_find_index(MocNode **bt, float (*orco)[3], MVert *mvert, float *co) { float *vec; int a; @@ -734,7 +736,7 @@ static struct { /* mode is 's' start, or 'e' end, or 'u' use */ /* if end, ob can be NULL */ -long mesh_octree_table(Object *ob, float *co, char mode) +intptr_t mesh_octree_table(Object *ob, float *co, char mode) { MocNode **bt; @@ -805,7 +807,7 @@ long mesh_octree_table(Object *ob, float *co, char mode) EditVert *eve; for(eve= G.editMesh->verts.first; eve; eve= eve->next) { - mesh_octree_add_nodes(MeshOctree.table, eve->co, MeshOctree.offs, MeshOctree.div, (long)(eve)); + mesh_octree_add_nodes(MeshOctree.table, eve->co, MeshOctree.offs, MeshOctree.div, (intptr_t)(eve)); } } else { @@ -863,7 +865,7 @@ int mesh_get_x_mirror_vert(Object *ob, int index) EditVert *editmesh_get_x_mirror_vert(Object *ob, float *co) { float vec[3]; - long poinval; + intptr_t poinval; /* ignore nan verts */ if (isnan(co[0]) || !finite(co[0]) || diff --git a/source/blender/src/parametrizer.c b/source/blender/src/parametrizer.c index 096629b01ec..7aa27f99d77 100644 --- a/source/blender/src/parametrizer.c +++ b/source/blender/src/parametrizer.c @@ -22,6 +22,8 @@ #include #include +#include "BLO_sys_types.h" // for intptr_t support + #if defined(_WIN32) #define M_PI 3.14159265358979323846 #endif @@ -38,7 +40,7 @@ static int PHashSizes[] = { 4194319, 8388617, 16777259, 33554467, 67108879, 134217757, 268435459 }; -#define PHASH_hash(ph, item) (((unsigned long) (item))%((unsigned int) (ph)->cursize)) +#define PHASH_hash(ph, item) (((uintptr_t) (item))%((unsigned int) (ph)->cursize)) #define PHASH_edge(v1, v2) ((v1)^(v2)) static PHash *phash_new(PHashLink **list, int sizehint) diff --git a/source/blender/src/parametrizer.h b/source/blender/src/parametrizer.h index 80fab110d5f..c468b8d62c5 100644 --- a/source/blender/src/parametrizer.h +++ b/source/blender/src/parametrizer.h @@ -5,9 +5,11 @@ #ifdef __cplusplus extern "C" { #endif + +#include "BLO_sys_types.h" // for intptr_t support typedef void ParamHandle; /* handle to a set of charts */ -typedef long ParamKey; /* (hash) key for identifying verts and faces */ +typedef intptr_t ParamKey; /* (hash) key for identifying verts and faces */ typedef enum ParamBool { PARAM_TRUE = 1, PARAM_FALSE = 0 diff --git a/source/blender/src/parametrizer_intern.h b/source/blender/src/parametrizer_intern.h index f7a32816b33..bc38cb4bc0f 100644 --- a/source/blender/src/parametrizer_intern.h +++ b/source/blender/src/parametrizer_intern.h @@ -30,7 +30,7 @@ typedef enum PBool { /* Special Purpose Hash */ -typedef long PHashKey; +typedef intptr_t PHashKey; typedef struct PHashLink { struct PHashLink *next; diff --git a/source/blender/src/renderwin.c b/source/blender/src/renderwin.c index 6c150f3d30f..88f5f6efe15 100644 --- a/source/blender/src/renderwin.c +++ b/source/blender/src/renderwin.c @@ -50,6 +50,8 @@ #endif +#include "BLO_sys_types.h" // for intptr_t support + #include #include "BLI_blenlib.h" @@ -901,7 +903,7 @@ static void renderwin_progress_display_cb(RenderResult *rr, volatile rcti *rect) void make_renderinfo_string(RenderStats *rs, char *str) { extern char info_time_str[32]; // header_info.c - extern unsigned long mem_in_use, mmap_in_use; + extern uintptr_t mem_in_use, mmap_in_use; float megs_used_memory, mmap_used_memory; char *spos= str; diff --git a/source/blender/src/space.c b/source/blender/src/space.c index 8d86336e12e..fb055216f7f 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -182,6 +182,8 @@ #include "SYS_System.h" /* for the user def menu ... should move elsewhere. */ +#include "BLO_sys_types.h" // for intptr_t support + /* maybe we need this defined somewhere else */ extern void StartKetsjiShell(ScrArea *area, char* startscenename, struct Main* maggie, struct SpaceIpo* sipo,int always_use_expand_framing); extern void StartKetsjiShellSimulation(ScrArea *area, char* startscenename, struct Main* maggie, struct SpaceIpo* sipo,int always_use_expand_framing);/*rcruiz*/ @@ -460,7 +462,7 @@ static LinkNode *save_and_reset_all_scene_cfra(void) Scene *sc; for (sc= G.main->scene.first; sc; sc= sc->id.next) { - BLI_linklist_prepend(&storelist, (void*) (long) sc->r.cfra); + BLI_linklist_prepend(&storelist, (void*) (intptr_t) sc->r.cfra); /* why is this reset to 1 ?*/ /* sc->r.cfra= 1;*/ @@ -478,7 +480,7 @@ static void restore_all_scene_cfra(LinkNode *storelist) { Scene *sc; for (sc= G.main->scene.first; sc; sc= sc->id.next) { - int stored_cfra= (long) sc_store->link; + int stored_cfra= (intptr_t) sc_store->link; sc->r.cfra= stored_cfra; set_scene_bg(sc); diff --git a/source/blender/src/splash.jpg.c b/source/blender/src/splash.jpg.c index 2431ff5de22..ecd63166792 100644 --- a/source/blender/src/splash.jpg.c +++ b/source/blender/src/splash.jpg.c @@ -1,2990 +1,1590 @@ /* DataToC output of file */ -int datatoc_splash_jpg_size= 95515; +int datatoc_splash_jpg_size= 50665; char datatoc_splash_jpg[]= { -255,216,255,224, 0, 16, 74, 70, 73, 70, 0, 1, 2, 0, 0,100, 0,100, 0, 0,255,236, 0, 17, 68,117, 99, -107,121, 0, 1, 0, 4, 0, 0, 0, 95, 0, 0,255,238, 0, 14, 65,100,111, 98,101, 0,100,192, 0, 0, 0, 1,255,219, 0,132, - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 1, 1, 1, 1, 2, 1, 2, 3, 2, 2, 3, 4, 4, 3, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5,255,192, 0, 17, 8, 1, 26, 1,245, 3, 1, 17, 0, 2, 17, 1, 3, 17, 1,255,196, 0,230, 0, 0, 0, 6, 3, 1, 1, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, 8, 0, 2, 9, 1, 10, 11, 1, 0, 0, 7, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 16, 0, 1, 3, 3, 3, 1, 4, 4, 9, 8, 5, 8, 5, - 8, 5, 13, 1, 2, 3, 4, 17, 5, 6, 0, 18, 7, 33, 49, 65, 19, 8, 81, 97, 34, 20,113,129,145, 50, 35, 51, 52, 21, 9,240, -161,177,193, 66, 82, 98, 53,225,149,213, 22, 54,209,241,114, 36,212, 69, 85, 24,194, 67, 83, 99,148,130,162,179, 37,117,181, 23, - 55,115,195, 68,133, 10,146,178,210,131,147,211,116,196,165,197, 38, 70, 71, 17, 0, 1, 3, 2, 4, 2, 6, 5, 8, 8, 5, 4, - 2, 1, 5, 1, 1, 17, 2, 3, 0, 4, 33, 49, 18, 5, 65, 6, 81, 97,113, 34, 19, 7,129,145,161, 50, 20,240,177,193,209, 66, -146, 83,211,225,114, 35, 51, 67, 21, 23, 8,241, 82, 98,130,210,178, 36, 52, 22,194,115,162,226, 99, 68,116, 9, 53,255,218, 0, - 12, 3, 1, 0, 2, 17, 3, 17, 0, 63, 0,251,244,208,161, 89,161, 66,136, 93,149,114, 77,174,228,171, 50, 34,185,119, 76, 9, -106,181, 55, 57, 74, 76, 37,220, 67,106,240, 3,197, 21, 88, 65,114,155,138,122,211,179, 81,175, 76,194, 25, 62, 31, 79,139,164, -232,212,186,117, 39,117, 83, 20, 84, 84,225, 82,172, 68, 38,104,254, 32,184, 69,168,107,210,154,180,175,123, 74,224,168,168,188, -107,147,184, 15,158, 62, 82,226,238, 69,187,224, 62,105,236,206, 52,193,184, 58,148,222, 45,214, 86,160,203,199,208,226,190,140, -161,168,200, 67,115,225,148,252,215, 81,185,116,235, 85,158,131,197, 92,181,253,196,239, 60,147,187, 75,181,115,188, 37,163, 81, - 73, 26,192, 11, 1,201, 3, 64, 18, 68,120, 57,170,239,214,225,237,206,102,254,220,118, 94,120,218, 34,221,185, 26, 96,227,164, - 44,110,121, 34, 66, 51, 82,226, 76,114,142, 45,114, 55,169,185,158,172, 99,217, 21,139, 44,179,192,200, 49,171,180, 27,221,150, -230,194, 36,193,185, 91,100,166, 84, 73, 44,172, 84, 20,173, 4,142,157,132,118,131,208,245,215,180, 54,221,202,223,120,129,151, - 54,178, 54, 72,158, 21,174,105, 5,164, 30, 32,138,241, 62,229,182, 92,108,211,190,214,238, 55, 71, 43, 10, 57,174, 4, 56, 17, -192,131, 75, 58,157, 80,107, 52, 40, 86,104, 80,172,208,161, 89,161, 66,179, 66,133,102,133, 10,205, 10, 21,154, 20, 43, 52, 40, - 86,104, 80,172,208,161, 89,161, 66,179, 66,133,102,133, 10,205, 10, 21,154, 20, 43, 52, 40, 86,104, 80,172,208,161, 89,161, 66, -179, 66,133,102,133, 10,205, 10, 21,154, 20, 43, 52, 40, 86,104, 80,172,208,161, 89,161, 66,179, 66,133,102,133, 10,205, 10, 21, -154, 20, 43, 52, 40, 86,104, 80,172,208,161, 89,161, 66,179, 66,133,102,133, 10,205, 10, 21,154, 20, 43, 52, 40, 86,104, 80,172, -208,161, 89,161, 66,179, 66,133,102,133, 10,205, 10, 21,154, 20, 43, 52, 40, 86,104, 80,172,208,161, 89,161, 66,179, 66,133,102, -133, 10,205, 10, 21,154, 20, 43, 52, 40, 86,104, 80,174,110,249,156,129,231,110, 79, 36, 72, 95, 16,221,151, 15,143,125,198, 10, -108,173, 88, 38, 67,132,250, 94,240,211,239, 30,251,239, 32, 58,183, 11,251,138, 72, 37, 59,118,210,134,186,242,199,155, 27, 63, -152,251,134,236,231,114,252,205,109,142,150,232, 12,124,108, 42,157,237,122,241, 46,212,168,138, 17, 19, 21,175, 86,121, 75,188, -249,109,183,109, 45,111, 48,194,231, 95,106,118,178,246, 72,240,139,221,209,163, 0,221, 40,170,133, 87,130, 85, 2,207,249,239, -205,223, 25,222, 14, 61,151,114,205,222, 29,241,180,133,201,181,196,188, 65,185, 75,130, 20, 1, 72,144,150, 16,224,101, 74, 6, -161, 43, 32,211,173, 41, 77,121,119,156,124,195,231,206, 68,185,248, 77,195,116, 34,100,197,140,146, 57, 11,122, 53,105, 7, 73, - 60, 1,197, 49, 74,245, 63, 38,121,115,200, 60,251,109,241,155,118,212, 12, 11,131,223, 28,177,135,116,232,214, 65,112, 28, 72, - 8,184, 45, 35,189,138,121,171,243, 47, 2,219,114,187, 65,190,230,112, 34,120,143, 90,110,183,166,162, 91,213,177,225, 69,120, - 47, 56,150, 93, 90, 23, 65,208, 18,146,122,246,232, 14, 78,243, 3,206,107,104,167,184,142, 73,161, 29,232,223, 41,142, 53, 7, -139, 11,180,184,180,245,119, 77, 25,231, 63, 47,124,150,186,150,222,222, 72,224,156,163,100,100, 34, 73, 16,142, 15, 13,212,208, -225,215,222, 25, 83,135,142,185, 19,204, 39,146,204,138, 51, 57, 22, 57,118,143,136,221,229,149, 92,113,123,194,183,216,174,229, - 0, 7, 23, 14, 74, 11,141,177, 33, 40,235,185, 7,175, 77,201, 34,154,149,203, 60,199,205,191,219,133,211, 89,127,108,241,103, - 35,187,209,184,131, 27,207, 19, 27,219,169,173,122,116,103,246,129, 25, 68,230,126, 91,229, 15,238, 82,213,239,219,238, 88,111, - 35,111,118, 86,130, 36, 96,224, 36, 99,131, 92,230, 47, 72,195,236,184, 28,251, 71,135,249,130,192,243,126, 29,188,115, 61,133, -201,147, 44, 56,238, 59,124,191, 95,173, 44,182,131,124,183, 61,142, 68, 92,185,112,148,218,214,134,252,100,161, 20, 69, 86, 18, -170,130, 21,180,215, 95, 70,124,189,230,219, 47, 50,236,224,189,219, 94,172,149,193,136,112, 44,126, 0,177,227, 20, 45, 36, 42, - 42,132, 33, 65, 21,243,115,204, 94, 82,189,242,194,242,226,203,115, 98, 62, 38,151,171,113, 15, 96, 4,135,176,148, 80,224, 10, - 42, 33, 80, 80,131, 81,199,147,111, 59,124, 23,231,171,141, 37,242,151, 5, 92,114, 9, 22, 91, 93,229,204,118,251,108,202,108, - 46, 99,247,203, 37,245,150, 24,144,184,238,182, 84,235, 46,237,106, 66, 15,136,195,171, 65,173, 2,170, 14,186,119, 54,242,133, -231, 37,220,139, 91,208,208,242,221, 64,180,168, 45, 82, 23,167,129,192,128,107,149,242,103, 59, 88,243,221,161,188,176, 46, 44, - 14,210, 67,155,164,135, 32, 40,120, 28, 8,196, 18, 58,234,102,230,206,105,227,159, 47, 28, 97,149,243, 31, 45, 95, 85,140,241, -238, 19, 14, 60,252,146,248,155,116,155,178,160, 69,148,251, 81,144,175,119,136,211,242, 28,220,243,200, 77, 16,131,219, 83,210, -186,170,217,246,139,141,250,229,150,150,173,213, 43,202, 52, 40, 11,130,230, 80,100, 42,231,123,222,237,185,118,214, 75,219,183, -105,133,129, 92, 80,148, 10,153, 0, 78,102,139,112, 87, 58,241,135,153, 62, 47,198,121,147,135, 50, 63,239, 95, 30,229,237,220, - 29,176, 94,205,186, 77,161,115, 17,108,150,252, 39,137,141, 49,150, 36,181,182, 68,103, 18, 55,160, 86,149, 21, 4, 18,123,206, -205,113,203,247, 47,179,187,110,153, 88,154,130,130,138, 1, 24,130, 70, 68, 81,108, 91,229,183, 50, 90, 71,123,102,253,112,189, -116,185, 8, 84, 37,167, 2, 1,204, 30, 21, 46,234,174,173,171, 52, 40, 86,104, 80,172,208,161, 84,163,130,252,254,121,126,243, - 25,207,252,215,229,203,139,166,229, 55, 76,219,128,164,201,182,242, 5,202,227,143, 42,207,141,181,124,129,113,145,108,147, 10, - 27,207,184,153, 18,151, 30, 84, 85,133, 56, 24, 13,145, 66,133,170,186,215,111,124,147,125,203,214, 54,215,247, 65,162, 59,140, - 88, 1, 87, 38,144,224, 74, 96, 20, 17,130,175, 72,172, 86,193,207,187,127, 50,223,221,109,214,133,230, 75, 98,146, 18,212,106, -135, 22,144, 9,196,161, 7, 20, 78,131, 87, 95, 89, 26,218,214,104, 80,166,150,125,157, 98,188, 97,131,230, 28,145,157, 93,216, -199,240,188, 7, 24,190,102, 57,101,242, 74, 22,235, 22,156,119, 27,140,236,201,146, 20,134,146,183, 92,240,163,178,165,108, 66, - 74,141, 40,144, 73, 3, 82,172,108,165,220,166,142,222, 22,234,145,238, 13,104,233,115,138, 1,233, 38,162,110, 23,241,109,112, - 73,115, 59,180,199, 27, 75,220,122, 26,208,164,244,224, 7, 12,107,231, 85,127,143, 87, 55,242,157,198,249,126,242,157,248,110, -243, 47, 52,241, 6, 61,113,145, 13,204,234, 69,202,226,205,198,240, 34,237, 82,208, 34,217,177,235,212, 72, 79, 6,250,150, 83, - 46, 66,192, 82, 74,146, 59, 15,120,119,146,214, 27, 72,108,123,174,239, 4, 23, 14, 11,163,186,129,122,220,246, 18, 58,244,180, -117,215,157,155,231,190,225,188,151,203,179,236,151, 23, 22,205, 41,173, 92,165, 56, 35, 35,120, 5, 56,106,113,196, 97, 93, 31, -252, 60,255, 0, 20,110, 28,252, 64, 96,101, 22, 91, 30, 57,127,226,190, 97,192, 67,107,206,120,151, 45,125, 19, 46, 22,248,142, - 57,224,251,228, 9,136,109,129, 62, 50, 36,253, 3,165,108,180,235,110, 10, 56,202, 2,155, 82,240, 28,249,229,197,223, 34, 58, - 55, 72,246,203, 4,158,228,141,200,241, 66, 49, 66,152,140, 72, 35, 34, 80,167, 72,242,239,205, 11, 47, 48,217, 35, 35, 99,162, -184,139,223,137,248,144, 50, 80,112,212, 23, 3,128, 32,230,208,160,158,156,107,158, 87, 76,172,208,161, 84, 31,206, 95,226, 19, -195,254, 77,114,110, 15,227,188,153,137, 25,135, 41,115,215, 34, 98, 56,102, 41,129,217,174, 45, 66,184, 91, 49,252,134,230,197, -186, 86, 67,113,113,104,119,221,161,195, 91,219, 90, 27, 10,159,116,120,109,128,148,186,227, 91,110, 83,228, 91,190,108,138,230, -226, 51,162, 24, 35,115,220,242, 20, 18,214,151, 6, 55,165,197, 49,255, 0, 40,196,230, 1,192,243,151,152, 86,124,157, 53,173, -172,160,190,123,137, 88,198,176, 16, 8, 14,112,105,123,186, 26, 23, 12, 21,199, 1,145, 34,242,191,121,182,195,180, 73,190,220, -167, 68,182, 90, 32,193,145,115,184, 92,174, 50, 81, 10, 5,190,223, 17, 5,215,159,125,231, 20,150,218,109,166,210, 84,181,172, -128, 0, 36,154, 13, 99, 35,141,210,184, 53,160,146, 74, 0, 49, 36,156,128, 29, 53,187,146, 70,194,210,247,144, 26, 2,146,112, - 0, 12,201, 60, 0,174, 61,240,191,227, 31,199,222,102,188,224,163,203,135,150,238, 20,228, 30, 89,226,251, 68, 91,136,205,252, -197,193,148,197,151, 23,199,165, 50, 8,141, 45,171,124,198,218,113,251,115,238,161, 76,165,247,164, 52,251,138,169, 98, 51,201, - 77, 87,213,119,191, 42,102,229,141,167,249,134,227,113, 28, 83, 56,141, 16, 21, 46,119, 72, 80,168,224, 49, 64, 11, 64,247,156, - 9,195,143,236, 30,112,193,205,155,207,242,205,174,218, 73,160,104, 58,231, 8, 26,222,131,164,162,176,156, 20,144,226,125,214, - 56, 12,123, 44,149,110, 74, 84, 59, 20, 1,235,219,215, 92,158,187, 29,123,161, 66,179, 66,133,102,133, 10,205, 10, 21,154, 20, - 43, 52, 40, 86,104, 80,172,208,161, 89,161, 66,179, 66,133,102,133, 10,205, 10, 21,154, 20, 43, 52, 40, 86,104, 80,172,208,161, - 89,161, 66,179, 66,133,102,133, 10,205, 10, 20,147,115,200, 44, 54, 69, 50,155,205,238,209,105, 84,128,181, 71, 77,206,228,204, - 5, 62,150,232, 20, 80, 29, 90, 55,109,168,173, 52,236,112,190, 95,117,164,246, 5,164,151, 6,230,104,172, 92,183, 21,157,144, - 79,196,161,100,216,252,204,170,215,111,137,118,185,227, 49,111, 49,164,100, 22,235, 84,243, 70, 36,191, 9, 14, 25, 44,180,249, -250,183, 22,128,149,119, 19,163,117,180,140, 96,144,181,193,132,160, 40, 80,145,152, 7, 37, 20, 3,193, 40,161,105,193,166,105, - 84,131,145,229,120,190, 31, 5,155,166, 91,146, 88, 49,107,108,137,240,237,113,238, 57, 29,226, 61,146, 11,247, 59,130,182, 71, -140,135,164,184,211,106,117,245,251, 45,182, 14,229, 30,128, 29, 61, 5,188,151, 39, 76,109,115,138, 42, 0, 73, 65,153,195,128, -164,185,225,152,146,148,189,166,105, 84,141, 55, 35,199,173,178,219,183,220,111,214, 91,124,247, 67,106,106, 20,219,163, 17,101, -186,151,137, 74, 10, 91,113,196,173, 91,148, 8, 20, 29, 78,157,100, 15,144,106,107, 73, 29, 32, 26, 73,112, 24, 19, 75, 58,106, -149, 89,161, 66,147, 87,122,179,183,120,143,142,185,118,182, 35, 32,153,108,155,122,137, 98, 92,246,147,120,149,103,183, 58,195, - 18, 37,183, 20,175,199, 91, 44, 63, 41,150,220,117, 41,218,149, 45, 9, 36, 21, 36, 23, 4, 78, 45, 47, 67,164, 20, 84,193, 74, -144, 23, 37, 32, 28, 58,141, 22,160,169,198,142, 73,147, 26, 20,119,165,204,144,196, 72,177,219, 83,210, 36,201,117, 44, 71, 97, -164, 10,169, 75, 90,136, 74, 64, 29,164,157, 33,173, 46, 40, 2,154, 50, 82,134,209, 80,172,208,161, 89,161, 66,162,142, 65,229, -236, 87, 1,180, 92,174,183, 27,132, 88,240,109, 15, 46, 61,239, 32,184,151, 34,226, 88,191,130,130,227,174,220,238, 1, 10,101, -132,176,210, 74,150,128, 74,135, 64, 66,119, 3,163,107, 75,138, 12,232, 18,149,199,110,102,252, 84,237,138,189, 92, 48,142, 2, -192,185, 19,154,114,148,186,109,176,179,171,149,238,225,198,152, 7,191,184,176,211,178,161,219,109,202,137,114,155, 18, 58,138, -150,143, 21, 64,169, 9,250,211, 80,181,109,236,249, 49,198, 49, 45,203,244, 14,128,210, 83,180,229,234, 94,140,234,150, 93,224, -106,211, 27, 84,246,253, 31, 90, 82,187,191,137, 3, 54,219, 37,162,213,253,207,190,103,119,152, 54,139,106, 46,249,108, 62,103, -185, 91,108, 87, 91,170, 88, 64,144,244, 51,109,139, 24, 63, 28,185, 95, 13,206,129, 67,218, 27,129,220,103,193,200, 34, 81,168, -204, 67, 78, 93,220, 83,130,247,176,168,239,223,116,224, 25,143,111,232,171,243,228,211,205, 53,183,204,213,131, 53,145, 18,223, -119,183,203,194,239, 22,200, 18,154,184, 60,221,218, 42, 81,116,143,226, 4, 49,115,101,182, 81, 48, 52,251, 79, 54, 67,141,135, - 19,182,139, 42, 39,113,203,111,219, 19,182, 71,129,172, 57,174, 84, 60,112, 69, 81,233,233,171, 75, 27,209,122, 9, 66, 8,206, -174,134,168,106,117, 4,251,236, 69, 97,233, 50, 94,106, 52,104,237, 45,231,228, 62,224,101,134, 25,104, 21, 41,107, 90,136, 74, - 82,144, 42, 73, 61, 52,137,101,108, 45, 47,121, 1,160, 41, 39, 0, 0,204,147,192, 82,226,137,211,184, 49,128,151, 18,128, 0, -164,147,144, 0,102,107,147,254,104,124,253,120, 78,207,227,158, 2,147,239,151, 7, 22,253,178,235,200, 17,219, 18, 27, 67,171, -250, 50,213,153, 52, 80,121, 68,146, 4,154, 83,254,204, 30,139, 30, 36,243,143,251,155, 33,206,218, 57, 92,235,144,146,199, 78, - 2,226,112,211, 8,199, 81, 63,231,251,128,224,234,247, 23,147, 63,218,248, 44,102,241,205, 35, 68, 96, 7,182,220,148,192, 99, -170,115,134,144, 51,209,159,249,200,197,181,205, 78, 40,199,198,113,204,248,141,131, 45, 92,153, 42,189,229,141,181,126, 55, 39, - 22,185,114,164, 5,173,199,144,250,150,119,149, 58,226, 10, 87, 83, 90,157,121, 91,203, 45,145,188,207,205,118, 86, 91,162,184, - 62,227,246,161,234,174, 45, 87, 57,174, 92, 85,196,105, 43,142, 53,234,239, 51,247,199,114,191, 41,222,222,237,101,173, 49,219, -126,200,177, 17,161,200,214,185,169,130, 52, 59, 80, 76, 48,174, 63,126, 51,190,110,252,197,187,231, 47,147,120, 22,221,152,102, -124, 97,197, 28, 37, 50,211,137,225, 56, 38, 45,120,151,139, 91, 46, 49, 4, 24,146, 77,230, 82, 34,173,143,125,114,226,183,188, - 86,156, 93, 66, 91,216,148, 80, 2, 79,233,159,201, 94, 73,218,236, 54, 59,123,134, 67, 27,228,145,170, 92, 90, 14,148, 36, 6, - 55,252,161,160, 34, 4,198,191, 45,190,124,115,230,239,184,111,247, 54,178, 77, 43, 34,137,200,214,135, 56,106, 80, 28, 94,236, -123,197,196,170,149,193, 18,175, 71,224,153,230, 31,152,124,206,241,135,153,239, 45, 60,239,145,228, 92,149,199,152, 39, 30, 51, -200, 28,127,152,229,243, 92,189,221,184,243, 35, 99,222, 18,136,109, 92,100,120,143,150,159, 13,120,237,180,183, 8, 64, 67,161, - 35,106,212, 53,231,143,239, 83,203, 45,151,115,216, 36,115,163,100,110,146, 57, 73, 0, 0,142,141,133,237,148, 12,129,105,192, -145,152, 40,107,210,159,216,191,154,155,230,221,191,199, 24,150, 73, 27, 28,145, 0, 92, 73,238,200,253, 15,136,156,200,120,196, - 2,112, 33, 69,116, 11,202,174,117,114,179, 88, 60,195,225, 94, 59,202,179,100,220, 19,201, 19,215, 23,121, 44, 55,114,181, 90, -228,165, 14, 4,246, 36,169,167,148, 9,239,160, 29,195, 95, 42,191,177,254, 98,150,219,152,228,218,201, 38, 41, 67, 36, 3,128, -123, 36,104, 84,224,173,113, 4,241, 65,213, 95, 91,127,190,174, 93,134,231,150,153,186, 0, 4,177, 23,198,188, 75, 36,141,229, - 23,138, 57,160,129,193, 79, 77,113,175,240,122,242, 79,230, 67,205,255, 0, 14,114, 35, 56, 63,155,222, 71,242,229,197,120,182, -117, 37,184,246, 14, 49,144,236, 59,133,251, 57,153, 6, 26,223,155,112,114, 52,219,123,139,105,136,201,142,134,155, 90,213, 83, -191,111,135,212,175,238, 71,155,124,233, 97,202,119,241, 9, 54,248,174, 39,124, 96,151, 73,147, 88, 28, 81,173, 80,236, 73, 82, - 78, 28, 21,120,124, 21,242, 95,145, 55, 30,114,219,166, 49,238, 82,218,219,178, 82, 3, 98,205,210, 22,181, 92,228, 45,192, 13, - 32, 12,120,162,113, 77,207,188,217,121,171,227,206, 58,252, 69,191, 13, 47, 50,252,165, 63,157, 34,113,254, 19,117,115, 16,207, -239, 50, 92,186, 94,237,183, 44, 30,253, 99, 90,144, 38,190, 87, 49,200,183, 24, 15,248,158, 12,151, 22,166, 92, 1, 41, 85, 10, -171, 38,203,150,118,203,235,141,167,152,182,232, 68, 6, 73, 0,115, 6, 0,135,177,252, 6, 10,215, 4, 80, 2,140, 82,162, 95, -243, 94,235,183,219,111, 60,177,185,206,110, 4, 81,146,201, 14, 36, 22, 61,156, 78, 40,230,149, 66, 78,147,130,212, 2,143, 60, -220,217,142,121,122,242, 75,228,227, 7,207,185, 43,138,248,153,236, 74,110, 97,202, 23,158, 22,101,229,242,158, 94,230, 79,150, -228,105, 92,104,126, 3,209,221,121,184, 80, 98,130,204,116, 56,148,173,213,168,185,184, 33, 0, 92, 14, 75,180,150,255, 0,116, -222, 38,142, 41,103,241, 52,198, 37, 79, 13,186, 98,143, 18,160,162,147,137, 76, 0, 9,153,170, 71,115,221,236, 59,118,211,178, - 67, 44,177, 91,248,122,164, 48,130,101,126,169,100,193,168, 65, 32, 52, 96, 20, 41, 37, 85, 5, 77,182,207, 53,156,173,229,103, -153,248,143,145,188,151,103, 94,127, 51,188, 77, 23, 20,199,230,110, 57,243, 49,135,220, 47, 24,221,246,214,183,152, 14, 38, 58, - 91,114, 83, 43, 50,163, 41,224, 23,225, 33,198, 86,148, 45, 11, 53, 32, 83, 30, 92,182,230, 91, 41,237,247,166,109,236,145, 22, - 39,219,184, 2, 10, 28,213, 14, 5, 56,144, 65, 32,138,188,111, 52, 93,114,173,253,189,206,196,253,202, 72,149, 38,142,229,142, - 45,112, 81,146, 40,196, 47, 0, 90, 64, 32,213,228,226,190, 84,252, 65,127, 17, 15, 59, 62,115,124,172, 90, 60,227,102,220, 67, -193, 56, 23, 37,242, 10,212,172, 90,199,110,131,154, 90,241, 59, 94, 69, 58, 13,166,207,108,157, 25,136, 83,226,163,192,162,100, - 58,169, 4,148,182, 2,130,201,214, 51,118,179,216,249, 7,101,219,119, 51,183,178,107,169, 99,103,188,231,104, 46, 49,135, 57, -206, 4,144,113,200, 39, 30, 21,187,217,175,185,131,204,125,247,116,218, 70,229, 36, 22,144,202,255, 0,117,173,214, 26, 36,115, - 88,198,144, 1, 24,102, 87, 33,198,162,252, 3,204,167,154,159,194,175,206,215,154, 95, 47, 89, 63, 58,102, 94,101, 48, 12, 23, -128,242,238, 70,178, 65,228,171,196,219,179, 15, 95, 99, 88, 99,222,236,178, 3,114, 37, 74,118, 26,219,144,248,141, 48, 71,120, - 37,198,234,170, 2, 19,182,214,255, 0, 96,219,124,203,217,172,111,227,182,101,180,210, 92, 54, 55,120, 96, 12, 11,203, 92, 48, - 1,112, 10,213, 10, 14, 29,180,251,111, 49,238,158, 85,111,187,134,219, 37,212,151, 80,199,108,249, 27,226, 18,123,193,129,236, - 56,146,152,157, 46, 66,132, 99,208,143,143, 35, 62, 92,124,255, 0,126, 38,216, 30, 71,230,227, 48,252, 66,249,143,139,175, 23, -124,174,253, 19, 6,176,225, 87, 73, 76,227,150,217,182, 39,118,238,118,223, 18,227, 6, 20, 72,232,144, 60, 54,226,180,205,118, - 13,202, 81,221, 67, 3,157,185,151,101,242,238,233,187, 69,190,213, 12,173,107, 26, 94,231,166,163,168,112, 37,164,146,152,151, - 19,159, 10,177,228, 46, 85,223,188,206,180,118,245,115,188, 79, 11,156,247, 8,218,194,116,130,211,153,104,115, 64, 11,128,104, - 25, 98,181,205,206, 17,243, 63,230, 7,201, 77,207,241, 54,228, 69,100, 48,231,121,150,145,156,219,120,150,247,159, 67,141, 26, -124, 40, 92,143,144,228,215,212,222,239,172, 54, 25, 76, 69,146,168, 18,215, 28,248, 65, 1,197,161, 91, 40, 54,235,161,111,124, -181, 97,206, 71,101,131, 65, 22,130, 55, 72, 24, 84, 18,198,198,205, 44, 56,175,218, 11,138,160, 56,215, 51,216, 57,171,112,228, - 97,190,220,107, 6,244,200,216,139,192, 4, 9, 29, 36,154,222, 48, 79,178,226, 48, 69, 35, 14, 21,174, 51,202,247,187,255, 0, - 6,185,201,114,188,194,126, 39, 51,188,222, 79,183,203,201,108, 55,252,122, 5,210,231,196, 82,111, 69,213, 59, 18, 32,146,155, -135,189,185, 29,214,130, 82,169, 45,154, 2, 74,131, 69, 41,216, 74,231,111, 16, 95,252, 55,195,109, 98,192, 16,210,215, 22,137, - 81, 49, 40,136, 10,240,232,226,184,209,218,238,102,227,110,248,175,138,221,142,228, 65,112,115, 67,140, 58,149, 64, 85, 82,210, - 62,208,227,138, 38, 21,102, 57, 79,241, 98,252, 72,111,220,113,228,142,193,140,114, 62, 79,196,220,183,151, 76,204,248,187, 58, - 93,207, 13,131, 0,242, 6, 67,108,187,217,226, 89,239, 18,152,185,218,220, 45,151,162,220,144,135,203, 41, 8, 82,195,132, 14, -180, 20, 27, 95,150,156,189, 5,198,229, 36,145, 54,107,120,195,100, 98, 56,157, 13, 44,113,115, 65,107,184, 22,148, 92, 81, 43, - 73,187,249,171,204,215, 22,219, 84,113, 74,248,110, 36, 47,137,234,192, 53,184, 61,141, 99,200,115,112, 80,224,169,130,173,125, - 78,126, 31,126, 86, 57, 51,203, 87, 13,101, 88,151, 51,115,158, 87,230, 43, 38,228,156,206,227,200,185, 6, 81,156,151,100,201, -143, 59, 34,182, 90,224,202,183,176,153, 50,166,175,221, 16,171,113,113,180, 21,129,244,138,246, 70,188,207,206,156,207, 15, 51, -221,178,123,107,102, 91, 70,200,195, 26,198,116, 53,206, 33,197, 0,239,119,144,246, 12,107,213,220,137,202,115,242,157,147,237, -238,238,159,117, 36,146, 25, 28,247,244,185,173,105,104, 82,123,163, 74,142,211,133, 91,156, 31,138,248,207,137,177, 88,120,190, - 17,138, 99,120, 86, 27,143, 67,121,187,117,146,205,110, 98,203, 96,178, 91,210,165,188,224,105,150,146,219, 44, 32, 41, 74, 90, -136, 0, 84,146,123, 78,179, 23,119,115,110, 82,186,105,158,231,200,227,139,156, 73,113, 57, 98, 78, 39,162,181,118,118, 80,109, - 80,182, 24, 24,216,226, 96,193,173, 1,173,104,207, 0, 48, 29, 53,242,201,248, 81, 71,111,158,191, 23, 95, 60, 30,105,184,194, - 55,186,240,195,119, 46, 71,179, 90,174,214,214,203, 22,204,149,220,239, 33,138,245,185,209, 77,169,112, 92, 34,217, 95,184,186, -145, 82,149, 45,178,174,170, 4,250, 75,205, 87,255, 0, 34,229, 93,175,106,184, 43,113,220,113, 7, 54,134, 48,135,122,139,195, - 7, 80, 41,149,121,107,201,246,127,236, 60,223,187,111, 22,193, 45,191,104,208, 70, 78, 50, 72, 11, 79, 94,160,194,243,208, 72, - 92,235,235,151, 94, 99,175, 88,213, 55,243,209,231, 91,139,124,136,240, 61,251,153,121, 29,244,207,184,168,185,100,227,188, 22, - 44,128,205,231,144,179,137, 13, 56,228,107,124,115,181,126, 11, 73, 8, 46,202,146,164,148,180,210, 84,170, 41,101, 8, 94,183, -146,249, 62,231,157,175,155,103,110, 16,102,247,240, 99, 56,184,244,158, 0,113, 61, 74, 70, 51,158,249,222,211,144,172, 31,123, -114, 84,228,198, 12,222,244,193,163,160,113,113,224, 49,196,160, 63, 22,156,219,199,126,102,238,126,101, 60,141,121,198,243, 99, -118,144,142, 78,243,137,230, 26,223,145,219,112,103,225,174, 26, 48, 12, 7, 6,190, 97,159,114,195,105,167, 30,113,112,155, 84, -107,230,214, 96,168,111,101,180, 32,188,165, 72,113,208,159, 89,237, 27,174,219,252,183,117,218, 54,166,254,194,206,216,180,189, - 87, 91,222,201,117,156,177, 66,204, 93,147,137, 58, 70,144, 23,198,123,222,207,186,141,211,104,222,183,135,127,220, 95, 93, 7, - 8,209, 60, 56,216,248,116, 4, 92, 20, 63, 6,230,208, 6,162, 92, 92,157,166,252,126,252,224,100, 88,119, 28,112,239,145,254, - 56,200, 96, 99, 89, 31,152,182, 34, 94,121, 66,255, 0, 62,246,140,126, 37,171,140, 12,228,219,160,194,149, 45,194,150,226,196, -189, 92,208,249,154,250,214,148,165,152,174, 54,176,166,221, 93, 57, 39,144,252,171, 29,212,179,239, 87, 12, 46,101,190, 17,180, - 13, 68,200,154,137, 3,139,154,212,210, 17, 75,156, 8,196, 10,237, 31,220, 71, 56, 75,105, 13,190,195,108,240,199,220,227, 35, -139,180,129, 30,173, 32, 19,193,175,114,234, 42,129,172, 32,168, 38,164, 31,195, 19,204,199,225, 51,229,123, 5,198, 60,188,113, -207,153,188, 26, 95, 36,220,165, 68,123, 50,203, 50, 76,110,253,134,219,243,190, 64,154,134,217,122, 72,189, 94,109, 80,237, 30, - 26,150, 3, 48,216, 68,178,148, 54, 18,144, 84,178,165,174,171,204, 46, 88,230,174,102,184,126,231,121,102,241, 16, 7, 67, 26, -230, 60,198,193,136, 26, 90,226,229,226,227,167, 18,167, 0,128, 92,121,105,205,156,161,202,150,209,237, 54, 87,209,153, 73, 26, -222,230,189,130, 73, 14, 4,235,123, 67, 83,131, 64,114, 0,131, 18,164,253, 20, 52,235, 79,182,135, 88,113, 14,180,226, 66,219, -113,181, 5,161,104, 80,168, 32,142,132, 17,174, 31,149,119,252,232, 77, 10, 21,154, 20, 43, 52, 40, 86,104, 80,172,208,161, 89, -161, 66,179, 66,133,102,133, 10,205, 10, 21,154, 20, 43, 52, 40, 86,104, 80,172,208,161, 89,161, 66,179, 66,133,102,133, 10,205, - 10, 21,154, 20, 43, 52, 40, 86,104, 80,175,158,111,198,119,138,239,252,141,206,126, 86, 29,111, 24,202,238, 24,116, 46, 52,243, - 31,107,200,178,123, 31, 6,221, 57,230,223,142, 92,175,118,150,153,181,165,219, 69,180,182, 68,137, 51,139,104,134,250,157, 79, -187,186, 83, 42,139, 12, 20,158,209,229,126,224,203, 43, 75,177,169,161,230, 72,136, 6, 65, 17, 32, 59,189,222, 60, 0, 85, 9, -222, 29,220, 22,179,187,212, 70, 73, 35,192,162, 59,134,174, 29, 31, 36,206,168,198, 29, 99,243,239,198,248, 90, 47,156,117,196, - 92,217,198,217, 99,126, 95,124,171,224,156,150,229,131, 25,186, 74,228, 11,119, 20, 99,119,124,149,155,131,246,183, 21,111,147, - 57,139,131,177,154,182, 74,147, 30, 51, 11,145, 17,167,150,157,128, 54,105,172,186,155,103,190,151, 68,243, 68,246,120,211, 57, -138, 91,164,188,181,137,171, 16, 11, 87, 80, 4,144, 28, 64,199, 26,175, 99,110, 34, 10,214,184, 29, 45, 7, 2,168,167,219,151, -101, 77,220,111,115,252, 65, 57, 58,227,150,225,151,190,121,243,117,103,194,177, 14, 8,231,236,243, 4,205, 44, 88, 45,247, 5, -187,229,121, 22, 28,168,210,241,219, 84,201,249, 38, 51, 10,229,119, 90,229,202,126, 50,222,109,134, 94,144,150,252, 38,202,124, - 50, 69, 93,244,123, 53,131, 89, 43, 45,237,139,221, 52, 77,115, 75,154,224,208,229, 15,112, 12,121, 13,192, 2,138, 64, 85, 57, -212,136,205,196,164,180,189,232, 26,226, 10, 16,169,144,196, 99, 76, 12,223, 34,243,115,205, 22,220, 42, 23, 61, 69,243,125,119, -205, 88,202, 60,141, 95,112, 92, 34,221,197,183, 88,124, 37,112,197,163,192,180, 73,203, 47,247,179, 22,209,224, 11,147, 23,224, -255, 0,142,185, 14,182, 91,112,148, 37, 37, 0,161,169,118,144,109,187, 91,158,108,205,176,102,155,144,231, 23,183,196, 14, 87, - 6, 53,170,229,210, 90,136,128,168,199, 60, 75, 82, 58,105,192,241, 53,170,177, 2, 20, 76, 20,156, 51, 90, 78,200, 57,127,241, - 86,179, 53,200,183, 59,174, 85,230,106,213,202,234,111,146, 98,230,188,121, 3,138,242,107,254, 45,110, 17,101, 7,236,215, 12, - 94, 67, 24,223,247,102,213, 21,178,211, 44, 50,244, 89,207, 25, 41, 89, 73, 72,241, 1, 83,144,237,188,189, 47,134,214,178, 3, - 15,115, 75,203,216, 28,112, 71, 7,130,253,110, 57,146, 11, 70,148,234,160,233,174,198,162, 75,181, 98,161, 15,161, 48, 65,235, -198,186, 69,143,121, 89,231, 23,121,139,158, 50, 87,114,120, 28,189,155,216, 60,187,121,126,201,113,156,191,204,135, 3,217,249, - 10,243,151,103, 50, 31,228, 75,136,178,217, 46, 42, 54, 91,101,129, 86,233, 38, 51, 14,150, 35,184, 80, 28,142,167, 80, 54, 39, -126, 30,110, 96,180, 22,214,241,232, 49, 70,233,229, 5,176,202,230, 6,181, 34, 26,156, 59,197,202, 20,133, 35, 34,153,225,100, -219, 73, 53,184,174,162, 26,220, 92,208, 84,247,176, 25, 39,248, 81, 30, 60,230, 14,113,193,185,123,131, 50, 65,121,243,135,150, -121,120,139, 19, 15,143,230, 70, 79, 37,113, 54, 85,125,190, 90,185,158,247,136,114, 27,119, 11,116, 91,113,199,209,122,114, 34, - 47,200,177,123,202, 45,209,156,131, 30, 71,187,165,165,163,196, 90, 84,171,221,182,210,238,218,118,105,182,109,202,187,193,208, -246, 0, 99, 18, 68,132,157, 90, 87, 78,180,212, 67,220, 21, 65, 74, 40,230,145,143,105, 87,150, 97,169, 65,205, 29,212,185,166, - 88, 81, 60, 63, 32,243,109,148,224,215,188,246,245,150,249,140,181,100,252,123,198,222, 77,178,124, 58,194,152,115,236,208,178, - 12,175, 53,207,114,120,153,114, 46,214,199, 32, 3,119, 83,118, 8,112,209, 50, 35,224,165,150,212, 22,180, 36,148, 44, 46,230, - 29,182,222,102,194,198, 64, 88,247,220, 7, 28, 9, 13,108, 76, 49,233,114,247,123,196,161, 25,156, 1,204, 81, 49,211, 61,165, -196,185, 64,106,118,151, 21, 81,199, 10,134,213,148,115,170,114,172, 51, 62,187, 90,252,209,223,249,126,225,229,219, 56,193,188, -192,223,174,118, 76,231, 22,199,184,111, 53,200,185, 75,141,126,241, 69,129,235, 93,130, 66,204, 11,125,190, 12,135, 23, 27, 28, - 74,220,122, 26, 3,193,196,111, 47,139, 63,135,180,240,223, 11, 77,184,132, 78,215, 68, 1,141,198, 70,136,102, 77, 74,225,222, - 36,140,100, 64, 29,130, 28,169,157,114, 40,113,214, 93,164,135,103,129,212,220,144,101,217,194,153,249, 53,187,157,178,108, 75, -147, 50,156,237, 94, 96,243,123,219,158, 89, 60,220,113,127, 20, 61,112,226,140,165,219, 78,114,245,135, 37,106,229, 98,182,222, -173, 55,123, 76,235,139,137,149,106,146,185, 17,217,191,168,174, 66, 99,182,135, 84,234,155, 82, 21, 42, 7,218, 65, 36, 81,195, -224,177,190, 60, 15,122, 61,138,213, 98, 56,181,205,112, 24, 56, 33, 49,224,221, 68,132, 85,164, 56, 72,224,226,237, 71,186,224, - 48, 56,227,128, 32,143,159,162,172, 14,121,152,121,184,113,185,108, 98,185, 63,154,152, 60,179, 51, 53,228,203, 87,152, 59, 81, -196,110,140,113,230, 1,133,191,156,194,139,136,200,195,100,200,180,174,196, 28, 93,157,198,189,213,219, 76,137, 5,232,190,242, -236,205,202, 66,148,154,107, 59,109,180, 33,145,182,230, 16,198, 24,142,166,235,115,188, 50,100, 18, 0,237, 94,242,168,120,106, - 59, 72,110,117, 34, 71,205,192,191, 82,157, 88, 20, 1,112, 76, 19, 46,133,193, 86,186,121,229, 82, 62,119,102,123,204,102, 27, -152,222,115,252,134,201,130,249,138,187,227,220, 97,121,228,121,178,175, 55,233,220,123, 47, 19,196, 46,169, 45,220,166, 36, 63, -115,142,221,234,229,113,109,167,202,150, 19,180,180, 21,244, 84, 24, 46, 97,116, 50,252, 52,177, 53,141,115,224, 5,225,128, 0, - 31,174, 70,228, 48, 7, 72,106,143, 79, 26,181,180,212,221,109,113, 36, 7, 96,189, 8, 15,206,181, 55,114,142, 75, 51, 23,196, -102,204,182,193,188, 92,238,114, 94,141, 10, 45,187, 30,136, 39, 95,228, 48,226,194,166, 42, 27, 74,113,164,169,230, 96,165,231, - 27, 42, 88, 1, 73, 21,244, 28,232, 11,133, 75,168, 23,142,177,183, 57,119, 37,189,100,153,133,153,171,118, 17,129,221,239,120, - 86, 15,198,147,217, 68,168,176, 62,128, 51, 58,227,114, 65, 83,172, 75,153,115, 98, 83,136,223, 85,165, 17,214, 82,149,169, 79, -190, 76,194,225,107,238,251,221, 61, 29,127, 85, 33, 53,224,114,169,133,188, 75,141,120,139, 27,114,223,133, 96, 24,157,133, 55, - 4,253,213,109,176,227,246, 40,150,161,122,153, 33, 59, 27, 97, 97, 8,111,196, 74,186,111, 42, 39,167,164,208, 22,238,111,102, -188, 58,165,123,156,122,201, 52, 81,194,200, 66, 53,160,118, 87, 1, 60,193,240,151,150, 91, 87, 42,228, 77,218,113, 75,222, 65, -114, 98, 67, 75,200,226,219,178,132, 91,120,230,223,151,164,169,115,155,181, 91,145, 9,192, 25,109,229,108, 37, 37, 21, 80, 81, - 0, 3,174,171,177, 27,169, 45,152,102,112, 94, 10, 9, 41,193,113, 69,244,118,227, 89,155,209, 16,144,232, 7,208, 80,124,223, - 77, 93,127,195,167,145,240,220, 91, 42,189,240, 94, 51,137,218,113, 40, 25, 12, 25,249,188, 72,150,167,164,190,210,110,182,228, -176,194,247,153, 14,188,166,204,184,232, 90,210,132,148,160,248, 43, 82, 82, 20, 86, 85,157,230,253,185,253,219,141, 90,128, 8, - 70, 1, 49,193, 17, 6, 38,167,237, 51,180, 44,104,156,123,107,176, 26,193,213,221, 81,143, 61,248, 87, 52,231,156,121,143, 88, -248,160, 73,151,105,126,237, 45, 25,213,150,223, 44, 66,184, 93, 33,173, 45, 24,117, 82,150,218, 92, 97,167, 18,233,121,186,245, - 37, 6,132, 36,235,206,223,220,119, 42,243, 31, 55,237,144, 90,108, 61,230, 25, 15,142,192,224,199, 61,168, 52, 98, 72, 5,128, -234,212,213,196,150,148, 41, 94,142,254,219,121,175,150,249, 63,116,158,243,127,238,200, 35, 30, 3,203, 75,218,199, 41,215,128, - 4,135,144, 91,165,201,128, 14, 10, 22,163,143, 42,222, 72,109,216, 40,135,154,114, 51, 44, 92,242,170, 33,232,145, 10,119,196, -179,149, 15,154,208, 87,206, 95, 94,174, 17,234, 77, 7, 83, 15,201,111,237,234,211,203,182,182,255, 0,112,211, 54,224, 66,131, -155, 33, 81,147, 23, 55,116,188,142,166,160,196,204,243,183,251,137,187,243, 25,206,219,246,237, 80,237,192,161, 25, 62,100, 57, -189, 50,111, 67, 1,235,114,156, 5, 7,243,103,197, 57, 31, 0,115,188,220,138,198,153, 80, 44,151,251,227,185,174, 17,123,101, -170, 49, 26, 91,143,123,195,177,146,163, 84,239,133, 33, 84,218,127, 96,164,210,135, 94, 69,243,195,147,111,124,172,230,135,110, - 54,154,153, 20,178,153,224,144, 12, 3,245,106,115, 87, 37, 99,142, 71, 54,145,211, 94,192,242, 47,156,236,124,214,229,102,237, -215,122, 95, 44, 81, 11,121,227, 39, 18,205, 58, 90,244,205, 30,209,152,201,192,227,133, 55,121,182,203,248,126,121,235, 77,135, - 36,243,129,196,185, 13,151,151, 49,251, 52, 75, 27,156,141,199,178,164, 64,147,124,183, 65,169,109,167,151, 13,246,157,113, 41, - 82,149,177, 15,180,189,149, 33, 43,161,215,178, 60,166,255, 0,253, 1, 28,181,102, 32,188, 50, 65, 38,110, 13, 96,150, 39, 57, - 49,115, 71,188,194,120,132, 78,179, 94, 43,243,131,255, 0,243,188,115, 93,231,196, 90, 54, 43,134,100,210,100, 48,204,214,174, - 13,113, 29,215,129,192,170,245, 10, 68,129,145,121,112,242,239,197, 25, 15, 5,249, 50,227, 57,120, 22, 47,151,185, 76,223, 53, -190, 56,167,114,156,166, 57, 71,134,182,212,227,143,201,146,224,117,191,163, 43,121,222,136,220,132,161, 33, 68,235,141,127,113, - 31,222, 61,223,155, 48, 73, 99,102,101,209, 35,116, 62, 89, 0,105,208,115,100,113,180,163, 67,190,209, 56,144,161, 56,215,106, -254,219,255, 0,178,219, 47, 39,231,142,250,236, 68, 31, 27,181,178, 40,201,112,241, 6, 79,146, 71, 5,113,111,217, 3, 0, 80, -175, 10,181, 30, 72,188,187,222,115, 76, 87,147,178, 57,199,238,120,217,166, 11,147, 96, 88,244,249, 49,148,239,130,221,250, 43, -177,220,153,178,168,241, 16, 29, 90, 54,128,161, 93,135,168, 4, 29,104, 63,179,110, 70,155, 97,215,204,215, 76, 65, 33,107, 33, - 7, 2, 88,215, 7, 61,221,142,112, 13,105,255, 0, 73, 57, 34,208,127,122, 60,245, 15, 48, 6,114,189,171,212,198, 28,249,156, - 49, 13,123,152, 88,198,254,179, 90,231, 57,195,253, 64,102,169, 72,184, 47,240, 89,252, 65, 60,157,217,242, 52,249, 83,243,231, -108,194,174, 57,116,173,153, 85,165,252, 24,183,140, 93, 99, 70, 64, 68,105, 77,179, 33,203,168,106, 83, 33, 78, 39,196, 13, 3, -180,129,184, 1, 77,125, 88,222,252,225,217,121,178, 70,157,211,106, 47, 12, 29,210, 31,222, 29, 32,144, 26,173, 56, 96,181,242, - 63, 96,242, 71,126,228,216,158,221,167,120, 17,185,231,190, 12,125,194,131, 2, 1, 46, 71, 12,113, 78,140,105,239,199,159,128, -142, 68,199, 20,249,156,145,202,124,244,188,243,204,199,153, 75, 27,182,171,175, 46, 95,108,207,220,226,216,205,202,235, 18,239, -114,115,194,118, 95,189,205,122,229, 42, 40, 47,200,113,212,168,128, 0, 72, 27,130,160, 95,249,221,227, 94, 89, 27,123, 95, 14, -206,217,202, 34, 14, 0,184,134,150,183, 16, 16, 6,131,128, 0,250,112, 75, 29,187,200, 47, 2,202,248, 92,221,153,111,174,219, -165,211, 57,164,134,130,224,247, 32, 37, 92, 92, 70, 36,145,195, 1,138,137,125,252, 3, 47, 31,252, 22,242,220,190, 62,231, 86, -184,251,205, 79,150,166, 46, 86,235, 31, 45, 90,241,247, 13,135, 44,180, 46,247,113,189,219,218,147, 4,202, 91,145,156,183, 72, -184,184, 27,121, 43, 94,228,169,105, 90, 22,146,144,130,183,243,183,254,238,247,226,109,124, 75, 43,162, 9,136,187, 22,157, 13, - 99,145,201,142,160,208,161, 7, 4, 32,170,157,207,144,127,246, 86, 31, 11,119,225, 95,218, 2, 27, 48,110, 14, 26,220,246,130, -213, 81,164,184,161, 83,153, 4, 16,137, 97, 56, 15,200, 95,226, 56,199, 62, 96,188,185,230,103,207, 35,185, 54, 61,129,198,118, -222,158, 58,227, 92, 94, 54, 55,139,101,246,215,212,218,220, 98,237, 29, 81, 24,132,242, 94,113,148, 23, 92, 49, 20,245, 18, 3, -110,182,125,161,158,223,121,207, 97,146,198, 75, 61,183,107, 12,115,202,248,146, 56,185,205, 61, 45,196,156, 49, 78,242,116,131, - 90,110, 94,228, 94, 99,143,112,138,247,117,221,203,219, 24, 35,195,137,161,173,120, 60, 30, 8, 3, 18, 2,157, 37,221, 14, 25, -212,197,228,223,240,217,201,188,172,249,207,243, 97,230,110,119, 36, 90,114,203, 39,153, 12,171, 41,201, 96, 99, 80,177,231, 45, - 18,177, 84,228,119,217,151,132,176,227,235,148,250,100,248, 41,148, 26,220,148, 38,164,110,160,236,213,127, 55,115,251, 57,155, -107,176,219,155, 9, 97,182, 99, 90, 93,169,117, 35, 3, 85, 16, 38, 75,153,171, 46, 75,242,221,252,167,187,238, 59,155,167, 15, - 23,111,115,131, 67, 83, 74,188,189, 9, 82,185,166, 66,152,188,191,248, 74,142, 98,252, 66,243, 79, 55, 89,134,115,104,188,241, -127, 35,241,132,238, 47,202,248,161,118, 55,163, 93, 30,180, 93,113,164,227,210, 20,155,154,101,237, 73, 41,171,201, 33,144, 82, -105, 67, 81, 93, 78,176,243, 61,219,102,195, 22,211, 4, 69,179, 71, 40,145,178,234, 8, 8,126,177,221, 79, 70,117, 95,184,249, - 74,205,219,152,165,222,110, 37, 14,134, 88, 76, 78,139, 73, 82, 29, 31,134,123,203,233,202,169,255, 0, 29,126, 15,191,136, 87, -149, 25,121,110, 1,228,243,207,219,152, 31, 5,229,247,169, 87, 23,109, 55,124, 88, 75,201,109, 40,152, 3, 74,121,148,150,223, -138,137, 98, 58, 82,149, 72,140,182, 10,202, 65, 33, 36, 10,106,247, 47, 54,118, 78,101,209,113,186,237, 94, 37,203, 26, 2,135, - 35, 74,112, 57, 29, 43,192,234, 74,199,237,126, 77,111,252,171,174,219,103,222, 60, 43, 71,184,157, 46, 98,184, 47, 17,152,212, -156, 70,149,165, 31, 47,255, 0,254, 31,136,152, 86, 59,230,115,143,249,159,153,221,228,108, 83,204, 14, 63,106,139,110,190,193, -176,155,102,101,137,101, 56,253,193,235,148, 27,202,223,145, 42, 99, 82,164, 34, 67,128,186, 10, 64, 88, 43, 73, 52, 89,211, 27, -239,158,114,223,205,101,113,105,108, 34,125,185, 42, 11,149,174,107,154, 26, 88,128, 2, 2, 12, 58, 48,232,167,249,127,251,124, -135,110,130,254,218,242,232,205, 29,203, 64, 4, 55, 75,216,230,184,185,175, 82, 72, 37, 78, 61, 56,142, 52,131,102,252, 43,127, - 18,174, 31,227, 38,184, 35, 21,252, 68,172, 56, 95,151, 75, 3,233, 84, 59,220, 92, 91,238, 12,227, 30,178,166, 72,144, 24, 98, -232,165,166, 92, 38,131,166,129, 8,185, 37, 52, 59, 64, 8, 59,116,237,199,153, 92,189,186,221, 27,233, 54,114,251,183,102, 53, - 43, 28, 81, 20,181, 16,148,255, 0, 66,241,207, 26,102,219,202,190,101,217,237, 6,223, 22,248, 35,178,102, 68, 51, 75,218,213, - 84, 14, 85, 1,127,214, 7, 12,176,171, 61,230,195,240,142,228,111, 50, 25,135,146,220,229,254,126,110,101,239,202,236, 91, 83, - 57, 61,223, 45,197,145,112,201, 57, 54, 92, 11,181,190,230,185,143,191, 9,232, 81,163,186,240,132, 80,104,201,237, 4,214,134, -185,206, 87,243, 62, 46, 93,182,220, 45,197,160, 2,233, 80, 49,200,216,193,107,154,128, 16, 73, 1,122,107, 81,205,190, 82,205, -204,247, 91,101,203,175, 9, 54,122,117, 23,181, 93, 33, 15,107,148,144, 90, 1, 58,122, 43,186,182,246, 23, 26, 12, 72,235,166, -246, 35,180,210,169,217,185, 0, 3,174, 65, 93,178,190,127,191, 28, 31, 59,121, 70, 47,141,227, 62, 64, 60,184,170, 69,251,204, - 95,154, 4, 68,199,178, 88,214, 7,247, 93, 49, 78, 53,201, 28, 49, 61,204,169, 36, 38, 60,140,145, 91,216, 42, 90,168,220, 68, -190,226,246, 5,180,230,187,167,147,156,161, 20,239,126,253,184,163,109, 45, 85,192,156,156,246,226,189, 97,153,225,155,244,128, -168, 69,121,239,207, 14,117,154, 8,227,229,221,173, 93,123,118,141,112,110,109,141,197, 19,168,201,136,199, 38, 7, 18,138, 13, -116, 23,240,222,242, 91,139,249, 41,242,229,136,113,157,169, 12, 77,201, 28,103,239,252,247, 36, 67, 37,167,114,140,230,234,219, -126,253, 46,135,218, 75, 77,236, 68,120,200, 61, 82,203,109,131, 85,110, 81,231, 92,243,205,179,115,166,227, 37,236,152, 55,221, - 99,127,202,193,238,142,222, 46,233,113, 60, 48,174,157,229,247, 38, 67,200,155,100, 86, 17, 33,120,239, 72,239,243,200,125,227, -217,193,163,131, 64,226,166,186, 12,163,180, 21, 30,192, 9,249, 53,144,173,181,124, 60,242,111, 54,121,183,231,255, 0, 60,177, - 60,211,121,157,252, 57,124,223,242, 87, 31,113,147,207,181,192, 62, 95, 35,241,134, 79, 97,198, 48,102, 99,200, 75,145, 36,220, -140,140,114,106, 39,201, 37,164, 73,150, 82,210, 67,207,134,247,125, 3, 45,177,175, 96,218,237, 59, 78,203,178, 29,171,109,222, - 44,226,150, 95,223, 76,100,140,185,248, 98, 26,146, 13, 35,128,196,163, 85, 59,206, 46,175, 18, 94,111, 27,206,253,191,141,227, -117,217, 47,166,134, 47,220, 64, 34,145,173,102, 56, 23, 44,110,212,126,211,176, 26,156,139,221,104,109, 55, 63, 18,191, 60,220, -165,230, 11,151, 60,135,228, 89, 79,145,206,115,242,247, 59,132,121, 31, 35,190,226,216,167, 32,219,238,113,238,252,199, 58,227, -117,195, 36,174, 5,149, 50,177,251, 99,142, 60,195,150,134, 89, 80,101,183,142,233, 45,251, 32,144, 21, 39,203,158, 74,179,216, -172,183, 72, 96,220,173,238, 27, 52, 65,174,115, 11, 72,136, 6,202, 53, 61, 30,228, 7, 81, 56,145,131, 78, 61, 17,124,208,231, -203,238, 97,191,218,102,159,106,185,182,116, 19, 57,205,100,129,192,204, 75,161, 58, 88,177,181, 72,210, 6, 1,216,184, 97,210, - 15,153, 43, 92,239, 62,191,138,159,148,216, 60,225,197,249,183, 12, 89,185,155,142,184,233,119,174, 41,205, 23, 38,215,150, 89, -113,108, 90, 70, 72,100, 91,223, 83,177, 45,210,227,253,232,237,165,250, 43,193,109, 97, 46,238, 65, 7,106,180,158, 94,185,111, - 34,242,165,251,172, 39,100,206,130, 71,134,200,196, 45, 46,112,141, 28, 49,112, 58,117, 14, 36, 40,199,136,165,115, 45,171,188, -194,231, 29,185,155,141,188,144, 50,120,152, 93, 19,212, 60, 53,166, 66, 90, 84, 52,141, 69,135,128, 40,229, 28, 13,118,239,241, - 20,252, 41,124,156,181,228, 79,154,242,156, 3,134,248,247,139,243,174, 22,226,108,179,148,177, 92,199, 11,198,227, 99,151,167, -159,227,203,115,215, 71, 97,207,145, 21, 13,187,117, 69,198, 44, 87, 35, 31,124, 83,132, 41, 97,192, 66,210, 21,174, 61,229,231, -153, 59,195,119,171,102, 92, 92,203, 44,115, 74,216,220,215,184,184,119,220, 26,173, 7, 6,233, 36, 30,234,100,153, 87,110,243, - 55,202,205,145,251, 13,212,150,214,145, 67, 44, 16,190, 70, 61,141, 13,119,236,218, 92,142, 33, 11,131,128, 35,188,185,174, 98, -166, 79,192,179,154,243, 46,100,242, 1,198, 74,206,110, 82,175, 87,140, 6,227,147,241,196,107,196,233, 10,147, 54,125,135, 20, -150,164, 91, 3,170, 87, 82, 98, 91,221,102, 40, 36,146, 82,216, 36,146, 78,170,252,230,218, 33,217,249,130,225,176, 0, 26,240, -217, 16,100, 11,135,123,214,229,119,166,173,252,140,222,166,222,249,110,217,211,184,185,241,151, 70,167, 50,214, 30,234,246, 52, -134,250, 43,178, 58,229,149,215,171, 52, 40, 86,104, 80,172,208,161, 89,161, 66,179, 66,133,102,133, 10,205, 10, 21,154, 20, 43, - 52, 40, 86,104, 80,172,208,161, 89,161, 66,179, 66,133,102,133, 10,205, 10, 21,154, 20, 43, 52, 40, 86,104, 80,172,208,161, 89, -161, 66,179, 66,133, 87,159, 48,190, 99,241, 63, 45,214,188, 90,251,155, 89,114, 41,246, 44,162,102,105,107,106,231, 98, 97,153, - 72,183,221,241, 44, 94,247,148,181, 17,214,214,235,110,173,219,180,123, 12,136,144,146,210, 84, 86,250,155, 65,166,240,117,117, -178,236,114,111,142,123, 34,115, 67,154, 26, 80,241, 14,123, 88,189,141, 46, 4,175, 5, 60, 42, 61,197,200,182, 0,184, 96, 87, -216, 9,246,165, 85, 25,255, 0,138,111, 6, 91,236,151, 60,149,204, 63,147, 31,176,194,198,219,189,192,155, 14,202,196,185,119, -219,171, 48,120,218,124,235, 52, 88, 77,201, 84,213, 79,181,179,201,144,196,166, 20,208, 40, 84, 89,160,253, 79,181,162,103,151, -247,111,120,143, 92,122,139,144,226,112, 11, 48, 14, 37, 19, 75,188, 18,133,113,212,222,154,136,119, 88,192, 84, 40,159,241,195, -183,189,236, 52,185, 39,241, 46,225,139,125,241,139,101,207, 22,206,226,218,111, 25,221,191, 13,196, 50,166, 34,195,184,216,178, -251,114,179, 12,175, 16,185, 95, 33,169,137, 75,116,192,179, 47, 16,153,116,148,230,202,136, 74, 67,193, 39,218, 74, 89,111, 34, -221, 61,154,154,246, 40, 97,115,155,136, 45, 62, 27, 36, 13, 42, 61,231,120,129,160,127,153, 69, 25,220,216, 10, 16, 81, 80, 30, -156, 72, 94,192,139,217, 75,153, 55,155,156,198,241,102,242,101,155,112,247, 28,204,201,108,254,102,115, 76,186, 15,247, 46,243, - 54, 5,155, 36,185,226, 48, 48,220,166,255, 0,110,151, 26,123,243, 81,110,132, 29, 93,162, 52,229, 56,165, 56, 85, 28,169, 8, - 66,157, 82, 70,154,131,150,226,137,215,177, 92,202, 26,232, 26,211,168, 2, 64,113,145,141, 32,128, 20,251,197,188, 59,216,146, -148,167,222, 56,136,220,198,174,162,112,234, 66,126,133,236,170,177, 96,252, 92,236, 63,122,114, 34,239,156,119,123,121,182,242, -137, 76, 96,216,140,137,214,188, 66,235, 98,178,224,184, 86, 25,117,202,160,220,110,115,238, 6,223,114,185, 49,147,228,139,135, - 5,136,100,248,201, 41, 85, 80,132,248,138,208, 77,229,187,244,199,162, 65,238,247,156,142,112, 37,210, 72,214, 16, 0, 80,210, -198, 43,137,203,172,225, 81, 27,188, 5, 42, 56,224, 50,200, 2,113,233, 83,133, 76,109,254, 39,248, 90,241,248,185,211,156, 37, -202,113,248,235, 34,191,114,222, 23,199,249, 27,211,172,105,187,230,249,231, 20,203, 48,205,181,187, 71,222, 94,247,111, 77,218, - 64, 44,197,126, 97,111,107,137, 80,121, 45,163,107,138,172, 60,131, 46,179, 15,143, 31,136,208,199, 56, 35,145,173,120, 85,212, -136,116,140, 72, 11,134, 74,112,167,191,154,181, 53,105, 58, 74,129,150, 36,117,117,211, 2,249,248,157, 94,184,167,145,121,175, - 7,230, 94, 31,153,110,191, 97,153, 59,207,227,248, 77,159, 47,177, 34,229,105,193,177,236, 51, 9,190, 79,109,203,156,139,139, -112,239,183, 75,132,252,168, 46,221, 10, 26, 82, 84,130, 91, 90,144,166,138,151, 50, 46, 66,102,227, 4, 18,218,204, 11, 92,220, - 92, 90,228, 46, 50, 72,209,221, 1, 90,208, 25,222,113,227,136, 85,193,183,110,134, 39, 57,175,110, 32,228,163, 36, 7, 62, 39, - 28, 5, 88,203,103,158,235, 45,247,143, 51, 62, 78,177,240,215, 37,203,197, 44,252,173,255, 0,192,236, 10,108,155,133,130, 11, -188,179,202, 82,243, 20, 97, 80,160,219, 35,155,178,230, 64,102, 77,209,230,214,169, 55, 38, 88, 8, 70,242, 82, 74, 0, 93, 36, -156,162,232,102,101,187,231,140, 60,199,226, 56, 35,142,134,120,126, 33, 36,233, 66, 64, 92, 26, 74,148,233,194, 72,191, 14,105, -120,105, 69, 65,150, 37, 83,167,167,166,163,249,127,137, 85,150, 5,219,147,241,153, 94, 94,249,109,204,167,132,237, 86,249, 92, -173,110,129,121,197,223,131,140,222,111,151,251,166, 57,106,183, 49, 37,219,220,117,220,156,188, 92, 32,199, 84, 71, 35,178, 81, -225,200, 74,222, 44,148, 45, 34,107,121, 21,239,108, 82, 11,136,244, 74, 78,130, 67,212,128,214,189,197, 52,148,210, 9, 85, 42, -173,193, 84, 83,103,115, 0,184,104, 42,220,242,195, 18, 7, 30, 63, 77, 91,110, 16,230,249,188,181,115,229, 92, 98,255, 0,199, -183,142, 54,205, 56,115, 48,178,225,185,134, 63,115,190, 91,242, 72,230,118, 67, 97,181,100,113, 29,137, 54,220,235,140,190,218, -237,183,152,229, 85, 9, 41, 94,228,208,210,167, 55,187,109, 35,110,108, 50, 50, 65, 35, 37,105,115, 72, 4, 96, 28,230, 21, 7, - 44, 90,125, 21, 50, 9,204,197,192,132, 45, 40,120,240, 7,233,164,111, 50, 89,131,184, 85,158,203,115, 74,228,219,152,158,213, -226,200,246, 72,133,184,220, 59, 34,167, 46, 10,192,113,196, 2,134, 21, 41, 12,173,180, 60,186, 80,110, 72, 80, 43, 0,181,180, -196,217,102, 26,242, 1,104,238, 28, 90,220, 42,154,113, 79, 53,163, 22,178, 95,114,156,138,241,154, 69,199,243,219,194,174,152, - 45,131, 21, 48,227, 77,186,217, 33, 50, 34,174,239, 57,233,237,174, 75, 9,184,184,208, 91, 1,146,159,103,169,170,247,210,238, -125,153,219,164,154,163, 32, 0, 49,207,209,233,250, 18,162,182,232, 91,132, 56,209, 76,247,204, 17,190,217,238, 12,224, 71, 34, -195,242,159,187,101, 49,104,203,114,188,193,236,145, 73,150,242, 3,126, 22,199,219,113, 17,140,166,202,227,238,105, 73, 3,196, - 42, 31, 72,150,212,149,183,151, 62, 4,137,158,117,134,144, 75, 81, 20,125, 61,156,114,164, 58,251,198, 5,163, 2,120,215, 60, -109,188,117,204,121, 6, 77, 51, 15,178,241, 86, 82,188,146,215, 37, 80,239,144,165,177,227,174,215, 49,190,139, 65, 16,196,189, -193, 42, 31, 61,213, 54,146, 58,133,117,214,241,219,148, 76,140, 72, 92,208,210, 20, 18, 83,213,198,168,133,187,203,139, 64, 36, -245, 87, 93,252,143,249, 91,189,240,204, 27,254,119,200,204, 33, 60,139,148,173,112,219,137,244, 42, 22, 75, 26, 20, 8, 64,240, - 86,234, 82, 93, 9, 66, 66, 55,168,165, 40, 5, 68,173,107, 58,231,220,203,189,183,112, 34, 40,138,176, 98, 78, 74,126,161, 87, -219,125,153,129, 92,236,254, 97,250,107,160,122,201,213,157,101, 43,208,245, 26, 20, 43, 52, 40, 83, 15,145,184,207, 11,229,108, -110, 86, 41,156,216,226, 94,237, 50, 65, 41, 75,233,219, 38, 27,244, 32, 61, 29,212,209,198, 28, 77,122, 45, 10, 7, 89,254,102, -229,109,191,156,109, 31, 99,185, 66,217, 97,119, 3,152, 61, 45, 35, 22,184,112,115, 72, 35,166,180, 60,177,205, 91,135, 38,221, -178,251,108,157,209, 76,222, 45,200,142,135, 2,161,205, 60, 90,224, 65,232,174,106,101,191,133,253,177,249,206, 61,134,114, 52, -219,108, 5,169, 74, 68, 43,205,165, 23, 87, 89, 73,236, 72,117, 15,197, 38,158,176,117,229, 45,231,251, 53,219,110,165, 46,177, -220, 37,133,135,236,190, 49, 42,118, 16,248,207,173,123,107,214,123, 39,247,163,185, 90, 68, 25,127,183, 69, 51,199,218,100,142, -137,123, 65,100,131,212,148,233,227,127,195,103, 16,199,238, 49,174, 57,190, 67, 35, 44, 49, 93, 67,169,132, 24, 16,109,174,169, - 6,163,123, 73, 91,138, 88,175,236,169,100, 30,240,117,166,228,239,237, 59, 97,229,233, 91, 61,252,178, 93,189,165, 67, 92, 3, - 35, 81,210,192, 92, 93,216, 92, 65,226, 13,102, 57,207,251,183,223,249,138, 23, 91,237,241, 71,102,199, 4, 46,105, 47,145, 14, -104,242, 26, 27,218, 26, 8,224, 69,116,146,193,143, 90,113,155,100,107, 69,154, 27, 48,160,197,105, 13, 52,203, 13,134,208, 18, -216, 0,116, 20, 2,128,107,212,112,194,203,118, 8,227, 1,173,104, 0, 0, 16, 0, 50, 0,112, 2,188,173, 52,207,184,121,146, - 71, 23, 57,196,146, 73, 82, 73,204,146,115, 38,150,180,229, 55, 89,161, 66,179, 66,133,102,133, 10,205, 10, 21,154, 20, 42,130, -121,182,227, 63, 52, 57, 87, 36,113, 12,254, 4,228, 43,238, 51,199,249, 99,172,241,231,152, 24,144,178,117, 89,228, 98,120, 69, -178,237,111,201, 27,200,241,244,110, 74,152,185,204,141,108,159,141, 56,236,112,167, 54, 92,153,124,141,176,130,147,179,229,189, -207,110,180,182,156, 94,196,215, 74,206,252, 61,213,212,242,215, 51, 67,250, 88, 11,155, 40, 7, 5,140,183,237,214, 23,154,118, -173,206,246,234,220,216, 76,230, 66,254,228,232,228, 45, 96,115,100,241, 35,232,121, 13,124, 36,140, 82, 86,187, 38, 87, 57,167, -240,247,226,163,117,186,243, 43, 23, 62, 73,229,232,146,239, 57,214, 51, 26, 58,177,156,150,199,101,196,114, 12, 46,127, 43, 99, - 55, 5,207,196,110,199, 61,122,225,143,174,197,199, 49,110, 49,100, 69, 94, 55,111,247,132, 56,182,212, 38, 72, 8,113,205,203, -119,174, 91,137,182,250, 97,136,129, 27,189,230,188,185,175, 22,242, 13, 50, 55,193, 13,126,185,203, 8, 34, 89, 52,160, 61,198, -168, 28,249,251, 23, 52,204,235,157,115,204, 11,164,104,238,185,129,142, 97,186,141,218,162,119,142, 92,194,203,112,246,150,152, - 98,212, 9, 29,247, 33, 47,190,116,225, 15, 58, 87, 60,131,204,111, 31,224, 80,249,199, 55,227, 76,139,137,177, 91,127, 25,100, - 92,131,204,214,214,162, 91,242,220, 78, 86, 28,252,107,125,149,149,229,211, 28,187, 34,121,183,220, 29,184, 78,191,218,160,202, - 10, 47, 54,169,115,217,146,132, 51, 7,101,223, 54,152,163,179,158,224,194,201,155, 43,140,141,100, 78,197,174, 18,130,231, 31, - 12,105, 69,104,107, 99,123,218,136, 67, 35, 45, 37,211,247,237,131,121,154, 75,219,123, 97, 60,144, 58, 22,136,221, 36,205, 64, -230,152,136,107, 7,138, 75,131,180,188,189,210,178, 55,174,160, 95, 35, 92, 3, 77,115, 6, 13,248,146,205,205,185,249,124,117, - 63,148,154,151,122,198,124,205,183,133,228, 49,121, 74,193,108,226,171,150, 37,127,193, 38,194,227, 75, 30, 45,102, 85,205,139, -141,135, 35,181,102,107,133, 38,109,218,100, 56,237,209, 15,168,206,117,183, 80,219,105,218, 55, 14, 95,142, 27, 81,112, 35, 64, -235,125,109,240,222,100, 14, 19, 3, 59,228,118,146,215,196,232,181, 6,177,174,113,197,163, 64, 32,146,189,235,109,230, 73,103, -188, 54,198, 85,115,110,116, 59,196,140, 68, 90,232, 28, 45,217, 27, 53, 7, 50,102,205,164,186, 71, 53,163, 7, 31, 16,130, 0, -181,222, 94,173,190,107,184, 99, 20,243, 64,206, 87,104,228, 30,106,251,142,225,103,201,124,184, 99,217,191, 36,218,175, 57, 86, -106,185, 24, 38, 60,253,206,210,111,147,167, 39,220, 88, 94,118, 46,113,219, 85,201,196, 6,145,237, 52, 12,127, 11,118,111,122, -159,109,222, 37,179, 49,186, 56,117, 2,217,220,198, 56, 53,159,182,120,107,180, 1,137,240,116, 19,160, 21, 57,247,150,181, 91, - 21,190,233,178, 67,124, 36,108,147,233,112,117,187, 95, 35, 75,159,251, 8,203,155,172,187,186, 60,125, 96,107, 33, 6, 93,212, -175,153,156, 59,202,239,227, 93,132,249,176,205,188,229, 75,242,179,136,231, 92,231,152,204,190,201,118,239,200, 57,214, 29,144, -218,177,197,223, 54, 52, 83,106,142,198,109, 20, 69, 76, 91,123, 98, 4, 97,189, 65,184,245,105, 52, 7, 94,135,220,121,167,146, -183, 13,170, 61,159,227,100,101,179, 19, 6, 50, 86,151,105,199,188, 76, 37, 85,221,227,210,236,107,204,187,103, 40,115,230,217, -187,203,190,124, 4,114, 93, 73,171, 25, 36,133,193,186,176,238, 1, 48, 68,111,112,116, 55, 1, 93, 50,192,185,235,255, 0,196, - 41,125,202,108, 88,246, 95,229,215,130,176,140, 90,235, 33, 86,203,174, 92,211,152,236,195,139, 71,150,218,219, 68,242,204,124, -226,230,251,162, 35,138, 75,138, 67,112,221, 36, 2, 3,107,249,167,158, 95,109,156,129,111, 11,159, 5,221,196,143, 1, 67, 82, - 65,169, 62,202,152, 90, 2,229,139,135,104,174,155,183,238,190, 99,220,204,200,238, 44,237,163,141,197, 11,214, 51,165,126,210, - 9,220, 74, 28, 80, 53,221,134,166, 63,193,227, 6,252, 79, 48,108,175,157, 17,231,175, 39,206,111,120,165,214,225,110, 86, 29, - 3,146,115,214, 57, 14,244,140,153,167,228,153,242,173, 50, 24,153, 60, 65,182,173,146,218, 83, 29, 46, 33,170,237, 44,180,144, - 22, 77, 87,155, 27,151, 45,223,182,215,249, 19, 24, 30, 1,214, 88,194,193,165, 6,144,224, 64, 87,170,226,132,244,147,133, 91, -249, 55,181,115, 78,220,251,179,204, 50, 61,204, 36,104, 18, 72, 36,118,165, 58,139, 72, 46,210,196, 76, 20, 15,242,129,141,119, -145,118,203,123,138, 43,114, 27, 11, 82,186,149, 41,176, 73,215, 24,174,235, 92, 40,252, 95, 60,158,115,223,152,158,116,252, 59, - 51, 78, 13,227, 95,239,126, 47,194, 60,173,149,100, 92,175,114, 99, 36,179, 99,255, 0,221,139, 53,202,241,130, 74,142,241, 98, -231,113,133, 34,110,248,246,105,170,219, 17,183, 84, 54, 80,128, 86,128,174,203,229,127, 53,216,114,237,134,237, 13,228,186, 31, - 60, 45,108, 99, 75,221,168,134, 76, 17, 90,210, 6, 46,111,188, 64,199,168,215, 13,243,111,147,183, 46,103,220,118,105,236, 97, -215, 29,188,238,116,167, 83, 27,165,165,240, 16, 81,206,105,118, 12,118, 13, 4,225,214, 21, 87,241, 77,252, 60,185,123,158,166, -112, 71,154,159, 41,183, 27,109,139,205, 63,150,247,162,185, 99,182, 92,100,179,110,139,155,227,240,101,139,140, 88,130, 68,159, -245, 70,223,129, 56,186,166,155,146, 82,195,168,125,230,222, 80, 27,116,199,150, 60,245,105,176,199,115,181,238,173, 46,177,185, - 29,226, 1, 37,142, 35, 73, 40, 49, 66, 17, 72, 87, 2,214,144, 51,167,252,216,242,246,247,152,165,181,221,246,119, 6,223,218, -158,232, 36, 0,246,131,168, 5, 56, 43, 74,160,114, 52,135, 56, 56,229, 84, 47,157, 57, 91,241,178,243,191,198, 18,188,163, 93, -252,164,226, 28, 5,101,205,147, 23, 30,229,142, 79, 85,197,112, 45,179,236, 17,220,108,190,203, 82, 30,186, 92, 76,120,146, 86, -223,250,202, 33, 55, 41,231, 81,236, 33, 65, 5, 97,123,125,150,207,146,249, 38,224,110,140,191,125,195,153,140,113,162,149,224, -163, 75, 85,195,129,113, 96, 7, 19,138, 38, 7,125,189,231,190,125,182, 59, 67,246,248,237,155, 39,118, 89,117, 32, 45,226, 1, - 46,114, 52,241, 13, 15,113, 24, 12, 21,123,251,228, 75,202,205,147,201,231,150,238, 58,224,235, 52,147,113,254,233, 90, 28, 23, -107,202,216,247,103,111,217, 37,221,247,103, 92,230,169, 27,150, 91, 18,103, 72,117, 77,182, 84,173,136,218,138,144,144,117,195, -121,183,152,228,230,205,198,109,194, 80,134, 71, 96, 63,202,208, 0,107,125, 13, 1, 79, 18,167,141,122, 7,147, 57, 94, 46, 77, -219, 32,219, 98, 42, 35,110, 46,203, 83,137, 46,115,189, 46, 37, 6, 40, 16,112,171,143,172,229,106, 43, 52, 40, 86,104, 80,172, -208,161, 89,161, 66,179, 66,133,102,133, 10,205, 10, 21,154, 20, 43, 52, 40, 86,104, 80,172,208,161, 89,161, 66,179, 66,133,102, -133, 10,205, 10, 21,154, 20, 43, 52, 40, 86,104, 80,172,208,161, 89,161, 66,179, 66,133, 70,124,167,195,252,125,205, 22,107, 6, - 63,200,246, 22,242, 27, 70, 51,156,225,188,141,104,134,235,238, 48,219, 57, 86, 7, 53,185,246,231,151,225,169, 62, 42, 18,251, -116,113,165,213, 14, 32,169, 11, 5, 42, 35, 83,246,253,206,109,173,206,124, 14,210, 92,199, 48,254,171,130, 31,208,115, 7, 26, -106, 88, 91, 56, 1,193, 80,131,233, 21, 21,219,252,154,249,116,182,203,197,165,199,227,200, 75, 56,111, 40,114,135, 48,216, 99, - 74,152,252,187,124,108,223,152, 99,205,139,124,117,113,220,113, 76,186,203,204, 78, 82, 25,140,164,150,218,216,215,134,148,248, -104,165,131,249,158,245,225,224,200,123,209,178, 51,146,233,140,130,220,122, 84, 98,115, 42, 87, 58,104, 89, 70, 19, 12,137, 62, -147,157, 36, 55,228,111,203, 67,120,214, 15,137,255, 0,240,252, 59,102,227,190, 32,228, 78, 12,197,219,145,121,153, 34, 84, 94, - 59,229, 70,153,106,245, 29,215,214,242,157,125,233, 41,104,148,201,112,151, 16, 86,225, 66,129,113, 85,112,243,101,249,124,146, -120,157,231,202,201, 29,128,247,217,238,148,224, 7, 70, 69, 2,229, 73,248, 24,144, 4,192, 52,129,216,115,163,151,239, 38,188, - 49,125,137,136, 67, 75,156,145,142,163,143,164, 99,178, 48, 39,240,206, 88,200,112,233,184, 74,177,140,101,236, 66, 50, 45, 47, -219,174, 17,221,183,182,187, 11,238, 48,251,108,169, 41,116,169, 74,112, 41, 74, 81, 41,135,153,238,161, 47, 63,179,118,181,213, -169,140,118,165,127,136,117, 2, 10,247,130,133,203,133, 27,172,152,228,204, 38, 72, 72, 68, 9,135,162,155, 54,191,195,255, 0, -203, 54, 56,226, 37,225,120,222, 99,199,215,150, 31,105,200,153, 63, 31,114,158, 75,133,101,209, 35,155, 21,159, 29,147, 24, 93, -109,215, 70, 46, 14, 51,112,183, 88, 96,170, 98, 29,117, 94, 43,237, 38, 82,235, 32,120,186,145, 39, 57, 95,207,132,174,107,219, -208,246, 49,205,247,156,240,116,150,144,160,185,200,131, 0,116,142,238, 20,145,183,196,223,116, 16,122, 65, 32,228, 7,208, 62, -124,233,102, 87,145,191, 45,179,176,155,103, 29,206,194,238,115,177, 27, 61,247,149, 50, 91,125,186,110, 99,119,151, 41,155,223, - 50,153,106,189,201, 51, 92,154,169,235,113,110, 77,113,200,238,169,226,182, 87,181,109,168, 45, 33, 65,166,243,101,243, 37, 51, -135,128,242, 24, 9, 13,110, 81,166,144,136,137,134, 33, 16,140, 14, 20,102,194, 34,221, 36, 96,164,230,120,231, 73,145,252,135, -240, 52, 59,157,203, 35,133, 47,153,160,230,151,171,133,202,125,235,144,224,121,129,205, 96,114, 45,229, 23,187,109,154,211, 58, - 44,171,227, 55,196, 92,159,141, 42, 38, 61,110,172,117,188, 80,218,152,109, 76,134,202, 19, 69,187,155,175, 28,208,194, 34, 44, - 0, 0,195, 20,101,129, 11,156, 8,110,148, 4, 23, 59, 20, 82,165, 86,136, 88, 70, 10,247,151,167, 81, 94, 3, 53,234, 20,190, -143, 37,188, 4,140, 90,245,132,139, 30, 83,253,214,190,204,201, 46,242,109, 3,145, 47,168,110, 38, 69,147,101, 13,230, 46, 93, -226,186,155,128,145, 26,225, 19, 33,105, 18, 98, 78,109,192,243, 52,218,133,132,146, 11, 39,154,111, 12,141,151, 83,117,128, 2, -232,110, 65,158, 30,147,130, 22,150, 96, 91,145,226, 41, 95, 3, 26, 22,161, 78,211,210,171,218,188,105,175,114,242, 47,194,144, -112,174, 95,178, 97,216,235,106,201,249,127, 0, 56,110, 79,127,228, 92,143, 33,206, 19,146,204,137,118,187,228, 17,110, 23,119, -197,234, 37,226, 76,148,222,175, 82, 36, 42, 91, 19,154,125, 63, 70,150,220, 74, 89,109, 41,144,206,109,186,124,176,190, 87,119, - 98,126,166,134, 6, 53, 59,173,105, 13, 26, 75, 64,210,208, 16,180,140,212, 98,105, 6,193,129,174, 13, 24,184, 33, 85, 60, 73, -199, 21,204,244,211,151,202,151,150,251,191,151,187, 87, 38, 74,202,243,217,156,137,155,114,206,126,214,119,147,222,164, 73,187, -205,143, 17, 86,235, 61,174,199, 10, 35, 50, 47,247,139,245,230, 87,133, 10,212,218,150,236,153,202,246,148, 82,218, 26,105, 45, -182,150, 57,135,124,110,242,232,132,113,134, 71, 27, 52,180,119,120,184,184,148,107, 90,209,139,178, 13,237, 36,169,165,218, 91, - 27,112,229, 42, 73, 94, 61, 9,196,147,195,166,173, 13,202,215,110,188, 68,114, 5,214, 12, 91,132, 39,169,226, 70,150,202, 95, -105, 68,118, 26, 40, 26, 17,220, 71, 81,221,170, 8,228,116, 71, 83, 73, 6,165, 16, 29,129,174,109,243,183,148,126, 65,123, 44, - 85,243,135,149,110,184, 99,119, 38,155,221,138, 93, 3, 73, 86, 45, 37,160,119,162, 27,175,220, 33, 36,197,121, 71,196, 75, 68, -168,161,101, 64, 81, 5, 32,108, 54,141,253,145, 71,162, 98,135,165, 9, 95, 87, 26,171,186,179,115,138,179, 26,105,113,127,146, -158, 68,188,229,144,103,115, 25,129,110,198, 45, 15,162,115,118,187, 91,145,247, 77,125,191,154,144, 25,157, 61, 69,117,236,117, - 78, 36, 32, 84,161, 27,232,177, 34,251,153, 34, 99, 63,100,117, 63,134, 4, 1,215,142,125, 84,136,108, 92, 79,124, 32,174,170, -195,133, 14,223, 29,168,144, 99, 51, 22, 51, 13, 50,195, 76,176,216,109, 8,105,132,132, 33, 61, 63,117, 9, 0,122,181,134,115, -203,202,146,166,173,192, 76,168,214,147, 71, 89,161, 66,185,251,255, 0, 53,124,143,255, 0, 5,194,191,171,167,127,105,107,209, -191,210, 45,179,241,103,251,204,252,186,224, 95,213, 45,203,240,225,251,175,255, 0,157,120,124,214,114, 63,252, 23, 10,254,174, -157,253,165,161,253, 34,219, 63, 22,127,188,207,203,164,159, 53, 55, 33,252, 56, 62,235,255, 0, 50,181, 62,107,121, 35,254, 11, -133,127, 86,207,254,210,209,255, 0, 72,118,191,197,159,239, 51,242,232,127, 85, 55, 47,195,131,238,191,243, 43, 63,230,183,145, -255, 0,224,184, 87,245,108,255, 0,237, 45, 15,233, 14,217,248,179,253,230,126, 93, 23,245, 83,114,252, 56, 62,235,255, 0, 50, -189,255, 0,154,222, 71,255, 0,130,225,127,213,179,191,180,180, 63,164, 59,103,226,207,247,153,249,116,127,213, 77,203,240,224, -251,175,252,202,243,254,107,121, 31,254, 9,133,255, 0, 86,206,254,210,208,254,144,237,159,139, 63,222,103,229,208,254,170,110, - 95,135, 7,221,127,230, 86,127,205,111, 36,127,193,112,175,234,217,223,218, 90, 31,210, 29,175,241,103,251,204,252,186, 47,234, -166,229,248,112,125,215,254,101,103,252,214,242, 71,252, 23, 10,254,173,157,253,165,165,127, 72, 54,191,197,159,239, 51,242,232, -127, 85, 55, 47,195,131,238,191,243, 43, 63,230,183,146, 63,224,184, 87,245,108,239,237, 45, 31,244,127,107,252, 89,254,243, 63, - 46,135,245, 87,114,252, 56, 62,235,255, 0, 50,179,254,107,121, 35,254, 11,133,127, 86,206,254,210,208,254,143,237,127,139, 63, -222,103,229,209,127, 85,119, 47,195,131,238,191,243, 43, 63,230,183,146, 63,224,184, 87,245,108,239,237, 45, 15,232,254,215,248, -179,253,230,126, 93, 31,245, 87,114,252, 40,126,235,255, 0, 50,188,255, 0,154,222, 72,255, 0,130,225, 95,213,179,255, 0,180, -180, 63,163,251, 95,226,207,247,153,249,116, 95,213, 93,203,240,224,251,175,252,202,207,249,173,228,131,254,229,194, 79,255, 0, -118,206,254,210,208, 62, 79,237,127,139, 63,222,103,229,208,254,170,238, 95,135, 7,221,127,230, 86,233,243, 79,200,170, 32,155, - 30, 16, 79,167,238,201,213,255, 0,222, 58, 65,242,135,107, 31,197,159,239, 51,242,233,109,243, 75,114, 63,195,135,238,191,243, - 40,227,126,103,185, 13,206,166,199,133,215,255, 0,102, 77,175,254,241,211, 47,242,155,108,111,241,103,251,204,252,186,144,223, - 51,119, 23,127, 14, 31,186,255, 0,249,209,228,249,148,228, 21, 82,182, 92, 55,119,254,204,154, 79,254,241,212,115,229,102,216, - 63,137, 63,222,103,229,211,195,204,141,196,255, 0, 14, 31,186,255, 0,249,209,232,126, 97,185, 38,115,201,143, 22,193,137, 58, -234,250, 4, 34,217, 52,147,255, 0,245, 13, 70,184,242,219,105,181,105,124,147, 76, 7,235, 51,242,234, 68, 30, 96,110,119, 14, -210,200,162, 39,245, 95,255, 0, 58,115, 57,202,188,184,212,114,250,241,156, 52, 81, 59,138, 62,237,150, 86, 7,193,247,134,179, -237,229,190, 95,123,244, 11,137,190,243, 63, 46,175,206,249,190, 6,107,240, 34,245, 59,254,116,203,149,230, 55,145, 98, 44,161, -220,127, 13,109, 73, 36, 81,118,169,128,212,127,247,128,214,162,223,202,253,166,224, 43,102,152,255, 0,185,159,151, 89,185,252, -196,220,237,202, 58, 40,129,253, 87,255, 0,206,146,156,243, 69,200,172,146, 81, 99,194, 18,122,245,251,178,104, 63,154,229,169, -236,242,139,107,119,241,103,251,204,252,186,128,255, 0, 52,119, 38,255, 0, 14, 31,186,255, 0,204,162,139,243, 95,201, 41, 52, - 22, 92, 35,227,182,207,254,211,212,134,249, 57,181, 31,226,220,125,230,126, 93, 70,119,155, 27,155,127,133, 7,221,127,230, 80, -127,243, 95,201, 43,232,171, 30, 14,125, 21,181,206, 63,255, 0,115,210,191,163,123, 87,226,220,125,230,126, 93, 32,121,181,185, -254, 20, 31,117,255, 0,153, 67,167,205, 95, 36,168, 83,238, 76, 34,158,143,187, 39, 83,255, 0,121,105,179,228,246,212, 63,139, -113,247,153,249,116,224,243, 95,115, 63,195,131,238,191,243, 43, 67,230,131,144, 82,173,255, 0,221,252, 19,119,239, 11, 84,218, -255, 0,239, 45, 36,121, 63,181, 31,226,220,125,230,126, 93, 47,250,169,185,126, 28, 31,117,255, 0,153, 94,171,205,119, 37, 39, -178,203,132,127, 86,207,254,211,210,199,147,187, 81,254, 45,199,222,103,229,210, 15,154,251,152,254, 20, 31,117,255, 0,153, 65, - 31, 54, 92,150, 63,220,152, 71,245,108,255, 0,237, 61, 44,121, 53,181, 31,226,220,125,230,126, 93, 50,239, 54,247, 54,255, 0, - 10, 15,186,255, 0,204,175, 7,155, 62, 75, 63,238, 76, 35,250,182,127,246,158,140,249, 53,181,126, 45,199,222,103,229,210, 63, -171,187,159,225, 65,247, 95,249,149,184,243, 99,201, 63,240, 92, 35,250,182,127,246,158,146,124,155,218,191, 22,227,239, 51,242, -232,127, 87,183, 63,194,131,238,191,243, 40, 79,249,174,228,131,254,229,194,127,171,103,127,105,105, 63,209,221,175,241,110, 62, -243, 63, 46,135,245,119,115,252, 40, 62,235,255, 0, 50,132, 30,106,249, 28,143,228,216, 87,245,108,239,237, 45, 32,249, 61,181, -254, 44,255, 0,121,159,151, 71,253, 93,220,255, 0, 10, 15,186,255, 0,204,173,191,230,175,145,191,224,184, 95,245,116,239,237, - 45, 15,232,246,215,248,179,253,230,126, 93, 15,234,238,231,248,112,125,215,254,101,122, 60,213,114, 49,255, 0,115, 97,117,255, - 0,217,211,191,180,180, 71,201,253,172,127, 22,127,188,207,203,161,253, 93,220,255, 0, 10, 15,186,255, 0,204,161, 7,154,126, - 69,239,179,225,127,213,211,191,180,116,131,229, 14,217,248,179,253,230,126, 93, 31,245,115,115,252, 40, 62,235,255, 0, 50,182, - 30,105,185, 22,191,201,176,207,234,233,223,218, 58, 31,210, 29,175,241,103,251,204,252,186, 31,213,205,207,240,160,251,175,252, -202,219,254,105, 57, 23,254, 13,134,127, 87,205,254,209,209,127, 72,182,207,197,159,239, 51,242,232,255, 0,171,155,159,225, 65, -247, 95,249,149,231,252,210,242, 39,125,155, 12,254,175,157,253,163,161,253, 34,219, 63, 22,127,188,207,203,164,255, 0, 87, 55, - 63,194,131,238,191,243, 40, 65,230,139,145, 15,251,159, 13,254,174,155,253,163,164,255, 0, 72,246,207,197,159,239, 51,242,232, -255, 0,171,155,159,225, 65,247, 95,249,149,176,243, 65,200,103,253,205,134,255, 0, 87,205,254,209,210, 79,148,155, 96,254, 44, -255, 0,121,159,151, 71,253, 92,220,255, 0, 10, 15,186,255, 0,204,161,147,230,119,144,143,109,159, 15,254,175,155,253,161,164, - 31, 41,182,193,252, 89,254,243, 63, 46,149,253, 91,220,191, 10, 15,186,255, 0,204,161, 7,153,190, 64, 63,238,140, 67,255, 0, - 1, 55,251, 67, 73, 62, 84,109,191,137, 63,222,103,229,209,143, 54,183, 47,195,131,238,191,243, 40, 81,230, 95, 62, 61,182,156, - 67,250,190,111,246,134,144,124,169,219,127, 18,127,188,207,203,163, 30,108,238, 71,248,112,125,215,254,101, 8, 60,202,231,167, -253,211,136,255, 0,224, 38, 15,255, 0,159,210, 79,149,123,119,226, 77,247,153,255, 0, 10, 87,245, 99,114,252, 56, 62,235,255, - 0, 50,132,255, 0,153, 44,243,254, 19,137,127,224, 38,127,183,233, 63,210,205,187,241, 38,251,204,255, 0,133, 31,245, 95,114, -252, 56, 62,235,255, 0, 50,176,121,146,207, 79,251,167, 18,255, 0,192, 76,255, 0,111,209,127, 75,118,239,196,155,239, 51,254, - 20, 63,170,251,143,225,193,247, 95,255, 0, 58,216,121,144,207, 59,237, 56,151,254, 6,103,251,126,139,250, 93,183,126, 36,223, -121,159,240,163,254,171,110, 63,135, 7,221,127,230, 86,195,204,134,118, 77, 62,234,196,255, 0,240, 51, 63,219,244, 95,210,237, -187,241, 38,251,204,255, 0,133, 31,245, 91,113,252, 56, 62,235,255, 0, 50,183,255, 0,152,220,239,254, 21,137,255, 0,224, 38, -127,183,232,191,165,251,119,226, 77,247,153,255, 0, 10, 63,234,174,227,248,112,253,215,255, 0,206,183, 79,152,188,236,255, 0, -186,177, 79,252, 12,207,246,253, 36,249, 99,183, 15,226, 77,247,153,255, 0, 10, 49,230,166,227,248,112,253,215,255, 0,206,135, - 79,152,124,225, 93,182,188, 87,255, 0, 3, 47,253,187, 77,159, 44,246,241,252, 73,190,243, 63,225, 78, 15, 52,183, 19,252, 56, -126,235,255, 0,231, 70, 19,230, 7, 54, 63,238,188, 95,175,162, 20,191,246,221, 52,124,182,176, 31,196,155,214,223,248, 83,173, -243, 59,112, 63,195,135,238,191,254,116, 97, 60,249,154, 30,219,102, 51,255, 0,130,149,254,219,166,207,151, 54, 3,248,146,250, -219,255, 0, 10,117,190,101,238, 7,248,112,253,215,127,206,141, 35,157,115, 37,118,219,113,175,138, 28,175,246,221, 50,239, 47, -108, 71,219,151,214,223,248, 83,236,243, 26,253,223, 98, 47, 83,191,231, 70,145,205,249,114,187,109,248,231,197, 18, 79,251,102, -154, 60,129,100, 62,220,190,182,255, 0,194,164,179,204, 11,215,125,136,189, 78,255, 0,157, 63,113, 94, 64,201,239,169,117,233, - 81, 44,204,176,217, 9, 30, 4,103,210,165, 40,255, 0,165, 37, 67, 88,238,101,217,173, 54, 93, 45,141,207, 46, 61, 36, 34,122, - 26, 43,160,242,173,253,206,248,215, 73, 48,104,104,195,186, 8,249,201,167,191,247,146, 90, 71,182,220, 90,143, 66, 20, 7,254, -147, 88,179, 47, 69,109,155,183,135,100,191, 47, 69, 1,253,233,156,165, 81,182, 34,158,180,161, 66,201,255, 0,210,105, 38, 99, - 82, 70,210,192, 21,196,251, 62,170, 51,247,245,201, 37, 37, 77, 67, 9, 35,175,176,189,223,250, 77, 23,140,105,159,129,136,228, - 92,190,143,170,132, 85,254, 88, 65, 41, 68, 85, 43,208, 16,163,215,255, 0,203,210,155, 41,113,166,254, 5,171,199,229,232,173, - 17,144,204,237,117,168,201, 7,176, 4, 42,191,254,126,157, 14, 83, 65,214, 13,224, 79,203,209, 67, 34,251, 41,192, 74, 91,143, - 78,239,101, 95,254,158,144,247,233, 56, 82, 13,147, 91,153, 52, 32,187, 79, 63,177, 23,255, 0,217,174,191,250, 77, 35,198, 52, - 95, 13, 31, 95,179,234,162, 15,223, 47,104, 39,194, 98,222,180,211,181, 77, 56, 15,254,151, 70, 37,169, 12,179,129,195, 18,239, -103,213, 68,255, 0,188, 57, 29,105,238,214,186, 82,181,240,156,255, 0,247,218, 95,136, 41,207,128,131,165,222,207,170,185,129, -238,107,244,126, 95, 46,189,169,227,138,241,119,129, 94,123,162,143,119,229,242,232,252, 97, 69,240,235, 94, 24, 74,253,223,203, -229,208, 19,138, 47,134,173,125,197, 95,186,127, 47,143, 74,248,138, 47,133,175, 68, 21, 1,243,127,203,250,116, 95, 16, 40,254, - 26,182, 76, 51, 95,155,250,180, 70,122, 31, 12,181,183,185, 31, 64,249,116,159, 30,129,182, 90, 12,195, 61,201,252,218, 88,159, -174,139,225,235,195, 12,142,239,205,253, 58, 87,143,215, 68,109,235,193, 19,175,103,230,209,252, 69, 23,195, 80,158,231, 95,217, -166,135,143,215, 71,240,233, 90,152, 68,254,206,143,199,162,248,106,221, 48,127,135,252,186, 35,113, 70, 45,169, 65,152, 3,189, - 63,151,203,168,210, 92, 84,134, 91, 83,219, 31,198, 30,185, 60,132, 37,162, 80, 84, 55, 31, 87,203,172,214,241,189,178,193,132, -147,141, 95,237,155, 59,175, 28, 0, 21, 63,218,184,222,217, 21, 13,173,200,233,121, 68, 2, 67,130,191,175, 92,115,115,231,169, -229, 36, 53,201,217, 93, 95,109,228,184, 88, 1,112, 90,121,194,197,236,214,233, 9,151, 30, 11, 76, 60,148,211,114, 19,215,244, -235, 37,119,205, 23, 55,108, 49,190, 66, 91, 90,171, 94, 88,130,221,225,236, 96, 14,161,103,173, 7,125, 69, 1, 20,165, 59,181, - 85,109, 43,156, 85,107, 69, 37,168, 99, 18,163, 12,131, 26,181, 92,227, 63,226, 36, 54,250,129, 40,113, 3,218, 7,229,215, 71, -216,121,150,226,198, 70,161, 86,244, 87, 61,223,121,102, 27,214, 59, 4, 61, 53, 94,175,118, 47,112,125, 77, 87,122,122,209, 93, -159,175, 93,203,105,221,190, 53,154,178,174, 37,186,109, 63, 4,253, 52,211,122, 0,175,103,235,253,122,208, 50,230,179,242, 90, -208, 41,134, 18,123, 52,179, 58,211, 34,217, 40,198, 71,204,126, 88,240, 38,172,150,174, 81, 95, 32, 96, 55, 73, 81,155, 66,178, - 68, 88,223,200,113, 27,188,148,116, 90,219,149, 17, 18,125,212,147,243,154,125,180, 20,247, 21, 39,218, 60,127,153,183,190, 99, -217,174, 30,232, 60, 23,194, 73,210,163, 20,224, 15,121,165, 71,167,166,187, 63, 41,114,142,205,204,118,237,253,231,140, 0, 15, - 1,216,175, 74, 16,112, 60, 8,236,206,145, 91,231, 15, 39, 55,249,140, 90,241, 62,121,199, 29,186,201,115,194,139, 14,249,118, -110,198,252,149,168, 80, 37, 8,150,203, 5, 71,119,112, 61,117,147,103,154, 27,245,171,150,123,104,156,209,154, 7, 15,104,115, -147,213, 90,233,252,154,178,115, 22, 51, 59,122, 9, 66, 63,233, 31, 61, 45, 92,162,196,130, 82,181,205,136,184,206,145,238,211, - 82,250, 12, 73, 40, 89,162, 74, 28, 10, 45,157,221,195,117,117,208, 57,123,205,109,191,119, 70, 76,176,201,208,239,119,208,225, -135,222, 13,174,109,191,121, 93,127,181, 43,162, 2,102,127,167,222, 29,173, 56,253,213,162,138,137,215,176,252, 98,159,175, 93, - 50, 59,145, 32, 14,105, 4, 28,136,174, 99, 53,169, 97, 33,193, 8,204, 86,162, 31,171, 75, 51,212, 99, 5, 10,152, 93,123, 59, - 52,131, 61, 39,192,163, 2, 23,164,124,154,108,220, 82,190, 30,183, 16,199,163,243, 83, 73,241,232,120, 21,239,185,250,191, 47, -151, 69,227,208,240, 43,207,116,245,126, 95, 46,143,198,164,248, 20, 42, 98,215,187, 72, 51, 80,240,104,100,196, 62,141, 32,205, - 74,240, 40, 81, 18,189,223,151,203,164,120,212,161, 13, 8, 32,122, 71,229,242,233, 63, 17, 71,240,244, 39,185,143, 71,229,242, -233, 30, 61, 31,195,208,137,136, 7,119,230,210, 76,203, 69,224,165, 8, 35, 83,187, 73, 50,209,248, 85,184,142, 43,217,164,248, -180, 60, 42,220, 71,167,113,249, 52, 94, 37, 23,133, 66, 37,143, 85, 52,131, 37, 15, 10,140, 33,129,222, 63, 94,154, 50, 83,130, - 42, 20, 69,235,217,164,248,180,126, 13, 10, 34,250,180,131, 53, 40, 67, 66, 38, 39, 94,163, 73, 51, 82,132, 20, 39,186,159, 71, -233,210, 60,106, 63, 0,208,168,139, 78,237, 33,210,211,141,134,140, 34, 55,171, 77,186, 90,117,176,209,198,227, 83,187, 76, 58, - 85,167,219, 21, 29, 67, 30,173, 48,233, 42, 75, 99,163,173,177,217,211, 76, 58, 74,146,198, 82,196, 8, 94, 60,134, 90, 35,162, -148, 63, 54,171,238,238,124, 22, 57,221, 2,175,118,123, 47,140,157,145,244,154,159,236, 81,217,183, 91,210,211, 66,132,141,235, -245,168,252,122,225,155,229,227,175,230, 50, 56,245, 10,244,150,209,183,182,194, 38,196,192,157, 52,162,148, 61, 41, 85, 72, 33, - 62,158,237, 80,184,214,132, 57,176, 12,115,165,104,177, 81, 28,133,172,138,129,217,249, 29, 32,154,133, 60,230, 92, 5, 3, 45, -255, 0, 17, 69, 45,246,246,116,209,128,180,168, 35,208, 20,208,109,125, 21, 10,213, 82,107,219,167, 64,225, 78, 63,246,153, 86, -202, 5,245,123, 53, 9, 29, 9,255, 0, 38,150,186, 5, 33,164, 70, 49,165, 4,169,182, 80, 7,163,167,199,166,115,168,197,166, - 82,180, 39,188,166,157,160,124, 99,252,186, 26,105, 30, 9,175, 60,118,143, 66,160,107,210,181,208, 67, 69,160,138,247,198,103, -178,190,174,223,233,209, 33,163,208,107,157,194, 1, 35,179,245,126,189,122,255, 0,226,171,201,230,214,179,220, 15,163,242,249, -116,127, 21, 69,240,213,239,184, 31, 64,252,190, 61, 31,196,208,248,122,207,112, 62,129,249,124,122, 31, 19, 67,225,235, 67, 4, -246,109,252,190, 93, 24,184,162, 54,245,231,185, 83,187,242,249,116,126, 61, 16,182, 74,244,194, 63,187,249,191,167, 69,227,209, -252, 61,104, 97, 30,225,249,124,186, 80,158,147,240,203, 90, 24, 42, 61,160,104,197,197, 23,195,214,233,183,159,221,252,190, 93, - 17,185,160, 45,232, 97,111, 80,236, 79, 79, 94,145,241, 93,116,127, 15, 88, 96,245,249,186, 88,186,164,252, 61,120, 33,144,170, - 4,232, 27,129, 67,192, 74, 84,183,219,149, 33,244, 50, 19, 66,162, 7, 93, 65,187,188, 16,180,187,162,165, 91, 90, 25,156, 27, -211, 86,131, 16,198,153,183,197, 97, 75,108, 21,148,133, 18, 71, 82, 78,184, 7, 52,115, 3,174,228,112, 7, 10,237,124,187,177, -182,213,128,145,141, 72,161, 8, 0, 0, 59, 7,167, 88, 23,202, 93,153,173,164,108,211, 68,101,188,132, 36,128, 58,211, 69, 24, -213, 82,152,116,227, 77, 9,175, 5,110, 20,244,234,242,210,220,132, 53, 26,230,240, 16,148,221,122,138,168, 34,160,215,167,167, - 87,241, 52,177, 8,170, 41, 37, 15,192,211, 54,239,141, 68,156,135, 92,236,116, 2, 82, 61,127, 46,182, 59, 71, 50,203,102,224, -211,149,100,119,142, 94,138,245,165,195, 58,136, 39,218, 87, 25,213,182,180,118, 18, 18,125, 32,124,122,235,118, 59,139,110,152, - 28,211, 92,150,251,110,117,171,139, 92, 41, 40,192,239,218, 70,172,133,197, 86, 24, 41, 11, 35,195,236, 89, 85,170, 69,155, 33, -181, 68,186,219,100,164,135, 35, 75,104, 56,144,174,229, 39,189, 36,122, 70,152,185,142, 59,214, 24,228, 10,211, 82,236, 46,166, -219, 37, 19, 64,226,215,142, 35,229,141,113,227,205,151,148,116,227, 62, 29,226,210,145, 46,195, 50, 81,102, 26,146,216, 15, 68, -121,117, 80, 97,193,184,168,251, 32,209, 67,161,245, 30,154,227, 60,201,176, 73,177, 63,196,140,151, 68,238, 60, 65,232, 63, 65, -175, 85,249,113,230, 68,123,203, 60, 9,198,153, 90, 49, 28, 8,233, 31, 72,174,119,171,144,185,143,132,102,152,152,118,119,152, - 89,237,168, 52,114,198,169,238, 76,176,184, 19,208,167,220,228, 23, 35,164, 40,116,170, 82, 15,175, 89,216,227,142,243,247,140, -105,235,227,235,206,186,205,196, 22,151,227, 86,144, 29,210, 43,163,190, 83,188,224,100,151, 23,113,216,121,132,230, 37,227, 87, -139,188,107, 37,221,183,211,177,252,102,237,112,246, 24,125,175,106,141, 48,235,164,111, 64,246, 71, 85, 0, 13,107,177,229,141, -221,219, 28,226, 18,227,224,187,129, 56, 14,177,208,156,122, 71,162,184, 39,153, 60,145, 22,227, 11,230,137,169, 51, 1, 32,143, -180,156, 15, 74,140,171,177,141,198, 73,238,168, 61,126, 29,118, 55, 77, 94, 94, 17, 45, 27, 76, 33,220, 63,203,250,116,209,158, -148, 32,161,132, 47, 86,155,241,232, 24, 43,111,115,245,126, 95, 46,139,199,160, 32,173,132, 32,123,191, 94,139,199,163,248,122, -223,220, 64,238,252,190, 93, 39,226, 40, 27,106,217, 48,127,135,242,249,116, 70,226,147,240,212, 40,133, 78,239,203,229,210, 76, -244, 62, 30,183, 17, 7,163, 73, 51, 82,188, 10, 24, 68,245,126, 95, 46,155,241,168,252, 10,247,221, 61, 90, 30, 53, 3, 5,103, -186,127, 14,135,141, 69,224, 86,194, 47,168,126,141, 23,141, 67,225,235,223,117, 31,151,249,244, 94, 53, 15,135,173,132, 79, 87, -229,242,232,188,106, 30, 5,108, 34,211,187,242,249,116, 70,101,161,224, 80,232,140, 61, 26,108,203, 74, 16, 81,132, 71,245,124, - 90,105,210,211,162, 10, 24, 70,245,126,125, 35,197,165, 11,122, 21, 49,135,112,210, 12,180,177,111, 67, 38, 48,244,126,189, 32, -203, 75, 22,244, 58, 98,252,154,108,205, 75, 22,244, 97, 49, 41,221,166,140,212,224,183,163, 9,139,234,211,102,106,116, 91,209, -148,196,167,118,154, 51, 83,130, 10, 50,220, 99,232,211, 46,150,158,100, 20,179,110,109, 77,201,101, 73, 2,187,192,165, 43,219, -170,251,210, 36,141,192,228,149,160,217, 3,160,184,141,205,205,106,104,180, 54, 93,162, 9,233,181, 53, 21,248, 53,195,111,220, -143, 34,189, 36,199, 6, 70, 29,197, 41,220,150, 3, 77,208, 80, 83,184,119,106,180,149,168,134,109, 71, 26, 79,124,171,175, 83, -242,232,192,169, 49,184, 26,214, 51, 96,239, 81,234,174,208, 52,170, 19,191, 42,211,193, 37,100,172,119,158,132,210,154,116, 20, -165, 9, 64, 8, 43,103, 36, 54,194,118,212,116,232, 58,233, 40,166,156,100, 70, 82,180,156,237,197,190,194,177, 80, 9,237,233, -250,116,227, 99, 53, 36, 91,150,210, 52,203,178,144,217, 82, 22,147, 78,225,219,250,116,235, 99,233,167,197,186,240,164, 84,228, - 75,109,105, 10, 38,149,234,107,253, 58,115,193, 90, 89,181, 6,140,127,121, 71,137, 90,154,122, 43,223,242,233, 62, 1,161,240, - 99, 74, 85,105, 16,207,163,243,107,210,134,122,242,119,129, 91,251,159,168,124,186, 30, 61, 23,129, 91,123,167,240,143,151, 71, -241, 20, 62, 28, 87,134, 39,240,254,157, 24,154,139,192,160,204, 90,254,206,150, 38,162,240, 43, 67, 19,213,249,124,186, 87,141, - 73, 48, 86,158,235,214,148,232, 59,116, 12,233, 67,192,173,189,208, 17,217,250,191, 94,136, 76,104, 24,107,116,194, 21,236,253, -122, 35, 61, 23,195,209,198,109,171,117, 65, 40, 73, 42, 52,236, 21,237,211, 18,222, 8,194,147, 78, 50,200,200, 80, 10, 95,111, - 16,184, 56,128,189,128, 3,217, 94,223,211,170, 41, 57,162,222, 50,139, 87, 49,114,204,210,133, 2,188,119, 14,185,182,128,231, -130,149,167,175, 97,235,250,116,136,249,190,209,238,211,173, 13, 56,254, 81,186, 13,213,161, 69, 35, 57,103,117,179, 71, 25, 90, - 77,125, 21,253,122,186,139,114,100,161, 90,224,106,166, 93,170, 72, 74, 57,166,156,216,140, 8,233,186, 50,169, 1, 37, 9, 32, -251, 94,159,151, 84, 60,205,118,255, 0,134,118,140,234,227, 96,177,105,156,106,171, 32,198,192,129,183,230, 1,236,211,178,154, -243,220,239, 46,113, 92,235,180, 69, 16, 96, 0, 86,235,114,157, 65,248,117, 24,154,146,214, 82,100,164, 21, 36,168, 26,158,189, - 53, 38, 7, 33,164,203,146, 83,106, 67, 11,169,170, 78,175,225,156, 37, 84,190, 34, 77, 34,188,201, 4,250, 14,173, 33,156, 58, -161, 75,110, 90,104,169,142, 87,210,149,211,230,112,220,105,182,192, 93, 73, 83,241,116, 92, 91,246,210, 16,160,106, 22, 7, 81, -249,245,111,182,115, 67,246,215, 97,136,232,170,189,203,150,153,184, 55, 28, 15, 77, 32,200,192,218, 13,130,212,132,151, 8,249, -167,211,242,235, 73,111,207,250,157,222,110, 21,154,159,145, 16,119, 78, 52,207,159,141, 74,137,187,114, 9, 72, 52,220, 59, 63, - 78,181,150, 28,209, 5,230, 1,216,214,106,251,149,230,180,196,133, 20,196,201, 49, 11, 70, 77,107,151, 99,191,219,163,220,173, -147, 91, 83,111,197,146,138,142,163,162,146,160, 66,155, 82,123, 82,180,144, 65,234, 8, 58,190,123,227,188, 97, 99,192,115, 79, - 3,136,170,104, 91, 54,221, 32,146, 39, 22,188,100, 70, 21,204,174,126,242, 89,103,183,219,174, 25, 13,145,185,119,123, 28, 84, - 42, 76,132, 73,172,187,197,153,132, 2, 86,167, 84, 19, 89, 44, 34,149, 46,252,244, 14,171, 10, 1, 75, 28,199,152,249, 78, 75, - 32,110, 44,113, 96,197,204,226, 58,199, 72,234,206,187,167, 37,121,146, 46, 8,181,191, 64,243,131, 95,147, 73,235, 28, 15,176, -245, 87, 56, 25,198,162,225, 87,207,115,113, 62, 21,146,244,164, 91, 95,144,210,186, 71,121,242, 3, 15, 2, 15,253, 91,148, 53, -214, 30, 27,215, 60,167, 28,235,176, 94, 64, 47, 96, 36,123,192,122,197,119,219,203,182,104,188,239,140,236,111,220,100,182,254, - 79,143,182, 49,188,169,160,163,227, 55,118,182, 0,148,186,176,123,166, 71,240,223, 4,116,246,136,237, 4, 14,225,203,123,200, -221, 45, 90, 87,188,222,233,244,100,125, 35,218,181,227,190,110,216, 63,148,222,188, 1,220,121,212,222,195,152,244, 21, 21, 96, - 17, 20, 16, 58,106,225,210,165,103, 69,189, 14,152,189, 58,141, 52,102,165,124, 61,109,238,163,209,162,241,168,124, 58, 86,233, -141,234,252,212,209, 25,104,252, 10, 25, 49,107,221,250,244,131, 53, 44, 91,208,130, 32,244, 13, 35,198,162, 54,245,239,186, 87, -187,228,208,241,169, 38,222,189, 16,253, 95,151,203,162,241,232,190, 30,182,247, 95, 86,139,198,162,248,122,195, 23,213,161,226, -208,248,122,207,117,248,180, 60, 90, 30, 5,103,186,232,120,180, 60, 10,216, 70, 30,141, 23,139, 67,193,175, 68, 97,232,252,218, - 47, 22,135,129, 94,251,183,171,243,104,120,180, 12, 21,178, 99,250,191, 86,146,100,160, 33, 74, 48,150, 61, 95, 23,102,155, 50, - 83,130, 26, 48,152,254,173, 54,100,167, 4, 52, 40,141,234,252,250, 71,139, 78, 8, 40, 68,199,245,124, 93,250, 65,150,148, 45, -232,210, 35,122,180,211,165,167, 4, 20,109, 17,189, 90,101,210,211,173,130,140,162, 48,238, 26,100,203, 78,139,122, 50,136,195, -209,166,140,180,232,183,163,104,138, 59,134,153,116,212,251, 45,233, 90, 4, 21, 56,242, 54,130, 40, 65,168,245,106,186,254,236, - 67, 27,137,232,173, 6,201, 96,103,153,169,192,212,169,102,100,179,237,171,162,182,247,235,143,110, 14, 14,121, 34,187, 87,137, -173,129,180,184,235,245, 73, 0,252,125,154,129, 73,142, 36, 42,105, 56,188,197, 61,181, 41, 74,169,175, 94,159,167, 78, 5,169, - 58, 29,194,138, 61,113, 98, 57, 27, 14,222,132, 30,191,211,167, 89, 25, 52,177, 3,159,157, 32,200,189, 29,228,165,103,175,117, -127,167, 83, 89, 14, 21, 37,150,224, 96,105, 57,219,154,221,237, 95, 79, 89,254,157, 16,141, 42,198, 56, 67,105, 14, 69,200, 2, -175,111,188,247,255, 0, 78,158, 12,169, 13, 20,140,253,211,161,246,171,241,250,126, 61, 44, 70,180,251, 89, 72, 82, 46, 21, 36, -133, 83,213, 95,233,211,237,142,156, 17,208, 30,255, 0,244,117,221,215,183,231,117,160,248,244,175, 14,143,195,164,132,198,233, -211,244,107,181, 25,107,201,255, 0, 15, 91,251,169,252,191,207,162,241,169, 95, 14, 43,223,118,245,126,127,233,208,241,168,190, - 30,188, 49,107,251, 63,159, 67,198,235,162,248,106,212,196,245,126,141, 40, 79, 68,109,232, 51, 19,213,242,105,127, 17, 73,248, -122, 11,221, 63,135,244,104,252,106, 35,111, 91,136,167,247,116, 12,244, 5,181, 57,236,120,232,184,186, 3,149, 75, 96,251, 68, -127,159, 89,237,235,125,254, 92,197, 25,213,198,217,179,124, 99,177,202,164,184, 24,188, 24, 10, 42,109, 1,117,253,165, 10,144, -117,205,183, 14,106,154,240, 33, 41, 91,107, 46, 95,138,216,170, 82,210,163, 54,132, 82,128, 10,116,233, 79,215,172,196,151,238, -113, 85,173, 28, 86,161,161, 41, 34, 64,111,105, 77, 71,192, 14,152, 23, 68,149,171, 24,225,193, 41, 41, 49, 99,169, 68, 56,210, - 87, 95, 72,244,234,197,187,212,204, 64,215, 17, 77, 73,180,195, 38, 46,104,175, 27,199,216,247,132,188,203,123,106,106, 64, 61, - 7,231,214,130, 46,107,124,177,120,114, 28,107, 55, 63, 46, 50, 25, 53,198, 48,169, 42, 27, 65, 49,208,133,117,162, 64,237,214, - 38,226, 79, 17,228,213,195, 86, 48, 5,122,182,105,215,187, 81,137,169, 13,145,104,131,131,184,116,244, 87, 82, 98, 52,204,174, - 52, 81,104, 29, 74,147, 93, 77, 99,170, 51,137,164,135,155, 73, 39,217,165,117, 53,146,105,166,204,101,245,171, 81, 82, 8, 81, - 20,169,174,138, 75,181,194,157,142,220,138,221,245,181, 29, 7,122,106, 72,233,232,253, 58, 96, 74, 94,105,225, 18,211, 50,100, -173,171, 42, 77, 65,169,165, 59,191, 62,173, 32,198,150, 97, 90, 75,126, 66,222, 70,213,209, 64,250, 71,244,234,214,217,222, 17, - 81, 85,215, 54,193,225, 8,166,212,219, 98, 93, 37, 64, 1, 95, 64,239,249,117,185,218,183,243, 8, 13, 53,134,221,182, 1, 42, -184, 96,105,187, 38,215,182,160,167,114, 72, 32,244,173, 65,214,218,211,116,109,192,172, 37,230,216,235,115, 92,138,243,211,229, - 18,253,253,217,200, 57, 31,136,215,107,129, 15,196,110, 77,239, 29,154,232,183, 69,181, 92, 30, 62,195,214,226,150,195, 97, 50, - 22,154,173,130, 65, 10,170,145,236,213, 41,231, 92,233, 97,109,183, 61,151, 77, 33,165,238, 77, 35,137,205, 64, 30,223,211, 93, -163,203, 78,113,153,192,217,220,130,230,181,165, 29,158, 25,105,119,208,106, 63,242,185,200,124,161,198,115,226,100,249, 22, 49, - 62,237,103,189,227, 22,155, 94,111,107,182, 52,178,182,174,144, 5, 99,205,109, 74, 73, 70,246,130,150,130, 55, 81, 73, 87,111, - 68,234,171, 97,230, 38,236,115, 56,156, 88,236,192,246, 31, 71,211, 67,155,182, 72,119,232,244, 49,192, 61,174, 37,164,244, 28, -199, 97,250, 43,176, 56, 86,113,139,103, 86,214, 46, 24,245,201,153, 37,196, 36,189,111,116,134, 46,144,157, 61,173,191, 28,159, - 17,181, 10,118, 17,215,180, 18, 53,212,236,247,187,109,201,186,161,145,167,164, 46, 35,180,103, 92, 94,247,100,184,219,157,166, - 86, 16, 56, 28,193,236, 57, 84,210,206, 32,221,190, 7,223,121,149,238,209,133, 88, 82,144,234,230,223,101,162, 60,133,181, 74, -213,182, 10,130,201,167,102,226, 62, 61,102, 55,110,125,178,177, 37,145, 59,197,127, 67,113, 11,214,114,245, 45, 94,109,124,151, -119,126,142,120,208,206,151,103,232, 31, 90, 85, 88,228,159,196, 67,201,151, 13,205,147,104,199,154,186,242,230, 79, 1, 74,109, -198,173, 44,125,227, 12, 72, 64,234, 20,226,202, 33, 3, 94,229, 80,235, 15,117,204,187,158,229,246,188, 54,158, 3,187,237,247, -189,181,210,246,190, 65,182,136, 7,104,213,214,236,125,153,123, 42, 31,181,126, 46, 60, 75,154, 75, 98,205,150,112,102, 79,138, -218, 30,123,194, 69,238, 10,224,206, 92, 4, 19, 64,226,152,105,207, 22,128, 30,161,176, 79,160, 29, 82, 58, 75,251, 71,248,176, - 92,184, 59,180,161,237, 14, 86,159, 72,173, 43,185, 66,218,118,120,114, 68,194, 58, 16, 4,236, 32, 2, 61,117,107,113,222, 76, -227,140,214,214,221,251, 13,201,173,217, 13,161,228,239,241,173,143,248,146,225,129, 90,165,248,171, 62, 59,106, 65, 20, 87,105, -245,106,234,195,204,123,203, 67,162,246, 32,241,210,222,235,189, 88,180,250, 18,177, 27,175,150,208, 5,248,119,185,135,161,221, -225,235,192,143,109, 59,173,147,237,183,118,148,245,178,100,121,173,182,181, 54,225,101,117, 45,184,158,208,161,209, 73, 62,162, - 53,212,118,205,234, 13,226, 63, 22, 7, 40,226, 14, 4, 30,130, 62, 64,240, 53,204,183, 45,150,125,170, 79, 14,102,167, 65,204, - 30,176,105, 88, 69,175,119,229,242,234,121,153, 42,188, 65, 91,123,175,171,244,105, 62, 53, 15, 2,188,247, 95, 86,143,198,164, -152, 43, 4,111, 86,135,139, 73, 48,215,190,236, 61, 3, 67,197,162,240, 43,207,117,252,171,161,226,209,120, 21,158,237,234, 26, - 30, 45, 23,129, 94,251,175,171, 69,227, 80,240,107,223,116,245,126, 95, 46,135,141, 67,192,175, 68, 63, 87,229,242,232,188,122, - 49,110,180, 50, 98,250,180,131, 53, 44, 91,209,132,198,167,118,155, 50,211,130, 10, 25, 49,189, 3, 77,153,105,209, 13, 12,152, -222,173, 32,203, 75, 16,209,148, 70,245,105,163, 45, 56, 33,163, 9,143,234,211, 70, 74,112, 67, 70, 80,199,171, 77, 58, 74,112, - 66,148,109,184,197,100, 37, 41, 42, 36,208, 1,218, 78,153,116,169, 79, 50, 18,112, 20,241,181, 99,192,209,201,105, 4, 16, 8, - 65,238, 7,211,215, 89,109,219,127, 22,225, 35, 56,214,171,105,216, 12,197,100,202,157,204,219, 98, 48,154,182,202, 17,211,161, - 3,175,233,214, 22,243,119,154,235, 7, 56,165,111, 44,118,200,172,207,113,161,104, 39, 29, 75, 10, 41, 6,132, 15, 77, 53, 90, -165,213,126,216,117,129, 69,189,232,172,237,221,240,144,123,180, 3,105,211, 22,145, 73,119, 25,233,105, 52, 74,128,233,220,122, -254,157, 74,141,139, 78, 65, 14,172, 77, 51, 37, 92, 74,215,213,100, 26, 26, 84,246,254,125, 77,100,105, 86, 34, 36,164,119, 46, - 59, 84, 66,143, 94,226, 15, 74,124,186,154,214, 97, 73,208,166,139,185,116, 72, 73,246,253, 53,235,253, 58, 54,219,151, 83,193, -225,185,211,114, 93,211,218, 59, 84,105,212,214,181,253,122,152,203, 94,154, 2, 69,202,145,156,184,172,214,135,175,166,167,252, -186,124, 90,138,121,178, 17, 68, 76,197, 43,180,246,250,244,102,220,112,167,155, 50,103, 91,123,223,179,182,191, 21,116,223,130, -105,223, 24, 83,196, 49,217,219,242,107,165, 25,171,204,190, 18, 80,158, 0,252,142,147,226,208,240,235,209, 28,104,252, 90, 63, - 14,179,221,198,135,137, 67,195,173, 76,113,220, 52, 98, 74, 47, 10,188, 17,253, 95, 41,209,248,148,159, 14,179,221,235,221,241, -232,188, 90, 30, 10,209,134, 97,239, 80, 0, 31,147,211,166,101,184,208, 22,156,100, 26,141, 73,150, 24, 30, 3, 9,165,106, 69, - 77, 70,185,151, 49,223,248,206, 43, 91, 61,162,219,194, 24, 83,157, 8, 9, 29,189,135, 88,137,102, 90,210,180, 81, 57,142, 37, - 41, 32,119,124,186,138, 94,181, 38, 54,173, 52,100,191,181, 71,183, 70, 29, 86, 49,177,107, 35, 44,173, 96, 14,181,166,140,189, - 40,220, 18,157,112,210, 70,210, 71,194, 15,126,139, 90,212, 57, 41,125,181,122, 52, 22,160, 60, 80,170,236,169,236,244,105, 75, - 77,182,136,184,144,123,123,186,211, 78, 49,233, 74, 45, 90, 79,112,245,219, 78,149,244,106, 67,100,163, 16,173, 6,152,219,186, -148,254,109, 44,205, 68, 24,148, 28,165, 37,150,207,239, 1,208, 15, 78,152, 14,212,106,194, 40,181, 10,102,206,156, 66,137,116, - 21, 0, 58, 1,217,250,117, 99, 27, 58, 40,252, 30,138,105, 75,152, 30, 87,176,222,222,189,255, 0,231,213,140, 24,113,167, 12, - 58, 69, 23, 66,213,249,245,105, 27,170, 4,177, 81,147, 69, 1, 81,215,179, 83, 98,145, 42,158,230,222,150, 44, 56,164,140,146, -114, 35, 35,232, 34,165, 73, 50,101,169, 4,165,164, 18, 58, 39,247,148,123,135,198,122,105,249, 57,140,108,237,212, 74,147,144, -233, 63, 87, 73,170, 57,182, 81,122, 81, 48,226,107,222, 73,188,240,182, 42,152,216,197,205,219, 91,183, 8, 5, 47, 37,171,140, -134,228, 54,101, 46,159, 72,180, 45, 91, 22,237, 9, 21, 9,168, 21, 9,160,168,214, 55,114,220,101,221,101,241,230,118,167,100, - 58, 26, 58, 26, 56, 14,158, 39,141, 89,218,216,178,194, 63, 10, 38,160,204,244,158,211,242, 78, 21, 94, 47, 23,107, 61,250, 52, -177,105,133,111,251,191,192, 83, 65,148, 52,219, 94, 50,128,246, 84, 0,165, 83,180,132,138,117,213,103,138, 22,148, 99, 34,185, -235,102,195,231,183,203,153, 53,254,217,122,185, 99, 8,199, 98, 46, 68,100,219,159, 92,116, 38,235, 32,157,138, 9, 10,218, 82, -148, 36,212, 31, 72, 58,149, 51,155, 52,122, 92, 21,106,104,156,194,193,210,181, 90, 94,242,221,230, 99,205,119, 38,229,150,219, -167,152,147, 15,141,236,175, 91,159,116,220,220,149, 51, 36,152,197,192, 44,169,165, 66,105,198,219,115,193, 40,217,188,188, 16, -122, 26, 3,236,235,109,203, 59, 27, 55, 6, 31, 15, 75, 52,231,196,246,129, 81,183, 46,103,139,102, 99, 92,248,156,247,185, 83, - 28, 48,235,171,205,199,191,134,135,151,188, 70, 12, 54,175,169,202,179,123,131, 45,163,222,101, 92,111, 78, 89,225, 72,124, 80, -149, 37,136, 5,133,160, 19,251, 42,117, 94,178,117,185,135,150,109, 98,247,213,199,172,253, 2,177,247, 92,255, 0,184,220,147, -225,150,198,222, 0, 5,249,254,170,146, 38,121, 6,242,225, 41,228,187, 27, 20,188,218,219, 73, 10,247,123,126, 89,113, 44,149, - 14,195, 87,223,125, 98,135,184, 42,158,173, 56,253,130,205,223, 97, 61, 38,162,199,206, 59,147, 51,145, 79, 73,104,250,168,178, -188,139,241,229,170, 66, 46,120, 38, 89,158, 97,119,166, 20, 21, 30,108,107,170, 46, 12, 2, 59,150,218,218,109,213,130, 71, 81, -226,138,247,215, 85,183, 60,163,105, 48, 70,234, 30,149, 30,163, 86,176,121,129,124, 48,153,172,123,123, 16,250,193,250, 40, 9, -152,239, 52,113, 69,222, 5,225, 13, 59,155, 52,133,178,204,139,174, 59,111,117, 95,123, 67,169, 11,106,229, 9, 21, 45,172, 10, - 41, 47, 34,163,224,214,112,108, 87,155, 4,162, 75, 83,168,117,124,196,116,124,150,173, 91,187, 88,115, 20, 70, 41,198,131,154, - 56,228,122, 90,106,238, 90, 28,114,231,110,133, 57,118,249,118,245,203,140,203,234,131, 44,127,172,198, 83,137, 4,165,126,202, -104, 65,238, 32, 29,116, 8,103,115,152,211, 34, 7, 17,136,232, 53,205,231,180, 17,200,230,176,171, 65,192,244,210,169,138,177, -218,217, 31, 22,150, 38, 7,141, 32,219, 17,152,173, 61,223,184,138,124, 90, 63, 22,155, 48, 86, 8,227,209,242, 13, 15, 18,144, - 96,172,240, 7,238,157, 15, 18,144, 97,175,125,220,122, 41,241,232,120,180, 94, 13,103,187,143,200,157, 15, 22,135,131, 91, 8, -195,184,126,106,232,188, 90, 30, 13,110, 35,143, 65,253, 3, 73, 50,209,248, 34,183,247,113,232,210,124, 90, 49, 13,108, 35, 87, -187,244,232,140,180,161, 13, 8, 35,122,191, 54,146,101,165,248, 84, 50, 99,250,191, 94,144,101,165, 8,168,100,177,221, 79,151, -166,155, 50, 82,252, 58, 25, 44,129,164, 23,210,196,116, 58, 99,174,149, 13,170,158,157,186,108,200, 58,105,193, 9,232,161, 18, -216,237,167, 93, 32,186,140, 50,151, 44,113,252, 89,200,233, 80,128,165, 31, 85, 53, 81,188,220,252, 60, 14, 53,111,179,218,248, -211, 0, 42, 66, 74, 82, 40,158,243,174, 89, 61,193,148,170,215, 78,134, 17, 8,192, 86,178, 29, 13,167,167, 95, 64,212,106,159, - 3, 53,211,118, 84,145,237,110, 72, 63, 23, 93, 58,209, 86,241,194,131, 10, 67,118,127,128,186, 5, 87,112,233,234,212,134, 49, -105,215, 69,172, 83,110,124,208,165, 31,104,159,132,154, 10,106, 84, 97, 42, 68, 81, 32,166,164,217,137,234, 73, 33, 93, 64,167, -249,245, 41,133, 42, 83, 98, 90, 66,149, 60,132, 14,181, 52,232,174,250,124,186,153, 11, 60, 67, 71, 32, 17, 12, 41, 25,115,212, -170,167,113,168,238,169,166,173, 24,208,218,132, 89,170,136,185, 37, 71,191,245,233,209, 78, 53,148, 92,184,165, 30,154, 88,165, -158,237,123,180,246,215,228,209, 23, 1, 76, 57,233, 65,110, 86,239,205,166,181,227, 73,241, 42, 96, 12,127, 15,203,173,137,146, -184, 55,135, 91,248, 3,208,126, 77, 39,196,161,162,189,240, 71,160,252,159,209,163,241, 40,105,172,240, 71,160,252,159,209,161, -226,154, 26,107, 60, 17,251,167,228,254,141, 31,139, 69,162,188,240, 1,253,147,242,127, 70,135,139, 67, 69,122, 24, 21,165, 63, - 94,139,197,163,211, 74, 16, 89, 79,138, 43,233, 29,105,168, 23,210,157, 6,164, 91, 48, 23, 84,147, 15,195,110, 50, 66, 64, 29, - 62, 61,114, 61,214,103, 58, 82,181,186,178,137, 24, 18,183, 81,167, 65,223,219,170, 87,190,172, 26, 41,189, 61,101, 42,237, 52, -210, 53, 84,216, 66,211,114, 67,161, 68,128,123,255, 0, 62,134,164,171, 6, 52,138, 22, 19,190, 26,251,187,116, 9,162,145,139, - 78,232,114, 82,160, 42,122,244,248,116, 75, 80,159, 25,165,166,220,167,233,210,129,168,175, 98,209,143, 20, 30,213,105, 75, 77, -104, 74, 1,197,164,214,157, 63, 94,140, 58,150,216,232,181, 1, 21,233,211, 74, 15, 74,112,178,182, 75,148, 20, 20, 31,175, 67, - 90,208,240,146,144,110,175, 33, 4, 16,170,147,218, 52,252, 33, 77, 77,137, 81, 41,141,113,115,122,137,244,158,205, 89,177,233, - 78, 53,137, 77,242, 13,122, 80,106, 92,111,167, 11, 86,140,176,194,158, 82, 27, 66, 84,183, 22,160,148, 33, 9,220,165,169, 70, -128, 0, 5, 73, 39, 83, 27, 62,145, 80,165,134,165,156,123,141,100,200, 40,149,124, 38, 52,125,169, 90, 33,182,175,245,151,107, -214,139, 52,250, 49,233, 3,175,193,219,170,251,189,220,176, 36,121,252,213, 85, 51,219,144,198,157,153, 13,162,227,108,178, 75, - 70, 60,218, 25,125, 49, 94,110, 34, 99, 39,104,140,165, 15,156,144,126,114,137,239, 38,167,211,172,117,225,153,206,241, 94, 73, - 53, 42,217,241,188,104, 24, 87, 18,167,223,172,152,215, 44,228, 51,249, 14,194,171,221,253,137, 87, 20,185,119,228,139,227,152, -237,134,192,212, 48, 92,250, 6, 17, 6,121,113,213, 55, 87, 18, 20, 18, 10, 61,164,173, 94,214,210,117,244,211,144,198, 96,212, -197, 51,250, 42,233,155,116, 12,128,200,231, 28,209, 26, 1, 61,167, 31,145,166,255, 0,148,223, 54,124,127,230,210,233,146, 76, -192, 45,144,227,217,177,171,197,206,209,120,189, 91, 17, 40, 89,158, 54,228, 33,192,244,119,166,193,183, 73, 90, 72,116, 35,233, - 35,160,133, 5, 10,116,169,150, 9,131, 7, 28, 77, 87,239, 59, 71,192,134,184,170, 17,197, 20,122,137, 21, 0,249,129,229,219, -118, 43,200,179,172, 56,245,213,183,205,201,215, 30,187, 45,158,174,236, 65, 8, 74, 18,148,142,180, 69, 63, 62,174,108,129,149, -170, 70, 85, 83, 21,151,136,221, 71, 46, 20,241,224,158, 72, 77,167,147,176, 9,118, 25, 45,188,155,253,222, 22, 47,121,140,219, -137, 72,186, 91,114, 55, 91,100, 21, 84,212,152,210, 10, 93, 20, 4,251, 52,236,214,183,150,111, 95,183,221, 48,240,119,116,142, -163,245,103, 89,221,246,196, 93,192,246,184, 98,208,163,168,143,172, 97, 93,151,106, 57, 52,246,127, 54,186,203,238,219,211, 92, -234, 43, 71,116, 81,228,197, 36,118, 31,147,250, 52,207,196,142,154,145,240,164,112,161, 4, 66, 77, 2,122,252, 29,116,102,112, - 2,173, 39,192, 39, 1, 78,107, 78, 62, 95, 33,110, 39,167,109, 8,233, 79,147, 89,141,219,152, 5,183,117,167, 26,186,176,217, -204,184,184, 83,230, 61,154, 36,116,132,248, 13,168,211,247, 69, 71,230,215, 61,188,230, 9,230,118, 14, 32, 86,202,211,103,134, - 54,226,208,180, 94, 77,166, 59,181, 1,176, 7, 94,148, 31,228,210,237,185,142,104, 72,198,159,151,100,138, 81,149, 51,174, 22, -176,202,206,192, 40, 61, 95,209,173,222,213,191, 54,236, 35,142, 53,151,220,185,120,194, 53, 52, 82, 42,154,161, 34,159,145,214, -145,178,106, 11, 89,121, 32,210, 80,215,129,154,247,124,154, 87,137, 81,204, 85,239,128,125, 31, 41,209,120,148,147, 29,123,224, -122,134,139,196,162,240,171,112,205,116,147, 37, 15, 14,183,240, 7,163,243,232,188, 74, 26, 43,111, 7,212, 63, 47,139, 69,174, -143, 69, 8, 26, 31, 14,146, 95, 74, 17,214,254, 24,244,126,109, 39, 85, 44, 49,104,220, 88,107,144,176,148,166,137,175,180,170, -118, 13, 70,185,187,109,179,117, 56,212,155,107, 55, 92, 57, 26, 41,216,197,146, 7, 77,232, 81,238, 36,171, 88,235,174, 99,149, -139,164,138,213, 91,242,244,110,247,133, 6,254, 54,208,123,123,110, 17, 30,149,219, 90,168, 31,147, 76,199,206, 68, 70,142,111, -127,217, 79,255, 0,234,141,115,253,227,167,162,143, 39,221, 99,161, 45, 41,180,148, 82,132,144, 42,127, 54,168,238, 55,217, 38, -118,160, 72, 53,127,111,176, 49,141,210, 70, 20, 15,187, 90,214,149, 0,148, 38,189, 65, 29,160,252,154, 31,251, 5,214,160,237, - 70,143,249, 44, 13, 26,116, 10, 51,110,110,222,195,142,166, 51,168, 91,195,104,116,110, 10, 90, 55,117, 21, 29,162,186,107,112, -222,230,191, 96,107,242, 20,155, 77,166, 43, 71,151, 48, 99, 74,229, 91, 71,136,179,181, 41, 53,248,117, 75,170,173,218,117, 96, - 41, 6,116,237,196,236, 80,167,229,234,210,193,171,123, 91, 84,206,155,207,202, 53, 53, 63, 30,164,199, 86, 65,154,105,187, 58, - 66, 77, 74, 85,211,209, 78,205, 76,105,160,214,211, 62,100,221,164,141,221,127, 47, 86,158,110, 53, 45,173, 74,108,202,150, 58, -245,169,235,240,234, 92,108, 46,165, 25, 67, 41, 13,217, 42, 85,122,252, 0,255, 0,155, 86, 49, 13, 2,161,203, 54,179, 69, 70, -229,117,175,231,212,150,189, 41,191, 17, 40, 68,164,158,157,126, 30,193,163, 50,165, 56,199,106,163, 13,164, 39,231, 0,116,109, -159, 85, 38, 96, 90, 21,105, 70, 42, 96,137, 12,153,200,148,168, 97, 95, 78,152,101, 9,146,164,122, 16, 86, 10, 1,248, 70,163, -222,186, 83, 27,188, 13, 62, 34, 97,169,116,175, 90, 98,157,149, 85, 36,218,106, 62, 57,238, 54,121, 77,188, 49,171, 78, 84,187, - 74, 44, 78,220,102,200,251,176,166,108,107,203,142,160, 69,128, 30,219,238,107, 15,196, 68,137, 6, 72, 86,196,236,216, 70,229, - 13,114,143,253,199,125, 15,254, 92,108,160,248,242,252, 63,110, 60, 35, 8,247,166,203,196, 26, 73,107,124, 52,212, 75,148, 96, - 13, 83,157,230, 49,114, 45,212,234,208, 93,145,224, 64, 69,203,138,213,160, 12,142,159,163, 94,133, 50,215, 54,211, 91, 22,135, -171, 69,226, 81,105,172, 12,250,191, 94,135,137, 67, 72,161, 17, 21,110, 29,168, 77, 73,233,208,105,169,110,155, 8, 87, 26, 92, -112,153, 10, 54,148, 81,101,125, 67,170, 64,248,127,205,170, 57,121,154, 8,202, 45, 90, 71,179, 72,240,169, 70,209,100, 71, 98, -136, 42,167, 95,135,228,213, 76,220,219,142, 25, 85,148, 91, 0, 76,107, 85, 89, 18, 23,243,186, 15, 64,254,141, 3,206, 1,161, - 17, 77, 27,121,111, 89, 85,194,141, 55, 99,232, 20,147, 79, 95,127,232,212,115,205,186,253,225, 74,118,194,216,242, 52,187, 29, -129, 29,176,149,144, 72, 29, 63, 42,107, 41,185, 95, 54,237,218,128, 74,182,181,183, 48,132, 90, 13,213,142,164, 30,237, 84,151, - 84,246,178,154,151, 23, 79, 80, 59,180, 69,213, 99,110,202,102, 72,148,164,172,245,167, 90,232,193,171,102, 70, 18,183,143, 47, -114,135, 90,154,143,203,179, 68,180,151, 49, 41,235,107,127,160, 36,122, 14,140, 26,131, 43, 41,208,219,213,161,210,193,168, 47, -141, 40,111, 20, 1, 93, 24, 52,214,138, 1,201, 53,233, 64, 15,231,210,129, 90,113,145,105,160, 20,232, 29, 43,211,183, 69,141, - 58, 26,181,171,143,141,166,157, 5, 52,182,138, 1,152,211, 98,115,133,100,247,141, 78,140,233,169, 45,109, 55,166, 10,138,119, -211,167,175, 78,248,148,243, 89, 64,219,108,151, 11,179,225,152, 81,214,232,173, 92,122,155, 88,101, 29,234, 90,207,178,144, 61, -122, 83,174,132, 33, 73,162,148,182, 48,174, 53, 63,226,184,117,182,194,219,114, 92, 64,153,115, 82, 82,125,225,196,213, 12, 30, -255, 0, 5, 37, 34,157,127,104,138,252, 29,154,132,251,231, 79,150, 85,159,186,185,116,197, 6, 13,249,103, 79, 87,159,240,134, -229,251, 9, 0,146,163,217,250, 52,209, 36, 84, 38, 48, 58,161,204,219,151,177,187, 3, 79, 69,147, 61,134,151,181,105, 90,156, -112, 34,135,208, 43,164, 72,243, 32, 74,113,141, 13, 56,103, 84,167, 54,224,156, 27,205, 36,143,118,156,207,190, 32, 37,196, 25, -140,246, 41,149,144, 74, 84,237, 10, 84,131, 64, 75,106, 5, 36,129, 80,105,168, 14,107,163,193,153,154,157,107,116,251,103, 40, - 36, 38,116,164,199,150,158, 16,242,181,192,153,157,163, 2,183,192,180,220,100,219,174,204, 46,117,177,152, 81, 82,139,170, 16, -176,176, 27,138,211, 44, 5,161,127, 57, 33, 27,171,218, 53, 26, 56,156, 30, 11,220,175, 95, 69, 78,220, 47, 95,184, 5,145, 75, - 83, 50,171,237,225, 95, 33,156,187,158,114,206, 59,205,209,223,199,113, 88, 55,152,138,185,222,165,101,185,253,202,124,217,178, -109,209,227, 32, 59, 22,221, 14,218,195,233,136, 83, 35,117, 92, 83,236, 41,106, 82,246,182,226, 2,119, 39,121, 3, 68,141, 3, - 32,153, 97,235, 90,176,178,182, 99,225, 85, 4,101,167,143,105, 40,163,181, 64, 29,121, 87, 74,191, 12, 46, 4,228,174, 66,229, -219,255, 0, 43,102, 23, 55,161,241,214, 7,146,139,205,146,218,226,188,103, 37,223,167, 3, 38, 36, 38,149, 80, 2, 33,165,105, -117,213,208,246, 33, 35,231, 18,155, 59,187,198, 91, 53,154, 71,123,234,170,121,237, 27, 62,166,240,200,215,210, 36,102, 83,210, -191,151,230,208,111, 49, 74, 6, 53, 89,255, 0,175,196,180,230,138,204, 69, 36, 37, 73,235,223,211,183,243,105, 13,223, 37,212, -164,209, 77,177,176, 4, 0, 82,163, 22,200, 75, 80, 90, 69, 21,220, 8,233,250, 53, 37,252,203, 43,134,147, 85, 78,229,230,176, -234, 74, 91,105, 40,142,138, 14,131,190,131,183, 84,119,119,102,224,173, 88, 91, 90, 8,194, 86,202,152, 0, 61,105,211,242,238, -213,105, 10,106,201,145, 81, 7, 38,160, 18, 66,250,254,143,205,160,134,167, 71, 10,138, 67,155, 45, 46,171,175, 83,223, 79,243, -106,206,194,119, 91,185, 69, 46,107, 70,200,196, 52,138,180,165, 74,170,123,255, 0, 47, 70,186,126,215,125,226,176, 7, 28,107, -152,111, 59,119,134,242, 90, 48,175, 3,126,174,186,184, 46,172,211,162,161, 60, 49,232,210, 53, 83,126, 29,108, 26,175,112,248, -198,139, 93, 22,138,219,194, 26, 45,116,157, 21,239,132, 61,122, 26,232,104,175,124, 49,232,209,106,161,225,214,219, 7,163, 69, -170,149,225,209,136,241, 28,144,180,132,161, 69, 21,246,149, 78,128,106, 29,229,243, 44,152, 92,243,232,169,150,118, 47,187,120, -107, 69, 38,229,121, 35,248, 75, 48,102, 55,102,118,125,160,188,242,175,247, 70,228,161,180,216, 32, 50,130,175, 29, 77, 16, 92, -126,170,162,118,182, 43,223,172, 6,231,189, 11,236, 9, 68,246,214,230,199,107,254, 94, 53, 16,173,226,122, 7, 77, 58,172,217, - 61,155, 33,177,195,190,218, 38,183, 46,221, 53,175, 25,153, 65, 10,101, 42,111,210, 66,210,149, 38,158,177,172,147, 47, 91,114, -166, 55, 7, 5, 35, 2,185,118, 85,221,163,226,187, 26,227, 32,183,164, 80,119,108,134,217,101, 66, 93,188, 93,109,246,216,142, -120, 68, 74,155, 57,168,241, 10, 93, 32, 37, 94, 42,148, 27, 9, 59,135,181, 90,106, 4,155,156, 49,199,226,151,119,113,246, 42, -132,205,112,202,149,127,186,218,237, 90, 62, 34, 70,176,189,193,173, 82,138, 79, 0,181,205, 14,107,243,155, 18,193,203,118,203, - 61,151, 56,139,108,198, 48,235,155, 72,206,237,139,137, 9,246, 47,113,218,121, 72,144,212,123,130,159, 41, 66,144,144, 10, 8, -232, 73,167,110,139,151,247,121, 55,152,155, 60,112, 17, 27,193,210, 92,161,221, 71, 74, 98, 15, 70, 24, 99, 92, 79,112,243,123, - 78,230,109,163,238,197, 27,136,120, 40, 75,144,161,210, 65, 67,213, 80,197,199,241,130,226,100,220, 36,218,237, 24,101,246,101, -201,230, 97, 61,101,182,155,147, 43, 47,111,125, 77,200,110, 84,128,128,196, 85, 33,160, 28,111,121,162,171, 74,141,109,108,182, - 59,147, 27,164,184, 1,160, 56,133, 10,132,112, 32,102,122, 8, 11, 82,207,156,246,236, 99,156,232, 92,113,195, 28,194,241,232, - 32,112,168,107, 59,252, 67,133,230,253,108,188,217, 50,108,199, 8, 93,155, 42, 97,215,228,166, 29,177,184,151, 92,113,215, 7, -139,111,144,235, 83, 28,105,229,199, 31, 49, 74, 20, 61,227, 80,223,103,120, 36,115, 96,100, 82, 53,204,238,174,176,224,228,192, -144,153, 46,117,131,220,188,220,184,184,187, 75, 83,220, 92, 48, 67,143, 7, 98,132, 14,154,185, 79,126, 42, 92, 44,255, 0, 37, -227, 60,103, 8, 75,186,195,151, 96,129, 47, 32,204,219,149, 29, 86,248, 23,121,202,109, 9,140,218, 90, 90,210,225, 74,156, 1, -197,238, 0, 26,247, 13, 87,218,236,219,133,189,185,146,241,141, 18,107,210, 3, 20,168, 69, 84, 33, 71,101,116,253,167,205, 56, - 96,154, 56, 46, 25,169,216, 7, 57,152,180, 19,208, 62,122,185,112,185,171,142,238, 25,157,195, 0, 70, 75, 9,156,170,221,111, -141,118, 93,186, 98,189,208, 74,183, 75, 64,113, 47, 71,113,202, 55, 33, 33, 42, 5, 69, 4,211,191, 72,108,110,115, 60, 65,139, - 85, 48,224,122,250, 43,177,218,115, 37,141,221,195,237, 25, 43,124, 86, 0, 72, 56, 96, 66,225,192,245,244, 83,233,201,173, 58, -210, 93,101,198,222, 66,211, 84, 45,165,133,161,105,244,130, 42, 14,148,199, 17, 90, 0, 67,130,138,108, 78,146,176, 9, 73,235, -232, 3, 83, 24,229,163, 0, 12,105,137,117,185, 34, 27, 78,202,150,180,177, 29,176, 75,143, 58,118, 54, 13, 9,165, 77, 58,144, - 13, 6,167,194,139,137,168,243,220,136,193,197, 42,156,220,188,220,225,234,188, 99, 12, 89, 45,207,220,241,156,186, 30, 92, 45, - 57,124,233, 77,217, 44,142, 94,177, 68,168,173,130,244,130,150,144,149,173, 5,186,184,164,154,210,137, 32,215, 84,187,151, 58, -216,109,130,225,154,203,167,128,179, 92, 77,107,139,192,121,192,160, 4,144,115, 86,168,233, 34,177,119, 28,223,111, 27,154, 23, -222, 84, 36,128, 20,117,213, 88,135,248,128,100,153, 85,246,239, 99,193,241,124,102,229,112,110,220,187,133,148, 79,186,185, 26, -215, 49,232, 5,209, 49,130,234,208,195,165, 44,161, 27,139,129, 52,175, 64, 72,235,168,155,167, 51,221,109, 48,182,226,233,158, - 20, 69,233,145,115,195, 72, 26, 9, 0,144,174, 39, 44,211, 49, 89,103,249,130,178,104,107, 90, 71,110, 29,139,244,210, 79, 27, -126, 36, 13, 95,222,202,221,207,109, 31,112, 61, 99,183, 78,103, 24, 70, 63, 0,187,138,229, 55,212, 26,183, 30, 76,219,131,236, - 24, 36,161,183, 10, 94, 10, 40, 61,148,173, 1, 61,219,114,221,246,201,173, 95, 0,138,104,158,225,226,176,148,150, 56,206,111, -104, 96,118,178, 9, 29,212, 7,137,195, 38,109,249,241,243,191, 84,157,208,214,158,232, 11,168,240, 10, 72,210,157, 56,213,159, -227,111, 59, 60,105,149, 93, 34, 99,153,179,176,184,227, 37,186, 75,141, 22,201, 2,237,122,143, 54, 61,220, 74,105, 46,165, 72, -125,146, 91,106,137, 88, 7,196, 35,175,126,182, 91, 94,227, 22,243, 19,165,135, 82, 49,117, 43, 72, 68, 36,113, 24,226, 43, 81, -182,115,140, 55,100,178, 78,227,213, 16,145,243,213,209,183,202,135,113,140,204,200, 50,163, 77,137, 33, 1,198, 37, 68,125, 50, - 99, 62,217,236, 82, 22,130,164, 40, 31, 72, 58,156,169, 90, 95,140, 18,181, 65, 90, 71,204,242,171,254, 25,102, 77,254,198,196, -103,149,111,146, 22,235,179,172,114,111,214,200, 74,117, 42, 74, 28,146,212, 70,221,121, 45,239,160, 43,216,105,172, 7,153, 59, -131,182,205,181,239,141,117,184,128,141,145,145,188,183, 51,160,188,128, 79, 72, 4, 20,202,179,155,206,231,240, 81,153, 21, 19, -138, 40,244,165, 50,221,229, 62, 67, 23,152, 18,150,246, 18, 57, 89, 88, 69,223, 47,141, 5, 48,231, 12,121,120, 90, 30,130,151, -218, 92, 95,112, 14,170, 82, 95, 83, 65, 13,109, 42, 9, 42, 59,197,104,124,174,207, 49,121,124,216, 62,251,225,102,248,209,116, -203,127, 19, 80, 85, 45,145, 28, 31,226,166,148, 5, 78, 69,201,221, 41,134, 75,249,187,124, 95, 27, 15, 27, 70,164,239, 38,156, -147, 37, 94,175,109, 92,240,208, 58,250, 20,100, 74,137,166,183, 12,110, 52, 29, 79,193,164, 25,147, 26, 2, 50,105, 89,139, 73, - 90, 55, 40,210,189,159,149, 53,158,188,230, 6,219,185, 5, 90,219,237, 70, 80,166,149, 89,136,212, 68,123, 35,218,237,169, 21, - 39,243,107, 29,185,111,111,189, 37, 78, 21,161,178,219, 91, 0, 65, 90,169,192, 79, 85, 31, 71,102,168, 76,149,118, 26, 27,194, -189, 78,206,227, 93, 22,186, 10, 77, 10,148,246,158,218,104,107, 90, 11, 94,169,107, 2,189, 0, 3,179,179, 68, 93, 72,210, 13, - 34,201,184,236, 81, 27,187, 63, 47, 70,144, 93, 82, 25, 2,210,113,187, 82,166,181,245,126, 67, 73, 46,167,133,189, 34,220, 39, - 33,208, 74,122, 30,254,191,209,164, 45, 76,130, 18,218,102,201,115,114,137,175,126,157,107,170,205,140,161,225,118,131,235,209, -151, 82, 36,109, 62,237,135,216, 29,105,217,162, 14,170,249, 91, 78,118,151, 64, 58,247,105,107, 81, 28,213,175, 20,233, 39,183, -166,148, 13, 35, 69, 2,181,250, 14,157, 24,210,218,218, 4,169, 68, 26, 29, 24,198,143, 42, 5,110, 41, 34,132,131,165, 12, 40, - 96,227, 73, 50, 13, 66,169,211,209,167, 67,169,230,210,141,191, 27, 47, 52, 46, 87,167, 13,186,214,145,189, 42, 85, 4,153, 96, -119, 54,138, 19,212,126,209, 20,212,121,239, 27, 0,166,164,186, 12,238,183, 23,123, 7,111,201,105,245,141, 73,142,237, 91,129, - 28, 70,181,178,176, 99,178,158,190,247, 36,208, 7, 28, 36, 13,199,167,193,232, 20, 26,169,109,195,174, 95,142, 93, 21, 2, 96, - 93,139,142, 63, 69, 73,237, 32, 54,217,112,154,157,165, 74, 81,236,232, 62, 13,105,173,173,195, 89,175,141, 82, 72,253, 69, 56, - 85,114,230, 30, 86, 70, 53,109,148,220, 69, 37, 82, 3, 75, 29, 59, 19, 81,222, 72,237,248,245, 26, 66, 73,198,150, 8, 29,214, -215, 11,121,171, 47,204, 57, 63, 34,126, 19,183, 7,162, 88, 24,144, 85, 41, 12,186,166,220,150,178,122, 32,169, 38,180, 61,244, -237,210,227, 1,129,106,238,204, 54, 0, 9,196,215, 73, 60,133,102,248,230, 25,196,151,156,118,241,114,247,140,131, 27,203,239, -150,247, 27,152,245,103, 51,111,144,164,202,136,128, 20, 2,182, 6, 31, 27, 59,169,211,187, 80,173,229,212,243, 32, 11,250, 41, -123,204, 96, 57,160,224, 28, 1,237, 81,245,213,102,243, 81,202, 86,217, 55, 94,106, 79, 27,100,152,173,135, 25,146,221,138, 86, -123,239,205,189,114,136,247, 45, 72,109,104,255, 0,213,236,176,243, 40,247,167,173,200,142,171,134,245, 80, 4,176,105,185, 75, - 37,153,173,204,178,181,200,125, 31, 46,218,155, 97,127, 29,189,177,108,205,212, 73, 70, 3,254, 81,153, 39, 48,133, 17, 58,235, -143,113,108,248,237,250,229,114,148,236,152, 87,183,193,109,171,132,167, 98, 34, 57,126,225, 25,180,133,188,218, 5,124, 48,225, -233,182,167,179,180,235, 71, 4,142, 99, 64, 53, 65,113,114,230, 59,186, 52,142,129, 87,227,201,191, 42, 91, 56,135, 35,190, 99, -215, 39, 3, 24,198, 72,109,107,125, 72, 63, 71,108,184,182, 84,211, 78,237,238, 11, 11, 8, 95,254, 78,159,120,241,154,167,133, - 21,181,225, 99,187,217, 26,236,189,182,237, 30,108,118,101,197,121,183,227, 72,109, 46,178,243, 74, 11, 67,141,168, 84, 16, 71, -110,153, 0, 10,183,212,180,226,143, 50,180,162,168,125, 63,144,208, 45,165, 7, 83,142, 44,205,201,234,122,142,255, 0, 79,230, -211,101,180,135, 49,104,202,167,157,164, 87,210, 43,249, 13, 36, 49,105,135, 66,133,105, 38, 77,193, 77,214,138,175,109,127, 42, -105,198,198,180,244,113,131,141, 33,187,112, 82,137, 85,123,251,191,205,167,155, 24, 21, 53,161, 40,153,154,189,244, 29, 71,102, -164, 70,193, 76,206,252, 40,251, 47,110, 0,252,116, 58,184,183,184,116, 57, 26,161,184,183,108,217,209,148,186, 43, 67,249,126, -109,105,109,119,124,129,172,173,230,204, 10,145, 70, 82,186,211,211,171,232,222, 37, 10, 43, 47, 60, 38, 7, 33,161,211,215, 70, -112,166, 18,182, 3,242, 58, 73, 52, 97,171, 66,132, 15, 64,249, 52,141, 84, 90, 43, 10, 7,163,243,104,106,163,209, 65,237,169, -160,244,233, 69,225,161, 77, 40, 71,168,160,164,252,219, 36,141,136, 98,146,230,174,231, 10,206,250,208, 90,139, 50,106,219, 75, - 66, 82,129, 32, 4,186, 82,151, 9,165, 2,107,174, 73,204,187,169,123,222,224,224,141, 5, 23, 1, 91,187, 56, 99,219,173,188, - 73, 28, 27,214, 83, 63, 77,115,219,144,188,250,221, 98,226, 55, 54, 48, 75, 13,178, 30, 87,106, 17, 25,202,100,101,211, 91, 77, -158, 28, 55,228, 52,194,148,218,218, 67,172, 43,122, 86, 87,237, 45, 52, 3,174,185,110,227,123,105,190, 58,217,146,120,132,185, -235, 27,153,128,212,208, 85, 84,130,133, 19, 35,157, 98,183, 95, 52,153, 30,136,109,162, 37,238, 41,168,145,164,124,134, 53, 83, -121, 47,207,189,151,140,108, 10,180,216,110, 18,165,101,209,219,203,159,185,206,134,194,133,142,241, 98,190, 53, 29,108, 73, 75, - 97,199, 89,125,209, 35,120,100, 39,230,131,211,161,214, 95,147,249, 83,124, 27,132,243, 50, 66,216,102, 44, 30, 25, 32,232,112, - 36, 57, 26,128, 53,186,120,130, 9, 57,227, 88,189,195,159, 78,202, 31, 28, 8, 30,117,174, 96, 16,228, 66,153,102,168,107,151, -188,197,248,135,102,249,238, 39,143,241, 99,118,247,173,184,107,145, 39, 61,117,109,111,169,235,157,193, 83, 93, 90,221, 65,116, - 20, 45,182, 82, 2, 72, 73,235, 94,135,166,189, 25,177,114, 7,242,224,101,184,148, 72,232,220,177,224,154,114,237, 82, 74,215, - 31,223,185,138, 77,230, 8, 89,114,237, 94, 11,137,105,232, 39,167,165, 56, 87, 63,159,230,187,253,183, 32,187,146,139, 52,168, - 76, 20,197,110,219, 62, 48,125,198,218,120, 81,183, 80,167, 18,224, 20,173, 77, 1,239,215, 68,254, 83, 13,196, 45,197,192,230, -163,218, 48, 74,204, 77, 43, 94,141,199, 28, 84, 84,108,215, 39, 74,201,126,251,159, 54,117,195, 29,176, 68, 68, 72, 51,101, 90, -163,120,240,213, 33,211, 68, 41,247,146,134,246,151, 18,213, 16, 7,109, 41, 77, 77,146,201,150, 5,140,104,107,228, 42, 64,113, - 66,131, 52, 4,156,151, 30,218, 83,174, 30,198,119, 59,192,102,122, 22,152,233,231, 9,247, 24, 99, 31,184,189, 21,232, 86,249, -175,190,212,167,223,116, 61, 33,192, 78,197, 47,111, 66, 64,165, 42, 53,100,118,145, 3,252,102,170,144,136, 0, 65, 72, 23, 1, -167, 80, 56,154, 63,103,229,251,152,184,197,118,117,214, 84, 22, 34, 60,195,145,137,132, 36,167,194, 65, 81,220,148, 44, 2,177, -212,142,221, 57, 54,212,192,195,225,180, 18, 65, 92, 83,218, 50,169,240,223, 22,128, 9,174,131, 98, 62,110,216,178, 69,199, 16, -187,222,111,150,198,188,202,125,156,181, 23,139,188, 53,173, 79,248, 73, 98, 59,150, 69,190,135, 93,136, 3, 97, 40,121, 14,130, - 13, 40, 58,107,153, 93,242, 92,151,210, 75, 32, 17,198,246,180,104, 45, 14,201, 84,137, 17, 3,186, 65, 30,154,156,237,201,197, -193,250,203, 95,142, 33,125,184,226, 15,162,167,222, 57,243,149,202, 60,113,147,170,123,124,191,126, 79, 30,177, 21, 89, 5,178, -203, 47, 35,105,246, 60, 22, 93,218, 34,182,151, 26,117,148,173, 46,146, 11, 41, 69, 10,122,210,154,143,117,182,190,120, 24,198, - 68,179,131,164,247, 73, 25,102,113, 5, 19,138,224,107,109,179,249,141,185,109,218, 4, 83,188,233,251, 36,171,125, 68,229, 83, - 22, 63,248,178,115,118, 79, 58,228,194,239, 86, 43, 20,104, 11,102, 68, 36, 92,177,136,114,238, 23,152,207,190,150,246, 32, 52, -235, 77, 13,169, 53, 83,128,251, 34,164,141, 61,184,236, 76,218,152,215,185,154,149, 65, 32,184, 6,144, 23,136, 39,176,113,173, -247,245,147,121,126,146,209, 17, 43,142, 9,135,166,152,252,185,231,247,145, 50,249, 23,152,207,242,221,166, 87, 29,230,143,218, - 97,220,120,225,168,201, 68,187, 93,203, 23, 37,211, 54, 35,232, 71,134, 16, 95, 72, 10,163,129, 74,238,168,214, 74,126, 75,139, -127,150, 25,231,134, 70, 92, 66, 28, 99,144, 56,134,233,144, 38,151, 55, 5, 41,210, 8, 29, 70,169,183, 63, 50,183, 29,193,178, -182, 98, 64,195,186, 48,110,121, 97,143,166,170,229,207,156,108,249, 69,198,254,132,114, 13,146, 28,107, 10, 44, 46, 98, 86, 8, -152,202,221,189,228, 87,112,166,214,168,170,114, 25,240, 35,199, 62, 25,222,242,201, 79,239,244,213,108,188,171, 54,196,216,157, - 29,179,220,231,151,248,143, 50, 13, 12,106, 30,250, 63, 23, 59,253, 35, 30,138,171,183,223, 33,184, 14,153,239,210, 66, 16,215, - 13, 74,122, 58,129,233,225,198,151,175,188,155,109,103, 60,132,152, 89, 70, 33,111, 98,231, 18,217,110,200,238,104, 67, 47,221, -108,246,171,245, 87,113,110,222,210,200, 75, 74,100,141,138,121,110,251, 84,246, 69, 14,170, 99,219,231,221,236,139,229,142, 71, -190, 53,115, 65,118,150,189,204,253,217,122, 1,129, 31,100, 55, 14, 38,163,110, 91,172, 87,174, 93, 77, 76, 23, 20,199,171,178, -151, 25,205,108, 83,177,220,147,152,243, 86, 37,220, 45,106,184, 28,103, 20,131, 49, 47,200,133,159, 88, 45, 46, 58,143, 10,230, -155,124,136,206,192, 5, 9, 74,217,117,180,172, 21,116, 39, 73,181,181,115,223, 14,197,103,166, 25,195, 76,210, 72, 51,137,206, - 0,143, 12,189,174,107,202,168, 33,201,134, 34,173,236,111, 98, 16, 27,137,156, 73, 82,139,136,127,106,100,156, 18,171,146, 46, - 86,156,154, 78, 77,148,202,200,236, 56,129,177,218,156,190,219,112,235,188,167,110, 87, 41,238,248,155,154,136,220,137, 36,184, - 14,212,212,135, 29, 53, 29, 0,214,237,155,149,198,213,224, 91, 54, 41, 39,241, 36, 13,116,205, 1,173, 24, 98,226, 27,135,169, -163, 30, 53, 87,107,189, 9,245, 61,231, 73, 82, 64,205,122, 22,175,143,146, 63, 58,249,158, 27,119,199, 45, 89,167, 36,109,227, -164, 90,231, 90,161,227,146, 44,181,177,218, 47, 50, 36,132, 91,225,174, 96, 66, 76, 70,126,144,173,111, 85,123, 19,221, 65,161, -204,215,142,216, 68,239,183,133,207,127,188, 70,165,115,128, 97, 46,115, 24, 78,106, 16, 52, 38,163, 91,238, 94,231, 87,192,230, -137,100,253,154, 16,136,128, 21,192, 19,209,215,192, 87, 74,252,199,230,188,136,246, 31, 43, 53,195,185, 1,135,120,230,240,204, -184, 57, 20,140,118, 99,217, 75,118, 75,147, 75, 66, 21, 17,180,194,117,150,165, 70,115,105,220,181,170,157,157, 5,117,202, 71, - 47,127,238,246,150,187,134,225, 44,211, 68,215, 7,134,152,153, 25, 97,114,227,160,130,246,150,100, 74,246, 85,191, 48,222, 92, - 92,199,227, 71, 33, 49, 28, 28,152,227,209,134, 99,165,107,140, 46,114,223, 47,158, 83,132, 21,203, 16,149,110, 78, 59,115,200, - 26,123, 99,222,232,212,101,202,136,135, 33,123,167,189,120,254, 35,136, 74, 21,224,120,244,246,105,234,212,182,242,198,197,240, -206,255, 0,181,122,120,205,140,185, 6,163,131,146, 69,210,152, 99,222,211,153,174, 99,252,242, 95,137, 93,103,212,126,101, 84, - 78, 11, 95,105,233, 79, 81,211,167,230,215,123,115,171,182,165, 40,197, 98,170, 10, 40,168, 30,174,159,163, 84,251,141,216,141, -164, 46, 53, 58,210, 13, 69, 82,151,183,237, 0, 10, 10, 14,202,107,155, 93,200, 75,142, 53,173,133,129, 5, 20,144,248,167, 93, - 65,115,170, 91, 27, 73,170,125,180,159,108,246,250, 6,145,170,164, 54, 50,107, 84,202,100, 42,181, 58, 26,233,207, 8,209,193, - 57,160,138, 36,129,233,252,169,161,170,155,240,122,104,147,210, 67,181, 74, 85,221, 93, 13, 84,243, 99, 13,166,172,247, 10, 10, -189, 58, 34,234,177,138, 53,166,179,243, 84, 42, 1, 58, 25,212,214, 66,180, 68, 74, 46, 18, 13, 65,233,161, 79,182, 36,173, 54, -149, 30,202,130,116,107, 78,229, 74,240,218, 29, 42,105,215,209,219,160,181, 26, 74,116,196, 80, 64, 29,123, 41,165, 10,131, 32, -165,198, 93,175,193,232,211,130,163, 56, 80,197, 93, 61, 26, 88,194,155, 74, 44,167,168,106, 58,252, 90,117,162,148, 90,162,188, - 75,164,215,165, 43,221, 77, 60, 27, 76, 60, 1, 90, 56,195,135,214, 85, 64, 18, 58,147, 95, 64,209,101, 74,108,131, 42,117,219, -236,209,109, 17,126,243,189,180,195,203, 90, 55,177, 5,246,201, 13, 14,208,181,215,161, 62,132, 17,240,234, 29,205,207,133,150, -117, 26, 91,131, 47,117,133, 7, 79,208, 62,186,136,243, 92,219,223,174,113,160, 33,224,144,252,150, 88,101,180,171,102,225,217, -213, 33, 52, 74, 82,159,131,228,214,126, 73,117,149, 52,184,163, 13, 21, 40,227, 50,152,101,248,144, 88,112, 60,166,219, 74,157, -117, 41, 0, 21, 47,180,164, 1, 64, 40, 40, 14,165,217,142,240, 2,152,152,174, 52,243,202,111,133,136,107,141, 29, 91, 81,225, -213,213,237, 37, 84,167, 64, 6,221,107, 12,189,208,209,149, 83, 22,105,199,141,115,155,157,110, 82, 39,181, 33,152,202,241, 10, -142,213, 10, 19,209, 93, 43,209, 58,135, 35,177,163,129,138,106,157,185,133, 46, 57,102, 66,224,188,182,210,180, 63, 33, 97, 36, -130, 65, 4,213, 95, 6,137,210, 32,169,236, 92,170,156,249,218,227,238, 44,201,167, 98,220,141,141,115,109,215,133,249, 83, 22, -178,207,179, 95, 44,102,227, 62,219,137,242,134, 55, 47,115,204,183, 41,184, 82,162, 23, 94,183, 72,117,239, 1, 85, 81, 27,212, - 8,161, 26,168,219,175, 46, 54,153, 30,211, 31,137, 27,138,225,192,250,141,116,123,104, 32,222,237, 88, 21,160,176, 6,146, 81, - 66,118,166, 4,113,174, 84, 89,243, 94, 77,147, 22, 55, 24, 89,114,120,183,156, 66, 21,226,235,119,132,152,112,158, 10,135, 46, -240,224,118, 66,203,206,184,226,164, 41,199,138,148, 20,233,220, 1, 3,168, 26,216, 68,241, 48,214,230,105, 39,174,179, 59,180, - 48, 64,240, 68,154,156,208,132,162, 12, 50, 76,126,110,218,186,124,109,199, 23, 75, 14, 61, 29,218,189, 38, 66,155, 47,203,125, -234,184,242,150,225,169, 82,141, 58,144,123,116,220,151, 1,107, 19,123,122, 30,250,121,193,102, 67, 79,221, 90,125, 84, 47, 54, - 90,222,158,196,182,160,162,131, 74,126,201, 0,254,125, 73,138,112, 82,145, 28,224,165, 92, 15, 43,222,111,102, 98,238, 39, 19, -203, 36, 61,118,181, 52,191,118,100,151, 0,145, 16,167,160,216, 84, 40,125, 96,145,167,229,181,208, 65,201,167,210,157,117,116, -217,252, 54,224, 23,160, 87, 72, 33,249,155,226,242,227, 13, 73,184,206,134,183,138, 1,247,136, 43, 72,103,120,173, 84,125, 30, -189,110, 45,124,178,220,239,225, 23, 22,193,146, 70, 66,130,215, 2,191,167,170,177,119, 30,103,109,150,115,120, 19,248,140,120, - 40, 67,154,112,253, 29,116,183, 55,205, 31, 21,218,146,246,203,195,211,156,105,178,180, 38, 44, 85, 41, 46,170,134,137, 4,129, -169, 54,126, 81,239, 55,100, 44, 65,160,158, 36, 97, 76,221,249,183,179, 91, 3,166, 66,226, 6, 8, 14, 53, 16,191,231,118,212, -148,202,174, 48,254,240,229, 35,210, 88,218,182,235,251, 94,205, 65,166,183, 99,200, 73, 73,111,253,192, 68,199, 10,196,143, 61, - 24, 65,255, 0,182,197,112,239,124,244,230,199,252,224,113,181,245, 76,177,115,114,117,138, 83,138, 8, 88,146,215,141, 29, 4, -255, 0, 26,123,189,116,213, 22,231,228,158,235, 96,174,135, 76,141, 29, 5, 15,168,214,167,105,243,139,109,188, 65, 48,116,110, -235, 10, 61, 98,167,107,110,113,136,222, 26,109,251,126, 71,104,146,203,136,222,146,153,205,131, 79, 88, 42, 4,107,156, 93,242, -229,245,139,139,101,130, 64,127, 84,215, 71,182,230, 43, 27,214,135, 71, 60,100,126,176,165, 39,114, 76,114, 50, 3,175,223, 45, -109,165, 95, 53, 74,158,216, 7,255, 0, 59, 71,109,179, 93, 76, 81,177, 60,159,213, 63, 85, 70,189,223, 45,162, 10,101, 98,126, -176,166,213,215,152,120,238,193, 29,199,230,229, 22,197, 6,234, 11, 81,159, 18, 94, 37, 61,193, 41,169,214,150,199,145,247, 59, -247, 6,178, 7,246,144,131,219, 89, 75,238,121,219,108, 26, 92,249,154,122,129, 83,236,168,139, 52,243, 91,133,219,237,138,254, -233,188,229,222,236,237, 18,210, 86,202,154, 97,138,138,238, 81, 35,173, 61, 26,221,236, 30, 83, 94,205, 40,248,192, 25, 24,235, - 82,107, 13,191,249,175,105, 20, 68, 89,171,164, 61, 33, 0,169,191,141,185, 42,211,154,227, 86,171,170,167,219,218,184, 73, 97, - 30,249, 9, 50, 82, 28,102, 71, 97, 78,210,119,117, 62,173, 67,220,118, 57, 54, 43,151,193,165,197,128,224, 83, 49, 78, 88,111, -177,239,182,204,152,185,161,228, 98, 20, 96,106, 90,101, 65,194, 5,122, 26, 83, 85,183, 18, 8, 66,212,235,104,140,197, 41,122, - 44,118, 20,176,149,170,189, 43,249,116,214, 47,112,230, 7,198, 81,149,174,179,216, 90,230,106,118,116,162,226, 98,162,168,216, - 5, 59, 21,219, 95,205,170, 33,190,204, 28,164,213,195, 54, 72,222,220, 0,162, 1,132, 58,231,179,214,157,104, 63,205,171,152, -249,160, 53,136,236,234,186,126, 89, 33,218,129,238,208, 83,164,219,236,177,132,187,138,210,211,107,125,136,232, 52,170,212,244, -133,132, 33, 41, 29,164,149, 30,193,170, 77,199,152,164,156,163, 14, 2,165, 91,237, 49, 90,183, 83,250,107,155,254,115,121,171, - 27,178,218,115, 52,228,246,171,114,191,248,115, 62,212,140, 62, 27,217, 66, 20, 46,121, 53,241,148,248, 11,185, 66, 98,142,169, -131,237,144,216, 33, 64, 10,214,167,167, 0,187,190,221, 57,179,113,100, 54,242, 65,240,205,113,241, 3,154, 73,123, 66,133,140, -156, 11,154,161,115,106,246, 86, 7,157,119,102,188, 62, 57, 24,211, 20,100, 34,184, 98,243,210,220,200, 78, 24, 87,207, 55,154, - 31, 48, 22,140,231,145,229, 95,240,100, 92,113,252, 58, 28,171, 80,205,176, 28,126,208,139, 5,166,253,116,132,173,146,157, 67, - 45, 56,179, 36,173, 84, 8,113,194, 85,235, 7, 93, 51,147,246, 25,182, 43, 31,131,186,120,153,238, 46, 49, 77, 35,181,150,135, - 12, 56, 0,192, 63,202,220, 18,184,111, 48,243, 28,114,220, 15, 5, 4, 99, 18, 0, 0, 19,210,156,122,171,157,217, 55, 34,220, -228, 95,175, 63,221,251,171,237, 64,118, 84,192,222, 43,116,148,224,149,106,130,228,133, 22,153,241,158, 10, 10, 81, 64,170,232, -174,193, 67,174,173,177, 89,182, 48,209, 35, 70,173, 35,246,141, 1, 28, 64,196,128, 50, 11,151,178,185,238,239,126,217, 59,224, -230, 78, 28, 71, 70, 60,126,138,132, 50,188,183, 45,207, 93,155, 14,215, 29,171,124, 11, 12, 20, 51,112,153, 13, 6, 35, 66, 59, - 71,105, 11, 90, 0, 73,162,151,237,123, 93,117,185,181,100, 27, 99, 67,164, 42,231, 28, 1,196,173, 82, 54, 64,206, 42,180,222, -183,220,222,179,196, 15, 99,241,225, 94,103, 76,142,251, 50, 83, 46, 90,103,182,219,172, 16,128,241, 65, 77, 18, 61,162, 69, 79, -193, 93, 59, 60,127, 24,228,144,150,180, 16, 66, 4,244, 84, 55,221,146, 81,216, 5,168,202, 12,251,164,184,119,171,122,165,200, - 48, 26,152,220,187,180, 97, 32, 70,182,200,145, 28,168, 35,113,166,210, 82, 86,173,130,157,250,181,185,100,113,201, 27,208,107, - 68,105, 69, 32, 28,253,105,141, 43,226,220,194,139,129,225,210,148,222,201,102, 65,114, 86,251, 51, 98, 42, 95, 87,138,236,118, -156, 50, 16,218,128, 30,205,118, 2, 79, 74,146, 5, 53,105, 6,160, 59,249, 81,155,128,231, 20, 9, 78,187, 5,254, 42,172,178, -158,118,200,228,151, 25,140,235, 98, 74,174, 75,171, 82, 40,118, 56,202, 74, 84,148,237, 52, 42, 73, 7, 85,183, 54,242, 54, 78, -228,136, 9,201, 7,168,210,133,208, 14, 1,212,123, 18,203,109,136,142,181, 94,156,140,220,184,138,241, 16,229, 22,153, 43, 41, - 21, 0,237, 29, 78,234, 80,233,201,217, 34,164, 96,161,163,125,203,212, 34,209,236,123,145,152, 76,245,187,124,140,235,182,117, - 58,183, 90,240, 2,158, 68, 87, 1,232,162,132, 41, 36, 14,189,149,211,211, 66,232,155,251, 50, 3,211,143, 31,101, 91, 50,244, -198, 20, 28,106, 84,182, 93, 32,207,177, 69,200,167,230,208, 93,137, 10, 35,232,251,146, 81,147, 30, 66,253,229,223, 9,184,241, -130, 3,145,247,144,162,225, 14,148,138, 87,169,214, 39,114,222, 37,101,193,181,138,213,250,139,135,124,105, 32, 32, 82,231, 42, - 20,225,221, 83, 87,214,215, 3, 75,159,226, 5, 76,142, 10, 73,224,126,180,167,198, 67,127,196,103,241, 46, 39,118,123, 20,131, -105,122,221, 43,238,167,175,141, 56,152,119,103,228,180,235,139,110,141,182,226, 76,198,212,144,106,224, 69, 83,211,218,214, 94, -218, 75,200,183,137,216,201,220,246,184,106, 12, 56,176, 96, 1,196,142,225,255, 0, 74,227,209, 66,109,204,150, 0,231, 2,225, -129, 8, 20, 99,154,253,170,126,112,126, 81,124,179,114, 21,227,147,184,174,199,122,200,172,248,246, 19,114,128, 96,207,181,177, -121,148,211, 19, 34, 58,212,133, 20, 20,183,244,109,188,165, 44,185,212,129, 78,218,234,131,153,119,239,129,183,138,210,250, 88, -226,158, 73, 81, 85, 27,158, 25,234, 26,139,112, 78, 37,106,101,133,251,173,166,116,182,173,212,192,211,129, 71, 21, 35, 21,195, - 33, 81, 70, 33,203, 23,108, 62,229,116,207,103,227,109, 95,175,215, 41, 83, 49,129,109,184, 91, 66,236,198, 37,217,144,151, 16, - 61,148,169, 43, 3,112,246, 84, 10, 69, 14,173,247, 61,142, 13,193,177,218, 53,225,173,106, 72,113,199,186,112, 62,188,106,146, - 59,199,192,124, 80, 51, 40, 71, 2, 15, 10,151, 98,191,198,145,236,241, 89,228,108,231, 56, 93,130, 56,124,221,177,172,127,221, -220, 86, 58,252,244, 40, 66,247, 86,158, 43, 68,146,219,169, 35,122, 87,223,212, 10, 29, 70,180,240,190, 38, 55, 91,198,211, 35, -149, 94,132, 96,220,212,165, 90, 91,207,105, 10, 9,100,121, 24,168, 31,103,161, 56, 26,103, 60,238, 31,144,113,132, 38,237,119, - 43,133,166,255, 0, 23, 41, 68, 86,160,223, 10, 31,189, 95,109,146, 92, 80,251,201, 96,184,146,223,187,178, 2, 11,109,165, 67, -190,189,117, 99,252,198,107, 91,151, 48, 70,195, 3, 88,174,123, 79,218,224,192, 19,233,244, 83,191,204, 99, 54,202,215, 16, 67, -184,230, 66,231,234,161,230,114,102, 93,142, 93, 12, 6,111,246,121,246,137,141, 91, 46, 23, 24, 54,134, 89,251,146,115, 86, 69, - 4, 55,227, 50,160,210, 20,235,136, 69, 28,222, 42, 65,165,117, 6, 75,123, 93,244,120,242, 68,230,200,197, 99, 28, 65, 15, 26, -135, 2, 20,160, 56,142,186,156,119,199,135, 1,169,174,110, 5, 56, 97,210, 48,196,140,235,160, 71, 55,230,107,103, 13,100,252, -141,134,101, 86,220, 2,195,102,177,174,126,107,199,216,101,253,118, 8, 88,220,105,165, 17,154, 66, 97,221, 30,122, 52,163, 53, - 14, 7, 84,212, 37,173,105, 61, 66, 64,215, 24,218, 57,165,155, 70,235, 22,212,100,158, 83, 43,139, 35,150, 86,248,130, 76,220, -229, 49,180,105,210, 66,106,145,173, 7,166,180, 55, 27,253,211,226,123,237,136,136,180, 43,152,210,128, 14,160, 74, 21,232, 11, - 92,247,254,246,226,135, 61, 51,213, 47, 51, 86, 14,152,105,190, 53, 52,221, 83,253,224,106,226,184,133, 78, 37, 63,234,251, 60, - 7, 46, 41, 67,138, 37,157,222,200,161,237,215, 82,209,119,240, 72,144,252, 94,189, 30,233,209,167, 86, 24,106,247,131, 20,102, -138,114,172,151,243, 39,106,213,168,228,170,191,163,166,191, 69,244, 32, 84, 15, 78,181, 50,200,129,107,214,140, 98,154,112,176, -128,219, 99,176,247,235,157,238,183,102, 87,154,211,217,219,134, 52, 86,142,172,124, 20,233,172,236,146, 41,171, 86, 49, 41, 38, - 67,201, 21,220,122,117,212,119, 58,166,199, 29, 32,190,253, 73, 41, 63, 6,147,170,172, 34,138,147, 23, 37, 66,164, 31,205,163, - 14,169, 2, 32,104, 31,126, 90, 79, 85, 29, 41,104, 24, 1,173,189,252,158,194, 65,244,254, 67, 68, 77, 6,219,209, 9,114, 10, -146, 74,149, 93, 16, 53, 45,145, 37, 55, 31,113, 36,158,163,228,211,162,164, 53,169, 69, 7, 83, 81,220,116,161, 78,229, 74, 13, - 36,146, 63, 46,186, 61, 52,219,136, 20,166,209, 32,246,143, 94,148, 27, 81,158,105, 89,135, 84, 59,244,227, 91, 81, 30,148,175, - 30, 66,137, 21, 58,119, 74, 84,103, 1, 74, 33,194, 71,110,150, 27, 77,225, 64, 45,246,217, 5,111, 45, 8, 66,106, 74,156, 80, - 74, 64, 30,179,169, 49,194,100, 40,208, 73,234,166, 38,149,177,133,113, 0,116,154,108,220,179,236, 70,207, 26, 68,201,151,171, -126,214, 1,220,211, 47,165,231,148,161,220, 18,154,146,117,161,177,229, 77,194,253,237,141,144,187, 30, 36, 16, 61,117,151,220, - 57,174,194,197,133,239,157,165, 56, 2, 9,245, 83,199,136, 47, 7, 55,183, 74,203,156,181, 57, 22,208,212,215,162,217, 4,157, -222, 44,245, 71,166,231,202,104, 0, 66, 15, 65,219, 83, 95, 71, 86,249,179, 99,111, 45,200,219,119, 73,174, 93, 42,224, 50,106, -240, 90,135,176,243, 3,185,134, 55, 72,214,105,141, 80, 19,153, 20,173,158, 77,124, 52,248,109,117,125, 64,150,193, 37, 72,170, -170, 58,146, 54,142,167, 92,234,233,197,199,174,180,241, 52, 55, 10,160,185,142, 80,140,119, 40,142,151,159,105,215, 86,232, 0, -151,104,191, 25,202, 85, 41, 4, 3, 78,190,144, 15, 67,211, 80,116, 45, 78, 99,148, 85,143,225, 44,149,119,121,183, 98,243,137, -241, 26,117, 13, 36, 5, 10, 54, 10, 71, 79,132,234,195,110,247,170, 29,214, 21, 50,103, 55,102,163,219,214,132,148,111, 40,160, - 42,234,170, 1,212,142,159,159, 90,114, 16, 85, 68,134,169, 6, 72,219,119, 59,129, 96,211,115,210, 82, 2, 74,171,184,147,216, -122, 87, 81,230, 8, 22,151,111,137, 74,155,167,241,197,158, 38, 13,244,141,180,169, 10,141, 83,177, 32, 45, 74,167,101, 72, 39, -191, 80, 11, 75,177,169,178, 63,195, 21,195, 63, 58,156, 81,104,156,151,214,243,167,194,142, 74,154,138,164,238, 45,186, 77, 0, - 61, 61,125,163, 78, 90, 93, 24,156,134,158,134,237, 70, 21, 82,248,151,139,109,150,171,123, 82, 24,183,161, 11, 90,183,239, 13, -118, 45, 70,159,187, 94,193,171, 67, 57,144,170,213,101,253,201, 37, 42,227,217,224, 51, 14,210,168,238,160, 0,227, 69, 21,236, - 61,148,233,211,209,210,186,106,103,113,172,172,242, 43,170, 2,205,228,166,199,113,125,164, 80, 63, 42, 33, 1, 13,138,149,128, -146, 7, 74,119,210,186, 93,164,139, 78,193, 34,212, 43,199,140,174,125,241,111,133, 57,185,231,119, 41, 52,219,181,100,158,180, -245,235, 98, 30, 28,192, 42,221,215, 69,162,174,236, 47,121, 16, 60, 25, 77, 45,217, 44,178, 28,142,241,170, 86,244,118,250,169, - 52,161,169, 72,234, 62, 77,116,143, 44, 57,189,220,187,118,219,105,157,255, 0,109, 35,144,174, 77,113,201,221, 64,228,125,117, -204, 60,197,229,214,239,246,198,226, 22,255, 0,220, 48, 40,255, 0, 80, 28, 59,122, 41, 37,251,251, 8, 72, 74, 86, 21, 81,210, -159,230,215,177,160,180,215,141,121, 89,247, 68, 96,105,187, 38,242,143,219, 52,173, 79, 67,211,244,106,206, 59, 58, 64,190, 67, - 73, 42,189, 50,151, 2,194,171,215,176,127,155, 79,252, 17, 53, 38, 59,244,165,136,249, 91,136, 20,106, 83,173, 3,211,217,112, -167,244,106, 59,246,176,236,218, 42, 99, 55, 36,200,210,203,121, 27,239, 36,120,183, 25, 14, 37, 34,160, 41,229, 40, 15,128, 29, - 49,252,181,173,201,131,213, 73,126,230, 79, 19,235,160,191,188, 41, 4,238,117, 75, 30,178, 78,157, 27,127, 85, 68,146,249,120, -209,200,249, 36, 68, 13,213,246,129, 31, 15,232,210, 95,183,184,212, 83,118,180,236,181,102, 74,140,180, 59, 14, 99,209, 92, 66, -146,164,169,151, 75,106, 10, 79, 80,122, 83,191, 85,151, 59, 80,120, 71, 0,123, 69, 57, 21,251,163, 42,210, 69, 88, 91, 23,154, - 30, 74,183,198,143, 13,156,129, 47, 54,192, 74, 16,169, 44, 33,231, 74, 83, 74, 2,162,154,157, 96,247, 15, 47,108, 46,137, 46, -143, 62,130, 69,108, 44,185,255, 0,113,179,104,107, 37,203,164, 3, 79,147,230,231,146,148,180, 20, 76,183, 55,183,105, 86,200, -137, 33,123, 69, 58,214,189,189,186,202, 63,202, 29,169,202, 92,215, 31, 77,105, 7,155,187,176, 64, 30,208,157, 66,164,172,103, -206,156,246, 33,134, 50, 59, 27, 23, 73, 73,112,147, 46, 43,222,236, 11, 71,210,157,164, 84,107, 27,187,249, 33, 20,207, 46,181, -148,177,169,145, 11,143,109,107, 54,143, 60, 39,182,102,155,152,131,220,185,130,152,118, 84,191, 98,243,131,198,119, 2,148, 92, - 85, 58,199, 32,169, 41, 1,246,188,118,212, 79,161, 72,244,124, 26,192,238,126, 76,110,182,216,197,166, 65,212, 80,251,107,160, -237,158,117,109,119, 65, 39, 15,140,246, 40,246, 82, 7,155,124,239, 16,185,112, 20,235,231,222, 86,121,241, 92,153, 2,109,150, - 73,156,235, 82,154,185, 67, 87,138,211,145,124, 6,220, 89,121,178, 43,180,211,229,215,159,249,220, 95,242,238,155,111, 5,193, -239,126,135, 97,131, 65,204,156, 70, 5, 17,106,195,159, 57,138,206, 77,163,198,129,193,225,238, 26, 72, 56,131,158, 9,198,190, - 97, 57,143,152,100,223, 49,151, 50, 27,149,242, 83,185, 93,166,248,221,202, 83,242, 39, 40, 75,202, 99, 23, 93, 74, 27,113,169, - 37, 43,120,194,112,132,237, 80, 36,118, 17,164,236,156,188, 54,251,195, 12, 81, 1, 3,216, 64, 0, 97, 25, 64,164, 16,169,172, - 99,215, 94,103,220, 55, 67, 57, 39, 81, 46,226,167,229,149, 82, 76,207, 46,200, 48,121,207,202,106,247, 98,186,220,114, 8, 49, -239, 55,184,108, 41,187,132,235, 34, 28, 5,239, 17, 11, 0,198,108, 56,224,249,169, 93,123,138,117,175,178,182,139,152, 25,160, -199, 35, 25, 27,139, 88, 74,180, 63,130, 17,239, 18, 7, 82,117,214, 47,117,104,105, 82,236,122,170, 7,147,204,246, 41,184,142, - 87,105,119, 24, 74, 50,171,204,230,165, 68,201,209, 9, 47,136,112,208,165, 21,167,110,194,225,113,213,168, 0,170,128, 58,252, - 26,214, 89,242,140,209, 95, 91,204,110, 8,133,141, 32,179, 82, 41,225,212,128,103,196,214,106,228,185,232,153, 14, 31, 46,138, -138,147,114, 85,170,206,229,158,222,253,202, 85,234,237, 39,197,155,108, 40, 42,139,112, 83,201, 3,113, 35,170,105,182,164, 29, -116, 71, 64, 46, 36, 18, 60, 52, 49,163, 3,196, 37, 68,124,165,167, 81, 32, 55,166,154,121, 53,170,116, 11, 76,155,171,118,118, -109, 37,151,218,110, 65,133, 41, 76, 46,171, 3,216,217,216, 2,149,237, 84,234,210,202,225,143,112,102,189, 93, 11, 74,130, 65, -113,145, 90,139, 93,185,200, 68, 82,212,116, 58,195, 15, 20, 23,146, 20, 8,113,226,123, 85,211,218,167,164,234,244, 64,215,157, - 68,101, 74,115, 0,118, 56,208, 16, 74,161,169,169, 82,208,153, 8, 73, 82,203, 75, 86,210,165, 40, 26, 1,232, 7, 75,115,151, - 1, 72,115,195,206, 20,118, 61,238, 99,211, 39, 45,165,152, 45,190,149,173,150, 99, 43,107, 9, 43, 0,109,160, 20, 30,207, 77, - 54, 96,106, 13, 65,105, 18, 56, 70, 1,245,210, 58, 29,241,220, 42, 74,138,125,157,164,168, 84,158,159,181,208,247,234, 67,134, -138,144, 31,162,140,120,190,238,242, 16,167, 8, 65, 9,173, 62,173, 74,236,168,233, 67, 74,234, 43,228,241, 66,129,141, 24,144, -191, 10,155,172, 23,152, 22,124, 78,235,136,185,112,180, 72, 57, 68,140,122,236,204,228, 91,155,157, 54, 28,152,206,108, 83, 30, -240,178,147, 21,173,139,222,186, 14,164, 14,237, 97,110,217, 60,247,140,189,108,111, 2, 32,246,150,234, 32, 16, 66,170,125,167, - 40, 65, 82,137,110,157, 10,157,117, 54,251,177,229, 69,101, 80, 50,222, 90,198,226, 90,112, 60, 86, 61,206, 35,183, 56,205,198, -118,224,171, 43,110, 54,220,104, 11, 78,226,234,212, 85,182,136, 85, 13, 69, 70,185,251,238,127,245,167, 65, 45,165,132,134, 73, -229, 45, 33,164,144, 53,144, 75,158, 56, 14, 56,142, 20,119,183,143, 96,208, 9,112, 80,184, 98, 61, 61, 21, 13,113,246,121, 19, - 19,157, 25,121, 3, 89, 44,108, 66,247,239, 17,174, 42,196,167,136, 55, 59,133,189, 59,155, 90, 2,214, 75,123, 86,177,244,129, - 95, 22,180,220,199,176,191,122,107,190, 31,194, 55, 17,161,111,136, 21,173,118,106,131, 21, 3, 36,169, 22,210, 27,126,243,137, - 13, 32,228,106, 91, 70, 81, 53,236, 2,237, 17, 28,134,204,251, 22, 85,123,139,122, 71, 30, 50,243,232,186, 91,228, 90, 20, 89, -143, 34, 64,110, 59, 81, 87, 37,108, 37, 41, 10, 77, 74,135, 93,101,157,181,177,251,147,103,146,212,182,120, 99, 44,241,200, 26, - 92, 29,139,154,213, 37,218, 87,129, 68,171,105,183, 43,137, 45,140,109,148, 24,222, 65, 49,142,172, 1, 32,113,249,234, 36,188, -223,172,115,239,176,237,246,155,117,201,184,140,220,130, 55, 79,185,110,147, 61,197, 4,132, 33,237,141,182, 62,137,208,162, 13, - 59, 15,167, 90,235, 43,121,161,182,115,230,115,117, 22,253,150,160, 3,171, 19,152, 74,167,150, 72,217,251,182, 16, 65,196,147, - 78,185,140, 93, 98, 73, 78, 67,110,159, 14,240,222, 44,221,185,119,134,164,211,223,237,206, 56,181, 35,195,240,158, 0,190,148, -158,158,197,123,142,168,224,154, 55, 15,135,145,133,134, 82,237, 9,238,185, 2,170,140,143,109, 56,158, 48, 15, 99,149, 6, 53, -182, 67,126, 68,224,213,237,139, 83,115, 45,115,224,248,147,227,173, 38, 35,238,203,108,123,107,119,194,160,170,148,119, 4,160, -142,238,205, 61,183,217, 58, 16, 97, 50, 22,200,215, 96,115, 9,192, 5,232,201, 77, 60,251,189,110,107,208, 34, 39, 70, 61,125, -116,191,144,243,146,243,110, 63,178,241,186,240,203,101,190,124, 91,236, 39,237,185, 36, 59,188,232,139,131, 1,182,146,199,186, - 72,138,167,140, 23,146,181, 36, 57,226,173,191, 17, 38,180, 81, 26,172,219,249, 44,236,123,132,155,144,185,123,163, 49,184, 58, - 50,198, 16, 92,171,169,174, 77, 96,240,210, 14,147,209, 86, 15,222,153,119, 1,131,193, 26,245, 2, 36, 87, 42,100, 90, 70, 73, -199,170,157,238,114,214, 68,236, 72, 92, 62,172,163, 22, 30,227,134, 92,248,237,139,242, 97,219,147,108,114,197,116,155, 18,232, -238,251,168,136, 36,169,104,126, 27,108,163,114,138,128, 42, 72, 80, 74,148, 13, 3,121, 82,213,143,118,244, 45,229,239, 78,217, -203, 22, 77, 90,218,199, 70, 18, 61, 90, 80,181,229,197, 2, 18, 1, 32,144, 8,148,119, 73, 10, 90,107,102,144,194,213, 65,145, - 33,199, 20, 85, 80, 7, 78, 99,141,126,144, 45, 57,212,124, 95, 30,182,119, 56, 54,189,159, 8, 83, 75,173,185,244,117,175, 95, -209,174,111,185,187,190, 64,173, 93,155, 59,184,209, 41, 50, 54,164,215,169,255, 0, 46,168,158, 42,201,152,211,106, 84,163,214, -181,211, 68, 26,177,138,146, 29,145, 80,127,205,164,233, 53, 57,180,156,227,189,123,126, 45, 44, 54,158, 20, 77,110,245,239,211, -129,139, 74, 90, 8,200, 35,160,174,150, 35,165, 7, 81, 41, 18, 10,186, 18,116,161, 29, 56, 30,148,152,226,199, 94,190,186,159, - 70,158,100, 36,208,241, 82,139,183,113,134,157,234, 84,184,224, 54, 9,112,151,147, 68, 1,218, 79, 93, 88, 55,106,157,200, 4, -110,199, 44, 14, 53, 5,251,180, 13, 4,153, 25,134,120,140, 43,213,228,214, 24,205,120,239, 93,161, 33,190,208,175,120, 73, 4, -124, 93,117, 62, 30, 89,190,153,250, 27, 3,245,126,169,170,169,249,166,194, 6,107,117,196, 97,191,172, 41,188,239, 46, 97,209, -217,148,234,103,151,215, 21, 91, 18,203, 72, 37,114, 9,253,206,157,158,189,106,237,124,173,221,103,123, 26, 99,210, 29,196,240, -237,172,101,231,155, 59, 69,187, 36,112,151, 81,110, 64, 15,123,178,163,105,252,235,121,114, 90,151,107,131, 17,136,105,249,168, -147, 87, 29, 95,172,145, 74,107,168,109,254, 76,218,199, 18, 92, 72,226,254,145,128, 21,200, 55, 79, 60,238,223, 50,219, 70,193, - 31, 67,177, 38,138,127,204, 6, 82,210, 19, 88,246,212,169, 36,213, 69,162,119, 3,217,211,187, 86, 13,242,107,110, 95,122, 68, -237,170,119,249,229,185,162, 6,198,189,148, 5,195,159,243, 41,176,214,196, 99, 6, 27,139, 66,146, 95, 97,175,164, 27,187,197, -107, 77, 75,180,242,131,109,182,144, 61,218,220, 7, 2,112,168, 23,158,117,238,151, 81,150, 55, 67, 73,226, 6, 53, 22, 94, 51, -204,186,254,218, 90,184,223,103, 60,134,211,179,194, 75,165,180, 17,235, 9,165,117,182,219,185, 78,195,104, 37,208,192,208,122, - 81, 77, 97,247, 30,114,220,119,116, 19,206,242, 7, 5, 74, 85,227, 44, 42,103, 32,102, 22,140,117, 42,146,150,165,201, 74,231, -201,109, 30, 41,137, 1,175,105,231, 72, 61, 61,148,131, 74,158,218,106, 55, 53,239,177,242,213,140,183, 78, 78,232,192,116,187, -128,169, 60,171,182,203,191,222, 71,110,213,239, 28, 79, 64,226,107,176,182,120, 16,236,118,104,246,104, 44,162, 61,178,215, 1, -152,113, 88, 39,216,101,136,233,160,170,168, 74,148,123, 84,125, 58,241, 29,237,244,155,148,178, 79, 49, 87, 56,146,123, 77,123, - 34,206,198, 61,190, 38, 67, 24, 70,180, 32,170,249,201,247,103,204,103,132,109,136, 82,144,229,124, 83,225,178,134, 80, 9, 53, -168,253, 31,175, 84,114, 53, 77, 79,214,149,198,174,123,205,221,178,223,219,152,100, 45, 75,142,250,138,158,105,101,181, 33,229, - 26,215,113, 73,219, 82, 43, 95,136,118,106, 77,189,169,148, 84,184, 30,184, 85,147,242,197,203,182,189,141,123,179,232,121,217, - 81, 26,147, 40,151, 74,202, 94, 80, 35,169, 35,243,159,211,164,193, 17,137,229,105,155,204, 5, 91,124,187, 51, 98,116, 7, 92, -247,128,162, 27, 7,161,165, 18, 69, 71, 78,222,181,252,142,175,227, 26,133, 81, 72,234,164,185,215, 36, 59,143, 60,185,172, 58, - 75,205,170,173,164,246, 35,101, 61,163,208,210,154, 83,217,168, 37, 63,107,157, 52, 37,121,216,113, 80,152,129, 62, 99,173,150, - 27,109, 5, 43, 27, 27,241, 13, 59, 59,143,203,166, 77,169, 13,169, 83,196, 95,149, 84,142, 68,204, 81,203,215, 97, 14, 43,254, -240,183,164,175,113,108,238,165, 13, 13,105,233,169,166,170,159, 9,137,203, 81, 67,204, 1, 77, 63,177,108, 29,139, 93,173,134, - 75, 69, 30, 11,116, 1, 66,181, 9, 61,135,167,117, 63, 42,234, 76,110, 35, 58,166,187,186,215, 65,228,208,221,139,107,125, 76, - 39,105,105, 85, 2,157, 77, 69, 61, 30,141, 9, 38,170,114, 84,215, 60,185, 15, 40,152,214, 78,219, 46,186,169, 18,146,249,140, -148, 87,219,110,189,135,211, 77,180,249, 53, 50,213,186,155,135, 26,155, 11, 48,169,191,136,240,151, 23, 38, 60,244,161, 74, 80, -117, 46,110,240,234, 20,149,131,210,187, 64,232,117,125,227,248,109, 13,164,203, 45, 90, 44,134, 26, 45,141,177, 64,219,106, 66, -208, 22,182,233, 68,111, 30,201,246, 83, 90,247, 30,221, 63,107, 62,186,140, 30,106, 25,203,236,202,128,227,119, 88,201, 66, 45, -211,149,179,232,148, 84,150, 38, 4,213,105, 34,131,104, 95, 85, 39,227, 29,218,246,175,147,156,241,252,254,207,224,231,114,207, - 8, 69, 63,105,156, 15, 89, 25, 31, 71, 77,121,123,205, 14, 88, 59, 61,215,197, 66,212,138, 66,184,112,119, 17,233,204, 84, 99, -114,148,173,132, 33,213, 86,157,180,215,116,183,119, 72,174, 79,172,210, 27,115, 20, 5, 9, 91,138,173, 71,229, 77, 78,160,102, - 34,150, 35,186,235,137, 21, 74,146, 79,113, 29,159,155, 72, 36, 10, 31, 22, 69, 42,199,241,145, 82, 86,162, 61, 3,187, 77, 61, -193,220, 40,141,217, 60,107,199, 94,120, 26, 32,145, 95, 86,141,168,148,217,185, 60,107,120,225,110,246,184,160, 79,196, 52,151, -188, 55,133, 23,196,154, 80,106, 75,177,142,208,225, 32,119,234, 36,132, 59,133, 41,183, 38,148, 99,222, 20,210,130,222,146, 24, -108, 41, 32,173, 74,218,145,184,208,124, 21, 58,169,190,150, 43,102, 25, 36, 32, 52,102, 73, 64, 61, 38,164,178,228,187, 1, 78, -171,150, 64,140,127,197,110,238,226,161, 60,212, 22, 39,210,228,251, 86,196, 63, 26, 87,213,169,149, 72, 91, 97,224,178, 41, 84, - 86,157,250,226, 27,191,158, 28,181, 96,255, 0, 13,183, 30, 43,181, 57,169, 19, 92,244,115,115, 14,210, 14,147,208,169,211,149, - 91,218,217, 79,114, 11,130, 0, 58, 72, 31, 61, 50,114,254,112,196,113,249,152,235,152,219, 57, 30,109, 59, 31, 91,147,121, 10, -201, 96, 97, 50, 96, 74,182,203, 12, 22, 98,176,242, 91, 81,105,228, 44,148, 45,197, 81, 34,166,134,180,215,157, 55,191, 58, 55, -254, 96,184,184,100, 14,142,194,217,224,182,217,242, 15,218,106, 11,223,123, 92, 80,180,132, 33,161, 79,109,105, 44,163,181,180, - 45,241,129,144,230,228, 56, 17,208, 58,250,233,151,111,230,172,114,250,205,165,187, 85,129,201,119, 91,173,222,251,118,182,195, -191,201,144,238, 73, 96,134,166,217, 82, 4,135, 17, 32, 54, 83, 1,198,214,218, 15,187,157,201, 39,173,123,112,214,222, 99,115, - 46,203,184,182,235,113,189,116,177, 65,225,234,107,116,136,165,112,212, 59,163, 78, 26,193, 4,247,176, 32, 97,209,101, 45,197, -156,150,238, 17,177,161,196,187,134, 45,110, 7, 53,225,217,136,166,119, 42,115, 14, 66,244,196,218, 49,236,139, 27,189, 89,101, - 74,143,107, 92,119,110, 78, 77,183, 89,174,228,120,107,144,182,219,171,227, 98,150, 65, 1,161,211,183, 90, 14,105,231, 81,206, -183, 14,187, 49, 79, 28,110,136,105,141,218, 91,222, 76,116, 47,116,245, 18,236,241,168, 77,149,246,205, 17, 50, 65,165,115, 11, -199,170,185,141,157, 53,121,206,121, 14,247, 3, 55,204, 18,219, 31,120, 79,110, 70, 96, 24, 38,215, 5,152, 44,149,186, 17,109, -105, 13,186,132,149,128, 18,189,131,182,166,167, 81,101,221,227,218,237, 27, 45,156, 4,188,181,191,179, 41,169,196,148, 11, 38, - 45, 41,143, 19,213, 84, 59,173,236,178, 75,226, 60,234,225,130, 3, 85,229,252, 85,188,135,141,166,101,205, 94, 37, 33,155,125, -206,117,173, 45,190,210, 3, 87,119,160, 46,137, 83,105,109, 33,214,155, 40, 80,220, 94, 61,189, 6,165, 55,118, 54,155,152,180, -115, 26,165,129,216, 47,117, 70, 42, 78, 4,168,251, 53, 95, 35,131,163,105, 39, 30, 11, 81,214, 47, 20,220,173, 55,103, 25,184, - 90,161,185, 25, 45,181,115,102,115,187, 94, 84, 71, 73, 63,234,205,169, 14, 23,105,179,105, 32,141,106,100, 99,124,104,218,230, -184,140,218, 71, 79, 94, 73, 85, 83, 75,221,192, 98,112,255, 0, 26, 59,112,202,230, 98,183,137,119,204, 98, 68,123,147,204,227, -178,108,209,247,176,137,126, 16, 90, 72, 47, 33,208,216, 73, 83, 68,252, 62,189, 91,199,182, 55,113,137,177, 76, 11, 70,176,227, -138,122, 19,174,169, 91, 0,187, 5,146, 12, 21,106, 34,157, 42,255, 0,122,177, 59, 46,226,183, 92,247,117, 44, 62,235,181, 43, - 42, 52, 36,170,163,182,186,210,193, 4, 86,207,210,192, 42, 88, 12,129,232, 48, 6,153, 66, 29,216, 67,115, 98, 82,136,201,250, - 77,206, 81, 75, 75,106,253,154,145, 94,148,175, 77, 88,153, 3, 8, 90,124,189,139,215, 72,110,180,235,104, 75,174, 62, 23,188, - 83,110,234,208,246, 39,226,233,167,195,131,176, 20,224,112, 57, 10, 42,148,185,179,216, 89, 59, 72, 90,138,122, 3,234,210,193, -233,163, 80,184,138, 51, 41,106,100, 33, 73, 4,149,128,119, 38,181, 71,103,119,249,116,128, 23, 42, 40,209,234, 40,234,148, 95, -247, 97, 33, 11, 8, 90,146,149, 37,190,213, 33, 94,131, 78,154,134,233, 11, 28,116,162,165, 28, 77, 12, 5, 51,169, 99, 16,203, -241, 76, 91, 29,188,219,156,197,163, 78,201, 47,196,219, 88,200,111, 10, 84,152,152,236, 34,226, 8,125,134, 90,218, 86,224, 72, - 32,238,233,234, 58,204,238,187, 53,222,237, 44,114,137,220, 34,103,123, 67,112, 47, 41,145, 39, 33, 79, 49,192,148,112,194,159, - 16,113, 28,159, 34,121, 57,110, 59,143,217, 50, 59, 70, 47,108, 66,110,192,178,126,238, 75,146,247,108,113,246,137,108,171,170, -183,109,238,244,107, 48,119, 75,125,189,142,180,185,150, 72,164,145,253,220,123,216,102, 26,113,236, 90,144,231,113, 64,131, 10, -108,227, 25, 4,167,230, 93, 97, 94, 34, 65, 16,174,171,126,223,109,117,183,125,218,199,141,220, 37,186,126,153, 8, 0,163, 98, -122,212,118, 83, 83, 55,139, 40,227,100,111,132,187, 91, 0,115,176, 87,200, 0,200,156,214,155, 23, 37,174, 76,232,205,186,231, - 35, 21,186, 41,139, 85,199,222,229,216,101, 74,122, 36,219, 83,228, 69, 67,205,116,109,214,214, 18, 21,245,134,169,219,168,243, - 68,221,222, 32,110, 25,221,144, 0, 90,225,138, 28,193, 29,153,209, 50, 99, 27,181,176,161, 28,105,163, 54, 84,187,133,197,235, -198, 64,244,207,189,102, 92, 28,154,229,201,226,165,169,231, 86,165, 41, 74, 80,219, 82,165, 19, 94,221, 88,197, 19, 45,227, 16, -192, 6,128,212, 13, 28, 7, 1,217, 68,233, 29, 51,139,156, 85,113, 61,180, 28,169, 15, 70,247,185,109, 93, 81, 45,110,190,134, -154, 10, 74,154,148,170, 18,173,197, 6,187,133, 7, 90,233,200,155,226,105,105, 98, 97,232,245,211, 1,161,184,181,104,229,247, - 45,151,124,102,219, 28, 8,204, 27,125,189,182, 84,220, 72,169,136, 30, 82, 9, 82,137, 41,249,234, 85, 42,165,119,250, 52,157, -191,108,109,158,179,137,212,226,113, 43,254, 3,160, 82,137,210,135,133, 60,101, 92,160,218,224,162, 94, 44,110, 15,253,237, 99, - 49,242, 22,167,198, 67,222, 18,222, 78,215, 66, 10,219, 40, 80, 87,106,104, 42, 59,142,168,237,173,228,187,144,199,122, 26, 52, -200,172, 45, 36,101,150, 71,244, 26,122, 43,147,108, 8,102,100, 17,232,168,195,100,127, 20, 57,225, 43,193, 41, 39,221,188, 78, -165, 34,157, 55,108,237, 30,141,106, 21,201,167,138,210, 23,141,126,156, 24,199, 42, 66, 17,145, 30,252,226,219,146,130, 18,153, - 8,111,122, 28, 71,165, 84, 29, 14,149,189,114,140,142, 37,214,225, 65,225, 94,170,229,207, 48,225, 12, 12,188, 36, 56,113, 3, - 62,218,117,191,204, 56,188, 96,148, 33,233, 47,238, 7,171, 76,244, 73, 30,154,211,183, 92,246, 95, 45,183, 11,183, 18,141, 29, -166,183, 7,205, 93,174,212, 0, 11,157,216, 40,131,188,183,140,186,219,138, 14, 73, 74,208,146,160,133,179, 66,225, 3,176, 31, - 73,212, 25, 60,174,220, 67,128, 70,161, 57,174, 85, 46, 47, 54,118,167, 2, 85,192,129,146,103, 77,233, 92,175,143,135,154, 66, -139,225,167, 25, 11, 83,161,189,193,167, 15,236,145,219,165, 15, 42,247, 7, 49,206, 26, 84, 20, 1,115, 29, 34,164,197,230,246, -212,217, 26,211,171, 73, 10, 74,100,122, 13, 33,204,229,252,109,149, 16,129, 45,238,159,178,213, 43,242,233,235,111, 40,183, 25, -189,226,198,250,105,249,188,231,218, 97,247, 67,221,216, 41,155,117,230,230,146, 74,109,118,226,175, 67,146,151, 79,252,208, 53, -169,219, 60,150, 92,110,166,244, 55,235, 53,153,221,124,246,107,112,180,129,122,220,126,129, 77,135,185,194,236,165,251, 17, 33, - 55,210,155, 72, 42,235,173, 28, 62, 76,216, 52,119,164,121,245, 86,114,111, 60,183, 7,158,236,113,129,233,164,231,121,163, 33, -169, 82, 4, 48, 9,249,190, 13,104, 53, 61,158, 79,109,128, 33,215,235,168, 78,243,183,117, 85, 30, 26,118, 82, 28,222, 98,200, -221, 90, 92, 76,136,237, 37, 0,251, 45,178, 0, 85,125, 58,159,109,229, 46,213, 16, 45, 44,113, 94,147, 80,238, 60,230,221,230, -112, 33,237, 9,208, 48,166,180,158, 69,200,103, 23, 82,237,210, 74, 80,237,106,132, 43, 98,104,123,133, 0,214,150,207,144,246, -203, 45, 37,144, 49, 71, 18, 22,179, 87,222, 99,110,183,161,193,247, 15, 67,192, 20,166,163,183,169, 1,106, 1,247,143,137,209, - 95, 72,125,170,250,125, 58,213, 55,111,143, 14,232,195, 44, 5,100, 31,187,200, 87,190,113,207, 19,141, 39,174,107,235, 53,113, -106, 8, 31, 52, 87,166,165,182,221,163, 32, 22,160, 73,184, 20, 69,162,130,230,150,149,178,133, 68,158,209,233, 63, 22,164, 11, -117,168, 82, 94,245,208,114, 47,107,101, 91,118,158,193,215,242, 26,122, 59, 80,234,131, 37,245, 18,122,246, 94, 27,104,123, 63, - 46,237, 60,219, 96,218,140,235,197,163, 49, 39,211,162,138,138,143, 96,175,119,201,164, 73, 24,162, 19,151, 83,142, 16,241,246, -251, 10,234,106, 72, 29,159,155, 85,119, 18, 6, 85,140, 0,186,186, 41,229,159, 16,143,142,227, 71, 44,145,226,162,126, 85, 33, - 80, 99, 5,251, 40, 22,120, 11,234,164,128, 42, 75,175, 36,252, 73, 4,107,201,222,115,115, 33,190,188,101,131, 8,209, 22, 39, -245,136,250, 7,207, 94,167,242,111,151,133,165,171,175,222, 14,169, 48,111,234,142, 62,147,243, 85,178, 83,209, 68, 55,222,120, -161, 40, 9,240,146,216,232, 18, 19, 83,215,160,161,235,215, 92,134, 36,112, 36,215,101,126, 6,170, 87, 48, 93,216,105,167, 35, - 68, 10, 83,142, 52,165, 2, 9,216, 2,255, 0,201,211, 81,221, 24, 38,153,115,235,141,158, 98,113,201, 50, 90,155, 32, 54,165, - 62,181, 44, 36, 87,113,218,107,220, 71,168,118,106,210,207, 3, 75,134,109, 38,170, 39, 0,114,118, 99,142,114, 83,216,196, 11, - 37,246,252,171,145, 74, 34, 64,176,217,164,222,110, 65,109, 47,104,163, 12, 54,226,138,106,105, 93,189, 15,110,172,110, 44, 90, -224, 30, 42,117,193,241, 89, 93, 86,185,179,205,214,188, 38,225,152,222, 56,199, 58,181,217,225,193,114,116,217,119,155, 19,246, -145, 6, 43, 73,220, 84,235, 82,146,211,192, 4,246,146,142,157,253,154,142,217,226,137, 3,156,139,134, 69, 61,104,149, 72,235, -119, 60,224,158,177, 92,239,205, 57,222,217,124, 90,143,191, 33,105,116, 16,149, 21, 2,149, 10,244,244,244,213,147,173, 73,167, - 33,140,199, 80, 69,207, 36,180, 78,144,143, 21,246,220,241, 42,154,165, 67,180,142,148,253, 58, 79,130, 90, 48,169, 65,198,164, -174, 60,200,108, 22, 9, 45, 63, 86,211, 78,174, 40, 16, 9, 36,250,105,221, 93, 65,158, 18,120, 84, 11,176,100, 21, 97,164,114, -181,165, 13,151, 83, 49,162,132,161, 73, 82, 80, 71, 85, 30,149, 35,215,219,170,185, 24, 69, 81, 62, 2,106,187,243, 15,153, 91, - 54, 59, 96,148,191,122,142, 36, 46, 45, 22,146,174,136,121,173,167,243,154,215,224,211, 76,182,116,206, 74, 56,236, 12,135, 42, -167, 28, 83,110,189,114, 94, 68,238,123,118,222,211, 51,222, 83,150,248,110, 36,143,245,116,212, 5, 16, 71,120,249,189, 59, 53, -161,142, 33,110,208, 58, 42, 76,236, 16, 13, 34,186,119,142, 93,109, 56,173,186, 35, 13,173,148, 61,225, 35,112, 4, 84,184,160, - 8,233, 79, 94,171,102,156,185,216, 85, 65, 5,212,165,125,184,253,225, 24, 72, 39,196, 47,168,146,164,138,182, 8, 6,128,138, -122, 8,212,235, 57, 80,165, 22,138,214,221,107,103, 33, 98, 86, 39, 53,214,152, 55,214,146,139,124,153, 40, 10,102, 37,221,170, -169,149, 41, 84, 10, 72, 82,189,149, 31, 65, 58,232,252,151,204,238,229,109,194, 27,214,169,107, 74, 56, 14, 44, 56, 56,125, 35, -172, 10,206,115, 94,196, 55,235, 25, 45,202, 41, 29,211,208,225,149, 87,203,222, 39,112,182,207,153,106,156,202,227,220, 45,210, -159,133, 49,133,123, 69,169, 17,212, 80,177, 81, 80,104,161,218, 53,239,203, 13,238, 59,232,153, 52, 68, 22, 61,161,192,244,130, - 20, 87,141,238,236,159,106,247, 70,240,142,105, 32,246,138, 72,110,200,184,224, 40,160,149, 3,218, 83,223,242,106,209,183,225, -213, 87, 35, 13, 31,109,133,145,213, 6,163,248,105,250,180,102,228, 84, 98, 8,161, 18,230,192,170, 36,147, 95, 70,140,204, 13, - 17, 6,188, 73,241,212, 19,180,164, 14,210, 7,110,146,110, 52,210,113,175,102, 61, 18,209, 25,201,179,204,132, 71,104,178, 22, - 90,140,183,220, 72,125, 65, 41, 86,212, 36,171,104,175, 83, 77, 66,159,116,100, 77, 47,115,130, 12,207, 71,109, 17, 4, 80,229, -112,203, 45, 75, 18,153,247, 89, 3,116,119,157,112, 50,219,225, 68,164,108, 43,218, 23,185, 64,129, 78,211,211, 85,108,230, 91, - 73,227, 50, 50, 86, 22,135,105, 36, 31,181,209,219, 78,104,115,113, 76,233, 53,190, 60,202,111,214,172,171,144,229,223,112,252, - 27, 17,178,217, 46, 38,194,223, 42, 71,114,223, 2,255, 0,145,194, 12, 21, 48,128,219,110, 56, 28,122, 43,187,163, 7, 40,133, -172, 1, 90,246,124,241,243,215,207,136,239,247,177,179,218,124, 84,138,246,198,246,219, 59, 16,197,119,121,205, 36, 2, 3,194, - 56,133,112, 24,229, 91,237,135, 97, 59,133,172,147,181,236,107, 88, 11,181, 59, 45, 65, 21,128,128, 78,163,193, 80, 30,154,173, - 60,165,204, 88,221,170,215, 26,209,155,227,185, 30, 87,105,137, 14, 69,139, 20,200,226,205,102,218,221,189,219,210,155,148,230, -224,218, 10,110, 9,108, 33, 65,146, 74, 67,117, 29,224,235,156,237,187, 93,222,227,116,235,171, 89,227,142,119, 16,249, 90, 65, -113,112, 96,210, 10,147,220, 39, 13, 89,234, 78,138, 31,204, 96,115, 11, 12,106, 17, 1, 56, 56, 21,197, 80, 98, 58, 58, 42, 23, -184,227, 48,237, 57,213,142,205,113,203,114, 28, 74,102, 66,212, 17,149,221,239, 86,229,218,154,134,137, 40, 15,182,235,239, 70, -113, 74,150,132, 33, 45,157,205,181,183,190,186,209, 75,230, 28,151,219,100,143,101,188,115, 54, 50,124, 48,215,107, 46, 67,165, - 26, 28, 59,139,142, 5,203,194,171,226,128,153,124, 39, 63, 66,166, 39, 16, 61, 84,215,155,125,141,142, 92,227,199,151,105,180, -222,242, 5,201, 46, 48,229,218,227, 33,248,183,108,116, 56,165,123,110,160, 50,252,114,250, 91, 14, 52,164,154,168, 26, 83, 80, -101,220,164,221, 33,212,201, 31, 28, 73,147, 90,208, 91, 34,112, 5, 67,131, 85, 28, 14, 84,248,119,133, 46,135, 35,135,206, 58, -184,245,209,185,217,246, 9,201, 56,113,182,179,136,225,216,207, 49, 92, 46, 45, 39, 11,200,172,247,121, 54, 40,151,183, 38,169, - 44, 34, 58,226, 45,149,197, 75,190,242,216, 10, 14,184, 42, 61,186,212,157,103,133,166,229,203, 55,130, 87, 92,207, 38,220, 26, -124,102, 57,173,121, 98, 41,213,168, 16,237, 58, 78, 26, 65,232,169,143,255, 0,186, 65, 26,120,132,128, 2,167, 80, 29,171,211, - 85,183, 55,227, 92,223, 5,184, 59,101,206,175, 15,194,207,172,215, 18,156,167, 25,183, 92,155,158,236,243,113,246,148,211,146, -147,189, 13,186,148,109, 30, 31, 84,237, 32,131,174,159,181,111,155,127, 52, 88,182,239,107,102,168, 28, 14,151,184, 35, 90, 27, -147,131,112, 37,167, 28,115, 81, 85,123,133,132,246,146, 24,165, 9, 40, 24,254,154,141, 38,228, 54,200, 88,166, 91,102,198,241, -204,134, 1, 88,178, 92,174, 48,159,201, 91,126,204,153,113,150,231,189, 46, 67, 69,162,181, 23, 10, 82, 16,132,145, 78,253, 20, - 86, 18,220, 93,193, 61,204,177,148,214,208, 67, 8,114, 16, 52,128, 87,134, 42,113,170,127, 12, 1,223, 66,229,195,170,161,252, - 25,219,115,185, 51,114,103,183, 29,152,113,226, 74,145, 61,165,196, 91,130, 83,143,149, 20,180, 67,101, 32,245, 34,137, 36, 13, -111,102,137,222, 22,144, 73,113, 35, 78, 57, 1,199, 26,166,221,166,146, 56,207,134, 10,156, 58, 40,214, 81,155, 62,172,118,124, - 72,120,211,112,172,146,223,114, 3,114, 19,110, 75, 33,130, 84,170,236,112, 2, 14,240, 0, 32,245, 26,189,178,219, 71,138,215, -189,228,184, 5,207, 62,222,202,106,214, 23,184, 53, 93,136, 20,216,195,217,197, 36, 92, 11, 23,150,238, 14, 67, 93,186,105,109, -180,187, 70,125,243,106, 75,110, 56,145, 82, 42, 82,161, 94,186,176,189, 51,180, 3, 26, 42,143, 85, 74,149,206, 67,128, 80,106, - 52,201, 89,145, 26, 75, 44, 55, 45,199, 34, 59,226,172, 84,123, 8, 81, 36, 82,137, 3,160, 29,149,213,228, 97, 27,136,198,151, -109, 35,102, 82, 70, 52,213, 84,100,184,202,147,227,125, 43, 64,172, 36,252,199, 18, 63, 71,168,105,229, 11, 82, 11,244, 59, 1, -133,100, 72,207, 16, 73, 66,219,109, 67,161,165,104, 71,197, 77, 37,239, 12,206,138, 71, 10,221, 77, 58,180,182,141,213, 53, 85, - 67,168,234, 79,163,167,235,210, 53, 33,164, 53,200, 73, 74, 85,183,197,113, 59,222, 95,209,248, 27, 84,144,161,226, 52, 0,244, - 10,106,186,250, 97, 25, 12, 69, 39, 58, 14,126,172,169,255, 0,122,205,165,222,177,188,127, 27,110,217,142, 37,156, 98, 66,229, - 71, 82, 45,233,102,229,123,126, 90,144,146,135, 84, 6,231,128, 61,137,233,211, 89,221,191,104,109,157,196,183, 14,124,131,197, - 8,123,216, 48, 14,129,195,182,166, 7,151,128, 7, 4, 53, 35,242, 13,182,241,199,120,180, 12, 46,109,150,251,129,228,178, 90, - 98,241,153,218,101, 76, 45, 69,185, 11,194, 84,184,133,166, 90,113, 99,104, 97, 64,209,116, 32,116,214,107, 98,187,143,125,187, -117,236, 82,199, 60, 0,150,196,224, 49,110,156, 28,164,140,215,162,173, 47, 29,225, 70, 34,210, 67,179, 35,133, 49,177, 75, 5, -166,250,251, 81, 36,222,125,202,221,105,183, 46,241,123,241, 31, 68,105,142, 70,138,164,133, 55, 25, 11, 27, 28,113, 65,126,192, -173,125, 58,178,222,247, 41,172,135,136, 35,212,247,187, 75, 16, 40, 83,197,196, 98, 6, 24,154,168,100,109, 37, 69, 20,185, 90, - 45, 86, 59,220,247,217,126, 67,214,181, 62, 92,199,150,167, 4,134,102, 70,221, 90, 58,243, 96, 13,233, 73, 1, 65, 61, 43, 93, - 57,101,119, 37,244, 45, 4, 1, 34, 35,198, 72,122,129,225,209, 68,247, 55, 20,175,111, 51,174,153, 58,151,113, 93,186, 44,123, -125,185,136,177,150,220, 22,195, 81, 89, 9, 59, 18,181,146, 55, 21, 44,154,168,232, 91, 67, 22,219,251, 61,100,189,196,156,113, - 61, 56, 81, 52,174, 13,246,211,102,116,117, 73,154,210, 22,227, 37, 45, 4,160, 56,208,163, 73, 80, 20,165, 64,174,172, 98,127, -134,195,215, 72,215,160, 18, 5, 25,135, 14, 3,119, 24,236,221,102, 42, 20, 47, 13, 78, 61, 34, 59, 69,231, 0,108, 31,154,130, - 58,149, 30,154,106, 73,164,240,203,162,106,185,112, 7, 1, 66, 41, 60, 78,202,240, 61, 62,224,133, 49, 10, 68,167,163,196, 91, -206,150,146,106,182,227,119,157,169,244, 39,174,140,248,112,157, 79, 0, 19,130,245,255, 0,141, 44,141, 37, 14, 84, 68,187, 8, -173, 41,247,199,124, 52,182,180,143,163, 59,188, 85, 41, 38,148,236,173, 7,110,159, 71,162,233, 11, 75, 66,169,194,191, 66,196, -228, 5,212, 80,168, 39,215,249, 13,117,131, 2, 26,216,182,101,173, 21,119, 7,181,206,131,208,127,163, 69,225,117, 82,196,212, - 18,175, 64,118, 56,163,241,255, 0, 70,135,129,213, 74,241,232,147,215,125,245,162,141,127, 47, 86,156,108, 32, 81,252, 71, 93, - 39, 42,106, 85,218,178, 62, 45, 62, 26,148, 60,122, 74,145, 41, 32,154, 57, 74, 86,159,149, 53, 33,128,116, 83, 78,184,164, 41, - 10,112,146,226, 87,211,210, 13, 58,124,154,150,194, 50,166, 77,201,173, 26,152,146,146,133,184,191, 64,244,233,194,212,225, 77, -155,147, 68,150, 84,162, 66, 20,174,181,167,175,243,105,208,224, 41, 6,224,154,241,181, 58, 74, 65, 89, 61, 71,200, 62, 45, 43, - 88,166, 93, 59,168,250,253,164,138, 14,190,154,117,209, 7,129, 77, 58, 98,104,187,200, 90,146,145,184,128, 15,181,233,253, 26, -113,178,180, 83, 46,121,160, 21, 29, 11,161, 74,136, 80, 61, 15,167,243,105,193, 58, 83, 69, 77, 2,229,185,231, 9, 90,220,233, -217, 90,119,124,154,112, 93, 52, 83,102, 50,104,187,214,181,246,182,162,163, 78,239,243,105, 66,240, 82, 12, 38,140, 65,130,241, -113, 40, 59,170,122, 2, 71,120,248,181, 26,226,237,160, 84,168, 45,201, 53, 47,224, 88,220,219,246, 65,100,199,153, 4, 57,120, -185,194,183,165,106, 77,124, 63,122,112, 32,171,179,177, 32,212,235, 27,191,239, 12,219,173,229,184,118, 76, 97,119,168, 45,108, - 54, 61,169,251,133,196, 80, 55, 55,184, 55,214,107,174,242,237,145,237, 17,162, 70,138,192, 98,223,102,183,177, 14, 35, 72, 77, - 17, 30, 44, 84, 4, 33, 35,165, 43, 64, 58,235,194, 27,133,204,151,178,190,121, 10,185,206, 46, 39,172,227, 94,236,176,180,101, -140, 49,193, 24, 70,181,160, 15, 64, 74,169, 28,167,207, 54,172,102,223,112,128, 39,178,135,208,226,183, 39,197,246,182,164, 26, -145,223,211,169,166,160, 70,231, 56,160,169,190, 22,170,164,210,188,197,127,124,249, 10,219,136, 89, 25,145,125,159,117,101,166, - 33, 69,183, 52,169,179,101, 73,112,172, 6,218,105, 8, 82,148,119, 2, 79,162,158,141, 91,178, 2, 35, 46,118, 9, 81,164,182, -112, 11, 86, 44,121, 93,178, 53,111,147,200, 94, 99, 46,167, 20,194, 45,237, 34, 82,177,187,108,144,237,226,232,146, 55,169, 18, - 94,105, 43,247,100, 20,244, 82, 26, 37,195,215,218,108,128, 76,139, 87, 53,168, 92, 78, 57,116,154,134, 65, 92, 51,170,219,158, -254, 44, 62, 78, 60,170,160,226, 28, 37,129, 88,162,183, 57,228, 37,225,139,218,155, 98,109,218, 91, 3,106, 23, 41,109,164,200, -148,233, 6,129,111, 45,107,245,234,228,120,142, 29,208,159, 46,154,153, 6,215, 45,215,121,197, 7, 73,250, 5, 85, 31, 51,159, -137,159,154, 94, 89,225,140,158, 62, 27,229,155,152, 49,172, 79, 32,199,238, 15, 28,191, 40,193, 39,227,120,195,182, 93,138,222, -243,115,238, 49,226, 67,112, 40, 3,177, 41, 89, 42,253,144, 77, 53, 3, 92, 82, 60, 54, 73,153,158, 64,169, 94,193, 86, 81,236, -177, 71,139,220, 79, 80, 8, 42,187,126, 14, 60,165,229, 46,227,137,114,108,158,125,198,113, 28,231,149,236,183, 91,122, 49,136, -153,244,118,110,150,219,102, 46,204, 96, 74,227, 66,153,190, 42,156, 84,160,189,206,120,101, 96, 4,138,129,219,103,189,153, 32, - 68, 4,176,181, 48, 36, 99,214,159, 77, 1,104,235,163,220, 41, 86, 63,155,191, 20,126, 44,177,221,166,241,127, 13,241,134, 21, - 50,239, 38,236,155, 37,190,211,139,226, 17, 31,147,113,153, 57,104,106, 59, 17,163, 69,138, 75,203,117,197, 4, 33, 8, 73, 36, -244, 2,186,206,195,179,190, 81,173,225, 27,214, 77, 79,118,212, 64,239, 76,157,128, 85,170,225,111, 39, 87,251,184,135,200,222, -106,240,110, 55,227,172,102,124, 69,220,152,227,136, 86, 24,242,121, 54,245, 38, 83, 96,161, 50,133,185,182,190,239, 8,174,239, - 12, 56,227,181,246, 86,134,205,117, 22,242, 65, 19,116,198,247,131,211,168,167,160, 19,243,165, 82,189,140, 99,136, 7, 88, 28, - 83, 63, 78,103,209,235,169,255, 0, 37,242, 71,229,147,146,177, 41,109,217, 56,223, 33,226,242,181, 58,197,174,248, 23, 54,205, -124, 42,108,109, 15,248, 19, 29, 88, 82, 15,112,117,179, 81,214,154,165,117,220,208,149,108,133,221,184,143,151,101, 41,208,199, - 32,239, 48, 55,216,107,231,203,205,207,225,201,203, 60,111,151, 75,190, 90, 50,100,242,158, 9, 4,170,122,173,140,197, 48,178, -104,241,218, 53,162,152, 78,230,230,164, 36, 84,248, 68, 40,246, 6,207,110,180, 59,110,240,199,163,101,110,135,116,240,253, 31, - 44,106, 35,100,133,189,208,113,168,183, 11,228, 59, 70, 47, 2, 58,158,113,184,190,236,200,103,193, 63, 70, 90, 40,246, 74,104, - 64,166,218,122, 53,117, 42,187, 1, 85,183,118,133,198,155,177,188,194,203,203, 51,185, 86,139, 3, 51,110, 76,199, 17, 91, 83, -144,218, 83,205,182,226,170,163, 82, 6,196,148,165, 95,180,116,236, 59,119,119, 91,170, 24,178, 13, 10,107,165,156,121,126,114, -233,104,131, 6,101,150, 83, 13,162, 58, 82,167, 93, 66, 95, 90,212, 69, 9, 81, 29,149,245,106, 36,145,248, 69, 65,168,143,141, -173,169,101,204,124,161, 41,149, 29, 94, 12,150, 22,137, 12, 21,167,161,216,170,211,168,245,106, 68, 55,137, 76, 57,171, 78,158, -109,195,226,222,113, 60,107,150, 45,145,194, 31,144,227,120,198,100, 25,103,107, 98,235, 29,178, 98, 74, 85, 5, 1,144,211,106, -109, 71,167, 84, 36,245, 36,157,122,115,201,126,113, 55, 16,191,109,149,202, 99,239, 49,127,202, 78, 35,208,113, 29,189, 85,231, - 79, 52,185,104, 91, 78, 46,227, 24, 63, 7,126,176,227,233, 31, 53, 84,153,109,148,145,181, 53, 29,253, 63,163, 94,129,134,253, -166,184,173,197,177, 28, 41, 37,210,160, 74, 82,154, 31,131, 83,155,122,211, 85,174,132,142, 20, 9,104, 43,187,175,125, 19,253, - 26, 95,199, 10,111,193, 52,199,203,179, 27, 77,133,147,110,138,181, 73,186, 58,212,143,125, 49, 36,198,109,118,120,229,179,177, -210, 28, 88,222,189,196, 81,178, 7, 78,181,214, 35,152,185,246, 13,142,224, 91,202, 29,139, 53,106, 24,161, 84, 68,246,212, 59, -155,134, 90,144,210,170,122, 2,225, 85,162,201,207, 23, 12, 82, 92,182,114,135, 69,250,203, 30,100,200,241,229,217,215, 38, 84, -185, 11,109,141,201,113,233, 7,198,105,182,208,165,167,114,146, 8, 20, 52, 26,231, 51,243, 14,235, 13,187,197,172,177, 31, 17, -217,189, 48, 81,138, 55, 5, 32, 98,135,141, 70,115,229,113, 58, 72, 33, 83, 19,151,101, 54, 99,242,221,250, 62, 81, 46, 67, 25, -132, 86,221,185, 89,219,184, 98,214,136,145, 35, 38, 66,173, 44,173, 79,237,125,233,108,134, 20,181, 45,197,109, 1,176,127,123, - 92,199,152,121,178,226,254,216, 67,164,152,154,246,135, 20, 13, 26,219,145, 13,143, 16,132, 41,196,209, 58,119, 34, 18,122, 21, - 50, 52,205,127,204,210, 47,217, 36,227,200,143,221,114,153, 23,120, 14,191, 49, 40, 68, 75, 20,104,236, 41,126, 35, 77,184,228, - 38, 82,204,182,227,148,132,150,125,148, 16, 77,106, 69,117,204,183, 46, 75, 26, 60,107, 68, 99,131,213, 73,115,201, 60, 72,212, - 85,165,217,234,196,213,163, 47, 36,130, 51, 28, 88, 14, 41,199,182,164,219,135, 55,113, 21,203, 22,188,225,249,206, 56,187,141, -191, 17,114,195, 3, 3,133,142,173,171,209,147, 10, 70,229, 50,202, 36,205, 74,219,183,197, 18, 31,250,112,202,247,109, 27, 71, -118,185,101,239, 37,238,194,238, 27,203, 9,244, 62, 77, 70, 98,253, 77, 3,164,150,179, 23,189, 7,119, 80, 69, 42,106,118,213, -127, 27, 75,196,154,139, 72, 40,128,106,212,152,103,193,106,177,115,111, 46,101,173,102, 86,203,176,141,109,111, 19,186, 91,173, -176,112, 77,185, 35,115,216,183, 78,177, 53, 29,151,124, 85, 60, 36, 41, 72, 82,154,232,203,167, 96, 73,233, 67, 93,104,185, 99, -148,237, 91,107, 36, 1,207, 50, 53,206, 51, 43, 8, 46, 15, 46, 33, 52,233,199, 31,121,189,229, 21,109, 14,228, 38,112,152, 49, -161,232, 6, 28, 8,204,144, 87, 63, 85, 48,184,175, 39, 94, 93,200,248,229,223, 41,138, 57, 3, 36, 19, 36,191, 38,205, 5,132, - 55,100,183, 69,140, 92, 81, 50,195,108,180,221, 90,162,148,216, 77, 83, 64, 7,171, 82, 57,194,197,219, 94,217, 52, 54,174,248, -104, 67, 64, 14,113, 37,238, 37, 61,213, 36,227,128, 42,133,106, 86,218,225, 61,192,123,128,113, 85, 56, 96, 61, 85, 44,226,188, -101,100,228,142, 69,207, 49,215,230,203,199,242, 11, 44, 89,215,188, 14,110, 17,141,165, 80,242,233,140, 34,140,194,141, 24,177, - 25, 13, 25, 73,113, 73, 91,251,105, 81,213, 34,186,201,238, 92,213, 55, 46,109,182,183, 8, 36,137,228, 50,102,204,243,170, 32, - 78, 46,115,149,196,233, 69, 13, 92,184,213,132,118, 44,184,154, 80,160, 56,123,186, 70, 7,161, 21, 51,233,166,102, 69,193, 60, -143,137,217,102,222,243, 58, 96, 18,109,153, 50,109,246,172,107, 44, 63,118,228,247,201,209, 83,226,169, 81,210, 16, 17, 35,194, -218,144,241, 10,239,233,211, 93, 14, 63, 49,118,189,194, 54, 67,182, 22,220,120,145, 43,228,139,188,198, 52,225,222,197, 90,184, -233, 81, 76,110,118,242,237,218, 93, 36,111, 4,168, 5, 51, 76,194,250,106,182,103,119,155, 62, 64,126,243,187, 91, 90,180,170, -100,103, 91, 91,246, 68, 37,185, 50, 92,140,214,212, 54,182,212, 82,218, 7,140,146,162,162, 9,169, 58,190,217,173,167,181,253, -156, 78,212,132, 96,236,130,156, 72, 57,146,152,116, 86, 82, 34,208,221, 37,125,227,137,196,227,244, 83, 71, 11,200, 88,199,108, -242, 16,187, 56,150,197,214,228,212, 98,110, 11, 83,234, 67, 14, 20,161, 78,130,132,165, 10, 82, 5, 72, 26,220,186,208,222, 57, - 67,144,181,167, 44, 63, 77,103,183,107,119, 92, 76,214,146,128, 99,133, 5,202, 86,171,101,190,117,179, 31,176,228,208,242,134, - 28,101,251,191,185,198,219, 18,223,101, 68,178, 3, 91,234, 18, 86,226,144, 9, 80,213,158,205,119, 36,140,116,179, 70, 88,152, - 41,196,187,167,209, 79,219, 60,181,186,139,116,240,235, 63,162,152,214,121, 24,197,161,160,236,164, 51,117,187, 62,218,208,210, - 55,148, 51, 8,128, 7,204, 82, 71,137,216, 77, 41, 67,171, 91,129, 53,202,105, 58, 90, 61,191, 85, 78, 58,158, 48,192, 84,125, - 42,209, 36,200,113,126,226,191, 10, 67, 14,190,218,221,120,161,167,146,205, 74,188, 52,132,212, 4,246, 1,171,134, 79,169,184, -156, 70, 20, 78,210,161, 13, 53,211, 21,242,133, 58,211, 46, 60,211, 10, 81,124,182,217,218,216, 2,181, 81, 35,160, 21,161, 39, - 83, 3,154,211,141, 60,224,189,181,179, 82,210,150,211, 13,245,237, 65, 90,220, 91, 85, 4,238, 88, 20,246,169,211,224,211, 82, -176,162,183, 58, 32,173,236,165, 73, 80, 96, 71,132, 36,199, 74,139,239, 36, 2, 28, 41, 82, 89, 74, 72,216,164,169, 43, 59,138, -186,212, 20,244,213,100, 55,178,107, 12,112,192,118,211,132, 40, 61,116,154,194,157, 9, 91,106,117, 94, 9, 66,150,180,132,146, -135, 20,105,236,130, 7,237,106, 69,204,109,121, 4,102,190,145, 76, 49, 69, 59,108,178,237, 22,213, 52,140,143, 27,150,243,114, -223,109,112,238, 16,101,169,135, 34,180,210, 13, 80,218, 54,148,169, 94, 34,146,162, 73,236, 20,214,122,250,222, 91,134,147,109, - 56, 5,161, 11, 92, 1, 82, 78,100,244, 34,138,178,135, 67, 61,224, 74,158,154,120,231, 16,177,187,150, 81,104,122, 61,207, 41, -122, 13,209,152, 34,237, 58,242, 69,194,238,135, 84,148,164,148, 33, 75, 82,150,148, 36, 0,157,202,245,106,143,100,188,186,181, -179,123, 95, 28, 65,204, 39, 64,103,117,189, 56,225,129, 60, 80, 81, 78,224,233, 21, 78, 92,126,186, 43,122,143, 2,215, 10,204, -221,157,249,109, 72,118,205, 33, 23,103,222,141,238, 1,246,202,220, 73, 64, 81,221, 83,225,132,212,122,244,229,157,195,175,100, -121,156, 2, 3,198,144, 10,166, 88,250,232, 73, 27, 24, 1,106,229,143,109, 33,198,176,221, 29,181,195,184, 72,144,203,150,198, -196,151, 32,199, 51, 67,143, 50,219, 95, 89, 70,189,162,144,123,170, 53, 46, 75,232,153, 51,163, 96, 58,240,212, 83, 12,114,199, -141, 67,115,245, 28,104, 7, 66, 88, 27,163, 92, 26, 45, 77,142, 92,247, 85, 56,162,144, 80,104, 55,165, 52, 21, 39,179,166,157, -208,167,188,220, 65,206,137,239,211,128, 5, 41, 42, 94,246,194, 75,133, 37, 73,117, 41,116, 35,176,146, 59, 77, 7,126,165, 64, -117, 96, 7,101, 40,145,144,232,160,223,121,167,136, 75,200,115,199, 1, 72, 73, 65,220,217, 71,104,221,210,181,174,150,214,152, -242, 74, 76, 96,140,178,175,109,210,158,183, 45,197, 68,150,244, 69,202,109,200,210, 93,105, 32,164,197,115,162,146,104, 10,141, - 72,210, 39,141,183, 33, 30,208, 80,168, 7,166,156, 36, 56, 33,173,141,199,253, 96, 57,177,157,161,165, 70, 15,123,175,107,106, -160,223,178,149,175, 77, 35,224,194, 34,156,215, 63,101, 35,194,224,188,107,239,120, 75, 82, 83,181, 39,227, 61,218,235, 63, 17, - 90,109, 85,232,125, 68, 84,184,106,116,161,113, 71,168,209,212, 73, 73, 77, 73,167,167,175,244,105, 38,106, 48,243, 68,223,153, - 74,132,244,244, 30,255, 0,209,165,137,186,104,157, 37, 38, 56,243,198,167,121,235,217, 79,243,105,209,114, 41, 6, 67, 64, 85, -127,182, 73, 31,151,171, 75, 23,116,157, 70,182, 36,168, 0,146,105,223,165, 11,186, 34,234,196,177,191,166,211,211,191, 78, 11, -218, 20,164,204, 36,148,238,161, 20,244,247,254,109, 54,235,211, 65, 40, 64,195, 3,218, 20, 7,243,254,141, 15,140, 52, 90,104, - 95, 9,181, 0, 65, 72,166,143,227, 13, 26, 81, 23,144,128,149,251, 98,189,212,210,133,217, 52,217,109, 38, 40, 26, 38,138, 53, - 79,163,166,158,248,186, 78,148,163, 41,241, 92, 78,223, 16, 0, 71, 90,143,242, 13, 23,197, 1, 71,166,134, 67, 78,161, 73, 72, - 80, 34,159,151,118,144,235,192,148,166,178,149,161,239, 75,136, 5, 9, 52, 53,174,222,237, 87, 92,222, 97, 86, 86,204,198,174, -143,149, 12, 97, 57, 7, 32,253,237, 33, 9, 49,241, 75,107,215, 20,138, 84, 57, 62, 93, 99,178, 15, 79,217, 11, 90,199,173, 35, - 92,143,204,141,212,178,207,225,219,156,174, 67,250,163, 19,243, 1,233,174,203,229,110,214, 46,239,252,103, 12, 34,110,175,247, - 28, 7,206, 79,162,186, 77, 62, 36,105, 17, 94,101,230,144,227,110, 32,165,105, 41,168, 80, 58,224, 55,150,236, 99, 16, 10,244, -156, 50, 59, 80,198,185, 93,230,211,203,222, 53,149,195,152,171, 53,170, 68, 43,162,219,127,195,147,105, 11,101,240,235,149,236, - 9,160, 85, 77,122, 17,172,160,186,117,171,240,202,180,214,238, 74,149,252,140,249, 34,176,121,111,198, 87,150,229,129, 57, 39, - 48,229, 72,121,219,149,246,114, 3,175, 98,214, 9,100, 41,171, 68, 74,141,173,144, 40,169,110,160, 2,226,201, 77, 75,104, 78, -182,113, 90,155,192,215, 74, 16,102,130,169,247, 13,195,197,113,108,126,232,249, 47,213, 86, 11,204, 23, 47,113, 71, 22, 99,232, -123,149, 34,219,166, 88,158, 74,214,228,107,172, 6,231,219,202, 91, 4,251,109,184,149,160,212, 10, 0, 70,152,191,141,178,200, - 24,214,130,149, 22,219, 87, 2, 84,244, 85,118,227,140,223, 19,229,164,197,123,132, 60,176, 90,162, 99,238, 56,146,206,119,116, -192, 97, 97, 24,179,109,189, 80,167,163,202,126, 35, 14,205, 9, 4,212,195,109,195,221,168,115,109,143,187,238,150,132,234,250, - 77, 76,248,167,219, 98,231, 21,235, 63, 69,115,135,206,181,191, 13,189, 92,115, 30, 36,228,168,145,236,242,211, 29,231, 27, 22, - 75,196,155,109,162, 96, 88, 86,199, 89,216,166, 18,230,213, 1,185, 43, 69, 71,120,161, 7, 81, 54,235, 49,111, 38,166, 96,230, -148,224,105,231,222, 72,208, 10, 40, 60,107,227,211, 54,192,102, 97,188,175,145,227,184,132,217,243, 81, 22,244,236, 75,107,144, -212,167,230, 74, 18, 72, 41, 66, 11, 2,171, 36,171,109, 18, 58,250, 53,211, 33,152, 58, 48,231,166, 88,212,160,242,236, 70, 6, -190,166, 63, 3,223, 34,118,222, 55,179, 79,243,193,230, 58,200,187, 29,232,220,164, 99, 28, 47,104,203, 45,226, 19,150, 54, 92, - 80,141, 63, 35,117,137, 45, 7,153,125,215, 84,184,176,214,170, 20,160, 58,186, 16,227,106, 25,237,214,245,151, 8,216,200, 44, - 4, 41, 24,175,103, 12, 62,126,202,133,117, 35,151, 66,226,122, 79,179,211, 93,218,229,175, 50,124, 91,198, 49,231,221,254,240, -183, 38, 67,169, 30,249,115,146,226, 11,129, 41, 52, 5, 78,184,119, 33, 0,158,130,180,244, 13, 98,239,238, 97,183,126,152,154, - 92,227,211,141, 63,107,182, 92,220, 16, 15,116,124,184, 87, 51,243,239,196,195,143,164,123,229,154,197,120,181, 95,239,171,184, -123,164, 56, 86,183, 5,215,107,170, 35,171,142, 36,169,182,130, 59, 84, 84,122,119,234,188,252, 84,128, 29, 26, 71,101, 91,197, -202,109,184,112, 87, 19,210,166,154,217,127,153,187,117,210,217,108,153,117,137, 10,227, 29,212,210, 83,236,182, 19, 38, 59,106, - 2,187,118,128,149, 4, 30,180,212,109, 79,121, 71, 82, 55, 14, 78,141, 8,140,233,120, 24,116, 31,170,185,175,230, 83,202,223, - 28,114, 62, 89,103,228, 92,122,237,117,179, 89,242, 96, 21,127,183, 88, 20,220,123,116,155,138,170,180, 75, 40,240,202,219, 47, -245, 75,219, 72, 5, 64, 42,149, 82,137,187,178,221,102,181, 97, 96, 0,166, 75,209, 89,107, 73,204, 4,193, 62, 99,232,225,245, - 81,220, 15,202,134, 41,135,176,204,203, 19,239, 45, 32,133,128,157,169, 82,149, 81, 85, 40,132,110, 53, 61,164,234, 96,223, 37, -151, 7, 83, 23, 50, 2,112,171,193,131,226,136,143,110, 74,233, 84,161,176, 9,217, 85,168,166,160,215,167,167,213,168,239,187, - 47,170,135,156,106, 76, 77,173,185,177, 12,117, 20, 7,130, 86,150,138, 83, 85, 84,142,206,206,218, 82,186,104, 93, 22, 21,166, - 78, 20,232,158,217,129,192,188,177,101,185,161,182, 88, 76,108, 98,231, 29, 82,122, 37,181,166,235, 21,178,180,158,148, 41,223, - 65,234,248,117,214, 60,167,188,115,247,120,132,106, 73, 14, 8, 56,247, 77,115,175, 50, 35, 18,109,228,167,218,109,115, 55, 34, -205,237, 22,199, 36,198,142,135,102, 73,105, 11,240,118, 55, 86, 22,232,236, 27,169,217,235,215,183, 54,189,154,230,235, 75,159, -221,105, 56,244,165,121,178,226, 12, 42, 59,139,200,119, 64,255, 0,137, 62,208,195,145,148, 64,218,201,240,220, 79,164,212,131, - 93,108, 36,229,168,203, 82, 57, 8, 61,117, 73, 43, 7, 10,242,102,107, 50,226,167,225,197,101, 48,153,116,109, 72,105, 59,164, - 4,244,253,170,119,250,181, 46,219, 98,138,212, 7,188,234,112,233,202,162,146, 27, 84,243,150, 44,247,182,239,179,102, 90,158, - 92, 38,110,150,249, 41,186,251,147,139, 93,206,250,252, 52,237, 97,165,150,193, 2,189, 8, 10,161,245,235,207, 30, 99, 94, 56, - 93,203, 36,145,196,198,233,110, 15, 44,112,205, 9,111, 17,219,134, 53, 71,117, 49, 46, 39, 72, 7, 12,211, 37,170,174,231, 32, -140, 66, 37,150,199,146,218, 47,175, 49, 14, 76,133, 93,161,193, 83,150,203,146,229,205,221,225, 23,214,133, 41,175, 12,208, 37, - 72, 32, 26,107,142,223, 69, 45,203,229,117,172,205, 4,129,164,168,115, 16, 1,169, 58,211,136,168,205,179, 36,184,130, 19,135, -232,235,168,101,236,194,209, 50, 85,230,231, 50, 52, 75, 26,152,132,236,235, 84, 24,119,167, 64, 91,137,116, 2,133,164,239,121, - 10, 66,133, 64, 73, 3,226,210,159, 20,172,107, 35, 97, 47, 4,128,226, 90, 58, 51,232, 67,233,169,177,219, 57,128, 1,138,116, -209, 8, 28,203, 14,227,107, 85,134,249,100,182, 55,113,153,225,125,223,145,251,243,230, 44, 23,119,238, 91,174,182, 84,164,109, - 40, 0, 20,167,167,125, 53, 10,227,151,101,100,190, 52, 50,184,176, 46,166, 32, 82, 19, 0, 15, 79, 89,162, 22,197,135, 83, 79, -161, 42, 80,195,243,184, 81,113,123,150, 19, 42, 28, 43,205,238,228, 87,115,111, 44, 84,181,201,129,109,182, 66, 5,231, 19, 13, -176,166,129, 82,138, 83,181, 69, 68,142,202,107, 49,186,237, 50, 73,112,219,192,226,200,219,221,240,208, 2,231, 28, 6,162,135, - 14,145, 72,124, 78, 99,245, 14,140,169, 91,141, 45, 88,182,115,151,220, 45,185,158, 39,117,200,177, 89,150,187,156,184, 87,104, - 23,133,199,106,201, 33,212, 5,135,219, 70,208,165, 45,132,168, 41,108,212,212, 5, 16, 14,168,185,186,226,239,106,178,108,182, - 83, 50, 57,154,230,130,215, 53,117,133,200,246,228, 15,102, 85,103,100,230,177,200,236, 79,163,229,233,171, 29,131,225,158, 92, -177, 24,182,214,109, 57, 5,230, 23, 37,218,151,126, 77,198,215,126,131,114,103, 29,206,236,236, 41, 30,233, 15,196, 96, 68,151, -111,121,228,189,226, 52,226, 84, 64, 41,170,136, 73,161,227,123,254,233,204,155,211,158,100,137,142,178,126,141, 46, 97,143,196, -133,216,234,122, 59, 83, 94,208,136,225,130,170, 12, 69,107,237,157,107,183,133,152, 35,218, 14, 5, 81,223,229, 24, 98, 48,227, - 81, 91, 60,201,121,226,252,213,220,133,219,211, 76,100, 56,116,153,240, 44,241,156, 64,189, 74,183,182,192,113,144,183, 29,148, -153, 97, 72,121, 47, 20, 45,160,158,162,135,215,173,115,249, 38, 14,101,177, 22,229,132,199, 40, 5,201,220, 14, 37, 14, 1,186, -113, 8,160,174, 24,213,127,243, 23, 57, 31, 24, 3,175, 60, 58, 49,237, 74, 83,228, 47, 48, 57, 87,155, 78, 90,198,102,102, 22, - 59, 74,227,227,214,233,145,113,251, 46, 29,141,219,177,137,111,205, 91, 12,188,235,146, 75,169,109,231, 27, 42,140,119, 15, 22, -128,159,101, 32, 26,106, 55, 44,121,121,107,229, 30,215, 51,108,229,122,202,224, 94,233,100,124,129, 20,128, 26,138, 1,239,127, -151,180,148,171, 75,173,242, 77,212,136,158, 26,140, 84, 70,134,144,160, 47, 90, 97,211,157, 71,190,104, 49,190, 48,183,228, 88, -116, 94, 38,195,242, 43, 71,255, 0,226,240,175, 89, 93,171, 40,186, 50,184,179,239,142,130,183,221,109, 13,169, 97,182, 80,170, -209, 41, 87, 94,241,173, 15,150, 91,150,231,115, 5,195,247,107,136,222,124,103, 50, 55, 70,210, 11, 89,144, 4,144, 20,244,148, -244,213, 13,241,136, 57, 97,111,106,241, 53, 93, 51,156,159, 27,106,202,150,225,198,136,185,202, 83, 5, 41,135, 24, 22, 32, 17, - 66,224,105, 52,246,170,161, 74,145,217,174,229,177, 89,202,226, 28,226, 81, 14,124,122, 22,176,194, 23,252, 73,120, 36, 51,160, -209,108,154,237,132, 93,176,156, 41,139, 14, 52,212, 44,141,249, 73,126,235,149,204, 99,194,121,254,138,107,193, 81, 77, 17,181, - 42, 88, 93,118,250, 53, 62,214,218,226, 25,230,116,207, 38, 52,238,176, 31, 74,211,209,197, 51, 37,145,206,114,179,128,232,168, -246,248,213,146,212,133, 34, 10, 88,184,220,100,192, 90, 92,117,129,226, 34, 27,141, 16, 2,212,226,168, 86,165, 82,190,200, 26, -157,106,249,102,112,212,173,104, 56, 14,159, 69, 79,135, 91,129,224, 22,146, 45, 89,196,123, 38, 53,145, 71,153,102,102,235,147, - 94, 18,136,214,155,188,186, 60,221,174,216,224, 41,121, 41, 79, 64,130, 15,205,160,237, 38,186,153,121,181, 62,242,104,203, 30, - 91, 27,113,115, 71, 19,194,166, 51, 75, 70, 34,152,177, 36, 93, 39, 71,122,205, 12, 37,126, 59, 79, 73,146,164, 81, 14,169, 1, - 59,212,130,162, 43, 79,103,176,106,213,237,100, 68, 61,220, 50,166, 94, 67, 14,178,122,169,172,233,101,196,149,165,138, 60, 66, - 16,148, 10,212,132, 83,218, 61, 43, 93, 72,214, 87, 26,125,152, 97, 70,163,200,117,191, 29,166,218,109,110, 50,199,182,219,201, - 43,104,120,132, 2,170,247, 20,146, 53, 18,230, 54,220, 22,151, 40, 11, 78,232,210, 23,166,131,134,185,110, 23, 67,161, 46, 33, -165, 35,109, 58, 4,237,238, 79,119, 81,164, 92, 66,198, 4, 5, 13, 17,115, 80, 32,167,173,166, 68, 63, 13,199,102,198,151, 41, -182, 17, 33, 73,109,149,164, 56,218,202, 84, 17,237,168, 20,143,164,166,228,237,169, 26,204,222,198,246, 16, 24, 64, 37, 51,226, - 56,229,213,215, 71, 27, 1, 82,106, 75,157,109,189,221, 35, 38, 37,223,238,198,100, 66,143,109, 83,115,124, 84,132, 64,183,186, -193,113,180,173, 72,232,129,233,233,243,187,117,155,138,234, 11, 82,177,135, 16,226,236, 19, 50, 10, 28,243,250,169,233,152,241, -221, 40,169,194,144,134, 83,115,188, 91,163, 99,151, 71,215,120, 77,190, 56,182,227,142,182,218, 35,181, 13,149,172,169,192,144, - 91, 78,245, 57, 90,111, 89, 38,131, 83, 29,180,195, 99, 41,185,136,104, 46, 58,158, 49, 36,148,195,142, 0,116, 12, 40,155, 54, - 8,152,211,101, 78,185,110,105,198, 98,190,244,118,148,165,176,247,138,148, 57,225,239,173, 69,118,146, 43, 74,118,234,215, 64, -148,171,128, 39,134,117, 20,188,184,162, 97, 73,101,246,212,148, 37,164, 5, 81, 30, 19,235, 4, 37, 14,117,238,232, 8, 26,144, - 35,113,207,209, 70, 16,112,162,158, 2, 22, 36,111,144,230,209,185,198,213, 65, 85, 20,244,161,168,235,167,181,232, 68, 24,209, - 58, 69, 68, 20, 18, 28, 92,101, 5,208, 17, 66,186, 17,232,248,136,235,162, 35,196,195,141, 26,107,192, 86,235,145,227,143, 25, -198, 82,132, 40,108,250, 38,192, 27,171,251, 95,229,210, 91, 31,134, 80, 28,122,232, 53,129,133, 43, 79,102,191, 53,205,158, 23, -206,238,222, 59,171, 74,105,220, 40, 87,222,242,122,167,218, 35,187,179, 91, 15, 31,162,181, 40, 40,116,109, 34,128,138,250, 52, - 98,122, 48, 5, 25,109,186,158,222,238,186, 95,196,245,208, 0, 26,245,198, 16, 69, 73, 29, 52, 62, 38,129,104,162, 10,216, 13, - 7, 83,217,167, 60,117,160,128,208,169,110,169,249,160,215,213,160, 46, 58,233, 36, 14,138,215, 99,109,246,142,158,141, 44, 92, -117,208, 13,109,110,151, 18,163, 68, 2, 15,112,209,248,244, 16, 82,129,113,196,178, 18, 26, 38,163,180,127,155, 68, 38, 83,157, - 25, 2,139, 34, 51,175,251, 99,217,235, 66, 15, 79,213,167, 62, 33, 56,210,116,131, 67,162, 11,133, 84, 61, 5, 59,125, 58, 51, -114,156,104, 8,197,110,108,174,174,171,175,102,139,227, 40,196, 66,189, 69,169,180,138,184, 59, 59,105,223,249,180, 13,223, 93, - 24,137,180,113, 54,214, 85, 74, 36, 0, 59,254, 15,139, 73,248,179,211, 74,240,218,107,101,218,210, 8, 80, 20,167,229,232,210, - 77,221, 40, 68,218, 53, 18,222,234,220,232,157,194,189,221,148,249, 53, 95,113,115,215, 86, 86,209,138,191,222, 77,218, 49,103, -102,168, 82, 0,241, 32,217, 86,165,158,212,150,215, 32, 4,246,119,238, 39,226,215, 29,243, 14, 96, 77,187,137,203, 95,204,218, -239, 62, 82,181, 29,114, 0,224,207,157,213,118,221,152,211,168, 32, 30,129,123, 77, 58,212,245, 30,142,189, 70,185, 20,243,248, -129, 13,119, 72,225, 44, 43, 76,135,173,205, 73,201, 45, 97,196,181,225, 53, 39,222, 22,157,128,169,199, 25, 27,144, 59, 58, 13, -244, 39,224,167,126,170, 35,128, 73, 59, 1,201,106,124,146, 17, 25, 78,138,146,220,121,150, 82, 86,235,136,109, 41, 21, 42, 90, -130, 64, 3,225,214,236,200,214,241, 21, 66,132,212, 39,157,242,103, 17,227,143, 34,225,151,174,196,235,182,255, 0,245,136,243, - 46,113,152,124,197,113,174,197, 52,167, 65, 40, 34,157,169,235,170,217, 93, 19,158, 92, 90, 9,235,167, 88,247,123,173, 39,209, - 92,175,243, 79,248,196,241,151, 15, 70,159, 3, 19,122, 53,214,232, 25,125, 16, 54, 44,169, 18, 93, 72,160,240,246,165,107, 89, - 10,167, 96,160,233, 82, 6,149, 9,154,232,233,136, 96, 61, 0, 85,132, 91,113, 35, 84,164, 48,122,220,125, 21,242,211,230,251, -207, 23, 39,121,159,202, 33, 95,150, 94,198,153,128,185,239, 15, 1,208,236,219,139,243,130, 1, 83,190,201, 74, 16,202, 17,181, -180, 36,158,213, 18, 77, 64, 76,237,191,101,109,137,123,228, 58,156,239, 80,171, 15,137,108, 64, 50, 44, 26, 7, 20, 83, 80,111, -150,222, 97,186,112,127, 40,199,228,149,194,110,233,121, 17, 37,195,251,198,108, 95,126,147,108, 92,242,128,185,109, 36,165, 68, -173, 41, 73, 73, 41,235,180,154,105, 59,222,222, 55, 72,124, 16, 80, 42,167, 74,112,169,155,117,212,108,145,101,200,251, 43,173, -121, 47,226,209,149, 47,142, 19,129, 92,239,120,246, 87,143, 60, 30, 42,140,167,149,110,186,132,201, 39,123, 74,162, 86,217, 73, - 82,141, 73, 0,143, 65,213, 36, 27, 91,217, 23,130, 1,106,113,171, 59,157,146,222,105, 68,204,152, 39, 65, 35, 10,169, 23,222, - 92,143,200,238, 11,148,204,161, 83,241,201,142, 71, 76,187, 50, 47,110,206,129,105, 46,237,240, 8,109,199, 21,245, 36, 20,168, -145,222, 14,155,248,103, 91,230, 59,221, 36, 99, 90,155, 8,226,141,168,210, 9, 28,122,104,107, 63, 27,216, 34,100, 17, 46,145, - 29, 99,221,230, 41, 38, 67,105, 32, 2, 77, 54,186,158,234,143, 72,212, 87,221, 61,205, 45, 53,103,220,140,235, 2,174, 18,166, - 65,181,217, 17, 1,203,131, 78, 52,182, 54, 71,105, 74, 10,123,121, 2,131,214, 53, 70, 90, 75,149, 42, 21,235,219,164,187,162, -159,156,101,120, 76,155,106,236,247, 85,169,113, 65,116, 69, 11,114,129,128, 85, 90, 80,244, 0,215,224,212,227, 30,144, 8,206, -184,167, 49, 74, 36,156,200,206, 53, 59,218,102, 35,238,196, 66,142,250, 91, 29,119, 20, 0, 73, 73, 42,218,154,129, 80, 58, 14, -223,207,166, 92, 0, 42,149,158,248,135, 3, 82,110, 41,144,174, 20, 7,155, 32, 56, 18,183, 3,244, 27, 66, 74, 9, 20,235, 74, -130, 58,138,122,117, 30, 67,141, 25,118,163, 82, 77,134,233, 21,197,162, 74,202, 18, 86,177,176,164,210,170,168,237, 4,127,147, - 81,222,227, 68,227,194,164,174,112,129,107,155,229,163,145,174,200, 91,104,122, 53,186,204,219,234,105, 85, 21, 85,230,220, 90, -169,167,237, 10,116,215, 90,242, 54,119,197,204,118,169,254,176,123, 60, 55, 86, 27,158, 83,249,116,164,240,211,255, 0, 80,174, - 35,221,102, 66,109,213,148, 0, 86, 1, 27,143, 90,126,109,125, 28,179,123,136,198,188,191,184, 93, 38, 85, 18,101, 92,129,110, -198, 27, 68,153,236, 76,149, 29,213,169,144,168,140,151, 26,142,178, 13, 22,234,128,246, 18,147,212,234, 47, 53,110,178,237, 22, -134, 72,148, 57, 70, 32, 2,131, 50, 80,144,184, 86, 86,230,233,196, 20, 41, 85,207, 32,230, 67,104,147, 98,188,174,235, 38,225, -144,195,102, 99,172,253,213, 36,219,173,232,113,247, 82, 97, 45,232,228,178,167, 29,142, 18, 9,220,146,149, 10,131,175, 61,238, -124,235,123,191, 67,225,137, 30,198, 49,231, 83,245,123,236, 57,181, 2,166,120, 98, 18,163,155,189, 88,143,144,168, 74,255, 0, -205,217, 46, 85,145,228,151,171,142,106, 32,100, 86,233, 78, 92, 83,112,155,109,142,213,145,245,186,221, 95, 74,155,140,141,137, - 46,182, 66, 83,236,208,158,240,117,204,183,123, 23, 88,178, 59,103, 48,201, 25, 5,164, 7, 18,228, 37, 70, 36,149, 67,137,199, - 10, 96, 91,178, 65,222,244,117,213, 64,186,114, 13,218,251, 51, 47,149,107,110,227,113,153, 62, 33,113,251,128,148,224,240,155, - 96,237,117,244,160, 10,169, 42,160,160, 61,154,183,143,109,109,163, 97,107,203, 90, 1,201, 7, 28,135,109, 72,101,184,104, 1, -201,133, 66,146,103,166,227,113,155, 42,107,139,128,255, 0,186, 23,150,183, 27, 43, 18,223, 66, 83,208, 84, 10, 21,245, 58,188, -210, 96, 96,107, 2,133,245, 10,127,222,194,142,219,174, 81, 90, 84,216,140,198,118, 91,115,151, 29,134, 39, 74, 6, 35, 44, 45, -116,169, 41,219,216,146,123,126, 93, 53, 52,110, 40, 84, 2, 49, 32, 98, 77, 37,236,203, 28,106, 80,180, 93,173,112, 99, 55,143, - 72,104, 72,157, 18, 98,148,110, 17,165, 55,238,165, 15,123, 33, 30, 16, 72, 81, 9, 81,170,136, 93, 53,157,186,181,154,105, 12, -193,200,194, 50, 32,174, 29,127, 54, 20,195,227,212,117,138,182,124, 99,158,113,157,183, 26,114, 45,210, 68,235,125,253,139,164, - 59,123, 48,109, 54,165, 95, 22,235, 9,142,234, 31,185, 7,220, 33, 12,130,225, 74, 11, 36,130, 65, 52, 52,215, 34,230,189,131, -115,188,186,253,136,107,161, 44, 36,151, 59, 64, 93, 65, 24,128, 41,195, 29, 67,211, 82,236,236,225,209,226, 73, 43,154, 75,189, -208, 23, 15,155, 58,125,243, 99,143, 99,152,246, 47,151, 98,247, 60, 49, 45,229,246,149,187, 24, 69,180,169,140,138, 36,136,141, - 24,164, 7, 27, 11, 97, 42,125,106, 42,240,210,181, 44, 30,222,154,204,242, 91, 13,204,211,217, 93, 50, 85,133,232, 73,114,176, -135, 29, 89, 20, 40,209,196,128, 42,210,230,102, 78, 26,246,241, 40,152,224,128, 99,233,170, 86,140,186, 51,146, 18,171,212, 95, -191, 22,252,181, 7,109,110, 45, 81, 18,221,197, 41,218,167, 84,232, 72, 81, 32, 10,209, 67,169,237,215, 94,126,208, 90,207,216, -187, 66, 15,120, 99,134,104,159, 85, 68,195, 87,123, 26, 84,228,236,251, 25,127, 63,114,233,198, 6,235, 6,197, 30,215,107, 22, -243,125, 88, 50,173,242,210,211,105,144, 82, 90,216,163,181,221,192, 56, 61,165, 14,186,135,203,123, 37,203,108, 4, 91,166,151, - 74, 92,229,209,145, 10,116,231,134, 73,134, 66,151,112,230,120,186,226,203,167,141, 56, 78, 61,150, 95,113, 88,156,153,123,155, -101,198,236, 55, 81,122,178, 89,100,136,242, 37, 72,200,174, 86,182,210,181, 37,196, 5, 41,212,161,223, 18,158, 42,200, 0,244, -166,163, 91,221,219, 90, 94,127, 45,129,174,146, 70,150,185,224,144, 3, 26,226,152,112, 36, 38, 67, 19, 78,207, 23,236,252, 87, - 20, 9,130, 98, 79,213, 80,126, 76, 35, 42, 51, 13,187, 37,199,140, 56,238,137,114,161,183,238, 73, 68,133,245, 1,107, 80, 59, -186, 86,128, 13,117,123, 32, 88,112, 25,228, 14, 56,117,116, 86, 81,142, 33,199, 12,206, 71, 28, 41,189,101,184,199,186,202, 98, -195, 14, 35,118,246, 91, 82, 4, 9,142, 73, 83,170,241,251,202,214,176, 18,128,174,222,131, 86, 19, 68, 96,105,149,228,187,164, - 39, 10,149,164,198, 53, 56,169,236,167, 6, 93,142, 11,109,157,121, 1,191, 67, 84,246,110,126, 28,107, 50,107, 49, 79, 22,156, - 9, 89, 83,162,129, 99,165, 77, 5, 59,180,213,157,203,101,127,134, 24, 64, 35, 60,147, 14,138,145,110,243,145, 24, 37, 48, 87, -107,148,227, 45, 92,174, 78, 80, 60,151,118, 68,167,186,169, 41,119,170, 84, 18, 41,236,165, 68,106,195,197,214,116,197,195,141, - 57, 36,128, 20, 35, 26,108,166,124,235, 60,169, 12,196,144,143, 20, 3,185,212, 13,199,219, 20,173, 8,239, 73, 34,154,148,232, -219, 48,239, 12, 40,157, 11,102, 0,145, 67,155,194, 25,240,214,227,113,157, 49,154, 90, 1, 45,237, 11, 42, 79, 74,208,118,212, -233,163, 14,160,129,113,160,216, 9, 40, 48,164,166,214,169, 33,201, 97,194,163, 37, 74, 42,108,116, 52,233,208,244,236,212,159, - 8, 32, 20,243,222, 98, 58, 72,202,134,145, 14,108, 22,162, 58,233, 44,123,202, 22,235,109,147, 71, 20,216, 52,173, 5, 79,192, -116,202, 49,196,140,248, 26, 70,176,229,161,109,138,148,220,173,155,138,140,144,218,220, 75,181, 72, 41, 66,133, 13, 70,152,185, -179, 19,181, 6, 9,149, 19,228, 13, 11,192, 84,187, 97,111, 33,202,174, 72,183, 89,220,138,110, 23, 84,125,216,150, 28,163, 13, -190,180, 26,165,189,235, 77, 42,118,238,169, 87,118,176,155,131, 45,246,150,234,156, 20, 97, 85,205, 58,240,165,192,215, 72,123, -188,105, 10, 45,169,214,238,235,133,113,109,105, 16,222,116, 72,247,113,188, 37,109,146,133,109, 34,128,208,138,130, 14,165, 92, -220,254,200, 73, 25, 5, 70, 20,135, 18, 10,113,164,119, 98,180,236,135,140, 98,167, 24, 67,207,109, 83,228, 13,237,166,189, 86, -123, 43,240, 13, 75,141,238,115, 70,172, 28,159, 36,164,185,229,184, 28,235,214,156,101,164, 36, 56,202,124, 48,178, 5,125,175, -106,157,189, 19, 83, 65,217,160,230,185,199, 60, 41, 39, 83,171, 79, 1, 42,140,243,142,173,170,165, 72, 33, 85,250, 68,110,236, - 1, 36, 84,215, 74,212, 87, 1, 64,184,130, 52,209,112,180,123,187,140, 46, 56,112, 44, 31, 13,242,104,164,154,245,211,140, 7, - 60,169, 72, 87, 80, 53,137,137, 37,134,144,242,153, 80, 97,196, 41,117, 32, 16, 61, 99,160, 58, 79,136,215, 18, 23, 26, 35, 32, -118, 0,227, 67,110, 62, 15,137,181,223, 4, 35,111,137,179,232,246, 31,218,173, 59,107,210,186,109, 10,162,133,162, 94, 24, 45, -125,230,184,232,108,116,234,125, 26,191, 18,214,184,132,162, 30,254,148, 40,238, 5, 39,214, 15,249, 52,191, 21, 41, 39, 10, 62, -197,200, 31,155, 83,240,247,126,109, 15, 22,148,180, 43,146,202,146,122, 17, 94,167, 70, 38, 2,130,208, 13,168,169, 64,128, 79, - 93, 44, 77, 68,220,233,192,202,155, 9, 27,145, 94,154, 79,141, 75, 74,220, 55, 29,205,219,134,223, 81, 35,252,154, 80,152,209, - 37, 39, 41,128,219,132,164,251, 53,167,196,116,231,196, 81,105,165,120,235, 5, 59, 59,104, 43, 93, 39,198,163, 2,135, 66, 8, - 82,130,123, 15, 80, 59,235,165,120,244, 52,208,111, 41,246,233, 74, 82,190,142,186, 49, 48,162, 66, 40, 70, 38, 20, 43,233,156, - 74, 69, 13, 1, 35, 64,200,185, 81,180,209,105, 87, 86, 16, 72, 75,136, 80,239,246,133, 6,148, 28,122, 40, 23, 1,149, 38,140, -138, 10, 8,221, 37,132,138,211,235,135,104,211,190, 27,206, 77, 62,170, 72,144, 81,214,175,209,230, 16, 24,117,183,135, 78,168, - 88, 87, 79,139, 76,200, 29, 23,188, 8,167, 26,240,114,167,124, 11,131, 17,208, 22,178,144,125,126,191,139, 85, 87, 18, 45, 90, -218,184, 10,183, 62, 91,115,107, 77,165,121,130, 95,150,219, 15, 75,137,104,240,183, 26, 85,182,215, 33, 43, 80,255, 0, 69, 78, -166,191, 14,185, 7,152,238,112, 16, 59,130,184,122,195, 83,230, 53,223,124,158,153,161,247, 45, 57,150,176,143, 65,114,252,226, -174, 5,147, 42,181,204,133,239, 94,240,130,144,183, 5, 58, 43,196, 88, 62,130, 59, 53,203,181,142, 53,221,154,224, 69, 70, 25, - 71, 41,218,109, 87,150,212,220,196, 33,244,120,132,110,120, 32,120,102,160, 80, 30,242,107, 93, 54,208, 75,181, 10,106, 89,128, -194,170,231, 49,121,180,143,135,217,103, 78,145, 49, 15, 60,148, 56,152,236, 7, 65, 75,138,235, 74,247,211, 86,145,135, 56, 83, - 17, 68,111,100, 12, 5, 7, 26,224, 39,152,143, 53, 55,142, 85,186, 92,159,186, 78, 45, 91, 45,233,117,110, 55,227, 22, 98, 54, -219, 0,158,192, 64, 3,182,164,157, 27,173,221, 25, 24,247,141,108, 45, 97,138,201,133, 6, 3,137,204,252,186, 43,133, 57,199, - 35,127,126,115,105,179,219,125, 75,132,135,149, 26, 10,214, 54,149, 68,105, 71,219, 9,167,179,188,213, 65, 52,232, 40, 59,117, -184,181,183,248, 72,131,120,241,172,221,196,198, 82,166,149, 96,199,106, 82, 91,246, 65, 42, 72,232, 7, 90, 87,178,189,250,139, - 43,234, 35,164, 74, 94,106,206,119,120,155, 8,236, 77, 2,125,160, 41,240,122,181, 20,201, 73,241,105,187,144, 90,156, 83, 59, -131,106, 20, 66,195,128,142,128, 30,254,205, 59, 28,169, 70, 38,168,166, 74,102, 91, 93,117,200,175, 73,138,227,173,134,212,228, -103,148,194,214,209,165, 65, 41,160, 80,245, 26,141, 62,228,148, 33,198,159,130,250, 75,114,172,113, 6,151,236, 92,231,156, 98, - 13, 55, 17,219,140,155,205,189,144,164,178,220,167,212,153,208,211, 74,125, 27,148,162,168, 59, 1,167,199,168,114,109,145, 72, - 85, 16,213,171,121,146,224, 55, 65, 42, 42,193,113,151,154,155, 13,206,226,194,175,183, 9,174, 74,138,180, 36, 71,185, 72, 59, -155, 80, 29,194,128, 31,135, 80,166,217, 90, 2,180, 83, 55, 92,193, 61,195, 11, 23, 10,190, 92,125,230, 38,195,119,184, 52,196, -121, 12, 33, 46, 40,128, 1,246, 40, 40,122, 26,117,221, 67,217,170,155,141,188,198, 43, 39,112,194,224,166,175,118, 11,147,181, -120,139, 41, 45, 20, 37, 15,161,183, 84,180,144, 0,104, 13,181, 4,251, 74, 61, 61, 21,214,122,224,104, 53, 75, 33,210,105,232, -140,139,193, 43,183, 48,249,220,226,148,162,162,122,132, 42,155,137,160,160,235, 78,167, 76,150,174, 52,235, 94,152,212,163,143, - 95,213, 6, 10, 37, 73,113, 42,109,128, 86,195, 77,164, 41,215, 29,114,161, 29,160, 26,146,170, 13, 71,115, 20,165, 7, 61,105, - 71,204,119, 53, 90,113, 62, 2,127,139, 87, 45, 18,115,156,254,227,102,185,223, 33,183,243,108,152,252, 7, 19, 45,176,178, 5, - 55,188,252,118,253,142,225, 82, 71,102,189, 51,253,191,114, 76,210, 94,127, 54,149,169, 19, 3,131, 23,237, 18, 19,212, 1, 56, -215, 23,243, 55,153,163,108, 95, 5, 25, 87, 18, 11,186,128,200,122,235,145, 87, 75,170, 86,165,123, 84, 36,168, 31, 88, 63, 22, -189,177,109, 32,111, 26,243,181,229,198,165,168,251, 45,184, 55,110,199, 38, 94, 92,178, 71,200, 99,195,106, 75,178,109,239, 54, -167,104,216, 77, 16, 86,144,130, 54,169,100, 2,123,187,117,207,252,210,220, 35,125,147,173,222,197, 46, 77, 14, 36, 4,118, 62, -232, 85, 46, 3,130, 86,114,114, 28, 64, 36, 2,114, 90,230,111, 39,228,201,203,100,220,238, 44,177, 2,192,168,150,246, 37, 72, -134,166, 21, 29,249,114, 91,116,182, 4,125,192,111, 40, 79, 66, 66, 64,245,107,207, 59, 96, 22, 95,179, 66,224,231, 16, 49, 80, -220, 23, 26,145, 20,126, 18, 12, 79, 14,202,174, 34,225, 46,230,210,132,118,230,186,211, 9, 72,188,188, 30, 83, 13,166, 2, 22, - 42, 20,180,208, 43,112, 87, 93,195,166,174,230, 99, 99, 61,228, 95,178, 19,138, 84,144,208, 23, 0,188, 40,220,124,129,120,216, -150, 44,113, 17,118, 76, 21, 73,183,201,241, 1,145,110,126,217, 53,181,108, 66,212,144,133,149, 52, 84, 72, 63, 46,160,207,102, - 47,147,197, 58, 73, 67,134, 5, 65,199,215, 74, 0,188, 5, 80, 77, 48,132,198, 28,150,209,247, 22, 36, 48,164,183, 27,194,148, -250,214,149, 56, 82,122,133, 84,108,161, 53, 2,186,181,240,157,167,222, 32,245, 10,113, 67, 65,162,172,170, 91, 91,235, 41, 14, - 44, 85,176,138,151, 18, 5, 78,222,193, 65, 77, 41,237,107,147, 10, 44, 31,152,167, 77,190, 97,101, 78, 37,201, 34, 50,228,192, -240, 29,145, 29,164,201, 84,132, 40,209, 73, 36,161, 68, 18, 71,111,110,160, 78,193, 38, 65, 81,202,135, 4,160,192, 27,158, 84, - 98, 43,178, 33, 73, 76, 91, 4,169, 20,157, 38, 60, 71, 23, 37, 9,109,228,205,120,138, 32,144,106, 64, 38,181,236,212, 87, 1, - 43, 75,238, 26, 59,160,156, 58, 7, 26,116,198, 30,129,165, 86,186, 41,201, 31,118,177,128,225,184, 10,243, 59, 36,235,254, 7, -113,143, 21, 83, 18,147, 91,181,182,114, 67,128,180,218, 93,117,168,190, 2,182,133, 45, 68, 21,118,244,236,215,156,185,114, 89, - 39,220, 46, 55, 15,134,123, 98,157,164,167,249, 92, 48,196,160, 46, 94,129,149, 89,221,219,139,102,248,100,168, 30,233,233,233, - 95,162,169, 73,145, 2, 4,137,114, 46,214, 89,111, 51, 18,228,169,205,184,201, 95,135,122,103,199, 1,109, 41,240, 8, 66, 84, -208, 80, 10, 77,104, 78,187, 1,108,147,181,173,134, 64, 9,106, 99,246, 74, 96, 83,138, 30, 6,161,120,109,141, 11,130,229,242, - 52, 46,127,144,227, 82, 38, 74,145,132, 98,241, 49,168,153, 25,145, 41,156,120,169,119, 39,108,209, 86,170,248, 30,240,241, 82, -158, 74, 13, 40,174,135,183,166,156,217, 54,171,168,154,214,222, 76,101,116,104, 53,251,161,197, 51, 65,145,234,164,220,200,217, -100, 37,129, 26,185, 83,219,143,173,162, 5,167, 31,185,102,127,119,100,216,205,226, 45,241, 17, 44,227, 32,117, 11,198, 36, 50, -189,165,229,176, 22,148, 49,189,196,130, 1, 7,112, 29,154,172,221, 26,251,251,137, 34,179,213, 20,172, 44,212,253, 1, 30, 8, -203, 82, 98,131,163, 42,143,115,126, 45,163, 56, 2,120, 2,190,202,133,242,187,142, 63, 59, 35,149,110,180,176,242,226,174, 73, - 96,201,132,175, 18, 18, 3,139,170,201, 27,104, 65, 20, 30,201,236,239,215, 74,219,173,165,130, 22,153, 14, 32,100,115,170,200, - 91, 43,155,226,200,128,156, 83,163,170,151,240,188, 98,216,205,249, 87, 27,133,185, 79, 91,151,114, 84,107,115,165,183,209, 98, -124,199,105,106, 87,135, 32,167,194,113, 65,192, 1, 71,118,145,127,120,231,199,161,174,239, 38, 57,106, 11,210, 51, 20,236,178, - 56, 65,169,160,135, 81, 62, 67,155,106,125,187,115, 81, 4,134,110, 12,187, 33,151,195,113, 16, 96, 55, 21,195,188, 20, 16, 7, - 80,123, 58,118,105, 91,116, 14,141, 74,171,112,227,138,245,208,178,150, 84,113,144, 14,170,102,149, 88,156,182,188,102,203,121, - 83,203,141, 34, 62,246,212,212,117, 45, 3,169,220, 42, 5,107,210,190,141, 90, 53,242, 7, 0, 7,119,219, 68,246,200, 92, 28, -209,135, 26,107,190,221,132, 90,247, 54, 86,110,166, 86,212, 60,149,213,160, 18, 58,130,154,119,250,117, 33,134, 71, 61, 15,186, -149, 58, 50,224,113,202,147, 62,235,120,198, 83,175,164, 37,181,133,123, 41, 2,138, 61,128,215,176, 26,233,253, 96, 59, 10, 64, -184, 26,176,204, 80, 80, 98,198, 76, 69,248,203, 13,248, 70,136, 74, 15,182,227,158,179,234,209,202,231, 18,141,167,167,113,123, -148,210,143,143, 51,217,122, 74,125,233,150,218, 67, 72, 82,147,185, 76,182,128,118,164,124, 58, 13,136, 0, 80, 84, 55,163,240, - 5, 13, 2,202,204,162,165, 48, 22,209, 7,104, 90,168, 66, 18,105,211,178,189,250, 55, 73,165,186,141, 25,102,146, 1,169, 30, - 4, 11,155, 48,162, 66,135, 16,184,234,153, 69,208,205,105,223, 5,255, 0, 13,186,237, 29,118,208,164,212,138,117,235,172,117, -211, 69,209, 47, 41, 82,131, 72,203, 58, 55,104,104, 33,171,146, 37, 93, 91,137,112,148,211,236,125,214,251, 46,174, 76,164,163, -106,146,148, 45, 41, 52, 46, 21, 84, 1,232,235,170,187,167,119,218, 4,100,176, 16,117, 4, 65,218, 58,168,203, 29,198,154,233, - 76,118,218, 13,190,195,136, 91, 37,192,165, 26, 80,144, 79,117, 58, 83,215,171, 18, 93,169, 65,194,152,121, 82,162,139, 71, 38, -169, 37, 5, 84, 91,139, 74,123,150, 73,233,214,159,171, 78, 63, 17, 75,127, 85,122,251, 34, 67,137,125,207,163,115,171, 99,122, -126,136, 20,118, 38,160,117,167,167, 74, 46, 17, 4, 24,209,120,129,131, 72,173, 67, 14, 45, 40, 11, 90, 60, 64,167, 20, 91, 41, -232, 20, 59, 54,244,165, 41,161,169,163, 17, 77,131,167, 44,168,210,238, 14,248,110,161,109, 54,165,161, 59, 18, 21,212,134,200, -236, 74,105,211,111,175, 77,136,134,160, 69, 1, 16,233,162,254,242,159,115, 13,117,219,237, 43,194,175, 77,221, 13, 59, 61, 29, -116,239,134,117,234,193,104,120,125,234,251,203, 90, 41,219,232,237,211,198,117,173,163,153, 69, 23, 16, 43,169, 21, 31, 6,148, - 46, 40,180, 86,161, 13, 48, 42, 84,148,142,242,165, 0, 6,148, 38, 38,134,138,247,223, 32, 52,157,207,202, 97, 9,236,170,221, - 0,105,246, 9, 31,131, 90, 77, 17, 1,180, 10,242, 11, 20, 52,110, 92,232,212,175, 74, 43,113,175,196, 53, 38, 59, 75,137, 48, - 12, 52,157,109, 20, 95,251,243, 97, 0, 35,222,129,169,166,224,133, 80,126,109, 75, 27, 69,206,122, 40,188, 86,208,202,202,108, - 74, 70,241,112, 20,255, 0, 68,215,244,105, 63,203,110, 85, 52, 80,241, 27,211, 73,255, 0,223,187, 10, 86,164,123,217, 33,177, - 95,171, 62,213, 61, 29, 52,240,217,238,112,238,231,215, 72,241,133, 35,202,229,120, 81,164, 45, 17,162, 45,212,166,129, 46, 19, -177, 43, 7,213, 77, 89,193,203,175,123, 65,123,128, 61, 20,147,112,153, 81, 83,204, 40, 15,182,159,115, 9, 74,190,125, 87,216, - 61, 93, 41,169, 63,250,206, 7,191,236,162, 55, 7,162,134,185,242,176,113,144,155,108,116,135,122,110, 91,202, 10, 9, 30,160, - 52, 45,121,117, 15,237, 93,135, 85, 19,238, 73, 24, 84, 83,115,202,111, 83, 36,120,206, 77,125, 73, 42, 39, 98, 87,177,180,239, -238, 0,122, 53,170,181,182,183,182,106, 53,162,162,184,151,103, 73,110,220,174, 42, 11, 38, 99,233, 10, 30,213, 29, 52,212,144, -232,129, 29,209,234,164, 98, 41, 53,213,184,166,247, 9, 36, 16,176,122, 57,214,167, 79,139,166,142, 20, 64, 82,133,170,255, 0, -118,177, 57,227, 68,148,176,149,128,151, 18,163,184, 20,142,189,148,212, 11,232,224,191, 9, 35,105,248,201, 97,194,164,248,188, -197, 12,165, 13, 75,101, 69,212,160, 2, 91, 87,178,165, 15, 85, 58,107, 19,121,203, 69, 86, 55, 96,188,106,218, 9,201,165, 72, -156,167,121, 90,156, 54,165, 8, 73, 40, 83,106, 83, 46, 31, 17,104, 89,170,122,250,136, 7,225,214,119,122,228,187,125,202, 7, - 69, 43,137, 60, 15, 65,233,173,199, 43,243, 4,187, 29,195,103,143,161, 8,233, 29, 21, 56,113,143,154, 73,182,171, 93,219, 30, -203,214, 96, 93,224,179,239,112, 36,190,178,152,215, 56,137,220,159, 17,165,118, 21, 2,148,239, 79,104,175,163,174,188,225,204, -252,169, 54,193, 62,151, 5, 97,201,220, 15,233,175, 82,114,238,255, 0, 14,255, 0, 7,137, 9,199,237, 55,139, 79,213,208,106, -180,243, 79,156,204,122, 59,207,174, 29,213,149,200,137,185, 18,154, 83,161, 14,238, 62,209,165,105,184, 21,117,232,117, 95,109, -102,120,214,137,150, 47,155,133,113,239,204, 79,157, 73,121, 75,175, 50,204,247, 99, 50,201, 83,123, 80,178,132, 45,191, 80,235, - 94,164,244,213,220, 54,173,104,171, 75,107, 35,105,136,206,168,173,251, 52,206,115,155, 68,150,227,177, 58,223,142,188,162,211, -210,159,109, 77,191,121, 83,255, 0,178,129,180, 29,135,188,247,252,186,145, 20, 17,177,250,142,116,139,151,190, 92, 28,112,232, -168,234,215,198,215,127,126,101,230,218,116,135,148,162,159,163, 33, 64, 36,245, 52,245, 83,191,187, 83,223, 56, 34,171, 36,171, - 19,142,113,245,201, 8,175,132,226,159, 65, 72, 65, 41, 42,160, 34,157, 5, 59, 9, 26,172,150, 64,106, 35,141, 62, 92,195,110, - 49,138, 66,153,170,232, 82, 70,222,149, 29,157,218,140, 94, 41, 45,198,147,151,131, 75,154,167,155,121,151, 0, 88, 32, 39,103, - 65, 83,240,122,116,131, 40,109, 58, 24,180,210,187,113, 3,169,112,248,140,187,180,164,237, 33,163, 65, 79,136,246,106, 67, 46, - 1, 24, 81, 0,149, 95, 51,110, 40,188, 69, 47, 42, 60,117,144, 43, 74,167,184,246,119, 13, 77,138, 96,234, 5,181, 85,114,124, - 39, 37,136,249,125,168,238,178,243, 71,114, 92,104, 22,212, 41,217,221, 67,169,172, 34,144,230,210,134, 21,204,185,142, 7, 45, -164,220, 89,148,164, 70,117, 46, 37,228,161, 74, 89,216,107, 66, 0,233,215,209,166,230,182,108,194,153,115, 86,186, 99,195,126, -124, 44, 16, 89, 97, 55,155,211,113, 86,132, 32,236,121,229, 50,232, 61,125,133, 21, 13,212, 31,151,167, 89,139,237,141,207,247, - 69, 65,154,215, 94, 85,109, 99,249,235,192, 36,169,151, 93,190,192,105,132, 4,168,169, 47,133,188,226,143,205, 74, 91, 66, 84, -234,201,237,160, 31, 13, 53, 81,252,138, 81,192,212, 97,100,234,153,240,175, 55,140,102, 51, 90,137, 97,131, 39, 98, 25,113, 86, -201,147, 40,193,247,243,236,180,232,109, 85, 73, 9, 73, 59, 66,143, 78,132,138,244, 23, 91, 6,217,107, 97,119, 27,239,155,170, - 61, 67, 80,232, 31, 79, 93, 85,111,155,125,195,173,100, 22,238,211, 38,146,148,143,125,186,222,242, 43,188,219,133,226, 76,153, - 19,228,200,121,201, 78, 73, 81, 91,203,117, 68,215,113, 53,236, 58,247,222,209, 61,180, 54,241,139, 96, 4,122, 70,148,201, 19, - 4,175, 19,110,179,200, 38,120,153,117,130, 85,115, 94, 52,220,157,101,120,128,232, 94,225, 74,169, 9,234, 81,249,181,117, 29, -243, 69, 80, 73, 40,117, 66,252,155, 7, 41, 69,130,230,113,219, 99,210,100, 45,150, 35, 42,122, 38,182,203, 76, 67,144,163,226, -165,214, 92, 30,216, 77, 1, 73, 29,154,227, 94,106, 62, 75,249,237,152,230,183,194,105, 36, 21, 58,139,128,203, 52, 1, 56,250, - 42, 19,154,215, 16, 74, 32,199,211, 92,237,228,187, 52,108,138,241,154, 55, 2, 18,125,225,135,109, 43,251,218,108,160,153,108, -199,128,200,247,134,209,225,164,182,162,243,157, 69, 6,178,219,113,104,136,177,177, 53,132, 98, 70,162, 64, 76, 16, 97,153,171, - 8, 94,216,144, 5, 29, 85, 90, 37,205,150, 44,223,117, 41, 73,139, 17,153, 42,240,155,143, 24, 38,108,181, 45,103,119,140,224, - 21, 88, 71,112, 86,141,144,180, 75,226,102,228,226,112, 29,130,158,115,123,227,166,144,213,119, 54,232,139,137, 17, 78, 63, 10, - 75,229,201,108,173,205,190, 36,164,167,110,226, 83, 69, 16,144,122, 3,211, 78,252, 47,138,224,231,102, 6, 4,116, 81,161, 46, -199,162,147, 34,195, 92,215, 31,113, 33, 45,180,203,107,117,198, 82,186, 57,180,119,161, 10,237, 32,106, 68,146,248, 96, 46, 38, -137, 83, 10,123, 99,150,217, 16, 38, 91,223,134,237,186,226,151, 92,143, 53,152,199,106,165,175,104, 36,143, 13, 73, 39,232,194, - 78,234,244,213, 69,244,205,153,142,107,193,110, 97,120,122,250,233, 50,157, 96,140,104, 9,115, 61,222,236,165,194,107,123,243, - 31,115,199, 96,175,198,108, 54,229, 74,145,183,104, 72, 32,158,128,105,113,198, 12,104,227,128, 25,253, 52,157, 37,193, 14, 66, -182,139, 2,215,238,178, 39, 92,102,169,150, 94,124,197,136, 18,149, 37,216,179,137,173, 93, 72, 21, 74, 64, 29,167, 73,124,178, - 23, 6, 49,185, 5, 61, 99,170,157, 7,162,166, 14, 51,230, 7,241,236, 3,144,184,169, 56,142, 23,122,127, 58,157,100,146,142, - 64,190,194, 18,175,216,172, 43, 10,150, 84,152,107, 33, 37, 45,201,222, 55,147,214,157,131, 88,190,101,228,177,186,110, 54,155, -167,196, 77, 27, 96,107,199,130,194,140,144,189, 49,112,233,106, 97, 86,208,238,226,218,218, 72, 93, 19, 92, 92, 66, 56,230, 19, -128,166,195, 50,164,125,223, 50,223, 30,234,223,128,152, 83, 84, 91, 15, 23, 99,172,178,122,236, 74,144, 84,144,225,234,158,205, - 76,185,182,107,100,108,166, 60, 84, 12,177,244,246, 85,107, 65,148,231,250, 41,179, 32, 67, 75,246, 89, 55, 73, 78,184,136,205, - 39,116, 86, 1, 98, 72,104,146,162,154,144, 59, 73,213,164, 23, 18,134, 73, 27, 26, 49,226,113, 11,211, 77, 2, 99, 46, 0,103, - 75,120,236, 36,228, 77, 95, 68, 54,238, 81, 32,180, 10,160, 91, 82,250,158,104, 40, 31,109, 78,184, 80,161,209, 61,128, 83,174, -164, 77, 28,182, 38, 34, 75, 93,210,236,189, 67,166,153,186,146, 59,124, 93,153,200,225, 73,214, 44, 23, 47,186,100,240,113,204, - 62,221, 38,109,214,224,234, 83,224,183,109, 15, 92,144,190,165, 65, 9,234, 72, 41, 29, 9,167,126,173, 46,247, 75,123, 88, 29, - 61,203,131, 88,222, 36,225, 76,248,204,149,170,236,122, 49,169, 31, 34,190,228,246, 75, 91,220, 95,147,179, 22, 19,246, 83, 37, -168,145,158, 97,180,182,210,129, 46, 46,142, 54,165, 36, 45, 75,234,174,189,123, 43,170,155,102, 67,114, 69,236, 4,185,175, 69, - 63,160,240,167,152, 9, 33,222,138, 66,137, 98,198,227, 89,225,165,110, 78,185,100,215,104,242,209, 58, 59, 17,253,230, 52, 22, - 18,226,106,224, 4, 13,132,244, 0,245,233,167, 95,123, 55,136,226, 0, 17,181, 17,112, 36,210, 37, 38, 65,193, 1,244,211, 43, - 37,141, 97, 68,214,226, 91,163, 75,240, 35,186,210, 89,182,165,126, 55,189,184, 19,181,199, 74,182, 2,129, 81,243, 73,213,134, -221, 44,206,110,185, 8, 83,199,163,160, 83,141, 61,197, 21, 27, 79,180,200,109, 79,220, 76, 7,162,194,143, 33, 45, 29,201, 33, - 8,117, 68,208, 26,142,211, 67,171,232,222,215,160,212, 9, 34,157,107,215,186, 14, 41, 69,157,150,251,241,220, 66,194,148,132, -138, 54,130, 74, 70,239, 78,208, 59,116, 65,129,165, 1,164,178, 17, 25, 81, 64, 70, 67, 8, 72,113,242, 73, 41, 5, 34,181, 78, -227,216, 59, 53, 37, 16, 97, 75,145,197,197, 5, 24,118, 75,197, 27, 67,231, 98,255, 0, 97, 32, 4,251,127,194, 6,144,154,105, -161,158, 84,189, 96,181,202,184, 73, 48,217,138,244,135, 20,195,206,169, 1, 6,131,192, 73, 89,232, 7,238,130,123,117, 81,186, -203,225,176, 16,120,211,129,186,148,138,121, 70,156,166,161,161,183, 28,154,176,211,109,170, 60, 1, 44,166, 42,131,102,181, 52, - 73, 39,253, 26,234,133,210, 22,168, 30,186, 6, 83,198,129,186, 93,156,186, 23,174, 73,140,150,159,101, 81,146,228,136,234,216, -243, 30, 16,160,160,167, 82, 64,234,116,166, 51,252,220,125, 84,235,228, 47, 82,152,154,110, 94,100,132,199, 50,124, 36, 81, 65, - 10, 14, 1,181,231,208, 71,180, 10,105, 78,158,157, 88,109,176,248,142, 32,240, 30,129, 72,181,140,189,196, 31,208, 40,130,202, -216, 67, 10,101,101,183,222, 66, 2, 20,165,110, 8, 90,171,219,208,129,180,106, 85,180, 77,123, 30,247,133,104,192, 83,209,180, - 56, 56,184, 96, 41, 82, 44,103, 95,106,148, 47, 6, 9,113,245,164,119,126,210,137, 52, 31, 46,170,164,239, 21, 1, 13, 70, 13, - 47,113,211, 66, 22,194, 81, 70,146,173,164,109,109,213,160,239,116, 47,211,242,244,210, 89,130,175,170,144, 9,227, 90,169, 1, -151,215,177, 43, 42,113,176,157,219,119, 39,112,237,238,235, 90,105, 44,113, 3,174,146, 9, 33,107, 61,214,103,128, 38,248, 10, -247,127,120, 45, 7,188, 63, 99,119, 65,217, 74, 86,157,105, 77, 56,162,158,240,156,139,194,190,234, 36,228,246,216,160,165, 79, -182,251,128,116,109,181, 5, 40,157, 51,111,111, 45,193,201, 7, 93,108, 12,128, 83,110,241,155,173,248,139,106, 26, 27,136, 74, - 74,124, 69, 44, 23,125, 31, 22,175,173, 54,182, 70, 67,158, 86,152,124,184, 84, 81, 50,250,219, 72, 87,188,220,212,163, 82, 74, - 75,229, 68,159,151, 90, 22, 57,163, 38,143, 85, 66,124,237,110,110,164, 7,114,203, 66,106, 28,121,215,232,123, 18,119, 14,154, -151, 28,165,185, 32,166, 29,125, 27,120,209, 39,179,155, 26,202, 82, 27,123,217, 62,128, 69, 71,197,167,219, 51,186,105,167,110, - 12,224, 40, 23,179,187,122, 88, 90,155,138,238,212, 2,162,225, 73, 89,160,254, 16, 9, 63, 22,132,183,159, 14,210,247, 18,131, -160, 18,125, 0, 2, 79,160, 81, 54,252, 72, 67, 90, 49,235, 32,123, 78, 20,217, 95, 42, 88,146,175, 5,235,205,186, 51,128,244, -106, 92,196, 68,112,159,244, 93,216,117,148,186,243, 23,106,177, 41, 60,207,103,235, 69, 51, 71,172,198, 5, 88,178,206,238, 80, -172,141,123, 11, 79,204,107, 72,249,156,121,174,127,171,204,137, 33, 10, 61, 28,143, 37,185, 9,235,235, 65, 58,126,207,204, 93, -142,248,233,138,250, 2,122, 12,141, 7,212, 72, 52,196,214,247,112,123,209, 60,127,180,209,201, 23,194,157,128,109, 89,170, 77, - 82,170,212,124,154,214, 67,126,201, 91,169,174, 4, 30, 32,168,245,213, 91,239, 92,220, 13, 15, 34,244,153, 49,118, 84,111, 52, - 9, 41, 72, 10, 66,180,243, 47, 0, 57,210, 62, 45,206,227, 69,226, 62,232, 11, 46, 56,160, 16, 18, 42, 21, 69, 18,125, 58, 55, - 95,138, 2,229,195, 21,162,146,175,211, 34,133, 33, 53,113, 33, 64,141,194,134,135, 73, 23, 65,220,105,127, 30, 91, 72,143,100, -215, 23,150, 18,178, 27,108,215,217, 73, 2,186,113,183,140,101, 48,251,183,203,198,146, 46,183,249,113,219,104, 55,191,115,149, - 27,183,118, 83,191,215,165,124,120,162,141,238, 60,104, 8,121, 28,165, 41, 45, 59, 41, 74, 73, 29, 84, 87, 90,122,181, 26, 91, -192,114,171, 11,107,146,210,134,156,104,187, 65,101, 33,197, 41, 36,146, 9, 37, 93,105,168, 47,191, 39,141, 92,178, 96, 56,211, -170, 6, 74,203, 15, 54,228,103,155, 35,161, 88,223,221,170,171,139,165, 24,154,187,180,185, 38,186, 11,229,223,139,113,254, 85, -227,158, 64,200,242,236,126, 45,206,200,252,100,227,214,133, 74, 20,116,205, 4, 60,251,204, 41, 37, 43,105, 77, 4,160, 7, 19, - 67, 83, 64,123,117,231,143, 55,249,128,180,195,107, 19,187,192,235,114,122,128,249,235,210, 94, 77,237,174, 38, 91,183, 12, 19, - 72,235,226,106,134,242,127,225,249,197, 19, 39,221,110, 23, 11,175, 33, 56,219,238, 60, 24,134,197,253,182, 24,142, 28, 86,212, -237, 89,140,227,170, 13,215,246,148,117,201,217,204,119, 13, 65,221,245, 87,161, 34,148,129,128, 21, 9,171,200,215,151,204, 77, -215,239, 54, 12, 66,231,145, 92, 98,244,131, 55, 45,187,187,125,240,222, 82,192, 83,201, 97,123, 99,213,176,154,131,225,244, 21, -235,215, 82,217,189,207, 54, 14,114, 14,172, 41, 15,145,239,192,165, 67,217, 63, 8,251,227,210, 80,139, 94,196, 68, 37, 17, 97, - 71, 97, 40, 67,105, 73, 64, 10,160,232,144, 10,246,128, 59, 40,107,223,171,123,123,228, 25,212, 57, 99,161,109,188, 15, 14, 52, -198,216,106, 58, 74,219,222,203,139,113,177,183,196, 81, 21,216, 0,235, 68,212,116,212,230,222,168,170,137,152,106, 84,180,240, -200, 76,150,182, 65, 0, 46, 57,116, 20,160,108, 66, 0, 10,168, 61,254,205,122,141, 37,211,173, 87,185,166,156,144, 56, 15,239, - 23, 80,167, 33, 42,138,218,181, 85, 0, 81, 46, 31,205, 74,106, 59,231, 74, 49,221,167, 31,252,182,165,176, 28, 68, 74, 40, 44, -164, 40,164,109,165,122,212,252, 99, 81,157,112,105, 97,244,155, 59,129, 55,179,225,189, 14,189, 59,146, 55, 54,162, 9, 4,126, -141, 37,183, 5,166,131,158,181, 21,221,188,182, 55, 40,184, 85, 24,173,186, 43,114, 86,218,122, 10,210,131,227,212,182,223, 17, - 77, 23,145, 80,110, 91,229, 46, 26,195,142,139,118,208, 55, 5,149, 54, 1, 73, 77,122,145, 74, 83,167,110,164, 51,115, 35, 10, - 47, 18,171, 22, 85,228,250, 11,174, 58,166,173,169, 42, 21, 86,221,137, 35,113,238, 34,130,155,191, 46,154,150,205,215,174,155, - 50, 84, 29,121,242,140,195, 42,220,213,191,101, 84,166,202, 20,223,176,151, 5,125,146,105, 84,250, 58,233,246,238,171, 73,241, - 5,109,143,121, 97, 80,144, 26,106, 25,106, 75, 42, 74,219, 37,176,164,154,119, 30,241,160,253,204, 10, 6, 80, 42,236,241,143, - 31, 73,199,152,101,169, 16, 92,143, 34, 50,208,122,142,169, 87,164, 26,118, 29, 84,220,220,137, 50, 53, 18,103,135,213,223,127, - 11,251,231, 27,139,152, 48,149,248,209,212,213,190,246,202, 16,144, 18,173,180,105,250,128, 15,182, 1, 74,137,239, 0,247,235, -181,249, 81,206,174,210,118,217,221,238,226,195,213,196,122, 56, 87,153,124,222,229, 97, 11,197,252, 67,222,193,253,189, 62,158, - 52,204, 85,151,122,136, 9, 9,104,213, 36,154, 84,141,119, 33,186, 14,154,224, 79, 96,164,219,230, 61,107,143,103,184,201,145, - 1, 87, 47,119,133, 37,212, 50,130,132, 61, 93,133, 37, 72, 42, 4, 18,132,146, 64, 61,186,203,243, 84, 13,221, 98, 29,221, 69, - 80,156,209,185,146, 2,128,184, 97,198,162,200,193, 33, 67, 92,205, 28, 93,153, 74,141,127,228,235,230, 61,101,183, 98,183, 25, -202, 69,146,243,147, 76, 85,176,195,136, 30, 75, 76, 62,251, 49, 19, 87, 82,232, 61, 3,130,157,228,141, 81,178,201,210,196,230, -105,238, 22,224,226, 80,143, 64,167,138, 15,217,142,140, 72,170,179,203, 88, 84, 11, 38, 73,119,182, 66,185,226,151,215,226,219, -211,113,149,247, 23,136,212, 40, 82,103, 4,168, 6, 74,141, 28, 89,221,243, 65, 58,174,248,118,217, 53,154, 37, 47, 4,128,163, - 21,255, 0, 10,126, 16,112,196,167, 93, 87, 87,109,114,109,233,126, 60,152,105,222,125,151, 18,227, 59,222,100,172, 87,208, 54, -144, 53,100,215,120,216,133,194,164, 7,234, 56,101, 71, 44, 22, 69, 56,125,245, 17,101, 56,164,169,212, 56, 93, 74, 84,216,118, - 61, 10,145,212,165, 61, 91,235, 66,117, 14,250,225, 63,102, 72, 7,218,159,227, 69, 33, 45,234, 20,142,185, 45, 9, 78,186,234, - 95,102, 74,131,225,183,155,120, 71, 41, 74, 79, 64, 10,122, 17,183,166,158,240,156,214,128, 16,140, 48, 69,163, 37, 6, 20,145, - 38, 91,174, 60,183,193, 41,220,119, 5,147, 85,181,235,169,235,221,169,140,136, 6,162, 82, 88, 58,104,205,174, 74, 84,242,147, - 40, 72,149, 16, 31, 25,216,226, 70,209, 38, 66, 71,179, 90,252, 61, 78,152,157,154, 64,211,129,236,202,150,225,162,149, 13,182, - 66,136,148,166,196, 86, 20, 29,117,130,106,170,248,102,190, 24, 34,166,157,123, 78,153, 51,128,116,140, 78, 11,245,210, 26,117, - 96,181, 50, 99, 62, 54, 57,112,199, 32, 72,141,100, 47, 92,109,223,124, 74,185, 55, 36, 92, 30,145, 30, 74,252,120,237, 60,132, -173, 73,105, 77,148, 10,160, 0,170, 30,163, 88,221,218, 54,238, 81,202,246,185,232,199,105, 13, 77, 32, 16, 16,144, 83, 16, 87, - 60, 71, 69, 73,122,196,208, 0, 69, 30,181,202,147,115,230, 34,206,200, 37,220,147, 9,230,151,116,121, 82, 18,193, 97, 76,161, -157,196,251, 96, 41, 8, 72, 74,192,220,154, 10,117,208,216,100,116,113, 54, 45, 65, 27,130,168, 43,243,229,149, 50,248,221, 8, - 67,237,161,109,106,190, 74,183, 73,133,100,109,184,214,248, 50, 89,102, 91,237,201, 73,144, 93,116, 18, 54,182, 8, 10, 35,106, -170,186, 26,107, 64,199, 69, 27,154, 36,247,136, 36, 96, 83,215,195,178,161, 92,218,177,163,197,113, 80, 41, 38, 5,239, 41,197, -111, 17,242, 12,118, 85,210,217,121,183,189, 34, 67, 87,135, 30,217,182,169, 83,100, 54,154, 18,225, 33, 68, 2,163,240, 13, 76, -185,177,183,220, 34, 48,204,214,185,142, 64,158,223, 69, 51, 28,141,140,224,157, 9, 70,109,200,133,125,183, 93,157,157, 14,100, -220,150,225, 25,229,192,158,166,215, 33,214,231, 41,196,157,229,199, 10, 82,162,163,184, 40,250,244,212,250,237, 92,208,210, 4, - 77, 56,140,130, 37, 9,140,130, 70,185,174, 26, 23, 17, 82, 46, 17,105,201,237,230,241, 98,135, 42, 42, 87, 39, 27,151,116,121, -249,113,131, 51,153,183,198,167,136,208, 81,170,145,226, 40,142,180,235,233,213, 38,233,121,111, 54,137, 92, 9, 73, 0, 64,112, - 36,228,125, 20, 12,172, 35, 83,129, 69, 74,132,174, 44,187,108, 82,110,141,190, 99,153, 10, 91, 12,172,109, 81,222,154, 21, 42, -190,209,173, 58, 87, 90,152,156, 39, 62, 25, 21, 42, 57, 90,226, 91,194,155,138,186, 78,145, 5, 54,160,233,158, 12,145, 39,193, - 9, 11, 83,142,162,180,170,187,122,110, 39, 83,220,193, 25, 14,201, 5, 41,177, 2,226,241,129,164, 87,101, 4,202,123,199,100, - 23,119,109, 90, 65, 73,240,150,154, 10, 84, 10,116, 3,174,159,107, 67,154, 18,157, 44, 45, 20, 73, 10,105,110,168, 58,130,166, - 66, 79,213,168,111,169,244,246,233,194, 75, 70, 20, 67,187,158,116,109,164, 37,135, 18,165,199, 83,141,250, 20,118,147, 95, 71, -103,102,155, 83, 46, 88, 80, 15, 25, 26, 91,145, 33, 40,109, 11,183, 61, 41, 47, 58,216,247,138, 44,182,176, 20, 5, 71,197, 82, - 14,146,157, 32, 26,102, 54,185,142, 61, 20,177,141, 77, 16, 25,144,137,240, 85, 54, 36,144,134,156, 4,133, 52,132, 3, 93,192, -208,148,145,214,148, 58,133,115, 19,110,189,210, 1,246,212,168, 95,225,189, 72, 86,165, 79,208,112, 59, 19,205, 49, 38, 36, 34, -227, 83, 26, 98, 88, 10,120,171,195, 4, 3, 69, 0,123, 5,122,131,172,219,223,224,146, 28,120,213,196,118,113, 17,169, 13, 67, - 92,153, 25,166,114,101,219,216,141, 25, 13, 90,209, 25,135, 91,102,137,105,116,246,213,243,122,119,211, 90,109,158, 49, 53,182, -161,246,150,145, 38,149, 64, 16, 82,215, 29,241,231,247,165,201,151, 11,159,139, 22,219, 26, 27,207, 91,235, 65,239,146, 55,117, - 34,191,178, 18, 8, 7,191, 85,251,213,251,108,152,216, 99,199, 20, 61, 84,108,183, 14,110, 57, 83,249,156, 18,200,202, 95,119, -199,150,181, 72, 89, 67,177,247, 33, 17,214,192,234, 18, 64, 77, 72,233,218,117, 82,217, 28, 13, 45,155,107, 90,229, 82,157, 20, -180,213,142,208,219, 34, 42, 32,176,150, 54,236,161, 72, 81, 0,250,207, 93, 40, 26,148,203, 72,227, 8, 26, 40,253,182,205,143, - 66,169, 54,232,235,117,160, 82,192, 83, 65, 73,234,122,146, 77,123,180,146,213, 43,198,155,248, 54, 52,130,214,129, 74, 94,239, -104,168,255, 0, 82, 79,135,226, 18, 91,216,159, 11,196, 52,161,165, 41,217, 81,163,167,124, 60, 19, 10,250, 19,155,200, 50,131, -132,178, 67,116,236, 32,214,191,159, 87, 34,253,163,141, 85, 62,236,156,169, 37,204,238,100,129,177,205,238,147,210,161,101, 41, - 31,159, 78,141,205,162,161,189,197,249,147, 73,239,222, 18,232,250, 80,226, 43,212,209, 91,141,126, 93, 44,110,160,113,168,197, -128,209,101, 72, 82,213, 84,110, 75,123,126,112, 52, 36,124,186, 31,205,177,206,147,160, 10,213, 1, 34,164,184, 79, 94,128,143, -106,167,227,210,191,154,245,208, 44,105,165,216,169,126,149,240,194,144, 71, 66, 85, 66,127, 62,135,243, 90, 73, 96,162,183, 9, - 73, 66, 28,142,168, 97,213, 47,217, 82, 87, 69,166,135,225, 52,209, 59,116, 14,192,210,217, 24, 24,138,105,206,176, 99, 83, 91, - 2, 78, 57, 9, 46,169, 39,233,209, 29, 12, 58, 8, 29,161,214,246,184, 62, 35,170, 91,235, 29,191,115, 9,113,109, 19,255, 0, - 89,141, 62,212, 90,177,131,112,184,182,253,220,175, 30,147,243,101, 77, 17,103,200,109,177,131, 86,185,102, 44,101, 5, 40, 65, - 99, 53,151, 37,166,215, 94,133, 8,153,111,146, 83,240, 37,105,248,117,203,247, 46, 64,138, 41, 76,219,108, 94, 3,248, 24,110, -101,136,250, 70,135,176,246, 17, 90,120,119,232,165, 26,110, 28, 94, 63,213, 19, 15,180, 61,166,155,206,101, 92,193,141, 57,226, -162,210,140,130, 18, 87,243, 93,110, 51,142,165, 3,247, 75, 50, 82,250,201, 29,229, 31, 22,161,127, 62,231, 46, 95, 61,214,124, - 68, 99,131,139, 28,239,188,221, 14, 61,165,181, 45,187,126,199,184,229, 47,132,238,199, 1,234, 32,129,235,160, 45,158,102,173, - 16,229, 42, 30,105,109,185, 96, 19,150,170, 41, 89, 67, 10,135,108, 74,143, 68,255, 0,172,172, 37,144, 20,122, 15,104,250,206, -180,219,119,156, 97,175,108, 59,157,172,182,239, 60,116,151, 55,230, 14, 31,116,246,212, 75,158, 70,149,205, 50, 90, 72,201,155, -254,146, 23,213, 82, 67,153, 65,185,236,148,139,139, 14, 69,146,210, 94, 97,230, 28, 14, 50,243, 75, 21, 10, 74,146, 72, 32,142, -194, 53,211, 45,185,134, 59,182, 9, 34,120,115, 78, 68, 21, 21,143,150,212,194, 75, 92,210, 8,204, 28,232,144,190, 33, 36,146, -246,228,215,189,202,118,124,122,123,249,207, 93, 23,128, 13, 23,159,146,153, 37, 1, 30, 18, 82,208,160,175, 82,163,242,232,127, - 57,235,165, 54,220, 10, 70, 57, 1,100,168, 56,211, 73, 43,236, 93,105, 66,126, 61, 36,239, 43,153,167, 91, 8, 52, 24,200,252, - 66, 91, 66,201, 61,155,186,237,175,203,166, 95,187,213,141,188, 1, 69, 58,172,210, 31,113,104, 41,113, 74, 82,138, 69, 9,232, -107,241,234,170,227,118,206,181,123,124, 77, 9, 95, 76,158, 94,184,237,172, 43,203,142, 9,101, 32,170,117,218,206,222, 77,118, - 82,211,180,153,215,208, 31,219, 79, 67,109, 20, 32, 87,209,241,107,203,252,213,184, 29,226,246, 89, 78, 65,218, 71, 99,112,246, -226,107,218, 28,143,183, 13,175,109,133,131, 50, 53, 30,211, 77, 12,227, 1,131,120,142,152,204,199, 74,164,200,113, 45, 32,246, - 6,218, 6,171, 89,167, 94,163,160,245, 87, 89,119, 53, 43,109, 27,210,161, 59,199, 15,219,160,130,194, 99,183,225,188,210,193, - 5, 32,236,108, 36, 2,146, 43,234, 53,249, 59,244,252, 79, 34,148, 92, 77, 64,119, 78, 42,128,202,231,161, 49,143,138,249, 97, -128,225, 77, 18,164,117, 90,251,201,173, 77,107,235, 62,173, 89, 69, 49,164, 56, 19, 76, 69,241,116,104,183, 32,234,218, 62, 35, -104, 90,188, 50, 54,161, 78,169, 65,196,158,222,190,210,250,254,189, 88,199, 49, 74,135, 43, 22,157, 48,240,196, 52,233,121,113, -144,203,109,110,101,164, 4,245, 64,238, 20,175,237, 81, 32,252, 26,146,217, 86,160,190, 33, 79,187, 38, 53, 29,218,165, 13, 36, -213, 13,169,181,109,162, 75,132,164, 26,252, 20,232, 61,122, 39, 61,105,131, 18, 83,162,110, 54, 26,106,136, 72,250, 80,130,164, -145, 82, 28, 41, 30,191,218, 4, 87, 77, 23, 82, 52, 45, 51,100,227, 9, 73, 11,240, 59,104,151,104, 59, 43,223,219,210,128,105, - 5,233, 64,178,146, 23,138,199, 91,195,253, 88, 0,162, 10,147,180, 84, 18, 5,122,122,193,236,210, 12,180,211,163,164,155,223, - 29, 69,121, 18, 9,140, 28, 11,109, 42, 62,192, 42, 64, 89,167, 78,180, 34,189, 14,155, 51, 83, 69,149, 4, 93,120,154, 40,125, -239,160, 71,213,168, 33, 69, 52, 11, 10, 59,146, 21,212,254,199,101, 61,122, 87,196, 26,143, 35,106, 58,184,112,253,182, 67,128, - 59, 13,176,181,212, 40, 20,239, 65,221,233, 21, 59,135,171,228,166,135,197, 17, 80, 94,226,218,106, 47,134, 24,183, 62,137,173, -176,141,205, 42,128, 20,254,197, 77, 5,107, 82, 59,171,163,248,162,236, 41,147, 42,210,133,203, 10,140,235, 44,190,136,222, 19, -137, 40,109, 84, 0, 5,164,244,165, 65,166,144,217,200,162,105, 43, 86, 43,139, 48,103,102,216,175, 56,196,138, 54,155,213,166, - 83, 17,100, 6,131,219,101, 50,146,235, 21, 77, 65, 62,218, 0, 52,235, 74,208,106,199, 98,221,255, 0,150,223,197, 56,224,224, -189,135, 3, 89,126,113,219, 70,233, 97, 52,103,252,164,250, 69, 85,153,240,157,247,167, 35, 37,175,109,165,173, 7,111, 68, 21, - 32,145,208,215,213,175, 87,197,186,135,128, 69,120,202,226,207,195, 36, 26, 44,187,116,178, 2, 87, 20,169,170, 80,168, 40, 42, -167,208, 71,126,164,141,206,171, 95, 2, 84, 47,201,124, 19, 23,146, 26, 48,221,202,114,156,122,223, 37,216,194,237,109,182,203, - 90, 97,203,131, 28,125, 75,109,149,134,217, 10, 63, 56,132,159,131, 81, 11,129, 36,234,114, 30, 11,128,236,232,166, 52,105, 43, - 81,126, 13,228,175, 12,199,110, 25,122,174,104, 57, 61,182,240,245,172,217,147, 45,186,220,160,162, 27, 59, 86,183, 30,160,246, -139,157, 64, 29, 41,168,174,179,134, 71,181,197,123,185, 0, 80,122,104,222, 76,128,112, 74,153,109,222, 88,248,210,217,122,186, -100,174, 97, 86,233,179,111, 81,124, 9,205, 92, 24, 19, 99,185, 78,190,202, 28,170, 27, 43,160, 10, 32,106,217,151,109, 97, 80, - 5, 14,246, 85,197,127, 48,188,115,200, 92,115,113,185, 99, 87, 11, 77,178, 20,124,178,249,127,204, 32,218, 44,165,147, 46,201, - 13,231,156,109, 13,190,148, 18,233, 74,163, 39,122,104, 0, 0,246,247,106,174,107, 72, 46, 39, 23, 14, 31,180, 1, 1,234, 85, -171, 8,229, 64,130,169,229,194, 12,148, 37, 66,173,168,178, 2, 40,165, 21,159, 24,143,101, 41, 31, 59,168,212,200,202, 57,105, - 24, 30,154,108,165,114, 82,242,208,227, 65,100,164,133,130, 54,169, 46,142,148, 61,105, 64,123,181, 98,219,114,113, 53, 49,182, -160,142,143,170,140, 90, 94,105,233, 47,195,146,133,164,181,180,199,121,165,133,165, 78, 82,190,215, 97, 29,117, 26,242, 55, 70, - 53, 4,164,220, 91,120, 96, 56, 28,234, 75, 76, 68, 8,254,230, 26, 67,202,157, 12, 8,211,165,201,117,166,152,144,250,168,151, - 2, 82, 65,168, 41,167, 90,141,103,223, 54,167,107, 84,210,113, 1, 49,234,168,108, 24,130,148,158,204, 59,229,150,234,211, 74, - 84,180, 75,101, 74,113, 18,216,121,101, 74, 43, 20, 11,108,208,116, 80,236,233,169, 13,124, 59,140,125,212,210,112, 67,243, 84, -150,188,198, 66,103, 83,164, 22,242,108,133, 41,112,166, 93,217,201, 12,179, 15,124,240, 21, 40,164, 13,161,180,239, 4, 4,128, -122, 17, 77,103,223,178, 65,102, 75,154,208,198,180,151, 97,151,111,109, 88, 27,121, 46,193, 40, 78, 21, 46,175,143,236,184,174, - 49, 46, 76,131, 26, 29,221,113, 82, 87,238, 15, 41,231,226,174,160,149, 60,165, 16,216, 61,169, 74, 82,159,135, 71,101,113, 37, -244,141, 44, 87, 48,158, 57, 30,207,157,107, 37,121, 28,238,152, 52,180,162,228, 66,122, 0,207,210,106,184,228, 78,221, 85, 33, - 81,227, 60,153,211, 29,111,199,121,110,237, 45,194,100,143,101, 29,201, 78,212,245, 62,189,107,237,237, 27,239, 16,141, 5, 7, - 93, 61, 29,152,247,156, 16, 15,111, 93, 1, 14,237, 38, 98,109,182, 47, 6, 37,177,198, 22,219,177, 39, 58,232,105,249, 53, 40, - 9, 74, 20,158,242,229, 85,219,168, 87, 86,130, 29, 82, 41,112, 57,142, 3,228, 40,131, 68, 42,224,164,147,234,169, 30,246,254, - 21, 6,218,192, 85,254, 74,114,134,197,201,169,162,212,253, 89,143, 9,164,161, 72,105, 75, 73,220,227,146, 92, 36, 43,122,136, -167,118,168,173, 69,204,146, 31,217,143, 11, 2, 20,113,199, 30,160, 7, 70, 52,213,175,137, 63,188,212,111, 95, 26,174, 87, 55, -163,220, 34, 41,111,202, 33,216,174, 40, 51, 30, 59,101,207, 13,135,205, 70,227,216, 40, 15, 90,107, 91, 2,177,200, 6,125, 53, -102,130, 60, 0,206,155,145, 31,102,215,112, 92,150,203,175,199,105, 37,173,237, 2,149, 37,197, 39,188,252, 58,153, 43,124,102, -233,165,144, 92, 19, 35, 73,253, 30, 81,121, 53, 90,214,226,150,176, 87, 68,251, 71,187,175,203,165, 17,164, 32,163, 36,180,161, -172,138,149, 61, 49,245,198, 82, 16,152, 72, 66,157, 59,124, 68,151,148,122, 38,149,161, 29, 52, 65,202,221, 36,103, 71, 39,236, -218, 11,179, 39, 10,117,205,185,155,220, 86,209, 38, 44,113, 58, 58, 10, 61,237,132,251,186,138, 43, 84,157,128,129,236,246, 29, - 71,142, 33,108,123,164,167, 69, 33,211, 12, 1, 20,144,216,144,228,132, 43,197, 42,241, 6,197,165, 39,160, 2,128,157, 60,196, - 74, 67,158, 8,169, 67, 13,178,220,174, 23, 24, 81, 90,136, 84,210,100, 23, 29, 91,233, 9,105,207,119, 5,123, 66,150, 67,123, -138, 65, 32, 19,215, 84,219,141,220,118,205, 37,113,234,207,235,163,183, 46,241, 3,149, 71, 69, 89, 88,141, 74, 90, 29, 76,102, - 55, 66, 97,178,209, 74, 15,187, 36,164, 15, 81,175, 78,241, 93,102,101,149,184,106, 61,227,233,173, 88, 64, 2,224,106,172,242, - 28,117,196,190, 92,151,214,146,131,114,251,122,148, 44, 81, 93,107,234, 58,222,109, 82,106,128, 1,195, 10,135, 59, 18, 76,106, -199, 91,153, 67, 86, 56, 18, 35,175,221,227, 57, 10, 42, 98,176,144,104,182,182,142,128,131, 74, 83,183, 88,185, 29,170, 82,210, - 20,169, 83, 83,218,153, 86,170, 9, 81,170, 73,167, 74,212, 83,174,156, 24, 83,130,181, 74,106,105,220, 59, 72, 21, 26, 82,165, - 29, 12, 90,220, 9,111,105, 9, 74, 73, 4,209, 68,159, 71,167, 69,169, 41, 53,174,215,104, 90,161,234,160,173,149,234, 84, 1, -235,249,244,165,163, 78, 53,219,134,148, 18, 2,156,113, 37, 93,251,151, 82, 15,203,172,127,243, 74,207,150, 10,221,217,109,176, - 55, 84, 45, 61,190,201,175, 95,151, 64,110,137,198,146, 99, 20,155, 39, 36,115,114, 89, 97,164,133, 30,213, 47,169,167,203,161, -252,212,209,136, 0,163, 48,111,178,214,164,182,183, 83, 82,126,106,187,193,248,244,109,220,143, 77, 7, 66, 13, 58,125,241, 1, -180,174,137, 11,165, 2, 73, 0, 19,242,233,223,230,102,154,240, 22,149,163, 94,149,224,132, 45, 45,213, 61,128, 40, 19,250,116, - 99,116,235,162,248,112,104,155,242, 93,121,210,225, 82, 69, 79,237, 47,187,229,208,254,100,105, 66,220, 81, 87,220, 83,169, 13, - 54,180,215,188,248,148,167,193,215, 64,238, 75, 78, 54,216, 10,109,204, 75,241, 84,135, 91, 86,231, 82,174,128,175,122, 77,125, - 61,116,217,220, 8,167,124, 17,149, 17,149,113,120,165, 75,150,178, 18,132,149, 16, 58, 84,250, 5, 77, 58,232, 29,202,128,128, - 84,117,118,203,172, 18, 24, 16,238,241,140, 86,100,128,209,106,255, 0, 19,192,136,250,221,233,176, 45,208, 99, 56, 79,102,212, -172,234,182,227,122,133,227, 68,195, 15,245, 12, 61,103, 15,109, 88,197,182,204,195,174, 18,164,113, 97,196,122, 1,212, 61, 85, - 77, 57, 62,227,147,121,125,191,218,114,236, 94,237,119,131,195,119,185,232,139,149, 88, 32, 41, 19,109,248,109,198,114,168,137, -177, 98,190,151, 88, 68,119, 9,170,219, 9,160, 53,218, 82, 74,117,131,221,246,182,216,220,139,203, 87,190, 48,227,137, 97, 68, -237, 25, 22,158,130,163,209, 93, 15, 98,188,143,153, 32,117,165,203, 24,251,134,142,225,112,197,192,112, 39, 61, 67,167, 63,109, - 79, 77,231, 51,153,137,110,151,122, 84, 9,182, 11,155,108, 59,110,204,241,245, 47,238,133,183, 44, 36,176,101,199, 82,221,118, - 48,122,160, 7,144,181,183, 82, 55,120, 99, 90, 6,115, 13,222,214,192,251,146, 37,139,241, 24, 17,192,116,185,185, 30,189, 40, -157, 4,214, 81,251, 60, 23, 79,116,112, 43, 37, 24, 24,222,115, 35, 48,215,113,236, 56,211,193, 18,165,188,194, 95, 97,196, 41, -178,141,201, 90, 28,222,149,143, 72, 32,208,235, 77,111,188,178,234, 49, 36, 78, 5,174, 10, 8, 56, 17, 84,111,128, 68,226,199, - 96, 71, 10, 1, 19, 37, 41,198,204,165,111,103,112, 42, 2,181,160,248,244,231,243, 19,211, 70, 34,111, 10,121, 67,157, 12,169, -189,141, 18,222,224,107,183,160,252,250, 14,220,169,216, 33, 67,157, 75,120,188,168,110,220,237,205,208, 54,135, 37,198,109, 75, - 34,129, 41, 82,192, 39,183,184,106, 5,198,226,141, 53,171,218, 97, 14,123, 65, 60, 69,125, 33,242, 87,154,158, 0,242,237,199, -252,121,255, 0,197,108,242,221,137,127,120, 49,203, 64,199,172, 34, 59,247,156,130,100, 6,163,180,143, 21, 48,160,183, 38, 64, -105,191,154,183,148,144,141,195,110,226,174,135,132,201, 32,110,167, 60,241, 63, 61,123, 98,202,226, 56, 32,137,171,246, 2, 14, - 57, 83,179, 15,204, 48,206, 70,176, 90,115,156, 34,243, 23, 37,197,239, 76,174, 77,154,243, 13, 46, 55, 26,114, 18,181, 33, 65, - 33,228,182,224, 40,113, 37, 10, 10, 72, 33, 73, 32,245, 4,106, 62,160,238,240,198,174,160,144, 72, 21,180, 79, 47,179,180,181, - 38, 90,134,208, 6,210,142,228,165, 32,128, 79, 94,242,170,232,136, 67, 83, 35,198,161,169, 48, 96, 62,235,232, 45, 81,197,186, -226, 80,118,215,234,118,142,157,123,194,105,169, 17, 58,156,116,102,152,215,124,125,135, 54,203, 75,105,250, 63, 17, 32,132,215, -115,109, 36,144,159,140,184, 63, 55,163, 86, 17,185,106, 51,216,148,213,154,150,217,109,224,118,160,168,169, 71,119,106,156,111, -105, 6,181,248,245, 49,133, 42, 19,217, 74,152,164,116,172, 47,104, 72,109, 33, 99,211,211, 96,245,247,168,105,101,212,195,219, - 82, 50, 45,172,190, 16, 28,216,165,184,181, 44, 44,118, 36,142,207,151,105,211, 46,117, 39, 69, 12,237,130, 50,219,108,134,144, - 86,160, 80,180,208, 0, 18,217, 32,143,132,164,212,105,146,250, 73,142,145,151,136,180, 10,210,132, 81, 77, 44,251, 4,244, 61, - 1, 20, 63, 6,153,116,148,219,152,148,135,119,177,248, 33,106, 66, 42,150,210,179, 94,212,173, 3,180, 30,189,104,127, 94,153, -115,234, 59,153, 81,125,198,218,194,150,255, 0,176,147,225,123, 73, 77, 43, 84,215,176,245,253,147,217,164,137, 42, 44,141,166, - 20,251, 36, 70,192,115,106, 78,213, 33,197, 30,193, 66, 73, 35,183,165, 6,149,169,106,182, 97, 77, 11,228,102,217, 97,194,104, -170,173, 40, 36,116, 4,252,190,201,236,248,244, 26,106, 38,149, 52,211,181,196,140,250,151, 25,109, 37,230,157, 81, 66,211, 65, -208, 56,123,186,244, 53, 33, 73,249, 52,153, 93,167, 26,119, 74, 85,143,193,109,169,180, 75,132, 20,216, 83,105,121,130,146, 69, - 82, 77,126, 30,197, 15,202,186,134, 37, 33,192,241, 21, 26,230, 49, 43, 11, 78, 68, 85, 54,207,236,209,237,153,134, 79,108, 75, -204,152,240, 47, 23, 38, 99, 56,149,130,181, 52,135, 87,178,167,165, 78,222,218,247,235,209,251,110,234,102,129,142, 92, 75, 71, -205, 94, 53,223, 44, 69,188,242, 55,161,199,231,168,226, 58,214, 29, 20, 85, 80,149,145,208,212, 19,242,234,218, 61,193,120,214, - 74,104,192, 57,210,179, 14, 45,215,130, 86,148, 43,169,173, 71, 65,167,155,185, 26,130,230,117,210,211, 97, 0,144, 26,217,180, -118,138, 0, 72,211,191,204, 9,227, 67, 64, 52, 28,203,237,190,203, 2, 93,210,243, 41,152, 86,216, 12,169,231,223,144,104,132, - 33, 31,164,158,224, 52, 62, 61, 2,147, 68,228, 96, 82,107,148, 94,109,121, 63,141,121,130, 75, 86, 75, 6, 56,220,183,225, 4, - 46,126, 74, 97, 8,183, 39, 0,170, 91, 67,110,164,248,193,176,154,212, 19,241,105, 63, 19, 36,142,107,195,136, 1,112,233, 53, - 13,247, 14,105, 5,167, 10,167,107,196,120,234, 4,139, 12,139,133,166,224,244, 59, 69,198,223,117,158,203,225, 14,220,174,168, - 96, 2,182, 67,244,234,218,182,128, 19,219, 65,167,163,186,121,120, 45, 56, 28, 19,128,244, 81, 71,112,231, 59, 4, 76,191, 77, - 80,156,182, 67,111, 93,175, 82,217, 99,221, 89,149,113,184, 75,102, 56,233,238,237, 62,234,148,148,127,228,131, 77,116, 88,143, -116,118, 86,197,140, 66,148,238,227, 28, 81,139,176,185,195,144,200, 18,153, 85,181,240,253, 10,157,219, 32, 21, 16, 58,246, 40, -122,117,159,222,110, 68, 32, 60,156, 16,212,151,217,120,132,181,213, 98,156,198, 45,145,132,107, 60,246,158,144,155, 96,115, 97, -247,143, 17,144,242,186,128,118,154, 16, 1,166,185,164, 87,211,110, 79,241,173, 64,240,158, 70, 39, 5, 3, 2,156, 65,167, 89, -180,194,204, 74,173, 72,150, 38,173,182,251, 29,198, 28,123,100, 71, 38, 92,148,211, 42,157, 34, 40,125,246, 98,180, 58, 54,211, -138, 63, 70, 7,203,166,174,182,249, 31,185, 91, 73,168,233,105, 61,208,228,196,253,162,223,181,243, 85,133,189,147, 2,160,167, -158, 47, 96,146,185, 81, 68, 68, 43,222, 11,136, 75, 1, 9,169,222,174,130,130,186,232,119, 49, 49,209, 56, 73,238,166, 53,105, - 28, 66, 32, 94,236, 0,198,186,209,228,235,240,230,159,230, 27, 43,196, 47, 25,173,178,225,116,224, 65,152, 93,177,222, 71,202, - 44, 83,162,137, 2,253, 10,206,228,230, 45, 49, 18,249,113,126, 44,135, 94,142,201,144, 90, 40, 66,150, 1, 59,168, 53, 85,181, -110, 14,141,102, 99, 90,210,214, 29, 12,114,226, 1, 13, 47, 32,125,145,137,205, 78,147, 91,175, 41,185, 30,227,157,239, 34,220, -230,138, 49,100,215, 72,221, 15,247,156, 90,208, 53,185,169,238, 43,148, 98,170,211,134, 85,203,254,120,242,183, 39,128,185,203, -151,248, 74,117,178,117,226, 54, 7,152,228,120,235,215,249, 12,120, 73,153,106,130,251,138,183,204,115,160, 1, 50,160,150, 95, - 9, 31,189,171,123,141,231,226, 88,201, 67,131, 92, 64, 45,111, 28, 64,195,182,184,207, 62,237,110,229,219,249,237, 73, 66,201, - 8, 96,226, 90,113,105,237, 45, 34,168,162,109,118,107,150, 79, 2,222,233, 84,123, 76, 7, 29,141, 34,227, 37, 36, 58, 67, 1, - 75, 7,169, 1, 0,237,162, 82, 59, 6,167,110, 6,107, 88, 28,224, 21,231, 20, 29,127,227, 88,221,197,146,218, 70,231, 39,124, -226,149, 25, 95,172, 15,137, 75,185, 68, 43,110, 4,217,210, 26,131, 69, 16,183, 91, 71,125, 1, 39, 82,173,110, 1,110,135,123, -192, 5,165, 91, 92, 32,209,246,128, 11, 76,137, 77,207,182,201, 8,241, 29,109,194,144, 84,146, 73, 14, 3,217, 81,223,171, 40, -180, 76,213, 65, 86, 17,145, 48,167, 13,128,148,203, 8,155, 21,231, 26,112,165, 82,163,200, 65, 8, 90, 86, 71,180,107, 74,118, -246,234, 13,211,155,165, 88,225,212, 65,167,159, 25, 35, 10,121,101,220,125, 92,113,121, 70, 58,165,165,184,238,186,151,163,211, -232,220, 64,161, 88, 20, 61, 10, 43,170,123, 77,219,246,222, 12,156, 69, 95,237,150, 70,230,220,204,246,226, 10,118,211, 71,133, -173,240,111,121,186, 44, 55,116, 47,221,110, 17,158,121, 65, 43,216,175, 22, 0,223, 78,222,187,147, 81,170,191, 49, 57,142, 94, - 85,219, 93,123, 11,117, 57,164, 14,161,171, 5, 61, 66,151, 30,222,203,243,165,252, 49, 21,106, 87,194, 56,250, 46, 87, 0, 26, -150,220, 9, 80,155, 84, 37,169,226,124, 23,150,122,208,215,229, 26,231,158, 95,121,141,125,205, 50, 72,219,134,181, 35, 28, 6, -107,149, 71,190,218,161,134, 48,230, 28, 73,245, 37, 74,152,239,149,155, 17,178, 49,119,187, 51, 50, 56, 92,130,212, 85, 34, 82, -155,117, 81,157, 72, 9,121,193,212, 83,119, 80, 53,146,187,243,178,111,230,151, 59,124,122, 72, 97, 58, 48,207, 78,109,237,165, -187, 99,143,194,107,241,199, 63, 77, 57,242,206, 47, 24,244, 43,124, 43, 4, 95,122, 92, 86, 74, 86,164,182, 11,196,188, 0, 82, -234,154, 5, 26, 14,218,106, 79, 42,249,143, 6,244, 95, 53,219,131, 59,201,137, 65,212, 16,229, 75,142,193,182,238, 13, 3, 42, -140, 22,212,248,172,136,178, 18,251,102,133,207,119, 36,132,184,149, 84, 14,158,154,235,164, 13,198,218, 87,130,215, 52,147,145, -169, 90, 20,173, 87,142, 93,136,234, 47, 16,156, 92,115, 24, 63,107, 80, 13,144, 69, 67,106, 61,122,250,107,173,215, 46, 78,217, - 98,118,151,106,199, 58,131,116,212, 32,212,155,128, 92,228, 93,112,251, 17,222,218, 69,189,151, 96, 40, 41, 96,157,236, 40,130, - 72, 38,189, 64, 20,213, 30,229, 19,109,231,126,120,149,169, 81,128, 66,244,211,150, 66, 17,236,169, 5,123,150,176,149, 36,160, - 0, 22,179, 68,129, 78,221,221,195, 81,161,148, 60,166, 31, 44,233,110,120,132, 43,136, 2,138,181, 45,182,151, 37,150,228, 32, - 58,193, 45,202,106,160, 45,146,149,109,246,135,119,181,211, 82, 95,110,226, 3,136,195,133, 69,102,225, 12,197, 3,133, 12, 86, -178, 66,171, 69, 14,160,142,134,186,105, 42,110,154,247,114,255, 0,125, 93,181,173,122,215, 73,212, 21, 56,209,233,174,197, 72, -107,195, 72,113,153,105, 4,132,246,188, 8, 81, 53,232, 58,250, 6,184, 37,223, 55, 89,217, 5,124,131,215,242,232,164,193,178, -220, 92, 96, 35, 52, 78, 66,100, 52, 69,101,138,168,110, 4, 56, 20, 8,236,244,250,117, 62,211,124,142,245,130, 72,220, 8, 52, -196,187,123,237,221,165,205,198,136,169,183, 84,173,229,218,171,183,112, 61,223, 46,165,182,255, 0, 94, 68, 83, 70,217,195, 54, -214, 42, 60,226, 66,227,188,231,136, 15, 78,191,211,165,139,211,194,141,176,245, 82,131, 81,238,142, 83,198,121,222,157, 42, 87, -253, 58,115,227, 9,160, 97,234,167, 44, 91, 68,221,187,209, 45,104, 89, 29, 1, 85, 71,233,210,133,217,164,120,125, 84, 93,228, -222, 34,184,166,158, 94,244,171,230,184,159,157,250,116, 13,227,169,225, 8, 60, 41, 22, 75,179, 16,165, 85,247,135,101, 61,163, -254, 93, 54,111,136,167,155, 23, 85, 36, 73,187, 92,155,162, 67,196, 54,154, 16, 84,106, 79,231,209,139,226, 41, 98, 6,158, 20, - 11,215,217, 50,227, 6,158,100,215,160,223, 74, 2, 6,148, 47,150,147,240,205, 24,165, 33, 93, 46,142,187, 28,197, 12,178,166, -214, 11,110,135, 80, 22,149,160,247, 16,106, 8, 58, 73,189,213,129, 20,203, 98,208, 84,103, 80,222, 73,132,170,227,105,185, 91, -237,102, 44,171,109,214, 43,209,110,248, 85,213,103,251,191,117,136,240, 33,104,142,125,163,109,118,134,173,173,177,176, 42,133, - 72,175,180, 43,101,143, 72, 34, 60, 1,205,191,100,250, 56, 30,177, 87, 54,187,150,153, 26,233, 65,212,211,132,131,222, 7,175, -252,195,164, 28, 83, 35, 85,147,203,143, 35,177,134,229,217, 39,150,108,215,222, 83, 30,179,191,184, 43,201, 26, 72,150,213,178, - 72, 82,157,181, 62,159, 16,182,165, 4, 18,166,136, 42, 73, 27,182,213, 37, 26,207, 54, 73,164, 91, 95, 21,209,181,115, 1,164, -254,175,120, 16,135,171,233,173,183, 49,237,205,186,133,155,188, 44,107,156,131, 90, 18,138, 50,120, 68, 56,117,250,114,165,108, -235,204, 52,223, 46, 25,226,176,140,191, 28,151,121,196,238,141, 53,117,178, 93,109,242,150, 37,139,123,196, 52,165, 39,198,113, -239, 24,160,160,151,129, 80, 37,123,136, 32, 30,174,109, 34,110, 95, 38, 16,237,113, 42,133,192,133,232, 76, 61, 9,195,174,163, -195,176,195,206, 48,124, 84,110,209, 48,193,193, 48, 81,237,236, 61, 21,121, 44,114,109,185, 13,178,217,117,181, 56,153, 16,174, -240, 98,220, 97, 59,216, 87, 18, 98, 18,226, 9, 4,244,246, 84, 42, 53,176,109,238,161,133,115,121,224,125,179,220,199, 4, 45, - 36, 31, 69, 57, 25,181, 33,167,144,133, 56,176, 9, 30,202, 77, 5,116, 78,187, 74,145,111,143, 10,151, 99,225,249, 45,155, 21, -123, 61,147, 22, 44, 44,106,219,111,186,222,211, 62,237,122,129,102, 92,200, 22, 22,158,126, 67,177,217,153, 41,135,164, 33, 34, - 59,137, 10,109, 4, 41,105, 40, 73, 43,246,117, 91,115,185, 8,195,179, 32,102,128,159,104,174,153,203,124,159,185,110,177,139, -152, 32, 38, 63,243, 18, 0,195, 50, 53, 16, 72, 29, 75,146,103, 84,251,128,145,201, 30,124, 60,223, 98, 54, 44,230,247,117,157, - 27, 38,185, 54,229,250,226,151,138,213,140,241,158, 30,194,156, 92,104,219,170,220,112,204, 24,226, 59, 21, 20, 46,173, 37, 91, -148,163, 94, 97, 51,219,118,242,153, 41,175, 76,237,118,157,214,181, 73, 32, 0, 79,101,125,151, 91, 91,177,227,216,254, 55, 99, -199, 33, 68,179,216, 49,200, 16,108,246,123, 92, 84,120, 81,109,246,251, 99, 65,166, 91, 66,107,243, 90, 66, 82,145, 95, 71, 94, -186,112,185, 17, 43,101, 4, 90, 66, 80,217, 11,158,245, 21,151, 20, 64, 76,160,216, 53, 85, 18, 19, 66, 71,127,168,104,206, 53, - 54, 32,134,161,121,173,182,195,242, 83,188, 23, 16,151, 85,208,154, 0,178, 74, 79,111,236,233,216,194, 84,163,136,166,109,210, -229,238, 17,159, 74,213, 86,219, 4,163,113, 29, 64, 66,135,166,189,164, 15,139, 86, 49, 5,168, 51, 84, 51,147,220,202,212,151, - 83, 93,143, 54, 28,108, 37, 84,232,234,208, 59, 43,208, 80,234,198, 38,213,123,141, 40,226,215,230,182, 46, 34, 29,240,212,223, -142, 10, 73,234, 84, 85, 79, 79,238,233,199,178,163, 57,220,106, 96,182,222,154,113,230,146,163,185, 78, 4, 26, 87,165,105,211, -191,248,181, 21,237, 74, 32,234,115, 34,119,136,218, 30, 65,170, 3,136, 80, 79, 74,215,109,105,219,233, 21,212, 71,138, 88, 34, -182,114, 90,131,200, 86,239,162,222,227, 75, 77,122,168, 44,146, 15,111,160,234, 51,169, 46, 66, 41,171,122,185,160, 54,166, 40, - 64, 7,104, 4,246, 5,131, 81,219,233,169,248,180,219,141, 66,147, 10,136,238,206,180,210,220, 94,237,141,186, 86, 21, 67,212, - 33,164,212,119,247,154,233, 34,161, 61,213, 20, 92,110,141, 49, 37,197,151, 71,128,240, 41, 82, 66,170,148, 56, 27, 7,211,208, - 21, 36, 83, 79,129, 85,243, 21,166, 13,238,240,135,144, 16, 84, 75, 78,165, 59,200,234, 80, 19,209, 68,122,104,160,126, 77, 45, -173,168,128, 99, 77,108, 81,249, 31,127, 58,149,149, 6,148,180,148, 36,154,215, 98,169, 74,215,184,211,175,199,164, 92, 14,237, - 73,193, 42,238,227,203,103,116, 52,169,180, 56,180, 70, 14,172, 41, 65, 33,192,138,168, 84,214,128,138,117, 58,167,107,195, 9, -115,138, 1,153,170,235,199, 22, 70,242, 56, 3, 84, 91, 41,192,178,183, 46,215, 43,132,248,109, 36,207,153, 38, 86,233, 51, 90, -109,192,135,220, 81, 0,239,118,181,235, 77,111,225,243, 43, 99,180, 96,105,189,135, 12, 48,114,229,217, 94, 82,222, 54,219,153, -229,115,188, 55, 98, 73,166,236, 44, 9, 98, 67, 77, 74,153, 5,149, 72, 80, 2,183,104,233, 67, 99,248,168,233,219,241,232,228, -243,135,151,237,129, 46,187,105, 79,242,135, 31,152, 99, 89,137,118, 27,151, 28, 99, 79, 72,165,197,113,204,246,230, 24,240,238, - 22,121, 64,167,196,109, 98,249, 16,161,226,154, 85, 8, 88,127,106,148, 61, 0,232,219,231, 87, 46,150,135,139,176,132,166, 45, -120, 35,180, 22,168, 29,102,163, 30, 92,185, 46,210, 35,199,180,125,116,227,103, 10,188,176,218,203,214,246,227,182,218, 65,121, -229,204,142,182,129,236,249,193,210, 15,197,171, 59,111, 55,121,122,225, 3,111,225,199,253, 73,151,109, 71,118,193,116,213,253, -145,170,203,230,123,141,121, 43, 40,198,162,227,216, 28, 75, 59,193,244, 61, 58,238,101,228, 48,237,201, 91, 17,232, 16,218, 75, -175, 36, 21, 18,107, 74,215, 80, 47,188,234,229,171, 89, 24, 31,119,172, 23,125,134,185,233,219,164,101, 81,230,229,187,185,208, - 8,208,103,137, 2,185,198,175, 39,188,170,211,139, 76,172,135, 6,176, 38,224, 99,190,243, 79,228,254,254, 91, 81, 86,197, 50, -178,202, 30, 81, 40, 29, 73,173, 61, 7, 66,235,251,129,216, 66, 24, 89,113, 42, 46, 81,145,195, 62,241, 25,210,191,245, 41,221, -139,139, 71,166,154,247,127, 42,153,132, 75, 96,102,227,153,225, 30,240,220,226,132, 60,221,205,233, 81,197,188, 21, 10,149,120, - 73, 88,219, 90, 10,252, 90,122,219,207,125,182,119,172,118,215, 30,239, 22,128, 87,163, 58,114, 30, 83,124,114, 52,189,205,208, -184,166,117, 70,115,207, 42,249,108, 25,147, 94, 57, 14, 45, 49,141,225, 77, 24, 50,221,113, 14,165,125,125,146, 91, 0,144, 59, -181,212,246,159, 56,172,111, 88, 27,224,204,211,214, 7,215, 87,243,217, 6, 57, 90, 69, 21,193, 44,139,195,111,254,245,150, 43, -117,158,117,173,187,108,183,109, 43,219, 38, 60,187,122, 74, 89,116, 33, 84, 83,137, 61,139, 2,158,157, 51,204,219,228,155,205, -153,102,218,158, 48,114,128,241,129, 7, 48,163, 35,209, 79,135,181,228, 23,116, 84,203, 13,206, 50,143, 62,216,227,217, 68,201, -108,188,165,185, 57,183, 45,206, 50, 90, 36,157,181, 39,169,245,211, 92,218,219,255, 0,108, 12,116,113,197, 24,104,192, 33,106, -122, 42,198, 6,197, 32, 58,134, 53, 51, 34, 47, 27,170,212,243,176,175,137,153, 41, 76, 32,192,140,203, 74,104, 38, 65, 85, 9, -119,114, 69, 61,158,186,184,217, 54,109,214,125,202, 11,171,182,150,232,119,120,170,141, 41,128, 24,250, 42,194,206, 18,133,169, -157, 72, 60,113,139,191,145, 93,163, 91,236,208,167,221,165, 4, 46, 67,145,237, 80,221,153, 33,168,237, 83,123,139, 75, 73, 90, -155, 66, 42, 55, 44,138, 14,243,174,215, 44,134,232,104,140, 18, 74, 12,186, 74, 86,143,109,216,230,220,222, 33,130, 50,247, 20, - 8, 1, 57,148, 82,156, 58,235,238, 47,203,255, 0, 7,224,222, 93,184,171, 13,192,113, 95, 29,188,121, 55,219, 10,243,151, 17, - 41, 50, 33,171,145,161,251,155, 46, 93,146, 21, 87, 25,106,124,219,106, 33, 45,148,154, 85, 77, 40, 36, 31, 21,107,202,238, 23, -179, 94, 92, 56,134, 0,241, 11,132, 96, 4, 38, 50,195,129,224, 92, 26,239, 19, 87,235,117, 1,235,251, 29,177,219, 88,109,188, - 17,181,169, 9,210, 26, 52,247,116, 41,203, 55, 6,157, 68,226,112, 32,240,175,153,127,197,202,126, 46, 60,249,114,253,169,167, -227,123,188,200,220,100,206, 66,150, 39, 8,161, 55, 52, 99,214,173,254, 33,220, 17, 80,217, 65, 88, 61,253,189,107,170,230,109, -211,221, 89,178, 72,166, 44,144, 52,233,192, 30, 37, 56, 46, 33, 61, 25, 87,150, 60,205,218,109,239,183, 93,111,141,165,250, 91, -137,233, 35, 3,247, 83,209, 92,127,243, 15,199,252, 43, 19, 22,200,238, 88,158, 69,143, 92, 47,208, 24,138,166, 88,137, 36, 25, -243,102, 73, 41, 73, 75, 65, 36,120,138, 66,107,186,154,215,114,198,231, 53,172,113, 65,114, 73,195, 18,125,100,159, 78, 85,142, -223,246, 59, 49, 17,240,222,194,230,180, 46, 88,245, 10,160, 24, 85,198,125,183, 45,177, 34,249, 25,231,172, 41, 76,155,108,176, -166,247,166, 28,123,144,219,226,147, 83, 66,218,168,107,220, 53,111,189, 79, 4,246,239, 48, 60, 7,230, 49,204,142, 21,205,101, -218,216,240,244, 8, 93,198,165,247,120,251, 21, 99, 44,220,253,206,217, 46, 51,143, 70, 17,165, 42, 66, 92,136,203, 46,169, 36, - 58, 78,239,216, 29,163, 89, 27, 78,111,150,125,189,210,186, 50,215,183, 82,179,137, 45, 81,135,111, 10, 59, 13,163,225, 48,115, -181,116, 97, 86,165,142, 48,226, 73, 51, 45,242,215,153, 99,179,218,105,160,205,201,199,230,180, 95,125, 64, 10,165, 7,120,218, -154,107,202,187,247, 57,243, 37,244,132, 54, 9, 98,141, 85,173,107, 72, 3,172,244,154,210, 50, 56,180, 16, 64, 90,100,114,204, - 60, 25,150,238, 54,236,114,101,183,238,193,110,121,192,136, 15,180,180, 73,150,240,235, 64,149, 16,123, 5, 78,186,247,150,147, - 94,195,102,199, 95, 23,120,133,231,222, 85, 13,225,158, 85,121,106,216,219,108, 26,226, 6, 4,250,234,133,241,117,142,225,108, -229,108, 46,235, 57,149,194,182, 28,133,177,114,150,234,118,177, 22,220,241, 83,107, 83,166,180, 72,216,173,117,126,125,158, 29, -215,101,186,129,132, 57,230, 62,232, 25,151, 12, 66,122,107, 44,192, 99,118,161,215, 93, 2,201, 50, 28, 70, 37,220,196,129,147, - 91,238,113,218,217,244,241,148,162,202,106,105, 65,211,173, 7,105, 26,229,126, 88, 88,187,102,177,149,247, 44, 44,149,231, 35, -154, 1,133, 68,153,175,153, 48,192, 84,242,247, 52,113,148,107, 59, 22,213,222, 85,112,115,220,153,142,168,208, 33,187, 33,244, -148,164, 38,180,218, 58, 36,247,215, 94,114,119, 33,111,147,110, 46,189,100, 90, 63,106, 92, 11,156, 0, 56,175, 79, 17, 90, 33, - 36,126, 30,131,209, 77,216, 60,175, 96,155,111, 67, 48,237, 25, 12,249,236, 63,182, 59,237, 90, 86,134,228,177,212, 83,122,202, - 82, 9, 71,175, 90,253,199,146,222,219,135,191,196,141,145, 72,195,168,106, 10,215,116,160,232, 53, 93, 11, 30,222,208,112,166, -115,104,183, 92,224,190,202,112,204,213,233, 43,146,144,204,144,134, 88,172, 84, 21, 43,106,220, 46,157,148, 81,169,233,171,152, -117,237,143,137,194,230, 3,162, 48,210,186,142, 61, 32, 38, 56, 82,244, 60,188,185, 48, 37,106, 42,201,248, 15, 55,228,171,133, -185,199,229, 68,180,177, 27,197,136,202,174, 18,146,165, 48,219,202, 27, 75,138, 30,129,240,235,164,237,190,108,237,252,178,199, - 54, 54, 23, 40, 24, 52,102,153,167,109, 54,253,189,211,165, 63,112,239, 43, 87,220, 1,169, 76,222, 50, 28,121,248, 49,215, 34, - 98, 95, 46, 41,229,184,250,246,165, 9,101,162, 91, 75,129, 74,246,190,118,179,187,191,158,145,239, 9,240,208,188, 56,160, 76, - 48, 28, 84,226,157, 25, 84,150,109,133,129, 9,169, 54,197,194,182,203,171,173,220, 37,100,111, 66, 22,199, 75,168,113,171,123, - 48,225,153, 40,175,181,185, 69,210, 10,123, 82, 79,126,178,247, 30,110, 93,237,142,119,135, 19, 92, 94, 56,146, 72, 29, 67, 15, - 77, 38,109,141,151,141,211, 34,165, 45, 39,135,184, 22,221, 29, 13,220,172,217, 45,254,243, 62, 66, 80,244,166,174,133, 44,186, - 84,165, 56,165, 57,225,208, 44,168,154,147,219,170,185,252,218,230,107,183, 19, 28,209, 71, 24, 25,104, 10, 59, 22,132, 60,187, -107, 16, 29,197,167,213,187, 28,227,187, 82,238,176, 99,113,189,161, 5, 17,255, 0,245,107,215, 24,206, 94,238, 97,138,124,242, -218,148,150,232, 9,237,173,117,149,188,231, 77,226,240, 50, 71,223,201,159,120, 52,134, 53,123, 70, 53,115, 21,139, 27,128,109, - 53, 82,168, 30,236,235,127,220,219, 0,180,155,147, 13,151,127,185, 73,220,167,194, 92, 72,123,195,241,124, 74, 36, 18, 43, 90, -117,236,239,212,147,189, 93,120,129,255, 0, 25, 47,137,164,255, 0, 24,228,163, 5, 68,250,104,124, 39, 86, 29,149,103,103,113, -228, 89,109,205, 93,138,253, 46, 75, 81,100,161,184,205, 72,117, 49,228, 60,212,161,226,161,197, 0, 13, 66, 90, 27,134,218, 15, -105, 34,186,243, 20,124,217, 59,147,226, 7,206, 71, 71,203,211, 93,168,109,172, 11,160,125, 21, 2, 78,202,101,202,180,139,173, -134,237, 10,247,105,148,227, 49,224,220, 45,147, 27,184, 69, 91,177,253,135,146,151,153, 91,141,170,143, 84, 18, 21, 65,217,221, -174,133,105,187,220, 91,159, 11,196,123, 10, 98, 20,131,234, 40,106, 29,230,198, 32,144,178,120,136,120,204, 57,168, 71,104, 56, -214,136,229, 27,253,186,169,149, 2, 44,135,144, 80,166, 66,130,155, 11,107,102,250, 86,134,167,106,147, 74,122,251,245,119,183, -243, 5,222,216, 16, 78,116,144,185,175, 31,209, 85, 55, 59, 28, 19,144, 92,207, 85, 61,241,254, 90,182, 78,147, 8,207,182,188, -211,104, 75,110,251,224,109, 73,105,147, 43,123, 96,171,168,239, 6,149,238, 53,238,213,246,193,230, 13,237,153, 6,225,193,236, -213,143, 74,103, 84,251,135, 43, 71, 43, 92, 34, 26, 77, 75, 80,179,124, 65,110,168,174,247, 24,183, 41,214,132, 86, 84, 54, 16, -144,216, 39,111,237, 40, 19, 83, 93,117, 22,121,141,183,185,186,181,160, 29, 85,141,127, 43,221, 40,104,102, 63,166,158, 63,125, -218,144,178, 73,127,192, 74,210,217,127,194, 40,100, 85, 69, 39,169,167,101, 43,172,214,227,231, 54,223,106, 72,132, 57,231,171, - 10,181,179,228, 43,153,211, 89, 13,163,176,175, 56,253,193,137,143, 19,189,184, 72, 82,150, 92, 52,112,108, 80, 77, 2, 65,170, -143, 94,237, 85,193,231, 92, 90,218,217, 96,112, 7,143, 69, 79,127, 32,200,209,221,120, 90, 21,216,120,179,184,237,215, 43,145, - 57,171,109,138,201, 4,220, 46,215, 41,132,134, 97,178, 84,148, 33, 52, 27,150,181,188,234,210,219, 72, 72, 37, 74, 32, 1,218, - 71, 85,216,249,138, 30, 97,107, 77,185, 87, 30, 28, 71,111,215, 85,150,124,155,123,127,115,240,177, 55, 28,203,143,186, 7, 73, - 61, 29,129, 73,192, 10,131, 36,243,247,147,120,216, 29,250,116,172,251, 41,189,242,180,230,236,241,176,140, 22,223,106,141,110, -178,177, 57,201,177,140,227,120,184,161,251,147,177,139,118,194,249,105,181, 71,111,233, 0, 5,100,123, 42,180,112,153,183, 77, -129,205, 0, 98, 78, 32,187,208,210,132,142,197,174,179,182,249, 39, 20, 81,234,189,186, 14,123,135,117,145,144, 15, 89, 37,192, -224, 7, 4, 28,104,227, 89, 22, 41,125,178, 34, 85,137, 15, 54,243, 72,140,137,172,123,250,110, 76,165,249, 33,101, 32, 44,197, -132,235, 36,108,161,105,104, 39,191,118,169,111,185,154,215,111,186,117,164,143,210,241,193,193, 48, 64, 87, 62,190,129, 92,235, -155,185, 42, 29,161,229,182,142,149,200, 80,135, 0,153, 42,135, 2, 15,160,180,118,210, 43, 80, 90,150,173,175, 13,187,168,118, -254,208, 30,158,221, 79,143,116,142, 95,117,205, 62,154,231,114, 91,190, 44,193,168,159,144,111, 77,113,197,210,203,144,251,234, -102, 98,119, 11,212, 12,107, 44,142,167, 67,231, 31,145,121, 90, 88,133, 61, 36,168,150, 80,153, 59, 90,125, 7,161, 10, 10, 3, -112, 53, 55,110, 44, 15, 13, 14, 11,208,184,213,165,134,218,237,198, 55, 51, 65, 15, 13, 46,105, 76, 28,152,150,245,225,136, 61, - 73, 85,183,207, 47, 22,135, 56,233,190,100,176,180,187,102,113,198, 55, 27, 77,214, 37,214, 41,240,228,191,107, 84,150,208,166, -150, 69, 10,188, 39, 86,135, 17, 83,210,138, 29,250,106,237,205,144, 47, 17, 90, 30, 68,220, 76, 87, 6,205,229, 98,148, 16,157, -105,244,228,106,142,249,154,229, 40,124,183,133,240, 15, 34,176,243, 94,251,115,179,229, 22,139,244, 52, 42,166,221,125,180,187, - 19,222, 26,165,122, 37, 74,115,196, 69,127,101, 67, 73,146, 99, 59, 65, 57,140, 13,109,121,111,103, 59, 60,247, 80,125,157, 77, - 45,236, 42,159, 85,116,235,202, 30, 65, 63, 42,225, 44, 46, 96,112,173,203,100,121, 54, 39, 86, 13, 72, 93,169,213, 54,144, 79, -167,194, 40,212,136, 46,136,104,174,119,205, 91,127,131,127, 34,113, 67,235, 21,120, 44,118,199,154,118, 37,202, 91, 17, 46, 38, - 51,237, 62,171,116,240,231,185,203, 13,154,248,110,248, 78,178,233, 74,187, 8, 74,193, 62,157, 56,249,203,198,117, 89,101, 24, -130, 70,188,176, 56, 2,186, 74,161,234, 40, 65, 78,194, 42, 4,243,171,230, 3, 52,141,129,179,129, 92,110, 48,156,115, 55,113, -182, 28,134,205,189,150, 13,191, 31,179,184,211,148, 96,165, 62, 35, 41, 90,208,219, 8, 0,211,102,228,129, 78,202, 29,222,232, -197, 17,107,120,225, 94,139,228,206,108,220,247,189,113, 74,246,139,118,180, 52, 49,172,107, 64,201, 0, 32, 46, 0,116,229, 86, - 55,240, 60,141,100, 28,131,204, 57, 52,218, 28,141, 24,101,162,205,141,213, 21,255, 0,212,238, 79, 67,215, 85,130, 79,105,117, -136,105,233,235,248,241,176, 18,199, 87, 97,218, 97,104, 7,167, 15,111,248, 87,210, 20,153, 79, 37,208,195,117, 40, 86,208,129, - 82, 5, 28,166,238,254,191, 54,186,156, 74,214,134, 24,233,101, 87, 49, 46, 9,106,181, 49,194,123,235,183,195, 77, 7,127,166, -186,144,194,162,157,209,164,173, 67,119, 91,163, 72, 84,135,139,131,114, 95,108, 56,130,105, 90,131, 65, 74,247,168, 84,234, 68, - 66,149, 33, 65, 81, 21,219, 32,106, 82,149, 21,194,124, 69, 71, 94,246,212,122,151,125,131,233,239, 14, 83, 86,112,178,171,102, -114, 84,127,121,158, 28, 4, 36, 20,238,105,212, 32, 40,116, 30, 26,194, 18, 59,125, 53, 58,177,140, 85, 84,175, 74,141,224,228, - 47, 90, 46, 62, 35,132,169, 91,208, 84, 43,218,203,170,105, 74,233, 94,224, 53, 47, 66,138,142,101, 90,151,241,188,229,135, 22, -194, 20,242,124,112,159, 19,183,254,174,130,189,253,202, 61, 53, 22, 72,233, 58,234, 83,183,100,227,114, 18, 92, 74, 91, 72, 37, -116, 85, 70,229, 0, 43,219,220, 72,212, 9, 25, 67,197,165,161,148, 69,162, 25, 82,170,176,221, 10,137,236, 82, 10,123,122,246, -209, 64,141, 67,123,105, 46,146,145,238,247, 24,239, 36,186,133,110, 64, 75, 32,154,246, 44,154,131,219,232, 78,152,115,106, 44, -146, 84, 49,147,221,195,109, 45, 33, 97, 68,173,105, 6,181,174,240, 69, 59,127,120,104,152,218,131, 36,139, 80, 92,214,229,188, -151, 10, 20,118,182,226,146, 40,231,183, 32, 41, 36,165, 32,215,165, 21,169,109,194,162, 73, 40, 52,131, 37,231,125,205, 53,216, - 82,195, 74, 46,212, 81,123,156, 21, 53,235, 64, 52,121, 26,141,171, 26, 89,195,156, 75,147, 18,249, 1, 34,187, 55,171,246, 77, - 74, 73, 29,127,122,154,137,113,149, 58,100,194,166,236,139, 33,141,105,227,252,222,238,252,181,196, 68, 28, 74,243,225,200, 75, -133,181,178,235,236,173, 9, 9, 32,244, 40, 90,128, 79,249, 53, 73, 59, 60, 70,185,169,152,170,125,210,109, 16, 60,158,138,224, - 93,239,145,243, 91,140,185,222,237,119,188,186,153, 30, 48,142,219,206, 58,149,166, 18,214,170,186,146, 73, 90,212, 8,220, 74, - 85,170,120, 54,139, 40,144,189,140, 81,153, 9,159, 65,232,244,138,224,247,206, 46, 39, 19, 77, 20,230,249, 4, 54,204,159,127, -156,251,177,155, 75, 63, 57,199,149,213,125, 10,214, 87,184,169,106,236, 3,174,167,255, 0, 47,183,144,233,210,208, 15, 96,245, - 97,149,103,229,105,167, 50,249, 66,232,242, 34,198,126,230,234,136, 45, 5, 53, 46,226, 98,111,146,158,165, 73, 74,143,179, 69, -126,193, 61,105,170,191,228,145,198, 92,240,209,199, 38,174, 31, 46, 52,218, 23, 97, 89, 27,150,242,198, 25,144,201,200,151, 49, - 82, 36,186,164,182,151, 16, 75, 17,199,204,216, 28, 89, 77, 82,163,214,131,215,164,201,203,214,175,112,112,136, 52, 1,215,137, -235, 74, 32,215,112, 52,147, 35,145,114,123,129,126,209,239,145,220, 80,109, 82, 61,228, 2,251,178, 2,137, 73,108,213,192, 1, - 87,171,179, 82,226,218,173,173,210, 93, 39,161, 50, 78,188,169, 38, 55, 59,187, 72,239,223,175,210, 17, 34, 35,182,200,246,215, - 88,113, 15, 52,244,247, 92,109, 46,182,215,122,182,186,165,162,168, 81,246,169, 77, 75, 99, 32,105, 15, 15, 46, 94, 1, 48,246, - 33,198,146, 96, 32,161, 20,215,184, 94,227, 6, 28,110, 19,143,200, 68,230,169, 88,175,189, 46, 43, 41,141,210,136, 83,197, 43, - 85, 20,122, 26,106,206,217,142, 5,100, 65,164,241, 64, 74,245, 12, 41, 47,132, 84, 17,126,190,190, 18,250, 38, 60,164,161,210, - 29, 44, 71,144,148, 50, 18,148,236,220, 74,104,180,168,145, 95, 86,183,155,124, 45, 36, 22,103,210, 70, 61, 61,137, 77,152, 20, -227, 85,254,232,251,114,101, 56,208,118, 97,113,106, 80, 64,123,233, 84,194, 85,235,253,170,252, 26,234, 59, 99, 72, 0,160,244, -113,165, 71,102,180,102,199,108, 89, 11, 46, 46, 92,133, 39,163, 77,248, 27, 20,164,168,158,160,154,158,154,219,219,129,134, 0, -122,106,246,203,108, 94, 21,124,188,153,249, 90,207,252,214,115, 14, 45,196, 56, 51, 75,183,200,188, 45,249,183,220,146,225, 29, -201, 22,140, 75, 27,183,164,174, 93,198,113,107,105, 75, 76, 38,137, 77, 72,220,181, 33, 0,238, 80,211,247, 55, 49,194, 11,158, -112, 3,128, 83,212, 0,226, 73,192,125, 66,186, 15, 45,114,183,243,137,219, 10,233, 8, 73, 40,168,131,128,193, 73, 40,208, 20, - 98,122, 43,236,183,200,119,144,110, 34,242, 84,254, 67,113,199,179,155,175, 35,101,188,139, 21,204, 38,231,123,186,196,133, 6, -207, 58, 14, 62, 85, 46, 83,118,200,137, 67,146, 81,185,198,221,105,214,253,225,221,229,176, 77, 54,157,102, 55,169,165,185,141, - 25, 27,152, 24, 25, 35,148,171,129, 36,181,138,128, 6,142,240,118, 40,138, 6, 56, 87,127,217, 57, 62, 61,130, 57, 29,110, 30, -160, 49,207, 46, 56,130,164, 53, 80, 0,208,174, 92,114, 80, 49, 53,106,101, 94,177, 78, 61,133,200,182,235,244,180, 67,177,241, -252,172,119, 44,187, 78,185, 79,247,132, 70,176, 92,110, 45, 93,164, 58,241, 87, 82, 96,165, 46,186, 5, 59, 0,213,149,216,155, -117,101,181,235, 81,101,100,141,192,105, 0,199, 25, 98,245, 7, 4, 83, 93, 70, 77,182, 73,237,109, 47, 98, 56, 76,217,193, 39, - 0,215, 70,199, 2, 84,228,211,135, 28, 49,175,131, 79, 51,156,143,124,231, 78,105,229,190, 89,158,211,226, 71, 32,231,121, 30, - 80,195, 15,185,181,200, 54,219,164,167, 12, 56,181, 10,219, 72,209,124, 54, 71, 94,196,233,135,110, 48,219,128,214,145,165,160, - 1,216,208,131,175, 33, 94, 35,230,235,129,186,222,205,112,223,116,185, 27,250,141,238,179,255, 0,196, 10,169,211,184,207, 34, -186,190,239,186, 37,231,150,154,123,194, 99,208,174, 49, 36,159,104,168,237,232, 58,211,174,178,155,167, 58,219, 91, 14,249, 3, -161,120,215, 58,185,181,212,112,160,226,112, 77,214, 68,173,239, 93, 22,212, 98,148,151, 38, 61, 25, 73, 97, 33, 84, 10, 4,165, - 35,244,107, 31,115,230, 44, 81,140, 24, 9,232, 6,160,124, 10,212,167, 3,202,251,104,131, 22,124,171,191,190,219,228,178,167, -146,243, 49,159, 97,207, 21,133, 16, 80,148, 47,218, 95, 65, 84,168, 80, 29,100,110, 60,217, 37,238, 99, 99,210,224, 83, 18, 14, -124, 84,101,217, 79, 29,184,129,213, 66,159, 47,118, 54,252, 69,206,118, 82, 92,241, 27,110, 52,118,166, 54, 39, 41,151, 21, 90, -173,178,173,169, 59, 5,104, 52,207,245, 54,119,167,134,137,196,144, 81,122,143,109, 15,128,234,162,236,240, 53,137,114,165,179, - 29,188,138, 99, 16,183, 56,152,238,120, 77,175,194, 81,218, 9, 82, 86, 77, 43, 67,219,161, 39,153, 23, 13,107, 75,140, 96,158, - 56,231,233,163, 22, 35,162,151, 45,188, 25,137, 42,124, 86,157,137, 37,146, 82,149,188,185, 1,199,218,113, 71,173, 84, 70,224, -144, 59, 40, 53, 95,115,230, 53,222,135, 16,224,122, 17, 1,165, 54,197, 78, 85, 35,195,227, 14, 62,109, 99,198,133,105, 92,146, -182,227,161, 2, 48,134,226,130,168, 55,123, 78, 4, 0,160,147,243,135,195,172,212,220,231,184, 56, 96,247,134,231,154,253, 21, - 37,182, 35,143,205, 82, 51, 92,103,128, 69,117,217, 22,107, 51, 77, 20,248, 79,214, 67, 72, 92,130,148, 15,154,151,153, 94,221, -170, 41, 53,166,179,111,231, 11,249, 90, 27, 52,132,230, 48, 37, 61, 71,141, 60,108, 7, 1, 68, 3,204, 90, 47, 6, 52, 23,216, -182,173,180,123,233, 76,246, 83,185, 8, 72, 59, 67,100,130,132,132,147,218, 72,168,209,186,232,221, 69,169,224,184,101,129,249, -233, 66,219, 73,235,161,163, 94, 30,185,181,114,146,245,230, 3,175, 17, 29,244,193,132,235, 69,132,150, 1, 11, 33,107,162,247, -174,190,215,118,153,148,178,220,181,161,142, 3, 16,165, 87,171,169, 61,180,182,219,168,196,208,113,242,123,100, 83,238,242, 97, -219, 85, 30, 70,231, 36, 73, 84,214,220,146,226,146, 54,236, 90, 82, 83, 68,147,218, 6,153,150, 57, 36,239, 53,206, 81,144, 76, - 61, 29,116,227,109,211,128,165, 40,215,150, 18,176,151, 38,217,110, 8,108,133,193,180, 8,136, 76, 56,204, 3, 82,135, 22,239, - 85,116,235,243,181, 18,103, 19,238,181,237, 92,220,184,158,196,250,169,239, 1, 41,190,237,230,207,115,121,166,166,206,178, 65, -110, 33,156,227,150,200,146, 91, 82, 95, 11, 36,149, 41,150,214,164, 43, 97, 61, 58, 84,233,245,150,221,164,198, 30, 73, 68,113, - 92, 61, 39, 28,105, 98, 45, 71, 26, 58,222, 95, 97,102,218,249,247,233, 34, 18, 90,113,166,220, 92, 68,196,139,112,120,210,161, - 41,108,172,178,148,129,218, 64, 36,106, 44,150,247, 15,144,119, 70,172,243, 82, 7,167, 51, 78,248, 77, 74,139, 47, 25,237,182, -221, 33,215,227,100,108, 45, 46,146,212,132, 55, 33,106,116,161, 65, 42, 9, 15, 23, 18,180, 1,216, 5, 41,234,214,134,215,110, -146,225,161,174,136,225,136,192,124,200,134,147,225, 14,154,103,255, 0,126, 25, 11,223,253,245,111,196, 84,207,127, 16,188,119, - 60,111, 5, 41,161,111,198,241, 60, 61,213, 52,174,222,205, 88,252, 9, 79,220,112, 69, 64,157,168,139,237,164,248, 99,166,187, -233,111,227,190, 61,184,218,164,193,138,226,228, 51, 34, 52,168, 50, 30, 21,140,252,185,239,176,251,238, 4,138, 37, 68,132, 6, - 86,158,228, 37, 77,163,183,169,249,225, 46,255, 0,123, 19,195,147, 47,119,161, 2, 5,244,227,218, 84,215,166, 63,148,179, 72, - 57, 46, 39,208, 50, 21,241,181,192,185,103, 39,121,114,243, 35,158,241,221,177,231, 39, 97,214, 44,219, 43,196,115,171, 53,239, -199,254,237, 59,110,199,228,190,132, 93,146,180, 7, 17, 17,225, 25,132,188,135,194, 78,228,208, 40, 41, 61,158,250,230, 54,216, -115, 54,207, 5,236,206,209, 43,227, 99,152,230,133,118,167, 52, 29, 8, 49, 32,146,132,112,204, 37,123, 87,150, 60,136,185,254, -227,217, 4, 22, 44, 13,152,198, 31,227,187, 8,226,110,157, 78,116,175,200, 70,220, 73, 83,130, 97,142, 7,166,156,209,231,183, -203,167, 22,227, 22,203,157,157,156,147,146,114, 12,165,147, 38,209,100,180, 91, 23, 96,122, 44, 70, 16,132,123,220,167,174, 41, - 97, 44, 71,113, 69,192,194,217, 75,158, 39,206, 78,228,128,173, 96, 57, 99,203,205,235,153,100, 12, 12, 17, 70,198,163,158,226, -161, 84,224, 19, 18, 64, 69, 5, 19,217, 94,115,231,127,237,235,112,242,250,103,195,188, 79, 4,122, 73, 17, 58, 55, 9, 77,192, -212, 82, 88,216, 52,189,177, 56, 98,215,202, 35,212, 19, 75, 93,138, 93, 94, 40,200, 48,220,255, 0,142,112,140,222,199, 22,108, - 23,249, 95, 28,179,223,226, 90, 47, 16,218,113,251,108, 11,179, 32,165,133,108, 5,173,204,168,147,185, 61, 14,202,131, 67,174, -103,189, 65,119,177,220,207,105, 33,111,236,100,115, 9,105, 56,144,113, 62,159,165, 43,131, 93, 89, 54,222, 87, 70,226,165,164, -133,224, 83, 10,138,114, 76,103, 62,137,150,166, 28,124, 77,247, 32, 66, 19,204, 73, 16, 34, 37,199,220,112,173,166, 81,185, 64, -253, 26, 80,181,170,169, 52,173, 15, 81,173,134,223,185,217, 58, 16, 36,144, 41, 3, 18, 72, 66,132,245,168,203,133, 65,108, 26, -129, 26,113, 60,122, 62, 93,126,202,112, 73,187,242,107,121, 13,187, 31,183, 95,113, 92,218,230,136,151,169,153, 14, 41,143,223, -195, 25, 30, 40, 45,146, 60, 22, 35,221,146,235, 14, 67, 68,137, 59, 30,117,150, 80,241, 62, 27,106, 43, 13,238, 69,109,127,146, -216,193, 98,219,201, 85,141,144, 52,180,150,168, 43,197, 84, 35, 78, 29,101, 66, 42, 26,210,127,235,207,182,182,101,196,142,247, -198, 13,204,132, 57,158,128,115,226, 82,186, 43,229,227, 22,227,222, 60,186,241,218,252,193,113,109,230,126,117,147, 94, 84,237, -227,143,121, 7, 36,182,241,230, 35,142,226,138, 74,228,178,181, 73,149,115,133, 22,225,114,126, 51, 5,214,224,200,146,223,178, -226, 74,218, 81,240,210,229,238,217,203,246,113, 61,142,185,113,120,112,118, 8,141, 96, 0, 29, 82, 18, 65, 0,240, 0, 21,232, - 64,226, 55,123, 63, 37,218,219, 91,124, 85,252,141, 14, 67,165,142, 32, 41,236, 57,156,137, 10, 8, 7, 17,146,179,188,205, 92, -177, 76,195, 42,206, 98,241,138,241,107, 46, 11, 62,107,146, 49, 91, 11, 86,216, 88,220, 76, 81,168, 42, 44,164, 78,132,133, 56, -137, 6, 43, 37,198,216,152,162,160,232, 81,162,146, 84,164, 7, 89,187,142, 82,221, 97,185,183,157,174,177,115,251,205,183, 66, - 74, 52,163, 30, 23, 86,103, 18, 74, 38, 35, 16,131, 55,125,126, 54,187,161, 36,110,107, 98,255, 0, 64,104, 82, 6, 68, 12,248, -162,225,141,114,147, 33,227, 12, 3, 17,228,136, 89,245,162, 20, 52, 94,146,197,213,114, 91,182, 52,251,243,175, 78, 16,194, 67, -133,180,125, 8, 45,181,189, 40, 44, 54,104, 23, 66, 73,165, 45,119, 79, 48, 47, 57,133,229,209, 44, 57, 0, 67,144,129,142,110, - 81,143,171, 42,206,110,188,209,113,186, 75,226,196,223, 12,140, 3,154,160,166, 88,144,131,171, 0, 61, 53, 12, 92, 60,203,225, -118,151,229,194,200,227,229,216,157,197,171,164,248,246,235,220,139, 90,162,219,152, 75, 78,161,230, 90,114, 66, 20,184,238, 36, -180,233, 43,105,125,127,105, 73, 73,162,181, 42,243,106,220,121,133,205,154, 89,153, 51,155, 27, 91,152, 82, 2,244, 0, 85, 85, - 29,237, 53, 85,118,203,157,192,137, 28,142, 40, 59,126,143, 95, 26,156,241, 78, 72,203, 50,139,114, 30,176, 60,205,217,108,217, -197,217,187,133,150,123, 46,177,115,183,189, 79,245,152,170, 47,215,194, 71, 79, 27,123, 75, 13,158,138,168, 41, 82,170,109,180, -108,215, 81, 25,228, 49,141, 72,224,240,226, 7, 81, 3, 53, 30,234, 57,164,230, 8, 66,148,151, 91,108, 45, 8,230, 3,211,212, -122, 50,166,194,178, 27,231, 42, 98, 25,230, 33,155,219,177,233,110, 95,237, 23,118,108, 87, 86, 44,232,176, 94,161,188,235,111, -185, 6, 81, 73, 91,201,116, 45,246, 80,242, 29,105,208,163,218, 90, 66,123, 58, 63, 49, 54,210,194,214, 29,218,196,190, 54,151, -128, 90,231,120,204,122, 56, 7, 52, 61, 3,227,145,141, 40, 88,246,161,106, 36,142,113,197,136,246,216,237,228,107,162, 36, 6, -230, 1,195,172, 38, 68, 82,229,255, 0,151,173,188,213,228,213,251,213,225,168,140,100,215, 30, 63,186,216,178,100,178,150,161, -197,145,145,226,209,233,227,134, 25,109,180,182,185, 82, 98,251, 67,247,206,234,128,118,142,115, 14,235,186,236, 27,179,172, 76, -174,146,212,200, 11,117, 43,156, 24,226,169,168,146, 72,104, 56, 42,148,195,133, 70,118,203,107,111,120,217, 24,192,215, 2,184, - 96, 61, 93,135,133,112, 87, 37,131, 51, 26,201, 47, 56,114,101,188,245,166,203,144,202,147,106,109,106, 62, 31,129,115, 67, 43, - 67,161, 53, 32, 23,163,165,162,126, 1,174,231, 97,112, 46,161, 18,166, 36, 99,218, 20, 31,109,110, 0,107,192,122, 98, 70, 62, -138,236,231,225,201,200,176,160, 98,185,126, 33,123,120, 34, 61,174, 67,153, 69,190,190,210,202, 84,148, 55, 37, 9, 72,234,174, -137, 66,168, 61,122,201,243, 31, 48,205,176,201, 17, 99, 53, 53,229, 8,232, 63,167,232,172,118,249,203,237,221,101, 15, 5, 28, -137,219, 95, 69,248,172, 79, 35,184,119, 6,219,185, 39,158,121,186,209,130, 73,190, 38,245, 2,195, 99,185,229,108, 55,201, 23, -169,150,149,120, 42,155, 10,211, 20, 74, 91,145,213, 45, 46, 54,218, 21, 24,164,109,171,146, 0, 34,182, 59, 71, 50, 13,246, 49, - 44, 10,208, 73, 93, 64, 0, 0,244,253, 62,170,221,108,190, 90,108,183, 22,141,154,225,211, 2,229, 11,169,173, 82, 48, 58, 71, -120,105, 4,113, 83,219, 95, 54, 30,111, 57,119, 16,229,238,120,201,239,220,117, 14, 92, 14, 62,180,183,111,197,240,230,229,203, -118, 76,171,133,182,196,202, 89,118,226,224,117,106, 83, 74,186,203, 14,203,240,129,163, 97, 97, 3,162,107,163,191,115,158,228, -113, 84,226, 48, 21,101,103, 97,103,180, 61,208,216,131,225, 3,129,113, 82, 74, 0, 73,237, 76, 7, 1, 93,231,242, 53,196,216, - 63,150,139, 55, 22,242,196,174, 97,199,178, 22,242,254, 51,131, 2,233,100,198,225,135,161, 89,111, 57, 22,219,181,193,155,172, -231,229,178,150,157,134,230,216,237,165,150,156,221,225, 41, 68,163,160,213, 92,205, 16, 70, 38,123,152,214, 18, 0, 37,195,188, -236,112, 28, 21, 56, 45,116,173,159,100,116, 4,206,249,219,223, 32,180,112, 35, 72, 26, 84,145,136, 43,146,215, 99,177,110, 75, -176,101,129,185, 54,137,209,231, 53,238,168,152,203,145,221, 14,161, 77,182, 75,100,130,146,106, 14,211,215, 70,217, 2, 40,173, - 24,136,179, 3, 79,152,143, 45, 46,168,132,159,167,142, 31, 40,253,228,172, 18, 0,235,219, 78,221, 75,129,234,104, 72, 48,168, - 63, 53,120,180,226,157, 13,148,133,110, 42, 64, 62,202,156, 96, 2, 43,215,190,167, 86, 49, 26,143, 33,168, 15, 47,184, 72,105, -230,166,181, 84,185,225,253, 47, 80,146, 28, 62, 24,165, 43,220, 6,173, 32,198,170,102,114, 84, 79,121,206, 22, 98, 54,158,215, -148,165, 16, 65,175, 78,210,123,122, 83,166,173, 33,141,106,142,225,232,105,139, 43, 46, 98, 92,160, 92, 90, 83,224,181,181,210, - 85,212,237,218, 7, 90,245,246, 70,167, 54, 44, 42,184,202,149,228, 12,160,198,113, 18,218,144, 10,146,166,154, 90,119,246,212, -158,206,189,131,191, 72,146, 26, 88,184,169,211, 30,204, 83, 50, 33,144,151,168,227,137, 86,207,164,246,118,130, 1,239,244, 13, - 85,205, 18, 80, 51,165, 58,142, 74,149, 54,248,241,193,119,196,162,150, 21, 66, 20,148, 3,233,248, 41,170,249, 35,162, 55, 20, - 96,229, 59, 26, 88, 91,128,162, 72, 83,116,221,209, 62, 16, 2,189,189, 15, 77, 69,123, 18,162,203, 61, 71, 87, 43,137,148,251, -136, 74,193, 65, 41, 41, 5, 94,209,246,138,106, 58,247,154,252,154,108, 4,168, 47,154,152,242,103,150,150, 80,160,176, 55, 52, - 70,213,123, 59, 28,170,210, 59,125, 37, 67,228,211,194,163, 57,235, 69, 36,248, 78, 41,198,200,160,148,159,104,246,128, 72,236, - 61,123,200, 26,108,185, 41,189,117,237,178, 79,187,200, 17,154,246, 66,141, 20, 71,206,161,234,107,215,210,116,196,165,104,204, -149, 29,121,194,228, 79,238,239, 12, 71,198,161, 76, 98, 61,195, 56,186, 71,134,249,113,210, 28,106,217, 18,174,173, 91, 16,164, -173, 65, 78,165, 3,167,111, 81,170,153,165, 16,227,138,142,138,200,243, 85,247,133, 14,129,155,141,113,143,251,197,121,183, 38, -106, 74,203,197,249, 10, 2, 67,168, 90,223,106, 39,134,170,165,176, 84,118,214,181, 2,186,140,248,225,184, 32,140, 48,200, 34, - 18,188,107,149, 76,226,104,139, 23,185, 55, 9,132,162,237,107, 67, 80,223, 65, 13, 75,104, 37,229, 50,174,213,171,103, 93,201, - 61,134,154, 18, 49,176, 55, 22, 59, 17,192,241,232,168, 62, 25,119, 69, 52,175,147, 24,102,122,132,155,178,158,240,101, 25, 17, -131,110, 41,132, 59,214,189, 40,162,167, 40, 61, 35,224,213,149,164,133,204,193,136,161, 14, 69, 62,170,108,192,153, 86,240,242, - 43, 52,165, 57, 16,173,212, 75,247,215,147, 9, 78, 74, 80, 80,102, 69, 2,210,143,104, 18,107, 90, 21,130,116, 82,193, 36, 99, - 88, 56, 38, 56,113, 25,124,133, 44, 69,213, 78, 43,117,198, 45,157,130,197,149,168,242, 38,169,111, 9,114,166, 63,239,101, 5, - 67,161,220, 77, 69, 41,237, 13, 87, 92, 57,247,101,102, 36, 55, 4, 3, 10, 91,109,200, 24, 10,218,233,145,221,110,113,228, 58, -135,109,141,157,202, 43,117,229, 37, 42,116,167,104, 80, 9,170,139,105, 36,116, 4, 31, 86,138,214, 24,173,200, 29,239,151,206, -104,205,171,223,157, 20, 51,218,188,219,219,128,237,222,217, 30, 83, 5,182,154, 68,102,130, 22, 85,208,211,110,208,170,158,250, -211,211,167,132,134,210, 67, 32, 99,136, 56,149, 63, 33, 68,109, 75,176, 74,111, 74,195, 35, 62,227,242,110,151, 21,191, 30, 91, -170,142,136,145,208,106,195,145,168, 1, 35,168,165, 77, 73, 73,213,189,175, 49, 22,163, 98,104, 4, 98,167,138,209,252, 11,186, - 40,252, 14, 38,198,101, 76, 50, 62,242, 92,133, 16,202, 75, 43,144,164, 20, 45, 84,219,181, 67,118,234,246, 82,157, 53,172,219, -249,186,118, 52, 2,212,235, 65, 83,237,246,226, 14, 85,106,120, 67,202, 20,206, 98,228, 11,111, 28, 97,214, 25, 55,204,174,249, - 87, 97, 55, 10,230, 45,176,160,219,163,182,167, 94,147, 45,247, 82, 17, 25,152,237,130,183,157, 81, 0, 15, 73, 32, 29,110,207, -204, 87,187,187,219, 29,185, 0,102,226,224,160, 5, 1,112, 82,113, 32, 0, 1, 36,144, 6, 38,183, 92,187,203,178,238,146,136, -163, 3,164,147,144, 29, 61, 39,168, 12, 73,192, 87,211,223,148,174, 56,227,111, 42,220, 88,199, 17,223, 51, 62, 56,200, 46, 22, -134,166, 71,200,100,113,245,150, 83, 17, 38,220,102,201,118, 93,110,151, 85, 60,195,151,201, 44,151,146,210, 20,234, 82,218, 27, - 67, 97, 45,130, 9, 62,144,111, 46,223, 77, 4, 82,219,218,190, 55, 4,239,191, 75, 92,228,104, 4,134, 16,227, 24, 56,184,144, -117, 18,226, 10, 4, 21,238, 14, 70,228,155,155,187, 86,179,109,180, 3,195,210, 11,244,180, 56,144,208, 14, 36, 61, 53, 98,226, -157,229, 56,160, 65, 76,238, 83,228,107,188,107,110, 13,103,189,100,183, 91, 52, 14, 58,104,192,196,115, 91, 36,165, 89,226,200, -136,194, 82,212, 85,191, 34, 51,169, 16,103,150,129, 75,187,212,150,223,168, 45, 43,113, 91, 45,233,182,219, 8, 54,223,136,241, - 88, 9,153,193,207, 80,186,142, 42, 10,230,222,129, 94,141,228,158, 88,179,229,182,220, 69, 60, 44,120,153, 28,237,109,212,164, - 2,173, 32,140, 70, 56, 97,210,163,166,135,249,191,243, 69,139, 88,236, 54,143, 47, 88,222, 83,112,201,179,110, 80,147,247,238, -100,243,151,175,127,190, 95, 96, 33,183, 98,199,138,252,135, 95, 75,155, 95,220,226,158, 42, 87, 68,248,105,249,187,169,131,243, - 66,107,219,139,102, 91,109,113,180, 52,176,130, 64, 1,172, 98,130, 64, 29, 47, 32, 12, 6, 13, 14, 7,222, 21,196, 63,184,141, -254, 86, 91, 55,109,177, 99, 24, 31, 25, 97, 13, 1,173,142, 34,224, 72,104, 24, 3, 33,106, 96, 48, 99, 94,190,240,174, 74,229, -247,120, 54, 49,113,198, 95,135,138,165,248,183, 4, 52, 17, 14,230, 50, 40,209,125,145,226,132,205, 72, 91, 18, 9, 88, 81, 14, - 50,178,142,192, 10,169,185, 94, 77,220,217,113,101, 57, 19, 61,250,154, 49,200, 47, 17,128,203, 2, 51,253, 21,243,223,121,219, - 62, 25,230, 54,149, 35, 3,209,232,168,241, 23,242,202,202,228, 55, 25,171,106,143,128,204,132, 60,169, 5,245,208,144,144,205, - 18, 42,123,205,117,207,247, 73,132,196,134,146, 95,153, 25, 39,166,178,114, 89, 61,216,165,104,254, 96,195,136,122,179,203, 14, - 36, 41,182,224,192,109, 81,155,171,164,143,105, 10, 35,173, 61,125, 53, 70,219,125, 36,119, 87,172,226,125,117, 28,217, 59,211, - 66,193,185, 6, 38,197,158,185, 22,247, 93,109,181,123,202,100, 41,213,184,136,235,253,144,143,105,180,146, 79, 82,145,168,247, - 50,135,180,176, 7, 1,193, 19, 62,220,253,116,227,118,199,102,162,128,147,151,200,247,182, 28, 16, 34,197,147,187,194,104,161, -198,221, 14, 71,108,244, 80, 82,170, 82, 79,193, 93, 19, 34,102,146, 53, 18,220,248,140,105, 67,110,114,240,175,102,242, 34, 74, -140,105, 50,226, 45,213, 6,209, 57,233, 14, 52,162,232, 73, 73, 8, 79,182, 15, 81,234,235,166, 98,176,251, 77, 5, 56, 0,184, - 83,159,203,201, 56,154,143,174,153,116, 87,222, 41,135, 33,216,204, 52,235,139, 66,140,253,158, 26,154, 59,168,141,138, 8,167, -168,234,226,222, 23, 49,189,224, 9, 35,163,235,198,136,216,180, 20, 21,164, 78, 85,180, 90,152, 2, 68,133,175,197,220,243,209, - 82,235, 94, 36,167, 24, 72, 41, 20,249,221,107,215,218,209, 77,180,203,112,123,163,168, 28,112, 95,101, 59, 29,171, 25,154,209, -116,121,153,130,195,111,199,139,110,125,134,130,254,145,195, 48, 37, 10, 85, 40, 18, 16,214,227, 74,244, 59,142,146,254, 74,146, - 66, 28,231,130,123, 62,191,162,156,211, 24,200, 26,142,239, 28,229, 14,115,134, 82, 36, 17, 50,160,248, 42,115,112, 81, 7,167, -179, 84,138, 31, 65,213,197,183, 45, 62, 33,167,236,210, 12, 76,205, 41, 9,254,114,185, 78, 64,141,224,197,140,219, 65, 45,175, -192,140, 24, 46, 33,186,245, 43, 74,168, 43, 95,104,234, 75,121,101,144,247,181, 18, 79, 73, 90,112, 48, 30, 1, 41,169,255, 0, -197, 41,104,149, 21,101,233,101, 73, 81, 67, 78, 34, 73,105,164, 34,163,183,181, 71,225, 58,154,118, 86,185,174, 24, 39,102, 52, -108,140, 45,121,113,228,103,158,148,149, 49, 42, 75,234,105,126, 49,105, 72, 50, 84,243,166,165, 99,169, 35,191,183, 66, 29,173, -172,110, 32, 14, 29, 9, 75, 49,210, 51, 57,212,230, 84,101, 70, 83,176,148, 94, 33, 76,182,160,135,139, 99,176,208,117, 77,107, -212, 13, 72,125,139, 28, 52,187, 28, 51,164,136, 58,168,220,254, 65,186, 62,173,210, 38, 75,144, 22, 91, 9,142,153, 59, 82,218, - 54,154,166,135,167,103, 67,166, 98,219, 99,140, 96, 0,235, 74, 51, 0, 60, 41,165, 43, 34,146,219,238,188,219,114, 28, 15,169, - 37, 46,118,132, 22,232, 74, 42,144, 63, 54,167, 50, 54,144, 1, 35, 10, 64,132, 28, 64,164,115,151, 92,140,182,201, 79,250,171, -126, 48,109, 30, 34, 60, 96, 94,113, 11, 95, 90,120,159, 57,180,254,213,127, 62,164,139, 88,195, 73,251, 94,204, 21, 58,184,158, - 20,225,212, 90, 25,192,112,237, 79,170,190,151,241,190, 76,181, 92, 49,233,238, 51,118,118, 12, 57,107,151, 73, 6, 82,162,184, - 97,251,176,139,226,120,137, 80, 90,214,236, 86,128, 80, 61,129, 93,190,143,155,119,155, 60,182,243, 6,134, 41,203, 37,226,190, -160,126,154,245, 12, 81,124, 75, 67, 2,151, 21, 24,102, 87, 12, 58, 73,250,107,229,235,206,167, 41,218,111, 60,209,204,150, 62, - 58,188, 49,149,226, 23, 12,134,204,185,137,199, 26, 65,181,185,150, 89,237,144, 45,239, 79,185,205,101, 5, 19,137,157, 29,242, -196,109,251, 43, 69,172,159,152,175,107,249, 75,200, 51,110, 27,125,163,239,131,163,238,185, 53, 30,246,146,231, 16, 24,211,238, -247, 72, 87,102, 50, 29, 53,238,142, 95,243,226,127, 40, 57, 46, 14, 93,110,151, 93,247,137,132, 52, 0,213,121,115, 13,219,179, -144,180, 16, 89,110,186, 70, 6, 92, 70,138,152,127, 15, 31, 32,184,255, 0,153, 7, 30,231,143, 49, 57, 13,214,225,199, 86,124, -233,252,127,251,145, 18, 75,140, 93,115,137, 86, 70, 34,201,144,228,219,143,138, 31, 98, 26, 82,248, 97, 73, 96, 37,106, 32,165, - 43,108, 1, 86,252,241,243,114,227,203,141, 59, 14,199, 19, 91,112,232,131,140,132, 40,140, 56,184, 13, 45,200,201,130,171,148, - 5, 4,181,220, 60, 85,206, 60,221,127,191, 79, 45,253,220,142,150,121, 10,185,238, 42, 84,253, 3,128,200, 4, 2,190,138,155, -103, 16,141, 13,213, 99,150,139, 60, 72, 24,251, 17, 45,118,236, 34, 55,129, 7, 39,137, 29,189,200, 91, 54,155,122, 92, 40,146, -219, 46, 21,199, 96, 32,161, 52, 79,206, 72, 4,107,196,172, 55, 82,185,166,103,184,151, 59, 83,165, 42, 88, 84,130, 53,184,226, - 28,125,231,102,113,200,215, 47, 22, 94, 51,156,229, 82,170,153,149, 42,184,103,158, 21, 3, 51,202,182, 43,222, 77, 47, 13,194, - 50, 27, 41,143,115,109,144,205,247, 34,152, 45, 47,162,248, 23,227, 55,103,150, 36,133, 57, 26,107,126,238,183, 23, 25,104,220, - 81, 85,132,168, 7, 18,222,247,249, 52,182,173,109,221,244, 79, 45, 4, 43, 35, 10,172,200,189,165,184, 22,149, 0, 56, 96, 14, - 10, 21,164,155, 26, 45,156,165,170, 1, 4,234,195, 0, 70, 7, 35,192,245,212, 21,150, 57,133,112,162,242, 78,109,176,113,254, - 65,140, 99,151,252,132,219,243, 91,222, 55, 58,126, 71, 98,187, 71,185, 77,117, 6,112,122, 75,200,114, 50, 96, 63, 53,196, 53, - 49,176, 10,202,188, 42, 16,176,180,244, 59, 93,194,231,152, 47, 5,155, 46, 35,241, 27,251, 72,162,120,104, 44, 32,106,107, 52, -129,165,216, 52,119, 72,193, 53, 28,136, 50, 63,156, 75,188, 74,233, 52,144,213, 37,189, 1, 50, 24,231,233, 95, 94, 21, 96,121, - 87, 32,201,185,187,139, 56,221,153,184,202, 51,188,106,240,152,188,127,131,221,108,174,162, 19, 25, 28, 44,230, 98, 19,104,140, -251,209, 3, 83,101,120,151,121, 73, 67, 82, 2,131,137, 46, 26, 41, 91,105,167, 45,121,162, 89,164,102,217, 51,201,188,138, 66, -245, 42,100,192,119,154, 65,238,184,128,164, 42,225,221,193,106, 91,238, 47,183, 70, 55, 88,196, 42, 56,133,113,224, 7, 94, 57, - 47,170,184,221,159,115,239, 46, 88,110, 17,111,151,251, 28,204, 22,253,198,217, 12, 28, 31,146,248,174,100,181, 38,197, 50,207, -126,140,103, 89, 93, 68, 9, 42, 46, 39,223,109, 77,184,133, 75, 74, 55,159,163,116, 44, 21, 39, 93, 86,223,148,237,162,116,150, -174,239, 9, 26, 95, 28,132, 35,218,224, 81,234, 66,100,226, 28, 26,112, 69, 8, 69, 64,188,219, 77,155,139, 36,105, 36, 98,174, - 24,133,225,213,210, 56, 82,191, 48,249,170,227,152, 55, 44,115, 42,131,128,221,178,126, 57,106,242,179,102, 15,228, 46, 38,125, -170, 56,133,109,113,216,207,198,119,199, 97,230,218,145, 37, 41, 33,231, 20,165, 40, 20,169,100,109, 2,135, 99,228,171,167,198, -251,119, 78, 25,113,167,188,116,132,113, 87, 33, 4, 33, 4,129,192, 96, 49, 0, 26,175, 7,196,214,192, 0, 36, 4,207, 15,105, - 92,141, 84,223, 48,185,174, 59,152,113,172,252,209, 45,191,107,189,231,156,153, 1,231, 44, 54,123,175,185,226,176,224,227,182, -133,161,199,219,183,123,186,201,122, 67,210, 80,175, 24, 74, 74, 82, 9, 64,104,215,120,221,242,197,143,242,185,190, 17, 92,227, - 19, 48,123,128, 42, 28,243,129,114,169, 68,201, 56,102,105,203,105,219, 35, 81,203,226,132,199,130, 21,193, 58,112, 24,225,217, - 72,151,156,167, 12,227, 12,111, 15,229,110, 1,205,178, 28, 18,245,116,251,202,215,148,240,212,247,151,144, 88, 44,247, 56,140, -196, 82,239, 22,235,131,239,120,136,106,228,225,175,187,150,141, 8,167,138,164,130,218,103, 90,237,242,110,222, 45,174,232,198, -202, 90,243,166, 64, 3,117, 48,169, 0,129,147,152,168,113,199, 52, 21,101,188, 73,105,122, 24, 98, 97, 14, 62,243,115,210, 70, - 24, 59,142,172,192,225,211, 83,159,150,255, 0, 54,188, 97,123, 76,155,151, 46,228,119,121,183,137, 19, 81, 26, 93,225, 16,219, - 15,174,122,153,127,194, 98, 60, 40, 81,203,174,163,196, 73,218,224, 4,213, 73, 81,165, 84, 17, 65,205,156,177,184, 65, 15,129, -183, 53,162, 32,164, 49,112,197, 3,137, 46, 40,164, 1,232, 8, 50,199, 47,113,183,186, 7,144,198,160, 35,228,171, 73, 7, 55, -182,217,236,188,221,199,118,228,201,133, 5,254, 77,145,144,227,145,100, 67,145, 30, 84, 91, 14, 90, 4,134,216,117, 46, 36, 6, -194, 26, 64, 82, 66,191,120,250,116,236,123,123,238,190, 22,234, 66, 11,132, 33,174, 66, 19, 83,112, 36,118,159,154,171,238,161, -241, 36,142, 70,166, 71,141, 85,222,104, 68, 57,185,229,130,235,111,143,224,177,119,227,254, 48,114, 74,211,237, 52,237,218, 21, -130,219, 26, 98,130,129, 41, 81, 50, 25, 81, 36,122,117,172,229,205,113,219, 61,143, 56,137,165, 79,213, 47,113,111,176,213,187, - 28, 11,112,224, 79,207, 83, 39, 20,100,121,110, 41,100,200, 36,225, 18, 31,143,145, 79, 44, 88, 98, 46, 43, 97,201,101,187,209, -216, 67, 32,252,213,146,221, 18,160, 42, 15, 81, 67,215, 81, 55,171,120, 46,157, 31,196, 38,128, 75,138,229,134, 56,245,117, 83, - 80, 0,233, 6,172,146,186, 35,102,226, 11, 23, 16,112, 78, 79,201,247,103,217,201,249, 38,229, 22, 45,138, 29,234,242,204,139, -146,166,230, 25, 41, 10, 83, 86,167, 86,211,209,148,171,100, 66,167,223,117,199, 82,179,211,247,130, 70, 42, 25,110,185,154, 83, - 48, 34, 27, 8,158, 59,184,183, 88, 31,103, 1,137, 41,136,200, 3, 86,138,235,150, 58, 64, 81,141, 32,118,158,143,164,142,138, -175, 28, 67,199, 49, 47,185,166, 61, 31, 48,187,219,236, 86, 55, 46,109, 63,116,155, 53,213,150, 26,183, 67, 10,125,245, 56, 89, - 67,206, 36, 41, 13,148,130, 16, 77, 79,102,166,243, 7, 49, 58, 27,121, 29,108,199, 61,233,130,116,156, 6,105,196,208,180, 38, - 87,134, 40, 11,196,229, 93, 38,195,242, 91, 69,203, 48,202, 14, 7,145, 63,125,181, 61,105,176, 90, 30,184,217,242, 1, 19, 29, - 79,185, 57, 49,246,246,182,252, 98,234,222,241, 84,119,154, 80, 0,128, 59,104, 57, 84,198,242,214,220, 69, 46,168,218,242, 75, -154, 65, 83,139,115, 1,201,129, 1, 56,231, 91, 43, 66,219, 40, 91, 28,174,112, 58,137, 65,136, 35, 15,103,181, 86,186,117,248, -108, 47,148,178, 41,220,131,120,186,192,157, 23, 21,198,239,163, 20, 49,238,170,241,148,101,204,105, 18,212, 35,184,154, 54,226, - 27, 10, 10, 36, 36,116,112,107,167,108, 23, 58,224,107, 23, 80, 1, 87,232,237,233,174,147,103, 59,100,183,104, 93, 93, 7,170, -187,120,213,164,123,167,222, 11,246, 10,216, 45,160, 30,129, 45,138,154,246,244,162,105,173,125,187, 14,116,204,146,240,170,227, -200,197,186,171,194, 0, 33, 1,225, 69,124,227,189, 61, 85, 74,247,141, 89,196, 42, 51,223, 85, 71, 35,153,227,188,246,231, 23, - 82,181,149,161, 75,246,126,114, 77, 7, 94,250, 83, 87, 22,226,170, 46, 94,149, 90,242, 23, 95,136, 92,219, 66, 27, 90,212,176, - 79, 78,211,243,122,245,232,147,171,200, 27, 89,251,137, 22,162,161,124,132,243,207,120,143,248, 42, 9, 90,150,146,174,213,171, -104, 3,183,212,117,100, 24,149, 92,247, 26, 40,171,219, 42,144,150, 99, 74, 9, 1, 9,117, 68, 46,168,222,138, 39,182,189,224, -154,104, 57,148,141, 68, 83,222,207,154,202,128,133, 71, 14,109, 72, 72, 3,114,232, 2, 70,250,211,175,121,212, 25,161, 6,144, - 95, 79, 88,153,219,111, 85, 66, 66,149,237, 37,123,183,209, 39,194,232,174,254,224,117, 87, 44, 73, 77, 58, 83, 75,199, 50, 14, - 66,118,142,168, 37,181,186,176, 86,107, 80, 71, 78,255, 0,218, 7, 85,242, 51, 26,142,233, 13, 22,115, 52,132,195,137, 10,124, - 45,197,129,225, 36, 46,189, 81, 78,149,175,164,157, 68,115, 13, 48,231, 19, 73,103, 33,143, 45,105, 66, 94, 14, 19, 82, 10, 85, - 94,237,169, 29,190,189, 17, 4, 81, 45, 45,198,150,169, 5,196,164,213, 73, 66, 10, 83, 94,242, 20, 1,237,244,211, 76,184,165, - 17, 41, 78,104,205, 51, 29, 46, 72,117,196, 33,107,105, 18, 30,113,102,141,176,202, 65, 83,132,245,232, 2, 81,168,146,201,164, - 41,200, 83,111,114, 10,228,103,152,252,211, 42,229,110, 70,185, 57,143, 93,154,143,101,177,173, 54,219, 20,117, 20,169, 77, 70, - 96, 20,151, 18, 79, 68, 45,213, 18,175,143, 88,251,158,103,180,133,197,178, 52,145,143,178,185,222,244,201, 47,165, 46, 7, 1, -149, 85,197, 91,114, 27, 37,193,193,119,135, 38,252,181, 60,168,174, 60,220,128,180,135,247, 26, 83,176, 30,206,205, 24,223,237, -111, 25,251, 39, 6, 39, 4,172,244,155,115,216,113, 11, 91, 57, 7, 35,154,242,227,195,196,190,238,106, 65,241,220,151, 35,235, - 29,109, 38,135,218, 9, 52, 77, 7,167, 74, 27,165,180, 35, 83,231,213,212, 56,123,105,161,102,254, 45,166,204,197,100, 54,103, -215, 42, 86, 57, 54, 67, 85,117,136, 82, 89, 37,228, 70, 6,173,133, 36, 32,239, 3,161,238,212,203,107,219,107,246,134,178,102, -131,196, 28, 23,215,133, 17,180,124, 95,102,146,219,190, 74,145, 53, 78, 71,177,135, 29,117, 45,183, 41,201, 54,197,184,226, 28, - 74,147, 69, 37, 78,246, 5, 40, 14,180,212,153, 3, 24,196,116,168,153, 35,135,209, 73, 13,119, 6,251, 41,193, 34, 92,247,182, -181, 45,168,209,223, 66, 10, 60, 4, 69, 84,127, 10,189, 70,237,165, 33, 66,189,130,186,174,101,204, 77, 5,204, 36,133,205, 86, -148, 99,144,226, 91, 94, 34, 42,252, 85, 72, 68, 70,229, 42, 66, 27,162,192, 91,141,180,229, 5, 81,176,144, 6,254,228,250,116, -159,230, 77, 68, 46, 32, 14,207,159,170,128,142, 79,242,209, 55,175, 57, 61,190, 66,219,102,195,224,180,219,136,113,209,224,165, -148,169,180, 17,182,138, 1, 94,201,175, 94,253, 63, 24,182,185,106,248,170,123,126,138, 82, 61,185,138, 45,253,232,149,119,125, -184, 76,193,114, 12,133, 77, 75,104,105,153, 43,111,194, 82,202, 18, 77,105, 78,170, 61, 6,166,195, 20,118, 96,200,231,130, 0, -204,140,243,167, 35,100,146,101, 82,180, 28,123, 42,134,192,145,247,136,251,177,151, 99,123,219,136,105, 79,169,130,224,170,148, - 66, 66,214,176,158,149, 0,119,234,251,151,183,189,191,113,184,142, 57,220, 35, 4,161,113, 5, 0, 29, 77, 4,147,154, 97, 87, -214, 54, 62, 36,141,107,221,165,164,226, 80,148, 29,128, 19,236,174,248,121, 41,243,253,228,143,203,215, 26, 63,102,206,248,159, - 49,137,149,253,221,111,182,222, 21,136, 98,145,114,116,101,172,219, 17,189,217,183, 59,133,194,237, 26,227, 40,207,144,143, 20, - 64,113, 2, 51, 4, 0,210, 59, 78,189, 47,113,184,108,214, 16, 71, 38,201,117, 12, 67, 21,121,215,227, 18,114, 0, 54, 51,165, - 49,239, 40, 37,115, 1, 43,209,123,118,235,180,109,208,180,109,239,142, 16, 85, 94,224,231, 74,122, 27,131, 28,224,152,171,145, -170,185,129, 80, 63,153, 79,198, 63, 7,207,174,210, 97, 96, 60, 77,116,180, 52,202, 37, 28,106,215,113, 76, 60,110, 97, 13, 54, -165,178,211,176,173,190, 42, 22,162, 40, 20,231,190, 13,190,189,160,107,101,203, 62,102,218,237, 81,136, 26,215,184, 56,254,210, -105, 94, 93,136, 11,221,104,212,113, 40,152,132, 85,233,174,211,202,158,122,219,242, 69,159,133,183, 90,186, 82,228, 15,150,121, - 10, 47, 18,214, 13, 69, 58, 6,161,237, 53,199, 62, 99,243,239,230,251, 50,193,242,104,119, 22, 29,227,220,118,226,249,140,221, -211, 20,185, 36,221,109,214,229,173, 64,199,113,207,124,159, 49,133,201,240,206,208,243,168,233,237, 37, 36, 26,107, 93,111,191, - 91,115, 19,137,182,145,174, 3, 62, 30,195,143,209, 75,223, 60,241,185,223, 37,107,173,231,104, 96,105,212,198,179, 72, 36,229, -222, 35, 80, 78,163,219, 80, 71, 8,113,151, 34,242, 93,249,222, 78,205,239, 86,214, 56,215,141, 48,249,185, 53,251, 41,190,186, -231,184,181,113,190,219, 87, 42, 21,172, 55, 21, 81,222,188, 75,151, 17,106,113,200,108,138,116, 33,245,161,163, 93,100,118,110, -116,182,222,111,103,128, 65, 32,100, 46,116,122,220, 17,165,237,118,146, 0,205, 20, 18, 15, 64, 84, 10, 43,152,115,255, 0, 51, -220, 62,214, 54,202,246,151,201,164,128, 49, 41,129, 85, 32,140, 20,116, 98,115,171,115,151, 95,177,248,188,102,203, 40,202, 98, -221,242, 38,155, 66,237,215, 27, 93,134, 76, 55, 82, 86,122,178,235,108, 38, 75, 9, 64, 38,158, 24,114,169,253,154,107,146,115, -160,216,183,153,220,201,166,137,146,244,135, 52,159,247, 1,137, 29,190,138,243,238,237, 35, 47, 28, 73, 40,122,106,153, 71,200, -179,251,170,218, 75,168, 65,109, 82,156, 98, 43,142, 54,164,109,122,180,175,180, 82,161,219,240,235,131,238, 31, 3,108,247, 6, -185, 83,136,200,129,198,177,111, 99,129,166,125,203,145, 51, 27, 67,254,224,234, 35, 5,138,188, 93, 97,149, 41, 75,121,181, 16, - 10,170, 84,170,116,248, 52,236, 59,117,173,203,117,133,245,252,213, 28,175, 69, 16, 57,254, 93, 44,135, 91,152,248, 83,138, 76, -122, 71,100,162,170,119,186,162,157,253,130,149,210,190, 6,214, 48,132, 12, 49,196,209,104,115,138,241,173,230,202,228, 56,108, -165, 79,139,146,158,145,181,208,146,203,142, 20,178,241,246, 8, 79, 82, 10,128, 61,189,218,106, 9,236,167, 36,183, 74, 12, 21, - 70,116,224,183,144,133,210,105,161,114,185,100, 10,117, 34, 82,110, 66, 72, 9,116,238, 97, 91,200, 95,101, 72,174,223,155,223, -232,213,148, 70, 16, 21,186,116,158,186, 2, 7,160, 36,103, 94, 75, 70, 65, 29, 17, 94,152,244,143, 10, 75, 78, 56, 2, 86,106, - 10, 84,164,168,159,132,164,244, 26, 30, 52, 77, 80, 17,105,201, 44,158,208, 9,227, 68,211, 14,233,116, 78,216,236,202, 90,219, - 88, 21,109,165,165,192,149, 0, 5, 58,247,215, 72, 59,140,118,229, 92, 69, 55, 29,161, 38,156, 8,194,179, 87, 99,134,161, 88, -239, 19, 29, 1, 63, 68, 33, 41, 52, 81, 21, 63, 73, 66, 79, 78,189,186,134,237,250,212, 57, 95, 35, 64,237,250, 41,109,180, 43, - 94, 91,248,183, 55, 90,226,184,229,134,116,121, 47,189,224, 54,151,219, 80,220,163,215,174,227,216, 13, 43,164, 92,115, 61,163, - 65, 2, 80, 69, 27,172, 92,112,163,183,174, 36,207,108,223,235, 55, 91,100,198, 99,123,187,147, 31,218,175, 17,180, 50,149,134, -202,246,160,246, 5, 16, 15,163, 77, 90,243, 93,165,208, 34, 55,130, 65, 3,214,189, 61,134,157, 22,101,185, 86,184,239, 29,228, - 23,119,253,213,152,142,253, 8, 14,120,142,199,163, 65,165,143,101, 94,209, 36, 87,173, 52,157,195,152, 33,180,102,178,236, 15, - 65,232,167,126, 8,132, 38,141, 92, 56,235, 42,176, 50,235,210, 35, 62,202,144,176, 11,130, 50,212,201,241, 85,210,187, 82,127, -100,247,106, 60, 60,199,111,120, 64,107,129,244,254,154, 49,110,120, 82, 51, 56,109,246, 83, 47, 62,213,178, 68,146,135,168,145, - 17, 11,241, 9,221,212,132,142,167,175,113, 26,144,253,246, 40,200,105,120, 24,113, 74, 31, 10,106, 83,198,120, 94,255, 0,116, -132,183,174, 73,118,209,182, 59,202,109,115,213,238,206,120,155,119, 37, 42,169,165, 20, 71,110,179,247,220,223, 20, 15,210,194, - 31,143, 12,105,211,109,167, 2,105, 14,227,199, 25,148, 87,144,212,139, 20,167, 99,161, 45,248,111,192, 95,140,216, 14, 15, 74, - 77, 85, 95,131, 82,109,249,146,218, 92, 91, 32, 4,244,225, 65,176,112,164,209,198, 57, 25,136,187,151,187, 17, 21,185,109,219, - 68, 93,227,223,212,227,202, 82, 8,167,206,246, 94, 64, 71,103,105,212,191,253,130, 33, 47,129,171,189,167, 82,240,203, 87,204, -105,239,131, 58,180,174, 40,190,197,171, 92,231, 36, 53,153,224, 42,181,220,165, 62,230, 34,133,206,180, 93,100,196,184, 57, 1, -203,149,218,254, 93, 83,137,140,244,103,154,118,140,192, 74, 80,118,168, 31,109, 36,208, 44,211,144, 79,203,241,237,247,203, 1, - 14, 45, 26,129, 45,224, 14,100, 16,113, 39, 32,122, 15, 69,117,237,143,153,174,182,123,136,239, 45,158, 99,150, 55, 43, 92, 51, - 14,233, 29,157, 52, 70,217,145,113,235,188, 97,126,227,219,126, 61,104,181, 97, 19,173,210, 49,118,236,182, 38, 90,183,181, 42, - 76,217,159, 66,250, 92, 74, 14,249, 13, 40, 23, 67,235, 74,148,165, 39,114,138,181, 29,176,222,219,110,177,110, 62, 35,157, 60, -111, 15, 5,202, 80, 1,139, 81,125,210, 48, 45, 8, 16,160, 74,151, 38,243, 37,214,169,100,113, 47,113, 85, 56,226,120,154, 53, -193, 28,155, 31,140,237,215,206, 27, 84,201, 24,252, 11, 20,139,165,235, 13,151,142, 75, 67,174, 92,229, 95,101, 37,135,222, 11, -155, 30, 66, 94, 38, 68, 80, 93,170, 2, 54,146,146,138, 39,173,247,154, 91, 19, 57,133,214,219,244, 32, 72,233,192,100,173,120, - 77, 46,141,170, 2, 52,132, 8, 80, 98,170, 23, 81, 92, 32,151, 9,194,202,226,238,142, 3,213,245,173, 74, 57,183,154, 12,154, -222, 96,221,161, 71,140,155,149,150,234,213,194,209,200, 24,108,102,236,249, 77,137,216,202,240,144, 37,196, 10, 54,187,156,117, -164,165,183, 91,163,104, 95,237, 50, 10, 16, 83,206,118,206, 65,130,109,113,200, 78,135, 4,116,111, 58,152,238, 39, 73,247,216, -225,137, 7, 18, 56, 59, 18, 10,254, 55,192, 26,116,140, 14, 99, 3,234, 24, 17,195,231, 21, 31,101,222, 98,184,207, 61, 76, 60, -187, 42,141,128, 96,252,213,108,137,112,131,247,235,108,176,182, 85, 31, 36, 97, 13,179,122,143,186, 91, 42,152,193,124,184,228, -155,121, 89,126, 50,151, 33, 52, 83,149, 83,151, 91, 39, 42, 94,242,241,125,180, 15,150, 91, 55, 22,163, 73, 63,100,226,195,221, - 33,164, 4, 13,122,105,120, 12, 56, 0, 0,147,186,237,147,239, 13,137, 97,115, 26,224, 94,227,164,226,213,210,160,241,110,166, -149, 60, 8, 35, 53,162, 78,254, 35,156,133,105,225, 60,231,202,215, 62,224,184,174,112,214, 87,199,183,140, 23, 22,228,251, 3, -205,217, 37, 70,183,221, 97,183,112,177, 92, 30,182,166, 26,216,144,225,121,108,169,183,144,166, 84, 26, 36, 82,187,203,189, 55, -151,249, 59,108,219,124, 75,221,166, 36,123,229,212,237, 88,184, 56, 59, 75,209,206, 14,112, 0, 7, 13, 32,129,137,200,161,108, -200,247,198, 88,218,186,205,208,181,116,144, 30, 61,228,224, 8,196, 32,236, 7,233, 43,228,127,205, 69,195, 16,242,233,200,252, - 41,145,196,181,220,177,248, 60,211,229,214,255, 0,141,100, 55, 69,200,151,122,195, 24,187,103, 54, 71,230,177,103, 67,110, 52, -211, 43,121, 80, 22,189,202,116, 80, 45,208,145, 85,149, 6,183, 46, 89,180,119, 50,217, 95,178, 16,110,166,107,227,214, 74, 6, -232,105, 33,200, 51,113, 80,210,113,238,128, 48,226,173,135,120,100, 77, 45,145,161,205, 14,107,143, 98,133, 3,181, 42,138,121, -183,181,227,120,247, 55,205, 24,230,101,145,231, 17,114, 76, 38, 26,238, 87,140,158, 43, 49, 38, 11,174, 53, 62,125,158, 51, 44, -134,165, 75,113,198,154,131,102,138, 16,167,148, 23, 82,164,237, 8, 9,175, 72, 51, 58,229,210, 49,207,212,248,229, 45, 36, 0, - 7, 3,246, 64, 24, 7, 34,160,244,230,107,121,170,230, 9,229,107,237,218,230,180,183, 39, 21,253, 40,137,159, 21,224,148,195, -200,109, 13, 53,229,223,145,152,184,200,146,236,188,125, 56,186,161,198, 64, 90,153,131,123,203, 46,214,229,173, 42,250, 96,132, -127,169,219, 22,149, 16,217, 37, 84, 4,209, 35, 85, 2,241,223,204, 45,163, 99, 90,142, 50, 18, 80,106, 45,107, 8,205, 21, 53, - 16,152,225,143, 73,172,117,148,198,114, 79, 6,159,159, 12,126,138,170,217, 78, 75, 18,103, 31,224, 88,243, 18, 37,185,114,179, -202,201,159,186, 52,230,239, 1, 63,120, 46, 42, 35,120,125,104, 79,132,193,173, 53,162,182,180,123, 46,166,148,129,165,193,128, -116,225,169, 87,210,106, 84, 67,190, 74, 10,151,240,155, 79, 28,231, 92,181, 38,203,123,126,126, 61,198,152,254, 43,156,228,136, -138,228,149, 63, 53, 34,201,109,146,229,182, 50,164, 38,136,111,125,192,178, 10,156, 33, 59, 70,210,170,145, 90,141,214,123,205, -186,201,174,128, 7,220, 58, 72,218, 78, 67,188,225,173,201,212,213,203, 30, 41, 76,106,208,199, 60,156,120,117,149,200, 84, 41, -123,131,148, 96, 25,158, 45,149, 77,179, 99,214, 59, 46, 97, 9,158, 69,179, 66,183, 56,166,236,139,199,175,179,101,182,210, 91, - 75,197, 78,167,196,247, 85,169, 45,213, 74, 74, 74, 65,165, 54,139,203, 75,136,119, 40,100,134, 55,185,198, 55, 24,156, 78,122, -154,208, 73,195,180, 99,130,156,170, 75,154, 38, 97,106,146, 70, 29,120, 10,178,118,159,117, 13, 94, 47, 47,220,190,238,180,228, -119,153,210,108,138,184, 45,233, 55, 55, 49,219,107, 78,199,182,164, 52,161,227, 44, 54,202,148,144,174,136,246, 69, 20, 5, 14, -168,110, 53,105,108, 96, 2,246,180,106, 68, 3, 81, 32,187, 28,177, 56,244,227,149, 81,206,143,112, 13,196,143,151,203,141,121, -157,222, 33,218,242,187,125,173, 22,123, 76,247, 44,248,166, 35, 1,251,180,185,139,156,194, 67, 86,232,207, 4,152,168, 91,108, - 50,235, 69,226,135,131,161,202, 40, 16,133, 20,128, 75,219,109,164,134, 18, 92, 92,221, 79,113, 68, 0,226,226, 1, 92, 73, 4, - 0, 66, 38, 4, 40, 92, 41,214,219, 62, 0, 67,142, 36,170,118,227,242,202,174,223,146, 27, 12, 91,223, 50,241,167,223,179,113, -107, 86, 59,155, 94,174,184,224,186, 63,141,181,148, 65,182,200,145,108,184, 71, 83,242,237,143, 4, 54,166,163,170, 82, 20,167, -145, 69, 53, 69, 58,133,161,109,161, 98,135,126,185,142, 14,228,132, 4, 33, 76,128,150,119,138, 5, 66, 14,125, 99, 49,158, 85, -123,177,197, 3,110,227,109,211,127,102, 84, 30, 56, 16,156, 65, 24, 19,208,163, 48,135, 26,184, 31,136,109,235, 29,193,249, 35, - 18,224,252, 43, 49, 98,235,142,227, 88,197,151, 36,190, 89,113, 40,178,226,224,120,222, 97,123,109,197, 59, 18,223, 26,233, 54, -117,207,123,108, 40, 41,247,164, 77,112,169, 75,160,160, 64, 26,114, 72, 90, 34, 48, 70,229, 99, 28, 91,167,128,115,125,236, 83, -188, 84,149, 61, 56,112, 65,113,204, 80, 91,217,191,225,237, 92,124, 33,138,125,144,113,201,113, 94,146, 73,205, 1,194,154,158, - 84,110, 28, 91,143, 93,175,153, 63, 37,195,254,247, 75, 76,120, 22,124, 11, 11,134,196,155,141,195, 34,200, 38, 60,133, 60, 83, -111,140,159,120,146, 35,182, 16, 8, 82,131,100,172, 5, 21, 86,135,158,243,166,207,184,238,145,197,109,183,146,192, 92, 76,143, -195, 0, 2, 0, 9,200,146,120, 2,112,193, 51,170, 59, 59, 23,206, 85,161,122, 59,112,195,182,186, 3,196,120, 15, 61,121,141, -202, 50, 11, 79, 11,240, 20, 59, 5,166,219, 49,155,125,206, 62, 63,132,226,188, 86,197,141,168,204, 70,121,213, 78,113,111,199, -147,188,151, 9,109, 79, 56, 74,194,194, 65,221,208, 84, 91,114,139, 45,166,109,147,166,146, 75,141, 58,207,137, 36,178, 20, 84, - 94,247,117,163, 12,130, 86,153,187,116,179,200, 24,184,129,138,174, 31, 64,175,161,126, 30,133, 31,139,112,155, 62, 3,114,225, -220,207,143,162,218,227,176,137, 23,121,179,236,217,108, 27,213,229,198,208,151,164, 56,229,142,233,112,148,219,143,169, 37,110, - 56,244,100, 54, 63,127, 93, 67,111,176,110,222,193, 24,105, 0,113,207,230,199,217, 91,187,116,129,129,131, 32, 42,108,202,110, -232,137, 4,136,251, 61,223,192,218,128,149,116, 85, 5, 21, 79,131,178,191, 14,180,172,106, 82,181,213, 51,204,114,232, 15, 59, - 41, 47,190,148, 59,226, 0, 66,151, 77,224, 5, 80, 14,189, 59,126, 77, 79,134, 58,102, 87,225, 85,147, 46,186,197,138, 36,190, - 92, 69, 20, 82,150,202, 79, 64, 90,162, 73,167,117, 22,173, 92, 64,202,163,187,153,106,188, 95,174,105,156,202,214,131, 74, 52, -105,215,113, 46,146,165,117,235,251, 61, 7,199,171,136,176,172,244,210,227, 85, 67, 50,118, 69,169,114,166,165,208,208,112,248, -161, 27,170, 42, 42,144, 59, 71,164, 19,235,213,132, 82,106, 41, 72, 99,195,170, 26, 99,147,210,135, 28,101,197, 46,161,196, 2, - 16,125,183, 22,146,163, 74,215,176,246,106,121,135, 10,123,195, 90,150,113,236,253,171,139, 75,101, 82, 82,148, 4, 53,185, 75, - 80,222,149,169,117,219,209, 93, 61,125,117, 95, 60,122,106, 44,140,211, 78,175,239, 64,134, 75,198, 82,124, 63, 9, 33,162, 86, - 18,133, 41,197, 0, 79,111,104, 29,117, 83, 48,168,206, 11, 76, 12,143,157,204, 7,215,111,135, 35,114, 89,109, 12, 56,160,189, -222, 32,105, 34,135,183,247,199, 93, 70, 22,218,177,165, 8, 22,144, 49,254, 73,191,100,115,144,136,234,117,109,135,212,226,157, -169,246, 16,225,160,235, 90, 14,205, 38, 75, 96,193, 74,116, 33,181,104,112,182,230,165, 45, 59, 33,213,169,127, 68, 84, 10,186, - 2,231,205, 3,175,160, 87, 85,119, 8, 48,168,178, 17, 83,213,141,192,157,239, 40,123,107, 27, 0,175, 85, 81,125, 40, 43,235, -213, 92,142,166, 77, 69,222, 97,179,203,182, 53,137,203,180,227,240,228,204,189, 94, 33, 41, 50,147, 25, 27,196, 59,120, 67,170, - 33, 74,173, 16, 94, 45,169, 34,189,213,214, 27,154,247,216,182,248,252, 34,240,215, 59,175,133, 87,223, 23, 6,163, 66,147, 92, -206,153,142,228, 13,205,184, 42, 36, 89, 81,101, 43,124,183, 28,117,181, 41,151,100,120, 77,186,174,170, 36,209, 9, 81,233, 94, -209,232,215, 46,110,229, 21,210, 23, 56, 18, 75, 64,245,167,182,168,157,102,247,185, 52,149,196, 82, 53,145,199,219, 44,187,112, -110, 84,161, 38, 90,174,178,183,178,160,233,136, 67, 94,193, 77, 69, 62,149,146,145,214,181,212,219,231, 49,174,208, 8, 9,130, -143, 79,203,213, 85,243, 66,240,226, 58, 48,245, 26,118,194,149,121,144,176,207,221, 18, 23,111,159, 33,244, 9, 30, 25, 82, 25, -137, 13, 13,165, 96,117, 39,113, 81, 36,211,176, 10,247,138,211, 43, 65,197,248,129,151,105, 36,125, 93,116, 70,220,184, 40, 24, -209,171,181,190,244,219,209,213, 22,208,242, 30,125,247,231,134,219, 20, 76, 70, 67,173,165,162, 82, 20, 80, 18, 84,179,186,157, - 58,143, 71, 73, 62, 43, 24,170,240,132, 97,242,235, 69, 29, 84,236,182,143,182, 13,212, 61,230,175, 96, 82, 62,143, 85, 51,242, -155, 69,241,200,119,196, 93,162,204,134,213,211,221,211, 17,168, 17,189,218,229,107,119,223, 10, 12,134,150,138, 20,146,146, 0, - 73,253,180,138,118,168,106,235,108,220,163, 88, 68, 1,158, 35, 23,188, 80,181,193, 9, 33,205, 42, 15,111, 6,250, 13, 57, 24, - 5,204,111,134, 11,129, 42,170,135,168,246,117, 80,110,219,228, 91,236,232,185, 59, 26,227, 41,104,118, 51, 94,245, 57, 41, 10, -121, 48, 66, 67,206,169,192,132, 37, 74, 21,170,128, 3,182,180,235,168, 50, 76,110,100, 37,160, 53,174,114,163, 85, 1, 56,160, - 82,112, 10, 6,103, 10,136,230, 41, 82, 56, 26,114, 91,167, 66,180, 41,152,183, 4, 68, 66,223, 64,146,166,168, 18,166,154, 40, - 74,131,174, 10, 84,146,149,165, 94,173,180,237, 52,213,104,100,151, 1, 3,142,100,122,138,125, 20,151, 56, 38, 84,118, 77,230, - 11,209,229, 33, 17,210, 81, 32,176,200,147, 37,164,183, 28, 85, 21,114,160,209, 52, 42, 34,162,189,148,239,210,225,133,241,226, - 9, 65,215,232,164,171, 78, 6,152,215,139, 36, 9, 57, 59, 50,109, 69,152, 73,142,228,120,140,196,106, 26,124,121,178, 38,149, -150,156, 42, 21, 0,181,210,160,119,252, 90,185,181,220,158, 45,244,185, 79, 21, 92,128,204,122,105,230,194,208, 16, 12, 79, 26, - 90,251,159, 53,131,104,156,213,157, 74, 80, 84, 80,160, 29,123, 96, 1, 78,180, 87,184,172, 84, 29,135,175,171,166,172, 44,119, -107, 89, 8,214,113, 95,154,157,100, 79,140,246, 83,137,104,228,137,142,196,142,161, 96,183, 70, 43, 75,142,201,122, 55,191, 75, -247, 38, 2, 90, 13, 37,170,161, 27,138,207, 90,171,211,173, 61,158,251,101,108,211,239,185,201,146,160, 92,243,236,171, 8,130, - 0,185,210, 86, 43,110,241,242,107,205,203, 62,181,227, 83, 36, 90, 22,197,183, 24,159, 5,183, 16,135, 12,230,211, 37,217, 62, - 19,197, 65,165,120,110, 50,223,176,178, 7, 90,116,173,108,111,249,151,246, 12,142,209,239, 1,192,151, 2,122,208, 5, 25,226, - 9,199,170,172,141,216,141,161,141, 36, 3,157, 94, 76,178,255, 0,199, 95,242,255, 0,130, 96, 24,251,118, 88,249,197,253, 19, -165, 57,238,246,196, 41, 56, 69,142, 92,181,185,113,191,173, 52, 45, 72,187, 95,148,244,123,116, 55,150,119, 48,196, 55,170, 66, - 28, 74, 23,213,118, 15, 50, 71, 33,236,144,206,238,252,242,106,210,197,247,136,115,128, 47, 57,136,216,153, 12, 92, 72, 3, 34, - 68,217, 46,131, 33,106, 28, 79,205,250,126,138,169, 92,175, 46,233,144,185, 30, 38, 37, 35,238,236,126,114, 89,178,189, 21,137, -142, 73,179,227,182,139, 19,109,178,130,195, 15, 56, 84,175, 1,151, 54, 19,188,173,117, 37, 68,169, 91,180,177,231,228, 60,195, -180,221,193,122,195, 21,201,141,193,160, 41,107,220,224,136, 8, 10,210, 87,142, 0,125,163, 84,243, 13, 78,198,162,171, 52,216, -109, 89, 89,154,152,119, 59,227,175,202,130,139,148, 8, 49,155,113,248,114, 38,171,231, 52,211,171,108, 44, 33, 37, 15, 2, 72, - 37, 7,120, 29,218,243,142,224,247, 62,233,204,115,219, 30, 5, 11,137, 67,167,129, 32, 20, 82, 8,232, 7, 12,177,170,201,109, -206,162,220,147,232,165, 39,177,187, 82,102,186,183,237,114, 30, 66, 20,185, 11, 64, 80,109,104,117,123,144,104,145, 74,123,100, -138,145,218, 65,214,121,219,140,163, 39,140, 69, 67, 17,132,202,135,119, 26,193, 36,184, 29, 56,221,177,115, 12, 74, 34, 68,134, -129,119,197,140,165, 20,165, 39,188,133, 32,143, 94,138, 45,222,237,173, 45, 18,185, 7, 71, 93, 37,204, 3, 4,199,133,104,140, - 99, 15,111,220,132,136,118,136,175,173, 44, 92, 11,104,101,180, 52,153, 45, 54,238,208, 59,194,137,220,160, 7,104, 26, 75, 55, - 43,199,130, 26,231,144,132, 28, 78, 74, 23,232,169,113,218,235, 90,116, 90,216,177, 50,242, 86,244,136, 78, 23,225, 6,221,125, -214, 66,209,243, 26,117, 72, 64, 30,200, 82, 66,232, 15,162,163,187, 80, 95,115, 54,131, 24, 5, 3,151, 62, 39,141, 61,240,164, -224, 15, 93, 16,115, 20,180,202, 77,214, 91,112, 98, 50, 67, 10, 68,118,166, 50,194,155,121,113, 42,176,224,116, 35,196, 73, 88, - 80, 73, 73,236, 3,227, 51,100,221, 29,166, 56,195,157,129,196,133, 84, 57,132, 84,192,226, 15, 26, 84,150,192, 32,192,245,253, - 30,138, 33,115,177,218,150,162,149, 99,182,249,208,144, 16,220, 86, 68, 70,220,113,165, 37, 38,171, 10, 31, 56,145,176, 17,221, -217,218,116,150,110, 50,146,130, 71, 7, 98,165, 78, 92, 62,158,218,140,232, 74,101,141, 49, 39,217, 31,127, 27, 39, 29,139,109, - 19, 95,144, 23,102,158, 24, 48,216,114, 68, 39, 79,134,151,220, 74, 10,195, 96,251, 11, 20,174,222,192, 72,214,147,109,187,134, - 43,192,219,242,237, 8, 67,128, 42,113,110, 99, 60,120,245,244,133, 90, 92, 17, 6,201,251, 80, 67,120,166, 96,117,117,211,246, -204,140,181,166, 83, 13,102, 11,146,163,198,105,249, 30, 19,193, 97,165, 26, 5, 84,144,146,104,148,130, 21, 78,160,246, 87, 84, -155,180, 16, 91, 72, 76,122,140,100,157, 46, 33, 20, 46,105,243,245,211, 76,135, 94, 45,202,129,187, 69,203,205,166, 60,135, 45, -202,250, 52, 59, 38,115,170,121, 0, 66, 15, 2, 74, 20, 83,216, 66,215, 66, 64,248, 43, 67,164, 89,199,107, 45,203, 97,124,136, -194,224, 20, 5, 40, 74, 40, 4,180,122,220, 7, 73, 20,227,109,136,120, 7, 34, 81,105, 22,195,114,202,242,118,163,201,185, 88, -158,199,219, 91, 15, 55, 42,217,127, 97, 2,125,189,173,168, 15, 54,234, 1, 80, 32, 63, 29, 75, 10, 38,138, 10, 4, 83,179, 86, - 28,193,182,193,177,205,225, 71, 51,100, 4, 2, 28,194,160,230, 70, 32,145,169,160,150,184, 2, 64,115, 74, 56,132, 37,203,235, - 19,101, 33,137,174,107,192, 62,243,114, 61, 97, 83,178,159,108,197,181,201,131, 54, 43,111,219, 66,157,138,151,247,180,207,129, -225, 52,210, 14,234,168,126,203,126, 32,248,129,248,178,205,146,103, 57,160, 7, 21, 56, 5, 92,248, 84,127,135,115,144, 87,177, - 26,130,202, 97,152,174,198,153, 9,251,124,133,161,199, 93, 75,196,180,221, 42, 64, 85,119,148,171,179,166,132,229,250,156, 8, - 32,180,208,240, 12,101, 58, 40,152,199, 45,118,196, 11,205,189,225, 37,111, 58,245, 97,178, 82,218, 91,240, 66, 21,237,171,160, -237, 81, 29,189,105,162, 55,115, 92,141, 14, 9,215, 73, 48, 28,233, 75,223,160, 93, 61,250, 37,198,207, 12, 90,154,142,200, 83, -242, 28,250, 87,140,135,148,144,147,214,135, 99,109,154,158,254,193,223,167,237, 98, 54,174,100,141,121,215,171, 46,128, 0,199, -210,184, 83,177,198,168,163,141, 15,108,186,216,172,175,196,109, 81,173,178, 96, 66, 67,111,220, 11,228,169,253,236, 41,198, 28, - 42, 5, 69, 66,170, 64, 80, 21, 29,167,178,154, 57, 44,229,191,113,210, 92, 28,247, 16,208, 50, 10, 65, 31, 57, 30,138,115,194, - 18,191, 1,153,192, 82, 15,247,106,218,165,155,246,214,183,181, 1, 50,203,126,215,134,111, 79,147, 32, 43,195,221,180, 80,182, -122, 87,183,229,212,191,139,151,196,210,135,247,154, 87,253, 57,124,176,200, 83,159, 14, 11,151,236,135, 34,240,199,244, 3,232, -174, 55,204,229, 79, 7, 26,198,240,200,247, 7, 13,163, 23,141,112,155, 33,108,171,104,186,100, 87,133, 21,202,121, 74, 77, 10, -146,218, 16,211,105,175,238,129,217,174,193,117,179,134,204, 75, 70, 46, 69, 61, 77,200,124,254,179, 90, 40,148,231,232, 20,233, -177,231,235,129, 10, 43,105, 82,157,106,220,159,123,139, 28,175,168,154,242, 18,151, 28, 89,173, 62,133, 9, 32, 87,190,189,221, -176,101,219, 60, 82, 92, 66,106,195,209,250,126,106,144,247, 17,130,208,145,178, 5,207,186, 63,122,122,227, 75,179,246,230,113, -187, 43,109,172,248,144,173,168,117, 43,147, 40,138,144, 22,253, 18,134,147,218,106,178,105, 81, 91,203,128,200,237,163,181,107, -123,173,113,123,143, 75,220,131,212, 5, 47,226, 52,160, 21,231, 35,101,153,109,133,172,222,209,142,223, 90,181, 91,160, 49,110, -176,182, 94, 81, 76,152,179,158,101, 42,125,230,100, 56,162,211, 75, 46,184,224, 74,187,129, 36, 0,163, 81, 81,183, 90, 65,115, -225, 58, 86,106,115,156,227,218,139,152,226, 16, 10,220,242,205,165,173,228,176,176,202,207, 21,206, 24, 61, 67, 7,105,232, 24, -122, 78, 88, 85, 61,203, 51,204,162, 45,134,193, 50,225,225,189, 36, 42,230,150,227,201,142,135,163, 72, 97,242, 10,221, 83, 97, - 75, 72, 76,134,155, 43,170, 21, 64,180,239, 77, 9,233,172,179,219,161,153,238,208,163, 36, 56,140, 70, 67,215,235, 24, 86,198, -243,118,220,185,126, 67,180,187, 68,182,145,137,158,198,247,100,208, 36, 26,101,240,228,247,187,164,106, 10,123,164,185,195,222, -113,114,171, 89, 59, 82,242,127,187, 4, 55, 89,251,181, 78, 88,155, 97, 51, 76,155,116,137, 54,197, 60,252, 89, 76, 52,227,138, -118, 41, 12,180,234, 94, 66,125,130,165,110, 79,206, 90, 69,149,189,187,153, 31,136,160,135,119,149, 49,197, 1, 7,129,199, 35, -159, 3,194,185, 78,253,185,187,116, 99,110,100,210, 29,164, 3,165,186,125,105,129, 80, 70, 57,168,239, 41,196,207,220, 43, 36, -221, 36, 68,194,166, 53, 56,194,205,249,111,141, 99,200,122, 44,145, 17,164, 71,193,141,206,241, 37, 46,172,161, 99,234, 25,241, - 18, 42, 58,167,191, 88,254,108, 6,217,166,230, 50,143,138, 9, 83,165, 95,161,128,132, 35, 21, 62,218, 78,194, 4,161,203,196, -143,152,147, 81,254,107,151, 68,203, 57, 66, 94, 66,134, 74, 32, 49,110,139,117,102, 49,148,103,109, 93,249,111,221,195,101,194, - 7,136,161, 34,230, 66,141, 58,144,122,119,106,235,100,177,117,149,152, 99,138,184,146, 9, 57,146, 17,139,234,106,213,103, 48, - 78, 94,228,111, 64, 3,211,141, 51,179,108,206,239,253,220,127, 20, 15,165, 17, 50,139,181,170,253,122,108,167,115,206, 72,198, -209, 37, 17,211,186,189, 18,149, 92, 86, 84,158,242, 18,123,181,105,109, 99, 25,147,199, 35,188,198,150, 55,177,197,164,255, 0, -208, 61,189, 53, 83, 97, 33,141,175,104,200,145,236, 84,168, 94,211,109,149,124,201,109,246,187,124,101,204,150,236,134, 81, 22, - 35, 67,114,223,150,226,210,150,144, 63,210,117,105, 7, 86, 82,204,219,118, 23,188,160, 1, 73,169,197,222, 27, 9, 53, 96,243, -187,253,147,135, 36, 99,248, 5,142, 29,167, 38,186,219,238,214,108,183,149,100, 72, 73,151, 7, 38,149,104,117, 18, 27,177,184, - 18,182,214, 97,144,130,135, 27, 10, 78,228,146,163,213, 93, 51, 27,125,188,188,194,201, 46, 36,115,152,215, 53,204,137, 48, 45, - 14, 9,226, 15,245,113, 7,133, 71,219,158,100,120,184,120,238,131,221, 7, 46,178,123,107, 95, 49,252,145, 99,200,175,174,230, - 86,171, 37,183, 34, 86, 55,150,230, 54,203, 78, 76, 22,240,198,220, 78,105,116,184, 94, 32,248, 22,151,159,148,220, 6,173,241, - 92,217, 30, 10, 30, 83, 77,154,168,238, 90,214,116,199, 37,108,146,109,150,226, 9, 94, 90, 94,200,201,102, 26,155,161,140,141, -218,158, 0, 47,115,156, 21,207, 32, 56,168, 24, 0, 42,226,254, 86,221, 72, 88,210,153,146, 71, 16,188, 58, 6, 40,149, 26,227, -185, 20,235,237,170, 29,206,233,113, 68,217, 96, 74,106, 95,136,234,140,231, 29,102,165, 43,114,162,134,168, 81, 9, 32,244, 2, -158,141,104,174,173,132, 5,193,173, 64, 81, 58, 61, 21, 75, 44, 90, 28,141, 8, 5, 23,200,178,148,100, 57, 14, 67,126,151, 88, -167, 32,186, 75,146,134, 91, 33,102, 59, 15, 44,173, 45,130,144,128, 67,104,218,129, 68,129,234, 29,154,158, 34,124, 77,107, 66, - 18,208, 7, 86, 1, 58,234, 91,156,102,144,188,246,215, 80,120,147,156, 44, 94, 92,101,249,103,186,167, 23, 79, 34, 78,194, 56, -131, 36,188, 35, 23,126, 75,112,163,203,206,185, 78, 78, 65, 38, 63,188,188,182,223, 67, 72,133, 2,108, 87,156, 81, 65, 41, 8, -173, 1, 29, 56,127, 50,242,245,215, 59,199,127,110,233,221, 19, 36,185,107, 67,177, 58, 99,133,177, 7,105, 10, 49,123,195,134, - 8, 9, 60,106, 99,110, 67, 92,221, 69, 67, 65,227,146,253, 61, 93, 53, 17,101, 60,171,120,229,126, 73,203,121, 39, 38,247, 86, -174,217, 77,226, 85,214, 68,104,123,132, 24, 33,211, 70,227, 71, 11, 82,148, 26,140,210, 82,211, 96,146,118,164, 87,174,182,187, -102,199, 30,195,107, 21,140, 36,150, 68,208,213, 57,158,151, 30,183, 21, 39,172,212,105, 31,226, 30,218,236, 15,146, 30, 91,192, - 56,103, 36,192, 45, 60,105,198,150,238,105,230,236,174, 53,186,103, 37,191,119,199,102,201,131,134, 89,165,184,242,217,180, 46, - 75,175, 69, 68, 84,150,252, 39,148,152,237, 47,198, 93, 67,139, 82, 82,134,198, 79,123,191,113,183,184,117,252, 17, 54,205,170, - 24,100,122,153, 72, 78,243, 90,220, 0, 94, 36,234, 8, 8, 69,173,255, 0, 46,221,199,183,197,165,177, 54, 71, 63, 50, 71,168, - 12, 58,184,103,211,146,125,116,112, 53,241, 24,198, 9, 61,198, 56, 79, 26,197,239, 57, 53,197,187,150,113, 63,138,111, 86, 75, -196,123, 77,193, 49,208,212, 88,183,120,173,187, 2,232,137, 22,219,122, 26, 97,109,166, 51,139,170, 84,118,141,198,186, 29,142, - 40,108,225, 18, 69, 0,110,160, 23, 65, 4,180, 98, 67, 72, 85, 80,170, 80, 98, 73,194,175,188, 64,113, 12, 13, 94,143,167,174, -162,142, 69,228,150,124, 57,115,153,150, 81, 29,137, 18, 82, 82,254,248,175, 37,248,174, 41, 42, 67,141,185,177,105,114,169,249, -138, 0,142,210, 41,171,219,107,136,167, 46, 67,238,231,213,210,163, 48,114,192,227,136,163, 14, 53, 78,175,190,108,215, 21,249, - 17, 46, 42,109,200,108,180,182,168,133,130, 66, 41,236,161, 34,160, 41, 74, 29,123,105,171,118, 70, 6,158,186,120,198, 72, 90, -172,249,103, 52, 64,200, 84,244,168, 15,133,239, 82,101,169,134,222, 79,209,236,220,175,105, 68,245, 0,129, 95, 87,195,171, 54, -232,183, 32, 60,161, 57,117,212, 25,222, 90, 42, 33,186,114, 91,242, 97, 56,135,102, 36,164,165, 99,114,150, 78,198,212, 66,147, - 66, 77,106, 8,237,245,106,113,184,142, 30, 61,117,155,186,126,163, 81,220,140,230, 76,102, 84,167, 28, 9,142, 74, 35,165,101, - 64, 17,227,132,247, 87,185, 52,169,245,233,231, 94, 48, 96,184,162,213, 84,141, 90,133,115, 43,252,139,220, 89, 98,180, 75,112, -252,117,110, 52,163, 74, 66,220,221,219,208,236, 65, 62,173, 70,126,239, 29,179,128, 39, 21, 79,104, 31, 57, 20, 35,105, 92, 42, -149, 94, 50, 55,160, 92,215,225,213,255, 0, 13,181,188,175, 12, 18, 54,133, 39,161, 62,159,111, 87,176,111,176,189,189,226, 6, - 41,243,253, 85,104,214, 40,164,193,205,240, 45, 17,157,123,199,240,139, 66, 56, 89, 43,161, 83,211, 89,220,142,149,235,210,134, -186,150,233, 91, 59,131, 65,196,175,176,161,164, 62, 37,173, 89,231, 28,159, 42, 40,131,104, 98, 66,146,183, 27, 82, 28,113, 69, - 8, 74, 70,209,233,248,116,147,183,174, 38,154,248, 97, 79,252,122,193,120,185,190,137, 87,185, 32,110, 59,150,128,189,168, 8, -168, 38,166,181, 63, 59,174,137,214,237,140, 80,210, 27, 86,247, 8,183,192,180, 71,111,193, 83, 74,220,165, 33,224, 8,162,149, -237, 0, 59,123,250,124, 26,166,187, 60, 42, 28,165,106,199,226,121, 8,117, 5,181,180, 2,147,185,202,143, 74, 72, 3,191,184, -107, 63,114,218,132,248,210,166,136,247, 86,173, 17, 26,152,245, 29,144, 89,126, 66, 25, 38,136, 66, 25, 78,231, 22,163, 90, 37, - 45,238, 5,106, 61,159, 9, 26,192,243,111, 51,193,203, 54,230,105, 78, 57, 52,113, 39,128,167,109, 44,221,118,228, 25, 82,155, - 55, 72,209, 26,155,124,187,197,180, 63, 30,230,195, 66, 41,158,144,175, 21,249,210, 34,194, 66, 70,225,237, 37, 14, 7, 28, 73, -173, 18,144, 73,232,189,120, 95,154, 57,134,227,154,238,100,123,222,229,212, 81, 56, 55,188,239,153, 7,248, 86,210, 61,161,150, -205,107,144, 28, 56,246,165, 66,153, 6,119,101, 78, 8, 45,227, 27,180,170, 93,210,199, 21,163, 53, 81, 80,226, 93,184,185,111, -106, 68,132,110,222, 21,181, 45, 72,142,149, 19,217, 95, 94,164, 89, 89, 74, 47, 27, 40,145,232,215, 42, 41, 8, 3,136, 7,183, - 3, 80, 77,171, 99,103,184, 50,246,160,250,197, 49,172, 55,252, 6,241,132,230, 47, 74,199,160,198,187, 91, 50, 73,208, 45, 81, - 99, 69, 67, 9, 24,156, 27,100, 39,144, 92, 63, 89, 84,220,148,160,219,131,231, 23,118, 14,206,154, 77,206,218,238,198,107,116, -148,185,174,136, 57,196,149,253,163,158,255, 0,254, 8,163,128, 11, 85, 19,237,246,178,180,184, 4,114,251, 16,154,109,202,228, -126, 54,197,172,127,118, 91,101, 67, 68,249,238, 66,117, 12,204,104, 72, 83, 87, 25,204,191, 37, 68,183, 90, 41, 42, 91,174, 52, -123,136,160, 85,106,116, 29,182,110, 55,179,178, 71,131,164, 7,101,134, 0,128, 7,176, 30,172, 82,171,155,111,111,110,212, 92, -207,207,254, 41, 76,139,190,127, 18, 23, 32,194, 22,152, 80,167, 90,165,226,166, 81, 97, 47, 9, 43,188, 61,116, 65,142,221,119, -144,159,163, 18, 80,133,142,158,218, 66,250, 14,205, 92, 59,105,146,201,102, 46, 18, 23,181,160,255, 0,148, 53,117, 39,106, 2, - 58,138, 83, 23, 13,136,184,224, 14, 31,162,148,239,124,177,143,221,238,248,203, 51,237,214,136,150,185, 97,187,173,194,226,182, - 91, 90, 86,212, 22, 16,166, 88, 82,148, 64, 33,217,238, 54,224, 32,117,167,118,227,168,209,236,146, 89, 91, 78,246, 72,227, 35, - 80, 48, 41,226,123,228,118, 52, 22,250,123, 41,136,227,134, 82,164,103,242,249,118,212, 43,112,229,236, 38,238,235,145, 36,199, -117, 48, 45, 86,251,220,227,108,143, 49,109, 51, 34, 77,156,162, 10, 68,128,218,182,188, 10, 20,165,144,170,141,225, 42,165, 82, - 53,115,103, 99,119, 96, 3,181, 2, 28, 64, 32,228,117,227,212,133, 80, 2, 16,128,160, 28, 77, 63,111,124,219, 88,229,183,104, -110,137, 0,212,173,105, 61,210,161, 9, 10,222, 43,164,133,226,168, 41,181,141,114,150, 1,117,154,209,184,217,246,202, 45, 45, - 64, 75, 8, 82, 83,107, 74, 84, 55, 56, 21, 84,144,218, 92, 74,129,237,246, 72,244, 82,109,214,217,117, 12,125,215,241, 57,116, -245,122,106,132,193,110,171,216, 42,103,154,120,218,225, 99,101,248, 51,219, 97,249, 22, 1,119,146, 72, 77, 29,143, 32,201, 10, - 13, 13,219,104, 86,133,164, 30,209,181, 71,165, 41,170, 8,111,111,163,213, 27,154,161,167, 79, 98, 1,245,131,215,133, 3,182, - 64,170,185,215,183,215,176, 91, 21,173,139,142, 57, 33,181, 93,227,207,182,189, 29,153, 8, 14,195,188,196,187,196,171,109,246, -149, 33,205,172,130,135, 16,122, 41, 84, 32,235, 95,201,183,204,151, 85,166,240,192,109,159, 27,156, 92, 59,178, 70, 91,145,107, -179, 32,162,104, 42, 14,125,182, 54,214, 80, 61,226, 54,162,147,135,111,233,166, 37,215,157, 91,114,109,238,209,117,176, 72,181, - 70,100,197,143,117,143, 46, 25,137,112,139, 18, 90,154,149, 33, 30, 10,210,133,182, 78,199,130,106, 58,157,180,233, 77, 87,183, -150,190, 17,225,246,242,151, 53, 85,132,168, 92,244,147,218, 11,122,170, 69,245,179,109, 94,232,164,104, 14,165,103,185, 43, 16, -110, 99, 76,162, 56,114, 84,155, 67,211, 38, 52,210,234,237,190,123,137,109,111, 55, 66,104, 3, 41, 90, 16,125, 36,158,211,162, -138,214,228, 0,237, 89, 16,222,209,138,122,115, 53, 87, 45,163, 10, 6,255, 0,133, 55,211,159, 96, 83,223,178,196, 64, 67,119, - 34,136,101,123, 20, 23, 10,217,106, 74,155, 95,138,226,129, 41, 36, 37,228,172,250, 2, 85, 94,237, 89, 8,238,216, 30,135, 14, - 29, 36,244,123, 61,180,201,180, 11,236,253, 53, 29,221,249, 1, 44,197,149, 62,205, 49,169,129,136,242,157, 82,203,129,181, 8, -113,159, 1,144,218,107,251, 79, 5,164,168,158,207, 88,213,197,164, 14,116,173,241,120, 39,175, 18,126,130,157, 52,243, 97, 17, -143, 77, 65,151, 12,247, 43,131,141, 21,199, 95,142,219,183, 9, 13, 37, 40,144, 26, 30, 29,193, 8,109, 37, 35,118,227,209,165, - 56,163,232, 41, 61, 40,117,162,134,206, 31, 24,106,195, 39,118,103,250, 41, 90, 0, 42, 78, 41, 69,172, 87,236,150,119, 32,173, -229, 67,145, 2,203,225, 91,225,209, 23,197,150,214,139, 55,130,203,114, 29,107, 99, 73, 0, 33,141,129, 42, 89, 7,183,212, 83, -121,162, 43, 35,142,167, 18, 93,238,133,239, 41, 32, 28, 78,103,217, 85,147, 69,171,142, 53, 56,220,179, 75, 0,133, 50,233, 30, -238,168,106,180,123,236,251,211, 78, 36, 73,122, 84, 86,211, 29, 94, 11, 71,117, 65, 14, 56, 40,107, 78,132,118,245,214, 82, 27, - 3,226,123,138,173, 65,213,158, 63, 46,170, 76,118,160,224,234,105, 55,159,198,187, 71, 69,209,187, 83,132, 64,143, 10, 29,169, -213,189,177, 17,163, 67, 43, 91,207,168, 36,128,162, 7,138,186,158,157, 71,105, 26,148,109, 89,105,220,115,128, 14,118, 61,100, -240,249,133, 58, 34,140, 59, 1,136, 20,131, 39,145,226,203,184,218,160, 42, 34,213, 39,239, 31,188, 30,105,163, 84, 2,132,186, -148,178,107, 82, 2,147, 84, 34,134,186,183,178,176,214,201, 28,199, 14,243, 67,125,122, 92,163,135,109, 74,104,108, 99, 44,254, -191,209, 67,218,249, 33,249, 77, 37,241, 13, 45,176,220, 73,147, 10, 65, 42, 42,184, 49, 37,230,208,129, 90,138,251,180, 69,130, -159,135, 80,229,217, 3, 93,164,156, 73, 79, 66,125,101,105,178, 26,194,148,169, 27,150,164, 63,110,152,153,101,217,239,161, 14, - 72,150, 97, 56, 16,154,199, 91,101,227, 85, 16, 2, 74, 75,131,169,232,148,211,225, 67,246,104,195,193,110, 3, 33,234, 79,171, -215, 67,193, 15, 61,116,167,106,228, 59,117,193,168, 6, 21,204, 7, 46, 10, 12,176,231,138,160,210, 36,190, 90, 33,105, 73, 93, - 66, 1, 66, 91, 35,210,149,118,130, 42,220,219, 65,136,146,225,195,235,255, 0, 31, 72,163,248,114, 50,167, 46, 25,122,157,146, - 78, 78, 55,100, 14,222,114,107,157,254,199,141, 88,236, 34, 66,124,121,183,187,149,197, 80,154,105,160, 74, 80,162,234,222, 65, - 77, 72, 6,157, 72,208,143,107,115,228,107, 67,115, 84,244,140, 61,184,122,106,109,181,137,148,134, 12, 73, 32, 14,178,114, 21, -107,188,197, 94, 56,115,203,118, 43,133,226, 14, 90,237,121,247, 48,204,178, 92,231,228,119, 8, 57, 68,175,117,181, 68, 92,199, -227,248,138,240, 23, 29,184,241, 99,173, 10,137, 29, 14,178,227,210, 92,143, 33,202,176,194,153, 82,250,229,183, 37,109,220,189, -100,217,119,118, 25, 37,121, 8,192,226, 20,162,160, 66, 50, 4, 23, 59,134,160, 6,162,160, 92,223,109,208,237,241,177,161, 11, -138,250,113,204,116, 5,192, 96,165, 9,192, 37,115,190,227,205, 23,191,114,126, 55,142,202,220,149, 46,210,219,200,101, 43, 76, - 70, 23, 50, 81, 41, 33, 43,117,213,132,132,186, 43,185, 71,165, 42,117,205, 55, 11, 75,107,135,186, 88, 96, 17, 52, 52,144,208, - 92,236,135, 18,226, 73, 42,163, 4, 24,101, 89,201, 64,113, 9,215,236,166,122,121, 91, 45,189, 76,142,211, 19, 94, 75, 83,219, -189, 41,245,238, 41, 83,227,235, 74, 7,112,161, 73, 72,244, 14,206,193,169, 80,109, 22,164, 28, 61,220, 61, 57, 10,138,226,135, - 17,209, 76,105,220,157,148, 66,145,107, 99,100,180,199,185,199,145, 97, 99,194,220,227,174,194,132,182,202,222, 38,181,218,234, -150,245, 8,244,211,174,209,171,107, 11, 27,120,228, 14, 8,161,193,217,113, 92, 62, 97,234,167, 34, 1,117,244, 33,164,252,115, -151, 51, 43, 99, 54,180,191,227,188,134, 71,184, 66,144,162,165, 39,197,162, 11,224,130,170,245, 91, 72, 31, 1, 58,122,235,105, -181,148,185, 64,239, 28,126, 93,166,154,144, 52,147,211, 74,108,243, 38, 97, 22, 91,240,221,147, 45, 9,115,221, 3,202, 90, 10, -156,112,204,218,161,236, 84,138,238,219, 95, 81,248, 65,174,126,203, 3, 81,186, 66,144, 61, 31, 32,105,122, 90,252,169, 78,227, -206, 87, 0,212,152,171,120,188,175,122,247,104,229, 78, 0,134,147, 17, 42, 74, 94, 61, 73, 82, 84,227,160,118,126,247,167,161, -127, 33,136, 60, 32,207,252,126,138, 38, 68,105, 17,124,179,118,142, 93,159,239, 43,114,225, 44, 34, 88,105, 73,241,153, 12,165, -101,212,180,176,165, 40, 16, 74,250,212,106,105,219, 34, 82, 56,105,195,181, 6, 62,142, 29,116,152,226, 94,140,234, 67, 87, 63, -100,191,115,179,108, 72,119,198,247, 41, 50, 29, 87,132,159,118, 62,211, 72,109, 20,165,122,123,104,161, 20,175, 65,223,168, 95, -200, 96,214,188, 23, 46, 62,234,103,237,167, 52,157, 26, 56, 42,254,154,231, 13,211, 26, 18,111,109, 68,181,255, 0,170, 64,240, - 99, 71,136,239, 93,162, 59,187,146, 86, 77,122,209, 40, 82,137,214,246, 25,192,112,212,123,125, 20,236, 55, 58, 26, 92,236,215, - 26, 89,185, 49,247, 99,233,154,251,138,251,182, 67,237, 50,136,205,146, 94,159, 66, 84, 64, 0,213, 69,229,144,154,127,165,163, -157,205,153,200,209,195,229,236,160,203,147, 33, 65,158,116,145, 6,116,219, 85,225,169, 79,171,103,221, 82,196,247,208, 23,185, - 97,237,202, 83,109, 86,164, 18, 28,167,201,240, 13, 55, 42, 74, 72, 60,105,246,201,168, 40,204,224, 62,186,147, 37,222,161,100, - 54, 27,131,211,205, 17, 38,229, 22,233, 51,173, 28,150,226,154, 82, 82,202, 73, 53, 5, 74,165, 79,114, 70,169,101,178,150,210, - 88,204, 39, 20, 32,117, 23, 34,159, 64, 95, 74, 82,217, 46,135,147,212,158,170,171,220,195, 21,163,115,135, 42, 35,232, 90,163, -221, 81,107,114,218,193,216,159,119, 65, 78,245,244, 36, 0,124, 71, 17, 64, 59, 1,214,227,102,115,124, 20,227,154,252,213,111, -111,114,244, 10, 79, 28, 87,164, 87,182, 91, 75,202,202, 91,191,188,242, 4, 86,172,176,100,172, 80, 36,253,224, 34, 42, 34,210, -122,245, 87,138, 86,175,143, 79,120,130, 56, 11, 58,207,169, 84,123, 42,174,242,229,211, 64, 34,232, 86,142,205, 69,223, 77, 63, - 49,188,130,241,142,205,119, 34,182,151, 22,109, 78,228,102,215, 22,164, 33,251,237,234, 11,240,153,113, 34,191, 57, 45,184,164, - 87,208,179,170,219,155, 70, 95,183, 67,135,188, 27,234, 14, 7,231,199,209, 74,176,156,218,163, 73,193, 20,250, 41, 17,133, 11, -123,182,248, 37, 40, 91,246,155, 60, 24, 50,101, 1,246,151,224, 54, 26,100,168, 87,169, 73, 36,250,122, 13, 88, 56, 2, 9, 25, - 23, 19, 85, 82,202,233,201,113,226, 74, 83, 98,250,211, 15, 62,237,198,229, 33, 81,173,214,200,141,137, 14,143,105,221,206,149, - 45, 77,182, 43, 66,183, 0, 64, 79,203,216, 52,168, 87, 78,134,140, 73,169, 54,227, 75, 80,102, 77, 75, 44,219,176,188, 7, 5, -180,115, 45,130,225, 33, 83,175,216,202, 85, 6, 3,187, 21,247, 84,229, 0,211,165, 14, 15,164, 90,202,139,130,170,245, 82,157, - 53,158,101,196,219,141,211,236, 37,104,210,215,226,122, 64,196,125, 21, 30,224,201,112,255, 0,134, 35,142, 39,170,170,236,233, -111,164, 90,238,139,121,199,243, 12,153,219,149,198, 99,202,115,222, 91,143,110,184,168, 52,130,242, 21, 80,146,200,105,110,133, -118,144,164,210,148,235,175,107,116,106,104, 31,179,106, 0, 58,198,126,181, 3,208,106,244, 68, 0,211,246, 64,249,169, 65,168, -241,238,170, 56,178,239, 30, 14, 61, 14,224,101, 58,153, 46, 21,120,242, 88, 83,161, 46, 44, 53, 85, 41, 75, 11, 85, 0, 35,183, -208, 52,219, 35, 49,129, 49,111,237, 8,225,192, 97,133, 50,247,248,125,244,198,164,200,248,186,161,219,228,194,179,170,116,228, -202,109, 42,143,238,216,159,186, 48,203,100,109,222, 30,241, 11,142,130, 1,173, 9,245,157, 65,117,211, 94,246,235, 32, 33,255, - 0, 50,250, 19, 33, 80,140,133,206,212,224,158,154,101,220,112, 91,235,115, 97, 42, 60,152,114,216, 65,109,169, 17, 91, 82,145, -113,104,188, 70,229, 6,136,162,232,154,116, 74,137,245,106,194, 43,230, 57, 87, 14,190, 30,186,145, 20,173, 32,168, 56,212,169, -153,230,151, 28,194, 92, 57,170,128,206, 50,136,126,233,106,178,218,162, 67, 17, 30,135,103,177, 71, 68, 40,101,242, 82,149, 62, -242,218,104,189, 33,229,245, 91,138, 82,186, 2, 0,166,219,118,230,237,234, 20,187, 50, 73, 42,174,113, 37,201,208, 50, 0,100, - 2, 10,118, 73, 90,215,157, 32, 34, 1,135, 71,233,226,120,210,157,182,249,116, 75,118,251, 53,173, 82,174, 23, 91,139,205, 66, -129, 20, 40,200,121,247,221, 80, 0,210,166,189,105,254,109, 59,225,177,186,166,145, 3, 70, 36,210,237, 86,225,233,236,175,165, - 78, 8,194,236, 92, 23,193, 87,126, 16,181, 93,109,214,222, 65,228, 68, 88,209,152,115, 84, 24,134,249, 60,102,153,107,241,210, -194,151, 25, 82, 35, 74,117,171,107, 18, 28,101,132,180,242,122, 23, 29, 66,208,234,137,215,146, 55,190, 97,184,230, 45,217,155, -171,212,219, 70, 72,109,187,148, 55,195, 96, 43,136,192, 57,197, 28, 78, 96,128,220, 90, 43,174,108,174,139,109,208, 37, 99, 72, - 1, 74,161,196,228,163, 17,135, 12,197,119,247, 17,243,119,142,216,177,124, 23, 25,202,175,178,249, 75,148, 49,172, 22,219,104, -191,230, 76,217,216,183,230, 89, 42,173,176,129,149,113,148,194,150,148,192, 68,167, 91,241,156,109,111,237, 21, 85,106, 64, 42, -233,150,156,247, 29,246,143, 2, 55, 74,245,112, 26, 83, 0,132,143,218, 56,128, 80, 96,113,224, 78, 53, 14,247,119,129,210, 57, -182,224,191,169,184,129,218,226,128,122,235,158,124,251,230,217,171,245,191, 42,117,182,100,219,131, 45,185, 58, 50,148,227, 36, - 54,171,194,223,121, 40, 41,109,229,186,118, 37,196, 10,237, 34,160,214,157, 42,214,219,205, 78,186, 47,115,218,154,228,210,138, -168, 10,225,234, 3, 44, 49,236,167, 29,117,225, 38,182,161, 78,144,126,106,230,214, 81,200,119,155,181,193,248,118,251,155, 47, -166,124, 52,220,210,250,150, 82,150, 27,121,137, 93, 92,235, 90, 52,148,165,194, 61, 31, 14,181,151,124,220,216, 35,129,193,117, - 6, 98, 58,214, 63,159, 17, 77, 29,205,164,233, 7, 26,128,241,254,106,159, 38,243, 58,219, 12,190,135, 20,234,216,121, 41, 88, - 91,241,219,117,101, 40,107,231,117, 41, 74,131,116, 7,231, 30,181,211, 59,151, 48,186, 41, 60, 82, 84, 53, 0,232, 46, 0, 41, -251,216,175, 64,194,160, 75,127,226, 56,129,149, 60, 31,228,107,236,201,114, 45, 77, 52,252,135, 26,125, 54,152,190, 10,188, 70, -140,199,136, 82,148,165,164,208,109, 8,175,250, 61,127,105, 58,169,190,230,233, 99, 44,105,114, 57,253,247,116,128, 50, 9,218, -114,255, 0, 54, 92,106,162, 71,107, 37, 50, 24,122,105,118,203,115,201,243, 11,236,124,122, 2,158, 48, 89,118, 36,100, 92,159, - 4,179, 37,167, 60, 68, 38, 82,148, 13, 18,151,222, 4, 53, 95,216, 21,253,147, 70, 38,231,230,217, 70,233, 36,118, 56,224, 56, - 16,131, 79,160, 34,245,246,226,118,246,143,184,120,107, 69, 22,184,163, 33,113, 88,253,153,132,173,217,119,155,236,156, 85,223, - 13,162,230,199,173,208,196,130,217,218,123, 95, 47, 45,161, 94,224, 15,102,153,135,157, 69,195,101,153,231,221,239, 5, 61, 36, -124,200, 15,109, 32,218, 73,172, 52,118,122,126, 70,161,251,122,158,103, 44,202,237,211, 45, 76, 61, 58,209, 26, 91,209, 88,144, -201,113, 51,146,225,113, 94, 42, 18, 55, 5,248, 73,142,161,215,191,225,209, 59,117,125,244, 13,149,178, 16, 30, 64, 40,114, 32, -162,117, 42,212,105, 60, 88,222, 91,196,125, 85, 95,115, 12, 53, 57,117,210, 76,145,105, 77,180, 93, 36, 75,185, 37,184,140,248, - 81,146,156,116, 37, 46, 54,216, 20, 72, 75,113,208,218, 64, 79,114,147,173,223, 47,243, 73,218,227, 26,164, 46, 44, 1,170, 74, -158,254, 68,245,234, 36,149,232, 52,113,222, 60, 38,161,192,251, 41, 51, 16,184,222,241,135,210,200,178,201,185,181, 21,166,218, - 82,226, 55,225,200, 82, 86, 81, 82, 66,169,214,138,167,166,189, 53,218,172,119,248,103,137,174, 46, 29,236, 70, 61,191, 87,171, - 26,156,217,132,130,166,200, 60,137,145, 92, 91,103,221, 48,188,133, 41, 74, 29, 74, 15,134,148,184,242,250, 80,144, 86, 59,201, - 63, 21,116,171,205,222,222, 19,164,200, 20, 98,122,134,127, 46,218, 73,115, 70, 4,212,149,100,229, 28,174, 41, 64,119, 27,187, - 45,109, 33,149,165, 1,164, 7, 7,138,178, 10, 74, 67,138,175, 78,160,250,245, 76,235,248, 46, 73,210,241,250, 17,126,154, 97, -209, 53,199, 3, 87, 59,143,242, 28,130,231,102,183,223, 27,182,120, 42,155, 57,200, 45,198,157,190, 50,194,152,240, 20,233, 41, - 0,147,181, 46, 84,118, 86,135,174,185,111, 60,115,196, 92,174, 7,116,187, 83, 92, 65, 80,131, 78,107,236,164, 69, 98,102,118, -149,232,246,252,141, 89, 43,143,222, 18, 19, 42,204,244,232, 22,187,188, 37,193,247,169, 14,128, 73,140, 30, 68,135,161,161, 42, -112,166,174,199, 44,130, 58,165,127,249, 42, 35,199,220,207,205, 83,115, 92,204,186,148, 56,198, 85, 0,201,184, 16,215,122, 14, -174,177,159, 17, 90,155, 91, 47,131, 26, 2, 2,159, 74,145,234, 74,219, 54,153,140,101,120,180, 3, 22,224,211,106, 69,150,203, -108, 74, 17,120, 75,166,200,155, 27,241, 98, 70, 76,106,173, 5,211,224, 48,250,220, 87,237,138,147,243, 55, 28,101,171,103,176, -149,202,220,156, 74,105, 61,229, 5,197,115, 69, 37,160, 14, 25, 12,210,172, 36, 2,229,163, 30,142, 57, 0, 80, 39,203, 26,132, -174,241, 49,172, 85,156,107,124,167,230,197,148, 63,187,129,183,223,110,143, 61,144, 41,128,132,180, 69, 60, 21, 86, 10, 71,138, -175,223,234, 83,180,141,108,236,205,197,251,228,121,104,105, 8,228, 3, 32,213,207,167,222, 56,117, 97,152,170,203,143, 14, 38, -128, 14, 7, 15,151,171,219, 85,189,155,198, 25, 10,225,147,206,115, 37, 82, 96,219,237, 41,179,202, 82,158, 83,177,228, 94, 49, -121,133,213, 50,195,132,130,176,236,148,248,200,160, 21, 69, 43, 64,105,173,184,182,186,187,208, 12, 67, 91,156,160, 0,136, 28, -212, 10, 56, 97,129,235, 94,138,205, 79, 20, 39, 80,215,130, 99,232,232,168,145,155,166, 21,117,190, 69,146,178, 69,229,235, 84, -207,115,101, 79,153, 13,174,105,116, 48,149, 16,165,148,133,171,222, 93, 93,105,208,129,251, 32,106,241,246,183, 86,145,227,139, - 65,199, 15, 79,208, 5,103, 46, 99,105,201,114,160,229, 90,156,189,228, 22,231,237,121, 7,184,196,176,197,153,109,142,249,116, -248, 18, 86,134, 67,193,197,132, 85, 69, 9,221,236,129,216, 77, 58, 83,161,178,252,162, 72,197, 56, 57, 58, 56, 1,236,250,106, - 9,140,202, 23, 46, 31, 93, 38,222,120,231, 36,157,114,110,207,111,189, 51, 42, 37,158, 85,178, 68,217,111, 56, 16, 35,149, 74, - 8,109,179,237, 40,130,148,161, 64,143, 74, 66, 64,246,180, 33,221,153, 44, 69,210, 52,130, 65, 0,112, 68,196,252,187,105,160, -199, 64, 10,154, 5,206, 19,159,100,145, 50, 61,230,224,245,157, 78,196,145,118,189,220, 27, 97, 82, 69,162,212,250,140,247,163, -161,175, 17, 42, 42,109, 10, 67, 74, 27,170, 85, 81,218, 52,254,201,186,218,110,143,128,204,242,219,114,246, 13, 73,168,128, 28, - 26, 31,164, 17,169, 74,184, 0, 66,132,167, 99, 33,215, 13,100,167, 75, 84,106, 32,106, 32, 20, 4,162,133, 65,193, 69, 70,140, - 59,141,223,231,230,144, 44,114,219,251,206,213,114,181,227,175, 48,211,222,240,244, 88,210,153,117,136,237,169,196, 37, 40, 6, - 83,140, 16,154,128,107, 80, 64, 32,235,111,204, 60,190,235, 80,111,108, 28,102,219,124, 66,214,204, 1, 3, 90, 23, 35,131,131, - 92, 48, 7, 73, 44,110,182,181, 64, 5, 90,221, 95, 56,114, 21,223, 41,150,248,160, 24,220, 65,107,154,224,239,120, 40, 14, 33, - 16,162,224, 64, 56, 28, 1, 4, 3, 23,203,236,194,108, 88,239,188,169, 48,109,191,234,183,105,113,201, 14, 49, 96,140,183,164, - 55, 25, 5, 59, 85,226, 44,202,112,165, 21, 53, 46, 35,224,214, 91,107,182,107,203,203,120,226, 23,237, 57, 0, 39,179, 0, 61, - 6,178, 45,183,192, 56,156,190,186, 72,191,115, 11, 54,251, 33,201,174, 17, 23,107, 83,115, 35, 59,102,132,100, 41,109, 69,251, -145,214, 84,135, 27,170,129, 8, 9,142,219, 77,238, 53,220, 86, 69,119, 39, 83,108,121,125,215, 82,152,181, 43, 74,234,244,140, -189,100,158,196,232, 52,207,195, 24,156, 28,211,136,249,248,122,105,103, 33,243, 57,110,243, 31, 61, 57,141,167, 3,200, 87,146, -189,112,199, 44,252,129,117, 97,182,155,180, 48,205,173,168,199, 99, 44,182,132,184, 84,248,140, 87,227, 18,123,198,223, 71, 66, -222,118,155, 13,183,108,132, 62, 66,201,162,139, 75,113,106, 61, 20,133,196, 16, 83, 34, 43, 89,185,192,253,232,186,232, 4, 39, - 49,196,101,244,226, 42, 60,127, 42, 90, 36,221, 90,134,167, 82,110, 83,215,143,165,244,186, 75,143,170, 82, 90, 18, 20, 40,106, - 18,170, 2,154,119,171,213,174,115,109,106,247,198, 30,252,218,210,243,212,186,147,210, 2,138,207, 75, 2, 5, 7,252, 5, 74, -246,139, 54, 59, 50,115,120,227, 87,132, 71,185,222,164,181,143, 9,142,190, 83, 21,166,222, 97,180, 45,107, 88, 52, 74, 91, 46, -180,149,122,134,160, 58,242,226, 38,153,203, 73,104,105,114,113,193, 78, 29,160, 85,114, 72, 94, 49,195,143,174,157,183,171,126, - 17,106,205,242,139, 4, 27,164,103,172,112,237,215,200, 54, 0,191,161,126, 83,105, 47, 8,200, 80, 39,169,113, 75, 82,130, 71, -106,200, 26,131,183,223, 93, 92, 66,199,185,135,196, 58,117,118,144,165, 59, 21, 59, 41, 19,153, 28, 72,111,187,168,167,160,210, -140, 30, 60,198, 50,251,155,150, 43, 29,194, 44,136,182,107,189,226, 43,147,124,100,178,196,162,175,118, 83, 72, 86,226, 54,130, -210, 87,180,118,133, 33, 98,154, 85,247, 48, 92,217, 91, 9,165,105, 4,129,135, 16,114,249,211,215, 81,222,217,181, 6,140,206, - 94,170, 52,156, 71, 24,241,161, 92,100,221, 27, 48, 46, 23,153, 41,117,110, 43, 97, 82, 76,105,126,236,197, 15,122, 95,128, 83, - 64, 79, 85,166,157,244, 40, 55, 89, 30, 93, 22, 42, 26, 10,116, 33,111,206, 15,170,153, 13,145, 20,240,166,166,101,139,197,198, -133,194, 51,172,133,187, 38,215,112,154,185, 14, 10, 33, 86,118, 36, 41,200,206, 80,245, 37,228,198,108,117, 31,180,125, 7, 83, - 45,247, 41, 94, 66,228,112,255, 0,118, 11, 82,226, 87, 96,105,178,140,125,231,242, 53,217,144,234,225,217,159,140,132, 69,101, - 35,195, 75,208, 46,203, 74, 5, 58,154, 2,217, 93,123,122, 31, 94,172,111, 46,225,117,156, 50,224,100,241, 92, 79, 72, 45, 33, -163,212, 71,207, 82, 1, 17,198,212,247,138,147,236,167, 30, 63,130,217,213, 42,232,167, 94, 96,161, 94, 21,206,203, 49, 85, 15, -120, 54,199, 88,105,150,220, 61,190, 35,136,117,194, 62, 13, 84,221,111,114, 90,152,155, 31,219,114, 17,209,220, 46, 94,192,128, - 80,151,190,164,112, 31, 47,157,105,122, 46, 47,143,218,173,185, 29,185, 30,236,243, 56,236,155,236,119,101,120,137, 75,166, 91, - 98, 50,169,237, 40, 85, 64,191, 41, 52,237,170,145,233, 26,120, 95,205,114, 3,194,171,138,142,207,169, 16,250,233,146,215, 59, -182,153,113,113, 6,151,198, 87,251,164, 65, 21,148, 93, 39, 49, 96,137,251,111, 77,102,104,117, 50,222,165,126,106, 54,238, 36, -246,104,155,185,201, 5,206,156, 78,152,203,143, 82, 17,135,105, 20,236, 49,146, 67,137,226,158,202, 78,149,196,177,237,216,110, - 55,123,131,117,104, 92, 47,146,165,185,112,132,221, 82,238, 56,237,189,214, 12,102, 64, 81,171,133,216,205,248,132,143,103,233, - 7,125,117,113, 14,245, 36,142,144, 61,157,208,128,127,168, 34,147,235, 41,211,133, 62, 36, 17,128, 6, 38,166,191, 44,214, 46, - 16,199,249, 74, 31, 39,242,183, 44, 99, 28,105,128, 96,215,124, 70,233, 14, 94, 85,113, 83,111,228,179, 49,255, 0, 2, 75,141, -177, 25,149,137, 46, 40,251,171,174,184,166,210,173,187,118,128,183, 92,109, 11,219,242, 45,141,231, 49,110, 30, 28, 45, 95, 9, -190, 33,233,205, 24, 0,195, 50, 49, 42, 0,204,144, 43, 69,178,134,205, 43, 95, 41, 1,173, 32,145,196,230,112,244,125, 1, 9, - 52,195,243, 29,147,218, 51, 14, 97,228,142,106,197, 35,201,191,224,220,167, 37,219,237,238,233,116,183,170,204,253,186,224, 22, -208,102,104,183,200,113, 83, 34,181, 37, 74,171,173,132,141,170,246,148,148,133, 42,151, 92,253,185,217,110,114, 65, 20, 23, 26, -174, 33,238, 22,133,208,173,192,134,185, 0, 36,226,152,144,120, 18,162,163,110,119, 34,246, 87, 22,184,230, 83,164,130, 87, 19, -149, 70,217, 94, 7,111,180, 76,194,177,203,106, 17, 50, 76,188,109,140,179, 53,186,161,123,226,198, 18,219,113,248,240,155, 88, - 59, 92, 40,109,157,203, 82, 9, 21, 86,208, 78,218,235,149,237,155,188,151,113, 58,103,132,106,150,176, 28,220,152, 23, 17,192, - 18,112, 7, 20,196,162,165, 87,205, 16,136,106, 37, 79, 1,209, 67,227, 56,203,108,221,178,120, 22,167, 45,235,131,100,198, 34, -198,114, 93,210, 2,167,199,114,116,179,225,169,242,148, 61, 25,244, 39,222,164, 41, 77,134,222,108,148, 36, 32,170,155,181, 34, -231,122,248, 0,198, 32, 71,184, 2, 16, 98,157,226, 1, 32,161, 64,138, 16,130,112, 53, 35,111,185,138,202, 65, 44,240,182,102, - 33, 5,132,185,160,168, 64, 85,164, 56, 22,148,112,197, 9, 8,224, 90, 72, 40,241,172, 74,149,158,164, 71,105,177, 10,219,104, -247, 75, 96,152,144,152,236,188,146,176,215, 64,165,251, 1, 79,111,237,169, 73, 0,245,235,167,228,220,226,123, 60, 88,245, 33, - 10, 1, 69, 10, 50, 36,102,153,112,236,170,249, 67, 90, 15,109, 54,165,227, 17, 45,247, 86,163,163, 99,209,225, 76,152, 18,180, -245, 67, 10, 93, 0,119,169,161, 42, 42,220, 65,209, 67,185, 25,194,244,212,115, 26,140,115, 52,189, 47, 11,241,173,143, 76,182, -199,140,185,119, 23, 89,183, 61, 50, 66,131,138, 75,179,148,167, 60, 81, 83, 68,128, 18,132, 5,119, 13,221,199,164,120,183, 71, -106,124,146, 18,129, 64, 29, 8,163,214, 83,230, 20,141, 32, 16,211,144, 79,151,162,163, 24, 88, 59, 83,178,119, 45,238, 50,144, -244,152,205,173,196,169,170,136, 54,102, 80,219,232,113, 36,144, 42,226, 80,176,165,119,215,248,181, 62, 61,224,197, 16, 45,197, - 48,237, 35, 49,235,250,106, 78,167, 34,129, 75,109,224,176,208,151, 30, 13,248,136,147, 18,202,166, 16,186,214,178, 18, 10,106, -127,106,158,211,170, 30,138,122,180,111,221, 30,204, 92,114, 95,156,212,125,110, 39, 14, 11, 71,255, 0,186,237,166, 56,140, 80, - 68,135,159, 84,228,183, 67,227,169,136,192, 72, 40,237,174,240,135, 64,255, 0, 72,246,233, 31,204,158,171,242, 95,170,155,212, - 87,209, 80,166, 69,139, 49,100,182,219, 99,186,202,190,244,147,142, 54, 88,102,159, 72, 28,115,180,122,106,119, 80, 15, 89,214, -194,214, 99, 44,135,162,163,192,243, 33, 61, 26,169,142,197,150, 75, 50, 74, 37, 49,226,174,194,110,119, 95,120,113, 59,154,140, -136,172,159, 13, 32, 86,128,151, 85,219,242,106,218, 59,166,135, 56,183,136, 69,169, 58,198, 36,113, 65, 81, 52,171, 76,192, 35, - 62,148, 56,234, 36, 7,166, 72, 83,132,130,165,167,122,170,106,122, 86,157, 62, 29, 57,108,224,231, 16,122, 22,172,152,230,144, -125, 84,179, 61, 37, 54,187,101,185,167, 3,106,119, 99,202, 64,250,199, 2,235,189, 99,213,210,131, 78, 49,170,231, 23,116, 39, - 96,253, 52,152,202, 43,141, 69,147, 25,251,202,233, 33,226,200, 13, 49, 37,197,182,143,156,165,200,114,170, 39,173,106, 84, 62, - 64, 53, 50, 47,217, 53, 23,160,122, 6, 66,172, 76,136,209, 71,217,181, 75, 92,152, 77, 72, 34, 51,111,167,223,158,223, 84,178, -203, 78,213, 73,168, 6,170, 62, 31, 80, 7,121,211,236,153,179, 2, 1,233, 4,246, 83, 78,115, 88, 48,169, 22, 59, 16, 45, 38, - 68,187,138,144,134,153, 41, 22,248, 67,105,121, 36, 29,234,120,130,118,133, 17, 74, 19,217,242, 2,220, 75, 51,139, 91,131, 70, - 4,253, 21, 12,172,184, 14, 57,211, 79,221, 89,184, 62,220,134, 67,109,189,112,121, 13,178,202, 86, 75,113, 33,133, 19,189,107, - 39,169, 53, 36,168,255, 0,154,193,206,210,208,193,157, 17,140, 51,209, 76,139,253,174, 45,244,222, 88,142,226,197,150, 35,255, - 0, 73, 38,187, 87, 49,208, 3,117, 72,173, 42, 80, 61,145,220, 7, 94,164,232,221,120,216, 28,198,143,146, 99, 82, 34, 6, 36, -114, 98,152, 10, 25,197, 11,213,159, 30,197,229, 91,227, 59,141,219, 18,244,132, 67, 91,239, 48, 34, 91,225, 37, 75, 74, 80,166, -157, 69, 74,138, 64, 37,117,169, 58,102,204,126,221,243,170, 56,241,255, 0, 26, 48,223, 8,151,175,123,235,164,187,231,191, 74, -177, 34,205,105, 2, 12,112,249, 15, 56,128,159, 24,182, 27, 82,130, 10,194, 3,138,249,194,149, 61,154,145, 4,129,210, 23, 28, -210,138, 18,143,212,236,112,164, 75,118, 47,111,176,182,110, 50,231,221, 89, 83, 49, 76,160,228, 93,145,214,243,171, 95,135, 68, -168,168,172,147,217,211,174,165,190,236, 76, 52, 4, 34,148,100,116,199, 33,233,167, 49,121,246, 34, 67,186,180,229,222, 18, 31, - 75,165,160,228,198, 93,184, 72, 91, 5, 61, 86,183, 9,217, 95, 16, 30,134,190,189, 53, 28,113,184,162, 3,232,194,163,185,197, -116,224,126,106, 94,128,230, 75, 53,201, 77,200,155,121,143, 14, 35, 14, 60,240, 55, 39, 20,220,133,213, 45,180,130, 2,130,126, -177,123,168, 59,129,211,178, 69, 12,106,116,181, 70, 88, 10, 40,131, 85, 80, 82, 28,102, 87, 40,199,142, 93, 47, 92, 35, 37,184, -169, 91,139,170,166,145, 64,178, 43,251, 72,236,169, 61, 69,123,199, 84, 74,124, 49,212,125,148,165,214,174,225,244, 84,213,197, - 48, 85,143,223,149,150,205,184,192,183,181, 29, 47,218, 99, 77,151, 5, 87, 37,176,137,105, 13, 62,168,200,241,152, 64, 95,134, -225, 73, 90,137, 0, 26, 1, 83, 81,147,223,174, 70,226,207,132,141,164,228,226, 1, 69, 42,173, 92, 14, 10, 21, 7, 70,117, 58, -202,111,135, 89, 61, 85,208,140, 91,204,127, 35,228,237, 95, 28,179,101,136,183, 53, 52,187, 49,235,139, 22,148,219, 50, 11,148, - 91, 99, 33,150, 99,137, 49,151,226, 67, 67,161, 37,180, 37,128,149,251, 94,211,128,212, 14,101,117,201,118,150,186, 60, 88,148, -183, 0,221, 74,208,167, 18, 65,193,196,102, 75,148,116, 55,141, 91, 58,253,247,143, 14,152,168, 57,142, 1, 50, 84,205,114,169, - 62, 23, 54, 38,203, 21,203, 68, 37,198, 38, 68,104,234,159, 37,253,174,173,219,132,212,183,239, 4,184,186,173,213,161,181, 45, - 27,202,183, 21, 84,215, 85, 71,110,150, 41, 26,224, 72, 69,203,128,199,212, 49,236, 74,208,195,184, 49,163, 72, 64, 18,159, 55, - 30, 66,181,220, 65, 76, 43,186,165, 79,153,110, 55, 43,172,107,157,193,119, 24, 77,194,104,190,242, 25,109, 69,126, 43, 69,210, -164,212, 84,138,154, 80, 83, 84,109,182,154, 53,214,212,105,127,117, 2, 21,192, 41,224, 80, 14,220, 41, 55, 55, 13,185,196, 56, -135,116,212,123,107,186, 70,202, 46,165,187, 28,241, 2, 74,108,120,221,156,120,242,148,228,120,176,227, 72,141, 24, 58,131,184, -169, 74,147, 26, 41, 64,223,187,161, 82,141, 41, 67,125, 43,100,108,109,115,198, 68,225,211,129, 63, 57,234,224, 43, 37,121,187, -127, 47,145, 39,239, 3,147,155,232,204,116,167,248, 80, 24, 78, 47,138,196,206,209,125, 84,200,209, 81, 22,210,222, 95, 61,185, - 10, 84,134, 88,152,241,115,220, 89, 82, 10,246,251, 83, 74, 94,114,167,176, 36,122, 70,170,239,239,230,101,169, 5,164,157,122, - 64, 28,127,204,126,238, 3,174,180, 86,164, 3,169,199,130,253, 94,220,105,243,141, 95,248,238, 42, 33, 61,108,184, 60,243, 55, - 25,151,139, 19, 83,156,125, 78, 56,171,214, 68, 17, 22,108,174,160,161, 75,139, 17,164,180,201, 64,246, 86,144, 65,237, 26,172, -186,219,175,158,231, 62, 80, 60, 78,233, 61,141,197,173,234, 4,149, 43,154,154, 91, 39,133,128, 1,238,227,235, 57,159,170,167, -104,220,219,199,216,134, 61,142, 49,100,179, 37,169,205,221, 39,172,174, 98, 10,156,122, 28, 4,186,152, 91,203,138,171,135,194, -117, 53, 42, 52,234,163, 65,212,107, 33, 39, 41,222, 94, 58, 64,231,146, 8, 3, 14,149, 5,231, 12,177, 30,192, 42,221,187,220, - 16,134, 8,128, 80,113,250, 62, 93,180, 40,231, 92,102,205,100,198, 29, 83, 22,233,210,254,248, 55,181, 72,109,132, 23,131,211, -148,235,111,200, 10, 79, 97,247, 98, 54,168,247, 43,248,116,252, 28,183, 61,195,165, 36,185,163, 32, 20,162, 4, 65,235, 7,213, -215, 82,153,186, 50, 48,208, 0, 60, 79,167,244, 83,158,225,146, 89, 23,149, 68,189,179, 97,137, 26, 76,184,118,148,174, 75, 45, -210, 67, 86,251,145,142,236,170, 30,218, 34, 58,222,175, 82, 42,216, 61,186, 99,111,178,154, 24,221, 14,178, 90, 28, 79, 82,130, - 83,214, 83,214,149, 26, 91,214, 74,226,253, 33, 79,173, 10, 47,177,106, 57,126,209,109,118,247,140,251,212, 24,150,200, 6,193, -127, 13,165,196, 0,144,156,157,168,146, 18,146, 69, 78,224,194, 19,180,118, 5, 87,187, 87, 31,204, 30,219, 57, 94,194, 92,242, -246,255, 0,248,184,143,159, 58,132, 26,215, 61,161,192, 1,164,159, 93, 65,242, 98,162,229,201,161,204,124,197, 54,107,141,156, -205, 75,143,109, 67, 44, 75,121,166,230,200,113,102,161, 41,240, 82,154, 41, 71,160,246,181,184,218, 55,121,246,237,179, 92,206, -118,168,156,198, 39, 74, 29, 32,122,120, 14,202,131, 37,185,145,197,204,226, 9,245,208, 54,120,121,100,139, 52,251,237,193, 34, -219, 25,216,174,194,182, 73,117, 34, 48,121, 44,161, 8, 10, 1, 69, 41, 74,150,166, 29,245,208,157, 93,203,191,135,184,183, 89, -115,138, 47, 28, 51, 35,177, 13, 84,220, 91,200, 64, 35, 36,166, 21,250,249,145,177, 27, 25,145,103,117, 99,239, 75,157,217, 17, - 93,109, 36,174,123, 86,121, 69, 98,181, 33, 69, 37, 77, 80,215,183,174,174,246,235,231,188,205, 35,156,130, 48,213, 94,151, 15, -211, 76,136,158, 2,140,141, 72, 16,121, 67, 62,119, 31,180,218,189,250,224,212,171, 4,165,220,161,152, 53, 18,174, 42,150,203, - 17, 35, 48, 18, 22, 2, 74,157,107,197, 82,149,212,169, 85, 61,106, 5, 46,229, 45,190,235, 14,137,218,210,210, 8, 43,144, 4, -130,126,106,126, 61,113, 29, 65, 87,231,160, 97, 95,121, 67, 43,188,200,117,251,197,233,200,107, 97,235,148,247,125,228,132,200, -154,232,105,183,124, 18,218,247,248,108,165, 9, 75, 68, 2,160,132, 18,144, 72, 0,208, 77,111,183, 89,177,173,208,220,208, 14, -172, 78, 61,103,143, 5, 32, 28,234,197,134,105, 84,234, 63, 47,151,170,141,102,183,220,215, 26,142,195, 81, 22,235,201,116, 42, -106,226, 38,122, 15,185,193,138, 18,207, 68,251, 32, 41,253,175, 33, 45,214,180, 20, 2,170, 80,208,218,236,236,174,195,139,128, - 85, 69, 76,201, 83,236,238,149,236, 61, 20,213,204,146,176,160, 56, 39, 79, 85, 64, 28,177,151,114, 75, 22,216, 18, 46,215, 11, -154,101, 53,146, 56,235,137, 14,253, 3,113,226,205,101, 13,164, 16,181, 81, 74, 14, 41,117,238, 73,165, 58,212,234,118, 72,236, -100,121, 17,177,161,165,160,118,148,249, 15, 69, 87, 78, 36, 0,106, 39,141, 48,114, 22,179,104,210,144,241, 85,193,113,100, 77, -145,122,184, 41, 11, 42,101,185, 87, 8,235, 74, 90,216, 85,182,149,108,154,145, 66,106, 43,171,219, 73,237, 26,132, 6,234, 1, - 7,251, 15,210, 83,209, 85,179, 54, 71, 46,105,245,212, 75, 63, 35,202,237,115, 81,121, 76,169,108, 60,194, 93,182,199,117, 46, - 21, 82, 53,189,182,130,207,111,236,182,154,154,119,208, 14,205, 89,203,101, 13,195, 12,104, 19, 63, 89, 38,162,235, 45, 64,120, -252,133, 60, 45,188,171,151,219,162, 64,136,236,249,150,209, 26, 45,205,201,111, 54,178,169,183, 5,220, 20, 86,234,119, 18, 74, - 10,146,162,208,233,236,251, 68, 13,202,213, 60,188,189,110,231, 57,250, 71,120,180,117, 0, 0, 3,229,214, 6, 66,137,165, 79, -101, 79,120,199,153, 25, 88,196, 42,220, 25,105,167, 86,182, 27, 36,182, 55, 63, 58,205,225,161,164,208,168,238, 12,150,144,160, - 15, 64,191,140,156,190,227,202, 49,223,135,182, 44,145, 62,246, 39,214,184,211, 47,107,142, 3,167,230,175,121, 39,205,231,190, -227,247,155,122, 26, 48,223,190,221,101, 57, 46,226,243,155,165, 61, 2, 10, 97,165,108,178,146,122, 54, 29, 66, 66,137,234, 84, -107,222,117, 54,195,202,201,118,248, 96,145,193, 99, 13,110, 35, 37, 5,237, 10,153, 28,240,234, 29, 84,207,132,233, 28, 72,205, -199,233, 95,154,160,235, 54,125,102, 55,201, 57,189,151, 7,139,103,186, 75,197,223,180, 92,166,218, 31,118, 44,219,197,206,107, - 30, 12,107,172,146,167, 29, 75,174, 34,104,110, 66,210, 83, 66, 80, 72, 1,106,223,174,153,123,191,137, 44, 29,182,220, 65, 19, -109, 93, 19, 99,115, 34, 6, 61, 82, 68, 9,142, 99,137, 30, 40, 42, 30,128, 53,237,113, 5,170, 84,109, 37,230,137,110,154,219, -123,150,131, 19, 97,208, 26,210, 71,121,160,232,144,169, 61,224, 83, 86, 65,193, 66, 3,136, 47, 31, 55,200,217,189,216,166,185, - 8,170, 59,183,132,100, 75,110, 83,133, 62, 35, 48, 28, 72,113,107,246,182,148,134, 88,170,186,126,202, 71,126,177,199, 98,130, -216,234, 94,232,106, 4,235, 32,132,244,170, 86, 63,196, 80,113,234,165, 8, 25,221,145,185,111, 79,151,107,126, 93,214, 28,155, -180,219, 12, 57,107, 46, 49, 10, 40, 97, 75,109, 65, 4,236, 74,218,117, 53,173, 42, 0, 3,176,117,133,184,237, 47,116, 70, 54, - 59, 75, 93,131,147, 50, 78, 97,122, 19,229,141, 37,142,114,131,237,236, 52,240,196, 60,199,192,196,213, 97,227,155,102, 60,196, -123,124,219,171,110, 93,221, 44,110,155,115,189, 92,130, 65, 37,195, 69, 40,179,227,182,148, 2,104,145, 83,219, 82,116,251,101, -149,157,195, 45,152,251,125, 82,177,192,185,197,216, 21, 40,154, 81, 16,128,112, 57, 86,142,203,117,146, 8,139, 24,154, 93,159, -215,245, 84,123,155,242,132,118,242, 57,109, 89,237, 72, 68,168,211,150,183, 31, 9, 30,232,196,201, 78, 52,223,188, 1, 94,210, -250, 2,207,195,167,185,155, 99,181,109,213,200,183, 1,176,228, 0,255, 0, 78, 7,209,129, 78,218,169, 98,200, 73,113,233,165, - 44,123, 53,188, 89,253,222, 44,152,205,200,187, 91,110,173, 16,165,167,114,252, 85,166, 84,132, 32,146,125,170,152,209,201,244, -246, 29, 99,239,108, 98,148, 17, 25, 65,160,143,161,125,166,152,115, 65, 83,195,252, 62,186,112, 69,151, 41, 89, 4, 43,237,213, -114,157,247, 60,118,205,119,125,166, 9, 75,168,149,113,144,241, 66, 10,201, 52, 82, 92,112, 10,247, 83,213,170,182,219, 36, 90, - 97, 77, 65,197,184,240,224,190,128,135,174,148,161,163,181,126,138,106,216,121, 58,243, 24, 39, 31,115,198,128,245,251, 47,139, -146,166, 96, 90,146,212, 56,150,134,166, 46, 97, 91, 64,159, 17, 9, 90, 1, 9, 61, 61,143,226,213,211, 54, 88,222,232,220, 72, - 45,107, 11, 83,167, 36, 62,207,109, 59,165,170, 79, 64,249,124,244,233,129,158,229,159,113,155,156,217, 46, 8,208,226,228, 25, - 44, 86,156, 86,231,133,193, 19,163, 56,203,235, 7,165, 75, 78,160, 36,118,125, 26,207,237, 29, 83,221,109,176, 71,112, 89, 27, - 19, 0, 9,233, 46, 14,195,208, 27,143,104,232,168,238,115, 38,104, 3,131,147,235,167,165,227,148, 46,156,132,246, 75, 49, 76, -190, 32, 70,180,220,237,214,180,183,255, 0, 87, 2,215, 18, 99, 81,138,148, 79, 93,243, 37, 10,143, 90, 70,153,143,101,101,149, -188, 77, 46,239, 13, 42,122,120,159,152,211,110,112, 14,232,199,233,169,115, 31,200, 46,185, 69,246,200,196, 11, 52,201,151, 35, -139, 93, 32,217,160, 66,101,115, 36,220,100, 88, 90, 76, 72,241,216,109, 1, 78, 45,110, 72,166,212,164, 18, 84,176, 70,179, 59, -150,217,166, 38,177,135,188,233, 89,144, 79,126, 69, 56, 15,163, 60,168,218,221,101, 78,104,158,202, 49, 54, 70,119, 62, 45,158, -193,141, 96,121,149,243, 47,201,111, 87, 75,125,130,199, 99,197,230,220, 46,115,175, 88,195,107,157,121,101,136,236,176,167,164, - 46,207, 28,161,217, 13,161, 39,195, 74,137,112, 0, 43,169,214, 60,166,233,101,106,135, 29, 45,115, 70, 4,146,136, 10,117,160, -199,136,165,197, 1,144,144, 1,196,252,213, 22,193,196,121,135, 36, 93,139, 24,198,112,124,226,251,116,201,151,120, 93,186, 21, -150,193, 58,235,112,190,201,138,144, 46, 6, 59, 44, 52,227,178,220,135,224,167,222, 10, 1,216, 80,119, 82,130,154, 27,123, 18, -100,107, 88,210,112, 40, 0, 42, 83,163,177,106, 68,125,236,129, 39,133, 63, 97, 89,115,213, 97,239, 67,141, 96,201,204, 56, 86, -139,213,201,167, 99,218,100, 59, 16,218, 44,158,255, 0, 26, 68,182, 86,148,109, 83, 76,251,179,232,146,248,246, 82,164, 44, 40, -130, 14,162,190,204, 49, 30,198,169,118, 42,156, 9, 10,123, 1,195,160, 37, 50, 87, 82, 39,200,103, 86,118,215,229,119,144,213, - 7,142, 82,252, 60,141,251,111, 55,227, 88,197,235, 21,201,109, 54, 43,197,223, 23,133,115,185,178,210, 45,214,153, 18, 25,183, - 45, 62,254,227,108, 58, 21, 26, 48,117,101, 33, 59, 2,200, 26,110,230,194,234,221,176,233,140,185,175, 13, 71, 52, 56,142,250, -144, 48, 25,132, 82, 2,148, 33, 22,164, 24,158,192, 59,185,140,208,241,225,149, 50,224,121, 28,206,185,183,154,248,215, 10,198, -241, 75,180,252, 10,233,200,143,241,235,124,153, 62,193,122,135,197, 49, 57, 18,100,251, 94, 63, 17, 82,231,187,108, 67,204, 50, - 46,210, 1, 41,114, 56,116,116, 66,153,241, 9,104,239,121, 91,122,188,217,118,155,171, 91, 97,166,226,230,226, 40, 4,154, 92, - 27,160,185,204, 46,213,165, 64, 87, 53,185,106, 26,138, 5, 20,112, 50, 87, 35, 90, 51, 40,168, 83, 52,232,162,207,240, 7, 48, - 79,183, 55,142,220, 48, 28,163, 27,150,213,165,177,123, 86, 81, 96,153, 96,105, 54,153,206,148,195,150,164, 73,105,181, 22,230, -132,182,136,230,132, 56, 74,182, 86,135, 92,150,241,238,218,220,101,157,175,110,157, 39, 22,144,139,145, 56, 96, 14, 40,114,194, -153, 49,189,167, 89, 4, 12,241,194,164,104,126, 80,185,138,239,104,227,156, 61,188, 99, 32,102,254,246,125,106,225,149,101,215, - 43, 45,210, 46, 57,136, 71,186, 92, 30,139,111,110,252,243, 80,100,136,194, 55,222, 76, 69, 11,113,123,212, 5, 67, 74, 81,166, -172,108, 68,251,205,227,219, 20, 78, 12,238,135, 18,210, 26,217, 28, 90, 10,148,238,169,196,132,193,125,106,100,111,184,114, 6, -156,192, 43,254, 24, 82, 78, 63,229,135,151,238,156,117,202,153, 14, 33,139,221,178, 73,204, 94,113,203, 44,219,102, 63, 97,185, -221,239, 23,180, 79,126,253, 30, 52,139, 67, 81,224,184,153,177, 96,253,195, 40, 76,123,122,124, 53,128, 8, 39,126,216,246,219, - 84,251,187, 31, 35, 24, 72,138, 64,208,128,146,224, 74,185,192, 1,136,212,199, 2,122, 61, 53, 44,219,184, 55, 37, 79, 94, 43, -245, 84, 77,140,113,158, 77,144,205,199,226,218,236, 89, 52,185,153,157,162,225,120,181,189, 10,201, 46, 75,178,236,184,252,151, -225,203,153, 20, 33,178,167,227,198,122, 51,236, 56,242, 1, 72, 91, 43, 4,213, 10, 2, 60,206,146,220,144, 35,113, 8, 75, 64, - 4,146, 2,229,211,139, 78, 89, 16, 71, 10,173,116,110,121, 8, 15,203,244,210,173,235,203,247, 38, 73,187,199,197, 88,226,190, - 79, 25, 54, 69,143,195,191,196,179, 55,130,221, 62,246,149,102,158,166,226,125,225, 26, 48,138, 95,122, 59,147, 28, 12, 37,212, - 36,167,196, 82, 16, 21,184,208,206, 22,151,176, 22, 1, 11,201, 69, 77, 46, 82, 9, 69, 68, 84, 82, 49,162,137,146, 56,133,105, -234,192,211,101,158, 45,204, 44,110,225,248, 84,236,115, 43, 77,254,252,253,213,200,150,249,118, 73, 76,220, 37,192,198, 93,152, -221,193, 73,101, 72, 14, 47,220, 23, 25,104,144, 66,126,140,178,226, 85, 66,133, 0,212,166, 89,222,239,217,144, 1,114, 4, 42, -116,247, 74,116,161, 15, 94,130, 58,168,165, 5, 79,116,175,203,234, 52,254,196,248, 83, 42,207, 93,181,205,177,226, 25,115,182, -156,134,239, 27,140,151,156,194,198,229,200,199,196,217, 44, 69, 68, 59,113,156,219, 42,140, 36,151, 17,181, 45,135, 55,157,224, - 83, 85,119,194,230,198, 19,113, 20, 79,116,122,151, 6,146, 11,220, 64, 64,122, 93,169, 64,204,240,167, 33,133,247, 26, 64, 5, - 50,234,163,240,184,119,147, 68,143,188,209,195,220,149, 49,188,127, 30,155,145,228, 49, 85,129, 93, 86,197,155, 27,152,215,135, -108,153, 44,136,167,221,154,125, 16,230, 22,157,112, 4,148, 36, 45, 36,138,157, 91,203,180, 93,220, 49, 76,111, 70,150,184,247, - 93,128,207, 28, 50, 35,143,109, 52, 45,228,140,147,164,245,225,194,163, 77,214,111,126, 55, 31,119, 96,214,208, 47,197,157,200, -241, 27, 64,144, 84, 0, 85,122,111, 4,215,167, 96,167,103, 93, 82,252, 76,218, 58,252, 68,246,212,125, 61,229, 92, 22,168, 93, -206,235,122,200,242, 8,153, 42,208,181, 91, 44,158,237,105, 66,168,106,169,109,164,149, 40,145,208,251,106, 39, 93,113,250, 32, - 96,141,167,188, 71,177,105,173, 13,137,154, 56,156,105,237,200,110,219,237, 16,177,188, 66, 58, 16,221,194,249, 75,182, 71, 53, -105,162,219,133, 33, 21,105,165,117,168,217,213, 68,122, 72,209, 88, 48,198,204,242, 52,196, 44, 46,212,254,140,170, 32,147, 12, -221, 97,202,131, 22, 63,211,175,221,163,198, 90, 5, 16,222,197, 3,185, 70,189, 2, 91, 73, 86,164,198, 94,233, 91,164,224,165, -123, 18,167, 70, 52,149, 61, 20,130,108, 74,152,228,139,163,137,164, 88, 17,132, 86,187, 82, 60, 6,155, 45,164, 39,175,106,136, -233,240,234, 77,230,224, 32, 33,173,205,206, 65,219,250, 6, 52,251, 74,247,125, 38,155, 54, 12,121, 50,110, 47,120,205,132, 52, -191,122,113, 30,205,106,160,146,149, 40,117,232, 16,142,131, 82,110, 46, 60, 40,201, 25,129, 66,105, 74, 0, 43,123,117,177, 89, - 70, 86,201, 83,169,143, 2, 69,225, 54,232,235, 80,163,113,161, 70, 5, 42,112,245,167,178,219, 93, 53, 30,204,252, 60, 45,103, -218, 56,158,211,250, 77, 34,121,124, 22,145,197, 22,153, 89, 44,100,100, 23, 75,194,237,238, 45,168,137,151, 36, 67, 37, 70,174, -193, 83,165,176, 65,220, 63,101,186,157,104,225,156, 64,196, 57,212,168,100,240, 26, 3,179,250,105,196, 44, 81,147, 22, 21,170, - 33,121, 33, 48,209, 62,116,197, 44, 37,111,137, 40, 65, 67,105,161,246,122, 40,212,252, 0,118,106,183,226,220,249,117,187,221, - 93, 32,122,212,154,143,241, 10,167,138,212,105,112,135, 61,213, 27,125,189,162,196, 56,237, 42, 67,202, 30,202, 92, 89, 4, 80, - 10,212,236, 21,248,245, 48,200, 1, 14,118,117, 46, 57, 64, 10,236,205,107, 41,181,197, 31,119,199,109, 65, 12, 67,142,135, 86, -174,139,125,199, 84, 10,146, 13,123, 61,145,211, 82, 99,153, 24,122,233, 33,250,251,199,166,142, 91, 32,190, 19, 14, 60,128, 84, -251,242, 12,233, 68,116,216,220,148, 13,189, 61, 27, 72, 26,105,183, 2, 61, 78,234, 32, 83, 82, 73,137, 35,161, 5, 56, 37, 88, - 4,187, 80, 97,214,199,142,211,247,152,228, 30,170,241,208,235, 43,104, 14,189,192,157, 70,130,227,198, 49,233,201, 62,117,164, -137,139, 61,149,179, 56,252, 91,150, 35,101,130, 74,125,241,121, 55,186,146,123, 82,195,236, 70, 81, 29,190,150,129,213,132, 83, -152,228,111, 69, 23,137,165,228,252,184,210,125,240,152, 23,187,211, 54,207,110, 43,215, 38,227, 4, 39,166,245,178,202,215, 94, -222,192,227,244,213,132,147,135,187, 81, 57, 31,106, 83,145, 15,217,161,226, 41, 2, 12, 85,198,185, 70, 46, 52,164, 62,236,117, -183, 17,183, 19, 66,149, 60,232,108,186, 65,236,220, 74,200,212, 89, 39,241,120,211,138, 52, 32,225, 79,248,207, 74,240, 98,135, -137, 16,109,178,223, 74, 91, 6,173,189, 39,121, 85,105, 94,229,245, 63, 22,171,163,107, 99, 38, 65,153,255, 0, 10, 15,147, 64, - 13, 29, 21, 43,224,242,167, 90, 16,171,138,157, 91, 73,113, 66, 36,117, 41,116, 66,214,170,168,244,236,162, 19, 85,124, 90,139, - 60, 45,157,154,141, 71,150,232,146,128,246,211, 89, 25, 91,236,170, 67,110, 59, 57,231,221,155,224,194, 91,114, 66, 26, 66,208, -149,158,181, 74,138,128, 10, 36,210,157,218,128,253,181,174, 58,184, 39,203,230,169,204,184,120, 3, 28,169,121,156,194,249, 22, - 83,202,102,100,212, 51, 58,218,244, 81, 41,167,200, 64,125,180,109, 9, 52, 35,111,210, 13,128,142,253, 54,253,186, 34,142, 32, - 97,138,124,186,168,155,114, 92, 16,208,184,206,123,117,137,122,154,182,110, 82, 78,201,176,208, 22,151,138, 55, 55,111,101,207, - 13, 38,132,116, 74,220, 81,210,167,176,140, 52,224, 48, 95,105,168,119, 76,241, 67, 87,130,252,255, 0,162,148,166,114,117,229, -203, 85,218,211, 9,249,205, 93,239, 14,198,138,137, 1, 95, 66,197,173,134,203,142, 56, 85,184, 41, 38, 61, 84,164,247, 18, 70, -161, 91,237, 17, 61,204,123,128, 45,106,146, 58, 72,192, 15, 79,215, 86, 31, 16,230,166, 56, 37, 89,110, 48,228, 88,184, 46, 61, -100,181, 55, 2,211, 46,229, 30,193,112,188,180,252,182,252,111,187,131,142,184,136,173,167,168, 86,245,165, 41,241, 8, 34,160, -144,106, 13, 53, 69,189,108,255, 0, 28,237, 79,115,128,113,200,113, 63, 44,170,162,238, 71, 94,185, 28,226, 24, 6, 67,137,166, -181,215,144,178,172,134, 82,110, 87,117, 91,221, 93,192, 92, 34,197, 74,109,209,212,166,159,113,180,208,135, 22,133,184, 3, 73, -117, 53,162,189, 90, 77,182,215, 29,180, 90, 88,184, 20,196,156,122,106,124, 30, 28, 35,186,190,179, 77,123,182,124,109,217, 4, -168,177,165, 59,247, 53,147,220, 26, 82,210,191,101,196, 91,234,218, 91, 0, 80,109,124,184,178,175, 85, 53, 34, 77,189,179, 18, - 83,129, 3,180,230,106,218, 27,178,214,128,184,147,243, 85,167,107,150, 92,152,136, 67,126,197, 66,110, 76,116,163,199,219,254, -162,184, 80,212,162,170,170,167,194, 67, 74,233,233, 93, 53,144,110,205,224, 68,226, 70,106, 87,173, 72, 9,233, 62,193, 83, 13, -232, 35, 14,207,152,125, 20,230,182,242,100,233,247,203,140,169,115,139, 48, 30,187, 4,218,194,156, 10, 84,120,240,148,134, 98, - 32,247, 5, 45,229, 40,154, 15,154, 62, 74,179,182, 54, 54, 6, 53,170, 88, 26, 79, 89, 42, 79,179,219, 75, 23,154,138,174,127, - 71,233,164,120,114, 26,153, 6, 85,230,209, 40, 49, 13,153, 49,241,251,150,213, 4,181,247,108,181, 72, 15,165, 52, 80, 35,196, -136,209,104,237,235,212,245, 4,131,171,231, 66,232, 97,108, 47, 10, 11,181,143,214, 0,103,254,236,105,231, 95, 0, 1, 29,158, -191,209, 66, 99,185,213,210,254,213,149,171,147,226, 93,186,213, 54,231, 46, 68, 45,137, 75, 82,126,142,168, 73,108, 81, 33,180, -169,194,162,218, 69, 42, 18, 13,105,168,167,110,100, 78,112, 24, 23, 1,143, 71,233,224,189,102,163,178,255, 0, 81, 0,244,208, -147,115,168,247,135, 49,235,155, 76, 66,143,105,199,161,200, 75,112, 34,165, 11,118, 81,149, 85,185, 77,221,129, 68, 16,106,123, - 43,235,212,193,103,240, 80,201, 3,151, 92,142, 14,212,114,195, 46,218,119,227,199,116, 97, 68,177,124,238, 13,213,115, 99,176, -219,232,183,184,171,130,231, 49, 20, 37,137,211,152,182,130,143, 13,183,254,112,223, 32, 37, 64,164, 0,144,160,161, 85, 10,138, -201,246,167,147,168,145,134, 75,146,230, 9, 31, 44, 71, 69, 25,220, 88,218, 87,153,201,239,194,196,239,201,180, 57, 26, 37,238, -225, 58,202,101, 63, 17,177,224,218, 45,171, 66,252, 24,241,168, 70,193, 26, 38,212, 71, 64,249,181, 83,159, 61, 85, 17,134,211, - 27,230,140,188,234, 29,236, 14,101, 51,113,237, 57,250, 6, 66,144,237,223, 67, 73,111,162,147,239,183,230, 95,180, 54,234,100, - 36,183,102,184, 90, 46,119,103, 67,117,126,108,219,123,177,154, 68,116,146,163,236, 53, 66, 84,158,206,162,163,175, 71, 33,181, -124,108,115,193,239, 63, 80,104,224, 3,147, 30,223,170,163, 63,113, 15, 32, 84,127,150,223, 83,144, 70,201,221,240,211, 37,119, -204,130,210,245,165,162,208, 8, 68, 88,110, 23,149, 30,149, 52, 47, 60,182,135, 78,212,182,173, 89,109, 22,255, 0, 15,224,183, - 32,192,229,235,193, 1,245, 47,174,144,251,241, 35,143, 95,205, 70, 45,153,116,121,146,154, 23, 71, 11,115, 39,219,237,169,140, -219,125,166, 66,150,136,232, 80, 77,107, 86,155,121, 69, 62,178,163,167,188, 29, 1,197,188, 63,196,250,211, 26,104,222, 23, 52, -175, 77, 9,153,226, 22, 11,138,102,204,129, 17,180,218,109, 55,149, 53,225, 14,187, 30,148,250,119, 54, 64, 81,169,241,118,162, -135,182,135, 74,131,121,150, 41, 92,215, 59, 18,209,234, 68, 7,212, 9, 53, 8,161,113,119, 14, 20,132,254, 25,134,181,113,137, - 31,193,118,116,232, 19, 97, 57, 37, 78, 43,127,132, 27, 71,138,224, 34,189,119, 41, 8,233,233, 62,154,233,231,239, 18,187,188, -226,141, 63,165, 62,127,101, 48, 0, 10, 70, 84,209,201,120,209,171,140, 43, 21,193,150, 22,151, 97, 67, 98,124,196,238, 5, 79, - 72,191, 74, 91,168, 33, 21, 21, 46,161,154,159, 66, 40,174,253, 73,135,152, 5,179,196, 45,235, 61,154, 80, 99,233, 52,235,116, -198,213, 52,212,200,184,242,211,145, 92, 45,240, 94,134,195,150,184, 95,122, 46,123,173, 69, 87,141,247,211,236,190,252, 88, 41, -146, 22,149, 54,133,132,178,183, 41,219,184, 16, 65, 78,180, 28,167,206,247, 92,191, 47,142, 36, 46, 99,152, 86, 39, 98,194, 10, - 2,253, 63,230, 25, 3,212,133, 65, 74,121,215,140,108, 38, 16,208,186,135,127,136,195, 46,202,144, 44, 56, 2,109,246,152, 73, -101,113,200,148,136,104, 50,149,185, 73,134,130,226,156,101, 14, 5, 45,100,168, 20,132,154,158,218,122,117,149,220,249,128, 93, - 63, 81,105,110, 37,218, 87,138,144, 83, 1,128,197, 58,170, 20,172, 87, 2, 14, 11,245, 86,185, 6, 35, 10, 85,237,235, 52,106, -188,155,101,154, 66, 25,122,148,109, 49, 25, 41,152,247, 93,223, 57,107,115,182,157, 67,116, 29,186, 84, 59,187,228,135,196,118, - 1, 80, 15, 74,124,187,106, 41,143, 18,157,190,159,240,165, 21,113,212, 90, 53,121,153, 9, 46, 71, 99,107,142,173, 72, 9, 13, - 59,118,247,185, 12,181, 78,210,165, 54,201,233,221, 78,189,186, 18,239, 5,160,198, 79,125,195, 87,177,173,249,200,246,209,178, - 28, 17,112,202,153,217,111, 14,200,185,102, 18,238,214, 24,130, 60,104,240,230,221,152,157, 66,217,102,114,131, 33, 78, 36,131, - 81,238,245, 64, 52,239, 87, 77, 73,179,223, 62, 18, 22, 55, 81, 80,229, 94, 61, 94,220,125, 84,251, 37,108, 77,160,111,220, 79, - 50,219, 6, 59,235,142,191,124,200, 78, 48,167, 24, 82,106,239,133, 20, 38, 91,202,235,215,219,149,177,144, 63,132,233,193,204, - 2,103,150,175,186, 10,158,212,255, 0, 26, 33, 56,203,128,167,109,199,142,238, 81,249, 10, 91,229,128, 27, 86, 64,197,202, 42, - 84, 40,218,152,113,189,205,164,145, 80, 54,180,218,170, 79, 64, 59,117,158,219,183, 85,177,110,175,120,198,135,183,141, 34, 89, -218,224,230,142, 43, 78,219, 13,181,167,238, 55, 88,247, 72,169,102, 53,234,230,212,246,101, 42,158, 24,131,140, 51,115, 45,198, - 2,167,106, 86,252,230,130,136,236, 32, 10, 86,154, 63,136, 49,143,217,149, 33, 23,210, 26, 9,246,122,105,185, 30,177,128, 56, - 82, 20, 44, 2,211, 46, 77,211, 36,188,161,182, 31,114,195,127,178,218,163, 38,137, 76, 56,150,216, 46, 9, 10, 77, 77,106,164, - 68,113, 36,247,149,215,183, 78,217,111, 18, 91, 49,208, 52,169, 4, 41,237, 58,191,249, 15, 69, 57, 36,136, 16,113, 31, 77, 2, -229,138,200,151,114, 87,156,113,201, 33,120,140,153,209,160,168,237,138,212, 71, 93,101,150, 91, 74,107, 66, 73,118,164,159, 71, -193,168,247, 27,132,242,152,144, 99,226,247,143,251, 92, 79,213,233,166, 33,106, 55,163,235, 81, 79, 56,182,171,101,167, 12, 22, -203,116, 20, 34,232,239,222,104,158,242,254,185,105,142,150,165,175,165,123, 12,166,169,240, 80,119,106,182, 75,185,159,118,255, - 0, 17,202,192, 35, 65,192, 19,172,124,201, 65,200,230, 47, 95,213, 78, 28, 98,230,244, 8,176, 93,176, 74, 92, 59,165,166, 68, -152,145,231, 48,178,204,168,238, 93, 74, 82, 22,218,210,160,166,212, 86, 74,234, 13, 65,161, 7, 78,204,215, 40,123,186, 99, 61, -136, 75,189,134,144, 29,164,168,235,249,171,161, 92,153,231,242,205,146,218,178,116, 97, 60,119,116,196,115,107,174, 49, 5,238, - 41,202, 45,230, 36, 55,184,243,147,185, 78,234, 47, 28,207,119,111,221,212, 20,132,229, 15,248,214,155,127,135,213, 48,153,142, - 22,134,200, 40, 71, 67,186,230,214, 22, 76, 24,210,215,104, 86, 16,157,215,189, 93, 41,255, 0,113,192,127,164, 12,178,171, 95, -230, 77,112, 40, 16,240,234, 39, 23, 31, 78, 67,170,164,158, 71,243,179,103,157, 7,146,165,113, 87, 31,207,227,251,229,163, 44, -179,216, 56, 34,239, 11,221,163, 61,198,119, 30, 67,188, 53,155,114, 44,132,173,151, 10,222,251,235, 41,128,204,107, 97, 31, 87, - 1, 78, 50,173,181, 9,213, 76,188,253, 21,202, 24, 24, 88,247, 71,174, 51,135,115, 83,153, 36,171,214, 92,129,157, 12, 80,105, -185,183,118,141, 65,129, 8, 33, 58,148,171,189,163, 14,170,124,114,255, 0,155, 94, 27,185, 59,203, 56, 11,252,117,153, 96,248, - 37,213,236,175, 26,227, 85, 98, 86,235, 85,214,102, 31,199, 89, 83,143, 95, 50, 43,114,154,145, 54, 27,107, 23, 78, 65,177,219, -223, 97, 72,119,216,137, 50,226, 42, 86, 67,111,196,119, 56, 89,239,208, 73,108,198,190, 54,160, 12,210,133,204,105, 13,149,205, -196,140,228, 12,236,105,127, 28, 11,147,110,172, 46, 61,210, 1, 24,101,128, 42, 79,173,192,122, 22,171,222, 33,230,143,137, 49, - 11,126, 25,155,184,121, 70,126, 75, 3,129,120,211,129,239,248, 44,140,118,221, 27, 14,106, 46, 7,145,219, 47, 47, 93,205,192, -100, 46,191, 49,216,238, 66,150,171,124, 53,219,217,255, 0, 89, 40,121, 79,160, 54, 91,118,206,195,127,130, 29, 5,186,202, 70, -214, 22,160,210,141, 32,234, 7, 81, 37, 16,105, 26, 70, 56,174, 8, 91,110,228,214,244,146, 26, 1, 8, 19, 53, 37, 87, 30,172, - 7,109, 91,174, 58,243, 47,198,209,241,140, 67,204, 28,187,131,246, 73, 88,118,105,196,217, 38, 77,103,185,223,177,235,164,254, - 67,195, 56,219,152, 21,150, 68,177,216,109, 86,252,238,108,187, 93,234, 61,150, 98,100, 72, 84,235, 43, 72, 33,137, 1, 79, 53, -239, 40,118, 93,249,223,225,138, 38, 93,149, 86,190, 50, 91,221, 37,205,100,250,131, 90, 4,152, 56, 3,168,171, 64, 64,113, 10, - 53, 76, 23,204,106, 61, 81, 8, 60, 49, 1,234,128,106,205, 58, 71,167, 28,105,197,147,204, 23,151,140, 23,128,238,254, 94,177, -124,199,155, 77,146,205,112,185,114, 20, 62,121,184,226, 54,139,223, 33,196,204,114, 75,222, 63, 41, 86, 24,214, 41, 57, 74,224, -166,219, 29,171,100,135,146,243,119, 68,148,201,145, 33,105, 96,133, 41, 78, 80,221,111,144,238, 86,223,203,238,154,247,177,224, -227,160, 14, 45,238,232, 18,123,168,213, 7, 89, 58,156, 84,112,168,142,221, 34, 45,240,187,200,120,166, 60, 48, 69,203,211,153, -202,157, 94, 99, 60,248,113, 63, 33,115,207, 3,243, 37,181,206,108,198,223,226,126, 87,151, 38,203,198,240,240,251, 45,246,211, -156, 96, 35, 51, 70, 89, 50,229, 42, 81,203,109,141,217,231, 59, 1,213,199,118, 50, 99,203, 67,178, 24,105,192,242, 80,186, 71, -179,134,254,199,112,159,226,228, 50,177,145,144,237, 40, 59,192, 74,231,140,157,129, 37,195, 80, 66, 14,145,222,199, 0,221,206, - 57, 94, 37, 87, 0, 14, 72, 49,239, 19,211,129, 43,142,121,103, 65,102, 94, 98,184,251,153,113, 53,219, 50,123,183, 42,112,150, - 89,156,229,252, 96,130,190, 32,194, 45, 87,252, 63, 31, 99,203,239,223,126,224,229,162, 29,199, 41,180,201,181,153,176,175,145, - 82,235, 41,144,230,201, 81, 29,150,151, 20,185, 42, 13,214, 77,204,182, 19, 54, 64,232,222,199, 63, 71,184, 20, 0,194,253, 41, -251, 70,166, 14, 11,195, 82,187, 18,228, 13, 63,118,138,102, 59, 86,160,112,200,116, 42, 38, 35,135,183, 26,148,173,222,112,120, -174, 95, 32,158,108,203, 49,206, 76,198,242,204, 71, 25,243, 21,131, 68,194,241,155, 29,163, 32,179, 57,100,229, 44,211, 60,204, - 97, 92,228, 93,229, 94,237, 15,182,244, 88,217,202,217,154,210, 45,219, 93, 83, 41,125,181, 39,113, 97, 17, 29,205,214, 87, 91, -156, 87, 18, 54, 86,150,199, 35, 3, 67, 90, 90,124, 71,186, 77, 69,250,129, 81,171, 73, 26, 51, 4,175,121, 42, 67,119,136,100, -211, 33, 4, 20, 56, 4, 57,147,197, 71, 79, 69, 85,151,124,208, 99,215,110, 2,243, 27,132,202,123,144, 63,188,220,141,151,121, -142,188,217,175,115, 81, 13,118,200,246, 94,108,203, 56, 23, 51,135, 10, 76,143,189, 85, 45,181, 67,183,113,133,246, 52,198,218, -105,104, 15,201,103,105,113, 46, 72, 91, 50,238,249,166, 15,134,146, 29, 47, 47,148,201,167, 47,117,207,128,227,142, 72,199, 46, -126,243,115, 82,140,191,112, 97,141,205, 66,164,185, 61, 37,135, 30,221, 39,214, 58,210,119, 62,104, 56,139, 42,198,249, 39,148, - 57, 88,102,118,215, 39,230, 83, 48,222, 14,184, 99,114,236, 23,174,111,181,226, 92,235,142, 64,179,114,116,167, 44,110,222, 83, - 70,146,197,137,182,109,234,151, 37,166,212,237,210, 66,219,115,127,142,131, 97,117,184, 91,220, 67, 35,229, 46,110,167, 22,176, -141, 37,224, 72,208,217,157,165,120, 6,144, 20,162,189,199,166,158, 23,209,189,165,206,226,228, 25, 42, 17,222,193,114,195,219, - 77,206, 30,243, 99,199, 28, 35,200, 28, 53,145,223, 71, 42, 93,115, 30, 40,226,204, 95,133,238,124,119, 96,199,237,206,241,181, -254, 53,202,250,237,226,227,124,141, 61,251,252,121, 5,245,166,122,159,102, 2,173,161, 11,184,161,169, 38, 98, 16,173,173,195, -131,152,109, 44, 31, 12,242,234, 72,226, 32,181, 6,157, 33,225,218,151, 82,168, 24,134,233,247,194,234, 20,139,125,197,145, 22, -187, 21, 29,212,225,154,174,125, 28, 19, 62, 52,227,242,219,156, 66,186,240, 55, 51,221,178,188,171,238, 59,244,110, 72,243, 95, -153, 97, 60,131,151,223,237, 47,217, 45,139,230,124, 29, 56,246, 64,114, 11,115,185,165,162,245,117, 93,192, 71,140,205,188, 53, -110,150, 4,165,175,195, 68,181, 45,232,171,151,181,238, 81,220,219,147, 35,180,185,100,120, 46, 45, 64, 37,141, 8,115,124, 64, -226, 72, 64, 17,174,239, 42,106,197,180, 34,187, 99,218, 84,227,222, 32,146, 62,211,113, 81,168, 18,188, 48, 56,244,226, 43,156, - 13, 96, 8, 66,167, 60,167,158,240, 36, 98,246,169,172,171,198, 59,253,206, 27,147, 25,112,127,165,224, 62,133, 83, 92,176,238, -131,194, 14,255, 0,247,139,125,160, 85, 33,159, 0, 23,129, 63, 49,170,169,140,127,130,215,246, 47,241,148, 30,223,170,249,195, -235, 63,135, 91,203,143,252,230,103,251,191, 70,116, 82,123,195,178,145,185, 63,252,107, 51,234,255, 0,150,185,246,159,182,126, - 94,143, 86,174, 97,203,143,189, 69, 7,187,254,234, 78,198,191,144,220,126,205,245,147,126,175,237,191, 82,223,230,253, 85,211, -208,126,245,249,251,191, 79, 10,118, 79,123,209,244,211,106,103,242, 70,254,111,219, 79,217,254,163,177, 63, 89,255, 0, 71, 81, -229,253,236,127,238,207, 60,184,117,253, 20,244, 25, 59,176, 82, 29,143,249,172,238,207,228, 78,255, 0,161,243,127,234,253,127, -174,154,157,121,251,131,250,195,231,227,244,210,227,203,211, 77,107, 79,217,187,190,166,227,245, 31, 63,234,155,249,159,197,250, -171,167, 99,253,235, 51,247,199,211,236,164, 59,247,135,229,198,155, 48, 62,196,223,216,126,204, 62,163,253, 23, 63, 35,235,213, -164,249,113,247,143,209,236,163,155,222,227,157, 31,107,237,202,249,255, 0,203, 45, 93,159, 87,216,215,230,244,250,181, 16,253, -143,214, 63, 49,166,155,145,237, 52,157, 23,237, 13,125,151,234,110, 95, 59,253, 35,243,189,126,141, 57, 55, 28,248, 81,143, 78, - 98,144,239, 63,205, 44,223, 98,251, 60, 79,169,236,237, 79,215,250,255, 0, 86,167, 12,184,240,169, 17,123,174,206,140, 15,241, - 99,191, 85,246,120,191, 55,234,190,177, 31, 55,248,127,119,213,164, 93,126,232,231,145,250,114,162, 31,187, 29,180,246, 87,243, - 4,125, 87,243,155,207,111,213,253, 83,125,190,191,215, 77, 49,203,222,228,127,168,223,152,210,101,227,232,166,198, 47,219,103, -236,255, 0, 21, 47,183,255, 0,160, 29,159,171, 86,243,228, 59,105, 82,113,236,166,123,127,205,103,246,255, 0, 53,127,235,190, -119,206,111,242,248, 41,163,147,135,235, 31,154,164, 59,221, 29,148, 97,255, 0,230, 49,126,111,242,200,159, 85,243,254,115,191, - 87,249,118,233,177,149, 33,153, 30,223,170,156,127,255, 0,175, 53,217,246,187,159,206,249,255, 0, 90,126,127,241,105,153,242, -244, 81, 59,247,158,170,150,167,127,135,172,255, 0, 83,246,219,223,217,126,111,212, 53,249,255, 0,115,213, 93, 51, 15,238,153, -158, 85, 0,123,199,209, 80,235, 63, 62,205,217,246,251,135,111,206,253,142,223,226,244,122,180,236,153,122, 42,209,217, 59,176, - 83,238, 55,242, 43,127,212,253,130, 71,250, 95,110,127,231,255, 0, 31,167,215,168, 82,126,241,190,159,154,163,253,163,219,244, - 10,102, 98,191, 58,231,245, 31,109,255, 0,173,251,111,236,252,207,215,167, 47, 56,126,181, 73,184,200,118, 82,155,223,111, 87, -214,127, 36,119,230,124,254,200,255, 0,159,247,189, 90,141,105,251,191,247, 59,231, 52,163, 79,196,125,180,127, 49,255, 0, 11, - 90, 62,175,179,230,167,255, 0, 55,211,235,211,119,249,179, 44,248,250,114,168, 71,143,105,169, 48,127, 40,195, 62,207,245,151, -111,159,243,254,190, 55,111,241,254,247,171, 85,211,253,175,163,179,229,233,164, 59, 35,159,200, 83, 11, 35,250,155,175,242,174, -219, 79,213,125,127,106,254,179,248,180,184,242, 29,166,166,219,251,205,247,184,212,144, 62,211, 63,237,159, 99,188,253,159,183, -230, 53,249,191,232,237,213,109,247,254, 44,121,123,205,249,248,245,212,136,179, 25,211,157, 63,202,154,254,101,246,143,255, 0, - 93,243,213,217,255, 0,121,251,191, 30,170, 96,253,244,190,238,109,249,135,178,165, 51, 33,217,244,212,131,128,255, 0,242,185, -207,174,254,105, 27,253, 15,169,155,245,255, 0,197,255, 0, 74,186,141,185,254,253,249,228,207,156,229,213,211, 71, 46, 99,183, -232,162, 22, 63,229,206,125,167,249, 94, 79,252,183,231,125, 81,250,207, 95,167,213,183, 77, 93,123,255, 0,238,103,253, 84,196, -126,255, 0,163,232,164,184,223,225,119,126,103,217,174, 31, 85,255, 0,240,238,253, 71,240,254,239,199,167, 36,253,243,115,205, -191, 61, 31, 17,217, 73,248,103,219, 32,127, 49,255, 0, 4,229, 31,203,251, 62,107,189,159,197,251,254,173, 72,147, 39,229,239, - 12,254, 94,170,105,217,158,223,163,228,148, 70, 23,205,200,127,154,255, 0,138, 45,125,159,103,251, 60, 62,223,250, 30,173, 70, - 62,252,121,123,167,183, 51,242, 61,105, 77,125,150,246, 83,202, 87,248, 54,247,246,174,219,247,111,215,125,186,213,243,255, 0, -143,247,189, 90, 97,222,244,125,163,179,221,119,179,163,173, 40, 71,251,211, 73, 78,125,153,175,173,251,117,135,230,253, 95,217, - 39,125, 87,253,239,163, 82,225,200,252,186, 61,148,136,114,244,210, 13,175,252,123,140,124,239,153,106,251, 71,212,253,182, 63, -229,240, 83, 68,239,252,119,124,184, 83,199,220,119,111,209, 86, 23, 30,255, 0, 12,223,126,163,255, 0,155, 48,254,209,243, 63, -251,119,218,127,232,127,222,109,214,107,120,255, 0,200, 31,253, 47,203, 60,134, 93,125, 29, 75, 78,143,116,250, 62, 93,148,210, -198, 62,213,153,125,151,235,220,251, 95,243,111,170,153,243,127,233,122,246,105, 91,191,238,225,207,223,110, 89,102,223,103,233, -168,252, 41,111, 38,254,105, 47,237, 63, 84,143,177,253,135,249,108, 47,169,255, 0,234,191,238,233,169, 27,103,251, 56,123,222, -247,188,125,238,175,165,106, 4,156, 61,239, 77, 71,182,111,240,197,239,249,183,248,226,193,246,223,173,251, 51,159, 93,252, 94, -143,251,189, 91,223,126,253,159,186,253,203,189,222,209,151, 87,211, 73,245,231, 78, 6,126,193,106,249,221,182,127,155,246, 95, -180, 68,250,207,227,253,239, 86,168,167,204,255, 0,187,183, 39, 84,216,179,227,157, 28,137,254, 38,201, 62,103,248,118, 47,206, -250,207,179, 35,183,248, 63,237,125, 91,245, 60,126,225,189,167,231,249,233,161,147,187,106, 64,187,255, 0,132,255, 0,251,111, -248,204,252,255, 0,157,246, 57,191, 91,255, 0,212,255, 0, 13, 53, 75,117,255, 0,154,255, 0,254,184,255, 0,235,225,213,211, -215, 75, 62,224,165,123, 15,216, 37,125,103,248, 87, 39,251,103,205,236,253,175, 95,167,248,182,104,174,253,211,255, 0,216,220, -187, 91,242,236, 90,134,114, 30,159,166,136,103,191,227, 92,123,237, 63,205,109, 61,191,203,126,190, 79,205,254, 31,251, 63, 94, -150,207,114,111,212, 61,190,232,249,122,168,155,145,249,116, 82,133,179,237,153,175,206,255, 0, 11, 69,254, 97,246,158,214,254, -171,248,191,123,248,107,166, 31,238, 69,250,220, 50,255, 0, 10,100,102, 61, 52,203,189,124,245,118,125, 92,223,178,118,253,161, -175,153,252, 63,246,190,189,154,177,176,253,217,244,118,240,207,232,167,248, 83, 82,243,246, 72,255, 0,105,254, 75,200, 93,189, -159,108,157,243,191,139,254,211,248,107,164,217,254,246,111,215,111,253, 12,249, 10,124,230,222,193,243,210,107,159,107,185,125, -159,252, 21,107,250,206,207,181, 68,249,223,247,127,175, 83,143,187,254,255, 0,160,123,105, 28, 6,121,211,157, 95,111,111,235, -126,117,251,224,249,206,125,102,160, 31,223, 77,217, 31,204,126, 93,180,137, 63,116,223, 79,209, 90,226, 95,104,191,252,207,241, - 22, 63,243,254,175,176,252,207,225,255, 0,180,248,180,245,239,184, 51,247, 79,207,242, 79, 77, 71,251, 34,178,203,246,188,119, -235, 62,177, 31,106,237,251,106,190,119,175,247,254, 61, 51,115,155,187, 15,205, 65,156,123, 69, 89, 54,127,147,207,251, 55,255, - 0, 49,177,239,254,151,234,209,249,253, 30,186,235, 35, 7,239,162,207,255, 0, 29,221,153,183,229,217, 80, 63,205,219,255, 0, - 42,115,242,143,242,105,159,103,251, 62, 53,245,191,110,254, 97,114,255, 0,205,255, 0,181,255, 0,201,213, 23, 46,127,255, 0, - 69,222,246,114,246,123,144,252,135,166,172,174,125,200,255, 0, 85,191,252,234,166,228,191, 83,156,124,239,241, 52, 95,179,252, -207,173,147,243, 63,135,245,215, 93, 67, 98,253,204, 95,253, 67, 60,242, 25,253, 52, 67,222, 53, 31, 91,191,148,175,237,127,107, -143,245, 29,159, 49,254,223,227,253, 90,153, 31,188, 61, 57,211,111,247,253, 31, 85, 21,119,249, 12,111,175,249,145,123,126,171, -235,100,125,119,241,126,189, 78,147,247,199, 44,143,200, 81,125,186, 90,187,127,138,240, 95,157,252,191,254,183,179,181,127,155, -247,180,150,254,229,253,159,252,169,159,176,106,195, 88,126,205,131,253,127,248,214,231,246,207,183,126,215,213,255, 0, 23,253, -167,199,172,181,199,239,228,255, 0,235, 29,153,140,186,254,138, 99,236,191,179,232,164,216,255, 0,110,205,255, 0,153,255, 0, -138, 34,127, 60,250,142,203,159,111,253,199,253,159,240,237,213,126,233,144,253, 73, 61,220,253,214,229,215, 82,160,247, 89,151, - 14,206, 53, 17,217,255, 0,194, 19,190,179,237,255, 0,239, 31,177,125,145,239,159,252,127,246,159,195, 93,104, 63,254, 76,121, -126,237,223, 59, 50,234,255, 0,244,211,135, 51,218, 43, 31,251, 25,249,223,204,112,175,179,127, 55,250,169, 31, 55,215,233,254, - 61,154,155, 62,126,131,217,159,203,219, 81,190,215, 30, 63, 61, 59,115,127,254,106, 68,251,111,217,240, 31,171,250,143,170,111, -183,213,232,245,236,213,125,215,238, 31,151,186,236,251, 71,178,157, 62,233,244,210,143,255, 0,242,187,103,215,255, 0,136,243, -159,173,237,254,102,223,215,250,189, 31,197,166,174,127,124,127, 81,159, 33,242,202,162,203,239,143,213, 31, 53, 73,138,254, 80, -207,218,127,193, 50,127,211,254, 94,207,230,214, 96,254,232,127,253,147,217,239,143,109, 3,239, 14,195,255, 0, 72,175,255,217, -}; +255,216,255,224, 0, 16, 74, 70, 73, + 70, 0, 1, 1, 1, 0, 72, 0, 72, 0, 0,255,225, 0, 22, 69,120,105,102, 0, 0, 77, 77, 0, 42, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 0,255,219, 0, 67, 0, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 2, 2, 4, 3, 2, 2, 2, 2, 5, 4, 4, + 3, 4, 6, 5, 6, 6, 6, 5, 6, 6, 6, 7, 9, 8, 6, 7, 9, 7, 6, 6, 8, 11, 8, 9, 10, 10, 10, 10, 10, 6, 8, 11, + 12, 11, 10, 12, 9, 10, 10, 10,255,219, 0, 67, 1, 2, 2, 2, 2, 2, 2, 5, 3, 3, 5, 10, 7, 6, 7, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,255,192, 0, 17, 8, 1, 26, 1,245, 3, 1, 34, 0, 2, 17, 1, 3, 17, 1, +255,196, 0, 30, 0, 0, 1, 4, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 4, 6, 7, 2, 3, 8, 1, 9, 10, +255,196, 0, 86, 16, 0, 1, 3, 2, 5, 1, 5, 4, 6, 6, 5, 8, 7, 6, 7, 1, 1, 2, 3, 4, 5, 17, 0, 6, 7, 18, 33, + 49, 8, 19, 34, 65, 81, 20, 97,113,129, 9, 21, 35, 50,145,161, 22, 66, 82, 98,177,211,130,148,193,209,240, 23, 24, 36, 51, 85, +146,147,225, 67, 69, 83,114,162,178,241, 10, 52, 53, 99,115,131, 37, 68,100,116,132,163,210,194,255,196, 0, 28, 1, 0, 1, 5, + 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 2, 4, 5, 6, 7, 8,255,196, 0, 63, 17, 0, 1, 3, 2, 4, + 3, 5, 6, 5, 4, 1, 4, 1, 5, 0, 0, 1, 2, 3, 17, 0, 4, 5, 18, 33, 49, 6, 65, 81, 19, 34, 97,113,145, 20,129,161, +177,193,240, 7, 22, 50,209,225, 21, 35, 66,241, 82, 51, 67, 98,114,162, 37,130,146,178,194,255,218, 0, 12, 3, 1, 0, 2, 17, + 3, 17, 0, 63, 0,251,249,133,133,142,108,237, 57, 79,237,181, 43, 82, 28,115, 72,106,197,156,189,220, 32, 66, 76, 7,154, 66, +130,172, 55,247,155,249, 42,221,123,117, 22,182, 50,177,140, 77,120, 77,167,108,150, 22,241,144, 50,182, 51, 43, 94,113, 35, 79, +226,181,112,124, 49, 24,181,223, 96,167,219,100, 65, 57,156, 86, 84,242,210, 96,235,175,206,186, 34,174,170,144,165,201, 85, 21, + 13, 42, 88, 97,102, 42, 95, 36, 32,185, 99,180, 42,220,218,246,189,188,177,201,249, 7,183, 22,169,105,126,162,203,200, 61,169, +232,202, 66, 61,160,129, 50, 60, 36,161,113, 1, 60, 89, 40, 0, 58,213,186, 40, 93, 95, 28, 85, 25,255, 0, 94,251, 94,105,157, + 96,229,236,221,171, 51, 25,156,145,119, 34,181, 49,151, 86,215,166,240,144,118,147,232,124,190, 88,102,246, 84,237, 87,218, 94, + 4,106,149, 90, 12,250,211, 13, 93, 81, 37, 77, 67,109,155, 30,187, 84, 64, 36, 30, 61, 69,241,228,152,207, 29, 95, 98, 87,136, + 70, 18,203,232,185,100,153,111, 40, 82, 84, 12, 72,113, 32,200,142, 71,151,153,145,235,184, 39, 1,216, 97,150, 75, 94, 46,245, +186,237,158, 2, 28,206, 82,164,157, 96,182,162, 0, 51,204,115,242, 16,126,135,101,236,199, 66,205,116,120,249,131, 45, 85,152, +157, 10, 82, 2,216,147, 25,192,164, 45, 39,204, 17,130, 24,249,229,167, 90,137,218, 19,177,110, 98,105,156,197,151, 37,183, 72, +150,245,228, 82,230, 27,177, 34,221, 75,107, 23, 9, 93,188,199, 94, 46, 15, 24,237, 28,159,218, 11, 33,231,125, 30,153,173, 20, + 23, 94,122, 5, 58,156,252,169,241, 16,145,223,178,166, 91, 46, 56,209, 4,129,190,195,142,108,110, 57,177,190, 61, 7,133,248, +177,142, 32, 38,217,214,203, 55, 73,253, 77,168, 16,124,196,193, 35,226, 61, 9,243,206, 41,225, 27,142, 29, 2,233,167, 3,214, +170,253, 46,164,130, 60,149, 18, 1,248, 30, 92,192,158, 97, 98,159,236,109,219,107, 67,123,117,105,171,218,165,161, 85, 26,131, +144,162,205, 49, 39,197,170, 64, 84,119,227, 62, 16,149,148, 40, 92,165, 92, 45, 60,164,169, 60,245,227, 19, 61,108,214,141, 57, +236,243,166, 21,109, 99,213,170,233,166,101,234, 35, 41,118,167, 56, 71,113,238,233, 42, 90, 80, 14,198,193, 82,188, 74, 72,224, +121,252,113,219, 46,218,229,187,159,103, 82, 8, 92,198, 88,214,122, 71, 90,225,219,188,181,118,219,218, 80,176, 91,137,205, 58, + 71, 89,233, 82,220, 44, 67,116, 43, 93,116,195,180,150,151, 83, 53,147, 71,115, 25,171,101,234,186, 92, 85, 62,113,142,227, 37, +192,135, 20,218,188, 14, 37, 42, 77,148,133, 14, 64,189,189, 49, 50,192,150,133,180,178,133,136, 35, 66, 14,224,142, 70,140,219, +141,186,216, 90, 12,164,137, 4,106, 8, 60,197, 44, 44, 44, 44, 70,167, 75, 11, 11, 20,142,134,118,251,236,253,218, 51, 95,243, +175,103, 61, 46,155, 84,149, 91,200, 46,169,156,193, 38, 77, 60,179, 25, 47,161,245,178,182,155, 82,142,229,148,173, 10,185,218, + 18, 69,172, 77,240,102,237,223,117, 10, 90, 18, 72, 72,146,121, 1, 49,175,190,128,237,203, 12,184,134,214,160, 20,179, 9, 28, +201, 2,116,247, 85,221,133,133,133,128,209,233, 97, 96, 46,126,207, 57, 87, 76, 50, 69, 99, 82, 51,213, 93,186,125, 22,131, 75, +126,161, 86,156,234, 73, 75, 17,217,109, 78, 56,178, 18, 9, 54, 74, 73,176, 4,155,112, 13,241,243,173, 95, 79, 78,183,234,149, + 66,117,119,178,119,209,187,156,179,174, 80,167, 73, 83,106,174,185, 37,244,185, 35,109,137, 27, 35,198,121, 13,174,220,237, 11, +113, 67,112,184, 29, 14,141,134, 19,127,137, 37, 74, 97, 50, 19,185, 36, 36, 9,216, 74,136, 19,225, 89,120,134, 51,135, 97,106, + 74,110, 23, 10, 84,192, 1, 74, 36, 13,204, 36, 19, 30, 53,244,187, 11, 28,193,244,122,125, 40,154, 57,244,129, 83,234,148, 90, + 30, 92,159,149,115,133, 2,198,187,148,170,238, 5,184,210, 9,219,222,180,224, 3,189,108, 47,192, 73, 74, 86,149, 11, 41, 2, +233, 42,233,252, 86,187,180,185,177,124,178,250, 74, 84, 55, 6,173, 89,222,218,226, 22,233,126,221, 97, 72, 59, 17,247,167,145, +214,150, 22, 22, 40, 14,217, 95, 72, 78,143,246, 54,204,217, 31, 78,243, 51, 14, 86, 51, 78,125,204, 81, 41,212,154, 12, 41, 41, + 67,140,199,122, 66, 89, 92,215,137, 7, 99, 72, 42,176,224,151, 20, 54,167,128,165, 33,173,237,159,187,116, 52,202,115, 40,242, + 30, 26,154,149,213,213,189,147, 37,215,212, 18,145,204,248,232, 61, 77, 95,248, 88,228,190,222,159, 73,158,109,236, 95,168,121, +119, 36,101,126,199,249,207, 81,152,174,208,221,168, 59, 83,203, 72, 89,110, 34,146,239,118, 25, 94,214,151,226, 35,197,212,113, +138, 50, 71,211,249,169, 16,226,187, 54,111,209,131,170,113,216,142,209,114, 68,135,251,196, 54,210, 0,185, 90,148,168,192, 37, + 32,117, 36,219, 26,150,188, 59,140, 94, 48,151,153,108, 20,171,110,242, 7,134,197, 64,214, 77,223, 19, 96,182, 47,169,151,220, + 33, 73,223,186,179,241, 9, 34,190,147,225, 99,152,254,141, 79,164, 82,111,210, 41,148,243, 62,123,133,160,245, 28,161, 71,160, + 85, 26,129, 14,124,234,171,114, 83, 81,120,183,189,208,141,136, 77,187,187,160, 30,191,124, 99,167, 49,155,121,103,113, 97,114, +166, 31, 16,180,238, 36, 24,231,202, 69,106, 89, 94,219, 98, 54,169,185,183, 86,100, 43, 99, 4, 79, 46, 96, 26, 88, 88, 88, 88, +173, 86,169, 97, 97, 97, 97, 82,165,133,133,133,133, 74,150, 22, 22, 22, 21, 42, 88, 88, 88, 88, 84,169, 97, 97, 97, 97, 82,165, +133,133,133,133, 74,150, 22, 22, 22, 21, 42, 88, 88, 88, 88, 84,169, 97, 97, 97,149, 79, 48,208,104,138, 66,107, 21,168,113, 11, +151, 45,137, 82, 82,222,224, 58,219,113, 23,194, 0,147,165, 42,123,133,129,145,115,118, 85,157,152, 36,101, 40, 89,154,158,245, + 86, 44,116, 63, 42,152,212,214,213, 33,150,149,247, 92, 83, 96,238, 74, 85,228,162, 44,124,176, 79, 10, 8,222,148,205, 44, 44, + 13,204,153,175, 43,228,248, 40,170,102,236,199, 79,165,198,114, 66, 24,110, 69, 70, 98, 24,109, 78,172,217, 13,133, 44,128, 84, +163,192, 79, 83,130, 88, 80, 98,105, 82,194,195, 9,185,143, 47, 83, 37,166,159, 81,175, 66,143, 33, 64, 20, 48,252,164, 33,106, +191, 2,192,155,158,111,135,248, 80,105, 82,194,194,195, 53,214,232,205, 86, 27,203,174, 85,163, 10,131,209, 87, 37,168, 42,125, + 61,242,217, 66,146,149,184, 16, 78,226,132,169,104, 5, 64, 88, 21,164, 30,163, 11, 90, 84,243, 11, 26,165, 74,141, 6, 58,229, +205,144,134,154,109, 59,156,113,213, 4,165, 32,117, 36,158,152,219,133, 74,150, 22, 22, 22, 21, 42, 88, 88,136,234, 14,175,101, + 92,131, 72,147, 85,168, 84, 26,109,136,107, 40,157, 80,145,185, 17, 33, 88, 93, 74,121,219,109, 72, 72, 23, 35,175, 78,151,199, + 29,235, 55,210,169, 75, 85,106, 70, 72,208, 44,133,152,179,165, 84, 47,185, 98,187, 38,115,212,202,127,120, 78,213, 56,219, 44, +148,186,227, 73, 55, 35,113, 4,132,253,238, 65, 39, 98,217,251,146, 67, 98, 98,160,183, 16,216,239, 26,239, 44, 44,112,195,191, + 73, 3, 52,218, 36, 74, 87,232,124,234,244,198, 33,182, 38, 85,217,206,143,180,195,238,236, 27,214,223,114,132,238, 69,250, 43, +128,122,243,123,226,252,236,107,218,150,155,218,106,129, 90,145, 14,159, 46, 59,180, 89,141, 52,234, 36, 45, 46,160, 5,162,246, + 75,201, 0, 57,101, 37,105,228, 5, 13,188,222,247,193,158,195,239, 45,218,237, 22,152, 30, 98,160,139,134,150,172,169, 58,213, +215,133,133,133,138, 84,106,211, 34, 75, 17, 24, 92,137, 79,161,182,219, 73, 82,220, 90,128, 74, 64,228,146, 79, 0, 99,148, 59, + 80,246,248, 13,187, 35, 78,116, 14, 79,125, 33, 69, 76,203,204, 13,167,112, 4,241,182, 56,231,113,253,254,159,179,251, 88,159, +246,238,201, 90,211,158,244,246,159, 67,210,128,227,177, 23, 45, 98,187, 10, 59,193, 14, 62,139, 39,187,228,145,116, 2, 21,185, + 62,165, 62,152,142,118, 87,236, 67, 78,200,161,156,235,168,204,162, 85, 86,193, 76,180, 69,209, 31,220,155,245, 62,255, 0,195, +223,231,252, 66,247, 20,226,216,153,194, 48,212, 22, 90,128, 86,249,232,121, 35,169,229,161,153,255, 0,136,212,250, 15, 14, 49, +194,184, 70, 22, 49,140, 77, 97,231,100,132, 48, 15, 49,205,206,131,158,162, 35,254, 71, 65,201,218, 81,151,198,120,214,122, 69, + 3, 54,173,199, 76,218,176, 76,255, 0,105, 81, 43, 90,174, 74,130,137,230,228,139, 31,142, 56,255, 0,233,156,237,117,218, 45, +222,217,121,159, 65,105,217,194,179,150, 50,158, 72,121,152, 20, 74, 13, 46, 99,145, 90,117, 29,203,107,246,165,132, 20,247,138, +112,171,112, 81,224, 39,104, 22,177, 39,189,123, 89,233, 78, 99,208, 13,119,123, 49, 80,210,235, 16,170, 19,149, 82,161,206, 66, + 60, 40, 89, 86,245, 54, 15, 75,161, 71,167,236,145,235,129,218,219, 69,250, 63, 59,117,166, 6,100,237,127,164,213, 24, 89,186, +159, 13, 17,149,152,242,243,171,109, 82, 91, 79, 68,168,182,160, 84, 46, 77,130,146,173,183, 32, 30,113,159,248, 49,197, 60, 57, +248,119,142, 94,217, 99,201,202,230, 99, 10, 80, 27,105, 26,157, 58,145, 36, 72, 84,138,189,248,221,194, 92, 75,248,145,128, 89, + 94,240,250,179, 55,148, 18,132,147,227, 34, 4,158,128,192, 48, 81,173, 81,255, 0, 66,103,104,125, 96,237, 59,166, 26,159,217, +167, 93,243, 29, 71, 50,229,218, 22, 94, 77, 87, 47,214, 42,239,169,247,105, 50, 70,240, 26, 75,203,186,182,171,110,240,146,120, + 8, 93,184, 81,199, 64,246, 85,207, 85, 42, 61, 3, 80,242, 87,126,179, 10,167,145, 42, 78,150,175,225, 14,183, 29, 96, 42,222, + 92, 40,252,108, 7,144,192, 24, 57,143,179,135,103,125, 40,168,104, 95, 99, 45, 51,122,131, 75,171,171,255, 0,198,235, 83,148, + 76,169,201,181,138, 73, 42, 82,136, 35,195,117, 30, 19,112, 0,185, 56,180,251, 17,246,120,172,231, 60,169,153,243, 28,227,236, +109, 86,168, 82,169,116,231,221,104,157,161,214,212,130,237,184,184,185, 22, 23,231, 97,245, 24, 39, 16,113, 46, 17,198, 95,139, +214,151,152, 18, 97,182,181, 90,192,128, 83, 16,102, 61,250,237, 42,210,135,195,124, 47,140,240, 79,224,221,221,150, 62,185,113, +221, 16,130,100,133, 78,145, 58,244,208,234, 2,117,138,224, 15,161,235,177, 63,104,254,215,250, 57,152,153,200,253,175,115, 30, +156,101, 90, 93,117, 65,186,126, 88,113, 72,114, 84,229, 50,217, 83,174,148, 56,217, 41, 74, 3, 96, 2, 77,252, 86,219,205,219, +103,238,214, 93,170,180,243, 78,187, 69,253, 26, 93,165,245, 73,252,244,214, 95,162, 58,105, 25,130,107,138,117,246, 93,141, 50, + 49, 35,188, 85,214, 91,113,181, 95,106,201, 40, 80, 0, 30, 78, 58,103, 66,254,133,175,164, 15,177,221, 30,162,158,202,157,188, +226,209, 36, 85,221,181, 86, 35,148, 43, 69,125, 41, 22, 67,129, 43, 46,237,112, 93, 67,117,175, 98, 57,227, 7,116,243,232, 18, +204, 81,244,167, 83,164,106,158,189, 26,246,166,106, 76, 18,196,172,219, 58, 26,221, 68, 93,242, 27,144,242,182,169,123,220, 91, +139, 64,220,178,160,120, 28, 14, 65,250,133,236,115, 7, 93,243,143,188,250, 22,217, 82, 74, 18, 16, 66,146, 66,129, 42, 39, 40, + 58,106, 78,164,158,156,171,229, 54, 56,127, 27, 70, 28,211, 12,176,182,221, 9, 88,113, 69,192, 82,164,148,144, 18, 6,114, 53, +210, 52, 1, 61,121,215, 5, 39,183, 54,182,229,206,207, 90, 39,216,227, 35,231,236,203,149,114,154,233, 11,168,102,137,185, 45, + 10, 53, 90,129,122,165, 48, 22,219,218,164,149, 37, 13,160,109, 64, 32, 21,168,149, 95,106,109, 54,166,118,172,213,110,203, 90, +205,148,117, 27,177,126,122,215,234,245, 37, 50, 66, 51,158, 92,212,202, 59,207, 70,148,214,228,220, 32, 2,164,157,200, 43,231, +106, 84,130,148,144, 77,200, 29,131, 94,250, 3,107, 3, 69,180,221,122,125,174,168,203,218,171,166,173,186,212, 28,219, 22,158, +174,226,123, 38, 91,210, 90, 74,218,222, 74, 20,218,158, 85,148, 9,184, 82,129, 4, 16, 5,131,160,125,130,254,145,182, 53,242, +133,171,157,166,123,114,170,167, 78,160,180, 90, 25,115, 45, 82,219,141, 22,123, 68,130, 80,250, 10, 18,133, 2, 82,155,157,133, +118, 72,218,164,245, 17,127, 30,192, 75,106, 83, 89, 72,254,230,100,171, 48,206, 73, 48, 99, 33,153,220, 18,161,150,167,111,195, +188, 68, 29, 66, 93,206, 21,253,188,171, 78, 83,144, 36, 38, 68,151, 19, 25,117, 4, 4,144,174,186,215, 55,233, 94,170,125, 32, +159, 72,135,109,157,102,236,177, 72,237,139, 91,202, 25, 18,129,153,106, 4,154, 92, 22, 27,154,196, 68, 78,117,166, 34,178,234, + 18,135, 16, 54,240,165, 21,155,132, 11,222,248,139,228, 14,210,157,170, 62,138,190,219, 58,165,217,235, 52,107,165,103, 82,168, + 20, 44,131, 46,175, 5,140,203, 49,215,146,167,211, 13, 18, 99, 47,106,214,162,217, 10, 86,197,236, 80, 10, 77,207, 22, 22,238, +158,199, 31, 70,206,101,236,179,219, 63, 86, 59, 77,206,212,136,149,104, 90,145, 85,149, 50, 61, 49,138,114,153, 84, 16,244,199, + 36, 4, 21, 21,168, 46,193,123,110, 0,185, 23,247, 96, 22,175,253, 18,163, 88,190,144,170,215,107,172,227,158, 98, 76,202,217, +143, 43,174,139, 86,202,102, 10,210,234,153, 92, 1, 17,100, 60, 23,199, 23, 80,240,220,113,233,140,177,141, 97, 30,210,235, 10, + 9,246,126,200, 64, 8, 2, 86, 2,103, 92,160,206,226, 73,138,214, 56, 22, 53,236,172,190,130,175,105, 14,153, 37,100,195,100, +170, 52,204, 70, 88,202, 96, 9,174, 79,236, 51,217,199,183,247,210,107,144,170, 61,174, 51,127,210, 21,156,178,180,201,117,103, +219,161, 64,162, 74,113, 49,153, 91, 74,181,212,211,110,161, 13,160, 43,194, 27, 74,111,180, 92,158,109,142,110,209, 30,211,253, +160, 59, 20,213, 59, 77,234, 34,179, 11, 47,234, 91,149,198,168, 51,171,236,180,219,136,106,164,244,249, 66, 76,196,141,187, 15, + 45, 58, 83,225, 9,220,180,155,113,108,119, 14,157,125, 15,223, 72, 87,101, 41,117,124,129,216,239,183,218,168, 57, 22,175, 53, +111, 46, 36,202, 86,249, 44, 5,120, 74,146, 44,164, 7,118,128, 55,160,162,251, 71, 75, 12, 57,208, 15,253,159,152,121, 39, 46, +234,118,159,235, 62,179,171, 49,210,117, 6,158,210, 35, 78, 98, 7,117, 54, 4,166,158, 83,205, 74, 42, 90,214, 22,176,162, 47, +192, 4, 21, 15,214, 56,211,254,183,131, 32,189,218,188,133,178,162,140,136, 74, 8, 33, 33, 96,144,123,160,108, 54, 36,204,114, +172,163,128,227,142, 37,142,197,149,161,228, 5,231,113, 78, 2, 10,138, 8, 10, 29,226,119, 59,128, 34,121,242,225, 76,179,170, +245,186,254,134,171, 82,229,118,132,237, 58,254,175, 63, 29,115, 32, 79,167,199,144,237, 33,111,110, 42,109,189,225,221,229, 4, + 88, 21,143, 82,118,216, 88,217,154,167,244,176,253, 35,245,253, 57,209, 26, 6, 88,212,122,158, 82,205,181,119,166,209, 43,170, +149, 70,101,191,173,100, 34, 76,118,227,202, 90, 94,100,216,148, 60,144,173,160, 2, 66,143,184,116,133, 27,232,173,250, 74,180, +127, 76,147,160,249, 83,233, 19,129, 69,211,170,122,193,102,107, 84,175,103,157, 17,158,243,126,196,190, 78,246,211,127, 32,232, + 22, 54,232,109,139, 63,181,135,209, 31,168,189,164, 51,134,139,103,151,245,253, 15, 78,210,230,154, 77, 82, 93, 94,150, 28,147, + 90, 90, 36,180,241,117, 74,109, 72, 74, 20,123,187,125,211,212,122, 97, 59,141, 96, 10,186, 73,119, 34,211, 43, 32,193, 48, 50, +156,162, 11, 96, 65, 36,119,117,130, 1,158,116,153,192,120,137, 54,139, 12,246,141,175, 42, 1, 18,148,230, 57,129, 81, 4, 56, +162, 72, 0,247,160,102, 4,136,229, 87,119,209,249,217,103, 83, 59, 53,104,213, 87, 41,107, 54,185,213,117, 22,167,153,107, 46, + 85,234, 21, 74,233, 82,148,133,189, 29,134,150,202, 66,214,179,221, 2,201, 80, 23, 3,198,120, 24,183, 50, 62,149,233,166,147, +229, 86,114,182, 72,202,148,218, 37, 26,158,202,132,120, 80,163, 33,136,241,155,185, 81,218,148,128, 18, 57, 36,252, 79,174, 36, + 20,246, 23, 26, 11, 49,215,109,205,182, 18,109,235,143,159,223, 78, 7,109,188,209,149,242,221, 51,176, 7,103, 21, 57, 63, 81, +117, 68, 34, 37, 73,170,122,238,236, 10,107,202,238,251,171,143,184,185, 7,114, 46,126,235, 73,113, 71,110,228, 43, 28, 21,163, + 23,152,230, 35,217,206,171, 50,163,176, 0,110,162, 4, 0, 0,159,149,122, 37,235,246, 92, 63,134,118,185,116, 64,132,141,212, + 73,217, 32,153, 36,168,199, 94,188,170,148,250, 40,163,183,175, 95, 75,174,184,118,166,211, 8,221,214, 75, 76,154,148,104,146, +227, 39,107, 83, 12,169,168, 83, 42,244, 61,226, 35, 45,226, 58,130,164, 95,168,191,215, 76,115,207,209,191,216,187, 43,246, 40, +236,229, 72,211, 42, 82, 16,245, 73, 72,246,170,253, 73, 40,177,155, 57,196,142,245,207, 80,145, 96,132,143, 36, 33, 62,119, 39, +161, 20,118,221, 74,232, 48, 76,126,253,172, 67, 17, 43,103,244, 36, 4, 39,169, 74, 68, 2,124,247,161,240,230, 28,246, 27,133, +165, 15,127,212, 81, 43, 84,108, 20,163, 36, 15, 45,170,154,237,207,219, 83, 75,123, 8,232, 60,253,101,212,121, 29,252,130, 76, +108,187, 66,105,203, 61, 86,156, 82, 74, 25, 71, 93,169,224,169,107, 34,200, 74, 73,228,237, 73,248,183,173,186,119,218,114,169, +218, 83, 67, 59, 98,246,176,171, 56, 51, 62,177,106, 27,115, 35, 80,150,201, 64,165, 64,141, 46,157,236,205, 37, 37, 68,182,157, +146,108,150,143,137, 9, 74,119, 18,181, 44, 11, 23, 83,117,175,181,190,191,246,229,103,181, 55,105,223,163,151, 88, 51, 46, 94, +203, 11, 82,114, 6,159, 55,150, 42, 17,226,211, 0, 88, 45,184,246,248,171, 14,185,225, 11, 93,146, 55,184, 19,127, 2, 18,222, + 7,253, 37, 29,186, 53, 79,180, 6,175,104, 54,101,205, 29,134,243,214,158,191,145,243, 44,137, 84,170, 78, 97,142,250, 94,204, + 46, 46, 77, 57,101,152,193,113,155, 37,105, 49,208,147,180, 47,153, 9,227,155, 30,235, 1,194,223,194,221, 67, 77,165, 42, 82, +210,174,209,121,144, 99,184,114,161, 34,103,120, 42, 32,106, 99,144,175, 62,226, 44, 90,223, 23,101,199,157, 82,146,150,212,144, +218, 50,172, 79,125, 57,156, 81,136,213, 50, 18,146,116, 19,166, 99, 95,114,104,236,184,138, 92,112, 92, 41,179, 73,184,183,187, + 28, 51,244,237,246,163,205,217, 7, 68,104, 93,142,244, 82,107,235,207,250,207, 83, 77, 34, 35, 80,213,103, 90,167,169,105, 67, +199,129,113,222, 41, 73,106,255, 0,178, 92,244,199, 94,104, 22,166,213,117, 91, 67,178,246,168,230,220,139, 63, 40, 74,170, 82, + 91,151, 58,131, 90,186, 31,166,155, 93, 77,187,185, 40, 32,139,115,116,143,134, 62,117,246, 23, 47,253, 36,223, 75,142,127,237, +209, 92,139,237, 25, 35, 74, 83,245, 46, 68, 75,151, 40, 91,254, 38,218,113, 60,218,251, 67,175,155,116, 83,168,199, 33,128,218, +161,139,167,111, 46, 4,162,220,102, 35,145, 92,194, 19,167, 85,124, 1,174,215,136,174,214,253,163, 86, 86,198, 23,114,114,131, +177, 8,137, 90,181,232,157, 58,201,174,244,236, 91,217,155, 44,118, 63,236,211,148,187, 62,101,134,208, 69, 10,152,145, 81,148, +132,128,101,205, 88,222,251,198,221,119, 44,170,222,235, 15, 44, 90,248,199,104, 9,232, 46,122,156,101,140, 7,222,118,225,229, + 58,225,149, 40,146, 79,137,222,186, 59,118, 26,181, 97, 44,180, 33, 41, 0, 1,208, 13, 5, 44, 44, 44, 44, 10,141, 75, 11, 11, + 11, 10,149, 44, 44, 44, 44, 42, 84,176,176,176,176,169, 82,194,194,194,194,165, 75, 11, 11, 11, 10,149, 44, 44, 44, 44, 42, 84, +176,176,176,176,169, 82,194,194,194,194,165, 75, 31, 60, 62,153,205, 43,175,234, 54,185,233, 99,173,229,138,172,138, 51, 25,107, + 50, 51, 81,170, 65,200,210, 43,205,196,113,216,201, 75, 1, 81,217,183,141, 78,109, 8, 89, 35,187, 81, 14,243,221,216,253, 15, +194,197,220, 62,245, 88,125,208,121, 34, 72, 4,122,130, 60,122,244,161,186,216,117, 25,107,227,238, 78,161,246,247,211,124,150, +154,230,157,105, 14,118,203, 85,100,233,246, 85,165,230, 85, 64,166, 72, 93, 65,154, 75, 50,102, 37,213,176, 75, 74, 90, 95, 40, + 76,103, 20,132, 37, 78, 50,151, 84, 45,225, 54,155,105,189, 79,233, 3,212,234,149, 95, 38, 86,245,227, 87, 97,209,105, 25, 18, +191, 84,161, 86,160, 80,166, 65,122,116,152,229, 14, 68,142,227,179, 34, 33,201, 4,173,110, 32,168, 37, 11,112, 35,106,109,183, + 31, 83, 49, 92,246,132,237, 31,148,251, 55,210,233, 85,220,237, 69,168,200,131, 84,122,107, 9,147, 5, 9, 88,105,230, 41,242, +103, 37,181, 2, 65, 42,117, 49, 92,109,176,144,110,226,146,158, 55, 99,100, 99,139,185, 89, 74, 88, 73, 81,219,159, 47, 16,118, +141, 53,245,170,222,204, 16, 39, 49,138,249,181,157,243, 23,107,157,104,166,209, 97,107,212, 93, 95,151, 91,110,169,145,165, 80, +168,145,242,180,132, 81, 29,138, 25,142,185,243, 36,236, 99,111,180, 9, 61,230,226,178,146,149, 18, 0, 32, 16,150,249,131, 87, +254,149, 90, 51, 89,138,169, 84,205, 90,155, 19, 54, 20,212,145, 91,203,209,242,172,249, 17, 89,218,230,232,239, 66, 90, 98,251, + 51, 13,141,168, 66, 84,135, 23,222, 5,145, 97,186,231,181,167,253, 41,154, 25, 79,162, 73,204,174,100,252,204,228, 6, 41,162, + 75, 15, 51, 9, 11, 92,151, 67, 84,119, 93,138,134,194,247,151,155, 77,101,157,232, 34,233, 49,228,126,199, 47,164,125, 37,186, + 51, 79,174, 55, 77,169,229,122,243, 81, 38, 87, 91,167, 82, 42,168,105,167, 24,168, 55,245,156,234,123,210,219, 41, 89, 61,203, + 38,158,243,235, 85,174, 25, 82, 87,110,160, 91, 23,151, 97, 34,108,196,116,211,195, 65,167,188,141,231, 89,210,135,217,183, 63, +245, 53,170,175, 47,246, 90,215, 23,117,139, 62,102, 71,115, 60,124,223, 92,129,167,121,126,101, 50,177,169, 25, 14, 45, 65,233, +243,138,234,239,123, 44,103,143,114,212, 82,218,251,164, 29,169, 86,208,182,138,135,132,110,211,167,154,193,174, 57, 27, 87,178, + 46, 99, 21,173, 97,171,105,227, 77, 67, 78,164, 57,153,114,157, 69,247,216,173, 57, 76,171, 7, 88, 67, 62,204, 31, 45, 9, 34, + 14,224,202, 20,195,110,119, 65, 36,110, 80, 55, 70,102,237,115,156, 43, 20, 93, 25,206,218, 61,167, 47, 84,161,234,101,106, 91, + 95, 82,205,121,150,100,189, 17, 52,185,210,153,117, 14,169,192,219,119, 49,218,116,146, 85,118,201, 0, 21, 16, 49, 86, 80,126, +151, 26, 15,214,153,137,117,205, 60,154,180,166,168,180,208,233, 14,191, 30, 27,177, 89,139, 74,167, 63, 57,151,158,117,222,237, +233, 9,151, 48,180,218, 27,251,224,131,192, 27,141, 68, 27,251,148,168, 41,160,173, 34, 59,160,136,238,158, 90, 25, 4,142, 67, +198, 34,136,123, 36, 17, 10,143,185,160,153, 63, 48,118,183,205, 57, 26,110,124,173,102,221, 70,137, 83,203,217,111, 38,205,163, +192, 12,188,202, 37,203,147, 88,154,220,240,251, 37,191,244,130, 35, 54,200, 91,106,184, 66, 84, 9, 2,233, 86, 33,170,205, 26, +234,156,213, 70,207,213,106, 94,168,212, 51,132,141, 59,157, 76,212, 9,242, 96,213,226,199,203,211, 94,204, 52,110,248, 69, 83, + 17,148,123,148, 52,211,138, 40,134, 10,150,202, 66,247, 39,113,115, 23,243,127, 73,246, 75, 94, 95,107, 61, 59,162, 89,169,188, +185, 81,159, 87,166,229,250,138,223,136, 30,169, 79,130,231,119,220, 8,253,238,246,131,170,186, 80,183, 54,217, 73, 33, 65, 34, +202, 32, 43,159, 73,205,107, 74,181, 23, 58,228,125,100,210, 7,163,207,163, 84,212,186,125, 18, 29, 94, 24,113,136, 45, 82,233, +178, 93, 73,121,110,132, 74,146,227,147,174,211, 77,129,116,146,146, 65, 69,212, 70,205,238,117, 69,184,235, 18, 6,130, 18, 71, +184,234,118,131,191, 67, 19,217,192,239,253,239, 84, 70,102,166,235,182,102,202, 89,151, 52,231,181,106, 13,114,106,180,203, 55, + 81, 50,154,228,101, 58,129,102,166,166,167,165,232,172, 73, 98, 67, 43,112,133, 50,181, 45, 41,148,119, 56, 24, 72, 81, 89, 73, + 6,192,207,153,195,181,187,136,117,140,171,153,245, 81,140,218,245,110,166,206,160,196,250,162, 66,105,212,168, 70,174,218, 32, + 46,156,181,178, 88,220, 88, 40,216,166, 20,230,246,187,229, 59,114,146, 69,251, 77,237,219, 69,174,233,229,103, 83,168, 90, 55, +153, 94,164,195,205,127,163, 52, 7,156,145, 13,179, 94,170, 42,168, 41,173,178,202, 59,226,182,144,167,148,146, 86,242, 91,218, +157,220,120,121,143,203,250, 74,104,176, 42,249,159, 44,202,236,247,155,149, 84,201, 49, 91,115, 53,198,143, 50,158,166,225, 60, +236,199,225,176,194, 86,169, 9, 47, 41,215, 90,108,161, 72, 78,221,175,130,178,141,170, 2, 62,209,118,225,255, 0,160, 14, 82, +121,167,195, 72,233,168,255, 0,238,143, 42,124,168, 3,245,111,231,247,252, 85,129,217, 86, 54,123,163, 61,168,217, 55, 56,214, +107,245, 8, 84, 45, 69,122, 38, 88,155,152,223,113,231,221,167,170,155, 79,124, 89,231, 6,231,144, 31,122, 72, 11,185,182,210, +155,248, 56,156,106,142,102,153,149,242,139,243, 41,144,102, 74,146,226,210,219, 81,233,205,119,146, 22,146,110,225,109, 36,139, +168, 54, 22,161,115,107,129,240,192, 29, 16,214,249,154,181, 83,205, 89,102,189,167,211, 50,221,107, 39, 86, 24,167, 86, 41,242, +167, 51, 37, 61,227,176,216,152,218,155,113,146, 82,164,150,164, 55,126,132, 27,143, 43,225,167,105, 44,224,238, 74,163,194,170, + 37,110,198, 68,132,189, 25,117, 36,169, 65, 17,183, 22,143, 36,112,146,160,146, 2,141,172, 46, 47,226,231, 1,228,173,203,152, + 80,130, 99,228, 53,211,174,245,109, 36, 37, 18, 40, 94,157,101,183, 53,119, 50,205,204,153,190,140,152,244, 74, 12,199,233,180, + 60,178,250, 2,210,215,131,107,175,188, 46, 82,227,174, 37,106, 23,241, 0,218,200, 4,151, 28, 56,152, 53,148,180,219, 72,178, +218,160,100,172,131, 73,128, 36, 14,226, 52, 10,124, 6,218,246,149,145, 96,131, 96, 46, 58, 94,255, 0,158, 57,247, 74,117,173, +188,173, 68,159,154,115, 21, 98,180,213, 62,189, 48,191, 66,167,210,139, 73, 91,236, 37, 59, 12,151, 84,232, 42, 72,112,164, 20, +237,183, 30,166,248,213,159,123, 65, 26,237, 30, 67, 57, 8,212,104,245, 95,102, 90, 97,213,234,213,133, 73,241,145,109,182, 80, + 33, 27,134,228, 93, 36,125,242,126,240, 73, 5, 54,151, 38, 66, 71,119,225,231, 80,237, 27,220,239, 84, 79,104, 61, 18,236,203, + 74,213,106,139,116,156,169, 54,161, 37,183, 1,169, 53, 26,168, 26,167, 53, 51,146,234, 88,100, 54,124, 1, 70,220,109,228, 31, + 92, 93,127, 71, 86,163,228,220,173,154,166,232, 94, 89,202,113, 41, 12, 84, 24,114,164,203, 81, 22,226,128,117, 1, 41, 55,222, + 77,138,146, 20, 64, 22, 79,217, 40,128, 9, 81, 52, 29, 55, 78,245,143, 48,102,103,178,133, 23, 74,170,166,165, 21,206,238,115, + 47, 35,113, 97, 99,168,251, 61,215,231,205, 69, 34,222,124,227,174,251, 16,118, 92,173,232,204, 41,249,239, 81,152, 72,204,117, + 66, 91, 75, 94, 19,236,204, 3,211,194, 72, 23,176, 22,185,176, 72,185, 37, 74,198,197,249,183, 69,143,102,165, 73,129, 26,235, + 61,106,163, 33,106,123, 48, 17, 93, 9,133,133,133,142,102,180,107, 29,164,240,163,113,140,177, 65,255, 0,157, 46,162,255, 0, +177,168,191,213,221,254,110, 49, 87,106, 77, 69,255, 0, 99,209,191,171, 59,252,220,116, 95,149,241, 94,131,214,176,127, 49,225, +189, 79,165, 91,218,141,166,121, 47, 85,178,219,185, 83, 61, 80,218,155, 17,209,192, 88,241, 54,175,218, 66,135, 41, 87,188, 27, +227,154,115,111,209,127, 76,126,114,158,201,154,140,252,104,234, 55, 75, 51, 98, 7, 74,125,219,130,147,253,184,155,158,212,186, +141,215,234,122, 55,245,119,191,155,133,254,116,218,141,254,197,163,127, 87,123,249,184,194,197,255, 0, 12, 45,177,229, 5, 95, + 91,161,100,115,146, 12,116,148,144, 99,194,107,123, 7,252, 76,189,192, 18, 83, 97,112,180, 3,184,128, 83, 61, 97, 64,137,241, +138,142,233,191,209,179,147,242,237, 69,186,150,119,204, 46, 85,187,165, 5, 6, 54,119,109,170,222,169, 4,147,240, 38,216,233, + 26, 14, 94,164,229,154, 91,116,138, 52, 36, 49, 29,164, 4,161, 13,166,195,143,134, 41, 17,218,155, 81,143,253, 77, 70,254,172, +239,243,112,191,206,147, 81,127,216,180,111,234,206,255, 0, 55, 7,194,191, 14,134, 6,209,110,197,132, 54, 14,240,117, 62,100, +201, 62,243, 85,241,111,196, 23,113,215,131,151,239,173,194, 54,145,160,242, 2, 0,247, 10,191,176,177, 64,255, 0,157, 38,163, +255, 0,177,168,223,213,157,254,110, 23,249,210,234, 48,235, 71,163,127, 86,123,249,184,214,252,175,138,244, 79,173,100,254,100, +195, 58,159, 74,191,176,177, 64, 30,212,218,143,254,199,163,127, 86,119,249,184, 95,231, 77,168,255, 0,236,106, 55,245,103,127, +155,135,252,173,139,116, 30,180,191, 50, 97,157, 79,165, 95,248, 88,160,127,206,155, 81,191,216,212,111,234,206,255, 0, 55, 30, + 30,212,218,138, 63,234,106, 55,245,119,191,155,133,249, 91, 22,232, 61,105,126,100,195, 58,159, 74,243,181,166,153,246,161,205, + 90,145,148, 42, 26, 9,168, 83,169,153,126,172,177, 73,212, 22, 89,170, 22, 85, 2, 10, 36,181, 48, 78,136, 47,116,200, 90, 25, +126, 9, 82, 46,171, 79,109,118,179, 23, 28,231, 63, 71,126,149, 26,173, 87, 57, 49, 83,212,156,222,203,179,107,177,144,217,166, + 84,162, 51, 18, 92, 37,230, 40, 78,151,160, 63,245,137,114, 33,102,150,137, 45,169,179, 18, 63,120,149,169, 39,190, 88, 10, 87, + 70,142,212,186,140,121, 52,106, 47,245,103,127,155,140,219,237, 57,168,142, 29,198,135, 69,248,251, 51,191,205,198,157,190, 25, +142, 90,182, 16,150,219, 49, 27,193, 59,206,191, 1,228, 4,107,173,100, 92,221,224,215,110,169,106,113,193, 51,177, 32,106, 35, + 65,234,124,201,153, 6, 42,140,215, 77, 16,237,165, 83,204, 26,143,167,249, 10, 30,120,173,229,170,142, 82,136,214, 89,168,230, + 12,230,192, 67, 82,216,114,158,164, 51, 25, 38,106,203,225,125,212,133, 56,236,166, 88,116, 18,226, 75,178, 16,234, 82,141,218, +193,145,190,146, 89,185,219, 63,175, 78,231,230,148, 59, 54,153,153,197, 22,160,214,105,134,213, 41,232,142,209,220,110,141, 18, + 12,114,234, 92,139, 61,169,229,133,174, 67,141,182,159, 11,135,190, 90, 86, 18,155,217,142,209,218,130,242,173,245, 37, 24,159, +116,103,127,153,130,112,117,159, 84, 39,145,221,101,234, 79,196,199,119,249,152,129, 99, 22,183, 72,206,134,244, 17,175,144, 19, +190,253,209,239,215,122,151,255, 0, 75,125, 71, 35,142,234,103, 79, 50, 96,105,183,120,248,198,147, 21, 12,236,247, 76,237, 91, +163, 25, 83, 84, 25,205,116,140,193,157,125,134, 67, 51, 52,226,159, 92,204,145,222,151, 82, 38,143, 17, 79, 70,246,151, 92,251, + 36, 26,143,181, 32, 23,138,118,142, 83,224,217,127,153,153, 59,178,239,211, 93,146,123, 88,214,251,101, 74,236,177, 72,174,231, +154,203,207,173,114,243, 5,118,151, 33,168,101,219, 38,204, 33, 51,211,176, 37,161,220,167,146, 18,221,210, 58,227,235,228, 13, + 65,213, 87,166, 33,153, 84, 74, 75,109,171,239, 45, 44, 56,109,255, 0,246, 96,219,217,174,190,202, 44,166, 32, 21, 91,254,193, + 86,255, 0,207,138,172, 98,215, 56, 82,156,254,219, 74, 46,128, 12,201,208, 8, 35, 69, 13,247, 87, 83, 86, 46,112, 43,108, 96, + 53,253,215, 81,217, 18, 83, 5, 35, 82,102,117, 73,253, 59, 39,160,174, 1,200, 90,245,255, 0,180, 41, 93,205, 48, 50,254,111, +236,235,145, 40,148,169, 78, 22,101, 85,210,168, 43,246, 20,169, 36, 7,182,162,160,226,149,180,144,162, 3,106, 60, 31, 10,186, + 98,101,244, 60,228,127,164,243, 34,230,172,244,158,221,153,158,187, 54,147, 42, 67,102,142,198,100,175, 34,162,248,146, 22,178, +235,140, 45, 43, 95,117, 28,167,104, 8, 4, 34,246,216,145,101, 19,212,245,237, 85,212, 74, 94,247, 34, 81,233, 14,161, 28,220, +197,114,255, 0,147,152,143, 47,180,158,127, 96,146, 40,116,116,159,255, 0,108,239,243, 49,119, 45,246, 33,102,182,153,183,101, + 33,113, 37, 32,130, 32,206,132,147, 30, 62, 21, 85, 44, 89,225,247,173,186,245,203,234, 82, 38, 2,136, 32,200,141, 64, 2, 64, +220,120,213,175, 63, 48,100,216,181,132,208,230, 76,130, 42, 14, 39,120,134,228,134,210,241, 71,237, 4, 41, 64,148,222,226,226, +253, 14, 56,123,233,118,236,171,173,125,163,117,231,179,182,109,209, 13, 61, 21, 90,126, 72,205,146,165,230,169, 2,161, 26, 48, +134,194,229, 83, 22,133, 89,247, 16, 93,186, 99,188,108,216, 81,240,244,241, 11,205,187, 71,178,199,104,186,116, 54,179,174, 86, +166, 23,169,235, 38, 60,184,141,173,183,144, 15, 91, 44,172,216, 94,198,222,239,198,131,172, 84,117,235,179, 60,230,231,105,150, +165, 84,157,136, 21,117,209,171,143,170,100, 55,147,251, 5, 46, 18, 82, 15,170, 10, 78, 49,187, 59,206, 28,189, 67,198, 51, 65, +137, 4,164,200, 41, 58,131,208,252,171,169,102,194,203,139,172, 23,110,149,145,170,102, 32, 30,234,130,134,224,238, 71,206,187, + 59,183,140,126,208, 50,187, 21,102,204,165,217,135, 40,174,173,157,107,116,129, 75,165,199, 68,148, 51,236,232,127,236,221,123, +114,184,240,182, 86, 71,190,216,140,253, 17,253,143, 43, 29,139, 59, 21,229,253, 49,207, 20,150, 98,102,170,140,135,234,185,173, +182,150, 23,182, 83,170,176,111,120,251,219, 27, 75,105,248,131,136, 62,134,253, 36,211,115,212,117,101,201,240,163,210,115, 37, +129, 85, 38,168,226,158,143, 32,139,220,198,123,114, 72, 38,227,236,220,189,172, 2, 72, 23, 38,204,167,246,182,207, 53, 56,254, +213, 10,145, 71, 32, 40,165,105, 84,103,130,144,160,108, 82, 71,123,193, 24, 38, 30,221,253,254, 28,171, 6, 2, 64,204, 22,100, +194,140, 8, 30, 5, 35,195,158,245, 75, 21,179, 99, 9,197,147,125,118, 21,152, 39, 32,210, 82, 36,201, 62, 10, 61,122,109, 93, + 16,163,199, 30, 88,247, 28,248,123, 84,234, 56,233, 70,162,255, 0, 87,123,249,184,201, 61,170,117, 29, 95,245, 45, 23,250,187, +223,205,196,255, 0, 42, 98,253, 19,235, 85,255, 0, 51,225,115,185,244,174,129,194,197, 4,142,212, 90,140,175,189, 70,163,127, + 87,123,249,184, 59,150, 53,159, 85, 51, 27,110,212,220,129, 64,129, 76,138,146,169,181, 89,205,186,220,118, 18, 57, 36,168,187, +107,129,229,128,191,195,184,133,179,101,110,148,128, 57,149, 81,152,199,172,110, 92, 13,180, 20, 73,228, 5, 92, 24, 88,229,236, +247,244,181,246, 40,201, 21,165,101,101,234,115,217,146,160,209, 41,123,244, 86,150,185, 45, 21,143, 32,160, 74,127,241, 28, 54, +163,253, 35,244,237, 70,157, 14, 30,147,233,157,113,182, 30,144, 16,236,188,195, 25, 40, 64, 4, 19,225, 75,110, 19,208, 18,110, + 69,135, 54, 61, 49,146,213,179,175, 56, 16,145,169, 48, 43,117,230,222, 97,146,235,137, 33, 32, 77,117, 86, 22, 40, 85,118,158, +212, 52,159,254, 15, 71,255, 0,128,247,243,113,137,237, 69,168,160,243, 71,163, 31,255, 0,142,247,243,113,181,249, 91, 21,232, + 61,107,156, 60, 77,133,142,103,210,175,204, 44, 80,137,237, 67,168,157, 62,167,163,255, 0, 86,119,249,184,244,118,158,212, 77, +215,250,154,143,207,255, 0,167,119,249,184, 95,149,241, 94,131,214,155,243, 70, 21,212,250, 85,245,133,138, 31,252,231,117, 15, +206,145, 71,254,174,239,243,112,143,105,205, 65,255, 0, 99,209,255, 0,171,187,252,220, 47,202,248,175, 68,250,210,252,209,133, +117, 62,149,124, 97, 98,136, 79,105,173, 67, 87, 31, 83,209,255, 0,171,187,252,204,101,254,114,250,128,122,209,168,255, 0,213, +221,254,110, 27,242,198, 43,208,122,211,254,103,194,250,159, 74,189,112,177, 70,167,180,182,160, 30,180,138, 71,245,119,127,153, +143, 71,105, 60,252,127,234,138, 71,252, 7,127,153,134,252,179,138,116, 30,180,191, 51,225,125, 79,165, 94, 56, 88,163,207,105, + 60,248, 79, 52,138, 79,252, 7,127,153,140,135,105, 12,247,229, 74,164,255, 0, 87,119,249,152,111,203, 88,167, 65,235, 75,243, + 62, 23,212,250, 85,221,133,138, 77, 61,163,115,201,235, 73,164,127, 87,119,249,152,244,118,140,207,127,236,186, 81,255, 0,236, + 59,252,204, 55,229,188, 79,160,245,167,252,205,133,245, 62,149,117,225, 98,148,255, 0, 56,140,243,254,202,165,127,192,119,249, +152,247,252,226, 51,209,233, 76,165,255, 0,192,119,249,152, 95,151, 49, 62,131,214,151,230,108, 47,169,244,171,171, 17,109, 83, +209,237, 63,214,138, 45, 63, 47,234, 61, 5, 53, 24,148,202,236, 58,188, 70, 86,226,146, 19, 42, 43,161,214, 86,108, 70,225,184, +114,147,112,160, 72, 55, 7, 16, 17,218, 35, 60,249,210,169, 95,240, 29,254,102, 16,237, 13,158, 15,253, 85, 75,255, 0,128,239, +243, 48,147,195,248,162, 20, 20,152, 4,120,210, 60, 73,133,168, 65, 39,210,138, 83,251, 27,118,116,166,203,165, 75,143,167,140, + 19, 70,205, 21, 76,193, 1,183, 94, 90,219, 68,234,130, 28, 68,149, 20, 19,181, 72, 41,116,132,160,141,168,218,141,160,109, 22, +102,223, 97,206,205, 13,229,170, 30, 83,255, 0, 39,225,112,178,238, 79,168,229,154, 90, 92,154,234,148,221, 58,114, 82,153, 40, + 82,138,174,165, 40, 39,133,155,169, 59,214, 65, 27,141,245, 39,180, 14,120, 39,197, 76,165,127,192,115,249,152,216,141,125,206, +134,231,234,202,103,201,151, 63,153,130,255, 0, 74,199, 7,249,255, 0,242,243,253,207,169,164, 49,252, 36,245,244,173,245,238, +198,250, 49, 93,137, 72,134,149,230, 74,114,114,243,145,151, 65, 93, 27, 54, 77,134,186,111,115, 1, 84,244, 6, 20,203,169, 45, + 36,199, 82,144,164,164,128,189,196,170,228,155,140,166,118, 0,236,207,151, 22, 38,100,188,183, 88,203,243, 27,112, 22,106,121, +127, 52,207,133, 49, 9,246, 56,241, 22,142,253,151,146,225, 75,141, 69, 96,172, 40,157,238, 54, 28, 55, 88,223,130, 9,215,124, +228,174,180,218,105,255, 0,236,185,252,204,108, 78,184,103, 5, 11,154,101, 55,228,203,159,255, 0,188, 55,244,220,109, 2, 2, +255, 0,249, 83,140,115, 11, 87, 95, 74,209, 43,176,231,102,233,217, 38, 46,158, 78,201,114, 95,164, 67,159, 85,153, 30, 51,245, +153, 43, 82, 95,168,247,134, 75,157,225,115,188, 42, 37,197, 20,168,170,232, 54, 41, 32,128,112,214, 63, 96,253, 6,135, 83,147, +152,225,203,206,108, 86,166,200,113,217,185,134, 62,160,213, 91,168,200, 14, 49, 29,135, 91, 92,148,200, 14,169,181, 34, 36,127, + 1, 85,146, 89, 65, 64, 78,209, 98,200,214,220,220,179,111,171,169,223,240,156,255, 0,253,225,253, 23, 84,115,109, 86, 90, 24, + 52,248, 1, 37, 86, 81, 75, 78,112, 63,223,192,151,103,140, 50,146,162,228, 13,127,203,222,125,106,195, 56,157,133,195,129, 8, + 4,147,225, 66,145,216,183, 64,209,149,166,228,145, 67,170,125, 85, 57,233, 50, 28,136, 51, 20,192, 17, 37,234,128,168,153, 40, + 80,119,114, 31, 68,148,133,161,208,119,162,214, 6,215, 4, 93, 75,176,198,138, 66,201,121,190,137,147,242,234, 77, 79, 55,208, + 62,174,170, 84, 51, 21, 74,108,225, 49,105,147, 34, 90, 30,144,175,104, 67,203,115,191,146,226,203,137,113, 43, 30, 16,149, 0, +132,129,105, 43, 49, 76, 66, 65, 91,109,127,186,127,191, 26,142,105,158, 77,144,195, 71,228,175,239,198, 72,190,186, 79,253,195, +188,239,207,173,109, 11, 34,173,146, 42, 11,217, 75,179,125, 99,179,221, 47, 51, 74,205,121,245,236,197, 91,205,149,241, 84,170, + 77,113,201, 43, 75,101, 17, 88,140,219,105, 92,167,223,121,118,109,132,146,165,184,121, 81, 9, 8, 72, 74, 69,161, 83,165,211, +234,241, 21, 2,169, 1,169, 12,175,239, 52,242, 2,129,252,112,201,154,204,229,183,222, 56,134,135,193, 39,251,241,173, 89,146, + 66, 20, 91, 45,183,127,129,254,252, 9,219,149,188,225,113,103, 83, 78,155,101, 1,148, 87, 63,107,183,100,141, 65,123, 54, 26, +222,143,174, 52,138,108,148, 11,210,165, 4,255, 0,160,168,117, 13,169, 78, 32,119,100,248,130,121, 32,147,110, 44, 0,157, 47, +236, 85,168,149,156,216,196,237, 98, 44, 71,166, 68,112, 58,152,177, 84,143,180, 80,232, 60, 46, 44,223,247,137, 27,121,176,189, +136,233,161, 94,152,161,184,182,221,173,208,164,255, 0,126, 49, 70, 97,154,226,251,180,180,215, 62,227,253,248,180, 49, 27,132, +181,147,227,206,134,108,137, 84,209, 56,112,161,211,227,162, 36, 24,200,105,164, 32, 37, 8, 66,108, 0, 2,192,126, 0, 99,126, + 6,138,180,159, 52, 34,255, 0, 3,253,248, 70,170,248,253, 84, 19,240, 63,223,138, 57,197, 19,179, 85, 18,194,192,179, 85,152, + 15,133, 45,254, 7,251,240,176,179,166,151,100,186,229,193, 7,142,152, 94,195,234, 48,103,216,147,255, 0,103,143,125,132, 14, +141,254, 88,245,223,105,175, 46,246,111, 10, 11,245,120, 62, 88, 95, 87, 15, 76, 27,246, 31,220,199,134, 8,243, 70, 23,180,210, +246,111, 10, 10,105,224, 11, 91, 9, 48, 61,216, 48, 96, 36,155,219,242,199,158,194,144,122, 97,253,162,151,179, 80,159, 96,190, + 49, 84, 18, 60,176,100,195, 4, 90,216,243,216, 69,174, 83,132, 46, 41,123, 53, 6, 48,136,232, 48,132, 37, 19,131, 63, 87,164, +244, 24,201, 52,212,158,191,195, 15,237, 49, 77,236,212, 29, 48, 21,110, 70, 23,213,202,193,191,171,147,123,243,143, 21, 79,183, + 79,225,134, 23, 52,189,154,131, 38,159,206, 55,179, 0, 94,214,193, 3, 79, 35, 15, 40,244,119, 38, 77, 67, 40, 70,235,158,152, +139,151, 65, 40, 42, 39,106,146, 45,138,148, 0, 20, 67, 38,100,211, 61,196,190,227,126, 27,244,182, 44,120,148, 40,241,217, 67, +105,104, 11, 14,160, 99, 26, 21, 25,186,116, 70,218, 74, 64, 32,114, 6, 10,112, 58,156,121,174, 43,139, 59,118,241,131,160,174, +247, 13,195, 91,181,104, 72,212,211, 99, 28,180,158, 7, 76, 15,156,226,133,236,112,254,107,202,228, 36,241,129, 50,214,162, 72, +190, 50,217, 10,113, 82,107, 96,169, 45,167,106, 99, 37,194, 82,164,132,131,127, 92, 66,115,101, 17, 74,120,184,204,123,115,206, +212,226,106,234, 73, 87, 56,208,235, 40, 88, 33,104, 6,253,110, 49,210, 97,247,107,178,115, 48,212, 86, 21,253,170, 47, 81,148, +232,106,173,118, 17, 4,164,167,228,113, 15,212,220,143, 7, 48, 81, 76, 39, 91, 64, 82, 46, 88, 36,115,111, 49,253,223, 28, 91, + 85,220,182,180, 41, 82, 88, 71, 23,228, 12, 71,235, 25, 90, 29,106, 10,233,245, 56,157,227, 46, 14, 69,200, 32,249, 16, 71, 32, +143, 81,142,154,245, 22,216,221,129, 68,137,220, 30,135,239, 74,193,195,174, 46,240, 28, 68, 58,153,142,126, 34,184, 51, 84,114, +204,204,165, 93, 53, 24,140, 45,151, 25,115,123, 74, 71, 80,160,110, 8, 62, 88,188, 52,119, 84,127, 72,218,161,231, 69,200, 40, + 21, 7, 5, 50,186,201,251,162, 70,223,178,118,222, 68,144, 19,127, 59,251,177, 36,213,221, 16,132,237, 57, 94,211,117,139,217, +137, 75, 3,199,232,133,250, 43,208,244, 87,184,240,106,141, 56,202,210,232,245,154,158,155,173, 74,104, 85,153, 42,167,174,223, +114, 75,126, 54,200,249,140,113, 12,173,252, 38,249, 57,196, 41, 7,212,115,143, 2, 43,212,111, 31,180,226, 76, 29, 80, 65,144, +124,199,159,136,222,186,115,217,174,110, 6, 55, 53, 13, 74,253, 92, 51,200, 53,230,179,158, 83,131,152,155, 72, 75,143,178, 4, +150,129,255, 0, 84,242,124, 46, 32,251,210,176,161,242,193,214,227, 16, 45,108,122,168,184, 75,136, 10, 73,144,107,194, 92,182, + 83,110,148, 40, 65, 26, 26,125,144, 50,172, 92,195,152,218,135, 82, 37, 49, 26, 66,159,152,161,228,210, 19,185, 95,141,128,249, +227,231,239,111,190,213, 58,147,218,227, 90,157,208, 93, 62,174, 61, 7, 36, 81,164,152,233,166,211,157, 45,176,250,146,108,165, +184, 19,247,192, 60, 11,241,197,241,218,221,167,117,113, 61,155,123, 35,230,189, 74, 66,131,117, 90,218, 5, 27, 47,243,101, 23, + 28, 7,122,199,184, 14,127,161,142, 15,236,167,165,115, 32,211, 14,111,168, 71, 87,180, 79, 81, 86,245, 39,144, 15,191, 30,127, +196, 55,234,114,240,235,162, 52, 3,150,109,201,247,109, 94,179,192,248,107, 54,214, 70,229,105,239, 43,229,252,212,251, 64,251, + 54,100,156,152,152,172, 53, 69,109,231,200, 78,247, 86,144, 74,143,153,231, 29, 67,166,116,136,238, 64, 85, 74, 60, 52, 34, 58, + 20, 90,133,181,187, 93, 35,239, 44,122,220,254, 67,223,138,251, 38,210,102,213, 43,144,178,205, 46,153, 34, 82, 28,121,180,213, +220,142,146, 19, 26, 61,193, 88, 83,157, 16,165, 38,224, 11,238,230,224, 98,249,106,156,212,118, 83, 30, 51, 41,109,180, 36, 37, + 13,161, 54, 9, 3,160, 3,211, 15,195, 22,110, 45,227,118,247, 47,211, 61,122,251,170,175, 27, 99, 1,214,197,163, 71,125,252, + 7, 79,125, 14, 84, 75,240, 83,140, 12, 37, 95,129,130,222,200, 73,231, 25, 8, 32,249, 99,186,237,226,188,180,177, 38,132, 8, +106,244,252,177,154, 97, 19,250,159,150, 11, 38, 9,243, 24,244,194,255, 0, 22,195, 23,230,155,217,207, 74, 20,152, 74,253,156, +102, 33,171,211, 4,196, 51,211, 25, 8,132,117, 24,137,126,144, 98,134, 38, 33, 30, 88,247,217, 13,250, 96,159,178,171,254, 88, +240, 70, 87,248, 56,143,109, 79,216, 26, 26,152,182,234,156,101,236,195,201, 56, 37,236,167, 8, 69,244,195,118,212,187, 3, 67, +189,152,121, 12, 33, 27,158,152, 36, 34, 31, 76, 47,101, 32,116,194,237,105,187, 10, 96,136,214,235,141,169,140, 15, 4, 97,226, + 35,144,108, 19,141,137,142,171,223,167,199, 16, 46,212,131, 2,153, 38, 39, 31,119,242,198, 73,137,232,140, 62, 76,110, 47,140, +132,123, 96,101,218,152, 98,153, 38, 37,197,136,198, 66, 31,157,176,249, 49,239,229,141,137,140, 61, 49, 18,245, 76, 48, 41,130, + 98, 31, 76,109, 68, 80, 58,140, 62, 68, 96, 79, 9,198,212, 68,244, 78, 4,167,141, 77, 54,244,197, 17,237,209, 63,150, 54,161, +131,233,135,169,138, 78, 54, 38, 37,240, 34,232,163, 37,131, 77,153,143,199, 3, 18,140,162,134,227,182, 22, 64,190, 3, 55, 22, +222, 88, 55,151,154,238,219, 41, 29, 73,233,140,156, 81,204,214,138,174,135, 0,111, 45,248,145,200,212,137, 45,185, 37, 64, 2, +109,231,135, 77,198,101,129,114,158,113,178, 3, 72, 75, 1, 71,169, 29, 49,228,149, 34,246,252, 49,196, 19, 38,187,146,228,156, +162,181, 72,150, 66,118, 35,140,106, 13,108,251, 85,245, 61, 49,239,118, 74,174,164,254, 88,216,234,217, 45,133,173, 86,183,150, + 29, 52,243, 26, 10,193, 10,113, 99,109,172, 49,181,178,150,126,237,177,161, 83,163, 33, 62, 19,134, 82, 42,128, 18,111,249,226, +112, 78,148, 68,160,174,137, 42, 89, 74,174, 85,141,107,171, 54,218,182,149,223, 1,158,171,146, 57, 35, 3,167, 79, 37, 91,146, +187,123,175,137, 6,232,130,220, 29,234, 88,221, 85,165,139,238, 24, 88,132,166,180,235, 87, 1,207,207, 11, 15,216,154,127,101, + 21, 20, 16,252,237,143,125,147,221,130, 9,140,146, 63,229,140,189,157, 62,135, 30,133,219, 26,243, 94,192,208,255, 0, 98,255, + 0, 22,198, 38, 25,244,193, 47,102, 7,221,132, 35,123,206, 23,109, 77,236,230,134, 24,106,242,198, 38, 26,143, 54,193, 79,103, + 29, 13,207,203, 30, 24,188,252,112,225,243, 75,217,205, 10,246, 83,123,237,199,162, 50,137,228, 96,151,177,159, 92,100,136, 68, +225,251,106,143, 96,104,123,112, 20,163,194, 48, 66,157,150,101,204,115,104,104,128, 58,220, 96,246, 87,163,182, 85,223,186,128, +109,210,227, 18, 70,227,182, 60, 73,108, 15,128,198, 29,254, 54, 88, 81, 66, 6,189,107, 82,211, 9, 14,164, 41, 71, 74,140,181, +145,226,165,171,184,155,155,115,140, 31,201,148,224,215, 1, 65, 95, 28, 74, 95, 72,109,190,152, 31, 33,244, 31, 13,177,207, 43, + 25,189, 42,144,179, 91,173,225,118,113, 5, 2,162,142,229, 39,138,143,112,171,252,113,157, 38,155, 38,153, 82, 66,220,142,124, + 39, 18, 36,125,235,131,135, 76,194,110, 66,130,150, 58, 30,184,184,140,125,213, 36,161,209, 32,138, 3,152, 27, 8, 80, 91,102, + 8,162,112,150,167,153, 14,132,245, 29, 49,146,202,213,193, 24,206, 34, 18,210, 54, 1,211, 25,184,216, 60,131,206, 57,229,168, + 41, 70, 43, 73, 58,111, 76,221, 74, 84,130, 20,145,238, 56,100,252, 48,179,225, 63, 60, 16,121, 4,117,198,149,160, 1,193,193, + 90, 89, 72,210,160,179, 38,132, 72,130,160,110, 58,227, 64,130,165, 42,196, 96,171,172,173,106, 38,216, 77,197, 33, 59,173,241, +197,193,114, 82,157,232, 97,172,198, 98,152, 10, 59,107, 78,215, 16, 13,252,176,210, 76, 10,123,104, 44,174, 34,122,242,109,211, + 5,165,190, 26, 71,217,158,125,216, 11, 81, 91,160, 21,174,252,226, 77,220,187, 58, 42, 42, 70,221,181,254,161, 65,179, 6, 79, +162,213,161, 61, 13,230, 80,227, 46,160,165,198,150, 46, 20, 15,145,199, 35,246,170,202,249,219, 66,170, 84,236,241,151, 40, 79, +212,226,196,169, 33,232,207, 48,217, 90,146,128,161,118,156,253,235, 19,101,121,143,120, 56,236, 61,202,115,194, 13,207,166, 36, + 19,251, 63,229,252,235,149,196, 60,232,133,149,173, 65,212,180,149, 91,101,135, 0,251,249,190, 15,117,116,167, 45,225,222,241, + 27,117,245,233, 81,181, 79,176, 92,230,104, 64, 58, 17,200,215, 26,228,141, 80, 86,156,102,186,180,170,142, 94,152,188,189, 93, +144,153,177,213, 25, 1, 74,135, 33, 73, 1,208, 83,127,186,171, 3,199, 66, 15,174, 47, 76,129, 83,203, 57,237,248,174,211,171, +140,123, 35,196, 41,231, 74,192, 45,163,204,144,121, 6,223,158, 34,122,255, 0,161,104,211,138, 43,178, 40, 50,162,205, 66,110, + 83, 21,107, 83,106, 3,208, 27,144, 79,225,136,174,156,118,113,204,181,220,142, 51,213, 87, 57, 59, 65,139, 57, 39,217,155,105, +238,109,234,127,134, 11,109,196, 87,140, 90,118, 72,136, 26, 9, 6, 71,199,247,172,219,156, 34,214,230,224,186,224, 51,206, 14, +134,171, 79,164,135, 87,178,167,104, 13,118,162,104,173, 22,164,134,114,150, 72,111,188,155,177, 86, 67,178, 22, 7, 30,251, 36, +126,103,215, 22, 38,148,232,172,154,237, 30, 42,133, 45,202, 53, 33, 44,164, 52,183, 27,219, 41,244,219,245, 16, 71,217, 15,222, + 80,221,232,145,194,177, 11,209,205, 38,209,109, 43,215,186,133,119, 61, 85,211, 88,168,206,144,143,170,234, 18,218,251, 22, 29, +232, 84,160, 77,183,159, 8, 11, 35,143,113,231, 29, 96,212,114,122, 98,254, 23,134,219, 93,164, 62,242,179, 71, 47, 30,166,137, +138, 99, 79,218,178,155, 91, 81,148, 70,170,235,229,251,208,124,185,148,104,121, 78,148,138, 46, 94,166, 55, 22, 51,100,144,134, +199, 42, 81,234,165, 19,202,148, 79, 82,121, 56,125,236,135,200, 97,250, 99, 15, 76,101,236,188,241,127,195, 29, 80,112, 36, 64, +218,184,213, 54,165,153, 59,208,241, 16,223,238,227, 52,196,231,145,135,193,131,210,223,150, 51, 76,101,121,225,139,213, 30,192, +211, 20,197, 61, 54,227,207, 99,183,234,126, 24, 36, 35,127,129,140,132, 81,136,118,209, 79,236,243, 67, 61,144,126,198, 23,178, +254,225,252,112, 76,197, 30, 71, 30, 24,163,246,112,187,106,111,103,240,161,190,203,251,167, 11,217, 71,166, 9,123, 55,238, 12, +120, 99,126,238, 23,109, 77,236,244, 59,217, 71,166, 16,140, 61, 48, 71,217,125,216, 94,203,238,195,246,213, 30,194,135,136,182, + 60, 12,123,236,215, 28,140, 16,246, 65,233,143, 68, 68,245, 3, 17, 46,138,126,192,208,225, 24,143, 44,100,152,216, 33,236,131, +246, 78, 61, 17, 71,236,225, 23,169, 6, 13, 50, 76,112, 15, 76,108, 17,248,225, 56,122,152,164,126,166, 50, 76, 99,231,108, 12, +189, 68, 12, 83, 36,198, 62,152,216,136,164, 30,159,150, 30, 38, 41,233,141,137,141,238,196, 11,181, 48,205, 52, 68,111, 92,109, + 68, 96, 56,182, 29, 38, 48,242,198,105, 97, 35,203, 2, 83,180, 64,205, 55, 68,113,127,187,248,227, 98, 24,242, 3, 14, 80,192, +193,106, 61, 21,183, 82, 36, 60, 46, 15,221, 24,172,245,202, 26, 70,101, 26,178,205,170,157, 94, 84,138, 27, 26,139, 49,240, 10, + 24, 54, 62,120, 51, 77,164,152,137, 79,120,158,125, 45,130,140,180,134,198,208,155, 1,233,143, 36,172, 4,157,163,159, 44,115, + 87,120,155,143,140,128, 64,174,166,195, 14, 69,178,179,115,172,195,233, 66, 0, 7, 26,156,124,238,220,142, 72,245,195, 55,164, +169, 42,178,193, 30,152,214,252,228,178,201,230,247, 24,205, 2, 77,108, 6,200,173,242,106,170,104, 16,165,140, 12,147, 91, 82, +193, 72, 86, 24, 77,158,227,138, 37, 23,192,231,103, 5,248, 9, 32,140, 89,109,177, 86, 82,200, 2,139, 46,162,163,250,223, 44, +104,151, 80, 74, 17,247,190, 38,248, 14,186,161, 65,178,149,249,225,180,170,182,235,132,156, 88, 75, 69, 70,104,130, 19,161,162, + 47,213,122,248,176,201,250,157,255, 0, 91,227,206, 6, 59, 49,106,228, 43, 26, 22,241, 61, 85,243,193,195, 2,138,149, 81, 7, + 39, 93, 87,220,112,176, 52, 60,175,218,194,195,246, 85, 46,209, 21, 37, 75, 2,220,131,143,123,129,251, 56,116,150, 49,233,103, +212,126, 88,223,237, 43,206,114, 26,107,220, 39,246, 70, 16, 97, 62,105, 24,118, 25, 62, 95,195, 8, 50,112,221,168,165,146,153, +152,233,242, 24,243,217,199,161,195,222,228,227,223,103, 82,186, 36,225,118,162,156, 34,105,144,142, 47,211,243,198,232,209, 16, +181,216,167, 27,251,130, 15, 9,198,232,173, 22,150, 20,161,198, 32,227,196, 36,197, 73, 40,214,141, 82, 33,165,168,193, 69, 28, + 91,211, 14,194,210, 5,128,198,152,142, 21,178, 2, 61, 49,235,132,222,216,226, 46,221, 90,158, 57,171,162, 97, 1, 40, 17, 90, +166,202, 72, 22,192,153,110,155,149, 3,135, 85, 5,128,111,124, 12,126, 66, 84,163,115,231,138,153,171, 65,164,146, 41,204, 53, +135, 22, 1,193,136,150, 0, 1,229,136,244,121, 40, 66,184,193,120, 18,148,176, 0, 55,190, 17, 85, 58,208, 98,139,182,177,123, +222,216,218,165,164, 39,212,225,163,107, 54, 31,217,141,129,195,230, 48,225, 85, 80,163, 90,245,103,212, 97,187,128,168,240,113, +181,197,169, 34,252, 88,140,107, 14, 36, 3,137, 5, 17, 78, 17, 58,215,168,105, 54,185,198,169,110, 6,208, 82,148,245,198, 97, +210, 58,156, 53,159, 32,186, 2, 27, 77,213,127, 33,135,206, 73,169,161, 16,104,101, 65,197,182,173,201, 87, 39, 3, 75,115,167, + 58, 24,105, 11,117, 74,232,132, 38,228,252,177, 35,103, 42,203,154,166,215, 57,228,176,135, 62,232, 60,173, 95, 4,255, 0,126, + 37,180, 44,187, 76,160,178, 81, 9,146, 22,161,246,142,175,149, 28, 28, 92, 36,104, 53, 52,150,180,160, 84, 66,131,148, 19, 67, +113, 21,154,248, 5,109, 14,241, 17,135,234,219,155,171,251,177,204,250,175,219,147,180, 20, 13, 68,153,150,242,206,148, 42,101, + 53,167,212,134,102,185, 52, 50, 28, 60,217,182,209, 98,167, 87,107,240,145,229,114, 70, 59, 62, 84, 56,111, 52,164, 56,216, 55, +234,125,113, 67,107,206,139, 66,122, 74,179, 46, 86,168,136, 85, 38, 66,204,119,148,144,180, 13,214,220, 20,142, 46, 56, 7,130, + 15, 31, 44, 87, 93,195,169, 50,161, 63, 74,139, 97,167, 15,126,185,221,125,164,179, 46,172,187, 47, 43, 85,114,196,200, 85,104, + 46,150,231,211,231, 71, 82, 29, 97, 94, 64,140, 67, 53,203,180,245, 95, 74,178,116, 12,133, 81, 14,182,226, 25,190,208,171,109, + 10, 36,237, 0,249,243,249, 98,111,216,167,176, 6,190,100, 44,197, 95,212, 60,249,172, 21, 60,200,101,173, 69, 21, 28,196,178, + 86,190, 74,182, 52,146, 78,198,193, 61, 47,111, 65,142, 66,237,181,156, 53,203, 45,118,134,150,238, 88,209,252,185,155,221, 68, +180,177, 33, 57,146, 50,164,183, 18, 55,121,227,113,150,199, 69,157,160,119,130,234, 74, 65, 0, 89, 71, 6,105,212, 56,169, 27, + 84,125,145, 38,227, 34,117, 20,102, 6,187,167, 56, 84,149, 78, 97,185, 77, 73, 42, 10,121, 18, 17, 98, 19,228,160,124,239,238, + 56,250, 77,147, 87, 50,110, 86,166,204,169, 36,135,221,128,202,223, 4,116, 89, 64, 39,243,190, 62,102,228, 76,187, 76,111, 61, + 39, 59, 69,160, 57, 22,151,245,138, 20,205, 61,230,202, 44,192, 80, 42, 72, 73, 0,165, 36,238,176,226,193, 93, 7, 76,125, 62, +203, 21,122,110, 98,162,196,174, 82, 29, 14, 70,150,194, 93, 97,105,243, 73, 23, 31, 15,134, 58, 92, 46,237,155,124,210,119,138, +200,197,236,212,234,210,148, 13,191,138,122,134, 15,149,134, 54, 8,247,198,246, 26, 66,190,254, 54,119, 9,189,146, 49,178,155, +230, 92,216,214, 81,176,117, 35,106,107,236,222,241,143, 82,192, 7,203, 15,154,130,226,249, 74, 78, 50, 84, 23,146,109,221,159, +142, 36, 46, 91, 81,128,170, 26,173, 92, 78,226,153, 38, 62,227,100,167,242,195,184,244, 57,143,240,219, 56, 39, 74,164,167,112, + 91,169,248,241,131,108,180,195, 72,240, 0, 45,231,140,187,204, 88, 48, 97, 26,154,183,109,134,151,117, 94,130,162,206,101,201, +141, 38,235, 72,189,176,209,218,123,140,159, 26, 49, 50,125, 76,158, 20,171,224,125, 82, 51, 14, 55,116,129,138,182,248,218,148, +168,112, 85,183, 48,100,148,202, 13, 70, 76,123,121, 99,194,201,195,231,227,132,158, 6, 53,134,136,232, 49,188,135,130,211, 34, +177, 93,183, 83,106,130, 41,175,117,238, 56,244, 53,238,195,174,232, 30,163, 30,247, 3,211, 15,218, 80,123, 58,106, 26, 30,236, +122, 26,227,129,249, 97,208, 99,229,140,131, 9,244,194,207, 75,179,166,189,207,184,227,208,200,244,195,158,224,122, 28,122,150, + 0,242,196,115,211,246,116,216, 49,230, 49,144, 96,245,218,112,232, 54, 7,150, 50,102, 58,157, 88, 64, 6,215,228,226, 37,200, +212,212,146,212,152, 20,221, 17, 28, 87,221, 65, 63, 1,140,204, 55, 91, 23, 91, 68, 15, 82, 48,122, 12, 86,216,111,106, 44, 79, +153,195,149, 24,206,178, 89,144,129, 99,140,135,177,118,219, 92, 1, 34,181, 90,194, 86,180,201, 48,106, 61, 14,156,228,181,109, + 71,226,113,185,202, 52,166, 86, 0,111,112, 62, 99, 4,102, 76,167, 82,163, 46, 75,175,182,203, 45,166,235,113,106, 9, 74, 71, +169, 39, 12,169, 89,198,147, 90,134,153,244,122,147, 50,227,169, 68, 37,248,238,133,160,145,214,196,113,138,170,198, 22, 85, 40, + 78,149,109, 24, 58, 2, 97, 74,214,180,123, 35,233, 94,194,202,175,126,150,196,138, 27, 66, 52, 84, 34,220,237,192, 42,214,118, +165,208,163,123,100,197, 34,246, 59, 91, 43, 1, 75, 3,147,180, 30,164, 14,109,133,144,117, 63, 34,106,109, 57,117, 76,151,153, + 99, 79,101,151, 10, 30,238, 28,185, 66,135, 80, 71, 81,138,151,119,238,220,182, 1, 76, 70,244,123,123, 54,109, 93,253, 90,158, + 85, 34, 46,165, 45,220,250,243,134, 18,229,130, 77,151,140,103,212,208, 9,105, 29, 48, 53,217, 4,146, 65,198,120, 50,107,113, +150, 76, 73,173,146,101, 88, 18,174,152, 27, 38,164, 64, 41, 81,190, 50,149, 48,164, 16,122,121,224, 68,249, 91, 82, 84,149, 98, +194, 34, 42,216, 64,175,101,212, 0, 28, 28, 13,126,161,226, 42, 81,182, 52,201,152, 72,228,224,124,169, 91, 70,247, 86, 18,145, +230, 77,177,105,180,205, 76,173, 8, 21,190, 68,197, 94,225, 88,208,185, 69, 66,247,198,158,241, 42, 73, 88, 88,218, 47,115,126, + 5,177,228, 89, 49,101,178, 31,136,250, 29, 65,232,180, 40, 40, 31,152,197,196,173, 59, 10, 9,113, 19, 91, 67,164,249,227, 52, +182,162, 46, 71, 24,241, 40, 28, 27,115,141,173,133, 19,111,126, 38, 28, 20,150,160, 19, 53,175,187, 42,251,163,240, 24, 88,145, +229,166, 51,137,140,232,203,181, 86, 89,104, 57,101,221,214,134,229, 91,247,249,194,198, 51,248,195,108,188, 81,157,189, 58,185, + 7,222, 50,152,245,170,189,185,163, 9,108, 90,214,198, 93,213,255, 0, 87, 27,210,221,199, 76,102,212, 98,226,130, 66,113,210, +169,208,145, 38,185, 48,146, 78,148,216, 51,113,194,113,190, 45, 49,114, 14,227,194,125, 78, 10, 51, 79,101, 8, 0,160, 19,239, +198, 75, 1,177,100,129,242,198, 61,206, 46, 0, 33,189,234,251, 54, 36,153, 93, 52, 77, 46, 34, 5,148,187,227, 54,227,199, 73, +176,111,143,134, 61,222, 66,190,237,241,234, 93, 7,128,156, 99,174,250,225,123,170,180,209,110,202, 54, 21,137,137, 29, 74,184, +111,231,141,201,137, 20, 39,196,145,127, 76,100,148,130,157,196,219, 26,222,113,182,211,125,220,143, 76, 12,221, 60, 79,234, 52, +253,147,100, 64, 21,180, 56,195, 9,218,142, 62,120,212,185, 13,168, 16, 15,195, 3, 37,207, 82, 84, 72,195, 69,213,148,158,119, + 96, 10, 89, 81,147, 71, 67, 6, 52,167, 21, 39,109,123,244,192, 73,111,132,172,237, 87, 24,115, 46,165,222,141,164,223, 3, 31, + 89, 90,190,120,136, 58,213,230,155, 32, 83,168,178, 84, 85,107,224,221, 45,226, 19,215,229,128, 16,129,176, 54,243,227, 6,169, +106, 9,229, 88,124,212,156, 77, 26,101,219,142, 85,206, 54,247,196, 14, 78, 26, 52,177,110, 49,234,149,230,113, 32,106,161, 69, +110, 91,230,252,155,227, 5, 72, 4,217, 29,113,130, 82,228,133,165,166,144, 84,162,108, 6, 36, 20,138, 12,122, 82, 68,201,190, + 55,237,112,157,190, 22,255, 0,188,225,249, 84, 20, 82,129,173, 50,135, 72,117,108,137, 21, 21,150, 16, 71,132, 91,196,175,151, +150, 4,213,115,125, 58,149, 43,234,250, 28, 61,210, 13,198,240,110,175,141,207, 79,150, 48,212,156,222,170,100, 23, 28, 47,115, +111, 14,206,167,241,197,109,145,171,238, 87,107,238,200,158,247,114,194, 13,237,123,173,195,233,238, 24,164,235,164,154,100,130, +173, 77, 93,249, 69,165,185, 17, 51,164,158,241,247, 5,212,165, 18,118,143,119,247,225,245, 74, 90,227, 32,168,174,222,227,134, + 89, 34, 82,101, 66, 47, 95,195,110, 9, 56, 27,159, 51, 85, 62,154,149,239, 95,221, 28,226,227, 73,134, 65, 21, 85,102, 22,102, +148,204,225, 30, 40, 82, 92,125, 32,158,156,224, 68, 56,185,107, 57,214, 67, 19,234, 1,101, 10, 23,104, 43,174, 41, 29, 90,215, +152, 84,247,204,102, 25,117, 75, 42,179, 97,148,220,147,138,162,126,126,237, 79,147, 67,154,165,165,217, 1,252,206,220, 71,210, +169,217,126, 12,132,137,142,178, 77,138,154, 11,178, 84,180,143, 22,210,161,112, 15, 56,101,129, 29,227,165, 22,221,181,188,168, + 27,242,174,207,214, 45, 73,139,164, 20, 4,207,157, 75,109,218, 50,155, 68,117,251, 38,229,200,101,229,171, 98, 44,210, 65, 46, + 37, 68,132,248,124, 64,249, 16, 73, 79,205,253,104, 38,102,185,204,170,207,203, 79, 64, 15, 62,243,109,181, 37, 73, 42, 93,182, + 18,171, 39,238,139,241, 99,207, 91,129,128, 29,160, 62,147, 29, 64,147,152,232,163, 84,116,203, 48,228,186,115, 85,214,214,235, + 25,150, 19,172,201,117,212, 40,134,124, 32, 20, 4, 7,123,181,146,149, 43,132,249,114, 48, 63, 36,206,206, 90,137, 93,115, 61, +230, 30,249,104,117,107, 49,212,240, 32,175,113,185, 95, 62, 71,139,122,129,131,148,144,172,252,163,106,155,141,173,150,123,201, +131,215,157, 73, 87, 1,167,146, 59,182, 82,148,142,128, 12,117, 71,100, 28,202,205, 75, 77,191, 71,156,118,238,210,228, 41, 9, + 4,255, 0,209,171,196, 63, 61,195, 28,226,244, 5,177, 13, 46, 6,109,199,138,231, 6,244,195, 83,102,105,148,241,152,154, 87, +250, 56, 90, 4,182,192,251,205,238,218,109,239,228, 31,150, 44, 54,172,201,129, 85, 25,115, 43,146,107,180,218, 90, 61,127, 44, +111,105,105, 38,226,223, 44, 70,178,198,110,165,102,154, 52,122,229, 22, 88,122, 60,134,194,144,180,255, 0, 15,142, 10,183, 47, +204, 28, 21, 37, 93,107, 76,132,198,212,110, 44,158,236,219,139, 28, 63,143, 37, 43,177,176, 62,235, 98, 60,196,195,235,135,176, +230, 0,174, 15, 92, 58,138,198,179, 66, 83,109,171,113, 71,146,243, 64, 93, 3,229,141,107,157,183,130,191,150, 7,174, 89, 31, +173,110, 56,195, 89, 83,211,110,191,158, 4,115, 40,235, 80, 13, 4,152, 20, 73,250,162, 80,124, 74, 24,105, 34,164,149,139, 3, +215, 2,156,152,165, 30, 85,127, 76,105,113,229,168, 90,231, 18, 75,122,213,144, 2, 69, 19, 83,193,195,201,199,137, 3,203, 12, +163, 56,161,213, 95,142, 28,119,192,114, 14, 54,173, 46,148,202,114,157,171, 22,246,209, 47,156,195,122,114, 18,155,116,194,216, +159, 76,105,106, 75,107, 36, 37, 96,144,108,108,113,189, 42, 73,231, 27, 8,115,180, 78, 97, 88, 46,180, 91, 86, 83, 72, 36, 95, +129,143,118,156,100,146, 15,221, 24,220,152,238, 44, 92, 52,109,134, 82,146,157,205, 64, 54, 85,176,166,251, 79,166, 22,213, 94, +214,195,133, 52, 81,247,145,140, 10, 20,162, 54,167, 8, 45, 36, 77, 46,205, 83, 17, 88,198,142,185, 46,134,210,109,234,112,241, + 77,199, 76,119, 33, 71,149,246,182,218, 86,130, 46,130,124,254, 56,214, 30,110,149, 13,233,210,142,212,180,217, 90,207,160, 2, +231, 28,155,173, 29,163, 53, 3, 46,178,254,171,100,166,166,210,104, 82, 28, 49,170, 19,229, 71, 79,112,147,115,103,148,187,110, + 77,133,172, 64, 62,252,114,248,206, 44,150, 92, 13, 5,104, 72, 3,196,159,231, 74,190,149,219,225,236,135, 94, 4,147,200,111, + 21,208, 84,188,225, 94,211,172,204,114,142,104,168, 55, 84,132,152,139,117,170,146, 30,239,100,157,160,169, 93,226, 16,144, 18, + 0,244,235,135,210, 53,195, 79,126,183, 69, 11,235,160,185, 18, 32,251, 92, 85,182, 82, 91, 91,118,191, 38,254, 19,107, 30,113, +243, 86,177,219,170,143,167,179, 42,121,135, 38, 86,220,145, 46, 69, 73,217, 20,250,181, 65,197,186,212,132,169,189,138,108, 43, +130, 7,136,155, 31, 63, 76, 80,249,255, 0,180,158,170,102, 7, 42,210, 41,153,177,198, 99,189, 79,238,164,152,207, 17,184, 27, + 94,231,112,230,252,113,205,184,198, 21,133,190, 55,121,112,174,208, 0,142,233, 4,136, 62, 32,141,127,125,199, 74,195,186,227, + 36, 90,142,226,119,141,249, 14,158,117,222,253,172,126,146,109, 60,250,130,161,167, 89, 82, 60,197, 76, 15,247, 18,223,113,132, + 46, 43,204,169, 32,144,149, 19,125,225, 87, 29, 45,239,199, 55,102,158,223, 58,171,167,185, 86, 62, 82,210,201, 38,137, 71,101, + 14,188,220, 84,200,105, 13,135, 22,224, 87,123,192, 81, 74, 65, 22,218, 79, 67,142, 33,205, 90,179, 10,171, 76,106,133, 34,168, +228,167,217,117, 37, 73,108, 43,109,137,228, 21, 94,220, 96, 46,110,204,149,136,146, 96,210, 37, 79,122, 60,105, 42,176, 75,175, +238, 79,119,126, 46, 60,192,228,227,176,181,192, 24,100,140,234, 36,147, 39, 55,132,108, 52,143, 42,225,159,199,241, 23,238, 59, + 85,186,115, 64, 29, 52, 29, 58, 78,230,187,110, 63,210, 47,171, 57,202,112,133, 92,212,161, 38,160,228,177, 32,178,152, 12,187, + 30, 58,130, 45,118,183,130, 71, 22,184,189,186,227,110, 69,250, 78, 51,190,153,101, 60,215,151, 50, 74, 88,129, 58,168,165,150, +106, 29,195,108,165,151, 9,251, 71, 16, 54,242,163,229,233,124,112, 46,123,207,239, 73,152, 24,162,161, 61,204, 7,212,216,155, + 13, 5,176,240, 61, 20, 71,151, 76, 48,111, 60,202,170,237, 97, 50, 84, 20,142,165,106, 82,247, 31, 79,118, 52,127,161,217,191, + 14, 56,153,219,126, 80,100,127, 29, 40, 3, 22,187,246,142,213, 75, 37, 94, 38,126, 63, 42,250,249,217,211,233, 81, 98, 70,148, + 72,164,103,124,217, 25,204,196,203,145,217,164, 74,170,164,247,114,148,162, 2,251,213, 32,168,166,198,231,119, 75, 91,140, 95, +244,175,164, 35, 67, 88, 68, 72,186,129, 87, 77, 18, 75,201, 9,121,231, 22, 28,142,151,127,101, 43, 79, 36, 30,160,144, 56, 56, +248,131,166,218,223,152,180,242,166, 12, 40, 12,199,125,212,168, 23, 4, 52, 56,226,144,160, 65, 27, 87,193, 4, 31,150, 38,116, + 94,208,110, 76,201,135, 43,231, 58,148,215, 41,226, 67,138,132,202,154, 79,250, 58,207,136, 42,224, 2, 65, 36,220, 95, 25,207, +224,138, 15, 74, 63, 79,199,221,167,195,229,177,233,108,184,219, 20,181,202, 51, 5, 36, 8,131,175,198,102,121, 87,220,220,189, +172, 90,105,159, 41,255, 0, 91,101, 76,245, 77,153, 28,172,160, 45,185,105,235,243, 56,105,153,179,238, 75,161, 82, 95,174, 86, +179,141, 58, 44, 40,192, 25, 18,157,150,144,134,193, 54,186,141,248,199,196,218,167,105, 92,193, 43, 47,194,202,249,118,172,245, + 42, 12, 32, 84,149,190, 82, 82,235,155, 70,237,167,109,211,127, 43, 19,137, 14, 94,237, 18, 51, 4, 21,229, 74, 14, 82,147, 84, +106,163, 24,125,103, 5,164,240,250, 27, 79,141, 69, 92, 21, 40,168, 92, 88,116,247,226,187,152,107,246,237,231, 87,211, 65,212, +157, 6,218,252,205,116,237,113,234,214,220,118, 34,127,246,250, 71,194,107,233, 38,180,246,173,167,101,252,244,222, 65,201,213, +152, 79, 69,105, 74, 21,154,219, 46,182,235,109,180,166,194,155, 91, 4,173, 41,116,146,171, 90,226,220,249,227,156,179,159,105, +125, 78,204,249, 29,154, 37, 39, 49,202,126, 93, 33,231,227,213,167,191, 49, 40, 70,197, 93, 77, 40, 32,125,229,132,241,226, 81, + 3,223,142, 54,155,175,175, 10, 29, 71, 44, 12,175,220, 48,128,160,168,147, 29, 40, 49,208, 14,237,137,113,126, 62,156, 14,111, +137,212,188,253, 47, 43,233,204,125, 86,151,146,225, 83, 40,249,138,148,168,212,104,116,234,154,148,229,218, 33, 37,231, 55, 40, +253,173,252,237,111,118, 50,110,108,113, 22,138, 75,170,204, 52, 16, 32, 2,122,145,154,117, 4,233, 37, 58, 13,122,229,189,197, + 47, 93, 21,169, 68,128, 57, 14,159, 31, 10,183,179, 94,112,212, 26,254, 79,167,230, 74, 70,125,155, 18,179,245,114,100,212, 35, + 74,173, 41, 54, 66, 85,181, 42,109,182,205,150,226,173,114,159, 75, 96,234,251, 97,106,243, 52, 42, 85, 86,101,110,125, 58, 45, + 62,152,136,209,167,209,105, 97,150, 38, 58,149,130, 3,225, 73,176,122,197, 91,201, 85,185, 6,216,231, 58,110,110, 68, 28,191, + 68, 53,106, 90,232, 52, 60,201, 86,246,215,235, 5,244,185, 32,161,180,237, 83,125,229,138,146, 73,230,199,175,166, 52,235, 23, +104, 38,243,198,114,122,133,150, 39,119,116,133,109, 68, 72, 84,214,150,203, 85, 5,164, 4, 37,197, 32,120, 59,203, 1,185, 65, + 34,231,203, 21,173,172,221, 85,194, 83, 18, 82, 84, 66,186, 9, 0,164, 17, 58,238, 34, 98, 6,189, 69, 54,241,181,165, 5, 89, +251,219, 1,204,248,252,188,235,189,123, 58,125, 38, 25, 95, 63,206,111, 46,106,109, 7,234,135,151, 39,185,110,170,153, 8, 49, +182,237,240,169,194, 79,133, 74, 32,244,227, 29, 61, 78,206,217, 66,167,151, 83,155, 41,249,138, 35,244,229, 35,112,154,211,193, + 77,145,241, 24,248,163, 63, 55, 80,234,181,234,125, 63, 44,228,134,225,138, 20, 62,242,175, 21,201,192,183, 33, 64,139,184, 9, + 41, 81,235,210,255, 0, 12,117,167, 99,238,212,204,228, 90, 25,211, 58,206, 81, 53,122, 13, 62, 59,107,126,165,151,221, 82,216, +105,151, 84, 84,227,178,133,174,109,113,101, 91,139, 17,141, 91,251,183, 45, 25, 14,100,130, 99, 67, 2, 53,137, 38, 79, 80, 96, +114, 58, 77,116, 86, 28, 72,227,131, 35,186,244, 53,209,250,213,155,114, 2,179, 93,217,205,113,102, 37,104,239, 10, 26, 76,196, +173,133, 30, 10, 85,221,184, 18,122, 92, 16, 58, 97, 99,151,181,230,163,163, 20,236,200,212,156,141,155, 50,173,102,153, 39,122, +152,114,169, 53, 74,146,201,184, 37, 11, 7,145,107,241,238,248, 97, 99,146,119,134,223,184,117, 78,185,112,185, 81, 39, 64, 99, + 94,144,168,138,205,126,253,194,242,137, 35,126, 71, 74,250,194,132,244, 55,195,200,113,136, 29,229,240,221,132,248,135,199, 4, + 16,176, 18, 2, 79,150, 59, 60, 66,225, 77,162, 7, 58,234,237,154,204,169, 52,150,189,157,112,222, 67,252, 95, 25, 58,231, 23, + 39,140, 51,147, 40, 36,220,114,113,204,169,100,154,217,109,178,107,213,204, 45,158, 45,141, 98,166, 82,163,124, 51,126, 69,239, +124, 53,113,244,129,193,231, 16, 10,154,180,150, 68, 81,163, 87, 73, 78,210,113,173,115,144,187,133,155, 96, 33,149,180,240,113, +232,152, 84, 57, 56,121, 53, 32,196, 83,154,131,169,231,106,133,176, 34, 67,206, 95, 14, 37, 74, 66, 82,121,231, 3,221,144, 22, +110, 14, 28, 77, 90, 66, 0, 21,232,125,203,216,158, 49,152, 9, 81,189,252,241,165, 4, 44,216, 97,195, 97, 32,218,248,148, 19, + 68, 48, 41,212, 84,132,218,248, 37, 25,212,131,112, 48, 49,178,145,208,252, 48,225,151, 82,146, 2,149,111,137,196,130, 73,160, + 44,131, 70, 99,190, 15, 55,198,242, 73,248,224, 92,119,145,112,174,240,126, 56, 61,150, 34, 34,116,190,245,205,170,109,171, 21, +130,122,159, 33,254, 61, 49, 34, 34,170, 44,128, 38,139,229,218, 81,132,208,155, 37,145,222,175,238, 5,113,180,122,252,113,186, +179, 48, 50, 10,183,254,175, 0,117, 62,252,109,153, 39, 98,142,196,149,145,233,128, 21,151,223, 8,113,197,144, 9, 29, 54,224, + 43, 81,136,170,154,168,230, 53, 92,106,238, 98, 98, 20, 39,156,113, 59,212, 18,108, 73,251,184,165,178, 14,119,118,163, 91,113, +142,244, 54,143,105,218, 18,165,242,171,158,113,104,107, 74,216, 52,167, 91, 97,145,189, 73, 55, 54,220, 78, 57,123, 44, 87, 14, + 79,213, 70,215, 60, 31,103, 83,188,238, 28,130, 79, 23,197,126,200,169, 36,209, 91, 80,218,190,130,229,247,151, 78,203, 12,173, +147, 96, 88, 4,155,115,211, 21,126,171, 84,164, 20, 59,185,103,113,191, 67,206, 39, 57, 27, 49,181, 89,203,145,154,218, 47,220, +131,201,247, 98, 59,169,121, 41,250,156,103, 87, 25,126, 37, 32,242, 49,117, 36, 6,196, 85, 39, 37, 74,174, 82,170,179, 90,205, + 90,146,221, 14, 3,123,201,243,183, 67,126, 49, 47,205,154,103,170, 25, 86,135,178,145, 95,159, 21, 98,202, 75,177, 29,216,160, +127,187,227,137, 6, 66,200,107,203,217,241, 85, 73, 74,220,182,215,116,139, 98,198,205,217,145,170,205, 45, 81,148,194,119,116, +196, 20,176,161, 21,105, 50,212, 20,239, 92,135,153, 6,107,204,111,171, 47,234, 68,193, 83, 75, 66,237,251,115, 9,113, 65,119, +184, 85,200,242,182, 38, 89, 59, 79,168,201,165, 50,211,101, 4, 37, 62, 45,160,117,198,253, 67,203, 43, 69, 84,212,119,129,119, + 57, 36,112,110,112, 94,131,150, 93,167,195,106,107, 79, 40,165,225,123,142, 44,124,198, 34,149, 32,236, 34,162,249,113,104,149, + 42,106, 43,155,178,186,162,165,214,144,223, 10, 65, 9,219,231,231,138,139, 53,230, 88,212,158,246,140,235,128,180,248, 45,172, + 31,222, 4, 3,242, 54, 56,186, 53, 23, 49, 63, 71,140,242, 82,214,226, 18, 65,184,232, 61,113,203,217,162,162,186,174,102, 92, + 53,155,184,227,183, 40, 39,175, 56,179,106,231,247, 42,146, 82,102,106,230,208,205,109,206,122,111, 5, 84,232,146, 67,209, 92, + 30, 22,222,241, 37, 10,247,122, 95, 22,107,125,171,243,162,141,219,133, 16,123,138, 14, 40,236,159, 73,117,168,237,177, 33, 23, + 66,211,224, 82,189,125, 13,176, 90,116, 89, 81, 89, 83,172,166,234,108, 93,105,191, 84,250,143,134, 59,174, 26,123, 11,114,235, +176,188,109, 36, 43,101, 30, 71,161,240, 63, 3, 88, 56,243,184,144,183,237,173, 28, 32,167,112, 57,143,220,124,170,224,111,181, +182,118,138,221,149, 2, 35,138,234, 9, 73, 24,124,231,108,236,196, 99, 32, 70,203,113,144,224,255, 0, 88, 84,178,111,142,119, +147,153, 20,201,220, 79, 24,214,230,106, 74,145,100,117,199,168,126, 82,193,220,130, 88, 31, 26,243,223,205,120,194, 4, 7,141, + 91,213,206,212,218,157, 50,172,170,147, 53,179, 28, 17,100,176,208,240, 36,124, 48,218,143,218,223, 83,232,175, 19, 34,162,137, +141,168,220,162, 66, 47,111,158, 41,233, 53,235,164,172,185,206, 7,185,153, 16,226,138, 66,133,241,124,112,214, 22,166,242, 22, + 19, 30, 66,170,163,136,177, 32,230,126,217, 83,230,107,173,114,175,109, 44,191, 46, 50, 81,153,232, 78,178,231,154,227,170,233, + 63, 35,131,255, 0,231,127,165, 97, 10, 80, 50,247, 14,137,238,122,227,139,152,204, 14,216, 13,215, 3, 14,227,102, 54,183, 0, +190,184,200,119,128,176,101,175, 48, 73, 30, 0,233,245,173,182,248,227, 22, 75,121, 74,129,243, 26,215, 92, 77,237,153,147, 90, + 73,246, 10, 36,151, 21, 99,183,122,128, 23,196,106,163,219, 39, 51,200,109,214, 41,244, 40,237,111,184,109,101, 68,148,140,115, +155,185,132,149,120, 69,189,248, 77,230,165,180,171, 41, 67,241,197,150, 56, 55, 8,103,102,231,204,147, 84, 31,226,220, 85,223, +251,145,229, 2,186, 47, 71, 59, 68,191,150,170,179, 31,206,111,200,146,220,197, 5,110, 74,175,177, 94,182,197,235,147, 53,115, + 36,103, 56,166, 69, 42,180,210, 84,159,188,219,202, 9, 80,252,113,193, 80,179,138,247,237, 82,198, 10,196,206,106,100,133, 37, +226,159, 93,170,182, 5,127,195, 12, 60,178,180,119, 73,233,183,165, 14,207,137, 46,109,210, 16,190,242, 71, 93,253,107,232, 84, + 74,229, 25, 77, 7, 81, 81, 97, 66,246, 42, 14,139,127, 28, 18, 98,183, 79,148,128,152, 82,218, 89,181,236,133,131,124,124,250, +137,159,103, 6, 59,182,106,143, 0,122,164, 58,112, 78,141,171, 57,139, 42,200,250,210,155, 95,122, 58,155, 73,187,157,233,178, + 71,159, 92,114, 23,156, 16,251,146,160,246,190, 35, 79,157,116,182,220,110,203,121, 82,166, 52,231, 7,248,174,241,113,254,240, +220,163, 27, 19,220,161, 37,205,215,176,232, 49,198,212,206,216,186,139, 67,152,212, 71,234,226,114,220,104,186,152,203,103,122, +214,129,114, 84, 2, 69,236, 45,215, 19,252,129,219,155, 43, 84,226, 45,204,249, 13,202, 96, 41, 61,219,157,218,199,139,246, 84, +146, 46,147,142, 82,251, 1,197,173, 26, 86, 85,165, 97, 34, 72, 74,132,129,214, 55,174,146,211,137,240, 75,181, 12,210,130,127, +228, 52,245,218,188,215, 94,215,185, 41,188,191,245, 99, 53,186,180, 57,176,171,197, 53, 10,108, 88,189,211,254,206,218,182,169, +197,110, 7,192, 47,127, 9, 23,252,177,243,231,180,119,106,188,215,158, 21, 84,136,137,177, 95,164,102,106,194,183,179, 45, 65, +106, 82, 26, 1, 13,148, 36, 4,134,201,183, 36, 36, 95,215, 7,251, 84,235, 58,145,168,146,245, 61,213,119, 80, 30,117, 77, 33, + 18,166, 5, 60,224, 42,185,111,105, 79, 59,147,250,192,121,115,142, 75,173,106, 46, 70,154,107, 47, 74,137, 37,245,169,228,253, + 87, 13, 42, 67, 73,105, 5, 87,185, 88, 55, 4, 92,244, 7,229,142, 38,199, 14, 91,215, 10,188,121,174,241,136,208, 18, 53,253, + 51,202, 12, 25,158, 94, 85,195,227, 56,219,215,107, 34, 99,246,218,136,106, 20,108,230,136, 17,114,107, 49,153,155, 13,185,174, +251, 29, 41,165,217, 77, 41, 96, 2,178, 65,228,250, 12, 85,249,247,235,154, 53, 81,188,162,169,174,195,144,227,253,219,140,190, +239,250,145,239, 35,203, 12, 94,212,108,195, 73,175,177, 63, 43, 86, 84,167, 97,184, 22,211,206,166,224,184, 61,198,225, 86,247, +227, 84,250,181,126, 69, 98,161,155,171, 77, 71,126,120,251, 89, 37,100, 30,242,252,149, 90,254,167,160,233,142,223, 13,106,229, +133,128,178,152, 35,161, 4,170,122,109,207, 94,100,239, 92, 67,239,184,162, 9,175, 39,253, 89,147,106, 46, 49, 76, 68,137,172, +173,189,174, 75,104, 92, 18, 71, 3,159, 67,252, 49, 23,175, 78,139, 38,160,203,177, 42,171,146,234,148, 3,203,124, 27, 54,155, + 14, 49, 38,115, 45,206,166,165,138,142, 96,172, 38, 34,167, 54, 36, 53, 13,135,129, 40,107,201, 86, 7, 21,253, 85,205,181,169, + 17, 33, 77, 81,105, 75, 61,217, 88,228,143, 95,142, 58, 27, 66, 22,102,100,245,170,169,112, 57, 36, 26, 49, 82,204,241,233,189, +245, 46,159, 41,110, 50,229,186,144, 18, 85,110,160,127,102, 6,210, 29,169, 83,222, 69, 82, 44,149,199,109, 75,218,227,163,160, +189,250,250,224, 82,195, 45,190,165,205,120, 92,116,183, 91, 99, 25, 85, 71, 30,100, 67, 68,165,247, 73, 55, 66,124,175,235,139, +201,108, 37, 57, 69, 60,154,147,102, 28,193, 41, 85, 72,245, 33, 84, 84,158,229, 3,187,251, 95, 18, 64, 61, 61,113,237,127, 62, +201,175, 6, 27, 33,108,161,176, 74,148,149,220,168,159, 60, 70, 95,154,137, 8, 73,104,142, 19,181,203, 12,102,218,217, 91, 74, + 13,143, 16, 29, 78, 24, 54,132, 0, 99,106,116,172,136, 39,122,156,229,173, 67,221, 82,129, 2,187, 1,185,241,218, 89, 67, 96, + 93, 42, 81, 80,218, 7,227,108, 89,116, 71,179, 21, 31, 81, 94,165, 82, 99,179,151,153,161,197,223, 61,185,149, 0,181,168, 20, +141,197, 4,248,183, 18, 65, 9, 7,140, 80,180, 10,173, 54, 43,203, 69, 74, 27,174, 40, 54, 67, 61,209,177, 74,252,142, 39,115, + 81, 88,246, 89, 82, 51, 54, 74,117, 18,229,197,109,214,139,151, 71,216,132,255, 0,172, 55, 55, 36,218,247,243,198, 22, 38,209, + 46,107,160, 32,141, 78,146, 72,212, 9, 0,232, 76,233,252,219,109,245,132,229,250, 81,154,254,166, 85,127, 72,170,217,121,213, +111,139, 53,194,204,137, 18, 90, 14, 56,164, 5, 92, 40,219,139,222,220,140, 72,245, 37,186, 75,180,156,183, 71,203,154,145, 26, +100, 88, 12,165,107,134,227, 10,105, 48,214,183, 6,224,178,174, 21,207, 36,129,211, 16,172,255, 0, 80,201,217,178, 37, 6, 86, +157,229, 9,116, 56, 13, 67, 13, 84,170, 83, 29,220,137, 18,121,185, 7,201, 60, 88, 99, 93, 31, 57, 86, 41,236,211,114,134,161, +209, 89,168,209, 26,150,169, 8,140,195,137,101,199,201, 77,133,222, 0,170,221, 45,229,140,146,195,138, 13,186,216, 41, 41,153, + 71,118, 78,132, 79, 49, 58,104, 51, 13,245, 52, 86,238, 86,161, 10,216,233,241,240,253,170,108,214,104,169,101, 12,241, 58, 46, +105,159, 10,180,220, 39,193,167,211,216, 95,127, 17,194, 69,194,208, 83, 97,110,150,183,204, 97,228,238,208,149,202,236,216, 84, +188,187, 22,149, 77,133, 70,154,169, 44, 73,106,158,148, 72, 36,128, 86,208,113, 41,185, 3,145,111,126, 33,153,131, 52, 84,227, + 81,103,102, 60,176,236, 72, 49, 95,117,182, 61,149,201,136,117,244,109, 59,129, 70,225,184,164, 90,215, 30,156,226, 63,150,115, + 69, 57, 16,101,203,173,255, 0,165, 43,188, 85,163,184,118,239, 42, 28,174,227,161,195,180,211,138,100,168,141, 68, 13, 58,192, +157, 54, 7,222,124,234, 70,233,198,204, 36,192, 63, 41,235,185,171, 78, 70,100,203,153,194,109, 87, 57, 49,147, 93,105,151, 74, + 18, 35, 70,124, 32,178, 66, 44,108, 57,222, 9,241, 17,135, 29,158,234,129,157, 64,141, 10, 95,181,184,201, 73,118, 84, 54, 22, + 91, 68,176, 8,251, 37, 56,146, 10, 69,141,237,207,151, 7, 21,221, 17,232,173,215,125,147, 38,190,244,168,146, 34,131, 41,185, + 13, 13,237,221, 62, 32, 61,195,246,176, 41,252,207, 85,162,204, 12,208,115, 35,233,109,133,149, 89, 14,148, 16,111,197,185,247, + 12, 9,118,142, 62,202,217, 73,137, 2, 38,116, 31, 79,129,231, 51, 82, 69,242,144,160, 73,219,165, 93,189,165,181, 7, 38,229, +108,252,154, 30,155, 72,169, 18,196, 80,154,187, 21,136,129,181, 71,147,114, 84,218, 10,198,245,161, 32,128, 20,176, 14, 22, 42, +106,173,122,169,152, 39, 43, 58,106,229,102,163, 85,153, 85, 1, 76,205, 50,195,206,172, 35,194,123,194,162, 85,113,192, 23,244, +194,196,108,173, 25,182,181, 67, 75, 73, 90,146, 32,171,121, 60,245,210, 96,233,183,157, 73,215, 74,220, 42, 26, 3,215,122,253, + 55,177, 33, 42, 1, 72, 87,192,131,135,168,112,119,124,168,123,206, 41,202, 30,171, 84,104,145, 83, 18, 67,105,125, 9,251,170, + 82,185, 24,115, 39, 92,234,132,142,226, 35, 41, 77,185, 4,223,156, 94,191,225,252, 65,245,101,108, 2, 58,205,122,189,167, 19, +225, 73,111, 50,201, 7,164, 85,161, 46, 85,147, 96,175, 60, 13,149, 35,175,139, 21,219,154,215, 82,117,165, 5, 70,103,113, 30, + 21, 11,241,134, 82,117,142,164,153, 1,192,195,101,189,150, 40, 62,190,184,202,252,169,139, 40,254,145,235, 90, 72,226,236, 21, + 49,222, 62,149, 99,173,251,242, 78, 27,186,249,190, 43, 25,154,209, 91, 90,137,143, 29,148, 15,133,240, 18,173,170, 89,158,160, +174,106, 5,161,251, 45,113,139, 12,112,102, 40,225,239,194, 71,156,252,170, 78,241,190, 14,218,123,153,148,124,163,231, 87, 27, +142, 88,245, 24,192,200, 23,177,116,124, 47,138, 34, 70,160, 86,148,229,157,171,188, 72,255, 0,230, 28,105,119, 54,212, 92, 29, +231,214, 46,159,131,135, 26, 72,224, 71,249,186, 61, 15,239, 84, 15,226, 5,176,217,147,234, 63,106,189, 37, 79, 97,181, 4, 56, +250, 1, 61, 1, 86, 7, 75,204,180, 72,193, 69,250,163, 41,219,247,134,254,113, 71,202,205, 82,221, 59,213, 53,194, 71, 75,172, +225,191,215, 14,173, 91,221, 93,239,234,113,117,158, 4, 72, 50,227,190,131,249,170,206,254, 33, 24,254,219, 32,121,159,226,174, + 33,170,185, 77,178,173,210,156,240,222,222, 14,184,212,246,182,229,166, 25,220,136,239, 41,103,245, 45,108, 83,206,203,120,168, + 40,116,198,181,187,179,198,165,223,231,141,102,248, 47, 8, 27,230, 62,255, 0,226,177,157,227,220, 89, 91,101, 30,239,230,173, + 21,235,236,181,135,147, 26,148,145,127,245, 37, 74,233,241,196,126,126,119,204, 53,153, 94,215, 46,172,232, 62, 73,109, 86, 9, +252, 49, 12, 76,183, 2,192,108, 90,254,184,122,151,100, 5, 11, 44, 16, 71, 56,214,183,192,240,203, 19, 45, 54, 1,245,249,214, + 13,223, 17, 98,152,128, 9,117,210, 71, 77,190, 85, 38,107, 50, 87, 16,139, 26,172,130, 47,113,246,167, 29, 41,162, 57,106,163, +150,178, 67, 47,214,222,113, 83, 39, 17, 33,212, 58,178, 75,105, 35,192,142,124,194,121, 62,245, 91,203, 20,223,103, 13, 34,168, +231,250,250, 51, 37,102, 53,168,180,215, 2,157, 43, 28, 72,116,114, 27, 30,163,161, 87,187,143, 60, 92, 85,173, 77,166, 67,172, +191, 74,113,244,165,198,239,100,147,201,199, 9,198, 23,246,225, 66,205,144, 58,168,143,128,250,159,117,118, 92, 35,103,112,164, +155,183,137,141,146, 15,196,253, 7,190,164,181, 42,220,120, 39,126,240, 13,237,215, 17,220,207, 92, 84,132,150, 99, 58, 54,237, +228,142, 77,206, 43,188,235,171,112, 89, 73, 83,147,146,147,126,128,244, 23,192,108,149,169,201,205,117, 31,104,102, 86,246, 82, +178, 10, 47,192,244,199, 12, 65,203, 93,174,105, 52, 91, 57, 82,211, 38, 58,214,249, 82,148,121,235,142, 95,237, 15,145, 38,193, +123,235, 58,115,138, 67,161,123,129, 79, 91,142, 69,142, 58,238,182,210, 38, 69, 74, 72, 35,120,184, 73,235,138,131, 88,178,114, +171,116,245,182, 64,189,200, 73,244, 3,173,190,120, 10, 87,217,170,164,146, 66,166,188,236,149,218, 46, 22,105,161,181,150,107, + 83, 11, 51,225,253,155,232,113, 92,174,214, 0,140, 95,115,115,108, 7,153, 84,114,224, 55, 71, 39,169,199,206,188,219, 72,206, +122, 81,152,218,206, 25, 85,210,151, 90, 88, 15, 32,126,186,111,200, 30,252, 92, 58, 99,218,250,133,156,224,165,167, 38,150,102, + 32, 4,201,140,233,241,165, 94,159,227,211, 23, 18,148,169, 50,157,170, 46,182,161,222, 78,213,208, 21, 58, 24,155, 33, 83,169, +206,164, 27,114,112, 30,163, 2,170,180, 22,209, 98, 74,108,163,211, 1, 50,182,167, 49, 57, 14, 45, 50,197,130,111, 98,172, 57, +149,168, 44,178, 18,148,188, 63,120,250,146, 73,254, 24,170,226, 32,233, 78,219,240, 53,175, 37,105,252, 41,112,146,186,145,222, + 66,175,221,143, 35,193,198,185, 45,194,140,216,105,224,148,139, 18,132,164,113,128,117,157, 75, 49, 2,251,217,169, 65, 60,139, + 43,200,121, 98,170,213,238,210, 52, 28,183, 74,118,108,154,178, 80,224,184, 66, 18,171,146,111,108, 2, 72,208, 84, 22,165, 58, + 96, 82,237, 27,168, 89,102,133, 77,146, 75,169,239,156, 96,132, 39,247,186, 99,159,180,214,139, 55, 53,215, 27,204, 51, 89, 82, +119,120,144, 74, 72,184,190, 51,133, 31, 50,107,198,108, 69, 94,180,167, 90,166, 33,203,182,209,224,184, 79,159,195, 29, 3,144, +244,218, 29, 38, 43, 72, 17,128, 64, 2,230,220, 28, 88,111,251, 73,215,115, 82, 82, 18,210, 35,157, 55,160,229,162,244, 61,174, +120, 71, 80,160, 1, 3, 25,212,232, 97,182, 59,208,143, 18,122,170,216,158, 65,203,204,196,110,233,111,114, 7, 75, 14,131, 2, +243, 37, 62, 51,108, 40,163,169,227,194, 57, 7,223,238,197,134, 46,138, 87, 84, 28,111, 74,163, 51,149, 9, 84,151, 83, 61,166, +255, 0,209, 95, 90,130,118,255, 0,209,172,117, 65,254, 35,212, 98, 62,228,198,211,194, 83,139, 38,171, 30, 29, 69,110, 82, 38, +168, 8,211, 83,181, 75,181,203, 15, 39,238,172, 15,196, 31, 81,124, 87,117,220,189, 62,137, 84,114,151, 53,177,189,181, 88,148, +158, 20, 58,133, 3,230, 8,228, 31,126, 62,131,224,254, 33,111, 20,177, 13,186,175,238, 32,107,226, 57, 31,161,241,243,175, 30, +226,140, 29, 88,125,223,104,216,254,218,246,240, 60,199,237,252, 83, 9,147,129,108,128,139,122,224,114, 29, 88, 89, 40, 23, 39, + 6,133, 40,173, 22, 40, 22, 35, 9,170, 10, 26,231,129,142,216, 92,182, 5,114, 93,225, 76,162, 51, 42,219,220, 80,177,232, 48, +245,150, 6,235,168,115,141,141, 83,214,130, 44,120,198, 74, 97,212, 47,194, 46, 61,112,198,225, 39,157, 54,101, 86, 15, 54,178, +155, 14, 49,173,182,202, 85,117, 27,227,110,201, 10, 59, 45,197,240,155,153, 76, 19, 61,128,205,103,191, 72,186,153,223,226, 2, +221,109,136, 42,229, 8, 26,154,140,170,182, 29,136,177, 66,108,122,223, 24, 63, 82,110, 3,125,252,167, 10, 16, 60,254, 87,195, + 81,152,155,141,189,188,193, 29,168,197, 43, 74, 90, 91, 78,239, 75,187,151,181, 54,244,242,189,240,238, 94, 87,203, 57,138, 11, + 53, 61, 67,172,162, 6, 94, 14,157,201,109, 37,217, 15,184,139, 16,139, 54,163,181, 36,237, 5, 70,246,221,124,114,220, 67,197, +118, 24, 38, 26,229,202,204,168, 76, 38, 9, 36,232, 32, 13,206,227,106, 51, 9, 46, 58,148, 76, 77, 17,137, 92,101, 25, 98,109, +113,165, 22,215, 1,145, 37,248,175, 50,176,226,162,220, 2,242, 46, 0, 85,175,123, 92,124,113, 8,175,246,167,163, 81,105,243, +232,172, 83,123,195, 80, 81,136,100,206,140,149,123, 59, 42,108,221,101, 0,158, 13,193, 10,191, 24,107,154, 39,211,179, 62, 98, +171, 61,217,234,147, 50, 19,113,166, 9, 81, 62,184,125, 18,223, 41, 62, 29,140, 40, 0, 30, 70,244,216, 34,198,194,215,231, 21, +180,202,150,113,207,185, 46,187,159,117, 50,155, 75, 93,120, 84,125,154, 75, 51, 35, 22, 30,219, 98,178,226,118,169, 33, 92,133, + 11,112, 5,177,225,119, 92, 99,137, 98,229, 66,249,194, 26, 86, 89,108, 16,149, 39, 52, 64, 32, 3, 35,172,168,244, 32,131, 90, +192, 54,196,134,245, 80,231,203,220,126, 59, 84,165, 29,162,179,157, 37,164,211, 36,103, 8,213, 74,125, 45,135, 89,163, 38,147, +189, 14,177,188, 41, 42, 78,228,237, 82,146,171,220,223,173,176, 83, 50,106,109, 70,110, 69,246,106,189, 18,189, 61, 69, 59,166, +212,163, 70, 89, 67, 10, 74, 56, 5, 43, 23, 87, 66,110, 15, 56,170, 51, 5,114,153,151,178,100, 28,229, 71,166, 46,152,182,160, +247,110, 3, 45, 46,183, 53,221,228, 41,208, 57, 41, 72, 30, 18,159, 94,152,101,151,117,111, 85,116,204,210,243,213, 58,171, 93, + 48, 21, 23,116, 50,243,170, 44,186,146,181, 5, 49,226, 4, 4,216,146, 13,143, 76, 98,151,148,153,118,204,101, 82,165, 36, 19, +151, 57,214, 82,114,233,169,212,239, 36,201, 18, 42,201,184,116,146,151, 21, 49,175,220,235,211,253, 80, 93, 83,175, 80, 43,148, +202,100,246,171, 79,170,170, 95,113, 79, 73,147, 35,188, 88,109, 55,219,100, 44, 0,132,250,251,241, 9,118,167,147,100,231,236, +191, 5,186,100, 72,240,156,167,169,170,172,237,253,232,150,242,129, 55,241, 27, 54,111, 97,113,211, 19, 74,236, 45, 43,204,148, +243,171,114,115, 12,199,171,213,153, 74, 68,156,166,251, 41, 45,181, 31,175,122,183,146, 2, 72, 85,136,216, 44,160,122,140, 65, +159,127, 50,101,234, 42,170,121, 61,182,133, 40, 74, 72, 45, 38, 27,111, 6, 10, 93, 4, 5, 18, 9, 63,218, 49,176,211,134,226, +216, 40,102, 7, 84,247,164, 65, 51, 48, 72,239, 1,174, 83, 25, 76, 72,229, 84,110, 51,165, 65, 70, 57,125,255, 0, 21, 12,206, +236,192,161,231,167, 30,167,211,239, 1, 47,148,169,168,174,111, 78,192,124, 69, 39,161, 54,243,193, 9, 52,212, 85, 98, 57, 78, +203,153,114, 91,241,230, 29,237,191, 37, 73,178,135,152, 42,176,231,225,128, 25,174, 85, 66,187,155,101, 53, 22,162,153,174, 76, +120,237, 33, 1,161,117, 27,170,192, 88, 36, 98, 65, 91,107, 51, 35,234,252,181, 25,180,192,101,136,214, 90,158,116,144,108, 62, +246,235,241,242,199, 67,108, 22, 16,137, 58,199,143,251,172,155,135, 14, 96,158,181, 8,173,192,168, 64,205, 97,138,221, 65,104, +238, 89, 66, 10, 20, 73,238,145,183,132,220,121, 14,152, 19, 81,162,180,228,213, 41, 50, 74, 90, 54, 45,186,161,109,222,254,112, +253,202,133, 77, 83,228, 63, 49, 73,144,165, 44,253,178,145,126,240, 94,220, 95, 4,179,221,101,186,189, 42, 26,234,176, 82,194, +211, 15,187,105,104,103,104, 36,113,113,239,198,251,101,105, 82, 83,247,233, 78, 74,147, 21, 10,146,197, 53,169, 37, 13,186, 92, + 64, 28, 43,215, 12,247, 54, 93,224,112, 56, 73, 39, 14,123,174,228,141,200,186,135,204, 28, 35, 0, 74,146,148,199,240, 5,216, + 88,159, 60, 91,216, 81, 38,177, 97,148, 54,165, 39,119, 10, 28,115,231,140, 35,119,137,116,169,231,108, 45,212,244, 56,112,251, + 9,142,187, 44, 13,201, 22, 81, 9,190, 60,102, 34, 55, 1,191,105, 42,232,175, 63,199, 17, 42, 4, 26, 64,198,244,119, 79,232, +121,178,177, 91,139, 31, 40,211, 4,169,137,145,222, 71,107, 98, 84, 20, 71, 60,223,203, 7, 17,154, 51, 54,101,204, 50, 63, 78, +125,181,249,142,184, 33, 42, 96,117, 68, 52,145,225,238,236, 60, 33, 41,177, 60,122, 98, 57, 18,169, 42,137, 40, 61, 71,125,198, + 94, 74, 56,121,151, 8, 41,248, 17,211, 18,109, 47,145, 18,136,245, 95, 59,187,156,153,166,200,167, 68, 10,133, 78,168, 70, 83, +202,158,242,252, 42, 9, 9,225, 36, 3,123,156, 98, 93,153, 74,150, 82, 14,128, 39, 67,154, 73,218, 68,232, 76,114,142,102,138, +209, 10, 58,214,189, 75,203, 57,103, 45, 84, 24,202,217,103, 63, 46,174,203, 98,234, 40,220,150,219,227,158,166,196,220,158,152, +209, 55, 53,193,145, 71, 12,213,156,126, 93, 66, 34,144,212, 57, 1, 96, 33, 44,167,245, 72,235,123,224, 83,117, 38,228, 87,100, + 78,137, 7,218, 84,224, 82,128, 95, 39,158,164,113,199,174, 36, 82,165,229, 37,101,136,217, 85,134, 18,203,179, 89, 75,239,204, +124, 32,169, 47, 2, 65, 73, 87, 80,139,121,117, 56,174,232, 82, 16,218, 92,149, 30,103, 73,241, 38, 0,244,141,105, 19,222, 58, +208,248,212,250,166,106,138,149, 83,221, 43, 68, 84, 23, 28,218,139, 4, 14, 73,249, 97,145,125, 18, 59,214,100,192, 67,164, 89, + 69,192,162, 56, 30,152,243,235,105, 10,101, 81, 98,184, 99, 51,110,237,192,194,136, 74,199, 67,199,166, 20,168, 81,162, 5, 52, +196,207,104, 73,105, 37, 46, 52,155, 38,231,168,247,219, 4, 0,133, 65,247,127,186,132,211,102,234,221,197, 65, 82,105,189,226, + 66, 65, 66, 16,165, 27,218,214,228,140, 17,201,149,215,104,149,148,212, 83, 25,135,130,219, 83,110, 55, 36, 2,147,127,225,129, +208,227,197, 40, 91,100,157,233,191, 32,227,199, 42,204, 55, 72, 77, 61, 20,182,251,192,233, 90,228, 90,235, 80,242, 79,195, 4, + 91,105,113, 5, 25,100, 29, 41, 3, 38, 41,245, 86, 89, 18, 73,102,123,102,228,221, 3,144,142,122, 15,118, 22, 52, 26, 90, 90, +136,204,244, 62,202,196,144, 78,197, 40, 93, 22, 54,228,121, 97, 97, 32,164, 38, 5, 54,252,235,244, 4,138,226,212,129,189, 68, +143,142, 60, 53,164, 95,149,143,134, 0,170, 65, 41, 0,227, 36,184,139, 2, 18,111,240,199, 93,157, 6,181,187, 69, 81,165, 85, +151,212, 12,105,114,164,181,117,227,231,134, 40,148, 45,208,223, 26, 36, 62,226,142,219, 31,134, 28, 45, 0,210,237, 21, 79,213, + 81,109, 63,121, 64,159,121,195,103,170, 13, 40,155, 92,252, 48,201,196,168,244, 29,113,136, 66,211,200, 23, 24, 40,117, 2,163, +218,168,214,215,130, 22, 10,193,231,210,248,212,220,149,182, 8, 83,119, 7, 30,219,127,234,219, 25,182,197,207, 32, 96,130,225, + 49,173, 64,173, 70,180,148, 23, 15,221,235,132,220,115,188,120, 78, 8,181, 25, 9,111,114,128,233,198, 49, 43,101, 60, 20,243, +135,246,161, 76,115, 86,149, 37,101, 27, 74,113,225, 97, 42,176, 62, 88,112,151, 89, 80,177,242,194, 5,147,116,132,242,112,141, +204, 83,101,147, 94,196, 97,165,144, 22,143,158, 37,186,123,167,210, 51,198,102,135,150,233,226,206, 74,116, 37, 75,181,195,104, + 28,169, 71,220, 5,206, 35,176, 99, 3, 97,183,242,199, 71,246, 84,200,200,203,244, 55,115,213, 73,144, 31,158, 59,168,100,142, + 82,200, 62, 37,123,183, 40,126, 9,247,227, 7, 26,198, 69,149,170,150, 14,187, 15, 51,247, 53,209, 96, 88, 89,196, 47, 18,212, +105,185,242, 31,113,239,171, 45, 48,178,246,153,228,182,168,212,166, 80,196,104,108,109,109, 62,103,213, 71,212,147,201, 62,167, + 28, 17,218,239,180,114,178,222,116,114,161, 68,151,220,186,208, 41, 95, 60, 45, 55,199, 79,246,162,213, 70,168, 20,215, 34, 34, + 69,174,131,201, 54,191, 24,249,119,218,231, 80, 5, 65,217, 82,139,227,119, 54, 36,244,199,149, 1,237, 78,151, 23, 94,196,202, + 18,130, 26, 64,208, 81,124,229,219,133,198,225, 42, 68,138,178, 84, 92, 77,138, 66,185, 22,190, 36,189,135,187,104, 10,198,174, + 71,200, 83,218,113, 81,234, 69, 74,101,197,182,108, 8, 5, 71,159,128, 56,172, 59, 4,118, 33,153,218, 14,106,245, 27, 55, 37, +102,156, 28, 62,205, 29, 98,232, 85,143,222, 32,245,254, 24,238,173, 58,236,193,166,154,105, 57, 46, 82, 50,187, 6,111, 9,246, +197, 71, 1, 96,126,202,125, 6, 51,111,111,218, 65, 45, 33, 51,227, 91, 13,177,110,148,144,119,171,190,173, 86, 97, 40, 68,212, + 32,108, 45,141,188,242, 15,166, 34,249,141,166,102, 70, 11, 13, 2, 20,174,125,195, 27, 39, 10,155,174,166, 59,141,169, 13, 35, +165,241,141, 81, 14,189, 20, 50,219,106,233,123,218,216,204, 23, 5,102,161,216, 4,138,170,179,222, 71,167, 84,227,184,243,205, + 5, 1,250,160,117,248, 99,156,245, 67, 66,167, 55, 81,250,251, 44,188, 97,206, 97, 91,146,227, 55,230,254, 71,212,117, 24,236, +153,153, 82, 98,226,111,117,187, 19,200,184,233,136,126,101,201, 44,169,149, 20, 50, 3,150,176, 39,204,127,139,224,200,184, 90, + 12,138,100,247, 14,149,197,185,155, 87,123, 70,100, 58, 98, 96, 70,163,135,210, 31, 79,125, 33,181, 16, 74,111,211,242,196,151, +252,240,107, 41,163, 67,166,185,151,167,174, 90,152, 30,208, 67, 68,128,174, 46, 47,243, 56,188, 51, 62,155, 48,255, 0,136,198, + 79, 34,234, 5, 63, 60, 86, 85, 76,145, 14, 5, 68,165,112,209,181, 74, 85,136, 79,167, 24,184,151,210,238,138, 20, 23,123, 44, +191,166,171,250,198,168,235,126,164, 47,217, 40, 20,111, 96,101,107,186,221,148,191, 21,173,199, 3, 25,229,125, 6,172, 85,106, + 40,168,231,186,155,147,228, 15, 18, 19,127, 0,230,253, 15, 95, 60, 90,244, 44,174,195, 9, 74,216, 66, 74, 77,186, 11, 98, 91, + 73,164,178, 22,128,166, 64,177, 22, 22,233,137, 74, 83,176,170, 6,229, 64,194, 68, 83,125, 50,211,184,112, 16,218, 19, 28, 55, +182,214,176,227,225,139, 58, 27,113,154, 72, 96, 53,247, 71, 81,208,251,240, 30,156, 35,176,218, 16,221,129,231,129,135,162,162, +218, 89, 37,162, 55, 36, 92,223,207, 21,220, 84,212,115,147,169,162, 98, 91, 49,154, 44,128, 45,123,120,191, 86,231,174, 35, 57, +130, 91,114, 30, 83, 77,139, 42,223,115,204, 17,249, 28, 48,171,231, 72,241, 74,146,137,105, 74,174,119, 37,125, 71,248,254,220, + 65,234, 26,136,219,210,220,219,177,181, 33, 94, 27,168,157,255, 0, 3,239,235,248,140, 13, 25,137,210,160,165, 72,210,135,214, + 36, 51, 31, 51, 45,144,176, 89,125, 65, 91, 83,250,170,189,190, 68, 28, 62,206, 25, 53, 85,186, 97,125,182,183, 75,132,201,113, +178, 7, 46,178, 57, 82,125,229, 63,120,123,183,123,177, 90, 72,206,111,230,125, 85,133, 64,165, 74, 70,254,240,170, 69,141,236, +142,164,227,162,161, 68,238,163, 49, 46,201,220,201, 10, 70,255, 0, 81,229,243,199, 71,134, 98,175,225, 87,109,190,217,212,111, +226, 57,143,125,102,226,120,122, 47,173, 11, 46,127,144,244, 60,141, 81, 46, 48,211,104,251,159,150, 27,173, 37, 99,193,198, 36, +250,131,250, 35,150, 51, 36,186, 75,211, 59,189,170, 11,109,178,147,112,133, 13,201, 31,129, 31,134, 43,204,201,159,154,140,224, + 69, 10, 23,120, 55,114,167, 56,191,195, 30,255, 0, 97,114,253,243,105, 91, 73, 48,160, 8, 59, 8, 58,138,241,107,171, 53, 48, +225, 66,134,163, 74, 50,166,157,218, 0, 73,194, 76,119, 15,131,187, 39,229,136, 19,181,172,209, 46, 97,152,229, 77, 77,120,183, + 37,180,171,129,238,198,117,156,243, 83,141, 5, 18,235,117,116, 50,195,100, 37, 79, 18, 16,155,251,206, 54, 61,149,244,128, 74, +199,143,133, 80, 45,164, 81,108,241,169, 52,140,153, 29, 17, 2,183, 75,152,178,203, 14,119, 91,144,202,173,247,148,110, 2,109, +239,227, 20,222,104,207,191, 90,230,183,101, 81, 43,110,251,100,118, 86,185,110, 48,240,101,151, 72, 77,146, 85,180,144, 79, 91, +249, 98, 83,171,148,232,211, 50, 67, 53, 25,149, 30,230, 29, 65,149, 56,196,150,156, 27, 94, 74, 79,139,197,229,233,108, 80,250, +134, 36,100, 89,107,147, 22,169, 29,159,173, 90, 75,113, 88,109,226,151, 18,216, 23, 5, 68,113,110, 71,151, 56,243,254, 33,196, + 2,111, 74, 26,115, 48,210, 4,130, 9, 27,157, 54, 35, 95, 77,106,147,189,229,194,106, 91,157,181,169,186,195, 81,234,185,201, + 8,126, 93, 61,109,136, 44, 68,126,204, 62,155, 1,247,128, 27,194,108, 56, 81,228,223, 1,171,186,138,251,242,197, 99, 38,195, +139, 53,118, 73,101, 14, 52,148,119,124,221,104,176, 62, 43, 27,117, 29, 6, 42,204,227,171,213,217, 18, 34,156,217, 57,180, 34, + 46,198,196, 40, 76,160,178,173,167,196, 8, 28, 92,142,111,231,128, 79,235, 21,118, 38,104,118,175,149, 42,242, 35,133, 56,144, +195, 4, 13,170, 0,220, 11, 90,223, 44,114, 46, 91,190,240,152,235,164,156,190, 91,124,124,230,157, 13,168, 65, 21,211, 52, 14, +211,249,213,202,165, 62, 91, 79,184,229, 74, 52,221,242, 35, 52,148, 52,137, 77,109, 2,214, 30, 97, 93,108, 5,240, 7, 87,181, +134,179,168,217,114,117, 27, 52, 79, 69, 1,216,210,213, 38, 13, 54,151, 5, 45,176, 93,106,225, 8, 34,251,183, 16, 73, 36,245, + 38,254,236, 83,185, 87, 85, 42, 16,115, 23,233,149, 36,188,156,192,213,214,233,125,180,173,189,196,242, 80, 45,225,235,131, 82, +171,245, 92,231, 91,101,186, 29, 71,188,152, 86,153, 11,147, 33,178,224,113,194, 46,187,133, 2, 71, 34,194,216,231,157,193,173, +217,185, 14,150,194, 96,111,211, 89,233, 17,227,189, 17,181,184,209,128,116,160,209,115,115,243,171, 70,175, 85,141, 34,100,197, + 52, 1,106, 74, 18,150,155,112,171,239, 41, 32,120,147,205,252,177,117,230,246, 42, 85, 76,171, 66,113,170,188, 25,117, 74, 72, + 65,150,219, 79,160, 33, 76, 43,254,133, 45, 17,185,106, 74,175,207, 75, 30, 49, 42,103, 82,161,229,185, 3, 54, 61,165,244,204, +199, 58, 69, 48,194,146,163, 8,161, 47,149,182, 54,149, 35,187,178, 84,155, 17,112,160, 73,247, 98, 5,172,153,199, 45,200,250, +178, 69, 29,138,132, 88,136,111,186, 98,128,169,165,197,197,106,193, 72, 73,115,131,180, 40,168,132,158, 69,173,142,117,203,135, +241, 27,198,194, 89,200, 19, 58,200, 35,104, 34, 52, 32,116,208, 3,185,212, 69,107,182,180, 54,217, 42, 50, 85,203,235, 63,102, +174, 28,213,216,210,153,155,114,244,126,208,212,170,107, 52,140,144,136, 66, 85, 78,151, 73,134,250,222,109, 9,103,114,212, 23, +180,221, 74, 32,155,126,175,158, 57,142,191, 80,131, 5,229, 63,147,158,168, 69,164, 73,220,166, 67,227,196, 20,146, 64, 10, 35, +195,114, 15, 39, 10,177,171,217,234,185,148,166,101,214, 42,114,227,101,245,202, 71,181,180,196,162,134,156,178, 74,127,213,240, +147,113,235,207, 95, 92, 88,240, 53,142,145,150, 52, 18,177,151, 98,126,141, 74, 85,110,148,202, 11, 41,162, 44,189, 21, 64,217, + 73, 73, 36,132, 18, 44, 74,141,129,196,237, 89,198,112,230, 2, 46, 87,219, 12,193, 41, 3, 76,169, 39,252,143,122, 84, 38,100, +193,129,227, 82,125,198, 46, 18, 50,140,164,111,207,225, 84, 44, 20, 85,235, 21,118,106,180,250, 83,108, 49, 20, 0,167, 89, 98, +193, 69, 35,169, 87, 36,156, 25,143,153,163, 84,242,197, 82, 14,101,202,211,107, 21, 96,226,141, 49, 77,238, 37,171,141,160, 41, + 62, 96,117,195,120, 57,129, 89, 78, 42,226,161,245, 77, 74,144,151, 80,216, 77,144,207, 4,216, 15, 60, 11,211,125, 93,171,229, +156,229, 58,171, 5,113,132,137, 49,214, 90,121,203,168,161, 94, 93, 63,134, 61, 2,221,149, 56,201, 82, 83,182,218,145,241,223, +206,176, 30, 11, 83,164,129,176,210,163,241,164, 71,165, 58,137,242, 24,118, 91,160,125,213, 35,111,118,160,109,247,124,249,198, + 85,233,149, 60,208, 75,213, 23, 18,195,169,108, 37, 9, 91, 99,119,185, 33, 35,204,225,235, 21,154,115, 80,229,207,152,195,143, + 74,125,197,222,235, 0,110, 60,130,124,250,146,112, 1,218,180,212,213,217,205, 8,146,130,184,235, 14, 54,176,143, 14,244,249, + 88,227, 89, 9, 42, 92,198,163,157, 25, 18,121, 86,154,238, 89,169,211,167, 70,133, 50, 59,137,117,230,130,130, 29, 78,210, 1, +247,124, 48, 46,124, 87,104,242,148,195,142,165,197, 52,144, 72,108, 95,175,145,247,225,230, 96,205, 85,124,209, 93,127, 48,213, +230,151, 36,190,177,180,164,216, 39,208, 15, 64, 6, 53,212, 41,114,163, 33,151,152,116,189,223,179,189,224, 7, 32,131,208,226, +226, 51,165, 35, 62,245, 45, 6,149,141, 26,169, 17, 11, 9,148,194, 8, 31,168,180, 92, 43,240, 55,198,185,168, 83,210,148,234, +174,110, 60, 42, 95, 0,140, 52,121,185, 44, 52,169,139, 77,130,172, 16,147,140,102,167,189, 90, 7,181, 41, 86, 9,178,119, 92, + 36,122, 98, 61,152, 14,102, 6,167,148, 17, 68,160,178,167, 92, 75,109, 77, 12, 20, 90,202, 60,130,161,231,111, 76, 77, 50,158, +107,204,117,106,125, 70, 13, 90,147, 6, 98,149, 21,100,200,126, 56,222,158,121, 82, 79, 2,254,152,129,183, 41,168,219, 86,167, +210,164,130, 55, 18, 57,196,150,150,191,110, 75,139,118,162,150,132, 54, 2,217, 12, 54,119, 56,162,176,108, 79, 83, 97,126,125, +216,203,190,104, 45, 48,161,207,120,219,235, 83, 65, 32,105,181, 19,211,122,123,210, 42, 63, 85,192,161, 68,118,106, 17, 33, 64, +200,112,161, 91,123,191,214, 36,132,217, 61,112, 5, 80, 97, 46,166,204, 58,187,142, 71,109,197, 18,226,208,144,171,115,250,190, +184,123,154,227,192,138,243, 79, 71,125,215, 36, 58,119,169,237,214, 70,211,211,222, 77,186,225,180,202,178,106, 12,253, 97, 61, +246, 86,241, 33, 10, 64,107,144, 0,181,197,184,197,102,195,138, 89,112, 29, 20, 61,224,235,231,167,184, 82, 36,101,131, 91,102, +197,167, 83, 92, 67, 9, 67,142,176,234, 9, 38,195,112,183, 79,134, 7, 41,200,201, 64, 90,183,182, 66, 60, 40, 82,174, 15, 56, +213,237,136, 67,247,142,141,202,189,146,160, 60, 36, 99, 23, 18,165, 32,182,232, 38,234,244,233,139, 40, 68, 1, 52, 49,214,144, +146, 25,121,192,211,182,230,226,195,175,187, 30,169, 15, 73, 79,122, 88, 28, 30, 66, 7, 24,214,232, 97,106, 74, 80,141,170, 2, +202, 54,228,227, 89,144,252,119, 3, 33,106, 69,254,246, 11, 19,181, 32, 58, 83,134,228, 71,108,158,250, 34, 84, 79, 34,202, 32, + 15,195, 11, 26, 84, 86,159, 8,177, 3,162,135,159,227,133,133,150,165, 95,124, 18, 82, 19, 98,113,155,110,160,248, 65,195,103, + 92, 80, 79,217,245,195,115, 45,246,205,139,119,248, 99, 72, 61, 90,154,209,134,146,131,239,199,142,150,118,220,218,248, 31, 30, +107,202, 28, 2, 49,154,222, 90,147, 99,135, 15,107, 79, 91, 84,176, 85,100,140,109, 67, 74,219,113,134,173, 5,169, 64,129,135, +236,188, 80,139,144, 58, 98, 93,189, 54,245,165, 65, 77,248,146,156, 98,135,148,181,109, 32, 12, 57, 76,134,110,123,192, 57,243, +182, 52,173, 41,223,189, 39,174, 28, 63,165, 42,113,177,245,180, 2, 20, 45,140, 91,134, 28, 4,175,174, 54, 70, 89, 7, 97, 60, +123,241,181, 41, 78,238, 21,107,249, 97,195,230,149,107,106, 19, 97, 94, 35,135,208,232,241,220, 55, 42,231, 13, 28,108,245, 75, +167, 27, 97,214,105,176, 28, 9,149, 57, 0,223,161, 86, 34,167,148,161,165, 21,176, 38,164,249,103, 45, 57, 85,170, 69,163,196, +108, 41,217, 47,161,166,193,245, 81, 0, 99,175,162, 81,225, 80,168,140,211,162, 54, 18,212, 88,233,109,176, 5,172,148,139, 99, +157, 59, 44, 66,167,231, 45, 74, 68,182, 30, 11,106,149, 29, 82, 87,111,219, 62, 20, 15,196,223,250, 56,232,220,212,235,140,209, +222, 90, 20, 5,144,109,127,134, 56,110, 35,121, 75,112, 32,255, 0,136,248,159,227,231, 94,157,194, 86,221,157,186,158,255, 0, +145,143,112,254,126, 85,193, 95, 72, 22,175,183, 74,204, 78,210,146,224, 66, 91,108,146, 73,243,231, 31, 57,235, 53, 42,142,186, +107, 4, 13, 57,164,190, 84,153,179, 2, 93, 82,121,178, 47,226,233,238,197,235,244,170,234,101, 82,151,158,157,132,226,246,172, +173, 86, 32,158, 70, 43,255, 0,162,127, 79,191, 75,117, 93,121,242,174,201,117,109,174,204, 41,126, 66,252,156, 97,169, 65,139, + 18,191, 10,237,109,209, 29,227, 95, 82,123, 47,233, 13, 55, 78, 52,246,157,148,168,116,224,204,120,241,144,130, 66, 66,111, 97, +207, 76, 88,163, 43, 70,114,178,151,251,164,142,230,251, 82, 71,159,175,191, 30,229,217, 40,166,211, 99,134, 0,229, 33, 40, 3, +225,212,224,205, 49,166,101, 21,204,112,149, 39,160,231,169,199, 50, 16, 21,189, 31, 49,154,208,140,165, 30, 82,212,235,236, 2, + 2,120, 4,117,192, 89,249, 80, 9,214, 67, 62, 0,108, 13,188,177, 45,246,194, 18,160, 20,120, 79,136,250, 99, 38,154,105,230, +210,167, 5,129, 55, 36,224,201,105, 39,106,137,112,212, 42,171,151, 84,251, 69, 9,111,202,247,247, 98, 25,152,242,219, 33, 91, +144,130, 44, 69,238, 49,114, 79,134,197,192, 77,185, 24,139,102,106, 67, 15, 36,182,210, 7, 78,184, 75,106, 41, 5,205, 81,185, +142,130,132,143,190, 73, 4,237,182, 42,140,243,149, 31,106, 74,150,211, 36,165, 87, 36,132,244, 56,233, 26,222, 82,222, 75,138, +104,139, 90,226,216, 28,206, 70,137, 38,237,203,136,135, 15,150,225,239,192,194,148,131, 73, 64, 26,229,186,124,153,212,164,247, + 75,108,236, 42,227,118, 15,211,179, 76,107,165,123,188,188, 87,242,197,237,153,116, 46,131, 88,136, 82,136, 40,105,100,125,228, + 14,190,254, 49, 81,103, 78,207, 53,234, 83,170,145, 76,124, 4,146,109,212,131,243, 24, 50, 95, 10,208,213, 53,180, 38,104, 76, +188,255, 0, 10,150,164,205,117,207, 5,185,231,166, 34,217,199,180, 54, 87,202,209,213, 58,101, 73, 40, 67,104,186,146, 85,107, +240,113,167, 49,100, 90,194, 89, 93, 50,176,167,154, 31,180,132, 94,216,175,243,231,102, 12,147,159, 40,174,194,168,230, 10,138, + 92, 82, 78,199, 18,177,180, 18, 45,202, 72,228,124,240,100,165, 11, 58,154, 9,109, 3,122,168, 53,123,233, 29,200, 82,115, 7, +213, 84,170,170, 59,192, 44, 86,211,128,139,252,127,199, 76, 4,157,218,226, 10,178,212,138,233,168, 13,193, 35,109,149,231,238, +197, 11,218, 87,232,240,173,100,137, 18,106, 57, 97,197,119,141,149, 45,167, 24, 55, 75,131,202,227,203, 20, 29, 23, 50,102,104, +213,182, 50, 77,121,110,180, 34,175,237,144,229,193, 42,191,191, 27, 76,217,219, 45, 18,131, 68, 75,109,146, 2,107,233, 39, 97, +202,157, 71, 61,103,247,179,117, 90, 74,139,210,212, 44, 9,224, 38,252, 12,125, 14,166,101,216, 83, 40, 73,109,230,183, 2,221, +186,242, 14, 62,108,118, 17,205, 52,138, 34, 99, 44, 73, 78,241,107,221, 88,250, 65,167,249,149,170,206, 88, 75,241,222, 71, 40, +227,156, 83,187, 64, 66,166,165,114,137, 85,115,239,105,140,166, 96,203,143, 90, 66, 74,182, 44,197,117, 68,116, 31,121, 31,255, + 0,223,225,138, 82,169, 83,102, 58,131, 65, 60,164,243,198, 58,163,180, 62, 95, 85, 75, 34, 86, 94, 39,114,208,199,180,182, 71, +146,155, 59,143,254, 29,195,231,142, 60,171, 73,113, 74, 42, 32,254, 56,246,207,195,220, 80,221, 96,129,181,157, 91, 37, 62,237, +199,206, 61,213,228,220, 95,109,216,222, 21, 39,101, 9,250, 26,242,181, 95,150,212, 71,156,167, 52,151, 30, 66, 9, 66, 86, 72, + 73, 62,134,216,172,115,150,166,212,162, 68,151, 84,175, 81, 94,110, 68,196, 37,142,237,230,202,153, 27, 9, 37, 73, 79, 4, 30, +150, 55,196,240,200,108, 33,196,189, 40, 48,165,167,107, 78,168,139, 5, 30, 1, 55,242,197, 3,173,217,199, 53,185, 85, 93, 55, + 53,203, 87,176,174,120, 67,107,142,187,157,169, 54, 33, 32, 14,120,243, 54,224,226,231, 22,222, 30,213,150,208,173,119, 35,156, +120,107, 63, 10,243,181, 41, 69,200,161,217,147, 88,133, 90,165, 22,161, 62, 67, 82, 66,157, 87,181, 37,194,164,161, 32,253,209, +215,143,144,196, 27, 54,103, 52,212,179, 10, 32,228,254,253, 81, 98,190,146,135,101,184, 28, 40, 81, 54,224,244, 9, 23, 56, 0, +227,175, 84,234,210, 98, 80, 19,222, 52, 73, 61,242,135,250,180,223,239, 40,227, 84,121,141, 46, 67, 52, 90,105,105,233, 5, 14, + 50,235,155, 64, 66,145,215,117,250,252,206, 57, 5, 50,216, 94, 97,200,109,203,204,138, 32, 17,189,105,206, 76, 86,105,149,121, + 16,106, 50, 91,124,153, 1,199, 8, 63,126,227,239, 15,136,195, 33, 80, 74,101, 7,169,112,144,206,199,183, 54,227,203,185, 2, +221, 44,122,227, 10,173,106,171, 37,210,197, 90,167,223, 45, 36, 14,249, 70,228,132,139, 36, 3,134,238, 60,138,131,237, 56,251, +235,117,222,236, 39,104, 79, 34,221, 6, 44,161, 10, 8, 25,190, 31,181, 19, 97, 82, 90, 62, 98,118,146,234, 42,237,168,185, 57, +213, 41, 47, 5,178,149,164, 3,199, 3,167, 79, 60, 78, 52,243, 86, 98,228, 28,215, 25,117,154, 74,102,182, 92,188,202, 89, 81, +108, 57, 96,118, 89, 96, 18,142, 77,205,177, 87, 55, 30, 85, 61,148,189, 37, 14, 32, 63,101, 52, 28, 28, 56, 1,183, 24,119, 53, +232,205,253,139,144, 18,195,171, 59,131,197,100,169, 28,117,248, 28, 81,185,179, 98,229, 5, 10, 18, 21,161,143,223,195,195, 95, +125, 50, 66,115, 2,107,171, 52,255, 0, 56,208,181, 43, 42,230, 35, 42, 27,240, 36,193,166, 38, 67, 34,139, 60,166,239, 38,224, + 40,169,125, 13,143, 33, 35,155, 98,130,204, 83,164,199,169,119,146, 61,161,228, 62,162, 91, 15,187,117,130,129,107,159, 76, 76, + 59, 49,103, 28,165,149,232,253,204, 53,207,159,152,171, 51, 87, 13,218,100, 20,173,197,187, 29, 73, 1, 41, 74,109,109,197, 64, +243,215,156, 70,179,116, 7,224, 87,133, 26,144,219,177, 37, 68, 46, 9, 48,234,119, 75,169, 5,118, 41, 36,142, 77,186,244,199, + 41,103,108,139, 44, 77,246,146,146, 19,164, 79,128,131,227, 18, 52, 60,234,202,130,202, 1, 53,141, 71, 86,235,245, 13, 51,119, + 79,229, 80, 34, 72, 92,185,205,201,102,112,140, 59,230, 66, 83,183,186, 73, 3,145,107, 30,122, 99, 86,155,211, 34,215,243, 58, +242,206,116,206,239, 81, 32,119, 46, 59, 49,231,221, 32, 47,106, 10,146,132,167,204,146, 0,249,227,201, 58,137,153, 32,229,137, +121, 38,116, 22, 26,129, 6, 75,146,226,176,203,105, 14, 54,234,194, 65, 59,199, 42, 22, 0, 88,241,136,254, 72,143, 64,172, 86, +157,123, 55,230, 39,152, 74,226, 56,228,101, 50,144,187,189,111, 10, 77,250, 11,227, 89, 22,197, 54,206, 20,167, 40, 36,153, 79, +120,201,136, 32, 68, 76, 70,145, 30,117, 2,224, 10, 4,235, 20,103, 48,189,151,162, 56,183,232,208,101, 54,210,216, 75, 41, 47, +202, 82,146, 8, 79,137, 87,176,224,245,182, 33,117, 26,220,202,123,171,102,152, 80,193, 86,221,239, 54,208, 77,254,125,113, 53, +212,221, 82,250,206,143, 14,139,246,114,166,180,210, 90, 91,169,100, 4,144, 60,207,169,247,224, 70, 85,202, 21,156,226,227, 20, +184,148,180, 42, 82,157, 50, 95,108,172, 33,146,218,121, 36,147,202, 79,187, 27, 86, 89,154,182, 10,120, 71,190,118,231,173, 82, +209, 78,102, 35, 66,126,244,167,153,118, 13, 6,165, 78,110,165, 90,106, 66,218, 80, 82,229, 37,166,236, 60, 41,234, 23,215,175, +150, 34,198,159, 76,153, 86,146,234, 22,182, 41,233,116,169,134, 86,225, 42, 0,249, 15,126, 39, 85,156,221, 26,139, 5,170,108, +152,205, 41,232,237,173,167,162, 60, 54,128, 73, 62, 99,175, 30,126,150,196, 26, 6,232,147,193,147, 75, 43, 90,212, 20, 90, 43, + 54,219,212,117,197,150, 84,225,149, 29,170, 72, 38, 14,148, 50,178, 96,247, 63,232,234, 81, 83,103,107, 91, 71, 84,223,207, 13, + 24,148,243, 55,116,173,101, 70,192, 29,223,150, 12, 76,204,176, 21, 87, 77, 68, 83,118, 36, 44,253,154,146, 10, 71, 63,158, 7, +165, 44, 86,230,174, 82, 2, 89, 74,150, 73, 64,224,127,203, 23, 18, 76, 65, 21, 48, 97, 18,170,104,245, 65,201, 50, 91,135, 32, +168,161, 3,129,233,135, 48, 41,205, 79,121,123,165, 37,180, 52,130,165, 95,175,252,241,166, 74, 34,179, 45, 33, 14, 11, 35,130, + 71, 63,158, 55,144,204,231, 54,197, 65, 66, 71, 0,250,252,113, 56,210, 5, 72,157, 1, 20,215,216, 86, 77,203, 68, 11, 92,110, +243,193,106, 67,203,109,132, 53,223, 44,247,135,196,216, 62, 86,195, 25, 15, 73,105,105,142,165, 37,192, 63, 88,224,166, 89,130, +135,106, 42,113, 18, 2, 31, 67,101,109,146, 69,130,188,135, 60, 96, 55, 25,123, 35,152, 84, 65, 82,168,189, 82,135, 71, 98,128, +205, 65,154,254,233,189,250,154,122, 10,199, 45,128, 1, 11,191, 75, 27,241,134,213, 38,196, 42,108,120, 14,198, 71,122,237,156, +222, 62,240, 7,248, 99,115,244, 73, 10, 79,183, 73,144,137, 33,165, 5,204,109,147,226, 72, 39,145,126,151,198, 53, 71,161, 73, +105,153,180,182, 92,108, 51,116,173,185, 11, 11, 80, 87,175, 30, 94,151,198, 48, 10, 4, 2, 73,223,253, 84,212, 58,208,205,136, +108,142,233,219,146,121, 27,120, 24,245,101,217, 9, 41, 90, 9, 67,100,155,140, 99, 34, 90, 86,164,219,106, 72, 59,137, 2,192, +227, 36, 47,236,133,150,157,132,216,131,231,131,193,208,212, 34,176,125,108,200,123,116, 82, 85, 96, 62,208,139, 99,214,152,126, +165, 32, 54,235,130,233, 22, 42, 35,128, 6, 60, 40,142, 92, 0, 46,197, 43,229, 32,240,172,122,118,180,217,117,167, 10, 73,242, + 39, 14, 34, 52,166,242,172, 95,138,236, 98, 17,183,120,230,196,116,194,199,175,187, 53,253,174, 5, 41, 64,142, 61,216, 88,112, + 9, 26,211,129, 59,215,222,133,160,116,183,192,227, 7, 88,109,164, 23, 29, 33, 32, 14, 73, 54, 24, 1, 35, 62,197, 65,238,225, +166,228,126,178,207, 24, 17, 93,206,202,157, 31,186,151, 52, 37, 54,251,169, 56, 51, 77, 58,225,147,165,108, 41,104, 21, 42,118, +185, 69,142,157,202,158,221,189,199, 26,151,156,178,252,116,243, 43,125,255, 0,100, 19,138,210,110,108,165,199, 77,155, 37,103, +225,134, 74,207,109,183,254,170, 24, 54,243, 81,197,244, 90,181,204,154, 1,185,108,115,171, 78, 70,160,210, 35, 35,236,153,113, + 68,244, 1, 56,213,254, 82, 89,232, 32, 47,111,157,200,197, 84,189, 69,125,213,109, 48, 17,199, 78,112,157,206,245, 71, 99,146, +220, 68,158, 46, 16,130, 46,127, 28, 28, 91,218,164, 73, 31, 31,218,135,237, 41, 39,122,182, 85,168, 84,194,222,229, 68, 88, 62, +151, 24,103,254, 83,227, 37,106, 2, 26,133,135,135,197,138,121,204,253, 81, 96, 31,104,161, 79, 9, 79, 59,144,218, 23,255, 0, +149, 68,225,130,181, 70,141, 29,219,212, 38, 59, 20, 19,255, 0,230,163, 56,223,254,100,219, 21, 13,230, 14,209,135, 9, 79,254, +193, 73, 30,164, 1, 70, 5,213,254,145, 62, 80,126, 85,112, 77,213, 74,177,144, 76,100,165, 40,253, 91,142,113,169,237, 80,204, + 13,186,151, 28,112, 4,249,157,188, 28, 86,172,230,216, 53, 56,201,149, 76,170, 50,251, 87,251,232,117, 38,223, 27, 30, 48,247, +235,135, 37,199,238,128, 42,191, 4,223,140,104, 91, 92, 97,151, 8,150, 74, 84, 58,130, 15,202,128,183,150,131, 10, 4,121,233, + 86, 20,189, 82,168, 84, 91, 12, 53, 37, 45,122,148,117, 56,211, 18,107,210, 93,246,146,249, 81,189,202,148,122,226, 15, 78, 88, + 74,202, 74,130,138,122, 39, 4, 35,212,100, 70, 89, 13,189,183,220, 85,130,149,180,210, 97,177, 20, 86, 31, 5, 90,215,104,118, + 23, 90, 40, 57,103, 51,102,231, 85,114,167,163,199, 73,183, 64,148,173, 71,255, 0, 50,127, 12, 93, 84,188,239, 19, 82,154,151, + 69,166, 76, 5,214,152, 61,227,105, 62, 36,121,115,142,113,250, 63,106,207,102,124,183,154,242,111,127,185,230,203, 50,219, 27, +248,177, 74,144,120,254,138,121,247,140, 68, 50,127,105, 76,187,160,125,190,104,121, 75, 57,102,182,160,192,204,201,126,145, 43, +190,115,107, 73,121, 99,115, 4,223,128, 75,168, 66, 1,253,252,121, 78, 56, 22,238, 46,232, 81,233,242, 21,237,156, 52, 59, 76, + 29,162,216,210, 20, 79,169,174, 43,250,106,114,190,101,201,154,181, 22,155, 83,167,188,148, 78, 22,130,242,191,233, 73, 60,255, + 0, 28, 90,127, 70, 70, 69,141,146,114,244, 55,222,103,106,157, 66, 74,183,121,252,126,126, 88, 61,244,226,234,134, 66,213, 45, + 98,200, 26,117,150,100, 49, 50,100, 25,170, 84,162,139, 29,169, 35,147,238,227, 19, 30,204,121, 89,202, 60, 42,122, 91, 99,104, + 75,105,238,211,253,167, 24, 23,206, 43,217,146,217,241,248, 87, 88, 16, 17,110,146, 57,138,235,250, 82, 36, 79, 97,168,105, 85, +137, 64, 82,173,250,160,255, 0,105,196,178,154,180, 65,166,247, 41,229, 73, 0,148,143, 35,255, 0,166, 35,121, 46, 9,135, 74, + 75,238, 40,169,210, 55, 40,129,212,225,231,214,114,153, 75,151,178, 9, 38,254,240, 7,247,155,124,177,148,141, 53,161,196,211, +242,239,217, 45,197,147,181, 75,218,148,250,171,251,186,124,177,154,107, 46, 46, 64, 66, 82,118,169, 55, 79,160, 31,250, 96, 68, +117, 41,180,163,189,112,128, 65, 54,247,242, 79,231,252, 48,150,243,137,152, 81,187,192, 81,199, 62,255, 0,241,242, 24, 42, 73, + 21, 21, 38,164, 11,148,135, 93, 66, 10,186, 42,235, 3,211, 26,100, 64,109,229,149,173,119, 28,222,222,120, 98,204,150,131, 42, + 82, 85,101,110,181,201,231,211, 27,162,206, 47, 39,126,240, 8, 77,138,125, 71,248, 56, 62,244, 19,165,123, 46,145, 13,240,119, + 4,220,164, 31,143,150, 2,202,162, 68, 74,238,194,236,177,247,110, 60,198, 11, 84, 36,164, 54, 16,218, 73,219,192, 62,183,192, +105, 47, 75, 65,178, 1, 38,247, 77,252,199,248, 24, 18,210, 41,130,141,122,105,200, 82,182,223,109,250, 17,208,224, 70, 98,163, +181, 37,155,150, 47,197,207,195,142,127, 60, 60,118,180,224, 90, 83, 99,110, 6, 48,155, 82, 67,129, 71,146, 59,176,109,233,205, +184,255, 0, 30,120,174,164,138, 98, 77, 86, 89,195, 79, 41,149, 52, 21,119, 99,113,253,145,249,226,171,205,122,116,220, 69,151, + 98, 36,236, 60, 41, 39,130, 49,122,212, 81,181,213,150,200, 62, 3, 97,208, 30,132, 15,195, 16,188,201, 79, 76,179,185, 23, 73, + 43,186,146, 71, 55,194, 74,202,104,106, 73, 21,205, 58,145,167,136,171,196, 91,111,178, 28, 83, 98,224,148,139,145,142, 5,237, +223,217, 97, 48, 0,212,108,151, 5, 41,148,194,183, 73,105, 8,218, 86,159, 95,126, 62,168,102, 90, 25,246,142,245,230,124, 38, +233, 38,216,231,222,213, 26,125, 79,149,150, 36,134,216,220,219,141,168,157,162,246, 62,124, 99, 66,210,233, 77,184, 40, 0,148, + 56, 43,231,135,101,141, 74,206, 7, 53,192,203,212,152,111, 59, 33,249, 9,101, 40, 23,240,171,223,242, 4,227,236, 7,103,154, + 6,111,143,146, 98,190,165, 45,205,232, 73,115,113, 54, 28, 99,132,187, 57,233,214,159,229,101,202,212,152,112, 91,250,196,202, + 67, 11,105, 35,194,135,124, 72, 82,199,165,193,231, 31, 78, 52, 86,167, 79, 99, 79,225, 71, 90, 82, 10,217, 77,250,115,141, 92, + 73, 33, 9, 19,204, 77, 90, 85,218, 46, 26,238,141, 1,143,120,222,133,103,108,143, 55, 48,229,154,133, 53,164,164, 25,112,156, + 97, 97,195,192,220,130, 1,249, 95, 28, 89, 95,201, 79, 83, 38, 72,164,213, 99, 41,153, 81,158, 83, 78,180,161,202, 22,147, 98, + 15,204, 99,232, 69,108,173,112,156,114, 42, 82, 8, 73,181,186,142, 49,203,221,164, 50,174,236,228,222, 98, 75, 59, 5, 78, 26, + 29,119,142, 3,168,187,106, 31, 31, 10, 85,253, 44,110,240, 54, 42,171, 43,183, 45,142,203, 18, 60,199,238, 15,194,184, 94, 47, +180,237, 45, 82,240,229,161,247,215, 53,215,242,228,165,176,166,225,190,211, 42, 1, 65, 75,121,146,180, 90,199,168, 24,231, 61, + 75,165, 86,178,188,202,109, 50,107,205,151, 17, 45,247, 30,158,166, 13,137, 88,183, 59,143, 64, 58,116,199,105,185, 69,136,131, +222, 22, 46, 71,222, 39,207, 20,102,163,232,190, 96,207,122,160,254,100,173,102, 24, 52, 26,124, 36,129, 17,199, 0,219, 45,195, +205,246,168,216,128, 56, 56,238,113, 21, 46,230,237, 47, 3,202, 62, 62,127,126,117,228, 14,167, 35,132,215, 31,102, 74, 36,156, +185, 84,117,168, 78,200,246, 85,183,117, 58,131,179,191, 77,249,189,141,173,124, 70,189,161, 13, 2,211, 44,109,113, 64,169, 42, + 72, 36,252, 49,122,234,146,114,116,248,177,233,180,202,205, 94,125,105,117, 37,178,166,123,166,187,182, 82,147,202,146, 17,112, + 71,165,177, 89, 87,116,231, 51, 51, 41, 21, 84, 83,228,169, 51, 36, 45,184,138,238,172,167, 20,155, 92, 91,200,220,129,108, 80, + 73,239,229, 84, 79,133, 32, 73,222,161,142,190,244,167, 18,154,139,197, 62, 45,167,195,200,249, 96,163, 80,169, 44, 5,191, 46, + 75,173,108, 82,123,151,218, 69,195,128,245,227,215, 5,149,166,121,214, 45,124, 82,235, 25, 86, 75, 18, 86,210,221, 66,100,178, +164,168,132,125,227,207,150, 6,102, 16,168,211, 59,182, 75,110,134,145, 98,155,147, 98,121,183, 56,117,171,191,217,141, 13, 74, + 53,167,117,153,205,183, 78,142,218,165, 53, 35, 99, 87,104,164, 2, 81,126,108,125, 14, 26,211, 87, 18, 83,241,154,170,201, 10, + 27, 73, 66,130,249, 4,115,180,131,208, 96, 76,185, 33,243,100, 32, 33, 55,184, 9, 77,185,195,116,133, 23,118,145,201,251,202, + 35, 14,150, 97, 17, 76, 0,169, 94, 94,212, 90,198, 71,206,148,253, 69,200, 18,157,164,213,105,146, 68,136,210, 26, 0,247, 46, +164,248, 84,159, 95,158, 10,215,243,146,243, 93, 97,252,201, 93,175, 72,169, 84,234, 14, 45,249,210,221,241, 5,188,165, 92,145, +233,114,121,242,196, 93, 8,250,213,164,164, 72,101,164, 52,217, 13,128, 45,127, 91,251,206, 8, 80, 87, 10,147, 14,124,248,181, +178,196,164,178, 26,138,193,104, 47,190, 10, 62, 62,122, 38,195,155,226,155,214,236, 21,118,153,123,241, 19, 26,196,232, 9,130, + 98, 76,244,169,133, 40,140,147,166,241, 69, 43,148,135, 41,200,122,167, 62, 4,148, 68,125, 33, 13, 56,187, 0,181,128, 55, 15, +126, 6, 64,147, 34,178,228, 74, 20, 42,115, 97,132, 57,119, 20,148,128,181,124, 84,113, 44,152,186,141,107, 35, 50,128,200,126, + 59, 33, 43,222,183,145,126,241, 66,220, 39,175,145,190, 35, 48,209, 62,159, 57,168,174,159,101,113,247, 64,113,125,209, 61,218, + 79,159,248,244,197, 75, 87, 2,129, 74,247, 7,236,199, 88,168,168, 40,123,233,246,113,203,244,230,150,167,163, 59, 29,178,174, + 27, 75, 46,216,182,125, 0, 29,109,235,124, 22,127, 32, 79,211, 76,143, 75,207,159,167, 48,220,145, 85, 74,156,106, 27, 51, 20, +167, 22,216, 54, 37, 86,233,200,192,106,174, 88,168, 68,188,134,148,212,158, 77,223,125, 86, 7,211,143,236,195, 42, 84, 90,203, + 85, 52,178,150,151, 44, 52,217, 82, 80,163, 96, 7, 82, 7,160,185,232, 49,120, 5, 20, 36, 37,122, 13,199, 81, 27,107,181, 85, + 74,199, 51, 52, 90,129, 84,163, 84,107, 42,174, 86, 98,185, 61,106,142,160, 33,184, 47,117,219,142,189,121, 3,156,110,205,175, +201,162, 67, 92,106,221, 25,136,239,203, 9, 89,104,248,150,150,252,128, 61, 83,133, 46,148,213, 78, 68,156,216,167, 18,195,251, + 82, 91,110, 51,170, 42, 10, 64, 0,248,109,243,198,221, 64,166,211, 95,153, 26,213,223,107, 15,193, 75,178, 31, 82,247, 20,168, +139,169, 55,247, 98, 0,161, 79, 36,107,254,185,116,169,133, 2, 65, 53, 14,147, 72,159, 83, 97,152,204, 48,211, 45, 62,225,238, +155, 39,197,111, 83,129, 18, 97, 75,129, 37,232,137, 28, 50,238,197,173, 61, 47,141,239,212, 89,106, 74, 95,109,107, 10, 71, 9, +178,188,177,140,228,203,106, 34,101,186,224,216,242,238,132,222,231,226, 78, 53, 83, 41, 0, 26, 40, 6,105,155,173,169, 82, 59, +215, 5,211,182,201,240,245,198,106,146,210,135,119,221,148,219,165,188,241,140,137,110,188,208, 42,176,183, 66, 6, 28,195,167, +206,159, 24,187, 26, 22,244,180, 46,183, 18,159,227,130, 72, 9,214,156,137,222,180, 70,142, 92,187,129, 28, 36,254,177,196,129, +182, 24,131, 26, 43,143, 76,142,181, 60,218,183,178, 21,114, 44,122, 31, 75,249, 96,101, 62, 89,100, 41, 47, 71, 75,137, 64,181, +239,107, 99, 20, 70,113,217, 65,104, 41,228,240, 48, 23, 91, 14, 1, 38, 34,155,157, 29,149, 82,159, 1, 70, 51,108,134, 91,113, + 32, 41,144,139,113,234,125,113,167,184,168, 46, 83,197,148,149,221, 55, 83,205,167,129,111, 92, 74,178, 59,143,214,159,114, 21, + 94,156,218,155,109,176, 27,113, 45,220, 36,142,130,248, 47,155,227,198,161,229, 89,146, 91,117, 8,121, 77,132,161, 8, 29,111, +199, 54,198,113, 25, 87,144,243,171, 9,100, 45, 19, 58, 85, 80,219,193,234,139,155,200, 45,129,194,136,234,172,123, 21,165, 56, +234,164,164, 42,200, 54, 0, 14, 62, 56,117, 68,160,206,173, 84, 5, 42, 21,183,184,119,169, 71,162, 0, 29, 78, 44,225,146,242, +181, 50,145, 14, 19, 81, 18,234,146,208,246,130,127, 89, 64,245, 54,197,171,149,165,158,232,220,252,133, 76, 50, 84, 12, 85,117, +236, 14,161, 77,161, 13,133,184,234,119,162,223,171,140,156,165, 78,105,210,135,226, 56, 10,147,100,133, 39,239,122,226,197,110, + 5, 50, 34,201,131, 5,182,193, 60,109, 78, 54,132,180,124, 75,108, 18, 58, 92, 98,158,106,113,102, 72,212,213,109, 31, 47, 86, +228,183,185, 20,167,200, 73,176, 41, 73,182, 22, 45, 86,234,157,218, 2, 26,109, 40, 0, 90,216, 88, 89,141, 55,178, 87,120, 74, +205,245, 7,220, 42, 18, 73,255, 0,186,113,168,102, 74,155,128, 36,185,193,243, 87, 39, 1, 90,153, 21, 0, 4,188, 15,173,177, +227,213, 20, 35,150, 8, 87,187, 20,198, 42,122,208,202, 84, 78,180,117,202,155,202, 3,188,108, 47,225,143, 10,150,225,222,109, +107,116,190, 34,210, 43,147,158,119,186, 15,108, 3,211, 27,169,245, 69,135,131,110, 73, 61,122,238,195,255, 0, 85, 81,231, 76, + 90,169, 35,106,108, 14, 16, 65, 62,252, 63,140,195,201, 72,115,189, 0, 31, 34, 48, 9,117,136,233, 64, 6, 66, 2,190, 56,115, + 22,190,157,157,216,150,149, 31, 44, 72, 98,167,173, 67,178, 85, 61,157, 46, 83,107, 44, 54, 81,201,228,225,187,178, 93,238,130, + 93,109,178, 45,201, 24,208,228,182,220, 89, 90,228,139,249,219, 26, 93,155, 21,209,221,170, 82, 82, 60,201,243,194,254,168,122, +212,131, 74,161, 18,242,172, 55,220,222,205, 85, 37,245, 3,117, 46,158,208, 81,254,147, 97, 7,243,192,153,185, 75, 62, 80,214, +101,229,188,222,219, 4, 31, 11, 0,184,132, 31,136, 81, 93,240,126,106, 91, 72, 11,140,232,189,248, 82,112,218, 84,151, 35,160, +185, 33, 69, 64, 12, 99,220, 49, 97,114,231,104,160, 66,191,228, 20,160,125, 65,173, 6,238,174, 91, 25,100, 17,208,128, 71,202, +163,208,245, 83, 86,242,164,133,126,152,100,197,205,140, 15,138,109, 25,192,234,237,234, 81,193,249, 1,137,142, 71,212,204,187, +158, 35,125,107, 66,172,123, 82, 18, 74, 94,106,246,117,149, 14,169, 90, 15,137, 4,122, 16, 49, 17,151,154,107, 81,147,186,117, + 1,192,215,253,172, 69,119,192, 15,120,176, 87,224,147,138,179, 90,105, 75,101,214,181,179, 78, 29, 68,153,148,213, 3, 90,131, + 29,194, 61,173,129,215,112, 22, 41, 90, 71,159, 6,223, 12, 48,196, 46,236,209, 13,186, 86, 7, 37,239, 30, 6, 36,251,230,175, + 91, 50,197,211,161, 43, 72, 65, 59, 20,237, 61, 8,157, 39,204, 87,210,207,163, 79, 81, 90,164,246,137,107, 47, 45,219, 53, 92, +165, 72,140, 82,163,213, 73, 1,224,127, 6,213,248,227,147,191,246,131,178, 84,236,155,218, 46,157, 92,131, 47,187,102,124,112, +182,123,187,164,165, 96,142, 65, 30,125, 57,192,158,206,125,160,235, 57, 82,169,150,245,223, 79,234, 79, 86, 32, 65,148,220,165, +193,121, 64,201, 66, 82,126,213,180,175,245,141,183, 36,165,119, 39,201, 94,189, 19,244,175,234,127,102,126,213, 61,140,227,235, +118, 94,170, 70,126, 99, 45,247,108, 9, 22, 76,168,210, 44,146, 90, 82,111,112,121, 4, 90,224,130, 8, 36, 27,227, 62,238,239, +182,188, 75,132, 65, 35,215,148,131,233,227,225, 94,169,193, 47, 54,219, 10,181, 90,181, 4,253, 57,121,131,235, 92, 69,217, 6, +177, 35, 84, 43, 52,199,115,101, 69,201,213,120, 85, 5,162, 93, 74, 99,170,117,231,208,162, 11,119, 82,142,226, 5,202, 64,253, +209,143,171, 58, 67,148, 35,195,163, 68,120, 55,100,132,166,192,117, 60, 99,228,119, 96,198, 51, 34,243, 58,115, 57,165, 41,186, + 96,144,129,237, 36,125,247, 18,187, 41, 35,224, 47,248,227,236,206,146, 71, 46,229, 88,178,100, 55,117,184,128,160, 1,232, 63, +199,246, 99, 3, 19, 90,149,113,173,118,174,165,164,136, 65,145, 39,215,152,251,218,173,186, 27, 40,137, 73,109,231, 0, 46, 41, + 60,143, 33,128, 85,137,143,174, 73, 74, 65, 9, 11,220, 5,250,129,198, 11,135,123,154, 32,104, 95,114,128,221,207, 75,249, 98, +136,237, 99,219, 63, 74,123, 45, 51, 24,102,197,189, 54,171, 53,189,208,168,144, 10,123,231, 91,185, 29,226,137,225,180, 94,227, +113,228,155,216, 27, 27, 80, 89, 9, 76,157,170,186,119,171,122, 60,197, 4,134,158,112,130, 60, 74,191,190,220,127,143, 92, 60, +155, 37,144,165,168, 44, 88, 40,238,248, 94,223,192,226,171,236,255, 0,218, 2,141,218, 15, 77, 98,106, 93, 23, 44,212,233,113, +229, 60,164,180,221, 77, 8, 29,226,145,194,138, 10, 84,119,160, 16, 70,238, 57, 7,142, 49, 42,118,169, 32,151,157,144,191, 9, +225, 34,255, 0,158, 36,217, 4, 72,169, 17, 52,112,214,246, 18,202, 5,238,120, 56, 33, 18, 91,109,181,202,252, 69, 94,103,204, +226,191,126,182, 98,200, 8,239,137, 34,219,121,242,191,252,176,110,145,152, 91,148,195, 78,184,176, 9, 80,243,255, 0, 30, 95, +199, 22, 6,212, 23, 4, 84,183,218,146,225, 1, 32,237,185, 10, 31, 44,104,144,250, 67,104,104,172,110,185,177,243,245,192,216, +245, 87, 18,210,214,165, 88,155,113,124,107,122,115, 74, 90, 93,109,193,193,228,124, 78, 25, 91, 80, 57,214, 82,210,203,129, 86, + 90, 66,135, 33, 94,184, 17, 84,144,228,111,181, 74,128, 3,238,223,204, 28,108,149, 37,198, 31, 89,255, 0,229,128,111,234, 48, + 2,173, 92, 82,201, 97,103,128, 15,248,255, 0, 30,184,170,179, 72, 26,206, 92,230,221, 66,143, 4, 3, 96, 61, 48, 10,175, 25, + 9, 33, 65, 87,241,121,244,198, 78,213,152,103,113,121,206, 58,159,199, 2,167,215, 88,101,183, 8,115,117,206,228,243,239,192, + 53,154,138,148, 34,133,102, 38, 26,121, 5, 37,177,117, 19,108, 83,250,187,150,153,168,210, 92,100,253,224,146, 64,183, 10,227, +159,203, 22,173, 78,165,223, 21, 54, 69,192, 30, 19,242, 54,196, 11, 50,151,157, 75,141, 74,177,178,141,137, 28,115,130,182, 72, + 53, 77,106,138,227, 93, 37,160, 75,168,235, 75,250, 77, 75, 59, 88,145, 84, 19, 31,111,205, 41, 72,182,223,129, 81, 39,250, 56, +232, 30,219, 29,162,115, 23,101,122, 38, 77,202,116, 40,174,162, 85, 90, 80,239,100,148, 43,186,142,202, 64,251,202,232, 20,162, +108, 1, 60,217, 71,203, 20,134, 92,149,156,116,223,182, 27,217,251, 41,229,132,213, 32, 21,161,153,241,195,201, 66,227,216,159, + 16,220, 69,211,240,231, 23,174,175, 84,226,235,187,245, 23,115,197, 49,167,227,212, 35,123, 57,136,180,133, 37,166,194,108, 0, +191, 66, 58,223,200,243,142,137, 44, 61,122,180,102,253, 33, 59,252,133, 83,190,199,112,236, 41,230,130,128, 84,153, 82, 65,215, + 93,201,250,117,171,239,178,206,168,197,213,156,148,203,210, 42, 40,126, 91,204,248,182,171,146,109,233,128, 61,168,114,203,176, +242,245, 41,109, 51,226, 98,161, 37,181,241,208, 41, 45,145,249,164,254,120,128,253, 17,154, 59, 92,201,121,138,177, 67,172,214, + 76,193, 76, 15, 54, 29,113, 68,221, 33, 68,161, 66,253, 60, 5, 60,122,223, 23, 31,108, 88,210, 41, 50,105, 49,100, 63,102, 36, +165, 78, 1,110,170, 79,159,224,230, 3, 96,165,218,226,237,248, 79,200,210,226,212,219, 12, 49,197, 50,101, 42, 9, 35,222, 68, + 87, 51, 74,163,188,160, 67,111,160, 19,201, 4, 96, 62, 98,200, 20,236,207, 79, 52,250,253, 33,185, 13, 41, 36, 37, 93, 10,110, + 44, 74, 79,145,196,162,172, 89, 84,165, 6, 85, 97,141, 10, 83,138,218, 16,191, 43, 91, 30,130,222, 33,152,107, 94, 17,116, 59, +213, 88,193,236,171,165,176, 43, 84,170,205, 27, 43, 8,142,210,221, 43, 71,118, 77,158, 37, 36, 13,228,245,235,124, 77, 27,210, +138, 43,219, 86,237, 18, 25, 45,187,222,183,102,147,116,175,246,135,161,196,161,128,226,130, 80,129,186,227,158, 49,181,101,198, +149,189, 73,218,145,202,142, 12,155,224, 12,138,167, 19, 92,187,219,127, 66, 51, 37, 98, 55,249, 83,133, 88,125,165, 83, 41,222, +203, 2, 20, 88,203, 94,245,169, 68,172,175,109,252, 37, 55,247, 99,136,230,229,121,173,184,224,220, 29, 81, 81,222,168,227,120, + 71, 23, 35,142, 71,246, 99,232, 54,190,246,177, 68,118,165,228, 44,153, 76,239, 93,121, 70, 58,229,173, 93, 60,137, 72,254,252, +115,123, 77, 83, 98,251, 75,206,209,162,153, 14, 47,237, 94, 66,172,224, 6,247, 31, 3,135,246,210,163, 49, 81,237,178,232, 43, +155, 42,116,154,132, 64,137, 37, 46, 37, 15, 92,176,165,121,128,108,127, 60, 51,125,249, 8,148,215,116,164,173,194,161,116,108, +189,199,166, 44,189,115,171, 53, 80,122,149, 76,129, 77,102, 52, 74, 92, 2,204,116,180, 57, 93,214,165, 21, 43,222, 73,196, 27, + 41, 66,113,218,236,121,225, 23, 72,154,219, 74,226,246,189,241,170,133, 36,177,156,138,209,101, 25,208, 12, 81,170, 13, 46, 84, +246, 94,126,159, 2,206,161, 33, 68, 16, 8, 3,206,192,227, 57,217,110,117,107,125,102, 27,171,122, 91,206, 4,186,207,116, 1, +191, 65,180, 14,184,176,152,203,180,202, 60, 34,235, 77,182, 94,120,169, 42,109, 66,231,111, 91,156, 18,161,191,245,117, 65,154, +140, 40, 41, 74,153, 59,155,216,155, 4,155,117, 24,231, 29,191, 82, 74,150,216,208, 78,167,109, 57, 73,249,212,147,102,174,102, +171,234, 30, 84,204,148,245,152,115,233,171,140,224, 35,114,151,193, 65,183,152,196,223, 40,101,182,105, 32,213, 43,243, 74,203, +188, 48,203, 45,141,203, 30,132,158,128,156,123, 82,154,253, 66,107,147,100,184, 84,227,138, 42, 82,148,110, 73,193, 40,142,229, +250, 46, 90,122,183, 83, 90,164, 77, 28, 65,134,131,192,253,229, 31, 47,112,196, 93, 90,222, 97, 14, 70,166, 54,241, 28,188, 60, +104,119,140,182,221,185, 6, 73,216, 70,255, 0,126, 60,170,180,212, 28,199, 76,118,189, 37, 81, 88,216,234, 92,179, 45, 54, 15, + 43,233,127,144,192,104, 19, 43,212, 73, 46,201,102,112,246,132,160, 41,208,160,124, 35,246,112,106, 6, 90,170, 87,234,143,214, + 24,167,149,200,117, 95, 97,114, 54,162,254,100,156, 57,212, 42,125, 82,133,236,209, 93,166,182,169,101,190,234, 83,236,120,144, +213,207, 79,143,169,198,139,110, 33, 11, 12,141, 79,223,223,157, 99,162, 80,160,216, 18, 99,229,244,167, 57, 51, 58,100,172,187, + 20, 86,107,161,201,253,226,200, 92, 55, 91,176,113, 91,120,220,120,226,246, 63, 44, 71, 51, 70,104,163,212,234, 13, 73,139, 31, +185,107,104, 46,161,165, 15,180, 81,235,240, 24,114,252,106, 45,110,139, 6,135, 17,196,161,246,218, 91,179,159, 82,188,197,248, +196,114,163,149,230, 67,133,237, 78, 48,164, 36,163,114, 10,211,109,201, 61, 8,197,150, 26,104,172,172,200, 39,175, 74,176,201, + 18, 73,153,241,173, 53, 54,163, 41, 74, 67, 16,202, 11,139, 1,178, 23,126, 62, 56,215, 45,217,132, 55, 26, 84, 91, 6, 83, 97, + 97,193,247,227,101, 43, 46,102, 9,145,151, 54, 37, 41,215, 88,108,128,181, 91,128, 79,166, 39, 25, 58,128,253, 93,182,105, 21, + 90, 58,202, 22,173,169,113, 77,155, 36, 17,230,109,131, 63,112,213,184,213, 64,199,141, 92, 67, 75, 81, 2, 55, 53, 92, 75,146, +136,241,200, 75,128,149,240,145,111,207, 4,225, 57, 54,130,234, 92,134,251,130,195,197,207,133, 70,220,241,134,218,143,148, 93, +202, 85,199,161, 54,178, 88, 39,115, 55, 55,176, 62, 88,184,244,231, 43,209, 51,174,151, 67,144,186,107, 10,125,214, 9, 91,197, + 60,133,131, 99,207,203, 25,216,182, 51,109,132,218,161,247, 18, 84,149, 24,211,202,126,149,104,217, 40,171, 40, 48, 69, 84,146, +208,100, 61,222, 40,221, 78, 39,197,180, 90,227, 15,178,237, 6,165, 81,113, 45, 83,227, 23, 28,221, 96, 7,166, 47,252,157,163, + 84, 76,207, 90, 97,164, 83,216, 65, 97, 9,246,135, 54, 3,225, 29,109,239, 61, 49, 55,143,164,185, 70,133, 50, 66, 96,209,154, +105,246,208, 67, 37,164,109, 42, 73,243,198, 62, 33,197,246, 22, 23, 6,221, 64,230, 9, 10,242,159,219, 73,161, 11, 55, 20,137, +157, 42,147,202, 52, 25,116,154, 74, 24,117,237,207,190,162, 84, 47,247,121,181,189,227,223,141,185,242,150,165, 80, 30,132,183, +208,225, 75, 69, 94, 17,200, 35,156, 75,179, 14, 65,172,210,228,251, 98,130, 75, 71,113,104, 19,205,147,212, 91, 1, 37,209,170, +146, 97, 73, 97,136,228, 36,176,119,133,117,177, 30,252, 30,223, 19,180,125,105, 90, 28, 7,223,207,248,171,104,107, 34, 34,171, +173, 38, 33,220,216,236, 46, 47, 34, 55,134,253,120, 55,196,246, 74, 2, 29, 87,116,210,138, 45,107,168,249,226,173,202, 51, 92, +162,230,232, 50, 16,238,207,181, 45, 44,250, 5,113,139, 97,166, 47,114,218, 75,201,191, 32, 3,108,107, 95,119, 30,204,118, 34, +147, 83,150,152,148,139,216, 99,106, 88,113,180,133, 45,179, 98, 56, 56,242, 90, 23, 14, 43,181, 7, 89, 80,101,167, 82,218,212, + 7,235, 30,108, 61, 77,177,174, 52,198,102, 41, 45,198,116,169, 74,108, 44, 32,117,177,192, 32,148,230,229, 78, 29,109, 74,202, + 14,181,180, 69, 83,156,182,229,253,111,197,142, 22, 54,162,149, 84,113, 33,104,167, 72, 80, 61, 8,101, 68, 31,203, 11, 16,237, + 17,255, 0, 33, 69,131, 93,119, 38, 85, 33, 69, 37,185,232, 23, 54, 0, 28,107,146, 98, 33, 64, 38, 85,253, 8, 56,207, 50,229, + 28,165, 15, 44, 78,204,202,124,194, 98,156,219,203,125,111,133,236,105,166,208, 84, 84, 15, 60, 93, 10, 23,228,248, 78, 42,218, + 70,124,162,234, 46, 95, 70,104,211, 60,214,197, 90, 11,178, 77,221,136,230,238,229, 95,176,164,158, 80,127,116,128,122, 99,193, + 44,248,218,241,242,165,148,119,118,233, 7,206,186,149,240,194,123, 44,233,152, 27,152,211,202,172,223,101,220,161,107,147,132, +170, 90,221, 90, 80,133, 20,173, 95,119,212,226, 2, 51, 54,127,166,146,203, 65,213,169, 42, 36, 41, 76,222,227,158, 61,221, 48, +123, 45,106, 54,100, 46,165,250,150, 94,117, 76, 54,132,247,171, 8,186,145,187,175, 31, 11, 99, 97,142, 47,108,173, 41,117, 49, +212,131,181, 81,115, 1,113, 32,148, 42,106, 86,197, 14, 69,193,118,231, 4,227,229,230, 54,248,214,160,163,230, 48, 18,159,170, +153, 91,218,195, 43,110, 64,114, 83,129, 73, 66,147,123, 13,163,240,196,145, 85,244, 48, 75,206, 83, 84, 27, 10, 0,146,174,109, +127, 65,141, 71,184,163, 8, 97, 50,167,125, 38,106,138, 48,123,215, 21, 1, 52, 62, 69, 34,116, 71, 54,161,229, 41, 7,167, 56, + 97, 42, 35,205,168,221, 4,223,208,226, 67, 76,206,116,185, 81,159,121,108, 4,247,105, 37, 40, 87, 85,115,229,135,146,106, 89, + 94, 62, 80,151,156,171, 49,214,204,120,109,130,166, 90, 70,231, 95,113, 95,113,166,211,230,165,114,111,209, 41, 73, 39,165,140, +236,120,138,195, 17,115,179,105,103, 55, 66, 35,210,172,127, 67,196, 2,194, 82,137, 39, 77, 42, 7, 49,115, 16,120,117, 64, 14, +128, 99, 19, 46,170,228,109,142,130, 83,228, 78, 5, 71,237,205,217,189, 25,118,161,144,233, 58, 55, 89,169,231,186,138, 91,102, + 35,242,102,149,177, 73, 80, 90, 92, 90,253,157, 45,161, 78,146,218, 86,139,238, 80, 27,183, 0, 45,130,113, 53, 18,135, 95,165, + 8,230, 11, 17,101,165, 9, 43,186, 84,210,156, 38,225, 94, 5, 45, 64,216,129,202,108, 57,231, 26, 15, 95, 34,217, 37,110,152, + 0,198,189,126,158,250,189,119,195, 24,133,157,183,106,230, 95, 32,100,249,104, 34,125,244,210,163, 62,106,155, 13, 7, 72, 72, +244,192, 90,134, 93,139, 85,120,206,135, 37,200,117, 4,166,201,152,200, 6,227,246, 92, 73,225,196,126,233,249, 17,215, 18, 72, +173, 71,144,224, 74,246,168,168, 92, 0,111,112, 49, 11,214,106,236, 61, 63,136, 51,245, 13,194,151, 41,111, 32,213,162,148,148, +137, 49, 73, 9,112, 11,128, 20,164, 3,188, 17,114, 54,159, 34,113, 31,111, 97,196,254,160, 71,157, 97,178,195,253,168, 74, 65, + 7,239,122,172, 50, 78,164, 84,251, 50,235,147,217, 43, 52, 68,246, 12,189,153,157,222,203,141, 40,247, 17,223, 38,219,218, 81, +232,130,120, 32,242,144, 69,250, 92,186,237,103,155,107,186, 99, 85,136, 98, 70,139, 62,141, 91,109,101,166, 95,105, 42, 44, 60, +144, 1, 40, 54,225, 86, 85,194,185,235,238,196,187,181,118,156, 82,245, 27, 64, 42,181, 68,182,133,191, 6, 15,214, 84,185, 41, + 28,164,164, 5,220, 31, 69, 34,255, 0,150, 57,123, 63,107, 72,213, 14,206,217, 85,202,172,189,213,154, 13,101,200, 51,183, 43, +196,180, 22,129,109,207,152, 77,143,189, 39, 21,213,217,131, 35,126, 71,159,148,244,174,195, 5,125,215,174, 91,185, 70,132, 28, +171,244,209, 95, 67, 93,229,216,198,155,148,209,167,121,102, 46, 91,109,207,103,144,199,124,174,248,130,181, 60,181,149, 44,168, +143, 61,215,249, 1,143,169,154,109,177, 52, 8,155, 64,176,101, 36,219,208, 1,255, 0, 44,124,120,250, 50,115, 43,181,188,161, + 74,142,252,143, 13, 50,185,220,184, 84,120, 74, 20, 82,171,255, 0,226, 56,250,237,144, 43,145,216,161,162, 54,224, 11, 8, 8, + 87,225,198, 51,238, 28,237, 92, 10, 53,222,224,235, 89,105,214,214,100,133,159,142,181, 61,174,230,186, 93, 15, 43,204,204, 21, +137,168, 98, 28, 24,174, 63, 41,247, 77,146,211,104, 73, 82,148,125,192, 2,113,241,102,173, 91,206,189,184,251,104,183,237, 21, + 39,173,154,179, 16, 66, 19,186,254,199, 79, 65, 38,201,191, 64,219, 9, 63, 18, 61,248,237,175,165,171,180,170,180,151,179,147, +154,113, 72,168,247,117, 76,234,247,177, 4,161, 86, 82, 33,163,197, 33, 95, 48, 80,223,188, 56,125, 49,204,255, 0, 68, 22,157, +189,153, 53, 78,187,172, 51,153,188,122, 12, 1, 10, 3,138, 28,123, 76,131,226, 80, 62,169,105, 42, 7,255, 0,170, 49, 73,211, +218, 58,148,122,214,170,115, 5, 72,175,163, 20, 86,233, 25, 26,147, 3, 37, 80, 98, 55, 18,157, 77,136,152,208,217,104, 89, 45, +182,148,132,128, 62, 64,227,124,186,243, 72,104,184,169, 62, 13,221, 9,196, 83, 53, 85,247, 45,111, 52,190,109,202, 65,248,255, + 0,207, 16,250,158,107,144,182, 16,200,144, 64, 0, 94,231,227,255, 0, 60,105, 33, 19, 78, 78, 81, 86, 13,126,189, 25,198,211, + 34, 59,219,148,165,146, 8,248,225,147,121,205,250,106, 84, 3,164,139,220,123,175,255, 0,166, 43, 21,102,233,136,145,181, 74, + 37, 9, 36,165, 63, 46,191,152,198, 43,207, 37,162,125,160,238,220,158,151,244, 22,197,160,214,149, 85,199,106,240,166,106, 63, +180, 69,222,235,151, 85,128, 54, 62,118,181,240,245, 25,193, 41,106,251,252, 86, 6,196,249,143,253,113, 69, 80,115,160, 68,144, +183, 29,178, 56, 35,158,188,226, 68,115,211, 5, 42, 45,187,115,199,159,203,251, 48, 23, 27, 53, 92,172, 85,160,246,116,222,173, +174,175,147,114, 47,233,128, 53,252,194,218, 91, 15, 37, 66,206, 38,252,121, 31, 60, 66, 95,206,237, 56,246,237,228, 0, 64,235, +228,112, 42,175,156,247,110,141,222,220, 2, 79, 94,131,174, 42,169, 6,160,167, 0,169, 44,188,196,101,120, 3,158, 29,190, 71, + 26, 39, 72,105, 76,141,175, 18,160, 1, 62,251,117,196, 66, 53,125,176,206,245,174,228, 90,252,245, 28,223,248,227,207,210, 34, +149, 32, 7, 73,240,157,220,249,121, 96, 93,153,160,169,225,202,136,214, 43,142, 50,199,124,210,141,202,184, 4,254, 24,142,214, + 51, 20, 89, 80,214, 30, 80, 42, 90, 56, 23,243, 60,219,248,140,106,175,214, 74,183,119, 42,184,219,125,163, 21,230, 96,157, 82, + 51, 20,227, 43, 59, 1,220, 61,254,191,227,223,130,161,169,170,203, 89, 85, 15,203, 58,105, 84,173,103,138,157, 82,148,192, 33, +213,248,220,113,196,161, 32,219,173,201,196,170,177,147,230,100,186, 52,186,237,110,171, 21, 17,161, 66,114, 92,146,137, 40, 81, + 13, 54,146,165, 40, 11,220,216, 3,211, 20,230,178,231,250,237, 47, 48, 71,162, 81, 35,160, 1, 9, 11,154,235,132, 0, 1, 36, +130, 57,231,131,136, 36,221, 69,253, 33,132,236, 7, 91,157, 37,180,165, 77,184, 9,186, 20, 15, 4, 91,139,130, 58,226, 74,197, +113, 70, 30, 13,160, 39, 32,142, 68,159,255, 0, 96, 60,180,175, 61,196,144,203,216,170,150,185,220, 13, 60, 34,190,132,125, 27, +217,183, 78,106, 90, 33, 43, 84,169,181, 38, 27,155, 92,140,101, 58,135, 31, 10,113, 5,211,187,187, 63,247, 65, 8,254,142, 54, +246,160,204, 20, 92,211,245, 74,106,153,194,159, 13,248, 97,239,178,146,237,148, 80,174,237, 9, 80, 0,116, 37,165, 99,128,123, + 41,103, 76,159,164,154,146,167,179, 26,170, 77, 80, 89,136,143,171,153, 47,172, 33,181,161, 32, 20,148,131,226,185, 4,244,230, +248,123,173,122,213, 83,213,236,245, 47, 56, 70,109,230, 35,184,176,136,205, 23,126,226, 83,194, 60, 32,250, 11,155,121,147,136, +223, 62,242, 31, 75,172, 40, 3,212,137,223,194, 71,149,117,252, 67,125,103,113,100,150,217, 50,149, 4,192, 28,128,255, 0, 85, +127,206,153,167, 81,156, 43,157,168, 52,181, 41, 39,238, 7, 21,207,229,252,112,233,209,165,146, 33,183, 34, 22,127,130, 23,107, +186, 2, 87,100,143,194,199, 28,119, 34, 93, 86, 36,133,137,111,168,173,106, 10,113, 65, 96, 2,175, 82,125, 49,131, 25,214,161, + 18, 34,189,177,229, 39,121, 42, 74,201,221,225, 23,177, 0,124,207, 56, 1,197, 49,200, 5, 15,143,255, 0, 17,175,214,188,217, +219, 70, 9,253, 63, 26,237, 26,106,114, 66,155, 6,153,169, 52, 71,219, 39,133,151,148,146, 7,192,167, 12, 51,196,156,163, 59, + 43, 78,165, 83,117, 30,148,196,183,217, 45,180,234,150,163,182,252, 21, 90,220,249,227,143, 63, 77,138, 95, 69, 73,170,211,128, + 33,143, 15,114,149, 37, 9,191,235, 91,203,156,107,147,159,234,172, 56, 23, 30,186,123,231,141,150,128,178,173,201, 61, 79, 55, + 62,252, 72, 98,252, 66, 83,151,181, 79,158, 77,127,111,133, 0,216,219,159,241,248,212,154,185,217,119, 40, 46,160,243,213,125, +127,165, 60,226, 30,187,102, 44, 37,149, 40, 31,189,114,162, 13,237,211, 2,191,205,199, 72, 96, 73,110, 75, 58,204,236,129,221, + 20,169,147, 13, 32,168,147,197,136, 56,102,228,236,205, 16,137, 17,167, 32,199, 82,206,229,188,160, 86,127, 43,143,225,129,242, +106,129,146,235, 87, 84,199, 89,241,165, 70, 50, 82, 19,126,137, 42, 28,155, 97,211,138,227,138,137,186, 62,228,160,127,252,253, +106, 63,211,237,128,140,159, 63,222,162, 26,149,217,179, 79,106,125,219, 80, 53, 22, 91,143, 55,194,208, 98,160, 95,169,224,223, +156, 85,117, 77, 31,129,150, 20,235, 80,179, 66,138, 2,146,224, 82,146, 5,148,147,112,108, 49,106,230,170,132,167, 28, 47, 41, +126, 11,220,180,130, 78,229,116,234, 63,134, 43,140,221, 56, 62,162,240,128, 84, 17,225,220,142, 13,253, 15,174, 58,204, 51, 21, +196,202, 66, 92,120,168,120,132,254,194,137,217,101,216, 69, 26, 94,161,100, 71,162, 21, 85,114,195,162, 90, 99,132, 3, 21,240, + 16, 84, 7, 42,177,231,156, 61,164,234,230,154, 8, 72,143, 54,133, 41,181, 33, 32, 88, 88,133,144,111,235,138,166,123, 42, 83, +194, 66,226,187,180,253,237,171,176,198,132, 66,169,202,157,181,152, 32, 3,208,220,147,111,126, 10,112,124, 57,201, 42, 82,181, +255, 0,204,199,161, 52,161,200,138,158,214,243,182, 94,159, 86,126, 92, 40,229,134, 92, 89, 45, 52, 44,118,143, 76, 18,166,103, +124,140,236, 6,227, 84,154, 90,146,147,226, 5,176, 65, 62,189,113, 92,251, 5, 85,130,231,114,194,212, 27, 28,217,174, 1,233, + 98,113,182,157, 68,157, 33, 27,149, 20,133, 40,248, 80,148,158, 79,199, 26,193,198,155,101, 45,131, 1, 48, 7,186,134,166, 86, +173,234,200,171,234,150, 85,246, 6, 40,217,122,150,204, 86, 90,229, 78,136,254, 37, 43,251, 6, 36,185, 39, 83,116, 90, 54, 87, +121,188,230,218,151, 61,215,236,217,141, 22,224, 35,205, 74,191,159, 94,152,169,163,105,222,103, 84,132, 54,136, 14, 45,197,167, +120,109,171,174,223, 44, 26,164,233, 61, 94,168,165,165,216,238,130, 23,182,200,104,222,254,167,208,123,241,158,167,112,182, 97, + 82, 36, 25,158,115,231, 70, 97, 46, 50,176,160, 1,243,168,190,172, 66,167, 85,115,197, 74,163,146, 86,161, 77,113,123, 98,173, +105,238,212,180,216, 94,227,203, 7,168,178, 50,245, 91, 32,198,164,230,133,134,234, 48, 64,105, 54, 27,131,205, 3,199, 62,182, +196,190, 23,103, 89, 78, 93,153, 13,173, 79, 27, 20,134,156, 36, 91,223,232,113, 36,160,118,118,202,137,113, 76, 86, 38, 72,142, +226, 90, 42, 14,188,164, 37,180,159, 43,146,121,249, 97,174,248,178,204,182,144, 87,170, 72, 32,141,244,250, 30,116, 37,218,246, +170,146,145,214,130,105,189,115, 70,169,212,199,154,205, 15,184,151,148,118, 35, 99, 36,165,180,250,241,231,137, 60,141, 66,209, + 90,110, 87,122,147,151,234, 61,228,151, 17,224,113, 81,213,115,239,189,176,229,122, 35,147, 90,101, 43,101, 13,119, 41,178,150, +249,241,111, 7,139, 0, 63,142, 60,151,163,121, 85,232, 75,151, 3, 41,165,196, 37,223, 11,200,113,105,178,109,233,111, 51,142, + 70,234,247, 10,188,191, 23, 78, 45,194,100, 24,145,148, 70,194, 15,202,106,202, 26,117, 17, 28,171,159,117,130,149, 27, 54, 84, +216,114,134,180,119, 77,182, 67,139, 81, 35,113,242,196,219, 67,235,185,111, 38,105, 50,242,238, 98, 68,149,212, 91,154,234,217, + 76,102,247, 39, 98,173,107,159,141,241,103,157, 42,203,148,197,150, 85, 68,133,126,232, 20,164,172, 41, 70,252,220,223,207, 5, +168,249,103, 39,210, 32,163,108,112,130,165, 16,234, 16,164,155,243,211,206,231,221,141, 59,254, 40,180,188,180, 75, 10, 65, 41, + 73, 4,121,143, 90, 75, 97,199, 86, 73,231, 81, 13, 62,213,202, 30, 88,117,249,210,169, 83,156, 14, 54, 18,142,237,159,125,252, +206, 15, 63,172, 85,154,236,214, 42, 20, 61, 61,152,160,217,225,110, 56,148,238, 73,245,244,196,218,147, 11, 42,182,135,153,122, +136,210,212, 72, 13,135, 80, 80,180,219,204,113,110,113,179, 48,193,133, 77,132,227,169,134,142,155,252, 68, 5, 95,160,233,215, +225,142, 98,247, 22,176,188,196, 77,202,217,254,225,211, 85, 24,136,141,132, 84,211,106,160,222, 94, 85, 11,169, 57,168, 57,133, +109,212, 70,157, 54, 26, 15, 18,158,250, 65,240, 31, 49,112, 45,206, 7,230, 44,137,153,115, 11,138, 92,186, 92, 26, 78,247, 62, +208,176,181, 45, 86, 34,214, 39,143,195, 18,119, 43,109, 57, 9,184,198,177, 47,107,201, 37,246,210,209, 38,215,189,174, 62,239, +199,174, 55,212, 51, 21, 58, 20,180,185, 22,162,216, 42, 64, 35,191, 10, 89, 73, 3,204,121,226, 13, 98,142,219, 40, 22, 82, 18, + 68,196,102,250,147, 62,149, 33,105, 53, 93, 80,187, 27,100,201, 11, 14, 84, 51,107,205,205, 66,194,217,105, 45,125,241,123,147, +207, 92, 75, 81,165,249,118,142, 24,165,162,108,201,138, 0, 7, 84, 1,105, 42, 81, 62,128,121,124,112, 96,103,200,149, 56,100, + 79,171, 45,187,170,238, 72,138,141,165,103,208, 19,211, 26,229,234,109, 30, 28, 68, 37,140,208,219, 77, 7, 5,218, 89, 43, 85, +192,177, 60, 15,203, 14,254, 63,142, 93, 42, 29,113, 71,195,253, 10, 34,108,208, 6,213,186, 6, 66,210,122, 43,237, 52,221, 17, + 51, 95, 65, 42, 84,103, 92, 83,128, 31, 62,110, 71, 56, 40,183,233,140, 42, 73,165,233,213, 26,146,226, 81,102, 28, 49,210, 13, +135,235, 1,242,196,122, 14,114,203,108, 71,109, 84,176,236,130,226,212,161,117, 22,210, 9, 60,239,227,166, 25,230,141, 74,203, + 13, 49,236,242, 22, 80, 16,131,185, 73,178,238,171,249, 27,240, 6, 51,215,113,125,112,224, 11, 82,213,230, 79,202,126, 98,136, +155, 84, 39, 97, 21, 55,155,154,106,245, 24,145, 93,222,160,148,181,100,247, 50, 18,205,255, 0,162, 7, 24, 88,166,221,212,218, + 88,121, 72,138,167, 94, 64, 55, 74,156, 65, 87, 7,222, 45,133,137, 11, 55,146, 32, 15,135,243, 83,236, 69,119,245,119, 44,105, +238,116,211,250,189, 18, 69, 20, 8,114,169,146, 98,186,218,147,112,148, 37,160,133,120,135, 78, 84,180,143, 50, 82, 79, 36,223, + 31, 25,123, 56,175, 83,251, 58,106,213, 86,179, 50, 92,186,125, 18,151, 84,126,151,152, 22,235, 87,143, 57,108,172,167,186, 9, + 36,110,116,219,194, 83,226, 23,226,224,144,126,165, 59,171,121, 73, 25, 17,218,158,107,170, 53, 79,136,227, 47, 58,251,174,185, +181, 13,139,173,106,177, 61, 0, 42, 28,250,164,123,177,242,247,180,125,127, 53,106,110,111,204,186,135,167,185,114,181, 39, 40, + 79,175, 72,118,157, 88,145, 5,230,225,199, 14, 57,180, 45,130,160, 6,245, 4,128, 92, 60,220,217, 54,234,120,190, 6,179,188, +113,119, 22,145, 41,114, 1, 42,216, 25, 49, 19,204,131,231,166,198, 43,233,110, 9,252,191,106,110, 30,198, 80, 87,111,148, 66, + 71,249,172,108,137,208,236,100,229, 32,255, 0,228,153,204, 46,221,122,250, 75,242,158, 73,134,213, 23, 74,244,197,201,213, 57, + 39,188,156,154,228,180,161, 16,124,131,106, 12,169, 69,110, 16, 77,198,228,237, 6,199,158, 7, 85,105,229, 88,230,188,135,151, +234, 78,101, 41, 84,169,217,134,148,204,218,131, 14, 19,246, 43,121,176, 75,100,158,124, 62, 33,206, 57,155,232,193,236, 71,164, +211,242,197, 51,180,182,179, 82,197,118,123,149, 89, 70,133, 65,152, 83,236,141,162, 58,130,123,247, 27,183,218, 18,224, 80, 1, + 87, 72,176, 36, 19,206, 59,117,140,201, 79,170, 60,181, 64,216,237, 81, 46, 32, 39, 47,165,149, 41,201, 40, 74, 82,165, 41, 14, + 37, 37, 41, 5, 92,248,186, 5,139,129,126, 33,196,239, 97, 86,119, 62,195, 98,133, 41, 77, 18, 22,178, 78,170,218, 0,232,152, +220,192,241,231, 94,123,141,123, 5,197,225, 22, 76,246,104,157, 4,149, 24,228, 9, 58,147,227,167,128,170, 62,179,165, 90,166, +254,108,113,200, 73,105,248,109,238, 13, 20, 60, 18,150,202,150,144, 10,189,246, 6,216, 99, 79,141, 83,205, 57,215,244,107, 76, +181, 73,154,212,202, 67,110,138,252, 89, 48,214,136,241, 31, 46, 40, 52,195,111,165,127,106, 74, 27,113, 69, 69, 32, 2, 0, 27, +185, 34, 91, 31, 91, 50,236,252,251,254, 79,162,230, 68,208, 18,166,130,217,139, 85,140,160,243,111,164, 19,221,173,180,248,202, + 82, 80,175,180, 30, 2, 1, 1, 87, 28,138,213, 65, 84,210,252,175, 39, 95,105, 90, 56,195, 84,196,190,145, 80,147, 73,134,152, +222,211, 9,199,118,151, 94,111,245,147,117, 29,151,185, 4,222,224,110, 4,182,151, 79,232,219,201, 25,149, 1, 2, 0,223,207, + 66,121, 0, 13,101,178,211, 40,148,169, 36,168,237,225,212,255, 0,189, 43,163,116, 98,179, 64,236,159, 47, 45, 85, 53,115, 47, +101, 56,181,183, 84,103, 85,115, 45,114,107,147,169,200,139,185, 64, 48,207,116,211,129,165,120, 2, 76,141,171, 74, 84,165, 36, + 46,228,237,137,246,148,212,252,173,172,153,186,185,156,169,217,156,194,135, 86, 90,150,219, 82, 29, 46,123, 10,110, 9, 12,169, + 32, 36,182, 64,240, 1,202, 65, 23, 28, 92,194, 51, 22, 97,205,154,209,162,185, 99, 49,211,230,194,204, 52, 10,132,182,233, 84, + 55, 38,200, 10, 67, 9,150,250, 24, 75, 42, 74,206,208,128,242,211,185, 11, 54, 7,125,194, 78, 56,155, 86,117, 27, 86,114,166, +102, 84,188,241, 81,135, 7, 57,229, 10,139, 49,166,181, 10, 66, 66, 39, 65,144,216,126, 58,130, 16, 74, 86,208, 65, 9, 34,246, +218,234, 65,231, 27,214,121,175,219, 41,182, 1, 57, 20, 36,198,169, 88,141, 58, 29,116, 50, 14,227, 72,219, 70,229,229,173,132, +165,166,242, 36, 70,177,172,245, 61,126,244,171,239, 62, 82,242, 69, 11, 52, 66,206, 12, 67, 97, 50,144,135,132, 87,123,150,218, + 14,220, 38,229, 78, 40,130,174,131,169, 29, 72, 3, 21, 70,102,237, 35, 39, 42,166,124,124,229,167,239,152, 45, 84, 10, 23, 80, +143, 53, 43, 17, 92, 85,150,216,176,178,146,171,110,181,189, 13,137,233,129,186,185,218,210, 64,110, 46,169,229, 45, 52,164, 57, + 72, 76,240,181, 64,146,210,175, 17, 73,105,144,160,133,130, 2, 6,247, 44, 0, 22, 6,196, 12, 86,122,239,169,116,141, 67,210, +231,179,229,102, 3, 14,215, 43, 89,129,164, 57, 45, 1, 73,188,118,163, 11, 0, 18,160,139,238, 34,228,160,168,159,214, 28,131, +126,206,214,233,247, 2,175, 4,230,208,146, 76,204,237, 3,167, 94,181,142, 81,218,174, 92, 81, 36,243, 63,126,149,209,186, 95, +170, 13,106,148, 6,217,202, 89,222, 4,224,227, 10, 49,212,236,144,133, 45,192, 9, 83,106, 22, 59, 22,145,180,145,225, 36, 92, +164,112,108, 71, 44,230,108,221, 34, 85, 79, 39,103,186,251,175,194,168, 48,182, 85, 6,165,101, 41, 12,175,122, 46, 20, 0, 82, +124, 60,148, 44, 18, 60,213,124,114,102,108,206, 90, 88,141, 62,162,234, 62, 72,167, 74,203, 57,234, 46,200,115, 69, 17, 97,152, + 51, 98,161,128,148,200, 91,118, 39,191, 42,251,196, 16, 15, 36,164,147,124, 29,236,203,219, 27, 44,208,157,117, 58,141, 73,169, +213,222, 76,144,219,206, 58,251,143, 62,242,142,225,246, 97, 71,106, 64, 22,224,145,239, 61, 49,125, 54,151, 22,246,142,150,145, +153, 42, 31,166, 6, 96,173,164, 29,189,226, 40, 87, 22, 72, 10, 57, 14, 97,167, 42,233, 93, 47,214, 7,115,111,101,217,121, 27, + 55,204,239,106, 25,121, 18, 50,235,206,188,162, 87,220,160, 45,166,193,191,236,164,167,229,199,150, 56,107, 59,210,151,151,115, + 90,226,199,222,136,211, 34,197,154,218, 20,120, 37,198,130,137,249, 40,168, 98,240,127, 84, 90,139,155, 51,197, 50,155, 77,114, + 60, 44,203, 38, 37, 86, 43, 27,154, 87,114, 84, 54,175,196,133, 16,110, 87,208, 19,247,125,216,173, 53,165,228, 85,211,148,102, + 71,142, 62,199, 44, 51, 21,247, 19,250,234,110, 67,246, 87,175,221, 41, 23,247, 98, 88, 91, 43,182,125, 95,241, 94,177, 58, 9, + 19,167, 77,100, 84,109,127,180,242,143, 90,232,143,163,115, 84, 14, 83,204,181, 12,189, 45, 68,179, 45,144,243,105, 31,246,173, +139,139,124, 69,255, 0, 12,125, 33,203, 95, 72,206,130,100,234, 68, 70,115,142,122, 79,214,142,222, 63,212,116,182,215, 54,115, +142, 4,164,139,180,208, 37, 36,146, 64,221,110, 65,199,199, 61, 46,153, 93,167, 68,158,188,179, 37,230,106, 5,144,152,171,142, +171, 46,234, 10, 65, 0,142,132,238,182, 59, 11,179, 77, 17,174,202,250, 53, 84,215,106, 44, 53, 63, 95,110,154,184,237,214, 22, +192,112, 25,242, 16, 3,108,161, 68,130,128,139,149,169, 66,247,219,207,222, 22,139,202,113,155,253, 20, 72, 87,248,244,211, 85, + 30,128,124,107,161,195,110, 27, 75,138, 60,213,244,231,238,161, 31, 72, 55,107, 68,118,168,215,215,115, 45, 18, 36,216,148, 90, + 60, 22,233,244,152,149, 6, 59,167,211,182,234,117,110, 32, 19,181,101,213, 40, 91,174,212,164, 30, 70, 59,199,232,226,201, 52, +157, 52,236,161,151,233,155,151, 30,177, 94,239, 43, 19, 89,149, 29,108,173,192,240, 79,118, 81,188, 14,241, 33,148,181,226, 77, +197,201,231, 31, 50,116, 55, 71,165,234,158,169,208,178, 92,218,134,247,171,149,134, 35, 44,163,196,161,222, 56, 55,172,159,112, + 37, 71,224,113,246,161,110, 80,232, 52,184,244, 26,115, 72,141, 14, 20,116, 71,138,210,120, 13,161, 35,106, 82, 61,192, 11,124, +176,123, 69, 7,157, 82,135, 42,219, 67,169, 88,210,131, 86,167, 15, 18, 92, 69,184,255, 0,149,241, 1,204,146,187,148, 18,133, +121, 29,190,238,184,146,230,106,244, 21,247,171,141, 33, 4,216,129,207,248,242,197,101, 88,204,173,165,245, 51, 37,209,112,118, +245,233,115,124,111,176,153,170,183, 14,229, 21, 31,168,234, 52,218, 60,151, 91,113, 87, 0, 16,146,122,115,231,129, 95,229,129, +135,228, 2,228,132,128,142,109,126,182,242,192,252,255, 0, 54, 9,136,227,140, 17,215,194,126, 56,231, 60,239,155,230,209, 42, +238,169,185,101, 34,252, 0,120,183, 63,242,252, 49,162,210, 18,189, 43, 56, 44,184,107,172,105,250,139, 14,104, 71,250, 71,118, + 69,172,119,112,121,195,245,234, 11,140, 47,106, 31,178, 7, 4,223,174, 56,251, 46,235, 28,134, 2, 1,157,187,144, 84, 20,191, +133,255, 0,134, 39, 48,245,254, 11,201, 30,218,240,177, 87,175, 62,252, 51,150,198,162,160,160,107,163,152,212, 17, 37, 9, 10, +144, 82, 22,121, 55,247,227, 25,217,254,152,219,189,227,147,129, 32,144,177,127,125,177,206, 85, 13,117,167,196, 8,109,137, 64, +163,101,130,138,189,127,199,231,136,156,189,108,153, 42, 98,187,169, 69, 94, 50, 65, 10,234, 47,123, 98,169,180, 81,168,101, 81, +174,168, 86,169, 66, 91,169, 40,148, 54,158, 0,191, 67,198, 31, 83,179,175,182, 63,113,126,128, 11,121, 95,252,126,120,230,140, +149, 95,170,215, 38,119,133,242, 83,191,129,127,134, 47,108,150,211, 41,140, 29,117,203,146, 8,254,204, 1,118,225, 52, 37, 38, + 42,108,250,220,116,135, 91, 55, 10, 60,243,228,112,214,101, 49,167,108, 54,220,171,167, 30,126,152, 35, 13,184,239,196, 70,231, + 5,246,216,139,225,218, 99, 51, 41,244, 37, 36, 29,132, 17,180,245,247, 98,170,187,162,132,107,152,251, 74,182,197, 27, 87,149, + 13,247,163, 52,180,192,142,164,169, 99,196,144, 91,232, 60,253,127, 28, 69,229,251, 5, 89,150,226, 52, 99, 45, 27, 1, 43,239, +148,217, 87,175, 3,175,207, 19, 46,214,212, 40,185,147, 88,101,213, 99, 60, 99,170, 44,102, 89,222, 64, 35,114, 69,135,203,159, +207, 20,228,172,191, 95,168,151, 82,213,116, 0,203,164, 44, 54,201, 73, 23, 6,195,223,198, 57,139,155,187,117,220, 18, 28,136, +174, 73,235, 23,156,185, 90,128,144, 77,108,157, 71, 75, 19, 28, 46, 41,148,134,110, 90,112,173, 74, 27,135,186,221, 45,134,178, +220,151, 76,150,220,248,178, 20,130, 25, 33, 37,196,165, 55, 36,121, 12,110, 86, 66,122, 51,136,134,107,143,135, 29, 4,238, 82, +238,126, 62,152,209, 81,211, 90,165, 49,230,229, 49, 84, 68,199, 86,157,233, 75,174, 19,208,226,105,196,237,167, 42,156,248, 81, + 63,164, 92,148,204, 83, 41, 21,199,223,144,220,105,181, 57, 13,119,164,247,171, 71, 59,207, 22, 60,116,198,140,195, 38, 10,163, +161,231, 38, 63, 36, 33, 27, 31, 37, 22, 31, 48, 58,224,155,148,124,245, 53,132, 63, 2,145, 21,160, 70,210,176,110, 83,240, 24, + 21, 85,201,121,198, 34,193,140,219, 15,150, 81,119, 18, 77,185,244,243,247,224,237,223, 91,149, 14,248, 30,241, 84, 93,195,221, +108,234, 41,139, 53,244, 82, 22,193,122,140,160,215,118,164,221,108, 17,184, 30,156,115,127,158, 9,211,234,176, 88, 38,165, 22, + 42,123,231,145,100,187,221, 27,160,242, 5,207, 65,240,192,105, 43,207, 96,130,230, 91,125,183, 20,174,241,183, 18,202, 74, 83, +229,239,227, 14,155, 57,165, 80,131,147,195,219, 29, 38,200, 72, 10,185,191, 55,249,224,238, 62,220,110, 61,104, 2,216,142, 70, +138,175, 51,212,148,174,234, 77,108, 38,228,146,181, 14, 19,127,213, 30,252, 53,166,214, 87, 22, 82,227,189, 86,144,243,110, 46, +196, 52,209, 55,252, 48,217,170, 85, 66, 81, 74, 81, 21, 75,112, 47,123, 72, 91, 28, 31, 80, 49,148,234, 94,122,109,164, 59, 76, +130,176,155,155, 89, 54, 41, 62,182,183, 65,128,139,150, 63, 76,129, 62, 67,233, 79,236,254, 6,182,202,203, 20,138,145, 1,217, + 82, 2, 1, 83,169, 74,211, 98, 72,245, 7,166, 26, 59,148,178,125, 65, 1, 18,169,203, 74,138,174,144,148,238,242,235,240,195, + 25,181,140,225, 73, 9,129, 85,130, 8, 73, 80, 42,238,201, 85,253, 9, 39, 15,242,254, 77,159, 93,138,135,254,176, 49, 94,121, +103,106, 81,199, 0,155,156, 20,222, 45,148,230, 83,144, 57, 65,167, 22,193, 71, 65, 94,167, 33,229, 14,225, 18,132,118, 20,150, +222, 1, 76, 41,187, 94,254,103,155,140, 58, 99, 39,228, 40,115,187,248,180,200, 77, 43, 98,129, 74, 16,171,145,230,122,224, 28, +252,177,155,105, 79,168, 10,123,207,169,151,118,169, 74, 73, 80, 7,212, 91,200,223,207, 1,179,102,117,205,180,102,156,126,171, +150,221, 76,118,154, 27,159, 97,173,196, 11, 18, 73,227,243,196,197,203,207, 70, 87,102,124,126,156,234, 72,180,204,114,229,214, +165,217,178,151, 16,181, 30, 62,150, 57, 21,169,239,255, 0,239, 13,203,225, 15,178, 8,220, 46, 77,199, 54,231,222,112,102,141, + 51, 46,185, 5,167, 36,209,224,186,235, 77,120,238,141,170, 30,187,118,241,138,154,139,156,166, 38, 43,117,248,244, 57, 11, 19, + 64, 12,169, 72,224, 55,201,218, 57,243, 28,156, 61,253, 36,206,210, 2, 95,137,151, 22, 15, 62, 20, 36,220, 39,225,228, 48, 69, +135, 22,212, 41,126, 26,145,254,250,206,181,113, 97, 38,212, 50, 80, 52, 59,243,171,105, 25,150,146,217,246,248,153,109, 72,112, + 1,181,224,202, 84,164,143, 33,126,182,195, 4, 85,170, 19, 36,169,193, 33, 40,117,199, 9, 81,147, 30,201, 9,244,235,136, 91, +212,204,225, 34, 11, 77, 83,100, 30,253, 92, 33, 41, 54,247,216,226, 56,170,126,174, 25,201, 98,119,122,222,229,148,133,128, 72, +242,184, 39, 21, 26, 67,106,152,112, 15, 51,251,213, 99,106,157,226,174, 47,211,120,194, 50, 88, 50,150, 91, 38,206, 4, 20,144, +181,116,224,117,199,136,175,211, 36, 41,110, 41,222,229,148,139, 37, 43, 1, 87,249, 28, 83,149,166,243,197, 30,154,154,179, 53, + 37,133, 4, 42,233, 8,233,107, 11,223,203, 1, 89,172,231,185,196, 33,126,218, 66,213,192, 66, 13,137,243,252,112, 68, 89,161, +105,204,149,136,166,246,116,116,174,134,127, 57, 59, 18, 35,113, 26,172, 48,180, 37, 36, 57,222,128,146,160,121, 1, 54, 56,100, +141, 68,102, 4,117, 75,151, 87,104,139,217, 40, 46,158, 57,243,248, 98,145,167,101,172,247, 92,101,201,173,179, 40,183, 28,144, +189,196,220,158,150, 31, 60, 55,159,149,117, 22, 26, 28,126,125, 34,110,196,253,210,164,145,127, 46, 61,112,201,178,182, 39, 41, +112, 79,186,166, 45,199,252,106,229,168,234,173, 38, 92,125,166,166,203,238, 41,119,222,183, 15,132,219,229,128,237,234, 61, 22, +159, 32, 61,237,236, 43,119, 46,109, 93,173,248, 98,167,167,229, 12,219, 61,213,182,105,146,218, 1, 36,221, 77,147,205,189,223, +135,207, 13,219,161,230, 20, 16,210,105,146, 84,164,159, 29,155, 39,140, 88, 77,165,170, 4, 5,211,150, 57,229,171,118, 95,104, +191, 97,105, 40,165,176,203,196,155,149, 56,226,174, 79,241,192,250,191,104,201,178,211,182,162,148, 4, 18,119,132, 11, 3,249, +226, 11, 75,210,172,231, 61,213, 61, 18,133, 37,103,161,216, 44,110,112,245,122, 1,170,114,228, 37,110, 80, 8,104,170,222, 53, + 2,175,158, 33,147, 7, 66,181, 80,159, 19, 83,236, 87,210,137, 43, 90,234,204,149, 57, 69,146,166,208,177, 98, 1, 2,224,245, +195, 25,186,159, 80,152,160,169, 51, 74,220, 81, 36,238, 95, 56,115, 78,236,227,157,234,145,220, 75,105, 67,105,108,171,236,220, + 93,137,176, 36, 91,240,192,103,244,123, 54,211, 93, 76,101,210,221, 90,251,144,240, 91,105,186, 84,131,231,124, 21, 15,225,101, + 80,149, 9,167, 75, 11, 60,169,212, 45, 70,113, 49, 28, 67,200, 72,228,236, 74, 15,158, 27,187,156,106, 33,189,137,184,105,197, +221, 69,213,143,157,134, 13,163, 66, 51, 51,176,155,115,196,151, 71,137, 81,201,241, 91, 2, 42,122, 93,155,233,242,125,149,202, +124,148,167,114, 66, 84,166,174,130, 77,249, 7, 9, 23,150, 10, 81,202,161, 82,236, 13, 96,206,109,144,123,198, 81, 48,148,168, +114, 67,134,228,121, 14,184,212,245,126, 84,196, 45,157,128,165, 92, 36,133, 27,147,130,148,237, 19,206,115,103,161,109, 81, 72, +102,192,151,199, 2,223,219,137, 37, 83, 67, 94,141, 25,164, 82,170, 12,166,118,197, 23,154, 88, 34,227,200,143, 33,230, 48, 53, +226, 54, 40, 80, 25,135,223, 90,126,192,197, 87,102,179, 86, 66,136, 12,167,142, 57, 32,244,248,225, 98, 88,141, 17,207,106, 82, +146,238, 95, 46, 40, 30, 84,209,227, 11, 4, 24,141,153,255, 0, 33,234, 63,122,127,102, 21, 51,157,168, 20,204,215,146,160,204, +205,172, 71,147, 73,121, 30,205, 30, 28,196, 5,165,240,130, 20,235,132, 17,107,119,138, 28,254,226,135,144,198,231,245, 38,153, +157, 50, 42,242,221,102, 51, 79, 67,169,182,220, 54,163, 41, 59, 80, 18, 14,237,192, 38,219,118,132,131,197,173,198, 57,166,181, +170, 70,172,204, 42, 91,106,112,195,166, 65, 68, 90,123, 23, 63,119,170,151,241, 82,202,143,204,224,205, 59, 61,191, 18, 57, 13, +172, 30,233,189,141, 92,240,216, 63,120,252, 73,233,142,121,120, 86, 85, 2,145, 4, 25, 17,200,206,227,225,233, 93,106, 46, 93, + 74, 34,116,171,223, 72,117,113,156,156,196,237, 44,170,188,164,177, 4, 54,245, 0,192,144,228, 84,182,211,142, 45,101, 96, 33, + 98,194,232,222, 73, 36,220,243,123,242, 99, 62,246,138,207,243, 32, 70,153, 30,123,181, 24,240, 95,239,225,206, 97, 65,153,209, + 29,181,130,219,117, 2,203,232, 69,148,159,187,112,162,164,149, 3,206,116,138,195, 21, 58,162,220, 92,165, 42,117, 73, 77, 71, +186, 77,187,182, 16, 78,212, 3,251, 74, 36, 95,208, 1,239,195, 77, 81,172, 87,154,139, 95,139, 73,204,111, 68,130,100,136,104, + 67, 64,165, 37, 41, 3,144,164,220,166,229, 36,155,122,219,165,241, 59,172, 34,210,227, 16,237, 72, 18,168, 38, 70,147, 0, 40, +142,146,100,248,213,155,105,184,112, 54,149, 4,204,120,125,251,234,255, 0,205,189,173, 50,174,100,163, 50,189, 71,168, 49, 15, + 48, 51, 29,108,166,189, 14, 0, 73, 91, 15, 4,165, 82, 25,186, 13,156, 74,210,144,227, 42, 32, 21, 54,160,146, 55,224, 44, 47, +164, 47, 95,178, 70,149,212,251, 52,234, 21,106,149,156,114,229,114,130,237, 50, 53, 97,244, 45, 83, 26,140,251, 65,198, 66, 92, + 75,129, 10,218,229,148, 74,146,181,120, 10,119,216, 38,220,133,154,115, 86,106,165, 83,233,178, 31,156,163, 34,202, 42, 77,194, +129, 65,228,146, 58, 29,201, 6,252,126,168, 56,119, 26,190,169, 25,189,200, 70, 3, 13,173,167, 23, 20,169,146, 18, 30, 8,186, +208,234,145,228,160, 18, 83,184,125,235,131,212, 18,116,172, 48, 91,107, 65,220, 72,141,122,105,255, 0,175, 48, 53,229,215,194, +174, 94, 22,172,243, 41,162,160,189,149, 49, 6, 0, 7, 81,184,233,166,219,215, 89,118, 55,237, 49,152,180,219, 64,115,142,149, + 77,126, 58,232, 18,243,118, 92,152,226, 31, 96, 45,212, 43,235, 72,234, 90, 91, 89, 54,104, 40, 48,146, 77,141,237,239, 56,169, + 59, 87, 55,167,244,189,105, 83,122,108,213, 71,216,228,209,123,169, 95, 89, 77, 75,238, 45,246,164,190,200, 35,106, 18, 16, 2, + 25,105, 59, 57, 32,164,155,243, 96, 39, 70, 84,186,164,232,217, 74,124, 20, 61, 14,175,155,169,226, 66,150,226,146, 16,152,161, +217, 42,189,148, 46, 10, 18,174,160,216,129,211, 17,220,209,154,145,153,117, 29,220,202,150, 27, 8, 76, 70,158, 67, 76,131,183, +123,128,186, 82, 46, 77,252,110,171,240,197,139,116,118,119,110,161, 35,115,152,251,192, 30,164,130,103,122,162,237,211,159,211, +192, 38, 71,243, 82,122,156, 42,125, 63,179,246,111,167,205, 66,158,118, 44,104,137, 69,136,179, 79,189, 37,178, 72,226,230,193, +157,191, 50,113, 79,102, 12,208,196,157, 62,164,101, 70, 99,184, 36, 66,155, 41,215,156, 39,133,165,192,208, 64, 3,221,177, 95, +142, 36, 25,219, 50,213, 77, 28,101,225, 45, 73,102,115,233,126, 99, 64,240,226,155, 10, 9,191,195,188, 86, 34,116,122, 84,186, +246,104,141, 73,166,199, 47, 60,183, 0,105,161,230,171,216, 15,196,140,104, 50,214, 73, 82,204,235,152,120,105, 31,189,102,182, +169, 64, 38,172, 13, 55,115, 35,102, 77,101,128,230,110,203,197,172,177, 75,136,244,202,140, 54,110,166,192,106, 58,212,218, 22, +163,209, 43,120, 32, 19,251,198,195,203, 16,221, 67,203,121,183, 40, 85, 40,121,242,117, 78, 59, 44, 87, 99,187, 54, 34,144,201, +105, 64, 55, 37,216,229, 43, 64, 31,235, 9,100,169, 92,117, 87, 60,226, 93,170,117,202,102,156,196,137,164,185, 53,230,100, 73, +109,212, 75,204,115, 66, 2,132,167,211,202, 90, 55,224,182,147,250,167,139,117, 28,156,101,174,250,192,172,245, 38,126,162, 83, + 41, 16,229,186,154,146, 37,170,162,252, 68,165,109, 72,148, 20,235,131, 98, 64, 77,208,226,214,144, 45, 97,100,245, 60,224, 45, + 41,243,112,133,161, 61,197, 8,212,242, 27,111,177, 81, 62,100, 1,167, 73,180, 66,155,205,232, 58,209, 58, 60,184, 69,233,185, +166,176,179, 4, 85,167, 7,218,132, 25,251, 68,181, 98,161,181, 23,225, 59,151,198,235,112,158, 47,140,179,246, 98,106,145, 82, +164, 82,232,226, 19,130, 53, 21,133, 41,247,227,133,188,210, 92, 5,208,159, 29,211,209, 96,238, 74, 65,230,222, 92,215,185, 50, +187, 34,175, 74, 75,245, 74,162,222,125, 15,175,114, 93,185, 82,175,206,237,223, 18,112,171,185,165, 85,106,187,213,105,253, 92, + 67,108, 33, 41,242, 66, 16, 16,145,242, 74, 64,193,147,108, 11,178,174, 95,232,124, 40, 1, 2, 76,239, 93, 41,217, 57, 83, 21, +168,153, 79, 61, 74,173, 73, 68, 39,115, 84,104,165,232, 12,165,183,210,164, 58,194,220, 45, 56,160, 17,185, 40, 90, 79, 39,195, +185, 36,216, 28,116, 15,210, 49,153,242, 38, 83,172,229, 61, 47,201, 53,217,147,158,106,147,237, 53,215, 17, 9,168, 12,149,149, + 20,180, 18,195, 7,186,184, 9,112,149,108, 10, 37,124,147,142,114,210, 93,111,141,160,185, 79, 76, 43, 25,114,140,220,250,133, + 22, 77, 66,180,168,114, 29, 9,109,201, 82,150,150,152,222,161,200, 9, 75, 13, 40,250, 1,193,244, 9,168, 58,197,156,117,155, + 81,167,234,110,126,125,151, 42, 19, 84,142,252,196,105, 72,101, 27, 80, 16, 18,128, 73, 33, 32, 36, 1,114, 79,169,185,198, 32, + 55,111, 93,175,184, 3,112, 68,206,178, 20, 68, 1,208,128, 21, 62, 67, 94, 90, 44,190, 26, 96,182, 35, 83,239,229,206,186, 19, +177, 46,168,228,253, 48,214,120,217,226,186,221, 70,116,200,177, 29,110,133, 72,165, 83,253,162,100,169,110, 39,101,154, 70,224, +155,132, 41,126, 37, 16, 5,193,235, 96,123,203,252,160,246,140,205, 20,148,205,111,179,189, 42,145, 29,198,247,181, 35, 54,103, +148,184,250,193,191, 37,184,209,221, 74, 15,168,220, 49,194, 61,140,117,166,147,166,117,106, 77, 31, 75,116,193,220,205,158,106, + 46,247,245,249, 50,131,109, 70,165,211,139,136, 75,101, 82, 54,173, 76, 54,119, 93,100, 4,146, 84,139,220, 0, 15,123, 87, 43, + 26,143, 91,130,152, 85,218, 93, 22, 59,203, 78,224,196, 74,148,132,184, 82, 5,207,118,151,227,163,188, 30,240,109,240,196,109, + 45,108, 92,186, 46, 45, 61,225,160,145, 49,202, 82, 12,196,245, 0, 19,212,136,173,182, 18,128,192, 86,228,212, 10,169,168,185, +222,148,234,191, 72,114,173, 33,139,220,173, 84, 90,178,157, 60, 95,146,151, 89,107,215,174,227,240,192,138,206,127,130,234, 4, +169, 15,236, 4,146,224,191, 61, 58,126, 55, 56, 5,171, 49,231,192, 15,184, 29,113, 37,167, 54,144,179,115,126, 9, 23, 30, 92, +142,158,184,160,245, 27, 58,214, 96, 76,118, 59, 50,150, 74, 18, 84,171, 31, 49,127,237, 54,199,109,108,219, 89, 52, 85, 1,224, + 86,106,209,212,173, 99,161,198,105, 9,139, 48, 43,194,119,167,229, 97,138, 3, 81,243,144,170, 33,213, 48,187,144, 70,211,248, +226, 9, 92,206, 85,202,213, 85,200,113,150,226,156, 64,253,163, 97,254, 63,183, 12,219,151, 87,157, 5, 78, 45, 10, 45,166,201, +223,180,155,159, 32, 61, 73,254,204, 91, 29,147, 71,245, 80, 66, 2, 40, 69, 95, 80,234, 20,169,106,111,218, 20,139,240, 8, 56, +217, 31, 88, 42, 69, 1, 66, 97,227,160,191,150, 33,185,230, 21,102,101, 90, 64,102, 3,129,136,227,253,105, 65,241,158,122,122, +249,159,128,192,234,102, 95,171, 76,124, 33,166, 29, 72, 1, 67,144,121, 34,192,254,103,242,197,129,112,201, 76,200,169,131, 53, +102,177,169,149,122,137, 12, 34, 66,213,117, 2, 0, 56,159,233,117, 23, 53,102, 71,219, 84,132,169, 45,149,125,229, 14,189, 49, + 23,210,173, 58,102, 52,148,119,205,151, 93, 67,132, 41, 42, 79,161, 85,255, 0, 36,156,116, 46, 77,135, 10,155,220,165,164,165, +180,160, 2,164,145,240,192,189,162,221, 70, 2,133, 50,180, 21, 57,211,202, 2,104,177,155,109,109, 18,174, 47,199,159, 31,223, +139, 71, 46,206,106, 59, 65,183,159,178,147,233,239, 23,197, 96,198,104, 97, 91, 83,125,160, 39,168,255, 0, 31, 12, 57, 78,119, +143, 14,110,239,110, 54, 4, 2, 71,195, 21,159, 68,138,170,164,149, 85,211, 76,156,236,199,172,204,176, 9,225, 36,158, 5,191, +182,247,193,236,184,249,102, 98, 36, 75,124,132, 54, 55, 58, 80,174,128,117, 24,160, 99,234,211,161,194,203,115, 71, 43, 55, 80, +234,155,159,249,226,235,209,156,221, 73,143, 67,149,152,164,237,152,236,118,194,219, 14,216,160,159, 50,175,112, 0,159,125,177, +203, 99,151,167, 11,195,157,186,203, 57, 68,199, 83,200,122,212,153, 97, 78,172, 35,173, 82,250,153, 11, 62,230,204,217, 87,175, + 67,162,127,163,170, 91,142, 33,178,130, 74,133,192,184,245,185, 41,183,207, 0,233, 57, 15, 55, 71,158,168, 74,203,253,227,215, + 43,238, 66,109,111, 9, 5, 95, 30, 5,135,191, 29, 95,156,243, 46, 77,170,209, 34,214, 34, 48,132,166, 99,131,187, 98, 59, 34, +238,182, 86,148,245, 61, 46,173,191,239, 12, 67, 37,186,186,212,167, 40,241, 86,150, 94,148,227,173,201,117,171, 36, 32, 41, 87, + 41,221,229,202, 58,143, 47,142, 60, 45, 28, 69,121,124,246,141, 0, 73, 53,214,240,223, 5,191,142, 98,205,216,180,160, 10,206, +164,236, 0,212,168,248, 1, 39,199,106,231,164,100,234,165, 98,170, 32,204, 74, 17, 33, 47, 56,222,255, 0, 48,144, 69,128, 61, + 13,249,248, 97,166, 96,200,121,151, 41, 72, 93, 66,116, 87,223, 74, 90, 82, 27, 88, 28, 0, 72,233,240,176,197,238,205, 27, 43, +105,251, 75,170,102,105,172,181, 30, 50,202, 26, 90, 0, 9, 60,241,183, 21,198,165,235,230, 80,206,181, 7,178,252, 22,131, 76, + 8,238, 52, 86, 20, 60,107, 59,118, 43,229,226,252,113, 80,227,183,235,117, 72,111,148,242,210,190,176,195,255, 0, 8,255, 0, + 13,172, 26, 67, 23, 22,203,184,152, 10,112,184,180,153, 38, 37, 41, 66,146,144, 57,193, 10,141,137, 53, 7,165, 79,159,153,148, +191,209, 8,157,234,160, 50, 68,134, 0,241,161, 68,114, 84,158,189, 1, 56,127, 85,203, 89,133, 16,123,199, 32, 37, 46, 37, 10, + 75, 97,193,255, 0, 72, 84, 55, 19,238, 31,192,226, 37, 59, 50, 84, 52, 3, 82,105, 57,246,154,180,184,220,225,221, 84,163,111, +184,121,130, 44,171,143,218, 73, 59,129,245, 22,232, 78, 44,109, 67,212,232,121,131, 37, 58,253, 18,114, 27,113,218,130, 90, 75, +143, 34,203,105,183, 2,128, 62,235, 37, 93,125, 2, 61, 49,189,135,226, 15, 93, 20,148,160, 65,231,208,243,175,158,191, 23,191, + 11,237,120, 27, 25, 72,181,112,170,217,224, 84,217, 87,234, 17, 18,149, 68, 2, 83, 32,200, 0, 16, 70,147, 53, 16,145,146,115, +181,162,185, 41,151,216,106, 52,128,158,237, 6,228,168,168,142,236,143, 49,207, 32,250,131,230, 48, 27, 42,228,233, 75, 91,242, +163,208,164,160, 62,243,178, 31, 64,112,144, 23,117,133,109, 29, 0, 27, 79, 78,182,191, 36,226,207,174,235,141, 69,156,185, 53, + 17, 91,140,135,251,176,168,199,194, 72, 46,161, 41, 74,191,239, 11,110,249, 98, 33,156, 53,239, 44, 83,218, 98,143, 8,182,243, +106,166,149,186,226, 58,149, 23, 20,213,174, 57,242,249,238,198,203, 87,151,197,176,146,141, 9,228,121,111,245,211,198,107,195, +213,100,137,133, 47, 74, 5, 77,126, 84, 24,207, 84, 39, 36, 53,221, 60, 90, 45,164, 19,185, 92,168, 1,238,228, 3,130,232,204, +168,144, 91, 49,161,173,106, 66,129, 95, 22, 3,207,230,122,124,240, 10,179,172,212, 10,117,105,216, 12,229,182,196, 24,234, 12, + 52, 57, 33, 68, 4,128, 57,228,159, 9, 23,249,226,111,151,181, 31, 78,170,240, 36,154,132, 17,222, 71, 67, 8, 72, 77,142,221, +234, 72, 4,250,147,185, 3,220, 78, 29,215, 10, 0, 89, 65, 32,213, 85,218,119,136, 74,170, 37, 92, 91, 21,170, 74,160, 72, 11, + 74,223,127,107,174, 54,139,169, 9, 32, 30, 46, 60,172, 77,253,254,236,104,167,228, 42,188,168, 44,205,167,182,242, 7,117,100, + 41,105, 60,164, 27,124,189,126,126,252, 88, 84, 58,206,152,176,244,174,252, 38, 80, 18,208,219,206,133,219,135, 27, 32, 44, 17, +200, 3,197,111,150, 35,117, 29, 78,204,244, 12,186,197, 66,155, 73,117,234, 66,231,123, 60,106,171,173, 0,217, 54, 32,182,181, + 3,109,195,106,125,198,215,193,154,117,215, 88, 61,150,138, 7,101,115, 7,167,136,137, 32,198,154,209, 81, 97,156, 25, 59,107, +165, 71, 14, 77,212, 74,122,166,165,186,251, 45,168, 74,113,127,104,146,162,120,224, 88,249,139,254,120, 13, 95,200, 57,177,147, + 2, 28,172,216,103, 71, 83,233, 21,118,165, 68, 74,130,153, 36,149, 41, 36, 88,163,132,148,249,223,118, 38, 72,214,106, 43,148, +185,179, 43,113, 80, 36,247,203, 41, 82,133,247,186,110,165,255, 0,186,157,168, 30,251,227, 26,174,176,229, 72,178, 95, 93,102, +150,158,239,184,111,188,142,143,190,178, 65, 82, 83,238, 28, 31,199, 18, 77,205,226, 85,250, 62, 3,239,157, 12,218,229, 61,218, +200,196,203, 85,120, 43, 84,138, 91, 37,150, 18, 21,220,119, 67,105,184, 40,181,189, 57, 63,142, 8, 59, 7, 38,198, 49,218, 48, + 81,223,247,101, 74, 74, 60, 55, 74, 83,207, 79,133,190, 88,139, 86, 51,197, 13,230, 91,101,151, 11, 47, 8,174, 56,243, 0, 89, + 45,130,171, 36,155,123,202, 85,243,196, 94,165, 87,175,205,205,105,109, 51,192, 83, 41, 82, 73, 2,192,223,119,228, 10,186,122, + 39, 5, 98,209,247,213, 18, 69, 36,219,105,173, 76, 28,160,229,214, 42,107, 45, 54,241,117, 13, 37,229,164, 46,200,222, 84, 82, + 5,255, 0,162,113,185,113,159,168, 69,113, 85, 42, 42, 89,238,101, 45, 17,214,100,133, 7,146, 15,133, 96,117, 77,211,110, 15, +166, 43,218, 45,107, 52, 41,247, 95,144,222,246,213, 61, 8, 91,169, 38,229,180,240,144, 9,253,165, 46,223, 60, 75,227,102,232, + 16, 80,135,107,140,144, 94,121, 68, 54,149,130, 90, 27, 60, 55,183, 79, 13,143,198,248,182,253,147,237,142,186, 83, 46,222, 14, +148, 93,132, 83, 32, 70,113,151,104,209,200, 12, 21, 92, 0, 65, 0, 94,231,221,207,231,140,183, 81, 36, 45,114,187,150, 4,126, +232, 20,134,155, 2,235,221,229,242, 3,240,196, 46,161,158,211, 26,168,188,185, 77, 14, 75, 46, 50,133, 60,251,220, 2,149, 40, + 57,180,123,133,147,242,190, 27, 85,245, 29, 84,135,150,234,160,182,134, 88,112, 20,178,216,232,130,162, 19,248,139,159,233, 98, +177,182,114, 96,157, 77, 68, 91,235,169,169,236, 37,101,135, 64,109,135,119, 2, 20, 20,218, 83,193, 89, 89, 10,191,194,223,150, + 31,201, 92, 10,228, 38,152,100, 23, 9, 9, 67,206,146, 80, 91, 4, 17,100,145,231,124, 84, 49,117, 14,170,196, 88,237, 69,130, + 18,227,234,154,164,133,114,123,209,114, 7,226,164,225,244,141, 71,157, 78,150,195, 78, 72, 82, 17,109,165, 8, 7,198,160, 44, +165,126, 0,255, 0,189,137,174,201,212, 57,221, 62, 83, 69,236,144, 14,149,102,202,128,219, 47,186,204, 55,209,189,214,144, 19, +127,190,131,200, 60,244,244,252, 48, 38,100, 89, 47, 84, 99, 54, 34, 37,181,169, 74,238,220,109,177,181, 64, 14,119, 31, 46, 45, +107,226, 28,238,168,199,106,182,152,149,150,139, 11,117,180,186,129,123,146,109,109,222,224, 44, 72, 30,103, 27, 39,103,168, 14, + 67,102,111,183,109,109, 78,169,149, 33, 43,182,203, 35,133,123,199, 76, 69, 54,175,160,130,126,244,168,251, 62, 99, 20,118, 46, + 94,204, 12,230, 41,149,214,106,200, 98, 58,155, 5, 81, 75, 71,119,120, 7, 43,184, 54,177, 22, 22,242, 34,248,144, 53, 75,204, +111, 56,195,194,162,210,155, 40, 42,229,203,115,107, 1,239,253,111,195, 19,206,206,180, 60,145, 42, 45, 87, 93,181, 74,183, 78, +141,147,232, 15, 45,134,189,177, 75, 40,149, 40, 67, 47, 41, 43, 8, 33, 69, 8, 7,121, 72,241, 58, 82,150,210, 60, 74, 41,163, +181, 71,180,119,233,125,125,233, 57,127, 45, 68,161, 83, 90, 10, 84, 72,209,225, 54,219,174, 54,171,132,149,237, 27, 82,121,190, +212,223,109,254,242,173,124,106, 43, 13,125,251, 65,114,233, 8,210, 6,154,170, 7, 32, 58,115, 36,255, 0, 39, 85,142, 86,194, +214,119,218,139,213, 33,234, 53, 34,182,136,145, 33, 48,227, 79, 92,203,146,137, 41, 6, 55,136, 41,190, 58,168, 42,202, 73,183, + 35, 5,169,232, 52,182, 90,106,173, 87, 5,199, 83,246, 73, 74, 71,221, 29, 62, 86,190, 41,202,174,171,230,105,117, 87,123,185, + 74, 42, 47, 39,106, 65,225, 91, 91,221,127,158,227,134, 34,191,155,100, 65,138,235, 50,214,236,135,214,243, 0,172,159, 3,118, + 77,205,189, 54,223,159,222,248, 98,162,172,212,251,105, 7, 42, 99,120,231,231, 85,212,210, 8, 31,115, 87,235,178,242,244,218, +156,105, 74,156,130,236,150,138,152,191, 82, 5,148, 79,167,153, 24,241,179, 71,168,193, 98, 53, 74, 99,125,193, 54, 67,173,158, + 7,136,143,239,199, 46,126,153,103, 89,254,201, 61,181, 62,133,182,242,217,142,234,250, 43,112,252,184, 23,249,224,136,212, 28, +228,186, 97,104, 23, 64,136,175, 24, 74,184,220, 54,128, 79,227,248,168,225,215,131, 28,163, 43,148,197,132, 3, 21,210, 45,190, +221, 5,213,198,165, 50,218,208, 19,246, 69,107,186,184, 54, 39,225,111,227,141,134,173, 75, 33,151,235, 42,140,100, 54,194, 11, +202,109, 2,201, 42, 30,126,224, 79, 31, 28,115,132, 61, 83,204,177,225,173,249, 82, 94,239, 2, 16,148, 92,241,101, 36, 95,240, +177,190, 53, 74,213,138,173, 98, 90,131, 82, 10, 27, 61, 86, 15, 43, 9,177, 10,248,146, 63, 60, 65, 24, 74,231,245,111,206,144, +103, 46,213,211,148,205, 85,166, 81, 97,129, 80, 83, 47, 23,142,228, 45, 12, 37, 92, 88,122,254, 63, 60, 44,114,241,213,108,207, + 8,132,209, 30,121,166,212,144,118,223,139,121, 17,111,158, 22, 8, 48,134, 0,213, 19,227, 36,124, 34,140,150,210, 19,168,248, +213, 70,254, 92, 51, 51, 42,159, 39,184, 99,122, 84, 10,120, 9,108, 89, 95,194,195,231,141,243,227, 42,155, 49,167,212,146,225, +144,224, 17,227, 35,245,136, 22, 3,241,231,228, 49, 61,206, 57,105,138, 91,162,134,195, 91,165, 57, 17,164,132,143, 46, 19,199, +248,244,192, 4,209,165, 69,110, 67,238, 54,127,208, 88,121, 73,144, 69,252, 74, 59, 82, 6, 58,100, 63,157, 2,106, 9,116,144, + 42, 41, 75,159, 42,135, 84, 76,242,248, 87,177, 57,116,237, 61, 87,205,173,240,254,236, 73, 93,173, 68,170,229,242,185,201,184, + 50,131,187, 79,253, 42,202,122, 31,112, 38,231, 17,153, 52, 41, 76,119, 78, 54,217, 8,238,183,171,119,175,151,246, 97,229, 76, + 90, 44, 90,123, 75, 41, 33, 41, 94,193,212,142,164,252,240,234, 66, 93, 0,154,176, 14,162,161, 58,189, 22, 60,202,219, 50,225, + 60, 92,117, 51,139, 75,109, 63,116,160, 16, 47,199,173,215,141,180, 74, 82,198, 99, 57,142, 76,175, 8,134,131,180,255, 0,218, +247,123, 8,252,119, 31,158, 55,188,195,149, 10,139,146, 84,208, 1, 14, 30,237, 32,121,245,255, 0, 7, 14, 90,163, 73,246,182, + 27,152,174,236, 41, 61,227,151, 28, 11,243, 96, 60,205,191,142, 47,165,216, 64, 79, 56,138, 58,213, 40,203, 60,169,206, 95,170, + 85,168,115, 23,152,169,138, 87,120,202,159, 68, 70,201,251,206,184,218,144, 21,111,112, 54,254,145,195,100, 58, 96,190,204, 1, +101,123, 28, 68, 53,222,249,168,164,109, 79,225,206, 36, 45,138,117, 21,110,203,158,180,146, 5,152, 96, 17,116,142,164,251,143, + 78,112, 36, 70, 98,162,226,100,163,106, 92,144,176, 44, 56, 75, 72,189,255, 0,191, 14,130, 12,170, 42,186,179, 41, 32,114, 21, + 31,174,166, 49,117,202,157, 81,226,152,241, 90, 1, 65, 63,121, 68,220,237, 30,243,198, 37,172,126,128,101,125, 49,131,172, 84, + 32,227, 83,230, 83,220,111,184, 43, 27, 90, 88, 86,194, 83,197,239,194,185, 36,245,196, 98,185, 78,135, 94, 92,192,209, 34, 11, + 74,225, 87,229,195,211,143,125,135,200, 12, 36,149,213,169,176,114,244,136,140, 42,156,210,202,253,157,192,118,161,180,130,108, + 44, 69,186, 15,153,195, 56,144,178,148,131,177,215,196, 70,212,253,158,100, 1,247, 21, 21,148,244,211, 6, 61, 73,150, 92,114, +173, 57,231, 36, 57, 37, 5, 68,180,133, 13,160, 40,244, 2,219,143,190,227,211, 25,178,197, 62,108,149,229,193, 61,105,132, 30, + 10,113, 38,234, 43, 32, 14, 72, 29, 73, 32,241,239,196,134,177,245,132,218, 33,162,211, 84, 99,178,167, 65, 82, 27, 81,176,184, + 38,220,243,134, 20,236,169, 74,162,180, 39,205, 84,175, 11,106, 94,230,221, 9,220,161,110, 56, 23,197,164,173, 4, 79,165, 27, + 62,154, 81,214, 50,220,104, 49,149, 22,146,220,223,182,108,108, 67,173,180,202, 45,234, 1, 80,185,231, 2, 42,122, 99,152,159, +238,221,166,186,167, 11, 87, 46, 54,166,129,185,247, 22,212,161,135, 44,167,187,166, 34,175, 29,151,162,182,165,169, 59, 81, 48, + 5,170,194,254, 35,110, 48,242,153, 22,177, 82,154, 19, 37,229,165,148, 55,222,184, 68,162,162,160, 18, 8, 73,241, 27,220,144, + 62,120,100,118,131, 92,194,130, 20, 65,208,214,252,209,154,107, 89,130, 52,104, 53, 56,202,134,212, 6,154,137, 76,136,148,109, +238,216,108, 29,191, 18, 86,165,172,147,212,168,249, 90,217, 66,169,205,137, 25,170,101, 47,190,126, 76,133,134,216,105, 36,169, + 78, 45, 92, 90,222,100,156, 12,143, 29,191, 13, 61,110, 93,198,148, 67, 43, 39,239, 40,155,148,254, 7,140, 75,116,238,148,170, + 53,124,102,233, 21, 36,199, 16, 13,155,120, 50, 22, 82,178,147,114,144,174, 55, 15, 83,211,142, 49, 93,226,219, 13, 24, 30, 67, +169,229, 69, 66,165, 98,118,174,245,236,117,149,169,221,155,180,176, 81, 41,210, 10,235,121,154,130,185,213,218,212, 20,148,206, + 97,215, 88, 87,114,219, 74, 82, 84, 20, 27, 94,221,188, 88, 44,147,101, 95,142,160,200,249,203, 35,232,230, 66,163,118,124,143, +170,143,102,186,141, 49, 5,134,166, 85,100, 50, 37, 60, 84,226,138, 46, 10,130, 90, 72, 10,216,144, 72, 1, 41, 72, 28, 12,124, +222,201,218,233,157,179, 28,199,105, 52,125, 64,159, 10, 35,141, 55, 16, 73,246,102,146,248,101,180,237,178, 84,218, 80, 82,155, + 91,129,201,183,222, 28,131, 42,203,250,215, 59, 38,211,218,133, 73,154,134, 31,113,162,228,183, 1,176, 47, 27,218,254,167,144, + 77,252,241,192, 11,124, 78,209,245,184, 85,222, 89,149, 70,255, 0, 17, 2, 54, 2, 14,194,183,145,136, 21,181,217, 36,194,126, + 63,126,181,209, 26,203,157,153,122,168,184,210,223,120,133,247,207, 6,236,139, 5, 11, 38,215, 6,196,120,111,127,222, 7, 20, +124,247,161,102, 7, 34, 8,110, 23, 29,152,208, 74,210,164,249,133, 35,143,153, 39,240,198,216,249,223, 45,213,226,194,109,169, +233,106,161, 33, 5,180,169, 10,220,219, 77,141,160,146,217,240,254,169,233,111,158, 0,138,165, 6,181, 85,110, 44, 50,219, 18, + 99,177, 47,187,117,181,157,151, 33, 68,172,130,127, 85, 75,227,158,182,227, 23,173,113, 59,244, 5, 37, 68,147,174,227,198,102, +169, 92, 92,169,190,244,233, 81,243, 74,166, 82,243, 67,212, 22, 92,107,189, 59, 66,158, 6,214, 74, 71, 36,124, 72, 82,254, 22, +197,129, 79,203,116,124,189, 25, 20,216,148, 16,239,179,132,186, 17,193, 41,113,196,132,166,231,160, 60,216,126,246,239,217,192, +230,114,190, 82,115, 57,211,204,233,109,247,158,210,227,114,156,176, 37, 76, 50, 71,120,178,125, 84, 5,133,252,175,137, 27, 90, +145,167,236,212,170, 53,216, 42, 76,151,225, 84, 82,252,183, 46,118,184,240, 10,238,155,235,109,169,222, 85,183,223,138, 87,216, +133,229,192,202,153, 51,191,172,127, 3,198,136,130,149,166, 84,119,173, 39, 78,227, 76,170, 71,203,112, 50,235,106,218, 84,185, + 14,132,130, 20,249, 82, 66,208, 61, 18,128, 66, 69,255, 0, 90,254,163, 27,243,206,144,195,202,208,234,134,149, 77,109,231, 98, + 41,133,161,108,177,113,177,231, 60, 71,228, 20, 45,115,228,113, 50,139,172, 25, 75, 35,101, 57,176,217,161,172, 58,167,154, 75, + 18,228, 52, 66,150, 8, 42, 90,238,122,146,178,163,243, 24,205, 61,162,169,143,208,234,181,103, 59,151, 36, 78,149,187,184, 9, + 73,229, 41, 37, 41, 30,224,181,143,247,113,138,155,236, 89, 46,130, 18,114,207, 93,246,250, 77, 89, 67,118,170, 76,102,214,171, +156,203,148,170,153, 87, 81, 98, 81,164,211, 84,220,121, 46,148, 54,226, 27, 60,148,130,175, 46,187,129, 81, 30,226, 61,112, 62, +114,179,140, 73,143, 70,126, 35,232,110, 60,132, 54,225, 3,145,188, 41, 41,255, 0,196,221,191,165,239,197,223, 63, 82,224,230, +138, 13, 47, 49,162,148,202,137,142,164, 2, 64, 42, 37, 44, 41,160,125,215, 90, 27, 62,237,195, 12,243, 60,150,106,105,250,205, +216,237, 33,137, 85, 70,212,250,199, 42, 81,100,160,252,109,117,168, 15, 80,156, 94,180,199, 47, 89, 41,204,152, 59,111,208,254, +213, 5,178,222, 98, 80,175,191,247, 85,210, 41, 89,185,197,187, 78,167, 77,121, 78,179, 37,109, 20, 58, 45,125,138, 41,189,207, +192,226, 83,148, 52,103, 59, 85, 18,219,245,234,170, 98,161,107, 8, 30, 27,149, 19, 99,235,233,231,141, 26,157,152,225,170,163, + 76,127, 46,186,159,105,143, 62,243,130, 71, 11,186, 80,174,158,119, 82,148,171,123,177, 56,163, 78,168,206,204,181, 72, 15, 84, +210,170,117, 52,141,242,146,177,181, 14,166,192,216,251,128, 80,248,131,142,145,174, 53,184, 69,146, 10,219,212,143,145, 0,252, +233,139,106,146, 1,162,244, 77, 13,200,244,165,183, 14,167,152,148,185, 15,188,166,201, 60, 36, 40, 27, 91,241,190, 38,142,105, +231,249, 63,210, 90,143,212,217,157,167,145, 54,100,116,182,176,176, 74, 55, 33,194, 83,240, 41, 4,255, 0, 68,226,156,206,217, +186, 50,114,109, 82,125, 42,114,150, 96, 77,105,194,250, 85,202,212,226,150,155, 3,240,183,225,239,198,138, 69, 94,174,184, 77, +229, 73,117,249, 14, 49, 36, 54,200,108,146,162,133,219,104, 32,115,115,177, 0, 95,203,113,243,189,243,239,177,245,226, 86, 11, +105,228,192, 84,143, 64, 15,212, 82,111, 58, 86, 12,213,217,149, 37, 84, 50,245, 2,153, 14,185, 81,101,111,191, 23,106, 29, 89, + 4,178, 18,171, 41, 64, 92,219,198,180,155,124, 79,166, 42,253, 96,205,199, 42,231, 8, 52,138, 85,119,191, 67,116,244, 9, 18, + 91,118,253,226,238, 65, 82,189, 14,208,158, 61, 45,136,163,185,115, 48,215,106, 68,174,185, 40,164, 84, 80,194, 73,145,225, 75, + 6,206,108,227,204,159, 17,183, 68,132,223,166, 7,106,206,151,214, 93,203, 47, 78,160,214, 59,186,140, 39,254,206, 42,159,191, +181,238, 81,220,155,116, 4, 36,169, 87, 54, 3, 98, 71, 0,227,207, 21,133, 32, 40,229,112,102, 87,132, 13, 77,123, 95,225, 15, + 23, 97,124, 43,198, 12,222,226, 41,254,201, 74,208,163,188,102, 76, 3,238, 84, 79,132,212,190,187,153,106,186,139,166,179, 50, +188, 41,229, 79, 54,209,117,158,243,146, 77,186, 98,133,209, 93, 46,206,203,204,117, 7,179,196,206,230, 68, 48,180,195,102,122, +202, 88, 40, 80,182,235, 0, 20, 85,114, 72,186,128, 6,198,199,166, 29,208,234, 90,153,148,139, 53,226,241, 66, 2, 79,129,181, +238, 4,247,202, 71, 3,206,192, 3,240, 80,245,195,172,205,172,121,255, 0, 48,100,116,215,169,212, 38,228, 74,145, 12,182,171, + 38,196,148,239, 74,172, 71,235, 13,183,183,191, 15,103,133, 98, 86, 97,196, 51,148,133,115, 49, 32,251,244,175,117,198,255, 0, + 17,120, 43, 16,188, 67,133,200, 0,157,137, 19,239, 26,250,117,170,239, 86, 53, 60,162,190,198, 71,145, 81, 76,153,109, 40,182, +149,247,155,137, 5, 64, 1,124, 93, 57,174, 93, 26,183, 1, 84,168,210,251,159,107, 5,231,212,218,249, 66, 6,221,160, 15, 46, + 20, 0,247, 92,121, 99,141,169, 26, 97,169, 47,234, 76,236,233,153,225, 56,219, 12, 48, 95, 73, 32,242,171, 14,158,225,126,191, + 12, 78,169,181,188,242,136,178,101,123, 67,214,117,180,176,183, 86, 73, 40, 72, 95, 32,122,115,197,252,194, 72,199,107,111,128, + 6, 91, 78, 69,137,210,122, 73,175,159, 63, 23,248,222,207,137,125,146,221,133, 72,103, 57,235,250,242, 0, 9,235, 8,159,120, +174,132,168,228,198,212,195, 81,233,217,152,174, 76,183, 26,142,150,186,128,146,158,188,245, 0, 15,157,149,233,141, 67, 65, 38, + 83,169,145,171,149, 9, 66, 64,104, 42, 51, 77,129,247,202, 20,181,172,159, 91, 93, 0, 30,151, 7,211, 16,109, 61,204,153,174, +136,202,235,146,102,184,164,176,242,228, 57, 34, 74,188,100, 4,216,171,241,186,108, 62, 31, 25, 60,206,210, 15,101,218, 43, 19, +221,109, 10, 98, 43, 18, 11,111, 61,254,169,180,166,224, 40,143, 51,183,120, 3,206,254,252, 64,217,223, 45,224,211, 7, 54,186, +199,145,210,188, 17,201,229, 67,179,164,188,149,144,179, 61, 39, 38, 84,170, 42, 92,153,117, 14,237,229, 72,176, 46, 74,186,108, +129,205,138,110,173,160,220, 88,155, 91,207, 26,151, 57,121, 86, 51,207,197,120,173,201,200, 88,105,174,133,107, 77,172,109,251, +189,217, 87, 62, 73, 30,184,131, 49, 94,149,170,177,165,192,155, 65,135, 57, 82,231,165,109,212,165,198, 74,221, 97,123,202, 79, +118,162, 46,144,119,157,214,235,108,108,207,180, 60,247, 62,107,213, 72,144,196, 97, 6, 19,107, 90, 11,132,165, 22, 64,104,219, +204, 3,193,183,150,226, 60,177,180,253,173,163,140,180, 51, 4,187,254, 66, 33, 58, 8, 17,169,215, 78,241,145, 57,132, 1, 4, +213,171,147,100,182, 91, 40, 78, 85, 0, 2,186, 19,212,122, 9,243,169, 45, 31, 57, 63, 77,140,213, 13,198,130,153,105,149, 72, +168,204, 7,149,184,120, 41, 30,160, 38,232, 30,251,159, 46,125,202,253,174,234,206, 34, 70,137, 39, 32, 72,172,211,235, 53, 63, +106,129, 29,173,200,109, 50,172,190,170, 3,238,221, 86,224,245, 2,248,175,148,140,194,213, 38, 16,159, 77, 46,182,200, 91, 79, +148, 19,101, 33, 69, 74,183, 30,151, 4,252,109,235,135,113,245, 43, 52,233,132,228,231, 24,153,101, 5,244,193, 68,122,115,129, + 60, 71, 73, 64, 82,136,226,215, 35,119,251,222,252, 26,213,139,118, 46,130,187,164,153,212,236, 52,141,181,158,158, 85, 89,133, +161, 46,201, 26,108,124, 69, 74,106,181, 42,188, 70, 96, 51, 95,165,174, 44,199,220,121,199,210,225, 22, 74,110,181, 40,220,112, +120, 85,191,162, 48,247, 44,212,104,181, 24,159,164, 25,141,101, 75,147, 36,146,223, 82, 27, 64,228,252,128, 35, 0, 51,134,169, +207,204,249, 34,155, 87,159, 74, 10,147, 37, 0,112,155, 27,157,201, 36,123,143,231,183, 2,242,157, 66,180,183, 13,122,170,148, + 54,201,151,236, 41,141,110, 1,222,157,195,240, 82,142, 1,119,134,134,140,149, 13, 96,233,226, 38, 7,150,158,148,238,165,181, + 18, 18, 52,171,170,100, 12,141, 27, 78,227,230, 22, 42, 32, 84,103, 76,116,200, 74,133,194, 24, 8,105, 40, 73,254,144, 89,249, +140, 72, 32,197,200, 51,147, 20,195,121, 46,200,153,254,138,200, 9,190,237,204, 29,202,248,135, 20,164,255, 0,233,138,146,148, +198, 96,206, 52,183, 27,105,135, 20,147, 18, 55,179, 33,134,138,138,212,227,224,172, 0, 60,249,199,103,253, 30,253,159,180, 86, +145,170,249,107, 54,246,132,170,165, 66,158, 67,180,188,186, 80, 86,150,150, 86,218,125,174, 93,129,186, 82, 87,116,179, 99,117, + 15, 23, 23, 7, 83,135,248,122,231, 19,184, 13, 52, 73, 50,125,195,127,127, 64, 55,171,216,118, 18,246, 36,248,105,160, 73, 63, +181, 49,200,255, 0, 71,190,177,103, 28,139, 23, 61,229, 61, 54,146,253, 29,198, 76,191,172, 29,150,196,118,212, 82,165, 36,216, +190,226, 55, 36, 88,157,201, 4,112, 57,190, 42,236,227,167,185, 88, 83, 37,202,164,148,188,138,115, 95,233,251, 20, 8, 4,180, +132, 1,127, 59, 2,190,125, 65,199,211,222,221, 61,180,116, 55, 34,105,107,255, 0, 84, 33,234,149, 68,199, 82,114,141, 29,149, +150, 29,121,196,110, 6,107,220,110,110, 58,118,148, 33, 36,110, 89, 4, 36, 1,202,126,109,235,119,106,188,147,172,217, 40, 83, + 63,201, 59,244, 60,246,236,182, 69, 86,175, 76,168, 54, 97,212, 89, 9,222,224,113,162,216, 94,253,224, 89, 69,107, 85,183, 2, +162, 44, 7, 75,138,240,214, 23,103,109,144, 93, 17,112,157, 84,149,136, 16,117,208,129,162,163,145,247,154,183,136,224,236, 88, +128,217, 89, 14, 1, 36, 30, 94, 7,161,240,247, 85, 51, 94,165,185, 42, 37, 69,200, 45, 1, 33,166,208,183, 10, 7,250,164,148, + 20,219,243, 72,249, 99,211,147,105,178, 33,198,146,167,138,158, 73,239, 30, 82,211,112,226, 89,181,211,243, 11,255, 0,195,143, + 25,147, 81,131, 42,163, 25,168,133, 70,125, 45, 5, 97, 74,229, 93,218, 11,128,254, 73, 36, 96,132,250,140,186, 88,132,133, 52, + 18,151,105,109,186,217, 41,191,218, 45, 23, 55,249, 90,254,244,156,121,165,218,221, 66,210,218,117,212,252,135,212, 86, 1, 16, + 52,167,206,101,204,165, 77,168, 83,106, 40, 40, 82,221,151, 25,148, 71, 35,162,220, 74, 59,196,252,141,193, 62,182,192,202,165, + 22,151, 86,206,180,170, 28, 18,193,121,214, 24, 10, 88, 55, 74,110,132, 21, 47,221,250,199,231,136,130,107, 21,108,209, 85,145, + 91,128,218,210,219, 10,115,217, 16, 79, 63, 31,193, 36,147,251,184,219,148, 96,213, 98, 74, 85,101,240,225, 29,225,100,150,207, + 54, 33,106, 9, 7,203,144,127, 12, 9, 12, 56, 27, 9, 90,251,209, 77,217,166,164,233,211,188,189,153, 53,101,200,213,202,136, +110,156,149,108,239,208,145,114, 17,112,216,255, 0,186,167, 74, 83,127,253, 48, 10,118, 79,165,196,114, 93, 50, 99,128,200,156, +164, 52,193,191,129,176,149,163,122,189,110, 66, 65,249,156, 17,114, 4,117,102, 71,145,152,158,117, 49,220, 79,219, 58,149, 16, +148,236,113,106, 88,248,110, 73,249,243,131, 51,226,100,217, 52,198, 43, 43,154, 84,229, 78, 43,123, 18,226,249,102, 66, 86,158, + 15,160, 80, 23, 7,223,137,165,197, 38, 6, 99,174,159,127,124,170, 66, 19, 17, 83,236,197,169,157,149,145,217,162, 95,101,109, + 56,206,242,243, 37, 94,163, 49, 51,235,143,192,165, 20, 70,132,243,109,182,148,110,121,221,138, 37, 43, 74,130, 0, 4,157,170, + 81, 0, 46,194,157,202, 52,116, 77,170,203, 99, 81,163, 50,227,244, 10, 27,178,212,204, 67,184, 79, 8, 72, 75,101, 38,195,194, + 72, 72, 85,192,218, 47,215,139,172,135,146,169,249, 18,147, 72,124,161,134,165, 77, 10, 53, 48,183, 18, 1,113,197, 45, 32,149, + 19,111, 9, 77,191,162, 49, 62,200,154, 31, 92,168,213,233,249,240, 86, 33, 57, 17,208,228, 69,247, 46,135, 16,166, 86,210,219, + 91,107, 34,246,225, 65, 68, 11,144, 82,147,198, 52,241,172, 78,217,107,236, 26, 48,211,114, 18,175,242, 49,190,191,249, 70,157, + 60,232,238,188, 28, 80,145,160, 21, 82,183,151, 17, 15, 45, 72,173, 87, 2, 68,247, 26,113, 77,182,148,248, 91,220,162,216, 39, +254,234, 66,172, 61, 72, 62, 88,144,230,122, 76,136, 89,109, 13, 72,121, 78, 73, 20,205,137, 73,109, 33,105,222,157,247, 42,182, +226, 54,173, 9,219,123, 11, 11,121,225,236,220,181, 77,171, 85,230, 50,211,128, 83, 92,150,232, 66, 90, 42, 87,217, 32,172,139, + 21,114,111,116,168,223,203,227,108, 44,192,227,117,140,214,234,234, 47, 36, 33,197, 8,251, 80,174, 55,130,148,148,223,220, 64, +252, 71,174, 50,205,219,133,112,147,182,167,239,238, 42, 9, 82,144,131,227,254,254,117, 27,107, 43,199,111, 37,196, 92,199,144, + 22,195,131,194, 7, 59,213,201, 87,251,187, 71,204,225,157, 14,137, 8,164, 66,152,202, 46, 1, 87,116,163,194,236, 21,201,245, +231,105,196,221,116,186, 75, 84, 95,172,170, 14,132,165,194,180,134,239, 97,100,108,177, 30,242, 71,224,112, 29,138, 13, 34,169, + 91,102,123, 50,194, 75, 14, 44,170,203,253, 80,129,193,249,220,219,214,216,113,116, 84,146,100,193,154, 4, 2,117,168,238,114, +201, 50, 2,164, 48,149,160,161,134, 75,105, 75, 64,112,128, 9,113, 67,230, 21,207,191, 3,232,249, 14, 44,154, 51, 19, 92,103, +104,125,167, 17, 30,201,251,173, 36, 47,197,248,220,124, 70, 44, 42, 99,116,215,145, 50,178,163,181,175,108, 91, 45,130,110, 10, +119, 0,161,239, 4,113,243,193, 56,212, 90, 51, 25,109,140,202,220,132,180,218,170,166, 3, 45, 56,175, 10, 27,229,213,159,251, +163,114, 65,194,246,213,160,132,245,164, 1, 34, 5, 86,201,201, 76, 0, 27,110, 42,188, 40, 77,212,148, 95,157,160,237,249, 2, + 63, 28, 44, 88, 84,220,215, 79,162,211,251,152,208,218,117, 14,202,121,196, 23, 83,117,109, 42,240,222,223,187,180,124,176,177, + 33,114,255, 0, 88,168,129,227, 84, 25,126,185, 94,204,137,206,111, 33, 93,195,142,123, 60,116,129,200,176,219,131, 58,153, 46, +159, 10,108, 28,137, 21,180,161, 13, 52, 94,169, 59,183,149, 44,139,128,126, 29, 62,120, 47,149, 80,143,209,202, 50,118, 11,125, +106, 77,173,241,196,127, 60, 37, 42,204, 82,157, 82, 65, 81,142, 46,162, 57, 60,227,109,167,115,184, 76,108, 72,248,208,180, 43, +138,141,201,128,245,110, 19,145, 91,143,101, 41,105,241,129,194, 0,185, 36,252, 6, 24,154, 18,165,119,245,183,209,100,165, 27, + 80,146, 60,173, 96, 7,229,137,173, 29, 8, 25, 65,106, 8, 0,149, 44, 19,110,190, 36,224, 69, 88, 4,193,142,132,139, 36,173, +119, 3,166, 14, 29, 80, 70,156,207,214, 40,169, 86,177, 81, 12,187,151,144,244,245,169,246,128, 66,146,181, 1,111,196,254, 28, + 99,202, 85, 44,230, 92,212,137, 50, 29,238,216,122,110,196,168,244, 67, 98,247, 63,128,196,142,130, 7,214,149, 17,111,187, 78, + 86,223,119,135, 2,160, 37, 41, 97,205,160, 11, 48,233, 22,242,225, 56, 41,112,151, 39,192,124,106, 68,146, 60,234, 45,152,226, +181,153, 42,179, 30,132, 10, 25, 47, 40,177,239, 70,235,127, 1,130, 95, 82, 67, 49,217,164,197, 66,146,218, 25, 14,186,233, 87, + 43,220, 5,135,187,174, 30, 69,105,164,192, 27, 90, 72,240, 39,162,127,116,227, 20,255, 0,241, 50, 60,189,149,158, 63, 12, 89, +113,213,104, 58, 82, 43, 51,150,162, 21, 42,125, 66, 75,191, 87,192,111,187,101,164,149, 40,129,109,199,158, 62, 88,198, 83, 46, +197,181, 58, 59, 68, 37, 12, 13,196,245, 89, 36, 27,126, 88,152, 67,109, 30,208,201,216, 46, 82,237,205,186,225,142,101,105,164, +202,164,148,182,145,189, 30, 43, 14,190, 47, 60, 17, 15, 28,213, 52,184, 73, 2,128,211,160,200,105, 13,177, 33, 55,113,215, 67, +206,123,147, 99,130,203,160,247,212,231, 34,188,215,137, 18, 93, 79, 35,213, 9,219,135, 19,144,129,154,212, 2, 64, 29,217, 22, +183,149,198, 13,190,148,253, 98,145,180,127,239,231,203,247, 14, 24,184,162,242, 81,200,254,226,162, 84,119,168,196, 74, 44,103, +242, 83,212,183, 63,215,125, 98,210, 83,238, 5, 42, 73,198,172,200,200,165, 86,223, 98,150,124, 45,161,150,148,145,230,108, 73, +255, 0,202, 48, 86,144,148,151, 30, 5, 35,255, 0,140,181,229,251,203,192,185,132,175, 51, 84, 55, 27,255, 0,164, 30,191, 28, + 90, 14, 41, 18, 41,210,117,154, 20,220, 87,225,205, 98, 67,204,144,163,191,186, 4,117, 87, 77,223,138,191, 44, 31,100, 74,238, + 84,195,170,187, 12, 62, 20,224, 79, 69,147, 99,111,241,233,141, 21, 4,165, 50, 89, 41, 72, 22,100,218,195,167,140, 97,252, 14, +114,226,212,121, 37,245, 92,159, 63, 14, 32,181, 21,106,106, 89,180,163,185, 53, 83, 98,184,186,201, 81,218,131,224, 55,234,162, + 69,134, 25,212, 51, 42,227, 85,102,186,233,113,224,167,108,130,151,108, 46, 85,240, 62, 99,242,193,246,208,132,101, 38, 2, 16, + 7,250, 99, 93, 7,255, 0, 40,156, 66,223, 0,178,110, 58,207,231,240, 56,174, 82,151, 0, 36, 84, 80,181, 21, 26, 59, 23, 49, +213,162,202,141, 53, 14,186,160,133,108,121,105, 87, 40,243, 60,121,240, 65,198,184, 57,182,162,197,115,187, 19,220, 81, 17,146, +130,119,159, 53,130,175,198,195, 27,233,169, 79,212,105, 85,133,204,215,238,125,120, 72,192,124,174,211, 78,230, 58,143,122,218, + 85,181,133, 20,238, 23,177,231, 3,202,128, 9,138,121,204, 8, 53, 42,127, 84, 42,241, 37, 75, 90, 11,203,125,246, 84,220, 66, +149,113,222, 45, 67,175,184,219,156, 76,180, 83, 59,140,139, 71,136,151,150,204,135,231,206, 81,222,240,221,180, 37, 55, 91,135, +247,137, 81,182, 42,121,164,251, 68, 83,126,123,213,243,242, 86, 8,197,117,196,199,165,109,113, 66,205,189,107, 31,222,197,117, +219,180,182, 20, 8,164,162, 74, 35,149, 90, 25,139, 82,243,102,104,169, 46,179, 83,150,194,217,106, 66, 82,150,209, 25,176, 2, + 74,200, 9, 7,111, 30,120, 7, 95,205,210, 32,187, 10,157, 10, 65, 11,246, 98,244,133,160,218,202, 95,141, 68, 91,206,214, 31, +142, 54, 83, 90,107,244, 25,106,238,211,115, 45, 36,155,117, 33, 10,182, 5,202, 1,235,173,209,184,134, 92, 0,171,146, 5,198, + 42,165,134,147,221, 3, 74,118,158, 40,128, 5, 90,153, 59, 88, 11,185, 86, 12, 86,135,217,165,166,212,210,119, 88,146, 30, 77, +191, 18,148,143,145,193,182, 53, 42,124,186,155, 9,250,195,100,104,145,146,133,217,127,174, 74,183,185,242, 0,255, 0,189,138, + 98,148,165, 53, 22, 2, 90, 81, 72, 9,108, 0,147,107,120,151,130,217,101,215, 28,136, 67,142, 41, 65, 68, 5, 2,111,113,115, +140,231,236,153, 4, 71, 63,169,171,169,125,100,213,178,229,102, 54,100,173,200, 20,233, 55,145, 17,131, 33, 42,184, 60,165,162, + 64, 63,151,224, 48,202, 22,116,172,119,179,242,188,106,178,203, 78, 52,134,214,176,171,110, 55, 78,243,127, 85, 18,163,126,183, + 89,196, 63, 74, 29,119,184,172,191,222, 43,121, 91,137, 43,191, 36,119, 99,139,250, 97,218,201,110,124,197, 54,118,158,253,174, + 83,199,174, 2,182,144,131,147,124,191,193,250,211,174,225,193, 83,188,195,169, 15,214, 34, 76,202,144,223,106, 43,109,204, 74, +159, 41,235,116, 1, 97,129,209,181,101,228,102, 53, 49, 79,121, 81,223,101, 41, 66, 95, 32, 18,149, 46,201,189,252,143,132, 95, +204,238,242,177,196, 90,151,246,149,169,129,207, 22,245, 58, 87,187,157,199,127, 83,235,136,234,212,164,200,113, 73, 36, 19, 95, + 72, 36,121,128, 77,177, 30,193,151, 19,146, 52,253,247,167, 55, 78,164,213,215, 11, 85,254,168,174, 56,210, 17,176,176,203,237, +193, 96,168,149, 19,180,169,110,174,253, 84,162, 83,184,254,207,132, 88, 18, 48, 51, 44,231,218,156,250,104, 19,234,234, 93, 70, + 89, 88,114, 75,137, 30, 6,212,160, 22, 71,225,180,124,134, 42,202,204,185, 74,206,189,234,164,184, 84,168,242, 55, 40,172,220, +221,196,223, 6, 50, 66,214,181,160,173,100,253,156,113,201,242,239,209,198, 2,109, 25, 26,199, 79,173, 56,191,184, 3, 67, 82, +120,185,241,183, 27,164,199, 66, 84,166,105, 17, 92,109,198,148, 62,242,192, 86,213,123,237,112,126, 8,192, 58, 22,112,118,141, + 73,106, 20,215, 10, 98,198,150,149,183, 99, 98, 82,164, 36, 18, 61,228,121,254,241,192,106, 59,142, 8,205,168, 56,171,170,107, +161, 70,253, 65, 28,224,126,102, 36, 64,216, 15, 2, 67, 0, 15,119,135, 6,106,221,180,166, 60,127,127,222,138,111,159, 81,130, +106,210,117,218, 94,106,139, 14, 52, 40,169, 50, 38,182,224, 37, 99,239,180, 28,240,139,122, 0,132,252,176, 2,152,198, 91,167, + 81, 26, 19,226,119,170,144, 86,148, 53,251,123, 66,249, 31, 21, 20,252,206, 8,100,175, 13, 86,158,226,120, 82, 50,188,133, 33, + 67,170, 78,215,185, 30,135, 13,139, 45, 43, 58, 82,153, 83, 73, 40, 69, 56, 20, 36,167,132,158,224, 30, 7,151, 60,252,112, 34, +165, 37,194,128,116,137,249,254,213, 73,199, 20,189, 77,103, 50, 50,171, 52,151,105,222,201,181,181, 54,204,116,243, 97,117, 18, +234,254, 67,106,148,125,195,223,136,149, 74,137, 50, 69, 1, 89,109, 12,165,201, 82, 18, 88,140,130,200, 88, 80,189,214,162, 15, + 81,181, 42, 32,122,145,235,137,102,164,188,244, 58, 10, 61,145,213, 53,121,210,193,238,213,183,139,161, 54,227,221,199,195,140, + 65, 96, 85,170,163, 85,227,182, 42,114, 2, 82, 65, 74,123,229, 88, 92, 11,219,156, 18,212,173,198,179,131, 16, 38, 60, 69, 4, + 62,164, 43, 77,232,214,152,101, 40, 57,109,109, 46,130,128,150,208,219,110, 33,151, 58,188,225,109, 42, 82,207,244,130,184,247, + 96,222, 99,156,243, 57, 77,215,229, 74, 46,189, 61,226,135,155, 72,232,148,144,176,143,154,128,192,250, 17, 40,163,184,164,155, + 16,211, 64, 17,229,215, 15,106,232, 65,160,196,186, 7, 53, 27,158, 58,248,159,254,225,248, 97,238, 30,122,230,247,180,117, 82, + 73,212,243, 53, 12,217,211, 78, 40,244, 41,174, 52,170, 60, 70, 59,192, 86,134,208,222,223,245,138,119,187, 63,193, 55, 63, 19, +134, 89,174,141,245,254, 66, 20, 90,124, 36, 23, 99,184,118, 40,162,251, 82,164, 13,234,249, 91,241,196,183, 47, 45,104,205, 41, + 8, 89, 22,109,229, 11, 31, 48,226, 82, 15,198,220,124, 56,192, 60,170,227,138, 27, 20,226,136, 44, 55,112, 79, 28,145,124, 87, +237, 8,118, 35,104, 62,253,169,167, 46,162,163,240,116,170,176,131, 37,170,154, 10, 88,130,243, 43, 59, 58, 54, 0, 42, 41, 30, +251,165, 35,250,120,245,172,141, 81,155,146,154,158,167,183, 58, 43,206,188,251, 97, 54,185,113, 2,196, 31, 59, 40,145,242,197, +163,168, 11, 91, 57,122, 74,154, 81, 73, 83,237,238, 41, 54,191,216,177,136,149, 41,107, 57,106,152,146,179, 98,182,137, 23,234, + 74,213,124, 58, 46,220, 90, 65,241, 31, 35, 81,237,148, 5, 61,133,153,179, 29, 34, 22, 93, 6, 59,125,221, 29,180, 60,182, 26, +104, 52, 22,134,130, 77,136, 0,117, 13,131,126,167,125,249,190, 39, 57, 63, 87,243,142, 80,205, 84,170,229, 6,164,149, 74, 17, + 1,122, 68,129,112, 84,132,135, 20, 20, 60,199,137, 39,223,179, 0,243,139,104, 53,153,224,160, 31,180,183, 79, 34,216, 4,126, + 28, 98, 46,151, 93,180,223,181, 87,134, 44,205,190, 46,156, 50, 49,173,105,139, 94,164,246,200, 81, 10,153,208,243,235, 87,173, +239,110, 27, 88, 90, 21, 7,125, 42, 97,169,122,149, 43, 53, 84,230,230, 10,213,110, 68,135,159, 12,203,146,241,115,196,164,119, +103, 98, 61,194,193, 92, 11,117,192, 26,117, 66,155, 27, 52,174, 74,226, 37,108,182,195, 8, 89, 39,130,181, 51,189,119,245,232, + 71,204,226, 63, 81,241, 65,169, 37, 92,143,102, 96, 88,250,119,110,113,135,147, 64, 74,165, 16, 45,224,127,167,185,133, 91, 15, +123,112,235,168, 82,148, 73, 36, 30,126, 0,205, 13,199,150,181, 74,140,147, 91, 13,124,198,204,169,168,204, 85,195,173,167,187, + 72,243, 74,129, 22,249,139, 12,107,175,202,169, 73, 37,169, 79,119,150,109,105,110,223,168, 27, 72,184, 30,235,169, 71,229,129, + 85,162,125,146, 18,175,200,146,205,143,167,137, 56, 41,153, 0, 69, 88,165, 34,194,243, 56, 31,253, 66, 49,146,176, 2,129,231, +251, 85, 2,179, 88,229, 26,116,185,116, 78,237,108, 4,170, 85,101, 49,247,142, 10, 91, 86,228,168,126, 35,243, 62,184,153,101, +236,190,244,108,169, 89,101,136, 96,189, 30,190,205,156,243,108, 50,137, 36,129,238,220,166,255, 0, 15,126, 26,105,202, 82,105, +144, 9, 72,230,168,130,120,255, 0,233,226,111, 77, 1, 45,230, 52,164, 88,123, 68,179, 97,235,199, 56,203,186,186,113, 25,136, +229,251,138, 65,197, 21,197, 86,149, 57,202,148, 32,208,170, 49, 3, 76, 54,194,153,144,233, 28,237, 43, 46, 42,254,242, 2,191, + 19,136,229,117, 77, 42,167, 13,134,128,108,180, 25, 66,210,179, 96, 28,184, 73, 63, 11,146,126, 24,153,234,235,104, 69, 94,174, +148, 32, 0,154,250, 18, 0, 29, 6,213,113,240,197,125,154,137, 57,174, 85,205,236,165, 17,127, 35, 97,139,246,103,180,107, 56, +211, 64,125, 96,253,105,103, 84,111, 82,170,205, 31, 79,100,211,169,243, 51, 83, 73,155, 46, 3, 41, 49, 99, 21,158,236,172, 0, +159, 16, 29, 78,237,199,155,129,111, 50,120,121, 70,207,117, 92,179, 57, 84,124,189, 85,112,198,219, 29,229, 65, 46, 89,152,235, + 80, 5,194,144, 58, 27, 91,159,221,231, 16, 37, 18,170,199,136,223,236, 28, 60,250,220,115,141,212,117, 40, 72,168,172, 40,220, +193, 93,205,249,251,131, 22, 84,214,116,128,179, 35,167,190,162,167, 20, 83, 21,179, 76,230,231,252,201, 85,122, 50, 42, 13, 51, + 74, 18,195, 20,213, 37,145,222,144, 92, 32,173, 68,139,131,100,147, 97,231,110,125, 95, 69,211,154,212,170, 34,234,109, 87, 36, + 41, 2,178,165, 45, 14,155,247,105,223,226,177,181,193, 36, 35,142,156,121, 99, 13, 40,113,104,102,159,177,100, 94,168,229,236, +127,117,120,147,103,183, 92,143,147,229, 37,135, 20,128,115, 69,136, 65,181,193,108,146, 56,196, 46, 93, 87,108, 82,152, 30, 67, +239, 90, 98,234,243,122, 84,123, 83,233, 21,255, 0,173,195,139,148,145, 31,111,121, 22, 59, 74, 35,112, 5, 54, 22,242, 5, 74, +176,247, 32,225,133, 86,137, 63, 44, 40, 71, 98,104,117,228,160,170, 78,211,113,193, 73, 42, 63, 21, 92,129,233,183, 7,245, 75, +255, 0,121,134,191, 63,110,124, 95,220, 24, 22, 31, 43,159,196,225,181, 88, 5,214, 10,150, 46, 85, 17,237,196,249,248,157,192, +109, 84, 75, 72, 79, 40,249, 69, 73, 75, 49, 90,242,131, 50,106, 84, 41, 8, 88, 87,117, 74,166,187, 49,198,239,203,174, 56,160, +150,211,242, 54, 81, 62,236, 55,118, 61, 99, 48,209,163, 82,153,152,190,233,137, 72, 9,106,246, 73,113,221,169, 22,248,217, 87, +248, 39, 5,104, 11, 90,103,230,128,149,144, 63, 70,209,192, 62,232,223,222,112, 11, 36,186,239,121, 79, 29,226,185,172,193,191, +139,247, 18,112,109,136,143,191,189,169,131,138,137,167,153,222,149, 38,137, 83, 77, 57,167, 84,144,210, 54,157,135,169, 79,132, +159,196, 28, 44, 21,206,169, 74,179, 93, 67,114, 65,180,199, 64,184,232, 55, 30, 48,176, 16,250,128,218,132, 28, 49, 95,255,217, + 0}; + diff --git a/source/blender/src/toolbox.c b/source/blender/src/toolbox.c index 8a8d7c8cec7..c8a20cdc951 100644 --- a/source/blender/src/toolbox.c +++ b/source/blender/src/toolbox.c @@ -123,6 +123,8 @@ #include "BPY_extern.h" #include "BPY_menus.h" +#include "BLO_sys_types.h" // for intptr_t support + void asciitoraw(int ch, unsigned short *event, unsigned short *qual) { if( isupper(ch) ) { @@ -238,7 +240,7 @@ void error_libdata(void) int saveover(char *file) { - int len= strlen(file); + size_t len= strlen(file); if(len==0) return 0; @@ -1756,8 +1758,8 @@ static uiBlock *tb_makemenu(void *arg) static int tb_mainx= 1234, tb_mainy= 0; static void store_main(void *arg1, void *arg2) { - tb_mainx= (long)arg1; - tb_mainy= (long)arg2; + tb_mainx= (intptr_t)arg1; + tb_mainy= (intptr_t)arg2; } static void do_group_addmenu(void *arg, int event) @@ -2185,27 +2187,27 @@ void toolbox_n(void) but=uiDefBlockBut(block, tb_makemenu, menu1, str1, mval[0]-(1.5*dx)+tb_mainx,mval[1]+tb_mainy, dx, 19, ""); uiButSetFlag(but, UI_MAKE_TOP|UI_MAKE_RIGHT); - uiButSetFunc(but, store_main, (void *)(long)dx, (void *)(long)-5); + uiButSetFunc(but, store_main, (void *)(intptr_t)dx, (void *)(intptr_t)-5); but=uiDefBlockBut(block, tb_makemenu, menu2, str2, mval[0]-(0.5*dx)+tb_mainx,mval[1]+tb_mainy, dx, 19, ""); uiButSetFlag(but, UI_MAKE_TOP); - uiButSetFunc(but, store_main, (void *)(long)0, (void *)(long)-5); + uiButSetFunc(but, store_main, (void *)(intptr_t)0, (void *)(intptr_t)-5); but=uiDefBlockBut(block, tb_makemenu, menu3, str3, mval[0]+(0.5*dx)+tb_mainx,mval[1]+tb_mainy, dx, 19, ""); uiButSetFlag(but, UI_MAKE_TOP|UI_MAKE_LEFT); - uiButSetFunc(but, store_main, (void *)(long)-dx, (void *)(long)-5); + uiButSetFunc(but, store_main, (void *)(intptr_t)-dx, (void *)(intptr_t)-5); but=uiDefBlockBut(block, tb_makemenu, menu4, str4, mval[0]-(1.5*dx)+tb_mainx,mval[1]+tb_mainy-20, dx, 19, ""); uiButSetFlag(but, UI_MAKE_DOWN|UI_MAKE_RIGHT); - uiButSetFunc(but, store_main, (void *)(long)dx, (void *)(long)5); + uiButSetFunc(but, store_main, (void *)(intptr_t)dx, (void *)(intptr_t)5); but=uiDefBlockBut(block, tb_makemenu, menu5, str5, mval[0]-(0.5*dx)+tb_mainx,mval[1]+tb_mainy-20, dx, 19, ""); uiButSetFlag(but, UI_MAKE_DOWN); - uiButSetFunc(but, store_main, (void *)(long)0, (void *)(long)5); + uiButSetFunc(but, store_main, (void *)(intptr_t)0, (void *)(intptr_t)5); but=uiDefBlockBut(block, tb_makemenu, menu6, str6, mval[0]+(0.5*dx)+tb_mainx,mval[1]+tb_mainy-20, dx, 19, ""); uiButSetFlag(but, UI_MAKE_DOWN|UI_MAKE_LEFT); - uiButSetFunc(but, store_main, (void *)(long)-dx, (void *)(long)5); + uiButSetFunc(but, store_main, (void *)(intptr_t)-dx, (void *)(intptr_t)5); } else if (tot==5 || tot==7) { /* check if it fits, dubious */ if(mval[0]-0.25*dx+tb_mainx < 6) mval[0]= 6 + 0.25*dx -tb_mainx; @@ -2282,7 +2284,7 @@ void toolbox_generic( TBitem *generic_menu ) TBitem *menu; int dx=96; short event, mval[2]; - long ypos = -5; + intptr_t ypos = -5; tb_mainx= -32; tb_mainy= -5; diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c index 9f2f58d0cdb..efb86b59ed1 100644 --- a/source/blender/src/transform_conversions.c +++ b/source/blender/src/transform_conversions.c @@ -144,6 +144,8 @@ extern ListBase editelems; #include "transform.h" +#include "BLO_sys_types.h" // for intptr_t support + /* local function prototype - for Object/Bone Constraints */ static short constraints_list_needinv(TransInfo *t, ListBase *list); /* local function prototype - for finding number of keyframes that are selected for editing */ @@ -1913,7 +1915,7 @@ static void set_crazyspace_quats(float *origcos, float *mappedcos, float *quats) EditVert *eve, *prev; EditFace *efa; float *v1, *v2, *v3, *v4, *co1, *co2, *co3, *co4; - long index= 0; + intptr_t index= 0; /* two abused locations in vertices */ for(eve= em->verts.first; eve; eve= eve->next, index++) { @@ -1925,13 +1927,13 @@ static void set_crazyspace_quats(float *origcos, float *mappedcos, float *quats) for(efa= em->faces.first; efa; efa= efa->next) { /* retrieve mapped coordinates */ - v1= mappedcos + 3*(long)(efa->v1->prev); - v2= mappedcos + 3*(long)(efa->v2->prev); - v3= mappedcos + 3*(long)(efa->v3->prev); + v1= mappedcos + 3*(intptr_t)(efa->v1->prev); + v2= mappedcos + 3*(intptr_t)(efa->v2->prev); + v3= mappedcos + 3*(intptr_t)(efa->v3->prev); - co1= (origcos)? origcos + 3*(long)(efa->v1->prev): efa->v1->co; - co2= (origcos)? origcos + 3*(long)(efa->v2->prev): efa->v2->co; - co3= (origcos)? origcos + 3*(long)(efa->v3->prev): efa->v3->co; + co1= (origcos)? origcos + 3*(intptr_t)(efa->v1->prev): efa->v1->co; + co2= (origcos)? origcos + 3*(intptr_t)(efa->v2->prev): efa->v2->co; + co3= (origcos)? origcos + 3*(intptr_t)(efa->v3->prev): efa->v3->co; if(efa->v2->tmp.p==NULL && efa->v2->f1) { set_crazy_vertex_quat(quats, co2, co3, co1, v2, v3, v1); @@ -1940,8 +1942,8 @@ static void set_crazyspace_quats(float *origcos, float *mappedcos, float *quats) } if(efa->v4) { - v4= mappedcos + 3*(long)(efa->v4->prev); - co4= (origcos)? origcos + 3*(long)(efa->v4->prev): efa->v4->co; + v4= mappedcos + 3*(intptr_t)(efa->v4->prev); + co4= (origcos)? origcos + 3*(intptr_t)(efa->v4->prev): efa->v4->co; if(efa->v1->tmp.p==NULL && efa->v1->f1) { set_crazy_vertex_quat(quats, co1, co2, co4, v1, v2, v4); diff --git a/source/blender/src/transform_generics.c b/source/blender/src/transform_generics.c index c332fd723eb..656fca3cad8 100644 --- a/source/blender/src/transform_generics.c +++ b/source/blender/src/transform_generics.c @@ -32,6 +32,8 @@ #include "MEM_guardedalloc.h" +#include "BLO_sys_types.h" // for intptr_t support + #include "DNA_action_types.h" #include "DNA_armature_types.h" #include "DNA_constraint_types.h" diff --git a/source/blender/yafray/intern/export_Plugin.cpp b/source/blender/yafray/intern/export_Plugin.cpp index 6ae4a31bf50..77d53c4ed96 100644 --- a/source/blender/yafray/intern/export_Plugin.cpp +++ b/source/blender/yafray/intern/export_Plugin.cpp @@ -74,7 +74,7 @@ extern "C" { extern char bprogname[]; } // add drive character if not in path string, using blender executable location as reference static void addDrive(string &path) { - int sp = path.find_first_of(":"); + size_t sp = path.find_first_of(":"); if (sp==-1) { string blpath = bprogname; sp = blpath.find_first_of(":"); diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index 2ee8b54a014..d8b2e063a9d 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -484,17 +484,10 @@ char BL_ActionActuator::GetAction_doc[] = PyObject* BL_ActionActuator::PyGetAction(PyObject* self, PyObject* args, PyObject* kwds) { - PyObject *result; - if (m_action){ - result = Py_BuildValue("s", m_action->id.name+2); + return PyString_FromString(m_action->id.name+2); } - else{ - Py_INCREF(Py_None); - result = Py_None; - } - - return result; + Py_RETURN_NONE; } /* getProperty */ @@ -640,8 +633,7 @@ PyObject* BL_ActionActuator::PySetAction(PyObject* self, return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* setStart */ @@ -662,8 +654,7 @@ PyObject* BL_ActionActuator::PySetStart(PyObject* self, return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* setEnd */ @@ -684,8 +675,7 @@ PyObject* BL_ActionActuator::PySetEnd(PyObject* self, return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* setBlendin */ @@ -707,8 +697,7 @@ PyObject* BL_ActionActuator::PySetBlendin(PyObject* self, return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* setBlendtime */ @@ -735,8 +724,7 @@ PyObject* BL_ActionActuator::PySetBlendtime(PyObject* self, return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* setPriority */ @@ -759,8 +747,7 @@ PyObject* BL_ActionActuator::PySetPriority(PyObject* self, return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* setFrame */ @@ -785,8 +772,7 @@ PyObject* BL_ActionActuator::PySetFrame(PyObject* self, return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* setProperty */ @@ -808,8 +794,7 @@ PyObject* BL_ActionActuator::PySetProperty(PyObject* self, return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* setFrameProperty */ @@ -830,8 +815,7 @@ PyObject* BL_ActionActuator::PySetFrameProperty(PyObject* self, return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* @@ -848,8 +832,7 @@ PyObject* BL_ActionActuator::PyGetChannel(PyObject* self, return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } */ @@ -934,8 +917,7 @@ PyObject* BL_ActionActuator::PySetChannel(PyObject* self, } } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* getType */ diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index a6337403cd1..edc14dabc70 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1946,10 +1946,22 @@ void BL_ConvertBlenderObjects(struct Main* maggie, //parentinversenode->SetLocalOrientation(parinvtrans.getBasis()); // Extract the rotation and the scaling from the basis - MT_Matrix3x3 inverseOrientation(parinvtrans.getRotation()); - parentinversenode->SetLocalOrientation(inverseOrientation); - MT_Matrix3x3 scale(inverseOrientation.transposed()*parinvtrans.getBasis()); - parentinversenode->SetLocalScale(MT_Vector3(scale[0][0], scale[1][1], scale[2][2])); + MT_Matrix3x3 ori(parinvtrans.getBasis()); + MT_Vector3 x(ori.getColumn(0)); + MT_Vector3 y(ori.getColumn(1)); + MT_Vector3 z(ori.getColumn(2)); + MT_Vector3 scale(x.length(), y.length(), z.length()); + if (!MT_fuzzyZero(scale[0])) + x /= scale[0]; + if (!MT_fuzzyZero(scale[1])) + y /= scale[1]; + if (!MT_fuzzyZero(scale[2])) + z /= scale[2]; + ori.setColumn(0, x); + ori.setColumn(1, y); + ori.setColumn(2, z); + parentinversenode->SetLocalOrientation(ori); + parentinversenode->SetLocalScale(scale); parentinversenode->AddChild(gameobj->GetSGNode()); } @@ -2129,7 +2141,24 @@ void BL_ConvertBlenderObjects(struct Main* maggie, float* fl = (float*) blenderobject->parentinv; MT_Transform parinvtrans(fl); parentinversenode->SetLocalPosition(parinvtrans.getOrigin()); - parentinversenode->SetLocalOrientation(parinvtrans.getBasis()); + + // Extract the rotation and the scaling from the basis + MT_Matrix3x3 ori(parinvtrans.getBasis()); + MT_Vector3 x(ori.getColumn(0)); + MT_Vector3 y(ori.getColumn(1)); + MT_Vector3 z(ori.getColumn(2)); + MT_Vector3 scale(x.length(), y.length(), z.length()); + if (!MT_fuzzyZero(scale[0])) + x /= scale[0]; + if (!MT_fuzzyZero(scale[1])) + y /= scale[1]; + if (!MT_fuzzyZero(scale[2])) + z /= scale[2]; + ori.setColumn(0, x); + ori.setColumn(1, y); + ori.setColumn(2, z); + parentinversenode->SetLocalOrientation(ori); + parentinversenode->SetLocalScale(scale); parentinversenode->AddChild(gameobj->GetSGNode()); } diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp index 242d648b062..942e3b502e0 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp +++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp @@ -464,17 +464,10 @@ char BL_ShapeActionActuator::GetAction_doc[] = "\tReturns a string containing the name of the current action.\n"; PyObject* BL_ShapeActionActuator::PyGetAction(PyObject* self) { - PyObject *result; - if (m_action){ - result = Py_BuildValue("s", m_action->id.name+2); + return PyString_FromString(m_action->id.name+2); } - else{ - Py_INCREF(Py_None); - result = Py_None; - } - - return result; + Py_RETURN_NONE; } /* getProperty */ @@ -591,12 +584,10 @@ PyObject* BL_ShapeActionActuator::PySetAction(PyObject* self, } } else { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* setStart */ @@ -614,12 +605,10 @@ PyObject* BL_ShapeActionActuator::PySetStart(PyObject* self, m_startframe = start; } else { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* setEnd */ @@ -637,12 +626,10 @@ PyObject* BL_ShapeActionActuator::PySetEnd(PyObject* self, m_endframe = end; } else { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* setBlendin */ @@ -661,12 +648,10 @@ PyObject* BL_ShapeActionActuator::PySetBlendin(PyObject* self, m_blendin = blendin; } else { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* setBlendtime */ @@ -690,12 +675,10 @@ PyObject* BL_ShapeActionActuator::PySetBlendtime(PyObject* self, m_blendframe = m_blendin; } else { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* setPriority */ @@ -715,12 +698,10 @@ PyObject* BL_ShapeActionActuator::PySetPriority(PyObject* self, m_priority = priority; } else { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* setFrame */ @@ -742,12 +723,10 @@ PyObject* BL_ShapeActionActuator::PySetFrame(PyObject* self, m_localtime=m_endframe; } else { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* setProperty */ @@ -766,12 +745,10 @@ PyObject* BL_ShapeActionActuator::PySetProperty(PyObject* self, m_propname = string; } else { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* getType */ @@ -793,7 +770,6 @@ PyObject* BL_ShapeActionActuator::PySetType(PyObject* self, short typeArg; if (!PyArg_ParseTuple(args, "h", &typeArg)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index 53ac730d203..cb2521de9a4 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -540,9 +540,16 @@ void BL_ConvertActuators(char* maggiename, // does the 'original' for replication exists, and // is it in a non-active layer ? SCA_IObject* originalval = NULL; - if (editobact->ob && !(editobact->ob->lay & activeLayerBitInfo)) - originalval = converter->FindGameObject(editobact->ob); - + if (editobact->ob) + { + if (editobact->ob->lay & activeLayerBitInfo) + { + fprintf(stderr, "Warning, object \"%s\" from AddObject actuator \"%s\" is not in a hidden layer.\n", objectname.Ptr(), uniquename.Ptr()); + } + else { + originalval = converter->FindGameObject(editobact->ob); + } + } MT_Vector3 linvelvec ( KX_BLENDERTRUNC(editobact->linVelocity[0]), KX_BLENDERTRUNC(editobact->linVelocity[1]), KX_BLENDERTRUNC(editobact->linVelocity[2])); diff --git a/source/gameengine/Converter/KX_ConvertSensors.cpp b/source/gameengine/Converter/KX_ConvertSensors.cpp index 5e433bb821b..4806df36090 100644 --- a/source/gameengine/Converter/KX_ConvertSensors.cpp +++ b/source/gameengine/Converter/KX_ConvertSensors.cpp @@ -65,6 +65,7 @@ probably misplaced */ #include "SCA_JoystickSensor.h" #include "KX_NetworkMessageSensor.h" #include "SCA_ActuatorSensor.h" +#include "SCA_DelaySensor.h" #include "SCA_PropertySensor.h" @@ -281,6 +282,22 @@ void BL_ConvertSensors(struct Object* blenderobject, break; } + case SENS_DELAY: + { + // we can reuse the Always event manager for the delay sensor + SCA_EventManager* eventmgr = logicmgr->FindEventManager(SCA_EventManager::ALWAYS_EVENTMGR); + if (eventmgr) + { + bDelaySensor* delaysensor = (bDelaySensor*)sens->data; + gamesensor = new SCA_DelaySensor(eventmgr, + gameobj, + delaysensor->delay, + delaysensor->duration, + (delaysensor->flag & SENS_DELAY_REPEAT) != 0); + } + break; + } + case SENS_COLLISION: { SCA_EventManager* eventmgr = logicmgr->FindEventManager(SCA_EventManager::TOUCH_EVENTMGR); @@ -741,10 +758,24 @@ void BL_ConvertSensors(struct Object* blenderobject, for (int i=0;itotlinks;i++) { bController* linkedcont = (bController*) sens->links[i]; - SCA_IController* gamecont = converter->FindGameController(linkedcont); + if (linkedcont) { + SCA_IController* gamecont = converter->FindGameController(linkedcont); - if (gamecont) { - logicmgr->RegisterToSensor(gamecont,gamesensor); + if (gamecont) { + logicmgr->RegisterToSensor(gamecont,gamesensor); + } else { + printf( + "Warning, sensor \"%s\" could not find its controller" + "(link %d of %d)\n" + "\tthere has been an error converting the blender controller for the game engine," + "logic may be incorrect\n", sens->name, i+1, sens->totlinks); + } + } else { + printf( + "Warning, sensor \"%s\" has lost a link to a controller" + "(link %d of %d)\n" + "\tpossible causes are partially appended objects or an error reading the file," + "logic may be incorrect\n", sens->name, i+1, sens->totlinks); } } // done with gamesensor diff --git a/source/gameengine/Expressions/InputParser.cpp b/source/gameengine/Expressions/InputParser.cpp index 24033dd21a2..32a9de32e21 100644 --- a/source/gameengine/Expressions/InputParser.cpp +++ b/source/gameengine/Expressions/InputParser.cpp @@ -631,7 +631,8 @@ void CParser::SetContext(CValue* context) PyObject* CParserPyMake(PyObject* ignored,PyObject* args) { char* txt; - Py_Try(PyArg_ParseTuple(args,"s",&txt)); + if (!PyArg_ParseTuple(args,"s",&txt)) + return NULL; CParser parser; CExpression* expr = parser.ProcessText(txt); CValue* val = expr->Calculate(); @@ -641,7 +642,7 @@ PyObject* CParserPyMake(PyObject* ignored,PyObject* args) static PyMethodDef CParserMethods[] = { - { "calc", CParserPyMake , Py_NEWARGS}, + { "calc", CParserPyMake , METH_VARARGS}, { NULL,NULL} // Sentinel }; diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index bbf58a8a06e..9ffdbb1223c 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -43,7 +43,7 @@ PyObject* listvalue_buffer_item(PyObject* list,Py_ssize_t index) return ((CListValue*) list)->GetValue(index)->AddRef(); } - Py_Error(PyExc_IndexError, "Python ListIndex out of range"); + PyErr_SetString(PyExc_IndexError, "Python ListIndex out of range"); return NULL; } @@ -130,9 +130,10 @@ listvalue_buffer_concat(PyObject * self, PyObject * other) } } - if (error) - Py_Error(PyExc_SystemError, "Python Error: couldn't add one or more items to a list"); - + if (error) { + PyErr_SetString(PyExc_SystemError, "Python Error: couldn't add one or more items to a list"); + return NULL; + } } else { @@ -155,8 +156,8 @@ listvalue_buffer_concat(PyObject * self, PyObject * other) listval->Add(objval); } else { - Py_Error(PyExc_SystemError, "Python Error: couldn't add item to a list"); - // bad luck + PyErr_SetString(PyExc_SystemError, "Python Error: couldn't add item to a list"); + return NULL; } } } diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index aabcd6cb71d..8937f481922 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -94,7 +94,7 @@ PyObjectPlus::PyObjectPlus(PyTypeObject *T) // constructor * PyObjectPlus Methods -- Every class, even the abstract one should have a Methods ------------------------------*/ PyMethodDef PyObjectPlus::Methods[] = { - {"isA", (PyCFunction) sPy_isA, Py_NEWARGS}, + {"isA", (PyCFunction) sPy_isA, METH_VARARGS}, {NULL, NULL} /* Sentinel */ }; @@ -134,7 +134,8 @@ int PyObjectPlus::_setattr(const STR_String& attr, PyObject *value) ------------------------------*/ PyObject *PyObjectPlus::_repr(void) { - Py_Error(PyExc_SystemError, "Representation not overridden by object."); + PyErr_SetString(PyExc_SystemError, "Representation not overridden by object."); + return NULL; } /*------------------------------ @@ -164,11 +165,12 @@ bool PyObjectPlus::isA(const char *mytypename) // check typename of each parent PyObject *PyObjectPlus::Py_isA(PyObject *args) // Python wrapper for isA { char *mytypename; - Py_Try(PyArg_ParseTuple(args, "s", &mytypename)); + if (!PyArg_ParseTuple(args, "s", &mytypename)) + return NULL; if(isA(mytypename)) - {Py_INCREF(Py_True); return Py_True;} + Py_RETURN_TRUE; else - {Py_INCREF(Py_False); return Py_False;}; + Py_RETURN_FALSE; } #endif //NO_EXP_PYTHON_EMBEDDING diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index 2bcb604dd23..f433a08faba 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -44,22 +44,7 @@ ------------------------------*/ // some basic python macros -#define Py_NEWARGS 1 #define Py_Return { Py_INCREF(Py_None); return Py_None;} -static inline PyObject* Py_Success(bool truth) -{ - if (truth) - { - Py_INCREF(Py_True); - return Py_True; - } - Py_INCREF(Py_False); - return Py_False; -} - -#define Py_Error(E, M) {PyErr_SetString(E, M); return NULL;} -#define Py_Try(F) {if (!(F)) return NULL;} -#define Py_Assert(A,E,M) {if (!(A)) {PyErr_SetString(E, M); return NULL;}} static inline void Py_Fatal(char *M) { //cout << M << endl; @@ -136,6 +121,13 @@ static inline void Py_Fatal(char *M) { }; \ static char method_name##_doc[]; \ +#define KX_PYMETHOD_DOC_VARARGS(class_name, method_name) \ + PyObject* Py##method_name(PyObject* self, PyObject* args); \ + static PyObject* sPy##method_name( PyObject* self, PyObject* args) { \ + return ((class_name*) self)->Py##method_name(self, args); \ + }; \ + static char method_name##_doc[]; \ + #define KX_PYMETHOD_DOC_O(class_name, method_name) \ PyObject* Py##method_name(PyObject* self, PyObject* value); \ static PyObject* sPy##method_name( PyObject* self, PyObject* value) { \ diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index b4694740679..7bcb45228db 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -158,15 +158,14 @@ PyParentObject CValue::Parents[] = { }; PyMethodDef CValue::Methods[] = { -// { "printHello", (PyCFunction) CValue::sPyPrintHello, Py_NEWARGS}, - { "getName", (PyCFunction) CValue::sPyGetName, Py_NEWARGS}, +// { "printHello", (PyCFunction) CValue::sPyPrintHello, METH_VARARGS}, + { "getName", (PyCFunction) CValue::sPyGetName, METH_NOARGS}, {NULL,NULL} //Sentinel }; -PyObject* CValue::PyGetName(PyObject* self,PyObject* args,PyObject* kwds) +PyObject* CValue::PyGetName(PyObject* self) { - PyObject* pyname = PyString_FromString(this->GetName()); - return pyname; + return PyString_FromString(this->GetName()); } /*#define CVALUE_DEBUG*/ @@ -662,7 +661,7 @@ CValue* CValue::FindIdentifier(const STR_String& identifiername) static PyMethodDef CValueMethods[] = { - //{ "new", CValue::PyMake , Py_NEWARGS}, + //{ "new", CValue::PyMake , METH_VARARGS}, { NULL,NULL} // Sentinel }; @@ -806,9 +805,8 @@ PyObject* CValue::ConvertKeysToPython( void ) PyObject* CValue::PyMake(PyObject* ignored,PyObject* args) { - //Py_Try(PyArg_ParseTuple(args,"s",&name)); - Py_INCREF(Py_None); - return Py_None;//new CValue(); + //if (!PyArg_ParseTuple(args,"s",&name)) return NULL; + Py_RETURN_NONE;//new CValue(); } */ diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index bcf231cf4f0..74fcdae5756 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -255,7 +255,7 @@ public: virtual PyObject* ConvertKeysToPython( void ); - KX_PYMETHOD(CValue,GetName); + KX_PYMETHOD_NOARGS(CValue,GetName); #else CValue(); diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp index 099cb8eebd0..44a488fa719 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp @@ -180,7 +180,6 @@ PyObject* SCA_ActuatorSensor::PySetActuator(PyObject* self, PyObject* args, PyOb char *actNameArg = NULL; if (!PyArg_ParseTuple(args, "s", &actNameArg)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.cpp b/source/gameengine/GameLogic/SCA_DelaySensor.cpp new file mode 100644 index 00000000000..4d05250e91c --- /dev/null +++ b/source/gameengine/GameLogic/SCA_DelaySensor.cpp @@ -0,0 +1,257 @@ +/** + * Delay trigger + * + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#ifdef WIN32 +// This warning tells us about truncation of __long__ stl-generated names. +// It can occasionally cause DevStudio to have internal compiler warnings. +#pragma warning( disable : 4786 ) +#endif + +#include "SCA_DelaySensor.h" +#include "SCA_LogicManager.h" +#include "SCA_EventManager.h" + +/* ------------------------------------------------------------------------- */ +/* Native functions */ +/* ------------------------------------------------------------------------- */ + +SCA_DelaySensor::SCA_DelaySensor(class SCA_EventManager* eventmgr, + SCA_IObject* gameobj, + int delay, + int duration, + bool repeat, + PyTypeObject* T) + : SCA_ISensor(gameobj,eventmgr, T), + m_delay(delay), + m_duration(duration), + m_repeat(repeat) +{ + Init(); +} + +void SCA_DelaySensor::Init() +{ + m_lastResult = false; + m_frameCount = -1; + m_reset = true; +} + +SCA_DelaySensor::~SCA_DelaySensor() +{ + /* intentionally empty */ +} + +CValue* SCA_DelaySensor::GetReplica() +{ + CValue* replica = new SCA_DelaySensor(*this); + // this will copy properties and so on... + CValue::AddDataToReplica(replica); + + return replica; +} + + + +bool SCA_DelaySensor::IsPositiveTrigger() +{ + return (m_invert ? !m_lastResult : m_lastResult); +} + +bool SCA_DelaySensor::Evaluate(CValue* event) +{ + bool trigger = false; + bool result; + + if (m_frameCount==-1) { + // this is needed to ensure ON trigger in case delay==0 + // and avoid spurious OFF trigger when duration==0 + m_lastResult = false; + m_frameCount = 0; + } + + if (m_frameCount 0) { + if (m_frameCount < m_delay+m_duration) { + m_frameCount++; + result = true; + } else { + result = false; + if (m_repeat) + m_frameCount = -1; + } + } else { + result = true; + if (m_repeat) + m_frameCount = -1; + } + if ((m_reset && m_level) || result != m_lastResult) + trigger = true; + m_reset = false; + m_lastResult = result; + return trigger; +} + +/* ------------------------------------------------------------------------- */ +/* Python functions */ +/* ------------------------------------------------------------------------- */ + +/* Integration hooks ------------------------------------------------------- */ +PyTypeObject SCA_DelaySensor::Type = { + PyObject_HEAD_INIT(&PyType_Type) + 0, + "SCA_DelaySensor", + sizeof(SCA_DelaySensor), + 0, + PyDestructor, + 0, + __getattr, + __setattr, + 0, //&MyPyCompare, + __repr, + 0, //&cvalue_as_number, + 0, + 0, + 0, + 0 +}; + +PyParentObject SCA_DelaySensor::Parents[] = { + &SCA_DelaySensor::Type, + &SCA_ISensor::Type, + &SCA_ILogicBrick::Type, + &CValue::Type, + NULL +}; + +PyMethodDef SCA_DelaySensor::Methods[] = { + /* setProperty */ + {"setDelay", (PyCFunction) SCA_DelaySensor::sPySetDelay, METH_VARARGS, SetDelay_doc}, + {"setDuration", (PyCFunction) SCA_DelaySensor::sPySetDuration, METH_VARARGS, SetDuration_doc}, + {"setRepeat", (PyCFunction) SCA_DelaySensor::sPySetRepeat, METH_VARARGS, SetRepeat_doc}, + /* getProperty */ + {"getDelay", (PyCFunction) SCA_DelaySensor::sPyGetDelay, METH_NOARGS, GetDelay_doc}, + {"getDuration", (PyCFunction) SCA_DelaySensor::sPyGetDuration, METH_NOARGS, GetDuration_doc}, + {"getRepeat", (PyCFunction) SCA_DelaySensor::sPyGetRepeat, METH_NOARGS, GetRepeat_doc}, + {NULL,NULL} //Sentinel +}; + +PyObject* SCA_DelaySensor::_getattr(const STR_String& attr) { + _getattr_up(SCA_ISensor); +} + +char SCA_DelaySensor::SetDelay_doc[] = +"setDelay(delay)\n" +"\t- delay: length of the initial OFF period as number of frame\n" +"\t 0 for immediate trigger\n" +"\tSet the initial delay before the positive trigger\n"; +PyObject* SCA_DelaySensor::PySetDelay(PyObject* self, PyObject* args, PyObject* kwds) +{ + int delay; + + if(!PyArg_ParseTuple(args, "i", &delay)) { + return NULL; + } + if (delay < 0) { + PyErr_SetString(PyExc_ValueError, "Delay cannot be negative"); + return NULL; + } + m_delay = delay; + Py_Return; +} + +char SCA_DelaySensor::SetDuration_doc[] = +"setDuration(duration)\n" +"\t- duration: length of the ON period in number of frame after the initial off period\n" +"\t 0 for no ON period\n" +"\tSet the duration of the ON pulse after initial delay.\n" +"\tIf > 0, a negative trigger is fired at the end of the ON pulse.\n"; +PyObject* SCA_DelaySensor::PySetDuration(PyObject* self, PyObject* args, PyObject* kwds) +{ + int duration; + + if(!PyArg_ParseTuple(args, "i", &duration)) { + return NULL; + } + if (duration < 0) { + PyErr_SetString(PyExc_ValueError, "Duration cannot be negative"); + return NULL; + } + m_duration = duration; + Py_Return; +} + +char SCA_DelaySensor::SetRepeat_doc[] = +"setRepeat(repeat)\n" +"\t- repeat: 1 if the initial OFF-ON cycle should be repeated indefinately\n" +"\t 0 if the initial OFF-ON cycle should run only once\n" +"\tSet the sensor repeat mode\n"; +PyObject* SCA_DelaySensor::PySetRepeat(PyObject* self, PyObject* args, PyObject* kwds) +{ + int repeat; + + if(!PyArg_ParseTuple(args, "i", &repeat)) { + return NULL; + } + m_repeat = (repeat != 0); + Py_Return; +} + +char SCA_DelaySensor::GetDelay_doc[] = +"getDelay()\n" +"\tReturn the delay parameter value\n"; +PyObject* SCA_DelaySensor::PyGetDelay(PyObject* self) +{ + return PyInt_FromLong(m_delay); +} + +char SCA_DelaySensor::GetDuration_doc[] = +"getDuration()\n" +"\tReturn the duration parameter value\n"; +PyObject* SCA_DelaySensor::PyGetDuration(PyObject* self) +{ + return PyInt_FromLong(m_duration); +} + +char SCA_DelaySensor::GetRepeat_doc[] = +"getRepeat()\n" +"\tReturn the repeat parameter value\n"; +PyObject* SCA_DelaySensor::PyGetRepeat(PyObject* self) +{ + return BoolToPyArg(m_repeat); +} + +/* eof */ diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.h b/source/gameengine/GameLogic/SCA_DelaySensor.h new file mode 100644 index 00000000000..a997fabe3cd --- /dev/null +++ b/source/gameengine/GameLogic/SCA_DelaySensor.h @@ -0,0 +1,77 @@ +/** + * SCA_DelaySensor.h + * + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef __KX_DELAYSENSOR +#define __KX_DELAYSENSOR +#include "SCA_ISensor.h" + +class SCA_DelaySensor : public SCA_ISensor +{ + Py_Header; + bool m_lastResult; + bool m_repeat; + int m_delay; + int m_duration; + int m_frameCount; + +public: + SCA_DelaySensor(class SCA_EventManager* eventmgr, + SCA_IObject* gameobj, + int delay, + int duration, + bool repeat, + PyTypeObject* T =&Type); + virtual ~SCA_DelaySensor(); + virtual CValue* GetReplica(); + virtual bool Evaluate(CValue* event); + virtual bool IsPositiveTrigger(); + virtual void Init(); + + + /* --------------------------------------------------------------------- */ + /* Python interface ---------------------------------------------------- */ + /* --------------------------------------------------------------------- */ + + virtual PyObject* _getattr(const STR_String& attr); + + /* setProperty */ + KX_PYMETHOD_DOC(SCA_DelaySensor,SetDelay); + KX_PYMETHOD_DOC(SCA_DelaySensor,SetDuration); + KX_PYMETHOD_DOC(SCA_DelaySensor,SetRepeat); + /* getProperty */ + KX_PYMETHOD_DOC_NOARGS(SCA_DelaySensor,GetDelay); + KX_PYMETHOD_DOC_NOARGS(SCA_DelaySensor,GetDuration); + KX_PYMETHOD_DOC_NOARGS(SCA_DelaySensor,GetRepeat); + +}; + +#endif //__KX_ALWAYSSENSOR + diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp index e73358bc1e8..f5512664d8f 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp @@ -271,8 +271,7 @@ PyObject* SCA_ILogicBrick::PyGetOwner(PyObject* self) } printf("ERROR: Python scriptblock without owner\n"); - Py_INCREF(Py_None); - return Py_None;//Int_FromLong(IsPositiveTrigger()); + Py_RETURN_NONE; //Int_FromLong(IsPositiveTrigger()); } diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp index 2dc49924062..f99b9b789d7 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.cpp +++ b/source/gameengine/GameLogic/SCA_ISensor.cpp @@ -189,6 +189,8 @@ PyMethodDef SCA_ISensor::Methods[] = { METH_NOARGS, GetLevel_doc}, {"setLevel", (PyCFunction) SCA_ISensor::sPySetLevel, METH_VARARGS, SetLevel_doc}, + {"reset", (PyCFunction) SCA_ISensor::sPyReset, + METH_NOARGS, Reset_doc}, {NULL,NULL} //Sentinel }; @@ -390,4 +392,15 @@ PyObject* SCA_ISensor::PySetUseNegPulseMode(PyObject* self, PyObject* args, PyOb Py_Return; } +char SCA_ISensor::Reset_doc[] = +"reset()\n" +"\tReset sensor internal state, effect depends on the type of sensor and settings.\n" +"\tThe sensor is put in its initial state as if it was just activated.\n"; +PyObject* SCA_ISensor::PyReset(PyObject* self) +{ + Init(); + Py_Return; +} + + /* eof */ diff --git a/source/gameengine/GameLogic/SCA_ISensor.h b/source/gameengine/GameLogic/SCA_ISensor.h index d5dabbce3ee..fc8f0bd0011 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.h +++ b/source/gameengine/GameLogic/SCA_ISensor.h @@ -148,6 +148,7 @@ public: KX_PYMETHOD_DOC(SCA_ISensor,SetInvert); KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetLevel); KX_PYMETHOD_DOC(SCA_ISensor,SetLevel); + KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,Reset); }; diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index cd1b029fc34..f9081c90288 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -248,7 +248,7 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr) { // didn't compile, so instead of compile, complain // something is wrong, tell the user what went wrong - printf("PYTHON SCRIPT ERROR:\n"); + printf("Python compile error from controller \"%s\": \n", GetName().Ptr()); //PyRun_SimpleString(m_scriptText.Ptr()); PyErr_Print(); return; @@ -285,7 +285,7 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr) else { // something is wrong, tell the user what went wrong - printf("PYTHON SCRIPT ERROR:\n"); + printf("Python script error from controller \"%s\": \n", GetName().Ptr()); PyErr_Print(); //PyRun_SimpleString(m_scriptText.Ptr()); } diff --git a/source/gameengine/Ketsji/BL_Shader.cpp b/source/gameengine/Ketsji/BL_Shader.cpp index f6f9a29b0e2..57d0fe4140f 100644 --- a/source/gameengine/Ketsji/BL_Shader.cpp +++ b/source/gameengine/Ketsji/BL_Shader.cpp @@ -846,8 +846,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, getFragmentProg ,"getFragmentProg( )" ) KX_PYMETHODDEF_DOC( BL_Shader, validate, "validate()") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } if(mShader==0) { PyErr_Format(PyExc_TypeError, "invalid shader object"); @@ -877,8 +876,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, validate, "validate()") KX_PYMETHODDEF_DOC( BL_Shader, setSampler, "setSampler(name, index)" ) { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; @@ -900,7 +898,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setSampler, "setSampler(name, index)" ) //else // spit("Invalid texture sample index: " << index); } - Py_Return; + Py_RETURN_NONE; } return NULL; } @@ -919,8 +917,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setNumberOfPasses, "setNumberOfPasses( max-pass ) KX_PYMETHODDEF_DOC( BL_Shader, setUniform1f, "setUniform1f(name, fx)" ) { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; @@ -945,8 +942,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform1f, "setUniform1f(name, fx)" ) KX_PYMETHODDEF_DOC( BL_Shader, setUniform2f , "setUniform2f(name, fx, fy)") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; float array[2]={ 0,0 }; @@ -970,8 +966,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform2f , "setUniform2f(name, fx, fy)") KX_PYMETHODDEF_DOC( BL_Shader, setUniform3f, "setUniform3f(name, fx,fy,fz) ") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; float array[3]={0,0,0}; @@ -996,8 +991,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform3f, "setUniform3f(name, fx,fy,fz) ") KX_PYMETHODDEF_DOC( BL_Shader, setUniform4f, "setUniform4f(name, fx,fy,fz, fw) ") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; float array[4]={0,0,0,0}; @@ -1021,8 +1015,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform4f, "setUniform4f(name, fx,fy,fz, fw) " KX_PYMETHODDEF_DOC( BL_Shader, setUniform1i, "setUniform1i(name, ix)" ) { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; int value=0; @@ -1046,8 +1039,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform1i, "setUniform1i(name, ix)" ) KX_PYMETHODDEF_DOC( BL_Shader, setUniform2i , "setUniform2i(name, ix, iy)") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; int array[2]={ 0,0 }; @@ -1071,8 +1063,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform2i , "setUniform2i(name, ix, iy)") KX_PYMETHODDEF_DOC( BL_Shader, setUniform3i, "setUniform3i(name, ix,iy,iz) ") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; @@ -1096,8 +1087,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform3i, "setUniform3i(name, ix,iy,iz) ") KX_PYMETHODDEF_DOC( BL_Shader, setUniform4i, "setUniform4i(name, ix,iy,iz, iw) ") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; int array[4]={0,0,0, 0}; @@ -1120,8 +1110,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform4i, "setUniform4i(name, ix,iy,iz, iw) " KX_PYMETHODDEF_DOC( BL_Shader, setUniformfv , "setUniformfv( float (list2 or list3 or list4) )") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char*uniform = ""; PyObject *listPtr =0; @@ -1190,8 +1179,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformfv , "setUniformfv( float (list2 or lis KX_PYMETHODDEF_DOC( BL_Shader, setUniformiv, "setUniformiv( int (list2 or list3 or list4) )") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char*uniform = ""; PyObject *listPtr =0; @@ -1263,8 +1251,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformMatrix4, "setUniformMatrix4(uniform-name, mat-4x4, transpose(row-major=true, col-major=false)" ) { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } float matr[16] = { @@ -1306,8 +1293,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformMatrix3, "setUniformMatrix3(uniform-name, list[3x3], transpose(row-major=true, col-major=false)" ) { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } float matr[9] = { @@ -1347,8 +1333,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformMatrix3, KX_PYMETHODDEF_DOC( BL_Shader, setAttrib, "setAttrib(enum)" ) { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } int attr=0; if(PyArg_ParseTuple(args, "i", &attr )) { @@ -1368,8 +1353,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setAttrib, "setAttrib(enum)" ) KX_PYMETHODDEF_DOC( BL_Shader, setUniformDef, "setUniformDef(name, enum)" ) { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp index 0a97b6f0a2f..42b909927fd 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.cpp +++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp @@ -395,8 +395,8 @@ PyParentObject KX_CameraActuator::Parents[] = { }; PyMethodDef KX_CameraActuator::Methods[] = { - {"setObject",(PyCFunction) KX_CameraActuator::sPySetObject, METH_VARARGS, SetObject_doc}, - {"getObject",(PyCFunction) KX_CameraActuator::sPyGetObject, METH_NOARGS, GetObject_doc}, + {"setObject",(PyCFunction) KX_CameraActuator::sPySetObject, METH_O, SetObject_doc}, + {"getObject",(PyCFunction) KX_CameraActuator::sPyGetObject, METH_VARARGS, GetObject_doc}, {"setMin" ,(PyCFunction) KX_CameraActuator::sPySetMin, METH_VARARGS, SetMin_doc}, {"getMin" ,(PyCFunction) KX_CameraActuator::sPyGetMin, METH_NOARGS, GetMin_doc}, {"setMax" ,(PyCFunction) KX_CameraActuator::sPySetMax, METH_VARARGS, SetMax_doc}, @@ -413,50 +413,43 @@ PyObject* KX_CameraActuator::_getattr(const STR_String& attr) { } /* get obj ---------------------------------------------------------- */ char KX_CameraActuator::GetObject_doc[] = -"getObject\n" +"getObject(name_only = 1)\n" +"name_only - optional arg, when true will return the KX_GameObject rather then its name\n" "\tReturns the object this sensor reacts to.\n"; -PyObject* KX_CameraActuator::PyGetObject(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_CameraActuator::PyGetObject(PyObject* self, PyObject* args) { - return PyString_FromString(m_ob->GetName()); + int ret_name_only = 1; + if (!PyArg_ParseTuple(args, "|i", &ret_name_only)) + return NULL; + + if (!m_ob) + Py_RETURN_NONE; + + if (ret_name_only) + return PyString_FromString(m_ob->GetName()); + else + return m_ob->AddRef(); } /* set obj ---------------------------------------------------------- */ char KX_CameraActuator::SetObject_doc[] = -"setObject\n" +"setObject(object)\n" +"\t- object: KX_GameObject, string or None\n" "\tSets the object this sensor reacts to.\n"; -PyObject* KX_CameraActuator::PySetObject(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_CameraActuator::PySetObject(PyObject* self, PyObject* value) { - - PyObject* gameobj; - if (PyArg_ParseTuple(args, "O!", &KX_GameObject::Type, &gameobj)) - { - if (m_ob) - m_ob->UnregisterActuator(this); - m_ob = (SCA_IObject*)gameobj; - if (m_ob) - m_ob->RegisterActuator(this); - Py_Return; - } - PyErr_Clear(); + KX_GameObject *gameobj; - char* objectname; - if (PyArg_ParseTuple(args, "s", &objectname)) - { - SCA_IObject *object = (SCA_IObject*)SCA_ILogicBrick::m_sCurrentLogicManager->GetGameObjectByName(STR_String(objectname)); - if(object) - { - if (m_ob != NULL) - m_ob->UnregisterActuator(this); - m_ob = object; - m_ob->RegisterActuator(this); - Py_Return; - } - } + if (!ConvertPythonToGameObject(value, &gameobj, true)) + return NULL; // ConvertPythonToGameObject sets the error - return NULL; + if (m_ob != NULL) + m_ob->UnregisterActuator(this); + + m_ob = (SCA_IObject*)gameobj; + if (m_ob) + m_ob->RegisterActuator(this); + + Py_RETURN_NONE; } /* get min ---------------------------------------------------------- */ diff --git a/source/gameengine/Ketsji/KX_CameraActuator.h b/source/gameengine/Ketsji/KX_CameraActuator.h index 488b36922b0..d53d12b3b82 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.h +++ b/source/gameengine/Ketsji/KX_CameraActuator.h @@ -123,9 +123,9 @@ private : virtual PyObject* _getattr(const STR_String& attr); /* set object to look at */ - KX_PYMETHOD_DOC(KX_CameraActuator,SetObject); + KX_PYMETHOD_DOC_O(KX_CameraActuator,SetObject); /* get current object */ - KX_PYMETHOD_DOC(KX_CameraActuator,GetObject); + KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,GetObject); KX_PYMETHOD_DOC(KX_CameraActuator,SetMin); KX_PYMETHOD_DOC(KX_CameraActuator,GetMin); KX_PYMETHOD_DOC(KX_CameraActuator,SetMax); diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp index 2401d69d3a3..e00ec68ad33 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp @@ -476,7 +476,6 @@ PyObject* KX_ConstraintActuator::PySetDamp(PyObject* self, PyObject* kwds) { int dampArg; if(!PyArg_ParseTuple(args, "i", &dampArg)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -504,7 +503,6 @@ PyObject* KX_ConstraintActuator::PySetRotDamp(PyObject* self, PyObject* kwds) { int dampArg; if(!PyArg_ParseTuple(args, "i", &dampArg)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -534,7 +532,6 @@ PyObject* KX_ConstraintActuator::PySetDirection(PyObject* self, MT_Vector3 dir; if(!PyArg_ParseTuple(args, "(fff)", &x, &y, &z)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } dir[0] = x; @@ -577,7 +574,6 @@ PyObject* KX_ConstraintActuator::PySetOption(PyObject* self, PyObject* kwds) { int option; if(!PyArg_ParseTuple(args, "i", &option)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -605,7 +601,6 @@ PyObject* KX_ConstraintActuator::PySetTime(PyObject* self, PyObject* kwds) { int t; if(!PyArg_ParseTuple(args, "i", &t)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -634,7 +629,6 @@ PyObject* KX_ConstraintActuator::PySetProperty(PyObject* self, PyObject* kwds) { char *property; if (!PyArg_ParseTuple(args, "s", &property)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } if (property == NULL) { @@ -670,7 +664,6 @@ PyObject* KX_ConstraintActuator::PySetMin(PyObject* self, PyObject* kwds) { float minArg; if(!PyArg_ParseTuple(args, "f", &minArg)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -716,7 +709,6 @@ PyObject* KX_ConstraintActuator::PySetMax(PyObject* self, PyObject* kwds){ float maxArg; if(!PyArg_ParseTuple(args, "f", &maxArg)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -770,7 +762,6 @@ PyObject* KX_ConstraintActuator::PySetLimit(PyObject* self, PyObject* kwds) { int locrotArg; if(!PyArg_ParseTuple(args, "i", &locrotArg)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp index 987125ca9ba..b54da6eb753 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp @@ -53,8 +53,7 @@ PyObject* KX_ConstraintWrapper::PyTestMethod(PyObject* self, PyObject* kwds) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } PyObject* KX_ConstraintWrapper::PyGetConstraintId(PyObject* self, diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 989cdabd491..700cc00e996 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -942,7 +942,7 @@ PyObject* KX_GameObject::PyEndObject(PyObject* self) KX_Scene *scene = PHY_GetActiveScene(); scene->DelayedRemoveObject(this); - return Py_None; + Py_RETURN_NONE; } @@ -1551,9 +1551,9 @@ KX_PYMETHODDEF_DOC(KX_GameObject, getDistanceTo, PyErr_Clear(); PyObject *pyother; - if (PyArg_ParseTuple(args, "O!", &KX_GameObject::Type, &pyother)) + KX_GameObject *other; + if (PyArg_ParseTuple(args, "O", &pyother) && ConvertPythonToGameObject(pyother, &other, false)) { - KX_GameObject *other = static_cast(pyother); return PyFloat_FromDouble(NodeGetWorldPosition().distance(other->NodeGetWorldPosition())); } @@ -1574,11 +1574,12 @@ KX_PYMETHODDEF_DOC(KX_GameObject, getVectTo, if (!PyVecArgTo(args, toPoint)) { PyErr_Clear(); - if (PyArg_ParseTuple(args, "O!", &KX_GameObject::Type, &pyother)) + + KX_GameObject *other; + if (PyArg_ParseTuple(args, "O", &pyother) && ConvertPythonToGameObject(pyother, &other, false)) { - KX_GameObject *other = static_cast(pyother); toPoint = other->NodeGetWorldPosition(); - }else + } else { PyErr_SetString(PyExc_TypeError, "Expected a 3D Vector or GameObject type"); return NULL; @@ -1648,12 +1649,15 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCastTo, { KX_GameObject *other; PyErr_Clear(); - if (!PyType_IsSubtype(pyarg->ob_type, &KX_GameObject::Type)) { + + if (ConvertPythonToGameObject(pyarg, &other, false)) + { + toPoint = other->NodeGetWorldPosition(); + } else + { PyErr_SetString(PyExc_TypeError, "the first argument to rayCastTo must be a vector or a KX_GameObject"); return NULL; } - other = static_cast(pyarg); - toPoint = other->NodeGetWorldPosition(); } MT_Point3 fromPoint = NodeGetWorldPosition(); if (dist != 0.0f) @@ -1712,12 +1716,15 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCast, if (!PyVecTo(pyto, toPoint)) { PyErr_Clear(); - if (!PyType_IsSubtype(pyto->ob_type, &KX_GameObject::Type)) { + + if (ConvertPythonToGameObject(pyto, &other, false)) + { + toPoint = other->NodeGetWorldPosition(); + } else + { PyErr_SetString(PyExc_TypeError, "the first argument to rayCast must be a vector or a KX_GameObject"); return NULL; } - other = static_cast(pyto); - toPoint = other->NodeGetWorldPosition(); } if (!pyfrom || pyfrom == Py_None) { @@ -1726,12 +1733,15 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCast, else if (!PyVecTo(pyfrom, fromPoint)) { PyErr_Clear(); - if (!PyType_IsSubtype(pyfrom->ob_type, &KX_GameObject::Type)) { + + if (ConvertPythonToGameObject(pyfrom, &other, false)) + { + fromPoint = other->NodeGetWorldPosition(); + } else + { PyErr_SetString(PyExc_TypeError, "the second optional argument to rayCast must be a vector or a KX_GameObject"); return NULL; } - other = static_cast(pyfrom); - fromPoint = other->NodeGetWorldPosition(); } if (dist != 0.0f) { @@ -1798,3 +1808,49 @@ void KX_GameObject::Relink(GEN_Map *map_parameter) } } +bool ConvertPythonToGameObject(PyObject * value, KX_GameObject **object, bool py_none_ok) +{ + if (value==NULL) { + PyErr_SetString(PyExc_TypeError, "Error in ConvertPythonToGameObject, python pointer NULL, should never happen"); + *object = NULL; + return false; + } + + if (value==Py_None) { + *object = NULL; + + if (py_none_ok) { + return true; + } else { + PyErr_SetString(PyExc_TypeError, "Expected KX_GameObject or a string for a name of a KX_GameObject, None is invalid"); + return false; + } + return (py_none_ok ? true : false); + } + + if (PyString_Check(value)) { + *object = (KX_GameObject *)SCA_ILogicBrick::m_sCurrentLogicManager->GetGameObjectByName(STR_String( PyString_AsString(value) )); + + if (*object) { + return true; + } else { + PyErr_SetString(PyExc_ValueError, "Requested name did not match any KX_GameObject"); + return false; + } + } + + if (PyObject_TypeCheck(value, &KX_GameObject::Type)) { + *object = static_cast(value); + return true; + } + + *object = NULL; + + if (py_none_ok) { + PyErr_SetString(PyExc_TypeError, "Expect a KX_GameObject, a string or None"); + } else { + PyErr_SetString(PyExc_TypeError, "Expect a KX_GameObject or a string"); + } + + return false; +} diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 4e435e9ddf4..a7ac2d75a93 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -48,6 +48,7 @@ #include "KX_KetsjiEngine.h" /* for m_anim_framerate */ #include "KX_IPhysicsController.h" /* for suspend/resume */ #include "DNA_object_types.h" +#include "SCA_LogicManager.h" /* for ConvertPythonToGameObject to search object names */ #define KX_OB_DYNAMIC 1 @@ -775,5 +776,8 @@ private : }; +/* utility conversion function */ +bool ConvertPythonToGameObject(PyObject * value, KX_GameObject **object, bool py_none_ok); + #endif //__KX_GAMEOBJECT diff --git a/source/gameengine/Ketsji/KX_IpoActuator.cpp b/source/gameengine/Ketsji/KX_IpoActuator.cpp index af3add8a323..a203ea6a6ff 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.cpp +++ b/source/gameengine/Ketsji/KX_IpoActuator.cpp @@ -480,7 +480,6 @@ PyObject* KX_IpoActuator::PySet(PyObject* self, int startFrame, stopFrame; if(!PyArg_ParseTuple(args, "siii", &mode, &startFrame, &stopFrame, &forceToggle)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } modenum = string2mode(mode); @@ -516,7 +515,6 @@ PyObject* KX_IpoActuator::PySetProperty(PyObject* self, /* args: property */ char *propertyName; if(!PyArg_ParseTuple(args, "s", &propertyName)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -535,7 +533,6 @@ PyObject* KX_IpoActuator::PySetStart(PyObject* self, PyObject* kwds) { float startArg; if(!PyArg_ParseTuple(args, "f", &startArg)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -561,7 +558,6 @@ PyObject* KX_IpoActuator::PySetEnd(PyObject* self, PyObject* kwds) { float endArg; if(!PyArg_ParseTuple(args, "f", &endArg)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -588,7 +584,6 @@ PyObject* KX_IpoActuator::PySetIpoAsForce(PyObject* self, int boolArg; if (!PyArg_ParseTuple(args, "i", &boolArg)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -617,7 +612,6 @@ PyObject* KX_IpoActuator::PySetIpoAdd(PyObject* self, int boolArg; if (!PyArg_ParseTuple(args, "i", &boolArg)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -646,7 +640,6 @@ PyObject* KX_IpoActuator::PySetType(PyObject* self, int typeArg; if (!PyArg_ParseTuple(args, "i", &typeArg)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -678,7 +671,6 @@ PyObject* KX_IpoActuator::PySetForceIpoActsLocal(PyObject* self, int boolArg; if (!PyArg_ParseTuple(args, "i", &boolArg)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } diff --git a/source/gameengine/Ketsji/KX_MaterialIpoController.cpp b/source/gameengine/Ketsji/KX_MaterialIpoController.cpp index 2ce5d469380..85d514bd22f 100644 --- a/source/gameengine/Ketsji/KX_MaterialIpoController.cpp +++ b/source/gameengine/Ketsji/KX_MaterialIpoController.cpp @@ -3,6 +3,8 @@ #include "KX_ScalarInterpolator.h" #include "KX_GameObject.h" +#include "BLO_sys_types.h" // for intptr_t support + #ifdef HAVE_CONFIG_H #include #endif @@ -76,10 +78,10 @@ SG_Controller* KX_MaterialIpoController::GetReplica(class SG_Node* destnode) iporeplica->AddInterpolator(copyipo); MT_Scalar* scaal = ((KX_ScalarInterpolator*)*i)->GetTarget(); - long orgbase = (long)this; - long orgloc = (long)scaal; - long offset = orgloc-orgbase; - long newaddrbase = (long)iporeplica + offset; + intptr_t orgbase = (intptr_t)this; + intptr_t orgloc = (intptr_t)scaal; + intptr_t offset = orgloc-orgbase; + intptr_t newaddrbase = (intptr_t)iporeplica + offset; MT_Scalar* blaptr = (MT_Scalar*) newaddrbase; copyipo->SetNewTarget((MT_Scalar*)blaptr); } diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index c7a251751cd..a0ac9cfd4ff 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -238,5 +238,5 @@ KX_PYMETHODDEF_DOC(KX_MeshProxy, reinstancePhysicsMesh, "Reinstance the physics mesh.") { //this needs to be reviewed, it is dependend on Sumo/Solid. Who is using this ? - return Py_None;//Py_Success(KX_ReInstanceShapeFromMesh(m_meshobj)); + Py_RETURN_NONE;//(KX_ReInstanceShapeFromMesh(m_meshobj)) ? Py_RETURN_TRUE : Py_RETURN_FALSE; } diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index 5cd4d089c14..98e73d4f0d7 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -360,7 +360,6 @@ PyObject* KX_ObjectActuator::PySetForce(PyObject* self, int bToggle = 0; if (!PyArg_ParseTuple(args, "fffi", &vecArg[0], &vecArg[1], &vecArg[2], &bToggle)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_force.setValue(vecArg); @@ -390,7 +389,6 @@ PyObject* KX_ObjectActuator::PySetTorque(PyObject* self, int bToggle = 0; if (!PyArg_ParseTuple(args, "fffi", &vecArg[0], &vecArg[1], &vecArg[2], &bToggle)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_torque.setValue(vecArg); @@ -420,7 +418,6 @@ PyObject* KX_ObjectActuator::PySetDLoc(PyObject* self, int bToggle = 0; if(!PyArg_ParseTuple(args, "fffi", &vecArg[0], &vecArg[1], &vecArg[2], &bToggle)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_dloc.setValue(vecArg); @@ -450,7 +447,6 @@ PyObject* KX_ObjectActuator::PySetDRot(PyObject* self, int bToggle = 0; if (!PyArg_ParseTuple(args, "fffi", &vecArg[0], &vecArg[1], &vecArg[2], &bToggle)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_drot.setValue(vecArg); @@ -479,7 +475,6 @@ PyObject* KX_ObjectActuator::PySetLinearVelocity(PyObject* self, int bToggle = 0; if (!PyArg_ParseTuple(args, "fffi", &vecArg[0], &vecArg[1], &vecArg[2], &bToggle)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_linear_velocity.setValue(vecArg); @@ -508,7 +503,6 @@ PyObject* KX_ObjectActuator::PySetAngularVelocity(PyObject* self, int bToggle = 0; if (!PyArg_ParseTuple(args, "fffi", &vecArg[0], &vecArg[1], &vecArg[2], &bToggle)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_angular_velocity.setValue(vecArg); @@ -523,7 +517,6 @@ PyObject* KX_ObjectActuator::PySetDamping(PyObject* self, PyObject* kwds) { int damping = 0; if (!PyArg_ParseTuple(args, "i", &damping) || damping < 0 || damping > 1000) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_damping = damping; @@ -553,7 +546,6 @@ PyObject* KX_ObjectActuator::PySetForceLimitX(PyObject* self, float vecArg[2]; int bToggle = 0; if(!PyArg_ParseTuple(args, "ffi", &vecArg[0], &vecArg[1], &bToggle)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_drot[0] = vecArg[0]; @@ -581,7 +573,6 @@ PyObject* KX_ObjectActuator::PySetForceLimitY(PyObject* self, float vecArg[2]; int bToggle = 0; if(!PyArg_ParseTuple(args, "ffi", &vecArg[0], &vecArg[1], &bToggle)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_drot[1] = vecArg[0]; @@ -609,7 +600,6 @@ PyObject* KX_ObjectActuator::PySetForceLimitZ(PyObject* self, float vecArg[2]; int bToggle = 0; if(!PyArg_ParseTuple(args, "ffi", &vecArg[0], &vecArg[1], &bToggle)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_drot[2] = vecArg[0]; @@ -636,7 +626,6 @@ PyObject* KX_ObjectActuator::PySetPID(PyObject* self, { float vecArg[3]; if (!PyArg_ParseTuple(args, "fff", &vecArg[0], &vecArg[1], &vecArg[2])) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_torque.setValue(vecArg); diff --git a/source/gameengine/Ketsji/KX_ParentActuator.cpp b/source/gameengine/Ketsji/KX_ParentActuator.cpp index fd1b56838e2..344e0fccc35 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.cpp +++ b/source/gameengine/Ketsji/KX_ParentActuator.cpp @@ -164,7 +164,7 @@ PyParentObject KX_ParentActuator::Parents[] = { }; PyMethodDef KX_ParentActuator::Methods[] = { - {"setObject", (PyCFunction) KX_ParentActuator::sPySetObject, METH_VARARGS, SetObject_doc}, + {"setObject", (PyCFunction) KX_ParentActuator::sPySetObject, METH_O, SetObject_doc}, {"getObject", (PyCFunction) KX_ParentActuator::sPyGetObject, METH_VARARGS, GetObject_doc}, {NULL,NULL} //Sentinel }; @@ -176,44 +176,44 @@ PyObject* KX_ParentActuator::_getattr(const STR_String& attr) { /* 1. setObject */ char KX_ParentActuator::SetObject_doc[] = "setObject(object)\n" -"\tSet the object to set as parent.\n" -"\tCan be an object name or an object\n"; -PyObject* KX_ParentActuator::PySetObject(PyObject* self, PyObject* args, PyObject* kwds) { - PyObject* gameobj; - if (PyArg_ParseTuple(args, "O!", &KX_GameObject::Type, &gameobj)) - { - if (m_ob != NULL) - m_ob->UnregisterActuator(this); - m_ob = (SCA_IObject*)gameobj; - if (m_ob) - m_ob->RegisterActuator(this); - Py_Return; - } - PyErr_Clear(); +"\t- object: KX_GameObject, string or None\n" +"\tSet the object to set as parent.\n"; +PyObject* KX_ParentActuator::PySetObject(PyObject* self, PyObject* value) { + KX_GameObject *gameobj; - char* objectname; - if (PyArg_ParseTuple(args, "s", &objectname)) - { - SCA_IObject *object = (SCA_IObject*)SCA_ILogicBrick::m_sCurrentLogicManager->GetGameObjectByName(STR_String(objectname)); - if(object) - { - if (m_ob != NULL) - m_ob->UnregisterActuator(this); - m_ob = object; - m_ob->RegisterActuator(this); - Py_Return; - } - } + if (!ConvertPythonToGameObject(value, &gameobj, true)) + return NULL; // ConvertPythonToGameObject sets the error - return NULL; + if (m_ob != NULL) + m_ob->UnregisterActuator(this); + + m_ob = (SCA_IObject*)gameobj; + if (m_ob) + m_ob->RegisterActuator(this); + + Py_RETURN_NONE; } /* 2. getObject */ -char KX_ParentActuator::GetObject_doc[] = -"getObject()\n" + +/* get obj ---------------------------------------------------------- */ +char KX_ParentActuator::GetObject_doc[] = +"getObject(name_only = 1)\n" +"name_only - optional arg, when true will return the KX_GameObject rather then its name\n" "\tReturns the object that is set to.\n"; -PyObject* KX_ParentActuator::PyGetObject(PyObject* self, PyObject* args, PyObject* kwds) { - return PyString_FromString(m_ob->GetName()); -} +PyObject* KX_ParentActuator::PyGetObject(PyObject* self, PyObject* args) +{ + int ret_name_only = 1; + if (!PyArg_ParseTuple(args, "|i", &ret_name_only)) + return NULL; + if (!m_ob) + Py_RETURN_NONE; + + if (ret_name_only) + return PyString_FromString(m_ob->GetName()); + else + return m_ob->AddRef(); +} + /* eof */ diff --git a/source/gameengine/Ketsji/KX_ParentActuator.h b/source/gameengine/Ketsji/KX_ParentActuator.h index 93b07cd424b..e2b30ba2d0f 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.h +++ b/source/gameengine/Ketsji/KX_ParentActuator.h @@ -79,9 +79,9 @@ class KX_ParentActuator : public SCA_IActuator virtual PyObject* _getattr(const STR_String& attr); /* 1. setObject */ - KX_PYMETHOD_DOC(KX_ParentActuator,SetObject); + KX_PYMETHOD_DOC_O(KX_ParentActuator,SetObject); /* 2. getObject */ - KX_PYMETHOD_DOC(KX_ParentActuator,GetObject); + KX_PYMETHOD_DOC_VARARGS(KX_ParentActuator,GetObject); }; /* end of class KX_ParentActuator : public SCA_PropertyActuator */ diff --git a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp index 2df4c6a9980..9291199d859 100644 --- a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp +++ b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp @@ -61,7 +61,7 @@ PyObject* KX_PhysicsObjectWrapper::PySetPosition(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } @@ -78,7 +78,7 @@ PyObject* KX_PhysicsObjectWrapper::PySetLinearVelocity(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } PyObject* KX_PhysicsObjectWrapper::PySetAngularVelocity(PyObject* self, @@ -94,7 +94,7 @@ PyObject* KX_PhysicsObjectWrapper::PySetAngularVelocity(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } PyObject* KX_PhysicsObjectWrapper::PySetActive(PyObject* self, @@ -109,7 +109,7 @@ PyObject* KX_PhysicsObjectWrapper::PySetActive(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp index c01d6a632a3..26243c7dba1 100644 --- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp +++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp @@ -91,7 +91,7 @@ static PyObject* gPySetGravity(PyObject* self, return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } static PyObject* gPySetDebugMode(PyObject* self, @@ -112,7 +112,7 @@ static PyObject* gPySetDebugMode(PyObject* self, return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } @@ -132,7 +132,7 @@ static PyObject* gPySetNumTimeSubSteps(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } @@ -151,7 +151,7 @@ static PyObject* gPySetNumIterations(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } @@ -171,7 +171,7 @@ static PyObject* gPySetDeactivationTime(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } @@ -190,7 +190,7 @@ static PyObject* gPySetDeactivationLinearTreshold(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } @@ -209,7 +209,7 @@ static PyObject* gPySetDeactivationAngularTreshold(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } static PyObject* gPySetContactBreakingTreshold(PyObject* self, @@ -227,7 +227,7 @@ static PyObject* gPySetContactBreakingTreshold(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } @@ -246,7 +246,7 @@ static PyObject* gPySetCcdMode(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } static PyObject* gPySetSorConstant(PyObject* self, @@ -264,7 +264,7 @@ static PyObject* gPySetSorConstant(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } static PyObject* gPySetSolverTau(PyObject* self, @@ -282,7 +282,7 @@ static PyObject* gPySetSolverTau(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } @@ -301,7 +301,7 @@ static PyObject* gPySetSolverDamping(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } static PyObject* gPySetLinearAirDamping(PyObject* self, @@ -319,7 +319,7 @@ static PyObject* gPySetLinearAirDamping(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } @@ -338,7 +338,7 @@ static PyObject* gPySetUseEpa(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } static PyObject* gPySetSolverType(PyObject* self, PyObject* args, @@ -355,7 +355,7 @@ static PyObject* gPySetSolverType(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } @@ -388,7 +388,7 @@ static PyObject* gPyGetVehicleConstraint(PyObject* self, return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } @@ -448,7 +448,7 @@ static PyObject* gPyCreateConstraint(PyObject* self, return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } @@ -502,7 +502,7 @@ static PyObject* gPyRemoveConstraint(PyObject* self, return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index db4793de23d..868439546c3 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -355,8 +355,7 @@ static PyObject *pyPrintExt(PyObject *,PyObject *,PyObject *) if(!count) pprint("No extenstions are used in this build"); - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp index e36891b56f4..ca0106d64d9 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp @@ -180,7 +180,7 @@ PyParentObject KX_SCA_AddObjectActuator::Parents[] = { NULL }; PyMethodDef KX_SCA_AddObjectActuator::Methods[] = { - {"setObject", (PyCFunction) KX_SCA_AddObjectActuator::sPySetObject, METH_VARARGS, SetObject_doc}, + {"setObject", (PyCFunction) KX_SCA_AddObjectActuator::sPySetObject, METH_O, SetObject_doc}, {"setTime", (PyCFunction) KX_SCA_AddObjectActuator::sPySetTime, METH_VARARGS, SetTime_doc}, {"getObject", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetObject, METH_VARARGS, GetObject_doc}, {"getTime", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetTime, METH_VARARGS, GetTime_doc}, @@ -200,41 +200,25 @@ PyObject* KX_SCA_AddObjectActuator::_getattr(const STR_String& attr) /* 1. setObject */ char KX_SCA_AddObjectActuator::SetObject_doc[] = -"setObject(name)\n" -"\t- name: string\n" +"setObject(object)\n" +"\t- object: KX_GameObject, string or None\n" "\tSets the object that will be added. There has to be an object\n" "\tof this name. If not, this function does nothing.\n"; - - - -PyObject* KX_SCA_AddObjectActuator::PySetObject(PyObject* self, - PyObject* args, - PyObject* kwds) -{ - PyObject* gameobj; - if (PyArg_ParseTuple(args, "O!", &KX_GameObject::Type, &gameobj)) - { - if (m_OriginalObject != NULL) - m_OriginalObject->UnregisterActuator(this); - m_OriginalObject = (SCA_IObject*)gameobj; - if (m_OriginalObject) - m_OriginalObject->RegisterActuator(this); - Py_Return; - } - PyErr_Clear(); +PyObject* KX_SCA_AddObjectActuator::PySetObject(PyObject* self, PyObject* value) +{ + KX_GameObject *gameobj; - char* objectname; - if (PyArg_ParseTuple(args, "s", &objectname)) - { - if (m_OriginalObject != NULL) - m_OriginalObject->UnregisterActuator(this); - m_OriginalObject = (SCA_IObject*)SCA_ILogicBrick::m_sCurrentLogicManager->GetGameObjectByName(STR_String(objectname));; - if (m_OriginalObject) - m_OriginalObject->RegisterActuator(this); - Py_Return; - } + if (!ConvertPythonToGameObject(value, &gameobj, true)) + return NULL; // ConvertPythonToGameObject sets the error - return NULL; + if (m_OriginalObject != NULL) + m_OriginalObject->UnregisterActuator(this); + + m_OriginalObject = (SCA_IObject*)gameobj; + if (m_OriginalObject) + m_OriginalObject->RegisterActuator(this); + + Py_RETURN_NONE; } @@ -280,19 +264,22 @@ PyObject* KX_SCA_AddObjectActuator::PyGetTime(PyObject* self, /* 4. getObject */ char KX_SCA_AddObjectActuator::GetObject_doc[] = -"getObject()\n" +"getObject(name_only = 1)\n" +"name_only - optional arg, when true will return the KX_GameObject rather then its name\n" "\tReturns the name of the object that will be added.\n"; - - - -PyObject* KX_SCA_AddObjectActuator::PyGetObject(PyObject* self, - PyObject* args, - PyObject* kwds) +PyObject* KX_SCA_AddObjectActuator::PyGetObject(PyObject* self, PyObject* args) { + int ret_name_only = 1; + if (!PyArg_ParseTuple(args, "|i", &ret_name_only)) + return NULL; + if (!m_OriginalObject) - Py_Return; - - return PyString_FromString(m_OriginalObject->GetName()); + Py_RETURN_NONE; + + if (ret_name_only) + return PyString_FromString(m_OriginalObject->GetName()); + else + return m_OriginalObject->AddRef(); } diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h index 1359f39278d..e7fdb2fbfbc 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h @@ -113,13 +113,13 @@ public: void InstantAddObject(); /* 1. setObject */ - KX_PYMETHOD_DOC(KX_SCA_AddObjectActuator,SetObject); + KX_PYMETHOD_DOC_O(KX_SCA_AddObjectActuator,SetObject); /* 2. setTime */ KX_PYMETHOD_DOC(KX_SCA_AddObjectActuator,SetTime); /* 3. getTime */ KX_PYMETHOD_DOC(KX_SCA_AddObjectActuator,GetTime); /* 4. getObject */ - KX_PYMETHOD_DOC(KX_SCA_AddObjectActuator,GetObject); + KX_PYMETHOD_DOC_VARARGS(KX_SCA_AddObjectActuator,GetObject); /* 5. getLinearVelocity */ KX_PYMETHOD_DOC(KX_SCA_AddObjectActuator,GetLinearVelocity); /* 6. setLinearVelocity */ diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.cpp b/source/gameengine/Ketsji/KX_TrackToActuator.cpp index f5b463abf02..67937d5c579 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.cpp +++ b/source/gameengine/Ketsji/KX_TrackToActuator.cpp @@ -454,7 +454,7 @@ PyParentObject KX_TrackToActuator::Parents[] = { PyMethodDef KX_TrackToActuator::Methods[] = { - {"setObject", (PyCFunction) KX_TrackToActuator::sPySetObject, METH_VARARGS, SetObject_doc}, + {"setObject", (PyCFunction) KX_TrackToActuator::sPySetObject, METH_O, SetObject_doc}, {"getObject", (PyCFunction) KX_TrackToActuator::sPyGetObject, METH_VARARGS, GetObject_doc}, {"setTime", (PyCFunction) KX_TrackToActuator::sPySetTime, METH_VARARGS, SetTime_doc}, {"getTime", (PyCFunction) KX_TrackToActuator::sPyGetTime, METH_VARARGS, GetTime_doc}, @@ -475,47 +475,45 @@ PyObject* KX_TrackToActuator::_getattr(const STR_String& attr) /* 1. setObject */ char KX_TrackToActuator::SetObject_doc[] = "setObject(object)\n" -"\t- object: string\n" +"\t- object: KX_GameObject, string or None\n" "\tSet the object to track with the parent of this actuator.\n"; -PyObject* KX_TrackToActuator::PySetObject(PyObject* self, PyObject* args, PyObject* kwds) { - PyObject* gameobj; - if (PyArg_ParseTuple(args, "O!", &KX_GameObject::Type, &gameobj)) - { - if (m_object != NULL) - m_object->UnregisterActuator(this); - m_object = (SCA_IObject*)gameobj; - if (m_object) - m_object->RegisterActuator(this); - Py_Return; - } - PyErr_Clear(); +PyObject* KX_TrackToActuator::PySetObject(PyObject* self, PyObject* value) +{ + KX_GameObject *gameobj; - char* objectname; - if (PyArg_ParseTuple(args, "s", &objectname)) - { - if (m_object != NULL) - m_object->UnregisterActuator(this); - m_object= static_cast(SCA_ILogicBrick::m_sCurrentLogicManager->GetGameObjectByName(STR_String(objectname))); - if (m_object) - m_object->RegisterActuator(this); - Py_Return; - } + if (!ConvertPythonToGameObject(value, &gameobj, true)) + return NULL; // ConvertPythonToGameObject sets the error - return NULL; + if (m_object != NULL) + m_object->UnregisterActuator(this); + + m_object = (SCA_IObject*)gameobj; + if (m_object) + m_object->RegisterActuator(this); + + Py_RETURN_NONE; } /* 2. getObject */ char KX_TrackToActuator::GetObject_doc[] = -"getObject()\n" -"\tReturns the object to track with the parent of this actuator.\n"; -PyObject* KX_TrackToActuator::PyGetObject(PyObject* self, PyObject* args, PyObject* kwds) +"getObject(name_only = 1)\n" +"name_only - optional arg, when true will return the KX_GameObject rather then its name\n" +"\tReturns the object to track with the parent of this actuator\n"; +PyObject* KX_TrackToActuator::PyGetObject(PyObject* self, PyObject* args) { + int ret_name_only = 1; + if (!PyArg_ParseTuple(args, "|i", &ret_name_only)) + return NULL; + if (!m_object) - Py_Return; - - return PyString_FromString(m_object->GetName()); + Py_RETURN_NONE; + + if (ret_name_only) + return PyString_FromString(m_object->GetName()); + else + return m_object->AddRef(); } diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.h b/source/gameengine/Ketsji/KX_TrackToActuator.h index 1d1cf46d21b..445132a6094 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.h +++ b/source/gameengine/Ketsji/KX_TrackToActuator.h @@ -75,9 +75,9 @@ class KX_TrackToActuator : public SCA_IActuator virtual PyObject* _getattr(const STR_String& attr); /* 1. setObject */ - KX_PYMETHOD_DOC(KX_TrackToActuator,SetObject); + KX_PYMETHOD_DOC_O(KX_TrackToActuator,SetObject); /* 2. getObject */ - KX_PYMETHOD_DOC(KX_TrackToActuator,GetObject); + KX_PYMETHOD_DOC_VARARGS(KX_TrackToActuator,GetObject); /* 3. setTime */ KX_PYMETHOD_DOC(KX_TrackToActuator,SetTime); /* 4. getTime */ diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp index 7e8160a4d67..f5a2b5e02fe 100644 --- a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp +++ b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp @@ -71,8 +71,7 @@ PyObject* KX_VehicleWrapper::PyAddWheel(PyObject* self, } else { return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } @@ -157,8 +156,7 @@ PyObject* KX_VehicleWrapper::PyApplyEngineForce(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } PyObject* KX_VehicleWrapper::PySetTyreFriction(PyObject* self, @@ -175,8 +173,7 @@ PyObject* KX_VehicleWrapper::PySetTyreFriction(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } PyObject* KX_VehicleWrapper::PySetSuspensionStiffness(PyObject* self, @@ -193,8 +190,7 @@ PyObject* KX_VehicleWrapper::PySetSuspensionStiffness(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } PyObject* KX_VehicleWrapper::PySetSuspensionDamping(PyObject* self, @@ -210,8 +206,7 @@ PyObject* KX_VehicleWrapper::PySetSuspensionDamping(PyObject* self, } else { return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } PyObject* KX_VehicleWrapper::PySetSuspensionCompression(PyObject* self, @@ -227,8 +222,7 @@ PyObject* KX_VehicleWrapper::PySetSuspensionCompression(PyObject* self, } else { return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } PyObject* KX_VehicleWrapper::PySetRollInfluence(PyObject* self, @@ -245,8 +239,7 @@ PyObject* KX_VehicleWrapper::PySetRollInfluence(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } @@ -264,8 +257,7 @@ PyObject* KX_VehicleWrapper::PyApplyBraking(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } @@ -285,8 +277,7 @@ PyObject* KX_VehicleWrapper::PySetSteeringValue(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py index 965c0522bd7..c911ce8ec60 100644 --- a/source/gameengine/PyDoc/GameLogic.py +++ b/source/gameengine/PyDoc/GameLogic.py @@ -42,6 +42,7 @@ Documentation for the GameLogic Module. - L{SCA_MouseSensor} - L{SCA_PropertySensor} - L{SCA_RandomSensor} + - L{SCA_DelaySensor} You can also access actuators linked to the controller:: # To get an actuator attached to the controller: diff --git a/source/gameengine/PyDoc/KX_CameraActuator.py b/source/gameengine/PyDoc/KX_CameraActuator.py index 032fc7338ac..9a9abaf3d57 100644 --- a/source/gameengine/PyDoc/KX_CameraActuator.py +++ b/source/gameengine/PyDoc/KX_CameraActuator.py @@ -8,11 +8,13 @@ class KX_CameraActuator(SCA_IActuator): @author: snail """ - def getObject(): + def getObject(name_only = 1): """ Returns the name of the object this actuator tracks. - rtype: string + @type name_only: bool + @param name_only: optional argument, when 0 return a KX_GameObject + @rtype: string, KX_GameObject or None if no object is set """ def setObject(target): @@ -20,7 +22,7 @@ class KX_CameraActuator(SCA_IActuator): Sets the object this actuator tracks. @param target: the object to track. - @type target: string or L{KX_GameObject} + @type target: L{KX_GameObject}, string or None """ def getMin(): diff --git a/source/gameengine/PyDoc/KX_ParentActuator.py b/source/gameengine/PyDoc/KX_ParentActuator.py index f45bb5d20b1..6d6e0937257 100644 --- a/source/gameengine/PyDoc/KX_ParentActuator.py +++ b/source/gameengine/PyDoc/KX_ParentActuator.py @@ -12,11 +12,12 @@ class KX_ParentActuator(SCA_IActuator): Object can be either a L{KX_GameObject} or the name of the object. - @type object: L{KX_GameObject} or string + @type object: L{KX_GameObject}, string or None """ - def getObject(): + def getObject(name_only = 1): """ Returns the name of the object to change to. - - @rtype: string + @type name_only: bool + @param name_only: optional argument, when 0 return a KX_GameObject + @rtype: string, KX_GameObject or None if no object is set """ diff --git a/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py b/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py index 44f9e051c8c..4f2bf85bff3 100644 --- a/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py +++ b/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py @@ -13,7 +13,7 @@ class KX_SCA_AddObjectActuator(SCA_IActuator): C{ERROR: GameObject I{OBName} has a AddObjectActuator I{ActuatorName} without object (in 'nonactive' layer)} """ - def setObject(obj): + def setObject(object): """ Sets the game object to add. @@ -21,17 +21,18 @@ class KX_SCA_AddObjectActuator(SCA_IActuator): If the object does not exist, this function is ignored. - obj can either be a L{KX_GameObject} or the name of an object. + object can either be a L{KX_GameObject} or the name of an object or None. - @type obj: L{KX_GameObject} or string + @type object: L{KX_GameObject}, string or None """ - def getObject(): + def getObject(name_only = 0): """ Returns the name of the game object to be added. Returns None if no game object has been assigned to be added. - - @rtype: string + @type name_only: bool + @param name_only: optional argument, when 0 return a KX_GameObject + @rtype: string, KX_GameObject or None if no object is set """ def setTime(time): """ diff --git a/source/gameengine/PyDoc/KX_TrackToActuator.py b/source/gameengine/PyDoc/KX_TrackToActuator.py index 39fb99ec2e2..2ecd94f38ae 100644 --- a/source/gameengine/PyDoc/KX_TrackToActuator.py +++ b/source/gameengine/PyDoc/KX_TrackToActuator.py @@ -18,16 +18,16 @@ class KX_TrackToActuator(SCA_IActuator): """ Sets the object to track. - @type object: L{KX_GameObject} or string + @type object: L{KX_GameObject}, string or None @param object: Either a reference to a game object or the name of the object to track. """ def getObject(): """ Returns the name of the object to track. - Returns None if no object has been set to track. - - @rtype: string + @type name_only: bool + @param name_only: optional argument, when 0 return a KX_GameObject + @rtype: string, KX_GameObject or None if no object is set """ def setTime(time): """ diff --git a/source/gameengine/PyDoc/SCA_DelaySensor.py b/source/gameengine/PyDoc/SCA_DelaySensor.py new file mode 100644 index 00000000000..46b74f461a7 --- /dev/null +++ b/source/gameengine/PyDoc/SCA_DelaySensor.py @@ -0,0 +1,56 @@ +# $Id$ +# Documentation for SCA_DelaySensor +from SCA_IActuator import * + +class SCA_DelaySensor(SCA_ISensor): + """ + The Delay sensor generates positive and negative triggers at precise time, + expressed in number of frames. The delay parameter defines the length + of the initial OFF period. A positive trigger is generated at the end of this period. + The duration parameter defines the length of the ON period following the OFF period. + There is a negative trigger at the end of the ON period. If duration is 0, the sensor + stays ON and there is no negative trigger. + The sensor runs the OFF-ON cycle once unless the repeat option is set: the + OFF-ON cycle repeats indefinately (or the OFF cycle if duration is 0). + Use SCA_ISensor::reset() at any time to restart sensor. + """ + def setDelay(delay): + """ + Set the initial delay before the positive trigger. + + @param delay: length of the initial OFF period as number of frame, 0 for immediate trigger + @type delay: integer + """ + def setDuration(duration): + """ + Set the duration of the ON pulse after initial delay and the generation of the positive trigger. + If duration is greater than 0, a negative trigger is sent at the end of the ON pulse. + + @param duration: length of the ON period in number of frame after the initial OFF period + @type duration: integer + """ + def setRepeat(repeat): + """ + Set if the sensor repeat mode. + + @param repeat: 1 if the OFF-ON cycle should be repeated indefinately, 0 if it should run once. + @type repeat: integer + """ + def getDelay(): + """ + Return the delay parameter value. + + @rtype: integer + """ + def getDuration(): + """ + Return the duration parameter value + + @rtype: integer + """ + def getRepeat(): + """ + Return the repeat parameter value + + @rtype: KX_TRUE or KX_FALSE + """ diff --git a/source/gameengine/PyDoc/SCA_ISensor.py b/source/gameengine/PyDoc/SCA_ISensor.py index 0ebc2debb31..33f0e976284 100644 --- a/source/gameengine/PyDoc/SCA_ISensor.py +++ b/source/gameengine/PyDoc/SCA_ISensor.py @@ -77,4 +77,10 @@ class SCA_ISensor(SCA_ILogicBrick): @param level: Detect level instead of edge? (KX_TRUE, KX_FALSE) @type level: boolean """ + def reset(): + """ + Reset sensor internal state, effect depends on the type of sensor and settings. + + The sensor is put in its initial state as if it was just activated. + """ diff --git a/source/kernel/CMakeLists.txt b/source/kernel/CMakeLists.txt index 3d966152cc5..ac759393326 100644 --- a/source/kernel/CMakeLists.txt +++ b/source/kernel/CMakeLists.txt @@ -24,7 +24,7 @@ # # ***** END GPL LICENSE BLOCK ***** -SET(INC gen_messaging gen_system ../../intern/string ../../intern/moto/include) +SET(INC gen_messaging gen_system ../../intern/string ../../intern/moto/include ../../source/blender/blenloader ) FILE(GLOB SRC gen_messaging/intern/messaging.c diff --git a/source/kernel/SConscript b/source/kernel/SConscript index 9e678c041dc..8bd1a18f835 100644 --- a/source/kernel/SConscript +++ b/source/kernel/SConscript @@ -5,6 +5,6 @@ sources = 'gen_messaging/intern/messaging.c gen_system/GEN_HashedPtr.cpp' sources += ' gen_system/GEN_Matrix4x4.cpp gen_system/SYS_SingletonSystem.cpp' sources += ' gen_system/SYS_System.cpp' -incs = 'gen_messaging gen_system #/intern/string #/intern/moto/include' +incs = 'gen_messaging gen_system #/intern/string #/intern/moto/include #/source/blender/blenloader ' env.BlenderLib ( 'bf_kernel', Split(sources), Split(incs), [], libtype = ['common','game2', 'player'], priority = [15, 10, 150] ) diff --git a/source/kernel/gen_system/GEN_HashedPtr.cpp b/source/kernel/gen_system/GEN_HashedPtr.cpp index 49ccb252246..6dbed1fb7a8 100644 --- a/source/kernel/gen_system/GEN_HashedPtr.cpp +++ b/source/kernel/gen_system/GEN_HashedPtr.cpp @@ -33,6 +33,8 @@ #include #endif +#include "BLO_sys_types.h" // for intptr_t support + // // Build hash index from pointer. Even though the final result // is a 32-bit integer, use all the bits of the pointer as long @@ -41,11 +43,7 @@ unsigned int GEN_Hash(void * inDWord) { -#if defined(_WIN64) - unsigned __int64 key = (unsigned __int64)inDWord; -#else - unsigned long key = (unsigned long)inDWord; -#endif + uintptr_t key = (uintptr_t)inDWord; key += ~(key << 16); key ^= (key >> 5); diff --git a/source/kernel/gen_system/Makefile b/source/kernel/gen_system/Makefile index 855af376615..31535ad2a97 100644 --- a/source/kernel/gen_system/Makefile +++ b/source/kernel/gen_system/Makefile @@ -37,4 +37,5 @@ CCFLAGS += $(LEVEL_2_CPP_WARNINGS) CPPFLAGS += -I$(NAN_MOTO)/include CPPFLAGS += -I$(NAN_STRING)/include +CPPFLAGS += -I../../../source/blender/blenloader From a06321d55c2f25440120ac2fdead20639863a608 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Mon, 18 Aug 2008 19:31:40 +0000 Subject: [PATCH 75/76] Implemented a find_nearest with heaps. This reachs a minimal number of distance queries. But the cost of maintaining the heap seems to be very high. For now DFS with local heuristics gets better times.. so BVHTree still uses that. --- source/blender/blenlib/intern/BLI_kdopbvh.c | 205 ++++++++++++++++++-- 1 file changed, 194 insertions(+), 11 deletions(-) diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index d20143f80e7..c41c3d8c3ab 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -46,6 +46,7 @@ #define MAX_TREETYPE 32 +#define DEFAULT_FIND_NEAREST_HEAP_SIZE 1024 typedef struct BVHNode { @@ -119,6 +120,72 @@ static float KDOP_AXES[13][3] = {0, 1.0, -1.0} }; +/* + * Generic push and pop heap + */ +#define PUSH_HEAP_BODY(HEAP_TYPE,PRIORITY,heap,heap_size) \ +{ \ + HEAP_TYPE element = heap[heap_size-1]; \ + int child = heap_size-1; \ + while(child != 0) \ + { \ + int parent = (child-1) / 2; \ + if(PRIORITY(element, heap[parent])) \ + { \ + heap[child] = heap[parent]; \ + child = parent; \ + } \ + else break; \ + } \ + heap[child] = element; \ +} + +#define POP_HEAP_BODY(HEAP_TYPE, PRIORITY,heap,heap_size) \ +{ \ + HEAP_TYPE element = heap[heap_size-1]; \ + int parent = 0; \ + while(parent < (heap_size-1)/2 ) \ + { \ + int child2 = (parent+1)*2; \ + if(PRIORITY(heap[child2-1], heap[child2])) \ + --child2; \ + \ + if(PRIORITY(element, heap[child2])) \ + break; \ + \ + heap[parent] = heap[child2]; \ + parent = child2; \ + } \ + heap[parent] = element; \ +} + +int ADJUST_MEMORY(void *local_memblock, void **memblock, int new_size, int *max_size, int size_per_item) +{ + int new_max_size = *max_size * 2; + void *new_memblock = NULL; + + if(new_size <= *max_size) + return TRUE; + + if(*memblock == local_memblock) + { + new_memblock = malloc( size_per_item * new_max_size ); + memcpy( new_memblock, *memblock, size_per_item * *max_size ); + } + else + new_memblock = realloc(*memblock, size_per_item * new_max_size ); + + if(new_memblock) + { + *memblock = new_memblock; + *max_size = new_max_size; + return TRUE; + } + else + return FALSE; +} + + ////////////////////////////////////////////////////////////////////////////////////////////////////// // Introsort // with permission deriven from the following Java code: @@ -1131,15 +1198,18 @@ static float calc_nearest_point(BVHNearestData *data, BVHNode *node, float *near } -// TODO: use a priority queue to reduce the number of nodes looked on -static void dfs_find_nearest(BVHNearestData *data, BVHNode *node) +typedef struct NodeDistance { - int i; - float nearest[3], sdist; + BVHNode *node; + float dist; - sdist = calc_nearest_point(data, node, nearest); - if(sdist >= data->nearest.dist) return; +} NodeDistance; +#define NodeDistance_priority(a,b) ( (a).dist < (b).dist ) + +// TODO: use a priority queue to reduce the number of nodes looked on +static void dfs_find_nearest_dfs(BVHNearestData *data, BVHNode *node) +{ if(node->totnode == 0) { if(data->callback) @@ -1147,17 +1217,130 @@ static void dfs_find_nearest(BVHNearestData *data, BVHNode *node) else { data->nearest.index = node->index; - VECCOPY(data->nearest.co, nearest); - data->nearest.dist = sdist; + data->nearest.dist = calc_nearest_point(data, node, data->nearest.co); } } else { - for(i=0; i != node->totnode; i++) - dfs_find_nearest(data, node->children[i]); + //Better heuristic to pick the closest node to dive on + int i; + float nearest[3]; + + if(data->proj[ node->main_axis ] <= node->children[0]->bv[node->main_axis*2+1]) + { + + for(i=0; i != node->totnode; i++) + { + if( calc_nearest_point(data, node->children[i], nearest) >= data->nearest.dist) continue; + dfs_find_nearest_dfs(data, node->children[i]); + } + } + else + { + for(i=node->totnode-1; i >= 0 ; i--) + { + if( calc_nearest_point(data, node->children[i], nearest) >= data->nearest.dist) continue; + dfs_find_nearest_dfs(data, node->children[i]); + } + } } } +static void dfs_find_nearest_begin(BVHNearestData *data, BVHNode *node) +{ + int i; + float nearest[3], sdist; + sdist = calc_nearest_point(data, node, nearest); + if(sdist >= data->nearest.dist) return; + dfs_find_nearest_dfs(data, node); +} + + +static void NodeDistance_push_heap(NodeDistance *heap, int heap_size) +PUSH_HEAP_BODY(NodeDistance, NodeDistance_priority, heap, heap_size) + +static void NodeDistance_pop_heap(NodeDistance *heap, int heap_size) +POP_HEAP_BODY(NodeDistance, NodeDistance_priority, heap, heap_size) + +//NN function that uses an heap.. this functions leads to an optimal number of min-distance +//but for normal tri-faces and BV 6-dop.. a simple dfs with local heuristics (as implemented +//in source/blender/blenkernel/intern/shrinkwrap.c) works faster. +// +//It may make sense to use this function if the callback queries are very slow.. or if its impossible +//to get a nice heuristic +// +//this function uses "malloc/free" instead of the MEM_* because it intends to be openmp safe +static void bfs_find_nearest(BVHNearestData *data, BVHNode *node) +{ + int i; + NodeDistance default_heap[DEFAULT_FIND_NEAREST_HEAP_SIZE]; + NodeDistance *heap=default_heap, current; + int heap_size = 0, max_heap_size = sizeof(default_heap)/sizeof(default_heap[0]); + float nearest[3]; + + int callbacks = 0, push_heaps = 0; + + if(node->totnode == 0) + { + dfs_find_nearest_dfs(data, node); + return; + } + + current.node = node; + current.dist = calc_nearest_point(data, node, nearest); + + while(current.dist < data->nearest.dist) + { +// printf("%f : %f\n", current.dist, data->nearest.dist); + for(i=0; i< current.node->totnode; i++) + { + BVHNode *child = current.node->children[i]; + if(child->totnode == 0) + { + callbacks++; + dfs_find_nearest_dfs(data, child); + } + else + { + //adjust heap size + if(heap_size >= max_heap_size + && ADJUST_MEMORY(default_heap, (void**)&heap, heap_size+1, &max_heap_size, sizeof(heap[0])) == FALSE) + { + printf("WARNING: bvh_find_nearest got out of memory\n"); + + if(heap != default_heap) + free(heap); + + return; + } + + heap[heap_size].node = current.node->children[i]; + heap[heap_size].dist = calc_nearest_point(data, current.node->children[i], nearest); + + if(heap[heap_size].dist >= data->nearest.dist) continue; + heap_size++; + + NodeDistance_push_heap(heap, heap_size); + // PUSH_HEAP_BODY(NodeDistance, NodeDistance_priority, heap, heap_size); + push_heaps++; + } + } + + if(heap_size == 0) break; + + current = heap[0]; + NodeDistance_pop_heap(heap, heap_size); +// POP_HEAP_BODY(NodeDistance, NodeDistance_priority, heap, heap_size); + heap_size--; + } + +// printf("hsize=%d, callbacks=%d, pushs=%d\n", heap_size, callbacks, push_heaps); + + if(heap != default_heap) + free(heap); +} + + int BLI_bvhtree_find_nearest(BVHTree *tree, const float *co, BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata) { int i; @@ -1189,7 +1372,7 @@ int BLI_bvhtree_find_nearest(BVHTree *tree, const float *co, BVHTreeNearest *nea //dfs search if(root) - dfs_find_nearest(&data, root); + dfs_find_nearest_begin(&data, root); //copy back results if(nearest) From f4ae23f3794605f5b7c0a5b90d982d6dfd20d492 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Thu, 21 Aug 2008 22:57:25 +0000 Subject: [PATCH 76/76] svn merge -r 16174:16215 https://svn.blender.org/svnroot/bf-blender/trunk/blender --- .../Dynamics/btDiscreteDynamicsWorld.cpp | 24 +- .../PHY_Physics/PHY_Bullet/PHY_Bullet.vcproj | 8 +- release/scripts/flt_dofedit.py | 835 ++++++++++++++++++ release/scripts/flt_lodedit.py | 502 +++++++++++ release/scripts/flt_properties.py | 19 +- source/blender/blenkernel/BKE_blender.h | 2 +- source/blender/blenkernel/BKE_collision.h | 11 + source/blender/blenkernel/BKE_effect.h | 2 +- source/blender/blenkernel/intern/collision.c | 68 +- source/blender/blenkernel/intern/effect.c | 135 ++- source/blender/blenkernel/intern/implicit.c | 2 +- source/blender/blenkernel/intern/ipo.c | 8 +- source/blender/blenkernel/intern/modifier.c | 2 +- source/blender/blenkernel/intern/particle.c | 9 +- .../blenkernel/intern/particle_system.c | 83 +- source/blender/blenloader/intern/readfile.c | 1 + source/blender/blenloader/intern/writefile.c | 1 + source/blender/include/BIF_resources.h | 4 + source/blender/makesdna/DNA_ipo_types.h | 8 +- source/blender/makesdna/DNA_modifier_types.h | 3 +- source/blender/makesdna/DNA_object_force.h | 4 +- source/blender/makesdna/DNA_particle_types.h | 3 + source/blender/makesdna/DNA_userdef_types.h | 5 + source/blender/python/api2_2x/Material.c | 92 +- source/blender/python/api2_2x/Mesh.c | 4 +- source/blender/python/api2_2x/Object.c | 37 +- source/blender/python/api2_2x/doc/Material.py | 19 +- source/blender/python/api2_2x/doc/Object.py | 8 +- source/blender/src/buttons_object.c | 110 ++- source/blender/src/drawipo.c | 52 +- source/blender/src/editipo.c | 19 +- source/blender/src/editipo_lib.c | 3 +- source/blender/src/resources.c | 19 +- source/blender/src/space.c | 3 + source/blender/src/usiblender.c | 10 +- .../BlenderRoutines/BL_KetsjiEmbedStart.cpp | 31 +- .../GamePlayer/ghost/GPG_Application.cpp | 49 +- .../GamePlayer/ghost/GPG_Application.h | 31 +- .../gameengine/GamePlayer/ghost/GPG_ghost.cpp | 19 +- .../Ketsji/KX_ConvertPhysicsObjects.cpp | 339 ++----- source/gameengine/Ketsji/KX_PythonInit.cpp | 4 + source/gameengine/Ketsji/KX_Scene.cpp | 31 - source/gameengine/Ketsji/KX_Scene.h | 6 - .../Physics/Bullet/CcdPhysicsController.cpp | 294 +++++- .../Physics/Bullet/CcdPhysicsController.h | 69 ++ .../Physics/Bullet/CcdPhysicsEnvironment.cpp | 5 +- source/gameengine/Physics/Bullet/SConscript | 2 +- .../Physics/common/PHY_DynamicTypes.h | 12 + 48 files changed, 2439 insertions(+), 568 deletions(-) create mode 100644 release/scripts/flt_dofedit.py create mode 100644 release/scripts/flt_lodedit.py diff --git a/extern/bullet2/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp b/extern/bullet2/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp index 29719ec9a3e..1017c8af6ea 100644 --- a/extern/bullet2/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp +++ b/extern/bullet2/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp @@ -856,10 +856,26 @@ void btDiscreteDynamicsWorld::debugDrawObject(const btTransform& worldTransform, btScalar radius = coneShape->getRadius();//+coneShape->getMargin(); btScalar height = coneShape->getHeight();//+coneShape->getMargin(); btVector3 start = worldTransform.getOrigin(); - getDebugDrawer()->drawLine(start+worldTransform.getBasis() * btVector3(btScalar(0.),btScalar(0.),btScalar(0.5)*height),start+worldTransform.getBasis() * btVector3(radius,btScalar(0.),btScalar(-0.5)*height),color); - getDebugDrawer()->drawLine(start+worldTransform.getBasis() * btVector3(btScalar(0.),btScalar(0.),btScalar(0.5)*height),start+worldTransform.getBasis() * btVector3(-radius,btScalar(0.),btScalar(-0.5)*height),color); - getDebugDrawer()->drawLine(start+worldTransform.getBasis() * btVector3(btScalar(0.),btScalar(0.),btScalar(0.5)*height),start+worldTransform.getBasis() * btVector3(btScalar(0.),radius,btScalar(-0.5)*height),color); - getDebugDrawer()->drawLine(start+worldTransform.getBasis() * btVector3(btScalar(0.),btScalar(0.),btScalar(0.5)*height),start+worldTransform.getBasis() * btVector3(btScalar(0.),-radius,btScalar(-0.5)*height),color); + // insert here Bullet 2.69 that fixes representation of cone + int upAxis= coneShape->getConeUpIndex(); + + btVector3 offsetHeight(0,0,0); + offsetHeight[upAxis] = height * btScalar(0.5); + btVector3 offsetRadius(0,0,0); + offsetRadius[(upAxis+1)%3] = radius; + btVector3 offset2Radius(0,0,0); + offset2Radius[(upAxis+2)%3] = radius; + + getDebugDrawer()->drawLine(start+worldTransform.getBasis() * (offsetHeight),start+worldTransform.getBasis() * (-offsetHeight+offsetRadius),color); + getDebugDrawer()->drawLine(start+worldTransform.getBasis() * (offsetHeight),start+worldTransform.getBasis() * (-offsetHeight-offsetRadius),color); + getDebugDrawer()->drawLine(start+worldTransform.getBasis() * (offsetHeight),start+worldTransform.getBasis() * (-offsetHeight+offset2Radius),color); + getDebugDrawer()->drawLine(start+worldTransform.getBasis() * (offsetHeight),start+worldTransform.getBasis() * (-offsetHeight-offset2Radius),color); + + // buggy code that does not take into account the direction of the cone + //getDebugDrawer()->drawLine(start+worldTransform.getBasis() * btVector3(btScalar(0.),btScalar(0.),btScalar(0.5)*height),start+worldTransform.getBasis() * btVector3(radius,btScalar(0.),btScalar(-0.5)*height),color); + //getDebugDrawer()->drawLine(start+worldTransform.getBasis() * btVector3(btScalar(0.),btScalar(0.),btScalar(0.5)*height),start+worldTransform.getBasis() * btVector3(-radius,btScalar(0.),btScalar(-0.5)*height),color); + //getDebugDrawer()->drawLine(start+worldTransform.getBasis() * btVector3(btScalar(0.),btScalar(0.),btScalar(0.5)*height),start+worldTransform.getBasis() * btVector3(btScalar(0.),radius,btScalar(-0.5)*height),color); + //getDebugDrawer()->drawLine(start+worldTransform.getBasis() * btVector3(btScalar(0.),btScalar(0.),btScalar(0.5)*height),start+worldTransform.getBasis() * btVector3(btScalar(0.),-radius,btScalar(-0.5)*height),color); break; } diff --git a/projectfiles_vc7/gameengine/physics/PHY_Physics/PHY_Bullet/PHY_Bullet.vcproj b/projectfiles_vc7/gameengine/physics/PHY_Physics/PHY_Bullet/PHY_Bullet.vcproj index 9a807f2d39a..76fde7612e3 100644 --- a/projectfiles_vc7/gameengine/physics/PHY_Physics/PHY_Bullet/PHY_Bullet.vcproj +++ b/projectfiles_vc7/gameengine/physics/PHY_Physics/PHY_Bullet/PHY_Bullet.vcproj @@ -19,7 +19,7 @@ I', struct.pack('>i', oldvalue))[0] + oldvalue |= mask + state["activeObject"].properties['FLT']['50I!FLAG'] = struct.unpack('>i', struct.pack(">I", oldvalue))[0] + +def clear_lockmask(mask): + state = update_state() + if state["activeObject"] and idprops_type(state["activeObject"], 14): + oldvalue = state["activeObject"].properties['FLT']['50I!FLAG'] + oldvalue = struct.unpack('>I', struct.pack('>i', oldvalue))[0] + oldvalue &= ~mask + state["activeObject"].properties['FLT']['50I!FLAG'] = struct.unpack('>i',struct.pack('>I',oldvalue))[0] + + +def create_dof(): + state = update_state() + actobj = state["activeObject"] + if actobj and not idprops_type(actobj, 14): + idprops_kill() + idprops_append(actobj,14, flt_properties.FLTDOF) + DOF_get_frame() + + +def event(evt,val): + if evt == Draw.ESCKEY: + Draw.Exit() + +def but_event(evt): + global DOF_MAKE + global DOF_UPDATE + global DOF_DELETE + + global DOF_TRANSX + global DOF_TRANSY + global DOF_TRANSZ + global DOF_ROTX + global DOF_ROTY + global DOF_ROTZ + global DOF_SCALEX + global DOF_SCALEY + global DOF_SCALEZ + + global DOF_MIN_TRANSX + global DOF_MIN_TRANSY + global DOF_MIN_TRANSZ + global DOF_MIN_ROTX + global DOF_MIN_ROTY + global DOF_MIN_ROTZ + global DOF_MIN_SCALEX + global DOF_MIN_SCALEY + global DOF_MIN_SCALEZ + + global DOF_MAX_TRANSX + global DOF_MAX_TRANSY + global DOF_MAX_TRANSZ + global DOF_MAX_ROTX + global DOF_MAX_ROTY + global DOF_MAX_ROTZ + global DOF_MAX_SCALEX + global DOF_MAX_SCALEY + global DOF_MAX_SCALEZ + + global DOF_STEP_TRANSX + global DOF_STEP_TRANSY + global DOF_STEP_TRANSZ + global DOF_STEP_ROTX + global DOF_STEP_ROTY + global DOF_STEP_ROTZ + global DOF_STEP_SCALEX + global DOF_STEP_SCALEY + global DOF_STEP_SCALEZ + + #labels + global DOF_ROTSTRING + global DOF_TRANSTRING + global DOF_SCALESTRING + + + #masks + global lockxtrans + global lockytrans + global lockztrans + global lockxrot + global lockyrot + global lockzrot + global lockxscale + global lockyscale + global lockzscale + + global zmin + global zmax + global zcur + global zstep + global ymin + global ymax + global ycur + global ystep + global xmin + global xmax + global xcur + global xstep + global pitchmin + global pitchmax + global pitchcur + global pitchstep + global rollmin + global rollmax + global rollcur + global rollstep + global yawmin + global yawmax + global yawcur + global yawstep + global zscalemin + global zscalemax + global zscalecur + global zscalestep + global yscalemin + global yscalemax + global yscalecur + global yscalestep + global xscalemin + global xscalemax + global xscalecur + global xscalestep + + + + #do "system" events + if evt == evcode["DOF_MAKE"]: + create_dof() + + if evt == evcode["DOF_UPDATE"]: + DOF_get_frame() + + if evt == evcode["DOF_DELETE"]: + idprops_kill() + #do translation lock events + if evt == evcode["DOF_TRANSX"]: + if DOF_TRANSX.val == True: + set_lockmask(lockxtrans) + else: + clear_lockmask(lockxtrans) + + if evt == evcode["DOF_TRANSY"]: + if DOF_TRANSY.val == True: + set_lockmask(lockytrans) + else: + clear_lockmask(lockytrans) + + if evt == evcode["DOF_TRANSZ"]: + if DOF_TRANSZ.val == True: + set_lockmask(lockztrans) + else: + clear_lockmask(lockztrans) + + + #do rotation lock events + if evt == evcode["DOF_ROTX"]: + if DOF_ROTX.val == True: + set_lockmask(lockxrot) + else: + clear_lockmask(lockxrot) + + if evt == evcode["DOF_ROTY"]: + if DOF_ROTY.val == True: + set_lockmask(lockyrot) + else: + clear_lockmask(lockyrot) + + if evt == evcode["DOF_ROTZ"]: + if DOF_ROTZ.val == True: + set_lockmask(lockzrot) + else: + clear_lockmask(lockzrot) + + #do scale lock events + if evt == evcode["DOF_SCALEX"]: + if DOF_SCALEX.val == True: + set_lockmask(lockxscale) + else: + clear_lockmask(lockxscale) + + if evt == evcode["DOF_SCALEY"]: + if DOF_SCALEY.val == True: + set_lockmask(lockyscale) + else: + clear_lockmask(lockyscale) + + if evt == evcode["DOF_SCALEZ"]: + if DOF_SCALEZ.val == True: + set_lockmask(lockzscale) + else: + clear_lockmask(lockzscale) + + + #do translation buttons + if evt == evcode["DOF_MIN_TRANSX"]: + set_prop(14, xmin, DOF_MIN_TRANSX.val) + if evt == evcode["DOF_MAX_TRANSX"]: + set_prop(14,xmax, DOF_MAX_TRANSX.val) + if evt == evcode["DOF_STEP_TRANSX"]: + set_prop(14,xstep, DOF_STEP_TRANSX.val) + + if evt == evcode["DOF_MIN_TRANSY"]: + set_prop(14, ymin, DOF_MIN_TRANSY.val) + if evt == evcode["DOF_MAX_TRANSY"]: + set_prop(14,ymax, DOF_MAX_TRANSY.val) + if evt == evcode["DOF_STEP_TRANSY"]: + set_prop(14,ystep, DOF_STEP_TRANSY.val) + + if evt == evcode["DOF_MIN_TRANSZ"]: + set_prop(14, zmin, DOF_MIN_TRANSZ.val) + if evt == evcode["DOF_MAX_TRANSZ"]: + set_prop(14, zmax, DOF_MAX_TRANSZ.val) + if evt == evcode["DOF_STEP_TRANSZ"]: + set_prop(14, zstep, DOF_STEP_TRANSZ.val) + + #do rotation buttons + if evt == evcode["DOF_MIN_ROTX"]: + set_prop(14, pitchmin, DOF_MIN_ROTX.val) + if evt == evcode["DOF_MAX_ROTX"]: + set_prop(14, pitchmax, DOF_MAX_ROTX.val) + if evt == evcode["DOF_STEP_ROTX"]: + set_prop(14, pitchstep, DOF_STEP_ROTX.val) + + if evt == evcode["DOF_MIN_ROTY"]: + set_prop(14, rollmin, DOF_MIN_ROTY.val) + if evt == evcode["DOF_MAX_ROTY"]: + set_prop(14, rollmax, DOF_MAX_ROTY.val) + if evt == evcode["DOF_STEP_ROTY"]: + set_prop(14, rollstep, DOF_STEP_ROTY.val) + + if evt == evcode["DOF_MIN_ROTZ"]: + set_prop(14, yawmin, DOF_MIN_ROTZ.val) + if evt == evcode["DOF_MAX_ROTZ"]: + set_prop(14, yawmax, DOF_MAX_ROTZ.val) + if evt == evcode["DOF_STEP_ROTZ"]: + set_prop(14, yawstep, DOF_STEP_ROTZ.val) + + #do scale buttons + if evt == evcode["DOF_MIN_SCALEX"]: + set_prop(14, xscalemin, DOF_MIN_SCALEX.val) + if evt == evcode["DOF_MAX_SCALEX"]: + set_prop(14, xscalemax, DOF_MAX_SCALEX.val) + if evt == evcode["DOF_STEP_SCALEX"]: + set_prop(14, xscalestep, DOF_STEP_SCALEX.val) + + if evt == evcode["DOF_MIN_SCALEY"]: + set_prop(14, yscalemin, DOF_MIN_SCALEY.val) + if evt == evcode["DOF_MAX_SCALEY"]: + set_prop(14, yscalemax, DOF_MAX_SCALEY.val) + if evt == evcode["DOF_STEP_SCALEY"]: + set_prop(14, yscalestep, DOF_STEP_SCALEY.val) + + if evt == evcode["DOF_MIN_SCALEZ"]: + set_prop(14, zscalemin, DOF_MIN_SCALEZ.val) + if evt == evcode["DOF_MAX_SCALEZ"]: + set_prop(14, zscalemax, DOF_MAX_SCALEZ.val) + if evt == evcode["DOF_STEP_SCALEZ"]: + set_prop(14, zscalestep, DOF_STEP_SCALEZ.val) + + + Draw.Redraw(1) + Blender.Window.RedrawAll() + +def draw_propsheet(x,y): + #UI buttons + global DOF_MAKE + global DOF_UPDATE + global DOF_DELETE + + global DOF_TRANSX + global DOF_TRANSY + global DOF_TRANSZ + global DOF_ROTX + global DOF_ROTY + global DOF_ROTZ + global DOF_SCALEX + global DOF_SCALEY + global DOF_SCALEZ + + global DOF_MIN_TRANSX + global DOF_MIN_TRANSY + global DOF_MIN_TRANSZ + global DOF_MIN_ROTX + global DOF_MIN_ROTY + global DOF_MIN_ROTZ + global DOF_MIN_SCALEX + global DOF_MIN_SCALEY + global DOF_MIN_SCALEZ + + global DOF_MAX_TRANSX + global DOF_MAX_TRANSY + global DOF_MAX_TRANSZ + global DOF_MAX_ROTX + global DOF_MAX_ROTY + global DOF_MAX_ROTZ + global DOF_MAX_SCALEX + global DOF_MAX_SCALEY + global DOF_MAX_SCALEZ + + global DOF_STEP_TRANSX + global DOF_STEP_TRANSY + global DOF_STEP_TRANSZ + global DOF_STEP_ROTX + global DOF_STEP_ROTY + global DOF_STEP_ROTZ + global DOF_STEP_SCALEX + global DOF_STEP_SCALEY + global DOF_STEP_SCALEZ + + #labels + global DOF_ROTSTRING + global DOF_TRANSTRING + global DOF_SCALESTRING + global DOF_EDITLABEL + + #masks + global lockxtrans + global lockytrans + global lockztrans + global lockxrot + global lockyrot + global lockzrot + global lockxscale + global lockyscale + global lockzscale + + global zmin + global zmax + global zcur + global zstep + global ymin + global ymax + global ycur + global ystep + global xmin + global xmax + global xcur + global xstep + global pitchmin + global pitchmax + global pitchcur + global pitchstep + global rollmin + global rollmax + global rollcur + global rollstep + global yawmin + global yawmax + global yawcur + global yawstep + global zscalemin + global zscalemax + global zscalecur + global zscalestep + global yscalemin + global yscalemax + global yscalecur + global yscalestep + global xscalemin + global xscalemax + global xscalecur + global xscalestep + + + global evcode + + state = update_state() + + row_height = 20 + toggle_width = 50 + input_width = 100 + pad = 10 + origx = x + origy = (row_height * 15) + (pad * 15) + + + #editor label + x = origx + y = origy + #y = y - (row_height + pad) + DOF_EDITLABEL = Blender.Draw.Label("FLT Degree of Freedom Editor", x, y, 200, row_height) + + + #draw Translation limits + x = origx + y = y- (row_height + pad) + DOF_TRANSTRING = Blender.Draw.Label("Translation Limits", x, y, input_width, row_height) + + + #X limits + x = origx + y = y- (row_height + pad) + DOF_TRANSX = Blender.Draw.Toggle("LimX", evcode["DOF_TRANSX"], x, y, toggle_width, row_height, get_lockmask(lockxtrans), "") + x = x + (toggle_width + pad) + DOF_MIN_TRANSX = Blender.Draw.Number("MinX", evcode["DOF_MIN_TRANSX"], x, y, input_width, row_height,get_prop(14,xmin), -1000000.0, 1000000.0, "") + x = x + (input_width + pad) + DOF_MAX_TRANSX = Blender.Draw.Number("MaxX", evcode["DOF_MAX_TRANSX"], x, y, input_width, row_height,get_prop(14,xmax), -1000000.0, 1000000.0, "") + x = x + (input_width + pad) + DOF_STEP_TRANSX = Blender.Draw.Number("StepX", evcode["DOF_STEP_TRANSX"], x, y, input_width, row_height,get_prop(14,xstep), -1000000.0, 1000000.0, "") + + #Y limits + x = origx + y = y- (row_height + pad) + DOF_TRANSY = Blender.Draw.Toggle("LimY", evcode["DOF_TRANSY"], x, y, toggle_width, row_height, get_lockmask(lockytrans), "") + x = x + (toggle_width + pad) + DOF_MIN_TRANSY = Blender.Draw.Number("MinY", evcode["DOF_MIN_TRANSY"], x, y, input_width, row_height, get_prop(14,ymin), -1000000.0, 1000000.0, "") + x = x + (input_width + pad) + DOF_MAX_TRANSY = Blender.Draw.Number("MaxY", evcode["DOF_MAX_TRANSY"], x, y, input_width, row_height, get_prop(14,ymax), -1000000.0, 1000000.0, "") + x = x + (input_width + pad) + DOF_STEP_TRANSY = Blender.Draw.Number("StepY", evcode["DOF_STEP_TRANSY"], x, y, input_width, row_height, get_prop(14,ystep), -1000000.0, 1000000.0, "") + + #Z limits + x = origx + y = y- (row_height + pad) + DOF_TRANSZ = Blender.Draw.Toggle("LimZ", evcode["DOF_TRANSZ"], x, y, toggle_width, row_height, get_lockmask(lockztrans), "") + x = x + (toggle_width + pad) + DOF_MIN_TRANSZ = Blender.Draw.Number("MinZ", evcode["DOF_MIN_TRANSZ"], x, y, input_width, row_height, get_prop(14,zmin), -1000000.0, 1000000.0, "") + x = x + (input_width + pad) + DOF_MAX_TRANSZ = Blender.Draw.Number("MaxZ", evcode["DOF_MAX_TRANSZ"], x, y, input_width, row_height, get_prop(14,zmax), -1000000.0, 1000000.0, "") + x = x + (input_width + pad) + DOF_STEP_TRANSZ = Blender.Draw.Number("StepZ", evcode["DOF_STEP_TRANSZ"], x, y, input_width, row_height, get_prop(14,zstep), -1000000.0, 1000000.0, "") + + #draw Rotation limits + x = origx + y = y- (row_height + pad) + DOF_ROTSTRING = Blender.Draw.Label("Rotation Limits", x, y, input_width, row_height) + + #draw Rotation limits + #X limits + x = origx + y = y- (row_height + pad) + DOF_ROTX = Blender.Draw.Toggle("LimX", evcode["DOF_ROTX"], x, y, toggle_width, row_height, get_lockmask(lockxrot), "") + x = x + (toggle_width + pad) + DOF_MIN_ROTX = Blender.Draw.Number("MinX", evcode["DOF_MIN_ROTX"], x, y, input_width, row_height, get_prop(14,pitchmin), -1000000.0, 1000000.0, "") + x = x + (input_width + pad) + DOF_MAX_ROTX = Blender.Draw.Number("MaxX", evcode["DOF_MAX_ROTX"], x, y, input_width, row_height, get_prop(14,pitchmax), -1000000.0, 1000000.0, "") + x = x + (input_width + pad) + DOF_STEP_ROTX = Blender.Draw.Number("StepX", evcode["DOF_STEP_ROTX"], x, y, input_width, row_height, get_prop(14,pitchstep), -1000000.0, 1000000.0, "") + + #Y limits + x = origx + y = y- (row_height + pad) + DOF_ROTY = Blender.Draw.Toggle("LimY", evcode["DOF_ROTY"], x, y, toggle_width, row_height, get_lockmask(lockyrot), "") + x = x + (toggle_width + pad) + DOF_MIN_ROTY = Blender.Draw.Number("MinY", evcode["DOF_MIN_ROTY"], x, y, input_width, row_height, get_prop(14,rollmin), -1000000.0, 1000000.0, "") + x = x + (input_width + pad) + DOF_MAX_ROTY = Blender.Draw.Number("MaxY", evcode["DOF_MAX_ROTY"], x, y, input_width, row_height, get_prop(14,rollmax), -1000000.0, 1000000.0, "") + x = x + (input_width + pad) + DOF_STEP_ROTY = Blender.Draw.Number("StepY", evcode["DOF_STEP_ROTY"], x, y, input_width, row_height, get_prop(14,rollstep), -1000000.0, 1000000.0, "") + + #Z limits + x = origx + y = y- (row_height + pad) + DOF_ROTZ = Blender.Draw.Toggle("LimZ", evcode["DOF_ROTZ"], x, y, toggle_width, row_height, get_lockmask(lockzrot), "") + x = x + (toggle_width + pad) + DOF_MIN_ROTZ = Blender.Draw.Number("MinZ", evcode["DOF_MIN_ROTZ"], x, y, input_width, row_height, get_prop(14, yawmin), -1000000.0, 1000000.0, "") + x = x + (input_width + pad) + DOF_MAX_ROTZ = Blender.Draw.Number("MaxZ", evcode["DOF_MAX_ROTZ"], x, y, input_width, row_height, get_prop(14, yawmax), -1000000.0, 1000000.0, "") + x = x + (input_width + pad) + DOF_STEP_ROTZ = Blender.Draw.Number("StepZ", evcode["DOF_STEP_ROTZ"], x, y, input_width, row_height, get_prop(14, yawstep), -1000000.0, 1000000.0, "") + + + #draw Scale limits + x = origx + y = y- (row_height + pad) + DOF_SCALESTRING = Blender.Draw.Label("Scale Limits", x, y, input_width, row_height) + + #draw Scale limits + #X limits + x = origx + y = y- (row_height + pad) + DOF_SCALEX = Blender.Draw.Toggle("LimX", evcode["DOF_SCALEX"], x, y, toggle_width, row_height, get_lockmask(lockxscale), "") + x = x + (toggle_width + pad) + DOF_MIN_SCALEX = Blender.Draw.Number("MinX", evcode["DOF_MIN_SCALEX"], x, y, input_width, row_height, get_prop(14, xscalemin), -1000000.0, 1000000.0, "") + x = x + (input_width + pad) + DOF_MAX_SCALEX = Blender.Draw.Number("MaxX", evcode["DOF_MAX_SCALEX"], x, y, input_width, row_height, get_prop(14, xscalemax), -1000000.0, 1000000.0, "") + x = x + (input_width + pad) + DOF_STEP_SCALEX = Blender.Draw.Number("StepX", evcode["DOF_STEP_SCALEX"], x, y, input_width, row_height, get_prop(14, xscalestep), -1000000.0, 1000000.0, "") + + #Y limits + x = origx + y = y- (row_height + pad) + DOF_SCALEY = Blender.Draw.Toggle("LimY", evcode["DOF_SCALEY"], x, y, toggle_width, row_height, get_lockmask(lockyscale), "") + x = x + (toggle_width + pad) + DOF_MIN_SCALEY = Blender.Draw.Number("MinY", evcode["DOF_MIN_SCALEY"], x, y, input_width, row_height, get_prop(14, yscalemin), -1000000.0, 1000000.0, "") + x = x + (input_width + pad) + DOF_MAX_SCALEY = Blender.Draw.Number("MaxY", evcode["DOF_MAX_SCALEY"], x, y, input_width, row_height, get_prop(14, yscalemax), -1000000.0, 1000000.0, "") + x = x + (input_width + pad) + DOF_STEP_SCALEY = Blender.Draw.Number("StepY", evcode["DOF_STEP_SCALEY"], x, y, input_width, row_height, get_prop(14, yscalestep), -1000000.0, 1000000.0, "") + + #Z limits + x = origx + y = y- (row_height + pad) + DOF_SCALEZ = Blender.Draw.Toggle("LimZ", evcode["DOF_SCALEZ"], x, y, toggle_width, row_height, get_lockmask(lockzscale), "") + x = x + (toggle_width + pad) + DOF_MIN_SCALEZ = Blender.Draw.Number("MinZ", evcode["DOF_MIN_SCALEZ"], x, y, input_width, row_height, get_prop(14, zscalemin), -1000000.0, 1000000.0, "") + x = x + (input_width + pad) + DOF_MAX_SCALEZ = Blender.Draw.Number("MaxZ", evcode["DOF_MAX_SCALEZ"], x, y, input_width, row_height, get_prop(14, zscalemax), -1000000.0, 1000000.0, "") + x = x + (input_width + pad) + DOF_STEP_SCALEZ = Blender.Draw.Number("StepZ", evcode["DOF_STEP_SCALEZ"], x, y, input_width, row_height, get_prop(14, zscalestep), -1000000.0, 1000000.0, "") + + #System + x = origx + y = y - (row_height + (pad)*3) + DOF_MAKE = Blender.Draw.PushButton("Make DOF", evcode["DOF_MAKE"], x, y, input_width, row_height, "Make a Dof Node out of Active Object") + x = x + (input_width + pad) + DOF_UPDATE = Blender.Draw.PushButton("Grab Loc/Rot", evcode["DOF_UPDATE"], x, y, input_width, row_height, "Update the Dof Node position/orientation") + x = x + (input_width + pad) + DOF_DELETE = Blender.Draw.PushButton("Delete DOF", evcode["DOF_DELETE"], x, y, input_width, row_height, "Delete the Dof Node properties") + + + + +def gui(): + #draw the propsheet/toolbox. + psheety = 800 + #psheetx = psheety + 10 + draw_propsheet(20,psheety) + +Draw.Register(gui,event,but_event) + \ No newline at end of file diff --git a/release/scripts/flt_lodedit.py b/release/scripts/flt_lodedit.py new file mode 100644 index 00000000000..58319b9e525 --- /dev/null +++ b/release/scripts/flt_lodedit.py @@ -0,0 +1,502 @@ +#!BPY + +""" +Name: 'FLT LOD Editor' +Blender: 240 +Group: 'Misc' +Tooltip: 'Level of Detail Edtior for FLT nodes' +""" + +__author__ = "Geoffrey Bantle" +__version__ = "1.0 11/21/07" +__email__ = ('scripts', 'Author, ') +__url__ = ('blender', 'blenderartists.org') + +__bpydoc__ ="""\ +This script provides tools for working with OpenFlight databases in Blender. OpenFlight is a +registered trademark of MultiGen-Paradigm, Inc. + +Feature overview and more availible at: +http://wiki.blender.org/index.php/Scripts/Manual/FLTools +""" + +# -------------------------------------------------------------------------- +# flt_palettemanager.py version 0.1 2005/04/08 +# -------------------------------------------------------------------------- +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# Copyright (C) 2007: Blender Foundation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# ***** END GPL LICENCE BLOCK ***** +# -------------------------------------------------------------------------- + +import Blender.Draw as Draw +from Blender.BGL import * +import Blender +import flt_properties +reload(flt_properties) +from flt_properties import * + +#event codes +evcode = { + "LOD_MAKE" : 100, + "LOD_DELETE" : 101, + "LOD_CALC_CENTER" : 102, + "LOD_GRAB_CENTER" : 103, + "LOD_X" : 104, + "LOD_Y" : 105, + "LOD_Z" : 106, + "LOD_FREEZE" : 107, + "LOD_SIG" : 108, + "LOD_IN" : 109, + "LOD_OUT" : 110, + "LOD_TRANS" : 111, + "LOD_PREVIOUS" : 112 +} + + +#system +LOD_MAKE = None #PushButton +LOD_DELETE = None #PushButton +LOD_CALC_CENTER = None #PushButton +LOD_GRAB_CENTER = None #Pushbutton +LOD_FREEZE = None #Toggle +LOD_PREVIOUS = None #Toggle + +LOD_X = None #Input +LOD_Y = None #Input +LOD_Z = None #Input + +LOD_SIG = None #Input +LOD_IN = None #Input +LOD_OUT = None #Input +LOD_TRANS = None #Input + +#labels +LOD_EDITLABEL = None +LOD_SWITCHLABEL = None +LOD_CENTERLABEL = None + +LOD_XLABEL = None +LOD_YLABEL = None +LOD_ZLABEL = None +LOD_SIGLABEL = None +LOD_INLABEL = None +LOD_OUTLABEL = None +LOD_TRANSLABEL = None + + +#ID Props +switch_in = '5d!switch in' +switch_out = '6d!switch out' +xco = '10d!X co' +yco = '11d!Y co' +zco = '12d!Z co' +trans = '13d!Transition' +sig_size = '14d!Sig Size' + +#Flags +lodflag = '9I!flags' +previous_mask = (1 << 31) +freeze_mask = (1 << 29) + +def update_state(): + state = dict() + state["activeScene"] = Blender.Scene.GetCurrent() + state["activeObject"] = state["activeScene"].objects.active + if state["activeObject"] and not state["activeObject"].sel: + state["activeObject"] = None + state["activeMesh"] = None + if state["activeObject"] and state["activeObject"].type == 'Mesh': + state["activeMesh"] = state["activeObject"].getData(mesh=True) + + state["activeFace"] = None + if state["activeMesh"]: + if state["activeMesh"].faceUV and state["activeMesh"].activeFace != None: + state["activeFace"] = state["activeMesh"].faces[state["activeMesh"].activeFace] + + + #update editmode + state["editmode"] = Blender.Window.EditMode() + + return state + +def idprops_append(object, typecode, props): + object.properties["FLT"] = dict() + object.properties["FLT"]['type'] = typecode + for prop in props: + object.properties["FLT"][prop] = props[prop] + object.properties["FLT"]['3t8!id'] = object.name + +def idprops_kill(): + state = update_state() + if state["activeObject"] and state["activeObject"].properties.has_key('FLT'): + state["activeObject"].properties.pop('FLT') + +def idprops_copy(source): + state = update_state() + if source.properties.has_key('FLT'): + for object in state["activeScene"].objects: + if object.sel and object != source and (state["activeScene"].Layers & object.Layers): + idprops_kill(object) + object.properties['FLT'] = dict() + for key in source.properties['FLT']: + object.properties['FLT'][key] = source.properties['FLT'][key] + +def select_by_typecode(typecode): + state = update_state() + + for object in state["activeScene"].objects: + if object.properties.has_key('FLT') and object.properties['FLT']['type'] == typecode and state["activeScene"].Layers & object.Layers: + object.select(1) + +def idprops_type(object, typecode): + if object.properties.has_key('FLT') and object.properties['FLT'].has_key('type') and object.properties['FLT']['type'] == typecode: + return True + return False + +#ui type code +def get_prop(typecode, prop): + + state = update_state() + if state["activeObject"] and idprops_type(state["activeObject"], typecode): + props = state["activeObject"].properties['FLT'] + else: + props = flt_properties.FLTLOD + + return props[prop] + +def set_prop(typecode, prop, value): + state = update_state() + if state["activeObject"] and idprops_type(state["activeObject"],typecode): + state["activeObject"].properties['FLT'][prop] = value + + + +def get_lockmask(mask): + global lodflag + state = update_state() + if state["activeObject"]: + flag = get_prop(73,lodflag) + if flag & mask: + return True + return False + +def set_lockmask(mask): + state = update_state() + if state["activeObject"] and idprops_type(state["activeObject"], 73): + oldvalue = state["activeObject"].properties['FLT'][lodflag] + oldvalue = struct.unpack('>I', struct.pack('>i', oldvalue))[0] + oldvalue |= mask + state["activeObject"].properties['FLT'][lodflag] = struct.unpack('>i', struct.pack(">I", oldvalue))[0] + +def clear_lockmask(mask): + state = update_state() + if state["activeObject"] and idprops_type(state["activeObject"], 73): + oldvalue = state["activeObject"].properties['FLT'][lodflag] + oldvalue = struct.unpack('>I', struct.pack('>i', oldvalue))[0] + oldvalue &= ~mask + state["activeObject"].properties['FLT'][lodflag] = struct.unpack('>i',struct.pack('>I',oldvalue))[0] + +def findchildren(object): + state = update_state() + children = list() + for candidate in state["activeScene"].objects: + if candidate.parent == object: + children.append(candidate) + retlist = list(children) + for child in children: + retlist = retlist + findchildren(child) + return retlist + +def get_object_center(object): + bbox = object.getBoundBox(1) + average = Blender.Mathutils.Vector(0.0, 0.0, 0.0) + + for point in bbox: + average[0] += point[0] + average[1] += point[1] + average[2] += point[2] + + average[0] = average[0] / 8.0 + average[1] = average[1] / 8.0 + average[2] = average[2] / 8.0 + + return average + + +def calc_center(): + + global xco + global yco + global zco + + state = update_state() + if state["activeObject"] and idprops_type(state["activeObject"], 73): + average = Blender.Mathutils.Vector(0.0, 0.0, 0.0) + children = findchildren(state["activeObject"]) #get children objects + if children: + for child in children: + center = get_object_center(child) + average[0] += center[0] + average[1] += center[1] + average[2] += center[2] + + average[0] = average[0] / len(children) + average[1] = average[1] / len(children) + average[2] = average[2] / len(children) + + set_prop(73, xco, average[0]) + set_prop(73, yco, average[1]) + set_prop(73, zco, average[2]) + + +def grab_center(): + + global xco + global yco + global zco + + state = update_state() + if state["activeObject"] and idprops_type(state["activeObject"], 73): + center = Blender.Window.GetCursorPos() + + set_prop(73, xco, center[0]) + set_prop(73, yco, center[1]) + set_prop(73, zco, center[2]) + + +def create_lod(): + state = update_state() + actobj = state["activeObject"] + if actobj and not idprops_type(actobj, 73): + idprops_kill() + idprops_append(actobj,73, flt_properties.FLTLOD) + calc_center() + + + +def event(evt,val): + if evt == Draw.ESCKEY: + Draw.Exit() + +def but_event(evt): + + global LOD_MAKE + global LOD_DELETE + global LOD_CALC_CENTER + global LOD_GRAB_CENTER + global LOD_FREEZE + global LOD_PREVIOUS + global LOD_X + global LOD_Y + global LOD_Z + global LOD_SIG + global LOD_IN + global LOD_OUT + global LOD_TRANS + + global switch_in + global switch_out + global xco + global yco + global zco + global trans + global sig_size + + global lodflag + global previous_mask + global freeze_mask + + global evcode + + #do "system" events + if evt == evcode["LOD_MAKE"]: + create_lod() + + if evt == evcode["LOD_CALC_CENTER"]: + calc_center() + + if evt == evcode["LOD_DELETE"]: + idprops_kill() + + if evt == evcode["LOD_GRAB_CENTER"]: + grab_center() + + #do mask events + if evt == evcode["LOD_FREEZE"]: + if LOD_FREEZE.val == True: + set_lockmask(freeze_mask) + else: + clear_lockmask(freeze_mask) + + if evt == evcode["LOD_PREVIOUS"]: + if LOD_PREVIOUS.val == True: + set_lockmask(previous_mask) + else: + clear_lockmask(previous_mask) + + #do input events + if evt == evcode["LOD_X"]: + set_prop(73, xco, LOD_X.val) + if evt == evcode["LOD_Y"]: + set_prop(73, yco, LOD_Y.val) + if evt == evcode["LOD_Z"]: + set_prop(73, zco, LOD_Z.val) + if evt == evcode["LOD_SIG"]: + set_prop(73, sig_size, LOD_SIG.val) + if evt == evcode["LOD_IN"]: + set_prop(73, switch_in, LOD_IN.val) + if evt == evcode["LOD_OUT"]: + set_prop(73, switch_out, LOD_OUT.val) + if evt == evcode["LOD_TRANS"]: + set_prop(73, trans, LOD_TRANS.val) + + + Draw.Redraw(1) + Blender.Window.RedrawAll() + +def draw_propsheet(x,y): + + global LOD_MAKE + global LOD_DELETE + global LOD_CALC_CENTER + global LOD_GRAB_CENTER + global LOD_FREEZE + global LOD_PREVIOUS + global LOD_X + global LOD_Y + global LOD_Z + global LOD_SIG + global LOD_IN + global LOD_OUT + global LOD_TRANS + + #labels + global LOD_EDITLABEL + global LOD_SWITCHLABEL + global LOD_CENTERLABEL + global LOD_XLABEL + global LOD_YLABEL + global LOD_ZLABEL + global LOD_SIGLABEL + global LOD_INLABEL + global LOD_OUTLABEL + global LOD_TRANSLABEL + + + global switch_in + global switch_out + global xco + global yco + global zco + global trans + global sig_size + + global lodflag + global previous_mask + global freeze_mask + + global evcode + + + global evcode + + state = update_state() + + label_width = 100 + row_height = 20 + toggle_width = 50 + input_width = 100 + pad = 10 + origx = x + origy = (row_height * 16) + (pad * 16) + + + #editor label + x = origx + y = origy + LOD_EDITLABEL = Blender.Draw.Label("FLT Level of Detail Editor", x, y, 250, row_height) + + + #Center inputs + x = origx + y = y- (row_height + pad) + LOD_CENTERLABEL = Blender.Draw.Label("LOD center", x, y, label_width, row_height) + y = y- (row_height + pad) + LOD_XLABEL = Blender.Draw.Label("X Coordinate", x, y, label_width, row_height) + x = origx + (label_width + pad) + LOD_X = Blender.Draw.Number("", evcode["LOD_X"], x, y, input_width, row_height,get_prop(73,xco), -1000000.0, 1000000.0, "") + x = origx + y = y- (row_height + pad) + LOD_YLABEL = Blender.Draw.Label("Y Coordinate", x, y, label_width, row_height) + x = origx + (label_width + pad) + LOD_Y = Blender.Draw.Number("", evcode["LOD_Y"], x, y, input_width, row_height,get_prop(73,yco), -1000000.0, 1000000.0, "") + x = origx + y = y- (row_height + pad) + LOD_ZLABEL = Blender.Draw.Label("Z Coordinate", x, y, label_width, row_height) + x = origx + (label_width + pad) + LOD_Z = Blender.Draw.Number("", evcode["LOD_Z"], x, y, input_width, row_height,get_prop(73,zco), -1000000.0, 1000000.0, "") + + + #Switch inputs + x = origx + y = y- (row_height + pad) + LOD_SWITCHLABEL = Blender.Draw.Label("Switch Settings", x, y, input_width, row_height) + y = y- (row_height + pad) + LOD_SIGLABEL = Blender.Draw.Label("Significant Size", x, y, label_width, row_height) + x = origx + (label_width + pad) + LOD_SIG = Blender.Draw.Number("", evcode["LOD_SIG"], x, y, input_width, row_height, get_prop(73,sig_size), -1000000.0, 1000000.0, "") + x = origx + y = y- (row_height + pad) + LOD_INLABEL = Blender.Draw.Label("Switch In", x, y, label_width, row_height) + x = origx + (label_width + pad) + LOD_IN = Blender.Draw.Number("", evcode["LOD_IN"], x, y, input_width, row_height, get_prop(73,switch_in), -1000000.0, 1000000.0, "") + x = origx + y = y- (row_height + pad) + LOD_OUTLABEL = Blender.Draw.Label("Switch Out", x, y, label_width, row_height) + x = origx + (label_width + pad) + LOD_OUT = Blender.Draw.Number("", evcode["LOD_OUT"], x, y, input_width, row_height, get_prop(73,switch_out), -1000000.0, 1000000.0, "") + x = origx + y = y- (row_height + pad) + LOD_TRANSLABEL = Blender.Draw.Label("Transition", x, y, label_width, row_height) + x = origx + (label_width + pad) + LOD_TRANS = Blender.Draw.Number("", evcode["LOD_TRANS"], x, y, input_width, row_height, get_prop(73,trans), -1000000.0, 1000000.0, "") + + + x = origx + y = y - (row_height + pad) + LOD_MAKE = Blender.Draw.PushButton("Make LOD", evcode["LOD_MAKE"], x, y, input_width + label_width + pad, row_height, "Make a LOD Node out of Active Object") + y = y - (row_height + pad) + LOD_DELETE = Blender.Draw.PushButton("Delete LOD", evcode["LOD_DELETE"], x, y, input_width + label_width + pad, row_height, "Delete the LOD Node properties") + y = y - (row_height + pad) + LOD_CALC_CENTER = Blender.Draw.PushButton("Calculate Center", evcode["LOD_CALC_CENTER"], x, y, input_width + label_width + pad, row_height, "Calculate the center of this LOD") + y = y - (row_height + pad) + LOD_GRAB_CENTER = Blender.Draw.PushButton("Grab Center", evcode["LOD_GRAB_CENTER"], x, y, input_width + label_width + pad, row_height, "Grab center from 3d cursor") + y = y - (row_height + pad) + LOD_FREEZE = Blender.Draw.Toggle("Freeze Center", evcode["LOD_FREEZE"], x, y, input_width + label_width + pad, row_height, get_lockmask(freeze_mask), "") + y = y - (row_height + pad) + LOD_PREVIOUS = Blender.Draw.Toggle("Previous Range", evcode["LOD_PREVIOUS"], x, y, input_width + label_width + pad, row_height, get_lockmask(previous_mask), "") + +def gui(): + #draw the propsheet/toolbox. + psheety = 800 + #psheetx = psheety + 10 + draw_propsheet(20,psheety) + +Draw.Register(gui,event,but_event) + \ No newline at end of file diff --git a/release/scripts/flt_properties.py b/release/scripts/flt_properties.py index bc7c972ca66..4c841e9c0c0 100644 --- a/release/scripts/flt_properties.py +++ b/release/scripts/flt_properties.py @@ -197,7 +197,10 @@ def write_prop(fw,type,value,length): elif type == 'i': fw.write_int(value) elif type == 'I': - fw.write_uint(value) + #NOTE!: + #there is no unsigned int type in python, but we can only store signed ints in ID props + newvalue = struct.unpack('>I', struct.pack('>i', value))[0] + fw.write_uint(newvalue) elif type == 'd': fw.write_double(value) elif type == 'f': @@ -267,16 +270,16 @@ FLTObjectDisplay = [10] FLTLOD = { '3t8!id' : 'L', '4i!reserved' : 0, - '5d!switch in' : 0, - '6d!switch out' : 0, + '5d!switch in' : 0.0, + '6d!switch out' : 0.0, '7s!sfx ID1' : 0, '8s!sfx ID2' : 0, '9I!flags' : 0, - '10d!X co' : 0, - '11d!Y co' : 0, - '12d!Z co' : 0, - '13d!Transition' : 0, - '14d!Sig Size' : 0 + '10d!X co' : 0.0, + '11d!Y co' : 0.0, + '12d!Z co' : 0.0, + '13d!Transition' : 0.0, + '14d!Sig Size' : 0.0 } FLTLODDisplay = [4] diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index e1eb6718a30..e403fc33e06 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -41,7 +41,7 @@ struct ListBase; struct MemFile; #define BLENDER_VERSION 247 -#define BLENDER_SUBVERSION 0 +#define BLENDER_SUBVERSION 1 #define BLENDER_MINVERSION 245 #define BLENDER_MINSUBVERSION 15 diff --git a/source/blender/blenkernel/BKE_collision.h b/source/blender/blenkernel/BKE_collision.h index 2966d932a49..c483148e4de 100644 --- a/source/blender/blenkernel/BKE_collision.h +++ b/source/blender/blenkernel/BKE_collision.h @@ -119,8 +119,10 @@ FaceCollPair; ///////////////////////////////////////////////// // used in modifier.c from collision.c ///////////////////////////////////////////////// + BVHTree *bvhtree_build_from_mvert ( MFace *mfaces, unsigned int numfaces, MVert *x, unsigned int numverts, float epsilon ); void bvhtree_update_from_mvert ( BVHTree * bvhtree, MFace *faces, int numfaces, MVert *x, MVert *xnew, int numverts, int moving ); + ///////////////////////////////////////////////// LinkNode *BLI_linklist_append_fast ( LinkNode **listp, void *ptr ); @@ -133,6 +135,15 @@ void collision_move_object ( CollisionModifierData *collmd, float step, float pr void collisions_compute_barycentric ( float pv[3], float p1[3], float p2[3], float p3[3], float *w1, float *w2, float *w3 ); void interpolateOnTriangle ( float to[3], float v1[3], float v2[3], float v3[3], double w1, double w2, double w3 ); +///////////////////////////////////////////////// +// used in effect.c +///////////////////////////////////////////////// +CollisionModifierData **get_collisionobjects(Object *self, int *numcollobj); + +///////////////////////////////////////////////// + + + ///////////////////////////////////////////////// #endif diff --git a/source/blender/blenkernel/BKE_effect.h b/source/blender/blenkernel/BKE_effect.h index 3b4c3198179..6475f7a71ac 100644 --- a/source/blender/blenkernel/BKE_effect.h +++ b/source/blender/blenkernel/BKE_effect.h @@ -66,7 +66,7 @@ void pdEndEffectors(struct ListBase *lb); void pdDoEffectors(struct ListBase *lb, float *opco, float *force, float *speed, float cur_time, float loc_time, unsigned int flags); /* required for particle_system.c */ -void do_physical_effector(short type, float force_val, float distance, float falloff, float size, float damp, float *eff_velocity, float *vec_to_part, float *velocity, float *field, int planar, struct RNG *rng, float noise); +void do_physical_effector(Object *ob, float *opco, short type, float force_val, float distance, float falloff, float size, float damp, float *eff_velocity, float *vec_to_part, float *velocity, float *field, int planar, struct RNG *rng, float noise_factor, float charge, float pa_size); float effector_falloff(struct PartDeflect *pd, float *eff_velocity, float *vec_to_part); diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index cfcab54058d..b5e09d551f0 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -31,10 +31,11 @@ #include "BKE_cloth.h" -#include "DNA_group_types.h" -#include "DNA_object_types.h" #include "DNA_cloth_types.h" +#include "DNA_group_types.h" #include "DNA_mesh_types.h" +#include "DNA_object_types.h" +#include "DNA_object_force.h" #include "DNA_scene_types.h" #include "BKE_DerivedMesh.h" @@ -1307,9 +1308,34 @@ CollisionModifierData **get_collisionobjects(Object *self, int *numcollobj) for ( base = G.scene->base.first; base; base = base->next ) { coll_ob = base->object; - collmd = ( CollisionModifierData * ) modifiers_findByType ( coll_ob, eModifierType_Collision ); - - if ( !collmd ) + + if(coll_ob->pd && coll_ob->pd->deflect) + { + collmd = ( CollisionModifierData * ) modifiers_findByType ( coll_ob, eModifierType_Collision ); + } + + if ( collmd ) + { + if(coll_ob == self) + continue; + + if(numobj >= maxobj) + { + // realloc + int oldmax = maxobj; + CollisionModifierData **tmp; + maxobj *= 2; + tmp = MEM_callocN(sizeof(CollisionModifierData *)*maxobj, "CollisionObjectsArray"); + memcpy(tmp, objs, sizeof(CollisionModifierData *)*oldmax); + MEM_freeN(objs); + objs = tmp; + + } + + objs[numobj] = collmd; + numobj++; + } + else { if ( coll_ob->dup_group ) { @@ -1319,8 +1345,12 @@ CollisionModifierData **get_collisionobjects(Object *self, int *numcollobj) for ( go= group->gobject.first; go; go= go->next ) { coll_ob = go->ob; - - collmd = ( CollisionModifierData * ) modifiers_findByType ( coll_ob, eModifierType_Collision ); + collmd = NULL; + + if(coll_ob->pd && coll_ob->pd->deflect) + { + collmd = ( CollisionModifierData * ) modifiers_findByType ( coll_ob, eModifierType_Collision ); + } if ( !collmd ) continue; @@ -1347,27 +1377,6 @@ CollisionModifierData **get_collisionobjects(Object *self, int *numcollobj) numobj++; } } - } - else - { - if(coll_ob == self) - continue; - - if(numobj >= maxobj) - { - // realloc - int oldmax = maxobj; - CollisionModifierData **tmp; - maxobj *= 2; - tmp = MEM_callocN(sizeof(CollisionModifierData *)*maxobj, "CollisionObjectsArray"); - memcpy(tmp, objs, sizeof(CollisionModifierData *)*oldmax); - MEM_freeN(objs); - objs = tmp; - - } - - objs[numobj] = collmd; - numobj++; } } *numcollobj = numobj; @@ -1484,6 +1493,9 @@ int cloth_bvh_objcollision ( Object *ob, ClothModifierData * clmd, float step, f BVHTreeOverlap *overlap = NULL; int result = 0; + if(!collmd->bvhtree) + continue; + /* move object to position (step) in time */ collision_move_object ( collmd, step + dt, step ); diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 7620edac126..0842e55a0ea 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -59,6 +59,7 @@ #include "BKE_armature.h" #include "BKE_bad_level_calls.h" #include "BKE_blender.h" +#include "BKE_collision.h" #include "BKE_constraint.h" #include "BKE_deform.h" #include "BKE_depsgraph.h" @@ -228,6 +229,60 @@ void pdEndEffectors(ListBase *lb) /* Effectors */ /************************************************/ +// triangle - ray callback function +static void eff_tri_ray_hit(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) +{ + // whenever we hit a bounding box, we don't check further + hit->dist = -1; + hit->index = 1; +} + +// get visibility of a wind ray +static float eff_calc_visibility(Object *ob, float *co, float *dir) +{ + CollisionModifierData **collobjs = NULL; + int numcollobj = 0, i; + float norm[3], len = 0.0; + float visibility = 1.0; + + collobjs = get_collisionobjects(ob, &numcollobj); + + if(!collobjs) + return 0; + + VECCOPY(norm, dir); + VecMulf(norm, -1.0); + len = Normalize(norm); + + // check all collision objects + for(i = 0; i < numcollobj; i++) + { + CollisionModifierData *collmd = collobjs[i]; + + if(collmd->bvhtree) + { + BVHTreeRayHit hit; + + hit.index = -1; + hit.dist = len + FLT_EPSILON; + + // check if the way is blocked + if(BLI_bvhtree_ray_cast(collmd->bvhtree, co, norm, &hit, eff_tri_ray_hit, NULL)>=0) + { + // visibility is only between 0 and 1, calculated from 1-absorption + visibility *= MAX2(0.0, MIN2(1.0, (1.0-((float)collmd->absorption)*0.01))); + + if(visibility <= 0.0f) + break; + } + } + } + + MEM_freeN(collobjs); + + return visibility; +} + // noise function for wind e.g. static float wind_func(struct RNG *rng, float strength) { @@ -277,7 +332,10 @@ float effector_falloff(PartDeflect *pd, float *eff_velocity, float *vec_to_part) { float eff_dir[3], temp[3]; float falloff=1.0, fac, r_fac; - + + if(pd->forcefield==PFIELD_LENNARDJ) + return falloff; /* Lennard-Jones field has it's own falloff built in */ + VecCopyf(eff_dir,eff_velocity); Normalize(eff_dir); @@ -314,12 +372,18 @@ float effector_falloff(PartDeflect *pd, float *eff_velocity, float *vec_to_part) return falloff; } -void do_physical_effector(short type, float force_val, float distance, float falloff, float size, float damp, float *eff_velocity, float *vec_to_part, float *velocity, float *field, int planar, struct RNG *rng, float noise) +void do_physical_effector(Object *ob, float *opco, short type, float force_val, float distance, float falloff, float size, float damp, float *eff_velocity, float *vec_to_part, float *velocity, float *field, int planar, struct RNG *rng, float noise_factor, float charge, float pa_size) { float mag_vec[3]={0,0,0}; float temp[3], temp2[3]; float eff_vel[3]; - float wind = 0; + float noise = 0, visibility; + + // calculate visibility + visibility = eff_calc_visibility(ob, opco, vec_to_part); + if(visibility <= 0.0) + return; + falloff *= visibility; VecCopyf(eff_vel,eff_velocity); Normalize(eff_vel); @@ -328,11 +392,11 @@ void do_physical_effector(short type, float force_val, float distance, float fal case PFIELD_WIND: VECCOPY(mag_vec,eff_vel); - // add wind noise here - if(noise> 0.0f) - wind = wind_func(rng, noise); - - VecMulf(mag_vec,(force_val+wind)*falloff); + // add wind noise here, only if we have wind + if((noise_factor > 0.0f) && (force_val > FLT_EPSILON)) + noise = wind_func(rng, noise_factor); + + VecMulf(mag_vec,(force_val+noise)*falloff); VecAddf(field,field,mag_vec); break; @@ -381,20 +445,47 @@ void do_physical_effector(short type, float force_val, float distance, float fal VecMulf(mag_vec,damp*1.9f*(float)sqrt(force_val)); VecSubf(field,field,mag_vec); break; - case PFIELD_NUCLEAR: - /*pow here is root of cosine expression below*/ - //rad=(float)pow(2.0,-1.0/power)*distance/size; - //VECCOPY(mag_vec,vec_to_part); - //Normalize(mag_vec); - //VecMulf(mag_vec,(float)cos(3.0*M_PI/2.0*(1.0-1.0/(pow(rad,power)+1.0)))/(rad+0.2f)); - //VECADDFAC(field,field,mag_vec,force_val); + case PFIELD_CHARGE: + if(planar) + Projf(mag_vec,vec_to_part,eff_vel); + else + VecCopyf(mag_vec,vec_to_part); + + VecMulf(mag_vec,charge*force_val*falloff); + VecAddf(field,field,mag_vec); break; + case PFIELD_LENNARDJ: + { + float fac; + + if(planar) { + Projf(mag_vec,vec_to_part,eff_vel); + distance = VecLength(mag_vec); + } + else + VecCopyf(mag_vec,vec_to_part); + + /* at this distance the field is 60 times weaker than maximum */ + if(distance > 2.22 * (size+pa_size)) + break; + + fac = pow((size+pa_size)/distance,6.0); + + fac = - fac * (1.0 - fac) / distance; + + /* limit the repulsive term drastically to avoid huge forces */ + fac = ((fac>2.0) ? 2.0 : fac); + + /* 0.003715 is the fac value at 2.22 times (size+pa_size), + substracted to avoid discontinuity at the border + */ + VecMulf(mag_vec, force_val * (fac-0.0037315)); + VecAddf(field,field,mag_vec); + break; + } } } - - - /* -------- pdDoEffectors() -------- generic force/speed system, now used for particles and softbodies lb = listbase with objects that take part in effecting @@ -451,16 +542,16 @@ void pdDoEffectors(ListBase *lb, float *opco, float *force, float *speed, float VecSubf(vec_to_part, opco, ob->obmat[3]); distance = VecLength(vec_to_part); - falloff=effector_falloff(pd,ob->obmat[2],vec_to_part); - + falloff=effector_falloff(pd,ob->obmat[2],vec_to_part); + if(falloff<=0.0f) ; /* don't do anything */ else { float field[3]={0,0,0}, tmp[3]; VECCOPY(field, force); - do_physical_effector(pd->forcefield,pd->f_strength,distance, + do_physical_effector(ob, opco, pd->forcefield,pd->f_strength,distance, falloff,pd->f_dist,pd->f_damp,ob->obmat[2],vec_to_part, - speed,force,pd->flag&PFIELD_PLANAR, pd->rng, pd->f_noise); + speed,force,pd->flag&PFIELD_PLANAR, pd->rng, pd->f_noise, 0.0f, 0.0f); // for softbody backward compatibility if(flags & PE_WIND_AS_SPEED){ diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c index 0375ab22909..93e35a4db06 100644 --- a/source/blender/blenkernel/intern/implicit.c +++ b/source/blender/blenkernel/intern/implicit.c @@ -1451,7 +1451,7 @@ void cloth_calc_force(ClothModifierData *clmd, lfVector *lF, lfVector *lX, lfVec float triunnormal[3]={0,0,0}; // not-normalized-triangle normal float tmp[3]={0,0,0}; float factor = (mfaces[i].v4) ? 0.25 : 1.0 / 3.0; - factor *= 0.05; + factor *= 0.02; // calculate face normal if(mfaces[i].v4) diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index fe92edfbbd5..4af25ee99e7 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -182,7 +182,7 @@ int part_ar[PART_TOTIPO]= { PART_EMIT_FREQ, PART_EMIT_LIFE, PART_EMIT_VEL, PART_EMIT_AVE, PART_EMIT_SIZE, PART_AVE, PART_SIZE, PART_DRAG, PART_BROWN, PART_DAMP, PART_LENGTH, PART_CLUMP, PART_GRAV_X, PART_GRAV_Y, PART_GRAV_Z, PART_KINK_AMP, PART_KINK_FREQ, PART_KINK_SHAPE, - PART_BB_TILT, PART_PD_FSTR, PART_PD_FFALL, PART_PD_FMAXD + PART_BB_TILT, PART_PD_FSTR, PART_PD_FFALL, PART_PD_FMAXD, PART_PD2_FSTR, PART_PD2_FFALL, PART_PD2_FMAXD }; @@ -1614,6 +1614,12 @@ void *get_ipo_poin(ID *id, IpoCurve *icu, int *type) poin= (part->pd?(&(part->pd->f_power)):NULL); break; case PART_PD_FMAXD: poin= (part->pd?(&(part->pd->maxdist)):NULL); break; + case PART_PD2_FSTR: + poin= (part->pd2?(&(part->pd2->f_strength)):NULL); break; + case PART_PD2_FFALL: + poin= (part->pd2?(&(part->pd2->f_power)):NULL); break; + case PART_PD2_FMAXD: + poin= (part->pd2?(&(part->pd2->maxdist)):NULL); break; } } diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index d08f30ff995..f33f33d9d46 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -5496,7 +5496,7 @@ static void collisionModifier_deformVerts( numverts = dm->getNumVerts ( dm ); - if(current_time > collmd->time) + if((current_time > collmd->time)|| (BKE_ptcache_get_continue_physics())) { // check if mesh has changed if(collmd->x && (numverts != collmd->numverts)) diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 643f90637ad..2f4696fc442 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -320,8 +320,14 @@ int psys_check_enabled(Object *ob, ParticleSystem *psys) /************************************************/ void psys_free_settings(ParticleSettings *part) { - if(part->pd) + if(part->pd) { MEM_freeN(part->pd); + part->pd = NULL; + } + if(part->pd2) { + MEM_freeN(part->pd2); + part->pd2 = NULL; + } } void free_hair(ParticleSystem *psys, int softbody) @@ -3015,6 +3021,7 @@ ParticleSettings *psys_copy_settings(ParticleSettings *part) partn= copy_libblock(part); if(partn->pd) partn->pd= MEM_dupallocN(part->pd); + if(partn->pd2) partn->pd2= MEM_dupallocN(part->pd2); return partn; } diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 60fdbca2021..ef8373ee977 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -60,6 +60,7 @@ #include "BKE_bad_level_calls.h" #include "BKE_cdderivedmesh.h" #include "BKE_displist.h" +#include "BKE_effect.h" #include "BKE_particle.h" #include "BKE_global.h" #include "BKE_utildefines.h" @@ -2205,6 +2206,9 @@ static int get_particles_from_cache(Object *ob, ParticleSystem *psys, int cfra) return 1; } +/************************************************/ +/* Effectors */ +/************************************************/ static void do_texture_effector(Tex *tex, short mode, short is_2d, float nabla, short object, float *pa_co, float obmat[4][4], float force_val, float falloff, float *field) { TexResult result[4]; @@ -2322,10 +2326,11 @@ static void add_to_effectors(ListBase *lb, Object *ob, Object *obsrc, ParticleSy for(i=0; epsys; epsys=epsys->next,i++){ type=0; - if(epsys!=psys){ + if(epsys!=psys || (psys->part->flag & PART_SELF_EFFECT)){ epart=epsys->part; - if(epsys->part->pd && epsys->part->pd->forcefield) + if((epsys->part->pd && epsys->part->pd->forcefield) + || (epsys->part->pd2 && epsys->part->pd2->forcefield)) type=PSYS_EC_PARTICLE; if(epart->type==PART_REACTOR) { @@ -2574,35 +2579,31 @@ void do_effectors(int pa_no, ParticleData *pa, ParticleKey *state, Object *ob, P ListBase *lb=&psys->effectors; ParticleEffectorCache *ec; float distance, vec_to_part[3]; - float falloff; + float falloff, charge = 0.0f; int p; /* check all effector objects for interaction */ if(lb->first){ + if(psys->part->pd && psys->part->pd->forcefield==PFIELD_CHARGE){ + /* Only the charge of the effected particle is used for + interaction, not fall-offs. If the fall-offs aren't the + same this will be unphysical, but for animation this + could be the wanted behavior. If you want physical + correctness the fall-off should be spherical 2.0 anyways. + */ + charge = psys->part->pd->f_strength; + } + if(psys->part->pd2 && psys->part->pd2->forcefield==PFIELD_CHARGE){ + charge += psys->part->pd2->f_strength; + } for(ec = lb->first; ec; ec= ec->next){ eob= ec->ob; if(ec->type & PSYS_EC_EFFECTOR){ pd=eob->pd; if(psys->part->type!=PART_HAIR && psys->part->integrator) where_is_object_time(eob,cfra); - /* Get IPO force strength and fall off values here */ - //if (has_ipo_code(eob->ipo, OB_PD_FSTR)) - // force_val = IPO_GetFloatValue(eob->ipo, OB_PD_FSTR, cfra); - //else - // force_val = pd->f_strength; - - //if (has_ipo_code(eob->ipo, OB_PD_FFALL)) - // ffall_val = IPO_GetFloatValue(eob->ipo, OB_PD_FFALL, cfra); - //else - // ffall_val = pd->f_power; - - //if (has_ipo_code(eob->ipo, OB_PD_FMAXD)) - // maxdist = IPO_GetFloatValue(eob->ipo, OB_PD_FMAXD, cfra); - //else - // maxdist = pd->maxdist; /* use center of object for distance calculus */ - //obloc= eob->obmat[3]; VecSubf(vec_to_part, state->co, eob->obmat[3]); distance = VecLength(vec_to_part); @@ -2615,22 +2616,22 @@ void do_effectors(int pa_no, ParticleData *pa, ParticleKey *state, Object *ob, P pd->flag & PFIELD_TEX_OBJECT, (pd->flag & PFIELD_TEX_ROOTCO) ? rootco : state->co, eob->obmat, pd->f_strength, falloff, force_field); } else { - do_physical_effector(pd->forcefield,pd->f_strength,distance, - falloff,pd->f_dist,pd->f_damp,eob->obmat[2],vec_to_part, - pa->state.vel,force_field,pd->flag&PFIELD_PLANAR, pd->rng, pd->f_noise); + do_physical_effector(eob, state->co, pd->forcefield,pd->f_strength,distance, + falloff,0.0,pd->f_damp,eob->obmat[2],vec_to_part, + pa->state.vel,force_field,pd->flag&PFIELD_PLANAR,pd->rng,pd->f_noise,charge,pa->size); } } if(ec->type & PSYS_EC_PARTICLE){ - int totepart; + int totepart, i; epsys= BLI_findlink(&eob->particlesystem,ec->psys_nbr); epart= epsys->part; - pd= epart->pd; + pd=epart->pd; totepart= epsys->totpart; if(totepart <= 0) continue; - if(pd->forcefield==PFIELD_HARMONIC){ + if(pd && pd->forcefield==PFIELD_HARMONIC){ /* every particle is mapped to only one harmonic effector particle */ p= pa_no%epsys->totpart; totepart= p+1; @@ -2642,31 +2643,27 @@ void do_effectors(int pa_no, ParticleData *pa, ParticleKey *state, Object *ob, P epsys->lattice=psys_get_lattice(ob,psys); for(; pparticles + p; estate.time=-1.0; if(psys_get_particle_state(eob,epsys,p,&estate,0)){ VECSUB(vec_to_part, state->co, estate.co); distance = VecLength(vec_to_part); - - //if(pd->forcefield==PFIELD_HARMONIC){ - // //if(cfra < epa->time + radius){ /* radius is fade-in in ui */ - // // eforce*=(cfra-epa->time)/radius; - // //} - //} - //else{ - // /* Limit minimum distance to effector particle so that */ - // /* the force is not too big */ - // if (distance < 0.001) distance = 0.001f; - //} - falloff=effector_falloff(pd,estate.vel,vec_to_part); + for(i=0, pd = epart->pd; i<2; i++,pd = epart->pd2) { + if(pd==NULL || pd->forcefield==0) continue; - if(falloff<=0.0f) - ; /* don't do anything */ - else - do_physical_effector(pd->forcefield,pd->f_strength,distance, - falloff,epart->size,pd->f_damp,estate.vel,vec_to_part, - state->vel,force_field,0, pd->rng, pd->f_noise); + falloff=effector_falloff(pd,estate.vel,vec_to_part); + + if(falloff<=0.0f) + ; /* don't do anything */ + else + do_physical_effector(eob, state->co, pd->forcefield,pd->f_strength,distance, + falloff,epart->size,pd->f_damp,estate.vel,vec_to_part, + state->vel,force_field,0, pd->rng, pd->f_noise,charge,pa->size); + } } else if(pd->forcefield==PFIELD_HARMONIC && cfra-framestep <= epa->dietime && cfra>epa->dietime){ /* first step after key release */ diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 9d7a0302d45..35ca42a4949 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2589,6 +2589,7 @@ static void lib_link_particlesettings(FileData *fd, Main *main) static void direct_link_particlesettings(FileData *fd, ParticleSettings *part) { part->pd= newdataadr(fd, part->pd); + part->pd2= newdataadr(fd, part->pd2); } static void lib_link_particlesystems(FileData *fd, ID *id, ListBase *particles) diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index b462233528a..d596f57990f 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -535,6 +535,7 @@ static void write_particlesettings(WriteData *wd, ListBase *idbase) writestruct(wd, ID_PA, "ParticleSettings", 1, part); if (part->id.properties) IDP_WriteProperty(part->id.properties, wd); writestruct(wd, DATA, "PartDeflect", 1, part->pd); + writestruct(wd, DATA, "PartDeflect", 1, part->pd2); } part= part->id.next; } diff --git a/source/blender/include/BIF_resources.h b/source/blender/include/BIF_resources.h index df514190270..0d27804dd1a 100644 --- a/source/blender/include/BIF_resources.h +++ b/source/blender/include/BIF_resources.h @@ -524,6 +524,10 @@ enum { TH_EDGE_SHARP, TH_EDITMESH_ACTIVE, + + TH_HANDLE_VERTEX, + TH_HANDLE_VERTEX_SELECT, + TH_HANDLE_VERTEX_SIZE, }; /* XXX WARNING: previous is saved in file, so do not change order! */ diff --git a/source/blender/makesdna/DNA_ipo_types.h b/source/blender/makesdna/DNA_ipo_types.h index 03ffef3cd55..1e30f3f7640 100644 --- a/source/blender/makesdna/DNA_ipo_types.h +++ b/source/blender/makesdna/DNA_ipo_types.h @@ -354,8 +354,8 @@ typedef short IPO_Channel; /* ******************** */ /* particle ipos */ -#define PART_TOTIPO 22 -#define PART_TOTNAM 22 +#define PART_TOTIPO 25 +#define PART_TOTNAM 25 #define PART_EMIT_FREQ 1 #define PART_EMIT_LIFE 2 @@ -385,6 +385,10 @@ typedef short IPO_Channel; #define PART_PD_FFALL 21 #define PART_PD_FMAXD 22 +#define PART_PD2_FSTR 23 +#define PART_PD2_FFALL 24 +#define PART_PD2_FMAXD 25 + /* these are IpoCurve specific */ /* **************** IPO ********************* */ diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 9ce04c1c272..0f820e88541 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -392,7 +392,8 @@ typedef struct CollisionModifierData { unsigned int numverts; unsigned int numfaces; - int pad; + short absorption; /* used for forces, in % */ + short pad; float time; /* cfra time of modifier */ struct BVHTree *bvhtree; /* bounding volume hierarchy for this cloth object */ } CollisionModifierData; diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h index 5f6ae7c7f06..5900e16d5e8 100644 --- a/source/blender/makesdna/DNA_object_force.h +++ b/source/blender/makesdna/DNA_object_force.h @@ -156,8 +156,8 @@ typedef struct SoftBody { #define PFIELD_GUIDE 5 #define PFIELD_TEXTURE 6 #define PFIELD_HARMONIC 7 -#define PFIELD_NUCLEAR 8 -#define PFIELD_MDIPOLE 9 +#define PFIELD_CHARGE 8 +#define PFIELD_LENNARDJ 9 /* pd->flag: various settings */ diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h index 4f62cd084cc..363f0075e23 100644 --- a/source/blender/makesdna/DNA_particle_types.h +++ b/source/blender/makesdna/DNA_particle_types.h @@ -166,6 +166,7 @@ typedef struct ParticleSettings { struct Object *bb_ob; struct Ipo *ipo; struct PartDeflect *pd; + struct PartDeflect *pd2; } ParticleSettings; typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in copy_particlesystem */ @@ -264,6 +265,8 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in #define PART_CHILD_RENDER (1<<29) #define PART_CHILD_GUIDE (1<<30) +#define PART_SELF_EFFECT (1<<22) + /* part->rotfrom */ #define PART_ROT_KEYS 0 /* interpolate directly from keys */ #define PART_ROT_ZINCR 1 /* same as zdir but done incrementally from previous position */ diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index cd1c047dac9..856324695a9 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -101,6 +101,11 @@ typedef struct ThemeSpace { char movie[4], image[4], scene[4], audio[4]; // for sequence editor char effect[4], plugin[4], transition[4], meta[4]; char editmesh_active[4]; + + char handle_vertex[4]; + char handle_vertex_select[4]; + char handle_vertex_size; + char hpad[7]; } ThemeSpace; diff --git a/source/blender/python/api2_2x/Material.c b/source/blender/python/api2_2x/Material.c index ccd24a437b5..20747a167e6 100644 --- a/source/blender/python/api2_2x/Material.c +++ b/source/blender/python/api2_2x/Material.c @@ -554,6 +554,7 @@ static int Material_setSssTexScatter( BPy_Material * self, PyObject * value ); static int Material_setSssFront( BPy_Material * self, PyObject * value ); static int Material_setSssBack( BPy_Material * self, PyObject * value ); static int Material_setSssBack( BPy_Material * self, PyObject * value ); +static int Material_setTexChannel( BPy_Material * self, PyObject * value ); static PyObject *Material_getColorComponent( BPy_Material * self, void * closure ); @@ -633,6 +634,7 @@ static PyObject *Material_getSssBack( BPy_Material * self ); static PyObject *Material_getFilter( BPy_Material * self ); static PyObject *Material_getTranslucency( BPy_Material * self ); static PyObject *Material_getTextures( BPy_Material * self ); +static PyObject *Material_getTexChannel( BPy_Material * self ); static PyObject *Material_clearIpo( BPy_Material * self ); static PyObject *Material_setTexture( BPy_Material * self, PyObject * args ); @@ -1140,7 +1142,11 @@ static PyGetSetDef BPy_Material_getseters[] = { NULL}, {"lightGroup", (getter)Material_getLightGroup, (setter)Material_setLightGroup, - "Set the light group for this material", + "The light group for this material", + NULL}, + {"enabledTextures", + (getter)Material_getTexChannel, (setter)Material_setTexChannel, + "Enabled texture channels for this material", NULL}, {"R", (getter)Material_getColorComponent, (setter)Material_setColorComponent, @@ -1517,6 +1523,36 @@ static PyObject *Material_getLightGroup( BPy_Material * self ) return Group_CreatePyObject( self->material->group ); } +static PyObject *Material_getTexChannel( BPy_Material * self ) +{ + int i; + short mask = 1; + PyObject *list = PyList_New(0); + if( !list ) + return EXPP_ReturnPyObjError( PyExc_MemoryError, + "PyList_New() failed" ); + + for( i = 0, mask = 1; i < MAX_MTEX ; ++i, mask <<= 1 ) { + if( self->material->mtex[i] && (mask & self->material->septex) == 0 ) { + PyObject * val = PyInt_FromLong(i); + if( !val ) { + Py_DECREF( list ); + return EXPP_ReturnPyObjError( PyExc_MemoryError, + "PyInt_FromLong() failed" ); + } + if( PyList_Append( list, val ) < 0 ) { + Py_DECREF( val ); + Py_DECREF( list ); + return EXPP_ReturnPyObjError( PyExc_RuntimeError, + "PyList_Append() failed" ); + } + Py_DECREF( val ); + } + } + + return list; +} + static PyObject *Material_getHaloSize( BPy_Material * self ) { return PyFloat_FromDouble( ( double ) self->material->hasize ); @@ -1982,6 +2018,57 @@ static int Material_setLightGroup( BPy_Material * self, PyObject * value ) return GenericLib_assignData(value, (void **) &self->material->group, NULL, 1, ID_GR, 0); } +static int Material_setTexChannel( BPy_Material * self, PyObject * value ) +{ + int i, mask; + short septex = 0; + int result = 1; + + /* fail if input is not a standard sequence */ + if( !PyList_Check( value ) && !PyTuple_Check( value ) ) + return EXPP_ReturnIntError( PyExc_TypeError, + "expected tuple or list of integers" ); + + /* get a fast sequence; in Python 2.5, this just return the original + * list or tuple and INCREFs it, so we must DECREF */ + value = PySequence_Fast( value, "" ); + + /* set the disable bit for each existing texture */ + for( i= 0, mask= 1; i < MAX_MTEX; ++i, mask <<= 1 ) + if( self->material->mtex[i] != NULL ) + septex |= mask; + + /* check the list, and build new septex value */ + for( i= PySequence_Size(value)-1; i >= 0; --i ) { + long ival; + PyObject *item = PySequence_Fast_GET_ITEM( value, i ); + if( !PyInt_Check( item ) ) { + PyErr_SetString ( PyExc_TypeError, + "expected tuple or list of integers" ); + goto exit; + } + ival= PyInt_AsLong( item ); + if(ival < 0 || ival > MAX_MTEX) { + PyErr_SetString( PyExc_ValueError, + "channel value out of range" ); + goto exit; + } + ival&= (1<material->mtex[(int)ival] == NULL ) { + PyErr_SetString( PyExc_ValueError, + "channels must have a texture assigned" ); + goto exit; + } + septex&= ~(1<material->septex= septex; + result = 0; + +exit: + Py_DECREF(value); + return result; +} + static int Material_setAdd( BPy_Material * self, PyObject * value ) { return EXPP_setFloatClamped ( value, &self->material->add, @@ -2313,9 +2400,6 @@ static int Material_setSssBack( BPy_Material * self, PyObject * value ) EXPP_MAT_SSS_BACK_MAX); } - - - static PyObject *Material_setTexture( BPy_Material * self, PyObject * args ) { int texnum; diff --git a/source/blender/python/api2_2x/Mesh.c b/source/blender/python/api2_2x/Mesh.c index 9f68287d658..b3e8fefdb7b 100644 --- a/source/blender/python/api2_2x/Mesh.c +++ b/source/blender/python/api2_2x/Mesh.c @@ -5381,11 +5381,11 @@ static PyObject *MFaceSeq_delete( BPy_MFaceSeq * self, PyObject *args ) if( PySequence_Size( args ) != 2 || !PyArg_ParseTuple( args, "iO", &edge_also, &args ) ) return EXPP_ReturnPyObjError( PyExc_TypeError, - "expected and int and a sequence of ints or MFaces" ); + "expected an int and a sequence of ints or MFaces" ); if( !PyList_Check( args ) && !PyTuple_Check( args ) ) return EXPP_ReturnPyObjError( PyExc_TypeError, - "expected and int and a sequence of ints or MFaces" ); + "expected an int and a sequence of ints or MFaces" ); /* see how many args we need to parse */ len = PySequence_Size( args ); diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c index 45cce46d389..dc70921492c 100644 --- a/source/blender/python/api2_2x/Object.c +++ b/source/blender/python/api2_2x/Object.c @@ -204,6 +204,7 @@ enum obj_consts { EXPP_OBJ_ATTR_SB_INSPRING, EXPP_OBJ_ATTR_SB_INFRICT, + EXPP_OBJ_ATTR_EMPTY_DRAWTYPE }; #define EXPP_OBJECT_DRAWSIZEMIN 0.01f @@ -2431,6 +2432,12 @@ static int Object_setDrawType( BPy_Object * self, PyObject * value ) OB_BOUNDBOX, OB_TEXTURE, 'b' ); } +static int Object_setEmptyShape( BPy_Object * self, PyObject * value ) +{ + return EXPP_setIValueRange( value, &self->object->empty_drawtype, + OB_ARROWS, OB_EMPTY_CONE, 'b' ); +} + static int Object_setEuler( BPy_Object * self, PyObject * args ) { float rot1, rot2, rot3; @@ -3758,6 +3765,9 @@ static PyObject *getIntAttr( BPy_Object *self, void *type ) case EXPP_OBJ_ATTR_DRAWTYPE: param = object->dt; break; + case EXPP_OBJ_ATTR_EMPTY_DRAWTYPE: + param = object->empty_drawtype; + break; case EXPP_OBJ_ATTR_PARENT_TYPE: param = object->partype; break; @@ -4938,6 +4948,10 @@ static PyGetSetDef BPy_Object_getseters[] = { (getter)getIntAttr, (setter)Object_setDrawType, "The object's drawing type", (void *)EXPP_OBJ_ATTR_DRAWTYPE}, + {"emptyShape", + (getter)getIntAttr, (setter)Object_setEmptyShape, + "The empty's drawing shape", + (void *)EXPP_OBJ_ATTR_EMPTY_DRAWTYPE}, {"parentType", (getter)getIntAttr, (setter)NULL, "The object's parent type", @@ -5538,6 +5552,24 @@ static PyObject *M_Object_IpoKeyTypesDict( void ) return M; } +static PyObject *M_Object_EmptyShapesDict( void ) +{ + PyObject *M = PyConstant_New( ); + + if( M ) { + BPy_constant *d = ( BPy_constant * ) M; + PyConstant_Insert( d, "ARROWS", PyInt_FromLong( OB_ARROWS ) ); + PyConstant_Insert( d, "AXES", PyInt_FromLong( OB_PLAINAXES ) ); + PyConstant_Insert( d, "CIRCLE", PyInt_FromLong( OB_CIRCLE ) ); + PyConstant_Insert( d, "ARROW", PyInt_FromLong( OB_SINGLE_ARROW ) ); + PyConstant_Insert( d, "CUBE", PyInt_FromLong( OB_CUBE ) ); + PyConstant_Insert( d, "SPHERE", PyInt_FromLong( OB_EMPTY_SPHERE ) ); + PyConstant_Insert( d, "CONE", PyInt_FromLong( OB_EMPTY_CONE ) ); + } + return M; +} + + /*****************************************************************************/ /* Function: initObject */ /*****************************************************************************/ @@ -5552,6 +5584,7 @@ PyObject *Object_Init( void ) PyObject *RBFlagsDict = M_Object_RBFlagsDict( ); PyObject *RBShapesDict = M_Object_RBShapeBoundDict( ); PyObject *IpoKeyTypesDict = M_Object_IpoKeyTypesDict( ); + PyObject *EmptyShapesDict = M_Object_EmptyShapesDict( ); PyType_Ready( &Object_Type ) ; @@ -5596,7 +5629,9 @@ PyObject *Object_Init( void ) if( RBShapesDict ) PyModule_AddObject( module, "RBShapes", RBShapesDict ); if( IpoKeyTypesDict ) - PyModule_AddObject( module, "IpoKeyTypes", IpoKeyTypesDict ); + PyModule_AddObject( module, "IpoKeyTypes", IpoKeyTypesDict ); + if( EmptyShapesDict ) + PyModule_AddObject( module, "EmptyShapes", EmptyShapesDict ); /*Add SUBMODULES to the module*/ dict = PyModule_GetDict( module ); /*borrowed*/ diff --git a/source/blender/python/api2_2x/doc/Material.py b/source/blender/python/api2_2x/doc/Material.py index a3496164cd1..02f7edd77f5 100644 --- a/source/blender/python/api2_2x/doc/Material.py +++ b/source/blender/python/api2_2x/doc/Material.py @@ -323,6 +323,21 @@ class Material: each color a list of 5 floats [0 - 1], [r,g,b,a,pos]. The colorband can have between 1 and 31 colors. @type colorbandSpecular: list + @type enabledTextures: list of integers + @ivar enabledTextures: The texture channels enabled in this material. + The attribute returns is list of integers in the range [0, 9], each + number representing the respective enabled MTex entry (see + L{getTextures()}). Enabling is done by assigning + a list of ints or an empty list. Attempting to enable a channel + which does not have a texture assigned to it will result in a + ValueError exception. + Example:: + mat.enabledTextures = [] # no texture channels are enabled + mat.enabledTextures = [0, 6] # texture channels 0 and 6 are enabled + ch = mat.enabledTextures + ch.append(4) + mat.enabledTextures = ch + print mat.enabledTextures # will print: [0, 4, 6] @ivar enableSSS: If True, subsurface scattering will be rendered on this material. @type enableSSS: bool @@ -1010,7 +1025,7 @@ class Material: def setTexture(index, texture, texco, mapto): """ - Assign a Blender Texture object to slot number 'number'. + Assign a Blender Texture object to channel number 'number'. @type index: int @param index: material's texture index in [0, 9]. @type texture: Blender Texture @@ -1033,7 +1048,7 @@ class Material: Get this Material's Texture list. @rtype: list of MTex @return: a list of Blender MTex objects. None is returned for each empty - texture slot. + texture channel. """ def getScriptLinks (event): diff --git a/source/blender/python/api2_2x/doc/Object.py b/source/blender/python/api2_2x/doc/Object.py index 2e4850aeb14..07942d58093 100644 --- a/source/blender/python/api2_2x/doc/Object.py +++ b/source/blender/python/api2_2x/doc/Object.py @@ -117,6 +117,10 @@ Example:: attribute. Only one type can be selected at a time. Values are BOX, SPHERE, CYLINDER, CONE, and POLYHEDERON +@type EmptyShapes: readonly dictionary +@var EmptyShapes: Constant dict used for with L{Object.emptyShape} attribute. + Only one type can be selected at a time. Values are + ARROW, ARROWS, AXES, CIRCLE, CONE, CUBE AND SPHERE """ def New (type, name='type'): @@ -347,7 +351,7 @@ class Object: ob.layers = [] # object won't be visible ob.layers = [1, 4] # object visible only in layers 1 and 4 ls = o.layers - ls.append([10]) + ls.append(10) o.layers = ls print ob.layers # will print: [1, 4, 10] B{Note}: changes will only be visible after the screen (at least @@ -525,6 +529,8 @@ class Object: @ivar drawType: The object's drawing type. See L{DrawTypes} constant dict for values. @type drawType: int + @ivar emptyShape: The empty drawing shape. + See L{EmptyShapes} constant dict for values. @ivar parentType: The object's parent type. Read-only. See L{ParentTypes} constant dict for values. @type parentType: int diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index 132bae8b7b8..78f19ad0608 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -3320,6 +3320,8 @@ static void object_panel_collision(Object *ob) uiDefBut(block, LABEL, 0, "",160,160,150,2, NULL, 0.0, 0, 0, 0, ""); if(pd->deflect) { + CollisionModifierData *collmd = (CollisionModifierData *)modifiers_findByType ( ob, eModifierType_Collision ); + uiDefBut(block, LABEL, 0, "Particle Interaction", 10,135,310,20, NULL, 0.0, 0, 0, 0, ""); uiBlockBeginAlign(block); @@ -3335,12 +3337,18 @@ static void object_panel_collision(Object *ob) uiDefBut(block, LABEL, 0, "Soft Body and Cloth Interaction", 10,65,310,20, NULL, 0.0, 0, 0, 0, ""); uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_FIELD_CHANGE, "Damping:", 10,45,150,20, &pd->pdef_sbdamp, 0.0, 1.0, 10, 0, "Amount of damping during collision"); - uiDefButF(block, NUM, B_FIELD_CHANGE, "Inner:", 10,25,150,20, &pd->pdef_sbift, 0.001, 1.0, 10, 0, "Inner face thickness"); - uiDefButF(block, NUM, B_FIELD_CHANGE, "Outer:", 10, 5,150,20, &pd->pdef_sboft, 0.001, 1.0, 10, 0, "Outer face thickness"); + uiDefButF(block, NUM, B_FIELD_CHANGE, "Inner:", 10,45,150,20, &pd->pdef_sbift, 0.001, 1.0, 10, 0, "Inner face thickness"); + uiDefButF(block, NUM, B_FIELD_CHANGE, "Outer:", 160, 45,150,20, &pd->pdef_sboft, 0.001, 1.0, 10, 0, "Outer face thickness"); uiBlockEndAlign(block); + uiDefButF(block, NUM, B_FIELD_CHANGE, "Damping:", 10,25,150,20, &pd->pdef_sbdamp, 0.0, 1.0, 10, 0, "Amount of damping during collision"); - uiDefButBitS(block, TOG, OB_SB_COLLFINAL, B_FIELD_CHANGE, "Ev.M.Stack", 170,45,150,20, &ob->softflag, 0, 0, 0, 0, "Pick collision object from modifier stack (softbody only)"); + uiDefButBitS(block, TOG, OB_SB_COLLFINAL, B_FIELD_CHANGE, "Ev.M.Stack", 160,25,150,20, &ob->softflag, 0, 0, 0, 0, "Pick collision object from modifier stack (softbody only)"); + + // collision options + if(collmd) + { + uiDefButS(block, NUM, B_FIELD_CHANGE, "Absorption: ", 10,0,150,20, &collmd->absorption, 0.0, 100, 1, 2, "How much of effector force gets lost during collision with this object (in percent)."); + } } } } @@ -3350,6 +3358,7 @@ static void object_panel_fields(Object *ob) uiBut *but; int particles=0; static short actpsys=-1; + static char slot=0; block= uiNewBlock(&curarea->uiblocks, "object_panel_fields", UI_EMBOSS, UI_HELV, curarea->win); if(uiNewPanel(curarea, block, "Fields", "Physics", 0, 0, 318, 204)==0) return; @@ -3371,7 +3380,7 @@ static void object_panel_fields(Object *ob) char *tipstr="Choose field type"; uiBlockBeginAlign(block); - + if(ob->particlesystem.first) { ParticleSystem *psys; char *menustr2= psys_menu_string(ob,1); @@ -3383,8 +3392,16 @@ static void object_panel_fields(Object *ob) if(psys->part->pd==NULL) psys->part->pd= MEM_callocN(sizeof(PartDeflect), "PartDeflect"); - pd= psys->part->pd; + if(psys->part->pd2==NULL) + psys->part->pd2= MEM_callocN(sizeof(PartDeflect), "PartDeflect"); + + pd= ((slot==1) ? psys->part->pd2 : psys->part->pd); particles=1; + + uiDefButC(block, ROW, B_REDR, "", 10, 163, 14, 14, &slot, 3.0, 0, 0, 0, "Edit first particle effector slot"); + uiDefButC(block, ROW, B_REDR, "", 24, 163, 14, 14, &slot, 3.0, 1, 0, 0, "Edit second particle effector slot"); + uiBlockEndAlign(block); + uiBlockBeginAlign(block); } else actpsys= -1; /* -1 = object */ @@ -3397,8 +3414,8 @@ static void object_panel_fields(Object *ob) /* setup menu button */ if(particles){ - sprintf(menustr, "Field Type%%t|None%%x0|Spherical%%x%d|Wind%%x%d|Vortex%%x%d|Magnetic%%x%d|Harmonic%%x%d", - PFIELD_FORCE, PFIELD_WIND, PFIELD_VORTEX, PFIELD_MAGNET, PFIELD_HARMONIC); + sprintf(menustr, "Field Type%%t|None%%x0|Spherical%%x%d|Wind%%x%d|Vortex%%x%d|Magnetic%%x%d|Harmonic%%x%d|Charge%%x%d|Lennard-Jones%%x%d", + PFIELD_FORCE, PFIELD_WIND, PFIELD_VORTEX, PFIELD_MAGNET, PFIELD_HARMONIC, PFIELD_CHARGE, PFIELD_LENNARDJ); if(pd->forcefield==PFIELD_FORCE) tipstr= "Particle attracts or repels particles (On shared object layers)"; else if(pd->forcefield==PFIELD_WIND) tipstr= "Constant force applied in direction of particle Z axis (On shared object layers)"; @@ -3406,11 +3423,11 @@ static void object_panel_fields(Object *ob) } else{ if(ob->type==OB_CURVE) - sprintf(menustr, "Field Type%%t|None%%x0|Spherical%%x%d|Wind%%x%d|Vortex%%x%d|Curve Guide%%x%d|Magnetic%%x%d|Harmonic%%x%d|Texture%%x%d", - PFIELD_FORCE, PFIELD_WIND, PFIELD_VORTEX, PFIELD_GUIDE, PFIELD_MAGNET, PFIELD_HARMONIC, PFIELD_TEXTURE); + sprintf(menustr, "Field Type%%t|None%%x0|Spherical%%x%d|Wind%%x%d|Vortex%%x%d|Curve Guide%%x%d|Magnetic%%x%d|Harmonic%%x%d|Texture%%x%d|Charge%%x%d|Lennard-Jones%%x%d", + PFIELD_FORCE, PFIELD_WIND, PFIELD_VORTEX, PFIELD_GUIDE, PFIELD_MAGNET, PFIELD_HARMONIC, PFIELD_TEXTURE, PFIELD_CHARGE, PFIELD_LENNARDJ); else - sprintf(menustr, "Field Type%%t|None%%x0|Spherical%%x%d|Wind%%x%d|Vortex%%x%d|Magnetic%%x%d|Harmonic%%x%d|Texture%%x%d", - PFIELD_FORCE, PFIELD_WIND, PFIELD_VORTEX, PFIELD_MAGNET, PFIELD_HARMONIC, PFIELD_TEXTURE); + sprintf(menustr, "Field Type%%t|None%%x0|Spherical%%x%d|Wind%%x%d|Vortex%%x%d|Magnetic%%x%d|Harmonic%%x%d|Texture%%x%d|Charge%%x%d|Lennard-Jones%%x%d", + PFIELD_FORCE, PFIELD_WIND, PFIELD_VORTEX, PFIELD_MAGNET, PFIELD_HARMONIC, PFIELD_TEXTURE, PFIELD_CHARGE, PFIELD_LENNARDJ); if(pd->forcefield==PFIELD_FORCE) tipstr= "Object center attracts or repels particles (On shared object layers)"; else if(pd->forcefield==PFIELD_WIND) tipstr= "Constant force applied in direction of Object Z axis (On shared object layers)"; @@ -3425,8 +3442,6 @@ static void object_panel_fields(Object *ob) uiBlockEndAlign(block); uiDefBut(block, LABEL, 0, "",160,180,150,2, NULL, 0.0, 0, 0, 0, ""); - - MEM_freeN(menustr); if(pd->forcefield) { uiBlockBeginAlign(block); @@ -3492,40 +3507,49 @@ static void object_panel_fields(Object *ob) uiBlockEndAlign(block); } else{ - uiDefButS(block, MENU, B_FIELD_DEP, "Fall-off%t|Cone%x2|Tube%x1|Sphere%x0", 160,180,140,20, &pd->falloff, 0.0, 0.0, 0, 0, "Fall-off shape"); - if(pd->falloff==PFIELD_FALL_TUBE) - uiDefBut(block, LABEL, 0, "Longitudinal", 160,160,140,20, NULL, 0.0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, PFIELD_POSZ, B_FIELD_CHANGE, "Pos", 160,140,40,20, &pd->flag, 0.0, 0, 0, 0, "Effect only in direction of positive Z axis"); - uiDefButF(block, NUM, B_FIELD_CHANGE, "Fall-off: ", 200,140,100,20, &pd->f_power, 0, 10, 10, 0, "Falloff power (real gravitational falloff = 2)"); - uiDefButBitS(block, TOG, PFIELD_USEMAX, B_FIELD_CHANGE, "Use", 160,120,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a maximum distance for the field to work"); - uiDefButF(block, NUM, B_FIELD_CHANGE, "MaxDist: ", 200,120,100,20, &pd->maxdist, 0, 1000.0, 10, 0, "Maximum distance for the field to work"); - uiDefButBitS(block, TOG, PFIELD_USEMIN, B_FIELD_CHANGE, "Use", 160,100,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a minimum distance for the field's fall-off"); - uiDefButF(block, NUM, B_FIELD_CHANGE, "MinDist: ", 200,100,100,20, &pd->mindist, 0, 1000.0, 10, 0, "Minimum distance for the field's fall-off"); - uiBlockEndAlign(block); - - if(pd->falloff==PFIELD_FALL_TUBE){ - uiDefBut(block, LABEL, 0, "Radial", 160,80,70,20, NULL, 0.0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_FIELD_CHANGE, "Fall-off: ", 160,60,140,20, &pd->f_power_r, 0, 10, 10, 0, "Radial falloff power (real gravitational falloff = 2)"); - uiDefButBitS(block, TOG, PFIELD_USEMAXR, B_FIELD_CHANGE, "Use", 160,40,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a maximum radial distance for the field to work"); - uiDefButF(block, NUM, B_FIELD_CHANGE, "MaxDist: ", 200,40,100,20, &pd->maxrad, 0, 1000.0, 10, 0, "Maximum radial distance for the field to work"); - uiDefButBitS(block, TOG, PFIELD_USEMINR, B_FIELD_CHANGE, "Use", 160,20,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a minimum radial distance for the field's fall-off"); - uiDefButF(block, NUM, B_FIELD_CHANGE, "MinDist: ", 200,20,100,20, &pd->minrad, 0, 1000.0, 10, 0, "Minimum radial distance for the field's fall-off"); - uiBlockEndAlign(block); + if(pd->forcefield==PFIELD_LENNARDJ) { + uiDefBut(block, LABEL, 0, "Fall-off determined", 160,140,140,20, NULL, 0.0, 0, 0, 0, ""); + uiDefBut(block, LABEL, 0, "by particle sizes", 160,120,140,20, NULL, 0.0, 0, 0, 0, ""); } - else if(pd->falloff==PFIELD_FALL_CONE){ - uiDefBut(block, LABEL, 0, "Angular", 160,80,70,20, NULL, 0.0, 0, 0, 0, ""); + else { + uiDefButS(block, MENU, B_FIELD_DEP, "Fall-off%t|Cone%x2|Tube%x1|Sphere%x0", 160,180,140,20, &pd->falloff, 0.0, 0.0, 0, 0, "Fall-off shape"); + if(pd->falloff==PFIELD_FALL_TUBE) + uiDefBut(block, LABEL, 0, "Longitudinal", 160,160,140,20, NULL, 0.0, 0, 0, 0, ""); uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_FIELD_CHANGE, "Fall-off: ", 160,60,140,20, &pd->f_power_r, 0, 10, 10, 0, "Radial falloff power (real gravitational falloff = 2)"); - uiDefButBitS(block, TOG, PFIELD_USEMAXR, B_FIELD_CHANGE, "Use", 160,40,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a maximum angle for the field to work"); - uiDefButF(block, NUM, B_FIELD_CHANGE, "MaxAngle: ", 200,40,100,20, &pd->maxrad, 0, 89.0, 10, 0, "Maximum angle for the field to work (in radians)"); - uiDefButBitS(block, TOG, PFIELD_USEMINR, B_FIELD_CHANGE, "Use", 160,20,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a minimum angle for the field's fall-off"); - uiDefButF(block, NUM, B_FIELD_CHANGE, "MinAngle: ", 200,20,100,20, &pd->minrad, 0, 89.0, 10, 0, "Minimum angle for the field's fall-off (in radians)"); + uiDefButBitS(block, TOG, PFIELD_POSZ, B_FIELD_CHANGE, "Pos", 160,140,40,20, &pd->flag, 0.0, 0, 0, 0, "Effect only in direction of positive Z axis"); + uiDefButF(block, NUM, B_FIELD_CHANGE, "Fall-off: ", 200,140,100,20, &pd->f_power, 0, 10, 10, 0, "Falloff power (real gravitational falloff = 2)"); + uiDefButBitS(block, TOG, PFIELD_USEMAX, B_FIELD_CHANGE, "Use", 160,120,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a maximum distance for the field to work"); + uiDefButF(block, NUM, B_FIELD_CHANGE, "MaxDist: ", 200,120,100,20, &pd->maxdist, 0, 1000.0, 10, 0, "Maximum distance for the field to work"); + uiDefButBitS(block, TOG, PFIELD_USEMIN, B_FIELD_CHANGE, "Use", 160,100,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a minimum distance for the field's fall-off"); + uiDefButF(block, NUM, B_FIELD_CHANGE, "MinDist: ", 200,100,100,20, &pd->mindist, 0, 1000.0, 10, 0, "Minimum distance for the field's fall-off"); uiBlockEndAlign(block); + + if(pd->falloff==PFIELD_FALL_TUBE){ + uiDefBut(block, LABEL, 0, "Radial", 160,80,70,20, NULL, 0.0, 0, 0, 0, ""); + uiBlockBeginAlign(block); + uiDefButF(block, NUM, B_FIELD_CHANGE, "Fall-off: ", 160,60,140,20, &pd->f_power_r, 0, 10, 10, 0, "Radial falloff power (real gravitational falloff = 2)"); + uiDefButBitS(block, TOG, PFIELD_USEMAXR, B_FIELD_CHANGE, "Use", 160,40,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a maximum radial distance for the field to work"); + uiDefButF(block, NUM, B_FIELD_CHANGE, "MaxDist: ", 200,40,100,20, &pd->maxrad, 0, 1000.0, 10, 0, "Maximum radial distance for the field to work"); + uiDefButBitS(block, TOG, PFIELD_USEMINR, B_FIELD_CHANGE, "Use", 160,20,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a minimum radial distance for the field's fall-off"); + uiDefButF(block, NUM, B_FIELD_CHANGE, "MinDist: ", 200,20,100,20, &pd->minrad, 0, 1000.0, 10, 0, "Minimum radial distance for the field's fall-off"); + uiBlockEndAlign(block); + } + else if(pd->falloff==PFIELD_FALL_CONE){ + uiDefBut(block, LABEL, 0, "Angular", 160,80,70,20, NULL, 0.0, 0, 0, 0, ""); + uiBlockBeginAlign(block); + uiDefButF(block, NUM, B_FIELD_CHANGE, "Fall-off: ", 160,60,140,20, &pd->f_power_r, 0, 10, 10, 0, "Radial falloff power (real gravitational falloff = 2)"); + uiDefButBitS(block, TOG, PFIELD_USEMAXR, B_FIELD_CHANGE, "Use", 160,40,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a maximum angle for the field to work"); + uiDefButF(block, NUM, B_FIELD_CHANGE, "MaxAngle: ", 200,40,100,20, &pd->maxrad, 0, 89.0, 10, 0, "Maximum angle for the field to work (in radians)"); + uiDefButBitS(block, TOG, PFIELD_USEMINR, B_FIELD_CHANGE, "Use", 160,20,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a minimum angle for the field's fall-off"); + uiDefButF(block, NUM, B_FIELD_CHANGE, "MinAngle: ", 200,20,100,20, &pd->minrad, 0, 89.0, 10, 0, "Minimum angle for the field's fall-off (in radians)"); + uiBlockEndAlign(block); + } } } + } + + MEM_freeN(menustr); } } @@ -4372,6 +4396,8 @@ static void object_panel_particle_extra(Object *ob) uiDefButBitI(block, TOG, PART_CHILD_EFFECT, B_PART_RECALC, "Children", butx+(butw*3)/5,buty,(butw*2)/5,buth, &part->flag, 0, 0, 0, 0, "Apply effectors to children"); uiBlockEndAlign(block); } + else if(part->phystype == PART_PHYS_NEWTON) + uiDefButBitI(block, TOG, PART_SELF_EFFECT, B_PART_RECALC, "Self Effect", butx,(buty-=buth),butw,buth, &part->flag, 0, 0, 0, 0, "Particle effectors effect themselves"); else buty-=buth; diff --git a/source/blender/src/drawipo.c b/source/blender/src/drawipo.c index 0e7476bbe82..71854570c8c 100644 --- a/source/blender/src/drawipo.c +++ b/source/blender/src/drawipo.c @@ -1212,16 +1212,9 @@ static void draw_ipovertices(int sel) /*}*/ } else { /* normal non bit curves */ if(ei->flag & IPO_EDIT) { - if(ei->icu->ipo==IPO_BEZ) { - /* Draw the editmode hendels for a bezier curve */ - if( (bezt->f1 & SELECT) == sel)/* && G.v2d->cur.xmin < bezt->vec[0][0] < G.v2d->cur.xmax)*/ - bglVertex3fv(bezt->vec[0]); - - if( (bezt->f3 & SELECT) == sel)/* && G.v2d->cur.xmin < bezt->vec[2][0] < G.v2d->cur.xmax)*/ - bglVertex3fv(bezt->vec[2]); - - } - + /* Only the vertex of the line, the + * handler are draw below. + */ if( (bezt->f2 & SELECT) == sel) /* && G.v2d->cur.xmin < bezt->vec[1][0] < G.v2d->cur.xmax)*/ bglVertex3fv(bezt->vec[1]); @@ -1237,6 +1230,45 @@ static void draw_ipovertices(int sel) bezt++; } bglEnd(); + + if (ei->flag & IPO_EDIT) { + /* Now draw the two vertex of the handler, + * need split it because we can't call glPointSize + * in the middle of a glBegin/glEnd also the + * bug comment before. + */ + a= ei->icu->totvert; + bezt= ei->icu->bezt; + + glPointSize(BIF_GetThemeValuef(TH_HANDLE_VERTEX_SIZE)); + + if(sel) BIF_ThemeColor(TH_HANDLE_VERTEX_SELECT); + else BIF_ThemeColor(TH_HANDLE_VERTEX); + + bglBegin(GL_POINTS); + + while(a--) { + if (ei->disptype!=IPO_DISPBITS) { + if(ei->flag & IPO_EDIT) { + if(ei->icu->ipo==IPO_BEZ) { + /* Draw the editmode hendels for a bezier curve */ + if( (bezt->f1 & SELECT) == sel)/* && G.v2d->cur.xmin < bezt->vec[0][0] < G.v2d->cur.xmax)*/ + bglVertex3fv(bezt->vec[0]); + + if( (bezt->f3 & SELECT) == sel)/* && G.v2d->cur.xmin < bezt->vec[2][0] < G.v2d->cur.xmax)*/ + bglVertex3fv(bezt->vec[2]); + } + } + } + bezt++; + } + bglEnd(); + + /* The color are always reset (see the while) + * but the point size not so we reset now. + */ + glPointSize(BIF_GetThemeValuef(TH_VERTEX_SIZE)); + } } } diff --git a/source/blender/src/editipo.c b/source/blender/src/editipo.c index 63c301658f2..cd6aefdb87c 100644 --- a/source/blender/src/editipo.c +++ b/source/blender/src/editipo.c @@ -462,24 +462,7 @@ static void make_part_editipo(SpaceIpo *si) name = getname_part_ei(part_ar[a]); strcpy(ei->name, name); ei->adrcode= part_ar[a]; - - //if(ei->adrcode & MA_MAP1) { - // ei->adrcode-= MA_MAP1; - // ei->adrcode |= texchannel_to_adrcode(si->channel); - //} - //else { - // if(ei->adrcode==MA_MODE) ei->disptype= IPO_DISPBITS; - //} - ei->col= ipo_rainbow(a, PART_TOTIPO); - - //len= strlen(ei->name); - //if(len) { - // if( ei->name[ len-1 ]=='R') ei->col= 0x5050FF; - // else if( ei->name[ len-1 ]=='G') ei->col= 0x50FF50; - // else if( ei->name[ len-1 ]=='B') ei->col= 0xFF7050; - //} - ei->icu= find_ipocurve(si->ipo, ei->adrcode); if(ei->icu) { ei->flag= ei->icu->flag; @@ -6011,4 +5994,4 @@ void move_to_frame(void) } } BIF_undo_push("Set frame to selected Ipo vertex"); -} \ No newline at end of file +} diff --git a/source/blender/src/editipo_lib.c b/source/blender/src/editipo_lib.c index 7b3d439833e..e1e286e10cf 100644 --- a/source/blender/src/editipo_lib.c +++ b/source/blender/src/editipo_lib.c @@ -103,7 +103,8 @@ char *ic_name_empty[1] ={ "" }; char *fluidsim_ic_names[FLUIDSIM_TOTNAM] = { "Fac-Visc", "Fac-Time", "GravX","GravY","GravZ", "VelX","VelY","VelZ", "Active" }; char *part_ic_names[PART_TOTNAM] = { "E_Freq", "E_Life", "E_Speed", "E_Angular", "E_Size", "Angular", "Size", "Drag", "Brown", "Damp", "Length", "Clump", -"GravX", "GravY", "GravZ", "KinkAmp", "KinkFreq", "KinkShape", "BBTilt", "FStreng", "FFall", "FMaxD"}; +"GravX", "GravY", "GravZ", "KinkAmp", "KinkFreq", "KinkShape", "BBTilt", +"FStreng", "FFall", "FMaxD", "F2Streng", "F2Fall", "F2MaxD"}; /* gets the appropriate icon for the given blocktype */ int geticon_ipo_blocktype(short blocktype) diff --git a/source/blender/src/resources.c b/source/blender/src/resources.c index f47f14a605c..acd14aae7a5 100644 --- a/source/blender/src/resources.c +++ b/source/blender/src/resources.c @@ -313,7 +313,15 @@ char *BIF_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid) cp= ts->transition; break; case TH_SEQ_META: cp= ts->meta; break; - + case TH_HANDLE_VERTEX: + cp= ts->handle_vertex; + break; + case TH_HANDLE_VERTEX_SELECT: + cp= ts->handle_vertex_select; + break; + case TH_HANDLE_VERTEX_SIZE: + cp= &ts->handle_vertex_size; + break; } } @@ -493,6 +501,10 @@ void BIF_InitTheme(void) SETCOL(btheme->tipo.hilite, 0x60, 0xc0, 0x40, 255); btheme->tipo.vertex_size= 3; + SETCOL(btheme->tipo.handle_vertex, 0xff, 0x70, 0xff, 255); + SETCOL(btheme->tipo.handle_vertex_select, 0xff, 0xff, 0x70, 255); + btheme->tipo.handle_vertex_size= 3; + /* space file */ /* to have something initialized */ btheme->tfile= btheme->tv3d; @@ -684,7 +696,10 @@ char *BIF_ThemeColorsPup(int spacetype) str += sprintf(str, "Vertex %%x%d|", TH_VERTEX); str += sprintf(str, "Vertex Selected %%x%d|", TH_VERTEX_SELECT); str += sprintf(str, "Vertex Size %%x%d|", TH_VERTEX_SIZE); - str += sprintf(str, "Current Frame %%x%d", TH_CFRAME); + str += sprintf(str, "Current Frame %%x%d|", TH_CFRAME); + str += sprintf(str, "Handle Vertex %%x%d|", TH_HANDLE_VERTEX); + str += sprintf(str, "Handle Vertex Selected %%x%d|", TH_HANDLE_VERTEX_SELECT); + str += sprintf(str, "Handle Vertex Size %%x%d", TH_HANDLE_VERTEX_SIZE); break; case SPACE_FILE: str += sprintf(str, "Selected file %%x%d", TH_HILITE); diff --git a/source/blender/src/space.c b/source/blender/src/space.c index fb055216f7f..8787cf9efc4 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -3492,6 +3492,9 @@ static void info_user_themebuts(uiBlock *block, short y1, short y2, short y3, sh uiButSetFunc(but, set_userdef_iconfile_cb, &iconfileindex, NULL); } + else if(th_curcol==TH_HANDLE_VERTEX_SIZE) { + uiDefButC(block, NUMSLI, B_UPDATE_THEME,"Handle size ", 465,y3,200,20, col, 1.0, 10.0, 0, 0, ""); + } else { uiBlockBeginAlign(block); if ELEM9(th_curcol, TH_PANEL, TH_LAMP, TH_FACE, TH_FACE_SELECT, TH_EDITMESH_ACTIVE, TH_MENU_BACK, TH_MENU_HILITE, TH_MENU_ITEM, TH_NODE) { diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c index 92e49ab29fa..15c2664a9d8 100644 --- a/source/blender/src/usiblender.c +++ b/source/blender/src/usiblender.c @@ -477,7 +477,15 @@ static void init_userdef_file(void) if ((G.main->versionfile < 245) || (G.main->versionfile == 245 && G.main->subversionfile < 16)) { U.flag |= USER_ADD_VIEWALIGNED|USER_ADD_EDITMODE; } - + if ((G.main->versionfile < 247) || (G.main->versionfile == 247 && G.main->subversionfile < 1)) { + bTheme *btheme; + for(btheme= U.themes.first; btheme; btheme= btheme->next) { + SETCOL(btheme->tipo.handle_vertex, 0xff, 0x70, 0xff, 255); + SETCOL(btheme->tipo.handle_vertex_select, 0xff, 0xff, 0x70, 255); + btheme->tipo.handle_vertex_size= 3; + } + } + /* GL Texture Garbage Collection (variable abused above!) */ if (U.textimeout == 0) { U.texcollectrate = 60; diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index 7de3056e382..16f8ae0095a 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -90,33 +90,10 @@ void update_for_newframe(); static BlendFileData *load_game_data(char *filename) { BlendReadError error; - //this doesn't work anymore for relative paths, so use BLO_read_from_memory instead - //BlendFileData *bfd= BLO_read_from_file(filename, &error); - FILE* file = fopen(filename,"rb"); - BlendFileData *bfd = 0; - if (file) - { - fseek(file, 0L, SEEK_END); - int len= ftell(file); - fseek(file, 0L, SEEK_SET); - char* filebuffer= new char[len];//MEM_mallocN(len, "text_buffer"); - int sizeread = fread(filebuffer,len,1,file); - if (sizeread==1){ - bfd = BLO_read_from_memory(filebuffer, len, &error); - } else { - error = BRE_UNABLE_TO_READ; - } - fclose(file); - // the memory is not released in BLO_read_from_memory, must do it here - delete filebuffer; - } else { - error = BRE_UNABLE_TO_OPEN; - } - + BlendFileData *bfd= BLO_read_from_file(filename, &error); if (!bfd) { printf("Loading %s failed: %s\n", filename, BLO_bre_as_string(error)); } - return bfd; } @@ -139,7 +116,9 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, // Acquire Python's GIL (global interpreter lock) // so we can safely run Python code and API calls PyGILState_STATE gilstate = PyGILState_Ensure(); - + + PyObject *pyGlobalDict = PyDict_New(); /* python utility storage, spans blend file loading */ + bgl::InitExtensions(true); do @@ -333,6 +312,7 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, initRasterizer(rasterizer, canvas); PyObject *gameLogic = initGameLogic(startscene); PyDict_SetItemString(dictionaryobject, "GameLogic", gameLogic); // Same as importing the module. + PyDict_SetItemString(PyModule_GetDict(gameLogic), "globalDict", pyGlobalDict); // Same as importing the module. initGameKeys(); initPythonConstraintBinding(); initMathutils(); @@ -407,6 +387,7 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, // which allows the scene to safely delete them :) // see: (space.c)->start_game PyDict_Clear(PyModule_GetDict(gameLogic)); + PyDict_SetItemString(PyModule_GetDict(gameLogic), "globalDict", pyGlobalDict); ketsjiengine->StopEngine(); exitGamePythonScripting(); diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp index 7be3b94d8ae..f859193ef7a 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -97,7 +97,7 @@ extern "C" #include "GHOST_IEventConsumer.h" #include "GHOST_IWindow.h" #include "GHOST_Rect.h" - +#include "marshal.h" static void frameTimerProc(GHOST_ITimerTask* task, GHOST_TUns64 time); @@ -125,7 +125,9 @@ GPG_Application::GPG_Application(GHOST_ISystem* system, struct Main* maggie, STR m_networkdevice(0), m_audiodevice(0), m_blendermat(0), - m_blenderglslmat(0) + m_blenderglslmat(0), + m_pyGlobalDictString(0), + m_pyGlobalDictString_Length(0) { fSystem = system; } @@ -645,14 +647,23 @@ bool GPG_Application::startEngine(void) PyObject* dictionaryobject = initGamePlayerPythonScripting("Ketsji", psl_Lowest); m_ketsjiengine->SetPythonDictionary(dictionaryobject); initRasterizer(m_rasterizer, m_canvas); - PyDict_SetItemString(dictionaryobject, "GameLogic", initGameLogic(startscene)); // Same as importing the module + PyObject *gameLogic = initGameLogic(startscene); + PyDict_SetItemString(dictionaryobject, "GameLogic", gameLogic); // Same as importing the module initGameKeys(); initPythonConstraintBinding(); initMathutils(); - - - + /* Restore the dict */ + if (m_pyGlobalDictString) { + PyObject* pyGlobalDict = PyMarshal_ReadObjectFromString(m_pyGlobalDictString, m_pyGlobalDictString_Length); + if (pyGlobalDict) { + PyDict_SetItemString(PyModule_GetDict(gameLogic), "globalDict", pyGlobalDict); // Same as importing the module. + } else { + PyErr_Clear(); + printf("Error could not marshall string\n"); + } + } + m_sceneconverter->ConvertScene( startscenename, startscene, @@ -688,6 +699,32 @@ bool GPG_Application::startEngine(void) void GPG_Application::stopEngine() { + // get the python dict and convert to a string for future use + { + SetPyGlobalDictMarshal(NULL, 0); + + PyObject* gameLogic = PyImport_ImportModule("GameLogic"); + if (gameLogic) { + PyObject* pyGlobalDict = PyDict_GetItemString(PyModule_GetDict(gameLogic), "globalDict"); // Same as importing the module + if (pyGlobalDict) { + PyObject* pyGlobalDictMarshal = PyMarshal_WriteObjectToString( pyGlobalDict, 2); // Py_MARSHAL_VERSION == 2 as of Py2.5 + if (pyGlobalDictMarshal) { + m_pyGlobalDictString_Length = PyString_Size(pyGlobalDictMarshal); + PyObject_Print(pyGlobalDictMarshal, stderr, 0); + m_pyGlobalDictString = static_cast (malloc(m_pyGlobalDictString_Length)); + memcpy(m_pyGlobalDictString, PyString_AsString(pyGlobalDictMarshal), m_pyGlobalDictString_Length); + } else { + printf("Error, GameLogic.globalDict could not be marshal'd\n"); + } + } else { + printf("Error, GameLogic.globalDict was removed\n"); + } + } else { + printf("Error, GameLogic failed to import GameLogic.globalDict will be lost\n"); + } + } + + // when exiting the mainloop exitGamePythonScripting(); m_ketsjiengine->StopEngine(); diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.h b/source/gameengine/GamePlayer/ghost/GPG_Application.h index 17f5add8b19..31f5eb75e52 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.h +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.h @@ -72,6 +72,29 @@ public: bool StartGameEngine(int stereoMode); void StopGameEngine(); + char* + GetPyGlobalDictMarshal() + { + return m_pyGlobalDictString; + }; + + void + SetPyGlobalDictMarshal( char* pyGlobalDictString, int length ) + { + if (m_pyGlobalDictString && m_pyGlobalDictString != pyGlobalDictString) + free(m_pyGlobalDictString); + + m_pyGlobalDictString = pyGlobalDictString; + m_pyGlobalDictString_Length = length; + }; + + int + GetPyGlobalDictMarshalLength() + { + return m_pyGlobalDictString_Length; + }; + + protected: bool handleWheel(GHOST_IEvent* event); bool handleButton(GHOST_IEvent* event, bool isDown); @@ -142,6 +165,12 @@ protected: bool m_blendermat; bool m_blenderglslmat; - + + /* + * GameLogic.globalDict as a string so that loading new blend files can use the same dict. + * Do this because python starts/stops when loading blend files. + */ + char* m_pyGlobalDictString; + int m_pyGlobalDictString_Length; }; diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index 8222e5c8bac..26a85128025 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -293,7 +293,9 @@ int main(int argc, char** argv) GHOST_TUns32 fullScreenHeight= 0; int fullScreenBpp = 32; int fullScreenFrequency = 60; - + char* pyGlobalDictString = NULL; /* store python dict data between blend file loading */ + int pyGlobalDictString_Length = 0; + #ifdef __linux__ #ifdef __alpha__ signal (SIGFPE, SIG_IGN); @@ -625,6 +627,10 @@ int main(int argc, char** argv) titlename = maggie->name; + // Set the GameLogic.globalDict from marshal'd data, so we can load new blend files + // abd keep data in GameLogic.globalDict + app.SetPyGlobalDictMarshal(pyGlobalDictString, pyGlobalDictString_Length); + // Check whether the game should be displayed full-screen if ((!fullScreenParFound) && (!windowParFound)) { @@ -750,6 +756,12 @@ int main(int argc, char** argv) } } app.StopGameEngine(); + + // GameLogic.globalDict has been converted into a buffer + // store in pyGlobalDictString so we can restore after python has stopped and started. + pyGlobalDictString = app.GetPyGlobalDictMarshal(); + pyGlobalDictString_Length = app.GetPyGlobalDictMarshalLength(); + BLO_blendfiledata_free(bfd); #ifdef __APPLE__ @@ -772,6 +784,11 @@ int main(int argc, char** argv) } } + if (pyGlobalDictString) { + free(pyGlobalDictString); + pyGlobalDictString = NULL; + } + return error ? -1 : 0; } diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index e0cd5a3bc9e..d6997ee29a8 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -680,188 +680,6 @@ void KX_ConvertODEEngineObject(KX_GameObject* gameobj, // forward declarations -static btCollisionShape* CreateBulletShapeFromMesh(RAS_MeshObject* meshobj, bool polytope) -{ - if (!meshobj) - return 0; - - btCollisionShape* collisionMeshShape = 0; - btConvexHullShape* convexHullShape = 0; - btTriangleMeshShape* concaveShape = 0; - - btTriangleMesh* collisionMeshData = 0; - - //see if there is any polygons, if not, bail out. - - int numPoints = 0; - btVector3* points = 0; - - // Mesh has no polygons! - int numpolys = meshobj->NumPolygons(); - if (!numpolys) - { - return NULL; - } - - // Count the number of collision polygons and check they all come from the same - // vertex array - int numvalidpolys = 0; - int vtxarray = -1; - RAS_IPolyMaterial *poly_material = NULL; - bool reinstance = true; - - for (int p=0; pGetPolygon(p); - - // only add polygons that have the collisionflag set - if (poly->IsCollider()) - { - // check polygon is from the same vertex array - if (poly->GetVertexIndexBase().m_vtxarray != vtxarray) - { - if (vtxarray < 0) - vtxarray = poly->GetVertexIndexBase().m_vtxarray; - else - { - reinstance = false; - vtxarray = -1; - } - } - - // check poly is from the same material - if (poly->GetMaterial()->GetPolyMaterial() != poly_material) - { - if (poly_material) - { - reinstance = false; - poly_material = NULL; - } - else - poly_material = poly->GetMaterial()->GetPolyMaterial(); - } - - // count the number of collision polys - numvalidpolys++; - - // We have one collision poly, and we can't reinstance, so we - // might as well break here. - if (!reinstance) - break; - } - } - - // No collision polygons - if (numvalidpolys < 1) - return NULL; - - - if (polytope) - { - convexHullShape = new btConvexHullShape(&points[0].getX(),numPoints); - collisionMeshShape = convexHullShape; - } else - { - collisionMeshData = new btTriangleMesh(); -// concaveShape = new btTriangleMeshShape(collisionMeshData); - //collisionMeshShape = concaveShape; - - } - - - numvalidpolys = 0; - - for (int p2=0; p2GetPolygon(p2); - - // only add polygons that have the collisionflag set - if (poly->IsCollider()) - { - //Bullet can raycast any shape, so - if (polytope) - { - for (int i=0;iVertexCount();i++) - { - const float* vtx = meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray, - poly->GetVertexIndexBase().m_indexarray[i], - poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ(); - btPoint3 point(vtx[0],vtx[1],vtx[2]); - convexHullShape->addPoint(point); - } - if (poly->VertexCount()) - numvalidpolys++; - - } else - { - { - const float* vtx = meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray, - poly->GetVertexIndexBase().m_indexarray[2], - poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ(); - btPoint3 vertex0(vtx[0],vtx[1],vtx[2]); - vtx = meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray, - poly->GetVertexIndexBase().m_indexarray[1], - poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ(); - btPoint3 vertex1(vtx[0],vtx[1],vtx[2]); - vtx = meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray, - poly->GetVertexIndexBase().m_indexarray[0], - poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ(); - btPoint3 vertex2(vtx[0],vtx[1],vtx[2]); - collisionMeshData->addTriangle(vertex0,vertex1,vertex2); - numvalidpolys++; - } - if (poly->VertexCount() == 4) - { - const float* vtx = meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray, - poly->GetVertexIndexBase().m_indexarray[3], - poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ(); - btPoint3 vertex0(vtx[0],vtx[1],vtx[2]); - vtx = meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray, - poly->GetVertexIndexBase().m_indexarray[2], - poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ(); - btPoint3 vertex1(vtx[0],vtx[1],vtx[2]); - vtx = meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray, - poly->GetVertexIndexBase().m_indexarray[0], - poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ(); - btPoint3 vertex2(vtx[0],vtx[1],vtx[2]); - collisionMeshData->addTriangle(vertex0,vertex1,vertex2); - numvalidpolys++; - } - - } - } - } - - - - if (numvalidpolys > 0) - { - - if (!polytope) - { - bool useQuantization = true; - concaveShape = new btBvhTriangleMeshShape( collisionMeshData, useQuantization ); - //concaveShape = new btTriangleMeshShape( collisionMeshData ); - - concaveShape->recalcLocalAabb(); - if (collisionMeshShape) - delete collisionMeshShape; - collisionMeshShape = concaveShape; - - } - - - - return collisionMeshShape; - } - if (collisionMeshShape) - delete collisionMeshShape; - if (collisionMeshData) - delete collisionMeshData; - return NULL; - -} - void KX_ConvertBulletObject( class KX_GameObject* gameobj, class RAS_MeshObject* meshobj, @@ -878,6 +696,7 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, bool isbulletdyna = false; CcdConstructionInfo ci; class PHY_IMotionState* motionstate = new KX_MotionState(gameobj->GetSGNode()); + class CcdShapeConstructionInfo *shapeInfo = new CcdShapeConstructionInfo(); @@ -894,120 +713,80 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, ci.m_gravity = btVector3(0,0,0); ci.m_localInertiaTensor =btVector3(0,0,0); ci.m_mass = objprop->m_dyna ? shapeprops->m_mass : 0.f; + shapeInfo->m_radius = objprop->m_radius; isbulletdyna = objprop->m_dyna; ci.m_localInertiaTensor = btVector3(ci.m_mass/3.f,ci.m_mass/3.f,ci.m_mass/3.f); - btTransform trans; - trans.setIdentity(); - btCollisionShape* bm = 0; switch (objprop->m_boundclass) { case KX_BOUNDSPHERE: { - float radius = objprop->m_radius; - btVector3 inertiaHalfExtents ( - radius, - radius, - radius); + //float radius = objprop->m_radius; + //btVector3 inertiaHalfExtents ( + // radius, + // radius, + // radius); //blender doesn't support multisphere, but for testing: //bm = new MultiSphereShape(inertiaHalfExtents,,&trans.getOrigin(),&radius,1); - bm = new btSphereShape(objprop->m_radius); - bm->calculateLocalInertia(ci.m_mass,ci.m_localInertiaTensor); + shapeInfo->m_shapeType = PHY_SHAPE_SPHERE; + bm = shapeInfo->CreateBulletShape(); break; }; case KX_BOUNDBOX: { - MT_Vector3 halfExtents ( + shapeInfo->m_halfExtend.setValue( objprop->m_boundobject.box.m_extends[0], - objprop->m_boundobject.box.m_extends[1], - objprop->m_boundobject.box.m_extends[2]); + objprop->m_boundobject.box.m_extends[1], + objprop->m_boundobject.box.m_extends[2]); - halfExtents /= 2.f; - - //btVector3 he (halfExtents[0]-CONVEX_DISTANCE_MARGIN ,halfExtents[1]-CONVEX_DISTANCE_MARGIN ,halfExtents[2]-CONVEX_DISTANCE_MARGIN ); - //he = he.absolute(); - - btVector3 he (halfExtents[0],halfExtents[1],halfExtents[2]); - he = he.absolute(); - - - bm = new btBoxShape(he); - bm->calculateLocalInertia(ci.m_mass,ci.m_localInertiaTensor); + shapeInfo->m_halfExtend /= 2.0; + shapeInfo->m_halfExtend = shapeInfo->m_halfExtend.absolute(); + shapeInfo->m_shapeType = PHY_SHAPE_BOX; + bm = shapeInfo->CreateBulletShape(); break; }; case KX_BOUNDCYLINDER: { - btVector3 halfExtents ( + shapeInfo->m_halfExtend.setValue( objprop->m_boundobject.c.m_radius, objprop->m_boundobject.c.m_radius, objprop->m_boundobject.c.m_height * 0.5f ); - bm = new btCylinderShapeZ(halfExtents); - bm->calculateLocalInertia(ci.m_mass,ci.m_localInertiaTensor); - + shapeInfo->m_shapeType = PHY_SHAPE_CYLINDER; + bm = shapeInfo->CreateBulletShape(); break; } - case KX_BOUNDCONE: + case KX_BOUNDCONE: { - btVector3 halfExtents (objprop->m_boundobject.box.m_extends[0], - objprop->m_boundobject.box.m_extends[1], - objprop->m_boundobject.box.m_extends[2]); - - - halfExtents /= 2.f; - - bm = new btConeShapeZ(objprop->m_boundobject.c.m_radius,objprop->m_boundobject.c.m_height); - bm->calculateLocalInertia(ci.m_mass,ci.m_localInertiaTensor); - + shapeInfo->m_radius = objprop->m_boundobject.c.m_radius; + shapeInfo->m_height = objprop->m_boundobject.c.m_height; + shapeInfo->m_shapeType = PHY_SHAPE_CONE; + bm = shapeInfo->CreateBulletShape(); break; } - case KX_BOUNDPOLYTOPE: - { - bm = CreateBulletShapeFromMesh(meshobj,true); - if (bm) - { - bm->calculateLocalInertia(ci.m_mass,ci.m_localInertiaTensor); - } - break; - } - case KX_BOUNDMESH: - { - if (!ci.m_mass) - { - bm = CreateBulletShapeFromMesh(meshobj,false); - ci.m_localInertiaTensor.setValue(0.f,0.f,0.f); - //no moving concave meshes, so don't bother calculating inertia - //bm->calculateLocalInertia(ci.m_mass,ci.m_localInertiaTensor); - } - - break; - } - - default: - //interpret the shape as a concave triangle-mesh + case KX_BOUNDPOLYTOPE: { - if (meshobj) - { - bm = CreateBulletShapeFromMesh(meshobj,false); - ci.m_localInertiaTensor.setValue(0.f,0.f,0.f); - - // assert(0); - - /* - meshobj->ScheduleCollisionPolygons(); - - KX_DeformableMesh* gfxmesh = new KX_DeformableMesh(meshobj); - gfxmesh->sendFixedMapping(); - //trianglemesh - bm = new TriangleMeshInterface(gfxmesh,trans); - */ + shapeInfo->SetMesh(meshobj, true); + bm = shapeInfo->CreateBulletShape(); + break; + } + case KX_BOUNDMESH: + { + if (!ci.m_mass) + { + shapeInfo->SetMesh(meshobj, false); + bm = shapeInfo->CreateBulletShape(); + //no moving concave meshes, so don't bother calculating inertia + //bm->calculateLocalInertia(ci.m_mass,ci.m_localInertiaTensor); } + + break; } } @@ -1017,44 +796,41 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, if (!bm) { delete motionstate; + delete shapeInfo; return; } bm->setMargin(0.06); - if (objprop->m_isCompoundChild) { //find parent, compound shape and add to it //take relative transform into account! KX_BulletPhysicsController* parentCtrl = (KX_BulletPhysicsController*)objprop->m_dynamic_parent->GetPhysicsController(); assert(parentCtrl); + CcdShapeConstructionInfo* parentShapeInfo = parentCtrl->GetShapeInfo(); btRigidBody* rigidbody = parentCtrl->GetRigidBody(); btCollisionShape* colShape = rigidbody->getCollisionShape(); assert(colShape->isCompound()); btCompoundShape* compoundShape = (btCompoundShape*)colShape; - btTransform childTrans; - childTrans.setIdentity(); - NodeList& children = objprop->m_dynamic_parent->GetSGNode()->GetSGChildren(); MT_Point3 childPos = gameobj->GetSGNode()->GetLocalPosition(); MT_Matrix3x3 childRot = gameobj->GetSGNode()->GetLocalOrientation(); MT_Vector3 childScale = gameobj->GetSGNode()->GetLocalScale(); bm->setLocalScaling(btVector3(childScale.x(),childScale.y(),childScale.z())); - childTrans.setOrigin(btVector3(childPos.x(),childPos.y(),childPos.z())); + shapeInfo->m_childTrans.setOrigin(btVector3(childPos.x(),childPos.y(),childPos.z())); float rotval[12]; childRot.getValue(rotval); btMatrix3x3 newRot; newRot.setValue(rotval[0],rotval[1],rotval[2],rotval[4],rotval[5],rotval[6],rotval[8],rotval[9],rotval[10]); newRot = newRot.transpose(); - childTrans.setBasis(newRot); - - - compoundShape->addChildShape(childTrans,bm); - kxscene->AddShape(bm); + shapeInfo->m_childTrans.setBasis(newRot); + parentShapeInfo->AddShape(shapeInfo); + + compoundShape->addChildShape(shapeInfo->m_childTrans,bm); //do some recalc? //recalc inertia for rigidbody if (!rigidbody->isStaticOrKinematicObject()) @@ -1069,15 +845,16 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, if (objprop->m_hasCompoundChildren) { - //replace shape by compoundShape + // create a compound shape info + CcdShapeConstructionInfo *compoundShapeInfo = new CcdShapeConstructionInfo(); + compoundShapeInfo->m_shapeType = PHY_SHAPE_COMPOUND; + compoundShapeInfo->AddShape(shapeInfo); + // create the compound shape manually as we already have the child shape btCompoundShape* compoundShape = new btCompoundShape(); - btTransform identTrans; - identTrans.setIdentity(); - compoundShape->addChildShape(identTrans,bm); - //note abount compoundShape: Bullet does not delete the child shapes when - //the compound shape is deleted, so insert also the child shapes - kxscene->AddShape(bm); + compoundShape->addChildShape(shapeInfo->m_childTrans,bm); + // now replace the shape bm = compoundShape; + shapeInfo = compoundShapeInfo; } @@ -1113,6 +890,7 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, ci.m_collisionShape = bm; + ci.m_shapeInfo = shapeInfo; ci.m_friction = smmaterial->m_friction;//tweak the friction a bit, so the default 0.5 works nice ci.m_restitution = smmaterial->m_restitution; ci.m_physicsEnv = env; @@ -1124,9 +902,12 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, ci.m_collisionFilterGroup = (isbulletdyna) ? short(CcdConstructionInfo::DefaultFilter) : short(CcdConstructionInfo::StaticFilter); ci.m_collisionFilterMask = (isbulletdyna) ? short(CcdConstructionInfo::AllFilter) : short(CcdConstructionInfo::AllFilter ^ CcdConstructionInfo::StaticFilter); ci.m_bRigid = objprop->m_dyna && objprop->m_angular_rigidbody; + MT_Vector3 scaling = gameobj->NodeGetWorldScaling(); + ci.m_scaling.setValue(scaling[0], scaling[1], scaling[2]); KX_BulletPhysicsController* physicscontroller = new KX_BulletPhysicsController(ci,isbulletdyna); - //remember that we created a shape so that we can delete it when the scene is removed (bullet will not delete it) - kxscene->AddShape(bm); + // shapeInfo is reference counted, decrement now as we don't use it anymore + if (shapeInfo) + shapeInfo->Release(); if (objprop->m_in_active_layer) { diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 868439546c3..472ae759d65 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -733,6 +733,10 @@ PyObject* initGameLogic(KX_Scene* scene) // quick hack to get gravity hook // Add some symbolic constants to the module d = PyModule_GetDict(m); + + // can be overwritten later for gameEngine instances that can load new blend files and re-initialize this module + // for now its safe to make sure it exists for other areas such as the web plugin + PyDict_SetItemString(d, "globalDict", PyDict_New()); ErrorObject = PyString_FromString("GameLogic.error"); PyDict_SetItemString(d, "error", ErrorObject); diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 2828663c63d..ab3692d2411 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -234,40 +234,9 @@ KX_Scene::~KX_Scene() { delete m_bucketmanager; } -#ifdef USE_BULLET - // This is a fix for memory leaks in bullet: the collision shapes is not destroyed - // when the physical controllers are destroyed. The reason is that shapes are shared - // between replicas of an object. There is no reference count in Bullet so the - // only workaround that does not involve changes in Bullet is to save in this array - // the list of shapes that are created when the scene is created (see KX_ConvertPhysicsObjects.cpp) - class btCollisionShape* shape; - class btTriangleMeshShape* meshShape; - vector::iterator it = m_shapes.begin(); - while (it != m_shapes.end()) { - shape = *it; - if (shape->getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE) - { - meshShape = static_cast(shape); - // shapes based on meshes use an interface that contains the vertices. - // Again the idea is to be able to share the interface between shapes but - // this is not used in Blender: each base object will have its own interface - btStridingMeshInterface* meshInterface = meshShape->getMeshInterface(); - if (meshInterface) - delete meshInterface; - } - delete shape; - it++; - } -#endif //Py_DECREF(m_attrlist); } -void KX_Scene::AddShape(class btCollisionShape*shape) -{ - m_shapes.push_back(shape); -} - - void KX_Scene::SetProjectionMatrix(MT_CmMatrix4x4& pmat) { m_projectionmat = pmat; diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index 80a2abe287a..1c56dd1ee55 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -121,11 +121,6 @@ protected: * The set of cameras for this scene */ list m_cameras; - /** - * The set of bullet shapes that must be deleted at the end of the scene - * to avoid memory leak (not deleted by bullet because shape are shared between replicas) - */ - vector m_shapes; /** * Various SCA managers used by the scene */ @@ -322,7 +317,6 @@ public: int NewRemoveObject(CValue* gameobj); void ReplaceMesh(CValue* gameobj, void* meshobj); - void AddShape(class btCollisionShape* shape); /** * @section Logic stuff * Initiate an update of the logic system. diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index b872fae6138..d6a32dfd9c0 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -18,6 +18,7 @@ subject to the following restrictions: #include "PHY_IMotionState.h" #include "CcdPhysicsEnvironment.h" +#include "RAS_MeshObject.h" class BP_Proxy; @@ -44,7 +45,18 @@ CcdPhysicsController::CcdPhysicsController (const CcdConstructionInfo& ci) m_newClientInfo = 0; m_registerCount = 0; + // copy pointers locally to allow smart release m_MotionState = ci.m_MotionState; + m_collisionShape = ci.m_collisionShape; + // apply scaling before creating rigid body + m_collisionShape->setLocalScaling(m_cci.m_scaling); + if (m_cci.m_mass) + m_collisionShape->calculateLocalInertia(m_cci.m_mass, m_cci.m_localInertiaTensor); + // shape info is shared, increment ref count + m_shapeInfo = ci.m_shapeInfo; + if (m_shapeInfo) + m_shapeInfo->AddRef(); + m_bulletMotionState = 0; @@ -116,7 +128,7 @@ void CcdPhysicsController::CreateRigidbody() m_body = new btRigidBody(m_cci.m_mass, m_bulletMotionState, - m_cci.m_collisionShape, + m_collisionShape, m_cci.m_localInertiaTensor * m_cci.m_inertiaFactor, m_cci.m_linearDamping,m_cci.m_angularDamping, m_cci.m_friction,m_cci.m_restitution); @@ -144,6 +156,19 @@ void CcdPhysicsController::CreateRigidbody() } } +static void DeleteBulletShape(btCollisionShape* shape) +{ + if (shape->getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE) + { + // shapes based on meshes use an interface that contains the vertices. + btTriangleMeshShape* meshShape = static_cast(shape); + btStridingMeshInterface* meshInterface = meshShape->getMeshInterface(); + if (meshInterface) + delete meshInterface; + } + delete shape; +} + CcdPhysicsController::~CcdPhysicsController() { //will be reference counted, due to sharing @@ -155,6 +180,27 @@ CcdPhysicsController::~CcdPhysicsController() if (m_bulletMotionState) delete m_bulletMotionState; delete m_body; + + if (m_collisionShape) + { + // collision shape is always unique to the controller, can delete it here + if (m_collisionShape->isCompound()) + { + // bullet does not delete the child shape, must do it here + btCompoundShape* compoundShape = (btCompoundShape*)m_collisionShape; + int numChild = compoundShape->getNumChildShapes(); + for (int i=numChild-1 ; i >= 0; i--) + { + btCollisionShape* childShape = compoundShape->getChildShape(i); + DeleteBulletShape(childShape); + } + } + DeleteBulletShape(m_collisionShape); + } + if (m_shapeInfo) + { + m_shapeInfo->Release(); + } } @@ -219,11 +265,33 @@ void CcdPhysicsController::PostProcessReplica(class PHY_IMotionState* motionsta { m_MotionState = motionstate; m_registerCount = 0; - + m_collisionShape = NULL; + + // always create a new shape to avoid scaling bug + if (m_shapeInfo) + { + m_shapeInfo->AddRef(); + m_collisionShape = m_shapeInfo->CreateBulletShape(); + + if (m_collisionShape) + { + // new shape has no scaling, apply initial scaling + m_collisionShape->setLocalScaling(m_cci.m_scaling); + if (m_cci.m_mass) + m_collisionShape->calculateLocalInertia(m_cci.m_mass, m_cci.m_localInertiaTensor); + } + } m_body = 0; CreateRigidbody(); - + + if (m_body) + { + if (m_cci.m_mass) + { + m_body->setMassProps(m_cci.m_mass, m_cci.m_localInertiaTensor * m_cci.m_inertiaFactor); + } + } m_cci.m_physicsEnv->addCcdPhysicsController(this); @@ -597,29 +665,32 @@ bool CcdPhysicsController::wantsSleeping() PHY_IPhysicsController* CcdPhysicsController::GetReplica() { - //very experimental, shape sharing is not implemented yet. - //just support btSphereShape/ConeShape for now - + // This is used only to replicate Near and Radar sensor controllers + // The replication of object physics controller is done in KX_BulletPhysicsController::GetReplica() CcdConstructionInfo cinfo = m_cci; - if (cinfo.m_collisionShape) + if (m_shapeInfo) { - switch (cinfo.m_collisionShape->getShapeType()) + // This situation does not normally happen + cinfo.m_collisionShape = m_shapeInfo->CreateBulletShape(); + } + else if (m_collisionShape) + { + switch (m_collisionShape->getShapeType()) { case SPHERE_SHAPE_PROXYTYPE: { - btSphereShape* orgShape = (btSphereShape*)cinfo.m_collisionShape; + btSphereShape* orgShape = (btSphereShape*)m_collisionShape; cinfo.m_collisionShape = new btSphereShape(*orgShape); break; } - case CONE_SHAPE_PROXYTYPE: + case CONE_SHAPE_PROXYTYPE: { - btConeShape* orgShape = (btConeShape*)cinfo.m_collisionShape; + btConeShape* orgShape = (btConeShape*)m_collisionShape; cinfo.m_collisionShape = new btConeShape(*orgShape); break; } - default: { return 0; @@ -628,6 +699,7 @@ PHY_IPhysicsController* CcdPhysicsController::GetReplica() } cinfo.m_MotionState = new DefaultMotionState(); + cinfo.m_shapeInfo = m_shapeInfo; CcdPhysicsController* replica = new CcdPhysicsController(cinfo); return replica; @@ -689,3 +761,201 @@ void DefaultMotionState::calculateWorldTransformations() } +// Shape constructor +bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, bool polytope) +{ + // assume no shape information + m_shapeType = PHY_SHAPE_NONE; + m_vertexArray.clear(); + + if (!meshobj) + return false; + + // Mesh has no polygons! + int numpolys = meshobj->NumPolygons(); + if (!numpolys) + { + return false; + } + + // check that we have at least one colliding polygon + int numvalidpolys = 0; + + for (int p=0; pGetPolygon(p); + + // only add polygons that have the collisionflag set + if (poly->IsCollider()) + { + numvalidpolys++; + break; + } + } + + // No collision polygons + if (numvalidpolys < 1) + return false; + + m_shapeType = (polytope) ? PHY_SHAPE_POLYTOPE : PHY_SHAPE_MESH; + + numvalidpolys = 0; + + for (int p2=0; p2GetPolygon(p2); + + // only add polygons that have the collisionflag set + if (poly->IsCollider()) + { + //Bullet can raycast any shape, so + if (polytope) + { + for (int i=0;iVertexCount();i++) + { + const float* vtx = meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray, + poly->GetVertexIndexBase().m_indexarray[i], + poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ(); + btPoint3 point(vtx[0],vtx[1],vtx[2]); + m_vertexArray.push_back(point); + numvalidpolys++; + } + } else + { + { + const float* vtx = meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray, + poly->GetVertexIndexBase().m_indexarray[2], + poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ(); + btPoint3 vertex0(vtx[0],vtx[1],vtx[2]); + vtx = meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray, + poly->GetVertexIndexBase().m_indexarray[1], + poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ(); + btPoint3 vertex1(vtx[0],vtx[1],vtx[2]); + vtx = meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray, + poly->GetVertexIndexBase().m_indexarray[0], + poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ(); + btPoint3 vertex2(vtx[0],vtx[1],vtx[2]); + m_vertexArray.push_back(vertex0); + m_vertexArray.push_back(vertex1); + m_vertexArray.push_back(vertex2); + numvalidpolys++; + } + if (poly->VertexCount() == 4) + { + const float* vtx = meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray, + poly->GetVertexIndexBase().m_indexarray[3], + poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ(); + btPoint3 vertex0(vtx[0],vtx[1],vtx[2]); + vtx = meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray, + poly->GetVertexIndexBase().m_indexarray[2], + poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ(); + btPoint3 vertex1(vtx[0],vtx[1],vtx[2]); + vtx = meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray, + poly->GetVertexIndexBase().m_indexarray[0], + poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ(); + btPoint3 vertex2(vtx[0],vtx[1],vtx[2]); + m_vertexArray.push_back(vertex0); + m_vertexArray.push_back(vertex1); + m_vertexArray.push_back(vertex2); + numvalidpolys++; + } + } + } + } + + if (!numvalidpolys) + { + // should not happen + m_shapeType = PHY_SHAPE_NONE; + return false; + } + return true; +} + +btCollisionShape* CcdShapeConstructionInfo::CreateBulletShape() +{ + btCollisionShape* collisionShape = 0; + btTriangleMeshShape* concaveShape = 0; + btTriangleMesh* collisionMeshData = 0; + btCompoundShape* compoundShape = 0; + CcdShapeConstructionInfo* nextShapeInfo; + + switch (m_shapeType) + { + case PHY_SHAPE_NONE: + break; + + case PHY_SHAPE_BOX: + collisionShape = new btBoxShape(m_halfExtend); + break; + + case PHY_SHAPE_SPHERE: + collisionShape = new btSphereShape(m_radius); + break; + + case PHY_SHAPE_CYLINDER: + collisionShape = new btCylinderShapeZ(m_halfExtend); + break; + + case PHY_SHAPE_CONE: + collisionShape = new btConeShapeZ(m_radius, m_height); + break; + + case PHY_SHAPE_POLYTOPE: + collisionShape = new btConvexHullShape(&m_vertexArray.begin()->getX(), m_vertexArray.size()); + break; + + case PHY_SHAPE_MESH: + collisionMeshData = new btTriangleMesh(); + // m_vertexArray is necessarily a multiple of 3 + for (std::vector::iterator it=m_vertexArray.begin(); it != m_vertexArray.end(); ) + { + collisionMeshData->addTriangle(*it++,*it++,*it++); + } + concaveShape = new btBvhTriangleMeshShape( collisionMeshData, true ); + concaveShape->recalcLocalAabb(); + collisionShape = concaveShape; + break; + + case PHY_SHAPE_COMPOUND: + if (m_nextShape) + { + compoundShape = new btCompoundShape(); + for (nextShapeInfo=m_nextShape; nextShapeInfo; nextShapeInfo = nextShapeInfo->m_nextShape) + { + collisionShape = nextShapeInfo->CreateBulletShape(); + if (collisionShape) + { + compoundShape->addChildShape(nextShapeInfo->m_childTrans, collisionShape); + } + } + collisionShape = compoundShape; + } + } + return collisionShape; +} + +void CcdShapeConstructionInfo::AddShape(CcdShapeConstructionInfo* shapeInfo) +{ + CcdShapeConstructionInfo* nextShape = this; + while (nextShape->m_nextShape != NULL) + nextShape = nextShape->m_nextShape; + nextShape->m_nextShape = shapeInfo; +} + +CcdShapeConstructionInfo::~CcdShapeConstructionInfo() +{ + CcdShapeConstructionInfo* childShape = m_nextShape; + + while (childShape) + { + CcdShapeConstructionInfo* nextShape = childShape->m_nextShape; + childShape->m_nextShape = NULL; + childShape->Release(); + childShape = nextShape; + } + + m_vertexArray.clear(); +} + + diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h index 448e5622eff..1e1a38aa2a6 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h @@ -17,11 +17,14 @@ subject to the following restrictions: #ifndef BULLET2_PHYSICSCONTROLLER_H #define BULLET2_PHYSICSCONTROLLER_H +#include + #include "PHY_IPhysicsController.h" /// PHY_IPhysicsController is the abstract simplified Interface to a physical object. /// It contains the IMotionState and IDeformableMesh Interfaces. #include "btBulletDynamicsCommon.h" +#include "LinearMath/btTransform.h" #include "PHY_IMotionState.h" @@ -31,8 +34,66 @@ extern float gAngularSleepingTreshold; extern bool gDisableDeactivation; class CcdPhysicsEnvironment; class btMotionState; +class RAS_MeshObject; +class btCollisionShape; +// Shape contructor +// It contains all the information needed to create a simple bullet shape at runtime +class CcdShapeConstructionInfo +{ +public: + CcdShapeConstructionInfo() : + m_shapeType(PHY_SHAPE_NONE), + m_radius(1.0), + m_height(1.0), + m_halfExtend(0.f,0.f,0.f), + m_nextShape(NULL), + m_refCount(1) + { + m_childTrans.setIdentity(); + } + ~CcdShapeConstructionInfo(); + + CcdShapeConstructionInfo* AddRef() + { + m_refCount++; + return this; + } + + int Release() + { + if (--m_refCount > 0) + return m_refCount; + delete this; + return 0; + } + + void AddShape(CcdShapeConstructionInfo* shapeInfo); + + CcdShapeConstructionInfo* GetNextShape() + { + return m_nextShape; + } + + bool SetMesh(RAS_MeshObject* mesh, bool polytope); + + btCollisionShape* CreateBulletShape(); + + // member variables + PHY_ShapeType m_shapeType; + btScalar m_radius; + btScalar m_height; + btVector3 m_halfExtend; + btTransform m_childTrans; + std::vector m_vertexArray; // Contains both vertex array for polytope shape and + // triangle array for concave mesh shape. + // In this case a triangle is made of 3 consecutive points +protected: + CcdShapeConstructionInfo* m_nextShape; // for compound shape + int m_refCount; // this class is shared between replicas + // keep track of users so that we can release it +}; struct CcdConstructionInfo { @@ -65,6 +126,7 @@ struct CcdConstructionInfo m_collisionFilterMask(AllFilter), m_collisionShape(0), m_MotionState(0), + m_shapeInfo(0), m_physicsEnv(0), m_inertiaFactor(1.f) { @@ -89,8 +151,11 @@ struct CcdConstructionInfo short int m_collisionFilterGroup; short int m_collisionFilterMask; + ///these pointers are used as argument passing for the CcdPhysicsController constructor + ///and not anymore after that class btCollisionShape* m_collisionShape; class PHY_IMotionState* m_MotionState; + class CcdShapeConstructionInfo* m_shapeInfo; CcdPhysicsEnvironment* m_physicsEnv; //needed for self-replication float m_inertiaFactor;//tweak the inertia (hooked up to Blender 'formfactor' @@ -106,6 +171,9 @@ class CcdPhysicsController : public PHY_IPhysicsController btRigidBody* m_body; class PHY_IMotionState* m_MotionState; btMotionState* m_bulletMotionState; + class btCollisionShape* m_collisionShape; + class CcdShapeConstructionInfo* m_shapeInfo; + friend class CcdPhysicsEnvironment; // needed when updating the controller @@ -137,6 +205,7 @@ class CcdPhysicsController : public PHY_IPhysicsController btRigidBody* GetRigidBody() { return m_body;} + CcdShapeConstructionInfo* GetShapeInfo() { return m_shapeInfo; } btCollisionShape* GetCollisionShape() { return m_body->getCollisionShape(); diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index dfbcf115fd7..d8e05fab839 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -1370,8 +1370,9 @@ int CcdPhysicsEnvironment::createConstraint(class PHY_IPhysicsController* ctrl PHY_IPhysicsController* CcdPhysicsEnvironment::CreateConeController(float coneradius,float coneheight) { CcdConstructionInfo cinfo; - //This is a memory leak: Bullet does not delete the shape and it cannot be added to - //the KX_Scene.m_shapes list -- too bad but that's not a lot of data + + // we don't need a CcdShapeConstructionInfo for this shape: + // it is simple enough for the standard copy constructor (see CcdPhysicsController::GetReplica) cinfo.m_collisionShape = new btConeShape(coneradius,coneheight); cinfo.m_MotionState = 0; cinfo.m_physicsEnv = this; diff --git a/source/gameengine/Physics/Bullet/SConscript b/source/gameengine/Physics/Bullet/SConscript index dd6eab0f018..0936d45197a 100644 --- a/source/gameengine/Physics/Bullet/SConscript +++ b/source/gameengine/Physics/Bullet/SConscript @@ -3,7 +3,7 @@ Import ('env') sources = 'CcdPhysicsEnvironment.cpp CcdPhysicsController.cpp' -incs = '. ../common' +incs = '. ../common #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/Rasterizer' incs += ' ' + env['BF_BULLET_INC'] diff --git a/source/gameengine/Physics/common/PHY_DynamicTypes.h b/source/gameengine/Physics/common/PHY_DynamicTypes.h index c289b9d8bcb..3b3e42c38d2 100644 --- a/source/gameengine/Physics/common/PHY_DynamicTypes.h +++ b/source/gameengine/Physics/common/PHY_DynamicTypes.h @@ -87,6 +87,18 @@ typedef enum PHY_ConstraintType { } PHY_ConstraintType; +typedef enum PHY_ShapeType { + PHY_SHAPE_NONE, + PHY_SHAPE_BOX, + PHY_SHAPE_SPHERE, + PHY_SHAPE_CYLINDER, + PHY_SHAPE_CONE, + PHY_SHAPE_MESH, + PHY_SHAPE_POLYTOPE, + PHY_SHAPE_COMPOUND +} PHY_ShapeType; + + typedef float PHY_Vector3[3]; #endif //__PHY_DYNAMIC_TYPES