Compare commits
1159 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43aa145c94 | ||
|
|
1608ed43c1 | ||
|
|
fa103a69f9 | ||
|
|
f8520f9dd3 | ||
|
|
3a372afc0e | ||
|
|
95d6bec68f | ||
|
|
56f2e20cb4 | ||
|
|
4cbcaba7f2 | ||
|
|
aeeca6e2c0 | ||
|
|
74704d0d2a | ||
|
|
0b384bdd72 | ||
|
|
e9cf3a6806 | ||
|
|
c5f9068664 | ||
|
|
992bbbba1c | ||
|
|
fe9dd63558 | ||
|
|
8e45003c27 | ||
|
|
f53d824e07 | ||
|
|
259670af85 | ||
|
|
c7e9430f99 | ||
|
|
afe573d2eb | ||
|
|
547d9817db | ||
|
|
9c63243fe7 | ||
|
|
5535ba6b47 | ||
|
|
52a80f98ed | ||
|
|
9600319094 | ||
|
|
9b930c8716 | ||
|
|
eb0d2e5b2c | ||
|
|
5e2722475a | ||
|
|
b1e406731d | ||
|
|
8c6d51cb71 | ||
|
|
4b205084f8 | ||
|
|
eb910b0bae | ||
|
|
09a6a1f259 | ||
|
|
315618a18b | ||
|
|
59af03695b | ||
|
|
e1851f7b5b | ||
|
|
a126b4003f | ||
|
|
9067de26ac | ||
|
|
260c5345fd | ||
|
|
e3dd05ef21 | ||
|
|
9379bcedf9 | ||
|
|
2c91210d6e | ||
|
|
f721d935e4 | ||
|
|
66597cade3 | ||
|
|
3c5f39e26a | ||
|
|
24e3176f1b | ||
|
|
e59757e3e8 | ||
|
|
282de8c7f5 | ||
|
|
541021f29c | ||
|
|
e01b9dcd39 | ||
|
|
8d4567b930 | ||
|
|
6f6988a487 | ||
|
|
435ab2ce77 | ||
|
|
1afd723c4e | ||
|
|
b09f7f5ac7 | ||
|
|
1b3f0f9ec0 | ||
|
|
d1d68721ac | ||
|
|
2f4afe5b68 | ||
|
|
47fcc70756 | ||
|
|
0e86b696c5 | ||
|
|
54f05b409c | ||
|
|
350dff9b98 | ||
|
|
f198221812 | ||
|
|
dee08b4216 | ||
|
|
e02d074a85 | ||
|
|
8e2da87b97 | ||
|
|
2deba06212 | ||
|
|
a6ac8e1f71 | ||
|
|
69436a9032 | ||
|
|
50d91d13be | ||
|
|
54a6db146e | ||
|
|
3b31fe91a6 | ||
|
|
90c5219be9 | ||
|
|
669fe29173 | ||
|
|
d7d06c8234 | ||
|
|
4754c1322d | ||
|
|
acb093c277 | ||
|
|
21d54edeb9 | ||
|
|
20ea0968da | ||
|
|
398d8c52a2 | ||
|
|
f82d12d381 | ||
|
|
91ee5724ca | ||
|
|
a82443f271 | ||
|
|
1cd0b70055 | ||
|
|
8f8904ad0f | ||
|
|
e975e389df | ||
|
|
d3242393e0 | ||
|
|
ce7d0e81bd | ||
|
|
0cf16e6f8f | ||
|
|
0ab395794e | ||
|
|
ac06a8394b | ||
|
|
46dd1ad154 | ||
|
|
e57a7b6f3b | ||
|
|
409128b07f | ||
|
|
fd562061ee | ||
|
|
c6a7dc8f9c | ||
|
|
5275f7e852 | ||
|
|
6ec19e4630 | ||
|
|
690ac8d4b1 | ||
|
|
7ae1cd33be | ||
|
|
a7c6c184da | ||
|
|
29d6b423a3 | ||
|
|
b3590c5ae6 | ||
|
|
67f549d86d | ||
|
|
9096265bff | ||
|
|
ce265b3948 | ||
|
|
7fee70543d | ||
|
|
f3a48bb0f0 | ||
|
|
c151c12b95 | ||
|
|
b8d999066d | ||
|
|
0e816492b4 | ||
|
|
c6ef099e18 | ||
|
|
1c5872da0c | ||
|
|
d95e94fa07 | ||
|
|
d7bbbd9d40 | ||
|
|
cf56659b18 | ||
|
|
4163b8e40b | ||
|
|
4ca6a5c52c | ||
|
|
511811de3b | ||
|
|
6ef4dfb61f | ||
|
|
5ca2a3b0f7 | ||
|
|
88794d0288 | ||
|
|
30e76a7c11 | ||
|
|
41eb687243 | ||
|
|
5191baa659 | ||
|
|
8159eff664 | ||
|
|
c6eb3d790e | ||
|
|
f62fc8ab15 | ||
|
|
75e85701c6 | ||
|
|
cd85afc9a5 | ||
|
|
b9ba472eda | ||
|
|
bf9d3acf33 | ||
|
|
bd7e291787 | ||
|
|
73b34b6d89 | ||
|
|
f2c7290ee8 | ||
|
|
6f6938f5bb | ||
|
|
601ff92871 | ||
|
|
f119986fad | ||
|
|
402cd21f87 | ||
|
|
8cb694af89 | ||
|
|
73d8cedf7e | ||
|
|
b7e8d36cf8 | ||
|
|
45f5eb9671 | ||
|
|
16fe6d0dcf | ||
|
|
b633c3ffea | ||
|
|
ca1696823c | ||
|
|
c1cc9d484a | ||
|
|
db75cb3e17 | ||
|
|
b8a17c8f22 | ||
|
|
74dff061ff | ||
|
|
3dd846b600 | ||
|
|
8a2e24ecd0 | ||
|
|
6ccca51fee | ||
|
|
a4b3c3d1ad | ||
|
|
bc8947289b | ||
|
|
e7c506c6ec | ||
|
|
8236964029 | ||
|
|
aadecaf102 | ||
|
|
b55e45eef6 | ||
|
|
adbc928148 | ||
|
|
c4c206076a | ||
|
|
5c077d7037 | ||
|
|
8583a2f4f7 | ||
|
|
ed8416ea10 | ||
|
|
deb7454cf7 | ||
|
|
8c40af5aee | ||
|
|
dd893bab41 | ||
|
|
759ee62e7c | ||
|
|
1e9b79e2c1 | ||
|
|
315883a28c | ||
|
|
19b85afe12 | ||
|
|
b2e8a31d68 | ||
|
|
b4b12732cb | ||
|
|
c714c57bb2 | ||
|
|
4697216c5e | ||
|
|
e2fa94e2c3 | ||
|
|
7578a27bf7 | ||
|
|
14e0b3c9e6 | ||
|
|
815acfc7da | ||
|
|
7d8af7d413 | ||
|
|
39810ed516 | ||
|
|
9cbcf8fe34 | ||
|
|
02b476035b | ||
|
|
9eb338f417 | ||
|
|
15e30604fc | ||
|
|
21f677cf58 | ||
|
|
3ead892b1c | ||
|
|
a59e87a896 | ||
|
|
96df7b82de | ||
|
|
5cb5d284c3 | ||
|
|
869517b9c6 | ||
|
|
56cefce1cc | ||
|
|
165af85894 | ||
|
|
7c073c1db7 | ||
|
|
061178ad82 | ||
|
|
dbc7c6e74d | ||
|
|
d87a48ea06 | ||
|
|
b36bb8b5bb | ||
|
|
2ed16c9736 | ||
|
|
c031649979 | ||
|
|
e0746fca12 | ||
|
|
2075042ba7 | ||
|
|
499cd48763 | ||
|
|
5d826b2b62 | ||
|
|
b20943d497 | ||
|
|
b4ab9a4e57 | ||
|
|
cd36a1fe16 | ||
|
|
1cda80cbe7 | ||
|
|
ffd0e6b79d | ||
|
|
a7728b87fc | ||
|
|
c218789abc | ||
|
|
3656cb9fdb | ||
|
|
e93fdf4615 | ||
|
|
6722e25cbe | ||
|
|
790db4283c | ||
|
|
a0359473ff | ||
|
|
ccfdcce5c1 | ||
|
|
811849fa23 | ||
|
|
1051fd9d42 | ||
|
|
5490a992ca | ||
|
|
2d29fb8d15 | ||
|
|
589035c1db | ||
|
|
8f6a578ec0 | ||
|
|
a2fcf4edac | ||
|
|
f56ac5210c | ||
|
|
576069a84d | ||
|
|
7ea7d4cf6c | ||
|
|
21e1359b37 | ||
|
|
eebee9b7c1 | ||
|
|
bfc986a97d | ||
|
|
d65a52242e | ||
|
|
c82c791061 | ||
|
|
bcd18a01d8 | ||
|
|
53a4931974 | ||
|
|
1f7751618e | ||
|
|
497babe8e9 | ||
|
|
973a90a34d | ||
|
|
3cff5cd1a8 | ||
|
|
8766335708 | ||
|
|
908fc939b1 | ||
|
|
73c4557a45 | ||
|
|
accfcbbf5c | ||
|
|
5a36450e01 | ||
|
|
839f4eab7e | ||
|
|
fec0559d11 | ||
|
|
e46fc0a805 | ||
|
|
fb7751360c | ||
|
|
0c2e7d7028 | ||
|
|
fe2e68b410 | ||
|
|
166c4df0b3 | ||
|
|
68684855c6 | ||
|
|
fa0de18ffe | ||
|
|
24ca32f9f7 | ||
|
|
f63de0d0cc | ||
|
|
f6db6058e1 | ||
|
|
d23632ef46 | ||
|
|
1048f213c7 | ||
|
|
98d88bff94 | ||
|
|
861fccd2d6 | ||
|
|
715c3b8510 | ||
|
|
3c6c7c4138 | ||
|
|
95106ca1c2 | ||
|
|
ac106b0aff | ||
|
|
001e45627b | ||
|
|
b8c3457644 | ||
|
|
5f6dcfa82a | ||
|
|
f2dd944acd | ||
|
|
d0f69ebb75 | ||
|
|
04737fb0e8 | ||
|
|
d78550e83e | ||
|
|
c640585bc3 | ||
|
|
a926cdc5be | ||
|
|
43e66b57a0 | ||
|
|
ee60a9801b | ||
|
|
fb69220b95 | ||
|
|
1cf7f67af5 | ||
|
|
8497ba1898 | ||
|
|
234259da91 | ||
|
|
ef7f309012 | ||
|
|
d372fa1a0f | ||
|
|
ea9005868b | ||
|
|
0a3a4a51bd | ||
|
|
1dbd913d9d | ||
|
|
22cded7ccc | ||
|
|
4851f1ad48 | ||
|
|
0d94dd7bf8 | ||
|
|
bbe7f6adfb | ||
|
|
828941a204 | ||
|
|
2ce3f2c131 | ||
|
|
8943552c1c | ||
|
|
dadbb00b85 | ||
|
|
852a8407c8 | ||
|
|
bfbbcad8e5 | ||
|
|
c684987908 | ||
|
|
53b8f70de8 | ||
|
|
a1eb30ae87 | ||
|
|
c4cb9de44b | ||
|
|
0a89503edd | ||
|
|
f12bd741e2 | ||
|
|
e35039faf7 | ||
|
|
a756943628 | ||
|
|
a9c3e13e5e | ||
|
|
67c8ac2b04 | ||
|
|
82044399e4 | ||
|
|
fdcf2eda5a | ||
|
|
e0997f1f04 | ||
|
|
58859ee709 | ||
|
|
c3771e2fd5 | ||
|
|
2e49365b0f | ||
|
|
cd87aadab3 | ||
|
|
e58f8856f4 | ||
|
|
18a48e6609 | ||
|
|
929b75989c | ||
|
|
7d98030edc | ||
|
|
846d573dd0 | ||
|
|
5805fe636a | ||
|
|
3db9c6a9ff | ||
|
|
22bcf83cb9 | ||
|
|
117eca3c98 | ||
|
|
81affe719f | ||
|
|
3febec4aa4 | ||
|
|
a78c6072ce | ||
|
|
aa6a57be63 | ||
|
|
fd29dd9508 | ||
|
|
5080ebf88f | ||
|
|
873df7805b | ||
|
|
009fb10927 | ||
|
|
3898d29741 | ||
|
|
1c521a3743 | ||
|
|
098d1b30ff | ||
|
|
484108dafc | ||
|
|
029d260ad8 | ||
|
|
e6bc8f8583 | ||
|
|
77a13963bb | ||
|
|
656eacbb09 | ||
|
|
98f9a09b39 | ||
|
|
7e8e8bdb26 | ||
|
|
e2a0f801b9 | ||
|
|
75b31b4151 | ||
|
|
f0763fd31c | ||
|
|
162e7b7699 | ||
|
|
7158a3c83d | ||
|
|
1fa30dd337 | ||
|
|
250049537f | ||
|
|
76e5311320 | ||
|
|
11098cd6d4 | ||
|
|
78a0b347fc | ||
|
|
08a23de051 | ||
|
|
a02ad53c73 | ||
|
|
9400701c96 | ||
|
|
aa983108e8 | ||
|
|
7dca333166 | ||
|
|
0f1ecf66ab | ||
|
|
74984b5a3c | ||
|
|
c5d5984885 | ||
|
|
c1ccfcb988 | ||
|
|
51dc0550d5 | ||
|
|
ac9e36549b | ||
|
|
009e9a598a | ||
|
|
1502ef2661 | ||
|
|
40f9e12bdf | ||
|
|
2fc783e67e | ||
|
|
4f8e6a188a | ||
|
|
b0e44ad1bd | ||
|
|
4a630b1780 | ||
|
|
ffa5e6099d | ||
|
|
8d1cd7008f | ||
|
|
31b5c5e9dd | ||
|
|
0e21a16c1c | ||
|
|
f666384a1d | ||
|
|
afacfcee94 | ||
|
|
7262bf96b8 | ||
|
|
3db489f4df | ||
|
|
6526c28e47 | ||
|
|
e473b9bf10 | ||
|
|
0bde458c27 | ||
|
|
66739ac820 | ||
|
|
4a3763d8d1 | ||
|
|
4230127459 | ||
|
|
a4c672252d | ||
|
|
d5d0473487 | ||
|
|
9bbad1f8f0 | ||
|
|
0523965822 | ||
|
|
cb8cd702e1 | ||
|
|
86b5737d51 | ||
|
|
4027ec7a67 | ||
|
|
c2748a2246 | ||
|
|
5c06afc977 | ||
|
|
4c82a5660f | ||
|
|
beacb5c701 | ||
|
|
8355331cbe | ||
|
|
dc9cb07a81 | ||
|
|
57fe7d9ad0 | ||
|
|
00336de59a | ||
|
|
b37b48f039 | ||
|
|
42ca1a8994 | ||
|
|
db678238ef | ||
|
|
861f88dd30 | ||
|
|
77d42f1eb9 | ||
|
|
364a13017c | ||
|
|
8183deeb30 | ||
|
|
bb56d0a752 | ||
|
|
41eafa4ede | ||
|
|
ce7629200f | ||
|
|
5dca06d3d4 | ||
|
|
b1d18c7f29 | ||
|
|
0b2d019e61 | ||
|
|
ab0dde7fe8 | ||
|
|
ef01d2af82 | ||
|
|
08084799b9 | ||
|
|
3642e401da | ||
|
|
094d284e62 | ||
|
|
2c7459e08d | ||
|
|
315d2c4daf | ||
|
|
e61cabf1ce | ||
|
|
994f409291 | ||
|
|
7d124012c2 | ||
|
|
4d3c80e273 | ||
|
|
a332a7fc35 | ||
|
|
2fb945a489 | ||
|
|
4d2517d163 | ||
|
|
b4848f308f | ||
|
|
1c8876cead | ||
|
|
1bcb6ad20d | ||
|
|
66aaa9cf80 | ||
|
|
61d365e957 | ||
|
|
006b319c3a | ||
|
|
e38ec797fd | ||
|
|
94b42e7a9b | ||
|
|
61097dac72 | ||
|
|
116fe01dee | ||
|
|
ba2bf9f366 | ||
|
|
a5b68f2da2 | ||
|
|
97edb0f954 | ||
|
|
a3531b931b | ||
|
|
0438f070f7 | ||
|
|
f53e36c430 | ||
|
|
8889e2de64 | ||
|
|
2d0b310e19 | ||
|
|
dfb465a11b | ||
|
|
9ed2dc755c | ||
|
|
e70342b356 | ||
|
|
ba0fd794d7 | ||
|
|
dbd7de628f | ||
|
|
d6fdaa93a4 | ||
|
|
80076833d1 | ||
|
|
dc9d3fbf96 | ||
|
|
e12548ab8c | ||
|
|
894261862d | ||
|
|
07a261a259 | ||
|
|
34a7bf4dbb | ||
|
|
5988f6cf88 | ||
|
|
039be1f8e9 | ||
|
|
70e92a1cea | ||
|
|
2af2e37dcd | ||
|
|
a6559b1e51 | ||
|
|
361b8852df | ||
|
|
ff201ce3f9 | ||
|
|
de2ce83a8d | ||
|
|
f37d83abe1 | ||
|
|
ee610ceb3f | ||
|
|
5affacab70 | ||
|
|
924011f36e | ||
|
|
70b5a6f05b | ||
|
|
05c7270dcf | ||
|
|
a75e34d1c2 | ||
|
|
f7139ac20e | ||
|
|
e43d718e0f | ||
|
|
cc0b5e660d | ||
|
|
8f525a37da | ||
|
|
5e62d2b104 | ||
|
|
6c373ee31e | ||
|
|
d98c46beb0 | ||
|
|
850772a4ce | ||
|
|
08be65e649 | ||
|
|
ed8e37ed89 | ||
|
|
1732d6d427 | ||
|
|
bb9a958a1e | ||
|
|
f1b8c36a28 | ||
|
|
03ed12a9b1 | ||
|
|
30f5a3a162 | ||
|
|
e4a3f76f55 | ||
|
|
f5bdb56a7c | ||
|
|
64d4a9e240 | ||
|
|
71d9084a95 | ||
|
|
9d6092faaa | ||
|
|
bb0f17ae6f | ||
|
|
ebb46999d8 | ||
|
|
1c48aa8f97 | ||
|
|
bdc0ad2b8f | ||
|
|
ac8d5e5ab3 | ||
|
|
41416dcffe | ||
|
|
dda7cb5791 | ||
|
|
f7fdeeea9b | ||
|
|
9d7d7590a7 | ||
|
|
77848afc94 | ||
|
|
8f7e96e2a5 | ||
|
|
eab807daeb | ||
|
|
c4bfdcbeac | ||
|
|
3801949887 | ||
|
|
29d5c951c5 | ||
|
|
eb4b0d630f | ||
|
|
b6225d1d9a | ||
|
|
32ec2be0b6 | ||
|
|
d7dfa91f6f | ||
|
|
c4cc9dd417 | ||
|
|
884b707385 | ||
|
|
acbc81c1ea | ||
|
|
cc60dcc8a4 | ||
|
|
275f85e7a6 | ||
|
|
24f99a2920 | ||
|
|
2acfbf12ed | ||
|
|
b0972de510 | ||
|
|
af58636c7c | ||
|
|
7341ad5e6e | ||
|
|
744e6c63b6 | ||
|
|
31aa30e3d0 | ||
|
|
ebb4489c01 | ||
|
|
31b3ae584e | ||
|
|
151afe4663 | ||
|
|
b03f7c1504 | ||
|
|
bceaee6e41 | ||
|
|
2a812e0e81 | ||
|
|
58b7fe5fef | ||
|
|
c4a82fe0d1 | ||
|
|
0c33c0de2e | ||
|
|
1b32c79a5e | ||
|
|
dd35f1bd68 | ||
|
|
9c0d8bbeb1 | ||
|
|
02753bfc7d | ||
|
|
88ae36f4e1 | ||
|
|
4dcf8f3f45 | ||
|
|
9e82297303 | ||
|
|
14a885f8d0 | ||
|
|
94aee52c64 | ||
|
|
755d3be89b | ||
|
|
6a3ee5fac4 | ||
|
|
63ff4e281b | ||
|
|
d1cfe54bd9 | ||
|
|
838266d710 | ||
|
|
6547452136 | ||
|
|
095f2d2255 | ||
|
|
42bf70849c | ||
|
|
236fa2a284 | ||
|
|
2450b435a7 | ||
|
|
aaf06fa2cc | ||
|
|
de29ea779a | ||
|
|
282df98d09 | ||
|
|
cc9f6b7b7b | ||
|
|
e3c91a3ba1 | ||
|
|
8ea156d128 | ||
|
|
99db9edfef | ||
|
|
a0c7b1f8ac | ||
|
|
97d57d81b0 | ||
|
|
66ebe45b5e | ||
|
|
7516871b16 | ||
|
|
30bd505eab | ||
|
|
17f7967e39 | ||
|
|
ab55c61dc3 | ||
|
|
066d0221b8 | ||
|
|
269deb56e6 | ||
|
|
7572674fdb | ||
|
|
63379105b5 | ||
|
|
655081365f | ||
|
|
7ac0330e4b | ||
|
|
bbb1d15b8e | ||
|
|
b7c54301fb | ||
|
|
75109e14c3 | ||
|
|
3446f708ff | ||
|
|
9bce3b38d4 | ||
|
|
93736308c9 | ||
|
|
ba9c5c366b | ||
|
|
e523aadc4a | ||
|
|
4416dafe73 | ||
|
|
2062431f23 | ||
|
|
a4b2ecc4f7 | ||
|
|
c8017c7945 | ||
|
|
f81f5e2374 | ||
|
|
19a36a6e12 | ||
|
|
9768b3e42f | ||
|
|
bc6348bb34 | ||
|
|
3da9fe0e94 | ||
|
|
75f94d346d | ||
|
|
4eb9dc5191 | ||
|
|
e00e704cbd | ||
|
|
033880c8f9 | ||
|
|
1f80dac4c0 | ||
|
|
a17eca6300 | ||
|
|
4a2168cf48 | ||
|
|
facd5a76c5 | ||
|
|
85c875e856 | ||
|
|
302bebd80f | ||
|
|
85943b8a03 | ||
|
|
8f2781ca3b | ||
|
|
101c65098d | ||
|
|
195c962d8c | ||
|
|
2bb2e05ef9 | ||
|
|
679019f2de | ||
|
|
649c29674c | ||
|
|
b22cc2c2fa | ||
|
|
2642a1c3ff | ||
|
|
9014d56957 | ||
|
|
7da8b012e6 | ||
|
|
edabdcf724 | ||
|
|
c5adb01ed9 | ||
|
|
13f26e6b5a | ||
|
|
64e7be0321 | ||
|
|
e182173ee2 | ||
|
|
a59940c592 | ||
|
|
36d8df602c | ||
|
|
062973aaaf | ||
|
|
be369b5500 | ||
|
|
ed0628774a | ||
|
|
f988cd36b6 | ||
|
|
8fb2812899 | ||
|
|
b4d0896507 | ||
|
|
4116ac75f6 | ||
|
|
23958965aa | ||
|
|
9723a45e72 | ||
|
|
bbb55b0b4d | ||
|
|
f3ca4b6e34 | ||
|
|
1dfd9a9c75 | ||
|
|
340286f918 | ||
|
|
e41b346046 | ||
|
|
d8fa14cac5 | ||
|
|
2c99e07b93 | ||
|
|
f1ee3a0834 | ||
|
|
ff3f6eccf7 | ||
|
|
b7e9a94744 | ||
|
|
faf5a8e694 | ||
|
|
8a13599436 | ||
|
|
767597ffe3 | ||
|
|
919fdafad5 | ||
|
|
78e3d61b98 | ||
|
|
fd21afa0b3 | ||
|
|
5491ff8a51 | ||
|
|
909ce355e2 | ||
|
|
63a9555d17 | ||
|
|
e85241d9ab | ||
|
|
38957ff531 | ||
|
|
8357a2b90b | ||
|
|
dad7228d56 | ||
|
|
e2c8e4950d | ||
|
|
342c812121 | ||
|
|
4c1880acac | ||
|
|
7383b0a974 | ||
|
|
748d55ddd0 | ||
|
|
7fd61c3bf1 | ||
|
|
48850b2af0 | ||
|
|
4e79bce3e2 | ||
|
|
362415fe8a | ||
|
|
38248ac5b3 | ||
|
|
98d5e4bea8 | ||
|
|
201ca35afb | ||
|
|
26655aefe0 | ||
|
|
f8d9bcf487 | ||
|
|
ec436b0e3b | ||
|
|
6714d3585d | ||
|
|
44d1b4f1fb | ||
|
|
7d98cf1891 | ||
|
|
2d66022727 | ||
|
|
15fefc231b | ||
|
|
53969d05d8 | ||
|
|
209e64b136 | ||
|
|
f3f1727b49 | ||
|
|
15dbce00ee | ||
|
|
2a7b96fab2 | ||
|
|
1aa0a9be67 | ||
|
|
53e26d4909 | ||
|
|
bdef8dc185 | ||
|
|
9c29488044 | ||
|
|
060628397b | ||
|
|
f23dc157be | ||
|
|
3715b7439d | ||
|
|
cde5b23353 | ||
|
|
07736106b1 | ||
|
|
01744730a1 | ||
|
|
c162b470b2 | ||
|
|
5d2511e39e | ||
|
|
483b97a608 | ||
|
|
ea0e25b92b | ||
|
|
06bebcc5c4 | ||
|
|
63a6ed4f43 | ||
|
|
26ca140e4b | ||
|
|
054d67669f | ||
|
|
503e5287cd | ||
|
|
7187ceb0ac | ||
|
|
594eacb480 | ||
|
|
f21bec1ab9 | ||
|
|
e6977de12f | ||
|
|
c99f54367d | ||
|
|
c6ec03ab19 | ||
|
|
cce3809a26 | ||
|
|
7183797e05 | ||
|
|
7b9f854c66 | ||
|
|
b9d2ad3132 | ||
|
|
8aa4d0fd27 | ||
|
|
030588caaf | ||
|
|
be249ac8a1 | ||
|
|
2badc1c79c | ||
|
|
3b8fbbc827 | ||
|
|
a5103a1fc1 | ||
|
|
749d0eec28 | ||
|
|
0af470b2a9 | ||
|
|
97c505f941 | ||
|
|
c6ec2a531f | ||
|
|
3e2f1a8fd9 | ||
|
|
7fa5abd4d1 | ||
|
|
924908f2ad | ||
|
|
bddb1ba48c | ||
|
|
a8cded0cf6 | ||
|
|
14c43aa9a2 | ||
|
|
f273d3ff59 | ||
|
|
1bd78c5398 | ||
|
|
fc4f0eaa82 | ||
|
|
8ad3b87c0e | ||
|
|
133dffb326 | ||
|
|
01e27eac76 | ||
|
|
d4a3cb168c | ||
|
|
f03376cd2a | ||
|
|
6bd9649277 | ||
|
|
6e05e49a45 | ||
|
|
fcf061d06b | ||
|
|
a3b232f389 | ||
|
|
3416b837dc | ||
|
|
ba84bf1461 | ||
|
|
3ed249cba5 | ||
|
|
584e5176a4 | ||
|
|
e5fcd54c92 | ||
|
|
899a21ca24 | ||
|
|
29a07f4b5c | ||
|
|
2e7d80e9ba | ||
|
|
d678735cf6 | ||
|
|
6b5875c008 | ||
|
|
203ae9dfa3 | ||
|
|
00b57dd40e | ||
|
|
f10402cbdb | ||
|
|
32ecf444bd | ||
|
|
3430a31e9d | ||
|
|
943f77eed0 | ||
|
|
801723813a | ||
|
|
69f2203d11 | ||
|
|
7879509727 | ||
|
|
c6a7ae51e6 | ||
|
|
91ed289a93 | ||
|
|
be7c33e3c7 | ||
|
|
a510af9480 | ||
|
|
297cd58295 | ||
|
|
5f9c6f1b08 | ||
|
|
0d1c98b5f7 | ||
|
|
a7e72ceb32 | ||
|
|
c629d2625c | ||
|
|
27322c07db | ||
|
|
caa82cf5e4 | ||
|
|
ee1ca0ed99 | ||
|
|
a7a2b0c227 | ||
|
|
1ab5c6a32a | ||
|
|
2234e95d5c | ||
|
|
511b0cfb9c | ||
|
|
f41c4dd273 | ||
|
|
cb0cc571ee | ||
|
|
06186e6c7e | ||
|
|
659874dce0 | ||
|
|
322ceceb60 | ||
|
|
254396596c | ||
|
|
c516a71804 | ||
|
|
8ab9039ff6 | ||
|
|
b5b51bd73b | ||
|
|
d8db37f3fb | ||
|
|
5a2ec28ddf | ||
|
|
31e2fdc16e | ||
|
|
f935453859 | ||
|
|
1a9cf9b013 | ||
|
|
2453c13e11 | ||
|
|
d174b7fcf8 | ||
|
|
d549e549d8 | ||
|
|
78673e4a94 | ||
|
|
193010e947 | ||
|
|
b7d2683b76 | ||
|
|
2f53f7232b | ||
|
|
b424d0232b | ||
|
|
54b43f1ad7 | ||
|
|
7ffb751ead | ||
|
|
7129d97ee5 | ||
|
|
ec55c53b62 | ||
|
|
e1356b7aaf | ||
|
|
0cbaa752a6 | ||
|
|
2f80012ccd | ||
|
|
1553a90ebb | ||
|
|
7fe411cd85 | ||
|
|
083aaffec7 | ||
|
|
997fdebb9f | ||
|
|
fe0a761ce6 | ||
|
|
232b1cf28c | ||
|
|
6bbb24b974 | ||
|
|
827bbc9b89 | ||
|
|
822b728adb | ||
|
|
8ed527af24 | ||
|
|
77eb928380 | ||
|
|
378dd14ade | ||
|
|
e5d71560e8 | ||
|
|
824f23082b | ||
|
|
af8f8bb040 | ||
|
|
23e9eabedb | ||
|
|
b9c487a0c7 | ||
|
|
96e8f37c81 | ||
|
|
0fc9d540bf | ||
|
|
1f587d1ad1 | ||
|
|
2d421a27e1 | ||
|
|
3934e0c9d3 | ||
|
|
ba1a29aae2 | ||
|
|
66a43ea537 | ||
|
|
3d47d6f0dc | ||
|
|
5583445c4d | ||
|
|
198840f839 | ||
|
|
78843493cc | ||
|
|
4aa3863f17 | ||
|
|
fcfffbb322 | ||
|
|
e4b35a050d | ||
|
|
8506a16dcb | ||
|
|
8dab5df746 | ||
|
|
811191cc7c | ||
|
|
a9972bbf02 | ||
|
|
51d5984afa | ||
|
|
f1eab3f2c5 | ||
|
|
139aad333a | ||
|
|
c009866d86 | ||
|
|
73cb43e71f | ||
|
|
b34a8db34a | ||
|
|
9be72ffb47 | ||
|
|
e6f70a0864 | ||
|
|
0933b8c43d | ||
|
|
dfc965954e | ||
|
|
02067f973e | ||
|
|
ec4679c2a8 | ||
|
|
bdcc4189be | ||
|
|
6b2628db44 | ||
|
|
664d5ab7fc | ||
|
|
3284b77df2 | ||
|
|
2c1512dcbe | ||
|
|
d8728f17ee | ||
|
|
603221fa48 | ||
|
|
8670f45287 | ||
|
|
aa5bc7bc25 | ||
|
|
5e8c7264da | ||
|
|
6474568125 | ||
|
|
c1feb11d98 | ||
|
|
edf75a7174 | ||
|
|
30c5b9514e | ||
|
|
8e55d5499e | ||
|
|
574022ed2c | ||
|
|
fc04f6b2e1 | ||
|
|
7c7c64bde3 | ||
|
|
2a432f73da | ||
|
|
f4863527aa | ||
|
|
8441bc80a4 | ||
|
|
3979ad46f6 | ||
|
|
f4f4a39c01 | ||
|
|
fcce986266 | ||
|
|
bcfe5232fb | ||
|
|
6708019a40 | ||
|
|
8565616c9d | ||
|
|
938736b77f | ||
|
|
8e94c43a54 | ||
|
|
2b7e78cb3b | ||
|
|
41303d0c9c | ||
|
|
4821d02051 | ||
|
|
fd42029a61 | ||
|
|
574d0dab8d | ||
|
|
1aee941cb6 | ||
|
|
75ee99f4d5 | ||
|
|
45cd0157ef | ||
|
|
b800e877f9 | ||
|
|
9ec10cf246 | ||
|
|
f545952136 | ||
|
|
f7cea9ac74 | ||
|
|
22db8f56f1 | ||
|
|
5cd7f05851 | ||
|
|
dde18dfc0f | ||
|
|
d95e1800e1 | ||
|
|
73e1a9ad78 | ||
|
|
ea6adb7ae4 | ||
|
|
93e62a375c | ||
|
|
52c8c68d12 | ||
|
|
f9531904f5 | ||
|
|
17c59f25f5 | ||
|
|
6bae4a8d92 | ||
|
|
a33efc61a2 | ||
|
|
bd4e988397 | ||
|
|
32bed5660a | ||
|
|
d03a012a41 | ||
|
|
c264607207 | ||
|
|
290b3d7106 | ||
|
|
65d2775e2a | ||
|
|
ef3f78175c | ||
|
|
7813ca03da | ||
|
|
ec5aaa2af8 | ||
|
|
4feb1985b0 | ||
|
|
addd687bf8 | ||
|
|
153f783922 | ||
|
|
e2954fdbfd | ||
|
|
6fd73ee8bb | ||
|
|
19d7186508 | ||
|
|
c67f848b5c | ||
|
|
683bd9375f | ||
|
|
d18fa5ba42 | ||
|
|
03c4535648 | ||
|
|
811f670199 | ||
|
|
9dd995a287 | ||
|
|
e40d622b8c | ||
|
|
09708b6318 | ||
|
|
9114f04ef6 | ||
|
|
9db6bc0557 | ||
|
|
9ea59b06d5 | ||
|
|
897392f7e0 | ||
|
|
7f52f78517 | ||
|
|
bb7793283d | ||
|
|
43f25fed9b | ||
|
|
4da896682d | ||
|
|
6155e64086 | ||
|
|
dbfd0cb7a6 | ||
|
|
19625ea6b8 | ||
|
|
e363aeb618 | ||
|
|
aa077032b7 | ||
|
|
1389bf76ce | ||
|
|
f096f181f3 | ||
|
|
1df09dec35 | ||
|
|
8e0e532ea8 | ||
|
|
daa07d031c | ||
|
|
ffb4abebdd | ||
|
|
cb12a35102 | ||
|
|
e8c286308d | ||
|
|
7fb05e6a48 | ||
|
|
12abca8954 | ||
|
|
3b2393dbda | ||
|
|
0261eac2a4 | ||
|
|
69f273eb0e | ||
|
|
477daff92f | ||
|
|
926e76adea | ||
|
|
9429b875aa | ||
|
|
f268c26a3a | ||
|
|
aa86730df2 | ||
|
|
80bb529220 | ||
|
|
7cc99ebf72 | ||
|
|
be5727548b | ||
|
|
54c08b3ea0 | ||
|
|
8964cfd58b | ||
|
|
cf214e4f9e | ||
|
|
2a830c3184 | ||
|
|
c313d5fe28 | ||
|
|
390c097c6a | ||
|
|
ebc839d540 | ||
|
|
20ee6cdb72 | ||
|
|
d503662b58 | ||
|
|
91f6a4efa3 | ||
|
|
13e25cfe6a | ||
|
|
3fad577f2b | ||
|
|
2f334b021f | ||
|
|
363fa450fb | ||
|
|
b049353178 | ||
|
|
0a874b0768 | ||
|
|
a179f95057 | ||
|
|
402f4f7068 | ||
|
|
42d9b425e9 | ||
|
|
d15ec04dba | ||
|
|
0cc5484b60 | ||
|
|
d04820507c | ||
|
|
260723f2a4 | ||
|
|
9e312a3808 | ||
|
|
5f0b1ab05b | ||
|
|
3132d2b0d0 | ||
|
|
c3226b25fe | ||
|
|
d98402b13f | ||
|
|
b2979ca3a4 | ||
|
|
7a913af2c7 | ||
|
|
e324ffd9ad | ||
|
|
e96caa78a1 | ||
|
|
b6bf5545c9 | ||
|
|
f25eb07fab | ||
|
|
9f6b89ff18 | ||
|
|
24463b7d04 | ||
|
|
909be9e169 | ||
|
|
010723eea6 | ||
|
|
a4fa66655e | ||
|
|
610f7ac5de | ||
|
|
be10c2d7fb | ||
|
|
e3ce473639 | ||
|
|
008eac5a8d | ||
|
|
08dd2f72ec | ||
|
|
c7ff14f224 | ||
|
|
942f4ce225 | ||
|
|
7aed929af5 | ||
|
|
99f81daa99 | ||
|
|
a1751dcc1e | ||
|
|
817c01595f | ||
|
|
128503fd7f | ||
|
|
cf100fc36c | ||
|
|
64513e7229 | ||
|
|
8262e899f8 | ||
|
|
a1c43e3539 | ||
|
|
7ab20726e4 | ||
|
|
f7614dced3 | ||
|
|
cfad646748 | ||
|
|
85f4fa9000 | ||
|
|
dd680f27d4 | ||
|
|
2c091a954f | ||
|
|
26f4c4a773 | ||
|
|
ee007f322b | ||
|
|
aece3c7069 | ||
|
|
9f0af64963 | ||
|
|
337c0d9cbb | ||
|
|
4423bef896 | ||
|
|
23e72f3978 | ||
|
|
f6861cd5ba | ||
|
|
988009d84d | ||
|
|
200b812182 | ||
|
|
4118afc146 | ||
|
|
034ff0a305 | ||
|
|
eeeca2197e | ||
|
|
16a8b92d84 | ||
|
|
de1a459bcb | ||
|
|
7448ca1046 | ||
|
|
8f5337cc67 | ||
|
|
d7782383f1 | ||
|
|
5f5943548b | ||
|
|
4cd3291bd1 | ||
|
|
d595eb3314 | ||
|
|
f770cb1a29 | ||
|
|
36d658c4c4 | ||
|
|
cfeb50ae4d | ||
|
|
2b61394234 | ||
|
|
1c96fa09fd | ||
|
|
1c93ca6360 | ||
|
|
5183adbcaa | ||
|
|
6abffb2ce4 | ||
|
|
8bdc92c99b | ||
|
|
8da3e86250 | ||
|
|
f3df986647 | ||
|
|
2a8b424b85 | ||
|
|
7e02a5825e | ||
|
|
c49907e5a4 | ||
|
|
60cd95b31f | ||
|
|
c39d66b547 | ||
|
|
a5928f4dbf | ||
|
|
9d4b978474 | ||
|
|
3447e9bd78 | ||
|
|
a27dad4db0 | ||
|
|
ba1b482025 | ||
|
|
f6f9e5b802 | ||
|
|
d57dcd2a9c | ||
|
|
399a0038cb | ||
|
|
c8cb600ba6 | ||
|
|
a415b34c28 | ||
|
|
ffd32542cc | ||
|
|
90e71db462 | ||
|
|
b125ec8d51 | ||
|
|
d20b7815df | ||
|
|
98d7721ab2 | ||
|
|
81fa147450 | ||
|
|
9f50b6942e | ||
|
|
c87f7b0576 | ||
|
|
6c45bf0353 | ||
|
|
428a3bafb8 | ||
|
|
9233f873ef | ||
|
|
aa54d82c5a | ||
|
|
bc64e3aa29 | ||
|
|
db2fb32dd8 | ||
|
|
4f863689a9 | ||
|
|
214ed0403d | ||
|
|
e4202c361b | ||
|
|
b90512fea0 | ||
|
|
f7c19ed3fb | ||
|
|
77d52d0435 | ||
|
|
2333a684a3 | ||
|
|
bed0ed73d9 | ||
|
|
c975339641 | ||
|
|
c0961e9760 | ||
|
|
705de655a9 | ||
|
|
723f4963e0 | ||
|
|
ddae988aa5 | ||
|
|
979d139af1 | ||
|
|
ca84e68da0 | ||
|
|
5817040956 | ||
|
|
8f9de319bf | ||
|
|
aa14bcc754 | ||
|
|
da0a092d42 | ||
|
|
227c621dad | ||
|
|
ffc44a7010 | ||
|
|
af1480615f | ||
|
|
6b26561605 | ||
|
|
1e7f984ce6 | ||
|
|
1ef90525b7 | ||
|
|
aa4bee448d | ||
|
|
1c0f87d82f | ||
|
|
af36d63975 | ||
|
|
243b499b95 | ||
|
|
b5ba5b8d3a | ||
|
|
b4cdd2c175 | ||
|
|
792cc12ebc | ||
|
|
df7c60de35 | ||
|
|
afe0f7ef3d | ||
|
|
da38d4bc48 | ||
|
|
fe29521298 | ||
|
|
4725db2d2f | ||
|
|
d08c34cc2e | ||
|
|
ad8ea07a7a | ||
|
|
2cc1658eda | ||
|
|
e58180a59e | ||
|
|
0a67fa3520 | ||
|
|
6c1ea557b5 | ||
|
|
3066dcac58 | ||
|
|
34738593eb | ||
|
|
0eba360416 | ||
|
|
116a4048b7 | ||
|
|
2bc9b8a1b9 | ||
|
|
18859e44c7 | ||
|
|
b473661cf4 | ||
|
|
dad4f4f9a0 | ||
|
|
7263b87e62 | ||
|
|
3fcc92ccad | ||
|
|
c06c909700 | ||
|
|
c47f6405d2 | ||
|
|
55f43c5fcd | ||
|
|
3c5a0efb8d | ||
|
|
c448908200 | ||
|
|
13077bc132 | ||
|
|
f0c7dadfa6 | ||
|
|
b6dfea6e5f | ||
|
|
5df5074090 | ||
|
|
e3939c3632 | ||
|
|
12d3873aa7 | ||
|
|
083d569e35 | ||
|
|
da942d4968 | ||
|
|
681f10d8b7 | ||
|
|
4db8234da5 | ||
|
|
da4196c246 | ||
|
|
67142f3080 | ||
|
|
67720c6a6a | ||
|
|
df6aa397f9 | ||
|
|
791b64f74b | ||
|
|
f4f888c172 | ||
|
|
68aa60595e | ||
|
|
2ec2b92bc5 | ||
|
|
992d8e960c | ||
|
|
9f48485b9c | ||
|
|
e9ca27322b | ||
|
|
104099aed5 | ||
|
|
892d224b9c | ||
|
|
fb88ad737f | ||
|
|
652e498cc5 | ||
|
|
2f2d140be5 | ||
|
|
d16e93f62f | ||
|
|
353e2977d6 | ||
|
|
641067c399 | ||
|
|
f7e45332bd | ||
|
|
36e6946c96 | ||
|
|
fa8e1f033b | ||
|
|
415bcd2b6c | ||
|
|
a50f0008b2 |
9
.gitignore
vendored
9
.gitignore
vendored
@@ -26,3 +26,12 @@ qtcreator-build/
|
|||||||
/.pc
|
/.pc
|
||||||
/build-*
|
/build-*
|
||||||
/viewer-*
|
/viewer-*
|
||||||
|
/indra/newview/res/viewerRes.rc
|
||||||
|
/indra/newview/res/viewerRes_bc.rc
|
||||||
|
/indra/newview/English.lproj/InfoPlist.strings
|
||||||
|
/indra/newview/linux_tools/handle_secondlifeprotocol.sh
|
||||||
|
/indra/newview/linux_tools/install.sh
|
||||||
|
/indra/newview/linux_tools/refresh_desktop_app_entry.sh
|
||||||
|
/indra/newview/linux_tools/wrapper.sh
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
29
LICENSES/LEGAL-intel_matrixlib.txt
Normal file
29
LICENSES/LEGAL-intel_matrixlib.txt
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
INTEL LICENSE AGREEMENT
|
||||||
|
|
||||||
|
IMPORTANT - READ BEFORE COPYING OR USING.
|
||||||
|
Do not use or load this library and any associated materials (collectively,
|
||||||
|
the "Software") until you have read the following terms and conditions. By
|
||||||
|
loading or using the Software, you agree to the terms of this Agreement. If
|
||||||
|
you do not wish to so agree, do not use the Software.
|
||||||
|
|
||||||
|
LICENSE: Subject to the restrictions below, Intel Corporation ("Intel")
|
||||||
|
grants to you the permission to use, copy, distribute and prepare derivative
|
||||||
|
works of this Software for any purpose and without fee, provided, that
|
||||||
|
Intel's copyright notice appear in all copies of the Software files.
|
||||||
|
The distribution of derivative works of the Software is also subject to the
|
||||||
|
following limitations: you (i) are solely responsible to your customers for
|
||||||
|
any liability which may arise from the distribution, (ii) do not make any
|
||||||
|
statement that your product is "certified", or that its performance is
|
||||||
|
guaranteed, by Intel, and (iii) do not use Intel's name or trademarks to
|
||||||
|
market your product without written permission.
|
||||||
|
|
||||||
|
EXCLUSION OF ALL WARRANTIES. The Software is provided "AS IS" without any
|
||||||
|
express or implies warranty of any kind including warranties of
|
||||||
|
merchantability, noninfringement, or fitness for a particular purpose.
|
||||||
|
Intel does not warrant or assume responsibility for the accuracy or
|
||||||
|
completeness of any information contained within the Software.
|
||||||
|
As this Software is given free of charge, in no event shall Intel be liable
|
||||||
|
for any damages whatsoever arising out of the use of or inability to use the
|
||||||
|
Software, even if Intel has been adviced of the possibility of such damages.
|
||||||
|
Intel does not assume any responsibility for any errors which may appear in
|
||||||
|
this Software nor any responsibility to update it.
|
||||||
4
README
4
README
@@ -15,8 +15,8 @@ Singularity Viewer is a SecondLife(tm) protocol compatible client application.
|
|||||||
It can be used to access SecondLife services as well as a number of others such
|
It can be used to access SecondLife services as well as a number of others such
|
||||||
as those based upon the OpenSim platform.
|
as those based upon the OpenSim platform.
|
||||||
|
|
||||||
Singulariy is maintained by a small group of volunteers who can be contacted
|
Singularity is maintained by a small group of volunteers who can be contacted
|
||||||
both, in-world (SingularityViewer group) as well on IRC (#SingularityViewer
|
both, in-world (SingularityViewer group) as well as on IRC (#SingularityViewer
|
||||||
@ FreeNode). Bug requests and features requests can be submitted through our
|
@ FreeNode). Bug requests and features requests can be submitted through our
|
||||||
Issue Tracker (http://code.google.com/p/singularity-viewer/issues/list or from
|
Issue Tracker (http://code.google.com/p/singularity-viewer/issues/list or from
|
||||||
the viewer menu: Help --> Bug Reporting --> Singularity Issue Tracker...)
|
the viewer menu: Help --> Bug Reporting --> Singularity Issue Tracker...)
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ if (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts)
|
|||||||
endif (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts)
|
endif (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts)
|
||||||
|
|
||||||
add_custom_target(viewer)
|
add_custom_target(viewer)
|
||||||
add_subdirectory(${LIBS_OPEN_PREFIX}llcrashlogger)
|
|
||||||
add_subdirectory(${LIBS_OPEN_PREFIX}llplugin)
|
add_subdirectory(${LIBS_OPEN_PREFIX}llplugin)
|
||||||
add_subdirectory(${LIBS_OPEN_PREFIX}llui)
|
add_subdirectory(${LIBS_OPEN_PREFIX}llui)
|
||||||
|
|
||||||
@@ -87,28 +86,6 @@ add_subdirectory(${LIBS_OPEN_PREFIX}plugins)
|
|||||||
# add_subdirectory(${VIEWER_PREFIX}test_apps/llplugintest)
|
# add_subdirectory(${VIEWER_PREFIX}test_apps/llplugintest)
|
||||||
#endif (NOT LINUX)
|
#endif (NOT LINUX)
|
||||||
|
|
||||||
if (LINUX)
|
|
||||||
add_subdirectory(${VIEWER_PREFIX}linux_crash_logger)
|
|
||||||
add_dependencies(viewer linux-crash-logger-strip-target)
|
|
||||||
elseif (DARWIN)
|
|
||||||
#add_subdirectory(${VIEWER_PREFIX}mac_crash_logger)
|
|
||||||
#add_subdirectory(${VIEWER_PREFIX}mac_updater)
|
|
||||||
add_dependencies(viewer mac-crash-logger)
|
|
||||||
#add_dependencies(viewer mac-updater)
|
|
||||||
elseif (WINDOWS)
|
|
||||||
add_subdirectory(${VIEWER_PREFIX}win_crash_logger)
|
|
||||||
# cmake EXISTS requires an absolute path, see indra/cmake/Variables.cmake
|
|
||||||
if (EXISTS ${VIEWER_DIR}win_setup)
|
|
||||||
add_subdirectory(${VIEWER_DIR}win_setup)
|
|
||||||
endif (EXISTS ${VIEWER_DIR}win_setup)
|
|
||||||
add_subdirectory(${VIEWER_PREFIX}win_updater)
|
|
||||||
add_dependencies(viewer windows-updater)
|
|
||||||
add_dependencies(viewer windows-crash-logger)
|
|
||||||
elseif (SOLARIS)
|
|
||||||
add_subdirectory(solaris_crash_logger)
|
|
||||||
add_dependencies(viewer solaris-crash-logger)
|
|
||||||
endif (LINUX)
|
|
||||||
|
|
||||||
add_subdirectory(${VIEWER_PREFIX}newview/statemachine)
|
add_subdirectory(${VIEWER_PREFIX}newview/statemachine)
|
||||||
add_subdirectory(${VIEWER_PREFIX}newview)
|
add_subdirectory(${VIEWER_PREFIX}newview)
|
||||||
add_dependencies(viewer secondlife-bin)
|
add_dependencies(viewer secondlife-bin)
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ set(aistatemachine_SOURCE_FILES
|
|||||||
aistatemachine.cpp
|
aistatemachine.cpp
|
||||||
aistatemachinethread.cpp
|
aistatemachinethread.cpp
|
||||||
aitimer.cpp
|
aitimer.cpp
|
||||||
|
aicondition.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(aistatemachine_HEADER_FILES
|
set(aistatemachine_HEADER_FILES
|
||||||
@@ -29,6 +30,7 @@ set(aistatemachine_HEADER_FILES
|
|||||||
aistatemachine.h
|
aistatemachine.h
|
||||||
aistatemachinethread.h
|
aistatemachinethread.h
|
||||||
aitimer.h
|
aitimer.h
|
||||||
|
aicondition.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set_source_files_properties(${aistatemachine_HEADER_FILES}
|
set_source_files_properties(${aistatemachine_HEADER_FILES}
|
||||||
|
|||||||
89
indra/aistatemachine/aicondition.cpp
Normal file
89
indra/aistatemachine/aicondition.cpp
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
/**
|
||||||
|
* @file aicondition.cpp
|
||||||
|
* @brief Implementation of AICondition
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013, Aleric Inglewood.
|
||||||
|
*
|
||||||
|
* 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, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* There are special exceptions to the terms and conditions of the GPL as
|
||||||
|
* it is applied to this Source Code. View the full text of the exception
|
||||||
|
* in the file doc/FLOSS-exception.txt in this software distribution.
|
||||||
|
*
|
||||||
|
* CHANGELOG
|
||||||
|
* and additional copyright holders.
|
||||||
|
*
|
||||||
|
* 14/10/2013
|
||||||
|
* Initial version, written by Aleric Inglewood @ SL
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "sys.h"
|
||||||
|
#include "aicondition.h"
|
||||||
|
#include "aistatemachine.h"
|
||||||
|
|
||||||
|
void AIConditionBase::wait(AIStateMachine* state_machine)
|
||||||
|
{
|
||||||
|
// The condition must be locked before calling AIStateMachine::wait().
|
||||||
|
llassert(mutex().isSelfLocked());
|
||||||
|
// Add the new state machine at the end.
|
||||||
|
mWaitingStateMachines.push_back(state_machine);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AIConditionBase::remove(AIStateMachine* state_machine)
|
||||||
|
{
|
||||||
|
mutex().lock();
|
||||||
|
// Remove all occurances of state_machine from the queue.
|
||||||
|
queue_t::iterator const end = mWaitingStateMachines.end();
|
||||||
|
queue_t::iterator last = end;
|
||||||
|
for (queue_t::iterator iter = mWaitingStateMachines.begin(); iter != last; ++iter)
|
||||||
|
{
|
||||||
|
if (iter->get() == state_machine)
|
||||||
|
{
|
||||||
|
if (--last == iter)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
queue_t::value_type::swap(*iter, *last);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// This invalidates all iterators involved, including end, but not any iterators to the remaining elements.
|
||||||
|
mWaitingStateMachines.erase(last, end);
|
||||||
|
mutex().unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AIConditionBase::signal(int n)
|
||||||
|
{
|
||||||
|
// The condition must be locked before calling AICondition::signal or AICondition::broadcast.
|
||||||
|
llassert(mutex().isSelfLocked());
|
||||||
|
// Signal n state machines.
|
||||||
|
while (n > 0 && !mWaitingStateMachines.empty())
|
||||||
|
{
|
||||||
|
LLPointer<AIStateMachine> state_machine = mWaitingStateMachines.front();
|
||||||
|
bool success = state_machine->signalled();
|
||||||
|
// Only state machines that are actually still blocked should be in the queue:
|
||||||
|
// they are removed from the queue by calling AICondition::remove whenever
|
||||||
|
// they are unblocked for whatever reason...
|
||||||
|
llassert(success);
|
||||||
|
if (success)
|
||||||
|
{
|
||||||
|
++n;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// We never get here...
|
||||||
|
remove(state_machine.get());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
110
indra/aistatemachine/aicondition.h
Normal file
110
indra/aistatemachine/aicondition.h
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
/**
|
||||||
|
* @file aicondition.h
|
||||||
|
* @brief Condition variable for statemachines.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013, Aleric Inglewood.
|
||||||
|
*
|
||||||
|
* 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, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* There are special exceptions to the terms and conditions of the GPL as
|
||||||
|
* it is applied to this Source Code. View the full text of the exception
|
||||||
|
* in the file doc/FLOSS-exception.txt in this software distribution.
|
||||||
|
*
|
||||||
|
* CHANGELOG
|
||||||
|
* and additional copyright holders.
|
||||||
|
*
|
||||||
|
* 14/10/2013
|
||||||
|
* Initial version, written by Aleric Inglewood @ SL
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef AICONDITION_H
|
||||||
|
#define AICONDITION_H
|
||||||
|
|
||||||
|
#include <deque>
|
||||||
|
#include <llpointer.h>
|
||||||
|
#include "aithreadsafe.h"
|
||||||
|
|
||||||
|
class AIStateMachine;
|
||||||
|
class LLMutex;
|
||||||
|
|
||||||
|
// class AICondition
|
||||||
|
//
|
||||||
|
// Call AIStateMachine::wait(AICondition&) in the multiplex_impl of a state machine to
|
||||||
|
// make the state machine go idle until some thread calls AICondition::signal().
|
||||||
|
//
|
||||||
|
// If the state machine is no longer running or wasn't waiting anymore because
|
||||||
|
// something else woke it up, then AICondition::signal() will wake up another
|
||||||
|
// state machine (if any).
|
||||||
|
//
|
||||||
|
// Usage:
|
||||||
|
//
|
||||||
|
// struct Foo { bool met(); }; // Returns true when the condition is met.
|
||||||
|
// AICondition<Foo> Condition_t;
|
||||||
|
// AIAccess<Foo> Condition_wat;
|
||||||
|
//
|
||||||
|
// // Some thread-safe condition variable.
|
||||||
|
// Condition_t condition;
|
||||||
|
//
|
||||||
|
// // Inside the state machine:
|
||||||
|
// {
|
||||||
|
// ...
|
||||||
|
// state WAIT_FOR_CONDITION:
|
||||||
|
// {
|
||||||
|
// // Lock condition and check it. Wait if condition is not met yet.
|
||||||
|
// {
|
||||||
|
// Condition_wat condition_w(condition);
|
||||||
|
// if (!condition_w->met())
|
||||||
|
// {
|
||||||
|
// wait(condition);
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// set_state(CONDITION_MET);
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// CONDITION_MET:
|
||||||
|
// {
|
||||||
|
//
|
||||||
|
|
||||||
|
class AIConditionBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~AIConditionBase() { }
|
||||||
|
|
||||||
|
void signal(int n = 1); // Call this when the condition was met to release n state machines.
|
||||||
|
void broadcast(void) { signal(mWaitingStateMachines.size()); } // Release all blocked state machines.
|
||||||
|
|
||||||
|
private:
|
||||||
|
// These functions are called by AIStateMachine.
|
||||||
|
friend class AIStateMachine;
|
||||||
|
void wait(AIStateMachine* state_machine);
|
||||||
|
void remove(AIStateMachine* state_machine);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual LLMutex& mutex(void) = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
typedef std::deque<LLPointer<AIStateMachine> > queue_t;
|
||||||
|
queue_t mWaitingStateMachines;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
class AICondition : public AIThreadSafeSimpleDC<T>, public AIConditionBase
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
/*virtual*/ LLMutex& mutex(void) { return this->mMutex; }
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
@@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
#include "linden_common.h"
|
#include "linden_common.h"
|
||||||
#include "aistatemachine.h"
|
#include "aistatemachine.h"
|
||||||
|
#include "aicondition.h"
|
||||||
#include "lltimer.h"
|
#include "lltimer.h"
|
||||||
|
|
||||||
//==================================================================
|
//==================================================================
|
||||||
@@ -283,7 +284,7 @@ char const* HelloWorld::state_str_impl(state_type run_state) const
|
|||||||
|
|
||||||
void AIEngine::add(AIStateMachine* state_machine)
|
void AIEngine::add(AIStateMachine* state_machine)
|
||||||
{
|
{
|
||||||
Dout(dc::statemachine, "Adding state machine [" << (void*)state_machine << "] to " << mName);
|
Dout(dc::statemachine(state_machine->mSMDebug), "Adding state machine [" << (void*)state_machine << "] to " << mName);
|
||||||
engine_state_type_wat engine_state_w(mEngineState);
|
engine_state_type_wat engine_state_w(mEngineState);
|
||||||
engine_state_w->list.push_back(QueueElement(state_machine));
|
engine_state_w->list.push_back(QueueElement(state_machine));
|
||||||
if (engine_state_w->waiting)
|
if (engine_state_w->waiting)
|
||||||
@@ -292,7 +293,36 @@ void AIEngine::add(AIStateMachine* state_machine)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void print_statemachine_diagnostics(U64 total_clocks, U64 max_delta, AIEngine::queued_type::const_reference slowest_state_machine);
|
#if STATE_MACHINE_PROFILING
|
||||||
|
// Called from AIStateMachine::mainloop
|
||||||
|
void print_statemachine_diagnostics(U64 total_clocks, AIStateMachine::StateTimerBase::TimeData& slowest_timer, AIEngine::queued_type::const_reference slowest_element)
|
||||||
|
{
|
||||||
|
AIStateMachine const& slowest_state_machine = slowest_element.statemachine();
|
||||||
|
F64 const tfactor = 1000 / calc_clock_frequency();
|
||||||
|
std::ostringstream msg;
|
||||||
|
|
||||||
|
U64 max_delta = slowest_timer.GetDuration();
|
||||||
|
|
||||||
|
if (total_clocks > max_delta)
|
||||||
|
{
|
||||||
|
msg << "AIStateMachine::mainloop did run for " << (total_clocks * tfactor) << " ms. The slowest ";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
msg << "AIStateMachine::mainloop: A ";
|
||||||
|
}
|
||||||
|
msg << "state machine " << "(" << slowest_state_machine.getName() << ") " << "ran for " << (max_delta * tfactor) << " ms";
|
||||||
|
if (slowest_state_machine.getRuntime() > max_delta)
|
||||||
|
{
|
||||||
|
msg << " (" << (slowest_state_machine.getRuntime() * tfactor) << " ms in total now)";
|
||||||
|
}
|
||||||
|
msg << ".\n";
|
||||||
|
|
||||||
|
AIStateMachine::StateTimerBase::DumpTimers(msg);
|
||||||
|
|
||||||
|
llwarns << msg.str() << llendl;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// MAIN-THREAD
|
// MAIN-THREAD
|
||||||
void AIEngine::mainloop(void)
|
void AIEngine::mainloop(void)
|
||||||
@@ -304,33 +334,38 @@ void AIEngine::mainloop(void)
|
|||||||
queued_element = engine_state_w->list.begin();
|
queued_element = engine_state_w->list.begin();
|
||||||
}
|
}
|
||||||
U64 total_clocks = 0;
|
U64 total_clocks = 0;
|
||||||
#ifndef LL_RELEASE_FOR_DOWNLOAD
|
#if STATE_MACHINE_PROFILING
|
||||||
U64 max_delta = 0;
|
|
||||||
queued_type::value_type slowest_element(NULL);
|
queued_type::value_type slowest_element(NULL);
|
||||||
|
AIStateMachine::StateTimerRoot::TimeData slowest_timer;
|
||||||
#endif
|
#endif
|
||||||
while (queued_element != end)
|
while (queued_element != end)
|
||||||
{
|
{
|
||||||
AIStateMachine& state_machine(queued_element->statemachine());
|
AIStateMachine& state_machine(queued_element->statemachine());
|
||||||
U64 start = get_clock_count();
|
AIStateMachine::StateTimerBase::TimeData time_data;
|
||||||
if (!state_machine.sleep(start))
|
if (!state_machine.sleep(get_clock_count()))
|
||||||
{
|
{
|
||||||
state_machine.multiplex(AIStateMachine::normal_run);
|
AIStateMachine::StateTimerRoot timer(state_machine.getName());
|
||||||
|
state_machine.multiplex(AIStateMachine::normal_run);
|
||||||
|
time_data = timer.GetTimerData();
|
||||||
}
|
}
|
||||||
U64 delta = get_clock_count() - start;
|
if (U64 delta = time_data.GetDuration())
|
||||||
state_machine.add(delta);
|
|
||||||
total_clocks += delta;
|
|
||||||
#ifndef LL_RELEASE_FOR_DOWNLOAD
|
|
||||||
if (delta > max_delta)
|
|
||||||
{
|
{
|
||||||
max_delta = delta;
|
state_machine.add(delta);
|
||||||
slowest_element = *queued_element;
|
total_clocks += delta;
|
||||||
}
|
#if STATE_MACHINE_PROFILING
|
||||||
|
if (delta > slowest_timer.GetDuration())
|
||||||
|
{
|
||||||
|
slowest_element = *queued_element;
|
||||||
|
slowest_timer = time_data;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
bool active = state_machine.active(this); // This locks mState shortly, so it must be called before locking mEngineState because add() locks mEngineState while holding mState.
|
bool active = state_machine.active(this); // This locks mState shortly, so it must be called before locking mEngineState because add() locks mEngineState while holding mState.
|
||||||
engine_state_type_wat engine_state_w(mEngineState);
|
engine_state_type_wat engine_state_w(mEngineState);
|
||||||
if (!active)
|
if (!active)
|
||||||
{
|
{
|
||||||
Dout(dc::statemachine, "Erasing state machine [" << (void*)&state_machine << "] from " << mName);
|
Dout(dc::statemachine(state_machine.mSMDebug), "Erasing state machine [" << (void*)&state_machine << "] from " << mName);
|
||||||
engine_state_w->list.erase(queued_element++);
|
engine_state_w->list.erase(queued_element++);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -339,8 +374,8 @@ void AIEngine::mainloop(void)
|
|||||||
}
|
}
|
||||||
if (total_clocks >= sMaxCount)
|
if (total_clocks >= sMaxCount)
|
||||||
{
|
{
|
||||||
#ifndef LL_RELEASE_FOR_DOWNLOAD
|
#if STATE_MACHINE_PROFILING
|
||||||
print_statemachine_diagnostics(total_clocks, max_delta, slowest_element);
|
print_statemachine_diagnostics(total_clocks, slowest_timer, slowest_element);
|
||||||
#endif
|
#endif
|
||||||
Dout(dc::statemachine, "Sorting " << engine_state_w->list.size() << " state machines.");
|
Dout(dc::statemachine, "Sorting " << engine_state_w->list.size() << " state machines.");
|
||||||
engine_state_w->list.sort(QueueElementComp());
|
engine_state_w->list.sort(QueueElementComp());
|
||||||
@@ -372,7 +407,7 @@ void AIEngine::setMaxCount(F32 StateMachineMaxTime)
|
|||||||
sMaxCount = calc_clock_frequency() * StateMachineMaxTime / 1000;
|
sMaxCount = calc_clock_frequency() * StateMachineMaxTime / 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
|
#ifdef CWDEBUG
|
||||||
char const* AIStateMachine::event_str(event_type event)
|
char const* AIStateMachine::event_str(event_type event)
|
||||||
{
|
{
|
||||||
switch(event)
|
switch(event)
|
||||||
@@ -392,7 +427,7 @@ void AIStateMachine::multiplex(event_type event)
|
|||||||
// If this fails then you are using a pointer to a state machine instead of an LLPointer.
|
// If this fails then you are using a pointer to a state machine instead of an LLPointer.
|
||||||
llassert(event == initial_run || getNumRefs() > 0);
|
llassert(event == initial_run || getNumRefs() > 0);
|
||||||
|
|
||||||
DoutEntering(dc::statemachine, "AIStateMachine::multiplex(" << event_str(event) << ") [" << (void*)this << "]");
|
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::multiplex(" << event_str(event) << ") [" << (void*)this << "]");
|
||||||
|
|
||||||
base_state_type state;
|
base_state_type state;
|
||||||
state_type run_state;
|
state_type run_state;
|
||||||
@@ -407,7 +442,7 @@ void AIStateMachine::multiplex(event_type event)
|
|||||||
llassert(!mMultiplexMutex.isSelfLocked()); // We may never enter recursively!
|
llassert(!mMultiplexMutex.isSelfLocked()); // We may never enter recursively!
|
||||||
if (!mMultiplexMutex.tryLock())
|
if (!mMultiplexMutex.tryLock())
|
||||||
{
|
{
|
||||||
Dout(dc::statemachine, "Leaving because it is already being run [" << (void*)this << "]");
|
Dout(dc::statemachine(mSMDebug), "Leaving because it is already being run [" << (void*)this << "]");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -421,7 +456,7 @@ void AIStateMachine::multiplex(event_type event)
|
|||||||
// we should indeed run, again.
|
// we should indeed run, again.
|
||||||
if (event == schedule_run && !sub_state_type_rat(mSubState)->need_run)
|
if (event == schedule_run && !sub_state_type_rat(mSubState)->need_run)
|
||||||
{
|
{
|
||||||
Dout(dc::statemachine, "Leaving because it was already being run [" << (void*)this << "]");
|
Dout(dc::statemachine(mSMDebug), "Leaving because it was already being run [" << (void*)this << "]");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -440,9 +475,9 @@ void AIStateMachine::multiplex(event_type event)
|
|||||||
{
|
{
|
||||||
#ifdef CWDEBUG
|
#ifdef CWDEBUG
|
||||||
if (state == bs_multiplex)
|
if (state == bs_multiplex)
|
||||||
Dout(dc::statemachine, "Running state bs_multiplex / " << state_str_impl(run_state) << " [" << (void*)this << "]");
|
Dout(dc::statemachine(mSMDebug), "Running state bs_multiplex / " << state_str_impl(run_state) << " [" << (void*)this << "]");
|
||||||
else
|
else
|
||||||
Dout(dc::statemachine, "Running state " << state_str(state) << " [" << (void*)this << "]");
|
Dout(dc::statemachine(mSMDebug), "Running state " << state_str(state) << " [" << (void*)this << "]");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SHOW_ASSERT
|
#ifdef SHOW_ASSERT
|
||||||
@@ -503,7 +538,7 @@ void AIStateMachine::multiplex(event_type event)
|
|||||||
// run of bs_reset is not a problem because it happens to be a NoOp.
|
// run of bs_reset is not a problem because it happens to be a NoOp.
|
||||||
state = (state == bs_initialize) ? bs_reset : bs_abort;
|
state = (state == bs_initialize) ? bs_reset : bs_abort;
|
||||||
#ifdef CWDEBUG
|
#ifdef CWDEBUG
|
||||||
Dout(dc::statemachine, "Late abort detected! Running state " << state_str(state) << " instead [" << (void*)this << "]");
|
Dout(dc::statemachine(mSMDebug), "Late abort detected! Running state " << state_str(state) << " instead [" << (void*)this << "]");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#ifdef SHOW_ASSERT
|
#ifdef SHOW_ASSERT
|
||||||
@@ -665,7 +700,7 @@ void AIStateMachine::multiplex(event_type event)
|
|||||||
|
|
||||||
#ifdef CWDEBUG
|
#ifdef CWDEBUG
|
||||||
if (state != state_w->base_state)
|
if (state != state_w->base_state)
|
||||||
Dout(dc::statemachine, "Base state changed from " << state_str(state) << " to " << state_str(state_w->base_state) <<
|
Dout(dc::statemachine(mSMDebug), "Base state changed from " << state_str(state) << " to " << state_str(state_w->base_state) <<
|
||||||
"; need_new_run = " << (need_new_run ? "true" : "false") << " [" << (void*)this << "]");
|
"; need_new_run = " << (need_new_run ? "true" : "false") << " [" << (void*)this << "]");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -699,11 +734,15 @@ void AIStateMachine::multiplex(event_type event)
|
|||||||
// Mark that we're added to this engine, and at the same time, that we're not added to the previous one.
|
// Mark that we're added to this engine, and at the same time, that we're not added to the previous one.
|
||||||
state_w->current_engine = engine;
|
state_w->current_engine = engine;
|
||||||
}
|
}
|
||||||
|
#ifdef SHOW_ASSERT
|
||||||
|
// We are leaving the loop, but we're not idle. The statemachine should re-enter the loop again.
|
||||||
|
mDebugShouldRun = true;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Remove this state machine from any engine.
|
// Remove this state machine from any engine,
|
||||||
// Cause the engine to remove us.
|
// causing the engine to remove us.
|
||||||
state_w->current_engine = NULL;
|
state_w->current_engine = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -747,9 +786,25 @@ void AIStateMachine::multiplex(event_type event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if STATE_MACHINE_PROFILING
|
||||||
|
std::vector<AIStateMachine::StateTimerBase*> AIStateMachine::StateTimerBase::mTimerStack;
|
||||||
|
AIStateMachine::StateTimerBase::TimeData AIStateMachine::StateTimerBase::TimeData::sRoot("");
|
||||||
|
void AIStateMachine::StateTimer::TimeData::DumpTimer(std::ostringstream& msg, std::string prefix)
|
||||||
|
{
|
||||||
|
F64 const tfactor = 1000 / calc_clock_frequency();
|
||||||
|
msg << prefix << mName << " " << (mEnd - mStart)*tfactor << "ms" << std::endl;
|
||||||
|
prefix.push_back(' ');
|
||||||
|
std::vector<TimeData>::iterator it;
|
||||||
|
for (it = mChildren.begin(); it != mChildren.end(); ++it)
|
||||||
|
{
|
||||||
|
it->DumpTimer(msg, prefix);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
AIStateMachine::state_type AIStateMachine::begin_loop(base_state_type base_state)
|
AIStateMachine::state_type AIStateMachine::begin_loop(base_state_type base_state)
|
||||||
{
|
{
|
||||||
DoutEntering(dc::statemachine, "AIStateMachine::begin_loop(" << state_str(base_state) << ") [" << (void*)this << "]");
|
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::begin_loop(" << state_str(base_state) << ") [" << (void*)this << "]");
|
||||||
|
|
||||||
sub_state_type_wat sub_state_w(mSubState);
|
sub_state_type_wat sub_state_w(mSubState);
|
||||||
// Honor a subsequent call to idle() (only necessary in bs_multiplex, but it doesn't hurt to reset this flag in other states too).
|
// Honor a subsequent call to idle() (only necessary in bs_multiplex, but it doesn't hurt to reset this flag in other states too).
|
||||||
@@ -759,7 +814,7 @@ AIStateMachine::state_type AIStateMachine::begin_loop(base_state_type base_state
|
|||||||
// Honor previous calls to advance_state() (once run_state is initialized).
|
// Honor previous calls to advance_state() (once run_state is initialized).
|
||||||
if (base_state == bs_multiplex && sub_state_w->advance_state > sub_state_w->run_state)
|
if (base_state == bs_multiplex && sub_state_w->advance_state > sub_state_w->run_state)
|
||||||
{
|
{
|
||||||
Dout(dc::statemachine, "Copying advance_state to run_state, because it is larger [" << state_str_impl(sub_state_w->advance_state) << " > " << state_str_impl(sub_state_w->run_state) << "]");
|
Dout(dc::statemachine(mSMDebug), "Copying advance_state to run_state, because it is larger [" << state_str_impl(sub_state_w->advance_state) << " > " << state_str_impl(sub_state_w->run_state) << "]");
|
||||||
sub_state_w->run_state = sub_state_w->advance_state;
|
sub_state_w->run_state = sub_state_w->advance_state;
|
||||||
}
|
}
|
||||||
#ifdef SHOW_ASSERT
|
#ifdef SHOW_ASSERT
|
||||||
@@ -789,7 +844,7 @@ AIStateMachine::state_type AIStateMachine::begin_loop(base_state_type base_state
|
|||||||
|
|
||||||
void AIStateMachine::run(AIStateMachine* parent, state_type new_parent_state, bool abort_parent, bool on_abort_signal_parent, AIEngine* default_engine)
|
void AIStateMachine::run(AIStateMachine* parent, state_type new_parent_state, bool abort_parent, bool on_abort_signal_parent, AIEngine* default_engine)
|
||||||
{
|
{
|
||||||
DoutEntering(dc::statemachine, "AIStateMachine::run(" <<
|
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::run(" <<
|
||||||
(void*)parent << ", " <<
|
(void*)parent << ", " <<
|
||||||
(parent ? parent->state_str_impl(new_parent_state) : "NA") <<
|
(parent ? parent->state_str_impl(new_parent_state) : "NA") <<
|
||||||
", abort_parent = " << (abort_parent ? "true" : "false") <<
|
", abort_parent = " << (abort_parent ? "true" : "false") <<
|
||||||
@@ -839,7 +894,7 @@ void AIStateMachine::run(AIStateMachine* parent, state_type new_parent_state, bo
|
|||||||
|
|
||||||
void AIStateMachine::run(callback_type::signal_type::slot_type const& slot, AIEngine* default_engine)
|
void AIStateMachine::run(callback_type::signal_type::slot_type const& slot, AIEngine* default_engine)
|
||||||
{
|
{
|
||||||
DoutEntering(dc::statemachine, "AIStateMachine::run(<slot>, default_engine = " << default_engine->name() << ") [" << (void*)this << "]");
|
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::run(<slot>, default_engine = " << default_engine->name() << ") [" << (void*)this << "]");
|
||||||
|
|
||||||
#ifdef SHOW_ASSERT
|
#ifdef SHOW_ASSERT
|
||||||
{
|
{
|
||||||
@@ -874,7 +929,7 @@ void AIStateMachine::run(callback_type::signal_type::slot_type const& slot, AIEn
|
|||||||
|
|
||||||
void AIStateMachine::callback(void)
|
void AIStateMachine::callback(void)
|
||||||
{
|
{
|
||||||
DoutEntering(dc::statemachine, "AIStateMachine::callback() [" << (void*)this << "]");
|
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::callback() [" << (void*)this << "]");
|
||||||
|
|
||||||
bool aborted = sub_state_type_rat(mSubState)->aborted;
|
bool aborted = sub_state_type_rat(mSubState)->aborted;
|
||||||
if (mParent)
|
if (mParent)
|
||||||
@@ -920,7 +975,7 @@ void AIStateMachine::force_killed(void)
|
|||||||
|
|
||||||
void AIStateMachine::kill(void)
|
void AIStateMachine::kill(void)
|
||||||
{
|
{
|
||||||
DoutEntering(dc::statemachine, "AIStateMachine::kill() [" << (void*)this << "]");
|
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::kill() [" << (void*)this << "]");
|
||||||
#ifdef SHOW_ASSERT
|
#ifdef SHOW_ASSERT
|
||||||
{
|
{
|
||||||
multiplex_state_type_rat state_r(mState);
|
multiplex_state_type_rat state_r(mState);
|
||||||
@@ -937,7 +992,7 @@ void AIStateMachine::kill(void)
|
|||||||
|
|
||||||
void AIStateMachine::reset()
|
void AIStateMachine::reset()
|
||||||
{
|
{
|
||||||
DoutEntering(dc::statemachine, "AIStateMachine::reset() [" << (void*)this << "]");
|
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::reset() [" << (void*)this << "]");
|
||||||
#ifdef SHOW_ASSERT
|
#ifdef SHOW_ASSERT
|
||||||
mDebugAborted = false;
|
mDebugAborted = false;
|
||||||
mDebugContPending = false;
|
mDebugContPending = false;
|
||||||
@@ -960,6 +1015,8 @@ void AIStateMachine::reset()
|
|||||||
sub_state_w->reset = true;
|
sub_state_w->reset = true;
|
||||||
// Start running.
|
// Start running.
|
||||||
sub_state_w->idle = false;
|
sub_state_w->idle = false;
|
||||||
|
// We're not waiting for a condition.
|
||||||
|
sub_state_w->blocked = NULL;
|
||||||
// Keep running till we reach at least bs_multiplex.
|
// Keep running till we reach at least bs_multiplex.
|
||||||
sub_state_w->need_run = true;
|
sub_state_w->need_run = true;
|
||||||
}
|
}
|
||||||
@@ -972,7 +1029,7 @@ void AIStateMachine::reset()
|
|||||||
|
|
||||||
void AIStateMachine::set_state(state_type new_state)
|
void AIStateMachine::set_state(state_type new_state)
|
||||||
{
|
{
|
||||||
DoutEntering(dc::statemachine, "AIStateMachine::set_state(" << state_str_impl(new_state) << ") [" << (void*)this << "]");
|
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::set_state(" << state_str_impl(new_state) << ") [" << (void*)this << "]");
|
||||||
#ifdef SHOW_ASSERT
|
#ifdef SHOW_ASSERT
|
||||||
{
|
{
|
||||||
multiplex_state_type_rat state_r(mState);
|
multiplex_state_type_rat state_r(mState);
|
||||||
@@ -983,6 +1040,8 @@ void AIStateMachine::set_state(state_type new_state)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
sub_state_type_wat sub_state_w(mSubState);
|
sub_state_type_wat sub_state_w(mSubState);
|
||||||
|
// It should never happen that set_state() is called while we're blocked.
|
||||||
|
llassert(!sub_state_w->blocked);
|
||||||
// Force current state to the requested state.
|
// Force current state to the requested state.
|
||||||
sub_state_w->run_state = new_state;
|
sub_state_w->run_state = new_state;
|
||||||
// Void last call to advance_state.
|
// Void last call to advance_state.
|
||||||
@@ -999,13 +1058,13 @@ void AIStateMachine::set_state(state_type new_state)
|
|||||||
|
|
||||||
void AIStateMachine::advance_state(state_type new_state)
|
void AIStateMachine::advance_state(state_type new_state)
|
||||||
{
|
{
|
||||||
DoutEntering(dc::statemachine, "AIStateMachine::advance_state(" << state_str_impl(new_state) << ") [" << (void*)this << "]");
|
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::advance_state(" << state_str_impl(new_state) << ") [" << (void*)this << "]");
|
||||||
{
|
{
|
||||||
sub_state_type_wat sub_state_w(mSubState);
|
sub_state_type_wat sub_state_w(mSubState);
|
||||||
// Ignore call to advance_state when the currently queued state is already greater or equal to the requested state.
|
// Ignore call to advance_state when the currently queued state is already greater or equal to the requested state.
|
||||||
if (sub_state_w->advance_state >= new_state)
|
if (sub_state_w->advance_state >= new_state)
|
||||||
{
|
{
|
||||||
Dout(dc::statemachine, "Ignored, because " << state_str_impl(sub_state_w->advance_state) << " >= " << state_str_impl(new_state) << ".");
|
Dout(dc::statemachine(mSMDebug), "Ignored, because " << state_str_impl(sub_state_w->advance_state) << " >= " << state_str_impl(new_state) << ".");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Ignore call to advance_state when the current state is greater than the requested state: the new state would be
|
// Ignore call to advance_state when the current state is greater than the requested state: the new state would be
|
||||||
@@ -1014,7 +1073,7 @@ void AIStateMachine::advance_state(state_type new_state)
|
|||||||
// the state change is and should be being ignored: the statemachine would start running it's current state (again).
|
// the state change is and should be being ignored: the statemachine would start running it's current state (again).
|
||||||
if (sub_state_w->run_state > new_state)
|
if (sub_state_w->run_state > new_state)
|
||||||
{
|
{
|
||||||
Dout(dc::statemachine, "Ignored, because " << state_str_impl(sub_state_w->run_state) << " > " << state_str_impl(new_state) << " (current state).");
|
Dout(dc::statemachine(mSMDebug), "Ignored, because " << state_str_impl(sub_state_w->run_state) << " > " << state_str_impl(new_state) << " (current state).");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Increment state.
|
// Increment state.
|
||||||
@@ -1023,6 +1082,13 @@ void AIStateMachine::advance_state(state_type new_state)
|
|||||||
sub_state_w->idle = false;
|
sub_state_w->idle = false;
|
||||||
// Ignore a call to idle if it occurs before we leave multiplex_impl().
|
// Ignore a call to idle if it occurs before we leave multiplex_impl().
|
||||||
sub_state_w->skip_idle = true;
|
sub_state_w->skip_idle = true;
|
||||||
|
// No longer say we woke up when signalled() is called.
|
||||||
|
if (sub_state_w->blocked)
|
||||||
|
{
|
||||||
|
Dout(dc::statemachine(mSMDebug), "Removing statemachine from condition " << (void*)sub_state_w->blocked);
|
||||||
|
sub_state_w->blocked->remove(this);
|
||||||
|
sub_state_w->blocked = NULL;
|
||||||
|
}
|
||||||
// Mark that a re-entry of multiplex() is necessary.
|
// Mark that a re-entry of multiplex() is necessary.
|
||||||
sub_state_w->need_run = true;
|
sub_state_w->need_run = true;
|
||||||
#ifdef SHOW_ASSERT
|
#ifdef SHOW_ASSERT
|
||||||
@@ -1048,7 +1114,7 @@ void AIStateMachine::advance_state(state_type new_state)
|
|||||||
|
|
||||||
void AIStateMachine::idle(void)
|
void AIStateMachine::idle(void)
|
||||||
{
|
{
|
||||||
DoutEntering(dc::statemachine, "AIStateMachine::idle() [" << (void*)this << "]");
|
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::idle() [" << (void*)this << "]");
|
||||||
#ifdef SHOW_ASSERT
|
#ifdef SHOW_ASSERT
|
||||||
{
|
{
|
||||||
multiplex_state_type_rat state_r(mState);
|
multiplex_state_type_rat state_r(mState);
|
||||||
@@ -1066,7 +1132,7 @@ void AIStateMachine::idle(void)
|
|||||||
// Ignore call to idle() when advance_state() was called since last call to set_state().
|
// Ignore call to idle() when advance_state() was called since last call to set_state().
|
||||||
if (sub_state_w->skip_idle)
|
if (sub_state_w->skip_idle)
|
||||||
{
|
{
|
||||||
Dout(dc::statemachine, "Ignored, because skip_idle is true (advance_state() was called last).");
|
Dout(dc::statemachine(mSMDebug), "Ignored, because skip_idle is true (advance_state() was called last).");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Mark that we are idle.
|
// Mark that we are idle.
|
||||||
@@ -1075,13 +1141,54 @@ void AIStateMachine::idle(void)
|
|||||||
mSleep = 0;
|
mSleep = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This function is very much like idle().
|
||||||
|
void AIStateMachine::wait(AIConditionBase& condition)
|
||||||
|
{
|
||||||
|
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::wait(" << (void*)&condition << ") [" << (void*)this << "]");
|
||||||
|
#ifdef SHOW_ASSERT
|
||||||
|
{
|
||||||
|
multiplex_state_type_rat state_r(mState);
|
||||||
|
// wait() may only be called multiplex_impl().
|
||||||
|
llassert(state_r->base_state == bs_multiplex);
|
||||||
|
// May only be called by the thread that is holding mMultiplexMutex.
|
||||||
|
llassert(mThreadId.equals_current_thread());
|
||||||
|
}
|
||||||
|
// wait() following set_state() cancels the reason to run because of the call to set_state.
|
||||||
|
mDebugSetStatePending = false;
|
||||||
|
#endif
|
||||||
|
sub_state_type_wat sub_state_w(mSubState);
|
||||||
|
// As wait() may only be called from within the state machine, it should never happen that the state machine is already idle.
|
||||||
|
llassert(!sub_state_w->idle);
|
||||||
|
// Ignore call to wait() when advance_state() was called since last call to set_state().
|
||||||
|
if (sub_state_w->skip_idle)
|
||||||
|
{
|
||||||
|
Dout(dc::statemachine(mSMDebug), "Ignored, because skip_idle is true (advance_state() was called last).");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Register ourselves with the condition object.
|
||||||
|
condition.wait(this);
|
||||||
|
// Mark that we are idle.
|
||||||
|
sub_state_w->idle = true;
|
||||||
|
// Mark that we are waiting for a condition.
|
||||||
|
sub_state_w->blocked = &condition;
|
||||||
|
// Not sleeping (anymore).
|
||||||
|
mSleep = 0;
|
||||||
|
}
|
||||||
|
|
||||||
void AIStateMachine::cont(void)
|
void AIStateMachine::cont(void)
|
||||||
{
|
{
|
||||||
DoutEntering(dc::statemachine, "AIStateMachine::cont() [" << (void*)this << "]");
|
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::cont() [" << (void*)this << "]");
|
||||||
{
|
{
|
||||||
sub_state_type_wat sub_state_w(mSubState);
|
sub_state_type_wat sub_state_w(mSubState);
|
||||||
// Void last call to idle(), if any.
|
// Void last call to idle(), if any.
|
||||||
sub_state_w->idle = false;
|
sub_state_w->idle = false;
|
||||||
|
// No longer say we woke up when signalled() is called.
|
||||||
|
if (sub_state_w->blocked)
|
||||||
|
{
|
||||||
|
Dout(dc::statemachine(mSMDebug), "Removing statemachine from condition " << (void*)sub_state_w->blocked);
|
||||||
|
sub_state_w->blocked->remove(this);
|
||||||
|
sub_state_w->blocked = NULL;
|
||||||
|
}
|
||||||
// Mark that a re-entry of multiplex() is necessary.
|
// Mark that a re-entry of multiplex() is necessary.
|
||||||
sub_state_w->need_run = true;
|
sub_state_w->need_run = true;
|
||||||
#ifdef SHOW_ASSERT
|
#ifdef SHOW_ASSERT
|
||||||
@@ -1095,15 +1202,56 @@ void AIStateMachine::cont(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This function is very much like cont(), except that it has no effect when we are not in a blocked state.
|
||||||
|
// Returns true if the state machine was unblocked, false if it was already unblocked.
|
||||||
|
bool AIStateMachine::signalled(void)
|
||||||
|
{
|
||||||
|
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::signalled() [" << (void*)this << "]");
|
||||||
|
{
|
||||||
|
sub_state_type_wat sub_state_w(mSubState);
|
||||||
|
// Test if we are blocked or not.
|
||||||
|
if (sub_state_w->blocked)
|
||||||
|
{
|
||||||
|
Dout(dc::statemachine(mSMDebug), "Removing statemachine from condition " << (void*)sub_state_w->blocked);
|
||||||
|
sub_state_w->blocked->remove(this);
|
||||||
|
sub_state_w->blocked = NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// Void last call to wait().
|
||||||
|
sub_state_w->idle = false;
|
||||||
|
// Mark that a re-entry of multiplex() is necessary.
|
||||||
|
sub_state_w->need_run = true;
|
||||||
|
#ifdef SHOW_ASSERT
|
||||||
|
// From this moment.
|
||||||
|
mDebugContPending = true;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
if (!mMultiplexMutex.isSelfLocked())
|
||||||
|
{
|
||||||
|
multiplex(schedule_run);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void AIStateMachine::abort(void)
|
void AIStateMachine::abort(void)
|
||||||
{
|
{
|
||||||
DoutEntering(dc::statemachine, "AIStateMachine::abort() [" << (void*)this << "]");
|
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::abort() [" << (void*)this << "]");
|
||||||
bool is_waiting = false;
|
bool is_waiting = false;
|
||||||
{
|
{
|
||||||
multiplex_state_type_rat state_r(mState);
|
multiplex_state_type_rat state_r(mState);
|
||||||
sub_state_type_wat sub_state_w(mSubState);
|
sub_state_type_wat sub_state_w(mSubState);
|
||||||
// Mark that we are aborted, iff we didn't already finish.
|
// Mark that we are aborted, iff we didn't already finish.
|
||||||
sub_state_w->aborted = !sub_state_w->finished;
|
sub_state_w->aborted = !sub_state_w->finished;
|
||||||
|
// No longer say we woke up when signalled() is called.
|
||||||
|
if (sub_state_w->blocked)
|
||||||
|
{
|
||||||
|
Dout(dc::statemachine(mSMDebug), "Removing statemachine from condition " << (void*)sub_state_w->blocked);
|
||||||
|
sub_state_w->blocked->remove(this);
|
||||||
|
sub_state_w->blocked = NULL;
|
||||||
|
}
|
||||||
// Mark that a re-entry of multiplex() is necessary.
|
// Mark that a re-entry of multiplex() is necessary.
|
||||||
sub_state_w->need_run = true;
|
sub_state_w->need_run = true;
|
||||||
// Schedule a new run when this state machine is waiting.
|
// Schedule a new run when this state machine is waiting.
|
||||||
@@ -1128,7 +1276,7 @@ void AIStateMachine::abort(void)
|
|||||||
|
|
||||||
void AIStateMachine::finish(void)
|
void AIStateMachine::finish(void)
|
||||||
{
|
{
|
||||||
DoutEntering(dc::statemachine, "AIStateMachine::finish() [" << (void*)this << "]");
|
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::finish() [" << (void*)this << "]");
|
||||||
#ifdef SHOW_ASSERT
|
#ifdef SHOW_ASSERT
|
||||||
{
|
{
|
||||||
multiplex_state_type_rat state_r(mState);
|
multiplex_state_type_rat state_r(mState);
|
||||||
@@ -1147,7 +1295,7 @@ void AIStateMachine::finish(void)
|
|||||||
|
|
||||||
void AIStateMachine::yield(void)
|
void AIStateMachine::yield(void)
|
||||||
{
|
{
|
||||||
DoutEntering(dc::statemachine, "AIStateMachine::yield() [" << (void*)this << "]");
|
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::yield() [" << (void*)this << "]");
|
||||||
multiplex_state_type_rat state_r(mState);
|
multiplex_state_type_rat state_r(mState);
|
||||||
// yield() may only be called from multiplex_impl().
|
// yield() may only be called from multiplex_impl().
|
||||||
llassert(state_r->base_state == bs_multiplex);
|
llassert(state_r->base_state == bs_multiplex);
|
||||||
@@ -1160,7 +1308,7 @@ void AIStateMachine::yield(void)
|
|||||||
void AIStateMachine::yield(AIEngine* engine)
|
void AIStateMachine::yield(AIEngine* engine)
|
||||||
{
|
{
|
||||||
llassert(engine);
|
llassert(engine);
|
||||||
DoutEntering(dc::statemachine, "AIStateMachine::yield(" << engine->name() << ") [" << (void*)this << "]");
|
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::yield(" << engine->name() << ") [" << (void*)this << "]");
|
||||||
#ifdef SHOW_ASSERT
|
#ifdef SHOW_ASSERT
|
||||||
{
|
{
|
||||||
multiplex_state_type_rat state_r(mState);
|
multiplex_state_type_rat state_r(mState);
|
||||||
@@ -1173,9 +1321,19 @@ void AIStateMachine::yield(AIEngine* engine)
|
|||||||
mYieldEngine = engine;
|
mYieldEngine = engine;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AIStateMachine::yield_if_not(AIEngine* engine)
|
||||||
|
{
|
||||||
|
if (engine && multiplex_state_type_rat(mState)->current_engine != engine)
|
||||||
|
{
|
||||||
|
yield(engine);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void AIStateMachine::yield_frame(unsigned int frames)
|
void AIStateMachine::yield_frame(unsigned int frames)
|
||||||
{
|
{
|
||||||
DoutEntering(dc::statemachine, "AIStateMachine::yield_frame(" << frames << ") [" << (void*)this << "]");
|
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::yield_frame(" << frames << ") [" << (void*)this << "]");
|
||||||
mSleep = -(S64)frames;
|
mSleep = -(S64)frames;
|
||||||
// Sleeping is always done from the main thread.
|
// Sleeping is always done from the main thread.
|
||||||
yield(&gMainThreadEngine);
|
yield(&gMainThreadEngine);
|
||||||
@@ -1183,7 +1341,7 @@ void AIStateMachine::yield_frame(unsigned int frames)
|
|||||||
|
|
||||||
void AIStateMachine::yield_ms(unsigned int ms)
|
void AIStateMachine::yield_ms(unsigned int ms)
|
||||||
{
|
{
|
||||||
DoutEntering(dc::statemachine, "AIStateMachine::yield_ms(" << ms << ") [" << (void*)this << "]");
|
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::yield_ms(" << ms << ") [" << (void*)this << "]");
|
||||||
mSleep = get_clock_count() + calc_clock_frequency() * ms / 1000;
|
mSleep = get_clock_count() + calc_clock_frequency() * ms / 1000;
|
||||||
// Sleeping is always done from the main thread.
|
// Sleeping is always done from the main thread.
|
||||||
yield(&gMainThreadEngine);
|
yield(&gMainThreadEngine);
|
||||||
@@ -1233,7 +1391,7 @@ void AIEngine::threadloop(void)
|
|||||||
engine_state_type_wat engine_state_w(mEngineState);
|
engine_state_type_wat engine_state_w(mEngineState);
|
||||||
if (!active)
|
if (!active)
|
||||||
{
|
{
|
||||||
Dout(dc::statemachine, "Erasing state machine [" << (void*)&state_machine << "] from " << mName);
|
Dout(dc::statemachine(state_machine.mSMDebug), "Erasing state machine [" << (void*)&state_machine << "] from " << mName);
|
||||||
engine_state_w->list.erase(queued_element++);
|
engine_state_w->list.erase(queued_element++);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -36,9 +36,11 @@
|
|||||||
|
|
||||||
#include "aithreadsafe.h"
|
#include "aithreadsafe.h"
|
||||||
#include <llpointer.h>
|
#include <llpointer.h>
|
||||||
|
#include "lltimer.h"
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <boost/signals2.hpp>
|
#include <boost/signals2.hpp>
|
||||||
|
|
||||||
|
class AIConditionBase;
|
||||||
class AIStateMachine;
|
class AIStateMachine;
|
||||||
|
|
||||||
class AIEngine
|
class AIEngine
|
||||||
@@ -97,11 +99,143 @@ class AIEngine
|
|||||||
extern AIEngine gMainThreadEngine;
|
extern AIEngine gMainThreadEngine;
|
||||||
extern AIEngine gStateMachineThreadEngine;
|
extern AIEngine gStateMachineThreadEngine;
|
||||||
|
|
||||||
|
#ifndef STATE_MACHINE_PROFILING
|
||||||
|
#ifndef LL_RELEASE_FOR_DOWNLOAD
|
||||||
|
#define STATE_MACHINE_PROFILING 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
class AIStateMachine : public LLThreadSafeRefCount
|
class AIStateMachine : public LLThreadSafeRefCount
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef U32 state_type; //!< The type of run_state
|
typedef U32 state_type; //!< The type of run_state
|
||||||
|
|
||||||
|
// A simple timer class that will calculate time delta between ctor and GetTimerData call.
|
||||||
|
// Time data is stored as a nested TimeData object.
|
||||||
|
// If STATE_MACHINE_PROFILING is defined then a stack of all StateTimers from root is maintained for debug output.
|
||||||
|
class StateTimerBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
class TimeData
|
||||||
|
{
|
||||||
|
friend class StateTimerBase;
|
||||||
|
public:
|
||||||
|
TimeData() : mStart(-1), mEnd(-1) {}
|
||||||
|
U64 GetDuration() { return mEnd - mStart; }
|
||||||
|
private:
|
||||||
|
U64 mStart, mEnd;
|
||||||
|
|
||||||
|
#if !STATE_MACHINE_PROFILING
|
||||||
|
TimeData(const std::string& name) : mStart(get_clock_count()), mEnd(get_clock_count()) {}
|
||||||
|
#else
|
||||||
|
TimeData(const std::string& name) : mName(name), mStart(get_clock_count()), mEnd(get_clock_count()) {}
|
||||||
|
void DumpTimer(std::ostringstream& msg, std::string prefix);
|
||||||
|
std::vector<TimeData> mChildren;
|
||||||
|
std::string mName;
|
||||||
|
static TimeData sRoot;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
#if !STATE_MACHINE_PROFILING
|
||||||
|
StateTimerBase(const std::string& name) : mData(name) {}
|
||||||
|
~StateTimerBase() {}
|
||||||
|
protected:
|
||||||
|
TimeData mData;
|
||||||
|
// Return a copy of the underlying timer data.
|
||||||
|
// This allows the data live beyond the scope of the state timer.
|
||||||
|
public:
|
||||||
|
const TimeData GetTimerData()
|
||||||
|
{
|
||||||
|
mData.mEnd = get_clock_count(); //set mEnd to current time, since GetTimerData() will always be called before the dtor, obv.
|
||||||
|
return mData;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
protected:
|
||||||
|
// Ctors/dtors are hidden. Only StateTimerRoot and StateTimer are permitted to access them.
|
||||||
|
StateTimerBase() : mData(NULL) {}
|
||||||
|
~StateTimerBase()
|
||||||
|
{
|
||||||
|
// If mData is null then the timer was not registered due to being in the wrong thread or the root timer wasn't in the expected state.
|
||||||
|
if (!mData)
|
||||||
|
return;
|
||||||
|
mData->mEnd = get_clock_count();
|
||||||
|
mTimerStack.pop_back();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Also hide internals from everything except StateTimerRoot and StateTimer
|
||||||
|
bool AddAsRoot(const std::string& name)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!is_main_thread())
|
||||||
|
return true; //Ignoring this timer, but pretending it was added.
|
||||||
|
if (!mTimerStack.empty())
|
||||||
|
return false;
|
||||||
|
TimeData::sRoot = TimeData(name);
|
||||||
|
mData = &TimeData::sRoot;
|
||||||
|
mData->mChildren.clear();
|
||||||
|
mTimerStack.push_back(this);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
bool AddAsChild(const std::string& name)
|
||||||
|
{
|
||||||
|
if (!is_main_thread())
|
||||||
|
return true; //Ignoring this timer, but pretending it was added.
|
||||||
|
if (mTimerStack.empty())
|
||||||
|
return false;
|
||||||
|
mTimerStack.back()->mData->mChildren.push_back(TimeData(name));
|
||||||
|
mData = &mTimerStack.back()->mData->mChildren.back();
|
||||||
|
mTimerStack.push_back(this);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
TimeData* mData;
|
||||||
|
static std::vector<StateTimerBase*> mTimerStack;
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Debug spew
|
||||||
|
static void DumpTimers(std::ostringstream& msg)
|
||||||
|
{
|
||||||
|
TimeData::sRoot.DumpTimer(msg, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return a copy of the underlying timer data.
|
||||||
|
// This allows the data live beyond the scope of the state timer.
|
||||||
|
const TimeData GetTimerData() const
|
||||||
|
{
|
||||||
|
if (mData)
|
||||||
|
{
|
||||||
|
TimeData ret = *mData;
|
||||||
|
ret.mEnd = get_clock_count(); //set mEnd to current time, since GetTimerData() will always be called before the dtor, obv.
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
return TimeData();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
public:
|
||||||
|
#if !STATE_MACHINE_PROFILING
|
||||||
|
typedef StateTimerBase StateTimerRoot;
|
||||||
|
typedef StateTimerBase StateTimer;
|
||||||
|
#else
|
||||||
|
class StateTimerRoot : public StateTimerBase
|
||||||
|
{ //A StateTimerRoot can become a child if a root already exists.
|
||||||
|
public:
|
||||||
|
StateTimerRoot(const std::string& name)
|
||||||
|
{
|
||||||
|
if(!AddAsRoot(name))
|
||||||
|
AddAsChild(name);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
class StateTimer : public StateTimerBase
|
||||||
|
{ //A StateTimer can never become a root
|
||||||
|
public:
|
||||||
|
StateTimer(const std::string& name)
|
||||||
|
{
|
||||||
|
AddAsChild(name);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// The type of event that causes multiplex() to be called.
|
// The type of event that causes multiplex() to be called.
|
||||||
enum event_type {
|
enum event_type {
|
||||||
@@ -132,6 +266,7 @@ class AIStateMachine : public LLThreadSafeRefCount
|
|||||||
struct sub_state_type {
|
struct sub_state_type {
|
||||||
state_type run_state;
|
state_type run_state;
|
||||||
state_type advance_state;
|
state_type advance_state;
|
||||||
|
AIConditionBase* blocked;
|
||||||
bool reset;
|
bool reset;
|
||||||
bool need_run;
|
bool need_run;
|
||||||
bool idle;
|
bool idle;
|
||||||
@@ -195,20 +330,36 @@ class AIStateMachine : public LLThreadSafeRefCount
|
|||||||
bool mDebugAdvanceStatePending; // True while advance_state() was called by not handled yet.
|
bool mDebugAdvanceStatePending; // True while advance_state() was called by not handled yet.
|
||||||
bool mDebugRefCalled; // True when ref() is called (or will be called within the critial area of mMultiplexMutex).
|
bool mDebugRefCalled; // True when ref() is called (or will be called within the critial area of mMultiplexMutex).
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef CWDEBUG
|
||||||
|
protected:
|
||||||
|
bool mSMDebug; // Print debug output only when true.
|
||||||
|
#endif
|
||||||
|
private:
|
||||||
U64 mRuntime; // Total time spent running in the main thread (in clocks).
|
U64 mRuntime; // Total time spent running in the main thread (in clocks).
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AIStateMachine(void) : mCallback(NULL), mDefaultEngine(NULL), mYieldEngine(NULL),
|
AIStateMachine(CWD_ONLY(bool debug)) : mCallback(NULL), mDefaultEngine(NULL), mYieldEngine(NULL),
|
||||||
#ifdef SHOW_ASSERT
|
#ifdef SHOW_ASSERT
|
||||||
mThreadId(AIThreadID::none), mDebugLastState(bs_killed), mDebugShouldRun(false), mDebugAborted(false), mDebugContPending(false),
|
mThreadId(AIThreadID::none), mDebugLastState(bs_killed), mDebugShouldRun(false), mDebugAborted(false), mDebugContPending(false),
|
||||||
mDebugSetStatePending(false), mDebugAdvanceStatePending(false), mDebugRefCalled(false),
|
mDebugSetStatePending(false), mDebugAdvanceStatePending(false), mDebugRefCalled(false),
|
||||||
|
#endif
|
||||||
|
#ifdef CWDEBUG
|
||||||
|
mSMDebug(debug),
|
||||||
#endif
|
#endif
|
||||||
mRuntime(0)
|
mRuntime(0)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// The user should call finish() (or abort(), or kill() from the call back when finish_impl() calls run()), not delete a class derived from AIStateMachine directly.
|
// The user should call finish() (or abort(), or kill() from the call back when finish_impl() calls run()),
|
||||||
virtual ~AIStateMachine() { llassert(multiplex_state_type_rat(mState)->base_state == bs_killed); }
|
// not delete a class derived from AIStateMachine directly. Deleting it directly before calling run() is
|
||||||
|
// ok however.
|
||||||
|
virtual ~AIStateMachine()
|
||||||
|
{
|
||||||
|
#ifdef SHOW_ASSERT
|
||||||
|
base_state_type state = multiplex_state_type_rat(mState)->base_state;
|
||||||
|
llassert(state == bs_killed || state == bs_reset);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// These functions may be called directly after creation, or from within finish_impl(), or from the call back function.
|
// These functions may be called directly after creation, or from within finish_impl(), or from the call back function.
|
||||||
@@ -224,11 +375,13 @@ class AIStateMachine : public LLThreadSafeRefCount
|
|||||||
void set_state(state_type new_state); // Run this state the NEXT loop.
|
void set_state(state_type new_state); // Run this state the NEXT loop.
|
||||||
// These functions can only be called from within multiplex_impl().
|
// These functions can only be called from within multiplex_impl().
|
||||||
void idle(void); // Go idle unless cont() or advance_state() were called since the start of the current loop, or until they are called.
|
void idle(void); // Go idle unless cont() or advance_state() were called since the start of the current loop, or until they are called.
|
||||||
|
void wait(AIConditionBase& condition); // The same as idle(), but wake up when AICondition<T>::signal() is called.
|
||||||
void finish(void); // Mark that the state machine finished and schedule the call back.
|
void finish(void); // Mark that the state machine finished and schedule the call back.
|
||||||
void yield(void); // Yield to give CPU to other state machines, but do not go idle.
|
void yield(void); // Yield to give CPU to other state machines, but do not go idle.
|
||||||
void yield(AIEngine* engine); // Yield to give CPU to other state machines, but do not go idle. Continue running from engine 'engine'.
|
void yield(AIEngine* engine); // Yield to give CPU to other state machines, but do not go idle. Continue running from engine 'engine'.
|
||||||
void yield_frame(unsigned int frames); // Run from the main-thread engine after at least 'frames' frames have passed.
|
void yield_frame(unsigned int frames); // Run from the main-thread engine after at least 'frames' frames have passed.
|
||||||
void yield_ms(unsigned int ms); // Run from the main-thread engine after roughly 'ms' miliseconds have passed.
|
void yield_ms(unsigned int ms); // Run from the main-thread engine after roughly 'ms' miliseconds have passed.
|
||||||
|
bool yield_if_not(AIEngine* engine); // Do not really yield, unless the current engine is not 'engine'. Returns true if it switched engine.
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// This function can be called from multiplex_imp(), but also by a child state machine and
|
// This function can be called from multiplex_imp(), but also by a child state machine and
|
||||||
@@ -236,11 +389,12 @@ class AIStateMachine : public LLThreadSafeRefCount
|
|||||||
// to access this state machine.
|
// to access this state machine.
|
||||||
void abort(void); // Abort the state machine (unsuccessful finish).
|
void abort(void); // Abort the state machine (unsuccessful finish).
|
||||||
|
|
||||||
// These are the only two functions that can be called by any thread at any moment.
|
// These are the only three functions that can be called by any thread at any moment.
|
||||||
// Those threads should use an LLPointer<AIStateMachine> to access this state machine.
|
// Those threads should use an LLPointer<AIStateMachine> to access this state machine.
|
||||||
void cont(void); // Guarantee at least one full run of multiplex() after this function is called. Cancels the last call to idle().
|
void cont(void); // Guarantee at least one full run of multiplex() after this function is called. Cancels the last call to idle().
|
||||||
void advance_state(state_type new_state); // Guarantee at least one full run of multiplex() after this function is called
|
void advance_state(state_type new_state); // Guarantee at least one full run of multiplex() after this function is called
|
||||||
// iff new_state is larger than the last state that was processed.
|
// iff new_state is larger than the last state that was processed.
|
||||||
|
bool signalled(void); // Call cont() iff this state machine is still blocked after a call to wait(). Returns false if it already unblocked.
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Accessors.
|
// Accessors.
|
||||||
@@ -274,19 +428,23 @@ class AIStateMachine : public LLThreadSafeRefCount
|
|||||||
|
|
||||||
// Return stringified state, for debugging purposes.
|
// Return stringified state, for debugging purposes.
|
||||||
char const* state_str(base_state_type state);
|
char const* state_str(base_state_type state);
|
||||||
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
|
#ifdef CWDEBUG
|
||||||
char const* event_str(event_type event);
|
char const* event_str(event_type event);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void add(U64 count) { mRuntime += count; }
|
void add(U64 count) { mRuntime += count; }
|
||||||
U64 getRuntime(void) const { return mRuntime; }
|
U64 getRuntime(void) const { return mRuntime; }
|
||||||
|
|
||||||
|
// For diagnostics. Every derived class must override this.
|
||||||
|
virtual const char* getName() const = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void initialize_impl(void) = 0;
|
virtual void initialize_impl(void) = 0;
|
||||||
virtual void multiplex_impl(state_type run_state) = 0;
|
virtual void multiplex_impl(state_type run_state) = 0;
|
||||||
virtual void abort_impl(void) { }
|
virtual void abort_impl(void) { }
|
||||||
virtual void finish_impl(void) { }
|
virtual void finish_impl(void) { }
|
||||||
virtual char const* state_str_impl(state_type run_state) const = 0;
|
virtual char const* state_str_impl(state_type run_state) const = 0;
|
||||||
|
virtual void force_killed(void); // Called from AIEngine::flush().
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void reset(void); // Called from run() to (re)initialize a (re)start.
|
void reset(void); // Called from run() to (re)initialize a (re)start.
|
||||||
@@ -303,7 +461,6 @@ class AIStateMachine : public LLThreadSafeRefCount
|
|||||||
mSleep = 0;
|
mSleep = 0;
|
||||||
return mSleep != 0;
|
return mSleep != 0;
|
||||||
}
|
}
|
||||||
void force_killed(void); // Called from AIEngine::flush().
|
|
||||||
|
|
||||||
friend class AIEngine; // Calls multiplex() and force_killed().
|
friend class AIEngine; // Calls multiplex() and force_killed().
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -181,7 +181,11 @@ class AIStateMachineThreadBase : public AIStateMachine {
|
|||||||
static state_type const max_state = wait_stopped + 1;
|
static state_type const max_state = wait_stopped + 1;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
AIStateMachineThreadBase(void) { }
|
AIStateMachineThreadBase(CWD_ONLY(bool debug))
|
||||||
|
#ifdef CWDEBUG
|
||||||
|
: AIStateMachine(debug)
|
||||||
|
#endif
|
||||||
|
{ }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Handle initializing the object.
|
// Handle initializing the object.
|
||||||
@@ -217,7 +221,10 @@ class AIStateMachineThread : public AIStateMachineThreadBase {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructor.
|
// Constructor.
|
||||||
AIStateMachineThread(void)
|
AIStateMachineThread(CWD_ONLY(bool debug))
|
||||||
|
#ifdef CWDEBUG
|
||||||
|
: AIStateMachineThreadBase(debug)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
*AIThreadImpl::StateMachineThread_wat(mThreadImpl.mStateMachineThread) = this;
|
*AIThreadImpl::StateMachineThread_wat(mThreadImpl.mStateMachineThread) = this;
|
||||||
}
|
}
|
||||||
@@ -225,6 +232,13 @@ class AIStateMachineThread : public AIStateMachineThreadBase {
|
|||||||
// Accessor.
|
// Accessor.
|
||||||
THREAD_IMPL& thread_impl(void) { return mThreadImpl; }
|
THREAD_IMPL& thread_impl(void) { return mThreadImpl; }
|
||||||
|
|
||||||
|
/*virtual*/ const char* getName() const
|
||||||
|
{
|
||||||
|
#define STRIZE(arg) #arg
|
||||||
|
return "AIStateMachineThread<"STRIZE(THREAD_IMPL)">";
|
||||||
|
#undef STRIZE
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/*virtual*/ AIThreadImpl& impl(void) { return mThreadImpl; }
|
/*virtual*/ AIThreadImpl& impl(void) { return mThreadImpl; }
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -76,7 +76,11 @@ class AITimer : public AIStateMachine {
|
|||||||
F64 mInterval; //!< Input variable: interval after which the event will be generated, in seconds.
|
F64 mInterval; //!< Input variable: interval after which the event will be generated, in seconds.
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AITimer(void) : mInterval(0) { DoutEntering(dc::statemachine, "AITimer(void) [" << (void*)this << "]"); }
|
AITimer(CWD_ONLY(bool debug = false)) :
|
||||||
|
#ifdef CWDEBUG
|
||||||
|
AIStateMachine(debug),
|
||||||
|
#endif
|
||||||
|
mInterval(0) { DoutEntering(dc::statemachine(mSMDebug), "AITimer(void) [" << (void*)this << "]"); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set the interval after which the timer should expire.
|
* @brief Set the interval after which the timer should expire.
|
||||||
@@ -94,9 +98,11 @@ class AITimer : public AIStateMachine {
|
|||||||
*/
|
*/
|
||||||
F64 getInterval(void) const { return mInterval; }
|
F64 getInterval(void) const { return mInterval; }
|
||||||
|
|
||||||
|
/*virtual*/ const char* getName() const { return "AITimer"; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Call finish() (or abort()), not delete.
|
// Call finish() (or abort()), not delete.
|
||||||
/*virtual*/ ~AITimer() { DoutEntering(dc::statemachine, "~AITimer() [" << (void*)this << "]"); mFrameTimer.cancel(); }
|
/*virtual*/ ~AITimer() { DoutEntering(dc::statemachine(mSMDebug), "~AITimer() [" << (void*)this << "]"); mFrameTimer.cancel(); }
|
||||||
|
|
||||||
// Handle initializing the object.
|
// Handle initializing the object.
|
||||||
/*virtual*/ void initialize_impl(void);
|
/*virtual*/ void initialize_impl(void);
|
||||||
|
|||||||
@@ -12,11 +12,25 @@ include(Variables)
|
|||||||
|
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -DLL_DEBUG=1")
|
set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -DLL_DEBUG=1")
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE
|
set(CMAKE_CXX_FLAGS_RELEASE
|
||||||
"-DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 -D_SECURE_SCL=0 -DLL_SEND_CRASH_REPORTS=1 -DNDEBUG")
|
"-DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 -D_SECURE_SCL=0 -DNDEBUG")
|
||||||
set(CMAKE_C_FLAGS_RELEASE
|
set(CMAKE_C_FLAGS_RELEASE
|
||||||
"${CMAKE_CXX_FLAGS_RELEASE}")
|
"${CMAKE_CXX_FLAGS_RELEASE}")
|
||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
||||||
"-DLL_RELEASE=1 -D_SECURE_SCL=0 -DLL_SEND_CRASH_REPORTS=0 -DNDEBUG -DLL_RELEASE_WITH_DEBUG_INFO=1")
|
"-DLL_RELEASE=1 -D_SECURE_SCL=0 -DNDEBUG -DLL_RELEASE_WITH_DEBUG_INFO=1")
|
||||||
|
|
||||||
|
# Configure crash reporting
|
||||||
|
set(RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in release builds")
|
||||||
|
set(NON_RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in developer builds")
|
||||||
|
|
||||||
|
if(RELEASE_CRASH_REPORTING)
|
||||||
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DLL_SEND_CRASH_REPORTS=1")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NON_RELEASE_CRASH_REPORTING)
|
||||||
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DLL_SEND_CRASH_REPORTS=1")
|
||||||
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DLL_SEND_CRASH_REPORTS=1")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# Don't bother with a MinSizeRel build.
|
# Don't bother with a MinSizeRel build.
|
||||||
|
|
||||||
@@ -32,10 +46,17 @@ if (WINDOWS)
|
|||||||
set(MSVC_DIR 10.0)
|
set(MSVC_DIR 10.0)
|
||||||
set(MSVC_SUFFIX 100)
|
set(MSVC_SUFFIX 100)
|
||||||
endif (MSVC10)
|
endif (MSVC10)
|
||||||
|
if (MSVC11)
|
||||||
|
set(MSVC_DIR 11.0)
|
||||||
|
set(MSVC_SUFFIX 110)
|
||||||
|
endif (MSVC11)
|
||||||
|
|
||||||
# Remove default /Zm1000 flag that cmake inserts
|
# Remove default /Zm1000 flag that cmake inserts
|
||||||
string (REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
string (REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
|
|
||||||
|
# Always use /Zm140
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm140")
|
||||||
|
|
||||||
# Don't build DLLs.
|
# Don't build DLLs.
|
||||||
set(BUILD_SHARED_LIBS OFF)
|
set(BUILD_SHARED_LIBS OFF)
|
||||||
|
|
||||||
@@ -64,11 +85,17 @@ if (WINDOWS)
|
|||||||
/W3
|
/W3
|
||||||
/c
|
/c
|
||||||
/Zc:forScope
|
/Zc:forScope
|
||||||
/Zc:wchar_t-
|
/Zc:wchar_t-
|
||||||
/nologo
|
/nologo
|
||||||
/Oy-
|
/Oy-
|
||||||
/arch:SSE2
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# SSE2 is implied on win64
|
||||||
|
if(WORD_SIZE EQUAL 32)
|
||||||
|
add_definitions(/arch:SSE2)
|
||||||
|
else(WORD_SIZE EQUAL 32)
|
||||||
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4267 /wd4250 /wd4244")
|
||||||
|
endif(WORD_SIZE EQUAL 32)
|
||||||
|
|
||||||
# configure win32 API for windows XP+ compatibility
|
# configure win32 API for windows XP+ compatibility
|
||||||
set(WINVER "0x0501" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)")
|
set(WINVER "0x0501" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)")
|
||||||
@@ -103,7 +130,7 @@ if (LINUX)
|
|||||||
-pthread
|
-pthread
|
||||||
)
|
)
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -D_FORTIFY_SOURCE=2 ")
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ")
|
||||||
|
|
||||||
# Don't catch SIGCHLD in our base application class for the viewer
|
# Don't catch SIGCHLD in our base application class for the viewer
|
||||||
# some of our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh!
|
# some of our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh!
|
||||||
@@ -222,30 +249,28 @@ endif (LINUX)
|
|||||||
|
|
||||||
|
|
||||||
if (DARWIN)
|
if (DARWIN)
|
||||||
add_definitions(-DLL_DARWIN=1 -D_XOPEN_SOURCE)
|
add_definitions(-DLL_DARWIN=1)
|
||||||
set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first")
|
set(CMAKE_CXX_LINK_FLAGS "-Wl,-no_compact_unwind -Wl,-headerpad_max_install_names,-search_paths_first")
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}")
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}")
|
||||||
|
set(DARWIN_extra_cstar_flags "-g")
|
||||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags} -ftemplate-depth=256")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mlong-branch")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DARWIN_extra_cstar_flags}")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mlong-branch")
|
# NOTE: it's critical that the optimization flag is put in front.
|
||||||
# NOTE: it's critical that the optimization flag is put in front.
|
# NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered.
|
||||||
# NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered.
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -msse3 -mtune=generic -mfpmath=sse ${GCC_EXTRA_OPTIMIZATIONS}")
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
||||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -msse3 -mtune=generic -mfpmath=sse ${GCC_EXTRA_OPTIMIZATIONS}")
|
set(CMAKE_XCODE_ATTRIBUTE_CLANG_X86_VECTOR_INSTRUCTIONS SSE3)
|
||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3 -msse3 -mtune=generic -mfpmath=sse ${GCC_EXTRA_OPTIMIZATIONS}")
|
set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL -O3)
|
||||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O3 -msse3 -mtune=generic -mfpmath=sse ${GCC_EXTRA_OPTIMIZATIONS}")
|
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -msse3 ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
set(CMAKE_C_FLAGS_RELEASE "-O3 -msse3 ${CMAKE_C_FLAGS_RELEASE}")
|
||||||
# NOTE: it's critical that the optimization flag is put in front.
|
if (XCODE_VERSION GREATER 4.2)
|
||||||
# NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered.
|
set(ENABLE_SIGNING TRUE)
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -msse3")
|
set(SIGNING_IDENTITY "Developer ID Application: Linden Research, Inc.")
|
||||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -msse3")
|
endif (XCODE_VERSION GREATER 4.2)
|
||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3 -msse3")
|
|
||||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O3 -msse3")
|
|
||||||
endif()
|
|
||||||
endif (DARWIN)
|
endif (DARWIN)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (LINUX OR DARWIN)
|
if (LINUX OR DARWIN)
|
||||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
add_definitions(-DLL_GNUC=1)
|
add_definitions(-DLL_GNUC=1)
|
||||||
@@ -253,13 +278,11 @@ if (LINUX OR DARWIN)
|
|||||||
set(UNIX_CXX_WARNINGS "${UNIX_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor -Woverloaded-virtual")
|
set(UNIX_CXX_WARNINGS "${UNIX_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor -Woverloaded-virtual")
|
||||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||||
add_definitions(-DLL_CLANG=1)
|
add_definitions(-DLL_CLANG=1)
|
||||||
set(UNIX_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs -Wno-tautological-compare -Wno-char-subscripts -Wno-gnu -Wno-logical-op-parentheses -Wno-non-virtual-dtor")
|
set(UNIX_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs -Wno-tautological-compare -Wno-char-subscripts -Wno-gnu -Wno-logical-op-parentheses -Wno-logical-not-parentheses -Wno-non-virtual-dtor -Wno-deprecated")
|
||||||
set(UNIX_WARNINGS "${UNIX_WARNINGS} -Woverloaded-virtual -Wno-parentheses-equality -Wno-reorder -Wno-unused-function -Wno-unused-value -Wno-unused-variable")
|
set(UNIX_WARNINGS "${UNIX_WARNINGS} -Woverloaded-virtual -Wno-parentheses-equality -Wno-reorder -Wno-unused-function -Wno-unused-value -Wno-unused-variable -Wno-unused-private-field -Wno-parentheses")
|
||||||
set(UNIX_CXX_WARNINGS "${UNIX_WARNINGS}")
|
set(UNIX_CXX_WARNINGS "${UNIX_WARNINGS}")
|
||||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
|
||||||
add_definitions(-DLL_ICC=1)
|
add_definitions(-DLL_ICC=1)
|
||||||
set(UNIX_WARNINGS "-wd327 -wd597 -wd858")
|
|
||||||
set(UNIX_CXX_WARNINGS "${UNIX_WARNINGS}")
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (NOT DISABLE_FATAL_WARNINGS)
|
if (NOT DISABLE_FATAL_WARNINGS)
|
||||||
|
|||||||
@@ -8,34 +8,77 @@ if (STANDALONE)
|
|||||||
include(FindBoost)
|
include(FindBoost)
|
||||||
|
|
||||||
set(Boost_USE_MULTITHREADED ON)
|
set(Boost_USE_MULTITHREADED ON)
|
||||||
find_package(Boost 1.40.0 COMPONENTS date_time filesystem program_options regex system thread wave)
|
find_package(Boost 1.51.0 COMPONENTS date_time filesystem program_options regex system thread wave context)
|
||||||
else (STANDALONE)
|
else (STANDALONE)
|
||||||
use_prebuilt_binary(boost)
|
use_prebuilt_binary(boost)
|
||||||
set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
|
set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
|
||||||
|
set(Boost_VERSION "1.52")
|
||||||
|
|
||||||
if (WINDOWS)
|
if (WINDOWS)
|
||||||
set(BOOST_VERSION 1_45)
|
set(Boost_CONTEXT_LIBRARY
|
||||||
set(BOOST_OPTIM_SUFFIX mt)
|
optimized libboost_context-mt
|
||||||
set(BOOST_DEBUG_SUFFIX mt-gd)
|
debug libboost_context-mt-gd)
|
||||||
|
set(Boost_FILESYSTEM_LIBRARY
|
||||||
|
optimized libboost_filesystem-mt
|
||||||
|
debug libboost_filesystem-mt-gd)
|
||||||
set(Boost_PROGRAM_OPTIONS_LIBRARY
|
set(Boost_PROGRAM_OPTIONS_LIBRARY
|
||||||
optimized libboost_program_options-vc${MSVC_SUFFIX}-${BOOST_OPTIM_SUFFIX}-${BOOST_VERSION}
|
optimized libboost_program_options-mt
|
||||||
debug libboost_program_options-vc${MSVC_SUFFIX}-${BOOST_DEBUG_SUFFIX}-${BOOST_VERSION})
|
debug libboost_program_options-mt-gd)
|
||||||
set(Boost_REGEX_LIBRARY
|
set(Boost_REGEX_LIBRARY
|
||||||
optimized libboost_regex-vc${MSVC_SUFFIX}-${BOOST_OPTIM_SUFFIX}-${BOOST_VERSION}
|
optimized libboost_regex-mt
|
||||||
debug libboost_regex-vc${MSVC_SUFFIX}-${BOOST_DEBUG_SUFFIX}-${BOOST_VERSION})
|
debug libboost_regex-mt-gd)
|
||||||
|
set(Boost_SIGNALS_LIBRARY
|
||||||
elseif (DARWIN)
|
optimized libboost_signals-mt
|
||||||
set(Boost_FILESYSTEM_LIBRARY boost_filesystem)
|
debug libboost_signals-mt-gd)
|
||||||
set(Boost_PROGRAM_OPTIONS_LIBRARY boost_program_options)
|
set(Boost_SYSTEM_LIBRARY
|
||||||
set(Boost_REGEX_LIBRARY boost_regex)
|
optimized libboost_system-mt
|
||||||
set(Boost_SYSTEM_LIBRARY boost_system)
|
debug libboost_system-mt-gd)
|
||||||
set(Boost_DATE_TIME_LIBRARY boost_date_time)
|
set(Boost_THREAD_LIBRARY
|
||||||
|
optimized libboost_thread-mt
|
||||||
|
debug libboost_thread-mt-gd)
|
||||||
elseif (LINUX)
|
elseif (LINUX)
|
||||||
set(Boost_FILESYSTEM_LIBRARY boost_filesystem-mt)
|
set(Boost_CONTEXT_LIBRARY
|
||||||
set(Boost_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt)
|
optimized boost_context-mt
|
||||||
set(Boost_REGEX_LIBRARY boost_regex-mt)
|
debug boost_context-mt-d)
|
||||||
set(Boost_SYSTEM_LIBRARY boost_system-mt)
|
set(Boost_FILESYSTEM_LIBRARY
|
||||||
set(Boost_DATE_TIME_LIBRARY boost_date_time-mt)
|
optimized boost_filesystem-mt
|
||||||
|
debug boost_filesystem-mt-d)
|
||||||
|
set(Boost_PROGRAM_OPTIONS_LIBRARY
|
||||||
|
optimized boost_program_options-mt
|
||||||
|
debug boost_program_options-mt-d)
|
||||||
|
set(Boost_REGEX_LIBRARY
|
||||||
|
optimized boost_regex-mt
|
||||||
|
debug boost_regex-mt-d)
|
||||||
|
set(Boost_SIGNALS_LIBRARY
|
||||||
|
optimized boost_signals-mt
|
||||||
|
debug boost_signals-mt-d)
|
||||||
|
set(Boost_SYSTEM_LIBRARY
|
||||||
|
optimized boost_system-mt
|
||||||
|
debug boost_system-mt-d)
|
||||||
|
set(Boost_THREAD_LIBRARY
|
||||||
|
optimized boost_thread-mt
|
||||||
|
debug boost_thread-mt-d)
|
||||||
|
elseif (DARWIN)
|
||||||
|
set(Boost_CONTEXT_LIBRARY
|
||||||
|
optimized boost_context-mt
|
||||||
|
debug boost_context-mt-d)
|
||||||
|
set(Boost_FILESYSTEM_LIBRARY
|
||||||
|
optimized boost_filesystem-mt
|
||||||
|
debug boost_filesystem-mt-d)
|
||||||
|
set(Boost_PROGRAM_OPTIONS_LIBRARY
|
||||||
|
optimized boost_program_options-mt
|
||||||
|
debug boost_program_options-mt-d)
|
||||||
|
set(Boost_REGEX_LIBRARY
|
||||||
|
optimized boost_regex-mt
|
||||||
|
debug boost_regex-mt-d)
|
||||||
|
set(Boost_SIGNALS_LIBRARY
|
||||||
|
optimized boost_signals-mt
|
||||||
|
debug boost_signals-mt-d)
|
||||||
|
set(Boost_SYSTEM_LIBRARY
|
||||||
|
optimized boost_system-mt
|
||||||
|
debug boost_system-mt-d)
|
||||||
|
set(Boost_THREAD_LIBRARY
|
||||||
|
optimized boost_thread-mt
|
||||||
|
debug boost_thread-mt-d)
|
||||||
endif (WINDOWS)
|
endif (WINDOWS)
|
||||||
endif (STANDALONE)
|
endif (STANDALONE)
|
||||||
|
|||||||
@@ -33,6 +33,48 @@ configure_file(
|
|||||||
${CMAKE_SOURCE_DIR}/llcommon/llversionviewer.h
|
${CMAKE_SOURCE_DIR}/llcommon/llversionviewer.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (WINDOWS)
|
||||||
|
configure_file(
|
||||||
|
${CMAKE_SOURCE_DIR}/newview/res/viewerRes.rc.in
|
||||||
|
${CMAKE_SOURCE_DIR}/newview/res/viewerRes.rc
|
||||||
|
)
|
||||||
|
|
||||||
|
configure_file(
|
||||||
|
${CMAKE_SOURCE_DIR}/newview/res/viewerRes_bc.rc.in
|
||||||
|
${CMAKE_SOURCE_DIR}/newview/res/viewerRes_bc.rc
|
||||||
|
)
|
||||||
|
endif (WINDOWS)
|
||||||
|
|
||||||
|
if (DARWIN)
|
||||||
|
configure_file(
|
||||||
|
${CMAKE_SOURCE_DIR}/newview/English.lproj/InfoPlist.strings.in
|
||||||
|
${CMAKE_SOURCE_DIR}/newview/English.lproj/InfoPlist.strings
|
||||||
|
)
|
||||||
|
endif (DARWIN)
|
||||||
|
|
||||||
|
if (LINUX)
|
||||||
|
configure_file(
|
||||||
|
${CMAKE_SOURCE_DIR}/newview/linux_tools/wrapper.sh.in
|
||||||
|
${CMAKE_SOURCE_DIR}/newview/linux_tools/wrapper.sh
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
configure_file(
|
||||||
|
${CMAKE_SOURCE_DIR}/newview/linux_tools/handle_secondlifeprotocol.sh.in
|
||||||
|
${CMAKE_SOURCE_DIR}/newview/linux_tools/handle_secondlifeprotocol.sh
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
configure_file(
|
||||||
|
${CMAKE_SOURCE_DIR}/newview/linux_tools/install.sh.in
|
||||||
|
${CMAKE_SOURCE_DIR}/newview/linux_tools/install.sh
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
configure_file(
|
||||||
|
${CMAKE_SOURCE_DIR}/newview/linux_tools/refresh_desktop_app_entry.sh.in
|
||||||
|
${CMAKE_SOURCE_DIR}/newview/linux_tools/refresh_desktop_app_entry.sh
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
endif (LINUX)
|
||||||
|
|
||||||
# Compose the version.
|
# Compose the version.
|
||||||
set(viewer_VERSION "${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}")
|
set(viewer_VERSION "${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}")
|
||||||
if (viewer_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$")
|
if (viewer_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$")
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ set(cmake_SOURCE_FILES
|
|||||||
FindColladadom.cmake
|
FindColladadom.cmake
|
||||||
FindELFIO.cmake
|
FindELFIO.cmake
|
||||||
FindGLOD.cmake
|
FindGLOD.cmake
|
||||||
|
FindGoogleBreakpad.cmake
|
||||||
FindGooglePerfTools.cmake
|
FindGooglePerfTools.cmake
|
||||||
FindHunSpell.cmake
|
FindHunSpell.cmake
|
||||||
FindJsonCpp.cmake
|
FindJsonCpp.cmake
|
||||||
@@ -50,6 +51,7 @@ set(cmake_SOURCE_FILES
|
|||||||
GStreamer010Plugin.cmake
|
GStreamer010Plugin.cmake
|
||||||
Glui.cmake
|
Glui.cmake
|
||||||
Glut.cmake
|
Glut.cmake
|
||||||
|
GoogleBreakpad.cmake
|
||||||
GooglePerfTools.cmake
|
GooglePerfTools.cmake
|
||||||
Hunspell.cmake
|
Hunspell.cmake
|
||||||
JPEG.cmake
|
JPEG.cmake
|
||||||
@@ -59,7 +61,6 @@ set(cmake_SOURCE_FILES
|
|||||||
LLAudio.cmake
|
LLAudio.cmake
|
||||||
LLCharacter.cmake
|
LLCharacter.cmake
|
||||||
LLCommon.cmake
|
LLCommon.cmake
|
||||||
LLCrashLogger.cmake
|
|
||||||
LLImage.cmake
|
LLImage.cmake
|
||||||
LLImageJ2COJ.cmake
|
LLImageJ2COJ.cmake
|
||||||
LLInventory.cmake
|
LLInventory.cmake
|
||||||
@@ -69,6 +70,7 @@ set(cmake_SOURCE_FILES
|
|||||||
LLPlugin.cmake
|
LLPlugin.cmake
|
||||||
LLPrimitive.cmake
|
LLPrimitive.cmake
|
||||||
LLPhysicsExtensions.cmake
|
LLPhysicsExtensions.cmake
|
||||||
|
LLSharedLibs.cmake
|
||||||
LLQtWebkit.cmake
|
LLQtWebkit.cmake
|
||||||
LLRender.cmake
|
LLRender.cmake
|
||||||
LLUI.cmake
|
LLUI.cmake
|
||||||
@@ -79,6 +81,7 @@ set(cmake_SOURCE_FILES
|
|||||||
Linking.cmake
|
Linking.cmake
|
||||||
MediaPluginBase.cmake
|
MediaPluginBase.cmake
|
||||||
NDOF.cmake
|
NDOF.cmake
|
||||||
|
NVAPI.cmake
|
||||||
OPENAL.cmake
|
OPENAL.cmake
|
||||||
OpenGL.cmake
|
OpenGL.cmake
|
||||||
OpenJPEG.cmake
|
OpenJPEG.cmake
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ if (STANDALONE)
|
|||||||
else (STANDALONE)
|
else (STANDALONE)
|
||||||
use_prebuilt_binary(colladadom)
|
use_prebuilt_binary(colladadom)
|
||||||
|
|
||||||
if (NOT WINDOWS)
|
if (NOT WINDOWS AND NOT LINUX)
|
||||||
use_prebuilt_binary(pcre)
|
use_prebuilt_binary(pcre)
|
||||||
endif (NOT WINDOWS)
|
endif (NOT WINDOWS AND NOT LINUX)
|
||||||
|
|
||||||
if (NOT DARWIN AND NOT WINDOWS)
|
if (NOT DARWIN AND NOT WINDOWS)
|
||||||
use_prebuilt_binary(libxml)
|
use_prebuilt_binary(libxml)
|
||||||
@@ -28,18 +28,12 @@ else (STANDALONE)
|
|||||||
set(COLLADADOM_LIBRARIES
|
set(COLLADADOM_LIBRARIES
|
||||||
debug libcollada14dom22-d
|
debug libcollada14dom22-d
|
||||||
optimized libcollada14dom22
|
optimized libcollada14dom22
|
||||||
debug libboost_filesystem-vc100-mt-gd-1_45.lib
|
|
||||||
optimized libboost_filesystem-vc100-mt-1_45.lib
|
|
||||||
debug libboost_system-vc100-mt-gd-1_45.lib
|
|
||||||
optimized libboost_system-vc100-mt-1_45.lib
|
|
||||||
)
|
)
|
||||||
else (WINDOWS)
|
else (WINDOWS)
|
||||||
set(COLLADADOM_LIBRARIES
|
set(COLLADADOM_LIBRARIES
|
||||||
collada14dom
|
collada14dom
|
||||||
minizip
|
minizip
|
||||||
xml2
|
xml2
|
||||||
pcrecpp
|
|
||||||
pcre
|
|
||||||
)
|
)
|
||||||
endif (WINDOWS)
|
endif (WINDOWS)
|
||||||
endif (STANDALONE)
|
endif (STANDALONE)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ IF("$ENV{PKG_CONFIG_LIBDIR}" STREQUAL "")
|
|||||||
else (WORD_SIZE EQUAL 32)
|
else (WORD_SIZE EQUAL 32)
|
||||||
SET(PKG_CONFIG_NO_MULTI_GUESS /usr/lib64 /usr/lib)
|
SET(PKG_CONFIG_NO_MULTI_GUESS /usr/lib64 /usr/lib)
|
||||||
SET(PKG_CONFIG_NO_MULTI_LOCAL_GUESS /usr/local/lib64 /usr/local/lib)
|
SET(PKG_CONFIG_NO_MULTI_LOCAL_GUESS /usr/local/lib64 /usr/local/lib)
|
||||||
SET(PKG_CONFIG_MULTI_GUESS /usr/local/lib/x86_64-linux-gnu)
|
SET(PKG_CONFIG_MULTI_GUESS /usr/lib/x86_64-linux-gnu)
|
||||||
SET(PKG_CONFIG_MULTI_LOCAL_GUESS /usr/local/lib/x86_64-linux-gnu)
|
SET(PKG_CONFIG_MULTI_LOCAL_GUESS /usr/local/lib/x86_64-linux-gnu)
|
||||||
endif (WORD_SIZE EQUAL 32)
|
endif (WORD_SIZE EQUAL 32)
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,24 @@
|
|||||||
|
|
||||||
include(CMakeCopyIfDifferent)
|
include(CMakeCopyIfDifferent)
|
||||||
|
|
||||||
|
if(WORD_SIZE EQUAL 32)
|
||||||
|
set(debug_libs_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug")
|
||||||
|
set(release_libs_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release")
|
||||||
|
else(WORD_SIZE EQUAL 32)
|
||||||
|
set(debug_libs_dir "${CMAKE_SOURCE_DIR}/../libraries/x86_64-win/lib/debug")
|
||||||
|
set(release_libs_dir "${CMAKE_SOURCE_DIR}/../libraries/x86_64-win/lib/release")
|
||||||
|
endif(WORD_SIZE EQUAL 32)
|
||||||
|
|
||||||
set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-win32")
|
set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-win32")
|
||||||
set(vivox_files
|
set(vivox_files
|
||||||
SLVoice.exe
|
ca-bundle.crt
|
||||||
alut.dll
|
libsndfile-1.dll
|
||||||
vivoxsdk.dll
|
|
||||||
ortp.dll
|
ortp.dll
|
||||||
wrap_oal.dll
|
SLVoice.exe
|
||||||
|
vivoxoal.dll
|
||||||
|
vivoxplatform.dll
|
||||||
|
vivoxsdk.dll
|
||||||
|
zlib1.dll
|
||||||
)
|
)
|
||||||
copy_if_different(
|
copy_if_different(
|
||||||
${vivox_src_dir}
|
${vivox_src_dir}
|
||||||
@@ -23,7 +34,7 @@ copy_if_different(
|
|||||||
set(all_targets ${all_targets} ${out_targets})
|
set(all_targets ${all_targets} ${out_targets})
|
||||||
|
|
||||||
|
|
||||||
set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug")
|
set(debug_src_dir "${debug_libs_dir}")
|
||||||
set(debug_files
|
set(debug_files
|
||||||
libhunspell.dll
|
libhunspell.dll
|
||||||
libapr-1.dll
|
libapr-1.dll
|
||||||
@@ -44,7 +55,7 @@ copy_if_different(
|
|||||||
set(all_targets ${all_targets} ${out_targets})
|
set(all_targets ${all_targets} ${out_targets})
|
||||||
|
|
||||||
# Debug config runtime files required for the plugin test mule
|
# Debug config runtime files required for the plugin test mule
|
||||||
set(plugintest_debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug")
|
set(plugintest_debug_src_dir "${debug_libs_dir}")
|
||||||
set(plugintest_debug_files
|
set(plugintest_debug_files
|
||||||
libeay32.dll
|
libeay32.dll
|
||||||
qtcored4.dll
|
qtcored4.dll
|
||||||
@@ -63,7 +74,7 @@ copy_if_different(
|
|||||||
set(all_targets ${all_targets} ${out_targets})
|
set(all_targets ${all_targets} ${out_targets})
|
||||||
|
|
||||||
# Debug config runtime files required for the plugin test mule (Qt image format plugins)
|
# Debug config runtime files required for the plugin test mule (Qt image format plugins)
|
||||||
set(plugintest_debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug/imageformats")
|
set(plugintest_debug_src_dir "${debug_libs_dir}/imageformats")
|
||||||
set(plugintest_debug_files
|
set(plugintest_debug_files
|
||||||
qgifd4.dll
|
qgifd4.dll
|
||||||
qicod4.dll
|
qicod4.dll
|
||||||
@@ -89,7 +100,7 @@ copy_if_different(
|
|||||||
set(all_targets ${all_targets} ${out_targets})
|
set(all_targets ${all_targets} ${out_targets})
|
||||||
|
|
||||||
# Release & ReleaseDebInfo config runtime files required for the plugin test mule
|
# Release & ReleaseDebInfo config runtime files required for the plugin test mule
|
||||||
set(plugintest_release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release")
|
set(plugintest_release_src_dir "${release_libs_dir}")
|
||||||
set(plugintest_release_files
|
set(plugintest_release_files
|
||||||
libeay32.dll
|
libeay32.dll
|
||||||
qtcore4.dll
|
qtcore4.dll
|
||||||
@@ -116,7 +127,7 @@ copy_if_different(
|
|||||||
set(all_targets ${all_targets} ${out_targets})
|
set(all_targets ${all_targets} ${out_targets})
|
||||||
|
|
||||||
# Release & ReleaseDebInfo config runtime files required for the plugin test mule (Qt image format plugins)
|
# Release & ReleaseDebInfo config runtime files required for the plugin test mule (Qt image format plugins)
|
||||||
set(plugintest_release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release/imageformats")
|
set(plugintest_release_src_dir "${release_libs_dir}/imageformats")
|
||||||
set(plugintest_release_files
|
set(plugintest_release_files
|
||||||
qgif4.dll
|
qgif4.dll
|
||||||
qico4.dll
|
qico4.dll
|
||||||
@@ -158,7 +169,7 @@ copy_if_different(
|
|||||||
set(all_targets ${all_targets} ${out_targets})
|
set(all_targets ${all_targets} ${out_targets})
|
||||||
|
|
||||||
# Debug config runtime files required for the plugins
|
# Debug config runtime files required for the plugins
|
||||||
set(plugins_debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug")
|
set(plugins_debug_src_dir "${debug_libs_dir}")
|
||||||
set(plugins_debug_files
|
set(plugins_debug_files
|
||||||
libeay32.dll
|
libeay32.dll
|
||||||
qtcored4.dll
|
qtcored4.dll
|
||||||
@@ -177,7 +188,7 @@ copy_if_different(
|
|||||||
set(all_targets ${all_targets} ${out_targets})
|
set(all_targets ${all_targets} ${out_targets})
|
||||||
|
|
||||||
# Release & ReleaseDebInfo config runtime files required for the plugins
|
# Release & ReleaseDebInfo config runtime files required for the plugins
|
||||||
set(plugins_release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release")
|
set(plugins_release_src_dir "${release_libs_dir}")
|
||||||
set(plugins_release_files
|
set(plugins_release_files
|
||||||
libeay32.dll
|
libeay32.dll
|
||||||
qtcore4.dll
|
qtcore4.dll
|
||||||
@@ -203,9 +214,9 @@ copy_if_different(
|
|||||||
)
|
)
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
set(all_targets ${all_targets} ${out_targets})
|
||||||
|
|
||||||
set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release")
|
|
||||||
|
set(release_src_dir "${release_libs_dir}")
|
||||||
set(release_files
|
set(release_files
|
||||||
libtcmalloc_minimal.dll
|
|
||||||
libhunspell.dll
|
libhunspell.dll
|
||||||
libapr-1.dll
|
libapr-1.dll
|
||||||
libaprutil-1.dll
|
libaprutil-1.dll
|
||||||
@@ -216,8 +227,21 @@ set(release_files
|
|||||||
glod.dll
|
glod.dll
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(WORD_SIZE EQUAL 32)
|
||||||
|
set(release_files ${release_files}
|
||||||
|
libtcmalloc_minimal.dll
|
||||||
|
)
|
||||||
|
endif(WORD_SIZE EQUAL 32)
|
||||||
|
|
||||||
|
|
||||||
if(FMODEX)
|
if(FMODEX)
|
||||||
find_path(FMODEX_BINARY_DIR fmodex.dll
|
if (WORD_SIZE EQUAL 32)
|
||||||
|
set(fmodex_dll_file "fmodex.dll")
|
||||||
|
else (WORD_SIZE EQUAL 32)
|
||||||
|
set(fmodex_dll_file "fmodex64.dll")
|
||||||
|
endif (WORD_SIZE EQUAL 32)
|
||||||
|
|
||||||
|
find_path(FMODEX_BINARY_DIR "${fmodex_dll_file}"
|
||||||
"${release_src_dir}"
|
"${release_src_dir}"
|
||||||
"${FMODEX_SDK_DIR}/api"
|
"${FMODEX_SDK_DIR}/api"
|
||||||
"${FMODEX_SDK_DIR}"
|
"${FMODEX_SDK_DIR}"
|
||||||
@@ -225,11 +249,11 @@ if(FMODEX)
|
|||||||
)
|
)
|
||||||
|
|
||||||
if(FMODEX_BINARY_DIR)
|
if(FMODEX_BINARY_DIR)
|
||||||
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Release" out_targets fmodex.dll)
|
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Release" out_targets "${fmodex_dll_file}")
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
set(all_targets ${all_targets} ${out_targets})
|
||||||
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo" out_targets fmodex.dll)
|
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo" out_targets "${fmodex_dll_file}")
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
set(all_targets ${all_targets} ${out_targets})
|
||||||
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Debug" out_targets fmodex.dll)
|
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Debug" out_targets "${fmodex_dll_file}")
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
set(all_targets ${all_targets} ${out_targets})
|
||||||
endif(FMODEX_BINARY_DIR)
|
endif(FMODEX_BINARY_DIR)
|
||||||
endif(FMODEX)
|
endif(FMODEX)
|
||||||
@@ -285,105 +309,6 @@ copy_if_different(
|
|||||||
)
|
)
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
set(all_targets ${all_targets} ${out_targets})
|
||||||
|
|
||||||
# Copy MS C runtime dlls, required for packaging.
|
|
||||||
# *TODO - Adapt this to support VC9
|
|
||||||
if (MSVC80)
|
|
||||||
FIND_PATH(debug_msvc8_redist_path msvcr80d.dll
|
|
||||||
PATHS
|
|
||||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC80.DebugCRT
|
|
||||||
NO_DEFAULT_PATH
|
|
||||||
NO_DEFAULT_PATH
|
|
||||||
)
|
|
||||||
|
|
||||||
if(EXISTS ${debug_msvc8_redist_path})
|
|
||||||
set(debug_msvc8_files
|
|
||||||
msvcr80d.dll
|
|
||||||
msvcp80d.dll
|
|
||||||
Microsoft.VC80.DebugCRT.manifest
|
|
||||||
)
|
|
||||||
|
|
||||||
copy_if_different(
|
|
||||||
${debug_msvc8_redist_path}
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/Debug"
|
|
||||||
out_targets
|
|
||||||
${debug_msvc8_files}
|
|
||||||
)
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
|
|
||||||
set(debug_appconfig_file ${CMAKE_CURRENT_BINARY_DIR}/Debug/${VIEWER_BINARY_NAME}.exe.config)
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT ${debug_appconfig_file}
|
|
||||||
COMMAND ${PYTHON_EXECUTABLE}
|
|
||||||
ARGS
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/build_win32_appConfig.py
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/Debug/Microsoft.VC80.DebugCRT.manifest
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/SecondLifeDebug.exe.config
|
|
||||||
${debug_appconfig_file}
|
|
||||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Debug/Microsoft.VC80.DebugCRT.manifest
|
|
||||||
COMMENT "Creating debug app config file"
|
|
||||||
)
|
|
||||||
|
|
||||||
endif (EXISTS ${debug_msvc8_redist_path})
|
|
||||||
|
|
||||||
FIND_PATH(release_msvc8_redist_path msvcr80.dll
|
|
||||||
PATHS
|
|
||||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC80.CRT
|
|
||||||
NO_DEFAULT_PATH
|
|
||||||
NO_DEFAULT_PATH
|
|
||||||
)
|
|
||||||
|
|
||||||
if(EXISTS ${release_msvc8_redist_path})
|
|
||||||
set(release_msvc8_files
|
|
||||||
msvcr80.dll
|
|
||||||
msvcp80.dll
|
|
||||||
Microsoft.VC80.CRT.manifest
|
|
||||||
)
|
|
||||||
|
|
||||||
copy_if_different(
|
|
||||||
${release_msvc8_redist_path}
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/Release"
|
|
||||||
out_targets
|
|
||||||
${release_msvc8_files}
|
|
||||||
)
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
|
|
||||||
copy_if_different(
|
|
||||||
${release_msvc8_redist_path}
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo"
|
|
||||||
out_targets
|
|
||||||
${release_msvc8_files}
|
|
||||||
)
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
|
|
||||||
set(release_appconfig_file ${CMAKE_CURRENT_BINARY_DIR}/Release/${VIEWER_BINARY_NAME}.exe.config)
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT ${release_appconfig_file}
|
|
||||||
COMMAND ${PYTHON_EXECUTABLE}
|
|
||||||
ARGS
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/build_win32_appConfig.py
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/Release/Microsoft.VC80.CRT.manifest
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/SecondLife.exe.config
|
|
||||||
${release_appconfig_file}
|
|
||||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Release/Microsoft.VC80.CRT.manifest
|
|
||||||
COMMENT "Creating release app config file"
|
|
||||||
)
|
|
||||||
|
|
||||||
set(relwithdebinfo_appconfig_file ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/${VIEWER_BINARY_NAME}.exe.config)
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT ${relwithdebinfo_appconfig_file}
|
|
||||||
COMMAND ${PYTHON_EXECUTABLE}
|
|
||||||
ARGS
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/build_win32_appConfig.py
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/Microsoft.VC80.CRT.manifest
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/SecondLife.exe.config
|
|
||||||
${relwithdebinfo_appconfig_file}
|
|
||||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/Microsoft.VC80.CRT.manifest
|
|
||||||
COMMENT "Creating relwithdebinfo app config file"
|
|
||||||
)
|
|
||||||
|
|
||||||
endif (EXISTS ${release_msvc8_redist_path})
|
|
||||||
endif (MSVC80)
|
|
||||||
|
|
||||||
add_custom_target(copy_win_libs ALL
|
add_custom_target(copy_win_libs ALL
|
||||||
DEPENDS
|
DEPENDS
|
||||||
${all_targets}
|
${all_targets}
|
||||||
|
|||||||
@@ -44,10 +44,15 @@ if (WINDOWS)
|
|||||||
"$ENV{ProgramFiles(x86)}/Windows Kits/8.0"
|
"$ENV{ProgramFiles(x86)}/Windows Kits/8.0"
|
||||||
)
|
)
|
||||||
|
|
||||||
if (WIN_KIT_ROOT_DIR)
|
find_path (WIN_KIT_LIB_DIR dxguid.lib
|
||||||
|
"${WIN_KIT_ROOT_DIR}/Lib/winv6.3/um/${DIRECTX_ARCHITECTURE}"
|
||||||
|
"${WIN_KIT_ROOT_DIR}/Lib/Win8/um/${DIRECTX_ARCHITECTURE}"
|
||||||
|
)
|
||||||
|
|
||||||
|
if (WIN_KIT_ROOT_DIR AND WIN_KIT_LIB_DIR)
|
||||||
set (DIRECTX_INCLUDE_DIR "${WIN_KIT_ROOT_DIR}/Include/um" "${WIN_KIT_ROOT_DIR}/Include/shared")
|
set (DIRECTX_INCLUDE_DIR "${WIN_KIT_ROOT_DIR}/Include/um" "${WIN_KIT_ROOT_DIR}/Include/shared")
|
||||||
set (DIRECTX_LIBRARY_DIR "${WIN_KIT_ROOT_DIR}/Lib/Win8/um/${DIRECTX_ARCHITECTURE}")
|
set (DIRECTX_LIBRARY_DIR "${WIN_KIT_LIB_DIR}")
|
||||||
endif (WIN_KIT_ROOT_DIR)
|
endif (WIN_KIT_ROOT_DIR AND WIN_KIT_LIB_DIR)
|
||||||
endif (DIRECTX_ROOT_DIR)
|
endif (DIRECTX_ROOT_DIR)
|
||||||
|
|
||||||
if (DIRECTX_INCLUDE_DIR)
|
if (DIRECTX_INCLUDE_DIR)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ if (NOT FMODEX_LIBRARY)
|
|||||||
)
|
)
|
||||||
elseif(WORD_SIZE EQUAL 64)
|
elseif(WORD_SIZE EQUAL 64)
|
||||||
find_library(FMODEX_LIBRARY
|
find_library(FMODEX_LIBRARY
|
||||||
fmodex64 fmodexL64
|
fmodex64_vc fmodexL64_vc fmodex64 fmodexL64
|
||||||
PATHS
|
PATHS
|
||||||
"${FMODEX_SDK_DIR}/api/lib"
|
"${FMODEX_SDK_DIR}/api/lib"
|
||||||
"${FMODEX_SDK_DIR}/api"
|
"${FMODEX_SDK_DIR}/api"
|
||||||
@@ -25,21 +25,31 @@ if (NOT FMODEX_LIBRARY)
|
|||||||
)
|
)
|
||||||
endif(WORD_SIZE EQUAL 32)
|
endif(WORD_SIZE EQUAL 32)
|
||||||
endif(FMODEX_SDK_DIR)
|
endif(FMODEX_SDK_DIR)
|
||||||
if(WINDOWS AND NOT FMODEX_LIBRARY)
|
if(WINDOWS AND NOT FMODEX_SDK_DIR)
|
||||||
set(FMODEX_PROG_DIR "$ENV{PROGRAMFILES}/FMOD SoundSystem/FMOD Programmers API Windows")
|
GET_FILENAME_COMPONENT(FMODEX_PROG_DIR [HKEY_CURRENT_USER\\Software\\FMOD\ Programmers\ API\ Windows] ABSOLUTE CACHE)
|
||||||
find_library(FMODEX_LIBRARY
|
if(WORD_SIZE EQUAL 32)
|
||||||
fmodex_vc fmodexL_vc
|
find_library(FMODEX_LIBRARY
|
||||||
PATHS
|
fmodex_vc fmodexL_vc
|
||||||
"${FMODEX_PROG_DIR}/api/lib"
|
PATHS
|
||||||
"${FMODEX_PROG_DIR}/api"
|
"${FMODEX_PROG_DIR}/api/lib"
|
||||||
"${FMODEX_PROG_DIR}"
|
"${FMODEX_PROG_DIR}/api"
|
||||||
)
|
"${FMODEX_PROG_DIR}"
|
||||||
|
)
|
||||||
|
else(WORD_SIZE EQUAL 32)
|
||||||
|
find_library(FMODEX_LIBRARY
|
||||||
|
fmodex64_vc fmodexL64_vc
|
||||||
|
PATHS
|
||||||
|
"${FMODEX_PROG_DIR}/api/lib"
|
||||||
|
"${FMODEX_PROG_DIR}/api"
|
||||||
|
"${FMODEX_PROG_DIR}"
|
||||||
|
)
|
||||||
|
endif(WORD_SIZE EQUAL 32)
|
||||||
if(FMODEX_LIBRARY)
|
if(FMODEX_LIBRARY)
|
||||||
message(STATUS "Found fmodex in ${FMODEX_PROG_DIR}")
|
message(STATUS "Found fmodex in ${FMODEX_PROG_DIR}")
|
||||||
set(FMODEX_SDK_DIR "${FMODEX_PROG_DIR}")
|
set(FMODEX_SDK_DIR "${FMODEX_PROG_DIR}")
|
||||||
set(FMODEX_SDK_DIR "${FMODEX_PROG_DIR}" CACHE PATH "Path to the FMOD Ex SDK." FORCE)
|
set(FMODEX_SDK_DIR "${FMODEX_PROG_DIR}" CACHE PATH "Path to the FMOD Ex SDK." FORCE)
|
||||||
endif(FMODEX_LIBRARY)
|
endif(FMODEX_LIBRARY)
|
||||||
endif(WINDOWS AND NOT FMODEX_LIBRARY)
|
endif(WINDOWS AND NOT FMODEX_SDK_DIR)
|
||||||
endif (NOT FMODEX_LIBRARY)
|
endif (NOT FMODEX_LIBRARY)
|
||||||
|
|
||||||
find_path(FMODEX_INCLUDE_DIR fmod.hpp
|
find_path(FMODEX_INCLUDE_DIR fmod.hpp
|
||||||
|
|||||||
40
indra/cmake/FindGoogleBreakpad.cmake
Normal file
40
indra/cmake/FindGoogleBreakpad.cmake
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
# -*- cmake -*-
|
||||||
|
|
||||||
|
# - Find Google BreakPad
|
||||||
|
# Find the Google BreakPad includes and library
|
||||||
|
# This module defines
|
||||||
|
# BREAKPAD_INCLUDE_DIRECTORIES, where to find the Goole BreakPad includes.
|
||||||
|
# BREAKPAD_EXCEPTION_HANDLER_LIBRARIES, the libraries needed to use Google BreakPad.
|
||||||
|
# BREAKPAD_EXCEPTION_HANDLER_FOUND, If false, do not try to use Google BreakPad.
|
||||||
|
# also defined, but not for general use are
|
||||||
|
# BREAKPAD_EXCEPTION_HANDLER_LIBRARY, where to find the Google BreakPad library.
|
||||||
|
|
||||||
|
FIND_PATH(BREAKPAD_INCLUDE_DIRECTORIES common/using_std_string.h PATH_SUFFIXES google_breakpad)
|
||||||
|
|
||||||
|
SET(BREAKPAD_EXCEPTION_HANDLER_NAMES ${BREAKPAD_EXCEPTION_HANDLER_NAMES} breakpad_client)
|
||||||
|
FIND_LIBRARY(BREAKPAD_EXCEPTION_HANDLER_LIBRARY
|
||||||
|
NAMES ${BREAKPAD_EXCEPTION_HANDLER_NAMES}
|
||||||
|
)
|
||||||
|
|
||||||
|
IF (BREAKPAD_EXCEPTION_HANDLER_LIBRARY AND BREAKPAD_INCLUDE_DIRECTORIES)
|
||||||
|
SET(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES ${BREAKPAD_EXCEPTION_HANDLER_LIBRARY})
|
||||||
|
SET(BREAKPAD_EXCEPTION_HANDLER_FOUND "YES")
|
||||||
|
ELSE (BREAKPAD_EXCEPTION_HANDLER_LIBRARY AND BREAKPAD_INCLUDE_DIRECTORIES)
|
||||||
|
SET(BREAKPAD_EXCEPTION_HANDLER_FOUND "NO")
|
||||||
|
ENDIF (BREAKPAD_EXCEPTION_HANDLER_LIBRARY AND BREAKPAD_INCLUDE_DIRECTORIES)
|
||||||
|
|
||||||
|
|
||||||
|
IF (BREAKPAD_EXCEPTION_HANDLER_FOUND)
|
||||||
|
IF (NOT BREAKPAD_EXCEPTION_HANDLER_FIND_QUIETLY)
|
||||||
|
MESSAGE(STATUS "Found Google BreakPad: ${BREAKPAD_EXCEPTION_HANDLER_LIBRARIES}")
|
||||||
|
ENDIF (NOT BREAKPAD_EXCEPTION_HANDLER_FIND_QUIETLY)
|
||||||
|
ELSE (BREAKPAD_EXCEPTION_HANDLER_FOUND)
|
||||||
|
IF (BREAKPAD_EXCEPTION_HANDLER_FIND_REQUIRED)
|
||||||
|
MESSAGE(FATAL_ERROR "Could not find Google BreakPad library")
|
||||||
|
ENDIF (BREAKPAD_EXCEPTION_HANDLER_FIND_REQUIRED)
|
||||||
|
ENDIF (BREAKPAD_EXCEPTION_HANDLER_FOUND)
|
||||||
|
|
||||||
|
MARK_AS_ADVANCED(
|
||||||
|
BREAKPAD_EXCEPTION_HANDLER_LIBRARY
|
||||||
|
BREAKPAD_INCLUDE_DIRECTORIES
|
||||||
|
)
|
||||||
21
indra/cmake/GoogleBreakpad.cmake
Normal file
21
indra/cmake/GoogleBreakpad.cmake
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# -*- cmake -*-
|
||||||
|
include(Prebuilt)
|
||||||
|
|
||||||
|
if (STANDALONE)
|
||||||
|
set(BREAKPAD_EXCEPTION_HANDLER_FIND_REQUIRED ON)
|
||||||
|
include(FindGoogleBreakpad)
|
||||||
|
else (STANDALONE)
|
||||||
|
use_prebuilt_binary(google_breakpad)
|
||||||
|
if (DARWIN)
|
||||||
|
set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler)
|
||||||
|
endif (DARWIN)
|
||||||
|
if (LINUX)
|
||||||
|
set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES breakpad_client)
|
||||||
|
endif (LINUX)
|
||||||
|
if (WINDOWS)
|
||||||
|
set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler crash_generation_client crash_generation_server common)
|
||||||
|
endif (WINDOWS)
|
||||||
|
# yes, this does look dumb, no, it's not incorrect
|
||||||
|
# I think it's incorrect: the second one should go --Aleric
|
||||||
|
set(BREAKPAD_INCLUDE_DIRECTORIES "${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/google_breakpad" "${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/google_breakpad/google_breakpad")
|
||||||
|
endif (STANDALONE)
|
||||||
@@ -159,3 +159,23 @@ MACRO(ADD_VIEWER_COMM_BUILD_TEST name parent wrapper)
|
|||||||
## MESSAGE(STATUS "ADD_VIEWER_COMM_BUILD_TEST ${name} wrapper = ${wrapper}")
|
## MESSAGE(STATUS "ADD_VIEWER_COMM_BUILD_TEST ${name} wrapper = ${wrapper}")
|
||||||
ADD_COMM_BUILD_TEST("${name}" "${parent}" "${wrapper}" llviewerprecompiledheaders.cpp)
|
ADD_COMM_BUILD_TEST("${name}" "${parent}" "${wrapper}" llviewerprecompiledheaders.cpp)
|
||||||
ENDMACRO(ADD_VIEWER_COMM_BUILD_TEST name parent wrapper)
|
ENDMACRO(ADD_VIEWER_COMM_BUILD_TEST name parent wrapper)
|
||||||
|
MACRO(SET_TEST_PATH LISTVAR)
|
||||||
|
IF(WINDOWS)
|
||||||
|
# We typically build/package only Release variants of third-party
|
||||||
|
# libraries, so append the Release staging dir in case the library being
|
||||||
|
# sought doesn't have a debug variant.
|
||||||
|
set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR} ${SHARED_LIB_STAGING_DIR}/Release)
|
||||||
|
ELSEIF(DARWIN)
|
||||||
|
# We typically build/package only Release variants of third-party
|
||||||
|
# libraries, so append the Release staging dir in case the library being
|
||||||
|
# sought doesn't have a debug variant.
|
||||||
|
set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources ${SHARED_LIB_STAGING_DIR}/Release/Resources /usr/lib)
|
||||||
|
ELSE(WINDOWS)
|
||||||
|
# Linux uses a single staging directory anyway.
|
||||||
|
IF (STANDALONE)
|
||||||
|
set(${LISTVAR} ${CMAKE_BINARY_DIR}/llcommon /usr/lib /usr/local/lib)
|
||||||
|
ELSE (STANDALONE)
|
||||||
|
set(${LISTVAR} ${SHARED_LIB_STAGING_DIR} /usr/lib)
|
||||||
|
ENDIF (STANDALONE)
|
||||||
|
ENDIF(WINDOWS)
|
||||||
|
ENDMACRO(SET_TEST_PATH)
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
# -*- cmake -*-
|
|
||||||
|
|
||||||
set(LLCRASHLOGGER_INCLUDE_DIRS
|
|
||||||
${LIBS_OPEN_DIR}/llcrashlogger
|
|
||||||
)
|
|
||||||
|
|
||||||
set(LLCRASHLOGGER_LIBRARIES llcrashlogger)
|
|
||||||
73
indra/cmake/LLSharedLibs.cmake
Normal file
73
indra/cmake/LLSharedLibs.cmake
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
# ll_deploy_sharedlibs_command
|
||||||
|
# target_exe: the cmake target of the executable for which the shared libs will be deployed.
|
||||||
|
macro(ll_deploy_sharedlibs_command target_exe)
|
||||||
|
get_target_property(TARGET_LOCATION ${target_exe} LOCATION)
|
||||||
|
get_filename_component(OUTPUT_PATH ${TARGET_LOCATION} PATH)
|
||||||
|
|
||||||
|
if(DARWIN)
|
||||||
|
SET_TEST_PATH(SEARCH_DIRS)
|
||||||
|
get_target_property(IS_BUNDLE ${target_exe} MACOSX_BUNDLE)
|
||||||
|
if(IS_BUNDLE)
|
||||||
|
# If its a bundle the exe is not in the target location, this should find it.
|
||||||
|
get_filename_component(TARGET_FILE ${TARGET_LOCATION} NAME)
|
||||||
|
set(OUTPUT_PATH ${TARGET_LOCATION}.app/Contents/MacOS)
|
||||||
|
set(TARGET_LOCATION ${OUTPUT_PATH}/${TARGET_FILE})
|
||||||
|
set(OUTPUT_PATH ${OUTPUT_PATH}/../Resources)
|
||||||
|
endif(IS_BUNDLE)
|
||||||
|
elseif(WINDOWS)
|
||||||
|
SET_TEST_PATH(SEARCH_DIRS)
|
||||||
|
LIST(APPEND SEARCH_DIRS "$ENV{SystemRoot}/system32")
|
||||||
|
elseif(LINUX)
|
||||||
|
SET_TEST_PATH(SEARCH_DIRS)
|
||||||
|
set(OUTPUT_PATH ${OUTPUT_PATH}/lib)
|
||||||
|
endif(DARWIN)
|
||||||
|
|
||||||
|
add_custom_command(
|
||||||
|
TARGET ${target_exe} POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND}
|
||||||
|
ARGS
|
||||||
|
"-DBIN_NAME=\"${TARGET_LOCATION}\""
|
||||||
|
"-DSEARCH_DIRS=\"${SEARCH_DIRS}\""
|
||||||
|
"-DDST_PATH=\"${OUTPUT_PATH}\""
|
||||||
|
"-P"
|
||||||
|
"${CMAKE_SOURCE_DIR}/cmake/DeploySharedLibs.cmake"
|
||||||
|
)
|
||||||
|
|
||||||
|
endmacro(ll_deploy_sharedlibs_command)
|
||||||
|
|
||||||
|
# ll_stage_sharedlib
|
||||||
|
# Performs config and adds a copy command for a sharedlib target.
|
||||||
|
macro(ll_stage_sharedlib DSO_TARGET)
|
||||||
|
# target gets written to the DLL staging directory.
|
||||||
|
# Also this directory is shared with RunBuildTest.cmake, y'know, for the tests.
|
||||||
|
set_target_properties(${DSO_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${SHARED_LIB_STAGING_DIR})
|
||||||
|
if(NOT WINDOWS)
|
||||||
|
get_target_property(DSO_PATH ${DSO_TARGET} LOCATION)
|
||||||
|
get_filename_component(DSO_FILE ${DSO_PATH} NAME)
|
||||||
|
if(DARWIN)
|
||||||
|
set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources)
|
||||||
|
else(DARWIN)
|
||||||
|
set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR})
|
||||||
|
endif(DARWIN)
|
||||||
|
|
||||||
|
# *TODO - maybe make this a symbolic link? -brad
|
||||||
|
add_custom_command(
|
||||||
|
TARGET ${DSO_TARGET} POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND}
|
||||||
|
ARGS
|
||||||
|
-E
|
||||||
|
copy_if_different
|
||||||
|
${DSO_PATH}
|
||||||
|
${SHARED_LIB_STAGING_DIR_CONFIG}/${DSO_FILE}
|
||||||
|
COMMENT "Copying llcommon to the staging folder."
|
||||||
|
)
|
||||||
|
endif(NOT WINDOWS)
|
||||||
|
|
||||||
|
if (DARWIN)
|
||||||
|
set_target_properties(${DSO_TARGET} PROPERTIES
|
||||||
|
BUILD_WITH_INSTALL_RPATH 1
|
||||||
|
INSTALL_NAME_DIR "@executable_path/../Resources"
|
||||||
|
)
|
||||||
|
endif(DARWIN)
|
||||||
|
|
||||||
|
endmacro(ll_stage_sharedlib)
|
||||||
@@ -5,22 +5,29 @@ set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
|
|||||||
include(Variables)
|
include(Variables)
|
||||||
|
|
||||||
if (NOT STANDALONE)
|
if (NOT STANDALONE)
|
||||||
if (WINDOWS)
|
set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib)
|
||||||
set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib)
|
set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/release)
|
||||||
set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/release)
|
set(ARCH_PREBUILT_DIRS_DEBUG ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/debug)
|
||||||
set(ARCH_PREBUILT_DIRS_DEBUG ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/debug)
|
|
||||||
elseif (LINUX)
|
if(WINDOWS OR ${CMAKE_GENERATOR} MATCHES "Xcode")
|
||||||
set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/release)
|
# the cmake xcode and VS generators implicitly append ${CMAKE_CFG_INTDIR} to the library paths for us
|
||||||
set(ARCH_PREBUILT_DIRS_RELEASE ${ARCH_PREBUILT_DIRS})
|
# fortunately both windows and darwin are case insensitive filesystems so this works.
|
||||||
set(ARCH_PREBUILT_DIRS_DEBUG ${ARCH_PREBUILT_DIRS})
|
set(ARCH_PREBUILT_LINK_DIRS "${ARCH_PREBUILT_DIRS}")
|
||||||
elseif (DARWIN)
|
else(WINDOWS OR ${CMAKE_GENERATOR} MATCHES "Xcode")
|
||||||
set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib)
|
# else block is for linux and any other makefile based generators
|
||||||
set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/release)
|
string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)
|
||||||
set(ARCH_PREBUILT_DIRS_DEBUG ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/debug)
|
set(ARCH_PREBUILT_LINK_DIRS ${ARCH_PREBUILT_DIRS}/${CMAKE_BUILD_TYPE_LOWER})
|
||||||
endif (WINDOWS)
|
endif(WINDOWS OR ${CMAKE_GENERATOR} MATCHES "Xcode")
|
||||||
|
|
||||||
|
if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
|
||||||
|
# When we're building something other than Release, append the
|
||||||
|
# packages/lib/release directory to deal with autobuild packages that don't
|
||||||
|
# provide (e.g.) lib/debug libraries.
|
||||||
|
list(APPEND ARCH_PREBUILT_LINK_DIRS ${ARCH_PREBUILT_DIRS_RELEASE})
|
||||||
|
endif (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
|
||||||
endif (NOT STANDALONE)
|
endif (NOT STANDALONE)
|
||||||
|
|
||||||
link_directories(${ARCH_PREBUILT_DIRS})
|
link_directories(${ARCH_PREBUILT_LINK_DIRS})
|
||||||
|
|
||||||
if (LINUX)
|
if (LINUX)
|
||||||
set(DL_LIBRARY dl)
|
set(DL_LIBRARY dl)
|
||||||
|
|||||||
21
indra/cmake/NVAPI.cmake
Normal file
21
indra/cmake/NVAPI.cmake
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# -*- cmake -*-
|
||||||
|
include(Prebuilt)
|
||||||
|
include(Variables)
|
||||||
|
|
||||||
|
set(NVAPI ON CACHE BOOL "Use NVAPI.")
|
||||||
|
|
||||||
|
if (NVAPI)
|
||||||
|
if (WINDOWS)
|
||||||
|
use_prebuilt_binary(nvapi)
|
||||||
|
if (WORD_SIZE EQUAL 32)
|
||||||
|
set(NVAPI_LIBRARY nvapi)
|
||||||
|
elseif (WORD_SIZE EQUAL 64)
|
||||||
|
set(NVAPI_LIBRARY nvapi64)
|
||||||
|
endif (WORD_SIZE EQUAL 32)
|
||||||
|
else (WINDOWS)
|
||||||
|
set(NVAPI_LIBRARY "")
|
||||||
|
endif (WINDOWS)
|
||||||
|
else (NVAPI)
|
||||||
|
set(NVAPI_LIBRARY "")
|
||||||
|
endif (NVAPI)
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ endif(INSTALL_PROPRIETARY)
|
|||||||
if (DARWIN)
|
if (DARWIN)
|
||||||
include(CMakeFindFrameworks)
|
include(CMakeFindFrameworks)
|
||||||
find_library(QUICKTIME_LIBRARY QuickTime)
|
find_library(QUICKTIME_LIBRARY QuickTime)
|
||||||
elseif (WINDOWS)
|
elseif (WINDOWS AND WORD_SIZE EQUAL 32)
|
||||||
set(QUICKTIME_SDK_DIR "$ENV{PROGRAMFILES}/QuickTime SDK"
|
set(QUICKTIME_SDK_DIR "$ENV{PROGRAMFILES}/QuickTime SDK"
|
||||||
CACHE PATH "Location of the QuickTime SDK.")
|
CACHE PATH "Location of the QuickTime SDK.")
|
||||||
|
|
||||||
|
|||||||
@@ -37,10 +37,15 @@ set(LIBS_PREBUILT_DIR ${CMAKE_SOURCE_DIR}/../libraries CACHE PATH
|
|||||||
|
|
||||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||||
set(WINDOWS ON BOOL FORCE)
|
set(WINDOWS ON BOOL FORCE)
|
||||||
set(ARCH i686)
|
if (WORD_SIZE EQUAL 32)
|
||||||
set(LL_ARCH ${ARCH}_win32)
|
set(ARCH i686)
|
||||||
set(LL_ARCH_DIR ${ARCH}-win32)
|
set(LL_ARCH ${ARCH}_win32)
|
||||||
set(WORD_SIZE 32)
|
set(LL_ARCH_DIR ${ARCH}-win32)
|
||||||
|
elseif (WORD_SIZE EQUAL 64)
|
||||||
|
set(ARCH x86_64)
|
||||||
|
set(LL_ARCH ${ARCH}_win)
|
||||||
|
set(LL_ARCH_DIR ${ARCH}-win)
|
||||||
|
endif (WORD_SIZE EQUAL 32)
|
||||||
endif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
endif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||||
|
|
||||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||||
@@ -92,24 +97,54 @@ endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|||||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
set(DARWIN 1)
|
set(DARWIN 1)
|
||||||
|
|
||||||
if(${CMAKE_GENERATOR} MATCHES Xcode)
|
execute_process(
|
||||||
#SDK Compiler and Deployment targets for XCode
|
COMMAND sh -c "xcodebuild -version | grep Xcode | cut -d ' ' -f2 | cut -d'.' -f1-2"
|
||||||
if (${XCODE_VERSION} VERSION_LESS 4.0.0)
|
OUTPUT_VARIABLE XCODE_VERSION )
|
||||||
set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk)
|
string(REGEX REPLACE "(\r?\n)+$" "" XCODE_VERSION "${XCODE_VERSION}")
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5)
|
|
||||||
else (${XCODE_VERSION} VERSION_LESS 4.0.0)
|
# # To support a different SDK update these Xcode settings:
|
||||||
set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.6.sdk)
|
# if (XCODE_VERSION GREATER 4.9) # (Which would be 5.0+)
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
|
# set(CMAKE_OSX_DEPLOYMENT_TARGET 10.8)
|
||||||
endif (${XCODE_VERSION} VERSION_LESS 4.0.0)
|
# set(CMAKE_OSX_SYSROOT macosx10.9)
|
||||||
else(${CMAKE_GENERATOR} MATCHES Xcode)
|
# else (XCODE_VERION GREATER 4.9)
|
||||||
set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.6.sdk)
|
# if (XCODE_VERSION GREATER 4.5)
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
|
# set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7)
|
||||||
endif(${CMAKE_GENERATOR} MATCHES Xcode)
|
# set(CMAKE_OSX_SYSROOT macosx10.8)
|
||||||
|
# else (XCODE_VERSION GREATER 4.5)
|
||||||
|
# if (XCODE_VERSION GREATER 4.2)
|
||||||
|
# set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
|
||||||
|
# set(CMAKE_OSX_SYSROOT macosx10.7)
|
||||||
|
# else (XCODE_VERSION GREATER 4.2)
|
||||||
|
# set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
|
||||||
|
# set(CMAKE_OSX_SYSROOT macosx10.7)
|
||||||
|
# endif (XCODE_VERSION GREATER 4.2)
|
||||||
|
# endif (XCODE_VERSION GREATER 4.5)
|
||||||
|
# endif (XCODE_VERSION GREATER 4.9)
|
||||||
|
|
||||||
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42")
|
# Hardcode SDK we build against until we can test and allow newer ones
|
||||||
|
# as autodetected in the code above
|
||||||
|
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
|
||||||
|
set(CMAKE_OSX_SYSROOT macosx10.6)
|
||||||
|
|
||||||
|
# Support for Unix Makefiles generator
|
||||||
|
if (CMAKE_GENERATOR STREQUAL "Unix Makefiles")
|
||||||
|
execute_process(COMMAND xcodebuild -version -sdk "${CMAKE_OSX_SYSROOT}" Path | head -n 1 OUTPUT_VARIABLE CMAKE_OSX_SYSROOT)
|
||||||
|
string(REGEX REPLACE "(\r?\n)+$" "" CMAKE_OSX_SYSROOT "${CMAKE_OSX_SYSROOT}")
|
||||||
|
endif (CMAKE_GENERATOR STREQUAL "Unix Makefiles")
|
||||||
|
|
||||||
|
# LLVM-GCC has been removed in Xcode5
|
||||||
|
if (XCODE_VERSION GREATER 4.9)
|
||||||
|
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0")
|
||||||
|
else (XCODE_VERSION GREATER 4.9)
|
||||||
|
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42")
|
||||||
|
endif (XCODE_VERSION GREATER 4.9)
|
||||||
|
|
||||||
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym)
|
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym)
|
||||||
|
|
||||||
|
message(STATUS "Xcode version: ${XCODE_VERSION}")
|
||||||
|
message(STATUS "OSX sysroot: ${CMAKE_OSX_SYSROOT}")
|
||||||
|
message(STATUS "OSX deployment target: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||||
|
|
||||||
# Build only for i386 by default, system default on MacOSX 10.6 is x86_64
|
# Build only for i386 by default, system default on MacOSX 10.6 is x86_64
|
||||||
set(CMAKE_OSX_ARCHITECTURES i386)
|
set(CMAKE_OSX_ARCHITECTURES i386)
|
||||||
set(ARCH i386)
|
set(ARCH i386)
|
||||||
@@ -119,26 +154,29 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|||||||
set(LL_ARCH_DIR universal-darwin)
|
set(LL_ARCH_DIR universal-darwin)
|
||||||
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
|
|
||||||
if (WINDOWS)
|
if (WINDOWS AND WORD_SIZE EQUAL 32)
|
||||||
set(PREBUILT_TYPE windows)
|
set(PREBUILT_TYPE windows)
|
||||||
|
elseif (WINDOWS AND WORD_SIZE EQUAL 64)
|
||||||
|
set(PREBUILT_TYPE windows64)
|
||||||
elseif(DARWIN)
|
elseif(DARWIN)
|
||||||
set(PREBUILT_TYPE darwin)
|
set(PREBUILT_TYPE darwin)
|
||||||
elseif(LINUX AND WORD_SIZE EQUAL 32)
|
elseif(LINUX AND WORD_SIZE EQUAL 32)
|
||||||
set(PREBUILT_TYPE linux)
|
set(PREBUILT_TYPE linux)
|
||||||
elseif(LINUX AND WORD_SIZE EQUAL 64)
|
elseif(LINUX AND WORD_SIZE EQUAL 64)
|
||||||
set(PREBUILT_TYPE linux64)
|
set(PREBUILT_TYPE linux64)
|
||||||
endif(WINDOWS)
|
endif(WINDOWS AND WORD_SIZE EQUAL 32)
|
||||||
|
|
||||||
# Default deploy grid
|
# Default deploy grid
|
||||||
set(GRID agni CACHE STRING "Target Grid")
|
set(GRID agni CACHE STRING "Target Grid")
|
||||||
|
|
||||||
set(VIEWER_CHANNEL "Singularity" CACHE STRING "Viewer Channel Name")
|
set(VIEWER_CHANNEL "Singularity" CACHE STRING "Viewer Channel Name")
|
||||||
set(VIEWER_LOGIN_CHANNEL ${VIEWER_CHANNEL} CACHE STRING "Fake login channel for A/B Testing")
|
set(VIEWER_LOGIN_CHANNEL "${VIEWER_CHANNEL}" CACHE STRING "Fake login channel for A/B Testing")
|
||||||
set(VIEWER_BRANDING_ID "singularity" CACHE STRING "Viewer branding id (currently secondlife|snowglobe)")
|
set(VIEWER_BRANDING_ID "singularity" CACHE STRING "Viewer branding id (currently secondlife|snowglobe)")
|
||||||
|
|
||||||
# *TODO: break out proper Branding-secondlife.cmake, Branding-snowglobe.cmake, etc
|
# *TODO: break out proper Branding-secondlife.cmake, Branding-snowglobe.cmake, etc
|
||||||
set(VIEWER_BRANDING_NAME "Singularity")
|
string(REGEX REPLACE " +" "" VIEWER_CHANNEL_ONE_WORD "${VIEWER_CHANNEL}")
|
||||||
set(VIEWER_BRANDING_NAME_CAMELCASE "Singularity")
|
set(VIEWER_BRANDING_NAME "${VIEWER_CHANNEL_ONE_WORD}")
|
||||||
|
set(VIEWER_BRANDING_NAME_CAMELCASE "${VIEWER_CHANNEL_ONE_WORD}")
|
||||||
|
|
||||||
set(STANDALONE OFF CACHE BOOL "Do not use Linden-supplied prebuilt libraries.")
|
set(STANDALONE OFF CACHE BOOL "Do not use Linden-supplied prebuilt libraries.")
|
||||||
|
|
||||||
|
|||||||
@@ -28,95 +28,16 @@
|
|||||||
#ifndef CWDEBUG
|
#ifndef CWDEBUG
|
||||||
|
|
||||||
#ifdef DEBUG_CURLIO
|
#ifdef DEBUG_CURLIO
|
||||||
|
#error DEBUG_CURLIO is not supported without libcwd.
|
||||||
// If CWDEBUG is not defined, but DEBUG_CURLIO is, then replace
|
// In order to use DEBUG_CURLIO you must install and use libcwd.
|
||||||
// some of the cwd macro's with something that generates viewer
|
// Download libcwd:
|
||||||
// specific debug output. Note that this generates a LOT of
|
// git clone https://github.com/CarloWood/libcwd.git
|
||||||
// output and should not normally be defined.
|
#endif
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include "llpreprocessor.h"
|
|
||||||
|
|
||||||
namespace debug {
|
|
||||||
namespace libcwd {
|
|
||||||
|
|
||||||
struct buf2str {
|
|
||||||
buf2str(char const* buf, int size) : mBuf(buf), mSize(size) { }
|
|
||||||
char const* mBuf;
|
|
||||||
int mSize;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct libcwd_do_type {
|
|
||||||
void on() const { }
|
|
||||||
};
|
|
||||||
extern LL_COMMON_API libcwd_do_type const libcw_do;
|
|
||||||
|
|
||||||
} // namespace libcwd
|
|
||||||
|
|
||||||
enum print_thread_id_t { print_thread_id };
|
|
||||||
inline void init() { }
|
|
||||||
struct Indent {
|
|
||||||
int M_indent;
|
|
||||||
static ll_thread_local int S_indentation;
|
|
||||||
enum LL_COMMON_API print_nt { print };
|
|
||||||
LL_COMMON_API Indent(int indent);
|
|
||||||
LL_COMMON_API ~Indent();
|
|
||||||
};
|
|
||||||
|
|
||||||
extern LL_COMMON_API std::ostream& operator<<(std::ostream& os, libcwd::buf2str const& b2s);
|
|
||||||
extern LL_COMMON_API std::ostream& operator<<(std::ostream& os, Indent::print_nt);
|
|
||||||
extern LL_COMMON_API std::ostream& operator<<(std::ostream& os, print_thread_id_t);
|
|
||||||
|
|
||||||
namespace dc {
|
|
||||||
|
|
||||||
struct fake_channel {
|
|
||||||
int mOn;
|
|
||||||
char const* mLabel;
|
|
||||||
fake_channel(int on, char const* label) : mOn(on), mLabel(label) { }
|
|
||||||
fake_channel(void) : mOn(0) { }
|
|
||||||
bool is_on() const { return !!mOn; }
|
|
||||||
bool is_off() const { return !mOn; }
|
|
||||||
void on() const { }
|
|
||||||
void off() const { }
|
|
||||||
};
|
|
||||||
extern LL_COMMON_API fake_channel const warning;
|
|
||||||
extern LL_COMMON_API fake_channel const curl;
|
|
||||||
extern LL_COMMON_API fake_channel const curlio;
|
|
||||||
extern LL_COMMON_API fake_channel const curltr;
|
|
||||||
extern LL_COMMON_API fake_channel const statemachine;
|
|
||||||
extern LL_COMMON_API fake_channel const notice;
|
|
||||||
extern LL_COMMON_API fake_channel const snapshot;
|
|
||||||
|
|
||||||
} // namespace dc
|
|
||||||
} // namespace debug
|
|
||||||
|
|
||||||
#define LIBCWD_DEBUG_CHANNELS debug
|
|
||||||
#define LibcwDoutScopeBegin(a, b, c) do { using namespace debug; using namespace debug::libcwd; llinfos_nf << print_thread_id << (c).mLabel << ": " << Indent::print;
|
|
||||||
#define LibcwDoutStream llcont
|
|
||||||
#define LibcwDoutScopeEnd llcont << llendl; } while(0)
|
|
||||||
|
|
||||||
#define Debug(x) do { using namespace debug; using namespace debug::libcwd; x; } while(0)
|
|
||||||
#define Dout(a, b) do { using namespace debug; using namespace debug::libcwd; if ((a).mOn) { llinfos_nf << print_thread_id << (a).mLabel << ": " << Indent::print << b << llendl; } } while(0)
|
|
||||||
#define DoutEntering(a, b) \
|
|
||||||
int __slviewer_debug_indentation = 2; \
|
|
||||||
{ \
|
|
||||||
using namespace debug; \
|
|
||||||
using namespace debug::libcwd; \
|
|
||||||
if ((a).mOn) \
|
|
||||||
llinfos_nf << print_thread_id << (a).mLabel << ": " << Indent::print << "Entering " << b << llendl; \
|
|
||||||
else \
|
|
||||||
__slviewer_debug_indentation = 0; \
|
|
||||||
} \
|
|
||||||
debug::Indent __slviewer_debug_indent(__slviewer_debug_indentation);
|
|
||||||
|
|
||||||
#else // !DEBUG_CURLIO
|
|
||||||
|
|
||||||
#define Debug(x)
|
#define Debug(x)
|
||||||
#define Dout(a, b)
|
#define Dout(a, b)
|
||||||
#define DoutEntering(a, b)
|
#define DoutEntering(a, b)
|
||||||
|
|
||||||
#endif // !DEBUG_CURLIO
|
|
||||||
|
|
||||||
#ifndef DOXYGEN // No need to document this. See http://libcwd.sourceforge.net/ for more info.
|
#ifndef DOXYGEN // No need to document this. See http://libcwd.sourceforge.net/ for more info.
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -144,6 +65,11 @@ extern LL_COMMON_API fake_channel const snapshot;
|
|||||||
#define CWDEBUG_MARKER 0
|
#define CWDEBUG_MARKER 0
|
||||||
|
|
||||||
#define BACKTRACE do { } while(0)
|
#define BACKTRACE do { } while(0)
|
||||||
|
#ifdef DEBUG_CURLIO
|
||||||
|
#define CWD_ONLY(...) __VA_ARGS__
|
||||||
|
#else
|
||||||
|
#define CWD_ONLY(...)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // !DOXYGEN
|
#endif // !DOXYGEN
|
||||||
|
|
||||||
@@ -180,6 +106,7 @@ extern LL_COMMON_API fake_channel const snapshot;
|
|||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
#define CWD_API __attribute__ ((visibility("default")))
|
#define CWD_API __attribute__ ((visibility("default")))
|
||||||
|
#define CWD_ONLY(...) __VA_ARGS__
|
||||||
|
|
||||||
//! Debug specific code.
|
//! Debug specific code.
|
||||||
namespace debug {
|
namespace debug {
|
||||||
@@ -384,6 +311,40 @@ void InstanceTracker<T>::dump(void)
|
|||||||
|
|
||||||
} // namespace debug
|
} // namespace debug
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
class AIDebugInstanceCounter
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static int sInstanceCount;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
static void print_count(char const* name, int count, bool destruction);
|
||||||
|
|
||||||
|
AIDebugInstanceCounter()
|
||||||
|
{
|
||||||
|
print_count(typeid(T).name(), ++sInstanceCount, false);
|
||||||
|
}
|
||||||
|
AIDebugInstanceCounter(AIDebugInstanceCounter const&)
|
||||||
|
{
|
||||||
|
print_count(typeid(T).name(), ++sInstanceCount, false);
|
||||||
|
}
|
||||||
|
~AIDebugInstanceCounter()
|
||||||
|
{
|
||||||
|
print_count(typeid(T).name(), --sInstanceCount, true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
//static
|
||||||
|
template<class T>
|
||||||
|
int AIDebugInstanceCounter<T>::sInstanceCount;
|
||||||
|
|
||||||
|
//static
|
||||||
|
template<class T>
|
||||||
|
void AIDebugInstanceCounter<T>::print_count(char const* name, int count, bool destruction)
|
||||||
|
{
|
||||||
|
Dout(dc::notice, (destruction ? "Destructed " : "Constructing ") << name << ", now " << count << " instance" << ((count == 1) ? "." : "s."));
|
||||||
|
}
|
||||||
|
|
||||||
//! Debugging macro.
|
//! Debugging macro.
|
||||||
//
|
//
|
||||||
// Print "Entering " << \a data to channel \a cntrl and increment
|
// Print "Entering " << \a data to channel \a cntrl and increment
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ class PlatformSetup(object):
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
def parse_build_opts(self, arguments):
|
def parse_build_opts(self, arguments):
|
||||||
opts, targets = getopt.getopt(arguments, 'o:', ['option='])
|
opts, targets = getopt.getopt(arguments, 'D:o:', ['option='])
|
||||||
build_opts = []
|
build_opts = []
|
||||||
for o, a in opts:
|
for o, a in opts:
|
||||||
if o in ('-o', '--option'):
|
if o in ('-o', '--option'):
|
||||||
@@ -221,6 +221,7 @@ class UnixSetup(PlatformSetup):
|
|||||||
exe_suffixes = ('',)
|
exe_suffixes = ('',)
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
PlatformSetup.__init__(self)
|
||||||
super(UnixSetup, self).__init__()
|
super(UnixSetup, self).__init__()
|
||||||
self.generator = 'Unix Makefiles'
|
self.generator = 'Unix Makefiles'
|
||||||
|
|
||||||
@@ -263,6 +264,7 @@ class UnixSetup(PlatformSetup):
|
|||||||
|
|
||||||
class LinuxSetup(UnixSetup):
|
class LinuxSetup(UnixSetup):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
UnixSetup.__init__(self)
|
||||||
super(LinuxSetup, self).__init__()
|
super(LinuxSetup, self).__init__()
|
||||||
try:
|
try:
|
||||||
self.debian_sarge = open('/etc/debian_version').read().strip() == '3.1'
|
self.debian_sarge = open('/etc/debian_version').read().strip() == '3.1'
|
||||||
@@ -384,6 +386,7 @@ class LinuxSetup(UnixSetup):
|
|||||||
|
|
||||||
class DarwinSetup(UnixSetup):
|
class DarwinSetup(UnixSetup):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
UnixSetup.__init__(self)
|
||||||
super(DarwinSetup, self).__init__()
|
super(DarwinSetup, self).__init__()
|
||||||
self.generator = 'Xcode'
|
self.generator = 'Xcode'
|
||||||
|
|
||||||
@@ -443,14 +446,21 @@ class WindowsSetup(PlatformSetup):
|
|||||||
'vc100' : {
|
'vc100' : {
|
||||||
'gen' : r'Visual Studio 10',
|
'gen' : r'Visual Studio 10',
|
||||||
'ver' : r'10.0'
|
'ver' : r'10.0'
|
||||||
|
},
|
||||||
|
'vc110' : {
|
||||||
|
'gen' : r'Visual Studio 11',
|
||||||
|
'ver' : r'11.0'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gens['vs2010'] = gens['vc100']
|
gens['vs2010'] = gens['vc100']
|
||||||
|
gens['vs2012'] = gens['vc110']
|
||||||
|
|
||||||
search_path = r'C:\windows'
|
search_path = r'C:\windows'
|
||||||
exe_suffixes = ('.exe', '.bat', '.com')
|
exe_suffixes = ('.exe', '.bat', '.com')
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
PlatformSetup.__init__(self)
|
||||||
super(WindowsSetup, self).__init__()
|
super(WindowsSetup, self).__init__()
|
||||||
self._generator = None
|
self._generator = None
|
||||||
self.incredibuild = False
|
self.incredibuild = False
|
||||||
@@ -491,7 +501,10 @@ class WindowsSetup(PlatformSetup):
|
|||||||
return 'win32'
|
return 'win32'
|
||||||
|
|
||||||
def build_dirs(self):
|
def build_dirs(self):
|
||||||
return ['build-' + self.generator]
|
if self.word_size == 64:
|
||||||
|
return ['build-' + self.generator + '-Win64']
|
||||||
|
else:
|
||||||
|
return ['build-' + self.generator]
|
||||||
|
|
||||||
def cmake_commandline(self, src_dir, build_dir, opts, simple):
|
def cmake_commandline(self, src_dir, build_dir, opts, simple):
|
||||||
args = dict(
|
args = dict(
|
||||||
@@ -503,6 +516,9 @@ class WindowsSetup(PlatformSetup):
|
|||||||
project_name=self.project_name,
|
project_name=self.project_name,
|
||||||
word_size=self.word_size,
|
word_size=self.word_size,
|
||||||
)
|
)
|
||||||
|
if self.word_size == 64:
|
||||||
|
args["generator"] += r' Win64'
|
||||||
|
|
||||||
#if simple:
|
#if simple:
|
||||||
# return 'cmake %(opts)s "%(dir)s"' % args
|
# return 'cmake %(opts)s "%(dir)s"' % args
|
||||||
return ('cmake -G "%(generator)s" '
|
return ('cmake -G "%(generator)s" '
|
||||||
@@ -596,15 +612,15 @@ class WindowsSetup(PlatformSetup):
|
|||||||
if environment == '':
|
if environment == '':
|
||||||
environment = self.find_visual_studio_express()
|
environment = self.find_visual_studio_express()
|
||||||
if environment == '':
|
if environment == '':
|
||||||
environment = self.find_visual_studio_express_single()
|
environment = self.find_visual_studio_express_single()
|
||||||
if environment == '':
|
if environment == '':
|
||||||
print >> sys.stderr, "Something went very wrong during build stage, could not find a Visual Studio?"
|
print >> sys.stderr, "Something went very wrong during build stage, could not find a Visual Studio?"
|
||||||
else:
|
else:
|
||||||
build_dirs=self.build_dirs()
|
build_dirs=self.build_dirs()
|
||||||
print >> sys.stderr, "\nSolution generation complete, it can can now be found in:", build_dirs[0]
|
print >> sys.stderr, "\nSolution generation complete, it can can now be found in:", build_dirs[0]
|
||||||
print >> sys.stderr, "\nAs you are using an Express Visual Studio, the build step cannot be automated"
|
print >> sys.stderr, "\nAs you are using an Express Visual Studio, the build step cannot be automated"
|
||||||
print >> sys.stderr, "\nPlease see https://wiki.secondlife.com/wiki/Microsoft_Visual_Studio#Extra_steps_for_Visual_Studio_Express_editions for Visual Studio Express specific information"
|
print >> sys.stderr, "\nPlease see https://wiki.secondlife.com/wiki/Microsoft_Visual_Studio#Extra_steps_for_Visual_Studio_Express_editions for Visual Studio Express specific information"
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
# devenv.com is CLI friendly, devenv.exe... not so much.
|
# devenv.com is CLI friendly, devenv.exe... not so much.
|
||||||
return ('"%sdevenv.com" %s.sln /build %s' %
|
return ('"%sdevenv.com" %s.sln /build %s' %
|
||||||
@@ -646,7 +662,7 @@ class WindowsSetup(PlatformSetup):
|
|||||||
os.path.join(build_dir,'Singularity.sln') +
|
os.path.join(build_dir,'Singularity.sln') +
|
||||||
' --config ' + self.build_type +
|
' --config ' + self.build_type +
|
||||||
' --startup secondlife-bin')
|
' --startup secondlife-bin')
|
||||||
print 'Running %r in %r' % (vstool_cmd, getcwd())
|
print 'Running vstool %r in %r' % (vstool_cmd, getcwd())
|
||||||
self.run(vstool_cmd)
|
self.run(vstool_cmd)
|
||||||
print >> open(stamp, 'w'), self.build_type
|
print >> open(stamp, 'w'), self.build_type
|
||||||
|
|
||||||
@@ -660,11 +676,11 @@ class WindowsSetup(PlatformSetup):
|
|||||||
if targets:
|
if targets:
|
||||||
for t in targets:
|
for t in targets:
|
||||||
cmd = '%s /project %s %s' % (build_cmd, t, ' '.join(opts))
|
cmd = '%s /project %s %s' % (build_cmd, t, ' '.join(opts))
|
||||||
print 'Running %r in %r' % (cmd, d)
|
print 'Running build(targets) %r in %r' % (cmd, d)
|
||||||
self.run(cmd)
|
self.run(cmd)
|
||||||
else:
|
else:
|
||||||
cmd = '%s %s' % (build_cmd, ' '.join(opts))
|
cmd = '%s %s' % (build_cmd, ' '.join(opts))
|
||||||
print 'Running %r in %r' % (cmd, d)
|
print 'Running build %r in %r' % (cmd, d)
|
||||||
self.run(cmd)
|
self.run(cmd)
|
||||||
finally:
|
finally:
|
||||||
os.chdir(cwd)
|
os.chdir(cwd)
|
||||||
@@ -685,6 +701,8 @@ class CygwinSetup(WindowsSetup):
|
|||||||
project_name=self.project_name,
|
project_name=self.project_name,
|
||||||
word_size=self.word_size,
|
word_size=self.word_size,
|
||||||
)
|
)
|
||||||
|
if self.word_size == 64:
|
||||||
|
args["generator"] += r' Win64'
|
||||||
#if simple:
|
#if simple:
|
||||||
# return 'cmake %(opts)s "%(dir)s"' % args
|
# return 'cmake %(opts)s "%(dir)s"' % args
|
||||||
return ('cmake -G "%(generator)s" '
|
return ('cmake -G "%(generator)s" '
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import shutil
|
|||||||
import sys
|
import sys
|
||||||
import tarfile
|
import tarfile
|
||||||
import errno
|
import errno
|
||||||
|
import subprocess
|
||||||
|
|
||||||
def path_ancestors(path):
|
def path_ancestors(path):
|
||||||
drive, path = os.path.splitdrive(os.path.normpath(path))
|
drive, path = os.path.splitdrive(os.path.normpath(path))
|
||||||
@@ -192,6 +193,8 @@ def usage(srctree=""):
|
|||||||
arg['description'] % nd)
|
arg['description'] % nd)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
print "cwd:", os.getcwd()
|
||||||
|
print " ".join(sys.argv)
|
||||||
option_names = [arg['name'] + '=' for arg in ARGUMENTS]
|
option_names = [arg['name'] + '=' for arg in ARGUMENTS]
|
||||||
option_names.append('help')
|
option_names.append('help')
|
||||||
options, remainder = getopt.getopt(sys.argv[1:], "", option_names)
|
options, remainder = getopt.getopt(sys.argv[1:], "", option_names)
|
||||||
@@ -266,7 +269,7 @@ class LLManifest(object):
|
|||||||
__metaclass__ = LLManifestRegistry
|
__metaclass__ = LLManifestRegistry
|
||||||
manifests = {}
|
manifests = {}
|
||||||
def for_platform(self, platform, arch = None):
|
def for_platform(self, platform, arch = None):
|
||||||
if arch:
|
if arch and platform != "windows":
|
||||||
platform = platform + '_' + arch
|
platform = platform + '_' + arch
|
||||||
return self.manifests[platform.lower()]
|
return self.manifests[platform.lower()]
|
||||||
for_platform = classmethod(for_platform)
|
for_platform = classmethod(for_platform)
|
||||||
@@ -391,20 +394,19 @@ class LLManifest(object):
|
|||||||
debugging/informational purpoases, prints out the command's
|
debugging/informational purpoases, prints out the command's
|
||||||
output as it is received."""
|
output as it is received."""
|
||||||
print "Running command:", command
|
print "Running command:", command
|
||||||
fd = os.popen(command, 'r')
|
fd = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||||
lines = []
|
lines = []
|
||||||
while True:
|
while True:
|
||||||
lines.append(fd.readline())
|
lines.append(fd.stdout.readline())
|
||||||
if lines[-1] == '':
|
if lines[-1] == '':
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
print lines[-1],
|
print lines[-1].rstrip('\n'),
|
||||||
output = ''.join(lines)
|
output = ''.join(lines)
|
||||||
status = fd.close()
|
if fd.returncode:
|
||||||
if status:
|
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
"Command %s returned non-zero status (%s) \noutput:\n%s"
|
"Command %s returned non-zero status (%s) \noutput:\n%s"
|
||||||
% (command, status, output) )
|
% (command, fd.returncode, output) )
|
||||||
return output
|
return output
|
||||||
|
|
||||||
def created_path(self, path):
|
def created_path(self, path):
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ namespace HACD
|
|||||||
if (m_callBack)
|
if (m_callBack)
|
||||||
{
|
{
|
||||||
char msg[1024];
|
char msg[1024];
|
||||||
sprintf(msg, "nCC %lu\n", m_graph.m_nCCs);
|
sprintf(msg, "nCC %zu\n", m_graph.m_nCCs);
|
||||||
(*m_callBack)(msg, 0.0, 0.0, m_graph.GetNVertices());
|
(*m_callBack)(msg, 0.0, 0.0, m_graph.GetNVertices());
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -679,7 +679,7 @@ namespace HACD
|
|||||||
{
|
{
|
||||||
if ((!condition1) && m_callBack)
|
if ((!condition1) && m_callBack)
|
||||||
{
|
{
|
||||||
sprintf(msg, "\n-> %lu\t%f\t%f\t%f\n", m_pqueue.size(), m_graph.m_vertices[v1].m_surf*100.0/m_area, m_graph.m_vertices[v2].m_surf*100.0/m_area, m_graph.m_edges[currentEdge.m_name].m_concavity);
|
sprintf(msg, "\n-> %zu\t%f\t%f\t%f\n", m_pqueue.size(), m_graph.m_vertices[v1].m_surf*100.0/m_area, m_graph.m_vertices[v2].m_surf*100.0/m_area, m_graph.m_edges[currentEdge.m_name].m_concavity);
|
||||||
(*m_callBack)(msg, progress, globalConcavity, m_graph.GetNVertices());
|
(*m_callBack)(msg, progress, globalConcavity, m_graph.GetNVertices());
|
||||||
}
|
}
|
||||||
globalConcavity = std::max<double>(globalConcavity ,m_graph.m_edges[currentEdge.m_name].m_concavity);
|
globalConcavity = std::max<double>(globalConcavity ,m_graph.m_edges[currentEdge.m_name].m_concavity);
|
||||||
@@ -879,7 +879,7 @@ namespace HACD
|
|||||||
if (m_callBack)
|
if (m_callBack)
|
||||||
{
|
{
|
||||||
char msg[1024];
|
char msg[1024];
|
||||||
sprintf(msg, "\t CH(%lu) \t %lu \t %lf \t %lu \t %f \t %lu\n", v, static_cast<unsigned long>(p), m_graph.m_vertices[v].m_concavity, m_graph.m_vertices[v].m_distPoints.Size(), m_graph.m_vertices[v].m_surf*100.0/m_area, m_graph.m_vertices[v].m_ancestors.size());
|
sprintf(msg, "\t CH(%zu) \t %zu \t %lf \t %zu \t %f \t %zu\n", v, p, m_graph.m_vertices[v].m_concavity, m_graph.m_vertices[v].m_distPoints.Size(), m_graph.m_vertices[v].m_surf*100.0/m_area, m_graph.m_vertices[v].m_ancestors.size());
|
||||||
(*m_callBack)(msg, 0.0, 0.0, m_nClusters);
|
(*m_callBack)(msg, 0.0, 0.0, m_nClusters);
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,9 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
|
#if defined(_MSC_VER) && _MSC_VER >= 1700
|
||||||
|
#include <functional>
|
||||||
|
#endif
|
||||||
namespace HACD
|
namespace HACD
|
||||||
{
|
{
|
||||||
const double sc_pi = 3.14159265;
|
const double sc_pi = 3.14159265;
|
||||||
@@ -315,7 +317,7 @@ namespace HACD
|
|||||||
bool m_addFacesPoints; //>! specifies whether to add faces points or not
|
bool m_addFacesPoints; //>! specifies whether to add faces points or not
|
||||||
bool m_addExtraDistPoints; //>! specifies whether to add extra points for concave shapes or not
|
bool m_addExtraDistPoints; //>! specifies whether to add extra points for concave shapes or not
|
||||||
|
|
||||||
friend HACD * const CreateHACD(HeapManager * heapManager = 0);
|
friend HACD * const CreateHACD(HeapManager * heapManager);
|
||||||
friend void DestroyHACD(HACD * const hacd);
|
friend void DestroyHACD(HACD * const hacd);
|
||||||
};
|
};
|
||||||
inline HACD * const CreateHACD(HeapManager * heapManager)
|
inline HACD * const CreateHACD(HeapManager * heapManager)
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ namespace HACD
|
|||||||
m_nMaxNodes = 0;
|
m_nMaxNodes = 0;
|
||||||
for(size_t k = 0; k < maxDepth; k++)
|
for(size_t k = 0; k < maxDepth; k++)
|
||||||
{
|
{
|
||||||
m_nMaxNodes += (1 << maxDepth);
|
m_nMaxNodes += (static_cast<size_t>(1) << maxDepth);
|
||||||
}
|
}
|
||||||
m_nodes = new RMNode[m_nMaxNodes];
|
m_nodes = new RMNode[m_nMaxNodes];
|
||||||
RMNode & root = m_nodes[AddNode()];
|
RMNode & root = m_nodes[AddNode()];
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ include(00-Common)
|
|||||||
include_directories(${LIBS_OPEN_DIR}/libhacd)
|
include_directories(${LIBS_OPEN_DIR}/libhacd)
|
||||||
|
|
||||||
set (libndhacd_SOURCE_FILES
|
set (libndhacd_SOURCE_FILES
|
||||||
LLConvexDecomposition.cpp
|
llconvexdecomposition.cpp
|
||||||
nd_hacdConvexDecomposition.cpp
|
nd_hacdConvexDecomposition.cpp
|
||||||
nd_hacdStructs.cpp
|
nd_hacdStructs.cpp
|
||||||
nd_hacdUtils.cpp
|
nd_hacdUtils.cpp
|
||||||
@@ -16,12 +16,12 @@ set (libndhacd_SOURCE_FILES
|
|||||||
)
|
)
|
||||||
|
|
||||||
set (libndhacd_HEADER_FILES
|
set (libndhacd_HEADER_FILES
|
||||||
LLConvexDecomposition.h
|
llconvexdecomposition.h
|
||||||
ndConvexDecomposition.h
|
ndConvexDecomposition.h
|
||||||
nd_hacdConvexDecomposition.h
|
nd_hacdConvexDecomposition.h
|
||||||
nd_hacdStructs.h
|
nd_hacdStructs.h
|
||||||
nd_StructTracer.h
|
nd_StructTracer.h
|
||||||
LLConvexDecompositionStubImpl.h
|
llconvexdecompositionstubimpl.h
|
||||||
nd_EnterExitTracer.h
|
nd_EnterExitTracer.h
|
||||||
nd_hacdDefines.h
|
nd_hacdDefines.h
|
||||||
nd_hacdUtils.h
|
nd_hacdUtils.h
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @file LLConvexDecomposition.cpp
|
* @file llconvexdecomposition.cpp
|
||||||
* @author falcon@lindenlab.com
|
* @author falcon@lindenlab.com
|
||||||
* @brief A stub implementation of LLConvexDecomposition interface
|
* @brief A stub implementation of LLConvexDecomposition interface
|
||||||
*
|
*
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
#include "nd_hacdConvexDecomposition.h"
|
#include "nd_hacdConvexDecomposition.h"
|
||||||
|
|
||||||
#include "LLConvexDecomposition.h"
|
#include "llconvexdecomposition.h"
|
||||||
|
|
||||||
|
|
||||||
/*static */bool LLConvexDecomposition::s_isInitialized = false;
|
/*static */bool LLConvexDecomposition::s_isInitialized = false;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @file LLConvexDecomposition.cpp
|
* @file llconvexdecomposition.cpp
|
||||||
* @brief LLConvexDecomposition interface definition
|
* @brief LLConvexDecomposition interface definition
|
||||||
*
|
*
|
||||||
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
|
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @file LLConvexDecompositionStubImpl.cpp
|
* @file llconvexdecompositionstubimpl.cpp
|
||||||
* @author falcon@lindenlab.com
|
* @author falcon@lindenlab.com
|
||||||
* @brief A stub implementation of LLConvexDecomposition
|
* @brief A stub implementation of LLConvexDecomposition
|
||||||
*
|
*
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "LLConvexDecompositionStubImpl.h"
|
#include "llconvexdecompositionstubimpl.h"
|
||||||
|
|
||||||
LLConvexDecomposition* LLConvexDecompositionImpl::getInstance()
|
LLConvexDecomposition* LLConvexDecompositionImpl::getInstance()
|
||||||
{
|
{
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @file LLConvexDecompositionStubImpl.h
|
* @file llconvexdecompositionstubimpl.h
|
||||||
* @author falcon@lindenlab.com
|
* @author falcon@lindenlab.com
|
||||||
* @brief A stub implementation of LLConvexDecomposition
|
* @brief A stub implementation of LLConvexDecomposition
|
||||||
*
|
*
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
#ifndef LL_CONVEX_DECOMP_UTIL_H
|
#ifndef LL_CONVEX_DECOMP_UTIL_H
|
||||||
#define LL_CONVEX_DECOMP_UTIL_H
|
#define LL_CONVEX_DECOMP_UTIL_H
|
||||||
|
|
||||||
#include "LLConvexDecomposition.h"
|
#include "llconvexdecomposition.h"
|
||||||
|
|
||||||
class LLConvexDecompositionImpl : public LLConvexDecomposition
|
class LLConvexDecompositionImpl : public LLConvexDecomposition
|
||||||
{
|
{
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "ndConvexDecomposition.h"
|
#include "ndConvexDecomposition.h"
|
||||||
#include "LLConvexDecomposition.h"
|
#include "llconvexdecomposition.h"
|
||||||
#include "nd_hacdStructs.h"
|
#include "nd_hacdStructs.h"
|
||||||
|
|
||||||
namespace ndStructTracer
|
namespace ndStructTracer
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
#ifndef ND_HACD_CONVEXDECOMP_H
|
#ifndef ND_HACD_CONVEXDECOMP_H
|
||||||
#define ND_HACD_CONVEXDECOMP_H
|
#define ND_HACD_CONVEXDECOMP_H
|
||||||
|
|
||||||
#include "LLConvexDecomposition.h"
|
#include "llconvexdecomposition.h"
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "nd_hacdStructs.h"
|
#include "nd_hacdStructs.h"
|
||||||
#include "LLConvexDecomposition.h"
|
|
||||||
|
|
||||||
void DecompHull::clear()
|
void DecompHull::clear()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include "nd_hacdDefines.h"
|
#include "nd_hacdDefines.h"
|
||||||
#include "hacdHACD.h"
|
#include "hacdHACD.h"
|
||||||
#include "LLConvexDecomposition.h"
|
#include "llconvexdecomposition.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
struct LLCDHull;
|
struct LLCDHull;
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
#define ND_HACD_UTILS_H
|
#define ND_HACD_UTILS_H
|
||||||
|
|
||||||
#include "nd_hacdStructs.h"
|
#include "nd_hacdStructs.h"
|
||||||
#include "LLConvexDecomposition.h"
|
|
||||||
|
|
||||||
tHACD* init( int nConcavity, int nClusters, int nMaxVerticesPerHull, double dMaxConnectDist, HACDDecoder *aData );
|
tHACD* init( int nConcavity, int nClusters, int nMaxVerticesPerHull, double dMaxConnectDist, HACDDecoder *aData );
|
||||||
DecompData decompose( tHACD *aHACD );
|
DecompData decompose( tHACD *aHACD );
|
||||||
|
|||||||
@@ -1,72 +0,0 @@
|
|||||||
# -*- cmake -*-
|
|
||||||
|
|
||||||
project(linux_crash_logger)
|
|
||||||
|
|
||||||
include(00-Common)
|
|
||||||
include(LLCommon)
|
|
||||||
include(LLCrashLogger)
|
|
||||||
include(LLMath)
|
|
||||||
include(LLMessage)
|
|
||||||
include(LLVFS)
|
|
||||||
include(LLXML)
|
|
||||||
include(Linking)
|
|
||||||
include(UI)
|
|
||||||
|
|
||||||
include_directories(
|
|
||||||
${LLCOMMON_INCLUDE_DIRS}
|
|
||||||
${LLCRASHLOGGER_INCLUDE_DIRS}
|
|
||||||
${LLMATH_INCLUDE_DIRS}
|
|
||||||
${LLVFS_INCLUDE_DIRS}
|
|
||||||
${LLXML_INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
|
|
||||||
set(linux_crash_logger_SOURCE_FILES
|
|
||||||
linux_crash_logger.cpp
|
|
||||||
llcrashloggerlinux.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
set(linux_crash_logger_HEADER_FILES
|
|
||||||
CMakeLists.txt
|
|
||||||
|
|
||||||
llcrashloggerlinux.h
|
|
||||||
)
|
|
||||||
|
|
||||||
set_source_files_properties(${linux_crash_logger_HEADER_FILES}
|
|
||||||
PROPERTIES HEADER_FILE_ONLY TRUE)
|
|
||||||
|
|
||||||
list(APPEND linux_crash_logger_SOURCE_FILES
|
|
||||||
${linux_crash_logger_HEADER_FILES}
|
|
||||||
)
|
|
||||||
|
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed")
|
|
||||||
|
|
||||||
add_executable(linux-crash-logger ${linux_crash_logger_SOURCE_FILES})
|
|
||||||
|
|
||||||
target_link_libraries(linux-crash-logger
|
|
||||||
${LLCRASHLOGGER_LIBRARIES}
|
|
||||||
${LLVFS_LIBRARIES}
|
|
||||||
${LLXML_LIBRARIES}
|
|
||||||
${LLMESSAGE_LIBRARIES}
|
|
||||||
${LLUI_LIBRARIES}
|
|
||||||
${LLVFS_LIBRARIES}
|
|
||||||
${LLMATH_LIBRARIES}
|
|
||||||
${LLCOMMON_LIBRARIES}
|
|
||||||
${UI_LIBRARIES}
|
|
||||||
${DB_LIBRARIES}
|
|
||||||
${XMLRPCEPI_LIBRARIES}
|
|
||||||
${CURL_LIBRARIES}
|
|
||||||
${APR_LIBRARIES}
|
|
||||||
${APRUTIL_LIBRARIES}
|
|
||||||
${CRYPTO_LIBRARIES}
|
|
||||||
rt
|
|
||||||
)
|
|
||||||
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT linux-crash-logger-stripped
|
|
||||||
COMMAND strip
|
|
||||||
ARGS --strip-debug -o linux-crash-logger-stripped linux-crash-logger
|
|
||||||
DEPENDS linux-crash-logger
|
|
||||||
)
|
|
||||||
|
|
||||||
add_custom_target(linux-crash-logger-strip-target ALL
|
|
||||||
DEPENDS linux-crash-logger-stripped)
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file linux_crash_logger.cpp
|
|
||||||
* @brief Linux crash logger implementation
|
|
||||||
*
|
|
||||||
* $LicenseInfo:firstyear=2003&license=viewergpl$
|
|
||||||
*
|
|
||||||
* Copyright (c) 2003-2009, Linden Research, Inc.
|
|
||||||
*
|
|
||||||
* Second Life Viewer Source Code
|
|
||||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
|
||||||
* to you under the terms of the GNU General Public License, version 2.0
|
|
||||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
|
||||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
|
||||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
|
||||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
|
||||||
*
|
|
||||||
* There are special exceptions to the terms and conditions of the GPL as
|
|
||||||
* it is applied to this Source Code. View the full text of the exception
|
|
||||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
|
||||||
* online at
|
|
||||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
|
||||||
*
|
|
||||||
* By copying, modifying or distributing this software, you acknowledge
|
|
||||||
* that you have read and understood your obligations described above,
|
|
||||||
* and agree to abide by those obligations.
|
|
||||||
*
|
|
||||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
|
||||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
|
||||||
* COMPLETENESS OR PERFORMANCE.
|
|
||||||
* $/LicenseInfo$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "llcrashloggerlinux.h"
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
|
||||||
{
|
|
||||||
LLCrashLoggerLinux app;
|
|
||||||
app.parseCommandOptions(argc, argv);
|
|
||||||
app.init();
|
|
||||||
app.mainLoop();
|
|
||||||
app.cleanup();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,148 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file llcrashloggerlinux.cpp
|
|
||||||
* @brief Linux crash logger implementation
|
|
||||||
*
|
|
||||||
* $LicenseInfo:firstyear=2003&license=viewergpl$
|
|
||||||
*
|
|
||||||
* Copyright (c) 2003-2009, Linden Research, Inc.
|
|
||||||
*
|
|
||||||
* Second Life Viewer Source Code
|
|
||||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
|
||||||
* to you under the terms of the GNU General Public License, version 2.0
|
|
||||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
|
||||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
|
||||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
|
||||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
|
||||||
*
|
|
||||||
* There are special exceptions to the terms and conditions of the GPL as
|
|
||||||
* it is applied to this Source Code. View the full text of the exception
|
|
||||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
|
||||||
* online at
|
|
||||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
|
||||||
*
|
|
||||||
* By copying, modifying or distributing this software, you acknowledge
|
|
||||||
* that you have read and understood your obligations described above,
|
|
||||||
* and agree to abide by those obligations.
|
|
||||||
*
|
|
||||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
|
||||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
|
||||||
* COMPLETENESS OR PERFORMANCE.
|
|
||||||
* $/LicenseInfo$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "llcrashloggerlinux.h"
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "linden_common.h"
|
|
||||||
|
|
||||||
#include "boost/tokenizer.hpp"
|
|
||||||
|
|
||||||
#include "indra_constants.h" // CRASH_BEHAVIOR_ASK, CRASH_SETTING_NAME
|
|
||||||
#include "llerror.h"
|
|
||||||
#include "llfile.h"
|
|
||||||
#include "lltimer.h"
|
|
||||||
#include "llstring.h"
|
|
||||||
#include "lldir.h"
|
|
||||||
#include "llsdserialize.h"
|
|
||||||
|
|
||||||
#if LL_GTK
|
|
||||||
# include "gtk/gtk.h"
|
|
||||||
#endif // LL_GTK
|
|
||||||
|
|
||||||
#define MAX_LOADSTRING 100
|
|
||||||
|
|
||||||
// These need to be localized.
|
|
||||||
static const char dialog_text[] =
|
|
||||||
"Second Life appears to have crashed or frozen last time it ran.\n"
|
|
||||||
"This crash reporter collects information about your computer's hardware, operating system, and some Second Life logs, all of which are used for debugging purposes only.\n"
|
|
||||||
"\n"
|
|
||||||
"Send crash report?";
|
|
||||||
|
|
||||||
static const char dialog_title[] =
|
|
||||||
"Second Life Crash Logger";
|
|
||||||
|
|
||||||
#if LL_GTK
|
|
||||||
static void response_callback (GtkDialog *dialog,
|
|
||||||
gint arg1,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
gint *response = (gint*)user_data;
|
|
||||||
*response = arg1;
|
|
||||||
gtk_widget_destroy(GTK_WIDGET(dialog));
|
|
||||||
gtk_main_quit();
|
|
||||||
}
|
|
||||||
#endif // LL_GTK
|
|
||||||
|
|
||||||
static BOOL do_ask_dialog(void)
|
|
||||||
{
|
|
||||||
#if LL_GTK
|
|
||||||
gtk_disable_setlocale();
|
|
||||||
if (!gtk_init_check(NULL, NULL)) {
|
|
||||||
llinfos << "Could not initialize GTK for 'ask to send crash report' dialog; not sending report." << llendl;
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
GtkWidget *win = NULL;
|
|
||||||
GtkDialogFlags flags = GTK_DIALOG_MODAL;
|
|
||||||
GtkMessageType messagetype = GTK_MESSAGE_QUESTION;
|
|
||||||
GtkButtonsType buttons = GTK_BUTTONS_YES_NO;
|
|
||||||
gint response = GTK_RESPONSE_NONE;
|
|
||||||
|
|
||||||
win = gtk_message_dialog_new(NULL,
|
|
||||||
flags, messagetype, buttons,
|
|
||||||
"%s", dialog_text);
|
|
||||||
gtk_window_set_type_hint(GTK_WINDOW(win),
|
|
||||||
GDK_WINDOW_TYPE_HINT_DIALOG);
|
|
||||||
gtk_window_set_title(GTK_WINDOW(win), dialog_title);
|
|
||||||
g_signal_connect (win,
|
|
||||||
"response",
|
|
||||||
G_CALLBACK (response_callback),
|
|
||||||
&response);
|
|
||||||
gtk_widget_show_all (win);
|
|
||||||
gtk_main();
|
|
||||||
|
|
||||||
return (GTK_RESPONSE_OK == response ||
|
|
||||||
GTK_RESPONSE_YES == response ||
|
|
||||||
GTK_RESPONSE_APPLY == response);
|
|
||||||
#else
|
|
||||||
return FALSE;
|
|
||||||
#endif // LL_GTK
|
|
||||||
}
|
|
||||||
|
|
||||||
LLCrashLoggerLinux::LLCrashLoggerLinux(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
LLCrashLoggerLinux::~LLCrashLoggerLinux(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void LLCrashLoggerLinux::gatherPlatformSpecificFiles()
|
|
||||||
{
|
|
||||||
mFileMap["CrashLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stack_trace.log").c_str();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LLCrashLoggerLinux::mainLoop()
|
|
||||||
{
|
|
||||||
bool send_logs = true;
|
|
||||||
if(CRASH_BEHAVIOR_ASK == getCrashBehavior())
|
|
||||||
{
|
|
||||||
send_logs = do_ask_dialog();
|
|
||||||
}
|
|
||||||
else if(CRASH_BEHAVIOR_NEVER_SEND == getCrashBehavior())
|
|
||||||
{
|
|
||||||
send_logs = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(send_logs)
|
|
||||||
{
|
|
||||||
sendCrashLogs();
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LLCrashLoggerLinux::updateApplication(const std::string& message)
|
|
||||||
{
|
|
||||||
LLCrashLogger::updateApplication(message);
|
|
||||||
}
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file llcrashloggerlinux.h
|
|
||||||
* @brief Linux crash logger definition
|
|
||||||
*
|
|
||||||
* $LicenseInfo:firstyear=2003&license=viewergpl$
|
|
||||||
*
|
|
||||||
* Copyright (c) 2003-2009, Linden Research, Inc.
|
|
||||||
*
|
|
||||||
* Second Life Viewer Source Code
|
|
||||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
|
||||||
* to you under the terms of the GNU General Public License, version 2.0
|
|
||||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
|
||||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
|
||||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
|
||||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
|
||||||
*
|
|
||||||
* There are special exceptions to the terms and conditions of the GPL as
|
|
||||||
* it is applied to this Source Code. View the full text of the exception
|
|
||||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
|
||||||
* online at
|
|
||||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
|
||||||
*
|
|
||||||
* By copying, modifying or distributing this software, you acknowledge
|
|
||||||
* that you have read and understood your obligations described above,
|
|
||||||
* and agree to abide by those obligations.
|
|
||||||
*
|
|
||||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
|
||||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
|
||||||
* COMPLETENESS OR PERFORMANCE.
|
|
||||||
* $/LicenseInfo$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LLCRASHLOGGERLINUX_H
|
|
||||||
#define LLCRASHLOGGERLINUX_H
|
|
||||||
|
|
||||||
#include "linden_common.h"
|
|
||||||
#include "llcrashlogger.h"
|
|
||||||
#include "llstring.h"
|
|
||||||
|
|
||||||
class LLCrashLoggerLinux : public LLCrashLogger
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LLCrashLoggerLinux(void);
|
|
||||||
~LLCrashLoggerLinux(void);
|
|
||||||
virtual bool mainLoop();
|
|
||||||
virtual void updateApplication(const std::string& = LLStringUtil::null);
|
|
||||||
virtual void gatherPlatformSpecificFiles();
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -983,19 +983,19 @@ BOOL LLAvatarAppearance::loadSkeletonNode ()
|
|||||||
mRoot->addChild(mMeshLOD[MESH_ID_SKIRT]);
|
mRoot->addChild(mMeshLOD[MESH_ID_SKIRT]);
|
||||||
mRoot->addChild(mMeshLOD[MESH_ID_HEAD]);
|
mRoot->addChild(mMeshLOD[MESH_ID_HEAD]);
|
||||||
|
|
||||||
LLAvatarJoint *skull = (LLAvatarJoint*)mRoot->findJoint("mSkull");
|
LLJoint *skull = mRoot->findJoint("mSkull");
|
||||||
if (skull)
|
if (skull)
|
||||||
{
|
{
|
||||||
skull->addChild(mMeshLOD[MESH_ID_HAIR] );
|
skull->addChild(mMeshLOD[MESH_ID_HAIR] );
|
||||||
}
|
}
|
||||||
|
|
||||||
LLAvatarJoint *eyeL = (LLAvatarJoint*)mRoot->findJoint("mEyeLeft");
|
LLJoint *eyeL = mRoot->findJoint("mEyeLeft");
|
||||||
if (eyeL)
|
if (eyeL)
|
||||||
{
|
{
|
||||||
eyeL->addChild( mMeshLOD[MESH_ID_EYEBALL_LEFT] );
|
eyeL->addChild( mMeshLOD[MESH_ID_EYEBALL_LEFT] );
|
||||||
}
|
}
|
||||||
|
|
||||||
LLAvatarJoint *eyeR = (LLAvatarJoint*)mRoot->findJoint("mEyeRight");
|
LLJoint *eyeR = mRoot->findJoint("mEyeRight");
|
||||||
if (eyeR)
|
if (eyeR)
|
||||||
{
|
{
|
||||||
eyeR->addChild( mMeshLOD[MESH_ID_EYEBALL_RIGHT] );
|
eyeR->addChild( mMeshLOD[MESH_ID_EYEBALL_RIGHT] );
|
||||||
|
|||||||
@@ -105,8 +105,9 @@ void LLAvatarJoint::setValid( BOOL valid, BOOL recursive )
|
|||||||
for (child_list_t::iterator iter = mChildren.begin();
|
for (child_list_t::iterator iter = mChildren.begin();
|
||||||
iter != mChildren.end(); ++iter)
|
iter != mChildren.end(); ++iter)
|
||||||
{
|
{
|
||||||
LLAvatarJoint* joint = (LLAvatarJoint*)(*iter);
|
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
||||||
joint->setValid(valid, TRUE);
|
if (joint)
|
||||||
|
joint->setValid(valid, TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,7 +125,8 @@ void LLAvatarJoint::setSkeletonComponents( U32 comp, BOOL recursive )
|
|||||||
iter != mChildren.end(); ++iter)
|
iter != mChildren.end(); ++iter)
|
||||||
{
|
{
|
||||||
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
||||||
joint->setSkeletonComponents(comp, recursive);
|
if (joint)
|
||||||
|
joint->setSkeletonComponents(comp, recursive);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -138,8 +140,9 @@ void LLAvatarJoint::setVisible(BOOL visible, BOOL recursive)
|
|||||||
for (child_list_t::iterator iter = mChildren.begin();
|
for (child_list_t::iterator iter = mChildren.begin();
|
||||||
iter != mChildren.end(); ++iter)
|
iter != mChildren.end(); ++iter)
|
||||||
{
|
{
|
||||||
LLAvatarJoint* joint = (LLAvatarJoint*)(*iter);
|
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
||||||
joint->setVisible(visible, recursive);
|
if(joint)
|
||||||
|
joint->setVisible(visible, recursive);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -150,7 +153,8 @@ void LLAvatarJoint::updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pix
|
|||||||
iter != mChildren.end(); ++iter)
|
iter != mChildren.end(); ++iter)
|
||||||
{
|
{
|
||||||
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
||||||
joint->updateFaceSizes(num_vertices, num_indices, pixel_area);
|
if (joint)
|
||||||
|
joint->updateFaceSizes(num_vertices, num_indices, pixel_area);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,7 +164,8 @@ void LLAvatarJoint::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind,
|
|||||||
iter != mChildren.end(); ++iter)
|
iter != mChildren.end(); ++iter)
|
||||||
{
|
{
|
||||||
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
||||||
joint->updateFaceData(face, pixel_area, damp_wind, terse_update);
|
if (joint)
|
||||||
|
joint->updateFaceData(face, pixel_area, damp_wind, terse_update);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,7 +175,8 @@ void LLAvatarJoint::updateJointGeometry()
|
|||||||
iter != mChildren.end(); ++iter)
|
iter != mChildren.end(); ++iter)
|
||||||
{
|
{
|
||||||
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
||||||
joint->updateJointGeometry();
|
if (joint)
|
||||||
|
joint->updateJointGeometry();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,6 +190,9 @@ BOOL LLAvatarJoint::updateLOD(F32 pixel_area, BOOL activate)
|
|||||||
iter != mChildren.end(); ++iter)
|
iter != mChildren.end(); ++iter)
|
||||||
{
|
{
|
||||||
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
||||||
|
if (!joint)
|
||||||
|
continue;
|
||||||
|
|
||||||
F32 jointLOD = joint->getLOD();
|
F32 jointLOD = joint->getLOD();
|
||||||
|
|
||||||
if (found_lod || jointLOD == DEFAULT_AVATAR_JOINT_LOD)
|
if (found_lod || jointLOD == DEFAULT_AVATAR_JOINT_LOD)
|
||||||
@@ -213,7 +222,8 @@ void LLAvatarJoint::dump()
|
|||||||
iter != mChildren.end(); ++iter)
|
iter != mChildren.end(); ++iter)
|
||||||
{
|
{
|
||||||
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
||||||
joint->dump();
|
if (joint)
|
||||||
|
joint->dump();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -260,7 +270,7 @@ void LLAvatarJointCollisionVolume::renderCollision()
|
|||||||
updateWorldMatrix();
|
updateWorldMatrix();
|
||||||
|
|
||||||
gGL.pushMatrix();
|
gGL.pushMatrix();
|
||||||
gGL.multMatrix( &mXform.getWorldMatrix().mMatrix[0][0] );
|
gGL.multMatrix( mXform.getWorldMatrix() );
|
||||||
|
|
||||||
gGL.diffuseColor3f( 0.f, 0.f, 1.f );
|
gGL.diffuseColor3f( 0.f, 0.f, 1.f );
|
||||||
|
|
||||||
|
|||||||
@@ -83,30 +83,28 @@ LLSkinJoint::~LLSkinJoint()
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLSkinJoint::setupSkinJoint()
|
// LLSkinJoint::setupSkinJoint()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLSkinJoint::setupSkinJoint( LLAvatarJoint *joint)
|
void LLSkinJoint::setupSkinJoint( LLJoint *joint)
|
||||||
{
|
{
|
||||||
|
mRootToJointSkinOffset.clearVec();
|
||||||
|
mRootToParentJointSkinOffset.clearVec();
|
||||||
|
|
||||||
// find the named joint
|
// find the named joint
|
||||||
mJoint = joint;
|
if (!(mJoint = joint))
|
||||||
if ( !mJoint )
|
|
||||||
{
|
{
|
||||||
llinfos << "Can't find joint" << llendl;
|
llinfos << "Can't find joint" << llendl;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// compute the inverse root skin matrix
|
// compute the inverse root skin matrix
|
||||||
mRootToJointSkinOffset.clearVec();
|
do
|
||||||
|
|
||||||
LLVector3 rootSkinOffset;
|
|
||||||
while (joint)
|
|
||||||
{
|
{
|
||||||
rootSkinOffset += joint->getSkinOffset();
|
mRootToJointSkinOffset -= joint->getSkinOffset();
|
||||||
joint = (LLAvatarJoint*)joint->getParent();
|
} while (joint = joint->getParent());
|
||||||
}
|
|
||||||
|
|
||||||
mRootToJointSkinOffset = -rootSkinOffset;
|
|
||||||
mRootToParentJointSkinOffset = mRootToJointSkinOffset;
|
mRootToParentJointSkinOffset = mRootToJointSkinOffset;
|
||||||
mRootToParentJointSkinOffset += mJoint->getSkinOffset();
|
mRootToParentJointSkinOffset += mJoint->getSkinOffset();
|
||||||
|
|
||||||
return TRUE;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -307,15 +305,14 @@ void LLAvatarJointMesh::setMesh( LLPolyMesh *mesh )
|
|||||||
for (jn = 0; jn < numJointNames; jn++)
|
for (jn = 0; jn < numJointNames; jn++)
|
||||||
{
|
{
|
||||||
//llinfos << "Setting up joint " << jointNames[jn] << llendl;
|
//llinfos << "Setting up joint " << jointNames[jn] << llendl;
|
||||||
LLAvatarJoint* joint = (LLAvatarJoint*)(getRoot()->findJoint(jointNames[jn]) );
|
mSkinJoints[jn].setupSkinJoint( getRoot()->findJoint(jointNames[jn]) );
|
||||||
mSkinJoints[jn].setupSkinJoint( joint );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// setup joint array
|
// setup joint array
|
||||||
if (!mMesh->isLOD())
|
if (!mMesh->isLOD())
|
||||||
{
|
{
|
||||||
setupJoint((LLAvatarJoint*)getRoot());
|
setupJoint(getRoot());
|
||||||
}
|
}
|
||||||
|
|
||||||
// llinfos << "joint render entries: " << mMesh->mJointRenderData.count() << llendl;
|
// llinfos << "joint render entries: " << mMesh->mJointRenderData.count() << llendl;
|
||||||
@@ -324,7 +321,7 @@ void LLAvatarJointMesh::setMesh( LLPolyMesh *mesh )
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// setupJoint()
|
// setupJoint()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void LLAvatarJointMesh::setupJoint(LLAvatarJoint* current_joint)
|
void LLAvatarJointMesh::setupJoint(LLJoint* current_joint)
|
||||||
{
|
{
|
||||||
// llinfos << "Mesh: " << getName() << llendl;
|
// llinfos << "Mesh: " << getName() << llendl;
|
||||||
|
|
||||||
@@ -345,7 +342,7 @@ void LLAvatarJointMesh::setupJoint(LLAvatarJoint* current_joint)
|
|||||||
if(mMesh->mJointRenderData.count() && mMesh->mJointRenderData[mMesh->mJointRenderData.count() - 1]->mWorldMatrix == ¤t_joint->getParent()->getWorldMatrix())
|
if(mMesh->mJointRenderData.count() && mMesh->mJointRenderData[mMesh->mJointRenderData.count() - 1]->mWorldMatrix == ¤t_joint->getParent()->getWorldMatrix())
|
||||||
{
|
{
|
||||||
// ...then just add ourselves
|
// ...then just add ourselves
|
||||||
LLAvatarJoint* jointp = js.mJoint;
|
LLJoint* jointp = js.mJoint;
|
||||||
mMesh->mJointRenderData.put(new LLJointRenderData(&jointp->getWorldMatrix(), &js));
|
mMesh->mJointRenderData.put(new LLJointRenderData(&jointp->getWorldMatrix(), &js));
|
||||||
// llinfos << "joint " << joint_count << js.mJoint->getName() << llendl;
|
// llinfos << "joint " << joint_count << js.mJoint->getName() << llendl;
|
||||||
// joint_count++;
|
// joint_count++;
|
||||||
@@ -366,8 +363,9 @@ void LLAvatarJointMesh::setupJoint(LLAvatarJoint* current_joint)
|
|||||||
for (LLJoint::child_list_t::iterator iter = current_joint->mChildren.begin();
|
for (LLJoint::child_list_t::iterator iter = current_joint->mChildren.begin();
|
||||||
iter != current_joint->mChildren.end(); ++iter)
|
iter != current_joint->mChildren.end(); ++iter)
|
||||||
{
|
{
|
||||||
LLAvatarJoint* child_joint = (LLAvatarJoint*)(*iter);
|
LLAvatarJoint* child_joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
||||||
setupJoint(child_joint);
|
if(child_joint)
|
||||||
|
setupJoint(child_joint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,9 +49,9 @@ class LLSkinJoint
|
|||||||
public:
|
public:
|
||||||
LLSkinJoint();
|
LLSkinJoint();
|
||||||
~LLSkinJoint();
|
~LLSkinJoint();
|
||||||
BOOL setupSkinJoint( LLAvatarJoint *joint);
|
void setupSkinJoint( LLJoint *joint);
|
||||||
|
|
||||||
LLAvatarJoint *mJoint;
|
LLJoint* mJoint;
|
||||||
LLVector3 mRootToJointSkinOffset;
|
LLVector3 mRootToJointSkinOffset;
|
||||||
LLVector3 mRootToParentJointSkinOffset;
|
LLVector3 mRootToParentJointSkinOffset;
|
||||||
};
|
};
|
||||||
@@ -122,7 +122,7 @@ public:
|
|||||||
void setMesh( LLPolyMesh *mesh );
|
void setMesh( LLPolyMesh *mesh );
|
||||||
|
|
||||||
// Sets up joint matrix data for rendering
|
// Sets up joint matrix data for rendering
|
||||||
void setupJoint(LLAvatarJoint* current_joint);
|
void setupJoint(LLJoint* current_joint);
|
||||||
|
|
||||||
// Sets ID for picking
|
// Sets ID for picking
|
||||||
void setMeshID( S32 id ) {mMeshID = id;}
|
void setMeshID( S32 id ) {mMeshID = id;}
|
||||||
|
|||||||
@@ -117,7 +117,8 @@ public:
|
|||||||
/*virtual*/ void stopAnimating(BOOL upload_bake);
|
/*virtual*/ void stopAnimating(BOOL upload_bake);
|
||||||
/*virtual*/ BOOL linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params);
|
/*virtual*/ BOOL linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params);
|
||||||
/*virtual*/ void resetDrivenParams();
|
/*virtual*/ void resetDrivenParams();
|
||||||
|
/*virtual*/ char const* getTypeString(void) const { return "param_driver"; }
|
||||||
|
|
||||||
// LLViewerVisualParam Virtual functions
|
// LLViewerVisualParam Virtual functions
|
||||||
/*virtual*/ F32 getTotalDistortion();
|
/*virtual*/ F32 getTotalDistortion();
|
||||||
/*virtual*/ const LLVector4a& getAvgDistortion();
|
/*virtual*/ const LLVector4a& getAvgDistortion();
|
||||||
|
|||||||
@@ -231,9 +231,9 @@ BOOL LLPolyMeshSharedData::allocateVertexData( U32 numVertices )
|
|||||||
mBaseCoords = (LLVector4a*) ll_aligned_malloc_16(numVertices*sizeof(LLVector4a));
|
mBaseCoords = (LLVector4a*) ll_aligned_malloc_16(numVertices*sizeof(LLVector4a));
|
||||||
mBaseNormals = (LLVector4a*) ll_aligned_malloc_16(numVertices*sizeof(LLVector4a));
|
mBaseNormals = (LLVector4a*) ll_aligned_malloc_16(numVertices*sizeof(LLVector4a));
|
||||||
mBaseBinormals = (LLVector4a*) ll_aligned_malloc_16(numVertices*sizeof(LLVector4a));
|
mBaseBinormals = (LLVector4a*) ll_aligned_malloc_16(numVertices*sizeof(LLVector4a));
|
||||||
mTexCoords = (LLVector2*) ll_aligned_malloc_16(numVertices*sizeof(LLVector2));
|
mTexCoords = (LLVector2*) ll_aligned_malloc_16((numVertices+numVertices%2)*sizeof(LLVector2));
|
||||||
mDetailTexCoords = (LLVector2*) ll_aligned_malloc_16(numVertices*sizeof(LLVector2));
|
mDetailTexCoords = (LLVector2*) ll_aligned_malloc_16((numVertices+numVertices%2)*sizeof(LLVector2));
|
||||||
mWeights = (F32*) ll_aligned_malloc_16(numVertices*sizeof(F32));
|
mWeights = (F32*) ll_aligned_malloc_16(((numVertices)*sizeof(F32)+0xF) & ~0xF);
|
||||||
for (i = 0; i < numVertices; i++)
|
for (i = 0; i < numVertices; i++)
|
||||||
{
|
{
|
||||||
mBaseCoords[i].clear();
|
mBaseCoords[i].clear();
|
||||||
@@ -1302,6 +1302,57 @@ BOOL LLPolyMesh::saveOBJ(LLFILE *fp)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Finds binormal based on three vertices with texture coordinates.
|
||||||
|
// Fills in dummy values if the triangle has degenerate texture coordinates.
|
||||||
|
void calc_binormal_from_triangle(LLVector4a& binormal,
|
||||||
|
|
||||||
|
const LLVector4a& pos0,
|
||||||
|
const LLVector2& tex0,
|
||||||
|
const LLVector4a& pos1,
|
||||||
|
const LLVector2& tex1,
|
||||||
|
const LLVector4a& pos2,
|
||||||
|
const LLVector2& tex2)
|
||||||
|
{
|
||||||
|
LLVector4a rx0( pos0[VX], tex0.mV[VX], tex0.mV[VY] );
|
||||||
|
LLVector4a rx1( pos1[VX], tex1.mV[VX], tex1.mV[VY] );
|
||||||
|
LLVector4a rx2( pos2[VX], tex2.mV[VX], tex2.mV[VY] );
|
||||||
|
|
||||||
|
LLVector4a ry0( pos0[VY], tex0.mV[VX], tex0.mV[VY] );
|
||||||
|
LLVector4a ry1( pos1[VY], tex1.mV[VX], tex1.mV[VY] );
|
||||||
|
LLVector4a ry2( pos2[VY], tex2.mV[VX], tex2.mV[VY] );
|
||||||
|
|
||||||
|
LLVector4a rz0( pos0[VZ], tex0.mV[VX], tex0.mV[VY] );
|
||||||
|
LLVector4a rz1( pos1[VZ], tex1.mV[VX], tex1.mV[VY] );
|
||||||
|
LLVector4a rz2( pos2[VZ], tex2.mV[VX], tex2.mV[VY] );
|
||||||
|
|
||||||
|
LLVector4a lhs, rhs;
|
||||||
|
|
||||||
|
LLVector4a r0;
|
||||||
|
lhs.setSub(rx0, rx1); rhs.setSub(rx0, rx2);
|
||||||
|
r0.setCross3(lhs, rhs);
|
||||||
|
|
||||||
|
LLVector4a r1;
|
||||||
|
lhs.setSub(ry0, ry1); rhs.setSub(ry0, ry2);
|
||||||
|
r1.setCross3(lhs, rhs);
|
||||||
|
|
||||||
|
LLVector4a r2;
|
||||||
|
lhs.setSub(rz0, rz1); rhs.setSub(rz0, rz2);
|
||||||
|
r2.setCross3(lhs, rhs);
|
||||||
|
|
||||||
|
if( r0[VX] && r1[VX] && r2[VX] )
|
||||||
|
{
|
||||||
|
binormal.set(
|
||||||
|
-r0[VZ] / r0[VX],
|
||||||
|
-r1[VZ] / r1[VX],
|
||||||
|
-r2[VZ] / r2[VX]);
|
||||||
|
// binormal.normVec();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
binormal.set( 0, 1 , 0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLPolyMesh::loadOBJ()
|
// LLPolyMesh::loadOBJ()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -146,10 +146,10 @@ public:
|
|||||||
class LLJointRenderData
|
class LLJointRenderData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LLJointRenderData(const LLMatrix4* world_matrix, LLSkinJoint* skin_joint) : mWorldMatrix(world_matrix), mSkinJoint(skin_joint) {}
|
LLJointRenderData(const LLMatrix4a* world_matrix, LLSkinJoint* skin_joint) : mWorldMatrix(world_matrix), mSkinJoint(skin_joint) {}
|
||||||
~LLJointRenderData(){}
|
~LLJointRenderData(){}
|
||||||
|
|
||||||
const LLMatrix4* mWorldMatrix;
|
const LLMatrix4a* mWorldMatrix;
|
||||||
LLSkinJoint* mSkinJoint;
|
LLSkinJoint* mSkinJoint;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ public:
|
|||||||
// LLVisualParam Virtual functions
|
// LLVisualParam Virtual functions
|
||||||
///*virtual*/ BOOL parseData(LLXmlTreeNode* node);
|
///*virtual*/ BOOL parseData(LLXmlTreeNode* node);
|
||||||
/*virtual*/ void apply( ESex sex );
|
/*virtual*/ void apply( ESex sex );
|
||||||
|
/*virtual*/ char const* getTypeString(void) const { return "param_morph"; }
|
||||||
|
|
||||||
// LLViewerVisualParam Virtual functions
|
// LLViewerVisualParam Virtual functions
|
||||||
/*virtual*/ F32 getTotalDistortion();
|
/*virtual*/ F32 getTotalDistortion();
|
||||||
|
|||||||
@@ -154,13 +154,13 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
|
|||||||
for (LLJoint::child_list_t::iterator iter = joint->mChildren.begin();
|
for (LLJoint::child_list_t::iterator iter = joint->mChildren.begin();
|
||||||
iter != joint->mChildren.end(); ++iter)
|
iter != joint->mChildren.end(); ++iter)
|
||||||
{
|
{
|
||||||
LLAvatarJoint* child_joint = (LLAvatarJoint*)(*iter);
|
LLAvatarJoint* child_joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
||||||
if (child_joint->inheritScale())
|
if (child_joint && child_joint->inheritScale())
|
||||||
{
|
{
|
||||||
LLVector3 childDeformation = LLVector3(child_joint->getScale());
|
LLVector3 childDeformation = LLVector3(child_joint->getScale());
|
||||||
childDeformation.scaleVec(bone_info->mScaleDeformation);
|
childDeformation.scaleVec(bone_info->mScaleDeformation);
|
||||||
mJointScales[child_joint] = childDeformation;
|
mJointScales[child_joint] = childDeformation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bone_info->mHasPositionDeformation)
|
if (bone_info->mHasPositionDeformation)
|
||||||
|
|||||||
@@ -68,7 +68,16 @@ class LLPolySkeletalDistortionInfo : public LLViewerVisualParamInfo
|
|||||||
{
|
{
|
||||||
friend class LLPolySkeletalDistortion;
|
friend class LLPolySkeletalDistortion;
|
||||||
public:
|
public:
|
||||||
|
void* operator new(size_t size)
|
||||||
|
{
|
||||||
|
return ll_aligned_malloc_16(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
void operator delete(void* ptr)
|
||||||
|
{
|
||||||
|
ll_aligned_free_16(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
LLPolySkeletalDistortionInfo();
|
LLPolySkeletalDistortionInfo();
|
||||||
/*virtual*/ ~LLPolySkeletalDistortionInfo() {};
|
/*virtual*/ ~LLPolySkeletalDistortionInfo() {};
|
||||||
|
|
||||||
@@ -77,12 +86,12 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
typedef std::vector<LLPolySkeletalBoneInfo> bone_info_list_t;
|
typedef std::vector<LLPolySkeletalBoneInfo> bone_info_list_t;
|
||||||
bone_info_list_t mBoneInfoList;
|
bone_info_list_t mBoneInfoList;
|
||||||
};
|
} LL_ALIGN_POSTFIX(16);
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLPolySkeletalDeformation
|
// LLPolySkeletalDeformation
|
||||||
// A set of joint scale data for deforming the avatar mesh
|
// A set of joint scale data for deforming the avatar mesh
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
LL_ALIGN_PREFIX(16)
|
||||||
class LLPolySkeletalDistortion : public LLViewerVisualParam
|
class LLPolySkeletalDistortion : public LLViewerVisualParam
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -109,7 +118,8 @@ public:
|
|||||||
// LLVisualParam Virtual functions
|
// LLVisualParam Virtual functions
|
||||||
///*virtual*/ BOOL parseData(LLXmlTreeNode* node);
|
///*virtual*/ BOOL parseData(LLXmlTreeNode* node);
|
||||||
/*virtual*/ void apply( ESex sex );
|
/*virtual*/ void apply( ESex sex );
|
||||||
|
/*virtual*/ char const* getTypeString(void) const { return "param_skeleton"; }
|
||||||
|
|
||||||
// LLViewerVisualParam Virtual functions
|
// LLViewerVisualParam Virtual functions
|
||||||
/*virtual*/ F32 getTotalDistortion() { return 0.1f; }
|
/*virtual*/ F32 getTotalDistortion() { return 0.1f; }
|
||||||
/*virtual*/ const LLVector4a& getAvgDistortion() { return mDefaultVec; }
|
/*virtual*/ const LLVector4a& getAvgDistortion() { return mDefaultVec; }
|
||||||
|
|||||||
@@ -1126,7 +1126,10 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
|
|||||||
// *TODO: Is this correct?
|
// *TODO: Is this correct?
|
||||||
//gPipeline.disableLights();
|
//gPipeline.disableLights();
|
||||||
stop_glerror();
|
stop_glerror();
|
||||||
glDisable(GL_LIGHTING);
|
if (!LLGLSLShader::sNoFixedFunction)
|
||||||
|
{
|
||||||
|
glDisable(GL_LIGHTING);
|
||||||
|
}
|
||||||
stop_glerror();
|
stop_glerror();
|
||||||
|
|
||||||
bool use_shaders = LLGLSLShader::sNoFixedFunction;
|
bool use_shaders = LLGLSLShader::sNoFixedFunction;
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ public:
|
|||||||
/*virtual*/ void setWeight(F32 weight, BOOL upload_bake);
|
/*virtual*/ void setWeight(F32 weight, BOOL upload_bake);
|
||||||
/*virtual*/ void setAnimationTarget(F32 target_value, BOOL upload_bake);
|
/*virtual*/ void setAnimationTarget(F32 target_value, BOOL upload_bake);
|
||||||
/*virtual*/ void animate(F32 delta, BOOL upload_bake);
|
/*virtual*/ void animate(F32 delta, BOOL upload_bake);
|
||||||
|
/*virtual*/ char const* getTypeString(void) const { return "param_alpha"; }
|
||||||
|
|
||||||
// LLViewerVisualParam Virtual functions
|
// LLViewerVisualParam Virtual functions
|
||||||
/*virtual*/ F32 getTotalDistortion() { return 1.f; }
|
/*virtual*/ F32 getTotalDistortion() { return 1.f; }
|
||||||
@@ -177,7 +178,7 @@ public:
|
|||||||
/*virtual*/ void setWeight(F32 weight, BOOL upload_bake);
|
/*virtual*/ void setWeight(F32 weight, BOOL upload_bake);
|
||||||
/*virtual*/ void setAnimationTarget(F32 target_value, BOOL upload_bake);
|
/*virtual*/ void setAnimationTarget(F32 target_value, BOOL upload_bake);
|
||||||
/*virtual*/ void animate(F32 delta, BOOL upload_bake);
|
/*virtual*/ void animate(F32 delta, BOOL upload_bake);
|
||||||
|
/*virtual*/ char const* getTypeString(void) const { return "param_color"; }
|
||||||
|
|
||||||
// LLViewerVisualParam Virtual functions
|
// LLViewerVisualParam Virtual functions
|
||||||
/*virtual*/ F32 getTotalDistortion() { return 1.f; }
|
/*virtual*/ F32 getTotalDistortion() { return 1.f; }
|
||||||
|
|||||||
@@ -143,6 +143,12 @@ BOOL LLViewerVisualParam::setInfo(LLViewerVisualParamInfo *info)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//virtual
|
||||||
|
std::string LLViewerVisualParam::getDumpWearableTypeName(void) const
|
||||||
|
{
|
||||||
|
return LLWearableType::getTypeName(LLWearableType::EType(getInfo()->mWearableType));
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
// These virtual functions should always be overridden,
|
// These virtual functions should always be overridden,
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ public:
|
|||||||
|
|
||||||
// LLVisualParam Virtual functions
|
// LLVisualParam Virtual functions
|
||||||
///*virtual*/ BOOL parseData(LLXmlTreeNode* node);
|
///*virtual*/ BOOL parseData(LLXmlTreeNode* node);
|
||||||
|
/*virtual*/ std::string getDumpWearableTypeName(void) const;
|
||||||
|
|
||||||
// New Virtual functions
|
// New Virtual functions
|
||||||
virtual F32 getTotalDistortion() = 0;
|
virtual F32 getTotalDistortion() = 0;
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ class LLVisualParam;
|
|||||||
class LLTexGlobalColorInfo;
|
class LLTexGlobalColorInfo;
|
||||||
class LLTexGlobalColor;
|
class LLTexGlobalColor;
|
||||||
class LLAvatarAppearance;
|
class LLAvatarAppearance;
|
||||||
|
class AIArchetype;
|
||||||
|
|
||||||
// Abstract class.
|
// Abstract class.
|
||||||
class LLWearable
|
class LLWearable
|
||||||
|
|||||||
@@ -611,8 +611,10 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
|
|||||||
llwarns << mCurrentDecodep->getUUID() << " has invalid vorbis data, aborting decode" << llendl;
|
llwarns << mCurrentDecodep->getUUID() << " has invalid vorbis data, aborting decode" << llendl;
|
||||||
mCurrentDecodep->flushBadFile();
|
mCurrentDecodep->flushBadFile();
|
||||||
LLAudioData *adp = gAudiop->getAudioData(mCurrentDecodep->getUUID());
|
LLAudioData *adp = gAudiop->getAudioData(mCurrentDecodep->getUUID());
|
||||||
adp->setHasValidData(false);
|
if(adp)
|
||||||
adp->setHasCompletedDecode(true);
|
{
|
||||||
|
adp->setLoadState(LLAudioData::STATE_LOAD_ERROR);
|
||||||
|
}
|
||||||
mCurrentDecodep = NULL;
|
mCurrentDecodep = NULL;
|
||||||
done = TRUE;
|
done = TRUE;
|
||||||
}
|
}
|
||||||
@@ -634,10 +636,7 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
|
|||||||
}
|
}
|
||||||
else if (mCurrentDecodep->isValid() && mCurrentDecodep->isDone())
|
else if (mCurrentDecodep->isValid() && mCurrentDecodep->isDone())
|
||||||
{
|
{
|
||||||
adp->setHasCompletedDecode(true);
|
adp->setLoadState(LLAudioData::STATE_LOAD_READY);
|
||||||
adp->setHasDecodedData(true);
|
|
||||||
adp->setHasValidData(true);
|
|
||||||
|
|
||||||
// At this point, we could see if anyone needs this sound immediately, but
|
// At this point, we could see if anyone needs this sound immediately, but
|
||||||
// I'm not sure that there's a reason to - we need to poll all of the playing
|
// I'm not sure that there's a reason to - we need to poll all of the playing
|
||||||
// sounds anyway.
|
// sounds anyway.
|
||||||
@@ -645,7 +644,7 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
adp->setHasCompletedDecode(true);
|
adp->setLoadState(LLAudioData::STATE_LOAD_ERROR);
|
||||||
llinfos << "Vorbis decode failed for " << mCurrentDecodep->getUUID() << llendl;
|
llinfos << "Vorbis decode failed for " << mCurrentDecodep->getUUID() << llendl;
|
||||||
}
|
}
|
||||||
mCurrentDecodep = NULL;
|
mCurrentDecodep = NULL;
|
||||||
@@ -685,6 +684,11 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
|
|||||||
mCurrentDecodep = new LLVorbisDecodeState(uuid, d_path);
|
mCurrentDecodep = new LLVorbisDecodeState(uuid, d_path);
|
||||||
if (!mCurrentDecodep->initDecode())
|
if (!mCurrentDecodep->initDecode())
|
||||||
{
|
{
|
||||||
|
LLAudioData *adp = gAudiop->getAudioData(uuid);
|
||||||
|
if(adp)
|
||||||
|
{
|
||||||
|
adp->setLoadState(LLAudioData::STATE_LOAD_ERROR);
|
||||||
|
}
|
||||||
mCurrentDecodep = NULL;
|
mCurrentDecodep = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -709,23 +713,13 @@ void LLAudioDecodeMgr::processQueue(const F32 num_secs)
|
|||||||
mImpl->processQueue(num_secs);
|
mImpl->processQueue(num_secs);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid)
|
bool LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid)
|
||||||
{
|
{
|
||||||
if (gAudiop->hasDecodedFile(uuid))
|
if(!uuid.notNull())
|
||||||
{
|
return false;
|
||||||
// Already have a decoded version, don't need to decode it.
|
else if (!gAssetStorage || !gAssetStorage->hasLocalAsset(uuid, LLAssetType::AT_SOUND))
|
||||||
//llinfos << "addDecodeRequest for " << uuid << " has decoded file already" << llendl;
|
return false;
|
||||||
return TRUE;
|
|
||||||
}
|
mImpl->mDecodeQueue.push(uuid);
|
||||||
|
return true;
|
||||||
if (gAssetStorage->hasLocalAsset(uuid, LLAssetType::AT_SOUND))
|
|
||||||
{
|
|
||||||
// Just put it on the decode queue.
|
|
||||||
//llinfos << "addDecodeRequest for " << uuid << " has local asset file already" << llendl;
|
|
||||||
mImpl->mDecodeQueue.push(uuid);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
//llinfos << "addDecodeRequest for " << uuid << " no file available" << llendl;
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LL_LLAUDIODECODEMGR_H
|
#ifndef LL_LLAUDIODECODEMGR_H
|
||||||
#define LL_LLAUDIODECODEMG_H
|
#define LL_LLAUDIODECODEMGR_H
|
||||||
|
|
||||||
#include "stdtypes.h"
|
#include "stdtypes.h"
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ public:
|
|||||||
~LLAudioDecodeMgr();
|
~LLAudioDecodeMgr();
|
||||||
|
|
||||||
void processQueue(const F32 num_secs = 0.005);
|
void processQueue(const F32 num_secs = 0.005);
|
||||||
BOOL addDecodeRequest(const LLUUID &uuid);
|
bool addDecodeRequest(const LLUUID &uuid);
|
||||||
void addAudioRequest(const LLUUID &uuid);
|
void addAudioRequest(const LLUUID &uuid);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -147,7 +147,7 @@ public:
|
|||||||
const LLVector3d &pos_global = LLVector3d::zero,
|
const LLVector3d &pos_global = LLVector3d::zero,
|
||||||
const LLUUID source_object = LLUUID::null);
|
const LLUUID source_object = LLUUID::null);
|
||||||
// </edit>
|
// </edit>
|
||||||
bool preloadSound(const LLUUID &id);
|
bool preloadSound(const LLUUID &id); //Preloads sounds without requiring a source.
|
||||||
|
|
||||||
void addAudioSource(LLAudioSource *asp);
|
void addAudioSource(LLAudioSource *asp);
|
||||||
void cleanupAudioSource(LLAudioSource *asp);
|
void cleanupAudioSource(LLAudioSource *asp);
|
||||||
@@ -177,9 +177,6 @@ public:
|
|||||||
void cleanupBuffer(LLAudioBuffer *bufferp);
|
void cleanupBuffer(LLAudioBuffer *bufferp);
|
||||||
|
|
||||||
bool hasDecodedFile(const LLUUID &uuid);
|
bool hasDecodedFile(const LLUUID &uuid);
|
||||||
bool hasLocalFile(const LLUUID &uuid);
|
|
||||||
|
|
||||||
bool updateBufferForData(LLAudioData *adp, const LLUUID &audio_uuid = LLUUID::null);
|
|
||||||
|
|
||||||
void setAllowLargeSounds(bool allow) { mAllowLargeSounds = allow ;}
|
void setAllowLargeSounds(bool allow) { mAllowLargeSounds = allow ;}
|
||||||
bool getAllowLargeSounds() const {return mAllowLargeSounds;}
|
bool getAllowLargeSounds() const {return mAllowLargeSounds;}
|
||||||
@@ -229,7 +226,7 @@ protected:
|
|||||||
S32 mNumChannels;
|
S32 mNumChannels;
|
||||||
bool mEnableWind;
|
bool mEnableWind;
|
||||||
|
|
||||||
LLUUID mCurrentTransfer; // Audio file currently being transferred by the system
|
LLAudioData* mCurrentTransfer; // Audio file currently being transferred by the system
|
||||||
LLFrameTimer mCurrentTransferTimer;
|
LLFrameTimer mCurrentTransferTimer;
|
||||||
|
|
||||||
// A list of all audio sources that are known to the viewer at this time.
|
// A list of all audio sources that are known to the viewer at this time.
|
||||||
@@ -244,6 +241,7 @@ public://Jay: IDGAF
|
|||||||
source_map mAllSources;
|
source_map mAllSources;
|
||||||
protected:
|
protected:
|
||||||
data_map mAllData;
|
data_map mAllData;
|
||||||
|
std::list<LLUUID> mPreloadSystemList;
|
||||||
LLAudioChannel *mChannels[MAX_CHANNELS];
|
LLAudioChannel *mChannels[MAX_CHANNELS];
|
||||||
|
|
||||||
// Buffers needs to change into a different data structure, as the number of buffers
|
// Buffers needs to change into a different data structure, as the number of buffers
|
||||||
@@ -287,9 +285,7 @@ public:
|
|||||||
virtual void update(); // Update this audio source
|
virtual void update(); // Update this audio source
|
||||||
void updatePriority();
|
void updatePriority();
|
||||||
|
|
||||||
void preload(const LLUUID &audio_id); // Only used for preloading UI sounds, now.
|
void preload(const LLUUID &audio_id);
|
||||||
|
|
||||||
void addAudioData(LLAudioData *adp, bool set_current = TRUE);
|
|
||||||
|
|
||||||
void setAmbient(const bool ambient) { mAmbient = ambient; }
|
void setAmbient(const bool ambient) { mAmbient = ambient; }
|
||||||
bool isAmbient() const { return mAmbient; }
|
bool isAmbient() const { return mAmbient; }
|
||||||
@@ -319,6 +315,7 @@ public:
|
|||||||
LLVector3d getPositionGlobal() const { return mPositionGlobal; }
|
LLVector3d getPositionGlobal() const { return mPositionGlobal; }
|
||||||
LLVector3 getVelocity() const { return mVelocity; }
|
LLVector3 getVelocity() const { return mVelocity; }
|
||||||
F32 getPriority() const { return mPriority; }
|
F32 getPriority() const { return mPriority; }
|
||||||
|
void setPriority(F32 priority) { mPriority = priority; }
|
||||||
|
|
||||||
// Gain should always be clamped between 0 and 1.
|
// Gain should always be clamped between 0 and 1.
|
||||||
F32 getGain() const { return mGain; }
|
F32 getGain() const { return mGain; }
|
||||||
@@ -402,25 +399,27 @@ public:
|
|||||||
LLUUID getID() const { return mID; }
|
LLUUID getID() const { return mID; }
|
||||||
LLAudioBuffer *getBuffer() const { return mBufferp; }
|
LLAudioBuffer *getBuffer() const { return mBufferp; }
|
||||||
|
|
||||||
bool hasLocalData() const { return mHasLocalData; }
|
enum ELoadState
|
||||||
bool hasDecodedData() const { return mHasDecodedData; }
|
{
|
||||||
bool hasCompletedDecode() const { return mHasCompletedDecode; }
|
STATE_LOAD_ERROR,
|
||||||
bool hasValidData() const { return mHasValidData; }
|
STATE_LOAD_REQ_FETCH,
|
||||||
|
STATE_LOAD_FETCHING,
|
||||||
|
STATE_LOAD_REQ_DECODE,
|
||||||
|
STATE_LOAD_DECODING,
|
||||||
|
STATE_LOAD_READY
|
||||||
|
};
|
||||||
|
ELoadState getLoadState() const { return mLoadState; }
|
||||||
|
ELoadState setLoadState(ELoadState state) { return mLoadState = state; }
|
||||||
|
bool isInPreload() const { return mLoadState > STATE_LOAD_ERROR && mLoadState < STATE_LOAD_READY; }
|
||||||
|
|
||||||
void setHasLocalData(const bool hld) { mHasLocalData = hld; }
|
void updateLoadState();
|
||||||
void setHasDecodedData(const bool hdd) { mHasDecodedData = hdd; }
|
|
||||||
void setHasCompletedDecode(const bool hcd) { mHasCompletedDecode = hcd; }
|
|
||||||
void setHasValidData(const bool hvd) { mHasValidData = hvd; }
|
|
||||||
|
|
||||||
friend class LLAudioEngine; // Severe laziness, bad.
|
friend class LLAudioEngine; // Severe laziness, bad.
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
LLUUID mID;
|
LLUUID mID;
|
||||||
LLAudioBuffer *mBufferp; // If this data is being used by the audio system, a pointer to the buffer will be set here.
|
LLAudioBuffer *mBufferp; // If this data is being used by the audio system, a pointer to the buffer will be set here.
|
||||||
bool mHasLocalData; // Set true if the sound asset file is available locally
|
ELoadState mLoadState;
|
||||||
bool mHasDecodedData; // Set true if the sound file has been decoded
|
|
||||||
bool mHasCompletedDecode; // Set true when the sound is decoded
|
|
||||||
bool mHasValidData; // Set false if decoding failed, meaning the sound asset is bad
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -450,11 +449,10 @@ protected:
|
|||||||
virtual void play() = 0;
|
virtual void play() = 0;
|
||||||
virtual void playSynced(LLAudioChannel *channelp) = 0;
|
virtual void playSynced(LLAudioChannel *channelp) = 0;
|
||||||
virtual void cleanup();
|
virtual void cleanup();
|
||||||
void setWaiting(bool waiting) { mWaiting = waiting; }
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual bool isPlaying() = 0;
|
virtual bool isPlaying() = 0;
|
||||||
bool isWaiting() const { return mWaiting; }
|
bool isFree() const { return mCurrentSourcep==NULL; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool updateBuffer(); // Check to see if the buffer associated with the source changed, and update if necessary.
|
virtual bool updateBuffer(); // Check to see if the buffer associated with the source changed, and update if necessary.
|
||||||
@@ -465,7 +463,6 @@ protected:
|
|||||||
LLAudioSource *mCurrentSourcep;
|
LLAudioSource *mCurrentSourcep;
|
||||||
LLAudioBuffer *mCurrentBufferp;
|
LLAudioBuffer *mCurrentBufferp;
|
||||||
bool mLoopedThisFrame;
|
bool mLoopedThisFrame;
|
||||||
bool mWaiting; // Waiting for sync.
|
|
||||||
F32 mSecondaryGain;
|
F32 mSecondaryGain;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -590,6 +590,7 @@ void LLAudioChannelFMOD::cleanup()
|
|||||||
}
|
}
|
||||||
|
|
||||||
mChannelID = 0;
|
mChannelID = 0;
|
||||||
|
mLastSamplePos = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -600,6 +601,12 @@ void LLAudioChannelFMOD::play()
|
|||||||
llwarns << "Playing without a channelID, aborting" << llendl;
|
llwarns << "Playing without a channelID, aborting" << llendl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!FSOUND_IsPaused(mChannelID))
|
||||||
|
{
|
||||||
|
FSOUND_SetPaused(mChannelID, true);
|
||||||
|
FSOUND_SetCurrentPosition(mChannelID, 0);
|
||||||
|
}
|
||||||
|
|
||||||
if (!FSOUND_SetPaused(mChannelID, false))
|
if (!FSOUND_SetPaused(mChannelID, false))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -59,8 +59,13 @@ bool attemptDelayLoad()
|
|||||||
{
|
{
|
||||||
__try
|
__try
|
||||||
{
|
{
|
||||||
|
#if defined(_WIN64)
|
||||||
|
if( FAILED( __HrLoadAllImportsForDll( "fmodex64.dll" ) ) )
|
||||||
|
return false;
|
||||||
|
#else
|
||||||
if( FAILED( __HrLoadAllImportsForDll( "fmodex.dll" ) ) )
|
if( FAILED( __HrLoadAllImportsForDll( "fmodex.dll" ) ) )
|
||||||
return false;
|
return false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
__except( EXCEPTION_EXECUTE_HANDLER )
|
__except( EXCEPTION_EXECUTE_HANDLER )
|
||||||
{
|
{
|
||||||
@@ -97,17 +102,17 @@ public:
|
|||||||
DEAD,
|
DEAD,
|
||||||
UNKNOWN
|
UNKNOWN
|
||||||
};
|
};
|
||||||
STATUS getPtrStatus(LLAudioChannelFMODEX* channel)
|
STATUS getPtrStatus(LLAudioChannel* channel)
|
||||||
{
|
{
|
||||||
if(!channel)
|
if(!channel)
|
||||||
return UNKNOWN;
|
return UNKNOWN;
|
||||||
return getPtrStatus(channel->mChannelp);
|
return getPtrStatus(dynamic_cast<LLAudioChannelFMODEX*>(channel)->mChannelp);
|
||||||
}
|
}
|
||||||
STATUS getPtrStatus(LLAudioBufferFMODEX* sound)
|
STATUS getPtrStatus(LLAudioBuffer* sound)
|
||||||
{
|
{
|
||||||
if(!sound)
|
if(!sound)
|
||||||
return UNKNOWN;
|
return UNKNOWN;
|
||||||
return getPtrStatus(sound->mSoundp);
|
return getPtrStatus(dynamic_cast<LLAudioBufferFMODEX*>(sound)->mSoundp);
|
||||||
}
|
}
|
||||||
STATUS getPtrStatus(FMOD::Channel* channel)
|
STATUS getPtrStatus(FMOD::Channel* channel)
|
||||||
{
|
{
|
||||||
@@ -131,18 +136,14 @@ public:
|
|||||||
}
|
}
|
||||||
void addNewSound(FMOD::Sound* sound)
|
void addNewSound(FMOD::Sound* sound)
|
||||||
{
|
{
|
||||||
llassert(getPtrStatus(sound) != ACTIVE);
|
assertActiveState(sound,true,false);
|
||||||
|
|
||||||
mDeadSounds.erase(sound);
|
mDeadSounds.erase(sound);
|
||||||
mActiveSounds.insert(std::make_pair(sound,std::set<FMOD::Channel*>()));
|
mActiveSounds.insert(std::make_pair(sound,std::set<FMOD::Channel*>()));
|
||||||
}
|
}
|
||||||
void removeSound(FMOD::Sound* sound)
|
void removeSound(FMOD::Sound* sound)
|
||||||
{
|
{
|
||||||
#ifdef SHOW_ASSERT
|
assertActiveState(sound,true);
|
||||||
STATUS status = getPtrStatus(sound);
|
|
||||||
llassert(status != DEAD);
|
|
||||||
llassert(status != UNKNOWN);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
active_sounds_t::const_iterator it = mActiveSounds.find(sound);
|
active_sounds_t::const_iterator it = mActiveSounds.find(sound);
|
||||||
llassert(it != mActiveSounds.end());
|
llassert(it != mActiveSounds.end());
|
||||||
@@ -150,49 +151,39 @@ public:
|
|||||||
{
|
{
|
||||||
if(!it->second.empty())
|
if(!it->second.empty())
|
||||||
{
|
{
|
||||||
#ifdef LL_RELEASE_FOR_DOWNLOAD
|
|
||||||
LL_WARNS("AudioImpl") << "Removing sound " << sound << " with attached channels: \n";
|
LL_WARNS("AudioImpl") << "Removing sound " << sound << " with attached channels: \n";
|
||||||
#else
|
|
||||||
LL_ERRS("AudioImpl") << "Removing sound " << sound << " with attached channels: \n";
|
|
||||||
#endif
|
|
||||||
for(std::set<FMOD::Channel*>::iterator it2 = it->second.begin(); it2 != it->second.end();++it2)
|
for(std::set<FMOD::Channel*>::iterator it2 = it->second.begin(); it2 != it->second.end();++it2)
|
||||||
{
|
{
|
||||||
switch(getPtrStatus(*it2))
|
switch(getPtrStatus(*it2))
|
||||||
{
|
{
|
||||||
case ACTIVE:
|
case ACTIVE:
|
||||||
llcont << " Channel " << *it2 << " ACTIVE\n";
|
LL_CONT << " Channel " << *it2 << " ACTIVE\n";
|
||||||
break;
|
break;
|
||||||
case DEAD:
|
case DEAD:
|
||||||
llcont << " Channel " << *it2 << " DEAD\n";
|
LL_CONT << " Channel " << *it2 << " DEAD\n";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
llcont << " Channel " << *it2 << " UNKNOWN\n";
|
LL_CONT << " Channel " << *it2 << " UNKNOWN\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
llcont << llendl;
|
LL_CONT << LL_ENDL;
|
||||||
}
|
}
|
||||||
|
llassert(it->second.empty());
|
||||||
mDeadSounds.insert(sound);
|
mDeadSounds.insert(sound);
|
||||||
mActiveSounds.erase(sound);
|
mActiveSounds.erase(sound);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void addNewChannelToSound(FMOD::Sound* sound,FMOD::Channel* channel)
|
void addNewChannelToSound(FMOD::Sound* sound,FMOD::Channel* channel)
|
||||||
{
|
{
|
||||||
STATUS status = getPtrStatus(sound);
|
assertActiveState(sound,true);
|
||||||
llassert(status != DEAD);
|
assertActiveState(channel,true,false);
|
||||||
llassert(status != UNKNOWN);
|
|
||||||
status = getPtrStatus(channel);
|
|
||||||
llassert(status != ACTIVE);
|
|
||||||
|
|
||||||
mActiveSounds[sound].insert(channel);
|
mActiveSounds[sound].insert(channel);
|
||||||
mActiveChannels.insert(std::make_pair(channel,sound));
|
mActiveChannels.insert(std::make_pair(channel,sound));
|
||||||
}
|
}
|
||||||
void removeChannel(FMOD::Channel* channel)
|
void removeChannel(FMOD::Channel* channel)
|
||||||
{
|
{
|
||||||
#ifdef SHOW_ASSERT
|
assertActiveState(channel,true);
|
||||||
STATUS status = getPtrStatus(channel);
|
|
||||||
llassert(status != DEAD);
|
|
||||||
llassert(status != UNKNOWN);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
active_channels_t::const_iterator it = mActiveChannels.find(channel);
|
active_channels_t::const_iterator it = mActiveChannels.find(channel);
|
||||||
llassert(it != mActiveChannels.end());
|
llassert(it != mActiveChannels.end());
|
||||||
@@ -214,25 +205,32 @@ public:
|
|||||||
mActiveChannels.erase(channel);
|
mActiveChannels.erase(channel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
void assertActiveState(T ptr, bool try_log=false, bool active=true)
|
||||||
|
{
|
||||||
|
#ifndef SHOW_ASSERT
|
||||||
|
if(try_log && sVerboseDebugging)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
CFMODSoundChecks::STATUS chan = getPtrStatus(ptr);
|
||||||
|
if(try_log && sVerboseDebugging)
|
||||||
|
{
|
||||||
|
if(active)
|
||||||
|
{
|
||||||
|
if(chan == CFMODSoundChecks::DEAD)
|
||||||
|
LL_WARNS("AudioImpl") << __FUNCTION__ << ": Using unexpectedly dead " << typeid(T*).name() << " " << ptr << LL_ENDL;
|
||||||
|
else if(chan == CFMODSoundChecks::UNKNOWN)
|
||||||
|
LL_WARNS("AudioImpl") << __FUNCTION__ << ": Using unexpectedly unknown " << typeid(T*).name() << " " << ptr << LL_ENDL;
|
||||||
|
}
|
||||||
|
else if(chan == CFMODSoundChecks::ACTIVE)
|
||||||
|
LL_WARNS("AudioImpl") << __FUNCTION__ << ": Using unexpectedly active " << typeid(T*).name() << " " << ptr << LL_ENDL;
|
||||||
|
}
|
||||||
|
llassert( active == (chan == CFMODSoundChecks::ACTIVE) );
|
||||||
|
}
|
||||||
|
}
|
||||||
} gSoundCheck;
|
} gSoundCheck;
|
||||||
|
|
||||||
bool isActive(LLAudioChannel* channel)
|
|
||||||
{
|
|
||||||
return gSoundCheck.getPtrStatus(dynamic_cast<LLAudioChannelFMODEX*>(channel)) == CFMODSoundChecks::ACTIVE;
|
|
||||||
}
|
|
||||||
bool isActive(LLAudioBuffer* sound)
|
|
||||||
{
|
|
||||||
return gSoundCheck.getPtrStatus(dynamic_cast<LLAudioBufferFMODEX*>(sound)) == CFMODSoundChecks::ACTIVE;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define CHECK_PTR(ptr) \
|
|
||||||
if(sVerboseDebugging){\
|
|
||||||
CFMODSoundChecks::STATUS chan = gSoundCheck.getPtrStatus(ptr); \
|
|
||||||
if(chan == CFMODSoundChecks::DEAD) \
|
|
||||||
LL_DEBUGS("AudioImpl") << __FUNCTION__ << ": Using dead " << typeid(ptr).name() << " " << ptr << llendl; \
|
|
||||||
else if(chan == CFMODSoundChecks::UNKNOWN) \
|
|
||||||
LL_DEBUGS("AudioImpl") << __FUNCTION__ << ": Using unknown " << typeid(ptr).name() << " " << ptr << llendl;} \
|
|
||||||
|
|
||||||
LLAudioEngine_FMODEX::LLAudioEngine_FMODEX(bool enable_profiler, bool verbose_debugging)
|
LLAudioEngine_FMODEX::LLAudioEngine_FMODEX(bool enable_profiler, bool verbose_debugging)
|
||||||
{
|
{
|
||||||
sVerboseDebugging = verbose_debugging;
|
sVerboseDebugging = verbose_debugging;
|
||||||
@@ -253,7 +251,7 @@ inline bool Check_FMOD_Error(FMOD_RESULT result, const char *string)
|
|||||||
{
|
{
|
||||||
if(result == FMOD_OK)
|
if(result == FMOD_OK)
|
||||||
return false;
|
return false;
|
||||||
LL_WARNS("AudioImpl") << string << " Error: " << FMOD_ErrorString(result) << llendl;
|
LL_WARNS("AudioImpl") << string << " Error: " << FMOD_ErrorString(result) << LL_ENDL;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,11 +259,11 @@ void* F_STDCALL decode_alloc(unsigned int size, FMOD_MEMORY_TYPE type, const cha
|
|||||||
{
|
{
|
||||||
if(type & FMOD_MEMORY_STREAM_DECODE)
|
if(type & FMOD_MEMORY_STREAM_DECODE)
|
||||||
{
|
{
|
||||||
LL_INFOS("AudioImpl") << "Decode buffer size: " << size << llendl;
|
LL_INFOS("AudioImpl") << "Decode buffer size: " << size << LL_ENDL;
|
||||||
}
|
}
|
||||||
else if(type & FMOD_MEMORY_STREAM_FILE)
|
else if(type & FMOD_MEMORY_STREAM_FILE)
|
||||||
{
|
{
|
||||||
LL_INFOS("AudioImpl") << "Stream buffer size: " << size << llendl;
|
LL_INFOS("AudioImpl") << "Stream buffer size: " << size << LL_ENDL;
|
||||||
}
|
}
|
||||||
return new char[size];
|
return new char[size];
|
||||||
}
|
}
|
||||||
@@ -504,7 +502,7 @@ void LLAudioEngine_FMODEX::allocateListener(void)
|
|||||||
mListenerp = (LLListener *) new LLListener_FMODEX(mSystem);
|
mListenerp = (LLListener *) new LLListener_FMODEX(mSystem);
|
||||||
if (!mListenerp)
|
if (!mListenerp)
|
||||||
{
|
{
|
||||||
LL_WARNS("AudioImpl") << "Listener creation failed" << llendl;
|
LL_WARNS("AudioImpl") << "Listener creation failed" << LL_ENDL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -513,16 +511,18 @@ void LLAudioEngine_FMODEX::shutdown()
|
|||||||
{
|
{
|
||||||
stopInternetStream();
|
stopInternetStream();
|
||||||
|
|
||||||
LL_INFOS("AudioImpl") << "About to LLAudioEngine::shutdown()" << llendl;
|
LL_INFOS("AudioImpl") << "About to LLAudioEngine::shutdown()" << LL_ENDL;
|
||||||
LLAudioEngine::shutdown();
|
LLAudioEngine::shutdown();
|
||||||
|
|
||||||
LL_INFOS("AudioImpl") << "LLAudioEngine_FMODEX::shutdown() closing FMOD Ex" << llendl;
|
LL_INFOS("AudioImpl") << "LLAudioEngine_FMODEX::shutdown() closing FMOD Ex" << LL_ENDL;
|
||||||
if ( mSystem ) // speculative fix for MAINT-2657
|
if ( mSystem ) // speculative fix for MAINT-2657
|
||||||
{
|
{
|
||||||
mSystem->close();
|
LL_INFOS("AudioImpl") << "LLAudioEngine_FMODEX::shutdown() Requesting FMOD Ex system closure" << LL_ENDL;
|
||||||
mSystem->release();
|
mSystem->close();
|
||||||
|
LL_INFOS("AudioImpl") << "LLAudioEngine_FMODEX::shutdown() Requesting FMOD Ex system release" << LL_ENDL;
|
||||||
|
mSystem->release();
|
||||||
}
|
}
|
||||||
LL_INFOS("AudioImpl") << "LLAudioEngine_FMODEX::shutdown() done closing FMOD Ex" << llendl;
|
LL_INFOS("AudioImpl") << "LLAudioEngine_FMODEX::shutdown() done closing FMOD Ex" << LL_ENDL;
|
||||||
|
|
||||||
delete mListenerp;
|
delete mListenerp;
|
||||||
mListenerp = NULL;
|
mListenerp = NULL;
|
||||||
@@ -654,7 +654,7 @@ LLAudioChannelFMODEX::LLAudioChannelFMODEX(FMOD::System *system) : LLAudioChanne
|
|||||||
LLAudioChannelFMODEX::~LLAudioChannelFMODEX()
|
LLAudioChannelFMODEX::~LLAudioChannelFMODEX()
|
||||||
{
|
{
|
||||||
if(sVerboseDebugging)
|
if(sVerboseDebugging)
|
||||||
LL_DEBUGS("AudioImpl") << "Destructing Audio Channel. mChannelp = " << mChannelp << llendl;
|
LL_DEBUGS("AudioImpl") << "Destructing Audio Channel. mChannelp = " << mChannelp << LL_ENDL;
|
||||||
|
|
||||||
cleanup();
|
cleanup();
|
||||||
}
|
}
|
||||||
@@ -678,7 +678,7 @@ void LLAudioChannelFMODEX::onRelease()
|
|||||||
{
|
{
|
||||||
llassert(mChannelp);
|
llassert(mChannelp);
|
||||||
if(sVerboseDebugging)
|
if(sVerboseDebugging)
|
||||||
LL_DEBUGS("AudioImpl") << "Fmod signaled channel release for channel " << mChannelp << llendl;
|
LL_DEBUGS("AudioImpl") << "Fmod signaled channel release for channel " << mChannelp << LL_ENDL;
|
||||||
gSoundCheck.removeChannel(mChannelp);
|
gSoundCheck.removeChannel(mChannelp);
|
||||||
mChannelp = NULL; //Null out channel here so cleanup doesn't try to redundantly stop it.
|
mChannelp = NULL; //Null out channel here so cleanup doesn't try to redundantly stop it.
|
||||||
cleanup();
|
cleanup();
|
||||||
@@ -688,42 +688,32 @@ bool LLAudioChannelFMODEX::updateBuffer()
|
|||||||
{
|
{
|
||||||
if (LLAudioChannel::updateBuffer())
|
if (LLAudioChannel::updateBuffer())
|
||||||
{
|
{
|
||||||
// Base class update returned true, which means that we need to actually
|
// Base class update returned true, which means the channel buffer was changed, and not is null.
|
||||||
// set up the channel for a different buffer.
|
|
||||||
|
|
||||||
LLAudioBufferFMODEX *bufferp = (LLAudioBufferFMODEX *)mCurrentSourcep->getCurrentBuffer();
|
|
||||||
|
|
||||||
llassert(mCurrentBufferp != NULL);
|
|
||||||
llassert(mCurrentBufferp == bufferp);
|
|
||||||
|
|
||||||
// Grab the FMOD sample associated with the buffer
|
// Grab the FMOD sample associated with the buffer
|
||||||
FMOD::Sound *soundp = bufferp->getSound();
|
FMOD::Sound *soundp = ((LLAudioBufferFMODEX*)mCurrentBufferp)->getSound();
|
||||||
if (!soundp)
|
if (!soundp)
|
||||||
{
|
{
|
||||||
// This is bad, there should ALWAYS be a sound associated with a legit
|
// This is bad, there should ALWAYS be a sound associated with a legit
|
||||||
// buffer.
|
// buffer.
|
||||||
LL_ERRS("AudioImpl") << "No FMOD sound!" << llendl;
|
LL_ERRS("AudioImpl") << "No FMOD sound!" << LL_ENDL;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Actually play the sound. Start it off paused so we can do all the necessary
|
// Actually play the sound. Start it off paused so we can do all the necessary
|
||||||
// setup.
|
// setup.
|
||||||
if(!mChannelp)
|
if(!mChannelp)
|
||||||
{
|
{
|
||||||
llassert(!isActive(this));
|
|
||||||
|
|
||||||
FMOD_RESULT result = getSystem()->playSound(FMOD_CHANNEL_FREE, soundp, true, &mChannelp);
|
FMOD_RESULT result = getSystem()->playSound(FMOD_CHANNEL_FREE, soundp, true, &mChannelp);
|
||||||
Check_FMOD_Error(result, "FMOD::System::playSound");
|
Check_FMOD_Error(result, "FMOD::System::playSound");
|
||||||
if(result == FMOD_OK)
|
if(result == FMOD_OK)
|
||||||
{
|
{
|
||||||
if(sVerboseDebugging)
|
if(sVerboseDebugging)
|
||||||
LL_DEBUGS("AudioImpl") << "Created channel " << mChannelp << " for sound " << soundp << llendl;
|
LL_DEBUGS("AudioImpl") << "Created channel " << mChannelp << " for sound " << soundp << LL_ENDL;
|
||||||
|
|
||||||
gSoundCheck.addNewChannelToSound(soundp,mChannelp);
|
gSoundCheck.addNewChannelToSound(soundp,mChannelp);
|
||||||
mChannelp->setCallback(&channel_callback);
|
mChannelp->setCallback(&channel_callback);
|
||||||
mChannelp->setUserData(this);
|
mChannelp->setUserData(this);
|
||||||
llassert(isActive(this));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -731,11 +721,9 @@ bool LLAudioChannelFMODEX::updateBuffer()
|
|||||||
// If we have a source for the channel, we need to update its gain.
|
// If we have a source for the channel, we need to update its gain.
|
||||||
if (mCurrentSourcep && mChannelp)
|
if (mCurrentSourcep && mChannelp)
|
||||||
{
|
{
|
||||||
// SJB: warnings can spam and hurt framerate, disabling
|
|
||||||
FMOD_RESULT result;
|
FMOD_RESULT result;
|
||||||
|
|
||||||
CHECK_PTR(mChannelp);
|
gSoundCheck.assertActiveState(this);
|
||||||
|
|
||||||
result = mChannelp->setVolume(getSecondaryGain() * mCurrentSourcep->getGain());
|
result = mChannelp->setVolume(getSecondaryGain() * mCurrentSourcep->getGain());
|
||||||
Check_FMOD_Error(result, "FMOD::Channel::setVolume");
|
Check_FMOD_Error(result, "FMOD::Channel::setVolume");
|
||||||
result = mChannelp->setMode(mCurrentSourcep->isLoop() ? FMOD_LOOP_NORMAL : FMOD_LOOP_OFF);
|
result = mChannelp->setMode(mCurrentSourcep->isLoop() ? FMOD_LOOP_NORMAL : FMOD_LOOP_OFF);
|
||||||
@@ -762,7 +750,7 @@ void LLAudioChannelFMODEX::update3DPosition()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CHECK_PTR(mChannelp);
|
gSoundCheck.assertActiveState(this);
|
||||||
|
|
||||||
if (mCurrentSourcep->isAmbient())
|
if (mCurrentSourcep->isAmbient())
|
||||||
{
|
{
|
||||||
@@ -790,7 +778,7 @@ void LLAudioChannelFMODEX::updateLoop()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CHECK_PTR(mChannelp);
|
gSoundCheck.assertActiveState(this);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Hack: We keep track of whether we looped or not by seeing when the
|
// Hack: We keep track of whether we looped or not by seeing when the
|
||||||
@@ -814,26 +802,20 @@ void LLAudioChannelFMODEX::cleanup()
|
|||||||
|
|
||||||
if (!mChannelp)
|
if (!mChannelp)
|
||||||
{
|
{
|
||||||
llassert(!isActive(this));
|
|
||||||
llassert(mCurrentBufferp == NULL);
|
llassert(mCurrentBufferp == NULL);
|
||||||
//llinfos << "Aborting cleanup with no channel handle." << llendl;
|
//LL_INFOS("AudioImpl") << "Aborting cleanup with no channel handle." << LL_ENDL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CHECK_PTR(mChannelp);
|
|
||||||
|
|
||||||
if(sVerboseDebugging)
|
if(sVerboseDebugging)
|
||||||
LL_DEBUGS("AudioImpl") << "Stopping channel " << mChannelp << llendl;
|
LL_DEBUGS("AudioImpl") << "Stopping channel " << mChannelp << LL_ENDL;
|
||||||
|
|
||||||
|
gSoundCheck.removeChannel(mChannelp);
|
||||||
mChannelp->setCallback(NULL);
|
mChannelp->setCallback(NULL);
|
||||||
if(!Check_FMOD_Error(mChannelp->stop(),"FMOD::Channel::stop"))
|
Check_FMOD_Error(mChannelp->stop(),"FMOD::Channel::stop");
|
||||||
{
|
|
||||||
gSoundCheck.removeChannel(mChannelp);
|
|
||||||
}
|
|
||||||
|
|
||||||
mChannelp = NULL;
|
mChannelp = NULL;
|
||||||
llassert(!isActive(this));
|
mLastSamplePos = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -841,18 +823,23 @@ void LLAudioChannelFMODEX::play()
|
|||||||
{
|
{
|
||||||
if (!mChannelp)
|
if (!mChannelp)
|
||||||
{
|
{
|
||||||
LL_WARNS("AudioImpl") << "Playing without a channel handle, aborting" << llendl;
|
LL_WARNS("AudioImpl") << "Playing without a channel handle, aborting" << LL_ENDL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
llassert(isActive(this));
|
gSoundCheck.assertActiveState(this,true);
|
||||||
|
|
||||||
CHECK_PTR(mChannelp);
|
|
||||||
|
|
||||||
|
bool paused=true;
|
||||||
|
Check_FMOD_Error(mChannelp->getPaused(&paused), "FMOD::Channel::getPaused");
|
||||||
|
if(!paused)
|
||||||
|
{
|
||||||
|
Check_FMOD_Error(mChannelp->setPaused(true), "FMOD::Channel::setPaused");
|
||||||
|
Check_FMOD_Error(mChannelp->setPosition(0,FMOD_TIMEUNIT_PCMBYTES), "FMOD::Channel::setPosition");
|
||||||
|
}
|
||||||
Check_FMOD_Error(mChannelp->setPaused(false), "FMOD::Channel::setPaused");
|
Check_FMOD_Error(mChannelp->setPaused(false), "FMOD::Channel::setPaused");
|
||||||
|
|
||||||
if(sVerboseDebugging)
|
if(sVerboseDebugging)
|
||||||
LL_DEBUGS("AudioImpl") << "Playing channel " << mChannelp << llendl;
|
LL_DEBUGS("AudioImpl") << "Playing channel " << mChannelp << LL_ENDL;
|
||||||
|
|
||||||
getSource()->setPlayedOnce(true);
|
getSource()->setPlayedOnce(true);
|
||||||
|
|
||||||
@@ -870,10 +857,10 @@ void LLAudioChannelFMODEX::playSynced(LLAudioChannel *channelp)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CHECK_PTR(mChannelp);
|
gSoundCheck.assertActiveState(this,true);
|
||||||
|
|
||||||
U32 cur_pos;
|
U32 cur_pos;
|
||||||
if(Check_FMOD_Error(mChannelp->getPosition(&cur_pos,FMOD_TIMEUNIT_PCMBYTES), "Unable to retrieve current position"))
|
if(Check_FMOD_Error(fmod_channelp->mChannelp->getPosition(&cur_pos,FMOD_TIMEUNIT_PCMBYTES), "Unable to retrieve current position"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
cur_pos %= mCurrentBufferp->getLength();
|
cur_pos %= mCurrentBufferp->getLength();
|
||||||
@@ -893,7 +880,7 @@ bool LLAudioChannelFMODEX::isPlaying()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
CHECK_PTR(mChannelp);
|
gSoundCheck.assertActiveState(this);
|
||||||
|
|
||||||
bool paused, playing;
|
bool paused, playing;
|
||||||
Check_FMOD_Error(mChannelp->getPaused(&paused),"FMOD::Channel::getPaused");
|
Check_FMOD_Error(mChannelp->getPaused(&paused),"FMOD::Channel::getPaused");
|
||||||
@@ -917,11 +904,10 @@ LLAudioBufferFMODEX::~LLAudioBufferFMODEX()
|
|||||||
if(mSoundp)
|
if(mSoundp)
|
||||||
{
|
{
|
||||||
if(sVerboseDebugging)
|
if(sVerboseDebugging)
|
||||||
LL_DEBUGS("AudioImpl") << "Release sound " << mSoundp << llendl;
|
LL_DEBUGS("AudioImpl") << "Release sound " << mSoundp << LL_ENDL;
|
||||||
|
|
||||||
CHECK_PTR(mSoundp);
|
|
||||||
Check_FMOD_Error(mSoundp->release(),"FMOD::Sound::Release");
|
|
||||||
gSoundCheck.removeSound(mSoundp);
|
gSoundCheck.removeSound(mSoundp);
|
||||||
|
Check_FMOD_Error(mSoundp->release(),"FMOD::Sound::Release");
|
||||||
mSoundp = NULL;
|
mSoundp = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -945,10 +931,9 @@ bool LLAudioBufferFMODEX::loadWAV(const std::string& filename)
|
|||||||
|
|
||||||
if (mSoundp)
|
if (mSoundp)
|
||||||
{
|
{
|
||||||
CHECK_PTR(mSoundp);
|
gSoundCheck.removeSound(mSoundp);
|
||||||
// If there's already something loaded in this buffer, clean it up.
|
// If there's already something loaded in this buffer, clean it up.
|
||||||
Check_FMOD_Error(mSoundp->release(),"FMOD::Sound::release");
|
Check_FMOD_Error(mSoundp->release(),"FMOD::Sound::release");
|
||||||
gSoundCheck.removeSound(mSoundp);
|
|
||||||
mSoundp = NULL;
|
mSoundp = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -967,7 +952,7 @@ bool LLAudioBufferFMODEX::loadWAV(const std::string& filename)
|
|||||||
if (result != FMOD_OK)
|
if (result != FMOD_OK)
|
||||||
{
|
{
|
||||||
// We failed to load the file for some reason.
|
// We failed to load the file for some reason.
|
||||||
LL_WARNS("AudioImpl") << "Could not load data '" << filename << "': " << FMOD_ErrorString(result) << llendl;
|
LL_WARNS("AudioImpl") << "Could not load data '" << filename << "': " << FMOD_ErrorString(result) << LL_ENDL;
|
||||||
|
|
||||||
//
|
//
|
||||||
// If we EVER want to load wav files provided by end users, we need
|
// If we EVER want to load wav files provided by end users, we need
|
||||||
@@ -992,7 +977,7 @@ U32 LLAudioBufferFMODEX::getLength()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
CHECK_PTR(mSoundp);
|
gSoundCheck.assertActiveState(this);
|
||||||
U32 length;
|
U32 length;
|
||||||
Check_FMOD_Error(mSoundp->getLength(&length, FMOD_TIMEUNIT_PCMBYTES),"FMOD::Sound::getLength");
|
Check_FMOD_Error(mSoundp->getLength(&length, FMOD_TIMEUNIT_PCMBYTES),"FMOD::Sound::getLength");
|
||||||
return length;
|
return length;
|
||||||
@@ -1001,7 +986,7 @@ U32 LLAudioBufferFMODEX::getLength()
|
|||||||
|
|
||||||
void LLAudioChannelFMODEX::set3DMode(bool use3d)
|
void LLAudioChannelFMODEX::set3DMode(bool use3d)
|
||||||
{
|
{
|
||||||
CHECK_PTR(mChannelp);
|
gSoundCheck.assertActiveState(this);
|
||||||
|
|
||||||
FMOD_MODE current_mode;
|
FMOD_MODE current_mode;
|
||||||
if(Check_FMOD_Error(mChannelp->getMode(¤t_mode),"FMOD::Channel::getMode"))
|
if(Check_FMOD_Error(mChannelp->getMode(¤t_mode),"FMOD::Channel::getMode"))
|
||||||
|
|||||||
@@ -189,6 +189,7 @@ void LLAudioChannelOpenAL::cleanup()
|
|||||||
LLAudioChannel::cleanup();
|
LLAudioChannel::cleanup();
|
||||||
alSourceStop(mALSource);
|
alSourceStop(mALSource);
|
||||||
alSourcei(mALSource, AL_BUFFER, AL_NONE);
|
alSourcei(mALSource, AL_BUFFER, AL_NONE);
|
||||||
|
mLastSamplePos = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLAudioChannelOpenAL::play()
|
void LLAudioChannelOpenAL::play()
|
||||||
@@ -199,11 +200,13 @@ void LLAudioChannelOpenAL::play()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isPlaying())
|
if(isPlaying())
|
||||||
{
|
{
|
||||||
alSourcePlay(mALSource);
|
alSourceStop(mALSource);
|
||||||
getSource()->setPlayedOnce(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
alSourcePlay(mALSource);
|
||||||
|
getSource()->setPlayedOnce(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLAudioChannelOpenAL::playSynced(LLAudioChannel *channelp)
|
void LLAudioChannelOpenAL::playSynced(LLAudioChannel *channelp)
|
||||||
|
|||||||
@@ -39,6 +39,13 @@ LLListener_OpenAL::~LLListener_OpenAL()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLListener_OpenAL::init()
|
||||||
|
{
|
||||||
|
// do inherited
|
||||||
|
LLListener::init();
|
||||||
|
mRolloffFactor = 1.0f;
|
||||||
|
}
|
||||||
|
|
||||||
void LLListener_OpenAL::translate(LLVector3 offset)
|
void LLListener_OpenAL::translate(LLVector3 offset)
|
||||||
{
|
{
|
||||||
//llinfos << "LLListener_OpenAL::translate() : " << offset << llendl;
|
//llinfos << "LLListener_OpenAL::translate() : " << offset << llendl;
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ class LLListener_OpenAL : public LLListener
|
|||||||
public:
|
public:
|
||||||
LLListener_OpenAL();
|
LLListener_OpenAL();
|
||||||
virtual ~LLListener_OpenAL();
|
virtual ~LLListener_OpenAL();
|
||||||
|
virtual void init();
|
||||||
|
|
||||||
virtual void translate(LLVector3 offset);
|
virtual void translate(LLVector3 offset);
|
||||||
virtual void setPosition(LLVector3 pos);
|
virtual void setPosition(LLVector3 pos);
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ set(llcharacter_SOURCE_FILES
|
|||||||
lljointsolverrp3.cpp
|
lljointsolverrp3.cpp
|
||||||
llkeyframefallmotion.cpp
|
llkeyframefallmotion.cpp
|
||||||
llkeyframemotion.cpp
|
llkeyframemotion.cpp
|
||||||
llkeyframemotionparam.cpp
|
|
||||||
llkeyframestandmotion.cpp
|
llkeyframestandmotion.cpp
|
||||||
llkeyframewalkmotion.cpp
|
llkeyframewalkmotion.cpp
|
||||||
llmotion.cpp
|
llmotion.cpp
|
||||||
@@ -57,7 +56,6 @@ set(llcharacter_HEADER_FILES
|
|||||||
lljointstate.h
|
lljointstate.h
|
||||||
llkeyframefallmotion.h
|
llkeyframefallmotion.h
|
||||||
llkeyframemotion.h
|
llkeyframemotion.h
|
||||||
llkeyframemotionparam.h
|
|
||||||
llkeyframestandmotion.h
|
llkeyframestandmotion.h
|
||||||
llkeyframewalkmotion.h
|
llkeyframewalkmotion.h
|
||||||
llmotion.h
|
llmotion.h
|
||||||
|
|||||||
@@ -72,21 +72,11 @@ LLCharacter::~LLCharacter()
|
|||||||
delete param;
|
delete param;
|
||||||
}
|
}
|
||||||
|
|
||||||
U32 i ;
|
bool erased = vector_replace_with_last(sInstances,this);
|
||||||
U32 size = sInstances.size() ;
|
|
||||||
for(i = 0 ; i < size ; i++)
|
|
||||||
{
|
|
||||||
if(sInstances[i] == this)
|
|
||||||
{
|
|
||||||
break ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
llassert_always(i < size) ;
|
llassert_always(erased) ;
|
||||||
|
|
||||||
llassert_always(sAllowInstancesChange) ;
|
llassert_always(sAllowInstancesChange) ;
|
||||||
sInstances[i] = sInstances[size - 1] ;
|
|
||||||
sInstances.pop_back() ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -136,7 +126,6 @@ LLMotion* LLCharacter::findMotion( const LLUUID &id )
|
|||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// createMotion()
|
// createMotion()
|
||||||
// NOTE: Always assign the result to a LLPointer!
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
LLMotion* LLCharacter::createMotion( const LLUUID &id )
|
LLMotion* LLCharacter::createMotion( const LLUUID &id )
|
||||||
{
|
{
|
||||||
@@ -195,11 +184,26 @@ void LLCharacter::updateMotions(e_update_t update_type)
|
|||||||
{
|
{
|
||||||
if (update_type == HIDDEN_UPDATE)
|
if (update_type == HIDDEN_UPDATE)
|
||||||
{
|
{
|
||||||
|
//<singu>
|
||||||
|
// Keep updating avatars that have at least one motion that is synchronized with a still running motion.
|
||||||
|
// This call tells the other controllers that we are in principle hidden.
|
||||||
|
// It returns false if we need to keep updating anyway.
|
||||||
|
if (!mMotionController.hidden(true))
|
||||||
|
{
|
||||||
|
mMotionController.updateMotions(LLCharacter::NORMAL_UPDATE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//</singu>
|
||||||
LLFastTimer t(FTM_UPDATE_HIDDEN_ANIMATION);
|
LLFastTimer t(FTM_UPDATE_HIDDEN_ANIMATION);
|
||||||
mMotionController.updateMotionsMinimal();
|
mMotionController.updateMotionsMinimal();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
//<singu>
|
||||||
|
// This call tells the other controllers that we are visible and that they need
|
||||||
|
// to keep updating if they are synchronized with us, even if they are hidden.
|
||||||
|
mMotionController.hidden(false);
|
||||||
|
//</singu>
|
||||||
LLFastTimer t(FTM_UPDATE_ANIMATION);
|
LLFastTimer t(FTM_UPDATE_ANIMATION);
|
||||||
// unpause if the number of outstanding pause requests has dropped to the initial one
|
// unpause if the number of outstanding pause requests has dropped to the initial one
|
||||||
if (mMotionController.isPaused() && mPauseRequest->getNumRefs() == 1)
|
if (mMotionController.isPaused() && mPauseRequest->getNumRefs() == 1)
|
||||||
@@ -529,3 +533,17 @@ LLAnimPauseRequest LLCharacter::requestPause()
|
|||||||
return mPauseRequest;
|
return mPauseRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLCharacter::requestPause(std::vector<LLAnimPauseRequest>& avatar_pause_handles)
|
||||||
|
{
|
||||||
|
mMotionController.pauseAllMotions();
|
||||||
|
avatar_pause_handles.push_back(mPauseRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLCharacter::pauseAllSyncedCharacters(std::vector<LLAnimPauseRequest>& avatar_pause_handles)
|
||||||
|
{
|
||||||
|
// Pause this avatar.
|
||||||
|
requestPause(avatar_pause_handles);
|
||||||
|
// Also pause all avatars with synchronized motions.
|
||||||
|
mMotionController.pauseAllSyncedCharacters(avatar_pause_handles);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ public:
|
|||||||
|
|
||||||
// is this motion active?
|
// is this motion active?
|
||||||
BOOL isMotionActive( const LLUUID& id );
|
BOOL isMotionActive( const LLUUID& id );
|
||||||
|
bool isMotionActive(U32 bit) const { return mMotionController.isactive(bit); }
|
||||||
|
|
||||||
// Event handler for motion deactivation.
|
// Event handler for motion deactivation.
|
||||||
// Called when a motion has completely stopped and has been deactivated.
|
// Called when a motion has completely stopped and has been deactivated.
|
||||||
@@ -158,6 +159,8 @@ public:
|
|||||||
void updateMotions(e_update_t update_type);
|
void updateMotions(e_update_t update_type);
|
||||||
|
|
||||||
LLAnimPauseRequest requestPause();
|
LLAnimPauseRequest requestPause();
|
||||||
|
void requestPause(std::vector<LLAnimPauseRequest>& avatar_pause_handles);
|
||||||
|
void pauseAllSyncedCharacters(std::vector<LLAnimPauseRequest>& avatar_pause_handles);
|
||||||
BOOL areAnimationsPaused() const { return mMotionController.isPaused(); }
|
BOOL areAnimationsPaused() const { return mMotionController.isPaused(); }
|
||||||
void setAnimTimeFactor(F32 factor) { mMotionController.setTimeFactor(factor); }
|
void setAnimTimeFactor(F32 factor) { mMotionController.setTimeFactor(factor); }
|
||||||
void setTimeStep(F32 time_step) { mMotionController.setTimeStep(time_step); }
|
void setTimeStep(F32 time_step) { mMotionController.setTimeStep(time_step); }
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ S32 LLEditingMotion::sHandPosePriority = 3;
|
|||||||
// LLEditingMotion()
|
// LLEditingMotion()
|
||||||
// Class Constructor
|
// Class Constructor
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
LLEditingMotion::LLEditingMotion( const LLUUID &id) : LLMotion(id)
|
LLEditingMotion::LLEditingMotion(LLUUID const& id, LLMotionController* controller) : AIMaskedMotion(id, controller, ANIM_AGENT_EDITING)
|
||||||
{
|
{
|
||||||
mCharacter = NULL;
|
mCharacter = NULL;
|
||||||
|
|
||||||
@@ -155,7 +155,7 @@ BOOL LLEditingMotion::onActivate()
|
|||||||
mShoulderJoint.setRotation( mShoulderState->getJoint()->getRotation() );
|
mShoulderJoint.setRotation( mShoulderState->getJoint()->getRotation() );
|
||||||
mElbowJoint.setRotation( mElbowState->getJoint()->getRotation() );
|
mElbowJoint.setRotation( mElbowState->getJoint()->getRotation() );
|
||||||
|
|
||||||
return TRUE;
|
return AIMaskedMotion::onActivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -215,7 +215,16 @@ BOOL LLEditingMotion::onUpdate(F32 time, U8* joint_mask)
|
|||||||
if (!target.isFinite())
|
if (!target.isFinite())
|
||||||
{
|
{
|
||||||
llwarns << "Non finite target in editing motion with target distance of " << target_dist <<
|
llwarns << "Non finite target in editing motion with target distance of " << target_dist <<
|
||||||
" and focus point " << focus_pt << " and pointAtPt: " << *pointAtPt << llendl;
|
" and focus point " << focus_pt << " and pointAtPt: ";
|
||||||
|
if (pointAtPt)
|
||||||
|
{
|
||||||
|
llcont << *pointAtPt;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
llcont << "NULL";
|
||||||
|
}
|
||||||
|
llcont << llendl;
|
||||||
}
|
}
|
||||||
|
|
||||||
mTarget.setPosition( target + mParentJoint.getPosition());
|
mTarget.setPosition( target + mParentJoint.getPosition());
|
||||||
@@ -247,12 +256,4 @@ BOOL LLEditingMotion::onUpdate(F32 time, U8* joint_mask)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// LLEditingMotion::onDeactivate()
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
void LLEditingMotion::onDeactivate()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// End
|
// End
|
||||||
|
|||||||
@@ -49,11 +49,11 @@
|
|||||||
// class LLEditingMotion
|
// class LLEditingMotion
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
class LLEditingMotion :
|
class LLEditingMotion :
|
||||||
public LLMotion
|
public AIMaskedMotion
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
LLEditingMotion(const LLUUID &id);
|
LLEditingMotion(LLUUID const& id, LLMotionController* controller);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
virtual ~LLEditingMotion();
|
virtual ~LLEditingMotion();
|
||||||
@@ -65,7 +65,7 @@ public:
|
|||||||
|
|
||||||
// static constructor
|
// static constructor
|
||||||
// all subclasses must implement such a function and register it
|
// all subclasses must implement such a function and register it
|
||||||
static LLMotion *create(const LLUUID &id) { return new LLEditingMotion(id); }
|
static LLMotion* create(LLUUID const& id, LLMotionController* controller) { return new LLEditingMotion(id, controller); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
@@ -107,9 +107,6 @@ public:
|
|||||||
// must return FALSE when the motion is completed.
|
// must return FALSE when the motion is completed.
|
||||||
virtual BOOL onUpdate(F32 time, U8* joint_mask);
|
virtual BOOL onUpdate(F32 time, U8* joint_mask);
|
||||||
|
|
||||||
// called when a motion is deactivated
|
|
||||||
virtual void onDeactivate();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// joint states to be animated
|
// joint states to be animated
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ const F32 HAND_MORPH_BLEND_TIME = 0.2f;
|
|||||||
// LLHandMotion()
|
// LLHandMotion()
|
||||||
// Class Constructor
|
// Class Constructor
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
LLHandMotion::LLHandMotion(const LLUUID &id) : LLMotion(id)
|
LLHandMotion::LLHandMotion(LLUUID const& id, LLMotionController* controller) : AIMaskedMotion(id, controller, ANIM_AGENT_HAND_MOTION)
|
||||||
{
|
{
|
||||||
mCharacter = NULL;
|
mCharacter = NULL;
|
||||||
mLastTime = 0.f;
|
mLastTime = 0.f;
|
||||||
@@ -112,7 +112,7 @@ BOOL LLHandMotion::onActivate()
|
|||||||
mCharacter->setVisualParamWeight(gHandPoseNames[mCurrentPose], 1.f);
|
mCharacter->setVisualParamWeight(gHandPoseNames[mCurrentPose], 1.f);
|
||||||
mCharacter->updateVisualParams();
|
mCharacter->updateVisualParams();
|
||||||
}
|
}
|
||||||
return TRUE;
|
return AIMaskedMotion::onActivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -235,14 +235,6 @@ BOOL LLHandMotion::onUpdate(F32 time, U8* joint_mask)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// LLHandMotion::onDeactivate()
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
void LLHandMotion::onDeactivate()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLHandMotion::getHandPoseName()
|
// LLHandMotion::getHandPoseName()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
// class LLHandMotion
|
// class LLHandMotion
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
class LLHandMotion :
|
class LLHandMotion :
|
||||||
public LLMotion
|
public AIMaskedMotion
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef enum e_hand_pose
|
typedef enum e_hand_pose
|
||||||
@@ -68,7 +68,7 @@ public:
|
|||||||
} eHandPose;
|
} eHandPose;
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
LLHandMotion(const LLUUID &id);
|
LLHandMotion(LLUUID const& id, LLMotionController* controller);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
virtual ~LLHandMotion();
|
virtual ~LLHandMotion();
|
||||||
@@ -80,7 +80,7 @@ public:
|
|||||||
|
|
||||||
// static constructor
|
// static constructor
|
||||||
// all subclasses must implement such a function and register it
|
// all subclasses must implement such a function and register it
|
||||||
static LLMotion *create(const LLUUID &id) { return new LLHandMotion(id); }
|
static LLMotion* create(LLUUID const& id, LLMotionController* controller) { return new LLHandMotion(id, controller); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
@@ -122,9 +122,6 @@ public:
|
|||||||
// must return FALSE when the motion is completed.
|
// must return FALSE when the motion is completed.
|
||||||
virtual BOOL onUpdate(F32 time, U8* joint_mask);
|
virtual BOOL onUpdate(F32 time, U8* joint_mask);
|
||||||
|
|
||||||
// called when a motion is deactivated
|
|
||||||
virtual void onDeactivate();
|
|
||||||
|
|
||||||
virtual BOOL canDeprecate() { return FALSE; }
|
virtual BOOL canDeprecate() { return FALSE; }
|
||||||
|
|
||||||
static std::string getHandPoseName(eHandPose pose);
|
static std::string getHandPoseName(eHandPose pose);
|
||||||
|
|||||||
@@ -76,8 +76,8 @@ const F32 EYE_BLINK_TIME_DELTA = 0.005f; // time between one eye starting a blin
|
|||||||
// LLHeadRotMotion()
|
// LLHeadRotMotion()
|
||||||
// Class Constructor
|
// Class Constructor
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
LLHeadRotMotion::LLHeadRotMotion(const LLUUID &id) :
|
LLHeadRotMotion::LLHeadRotMotion(LLUUID const& id, LLMotionController* controller) :
|
||||||
LLMotion(id),
|
AIMaskedMotion(id, controller, ANIM_AGENT_HEAD_ROT),
|
||||||
mCharacter(NULL),
|
mCharacter(NULL),
|
||||||
mTorsoJoint(NULL),
|
mTorsoJoint(NULL),
|
||||||
mHeadJoint(NULL)
|
mHeadJoint(NULL)
|
||||||
@@ -104,7 +104,10 @@ LLHeadRotMotion::~LLHeadRotMotion()
|
|||||||
LLMotion::LLMotionInitStatus LLHeadRotMotion::onInitialize(LLCharacter *character)
|
LLMotion::LLMotionInitStatus LLHeadRotMotion::onInitialize(LLCharacter *character)
|
||||||
{
|
{
|
||||||
if (!character)
|
if (!character)
|
||||||
|
{
|
||||||
|
llwarns << "character is NULL." << llendl;
|
||||||
return STATUS_FAILURE;
|
return STATUS_FAILURE;
|
||||||
|
}
|
||||||
mCharacter = character;
|
mCharacter = character;
|
||||||
|
|
||||||
mPelvisJoint = character->getJoint("mPelvis");
|
mPelvisJoint = character->getJoint("mPelvis");
|
||||||
@@ -169,16 +172,6 @@ LLMotion::LLMotionInitStatus LLHeadRotMotion::onInitialize(LLCharacter *characte
|
|||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// LLHeadRotMotion::onActivate()
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
BOOL LLHeadRotMotion::onActivate()
|
|
||||||
{
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLHeadRotMotion::onUpdate()
|
// LLHeadRotMotion::onUpdate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -263,19 +256,11 @@ BOOL LLHeadRotMotion::onUpdate(F32 time, U8* joint_mask)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// LLHeadRotMotion::onDeactivate()
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
void LLHeadRotMotion::onDeactivate()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLEyeMotion()
|
// LLEyeMotion()
|
||||||
// Class Constructor
|
// Class Constructor
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
LLEyeMotion::LLEyeMotion(const LLUUID &id) : LLMotion(id)
|
LLEyeMotion::LLEyeMotion(LLUUID const& id, LLMotionController* controller) : AIMaskedMotion(id, controller, ANIM_AGENT_EYE)
|
||||||
{
|
{
|
||||||
mCharacter = NULL;
|
mCharacter = NULL;
|
||||||
mEyeJitterTime = 0.f;
|
mEyeJitterTime = 0.f;
|
||||||
@@ -343,16 +328,6 @@ LLMotion::LLMotionInitStatus LLEyeMotion::onInitialize(LLCharacter *character)
|
|||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// LLEyeMotion::onActivate()
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
BOOL LLEyeMotion::onActivate()
|
|
||||||
{
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLEyeMotion::onUpdate()
|
// LLEyeMotion::onUpdate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -533,6 +508,8 @@ void LLEyeMotion::onDeactivate()
|
|||||||
{
|
{
|
||||||
joint->setRotation(LLQuaternion::DEFAULT);
|
joint->setRotation(LLQuaternion::DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AIMaskedMotion::onDeactivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
// End
|
// End
|
||||||
|
|||||||
@@ -46,11 +46,11 @@
|
|||||||
// class LLHeadRotMotion
|
// class LLHeadRotMotion
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
class LLHeadRotMotion :
|
class LLHeadRotMotion :
|
||||||
public LLMotion
|
public AIMaskedMotion
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
LLHeadRotMotion(const LLUUID &id);
|
LLHeadRotMotion(LLUUID const& id, LLMotionController* controller);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
virtual ~LLHeadRotMotion();
|
virtual ~LLHeadRotMotion();
|
||||||
@@ -62,7 +62,7 @@ public:
|
|||||||
|
|
||||||
// static constructor
|
// static constructor
|
||||||
// all subclasses must implement such a function and register it
|
// all subclasses must implement such a function and register it
|
||||||
static LLMotion *create(const LLUUID &id) { return new LLHeadRotMotion(id); }
|
static LLMotion* create(LLUUID const& id, LLMotionController* controller) { return new LLHeadRotMotion(id, controller); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
@@ -94,19 +94,11 @@ public:
|
|||||||
// must return true to indicate success and be available for activation
|
// must return true to indicate success and be available for activation
|
||||||
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
||||||
|
|
||||||
// called when a motion is activated
|
|
||||||
// must return TRUE to indicate success, or else
|
|
||||||
// it will be deactivated
|
|
||||||
virtual BOOL onActivate();
|
|
||||||
|
|
||||||
// called per time step
|
// called per time step
|
||||||
// must return TRUE while it is active, and
|
// must return TRUE while it is active, and
|
||||||
// must return FALSE when the motion is completed.
|
// must return FALSE when the motion is completed.
|
||||||
virtual BOOL onUpdate(F32 time, U8* joint_mask);
|
virtual BOOL onUpdate(F32 time, U8* joint_mask);
|
||||||
|
|
||||||
// called when a motion is deactivated
|
|
||||||
virtual void onDeactivate();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// joint states to be animated
|
// joint states to be animated
|
||||||
@@ -129,11 +121,11 @@ public:
|
|||||||
// class LLEyeMotion
|
// class LLEyeMotion
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
class LLEyeMotion :
|
class LLEyeMotion :
|
||||||
public LLMotion
|
public AIMaskedMotion
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
LLEyeMotion(const LLUUID &id);
|
LLEyeMotion(LLUUID const& id, LLMotionController* controller);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
virtual ~LLEyeMotion();
|
virtual ~LLEyeMotion();
|
||||||
@@ -145,7 +137,7 @@ public:
|
|||||||
|
|
||||||
// static constructor
|
// static constructor
|
||||||
// all subclasses must implement such a function and register it
|
// all subclasses must implement such a function and register it
|
||||||
static LLMotion *create( const LLUUID &id) { return new LLEyeMotion(id); }
|
static LLMotion* create(LLUUID const& id, LLMotionController* controller) { return new LLEyeMotion(id, controller); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
@@ -177,11 +169,6 @@ public:
|
|||||||
// must return true to indicate success and be available for activation
|
// must return true to indicate success and be available for activation
|
||||||
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
||||||
|
|
||||||
// called when a motion is activated
|
|
||||||
// must return TRUE to indicate success, or else
|
|
||||||
// it will be deactivated
|
|
||||||
virtual BOOL onActivate();
|
|
||||||
|
|
||||||
// called per time step
|
// called per time step
|
||||||
// must return TRUE while it is active, and
|
// must return TRUE while it is active, and
|
||||||
// must return FALSE when the motion is completed.
|
// must return FALSE when the motion is completed.
|
||||||
|
|||||||
@@ -312,19 +312,15 @@ void LLJoint::setWorldPosition( const LLVector3& pos )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLMatrix4 temp_matrix = getWorldMatrix();
|
LLMatrix4a temp_matrix = getWorldMatrix();
|
||||||
temp_matrix.mMatrix[VW][VX] = pos.mV[VX];
|
temp_matrix.setTranslate_affine(pos);
|
||||||
temp_matrix.mMatrix[VW][VY] = pos.mV[VY];
|
|
||||||
temp_matrix.mMatrix[VW][VZ] = pos.mV[VZ];
|
|
||||||
|
|
||||||
LLMatrix4 parentWorldMatrix = mParent->getWorldMatrix();
|
LLMatrix4a invParentWorldMatrix = mParent->getWorldMatrix();
|
||||||
LLMatrix4 invParentWorldMatrix = parentWorldMatrix.invert();
|
invParentWorldMatrix.invert();
|
||||||
|
|
||||||
temp_matrix *= invParentWorldMatrix;
|
invParentWorldMatrix.mul(temp_matrix);
|
||||||
|
|
||||||
LLVector3 localPos( temp_matrix.mMatrix[VW][VX],
|
LLVector3 localPos( invParentWorldMatrix.getRow<LLMatrix4a::ROW_TRANS>().getF32ptr() );
|
||||||
temp_matrix.mMatrix[VW][VY],
|
|
||||||
temp_matrix.mMatrix[VW][VZ] );
|
|
||||||
|
|
||||||
setPosition( localPos );
|
setPosition( localPos );
|
||||||
}
|
}
|
||||||
@@ -383,19 +379,19 @@ void LLJoint::setWorldRotation( const LLQuaternion& rot )
|
|||||||
this->setRotation( rot );
|
this->setRotation( rot );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LLMatrix4a parentWorldMatrix = mParent->getWorldMatrix();
|
||||||
|
LLQuaternion2 rota(rot);
|
||||||
|
LLMatrix4a temp_mat(rota);
|
||||||
|
|
||||||
LLMatrix4 temp_mat(rot);
|
LLMatrix4a invParentWorldMatrix = mParent->getWorldMatrix();
|
||||||
|
invParentWorldMatrix.setTranslate_affine(LLVector3(0.f));
|
||||||
|
|
||||||
LLMatrix4 parentWorldMatrix = mParent->getWorldMatrix();
|
invParentWorldMatrix.invert();
|
||||||
parentWorldMatrix.mMatrix[VW][VX] = 0;
|
|
||||||
parentWorldMatrix.mMatrix[VW][VY] = 0;
|
|
||||||
parentWorldMatrix.mMatrix[VW][VZ] = 0;
|
|
||||||
|
|
||||||
LLMatrix4 invParentWorldMatrix = parentWorldMatrix.invert();
|
invParentWorldMatrix.mul(temp_mat);
|
||||||
|
|
||||||
temp_mat *= invParentWorldMatrix;
|
setRotation(LLQuaternion(LLMatrix4(invParentWorldMatrix.getF32ptr())));
|
||||||
|
|
||||||
setRotation(LLQuaternion(temp_mat));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -425,7 +421,7 @@ void LLJoint::setScale( const LLVector3& scale )
|
|||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// getWorldMatrix()
|
// getWorldMatrix()
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
const LLMatrix4 &LLJoint::getWorldMatrix()
|
const LLMatrix4a &LLJoint::getWorldMatrix()
|
||||||
{
|
{
|
||||||
updateWorldMatrixParent();
|
updateWorldMatrixParent();
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
#include "lldarray.h"
|
#include "lldarray.h"
|
||||||
|
|
||||||
const S32 LL_CHARACTER_MAX_JOINTS_PER_MESH = 15;
|
const S32 LL_CHARACTER_MAX_JOINTS_PER_MESH = 15;
|
||||||
const U32 LL_CHARACTER_MAX_JOINTS = 32; // must be divisible by 4!
|
const U32 LL_CHARACTER_MAX_JOINTS = 32; // must be divisible by 16!
|
||||||
const U32 LL_HAND_JOINT_NUM = 31;
|
const U32 LL_HAND_JOINT_NUM = 31;
|
||||||
const U32 LL_FACE_JOINT_NUM = 30;
|
const U32 LL_FACE_JOINT_NUM = 30;
|
||||||
const S32 LL_CHARACTER_MAX_PRIORITY = 7;
|
const S32 LL_CHARACTER_MAX_PRIORITY = 7;
|
||||||
@@ -162,7 +162,7 @@ public:
|
|||||||
void setScale( const LLVector3& scale );
|
void setScale( const LLVector3& scale );
|
||||||
|
|
||||||
// get/set world matrix
|
// get/set world matrix
|
||||||
const LLMatrix4 &getWorldMatrix();
|
const LLMatrix4a &getWorldMatrix();
|
||||||
void setWorldMatrix( const LLMatrix4& mat );
|
void setWorldMatrix( const LLMatrix4& mat );
|
||||||
|
|
||||||
void updateWorldMatrixChildren();
|
void updateWorldMatrixChildren();
|
||||||
|
|||||||
@@ -171,12 +171,14 @@ void LLJointSolverRP3::solve()
|
|||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// get the poleVector in world space
|
// get the poleVector in world space
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
LLMatrix4 worldJointAParentMat;
|
LLVector3 poleVec = mPoleVector;
|
||||||
if ( mJointA->getParent() )
|
if ( mJointA->getParent() )
|
||||||
{
|
{
|
||||||
worldJointAParentMat = mJointA->getParent()->getWorldMatrix();
|
LLVector4a pole_veca;
|
||||||
|
pole_veca.load3(mPoleVector.mV);
|
||||||
|
mJointA->getParent()->getWorldMatrix().rotate(pole_veca,pole_veca);
|
||||||
|
poleVec.set(pole_veca.getF32ptr());
|
||||||
}
|
}
|
||||||
LLVector3 poleVec = rotate_vector( mPoleVector, worldJointAParentMat );
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// compute the following:
|
// compute the following:
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
// LLKeyframeFallMotion()
|
// LLKeyframeFallMotion()
|
||||||
// Class Constructor
|
// Class Constructor
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
LLKeyframeFallMotion::LLKeyframeFallMotion(const LLUUID &id) : LLKeyframeMotion(id)
|
LLKeyframeFallMotion::LLKeyframeFallMotion(LLUUID const& id, LLMotionController* controller) : LLKeyframeMotion(id, controller)
|
||||||
{
|
{
|
||||||
mVelocityZ = 0.f;
|
mVelocityZ = 0.f;
|
||||||
mCharacter = NULL;
|
mCharacter = NULL;
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class LLKeyframeFallMotion :
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
LLKeyframeFallMotion(const LLUUID &id);
|
LLKeyframeFallMotion(LLUUID const& id, LLMotionController* controller);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
virtual ~LLKeyframeFallMotion();
|
virtual ~LLKeyframeFallMotion();
|
||||||
@@ -59,7 +59,7 @@ public:
|
|||||||
|
|
||||||
// static constructor
|
// static constructor
|
||||||
// all subclasses must implement such a function and register it
|
// all subclasses must implement such a function and register it
|
||||||
static LLMotion *create(const LLUUID &id) { return new LLKeyframeFallMotion(id); }
|
static LLMotion* create(LLUUID const& id, LLMotionController* controller) { return new LLKeyframeFallMotion(id, controller); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -84,38 +84,55 @@ LLKeyframeMotion::JointMotionList::~JointMotionList()
|
|||||||
for_each(mJointMotionArray.begin(), mJointMotionArray.end(), DeletePointer());
|
for_each(mJointMotionArray.begin(), mJointMotionArray.end(), DeletePointer());
|
||||||
}
|
}
|
||||||
|
|
||||||
U32 LLKeyframeMotion::JointMotionList::dumpDiagInfo()
|
//Singu: add parameter 'silent'.
|
||||||
|
U32 LLKeyframeMotion::JointMotionList::dumpDiagInfo(bool silent) const
|
||||||
{
|
{
|
||||||
S32 total_size = sizeof(JointMotionList);
|
S32 total_size = sizeof(JointMotionList);
|
||||||
|
|
||||||
for (U32 i = 0; i < getNumJointMotions(); i++)
|
for (U32 i = 0; i < getNumJointMotions(); i++)
|
||||||
{
|
{
|
||||||
LLKeyframeMotion::JointMotion* joint_motion_p = mJointMotionArray[i];
|
LLKeyframeMotion::JointMotion const* joint_motion_p = mJointMotionArray[i];
|
||||||
|
|
||||||
llinfos << "\tJoint " << joint_motion_p->mJointName << llendl;
|
if (!silent)
|
||||||
|
{
|
||||||
|
llinfos << "\tJoint " << joint_motion_p->mJointName << llendl;
|
||||||
|
}
|
||||||
if (joint_motion_p->mUsage & LLJointState::SCALE)
|
if (joint_motion_p->mUsage & LLJointState::SCALE)
|
||||||
{
|
{
|
||||||
llinfos << "\t" << joint_motion_p->mScaleCurve.mNumKeys << " scale keys at "
|
if (!silent)
|
||||||
<< joint_motion_p->mScaleCurve.mNumKeys * sizeof(ScaleKey) << " bytes" << llendl;
|
{
|
||||||
|
llinfos << "\t" << joint_motion_p->mScaleCurve.mNumKeys << " scale keys at "
|
||||||
|
<< joint_motion_p->mScaleCurve.mNumKeys * sizeof(ScaleKey) << " bytes" << llendl;
|
||||||
|
}
|
||||||
total_size += joint_motion_p->mScaleCurve.mNumKeys * sizeof(ScaleKey);
|
total_size += joint_motion_p->mScaleCurve.mNumKeys * sizeof(ScaleKey);
|
||||||
}
|
}
|
||||||
if (joint_motion_p->mUsage & LLJointState::ROT)
|
if (joint_motion_p->mUsage & LLJointState::ROT)
|
||||||
{
|
{
|
||||||
llinfos << "\t" << joint_motion_p->mRotationCurve.mNumKeys << " rotation keys at "
|
if (!silent)
|
||||||
<< joint_motion_p->mRotationCurve.mNumKeys * sizeof(RotationKey) << " bytes" << llendl;
|
{
|
||||||
|
llinfos << "\t" << joint_motion_p->mRotationCurve.mNumKeys << " rotation keys at "
|
||||||
|
<< joint_motion_p->mRotationCurve.mNumKeys * sizeof(RotationKey) << " bytes" << llendl;
|
||||||
|
}
|
||||||
total_size += joint_motion_p->mRotationCurve.mNumKeys * sizeof(RotationKey);
|
total_size += joint_motion_p->mRotationCurve.mNumKeys * sizeof(RotationKey);
|
||||||
}
|
}
|
||||||
if (joint_motion_p->mUsage & LLJointState::POS)
|
if (joint_motion_p->mUsage & LLJointState::POS)
|
||||||
{
|
{
|
||||||
llinfos << "\t" << joint_motion_p->mPositionCurve.mNumKeys << " position keys at "
|
if (!silent)
|
||||||
<< joint_motion_p->mPositionCurve.mNumKeys * sizeof(PositionKey) << " bytes" << llendl;
|
{
|
||||||
|
llinfos << "\t" << joint_motion_p->mPositionCurve.mNumKeys << " position keys at "
|
||||||
|
<< joint_motion_p->mPositionCurve.mNumKeys * sizeof(PositionKey) << " bytes" << llendl;
|
||||||
|
}
|
||||||
total_size += joint_motion_p->mPositionCurve.mNumKeys * sizeof(PositionKey);
|
total_size += joint_motion_p->mPositionCurve.mNumKeys * sizeof(PositionKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
llinfos << "Size: " << total_size << " bytes" << llendl;
|
//Singu: Also add memory used by the constraints.
|
||||||
|
S32 constraints_size = mConstraints.size() * sizeof(constraint_list_t::value_type);
|
||||||
|
total_size += constraints_size;
|
||||||
|
if (!silent)
|
||||||
|
{
|
||||||
|
llinfos << "\t" << mConstraints.size() << " constraints at " << constraints_size << " bytes" << llendl;
|
||||||
|
llinfos << "Size: " << total_size << " bytes" << llendl;
|
||||||
|
}
|
||||||
|
|
||||||
return total_size;
|
return total_size;
|
||||||
}
|
}
|
||||||
@@ -427,9 +444,8 @@ void LLKeyframeMotion::JointMotion::update(LLJointState* joint_state, F32 time,
|
|||||||
// LLKeyframeMotion()
|
// LLKeyframeMotion()
|
||||||
// Class Constructor
|
// Class Constructor
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
LLKeyframeMotion::LLKeyframeMotion(const LLUUID &id)
|
LLKeyframeMotion::LLKeyframeMotion(const LLUUID &id, LLMotionController* controller)
|
||||||
: LLMotion(id),
|
: LLMotion(id, controller),
|
||||||
mJointMotionList(NULL),
|
|
||||||
mPelvisp(NULL),
|
mPelvisp(NULL),
|
||||||
mLastSkeletonSerialNum(0),
|
mLastSkeletonSerialNum(0),
|
||||||
mLastUpdateTime(0.f),
|
mLastUpdateTime(0.f),
|
||||||
@@ -452,9 +468,9 @@ LLKeyframeMotion::~LLKeyframeMotion()
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// create()
|
// create()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
LLMotion *LLKeyframeMotion::create(const LLUUID &id)
|
LLMotion* LLKeyframeMotion::create(LLUUID const& id, LLMotionController* controller)
|
||||||
{
|
{
|
||||||
return new LLKeyframeMotion(id);
|
return new LLKeyframeMotion(id, controller);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -484,7 +500,9 @@ LLJoint* LLKeyframeMotion::getJoint(U32 index)
|
|||||||
index = (S32)mJointStates.size() - 1;
|
index = (S32)mJointStates.size() - 1;
|
||||||
// </edit>
|
// </edit>
|
||||||
LLJoint* joint = mJointStates[index]->getJoint();
|
LLJoint* joint = mJointStates[index]->getJoint();
|
||||||
llassert_always (joint);
|
if(!joint) {
|
||||||
|
LL_WARNS_ONCE("Animation") << "Missing joint index:"<< index << " ID:" << mID << " Name:" << mName << LL_ENDL;
|
||||||
|
}
|
||||||
return joint;
|
return joint;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -515,6 +533,7 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact
|
|||||||
case ASSET_FETCHED:
|
case ASSET_FETCHED:
|
||||||
return STATUS_HOLD;
|
return STATUS_HOLD;
|
||||||
case ASSET_FETCH_FAILED:
|
case ASSET_FETCH_FAILED:
|
||||||
|
llwarns << "Trying to initialize a motion that failed to be fetched." << llendl;
|
||||||
return STATUS_FAILURE;
|
return STATUS_FAILURE;
|
||||||
case ASSET_LOADED:
|
case ASSET_LOADED:
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
@@ -524,7 +543,7 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLKeyframeMotion::JointMotionList* joint_motion_list = LLKeyframeDataCache::getKeyframeData(getID());
|
LLKeyframeMotion::JointMotionListPtr joint_motion_list = LLKeyframeDataCache::getKeyframeData(getID());
|
||||||
|
|
||||||
if(joint_motion_list)
|
if(joint_motion_list)
|
||||||
{
|
{
|
||||||
@@ -799,7 +818,44 @@ void LLKeyframeMotion::onDeactivate()
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// setStopTime()
|
// setStopTime()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// time is in seconds since character creation
|
//
|
||||||
|
// Consider a looping animation of 20 frames, where the loop in point is at 3 frames
|
||||||
|
// and the loop out point at 16 frames:
|
||||||
|
//
|
||||||
|
// The first 3 frames of the animation would be the "loop in" animation.
|
||||||
|
// The last 4 frames of the animation would be the "loop out" animation.
|
||||||
|
// Frames 4 through 15 would be the looping animation frames.
|
||||||
|
//
|
||||||
|
// If the animation would not be looping, all frames would just be played once sequentially:
|
||||||
|
//
|
||||||
|
// mActivationTimestamp -.
|
||||||
|
// v
|
||||||
|
// 0 3 15 16 20
|
||||||
|
// | | \| |
|
||||||
|
// ---------------------
|
||||||
|
// <--> <-- mLoopInPoint (relative to mActivationTimestamp)
|
||||||
|
// <--------------> <-- mLoopOutPoint (relative to mActivationTimestamp)
|
||||||
|
// <----mDuration------>
|
||||||
|
//
|
||||||
|
// When looping the animation would repeat frames 3 to 16 (loop) a few times, for example:
|
||||||
|
//
|
||||||
|
// 0 3 15 3 15 3 15 3 15 16 20
|
||||||
|
// | | loop 1 \| loop 2 \| loop 3 \| loop 4 \| |
|
||||||
|
// ------------------------------------------------------------
|
||||||
|
//LOOP^ ^ LOOP
|
||||||
|
// IN | <----->| OUT
|
||||||
|
// start_loop_time loop_fraction_time-' time
|
||||||
|
//
|
||||||
|
// The time at which the animation is started corresponds to frame 0 and is stored
|
||||||
|
// in mActivationTimestamp (in seconds since character creation).
|
||||||
|
//
|
||||||
|
// If setStopTime() is called with a time somewhere inside loop 4,
|
||||||
|
// then 'loop_fraction_time' is the time from the beginning of
|
||||||
|
// loop 4 till 'time'. Thus 'time - loop_fraction_time' is the first
|
||||||
|
// frame of loop 4, and '(time - loop_fraction_time) +
|
||||||
|
// (mJointMotionList->mDuration - mJointMotionList->mLoopInPoint)'
|
||||||
|
// would correspond to frame 20.
|
||||||
|
//
|
||||||
void LLKeyframeMotion::setStopTime(F32 time)
|
void LLKeyframeMotion::setStopTime(F32 time)
|
||||||
{
|
{
|
||||||
LLMotion::setStopTime(time);
|
LLMotion::setStopTime(time);
|
||||||
@@ -817,6 +873,8 @@ void LLKeyframeMotion::setStopTime(F32 time)
|
|||||||
loop_fraction_time = fmod(time - start_loop_time,
|
loop_fraction_time = fmod(time - start_loop_time,
|
||||||
mJointMotionList->mLoopOutPoint - mJointMotionList->mLoopInPoint);
|
mJointMotionList->mLoopOutPoint - mJointMotionList->mLoopInPoint);
|
||||||
}
|
}
|
||||||
|
// This sets mStopTimestamp to the time that corresponds to the end of the animation (ie, frame 20 in the above example)
|
||||||
|
// minus the ease out duration, so that the animation eases out during the loop out and finishes exactly at the end.
|
||||||
mStopTimestamp = llmax(time,
|
mStopTimestamp = llmax(time,
|
||||||
(time - loop_fraction_time) + (mJointMotionList->mDuration - mJointMotionList->mLoopInPoint) - getEaseOutDuration());
|
(time - loop_fraction_time) + (mJointMotionList->mDuration - mJointMotionList->mLoopInPoint) - getEaseOutDuration());
|
||||||
}
|
}
|
||||||
@@ -1225,13 +1283,42 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Helper class.
|
||||||
|
template<typename T>
|
||||||
|
struct AIAutoDestruct
|
||||||
|
{
|
||||||
|
T* mPtr;
|
||||||
|
AIAutoDestruct() : mPtr(NULL) { }
|
||||||
|
~AIAutoDestruct() { delete mPtr; }
|
||||||
|
void add(T* ptr) { mPtr = ptr; }
|
||||||
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// deserialize()
|
// deserialize()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
||||||
{
|
{
|
||||||
BOOL old_version = FALSE;
|
BOOL old_version = FALSE;
|
||||||
mJointMotionList = new LLKeyframeMotion::JointMotionList;
|
|
||||||
|
//<singu>
|
||||||
|
|
||||||
|
// First add a new LLKeyframeMotion::JointMotionList to the cache, then assign a pointer
|
||||||
|
// to that to mJointMotionList. In LLs code the cache is never deleted again. Now it is
|
||||||
|
// is deleted when the last mJointMotionList pointer is destructed.
|
||||||
|
//
|
||||||
|
// It is possible that we get here for an already added animation, because animations can
|
||||||
|
// be requested multiple times (we get here from LLKeyframeMotion::onLoadComplete) when
|
||||||
|
// the animation was still downloading from a previous request for another LLMotionController
|
||||||
|
// object (avatar). In that case we just overwrite the old data while decoding it again.
|
||||||
|
mJointMotionList = LLKeyframeDataCache::getKeyframeData(getID());
|
||||||
|
bool singu_new_joint_motion_list = !mJointMotionList;
|
||||||
|
if (singu_new_joint_motion_list)
|
||||||
|
{
|
||||||
|
// Create a new JointMotionList.
|
||||||
|
mJointMotionList = LLKeyframeDataCache::createKeyframeData(getID());
|
||||||
|
}
|
||||||
|
|
||||||
|
//</singu>
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// get base priority
|
// get base priority
|
||||||
@@ -1394,8 +1481,10 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
mJointMotionList->mJointMotionArray.clear();
|
if (singu_new_joint_motion_list)
|
||||||
mJointMotionList->mJointMotionArray.reserve(num_motions);
|
{
|
||||||
|
mJointMotionList->mJointMotionArray.reserve(num_motions);
|
||||||
|
}
|
||||||
mJointStates.clear();
|
mJointStates.clear();
|
||||||
mJointStates.reserve(num_motions);
|
mJointStates.reserve(num_motions);
|
||||||
|
|
||||||
@@ -1405,8 +1494,19 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||||||
|
|
||||||
for(U32 i=0; i<num_motions; ++i)
|
for(U32 i=0; i<num_motions; ++i)
|
||||||
{
|
{
|
||||||
|
AIAutoDestruct<JointMotion> watcher;
|
||||||
|
|
||||||
JointMotion* joint_motion = new JointMotion;
|
JointMotion* joint_motion = new JointMotion;
|
||||||
mJointMotionList->mJointMotionArray.push_back(joint_motion);
|
if (singu_new_joint_motion_list)
|
||||||
|
{
|
||||||
|
// Pass ownership to mJointMotionList.
|
||||||
|
mJointMotionList->mJointMotionArray.push_back(joint_motion);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Just delete this at the end.
|
||||||
|
watcher.add(joint_motion);
|
||||||
|
}
|
||||||
|
|
||||||
std::string joint_name;
|
std::string joint_name;
|
||||||
if (!dp.unpackString(joint_name, "joint_name"))
|
if (!dp.unpackString(joint_name, "joint_name"))
|
||||||
@@ -1834,7 +1934,15 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
mJointMotionList->mConstraints.push_front(constraintp);
|
AIAutoDestruct<JointConstraintSharedData> watcher;
|
||||||
|
if (singu_new_joint_motion_list)
|
||||||
|
{
|
||||||
|
mJointMotionList->mConstraints.push_front(constraintp);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
watcher.add(constraintp);
|
||||||
|
}
|
||||||
|
|
||||||
constraintp->mJointStateIndices = new S32[constraintp->mChainLength + 1]; // note: mChainLength is size-limited - comes from a byte
|
constraintp->mJointStateIndices = new S32[constraintp->mChainLength + 1]; // note: mChainLength is size-limited - comes from a byte
|
||||||
|
|
||||||
@@ -1874,15 +1982,12 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
|
|||||||
if (constraintp->mJointStateIndices[i] < 0 )
|
if (constraintp->mJointStateIndices[i] < 0 )
|
||||||
{
|
{
|
||||||
llwarns << "No joint index for constraint " << i << llendl;
|
llwarns << "No joint index for constraint " << i << llendl;
|
||||||
delete constraintp;
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// *FIX: support cleanup of old keyframe data
|
|
||||||
LLKeyframeDataCache::addKeyframeData(getID(), mJointMotionList);
|
|
||||||
mAssetStatus = ASSET_LOADED;
|
mAssetStatus = ASSET_LOADED;
|
||||||
|
|
||||||
setupPose();
|
setupPose();
|
||||||
@@ -2224,16 +2329,24 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs,
|
|||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// LLKeyframeDataCache::dumpDiagInfo()
|
// LLKeyframeDataCache::dumpDiagInfo()
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
void LLKeyframeDataCache::dumpDiagInfo()
|
// <singu>
|
||||||
|
// quiet = 0 : print everything in detail.
|
||||||
|
// 1 : print the UUIDs of all animations in the cache and the total memory usage.
|
||||||
|
// 2 : only print the total memory usage.
|
||||||
|
// </singu>
|
||||||
|
void LLKeyframeDataCache::dumpDiagInfo(int quiet)
|
||||||
{
|
{
|
||||||
// keep track of totals
|
// keep track of totals
|
||||||
U32 total_size = 0;
|
U32 total_size = 0;
|
||||||
|
|
||||||
char buf[1024]; /* Flawfinder: ignore */
|
char buf[1024]; /* Flawfinder: ignore */
|
||||||
|
|
||||||
llinfos << "-----------------------------------------------------" << llendl;
|
if (quiet < 2)
|
||||||
llinfos << " Global Motion Table (DEBUG only)" << llendl;
|
{
|
||||||
llinfos << "-----------------------------------------------------" << llendl;
|
llinfos << "-----------------------------------------------------" << llendl;
|
||||||
|
llinfos << " Global Motion Table" << llendl;
|
||||||
|
llinfos << "-----------------------------------------------------" << llendl;
|
||||||
|
}
|
||||||
|
|
||||||
// print each loaded mesh, and it's memory usage
|
// print each loaded mesh, and it's memory usage
|
||||||
for (keyframe_data_map_t::iterator map_it = sKeyframeDataMap.begin();
|
for (keyframe_data_map_t::iterator map_it = sKeyframeDataMap.begin();
|
||||||
@@ -2241,30 +2354,46 @@ void LLKeyframeDataCache::dumpDiagInfo()
|
|||||||
{
|
{
|
||||||
U32 joint_motion_kb;
|
U32 joint_motion_kb;
|
||||||
|
|
||||||
LLKeyframeMotion::JointMotionList *motion_list_p = map_it->second;
|
LLKeyframeMotion::JointMotionList const* motion_list_p = map_it->get();
|
||||||
|
|
||||||
llinfos << "Motion: " << map_it->first << llendl;
|
if (quiet < 2)
|
||||||
|
{
|
||||||
|
llinfos << "Motion: " << map_it->key() << llendl;
|
||||||
|
}
|
||||||
|
|
||||||
joint_motion_kb = motion_list_p->dumpDiagInfo();
|
if (motion_list_p)
|
||||||
|
{
|
||||||
total_size += joint_motion_kb;
|
joint_motion_kb = motion_list_p->dumpDiagInfo(quiet);
|
||||||
|
total_size += joint_motion_kb;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
llinfos << "-----------------------------------------------------" << llendl;
|
if (quiet < 2)
|
||||||
|
{
|
||||||
|
llinfos << "-----------------------------------------------------" << llendl;
|
||||||
|
}
|
||||||
llinfos << "Motions\tTotal Size" << llendl;
|
llinfos << "Motions\tTotal Size" << llendl;
|
||||||
snprintf(buf, sizeof(buf), "%d\t\t%d bytes", (S32)sKeyframeDataMap.size(), total_size ); /* Flawfinder: ignore */
|
snprintf(buf, sizeof(buf), "%d\t\t%d bytes", (S32)sKeyframeDataMap.size(), total_size ); /* Flawfinder: ignore */
|
||||||
llinfos << buf << llendl;
|
llinfos << buf << llendl;
|
||||||
llinfos << "-----------------------------------------------------" << llendl;
|
if (quiet < 2)
|
||||||
|
{
|
||||||
|
llinfos << "-----------------------------------------------------" << llendl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// LLKeyframeDataCache::addKeyframeData()
|
// LLKeyframeDataCache::createKeyframeData()
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
void LLKeyframeDataCache::addKeyframeData(const LLUUID& id, LLKeyframeMotion::JointMotionList* joint_motion_listp)
|
//<singu> This function replaces LLKeyframeDataCache::addKeyframeData and was rewritten to fix a memory leak (aka, the usage of AICachedPointer).
|
||||||
|
LLKeyframeMotion::JointMotionListPtr LLKeyframeDataCache::createKeyframeData(LLUUID const& id)
|
||||||
{
|
{
|
||||||
sKeyframeDataMap[id] = joint_motion_listp;
|
std::pair<keyframe_data_map_t::iterator, bool> result =
|
||||||
|
sKeyframeDataMap.insert(AICachedPointer<LLUUID, LLKeyframeMotion::JointMotionList>(id, new LLKeyframeMotion::JointMotionList, &sKeyframeDataMap));
|
||||||
|
llassert(result.second); // id may not already exist in the cache.
|
||||||
|
return &*result.first; // Construct and return a JointMotionListPt from a pointer to the actually inserted AICachedPointer.
|
||||||
}
|
}
|
||||||
|
//</singu>
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// LLKeyframeDataCache::removeKeyframeData()
|
// LLKeyframeDataCache::removeKeyframeData()
|
||||||
@@ -2274,7 +2403,6 @@ void LLKeyframeDataCache::removeKeyframeData(const LLUUID& id)
|
|||||||
keyframe_data_map_t::iterator found_data = sKeyframeDataMap.find(id);
|
keyframe_data_map_t::iterator found_data = sKeyframeDataMap.find(id);
|
||||||
if (found_data != sKeyframeDataMap.end())
|
if (found_data != sKeyframeDataMap.end())
|
||||||
{
|
{
|
||||||
delete found_data->second;
|
|
||||||
sKeyframeDataMap.erase(found_data);
|
sKeyframeDataMap.erase(found_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2282,14 +2410,14 @@ void LLKeyframeDataCache::removeKeyframeData(const LLUUID& id)
|
|||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// LLKeyframeDataCache::getKeyframeData()
|
// LLKeyframeDataCache::getKeyframeData()
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
LLKeyframeMotion::JointMotionList* LLKeyframeDataCache::getKeyframeData(const LLUUID& id)
|
LLKeyframeMotion::JointMotionListPtr LLKeyframeDataCache::getKeyframeData(const LLUUID& id)
|
||||||
{
|
{
|
||||||
keyframe_data_map_t::iterator found_data = sKeyframeDataMap.find(id);
|
keyframe_data_map_t::iterator found_data = sKeyframeDataMap.find(id);
|
||||||
if (found_data == sKeyframeDataMap.end())
|
if (found_data == sKeyframeDataMap.end())
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return found_data->second;
|
return &*found_data; // Construct and return a JointMotionListPt from a pointer to the found AICachedPointer.
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
@@ -2305,7 +2433,6 @@ LLKeyframeDataCache::~LLKeyframeDataCache()
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void LLKeyframeDataCache::clear()
|
void LLKeyframeDataCache::clear()
|
||||||
{
|
{
|
||||||
for_each(sKeyframeDataMap.begin(), sKeyframeDataMap.end(), DeletePairedPointer());
|
|
||||||
sKeyframeDataMap.clear();
|
sKeyframeDataMap.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||||
*
|
*
|
||||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||||
|
* AICachedPointer and AICachedPointPtr copyright (c) 2013, Aleric Inglewood.
|
||||||
*
|
*
|
||||||
* Second Life Viewer Source Code
|
* Second Life Viewer Source Code
|
||||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||||
@@ -48,10 +49,12 @@
|
|||||||
#include "v3dmath.h"
|
#include "v3dmath.h"
|
||||||
#include "v3math.h"
|
#include "v3math.h"
|
||||||
#include "llbvhconsts.h"
|
#include "llbvhconsts.h"
|
||||||
|
#include <boost/intrusive_ptr.hpp>
|
||||||
|
|
||||||
class LLKeyframeDataCache;
|
class LLKeyframeDataCache;
|
||||||
class LLVFS;
|
class LLVFS;
|
||||||
class LLDataPacker;
|
class LLDataPacker;
|
||||||
|
class LLMotionController;
|
||||||
|
|
||||||
#define MIN_REQUIRED_PIXEL_AREA_KEYFRAME (40.f)
|
#define MIN_REQUIRED_PIXEL_AREA_KEYFRAME (40.f)
|
||||||
#define MAX_CHAIN_LENGTH (4)
|
#define MAX_CHAIN_LENGTH (4)
|
||||||
@@ -59,6 +62,112 @@ class LLDataPacker;
|
|||||||
const S32 KEYFRAME_MOTION_VERSION = 1;
|
const S32 KEYFRAME_MOTION_VERSION = 1;
|
||||||
const S32 KEYFRAME_MOTION_SUBVERSION = 0;
|
const S32 KEYFRAME_MOTION_SUBVERSION = 0;
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// <singu>
|
||||||
|
|
||||||
|
template<typename KEY, typename T>
|
||||||
|
class AICachedPointer;
|
||||||
|
|
||||||
|
template<typename KEY, typename T>
|
||||||
|
void intrusive_ptr_add_ref(AICachedPointer<KEY, T> const* p);
|
||||||
|
|
||||||
|
template<typename KEY, typename T>
|
||||||
|
void intrusive_ptr_release(AICachedPointer<KEY, T> const* p);
|
||||||
|
|
||||||
|
template<typename KEY, typename T>
|
||||||
|
class AICachedPointer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef std::set<AICachedPointer<KEY, T> > container_type;
|
||||||
|
|
||||||
|
private:
|
||||||
|
KEY mKey; // The unique key.
|
||||||
|
LLPointer<T> mData; // The actual data pointer.
|
||||||
|
container_type* mCache; // Pointer to the underlaying cache.
|
||||||
|
mutable int mRefCount; // Number of AICachedPointerPtr's pointing to this object.
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Construct a NULL pointer. This is needed when adding a new entry to a std::set, it is always first default constructed.
|
||||||
|
AICachedPointer(void) : mCache(NULL) { }
|
||||||
|
|
||||||
|
// Copy constructor. This is needed to replace the std::set inserted instance with its actual value.
|
||||||
|
AICachedPointer(AICachedPointer const& cptr) : mKey(cptr.mKey), mData(cptr.mData), mCache(cptr.mCache), mRefCount(0) { }
|
||||||
|
|
||||||
|
// Construct a AICachedPointer that points to 'ptr' with key 'key'.
|
||||||
|
AICachedPointer(KEY const& key, T* ptr, container_type* cache) : mKey(key), mData(ptr), mCache(cache), mRefCount(-1) { }
|
||||||
|
|
||||||
|
// Construct a temporary NULL pointer that can be used in a search for a key.
|
||||||
|
AICachedPointer(KEY const& key) : mKey(key), mCache(NULL) { }
|
||||||
|
|
||||||
|
// Accessors for key and data.
|
||||||
|
KEY const& key(void) const { return mKey; }
|
||||||
|
T const* get(void) const { return mData.get(); }
|
||||||
|
T* get(void) { return mData.get(); }
|
||||||
|
|
||||||
|
// Order only by key.
|
||||||
|
friend bool operator<(AICachedPointer const& cp1, AICachedPointer const& cp2) { return cp1.mKey < cp2.mKey; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
friend void intrusive_ptr_add_ref<>(AICachedPointer<KEY, T> const* p);
|
||||||
|
friend void intrusive_ptr_release<>(AICachedPointer<KEY, T> const* p);
|
||||||
|
|
||||||
|
private:
|
||||||
|
AICachedPointer& operator=(AICachedPointer const&);
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename KEY, typename T>
|
||||||
|
void intrusive_ptr_add_ref(AICachedPointer<KEY, T> const* p)
|
||||||
|
{
|
||||||
|
llassert(p->mCache);
|
||||||
|
if (p->mCache)
|
||||||
|
{
|
||||||
|
p->mRefCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename KEY, typename T>
|
||||||
|
void intrusive_ptr_release(AICachedPointer<KEY, T> const* p)
|
||||||
|
{
|
||||||
|
llassert(p->mCache);
|
||||||
|
if (p->mCache)
|
||||||
|
{
|
||||||
|
if (--p->mRefCount == 0)
|
||||||
|
{
|
||||||
|
p->mCache->erase(p->mKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename KEY, typename T>
|
||||||
|
class AICachedPointerPtr
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
boost::intrusive_ptr<AICachedPointer<KEY, T> const> mPtr;
|
||||||
|
static int sCnt;
|
||||||
|
|
||||||
|
public:
|
||||||
|
AICachedPointerPtr(void) { ++sCnt; }
|
||||||
|
AICachedPointerPtr(AICachedPointerPtr const& cpp) : mPtr(cpp.mPtr) { ++sCnt; }
|
||||||
|
AICachedPointerPtr(AICachedPointer<KEY, T> const* cp) : mPtr(cp) { ++sCnt; }
|
||||||
|
~AICachedPointerPtr() { --sCnt; }
|
||||||
|
|
||||||
|
typedef boost::intrusive_ptr<AICachedPointer<KEY, T> const> const AICachedPointerPtr<KEY, T>::* const bool_type;
|
||||||
|
operator bool_type() const { return mPtr ? &AICachedPointerPtr<KEY, T>::mPtr : NULL; }
|
||||||
|
|
||||||
|
T const* operator->() const { return mPtr->get(); }
|
||||||
|
T* operator->() { return const_cast<AICachedPointer<KEY, T>&>(*mPtr).get(); }
|
||||||
|
T const& operator*() const { return *mPtr->get(); }
|
||||||
|
T& operator*() { return *const_cast<AICachedPointer<KEY, T>&>(*mPtr).get(); }
|
||||||
|
|
||||||
|
AICachedPointerPtr& operator=(AICachedPointerPtr const& cpp) { mPtr = cpp.mPtr; return *this; }
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename KEY, typename T>
|
||||||
|
int AICachedPointerPtr<KEY, T>::sCnt;
|
||||||
|
|
||||||
|
// </singu>
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// class LLKeyframeMotion
|
// class LLKeyframeMotion
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -68,7 +177,7 @@ class LLKeyframeMotion :
|
|||||||
friend class LLKeyframeDataCache;
|
friend class LLKeyframeDataCache;
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
LLKeyframeMotion(const LLUUID &id);
|
LLKeyframeMotion(const LLUUID &id, LLMotionController* controller);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
virtual ~LLKeyframeMotion();
|
virtual ~LLKeyframeMotion();
|
||||||
@@ -85,7 +194,7 @@ public:
|
|||||||
|
|
||||||
// static constructor
|
// static constructor
|
||||||
// all subclasses must implement such a function and register it
|
// all subclasses must implement such a function and register it
|
||||||
static LLMotion *create(const LLUUID& id);
|
static LLMotion* create(LLUUID const& id, LLMotionController* controller);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
@@ -158,7 +267,7 @@ public:
|
|||||||
U32 getFileSize();
|
U32 getFileSize();
|
||||||
BOOL serialize(LLDataPacker& dp) const;
|
BOOL serialize(LLDataPacker& dp) const;
|
||||||
BOOL deserialize(LLDataPacker& dp);
|
BOOL deserialize(LLDataPacker& dp);
|
||||||
BOOL isLoaded() { return mJointMotionList != NULL; }
|
BOOL isLoaded() { return !!mJointMotionList; }
|
||||||
|
|
||||||
|
|
||||||
// setters for modifying a keyframe animation
|
// setters for modifying a keyframe animation
|
||||||
@@ -393,7 +502,7 @@ public:
|
|||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// JointMotionList
|
// JointMotionList
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
class JointMotionList
|
class JointMotionList : public LLRefCount
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
std::vector<JointMotion*> mJointMotionArray;
|
std::vector<JointMotion*> mJointMotionArray;
|
||||||
@@ -416,19 +525,22 @@ public:
|
|||||||
public:
|
public:
|
||||||
JointMotionList();
|
JointMotionList();
|
||||||
~JointMotionList();
|
~JointMotionList();
|
||||||
U32 dumpDiagInfo();
|
U32 dumpDiagInfo(bool silent = false) const;
|
||||||
JointMotion* getJointMotion(U32 index) const { llassert(index < mJointMotionArray.size()); return mJointMotionArray[index]; }
|
JointMotion* getJointMotion(U32 index) const { llassert(index < mJointMotionArray.size()); return mJointMotionArray[index]; }
|
||||||
U32 getNumJointMotions() const { return mJointMotionArray.size(); }
|
U32 getNumJointMotions() const { return mJointMotionArray.size(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Singu: Type of a pointer to the cached pointer (in LLKeyframeDataCache::sKeyframeDataMap) to a JointMotionList object.
|
||||||
|
typedef AICachedPointerPtr<LLUUID, JointMotionList> JointMotionListPtr;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static LLVFS* sVFS;
|
static LLVFS* sVFS;
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// Member Data
|
// Member Data
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
JointMotionList* mJointMotionList;
|
JointMotionListPtr mJointMotionList; // singu: automatically clean up cache entry when destructed.
|
||||||
std::vector<LLPointer<LLJointState> > mJointStates;
|
std::vector<LLPointer<LLJointState> > mJointStates;
|
||||||
LLJoint* mPelvisp;
|
LLJoint* mPelvisp;
|
||||||
LLCharacter* mCharacter;
|
LLCharacter* mCharacter;
|
||||||
@@ -442,21 +554,24 @@ protected:
|
|||||||
|
|
||||||
class LLKeyframeDataCache
|
class LLKeyframeDataCache
|
||||||
{
|
{
|
||||||
public:
|
private:
|
||||||
// *FIX: implement this as an actual singleton member of LLKeyframeMotion
|
friend class LLKeyframeMotion;
|
||||||
LLKeyframeDataCache(){};
|
LLKeyframeDataCache(){};
|
||||||
~LLKeyframeDataCache();
|
~LLKeyframeDataCache();
|
||||||
|
|
||||||
typedef std::map<LLUUID, class LLKeyframeMotion::JointMotionList*> keyframe_data_map_t;
|
public:
|
||||||
|
typedef AICachedPointer<LLUUID, LLKeyframeMotion::JointMotionList>::container_type keyframe_data_map_t; // singu: add automatic cache cleanup.
|
||||||
static keyframe_data_map_t sKeyframeDataMap;
|
static keyframe_data_map_t sKeyframeDataMap;
|
||||||
|
|
||||||
static void addKeyframeData(const LLUUID& id, LLKeyframeMotion::JointMotionList*);
|
//<singu>
|
||||||
static LLKeyframeMotion::JointMotionList* getKeyframeData(const LLUUID& id);
|
static LLKeyframeMotion::JointMotionListPtr createKeyframeData(LLUUID const& id); // id may not exist.
|
||||||
|
static LLKeyframeMotion::JointMotionListPtr getKeyframeData(LLUUID const& id); // id may or may not exists. Returns a NULL pointer when it doesn't exist.
|
||||||
|
//</singu>
|
||||||
|
|
||||||
static void removeKeyframeData(const LLUUID& id);
|
static void removeKeyframeData(const LLUUID& id);
|
||||||
|
|
||||||
//print out diagnostic info
|
//print out diagnostic info
|
||||||
static void dumpDiagInfo();
|
static void dumpDiagInfo(int quiet = 0); // singu: added param 'quiet'.
|
||||||
static void clear();
|
static void clear();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,456 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file llkeyframemotionparam.cpp
|
|
||||||
* @brief Implementation of LLKeyframeMotion class.
|
|
||||||
*
|
|
||||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
|
||||||
* Second Life Viewer Source Code
|
|
||||||
* Copyright (C) 2010, Linden Research, Inc.
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation;
|
|
||||||
* version 2.1 of the License only.
|
|
||||||
*
|
|
||||||
* This library 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
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*
|
|
||||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
|
||||||
* $/LicenseInfo$
|
|
||||||
*/
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Header Files
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
#include "linden_common.h"
|
|
||||||
|
|
||||||
#include "llkeyframemotionparam.h"
|
|
||||||
#include "llcharacter.h"
|
|
||||||
#include "llmath.h"
|
|
||||||
#include "m3math.h"
|
|
||||||
#include "lldir.h"
|
|
||||||
#include "llanimationstates.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// LLKeyframeMotionParam class
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// LLKeyframeMotionParam()
|
|
||||||
// Class Constructor
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
LLKeyframeMotionParam::LLKeyframeMotionParam( const LLUUID &id) : LLMotion(id)
|
|
||||||
{
|
|
||||||
mDefaultKeyframeMotion = NULL;
|
|
||||||
mCharacter = NULL;
|
|
||||||
|
|
||||||
mEaseInDuration = 0.f;
|
|
||||||
mEaseOutDuration = 0.f;
|
|
||||||
mDuration = 0.f;
|
|
||||||
mPriority = LLJoint::LOW_PRIORITY;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// ~LLKeyframeMotionParam()
|
|
||||||
// Class Destructor
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
LLKeyframeMotionParam::~LLKeyframeMotionParam()
|
|
||||||
{
|
|
||||||
for (motion_map_t::iterator iter = mParameterizedMotions.begin();
|
|
||||||
iter != mParameterizedMotions.end(); ++iter)
|
|
||||||
{
|
|
||||||
motion_list_t& motionList = iter->second;
|
|
||||||
for (motion_list_t::iterator iter2 = motionList.begin(); iter2 != motionList.end(); ++iter2)
|
|
||||||
{
|
|
||||||
const ParameterizedMotion& paramMotion = *iter2;
|
|
||||||
delete paramMotion.mMotion;
|
|
||||||
}
|
|
||||||
motionList.clear();
|
|
||||||
}
|
|
||||||
mParameterizedMotions.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// LLKeyframeMotionParam::onInitialize(LLCharacter *character)
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
LLMotion::LLMotionInitStatus LLKeyframeMotionParam::onInitialize(LLCharacter *character)
|
|
||||||
{
|
|
||||||
mCharacter = character;
|
|
||||||
|
|
||||||
if (!loadMotions())
|
|
||||||
{
|
|
||||||
return STATUS_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (motion_map_t::iterator iter = mParameterizedMotions.begin();
|
|
||||||
iter != mParameterizedMotions.end(); ++iter)
|
|
||||||
{
|
|
||||||
motion_list_t& motionList = iter->second;
|
|
||||||
for (motion_list_t::iterator iter2 = motionList.begin(); iter2 != motionList.end(); ++iter2)
|
|
||||||
{
|
|
||||||
const ParameterizedMotion& paramMotion = *iter2;
|
|
||||||
LLMotion* motion = paramMotion.mMotion;
|
|
||||||
motion->onInitialize(character);
|
|
||||||
|
|
||||||
if (motion->getDuration() > mEaseInDuration)
|
|
||||||
{
|
|
||||||
mEaseInDuration = motion->getEaseInDuration();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (motion->getEaseOutDuration() > mEaseOutDuration)
|
|
||||||
{
|
|
||||||
mEaseOutDuration = motion->getEaseOutDuration();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (motion->getDuration() > mDuration)
|
|
||||||
{
|
|
||||||
mDuration = motion->getDuration();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (motion->getPriority() > mPriority)
|
|
||||||
{
|
|
||||||
mPriority = motion->getPriority();
|
|
||||||
}
|
|
||||||
|
|
||||||
LLPose *pose = motion->getPose();
|
|
||||||
|
|
||||||
mPoseBlender.addMotion(motion);
|
|
||||||
for (LLJointState *jsp = pose->getFirstJointState(); jsp; jsp = pose->getNextJointState())
|
|
||||||
{
|
|
||||||
LLPose *blendedPose = mPoseBlender.getBlendedPose();
|
|
||||||
blendedPose->addJointState(jsp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// LLKeyframeMotionParam::onActivate()
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
BOOL LLKeyframeMotionParam::onActivate()
|
|
||||||
{
|
|
||||||
for (motion_map_t::iterator iter = mParameterizedMotions.begin();
|
|
||||||
iter != mParameterizedMotions.end(); ++iter)
|
|
||||||
{
|
|
||||||
motion_list_t& motionList = iter->second;
|
|
||||||
for (motion_list_t::iterator iter2 = motionList.begin(); iter2 != motionList.end(); ++iter2)
|
|
||||||
{
|
|
||||||
const ParameterizedMotion& paramMotion = *iter2;
|
|
||||||
paramMotion.mMotion->activate(mActivationTimestamp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// LLKeyframeMotionParam::onUpdate()
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask)
|
|
||||||
{
|
|
||||||
F32 weightFactor = 1.f / (F32)mParameterizedMotions.size();
|
|
||||||
|
|
||||||
// zero out all pose weights
|
|
||||||
for (motion_map_t::iterator iter = mParameterizedMotions.begin();
|
|
||||||
iter != mParameterizedMotions.end(); ++iter)
|
|
||||||
{
|
|
||||||
motion_list_t& motionList = iter->second;
|
|
||||||
for (motion_list_t::iterator iter2 = motionList.begin(); iter2 != motionList.end(); ++iter2)
|
|
||||||
{
|
|
||||||
const ParameterizedMotion& paramMotion = *iter2;
|
|
||||||
// llinfos << "Weight for pose " << paramMotion.mMotion->getName() << " is " << paramMotion.mMotion->getPose()->getWeight() << llendl;
|
|
||||||
paramMotion.mMotion->getPose()->setWeight(0.f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
for (motion_map_t::iterator iter = mParameterizedMotions.begin();
|
|
||||||
iter != mParameterizedMotions.end(); ++iter)
|
|
||||||
{
|
|
||||||
const std::string& paramName = iter->first;
|
|
||||||
F32* paramValue = (F32 *)mCharacter->getAnimationData(paramName);
|
|
||||||
if (NULL == paramValue) // unexpected, but...
|
|
||||||
{
|
|
||||||
llwarns << "paramValue == NULL" << llendl;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// DANGER! Do not modify mParameterizedMotions while using these pointers!
|
|
||||||
const ParameterizedMotion* firstMotion = NULL;
|
|
||||||
const ParameterizedMotion* secondMotion = NULL;
|
|
||||||
|
|
||||||
motion_list_t& motionList = iter->second;
|
|
||||||
for (motion_list_t::iterator iter2 = motionList.begin(); iter2 != motionList.end(); ++iter2)
|
|
||||||
{
|
|
||||||
const ParameterizedMotion& paramMotion = *iter2;
|
|
||||||
paramMotion.mMotion->onUpdate(time, joint_mask);
|
|
||||||
|
|
||||||
F32 distToParam = paramMotion.mParam - *paramValue;
|
|
||||||
|
|
||||||
if ( distToParam <= 0.f)
|
|
||||||
{
|
|
||||||
// keep track of the motion closest to the parameter value
|
|
||||||
firstMotion = ¶mMotion;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// we've passed the parameter value
|
|
||||||
// so store the first motion we find as the second one we want to blend...
|
|
||||||
if (firstMotion && !secondMotion )
|
|
||||||
{
|
|
||||||
secondMotion = ¶mMotion;
|
|
||||||
}
|
|
||||||
//...or, if we've seen no other motion so far, make sure we blend to this only
|
|
||||||
else if (!firstMotion)
|
|
||||||
{
|
|
||||||
firstMotion = ¶mMotion;
|
|
||||||
secondMotion = ¶mMotion;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LLPose *firstPose;
|
|
||||||
LLPose *secondPose;
|
|
||||||
|
|
||||||
if (firstMotion)
|
|
||||||
firstPose = firstMotion->mMotion->getPose();
|
|
||||||
else
|
|
||||||
firstPose = NULL;
|
|
||||||
|
|
||||||
if (secondMotion)
|
|
||||||
secondPose = secondMotion->mMotion->getPose();
|
|
||||||
else
|
|
||||||
secondPose = NULL;
|
|
||||||
|
|
||||||
// now modify weight of the subanim (only if we are blending between two motions)
|
|
||||||
if (firstMotion && secondMotion)
|
|
||||||
{
|
|
||||||
if (firstMotion == secondMotion)
|
|
||||||
{
|
|
||||||
firstPose->setWeight(weightFactor);
|
|
||||||
}
|
|
||||||
else if (firstMotion->mParam == secondMotion->mParam)
|
|
||||||
{
|
|
||||||
firstPose->setWeight(0.5f * weightFactor);
|
|
||||||
secondPose->setWeight(0.5f * weightFactor);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
F32 first_weight = 1.f -
|
|
||||||
((llclamp(*paramValue - firstMotion->mParam, 0.f, (secondMotion->mParam - firstMotion->mParam))) /
|
|
||||||
(secondMotion->mParam - firstMotion->mParam));
|
|
||||||
first_weight = llclamp(first_weight, 0.f, 1.f);
|
|
||||||
|
|
||||||
F32 second_weight = 1.f - first_weight;
|
|
||||||
|
|
||||||
firstPose->setWeight(first_weight * weightFactor);
|
|
||||||
secondPose->setWeight(second_weight * weightFactor);
|
|
||||||
|
|
||||||
// llinfos << "Parameter " << *paramName << ": " << *paramValue << llendl;
|
|
||||||
// llinfos << "Weights " << firstPose->getWeight() << " " << secondPose->getWeight() << llendl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (firstMotion && !secondMotion)
|
|
||||||
{
|
|
||||||
firstPose->setWeight(weightFactor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// blend poses
|
|
||||||
mPoseBlender.blendAndApply();
|
|
||||||
|
|
||||||
llinfos << "Param Motion weight " << mPoseBlender.getBlendedPose()->getWeight() << llendl;
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// LLKeyframeMotionParam::onDeactivate()
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
void LLKeyframeMotionParam::onDeactivate()
|
|
||||||
{
|
|
||||||
for (motion_map_t::iterator iter = mParameterizedMotions.begin();
|
|
||||||
iter != mParameterizedMotions.end(); ++iter)
|
|
||||||
{
|
|
||||||
motion_list_t& motionList = iter->second;
|
|
||||||
for (motion_list_t::iterator iter2 = motionList.begin(); iter2 != motionList.end(); ++iter2)
|
|
||||||
{
|
|
||||||
const ParameterizedMotion& paramMotion = *iter2;
|
|
||||||
paramMotion.mMotion->onDeactivate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// LLKeyframeMotionParam::addKeyframeMotion()
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
BOOL LLKeyframeMotionParam::addKeyframeMotion(char *name, const LLUUID &id, char *param, F32 value)
|
|
||||||
{
|
|
||||||
LLMotion *newMotion = mCharacter->createMotion( id );
|
|
||||||
|
|
||||||
if (!newMotion)
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
newMotion->setName(name);
|
|
||||||
|
|
||||||
// now add motion to this list
|
|
||||||
mParameterizedMotions[param].insert(ParameterizedMotion(newMotion, value));
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// LLKeyframeMotionParam::setDefaultKeyframeMotion()
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
void LLKeyframeMotionParam::setDefaultKeyframeMotion(char *name)
|
|
||||||
{
|
|
||||||
for (motion_map_t::iterator iter = mParameterizedMotions.begin();
|
|
||||||
iter != mParameterizedMotions.end(); ++iter)
|
|
||||||
{
|
|
||||||
motion_list_t& motionList = iter->second;
|
|
||||||
for (motion_list_t::iterator iter2 = motionList.begin(); iter2 != motionList.end(); ++iter2)
|
|
||||||
{
|
|
||||||
const ParameterizedMotion& paramMotion = *iter2;
|
|
||||||
if (paramMotion.mMotion->getName() == name)
|
|
||||||
{
|
|
||||||
mDefaultKeyframeMotion = paramMotion.mMotion;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// loadMotions()
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
BOOL LLKeyframeMotionParam::loadMotions()
|
|
||||||
{
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
// Load named file by concatenating the character prefix with the motion name.
|
|
||||||
// Load data into a buffer to be parsed.
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
//std::string path = gDirUtilp->getExpandedFilename(LL_PATH_MOTIONS,mCharacter->getAnimationPrefix())
|
|
||||||
// + "_" + getName() + ".llp";
|
|
||||||
//RN: deprecated unused reference to "motion" directory
|
|
||||||
std::string path;
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
// open the file
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
S32 fileSize = 0;
|
|
||||||
LLAPRFile infile(path, LL_APR_R, &fileSize);
|
|
||||||
apr_file_t* fp = infile.getFileHandle() ;
|
|
||||||
if (!fp || fileSize == 0)
|
|
||||||
{
|
|
||||||
llinfos << "ERROR: can't open: " << path << llendl;
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// allocate a text buffer
|
|
||||||
try
|
|
||||||
{
|
|
||||||
std::vector<char> text(fileSize+1);
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
// load data from file into buffer
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
bool error = false;
|
|
||||||
char *p = &text[0];
|
|
||||||
while ( 1 )
|
|
||||||
{
|
|
||||||
if (apr_file_eof(fp) == APR_EOF)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (apr_file_gets(p, 1024, fp) != APR_SUCCESS)
|
|
||||||
{
|
|
||||||
error = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
while ( *(++p) )
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
// close the file
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
infile.close();
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
// check for error
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
llassert( p <= (&text[0] + fileSize) );
|
|
||||||
|
|
||||||
if ( error )
|
|
||||||
{
|
|
||||||
llinfos << "ERROR: error while reading from " << path << llendl;
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
llinfos << "Loading parametric keyframe data for: " << getName() << llendl;
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
// parse the text and build keyframe data structures
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
p = &text[0];
|
|
||||||
S32 num;
|
|
||||||
char strA[80]; /* Flawfinder: ignore */
|
|
||||||
char strB[80]; /* Flawfinder: ignore */
|
|
||||||
F32 floatA = 0.0f;
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
// get priority
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
BOOL isFirstMotion = TRUE;
|
|
||||||
num = sscanf(p, "%79s %79s %f", strA, strB, &floatA); /* Flawfinder: ignore */
|
|
||||||
|
|
||||||
while(1)
|
|
||||||
{
|
|
||||||
if (num == 0 || num == EOF) break;
|
|
||||||
if ((num != 3))
|
|
||||||
{
|
|
||||||
llinfos << "WARNING: can't read parametric motion" << llendl;
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
addKeyframeMotion(strA, gAnimLibrary.stringToAnimState(std::string(strA)), strB, floatA);
|
|
||||||
if (isFirstMotion)
|
|
||||||
{
|
|
||||||
isFirstMotion = FALSE;
|
|
||||||
setDefaultKeyframeMotion(strA);
|
|
||||||
}
|
|
||||||
|
|
||||||
p = strstr(p, "\n");
|
|
||||||
if (!p)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
p++;
|
|
||||||
num = sscanf(p, "%79s %79s %f", strA, strB, &floatA); /* Flawfinder: ignore */
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
catch(std::bad_alloc)
|
|
||||||
{
|
|
||||||
llinfos << "ERROR: Unable to allocate keyframe text buffer." << llendl;
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// End
|
|
||||||
@@ -1,176 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file llkeyframemotionparam.h
|
|
||||||
* @brief Implementation of LLKeframeMotionParam class.
|
|
||||||
*
|
|
||||||
* $LicenseInfo:firstyear=2002&license=viewergpl$
|
|
||||||
*
|
|
||||||
* Copyright (c) 2002-2009, Linden Research, Inc.
|
|
||||||
*
|
|
||||||
* Second Life Viewer Source Code
|
|
||||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
|
||||||
* to you under the terms of the GNU General Public License, version 2.0
|
|
||||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
|
||||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
|
||||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
|
||||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
|
||||||
*
|
|
||||||
* There are special exceptions to the terms and conditions of the GPL as
|
|
||||||
* it is applied to this Source Code. View the full text of the exception
|
|
||||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
|
||||||
* online at
|
|
||||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
|
||||||
*
|
|
||||||
* By copying, modifying or distributing this software, you acknowledge
|
|
||||||
* that you have read and understood your obligations described above,
|
|
||||||
* and agree to abide by those obligations.
|
|
||||||
*
|
|
||||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
|
||||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
|
||||||
* COMPLETENESS OR PERFORMANCE.
|
|
||||||
* $/LicenseInfo$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LL_LLKEYFRAMEMOTIONPARAM_H
|
|
||||||
#define LL_LLKEYFRAMEMOTIONPARAM_H
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Header files
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include "llmotion.h"
|
|
||||||
#include "lljointstate.h"
|
|
||||||
#include "v3math.h"
|
|
||||||
#include "llquaternion.h"
|
|
||||||
#include "linked_lists.h"
|
|
||||||
#include "llkeyframemotion.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// class LLKeyframeMotionParam
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
class LLKeyframeMotionParam :
|
|
||||||
public LLMotion
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
// Constructor
|
|
||||||
LLKeyframeMotionParam(const LLUUID &id);
|
|
||||||
|
|
||||||
// Destructor
|
|
||||||
virtual ~LLKeyframeMotionParam();
|
|
||||||
|
|
||||||
public:
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
// functions to support MotionController and MotionRegistry
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// static constructor
|
|
||||||
// all subclasses must implement such a function and register it
|
|
||||||
static LLMotion *create(const LLUUID &id) { return new LLKeyframeMotionParam(id); }
|
|
||||||
|
|
||||||
public:
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
// animation callbacks to be implemented by subclasses
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// motions must specify whether or not they loop
|
|
||||||
virtual BOOL getLoop() {
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// motions must report their total duration
|
|
||||||
virtual F32 getDuration() {
|
|
||||||
return mDuration;
|
|
||||||
}
|
|
||||||
|
|
||||||
// motions must report their "ease in" duration
|
|
||||||
virtual F32 getEaseInDuration() {
|
|
||||||
return mEaseInDuration;
|
|
||||||
}
|
|
||||||
|
|
||||||
// motions must report their "ease out" duration.
|
|
||||||
virtual F32 getEaseOutDuration() {
|
|
||||||
return mEaseOutDuration;
|
|
||||||
}
|
|
||||||
|
|
||||||
// motions must report their priority
|
|
||||||
virtual LLJoint::JointPriority getPriority() {
|
|
||||||
return mPriority;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual LLMotionBlendType getBlendType() { return NORMAL_BLEND; }
|
|
||||||
|
|
||||||
// called to determine when a motion should be activated/deactivated based on avatar pixel coverage
|
|
||||||
virtual F32 getMinPixelArea() { return MIN_REQUIRED_PIXEL_AREA_KEYFRAME; }
|
|
||||||
|
|
||||||
// run-time (post constructor) initialization,
|
|
||||||
// called after parameters have been set
|
|
||||||
// must return true to indicate success and be available for activation
|
|
||||||
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
|
||||||
|
|
||||||
// called when a motion is activated
|
|
||||||
// must return TRUE to indicate success, or else
|
|
||||||
// it will be deactivated
|
|
||||||
virtual BOOL onActivate();
|
|
||||||
|
|
||||||
// called per time step
|
|
||||||
// must return TRUE while it is active, and
|
|
||||||
// must return FALSE when the motion is completed.
|
|
||||||
virtual BOOL onUpdate(F32 time, U8* joint_mask);
|
|
||||||
|
|
||||||
// called when a motion is deactivated
|
|
||||||
virtual void onDeactivate();
|
|
||||||
|
|
||||||
virtual LLPose* getPose() { return mPoseBlender.getBlendedPose();}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
// new functions defined by this subclass
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
struct ParameterizedMotion
|
|
||||||
{
|
|
||||||
ParameterizedMotion(LLMotion* motion, F32 param) : mMotion(motion), mParam(param) {}
|
|
||||||
LLMotion* mMotion;
|
|
||||||
F32 mParam;
|
|
||||||
};
|
|
||||||
|
|
||||||
// add a motion and associated parameter triplet
|
|
||||||
BOOL addKeyframeMotion(char *name, const LLUUID &id, char *param, F32 value);
|
|
||||||
|
|
||||||
// set default motion for LOD and retrieving blend constants
|
|
||||||
void setDefaultKeyframeMotion(char *);
|
|
||||||
|
|
||||||
BOOL loadMotions();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
// Member Data
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
|
|
||||||
struct compare_motions
|
|
||||||
{
|
|
||||||
bool operator() (const ParameterizedMotion& a, const ParameterizedMotion& b) const
|
|
||||||
{
|
|
||||||
if (a.mParam != b.mParam)
|
|
||||||
return (a.mParam < b.mParam);
|
|
||||||
else
|
|
||||||
return a.mMotion < b.mMotion;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef std::set < ParameterizedMotion, compare_motions > motion_list_t;
|
|
||||||
typedef std::map <std::string, motion_list_t > motion_map_t;
|
|
||||||
motion_map_t mParameterizedMotions;
|
|
||||||
LLMotion* mDefaultKeyframeMotion;
|
|
||||||
LLCharacter* mCharacter;
|
|
||||||
LLPoseBlender mPoseBlender;
|
|
||||||
|
|
||||||
F32 mEaseInDuration;
|
|
||||||
F32 mEaseOutDuration;
|
|
||||||
F32 mDuration;
|
|
||||||
LLJoint::JointPriority mPriority;
|
|
||||||
|
|
||||||
LLUUID mTransactionID;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // LL_LLKEYFRAMEMOTIONPARAM_H
|
|
||||||
@@ -50,7 +50,7 @@ const F32 POSITION_THRESHOLD = 0.1f;
|
|||||||
// LLKeyframeStandMotion()
|
// LLKeyframeStandMotion()
|
||||||
// Class Constructor
|
// Class Constructor
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
LLKeyframeStandMotion::LLKeyframeStandMotion(const LLUUID &id) : LLKeyframeMotion(id)
|
LLKeyframeStandMotion::LLKeyframeStandMotion(LLUUID const& id, LLMotionController* controller) : LLKeyframeMotion(id, controller)
|
||||||
{
|
{
|
||||||
mFlipFeet = FALSE;
|
mFlipFeet = FALSE;
|
||||||
mCharacter = NULL;
|
mCharacter = NULL;
|
||||||
@@ -286,40 +286,38 @@ BOOL LLKeyframeStandMotion::onUpdate(F32 time, U8* joint_mask)
|
|||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
if ( mTrackAnkles )
|
if ( mTrackAnkles )
|
||||||
{
|
{
|
||||||
LLVector4 dirLeft4 = mAnkleLeftJoint.getWorldMatrix().getFwdRow4();
|
const LLVector4a& dirLeft4 = mAnkleLeftJoint.getWorldMatrix().getRow<LLMatrix4a::ROW_FWD>();
|
||||||
LLVector4 dirRight4 = mAnkleRightJoint.getWorldMatrix().getFwdRow4();
|
const LLVector4a& dirRight4 = mAnkleRightJoint.getWorldMatrix().getRow<LLMatrix4a::ROW_FWD>();
|
||||||
LLVector3 dirLeft = vec4to3( dirLeft4 );
|
|
||||||
LLVector3 dirRight = vec4to3( dirRight4 );
|
|
||||||
|
|
||||||
LLVector3 up;
|
LLVector4a up;
|
||||||
LLVector3 dir;
|
LLVector4a dir;
|
||||||
LLVector3 left;
|
LLVector4a left;
|
||||||
|
|
||||||
up = mNormalLeft;
|
up.load3(mNormalLeft.mV);
|
||||||
up.normVec();
|
up.normalize3fast();
|
||||||
if (mFlipFeet)
|
if (mFlipFeet)
|
||||||
{
|
{
|
||||||
up *= -1.0f;
|
up.negate();
|
||||||
}
|
}
|
||||||
dir = dirLeft;
|
dir = dirLeft4;
|
||||||
dir.normVec();
|
dir.normalize3fast();
|
||||||
left = up % dir;
|
left.setCross3(up,dir);
|
||||||
left.normVec();
|
left.normalize3fast();
|
||||||
dir = left % up;
|
dir.setCross3(left,up);
|
||||||
mRotationLeft = LLQuaternion( dir, left, up );
|
mRotationLeft = LLQuaternion( LLVector3(dir.getF32ptr()), LLVector3(left.getF32ptr()), LLVector3(up.getF32ptr()));
|
||||||
|
|
||||||
up = mNormalRight;
|
up.load3(mNormalRight.mV);
|
||||||
up.normVec();
|
up.normalize3fast();
|
||||||
if (mFlipFeet)
|
if (mFlipFeet)
|
||||||
{
|
{
|
||||||
up *= -1.0f;
|
up.negate();
|
||||||
}
|
}
|
||||||
dir = dirRight;
|
dir = dirRight4;
|
||||||
dir.normVec();
|
dir.normalize3fast();
|
||||||
left = up % dir;
|
left.setCross3(up,dir);
|
||||||
left.normVec();
|
left.normalize3fast();
|
||||||
dir = left % up;
|
dir.setCross3(left,up);
|
||||||
mRotationRight = LLQuaternion( dir, left, up );
|
mRotationRight = LLQuaternion( LLVector3(dir.getF32ptr()), LLVector3(left.getF32ptr()), LLVector3(up.getF32ptr()));
|
||||||
}
|
}
|
||||||
mAnkleLeftJoint.setWorldRotation( mRotationLeft );
|
mAnkleLeftJoint.setWorldRotation( mRotationLeft );
|
||||||
mAnkleRightJoint.setWorldRotation( mRotationRight );
|
mAnkleRightJoint.setWorldRotation( mRotationRight );
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class LLKeyframeStandMotion :
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
LLKeyframeStandMotion(const LLUUID &id);
|
LLKeyframeStandMotion(LLUUID const& id, LLMotionController* controller);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
virtual ~LLKeyframeStandMotion();
|
virtual ~LLKeyframeStandMotion();
|
||||||
@@ -60,7 +60,7 @@ public:
|
|||||||
|
|
||||||
// static constructor
|
// static constructor
|
||||||
// all subclasses must implement such a function and register it
|
// all subclasses must implement such a function and register it
|
||||||
static LLMotion *create(const LLUUID &id) { return new LLKeyframeStandMotion(id); }
|
static LLMotion* create(LLUUID const& id, LLMotionController* controller) { return new LLKeyframeStandMotion(id, controller); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -55,8 +55,8 @@ const F32 SPEED_ADJUST_TIME_CONSTANT = 0.1f; // time constant for speed adjustm
|
|||||||
// LLKeyframeWalkMotion()
|
// LLKeyframeWalkMotion()
|
||||||
// Class Constructor
|
// Class Constructor
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
LLKeyframeWalkMotion::LLKeyframeWalkMotion(const LLUUID &id)
|
LLKeyframeWalkMotion::LLKeyframeWalkMotion(LLUUID const& id, LLMotionController* controller)
|
||||||
: LLKeyframeMotion(id),
|
: LLKeyframeMotion(id, controller),
|
||||||
mCharacter(NULL),
|
mCharacter(NULL),
|
||||||
mCyclePhase(0.0f),
|
mCyclePhase(0.0f),
|
||||||
mRealTimeLast(0.0f),
|
mRealTimeLast(0.0f),
|
||||||
@@ -138,8 +138,8 @@ BOOL LLKeyframeWalkMotion::onUpdate(F32 time, U8* joint_mask)
|
|||||||
// LLWalkAdjustMotion()
|
// LLWalkAdjustMotion()
|
||||||
// Class Constructor
|
// Class Constructor
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
LLWalkAdjustMotion::LLWalkAdjustMotion(const LLUUID &id) :
|
LLWalkAdjustMotion::LLWalkAdjustMotion(LLUUID const& id, LLMotionController* controller) :
|
||||||
LLMotion(id),
|
AIMaskedMotion(id, controller, ANIM_AGENT_WALK_ADJUST),
|
||||||
mLastTime(0.f),
|
mLastTime(0.f),
|
||||||
mAnimSpeed(0.f),
|
mAnimSpeed(0.f),
|
||||||
mAdjustedSpeed(0.f),
|
mAdjustedSpeed(0.f),
|
||||||
@@ -193,7 +193,7 @@ BOOL LLWalkAdjustMotion::onActivate()
|
|||||||
F32 rightAnkleOffset = (mRightAnkleJoint->getWorldPosition() - mCharacter->getCharacterPosition()).magVec();
|
F32 rightAnkleOffset = (mRightAnkleJoint->getWorldPosition() - mCharacter->getCharacterPosition()).magVec();
|
||||||
mAnkleOffset = llmax(leftAnkleOffset, rightAnkleOffset);
|
mAnkleOffset = llmax(leftAnkleOffset, rightAnkleOffset);
|
||||||
|
|
||||||
return TRUE;
|
return AIMaskedMotion::onActivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -280,7 +280,7 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask)
|
|||||||
avatar_movement_dir.normalize();
|
avatar_movement_dir.normalize();
|
||||||
|
|
||||||
// planted foot speed is avatar velocity - foot slip amount along avatar movement direction
|
// planted foot speed is avatar velocity - foot slip amount along avatar movement direction
|
||||||
F32 foot_speed = speed - ((foot_slip_vector * avatar_movement_dir) / delta_time);
|
F32 foot_speed = llmax(0.f, speed - ((foot_slip_vector * avatar_movement_dir) / delta_time));
|
||||||
|
|
||||||
// multiply animation playback rate so that foot speed matches avatar speed
|
// multiply animation playback rate so that foot speed matches avatar speed
|
||||||
F32 min_speed_multiplier = clamp_rescale(speed, 0.f, 1.f, 0.f, 0.1f);
|
F32 min_speed_multiplier = clamp_rescale(speed, 0.f, 1.f, 0.f, 0.1f);
|
||||||
@@ -325,13 +325,14 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask)
|
|||||||
void LLWalkAdjustMotion::onDeactivate()
|
void LLWalkAdjustMotion::onDeactivate()
|
||||||
{
|
{
|
||||||
mCharacter->removeAnimationData("Walk Speed");
|
mCharacter->removeAnimationData("Walk Speed");
|
||||||
|
AIMaskedMotion::onDeactivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLFlyAdjustMotion::LLFlyAdjustMotion()
|
// LLFlyAdjustMotion::LLFlyAdjustMotion()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
LLFlyAdjustMotion::LLFlyAdjustMotion(const LLUUID &id)
|
LLFlyAdjustMotion::LLFlyAdjustMotion(LLUUID const& id, LLMotionController* controller)
|
||||||
: LLMotion(id),
|
: AIMaskedMotion(id, controller, ANIM_AGENT_FLY_ADJUST),
|
||||||
mRoll(0.f)
|
mRoll(0.f)
|
||||||
{
|
{
|
||||||
mName = "fly_adjust";
|
mName = "fly_adjust";
|
||||||
@@ -368,7 +369,7 @@ BOOL LLFlyAdjustMotion::onActivate()
|
|||||||
mPelvisState->setPosition(LLVector3::zero);
|
mPelvisState->setPosition(LLVector3::zero);
|
||||||
mPelvisState->setRotation(LLQuaternion::DEFAULT);
|
mPelvisState->setRotation(LLQuaternion::DEFAULT);
|
||||||
mRoll = 0.f;
|
mRoll = 0.f;
|
||||||
return TRUE;
|
return AIMaskedMotion::onActivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class LLKeyframeWalkMotion :
|
|||||||
friend class LLWalkAdjustMotion;
|
friend class LLWalkAdjustMotion;
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
LLKeyframeWalkMotion(const LLUUID &id);
|
LLKeyframeWalkMotion(LLUUID const& id, LLMotionController* controller);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
virtual ~LLKeyframeWalkMotion();
|
virtual ~LLKeyframeWalkMotion();
|
||||||
@@ -64,7 +64,7 @@ public:
|
|||||||
|
|
||||||
// static constructor
|
// static constructor
|
||||||
// all subclasses must implement such a function and register it
|
// all subclasses must implement such a function and register it
|
||||||
static LLMotion *create(const LLUUID &id) { return new LLKeyframeWalkMotion(id); }
|
static LLMotion* create(LLUUID const& id, LLMotionController* controller) { return new LLKeyframeWalkMotion(id, controller); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
@@ -86,11 +86,11 @@ public:
|
|||||||
S32 mDownFoot;
|
S32 mDownFoot;
|
||||||
};
|
};
|
||||||
|
|
||||||
class LLWalkAdjustMotion : public LLMotion
|
class LLWalkAdjustMotion : public AIMaskedMotion
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
LLWalkAdjustMotion(const LLUUID &id);
|
LLWalkAdjustMotion(LLUUID const& id, LLMotionController* controller);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
@@ -99,7 +99,7 @@ public:
|
|||||||
|
|
||||||
// static constructor
|
// static constructor
|
||||||
// all subclasses must implement such a function and register it
|
// all subclasses must implement such a function and register it
|
||||||
static LLMotion *create(const LLUUID &id) { return new LLWalkAdjustMotion(id); }
|
static LLMotion* create(LLUUID const& id, LLMotionController* controller) { return new LLWalkAdjustMotion(id, controller); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
@@ -136,11 +136,11 @@ public:
|
|||||||
F32 mAnkleOffset;
|
F32 mAnkleOffset;
|
||||||
};
|
};
|
||||||
|
|
||||||
class LLFlyAdjustMotion : public LLMotion
|
class LLFlyAdjustMotion : public AIMaskedMotion
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
LLFlyAdjustMotion(const LLUUID &id);
|
LLFlyAdjustMotion(LLUUID const& id, LLMotionController* controller);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
@@ -149,7 +149,7 @@ public:
|
|||||||
|
|
||||||
// static constructor
|
// static constructor
|
||||||
// all subclasses must implement such a function and register it
|
// all subclasses must implement such a function and register it
|
||||||
static LLMotion *create(const LLUUID &id) { return new LLFlyAdjustMotion(id); }
|
static LLMotion* create(LLUUID const& id, LLMotionController* controller) { return new LLFlyAdjustMotion(id, controller); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
@@ -157,7 +157,6 @@ public:
|
|||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
virtual LLMotionInitStatus onInitialize(LLCharacter *character);
|
||||||
virtual BOOL onActivate();
|
virtual BOOL onActivate();
|
||||||
virtual void onDeactivate() {};
|
|
||||||
virtual BOOL onUpdate(F32 time, U8* joint_mask);
|
virtual BOOL onUpdate(F32 time, U8* joint_mask);
|
||||||
virtual LLJoint::JointPriority getPriority(){return LLJoint::HIGHER_PRIORITY;}
|
virtual LLJoint::JointPriority getPriority(){return LLJoint::HIGHER_PRIORITY;}
|
||||||
virtual BOOL getLoop() { return TRUE; }
|
virtual BOOL getLoop() { return TRUE; }
|
||||||
|
|||||||
@@ -37,6 +37,125 @@
|
|||||||
|
|
||||||
#include "llmotion.h"
|
#include "llmotion.h"
|
||||||
#include "llcriticaldamp.h"
|
#include "llcriticaldamp.h"
|
||||||
|
#include "llmotioncontroller.h"
|
||||||
|
|
||||||
|
//<singu>
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// AISyncClientMotion class
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
AISyncKey* AISyncClientMotion::createSyncKey(AISyncKey const* from_key) const
|
||||||
|
{
|
||||||
|
// The const cast is needed because getDuration() is non-const while it should have been.
|
||||||
|
AISyncClientMotion* self = const_cast<AISyncClientMotion*>(this);
|
||||||
|
// Only synchronize motions with the same duration and loop value.
|
||||||
|
return new AISyncKeyMotion(from_key, self->getDuration(), self->getLoop());
|
||||||
|
}
|
||||||
|
|
||||||
|
void AISyncClientMotion::aisync_loading(void)
|
||||||
|
{
|
||||||
|
// Register the motion for (possible) synchronization: this marks the time at which is should have started.
|
||||||
|
unregister_client(); // In case it is already registered. Getting here means we are being (re)started now, we need to synchronize with other motions that start now.
|
||||||
|
register_client();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AISyncClientMotion::aisync_loaded(void)
|
||||||
|
{
|
||||||
|
AISyncServer* server = this->server();
|
||||||
|
if (!server)
|
||||||
|
{
|
||||||
|
// Already expired without being synchronized (no other motion was started at the same time).
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
AISyncKey const& key = server->key(); // The allocation of this is owned by server.
|
||||||
|
// There is no need to resync if there was not another motion started at the same time and the key already expired.
|
||||||
|
bool need_resync = !(server->never_synced() && key.expired());
|
||||||
|
AISyncKey* new_key = NULL;
|
||||||
|
if (need_resync)
|
||||||
|
{
|
||||||
|
// Create a new key using the old start time.
|
||||||
|
new_key = createSyncKey(&key);
|
||||||
|
}
|
||||||
|
server->remove(this); // This resets mServer and might even delete server.
|
||||||
|
if (need_resync)
|
||||||
|
{
|
||||||
|
// Add the client to another server (based on the new key). This takes ownership of the key allocation.
|
||||||
|
AISyncServerMap::instance().register_client(this, new_key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
F32 LLMotion::getRuntime(void) const
|
||||||
|
{
|
||||||
|
llassert(mActive);
|
||||||
|
return mController->getAnimTime() - mActivationTimestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
F32 LLMotion::getAnimTime(void) const
|
||||||
|
{
|
||||||
|
return mController->getAnimTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
F32 LLMotion::syncActivationTime(F32 time)
|
||||||
|
{
|
||||||
|
AISyncServer* server = this->server();
|
||||||
|
if (!server)
|
||||||
|
{
|
||||||
|
register_client();
|
||||||
|
server = this->server();
|
||||||
|
}
|
||||||
|
AISyncServer::client_list_t const& clients = server->getClients();
|
||||||
|
if (clients.size() > 1)
|
||||||
|
{
|
||||||
|
// Look for the client with the smallest runtime.
|
||||||
|
AISyncClientMotion* motion_with_smallest_runtime = NULL;
|
||||||
|
F32 runtime = 1e10;
|
||||||
|
// Run over all motions in this to be synchronized group.
|
||||||
|
for (AISyncServer::client_list_t::const_iterator client = clients.begin(); client != clients.end(); ++client)
|
||||||
|
{
|
||||||
|
if ((client->mReadyEvents & 2)) // Is this motion active? Motions that aren't loaded yet are not active.
|
||||||
|
{
|
||||||
|
// Currently, if event 2 is set then this is an LLMotion.
|
||||||
|
llassert(dynamic_cast<AISyncClientMotion*>(client->mClientPtr));
|
||||||
|
AISyncClientMotion* motion = static_cast<AISyncClientMotion*>(client->mClientPtr);
|
||||||
|
// Deactivated motions should have been deregistered, certainly not have event 2 set.
|
||||||
|
llassert(static_cast<LLMotion*>(motion)->isActive());
|
||||||
|
if (motion->getRuntime() < runtime)
|
||||||
|
{
|
||||||
|
// This is a bit fuzzy since theoretically the runtime of all active motions in the list should be the same.
|
||||||
|
// Just use the smallest value to get rid of some randomness. We might even synchronizing with ourselves
|
||||||
|
// in which case 'time' would be set to a value such that mActivationTimestamp won't change.
|
||||||
|
// In practise however, this list will contain only two clients: this, being inactive, and our partner.
|
||||||
|
runtime = motion->getRuntime();
|
||||||
|
motion_with_smallest_runtime = motion;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//-----------------------------------------------------------------------------------------
|
||||||
|
// Here is where the actual synchronization takes place.
|
||||||
|
// Current we only synchronize looped motions.
|
||||||
|
if (getLoop())
|
||||||
|
{
|
||||||
|
if (motion_with_smallest_runtime)
|
||||||
|
{
|
||||||
|
// Pretend the motion was started in the past at the same time as the other motion(s).
|
||||||
|
time = getAnimTime() - runtime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//-----------------------------------------------------------------------------------------
|
||||||
|
}
|
||||||
|
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AISyncClientMotion::deregistered(void)
|
||||||
|
{
|
||||||
|
#ifdef SHOW_ASSERT
|
||||||
|
mReadyEvents = 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
//</singu>
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -48,10 +167,11 @@
|
|||||||
// LLMotion()
|
// LLMotion()
|
||||||
// Class Constructor
|
// Class Constructor
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
LLMotion::LLMotion( const LLUUID &id ) :
|
LLMotion::LLMotion(LLUUID const& id, LLMotionController* controller) :
|
||||||
mStopped(TRUE),
|
mStopped(TRUE),
|
||||||
mActive(FALSE),
|
mActive(FALSE),
|
||||||
mID(id),
|
mID(id),
|
||||||
|
mController(controller),
|
||||||
mActivationTimestamp(0.f),
|
mActivationTimestamp(0.f),
|
||||||
mStopTimestamp(0.f),
|
mStopTimestamp(0.f),
|
||||||
mSendStopTimestamp(F32_MAX),
|
mSendStopTimestamp(F32_MAX),
|
||||||
@@ -147,6 +267,19 @@ void LLMotion::activate(F32 time)
|
|||||||
{
|
{
|
||||||
mActivationTimestamp = time;
|
mActivationTimestamp = time;
|
||||||
mStopped = FALSE;
|
mStopped = FALSE;
|
||||||
|
//<singu>
|
||||||
|
if (mController && !mController->syncing_disabled()) // Avoid being registered when syncing is disabled for this motion.
|
||||||
|
{
|
||||||
|
if (mActive)
|
||||||
|
{
|
||||||
|
// If the motion is already active then we are being restarted.
|
||||||
|
// Unregister it first (if it is registered) so that the call to ready will cause it to be registered
|
||||||
|
// and be synchronized with other motions that are started at this moment.
|
||||||
|
unregister_client();
|
||||||
|
}
|
||||||
|
ready(6, 2 | (mController->isHidden() ? 0 : 4)); // Signal that mActivationTimestamp is set/valid (2), and that this server has a visible motion (4) (or not).
|
||||||
|
}
|
||||||
|
//</singu>
|
||||||
mActive = TRUE;
|
mActive = TRUE;
|
||||||
onActivate();
|
onActivate();
|
||||||
}
|
}
|
||||||
@@ -159,6 +292,14 @@ void LLMotion::deactivate()
|
|||||||
mActive = FALSE;
|
mActive = FALSE;
|
||||||
mPose.setWeight(0.f);
|
mPose.setWeight(0.f);
|
||||||
|
|
||||||
|
//<singu>
|
||||||
|
if (server()) // Only when this motion is already registered.
|
||||||
|
{
|
||||||
|
ready(6, 0); // Signal that mActivationTimestamp is no longer valid.
|
||||||
|
unregister_client(); // No longer running, so no longer a part of this sync group.
|
||||||
|
}
|
||||||
|
//</singu>
|
||||||
|
|
||||||
if (mDeactivateCallback)
|
if (mDeactivateCallback)
|
||||||
{
|
{
|
||||||
(*mDeactivateCallback)(mDeactivateCallbackUserData);
|
(*mDeactivateCallback)(mDeactivateCallbackUserData);
|
||||||
@@ -174,4 +315,19 @@ BOOL LLMotion::canDeprecate()
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// AIMaskedMotion
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
BOOL AIMaskedMotion::onActivate()
|
||||||
|
{
|
||||||
|
mController->activated(mMaskBit);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AIMaskedMotion::onDeactivate()
|
||||||
|
{
|
||||||
|
mController->deactivated(mMaskBit);
|
||||||
|
}
|
||||||
|
|
||||||
// End
|
// End
|
||||||
|
|||||||
@@ -38,16 +38,85 @@
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#include "aisyncclient.h"
|
||||||
#include "llerror.h"
|
#include "llerror.h"
|
||||||
#include "llpose.h"
|
#include "llpose.h"
|
||||||
#include "lluuid.h"
|
#include "lluuid.h"
|
||||||
|
|
||||||
class LLCharacter;
|
class LLCharacter;
|
||||||
|
class LLMotionController;
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// class AISync* stuff
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class AISyncKeyMotion : public AISyncKey
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
F32 mDuration;
|
||||||
|
bool mLoop;
|
||||||
|
|
||||||
|
public:
|
||||||
|
AISyncKeyMotion(AISyncKey const* from_key, F32 duration, bool loop) : AISyncKey(from_key), mDuration(duration), mLoop(loop) { }
|
||||||
|
|
||||||
|
// Virtual functions of AISyncKey.
|
||||||
|
public:
|
||||||
|
/*virtual*/ synckeytype_t getkeytype(void) const
|
||||||
|
{
|
||||||
|
// Return a unique identifier for this class, where the low 8 bits represent the syncgroup.
|
||||||
|
return synckeytype_motion;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ bool equals(AISyncKey const& key) const
|
||||||
|
{
|
||||||
|
switch (key.getkeytype())
|
||||||
|
{
|
||||||
|
case synckeytype_motion:
|
||||||
|
{
|
||||||
|
// The other key is of the same type.
|
||||||
|
AISyncKeyMotion const& motion_key = static_cast<AISyncKeyMotion const&>(key);
|
||||||
|
return mLoop == motion_key.mLoop && is_approx_equal(mDuration, motion_key.mDuration);
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
// The keys must be in the same syncgroup.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class AISyncClientMotion : public AISyncClient
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
// Make sure that clients that are destroyed are first unregistered.
|
||||||
|
// This is needed, for example, when loading fails or when excess motions are being purged.
|
||||||
|
/*virtual*/ ~AISyncClientMotion() { unregister_client(); }
|
||||||
|
|
||||||
|
// AISyncClient events.
|
||||||
|
/*virtual*/ AISyncKey* createSyncKey(AISyncKey const* from_key = NULL) const;
|
||||||
|
/*virtual*/ void event1_ready(void) { }
|
||||||
|
/*virtual*/ void event1_not_ready(void) { }
|
||||||
|
/*virtual*/ void deregistered(void);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// This is called when the server sent us a message that it wants us to play this animation, but we can't because it isn't fully downloaded yet.
|
||||||
|
void aisync_loading(void);
|
||||||
|
// This is called when that motion is successfully loaded and it has to be re-registered because now the duration etc is known.
|
||||||
|
void aisync_loaded(void);
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Virtual functions of AISyncClientMotion.
|
||||||
|
// These are defined by classes derived from LLMotion (which is derived from this class).
|
||||||
|
virtual BOOL getLoop() = 0;
|
||||||
|
virtual F32 getDuration() = 0;
|
||||||
|
virtual F32 getAnimTime(void) const = 0;
|
||||||
|
virtual F32 getRuntime(void) const = 0;
|
||||||
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// class LLMotion
|
// class LLMotion
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
class LLMotion
|
class LLMotion : public AISyncClientMotion
|
||||||
{
|
{
|
||||||
friend class LLMotionController;
|
friend class LLMotionController;
|
||||||
|
|
||||||
@@ -66,7 +135,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
LLMotion(const LLUUID &id);
|
LLMotion(LLUUID const& id, LLMotionController* controller);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
virtual ~LLMotion();
|
virtual ~LLMotion();
|
||||||
@@ -114,7 +183,22 @@ protected:
|
|||||||
BOOL isActive() { return mActive; }
|
BOOL isActive() { return mActive; }
|
||||||
public:
|
public:
|
||||||
void activate(F32 time);
|
void activate(F32 time);
|
||||||
|
|
||||||
|
//<singu>
|
||||||
|
// Returns the time that this motion has been running.
|
||||||
|
virtual F32 getRuntime(void) const;
|
||||||
|
|
||||||
|
// Return the current time (in seconds since creation of the controller).
|
||||||
|
virtual F32 getAnimTime(void) const;
|
||||||
|
|
||||||
|
// This is called when a motion is to be activated, but might need synchronization.
|
||||||
|
// It adjusts the start time to match that of other motions in the same synchronization group that were already started.
|
||||||
|
F32 syncActivationTime(F32 time);
|
||||||
|
|
||||||
|
// Accessor.
|
||||||
|
LLMotionController* getController(void) const { return mController; }
|
||||||
|
//</singu>
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// animation callbacks to be implemented by subclasses
|
// animation callbacks to be implemented by subclasses
|
||||||
@@ -181,6 +265,9 @@ protected:
|
|||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
std::string mName; // instance name assigned by motion controller
|
std::string mName; // instance name assigned by motion controller
|
||||||
LLUUID mID;
|
LLUUID mID;
|
||||||
|
//<singu>
|
||||||
|
LLMotionController* mController;
|
||||||
|
//</singu>
|
||||||
|
|
||||||
F32 mActivationTimestamp; // time when motion was activated
|
F32 mActivationTimestamp; // time when motion was activated
|
||||||
F32 mStopTimestamp; // time when motion was told to stop
|
F32 mStopTimestamp; // time when motion was told to stop
|
||||||
@@ -199,9 +286,9 @@ protected:
|
|||||||
class LLTestMotion : public LLMotion
|
class LLTestMotion : public LLMotion
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LLTestMotion(const LLUUID &id) : LLMotion(id){}
|
LLTestMotion(LLUUID const& id, LLMotionController* controller) : LLMotion(id, controller){}
|
||||||
~LLTestMotion() {}
|
~LLTestMotion() {}
|
||||||
static LLMotion *create(const LLUUID& id) { return new LLTestMotion(id); }
|
static LLMotion* create(LLUUID const& id, LLMotionController* controller) { return new LLTestMotion(id, controller); }
|
||||||
BOOL getLoop() { return FALSE; }
|
BOOL getLoop() { return FALSE; }
|
||||||
F32 getDuration() { return 0.0f; }
|
F32 getDuration() { return 0.0f; }
|
||||||
F32 getEaseInDuration() { return 0.0f; }
|
F32 getEaseInDuration() { return 0.0f; }
|
||||||
@@ -223,9 +310,9 @@ public:
|
|||||||
class LLNullMotion : public LLMotion
|
class LLNullMotion : public LLMotion
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LLNullMotion(const LLUUID &id) : LLMotion(id) {}
|
LLNullMotion(LLUUID const& id, LLMotionController* controller) : LLMotion(id, controller) {}
|
||||||
~LLNullMotion() {}
|
~LLNullMotion() {}
|
||||||
static LLMotion *create(const LLUUID &id) { return new LLNullMotion(id); }
|
static LLMotion* create(LLUUID const& id, LLMotionController* controller) { return new LLNullMotion(id, controller); }
|
||||||
|
|
||||||
// motions must specify whether or not they loop
|
// motions must specify whether or not they loop
|
||||||
/*virtual*/ BOOL getLoop() { return TRUE; }
|
/*virtual*/ BOOL getLoop() { return TRUE; }
|
||||||
@@ -266,5 +353,41 @@ public:
|
|||||||
// called when a motion is deactivated
|
// called when a motion is deactivated
|
||||||
/*virtual*/ void onDeactivate() {}
|
/*virtual*/ void onDeactivate() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// AIMaskedMotion
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// These motions have a bit assigned in LLMotionController::mActiveMask
|
||||||
|
// that is set and uset upon activation/deactivation.
|
||||||
|
|
||||||
|
// This must be in the same order as ANIM_AGENT_BODY_NOISE_ID through ANIM_AGENT_WALK_ADJUST_ID in llvoavatar.cpp.
|
||||||
|
U32 const ANIM_AGENT_BODY_NOISE = 0x001;
|
||||||
|
U32 const ANIM_AGENT_BREATHE_ROT = 0x002;
|
||||||
|
U32 const ANIM_AGENT_PHYSICS_MOTION = 0x004;
|
||||||
|
U32 const ANIM_AGENT_EDITING = 0x008;
|
||||||
|
U32 const ANIM_AGENT_EYE = 0x010;
|
||||||
|
U32 const ANIM_AGENT_FLY_ADJUST = 0x020;
|
||||||
|
U32 const ANIM_AGENT_HAND_MOTION = 0x040;
|
||||||
|
U32 const ANIM_AGENT_HEAD_ROT = 0x080;
|
||||||
|
U32 const ANIM_AGENT_PELVIS_FIX = 0x100;
|
||||||
|
U32 const ANIM_AGENT_TARGET = 0x200;
|
||||||
|
U32 const ANIM_AGENT_WALK_ADJUST = 0x400;
|
||||||
|
|
||||||
|
class AIMaskedMotion : public LLMotion
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
U32 mMaskBit;
|
||||||
|
|
||||||
|
public:
|
||||||
|
AIMaskedMotion(LLUUID const& id, LLMotionController* controller, U32 mask_bit) : LLMotion(id, controller), mMaskBit(mask_bit) { }
|
||||||
|
|
||||||
|
/*virtual*/ BOOL onActivate();
|
||||||
|
/*virtual*/ void onDeactivate();
|
||||||
|
|
||||||
|
U32 getMaskBit(void) const { return mMaskBit; }
|
||||||
|
};
|
||||||
|
|
||||||
#endif // LL_LLMOTION_H
|
#endif // LL_LLMOTION_H
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ void LLMotionRegistry::markBad( const LLUUID& id )
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// createMotion()
|
// createMotion()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
LLMotion *LLMotionRegistry::createMotion( const LLUUID &id )
|
LLMotion* LLMotionRegistry::createMotion(LLUUID const& id, LLMotionController* controller)
|
||||||
{
|
{
|
||||||
LLMotionConstructor constructor = get_if_there(mMotionTable, id, LLMotionConstructor(NULL));
|
LLMotionConstructor constructor = get_if_there(mMotionTable, id, LLMotionConstructor(NULL));
|
||||||
LLMotion* motion = NULL;
|
LLMotion* motion = NULL;
|
||||||
@@ -105,11 +105,11 @@ LLMotion *LLMotionRegistry::createMotion( const LLUUID &id )
|
|||||||
if ( constructor == NULL )
|
if ( constructor == NULL )
|
||||||
{
|
{
|
||||||
// *FIX: need to replace with a better default scheme. RN
|
// *FIX: need to replace with a better default scheme. RN
|
||||||
motion = LLKeyframeMotion::create(id);
|
motion = LLKeyframeMotion::create(id, controller);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
motion = constructor(id);
|
motion = constructor(id, controller);
|
||||||
}
|
}
|
||||||
|
|
||||||
return motion;
|
return motion;
|
||||||
@@ -126,18 +126,22 @@ LLMotion *LLMotionRegistry::createMotion( const LLUUID &id )
|
|||||||
// Class Constructor
|
// Class Constructor
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
LLMotionController::LLMotionController()
|
LLMotionController::LLMotionController()
|
||||||
: mTimeFactor(sCurrentTimeFactor),
|
: mIsSelf(FALSE),
|
||||||
|
mTimeFactor(sCurrentTimeFactor),
|
||||||
mCharacter(NULL),
|
mCharacter(NULL),
|
||||||
mAnimTime(0.f),
|
mActiveMask(0),
|
||||||
|
mDisableSyncing(0),
|
||||||
|
mHidden(false),
|
||||||
|
mHaveVisibleSyncedMotions(false),
|
||||||
mPrevTimerElapsed(0.f),
|
mPrevTimerElapsed(0.f),
|
||||||
|
mAnimTime(0.f),
|
||||||
mLastTime(0.0f),
|
mLastTime(0.0f),
|
||||||
mHasRunOnce(FALSE),
|
mHasRunOnce(FALSE),
|
||||||
mPaused(FALSE),
|
mPaused(FALSE),
|
||||||
mPauseTime(0.f),
|
mPauseTime(0.f),
|
||||||
mTimeStep(0.f),
|
mTimeStep(0.f),
|
||||||
mTimeStepCount(0),
|
mTimeStepCount(0),
|
||||||
mLastInterp(0.f),
|
mLastInterp(0.f)
|
||||||
mIsSelf(FALSE)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,7 +172,15 @@ void LLMotionController::deleteAllMotions()
|
|||||||
mLoadingMotions.clear();
|
mLoadingMotions.clear();
|
||||||
mLoadedMotions.clear();
|
mLoadedMotions.clear();
|
||||||
mActiveMotions.clear();
|
mActiveMotions.clear();
|
||||||
|
//<singu>
|
||||||
|
mActiveMask = 0;
|
||||||
|
for_each(mDeprecatedMotions.begin(), mDeprecatedMotions.end(), DeletePointer());
|
||||||
|
mDeprecatedMotions.clear();
|
||||||
|
for (motion_map_t::iterator iter = mAllMotions.begin(); iter != mAllMotions.end(); ++iter)
|
||||||
|
{
|
||||||
|
iter->second->unregister_client();
|
||||||
|
}
|
||||||
|
//</singu>
|
||||||
for_each(mAllMotions.begin(), mAllMotions.end(), DeletePairedPointer());
|
for_each(mAllMotions.begin(), mAllMotions.end(), DeletePairedPointer());
|
||||||
mAllMotions.clear();
|
mAllMotions.clear();
|
||||||
}
|
}
|
||||||
@@ -178,26 +190,19 @@ void LLMotionController::deleteAllMotions()
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void LLMotionController::purgeExcessMotions()
|
void LLMotionController::purgeExcessMotions()
|
||||||
{
|
{
|
||||||
if (mLoadedMotions.size() > MAX_MOTION_INSTANCES)
|
//<singu>
|
||||||
|
// The old code attempted to remove non-active motions from mDeprecatedMotions,
|
||||||
|
// but that is nonsense: there are no motions in mDeprecatedMotions that are not active.
|
||||||
|
if (mLoadedMotions.size() <= MAX_MOTION_INSTANCES)
|
||||||
{
|
{
|
||||||
// clean up deprecated motions
|
// Speed up, no need to create motions_to_kill.
|
||||||
for (motion_set_t::iterator deprecated_motion_it = mDeprecatedMotions.begin();
|
return;
|
||||||
deprecated_motion_it != mDeprecatedMotions.end(); )
|
|
||||||
{
|
|
||||||
motion_set_t::iterator cur_iter = deprecated_motion_it++;
|
|
||||||
LLMotion* cur_motionp = *cur_iter;
|
|
||||||
if (!isMotionActive(cur_motionp))
|
|
||||||
{
|
|
||||||
// Motion is deprecated so we know it's not cannonical,
|
|
||||||
// we can safely remove the instance
|
|
||||||
removeMotionInstance(cur_motionp); // modifies mDeprecatedMotions
|
|
||||||
mDeprecatedMotions.erase(cur_iter);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
//</singu>
|
||||||
|
|
||||||
std::set<LLUUID> motions_to_kill;
|
std::set<LLUUID> motions_to_kill;
|
||||||
if (mLoadedMotions.size() > MAX_MOTION_INSTANCES)
|
|
||||||
|
if (1) // Singu: leave indentation alone...
|
||||||
{
|
{
|
||||||
// too many motions active this frame, kill all blenders
|
// too many motions active this frame, kill all blenders
|
||||||
mPoseBlender.clearBlenders();
|
mPoseBlender.clearBlenders();
|
||||||
@@ -308,24 +313,44 @@ BOOL LLMotionController::registerMotion( const LLUUID& id, LLMotionConstructor c
|
|||||||
void LLMotionController::removeMotion( const LLUUID& id)
|
void LLMotionController::removeMotion( const LLUUID& id)
|
||||||
{
|
{
|
||||||
LLMotion* motionp = findMotion(id);
|
LLMotion* motionp = findMotion(id);
|
||||||
mAllMotions.erase(id);
|
//<singu>
|
||||||
removeMotionInstance(motionp);
|
// If a motion is erased from mAllMotions, it must be deleted.
|
||||||
|
if (motionp)
|
||||||
|
{
|
||||||
|
mAllMotions.erase(id);
|
||||||
|
removeMotionInstance(motionp);
|
||||||
|
delete motionp;
|
||||||
|
}
|
||||||
|
//</singu>
|
||||||
}
|
}
|
||||||
|
|
||||||
// removes instance of a motion from all runtime structures, but does
|
// removes instance of a motion from all runtime structures, but does
|
||||||
// not erase entry by ID, as this could be a duplicate instance
|
// not erase entry by ID, as this could be a duplicate instance
|
||||||
// use removeMotion(id) to remove all references to a given motion by id.
|
// use removeMotion(id) to remove a reference to a given motion by id
|
||||||
|
// (that will not remove (active) deprecated motions).
|
||||||
void LLMotionController::removeMotionInstance(LLMotion* motionp)
|
void LLMotionController::removeMotionInstance(LLMotion* motionp)
|
||||||
{
|
{
|
||||||
if (motionp)
|
if (motionp)
|
||||||
{
|
{
|
||||||
llassert(findMotion(motionp->getID()) != motionp);
|
llassert(findMotion(motionp->getID()) != motionp);
|
||||||
if (motionp->isActive())
|
|
||||||
motionp->deactivate();
|
|
||||||
mLoadingMotions.erase(motionp);
|
mLoadingMotions.erase(motionp);
|
||||||
mLoadedMotions.erase(motionp);
|
mLoadedMotions.erase(motionp);
|
||||||
mActiveMotions.remove(motionp);
|
mActiveMotions.remove(motionp);
|
||||||
delete motionp;
|
//<singu>
|
||||||
|
// Deactivation moved here. Only delete motionp when it is being removed from mDeprecatedMotions.
|
||||||
|
if (motionp->isActive())
|
||||||
|
{
|
||||||
|
motionp->deactivate();
|
||||||
|
// If a motion is deactivated, it must be removed from mDeprecatedMotions if there.
|
||||||
|
motion_set_t::iterator found_it = mDeprecatedMotions.find(motionp);
|
||||||
|
if (found_it != mDeprecatedMotions.end())
|
||||||
|
{
|
||||||
|
mDeprecatedMotions.erase(found_it);
|
||||||
|
// If a motion is erased from mDeprecatedMotions, it must be deleted.
|
||||||
|
delete motionp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//</singu>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -341,7 +366,7 @@ LLMotion* LLMotionController::createMotion( const LLUUID &id )
|
|||||||
if (!motion)
|
if (!motion)
|
||||||
{
|
{
|
||||||
// look up constructor and create it
|
// look up constructor and create it
|
||||||
motion = sRegistry.createMotion(id);
|
motion = sRegistry.createMotion(id, this);
|
||||||
if (!motion)
|
if (!motion)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -393,6 +418,7 @@ BOOL LLMotionController::startMotion(const LLUUID &id, F32 start_offset)
|
|||||||
if (motion
|
if (motion
|
||||||
&& !mPaused
|
&& !mPaused
|
||||||
&& motion->canDeprecate()
|
&& motion->canDeprecate()
|
||||||
|
&& motion->isActive() // singu: do not deprecate motions that are not active.
|
||||||
&& motion->getFadeWeight() > 0.01f // not LOD-ed out
|
&& motion->getFadeWeight() > 0.01f // not LOD-ed out
|
||||||
&& (motion->isBlending() || motion->getStopTime() != 0.f))
|
&& (motion->isBlending() || motion->getStopTime() != 0.f))
|
||||||
{
|
{
|
||||||
@@ -418,7 +444,19 @@ BOOL LLMotionController::startMotion(const LLUUID &id, F32 start_offset)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// llinfos << "Starting motion " << name << llendl;
|
// llinfos << "Starting motion " << name << llendl;
|
||||||
return activateMotionInstance(motion, mAnimTime - start_offset);
|
//<singu>
|
||||||
|
F32 start_time = mAnimTime - start_offset;
|
||||||
|
if (!mDisableSyncing)
|
||||||
|
{
|
||||||
|
start_time = motion->syncActivationTime(start_time);
|
||||||
|
}
|
||||||
|
++mDisableSyncing;
|
||||||
|
//</singu>
|
||||||
|
BOOL res = activateMotionInstance(motion, start_time);
|
||||||
|
//<singu>
|
||||||
|
--mDisableSyncing;
|
||||||
|
//</singu>
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -774,7 +812,19 @@ void LLMotionController::updateLoadingMotions()
|
|||||||
// this motion should be playing
|
// this motion should be playing
|
||||||
if (!motionp->isStopped())
|
if (!motionp->isStopped())
|
||||||
{
|
{
|
||||||
activateMotionInstance(motionp, mAnimTime);
|
//<singu>
|
||||||
|
F32 start_time = mAnimTime;
|
||||||
|
if (!mDisableSyncing)
|
||||||
|
{
|
||||||
|
motionp->aisync_loaded();
|
||||||
|
start_time = motionp->syncActivationTime(start_time);
|
||||||
|
}
|
||||||
|
++mDisableSyncing;
|
||||||
|
//</singu>
|
||||||
|
activateMotionInstance(motionp, start_time);
|
||||||
|
//<singu>
|
||||||
|
--mDisableSyncing;
|
||||||
|
//</singu>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (status == LLMotion::STATUS_FAILURE)
|
else if (status == LLMotion::STATUS_FAILURE)
|
||||||
@@ -782,12 +832,15 @@ void LLMotionController::updateLoadingMotions()
|
|||||||
llinfos << "Motion " << motionp->getID() << " init failed." << llendl;
|
llinfos << "Motion " << motionp->getID() << " init failed." << llendl;
|
||||||
sRegistry.markBad(motionp->getID());
|
sRegistry.markBad(motionp->getID());
|
||||||
mLoadingMotions.erase(curiter);
|
mLoadingMotions.erase(curiter);
|
||||||
motion_set_t::iterator found_it = mDeprecatedMotions.find(motionp);
|
// Singu note: a motion in mLoadingMotions will not be in mActiveMotions
|
||||||
if (found_it != mDeprecatedMotions.end())
|
// and therefore not be in mDeprecatedMotions. So, we don't have to
|
||||||
{
|
// check for it's existence there.
|
||||||
mDeprecatedMotions.erase(found_it);
|
llassert(mDeprecatedMotions.find(motionp) == mDeprecatedMotions.end());
|
||||||
}
|
|
||||||
mAllMotions.erase(motionp->getID());
|
mAllMotions.erase(motionp->getID());
|
||||||
|
//<singu>
|
||||||
|
// Make sure we're not registered anymore.
|
||||||
|
motionp->unregister_client();
|
||||||
|
//</singu>
|
||||||
delete motionp;
|
delete motionp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -821,8 +874,15 @@ void LLMotionController::updateMotions(bool force_update)
|
|||||||
{
|
{
|
||||||
F32 time_interval = fmodf(update_time, mTimeStep);
|
F32 time_interval = fmodf(update_time, mTimeStep);
|
||||||
|
|
||||||
// always animate *ahead* of actual time
|
//<singu>
|
||||||
S32 quantum_count = llmax(0, llfloor((update_time - time_interval) / mTimeStep)) + 1;
|
// This old code is nonsense.
|
||||||
|
//S32 quantum_count = llmax(0, llround((update_time - time_interval) / mTimeStep)) + 1;
|
||||||
|
// (update_time - time_interval) / mTimeStep is an integer! We need llround to get rid of floating point errors, not llfloor.
|
||||||
|
// Moreover, just rounding off to the nearest integer with llround(update_time / mTimeStep) makes a lot more sense:
|
||||||
|
// it is the best we can do to get as close to what we should draw as possible.
|
||||||
|
// However, mAnimTime may only be incremented; therefore make sure of that with the llmax.
|
||||||
|
S32 quantum_count = llmax(llround(update_time / mTimeStep), llceil(mAnimTime / mTimeStep));
|
||||||
|
//</singu>
|
||||||
if (quantum_count == mTimeStepCount)
|
if (quantum_count == mTimeStepCount)
|
||||||
{
|
{
|
||||||
// we're still in same time quantum as before, so just interpolate and exit
|
// we're still in same time quantum as before, so just interpolate and exit
|
||||||
@@ -848,7 +908,8 @@ void LLMotionController::updateMotions(bool force_update)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mAnimTime = update_time;
|
// Singu note: mAnimTime may never be set back in time.
|
||||||
|
mAnimTime = llmax(mAnimTime, update_time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -915,6 +976,12 @@ BOOL LLMotionController::activateMotionInstance(LLMotion *motion, F32 time)
|
|||||||
|
|
||||||
if (mLoadingMotions.find(motion) != mLoadingMotions.end())
|
if (mLoadingMotions.find(motion) != mLoadingMotions.end())
|
||||||
{
|
{
|
||||||
|
//<singu>
|
||||||
|
if (!syncing_disabled())
|
||||||
|
{
|
||||||
|
motion->aisync_loading();
|
||||||
|
}
|
||||||
|
//</singu>
|
||||||
// we want to start this motion, but we can't yet, so flag it as started
|
// we want to start this motion, but we can't yet, so flag it as started
|
||||||
motion->setStopped(FALSE);
|
motion->setStopped(FALSE);
|
||||||
// report pending animations as activated
|
// report pending animations as activated
|
||||||
@@ -970,18 +1037,16 @@ BOOL LLMotionController::activateMotionInstance(LLMotion *motion, F32 time)
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLMotionController::deactivateMotionInstance(LLMotion *motion)
|
BOOL LLMotionController::deactivateMotionInstance(LLMotion *motion)
|
||||||
{
|
{
|
||||||
motion->deactivate();
|
|
||||||
|
|
||||||
motion_set_t::iterator found_it = mDeprecatedMotions.find(motion);
|
motion_set_t::iterator found_it = mDeprecatedMotions.find(motion);
|
||||||
if (found_it != mDeprecatedMotions.end())
|
if (found_it != mDeprecatedMotions.end())
|
||||||
{
|
{
|
||||||
// deprecated motions need to be completely excised
|
// deprecated motions need to be completely excised
|
||||||
removeMotionInstance(motion);
|
removeMotionInstance(motion); // singu note: this deactivates motion and removes it from mDeprecatedMotions.
|
||||||
mDeprecatedMotions.erase(found_it);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// for motions that we are keeping, simply remove from active queue
|
// for motions that we are keeping, simply remove from active queue
|
||||||
|
motion->deactivate(); // singu note: moved here from the top of the function.
|
||||||
mActiveMotions.remove(motion);
|
mActiveMotions.remove(motion);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1049,11 +1114,26 @@ void LLMotionController::dumpMotions()
|
|||||||
state_string += std::string("L");
|
state_string += std::string("L");
|
||||||
if (std::find(mActiveMotions.begin(), mActiveMotions.end(), motion)!=mActiveMotions.end())
|
if (std::find(mActiveMotions.begin(), mActiveMotions.end(), motion)!=mActiveMotions.end())
|
||||||
state_string += std::string("A");
|
state_string += std::string("A");
|
||||||
if (mDeprecatedMotions.find(motion) != mDeprecatedMotions.end())
|
llassert(mDeprecatedMotions.find(motion) == mDeprecatedMotions.end()); // singu: it's impossible that a motion is in mAllMotions and mDeprecatedMotions at the same time.
|
||||||
state_string += std::string("D");
|
|
||||||
llinfos << gAnimLibrary.animationName(id) << " " << state_string << llendl;
|
llinfos << gAnimLibrary.animationName(id) << " " << state_string << llendl;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//<singu>
|
||||||
|
// Also dump the deprecated motions.
|
||||||
|
for (motion_set_t::iterator iter = mDeprecatedMotions.begin();
|
||||||
|
iter != mDeprecatedMotions.end(); ++iter)
|
||||||
|
{
|
||||||
|
std::string state_string;
|
||||||
|
LLMotion* motion = *iter;
|
||||||
|
LLUUID id = motion->getID();
|
||||||
|
llassert(mLoadingMotions.find(motion) == mLoadingMotions.end());
|
||||||
|
if (mLoadedMotions.find(motion) != mLoadedMotions.end())
|
||||||
|
state_string += std::string("L");
|
||||||
|
if (std::find(mActiveMotions.begin(), mActiveMotions.end(), motion)!=mActiveMotions.end())
|
||||||
|
state_string += std::string("A");
|
||||||
|
state_string += "D";
|
||||||
|
llinfos << gAnimLibrary.animationName(id) << " " << state_string << llendl;
|
||||||
|
}
|
||||||
|
//</singu>
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -1061,11 +1141,11 @@ void LLMotionController::dumpMotions()
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void LLMotionController::deactivateAllMotions()
|
void LLMotionController::deactivateAllMotions()
|
||||||
{
|
{
|
||||||
for (motion_map_t::iterator iter = mAllMotions.begin();
|
// Singu note: this must run over mActiveMotions: other motions are not active,
|
||||||
iter != mAllMotions.end(); iter++)
|
// and running over mAllMotions will miss the ones in mDeprecatedMotions.
|
||||||
|
for (motion_list_t::iterator iter = mActiveMotions.begin(); iter != mActiveMotions.end();)
|
||||||
{
|
{
|
||||||
LLMotion* motionp = iter->second;
|
deactivateMotionInstance(*iter++); // This might invalidate iter by erasing it from mActiveMotions.
|
||||||
deactivateMotionInstance(motionp);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1086,8 +1166,7 @@ void LLMotionController::flushAllMotions()
|
|||||||
active_motions.push_back(std::make_pair(motionp->getID(),dtime));
|
active_motions.push_back(std::make_pair(motionp->getID(),dtime));
|
||||||
motionp->deactivate(); // don't call deactivateMotionInstance() because we are going to reactivate it
|
motionp->deactivate(); // don't call deactivateMotionInstance() because we are going to reactivate it
|
||||||
}
|
}
|
||||||
mActiveMotions.clear();
|
|
||||||
|
|
||||||
// delete all motion instances
|
// delete all motion instances
|
||||||
deleteAllMotions();
|
deleteAllMotions();
|
||||||
|
|
||||||
@@ -1096,13 +1175,136 @@ void LLMotionController::flushAllMotions()
|
|||||||
mCharacter->removeAnimationData("Hand Pose");
|
mCharacter->removeAnimationData("Hand Pose");
|
||||||
|
|
||||||
// restart motions
|
// restart motions
|
||||||
|
//<singu>
|
||||||
|
// Because we called motionp->deactivate() above, instead of deactivateMotionInstance(),
|
||||||
|
// prevent calling AISyncClientMotion::activateInstance in startMotion below.
|
||||||
|
disable_syncing();
|
||||||
|
//</singu>
|
||||||
for (std::vector<std::pair<LLUUID,F32> >::iterator iter = active_motions.begin();
|
for (std::vector<std::pair<LLUUID,F32> >::iterator iter = active_motions.begin();
|
||||||
iter != active_motions.end(); ++iter)
|
iter != active_motions.end(); ++iter)
|
||||||
{
|
{
|
||||||
startMotion(iter->first, iter->second);
|
startMotion(iter->first, iter->second);
|
||||||
}
|
}
|
||||||
|
//<singu>
|
||||||
|
enable_syncing();
|
||||||
|
//</singu>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//<singu>
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// toggle_hidden()
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
void LLMotionController::toggle_hidden(void)
|
||||||
|
{
|
||||||
|
mHaveVisibleSyncedMotions = mHidden; // Default is false if we just became invisible (otherwise this value isn't used).
|
||||||
|
mHidden = !mHidden;
|
||||||
|
synceventset_t const visible = mHidden ? 0 : 4;
|
||||||
|
|
||||||
|
// Run over all motions.
|
||||||
|
for (motion_list_t::iterator iter = mActiveMotions.begin(); iter != mActiveMotions.end(); ++iter)
|
||||||
|
{
|
||||||
|
LLMotion* motionp = *iter;
|
||||||
|
AISyncServer* server = motionp->server();
|
||||||
|
if (server && !server->never_synced() && motionp->isActive()) // Skip motions that aren't synchronized at all or that are not active.
|
||||||
|
{
|
||||||
|
bool visible_before = server->events_with_at_least_one_client_ready() & 4;
|
||||||
|
server->ready(4, visible, motionp); // Mark that now we are visible or no longer visible.
|
||||||
|
bool visible_after = server->events_with_at_least_one_client_ready() & 4;
|
||||||
|
if (visible_after) // Are there any synchronized motions (left) that ARE visible?
|
||||||
|
{
|
||||||
|
mHaveVisibleSyncedMotions = true;
|
||||||
|
}
|
||||||
|
if (visible_before != visible_after)
|
||||||
|
{
|
||||||
|
// The group as a whole now might need to change whether or not it is animated.
|
||||||
|
AISyncServer::client_list_t const& clients = server->getClients();
|
||||||
|
for (AISyncServer::client_list_t::const_iterator client = clients.begin(); client != clients.end(); ++client)
|
||||||
|
{
|
||||||
|
LLMotion* motion = dynamic_cast<LLMotion*>(client->mClientPtr);
|
||||||
|
if (!motion)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
LLMotionController* controller = motion->getController();
|
||||||
|
if (controller == this)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (visible_after)
|
||||||
|
{
|
||||||
|
// Us becoming visible means that all synchronized avatars need to be animated again too.
|
||||||
|
controller->setHaveVisibleSyncedMotions();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Us becoming hidden means that all synchronized avatars might stop animating.
|
||||||
|
controller->refresh_hidden(); // It is extremely unlikely, but harmless, to call this twice on the same controller.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLMotionController::refresh_hidden(void)
|
||||||
|
{
|
||||||
|
mHaveVisibleSyncedMotions = !mHidden;
|
||||||
|
|
||||||
|
// Run over all motions.
|
||||||
|
for (motion_list_t::iterator iter = mActiveMotions.begin(); iter != mActiveMotions.end(); ++iter)
|
||||||
|
{
|
||||||
|
LLMotion* motionp = *iter;
|
||||||
|
AISyncServer* server = motionp->server();
|
||||||
|
if (server && !server->never_synced() && motionp->isActive()) // Skip motions that aren't synchronized at all or that are not active.
|
||||||
|
{
|
||||||
|
bool visible_after = server->events_with_at_least_one_client_ready() & 4;
|
||||||
|
if (visible_after) // Are there any synchronized motions (left) that ARE visible?
|
||||||
|
{
|
||||||
|
mHaveVisibleSyncedMotions = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLMotionController::pauseAllSyncedCharacters(std::vector<LLAnimPauseRequest>& avatar_pause_handles)
|
||||||
|
{
|
||||||
|
// Run over all motions.
|
||||||
|
for (motion_list_t::iterator iter = mActiveMotions.begin(); iter != mActiveMotions.end(); ++iter)
|
||||||
|
{
|
||||||
|
LLMotion* motionp = *iter;
|
||||||
|
AISyncServer* server = motionp->server();
|
||||||
|
if (server && !server->never_synced() && motionp->isActive()) // Skip motions that aren't synchronized at all or that are not active.
|
||||||
|
{
|
||||||
|
// Run over all clients of the found servers.
|
||||||
|
AISyncServer::client_list_t const& clients = server->getClients();
|
||||||
|
for (AISyncServer::client_list_t::const_iterator client = clients.begin(); client != clients.end(); ++client)
|
||||||
|
{
|
||||||
|
LLMotion* motion = dynamic_cast<LLMotion*>(client->mClientPtr);
|
||||||
|
if (!motion)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
LLMotionController* controller = motion->getController();
|
||||||
|
if (controller == this)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
controller->requestPause(avatar_pause_handles);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLMotionController::requestPause(std::vector<LLAnimPauseRequest>& avatar_pause_handles)
|
||||||
|
{
|
||||||
|
if (mCharacter)
|
||||||
|
{
|
||||||
|
mCharacter->requestPause(avatar_pause_handles);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//</singu>
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// pause()
|
// pause()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -51,11 +51,14 @@
|
|||||||
// This is necessary because llcharacter.h includes this file.
|
// This is necessary because llcharacter.h includes this file.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
class LLCharacter;
|
class LLCharacter;
|
||||||
|
class LLMotionController;
|
||||||
|
class LLPauseRequestHandle;
|
||||||
|
typedef LLPointer<LLPauseRequestHandle> LLAnimPauseRequest;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLMotionRegistry
|
// LLMotionRegistry
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
typedef LLMotion*(*LLMotionConstructor)(const LLUUID &id);
|
typedef LLMotion* (*LLMotionConstructor)(LLUUID const& id, LLMotionController*);
|
||||||
|
|
||||||
class LLMotionRegistry
|
class LLMotionRegistry
|
||||||
{
|
{
|
||||||
@@ -72,7 +75,7 @@ public:
|
|||||||
|
|
||||||
// creates a new instance of a named motion
|
// creates a new instance of a named motion
|
||||||
// returns NULL motion is not registered
|
// returns NULL motion is not registered
|
||||||
LLMotion *createMotion( const LLUUID &id );
|
LLMotion* createMotion(LLUUID const& id, LLMotionController* controller);
|
||||||
|
|
||||||
// initialization of motion failed, don't try to create this motion again
|
// initialization of motion failed, don't try to create this motion again
|
||||||
void markBad( const LLUUID& id );
|
void markBad( const LLUUID& id );
|
||||||
@@ -115,7 +118,6 @@ public:
|
|||||||
|
|
||||||
// unregisters a motion with the controller
|
// unregisters a motion with the controller
|
||||||
// (actually just forwards call to motion registry)
|
// (actually just forwards call to motion registry)
|
||||||
// returns true if successfull
|
|
||||||
void removeMotion( const LLUUID& id );
|
void removeMotion( const LLUUID& id );
|
||||||
|
|
||||||
// start motion
|
// start motion
|
||||||
@@ -150,10 +152,20 @@ public:
|
|||||||
//Flush is a liar.
|
//Flush is a liar.
|
||||||
void deactivateAllMotions();
|
void deactivateAllMotions();
|
||||||
|
|
||||||
|
//<singu>
|
||||||
|
void activated(U32 bit) { mActiveMask |= bit; }
|
||||||
|
void deactivated(U32 bit) { mActiveMask &= ~bit; }
|
||||||
|
bool isactive(U32 bit) const { return (mActiveMask & bit) != 0; }
|
||||||
|
//</singu>
|
||||||
|
|
||||||
// pause and continue all motions
|
// pause and continue all motions
|
||||||
void pauseAllMotions();
|
void pauseAllMotions();
|
||||||
void unpauseAllMotions();
|
void unpauseAllMotions();
|
||||||
BOOL isPaused() const { return mPaused; }
|
BOOL isPaused() const { return mPaused; }
|
||||||
|
//<singu>
|
||||||
|
void requestPause(std::vector<LLAnimPauseRequest>& avatar_pause_handles);
|
||||||
|
void pauseAllSyncedCharacters(std::vector<LLAnimPauseRequest>& avatar_pause_handles);
|
||||||
|
//</singu>
|
||||||
|
|
||||||
void setTimeStep(F32 step);
|
void setTimeStep(F32 step);
|
||||||
|
|
||||||
@@ -180,7 +192,10 @@ protected:
|
|||||||
// internal operations act on motion instances directly
|
// internal operations act on motion instances directly
|
||||||
// as there can be duplicate motions per id during blending overlap
|
// as there can be duplicate motions per id during blending overlap
|
||||||
void deleteAllMotions();
|
void deleteAllMotions();
|
||||||
|
// singu: LLMotion needs access to activateMotionInstance.
|
||||||
|
public:
|
||||||
BOOL activateMotionInstance(LLMotion *motion, F32 time);
|
BOOL activateMotionInstance(LLMotion *motion, F32 time);
|
||||||
|
protected:
|
||||||
BOOL deactivateMotionInstance(LLMotion *motion);
|
BOOL deactivateMotionInstance(LLMotion *motion);
|
||||||
void deprecateMotionInstance(LLMotion* motion);
|
void deprecateMotionInstance(LLMotion* motion);
|
||||||
BOOL stopMotionInstance(LLMotion *motion, BOOL stop_imemdiate);
|
BOOL stopMotionInstance(LLMotion *motion, BOOL stop_imemdiate);
|
||||||
@@ -205,10 +220,13 @@ protected:
|
|||||||
// Life cycle of an animation:
|
// Life cycle of an animation:
|
||||||
//
|
//
|
||||||
// Animations are instantiated and immediately put in the mAllMotions map for their entire lifetime.
|
// Animations are instantiated and immediately put in the mAllMotions map for their entire lifetime.
|
||||||
|
// Singu note: that is not true, they are moved to mDeprecatedMotions (often) for the last part of their lifetime.
|
||||||
// If the animations depend on any asset data, the appropriate data is fetched from the data server,
|
// If the animations depend on any asset data, the appropriate data is fetched from the data server,
|
||||||
// and the animation is put on the mLoadingMotions list.
|
// and the animation is put on the mLoadingMotions list.
|
||||||
// Once an animations is loaded, it will be initialized and put on the mLoadedMotions list.
|
// Once an animations is loaded, it will be initialized and put on the mLoadedMotions list.
|
||||||
// Any animation that is currently playing also sits in the mActiveMotions list.
|
// Any animation that is currently playing also sits in the mActiveMotions list.
|
||||||
|
// Singu note: animations are only put in mDeprecatedMotions if and while they are playing,
|
||||||
|
// therefore animations in mDeprecatedMotions will be (must be) active and in mActiveMotions.
|
||||||
|
|
||||||
typedef std::map<LLUUID, LLMotion*> motion_map_t;
|
typedef std::map<LLUUID, LLMotion*> motion_map_t;
|
||||||
motion_map_t mAllMotions;
|
motion_map_t mAllMotions;
|
||||||
@@ -217,7 +235,13 @@ protected:
|
|||||||
motion_set_t mLoadedMotions;
|
motion_set_t mLoadedMotions;
|
||||||
motion_list_t mActiveMotions;
|
motion_list_t mActiveMotions;
|
||||||
motion_set_t mDeprecatedMotions;
|
motion_set_t mDeprecatedMotions;
|
||||||
|
|
||||||
|
//<singu>
|
||||||
|
U32 mActiveMask;
|
||||||
|
int mDisableSyncing; // Set while LLMotion::onActivate (and onDeactivate) are called for this controller.
|
||||||
|
bool mHidden; // The value of the last call to hidden().
|
||||||
|
bool mHaveVisibleSyncedMotions; // Set when we are synchronized with one or more motions of a controller that is not hidden.
|
||||||
|
//</singu>
|
||||||
LLFrameTimer mTimer;
|
LLFrameTimer mTimer;
|
||||||
F32 mPrevTimerElapsed;
|
F32 mPrevTimerElapsed;
|
||||||
F32 mAnimTime;
|
F32 mAnimTime;
|
||||||
@@ -230,6 +254,26 @@ protected:
|
|||||||
F32 mLastInterp;
|
F32 mLastInterp;
|
||||||
|
|
||||||
U8 mJointSignature[2][LL_CHARACTER_MAX_JOINTS];
|
U8 mJointSignature[2][LL_CHARACTER_MAX_JOINTS];
|
||||||
|
|
||||||
|
//<singu>
|
||||||
|
public:
|
||||||
|
// Internal administration for AISync.
|
||||||
|
void disable_syncing(void) { mDisableSyncing += 100; }
|
||||||
|
void enable_syncing(void) { mDisableSyncing -= 100; }
|
||||||
|
bool syncing_disabled(void) const { return mDisableSyncing >= 100; }
|
||||||
|
|
||||||
|
// Accessors needed for synchronization.
|
||||||
|
F32 getAnimTime(void) const { return mAnimTime; }
|
||||||
|
bool isHidden(void) const { return mHidden; }
|
||||||
|
|
||||||
|
// Called often. Should return false if we still need to keep updating our motions even if we're not visible.
|
||||||
|
bool hidden(bool not_visible) { if (mHidden != not_visible) toggle_hidden(); return !mHaveVisibleSyncedMotions; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
void toggle_hidden(void);
|
||||||
|
void refresh_hidden(void);
|
||||||
|
void setHaveVisibleSyncedMotions(void) { mHaveVisibleSyncedMotions = true; }
|
||||||
|
//</singu>
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ const F32 TORSO_ROT_FRACTION = 0.5f;
|
|||||||
// LLTargetingMotion()
|
// LLTargetingMotion()
|
||||||
// Class Constructor
|
// Class Constructor
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
LLTargetingMotion::LLTargetingMotion(const LLUUID &id) : LLMotion(id)
|
LLTargetingMotion::LLTargetingMotion(LLUUID const& id, LLMotionController* controller) : AIMaskedMotion(id, controller, ANIM_AGENT_TARGET)
|
||||||
{
|
{
|
||||||
mCharacter = NULL;
|
mCharacter = NULL;
|
||||||
mName = "targeting";
|
mName = "targeting";
|
||||||
@@ -99,14 +99,6 @@ LLMotion::LLMotionInitStatus LLTargetingMotion::onInitialize(LLCharacter *charac
|
|||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// LLTargetingMotion::onActivate()
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
BOOL LLTargetingMotion::onActivate()
|
|
||||||
{
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLTargetingMotion::onUpdate()
|
// LLTargetingMotion::onUpdate()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -166,12 +158,4 @@ BOOL LLTargetingMotion::onUpdate(F32 time, U8* joint_mask)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// LLTargetingMotion::onDeactivate()
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
void LLTargetingMotion::onDeactivate()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// End
|
// End
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user