mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-12 13:08:24 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f14473fd23 | ||
|
|
69ab4b6137 | ||
|
|
6bf867330f | ||
|
|
f085e69939 | ||
|
|
03160ed3fc | ||
|
|
1be1386161 | ||
|
|
cc1954b4ac | ||
|
|
973600ab30 | ||
|
|
f2a8b11ef7 | ||
|
|
558181e7dd | ||
|
|
6be03843e3 | ||
|
|
ba2cf008c6 | ||
|
|
6b638cae8b | ||
|
|
37283185c9 | ||
|
|
b13dc7415c | ||
|
|
7053a74d3f | ||
|
|
a47ab76500 | ||
|
|
ecbd921668 | ||
|
|
659668749c | ||
|
|
32d4e740ce | ||
|
|
1af6d8a59f | ||
|
|
b46c78f391 | ||
|
|
8c9e72aec1 | ||
|
|
a6dc4430ba | ||
|
|
bc7427732c | ||
|
|
eb8b31df3c | ||
|
|
dabbaee7b9 | ||
|
|
1df9766491 | ||
|
|
c4b2feb811 | ||
|
|
fd64b158ac | ||
|
|
70d906c176 | ||
|
|
b6c0688f41 | ||
|
|
451db1fac5 | ||
|
|
6d6309aaf0 | ||
|
|
c83d72d589 | ||
|
|
46806e7204 | ||
|
|
c5fe9f4252 | ||
|
|
eeff3b87e8 | ||
|
|
78a0711bff | ||
|
|
3d4d9b09cf | ||
|
|
449483206f | ||
|
|
57503051ea | ||
|
|
0066fe8065 | ||
|
|
766e4f5110 | ||
|
|
691fa0a31d | ||
|
|
a1d3dd69dd | ||
|
|
68beaa5ffc | ||
|
|
67c95d6dfb | ||
|
|
710e912aca | ||
|
|
66bfdc9408 | ||
|
|
0bd74c923f | ||
|
|
1cdd0e47cb | ||
|
|
dfae380f33 | ||
|
|
b4e16c243c | ||
|
|
2fa401ef26 | ||
|
|
5521d58994 | ||
|
|
44bf15ad28 | ||
|
|
30047af7a3 | ||
|
|
426dfd79db | ||
|
|
a58cbf6e42 | ||
|
|
7fabbcebba | ||
|
|
51adb3ff78 | ||
|
|
e67b6d4b3c | ||
|
|
a23e2ead3c | ||
|
|
d2bc5e0454 | ||
|
|
c6ead6e973 | ||
|
|
5a4bb34cf8 | ||
|
|
39f1441b7c | ||
|
|
1808c6de57 | ||
|
|
950aef8ded | ||
|
|
cf9ecbcf39 | ||
|
|
ca6c0110fe | ||
|
|
30c5a2870f | ||
|
|
ffe0987454 | ||
|
|
c7825e4708 | ||
|
|
c2cb872b08 | ||
|
|
fa809bd3f4 | ||
|
|
fdafae33c1 | ||
|
|
9fa871ccf9 | ||
|
|
cf2f8f6489 | ||
|
|
d8f1cf7b5a | ||
|
|
57273a545f | ||
|
|
66f056322a | ||
|
|
2f39e4cd33 | ||
|
|
857562bf9d | ||
|
|
3fbed8df27 | ||
|
|
c74104f8c9 | ||
|
|
ba58eaf9fe | ||
|
|
d0b0246ee4 | ||
|
|
b5aef51cc0 | ||
|
|
6c5d5ea497 | ||
|
|
721c6bc5bb | ||
|
|
dbbcba41a5 | ||
|
|
b8041cc93b | ||
|
|
d120c9f38b | ||
|
|
b49d2a87ab | ||
|
|
f589c50043 | ||
|
|
3ec06a3a4c | ||
|
|
92b4982292 | ||
|
|
f019b434ef | ||
|
|
0dc55a34d9 | ||
|
|
79fdccb31f | ||
|
|
f1447ddf3f | ||
|
|
9fe1b9f0b2 | ||
|
|
556cc4b426 | ||
|
|
e47056468c | ||
|
|
8e2753cc53 | ||
|
|
9438545bca | ||
|
|
63638ee571 | ||
|
|
a379b71d42 | ||
|
|
4c1dc265bc | ||
|
|
5851d103d0 | ||
|
|
0b3ef16982 | ||
|
|
fabdc580ef | ||
|
|
3e8234ab38 | ||
|
|
22f8dfab2d | ||
|
|
a626a30098 | ||
|
|
087debe45d | ||
|
|
09ddd9ddcf | ||
|
|
70ffe1c12e | ||
|
|
1acfb9fed6 | ||
|
|
1b754cf62d | ||
|
|
df17764673 | ||
|
|
11576f1d99 | ||
|
|
08bed1b0a2 | ||
|
|
94e2570c2f | ||
|
|
716b9ac09a | ||
|
|
84418df9eb | ||
|
|
63a640605c | ||
|
|
c4478da202 | ||
|
|
95457077c6 | ||
|
|
5f52a06080 | ||
|
|
f1b900f7bc | ||
|
|
a1f3aea089 | ||
|
|
82473e4e32 | ||
|
|
c1386c6f6f | ||
|
|
882fe09dad | ||
|
|
74f202bbda | ||
|
|
588a64dcf2 | ||
|
|
b91dd1413f | ||
|
|
9f1ca98ca3 | ||
|
|
8b4f900652 | ||
|
|
9f2c15c17c | ||
|
|
11641645b2 | ||
|
|
43a3298990 | ||
|
|
1d013b49c6 | ||
|
|
a40e77b408 | ||
|
|
0d3593f794 | ||
|
|
ecadf864c5 | ||
|
|
e2a6a7ad17 | ||
|
|
f89f6119e7 | ||
|
|
3fbfeadaf3 | ||
|
|
5a92ec15cf | ||
|
|
e18a5716e3 | ||
|
|
0a73bccd52 | ||
|
|
9e1c426a3a | ||
|
|
329447f51c | ||
|
|
4f678dfdfc | ||
|
|
259cd900da | ||
|
|
056af331aa | ||
|
|
f3453500d4 | ||
|
|
25210d5f2a | ||
|
|
c72d47b9d0 | ||
|
|
37f74de732 | ||
|
|
62e96b63e4 | ||
|
|
341d1f9528 | ||
|
|
35e28d2f72 | ||
|
|
eebd7bbeea | ||
|
|
bf7d19f401 | ||
|
|
39adab8cc1 | ||
|
|
ad7cb85fcc | ||
|
|
a04b54006d | ||
|
|
d00921b723 | ||
|
|
6f39d6da97 | ||
|
|
a98c2c38c0 | ||
|
|
80b5bcd16c | ||
|
|
b70b40969b | ||
|
|
a883dfd825 | ||
|
|
9ccdcad906 | ||
|
|
ef4b5db5e2 | ||
|
|
0b1e6b437d | ||
|
|
c87445f0f9 | ||
|
|
907f0db4a3 | ||
|
|
bc64b7cd4e | ||
|
|
d6b7bba069 | ||
|
|
a6789c5717 | ||
|
|
1421d1da30 | ||
|
|
7b1b137866 | ||
|
|
ccba9635b6 | ||
|
|
5f0fcce8d0 | ||
|
|
171694804b | ||
|
|
385539ccc5 | ||
|
|
78e5b63b41 | ||
|
|
c09a2f9ab7 | ||
|
|
934f7c58ba | ||
|
|
6b57791b0a | ||
|
|
801956aaaa | ||
|
|
2681352d53 | ||
|
|
12e5b93a8b | ||
|
|
8ec72610d8 | ||
|
|
c045b80a5a | ||
|
|
b13c8db6b5 | ||
|
|
554519457b | ||
|
|
88a44a2c2e | ||
|
|
defab8842a | ||
|
|
79d35d158a | ||
|
|
98a3d80e71 | ||
|
|
fce0ca2a3a | ||
|
|
ec79d8c46a | ||
|
|
371c3e56de | ||
|
|
10df6d3b54 | ||
|
|
f62490b14f | ||
|
|
d48ec2a9e6 | ||
|
|
d78e1da956 | ||
|
|
801cc57e82 | ||
|
|
b00776b09e | ||
|
|
e7d3f36a22 | ||
|
|
8cc2886773 | ||
|
|
5a46537968 | ||
|
|
ec04fdf2f1 | ||
|
|
a5d701d2dd | ||
|
|
dd5bc1a951 | ||
|
|
50fc71a0a6 | ||
|
|
22a07eaf6c | ||
|
|
634de19dc9 | ||
|
|
80f9e6db90 | ||
|
|
2797aae6cf | ||
|
|
93a6426fe4 | ||
|
|
e8cc77e567 | ||
|
|
fd4e3c0448 | ||
|
|
75182bfc6f | ||
|
|
bae2110bb4 | ||
|
|
d1291f406b | ||
|
|
d87b85bdd1 | ||
|
|
eede1a4978 | ||
|
|
db490a69a3 | ||
|
|
0b1716650b | ||
|
|
1bd07c34c7 | ||
|
|
b2b4cc667c | ||
|
|
f321763b1c | ||
|
|
c0c3bb3dbd | ||
|
|
4963ff31f0 | ||
|
|
043574c5be | ||
|
|
a8b91ee910 | ||
|
|
08521a02ba | ||
|
|
954b95cc81 | ||
|
|
70bbe92154 | ||
|
|
d7de9facc3 | ||
|
|
77d83b4782 | ||
|
|
8bf552dacd | ||
|
|
f8f25602e8 | ||
|
|
a35e452ec3 | ||
|
|
68ecade37d | ||
|
|
4d4b00f877 | ||
|
|
3e00c632bd | ||
|
|
184b519f84 | ||
|
|
136a435c43 | ||
|
|
abd6dcd57f | ||
|
|
a09a1030c0 | ||
|
|
73cc655de7 | ||
|
|
fd3025ff40 | ||
|
|
e49c71b142 | ||
|
|
c92bf4d5e8 | ||
|
|
c64c072b43 | ||
|
|
cae04ff5f2 | ||
|
|
1d6b24b545 | ||
|
|
f25b60a7ab | ||
|
|
bcbcabffe0 | ||
|
|
450ab7de40 | ||
|
|
80f06b9574 | ||
|
|
aeddb18e31 | ||
|
|
759b963c2f | ||
|
|
d08b785f9d | ||
|
|
24c7bcb196 | ||
|
|
1e02bd3455 | ||
|
|
d1b50acfee | ||
|
|
45477658e1 | ||
|
|
d029cafdd9 | ||
|
|
f85ab1f535 | ||
|
|
66b1ad99d4 | ||
|
|
f847548178 | ||
|
|
a088113f4c | ||
|
|
d61e5504a7 | ||
|
|
a19128422d | ||
|
|
cd4c17624a | ||
|
|
004a299b74 | ||
|
|
be2fb7b10d | ||
|
|
999f7971ed | ||
|
|
642e65f53f | ||
|
|
3ad2d593fb | ||
|
|
e5059a237a | ||
|
|
c1493eb579 | ||
|
|
8c796f694f | ||
|
|
7197255211 | ||
|
|
c00e3b7b67 | ||
|
|
5cbe9dea09 | ||
|
|
a0924a414f | ||
|
|
0bb1de9561 | ||
|
|
f653cf4e7c | ||
|
|
be3240a1a1 | ||
|
|
a03b3238cb | ||
|
|
b17e76d8b7 | ||
|
|
1f13d616cc | ||
|
|
8dee95651f | ||
|
|
0c8f9663f2 | ||
|
|
47d0cb053e | ||
|
|
e5f788b28c | ||
|
|
e02cfe8cb0 | ||
|
|
ce61db1473 | ||
|
|
26e5c28208 | ||
|
|
c962ad6009 | ||
|
|
d8d11c5dcc | ||
|
|
f83a26c8b0 | ||
|
|
94615dfd35 | ||
|
|
9f6dc975da | ||
|
|
8b4c92291f | ||
|
|
bd8d3d66d7 | ||
|
|
a8a2d7730f | ||
|
|
ddf779008a | ||
|
|
4f51341fc0 | ||
|
|
46182e090b | ||
|
|
778ee176cc | ||
|
|
5a9dbf7e4f | ||
|
|
2da8a18086 | ||
|
|
7a2c09e9ce | ||
|
|
b34abd4c17 | ||
|
|
188d213c8d | ||
|
|
e4055e0d1b | ||
|
|
b4f0ebca4d | ||
|
|
b009b87530 | ||
|
|
b7b7c67ca3 | ||
|
|
1ac44d8eca | ||
|
|
0742ebec21 | ||
|
|
eec0613c10 | ||
|
|
ff8a7f22fc | ||
|
|
2139abe8b7 | ||
|
|
d339eb327c | ||
|
|
e4210f5b00 | ||
|
|
58787e6d89 | ||
|
|
4ed3e750d4 | ||
|
|
c0431b34c9 | ||
|
|
3ae54e0eed | ||
|
|
bbef084955 | ||
|
|
5f75ce3f12 | ||
|
|
c1190551b2 | ||
|
|
6fea8f14c5 | ||
|
|
bd424da015 | ||
|
|
4333e3d5e7 | ||
|
|
57b7398bdd | ||
|
|
2ac91822c3 | ||
|
|
fa0d82b188 | ||
|
|
5bcacf9b49 | ||
|
|
40a287a7c1 | ||
|
|
e44475f581 | ||
|
|
8535e766c8 | ||
|
|
58543a43ff | ||
|
|
efce4d0abf | ||
|
|
06df028722 | ||
|
|
8a12bb9f04 | ||
|
|
d6c80d7de7 | ||
|
|
d8f5065d64 | ||
|
|
64fdadf60f | ||
|
|
452c02653e | ||
|
|
2eb7499b64 | ||
|
|
79bcc5efc9 | ||
|
|
a87f3ae3cd | ||
|
|
16996aad6d | ||
|
|
65fd5c406b | ||
|
|
25e08cf6c4 | ||
|
|
a830051076 | ||
|
|
30d032ba5a | ||
|
|
21a58f13ec | ||
|
|
1ffb1f4feb | ||
|
|
51bac3ef73 | ||
|
|
9358b0c3f3 | ||
|
|
c5485152aa | ||
|
|
cb2e898d8c | ||
|
|
59fb7700b8 | ||
|
|
fd99239c99 | ||
|
|
5e0eec8857 | ||
|
|
e42ed3e3df | ||
|
|
0e4f1a400f | ||
|
|
2a54544eb3 | ||
|
|
4144c8de35 | ||
|
|
b086b72ff9 | ||
|
|
6ef00432cb | ||
|
|
54b5d289b0 | ||
|
|
f185c1ef1f | ||
|
|
c6aba1af2f | ||
|
|
9dbd605a66 | ||
|
|
231e499714 | ||
|
|
2fb5e821cf | ||
|
|
24ce77155a | ||
|
|
9d74212a41 | ||
|
|
b0398c1482 | ||
|
|
fa9fe88547 | ||
|
|
236f5b3514 | ||
|
|
6d20fa96e0 | ||
|
|
89dddaf9f0 | ||
|
|
f341f70705 | ||
|
|
4d24153870 | ||
|
|
28cc34bf14 | ||
|
|
ed07ba0852 | ||
|
|
1bc945e3dc | ||
|
|
59b3344e72 | ||
|
|
4e7b376e18 | ||
|
|
cb529822c6 | ||
|
|
374f8e8a19 | ||
|
|
2f72506959 | ||
|
|
9d11133edf | ||
|
|
1411b9ee6e | ||
|
|
d7ed925488 | ||
|
|
49bf9b62ae | ||
|
|
d181f70303 | ||
|
|
a0fcbf85a1 | ||
|
|
838c1eb93a | ||
|
|
a137332218 | ||
|
|
c53bb90b75 | ||
|
|
82d37d2036 | ||
|
|
735801a317 | ||
|
|
5343648dc9 | ||
|
|
312a2b5c80 | ||
|
|
4e04e95713 | ||
|
|
c9af58494b | ||
|
|
3f7a30a4b3 | ||
|
|
941a5d4f94 | ||
|
|
86ee08b7a7 | ||
|
|
668813cca9 | ||
|
|
9a90477c6d | ||
|
|
b3faed3906 | ||
|
|
4ad8d3c917 | ||
|
|
80512800e1 | ||
|
|
21341c5b3a | ||
|
|
2e490037ab | ||
|
|
f9960b5f8d | ||
|
|
9096038e20 | ||
|
|
82c6dd1f3d | ||
|
|
f51aa6e4ec | ||
|
|
6e45af3858 | ||
|
|
1178673380 | ||
|
|
7a2d799a6c | ||
|
|
2171439647 | ||
|
|
65b740a5ff | ||
|
|
54c526f1e2 | ||
|
|
ffac0c119e | ||
|
|
fe4622fd3b | ||
|
|
dd53162519 | ||
|
|
acaf65a8f7 | ||
|
|
5635894178 | ||
|
|
be22290495 | ||
|
|
2749a6ada2 | ||
|
|
8330a0ee46 | ||
|
|
3e69214d78 | ||
|
|
2f1c3fb437 | ||
|
|
204f0183e1 | ||
|
|
529349019d | ||
|
|
c0027ae9a1 | ||
|
|
7e08752da2 | ||
|
|
aa10eecbbf | ||
|
|
99466cba86 | ||
|
|
4436d5998b | ||
|
|
5dcebe4718 | ||
|
|
3a6ada1652 | ||
|
|
64c22de3ae | ||
|
|
a81c01729b | ||
|
|
85afd633e4 | ||
|
|
ee8dc151a3 | ||
|
|
5072de4c0f | ||
|
|
e6f5270c3d | ||
|
|
649205178f | ||
|
|
efacf637db | ||
|
|
acbf11931b | ||
|
|
717709ef9e | ||
|
|
7b7a31d944 | ||
|
|
f24a73351c | ||
|
|
7cb78d499c | ||
|
|
0a1f1237aa | ||
|
|
4df6151e14 | ||
|
|
dd9034248b | ||
|
|
0aeb683444 | ||
|
|
944eff06b8 | ||
|
|
2562391167 | ||
|
|
eb409328ec | ||
|
|
808b973752 | ||
|
|
0f91cf67fc | ||
|
|
54ce598a00 | ||
|
|
1de95c6413 | ||
|
|
ea0202a39d | ||
|
|
d749790521 | ||
|
|
140ad6ab98 | ||
|
|
e3213cc8a7 | ||
|
|
1bf0175da4 | ||
|
|
61a4e94649 | ||
|
|
126a5bf121 | ||
|
|
8eca08c6ac | ||
|
|
98a79f2279 | ||
|
|
c035f9597a | ||
|
|
7e89335392 | ||
|
|
8e76c4a131 | ||
|
|
c783dbff28 | ||
|
|
b8cf967914 | ||
|
|
4710bfcf43 | ||
|
|
a98033f375 | ||
|
|
2f9eb86a59 | ||
|
|
c21abd28f8 | ||
|
|
b8cea125e4 | ||
|
|
8e47e7e8b3 | ||
|
|
eddb655eb9 | ||
|
|
15142be8ee | ||
|
|
6b4d4447b2 | ||
|
|
69f9bc840d | ||
|
|
7bf34c48a9 | ||
|
|
17837ec81d | ||
|
|
63762e8850 | ||
|
|
5fc5cb4962 | ||
|
|
2becbaf4e2 | ||
|
|
67610b8263 | ||
|
|
375b588847 | ||
|
|
d28ec842f3 | ||
|
|
575095c8e6 | ||
|
|
076a83a62b | ||
|
|
f584d1cea5 | ||
|
|
1fef134f04 | ||
|
|
b503407abb | ||
|
|
36137d22e5 | ||
|
|
d01b81749d | ||
|
|
a0256fa321 | ||
|
|
bf3188eac4 | ||
|
|
06f3feec61 | ||
|
|
160c8167d6 | ||
|
|
e2c7671e9f | ||
|
|
c70916ca31 | ||
|
|
b9148c1d70 | ||
|
|
8bdcb2f123 | ||
|
|
56fb642119 | ||
|
|
0655b49408 | ||
|
|
1122a7c585 | ||
|
|
c898ef1d6d | ||
|
|
ba5f7ff5e4 | ||
|
|
9f5ec1cc42 | ||
|
|
b4e3a22fe6 | ||
|
|
949a5c76fe | ||
|
|
6741423410 | ||
|
|
3410d5c4e4 | ||
|
|
2fc45fb5ac | ||
|
|
ec96fe89e9 | ||
|
|
eb08a3dbef | ||
|
|
3afd2497d2 | ||
|
|
b0746a4910 | ||
|
|
dd4146e302 | ||
|
|
2ee3f12c9d | ||
|
|
4a611b5096 | ||
|
|
b13ca2df97 | ||
|
|
4afa2871ab | ||
|
|
80d9d1f143 | ||
|
|
1345e97f8c | ||
|
|
c6dd51da35 | ||
|
|
9e26332c48 | ||
|
|
b8c3c6e405 | ||
|
|
0e34d362d3 | ||
|
|
52c1d398a2 | ||
|
|
ed40b13ea0 | ||
|
|
f98473b9da | ||
|
|
a4ac0df389 | ||
|
|
13d6827689 | ||
|
|
f70da4c2e2 | ||
|
|
2df6b201da | ||
|
|
fe56e4ffea | ||
|
|
e6bcb64ced | ||
|
|
70457e06d8 | ||
|
|
055044be96 | ||
|
|
c78ce113b4 | ||
|
|
e5ed82858f | ||
|
|
29121389e1 | ||
|
|
4764ba8770 | ||
|
|
fbe307ece7 | ||
|
|
def3343272 | ||
|
|
fb5d31816d | ||
|
|
c485b5b292 | ||
|
|
88dbbb284d | ||
|
|
88c04be7a4 | ||
|
|
7dfbfef995 | ||
|
|
71499abf1f | ||
|
|
0185f71bab | ||
|
|
6dd3a84bc9 | ||
|
|
581333f222 | ||
|
|
b75f242a7f | ||
|
|
484fff5e28 | ||
|
|
bd7970b9b7 | ||
|
|
8ae708576f | ||
|
|
6433cde3c0 | ||
|
|
dd79c9a236 | ||
|
|
a7d09733a6 | ||
|
|
34870290cd | ||
|
|
b22d7902f1 | ||
|
|
17a15273ba | ||
|
|
d4756f83e5 | ||
|
|
f6c8aba119 | ||
|
|
45a648b042 | ||
|
|
d87e1c57d6 | ||
|
|
72fe4a1e3c | ||
|
|
72bd83b8d1 | ||
|
|
e378b7053d | ||
|
|
bd012a567e | ||
|
|
5fc7a6776b | ||
|
|
ce9439e722 | ||
|
|
541c6e6c41 | ||
|
|
43dcc3d501 | ||
|
|
acf7c681b4 | ||
|
|
19db4f63a7 | ||
|
|
e7061a8d2a | ||
|
|
fa4a8b8bbd | ||
|
|
2adace47d4 | ||
|
|
66c8778878 | ||
|
|
3cb5b651a2 | ||
|
|
c4f2e30819 | ||
|
|
aa55ab4866 | ||
|
|
9b1e66d302 | ||
|
|
2ce9d71553 | ||
|
|
42ebe7a7ad | ||
|
|
cc9e951b44 | ||
|
|
2906bec7a8 | ||
|
|
1223309052 | ||
|
|
f060863d40 | ||
|
|
57089dc108 | ||
|
|
1e7701bf29 | ||
|
|
9a6e137a56 | ||
|
|
ef8094836f | ||
|
|
e0c0815f42 | ||
|
|
1b302d6e40 | ||
|
|
865ec1eb71 | ||
|
|
c43a733dba | ||
|
|
7f8d4479f4 | ||
|
|
ed2dedb233 | ||
|
|
a44318dae5 | ||
|
|
4af9a92f76 | ||
|
|
9dff2434ef | ||
|
|
5a9f6ad9b7 | ||
|
|
06f5f635ca | ||
|
|
476738cc5c | ||
|
|
739495027b | ||
|
|
7ed57ee77d | ||
|
|
da1ab24c57 | ||
|
|
83b0d3e412 | ||
|
|
3593256a76 | ||
|
|
e3f854092f | ||
|
|
d75f155eb6 | ||
|
|
f928e57064 | ||
|
|
fa5d2b9920 | ||
|
|
bac9973354 | ||
|
|
281dd9b4ac | ||
|
|
67c67f566f | ||
|
|
e8c1c153d6 | ||
|
|
779a7676d6 | ||
|
|
18f06e177e | ||
|
|
99e7cb7d75 | ||
|
|
63bb97287f | ||
|
|
4393e17ea7 | ||
|
|
097515fa63 | ||
|
|
95214e8180 | ||
|
|
c63f059e10 | ||
|
|
138a12d5e1 | ||
|
|
8e3d0612d2 | ||
|
|
efd0c991a6 | ||
|
|
a29e416be8 | ||
|
|
6766a62300 | ||
|
|
bd36b0a968 | ||
|
|
48c4e1227a | ||
|
|
fec24bd47b | ||
|
|
de6e138d15 | ||
|
|
4a7c81b353 | ||
|
|
ef9c16c7c9 | ||
|
|
d8680542ba | ||
|
|
0411aba219 | ||
|
|
6c164984a0 | ||
|
|
ad0953ac87 | ||
|
|
11a0610d13 | ||
|
|
e695d4e8ad | ||
|
|
da0f3620bc | ||
|
|
4f4d288253 | ||
|
|
127b803fba | ||
|
|
b4782d9a51 | ||
|
|
5245590bae | ||
|
|
5e7f175545 | ||
|
|
0eec872442 | ||
|
|
9605c01c49 | ||
|
|
0815055906 | ||
|
|
fb78a3a017 | ||
|
|
b73575bf79 | ||
|
|
988647f92a | ||
|
|
4595ba8e1f | ||
|
|
77a56f5114 | ||
|
|
9bb5430956 | ||
|
|
191c4f5299 | ||
|
|
308ff366de | ||
|
|
601a260d47 | ||
|
|
78efeb6ae2 | ||
|
|
7404abf938 | ||
|
|
12027bf1a8 | ||
|
|
844d1475e6 | ||
|
|
43956f07fa | ||
|
|
f97d084290 | ||
|
|
a2fe3dcaaf | ||
|
|
a43289684d | ||
|
|
2670d22d61 | ||
|
|
7dca09d6f8 | ||
|
|
e09358c712 | ||
|
|
ce8083fd2e | ||
|
|
924296c680 | ||
|
|
4d20460e6b | ||
|
|
750d404e23 | ||
|
|
958fd82f24 | ||
|
|
e0082c1a9f | ||
|
|
0b4e690f4d | ||
|
|
03db246f88 | ||
|
|
637e8d76ab | ||
|
|
24ac625179 | ||
|
|
96718b281e | ||
|
|
d349ea61cf | ||
|
|
7c9736bae8 | ||
|
|
9e25597943 | ||
|
|
ed86a2ed10 | ||
|
|
0e2318998e | ||
|
|
346a05b5fb | ||
|
|
881b18a965 | ||
|
|
75c45c4f2b | ||
|
|
88ca3e993c | ||
|
|
0ba93887bf | ||
|
|
593334747b | ||
|
|
15a5083b8c | ||
|
|
de80671658 | ||
|
|
3a17f41dc8 | ||
|
|
9517eff012 | ||
|
|
46b1b113e0 | ||
|
|
d9c5013d42 | ||
|
|
558cb64438 | ||
|
|
36375cecf8 | ||
|
|
33f2fe8029 | ||
|
|
75a5af26c6 | ||
|
|
582573f324 | ||
|
|
44b9943738 | ||
|
|
2c28505e04 | ||
|
|
2357c9ef82 | ||
|
|
858e15b837 | ||
|
|
6e51153387 | ||
|
|
45cf53b487 | ||
|
|
2d83ed388f | ||
|
|
01e25bd5c7 | ||
|
|
dfed19cb4d | ||
|
|
10b636f80d | ||
|
|
c34b4dd787 | ||
|
|
a2d4a9efc5 | ||
|
|
e9b7c32393 | ||
|
|
5a16b61ec5 | ||
|
|
a568782309 | ||
|
|
0310b67927 | ||
|
|
8f25897d9e | ||
|
|
2012abd6d1 | ||
|
|
edd4f46bbf | ||
|
|
b0d6919339 | ||
|
|
0dee5b889d | ||
|
|
08c7f63074 | ||
|
|
51f7f7a22c | ||
|
|
b1cf9adfef | ||
|
|
acabead15a | ||
|
|
a5ecdf39fb | ||
|
|
a05555cd99 | ||
|
|
4cba63cdd0 | ||
|
|
2009d359c9 | ||
|
|
a1d094e64e | ||
|
|
a2542590ef | ||
|
|
c335d870a5 | ||
|
|
532b2ac1ba | ||
|
|
34184654d9 | ||
|
|
8f32801292 | ||
|
|
7058207197 | ||
|
|
b303283ac3 | ||
|
|
7df38ac5db | ||
|
|
46bae549ac | ||
|
|
17827940fd | ||
|
|
254fa75a0f | ||
|
|
4d419b2b56 | ||
|
|
60242e161a | ||
|
|
c147604103 | ||
|
|
7bdef1fde4 | ||
|
|
dd83b4a043 | ||
|
|
b5e97238ac | ||
|
|
d86f466fe9 | ||
|
|
a5d7bedb8a | ||
|
|
6bae9244e8 | ||
|
|
5f6a342817 | ||
|
|
b515cd10f1 | ||
|
|
6f0df4cf60 | ||
|
|
03145a0424 | ||
|
|
64b672125c | ||
|
|
11a96df465 | ||
|
|
e84adb504f | ||
|
|
63504cd9c8 | ||
|
|
91abbdd4f1 | ||
|
|
6d4ac23f26 | ||
|
|
c8bf28842f | ||
|
|
2322e77795 | ||
|
|
c678d97270 | ||
|
|
982c862deb | ||
|
|
8a50b7373b | ||
|
|
97de027eb7 | ||
|
|
ac7f1cc5e2 | ||
|
|
969403fadb | ||
|
|
79c7627651 | ||
|
|
6930262ec2 | ||
|
|
afe173c883 | ||
|
|
936b5e4b7c | ||
|
|
ccd4bdbd60 | ||
|
|
f7c56ddda3 | ||
|
|
301a094ef9 | ||
|
|
253c8cd997 | ||
|
|
ada900e1e1 | ||
|
|
9d20af4249 | ||
|
|
3e58159480 | ||
|
|
552845a94d | ||
|
|
6d8789f4c1 | ||
|
|
fe1151efc3 | ||
|
|
9fdcd926ad | ||
|
|
8ab4f5a0b2 | ||
|
|
e6ab06a701 | ||
|
|
59da394197 | ||
|
|
f75fbafeb2 | ||
|
|
957c85f9ea | ||
|
|
f0c2d786ae | ||
|
|
f3a55f1036 | ||
|
|
aed6fd8082 | ||
|
|
87106b03c1 | ||
|
|
5c024f1cd8 | ||
|
|
927ed42498 | ||
|
|
67ab87669f | ||
|
|
35ac275f62 | ||
|
|
47cb15cb03 | ||
|
|
05e4ec733e | ||
|
|
9ff3221c9d | ||
|
|
fdd85654d6 | ||
|
|
7bbd20b31d | ||
|
|
dfe753042f | ||
|
|
18eaa7e709 | ||
|
|
324227d239 | ||
|
|
fa9b641ef0 | ||
|
|
d6ffd69ed0 | ||
|
|
98f6000ff6 | ||
|
|
4ef0809931 | ||
|
|
d1b6a865c4 | ||
|
|
684e83ef30 | ||
|
|
6d4b44bf94 | ||
|
|
09f108b4a7 | ||
|
|
df31ba6255 | ||
|
|
7b9c146ae9 | ||
|
|
2c53553952 | ||
|
|
ff3a9e87e0 | ||
|
|
0da40fb3aa | ||
|
|
4e92a4ed77 | ||
|
|
7a152700fa | ||
|
|
f50eabb13c | ||
|
|
3ad821c102 | ||
|
|
3764c39dfc | ||
|
|
ed53be7c81 | ||
|
|
6bac458885 | ||
|
|
b792c5deae | ||
|
|
3e24672a43 | ||
|
|
9e7ac432c3 | ||
|
|
9812dfb4d4 | ||
|
|
c0e81ca820 | ||
|
|
cc095e56fc | ||
|
|
193b0b147f | ||
|
|
ba079b14dc | ||
|
|
ae1c26cbc4 | ||
|
|
d257ec51a0 | ||
|
|
124ef06ef7 | ||
|
|
0e1406f3f1 | ||
|
|
eb34553fae | ||
|
|
b9f110679a | ||
|
|
1bf7cbccbe | ||
|
|
79f28f2985 | ||
|
|
514412afe0 | ||
|
|
a54af2f2c1 | ||
|
|
5ea70ffb2e | ||
|
|
ace37d2c7a | ||
|
|
65f33f4403 | ||
|
|
43ff75fd72 | ||
|
|
87d5fe2092 | ||
|
|
be87a8cdc7 | ||
|
|
0c6ba894fd | ||
|
|
c5e56b1b25 | ||
|
|
4a715e79e3 | ||
|
|
409a6136b8 | ||
|
|
f412095047 | ||
|
|
a53645cc55 | ||
|
|
549ed6fc6b | ||
|
|
848d8a95ab | ||
|
|
301ee64e80 | ||
|
|
8a4590462f | ||
|
|
e2dc60a0c0 | ||
|
|
1df9807954 | ||
|
|
efe90a9f34 | ||
|
|
c51e4397b0 | ||
|
|
3dc26db377 | ||
|
|
58fcf421b5 | ||
|
|
e179108080 | ||
|
|
a146dfee79 | ||
|
|
33dda78ea8 | ||
|
|
fc5d240297 | ||
|
|
f0eaef9d51 | ||
|
|
3c57c991de | ||
|
|
3087ceb482 | ||
|
|
840034d4a0 | ||
|
|
5f9f43929a | ||
|
|
53c9acacd6 | ||
|
|
c68c8a8cfe | ||
|
|
87f05b3a7b | ||
|
|
8d0e3d7777 | ||
|
|
4845c4b4db | ||
|
|
3b3b008614 | ||
|
|
d66aff8fbd | ||
|
|
129da8a802 | ||
|
|
e1e83b17b7 | ||
|
|
f4e5f896a2 | ||
|
|
c871faa1f5 | ||
|
|
690b729474 | ||
|
|
acf3b22fd3 | ||
|
|
6ace8ce66a | ||
|
|
359af5d5ab | ||
|
|
20ed6eb90a | ||
|
|
f4b168f9b6 | ||
|
|
7b5b49a5e6 | ||
|
|
e36564b2b0 | ||
|
|
15a8f0c485 | ||
|
|
83684df3e9 | ||
|
|
632039f985 | ||
|
|
b6d34e9581 | ||
|
|
ffcb9d4a16 | ||
|
|
03358b2ecd | ||
|
|
047b10a3de | ||
|
|
3917c658f3 | ||
|
|
b495d85845 | ||
|
|
ee484b693c | ||
|
|
765e636214 | ||
|
|
2a13af52fc | ||
|
|
e5b38315fe | ||
|
|
023599366c | ||
|
|
8a215ce30e | ||
|
|
b951c84e01 | ||
|
|
0021970c16 | ||
|
|
831ea1a507 | ||
|
|
c8bcbad4a7 | ||
|
|
5a3b78bad3 | ||
|
|
8f15467215 | ||
|
|
d06c963a19 | ||
|
|
e411e7c284 | ||
|
|
365c7f9c8b | ||
|
|
8efa2b146e | ||
|
|
f6ca860bc9 | ||
|
|
95f172e3c7 | ||
|
|
34852e159a | ||
|
|
08bbc8199f | ||
|
|
0e3bc69f8c | ||
|
|
087002d9c5 | ||
|
|
c38f86e14a | ||
|
|
e0483f73bc | ||
|
|
467070f6a6 | ||
|
|
edadba1ec7 | ||
|
|
13e4148996 | ||
|
|
77dde2a85c | ||
|
|
f84da4b466 | ||
|
|
e5938bca1f | ||
|
|
2dfe441381 | ||
|
|
bf7616cf0e | ||
|
|
d4a3726347 | ||
|
|
25c8baeefe | ||
|
|
12d0073d50 | ||
|
|
cb3943da0e | ||
|
|
df60fa7a19 | ||
|
|
eb208b170f | ||
|
|
32f4bc4b93 | ||
|
|
7c6b93f58f | ||
|
|
c9646c1fd2 | ||
|
|
3ec5816259 | ||
|
|
627089e2f6 | ||
|
|
299b72e208 | ||
|
|
a4963d2a19 | ||
|
|
fc33b7abcc | ||
|
|
6667560263 | ||
|
|
d76c09fd08 | ||
|
|
7ea0528c6b | ||
|
|
8e6b7a2751 | ||
|
|
217e71d568 | ||
|
|
268a173f44 | ||
|
|
59faeb510b | ||
|
|
ccc8d1aec2 | ||
|
|
1febb963ae | ||
|
|
e192d4eaa6 | ||
|
|
7e3cce9397 | ||
|
|
aea00f1e00 | ||
|
|
1c93cc4b18 | ||
|
|
953045f0d2 | ||
|
|
0f2a6f3dd2 | ||
|
|
caafee006c | ||
|
|
d61edc51ad | ||
|
|
a88284897b | ||
|
|
7afc83518d | ||
|
|
b260254fd4 | ||
|
|
8defa3b924 | ||
|
|
6078864e26 | ||
|
|
21f7f6059a | ||
|
|
d674d2102e | ||
|
|
25f31883d5 | ||
|
|
a65675d24f | ||
|
|
9ef51d8215 | ||
|
|
c97fd9afcf | ||
|
|
45dc1b7977 | ||
|
|
40d55b7ae3 | ||
|
|
f12ea0e1e3 | ||
|
|
aa2c29ac8b | ||
|
|
62d9e087c4 | ||
|
|
4197cfe174 | ||
|
|
5526a2ba93 | ||
|
|
86fdca5e68 | ||
|
|
6ebd4e139e | ||
|
|
d77da6b53d | ||
|
|
284e6b2994 | ||
|
|
f9bc2d3783 | ||
|
|
e9e1db2945 | ||
|
|
bcce88e516 | ||
|
|
6951111459 | ||
|
|
0c66441d08 | ||
|
|
5b1ecbff87 | ||
|
|
dd1da5154f | ||
|
|
271edb4ca1 | ||
|
|
607ae71259 | ||
|
|
76788d3890 | ||
|
|
dd517f4660 | ||
|
|
82c62b1693 | ||
|
|
06f98fcd16 | ||
|
|
120cf21505 | ||
|
|
74431917a2 | ||
|
|
40411e5a6f | ||
|
|
04223b464a | ||
|
|
0215badb4c | ||
|
|
75e02c4646 | ||
|
|
d8ba05170f | ||
|
|
9faae7eb3f | ||
|
|
d1664481c2 | ||
|
|
69a3bf6a31 | ||
|
|
9daa63437a | ||
|
|
fa347475e8 | ||
|
|
3fb630c571 | ||
|
|
154b98394b | ||
|
|
637b26772c | ||
|
|
1cc350bfdb | ||
|
|
96a9730a08 | ||
|
|
d1ff5dd973 | ||
|
|
4df1ba690d | ||
|
|
d220ce5870 | ||
|
|
8eed4c38cf | ||
|
|
87c5b03bed | ||
|
|
d4ecc6398d | ||
|
|
0b3e90dbf4 | ||
|
|
0a074ec4a5 | ||
|
|
a4d19e174a | ||
|
|
27a6d68af9 | ||
|
|
d5d04babdd | ||
|
|
9ca27adb59 | ||
|
|
1f29de24de | ||
|
|
ca6eee21d9 | ||
|
|
0a33e6e8e4 | ||
|
|
b15cca82c7 | ||
|
|
841adf04a5 | ||
|
|
5bfc513af4 | ||
|
|
00a59629aa | ||
|
|
7790fc3647 | ||
|
|
32c91baca6 | ||
|
|
faafa2def0 | ||
|
|
fbb508ab5e | ||
|
|
7104d329fd | ||
|
|
d722ac6c04 | ||
|
|
d5821c7f61 | ||
|
|
f4071ba6ec | ||
|
|
0a8f7b9ff2 | ||
|
|
e21df42ec1 | ||
|
|
8aa7ae168e | ||
|
|
55dd4ac754 | ||
|
|
662755c899 | ||
|
|
4159dc43ed | ||
|
|
7baa75bee0 | ||
|
|
d433d592e1 | ||
|
|
692caf19ce | ||
|
|
96d984b04d | ||
|
|
a759cd9a19 | ||
|
|
d236b2db58 | ||
|
|
d70d04c473 | ||
|
|
996bb990a0 | ||
|
|
fcccc9dc0b | ||
|
|
5b9a17dc8f | ||
|
|
f21bb4d0dc | ||
|
|
0c5a87b1d7 | ||
|
|
9c7dd3068f | ||
|
|
f14dbe081b | ||
|
|
8fd0033b43 | ||
|
|
602ba5d8a6 | ||
|
|
9ee32a4dd6 | ||
|
|
23bedbb3fb | ||
|
|
c1e85bb504 | ||
|
|
b43d0b4201 | ||
|
|
9b3519f850 | ||
|
|
257410d058 | ||
|
|
b7aefa71f8 | ||
|
|
8ac346be63 | ||
|
|
a86e6975cc | ||
|
|
8f7fc79cd7 | ||
|
|
e06006b436 | ||
|
|
d30686a78f | ||
|
|
32cebbbcba | ||
|
|
fbd6d0ebc6 | ||
|
|
809bce6cd9 | ||
|
|
793930b352 | ||
|
|
bd63327c3d | ||
|
|
a9492f6a44 | ||
|
|
b591d63e8b | ||
|
|
4b419ce125 | ||
|
|
66f1c42fcc | ||
|
|
05a3f43057 | ||
|
|
7f4b490fdb | ||
|
|
e3fce81097 | ||
|
|
1d97a81224 | ||
|
|
2324399fa8 | ||
|
|
e97682d4ca | ||
|
|
a5998cb589 | ||
|
|
80017f7d71 | ||
|
|
fe33f30c15 | ||
|
|
0b2afde90b | ||
|
|
89829d22b4 | ||
|
|
592fe4d967 | ||
|
|
f9b75e7d76 | ||
|
|
90cfb50658 | ||
|
|
c04573233c | ||
|
|
f73c3af445 | ||
|
|
b1d750bc1d | ||
|
|
a58395b718 | ||
|
|
d63e79a8ce | ||
|
|
0341bdcf77 | ||
|
|
05496a8b57 | ||
|
|
2a594d313c | ||
|
|
129151d5fc | ||
|
|
c6887aa999 | ||
|
|
29b9c2e14d | ||
|
|
2712b60de0 | ||
|
|
a84540515c | ||
|
|
286b4e8f09 | ||
|
|
f36b70e8b5 | ||
|
|
9e5d6c4155 | ||
|
|
652c59b25e | ||
|
|
292ed35005 | ||
|
|
d1bfea400c | ||
|
|
a74c2748ec | ||
|
|
f6ebe7c6a9 | ||
|
|
c1e13a9fcf | ||
|
|
b5e379dd80 | ||
|
|
b587018c56 | ||
|
|
67055289d0 | ||
|
|
8983af2016 | ||
|
|
295cae5a7b | ||
|
|
893fcdd39e | ||
|
|
8568667481 | ||
|
|
5940d227bb | ||
|
|
50281f5755 | ||
|
|
fdae8f4c6d | ||
|
|
40ac2126c9 | ||
|
|
74d3915302 | ||
|
|
5649f084e3 | ||
|
|
3da08c9d9e | ||
|
|
38f9b93885 | ||
|
|
dd80ffc61b | ||
|
|
989815e9f2 | ||
|
|
0610721aa0 | ||
|
|
3996dc4b79 | ||
|
|
ab2d94bb64 | ||
|
|
4a9639f02f | ||
|
|
ef733f0049 | ||
|
|
91dabc3165 | ||
|
|
95e934825a | ||
|
|
aace0ae9bd | ||
|
|
4921cb719b | ||
|
|
55a0b7d1a9 | ||
|
|
7d79e367f9 | ||
|
|
d77c209c85 | ||
|
|
53efaf1816 | ||
|
|
69abe6dbb9 | ||
|
|
92221216bf | ||
|
|
ed0aefaf6c | ||
|
|
7123d1fbd2 | ||
|
|
6d49ccf978 | ||
|
|
0369fd6578 | ||
|
|
e5370c114b | ||
|
|
b97c8a183d | ||
|
|
24311af259 | ||
|
|
a72cdb77ad | ||
|
|
396857db9a | ||
|
|
755ceda4f9 | ||
|
|
1b27c3dec1 | ||
|
|
0fc2a87bfd | ||
|
|
7579d68272 | ||
|
|
62aa0c4415 | ||
|
|
22672af217 | ||
|
|
17235d70e2 | ||
|
|
571f899c3d | ||
|
|
805470072b | ||
|
|
1ce3b12335 | ||
|
|
09e7186a4e | ||
|
|
4c0ce28e6e | ||
|
|
a56afd8b8f | ||
|
|
541c1b34e1 | ||
|
|
76a53e75ad | ||
|
|
482261e81b | ||
|
|
32a132e0ab | ||
|
|
8c89ec158c | ||
|
|
1274092fdd | ||
|
|
8906ebc272 | ||
|
|
84558215fd | ||
|
|
f79630e778 | ||
|
|
61cbb25b12 | ||
|
|
b1e94e8215 | ||
|
|
151feee826 | ||
|
|
c9c0621076 | ||
|
|
b8830815ab | ||
|
|
3d992be092 | ||
|
|
422c6a4935 | ||
|
|
3a0692711f | ||
|
|
3e1be4d549 | ||
|
|
32a5c1a58b | ||
|
|
137f8df057 | ||
|
|
0b05fdf0b5 | ||
|
|
f4103b4074 | ||
|
|
c549f7e8d7 |
No files matched your search
+35
-1
@@ -1,4 +1,38 @@
|
||||
# 1.5.0 (future)
|
||||
# 1.5.0+ (future)
|
||||
- AUTOSAVE/SRAM - Fix bug #3829 / #4820 (https://github.com/libretro/RetroArch/issues/3829)
|
||||
- ENDIANNESS: Fixed database scanning. Should fix scanning on PS3/WiiU/Wii, etc.
|
||||
- NET: Fix bug #4703 (https://github.com/libretro/RetroArch/issues/4703)
|
||||
- ANDROID: Runtime permission checking
|
||||
- ANDROID: Improve autoconf fallback
|
||||
- ANDROID: Improve shield portable/gamepad device grouping workaround
|
||||
- ANDROID: Allow remotes to retain OK/Cancel position when menu_swap_ok_cancel is enabled
|
||||
- LOCALIZATION: Update/finish French translation
|
||||
- LOCALIZATION: Update German translation
|
||||
- LOCALIZATION: Update Japanese translation
|
||||
- LOCALIZATION/GUI: Korean font should display properly now with XMB/MaterialUI's default font
|
||||
- MENU: Improved rendering for XMB ribbon; using additive blending (Vulkan/GL)
|
||||
- OSX/MACOS: Fixes serious memory leak
|
||||
- WINDOWS: Added WASAPI audio driver for low-latency audio. Both shared and exclusive mode.
|
||||
- WINDOWS: Added RawInput input driver for low-latency, low-level input.
|
||||
- WINDOWS: Core mouse input should be relative again in cores
|
||||
- MISC: Various frontend optimizations.
|
||||
- VIDEO: Fix threaded video regression; tickering of menu entries would no longer work.
|
||||
- WII: Fix crashing issues which could occur with the dummy core
|
||||
- WIIU: HID Controller support
|
||||
- WIIU: XMB/MaterialUI menu driver support
|
||||
- WIIU: Initial network/netplay support
|
||||
- LOBBIES: Fallback to filename based matching if no CRC matches are found (for people making playlists by hand)
|
||||
- LOBBIES: GUI refinement, show stop hosting when a host has been started, show disconnect when playing as client
|
||||
- LOBBIES: if the game is already loaded it will try to connect directly instead of re-loading content (non-fullpath cores only)
|
||||
- LOBBIES: unify both netplay menus
|
||||
- THUMBNAILS: Thumbnails show up now in Load Content -> Collection, Information -> Database
|
||||
- VITA: Fix slow I/O
|
||||
- VITA: Fix 30fps menu (poke into input now instead of reading the entire input buffer which apparently is slow)
|
||||
- VITA: Fix frame throttle
|
||||
- VULKAN: Unicode font rendering support. Should fix bad character encoding for French characters, etc.
|
||||
- VULKAN: Fix some crashes on loading some thumbnails
|
||||
|
||||
# 1.5.0
|
||||
- MOBILE: Single-tap for menu entry selection
|
||||
- MOBILE: Long-tap a setting to reset to default
|
||||
- ANDROID: Autoconf fallback
|
||||
|
||||
@@ -22,6 +22,11 @@ LIBS :=
|
||||
DEFINES := -DHAVE_CONFIG_H -DRARCH_INTERNAL -DHAVE_OVERLAY
|
||||
DEFINES += -DGLOBAL_CONFIG_DIR='"$(GLOBAL_CONFIG_DIR)"'
|
||||
|
||||
ifneq ($(findstring BSD,$(OS)),)
|
||||
CFLAGS += -DBSD
|
||||
LDFLAGS += -L/usr/local/lib
|
||||
endif
|
||||
|
||||
ifneq ($(findstring DOS,$(OS)),)
|
||||
CFLAGS += -march=i386
|
||||
LDFLAGS += -lemu
|
||||
|
||||
+48
-39
@@ -1,6 +1,7 @@
|
||||
ROOT_DIR := .
|
||||
DEPS_DIR := $(ROOT_DIR)/deps
|
||||
LIBRETRO_COMM_DIR := $(ROOT_DIR)/libretro-common
|
||||
WANT_WGL = 0
|
||||
|
||||
ifeq ($(HAVE_GL_CONTEXT),)
|
||||
HAVE_GL_CONTEXT=0
|
||||
@@ -160,17 +161,18 @@ OBJ += frontend/frontend.o \
|
||||
command.o \
|
||||
msg_hash.o \
|
||||
intl/msg_hash_us.o \
|
||||
runloop.o \
|
||||
$(LIBRETRO_COMM_DIR)/queues/task_queue.o \
|
||||
tasks/task_content.o \
|
||||
tasks/task_save.o \
|
||||
tasks/task_file_transfer.o \
|
||||
tasks/task_image.o \
|
||||
tasks/task_audio_mixer.o \
|
||||
$(LIBRETRO_COMM_DIR)/encodings/encoding_utf.o \
|
||||
$(LIBRETRO_COMM_DIR)/encodings/encoding_crc32.o \
|
||||
$(LIBRETRO_COMM_DIR)/lists/file_list.o \
|
||||
$(LIBRETRO_COMM_DIR)/lists/dir_list.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/retro_dirent.o \
|
||||
$(LIBRETRO_COMM_DIR)/streams/stdin_stream.o \
|
||||
$(LIBRETRO_COMM_DIR)/streams/file_stream.o \
|
||||
$(LIBRETRO_COMM_DIR)/streams/interface_stream.o \
|
||||
$(LIBRETRO_COMM_DIR)/streams/memory_stream.o \
|
||||
@@ -186,7 +188,7 @@ OBJ += frontend/frontend.o \
|
||||
file_path_str.o \
|
||||
$(LIBRETRO_COMM_DIR)/hash/rhash.o \
|
||||
audio/audio_driver.o \
|
||||
audio/audio_mixer.o \
|
||||
$(LIBRETRO_COMM_DIR)/audio/audio_mixer.o \
|
||||
input/input_driver.o \
|
||||
gfx/video_coord_array.o \
|
||||
gfx/video_driver.o \
|
||||
@@ -222,7 +224,6 @@ OBJ += frontend/frontend.o \
|
||||
tasks/task_powerstate.o \
|
||||
$(LIBRETRO_COMM_DIR)/gfx/scaler/scaler.o \
|
||||
gfx/drivers_shader/shader_null.o \
|
||||
gfx/video_shader_driver.o \
|
||||
gfx/video_shader_parse.o \
|
||||
$(LIBRETRO_COMM_DIR)/gfx/scaler/pixconv.o \
|
||||
$(LIBRETRO_COMM_DIR)/gfx/scaler/scaler_int.o \
|
||||
@@ -269,7 +270,8 @@ OBJ += intl/msg_hash_de.o \
|
||||
intl/msg_hash_ko.o \
|
||||
intl/msg_hash_nl.o \
|
||||
intl/msg_hash_pl.o \
|
||||
intl/msg_hash_pt.o \
|
||||
intl/msg_hash_pt_br.o \
|
||||
intl/msg_hash_pt_pt.o \
|
||||
intl/msg_hash_ru.o \
|
||||
intl/msg_hash_vn.o \
|
||||
intl/msg_hash_chs.o
|
||||
@@ -432,6 +434,12 @@ ifeq ($(HAVE_DSOUND), 1)
|
||||
LIBS += -ldxguid -ldsound
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_WASAPI), 1)
|
||||
OBJ += audio/drivers/wasapi.o
|
||||
DEFINES += -DHAVE_WASAPI
|
||||
LIBS += -lole32 -lksuser
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_XAUDIO), 1)
|
||||
OBJ += audio/drivers/xaudio.o
|
||||
DEFINES += -DHAVE_XAUDIO
|
||||
@@ -548,7 +556,6 @@ ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
menu/menu_input.o \
|
||||
menu/menu_event.o \
|
||||
menu/menu_entries.o \
|
||||
menu/menu_navigation.o \
|
||||
menu/menu_setting.o \
|
||||
menu/menu_shader.o \
|
||||
menu/widgets/menu_filebrowser.o \
|
||||
@@ -576,7 +583,6 @@ ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
menu/cbs/menu_cbs_up.o \
|
||||
menu/cbs/menu_cbs_down.o \
|
||||
menu/cbs/menu_cbs_contentlist_switch.o \
|
||||
menu/menu_display.o \
|
||||
menu/menu_displaylist.o \
|
||||
menu/menu_animation.o \
|
||||
menu/drivers_display/menu_display_null.o \
|
||||
@@ -602,7 +608,6 @@ endif
|
||||
|
||||
ifeq ($(HAVE_THREADS), 1)
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/rthreads/rthreads.o \
|
||||
$(LIBRETRO_COMM_DIR)/rthreads/rsemaphore.o \
|
||||
gfx/video_thread_wrapper.o \
|
||||
audio/audio_thread_wrapper.o
|
||||
DEFINES += -DHAVE_THREADS
|
||||
@@ -669,8 +674,9 @@ endif
|
||||
ifeq ($(HAVE_X11), 1)
|
||||
OBJ += input/common/input_x11_common.o \
|
||||
input/drivers/x11_input.o \
|
||||
gfx/common/dbus_common.o \
|
||||
gfx/common/x11_common.o \
|
||||
input/drivers_keyboard/keyboard_event_x11.o
|
||||
gfx/common/xinerama_common.o
|
||||
|
||||
LIBS += $(X11_LIBS) $(XEXT_LIBS) $(XF86VM_LIBS) $(XINERAMA_LIBS)
|
||||
DEFINES += $(X11_CFLAGS) $(XEXT_CFLAGS) $(XF86VM_CFLAGS) $(XINERAMA_CFLAGS)
|
||||
@@ -703,7 +709,6 @@ ifeq ($(HAVE_UDEV), 1)
|
||||
LIBS += $(UDEV_LIBS)
|
||||
OBJ += input/drivers/udev_input.o \
|
||||
input/common/udev_common.o \
|
||||
input/drivers_keyboard/keyboard_event_udev.o \
|
||||
input/drivers_joypad/udev_joypad.o
|
||||
endif
|
||||
|
||||
@@ -749,6 +754,10 @@ ifeq ($(HAVE_PARPORT), 1)
|
||||
OBJ += input/drivers_joypad/parport_joypad.o
|
||||
endif
|
||||
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
OBJ += input/drivers/winraw_input.o
|
||||
endif
|
||||
|
||||
# Companion UI
|
||||
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
@@ -761,14 +770,8 @@ endif
|
||||
|
||||
# Video
|
||||
|
||||
OBJ += gfx/video_context_driver.o \
|
||||
gfx/drivers_context/gfx_null_ctx.o \
|
||||
gfx/video_state_tracker.o \
|
||||
$(LIBRETRO_COMM_DIR)/gfx/math/vector_2.o \
|
||||
$(LIBRETRO_COMM_DIR)/gfx/math/vector_3.o \
|
||||
$(LIBRETRO_COMM_DIR)/gfx/math/vector_4.o \
|
||||
$(LIBRETRO_COMM_DIR)/gfx/math/matrix_4x4.o \
|
||||
$(LIBRETRO_COMM_DIR)/gfx/math/matrix_3x3.o
|
||||
OBJ += gfx/drivers_context/gfx_null_ctx.o \
|
||||
gfx/video_state_tracker.o
|
||||
|
||||
ifeq ($(HAVE_KMS), 1)
|
||||
HAVE_AND_WILL_USE_DRM = 1
|
||||
@@ -793,11 +796,14 @@ ifeq ($(HAVE_PLAIN_DRM), 1)
|
||||
LIBS += -ldrm
|
||||
endif
|
||||
|
||||
OBJ += \
|
||||
gfx/drivers_renderchain/null_renderchain.o
|
||||
|
||||
ifeq ($(HAVE_GL_CONTEXT), 1)
|
||||
DEFINES += -DHAVE_OPENGL -DHAVE_GLSL
|
||||
OBJ += gfx/drivers/gl.o \
|
||||
gfx/drivers_renderchain/gl_legacy_renderchain.o \
|
||||
$(LIBRETRO_COMM_DIR)/gfx/gl_capabilities.o \
|
||||
gfx/drivers/gl_renderchains/render_chain_gl_legacy.o \
|
||||
gfx/common/gl_common.o \
|
||||
gfx/drivers_font/gl_raster_font.o \
|
||||
$(LIBRETRO_COMM_DIR)/glsym/rglgen.o
|
||||
@@ -842,7 +848,7 @@ ifeq ($(HAVE_GL_CONTEXT), 1)
|
||||
ifeq ($(HAVE_FFMPEG), 1)
|
||||
ifneq ($(C89_BUILD), 1)
|
||||
ifneq ($(HAVE_OPENGLES), 1)
|
||||
OBJ += cores/libretro-ffmpeg/fft/fft.o
|
||||
OBJ += cores/libretro-ffmpeg/ffmpeg_fft.o
|
||||
DEFINES += -I$(DEPS_DIR) -DHAVE_GL_FFT
|
||||
NEED_CXX_LINKER=1
|
||||
endif
|
||||
@@ -866,8 +872,8 @@ endif
|
||||
GL_LIBS := -framework OpenGL
|
||||
OBJ += gfx/drivers_context/cgl_ctx.o
|
||||
else ifneq ($(findstring Win32,$(OS)),)
|
||||
GL_LIBS := -lopengl32 -lgdi32 -lcomdlg32 -lcomctl32
|
||||
OBJ += gfx/drivers_context/wgl_ctx.o
|
||||
GL_LIBS := -lopengl32 -lgdi32 -lcomdlg32
|
||||
WANT_WGL=1
|
||||
endif
|
||||
LIBS += $(GL_LIBS)
|
||||
endif
|
||||
@@ -920,6 +926,7 @@ endif
|
||||
ifeq ($(HAVE_VULKAN), 1)
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
GLSLANG_PLATFORM := Windows
|
||||
WANT_WGL = 1
|
||||
else
|
||||
GLSLANG_PLATFORM := Unix
|
||||
endif
|
||||
@@ -978,6 +985,10 @@ ifeq ($(HAVE_VULKAN), 1)
|
||||
DEFINES += -DHAVE_SLANG
|
||||
endif
|
||||
|
||||
ifeq ($(WANT_WGL), 1)
|
||||
OBJ += gfx/drivers_context/wgl_ctx.o
|
||||
LIBS += -lcomctl32
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_OMAP), 1)
|
||||
OBJ += gfx/drivers/omap_gfx.o
|
||||
@@ -1026,8 +1037,7 @@ endif
|
||||
|
||||
ifeq ($(HAVE_D3D9), 1)
|
||||
OBJ += gfx/drivers/d3d.o \
|
||||
gfx/drivers/d3d_renderchains/render_chain_null.o \
|
||||
gfx/drivers/d3d_renderchains/render_chain_driver.o \
|
||||
gfx/video_renderchain_driver.o \
|
||||
gfx/common/d3d_common.o \
|
||||
gfx/drivers_font/d3d_w32_font.o \
|
||||
gfx/drivers_context/d3d_ctx.o
|
||||
@@ -1041,7 +1051,7 @@ ifeq ($(HAVE_D3D9), 1)
|
||||
|
||||
ifeq ($(HAVE_CG), 1)
|
||||
LIBS += -lcgD3D9
|
||||
OBJ += gfx/drivers/d3d_renderchains/render_chain_cg.o
|
||||
OBJ += gfx/drivers_renderchain/d3d9_cg_renderchain.o
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -1125,20 +1135,20 @@ ifdef HAVE_COMPRESSION
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_BUILTINZLIB),1)
|
||||
OBJ += $(DEPS_DIR)/zlib/adler32.o \
|
||||
$(DEPS_DIR)/zlib/compress.o \
|
||||
$(DEPS_DIR)/zlib/crc32.o \
|
||||
$(DEPS_DIR)/zlib/deflate.o \
|
||||
$(DEPS_DIR)/zlib/gzclose.o \
|
||||
$(DEPS_DIR)/zlib/gzlib.o \
|
||||
$(DEPS_DIR)/zlib/gzread.o \
|
||||
$(DEPS_DIR)/zlib/gzwrite.o \
|
||||
$(DEPS_DIR)/zlib/inffast.o \
|
||||
$(DEPS_DIR)/zlib/inflate.o \
|
||||
$(DEPS_DIR)/zlib/inftrees.o \
|
||||
$(DEPS_DIR)/zlib/trees.o \
|
||||
$(DEPS_DIR)/zlib/uncompr.o \
|
||||
$(DEPS_DIR)/zlib/zutil.o
|
||||
OBJ += $(DEPS_DIR)/libz/adler32.o \
|
||||
$(DEPS_DIR)/libz/compress.o \
|
||||
$(DEPS_DIR)/libz/crc32.o \
|
||||
$(DEPS_DIR)/libz/deflate.o \
|
||||
$(DEPS_DIR)/libz/gzclose.o \
|
||||
$(DEPS_DIR)/libz/gzlib.o \
|
||||
$(DEPS_DIR)/libz/gzread.o \
|
||||
$(DEPS_DIR)/libz/gzwrite.o \
|
||||
$(DEPS_DIR)/libz/inffast.o \
|
||||
$(DEPS_DIR)/libz/inflate.o \
|
||||
$(DEPS_DIR)/libz/inftrees.o \
|
||||
$(DEPS_DIR)/libz/trees.o \
|
||||
$(DEPS_DIR)/libz/uncompr.o \
|
||||
$(DEPS_DIR)/libz/zutil.o
|
||||
else
|
||||
ifeq ($(HAVE_ZLIB),1)
|
||||
OBJ += $(ZLIB_OBJS)
|
||||
@@ -1239,7 +1249,6 @@ endif
|
||||
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
OBJ += media/rarch.o \
|
||||
input/drivers_keyboard/keyboard_event_win32.o \
|
||||
gfx/common/win32_common.o \
|
||||
frontend/drivers/platform_win32.o
|
||||
|
||||
|
||||
+1
-1
@@ -142,7 +142,7 @@ ifeq ($(WHOLE_ARCHIVE_LINK), 1)
|
||||
WHOLE_END := -Wl,--no-whole-archive
|
||||
endif
|
||||
|
||||
CFLAGS += -I. -Ideps/zlib -Ideps/7zip -Ilibretro-common/include
|
||||
CFLAGS += -I. -Ideps/libz -Ideps/7zip -Ilibretro-common/include
|
||||
|
||||
CFLAGS += -DRARCH_INTERNAL -DRARCH_CONSOLE -DSINC_LOWEST_QUALITY
|
||||
CFLAGS += -DHAVE_FILTERS_BUILTIN $(DEFINES)
|
||||
|
||||
@@ -74,7 +74,7 @@ else
|
||||
CFLAGS += -O3
|
||||
endif
|
||||
|
||||
CFLAGS += -I. -Ideps/zlib -Ideps/7zip -Ilibretro-common/include
|
||||
CFLAGS += -I. -Ideps/libz -Ideps/7zip -Ilibretro-common/include
|
||||
|
||||
#CFLAGS += -DRARCH_INTERNAL
|
||||
CFLAGS += -DRARCH_CONSOLE -DIS_SALAMANDER
|
||||
|
||||
+2
-2
@@ -72,7 +72,7 @@ OBJ += libretro-common/audio/dsp_filters/phaser.o
|
||||
OBJ += libretro-common/audio/dsp_filters/reverb.o
|
||||
OBJ += libretro-common/audio/dsp_filters/wahwah.o
|
||||
|
||||
CFLAGS += -Ideps/zlib/
|
||||
CFLAGS += -Ideps/libz/
|
||||
libretro = libretro_emscripten.bc
|
||||
|
||||
ifneq ($(V), 1)
|
||||
@@ -111,7 +111,7 @@ $(TARGET): $(OBJ)
|
||||
|
||||
clean:
|
||||
rm -f *.o
|
||||
rm -f deps/zlib/*.o
|
||||
rm -f deps/libz/*.o
|
||||
rm -f frontend/*.o
|
||||
rm -f menu/*.o
|
||||
rm -f menu/disp/*.o
|
||||
|
||||
+4
-4
@@ -89,7 +89,7 @@ else ifeq ($(libogc_platform), 1)
|
||||
EXT_TARGET := $(TARGET_NAME)_$(platform).dol
|
||||
EXT_INTER_TARGET := $(TARGET_NAME)_$(platform).elf
|
||||
|
||||
INCLUDE += -I. -I$(DEVKITPRO)/libogc/include -Ideps/zlib
|
||||
INCLUDE += -I. -I$(DEVKITPRO)/libogc/include -Ideps/libz
|
||||
|
||||
ifeq ($(platform), ngc)
|
||||
LIBDIRS += -L$(DEVKITPRO)/libogc/lib/cube
|
||||
@@ -213,8 +213,8 @@ else ifeq ($(platform), vita)
|
||||
MACHDEP := -DVITA
|
||||
WANT_ZLIB := 1
|
||||
INCLUDE += -Ideps/libvita2d/include
|
||||
INCLUDE += -Ideps/zlib
|
||||
PLATCFLAGS := -marm -mfloat-abi=hard -fsingle-precision-constant \
|
||||
INCLUDE += -Ideps/libz
|
||||
PLATCFLAGS := -mfloat-abi=hard -fsingle-precision-constant \
|
||||
-mword-relocations -fno-unwind-tables -fno-asynchronous-unwind-tables -ftree-vectorize -fno-optimize-sibling-calls
|
||||
LIBS += -lSceDisplay_stub -lSceGxm_stub -lSceNet_stub -lSceNetCtl_stub\
|
||||
-lSceSysmodule_stub -lSceCtrl_stub -lSceTouch_stub -lSceAudio_stub -lSceFiber_stub\
|
||||
@@ -414,7 +414,7 @@ ifneq ($(DEBUG), 1)
|
||||
arm-vita-eabi-strip -g $<
|
||||
endif
|
||||
vita-elf-create $< $@
|
||||
vita-make-fself -s $@ eboot.bin
|
||||
vita-make-fself -c -s $@ eboot.bin
|
||||
|
||||
%.elf32: %.elf
|
||||
ifeq ($(platform), xenon360)
|
||||
|
||||
+2
-7
@@ -15,7 +15,6 @@ DEBUG = 0
|
||||
HAVE_GCMGL = 0
|
||||
HAVE_LOGGER = 0
|
||||
HAVE_FREETYPE = 0
|
||||
HAVE_RLAUNCH = 0
|
||||
WHOLE_ARCHIVE_LINK = 0
|
||||
|
||||
CONTENT_ID_FULL = UP0001-SSNE10000_00-0000000000000001
|
||||
@@ -34,7 +33,7 @@ EBOOT_PATH = pkg/ps3/USRDIR/EBOOT.BIN
|
||||
CORE_PATH = pkg/ps3/USRDIR/cores/CORE.SELF
|
||||
|
||||
LDDIRS = -L. -L$(CELL_SDK)/target/ppu/lib/PSGL/RSX/ultra-opt
|
||||
INCDIRS = -I. -Idefines -Ideps/zlib -Ilibretro-common/include
|
||||
INCDIRS = -I. -Idefines -Ideps/libz -Ilibretro-common/include
|
||||
|
||||
# system platform
|
||||
system_platform = unix
|
||||
@@ -64,11 +63,7 @@ endif
|
||||
|
||||
PPU_SRCS = griffin/griffin.c
|
||||
|
||||
ifeq ($(HAVE_RLAUNCH), 1)
|
||||
DEFINES += -DHAVE_RLAUNCH
|
||||
endif
|
||||
|
||||
DEFINES += -DHAVE_MENU -DHAVE_RGUI -DHAVE_XMB -DHAVE_LIBRETRODB -DHAVE_MATERIALUI -DHAVE_SHADERPIPELINE -DRARCH_INTERNAL -DMSB_FIRST -DHAVE_OVERLAY -DHAVE_CC_RESAMPLER
|
||||
DEFINES += -DHAVE_MENU -DHAVE_RGUI -DHAVE_XMB -DHAVE_LIBRETRODB -DHAVE_MATERIALUI -DHAVE_SHADERPIPELINE -DRARCH_INTERNAL -DMSB_FIRST -DHAVE_OVERLAY -DHAVE_CC_RESAMPLER -DHAVE_STB_VORBIS
|
||||
|
||||
ifeq ($(HAVE_GCMGL), 1)
|
||||
DEFINES += -DHAVE_GCMGL
|
||||
|
||||
+1
-6
@@ -13,7 +13,6 @@ DEBUG = 0
|
||||
HAVE_GCMGL = 1
|
||||
HAVE_LOGGER = 0
|
||||
HAVE_FREETYPE = 0
|
||||
HAVE_RLAUNCH = 0
|
||||
WHOLE_ARCHIVE_LINK = 0
|
||||
|
||||
CONTENT_ID_FULL = UP0001-SSNE10000_00-0000000000000001
|
||||
@@ -62,10 +61,6 @@ endif
|
||||
|
||||
PPU_SRCS = griffin/griffin.c
|
||||
|
||||
ifeq ($(HAVE_RLAUNCH), 1)
|
||||
DEFINES += -DHAVE_RLAUNCH
|
||||
endif
|
||||
|
||||
DEFINES += -DHAVE_RGUI -DHAVE_MATERIALUI -DHAVE_XMB -DHAVE_MENU -DRARCH_INTERNAL
|
||||
|
||||
ifeq ($(HAVE_GCMGL), 1)
|
||||
@@ -104,7 +99,7 @@ PPU_LDLIBS = $(FONT_LIBS) $(GL_LIBS) $(WHOLE_START) -lretro_ps3 $(WHOLE_END) -l
|
||||
|
||||
PPU_RANLIB = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ranlib.exe
|
||||
|
||||
DEFINES += -DHAVE_THREADS -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_OVERLAY -DHAVE_HEADSET -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_FBO -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_RSOUND -DHAVE_ZLIB -DHAVE_RPNG -DWANT_ZLIB -DSINC_LOWER_QUALITY -D__CELLOS_LV2__ -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=0 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
|
||||
DEFINES += -DHAVE_THREADS -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_OVERLAY -DHAVE_HEADSET -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_FBO -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_RSOUND -DHAVE_ZLIB -DHAVE_RPNG -DWANT_ZLIB -DSINC_LOWER_QUALITY -D__CELLOS_LV2__ -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=0 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -DHAVE_STB_VORBIS
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
PPU_OPTIMIZE_LV := -O0 -g
|
||||
|
||||
@@ -18,7 +18,7 @@ endif
|
||||
|
||||
STRIP = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-strip.exe
|
||||
|
||||
PPU_CFLAGS += -I. -Ilibretro-common/include -Ideps/zlib -D__CELLOS_LV2__ -DIS_SALAMANDER -DRARCH_CONSOLE -DHAVE_SYSUTILS -DHAVE_SYSMODULES -DHAVE_RARCH_EXEC
|
||||
PPU_CFLAGS += -I. -Ilibretro-common/include -Ideps/libz -D__CELLOS_LV2__ -DIS_SALAMANDER -DRARCH_CONSOLE -DHAVE_SYSUTILS -DHAVE_SYSMODULES -DHAVE_RARCH_EXEC
|
||||
PPU_SRCS = frontend/frontend_salamander.c \
|
||||
frontend/frontend_driver.c \
|
||||
frontend/drivers/platform_ps3.c \
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ ELF_TARGET := retroarch_psl1ght.elf
|
||||
EBOOT_PATH = pkg/ps3/USRDIR/EBOOT.BIN
|
||||
CORE_PATH = pkg/ps3/USRDIR/cores/CORE.SELF
|
||||
|
||||
INCLUDE := -I. -I$(PS3DEV)/ppu/include -Ideps/zlib -Ips3/gcmgl/include/export -Ips3/include
|
||||
INCLUDE := -I. -I$(PS3DEV)/ppu/include -Ideps/libz -Ips3/gcmgl/include/export -Ips3/include
|
||||
LIBDIRS := -L$(PS3DEV)/ppu/lib -L$(PS3DEV)/portlibs/ppu/lib -L.
|
||||
|
||||
MACHDEP := -D__CELLOS_LV2__ -D__PSL1GHT__
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ ifeq ($(WHOLE_ARCHIVE_LINK), 1)
|
||||
WHOLE_END := -Wl,--no-whole-archive
|
||||
endif
|
||||
|
||||
INCDIR = deps/zlib deps/7zip libretro-common/include
|
||||
INCDIR = deps/libz deps/7zip libretro-common/include
|
||||
CFLAGS = $(OPTIMIZE_LV) -G0 -std=gnu99 -ffast-math
|
||||
ASFLAGS = $(CFLAGS)
|
||||
|
||||
|
||||
+1
-1
@@ -97,7 +97,7 @@ STRIP := $(PREFIX)strip
|
||||
NM := $(PREFIX)nm
|
||||
LD := $(CXX)
|
||||
|
||||
INCDIRS := -I. -Ideps/zlib -Ideps/7zip -Ilibretro-common/include
|
||||
INCDIRS := -I. -Ideps/libz -Ideps/7zip -Ilibretro-common/include
|
||||
LIBDIRS := -L.
|
||||
|
||||
ARCHFLAGS := -march=armv7-a -mfpu=neon -mfloat-abi=hard -DVITA
|
||||
|
||||
@@ -29,7 +29,7 @@ ELF2DOL = $(DEVKITPPC)/bin/elf2dol$(EXE_EXT)
|
||||
DOL_TARGET := retroarch-salamander_wii.dol
|
||||
ELF_TARGET := retroarch-salamander_wii.elf
|
||||
|
||||
INCLUDE := -I. -I$(DEVKITPRO)/libogc/include -Ilibretro-common/include -Ideps/zlib
|
||||
INCLUDE := -I. -I$(DEVKITPRO)/libogc/include -Ilibretro-common/include -Ideps/libz
|
||||
LIBDIRS := -L$(DEVKITPRO)/libogc/lib/wii -L.
|
||||
|
||||
MACHDEP := -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float
|
||||
|
||||
+36
-10
@@ -1,18 +1,33 @@
|
||||
TARGET := retroarch_wiiu
|
||||
BUILD_HBL_ELF = 1
|
||||
BUILD_RPX = 1
|
||||
BUILD_RPX = 1
|
||||
DEBUG = 0
|
||||
GRIFFIN_BUILD = 0
|
||||
WHOLE_ARCHIVE_LINK = 0
|
||||
|
||||
PC_DEVELOPMENT_IP_ADDRESS =
|
||||
PC_DEVELOPMENT_TCP_PORT =
|
||||
PC_DEVELOPMENT_IP_ADDRESS ?=
|
||||
PC_DEVELOPMENT_TCP_PORT ?=
|
||||
|
||||
OBJ :=
|
||||
OBJ += wiiu/system/memory.o
|
||||
OBJ += wiiu/system/exception_handler.o
|
||||
OBJ += wiiu/fs/sd_fat_devoptab.o
|
||||
OBJ += wiiu/fs/fs_utils.o
|
||||
OBJ += wiiu/controller_patcher/ControllerPatcher.o
|
||||
OBJ += wiiu/controller_patcher/ControllerPatcherWrapper.o
|
||||
OBJ += wiiu/controller_patcher/ConfigReader.o
|
||||
OBJ += wiiu/controller_patcher/config/ConfigParser.o
|
||||
OBJ += wiiu/controller_patcher/config/ConfigValues.o
|
||||
OBJ += wiiu/controller_patcher/network/ControllerPatcherNet.o
|
||||
OBJ += wiiu/controller_patcher/network/TCPServer.o
|
||||
OBJ += wiiu/controller_patcher/network/UDPClient.o
|
||||
OBJ += wiiu/controller_patcher/network/UDPServer.o
|
||||
OBJ += wiiu/controller_patcher/patcher/ControllerPatcherUtils.o
|
||||
OBJ += wiiu/controller_patcher/patcher/ControllerPatcherHID.o
|
||||
OBJ += wiiu/controller_patcher/utils/CPRetainVars.o
|
||||
OBJ += wiiu/controller_patcher/utils/CPStringTools.o
|
||||
OBJ += wiiu/controller_patcher/utils/PadConst.o
|
||||
OBJ += wiiu/controller_patcher/utils/FSHelper.o
|
||||
OBJ += wiiu/tex_shader.o
|
||||
OBJ += wiiu/hbl.o
|
||||
|
||||
@@ -22,7 +37,10 @@ ifeq ($(GRIFFIN_BUILD), 1)
|
||||
OBJ += griffin/griffin.o
|
||||
DEFINES += -DHAVE_GRIFFIN=1 -DHAVE_MENU -DHAVE_RGUI -DHAVE_LIBRETRODB
|
||||
DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DWANT_ZLIB -DHAVE_CC_RESAMPLER
|
||||
# DEFINES += -DHAVE_XMB -DHAVE_MATERIALUI
|
||||
DEFINES += -DHAVE_STB_FONT -DHAVE_STB_VORBIS -DHAVE_LANGEXTRA -DHAVE_LIBRETRODB -DHAVE_NETWORKING
|
||||
# DEFINES += -DWANT_IFADDRS
|
||||
# DEFINES += -DHAVE_FREETYPE
|
||||
DEFINES += -DHAVE_XMB -DHAVE_MATERIALUI
|
||||
else
|
||||
HAVE_MENU_COMMON = 1
|
||||
HAVE_RTGA = 1
|
||||
@@ -35,18 +53,25 @@ else
|
||||
HAVE_BUILTINZLIB = 1
|
||||
HAVE_LIBRETRODB = 1
|
||||
HAVE_ZARCH = 0
|
||||
HAVE_MATERIALUI = 0
|
||||
HAVE_XMB = 0
|
||||
HAVE_MATERIALUI = 1
|
||||
HAVE_XMB = 1
|
||||
HAVE_STB_FONT = 1
|
||||
# HAVE_FREETYPE = 1
|
||||
HAVE_LANGEXTRA = 1
|
||||
HAVE_LIBRETRODB = 1
|
||||
HAVE_NETWORKING = 1
|
||||
# WANT_IFADDRS = 1
|
||||
|
||||
include Makefile.common
|
||||
BLACKLIST :=
|
||||
BLACKLIST += input/input_overlay.o
|
||||
BLACKLIST += tasks/task_overlay.o
|
||||
BLACKLIST += $(LIBRETRO_COMM_DIR)/net/net_ifinfo.o
|
||||
OBJ := $(filter-out $(BLACKLIST),$(OBJ))
|
||||
|
||||
OBJ += gfx/drivers/wiiu_gfx.o
|
||||
# OBJ += gfx/drivers_font/wiiu_font.o
|
||||
# OBJ += menu/drivers_display/menu_display_wiiu.o
|
||||
OBJ += gfx/drivers_font/wiiu_font.o
|
||||
OBJ += menu/drivers_display/menu_display_wiiu.o
|
||||
OBJ += input/drivers/wiiu_input.o
|
||||
OBJ += input/drivers_joypad/wiiu_joypad.o
|
||||
OBJ += audio/drivers/wiiu_audio.o
|
||||
@@ -101,7 +126,7 @@ else
|
||||
endif
|
||||
|
||||
|
||||
INCDIRS := -I. -Ideps/zlib -Ideps/7zip -Ilibretro-common/include -Iwiiu -Iwiiu/include -I$(DEVKITPRO)/portlibs/ppc/include
|
||||
INCDIRS := -I. -Ideps/libz -Ideps/7zip -Ilibretro-common/include -Iwiiu -Iwiiu/include -I$(DEVKITPRO)/portlibs/ppc/include
|
||||
LIBDIRS := -L. -L$(DEVKITPRO)/portlibs/ppc/lib
|
||||
|
||||
CFLAGS := -mwup -mcpu=750 -meabi -mhard-float
|
||||
@@ -123,6 +148,7 @@ CFLAGS += -ffast-math -Werror=implicit-function-declaration
|
||||
#todo: remove -DWIIU and use the built-in macros instead (HW_WUP or __wiiu__).
|
||||
CFLAGS += -DWIIU -DMSB_FIRST
|
||||
CFLAGS += -DHAVE_MAIN
|
||||
CFLAGS += -DHAVE_UPDATE_ASSETS
|
||||
CFLAGS += -DRARCH_INTERNAL -DRARCH_CONSOLE
|
||||
CFLAGS += -DHAVE_FILTERS_BUILTIN $(DEFINES)
|
||||
|
||||
@@ -138,7 +164,7 @@ ifeq ($(WHOLE_ARCHIVE_LINK), 1)
|
||||
WHOLE_START := -Wl,--whole-archive
|
||||
WHOLE_END := -Wl,--no-whole-archive
|
||||
endif
|
||||
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
|
||||
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -D_GNU_SOURCE
|
||||
|
||||
LDFLAGS += -Wl,--gc-sections
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ else
|
||||
endif
|
||||
|
||||
|
||||
INCDIRS := -I. -Ideps/zlib -Ideps/7zip -Ilibretro-common/include -Iwiiu -Iwiiu/include -I$(DEVKITPRO)/portlibs/ppc/include
|
||||
INCDIRS := -I. -Ideps/libz -Ideps/7zip -Ilibretro-common/include -Iwiiu -Iwiiu/include -I$(DEVKITPRO)/portlibs/ppc/include
|
||||
LIBDIRS := -L. -L$(DEVKITPRO)/portlibs/ppc/lib
|
||||
|
||||
CFLAGS := -mwup -mcpu=750 -meabi -mhard-float
|
||||
|
||||
@@ -3,6 +3,7 @@ TARGET = retroarch.exe
|
||||
HAVE_DINPUT = 1
|
||||
HAVE_XAUDIO = 1
|
||||
HAVE_DSOUND = 1
|
||||
HAVE_WASAPI = 1
|
||||
HAVE_OPENGL = 1
|
||||
HAVE_FBO = 1
|
||||
HAVE_DYLIB = 1
|
||||
|
||||
+369
-120
@@ -25,14 +25,15 @@
|
||||
#include <audio/dsp_filter.h>
|
||||
#include <file/file_path.h>
|
||||
#include <lists/dir_list.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../config.h"
|
||||
#endif
|
||||
|
||||
#include "audio_driver.h"
|
||||
#include "audio_mixer.h"
|
||||
#include "audio_thread_wrapper.h"
|
||||
#include "../gfx/video_driver.h"
|
||||
#include "../record/record_driver.h"
|
||||
#include "../frontend/frontend_driver.h"
|
||||
|
||||
@@ -40,13 +41,13 @@
|
||||
#include "../driver.h"
|
||||
#include "../configuration.h"
|
||||
#include "../retroarch.h"
|
||||
#include "../runloop.h"
|
||||
#include "../performance_counters.h"
|
||||
#include "../verbosity.h"
|
||||
#include "../list_special.h"
|
||||
|
||||
#define AUDIO_BUFFER_FREE_SAMPLES_COUNT (8 * 1024)
|
||||
|
||||
#define AUDIO_MIXER_MAX_STREAMS 8
|
||||
|
||||
static const audio_driver_t *audio_drivers[] = {
|
||||
#ifdef HAVE_ALSA
|
||||
&audio_alsa,
|
||||
@@ -84,6 +85,9 @@ static const audio_driver_t *audio_drivers[] = {
|
||||
#ifdef HAVE_DSOUND
|
||||
&audio_dsound,
|
||||
#endif
|
||||
#ifdef HAVE_WASAPI
|
||||
&audio_wasapi,
|
||||
#endif
|
||||
#ifdef HAVE_PULSE
|
||||
&audio_pulse,
|
||||
#endif
|
||||
@@ -103,7 +107,7 @@ static const audio_driver_t *audio_drivers[] = {
|
||||
&audio_rwebaudio,
|
||||
#endif
|
||||
#if defined(PSP) || defined(VITA)
|
||||
&audio_psp,
|
||||
&audio_psp,
|
||||
#endif
|
||||
#ifdef _3DS
|
||||
&audio_ctr_csnd,
|
||||
@@ -113,44 +117,63 @@ static const audio_driver_t *audio_drivers[] = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
struct audio_mixer_stream
|
||||
{
|
||||
audio_mixer_sound_t *handle;
|
||||
audio_mixer_voice_t *voice;
|
||||
audio_mixer_stop_cb_t stop_cb;
|
||||
enum audio_mixer_state state;
|
||||
float volume;
|
||||
void *buf;
|
||||
size_t bufsize;
|
||||
};
|
||||
|
||||
static unsigned audio_mixer_current_max_idx = 0;
|
||||
static struct audio_mixer_stream audio_mixer_streams[AUDIO_MIXER_MAX_STREAMS] = {{0}};
|
||||
|
||||
static size_t audio_driver_chunk_size = 0;
|
||||
static size_t audio_driver_chunk_nonblock_size = 0;
|
||||
static size_t audio_driver_chunk_block_size = 0;
|
||||
|
||||
static size_t audio_driver_rewind_ptr = 0;
|
||||
static size_t audio_driver_rewind_size = 0;
|
||||
static int16_t *audio_driver_rewind_buf = NULL;
|
||||
|
||||
static float *audio_driver_input_data = NULL;
|
||||
static int16_t *audio_driver_rewind_buf = NULL;
|
||||
static int16_t *audio_driver_output_samples_conv_buf = NULL;
|
||||
|
||||
static unsigned audio_driver_free_samples_buf[AUDIO_BUFFER_FREE_SAMPLES_COUNT];
|
||||
static uint64_t audio_driver_free_samples_count = 0;
|
||||
|
||||
static float *audio_driver_output_samples_buf = NULL;
|
||||
static int16_t *audio_driver_output_samples_conv_buf = NULL;
|
||||
|
||||
static float audio_driver_volume_gain = 0.0f;
|
||||
|
||||
static size_t audio_driver_buffer_size = 0;
|
||||
static size_t audio_driver_data_ptr = 0;
|
||||
|
||||
static bool audio_driver_control = false;
|
||||
static bool audio_driver_control = false;
|
||||
static bool audio_driver_mute_enable = false;
|
||||
static bool audio_driver_use_float = false;
|
||||
static bool audio_driver_active = false;
|
||||
static bool audio_driver_data_own = false;
|
||||
static bool audio_mixer_active = false;
|
||||
|
||||
static float audio_driver_rate_control_delta = 0.0f;
|
||||
static float audio_driver_input = 0.0f;
|
||||
static float audio_driver_volume_gain = 0.0f;
|
||||
|
||||
static float *audio_driver_input_data = NULL;
|
||||
static float *audio_driver_output_samples_buf = NULL;
|
||||
|
||||
static double audio_source_ratio_original = 0.0f;
|
||||
static double audio_source_ratio_current = 0.0f;
|
||||
|
||||
static struct retro_audio_callback audio_callback = {0};
|
||||
|
||||
static retro_dsp_filter_t *audio_driver_dsp = NULL;
|
||||
static struct string_list *audio_driver_devices_list = NULL;
|
||||
static const retro_resampler_t *audio_driver_resampler = NULL;
|
||||
|
||||
static void *audio_driver_resampler_data = NULL;
|
||||
static const audio_driver_t *current_audio = NULL;
|
||||
static void *audio_driver_context_audio_data = NULL;
|
||||
|
||||
static bool audio_driver_use_float = false;
|
||||
static bool audio_driver_active = false;
|
||||
static bool audio_driver_data_own = false;
|
||||
|
||||
/**
|
||||
* compute_audio_buffer_statistics:
|
||||
*
|
||||
@@ -160,7 +183,8 @@ static bool audio_driver_data_own = false;
|
||||
static void compute_audio_buffer_statistics(void)
|
||||
{
|
||||
unsigned i, low_water_size, high_water_size, avg, stddev;
|
||||
float avg_filled, deviation;
|
||||
float avg_filled = 0.0f;
|
||||
float deviation = 0.0f;
|
||||
uint64_t accum = 0;
|
||||
uint64_t accum_var = 0;
|
||||
unsigned low_water_count = 0;
|
||||
@@ -198,9 +222,9 @@ static void compute_audio_buffer_statistics(void)
|
||||
high_water_count++;
|
||||
}
|
||||
|
||||
RARCH_LOG("Average audio buffer saturation: %.2f %%, standard deviation (percentage points): %.2f %%.\n",
|
||||
RARCH_LOG("[Audio]: Average audio buffer saturation: %.2f %%, standard deviation (percentage points): %.2f %%.\n",
|
||||
avg_filled * 100.0, deviation * 100.0);
|
||||
RARCH_LOG("Amount of time spent close to underrun: %.2f %%. Close to blocking: %.2f %%.\n",
|
||||
RARCH_LOG("[Audio]: Amount of time spent close to underrun: %.2f %%. Close to blocking: %.2f %%.\n",
|
||||
(100.0 * low_water_count) / (samples - 1),
|
||||
(100.0 * high_water_count) / (samples - 1));
|
||||
}
|
||||
@@ -270,7 +294,7 @@ static bool audio_driver_deinit_internal(void)
|
||||
|
||||
audio_driver_rewind_size = 0;
|
||||
|
||||
if (settings && !settings->audio.enable)
|
||||
if (settings && !settings->bools.audio_enable)
|
||||
{
|
||||
audio_driver_active = false;
|
||||
return false;
|
||||
@@ -300,17 +324,15 @@ static bool audio_driver_init_internal(bool audio_cb_inited)
|
||||
float *samples_buf = NULL;
|
||||
int16_t *conv_buf = NULL;
|
||||
int16_t *rewind_buf = NULL;
|
||||
size_t outsamples_max = AUDIO_CHUNK_SIZE_NONBLOCKING * 2;
|
||||
size_t max_bufsamples = AUDIO_CHUNK_SIZE_NONBLOCKING * 2;
|
||||
settings_t *settings = config_get_ptr();
|
||||
/* Accomodate rewind since at some point we might have two full buffers. */
|
||||
size_t outsamples_max = AUDIO_CHUNK_SIZE_NONBLOCKING * 2 * AUDIO_MAX_RATIO *
|
||||
settings->floats.slowmotion_ratio;
|
||||
|
||||
convert_s16_to_float_init_simd();
|
||||
convert_float_to_s16_init_simd();
|
||||
|
||||
/* Accomodate rewind since at some point we might have two full buffers. */
|
||||
outsamples_max = max_bufsamples * AUDIO_MAX_RATIO *
|
||||
settings->slowmotion_ratio;
|
||||
|
||||
conv_buf = (int16_t*)malloc(outsamples_max
|
||||
* sizeof(int16_t));
|
||||
/* Used for recording even if audio isn't enabled. */
|
||||
@@ -335,7 +357,7 @@ static bool audio_driver_init_internal(bool audio_cb_inited)
|
||||
audio_driver_rewind_buf = rewind_buf;
|
||||
audio_driver_rewind_size = max_bufsamples;
|
||||
|
||||
if (!settings->audio.enable)
|
||||
if (!settings->bools.audio_enable)
|
||||
{
|
||||
audio_driver_active = false;
|
||||
return false;
|
||||
@@ -345,14 +367,15 @@ static bool audio_driver_init_internal(bool audio_cb_inited)
|
||||
#ifdef HAVE_THREADS
|
||||
if (audio_cb_inited)
|
||||
{
|
||||
RARCH_LOG("Starting threaded audio driver ...\n");
|
||||
RARCH_LOG("[Audio]: Starting threaded audio driver ...\n");
|
||||
if (!audio_init_thread(
|
||||
¤t_audio,
|
||||
&audio_driver_context_audio_data,
|
||||
*settings->audio.device ? settings->audio.device : NULL,
|
||||
settings->audio.out_rate, &new_rate,
|
||||
settings->audio.latency,
|
||||
settings->audio.block_frames,
|
||||
*settings->arrays.audio_device
|
||||
? settings->arrays.audio_device : NULL,
|
||||
settings->uints.audio_out_rate, &new_rate,
|
||||
settings->uints.audio_latency,
|
||||
settings->uints.audio_block_frames,
|
||||
current_audio))
|
||||
{
|
||||
RARCH_ERR("Cannot open threaded audio driver ... Exiting ...\n");
|
||||
@@ -363,15 +386,18 @@ static bool audio_driver_init_internal(bool audio_cb_inited)
|
||||
#endif
|
||||
{
|
||||
audio_driver_context_audio_data =
|
||||
current_audio->init(*settings->audio.device ?
|
||||
settings->audio.device : NULL,
|
||||
settings->audio.out_rate, settings->audio.latency,
|
||||
settings->audio.block_frames,
|
||||
current_audio->init(*settings->arrays.audio_device ?
|
||||
settings->arrays.audio_device : NULL,
|
||||
settings->uints.audio_out_rate,
|
||||
settings->uints.audio_latency,
|
||||
settings->uints.audio_block_frames,
|
||||
&new_rate);
|
||||
}
|
||||
|
||||
if (new_rate != 0)
|
||||
settings->audio.out_rate = new_rate;
|
||||
{
|
||||
configuration_set_int(settings, settings->uints.audio_out_rate, new_rate);
|
||||
}
|
||||
|
||||
if (!audio_driver_context_audio_data)
|
||||
{
|
||||
@@ -384,7 +410,7 @@ static bool audio_driver_init_internal(bool audio_cb_inited)
|
||||
&& current_audio->use_float(audio_driver_context_audio_data))
|
||||
audio_driver_use_float = true;
|
||||
|
||||
if (!settings->audio.sync && audio_driver_active)
|
||||
if (!settings->bools.audio_sync && audio_driver_active)
|
||||
{
|
||||
command_event(CMD_EVENT_AUDIO_SET_NONBLOCKING_STATE, NULL);
|
||||
audio_driver_chunk_size = audio_driver_chunk_nonblock_size;
|
||||
@@ -394,21 +420,21 @@ static bool audio_driver_init_internal(bool audio_cb_inited)
|
||||
{
|
||||
/* Should never happen. */
|
||||
RARCH_WARN("Input rate is invalid (%.3f Hz). Using output rate (%u Hz).\n",
|
||||
audio_driver_input, settings->audio.out_rate);
|
||||
audio_driver_input = settings->audio.out_rate;
|
||||
audio_driver_input, settings->uints.audio_out_rate);
|
||||
audio_driver_input = settings->uints.audio_out_rate;
|
||||
}
|
||||
|
||||
audio_source_ratio_original = audio_source_ratio_current =
|
||||
(double)settings->audio.out_rate / audio_driver_input;
|
||||
(double)settings->uints.audio_out_rate / audio_driver_input;
|
||||
|
||||
if (!retro_resampler_realloc(
|
||||
&audio_driver_resampler_data,
|
||||
&audio_driver_resampler,
|
||||
settings->audio.resampler,
|
||||
settings->arrays.audio_resampler,
|
||||
audio_source_ratio_original))
|
||||
{
|
||||
RARCH_ERR("Failed to initialize resampler \"%s\".\n",
|
||||
settings->audio.resampler);
|
||||
settings->arrays.audio_resampler);
|
||||
audio_driver_active = false;
|
||||
}
|
||||
|
||||
@@ -421,7 +447,7 @@ static bool audio_driver_init_internal(bool audio_cb_inited)
|
||||
audio_driver_input_data = aud_inp_data;
|
||||
audio_driver_data_ptr = 0;
|
||||
|
||||
retro_assert(settings->audio.out_rate <
|
||||
retro_assert(settings->uints.audio_out_rate <
|
||||
audio_driver_input * AUDIO_MAX_RATIO);
|
||||
|
||||
samples_buf = (float*)malloc(outsamples_max * sizeof(float));
|
||||
@@ -437,7 +463,7 @@ static bool audio_driver_init_internal(bool audio_cb_inited)
|
||||
if (
|
||||
!audio_cb_inited
|
||||
&& audio_driver_active
|
||||
&& settings->audio.rate_control
|
||||
&& settings->bools.audio_rate_control
|
||||
)
|
||||
{
|
||||
/* Audio rate control requires write_avail
|
||||
@@ -452,21 +478,15 @@ static bool audio_driver_init_internal(bool audio_cb_inited)
|
||||
RARCH_WARN("Audio rate control was desired, but driver does not support needed features.\n");
|
||||
}
|
||||
|
||||
/* If we start muted, stop the audio driver,
|
||||
* so subsequent unmute works. */
|
||||
if ( !audio_cb_inited
|
||||
&& audio_driver_active
|
||||
&& settings->audio.mute_enable)
|
||||
audio_driver_stop();
|
||||
|
||||
command_event(CMD_EVENT_DSP_FILTER_INIT, NULL);
|
||||
|
||||
audio_driver_free_samples_count = 0;
|
||||
|
||||
audio_mixer_init(settings->uints.audio_out_rate);
|
||||
|
||||
/* Threaded driver is initially stopped. */
|
||||
if (
|
||||
audio_driver_active
|
||||
&& !settings->audio.mute_enable
|
||||
&& audio_cb_inited
|
||||
)
|
||||
audio_driver_start(false);
|
||||
@@ -484,8 +504,9 @@ void audio_driver_set_nonblocking_state(bool enable)
|
||||
audio_driver_active
|
||||
&& audio_driver_context_audio_data
|
||||
)
|
||||
current_audio->set_nonblock_state(audio_driver_context_audio_data,
|
||||
settings->audio.sync ? enable : true);
|
||||
current_audio->set_nonblock_state(
|
||||
audio_driver_context_audio_data,
|
||||
settings->bools.audio_sync ? enable : true);
|
||||
|
||||
audio_driver_chunk_size = enable ?
|
||||
audio_driver_chunk_nonblock_size :
|
||||
@@ -510,12 +531,8 @@ static bool audio_driver_flush(const int16_t *data, size_t samples)
|
||||
bool is_paused = false;
|
||||
bool is_idle = false;
|
||||
bool is_slowmotion = false;
|
||||
static struct retro_perf_counter resampler_proc = {0};
|
||||
static struct retro_perf_counter audio_convert_s16 = {0};
|
||||
const void *output_data = NULL;
|
||||
unsigned output_frames = 0;
|
||||
size_t output_size = sizeof(float);
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
src_data.data_in = NULL;
|
||||
src_data.data_out = NULL;
|
||||
@@ -529,16 +546,13 @@ static bool audio_driver_flush(const int16_t *data, size_t samples)
|
||||
runloop_get_status(&is_paused, &is_idle, &is_slowmotion,
|
||||
&is_perfcnt_enable);
|
||||
|
||||
if (is_paused || settings->audio.mute_enable)
|
||||
if (is_paused || audio_driver_mute_enable)
|
||||
return true;
|
||||
if (!audio_driver_active || !audio_driver_input_data)
|
||||
return false;
|
||||
|
||||
performance_counter_init(audio_convert_s16, "audio_convert_s16");
|
||||
performance_counter_start_plus(is_perfcnt_enable, audio_convert_s16);
|
||||
convert_s16_to_float(audio_driver_input_data, data, samples,
|
||||
audio_driver_volume_gain);
|
||||
performance_counter_stop_plus(is_perfcnt_enable, audio_convert_s16);
|
||||
|
||||
src_data.data_in = audio_driver_input_data;
|
||||
src_data.input_frames = samples >> 1;
|
||||
@@ -546,7 +560,6 @@ static bool audio_driver_flush(const int16_t *data, size_t samples)
|
||||
|
||||
if (audio_driver_dsp)
|
||||
{
|
||||
static struct retro_perf_counter audio_dsp = {0};
|
||||
struct retro_dsp_data dsp_data;
|
||||
|
||||
dsp_data.input = NULL;
|
||||
@@ -557,15 +570,12 @@ static bool audio_driver_flush(const int16_t *data, size_t samples)
|
||||
dsp_data.input = audio_driver_input_data;
|
||||
dsp_data.input_frames = (unsigned)(samples >> 1);
|
||||
|
||||
performance_counter_init(audio_dsp, "audio_dsp");
|
||||
performance_counter_start_plus(is_perfcnt_enable, audio_dsp);
|
||||
retro_dsp_filter_process(audio_driver_dsp, &dsp_data);
|
||||
performance_counter_stop_plus(is_perfcnt_enable, audio_dsp);
|
||||
|
||||
if (dsp_data.output)
|
||||
{
|
||||
src_data.data_in = dsp_data.output;
|
||||
src_data.input_frames = dsp_data.output_frames;
|
||||
src_data.data_in = dsp_data.output;
|
||||
src_data.input_frames = dsp_data.output_frames;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -581,55 +591,54 @@ static bool audio_driver_flush(const int16_t *data, size_t samples)
|
||||
(int)current_audio->write_avail(audio_driver_context_audio_data);
|
||||
int delta_mid = avail - half_size;
|
||||
double direction = (double)delta_mid / half_size;
|
||||
double adjust = 1.0 + settings->audio.rate_control_delta * direction;
|
||||
double adjust = 1.0 + audio_driver_rate_control_delta * direction;
|
||||
|
||||
#if 0
|
||||
RARCH_LOG_OUTPUT("Audio buffer is %u%% full\n",
|
||||
RARCH_LOG_OUTPUT("[Audio]: Audio buffer is %u%% full\n",
|
||||
(unsigned)(100 - (avail * 100) / audio_driver_buffer_size));
|
||||
#endif
|
||||
|
||||
audio_driver_free_samples_buf[write_idx] = avail;
|
||||
audio_driver_free_samples_buf
|
||||
[write_idx] = avail;
|
||||
audio_source_ratio_current =
|
||||
audio_source_ratio_original * adjust;
|
||||
|
||||
#if 0
|
||||
RARCH_LOG_OUTPUT("New rate: %lf, Orig rate: %lf\n",
|
||||
RARCH_LOG_OUTPUT("[Audio]: New rate: %lf, Orig rate: %lf\n",
|
||||
audio_source_ratio_current,
|
||||
audio_source_ratio_original);
|
||||
#endif
|
||||
}
|
||||
|
||||
src_data.ratio = audio_source_ratio_current;
|
||||
src_data.ratio = audio_source_ratio_current;
|
||||
|
||||
if (is_slowmotion)
|
||||
src_data.ratio *= settings->slowmotion_ratio;
|
||||
|
||||
performance_counter_init(resampler_proc, "resampler_proc");
|
||||
performance_counter_start_plus(is_perfcnt_enable, resampler_proc);
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
src_data.ratio *= settings->floats.slowmotion_ratio;
|
||||
}
|
||||
|
||||
audio_driver_resampler->process(audio_driver_resampler_data, &src_data);
|
||||
performance_counter_stop_plus(is_perfcnt_enable, resampler_proc);
|
||||
|
||||
output_data = audio_driver_output_samples_buf;
|
||||
output_frames = (unsigned)src_data.output_frames;
|
||||
if (audio_mixer_active)
|
||||
audio_mixer_mix(audio_driver_output_samples_buf, src_data.output_frames);
|
||||
|
||||
if (!audio_driver_use_float)
|
||||
output_data = audio_driver_output_samples_buf;
|
||||
output_frames = (unsigned)src_data.output_frames;
|
||||
|
||||
if (audio_driver_use_float)
|
||||
output_frames *= sizeof(float);
|
||||
else
|
||||
{
|
||||
static struct retro_perf_counter audio_convert_float = {0};
|
||||
|
||||
performance_counter_init(audio_convert_float, "audio_convert_float");
|
||||
performance_counter_start_plus(is_perfcnt_enable, audio_convert_float);
|
||||
convert_float_to_s16(audio_driver_output_samples_conv_buf,
|
||||
(const float*)output_data, output_frames * 2);
|
||||
performance_counter_stop_plus(is_perfcnt_enable, audio_convert_float);
|
||||
|
||||
output_data = audio_driver_output_samples_conv_buf;
|
||||
output_size = sizeof(int16_t);
|
||||
output_data = audio_driver_output_samples_conv_buf;
|
||||
output_frames *= sizeof(int16_t);
|
||||
}
|
||||
|
||||
if (current_audio->write(audio_driver_context_audio_data,
|
||||
output_data, output_frames * output_size * 2,
|
||||
is_perfcnt_enable) < 0)
|
||||
output_data, output_frames * 2) < 0)
|
||||
{
|
||||
audio_driver_active = false;
|
||||
return false;
|
||||
@@ -768,22 +777,22 @@ void audio_driver_monitor_adjust_system_rates(void)
|
||||
{
|
||||
float timing_skew;
|
||||
settings_t *settings = config_get_ptr();
|
||||
const struct retro_system_timing *info = NULL;
|
||||
struct retro_system_av_info *av_info = video_viewport_get_system_av_info();
|
||||
float video_refresh_rate = settings->floats.video_refresh_rate;
|
||||
float max_timing_skew = settings->floats.audio_max_timing_skew;
|
||||
const struct retro_system_timing *info = av_info ?
|
||||
(const struct retro_system_timing*)&av_info->timing : NULL;
|
||||
|
||||
if (av_info)
|
||||
info = (const struct retro_system_timing*)&av_info->timing;
|
||||
|
||||
if (!info || info->sample_rate <= 0.0)
|
||||
return;
|
||||
|
||||
timing_skew = fabs(1.0f - info->fps / settings->video.refresh_rate);
|
||||
timing_skew = fabs(1.0f - info->fps / video_refresh_rate);
|
||||
audio_driver_input = info->sample_rate;
|
||||
|
||||
if (timing_skew <= settings->audio.max_timing_skew)
|
||||
audio_driver_input *= (settings->video.refresh_rate / info->fps);
|
||||
if (timing_skew <= max_timing_skew)
|
||||
audio_driver_input *= (video_refresh_rate / info->fps);
|
||||
|
||||
RARCH_LOG("Set audio input rate to: %.2f Hz.\n",
|
||||
RARCH_LOG("[Audio]: Set audio input rate to: %.2f Hz.\n",
|
||||
audio_driver_input);
|
||||
}
|
||||
|
||||
@@ -813,7 +822,7 @@ bool audio_driver_find_driver(void)
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
drv.label = "audio_driver";
|
||||
drv.s = settings->audio.driver;
|
||||
drv.s = settings->arrays.audio_driver;
|
||||
|
||||
driver_ctl(RARCH_DRIVER_CTL_FIND_INDEX, &drv);
|
||||
|
||||
@@ -825,7 +834,7 @@ bool audio_driver_find_driver(void)
|
||||
{
|
||||
unsigned d;
|
||||
RARCH_ERR("Couldn't find any audio driver named \"%s\"\n",
|
||||
settings->audio.driver);
|
||||
settings->arrays.audio_driver);
|
||||
RARCH_LOG_OUTPUT("Available audio drivers are:\n");
|
||||
for (d = 0; audio_driver_find_handle(d); d++)
|
||||
RARCH_LOG_OUTPUT("\t%s\n", audio_driver_find_ident(d));
|
||||
@@ -885,9 +894,188 @@ bool audio_driver_get_devices_list(void **data)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool audio_driver_mixer_extension_supported(const char *ext)
|
||||
{
|
||||
union string_list_elem_attr attr;
|
||||
unsigned i;
|
||||
bool ret = false;
|
||||
struct string_list *str_list = string_list_new();
|
||||
|
||||
attr.i = 0;
|
||||
|
||||
#ifdef HAVE_STB_VORBIS
|
||||
string_list_append(str_list, "ogg", attr);
|
||||
#endif
|
||||
string_list_append(str_list, "wav", attr);
|
||||
|
||||
for (i = 0; i < str_list->size; i++)
|
||||
{
|
||||
const char *str_ext = str_list->elems[i].data;
|
||||
if (string_is_equal_noncase(str_ext, ext))
|
||||
{
|
||||
ret = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
string_list_free(str_list);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int audio_mixer_find_index(audio_mixer_sound_t *sound)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < AUDIO_MIXER_MAX_STREAMS; i++)
|
||||
{
|
||||
audio_mixer_sound_t *handle = audio_mixer_streams[i].handle;
|
||||
if (handle == sound)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void audio_mixer_play_stop_cb(audio_mixer_sound_t *sound, unsigned reason)
|
||||
{
|
||||
int idx = audio_mixer_find_index(sound);
|
||||
|
||||
switch (reason)
|
||||
{
|
||||
case AUDIO_MIXER_SOUND_FINISHED:
|
||||
audio_mixer_destroy(sound);
|
||||
|
||||
if (audio_mixer_streams[idx].buf != NULL)
|
||||
free(audio_mixer_streams[idx].buf);
|
||||
audio_mixer_streams[idx].state = AUDIO_STREAM_STATE_NONE;
|
||||
audio_mixer_streams[idx].volume = 0.0f;
|
||||
audio_mixer_streams[idx].buf = NULL;
|
||||
audio_mixer_streams[idx].stop_cb = NULL;
|
||||
audio_mixer_streams[idx].handle = NULL;
|
||||
audio_mixer_streams[idx].voice = NULL;
|
||||
audio_mixer_current_max_idx--;
|
||||
break;
|
||||
case AUDIO_MIXER_SOUND_STOPPED:
|
||||
break;
|
||||
case AUDIO_MIXER_SOUND_REPEATED:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool audio_driver_mixer_add_stream(audio_mixer_stream_params_t *params)
|
||||
{
|
||||
audio_mixer_voice_t *voice = NULL;
|
||||
audio_mixer_sound_t *handle = NULL;
|
||||
audio_mixer_stop_cb_t stop_cb = audio_mixer_play_stop_cb;
|
||||
bool looped = false;
|
||||
void *buf = NULL;
|
||||
|
||||
if (audio_mixer_current_max_idx >= AUDIO_MIXER_MAX_STREAMS)
|
||||
return false;
|
||||
|
||||
if (params->state == AUDIO_STREAM_STATE_NONE)
|
||||
return false;
|
||||
|
||||
buf = malloc(params->bufsize);
|
||||
|
||||
if (!buf)
|
||||
return false;
|
||||
|
||||
memcpy(buf, params->buf, params->bufsize);
|
||||
|
||||
switch (params->type)
|
||||
{
|
||||
case AUDIO_MIXER_TYPE_WAV:
|
||||
handle = audio_mixer_load_wav(buf, params->bufsize);
|
||||
break;
|
||||
case AUDIO_MIXER_TYPE_OGG:
|
||||
handle = audio_mixer_load_ogg(buf, params->bufsize);
|
||||
break;
|
||||
case AUDIO_MIXER_TYPE_NONE:
|
||||
free(buf);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!handle)
|
||||
{
|
||||
free(buf);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (params->state == AUDIO_STREAM_STATE_PLAYING)
|
||||
{
|
||||
voice = audio_mixer_play(handle, looped, params->volume, stop_cb);
|
||||
audio_set_bool(AUDIO_ACTION_MIXER, true);
|
||||
}
|
||||
else if (params->state == AUDIO_STREAM_STATE_PLAYING_LOOPED)
|
||||
{
|
||||
looped = true;
|
||||
voice = audio_mixer_play(handle, looped, params->volume, stop_cb);
|
||||
audio_set_bool(AUDIO_ACTION_MIXER, true);
|
||||
}
|
||||
|
||||
audio_mixer_streams[audio_mixer_current_max_idx].buf = buf;
|
||||
audio_mixer_streams[audio_mixer_current_max_idx].handle = handle;
|
||||
audio_mixer_streams[audio_mixer_current_max_idx].voice = voice;
|
||||
audio_mixer_streams[audio_mixer_current_max_idx].state = params->state;
|
||||
audio_mixer_streams[audio_mixer_current_max_idx].volume = params->volume;
|
||||
audio_mixer_streams[audio_mixer_current_max_idx].stop_cb = stop_cb;
|
||||
|
||||
audio_mixer_current_max_idx++;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void audio_driver_mixer_remove_stream(unsigned i)
|
||||
{
|
||||
audio_mixer_sound_t *handle = audio_mixer_streams[i].handle;
|
||||
audio_mixer_voice_t *voice = audio_mixer_streams[i].voice;
|
||||
|
||||
switch (audio_mixer_streams[i].state)
|
||||
{
|
||||
case AUDIO_STREAM_STATE_PLAYING:
|
||||
if (voice)
|
||||
audio_mixer_stop(voice);
|
||||
if (handle)
|
||||
audio_mixer_destroy(handle);
|
||||
break;
|
||||
case AUDIO_STREAM_STATE_PLAYING_LOOPED:
|
||||
if (voice)
|
||||
audio_mixer_stop(voice);
|
||||
if (handle)
|
||||
audio_mixer_destroy(handle);
|
||||
break;
|
||||
case AUDIO_STREAM_STATE_STOPPED:
|
||||
if (handle)
|
||||
audio_mixer_destroy(handle);
|
||||
break;
|
||||
case AUDIO_STREAM_STATE_NONE:
|
||||
break;
|
||||
}
|
||||
|
||||
audio_mixer_streams[i].state = AUDIO_STREAM_STATE_NONE;
|
||||
audio_mixer_streams[i].volume = 0.0f;
|
||||
audio_mixer_streams[i].stop_cb = NULL;
|
||||
audio_mixer_streams[i].handle = NULL;
|
||||
audio_mixer_streams[i].voice = NULL;
|
||||
}
|
||||
|
||||
static void audio_driver_mixer_deinit(void)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
audio_set_bool(AUDIO_ACTION_MIXER, false);
|
||||
|
||||
for (i = 0; i < AUDIO_MIXER_MAX_STREAMS; i++)
|
||||
audio_driver_mixer_remove_stream(i);
|
||||
|
||||
audio_mixer_current_max_idx = 0;
|
||||
audio_mixer_done();
|
||||
}
|
||||
|
||||
bool audio_driver_deinit(void)
|
||||
{
|
||||
audio_driver_mixer_deinit();
|
||||
audio_driver_free_devices_list();
|
||||
if (!audio_driver_deinit_internal())
|
||||
return false;
|
||||
@@ -927,7 +1115,7 @@ bool audio_driver_disable_callback(void)
|
||||
void audio_driver_monitor_set_rate(void)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
double new_src_ratio = (double)settings->audio.out_rate /
|
||||
double new_src_ratio = (double)settings->uints.audio_out_rate /
|
||||
audio_driver_input;
|
||||
|
||||
audio_source_ratio_original = new_src_ratio;
|
||||
@@ -952,15 +1140,15 @@ bool audio_driver_has_callback(void)
|
||||
|
||||
bool audio_driver_toggle_mute(void)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool new_mute_state = !audio_driver_mute_enable;
|
||||
if (!audio_driver_context_audio_data)
|
||||
return false;
|
||||
if (!audio_driver_active)
|
||||
return false;
|
||||
|
||||
settings->audio.mute_enable = !settings->audio.mute_enable;
|
||||
audio_driver_mute_enable = new_mute_state;
|
||||
|
||||
if (settings->audio.mute_enable)
|
||||
if (new_mute_state)
|
||||
command_event(CMD_EVENT_AUDIO_STOP, NULL);
|
||||
else if (!command_event(CMD_EVENT_AUDIO_START, NULL))
|
||||
{
|
||||
@@ -970,19 +1158,40 @@ bool audio_driver_toggle_mute(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
static INLINE bool audio_driver_alive(void)
|
||||
{
|
||||
if ( current_audio
|
||||
&& current_audio->alive
|
||||
&& audio_driver_context_audio_data)
|
||||
return current_audio->alive(audio_driver_context_audio_data);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool audio_driver_start(bool is_shutdown)
|
||||
{
|
||||
if (!current_audio || !current_audio->start
|
||||
|| !audio_driver_context_audio_data)
|
||||
return false;
|
||||
return current_audio->start(audio_driver_context_audio_data, is_shutdown);
|
||||
goto error;
|
||||
if (!current_audio->start(audio_driver_context_audio_data, is_shutdown))
|
||||
goto error;
|
||||
|
||||
return true;
|
||||
|
||||
error:
|
||||
RARCH_ERR("%s\n",
|
||||
msg_hash_to_str(MSG_FAILED_TO_START_AUDIO_DRIVER));
|
||||
audio_driver_active = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool audio_driver_stop(void)
|
||||
{
|
||||
if (!current_audio || !current_audio->stop
|
||||
|| !audio_driver_context_audio_data)
|
||||
return false;
|
||||
if (!audio_driver_alive())
|
||||
return false;
|
||||
return current_audio->stop(audio_driver_context_audio_data);
|
||||
}
|
||||
|
||||
@@ -992,15 +1201,6 @@ void audio_driver_unset_callback(void)
|
||||
audio_callback.set_state = NULL;
|
||||
}
|
||||
|
||||
bool audio_driver_alive(void)
|
||||
{
|
||||
if ( current_audio
|
||||
&& current_audio->alive
|
||||
&& audio_driver_context_audio_data)
|
||||
return current_audio->alive(audio_driver_context_audio_data);
|
||||
return false;
|
||||
}
|
||||
|
||||
void audio_driver_frame_is_reverse(void)
|
||||
{
|
||||
/* We just rewound. Flush rewind audio buffer. */
|
||||
@@ -1034,14 +1234,63 @@ void audio_driver_set_active(void)
|
||||
audio_driver_active = true;
|
||||
}
|
||||
|
||||
void audio_driver_unset_active(void)
|
||||
{
|
||||
audio_driver_active = false;
|
||||
}
|
||||
|
||||
void audio_driver_destroy(void)
|
||||
{
|
||||
audio_driver_active = false;
|
||||
audio_driver_data_own = false;
|
||||
current_audio = NULL;
|
||||
}
|
||||
|
||||
void audio_set_bool(enum audio_action action, bool val)
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case AUDIO_ACTION_MIXER:
|
||||
audio_mixer_active = val;
|
||||
break;
|
||||
case AUDIO_ACTION_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void audio_set_float(enum audio_action action, float val)
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case AUDIO_ACTION_RATE_CONTROL_DELTA:
|
||||
audio_driver_rate_control_delta = val;
|
||||
break;
|
||||
case AUDIO_ACTION_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
float *audio_get_float_ptr(enum audio_action action)
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case AUDIO_ACTION_RATE_CONTROL_DELTA:
|
||||
return &audio_driver_rate_control_delta;
|
||||
case AUDIO_ACTION_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool *audio_get_bool_ptr(enum audio_action action)
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case AUDIO_ACTION_MUTE_ENABLE:
|
||||
return &audio_driver_mute_enable;
|
||||
case AUDIO_ACTION_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
+42
-5
@@ -22,6 +22,7 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <boolean.h>
|
||||
#include <audio/audio_mixer.h>
|
||||
#include <retro_common_api.h>
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
@@ -33,6 +34,14 @@ RETRO_BEGIN_DECLS
|
||||
|
||||
#define AUDIO_MAX_RATIO 16
|
||||
|
||||
enum audio_action
|
||||
{
|
||||
AUDIO_ACTION_NONE = 0,
|
||||
AUDIO_ACTION_RATE_CONTROL_DELTA,
|
||||
AUDIO_ACTION_MUTE_ENABLE,
|
||||
AUDIO_ACTION_MIXER
|
||||
};
|
||||
|
||||
typedef struct audio_driver
|
||||
{
|
||||
/* Creates and initializes handle to audio driver.
|
||||
@@ -67,8 +76,7 @@ typedef struct audio_driver
|
||||
* Unless said otherwise with set_nonblock_state(), all writes
|
||||
* are blocking, and it should block till it has written all frames.
|
||||
*/
|
||||
ssize_t (*write)(void *data, const void *buf, size_t size,
|
||||
bool is_perfcnt_enable);
|
||||
ssize_t (*write)(void *data, const void *buf, size_t size);
|
||||
|
||||
/* Temporarily pauses the audio driver. */
|
||||
bool (*stop)(void *data);
|
||||
@@ -116,6 +124,24 @@ typedef struct audio_driver
|
||||
size_t (*buffer_size)(void *data);
|
||||
} audio_driver_t;
|
||||
|
||||
enum audio_mixer_state
|
||||
{
|
||||
AUDIO_STREAM_STATE_NONE = 0,
|
||||
AUDIO_STREAM_STATE_STOPPED,
|
||||
AUDIO_STREAM_STATE_PLAYING,
|
||||
AUDIO_STREAM_STATE_PLAYING_LOOPED
|
||||
};
|
||||
|
||||
typedef struct audio_mixer_stream_params
|
||||
{
|
||||
float volume;
|
||||
enum audio_mixer_type type;
|
||||
enum audio_mixer_state state;
|
||||
void *buf;
|
||||
size_t bufsize;
|
||||
audio_mixer_stop_cb_t cb;
|
||||
} audio_mixer_stream_params_t;
|
||||
|
||||
void audio_driver_destroy_data(void);
|
||||
|
||||
void audio_driver_set_own_driver(void);
|
||||
@@ -124,8 +150,6 @@ void audio_driver_unset_own_driver(void);
|
||||
|
||||
void audio_driver_set_active(void);
|
||||
|
||||
void audio_driver_unset_active(void);
|
||||
|
||||
void audio_driver_destroy(void);
|
||||
|
||||
void audio_driver_deinit_resampler(void);
|
||||
@@ -175,6 +199,8 @@ void audio_driver_sample_rewind(int16_t left, int16_t right);
|
||||
|
||||
size_t audio_driver_sample_batch_rewind(const int16_t *data, size_t frames);
|
||||
|
||||
bool audio_driver_mixer_extension_supported(const char *ext);
|
||||
|
||||
void audio_driver_set_volume_gain(float gain);
|
||||
|
||||
void audio_driver_dsp_filter_free(void);
|
||||
@@ -212,12 +238,22 @@ void audio_driver_unset_callback(void);
|
||||
|
||||
void audio_driver_frame_is_reverse(void);
|
||||
|
||||
bool audio_driver_alive(void);
|
||||
void audio_set_float(enum audio_action action, float val);
|
||||
|
||||
void audio_set_bool(enum audio_action action, bool val);
|
||||
|
||||
void audio_unset_bool(enum audio_action action, bool val);
|
||||
|
||||
float *audio_get_float_ptr(enum audio_action action);
|
||||
|
||||
bool *audio_get_bool_ptr(enum audio_action action);
|
||||
|
||||
bool audio_driver_deinit(void);
|
||||
|
||||
bool audio_driver_init(void);
|
||||
|
||||
bool audio_driver_mixer_add_stream(audio_mixer_stream_params_t *params);
|
||||
|
||||
extern audio_driver_t audio_rsound;
|
||||
extern audio_driver_t audio_oss;
|
||||
extern audio_driver_t audio_alsa;
|
||||
@@ -230,6 +266,7 @@ extern audio_driver_t audio_sdl;
|
||||
extern audio_driver_t audio_xa;
|
||||
extern audio_driver_t audio_pulse;
|
||||
extern audio_driver_t audio_dsound;
|
||||
extern audio_driver_t audio_wasapi;
|
||||
extern audio_driver_t audio_coreaudio;
|
||||
extern audio_driver_t audio_xenon360;
|
||||
extern audio_driver_t audio_ps3;
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2017 - Andre Leiradella
|
||||
*
|
||||
* RetroArch 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 Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch 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 RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __AUDIO_MIXER__H
|
||||
#define __AUDIO_MIXER__H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include <boolean.h>
|
||||
#include <retro_common_api.h>
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
typedef struct audio_mixer_sound_t audio_mixer_sound_t;
|
||||
typedef struct audio_mixer_voice_t audio_mixer_voice_t;
|
||||
|
||||
typedef void (*audio_mixer_stop_cb_t)(audio_mixer_voice_t* voice, unsigned reason);
|
||||
|
||||
/* Reasons passed to the stop callback. */
|
||||
#define AUDIO_MIXER_SOUND_FINISHED 0
|
||||
#define AUDIO_MIXER_SOUND_STOPPED 1
|
||||
#define AUDIO_MIXER_SOUND_REPEATED 2
|
||||
|
||||
void audio_mixer_init(unsigned rate);
|
||||
void audio_mixer_done(void);
|
||||
|
||||
audio_mixer_sound_t* audio_mixer_load_wav(const char* path);
|
||||
audio_mixer_sound_t* audio_mixer_load_ogg(const char* path);
|
||||
|
||||
void audio_mixer_destroy(audio_mixer_sound_t* sound);
|
||||
|
||||
audio_mixer_voice_t* audio_mixer_play(audio_mixer_sound_t* sound, bool repeat, float volume, audio_mixer_stop_cb_t stop_cb);
|
||||
void audio_mixer_stop(audio_mixer_voice_t* voice);
|
||||
|
||||
void audio_mixer_mix(float* buffer, size_t num_frames);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
@@ -228,8 +228,7 @@ static bool audio_thread_use_float(void *data)
|
||||
return thr->use_float;
|
||||
}
|
||||
|
||||
static ssize_t audio_thread_write(void *data, const void *buf, size_t size,
|
||||
bool is_perfcnt_enable)
|
||||
static ssize_t audio_thread_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
ssize_t ret;
|
||||
audio_thread_t *thr = (audio_thread_t*)data;
|
||||
@@ -237,8 +236,7 @@ static ssize_t audio_thread_write(void *data, const void *buf, size_t size,
|
||||
if (!thr)
|
||||
return 0;
|
||||
|
||||
ret = thr->driver->write(thr->driver_data, buf, size,
|
||||
is_perfcnt_enable);
|
||||
ret = thr->driver->write(thr->driver_data, buf, size);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
+71
-65
@@ -29,6 +29,7 @@ typedef struct alsa
|
||||
snd_pcm_t *pcm;
|
||||
size_t buffer_size;
|
||||
bool nonblock;
|
||||
unsigned int frame_bits;
|
||||
bool has_float;
|
||||
bool can_pause;
|
||||
bool is_paused;
|
||||
@@ -46,11 +47,11 @@ static bool find_float_format(snd_pcm_t *pcm, void *data)
|
||||
|
||||
if (snd_pcm_hw_params_test_format(pcm, params, SND_PCM_FORMAT_FLOAT) == 0)
|
||||
{
|
||||
RARCH_LOG("ALSA: Using floating point format.\n");
|
||||
RARCH_LOG("[ALSA]: Using floating point format.\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
RARCH_LOG("ALSA: Using signed 16-bit format.\n");
|
||||
RARCH_LOG("[ALSA]: Using signed 16-bit format.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -92,6 +93,9 @@ static void *alsa_init(const char *device, unsigned rate, unsigned latency,
|
||||
alsa->pcm, params, SND_PCM_ACCESS_RW_INTERLEAVED) < 0)
|
||||
goto error;
|
||||
|
||||
/* channels hardcoded to 2 for now */
|
||||
alsa->frame_bits = snd_pcm_format_physical_width(format) * 2;
|
||||
|
||||
if (snd_pcm_hw_params_set_format(alsa->pcm, params, format) < 0)
|
||||
goto error;
|
||||
|
||||
@@ -122,17 +126,17 @@ static void *alsa_init(const char *device, unsigned rate, unsigned latency,
|
||||
if (snd_pcm_hw_params_get_period_size(params, &buffer_size, NULL))
|
||||
snd_pcm_hw_params_get_period_size_min(params, &buffer_size, NULL);
|
||||
|
||||
RARCH_LOG("ALSA: Period size: %d frames\n", (int)buffer_size);
|
||||
RARCH_LOG("[ALSA]: Period size: %d frames\n", (int)buffer_size);
|
||||
|
||||
if (snd_pcm_hw_params_get_buffer_size(params, &buffer_size))
|
||||
snd_pcm_hw_params_get_buffer_size_max(params, &buffer_size);
|
||||
|
||||
RARCH_LOG("ALSA: Buffer size: %d frames\n", (int)buffer_size);
|
||||
RARCH_LOG("[ALSA]: Buffer size: %d frames\n", (int)buffer_size);
|
||||
|
||||
alsa->buffer_size = snd_pcm_frames_to_bytes(alsa->pcm, buffer_size);
|
||||
alsa->can_pause = snd_pcm_hw_params_can_pause(params);
|
||||
|
||||
RARCH_LOG("ALSA: Can pause: %s.\n", alsa->can_pause ? "yes" : "no");
|
||||
RARCH_LOG("[ALSA]: Can pause: %s.\n", alsa->can_pause ? "yes" : "no");
|
||||
|
||||
if (snd_pcm_sw_params_malloc(&sw_params) < 0)
|
||||
goto error;
|
||||
@@ -153,7 +157,7 @@ static void *alsa_init(const char *device, unsigned rate, unsigned latency,
|
||||
return alsa;
|
||||
|
||||
error:
|
||||
RARCH_ERR("ALSA: Failed to initialize...\n");
|
||||
RARCH_ERR("[ALSA]: Failed to initialize...\n");
|
||||
if (params)
|
||||
snd_pcm_hw_params_free(params);
|
||||
|
||||
@@ -173,74 +177,82 @@ error:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static ssize_t alsa_write(void *data, const void *buf_, size_t size_,
|
||||
bool is_perfcnt_enable)
|
||||
#define BYTES_TO_FRAMES(bytes, frame_bits) ((bytes) * 8 / frame_bits)
|
||||
#define FRAMES_TO_BYTES(frames, frame_bits) ((frames) * frame_bits / 8)
|
||||
|
||||
static ssize_t alsa_write(void *data, const void *buf_, size_t size_)
|
||||
{
|
||||
alsa_t *alsa = (alsa_t*)data;
|
||||
const uint8_t *buf = (const uint8_t*)buf_;
|
||||
bool eagain_retry = true;
|
||||
snd_pcm_sframes_t written = 0;
|
||||
snd_pcm_sframes_t size = snd_pcm_bytes_to_frames(alsa->pcm, size_);
|
||||
snd_pcm_sframes_t size = BYTES_TO_FRAMES(size_, alsa->frame_bits);
|
||||
size_t frames_size = alsa->has_float ? sizeof(float) : sizeof(int16_t);
|
||||
|
||||
while (size)
|
||||
if (alsa->nonblock)
|
||||
{
|
||||
snd_pcm_sframes_t frames;
|
||||
|
||||
if (!alsa->nonblock)
|
||||
while (size)
|
||||
{
|
||||
snd_pcm_sframes_t frames = snd_pcm_writei(alsa->pcm, buf, size);
|
||||
|
||||
if (frames == -EPIPE || frames == -EINTR || frames == -ESTRPIPE)
|
||||
{
|
||||
if (snd_pcm_recover(alsa->pcm, frames, 1) < 0)
|
||||
return -1;
|
||||
|
||||
break;
|
||||
}
|
||||
else if (frames == -EAGAIN)
|
||||
break;
|
||||
else if (frames < 0)
|
||||
return -1;
|
||||
|
||||
written += frames;
|
||||
buf += (frames << 1) * frames_size;
|
||||
size -= frames;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bool eagain_retry = true;
|
||||
|
||||
while (size)
|
||||
{
|
||||
snd_pcm_sframes_t frames;
|
||||
int rc = snd_pcm_wait(alsa->pcm, -1);
|
||||
|
||||
if (rc == -EPIPE || rc == -ESTRPIPE || rc == -EINTR)
|
||||
{
|
||||
if (snd_pcm_recover(alsa->pcm, rc, 1) < 0)
|
||||
{
|
||||
RARCH_ERR("[ALSA]: (#1) Failed to recover from error (%s)\n",
|
||||
snd_strerror(rc));
|
||||
return -1;
|
||||
continue;
|
||||
}
|
||||
|
||||
frames = snd_pcm_writei(alsa->pcm, buf, size);
|
||||
|
||||
if (frames == -EPIPE || frames == -EINTR || frames == -ESTRPIPE)
|
||||
{
|
||||
if (snd_pcm_recover(alsa->pcm, frames, 1) < 0)
|
||||
return -1;
|
||||
|
||||
break;
|
||||
}
|
||||
else if (frames == -EAGAIN)
|
||||
{
|
||||
/* Definitely not supposed to happen. */
|
||||
if (eagain_retry)
|
||||
{
|
||||
eagain_retry = false;
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
frames = snd_pcm_writei(alsa->pcm, buf, size);
|
||||
|
||||
if (frames == -EPIPE || frames == -EINTR || frames == -ESTRPIPE)
|
||||
{
|
||||
if (snd_pcm_recover(alsa->pcm, frames, 1) < 0)
|
||||
{
|
||||
RARCH_ERR("[ALSA]: (#2) Failed to recover from error (%s)\n",
|
||||
snd_strerror(frames));
|
||||
else if (frames < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
break;
|
||||
written += frames;
|
||||
buf += (frames << 1) * frames_size;
|
||||
size -= frames;
|
||||
}
|
||||
else if (frames == -EAGAIN && !alsa->nonblock)
|
||||
{
|
||||
/* Definitely not supposed to happen. */
|
||||
RARCH_WARN("[ALSA]: poll() was signaled, but EAGAIN returned from write.\n"
|
||||
"Your ALSA driver might be subtly broken.\n");
|
||||
|
||||
if (eagain_retry)
|
||||
{
|
||||
eagain_retry = false;
|
||||
continue;
|
||||
}
|
||||
return written;
|
||||
}
|
||||
else if (frames == -EAGAIN) /* Expected if we're running nonblock. */
|
||||
return written;
|
||||
else if (frames < 0)
|
||||
{
|
||||
RARCH_ERR("[ALSA]: Unknown error occurred (%s).\n",
|
||||
snd_strerror(frames));
|
||||
return -1;
|
||||
}
|
||||
|
||||
written += frames;
|
||||
buf += (frames << 1) *
|
||||
(alsa->has_float ? sizeof(float) : sizeof(int16_t));
|
||||
size -= frames;
|
||||
}
|
||||
|
||||
return written;
|
||||
@@ -318,19 +330,13 @@ static void alsa_free(void *data)
|
||||
|
||||
static size_t alsa_write_avail(void *data)
|
||||
{
|
||||
alsa_t *alsa = (alsa_t*)data;
|
||||
alsa_t *alsa = (alsa_t*)data;
|
||||
snd_pcm_sframes_t avail = snd_pcm_avail(alsa->pcm);
|
||||
|
||||
if (avail < 0)
|
||||
{
|
||||
#if 0
|
||||
RARCH_WARN("[ALSA]: snd_pcm_avail() failed: %s\n",
|
||||
snd_strerror(avail));
|
||||
#endif
|
||||
return alsa->buffer_size;
|
||||
}
|
||||
|
||||
return snd_pcm_frames_to_bytes(alsa->pcm, avail);
|
||||
return FRAMES_TO_BYTES(avail, alsa->frame_bits);
|
||||
}
|
||||
|
||||
static size_t alsa_buffer_size(void *data)
|
||||
@@ -364,7 +370,7 @@ static void *alsa_device_list_new(void *data)
|
||||
/* description of device IOID - input / output identifcation
|
||||
* ("Input" or "Output"), NULL means both) */
|
||||
|
||||
if (!io || string_is_equal(io,"Output"))
|
||||
if (!io || (string_is_equal_fast(io, "Output", 6)))
|
||||
string_list_append(s, name, attr);
|
||||
|
||||
if (name)
|
||||
|
||||
@@ -219,8 +219,7 @@ static int check_pcm_status(void *data, int channel_type)
|
||||
}
|
||||
|
||||
|
||||
static ssize_t alsa_qsa_write(void *data, const void *buf, size_t size,
|
||||
bool is_perfcnt_enable)
|
||||
static ssize_t alsa_qsa_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
alsa_t *alsa = (alsa_t*)data;
|
||||
snd_pcm_sframes_t written = 0;
|
||||
|
||||
@@ -243,8 +243,7 @@ error:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static ssize_t alsa_thread_write(void *data, const void *buf, size_t size,
|
||||
bool is_perfcnt_enable)
|
||||
static ssize_t alsa_thread_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
alsa_thread_t *alsa = (alsa_thread_t*)data;
|
||||
|
||||
@@ -371,7 +370,7 @@ static void *alsa_device_list_new(void *data)
|
||||
/* description of device IOID - input / output identifcation
|
||||
* ("Input" or "Output"), NULL means both) */
|
||||
|
||||
if (!io || string_is_equal(io,"Output"))
|
||||
if (!io || (string_is_equal_fast(io,"Output", 6)))
|
||||
string_list_append(s, name, attr);
|
||||
|
||||
if (name)
|
||||
|
||||
@@ -94,13 +94,11 @@ static OSStatus audio_write_cb(void *userdata,
|
||||
(void)bus_number;
|
||||
(void)number_frames;
|
||||
|
||||
if (!io_data)
|
||||
return noErr;
|
||||
if (io_data->mNumberBuffers != 1)
|
||||
if (!io_data || io_data->mNumberBuffers != 1)
|
||||
return noErr;
|
||||
|
||||
write_avail = io_data->mBuffers[0].mDataByteSize;
|
||||
outbuf = io_data->mBuffers[0].mData;
|
||||
outbuf = io_data->mBuffers[0].mData;
|
||||
|
||||
slock_lock(dev->lock);
|
||||
|
||||
@@ -261,7 +259,7 @@ static void *coreaudio_init(const char *device,
|
||||
choose_output_device(dev, device);
|
||||
#endif
|
||||
|
||||
dev->dev_alive = true;
|
||||
dev->dev_alive = true;
|
||||
|
||||
/* Set audio format */
|
||||
stream_desc.mSampleRate = rate;
|
||||
@@ -317,11 +315,11 @@ static void *coreaudio_init(const char *device,
|
||||
if (AudioUnitInitialize(dev->dev) != noErr)
|
||||
goto error;
|
||||
|
||||
fifo_size = (latency * (*new_rate)) / 1000;
|
||||
fifo_size *= 2 * sizeof(float);
|
||||
dev->buffer_size = fifo_size;
|
||||
fifo_size = (latency * (*new_rate)) / 1000;
|
||||
fifo_size *= 2 * sizeof(float);
|
||||
dev->buffer_size = fifo_size;
|
||||
|
||||
dev->buffer = fifo_new(fifo_size);
|
||||
dev->buffer = fifo_new(fifo_size);
|
||||
if (!dev->buffer)
|
||||
goto error;
|
||||
|
||||
@@ -339,8 +337,7 @@ error:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static ssize_t coreaudio_write(void *data, const void *buf_, size_t size,
|
||||
bool is_perfcnt_enable)
|
||||
static ssize_t coreaudio_write(void *data, const void *buf_, size_t size)
|
||||
{
|
||||
coreaudio_t *dev = (coreaudio_t*)data;
|
||||
const uint8_t *buf = (const uint8_t*)buf_;
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
|
||||
#include "../audio_driver.h"
|
||||
|
||||
#include "../../performance_counters.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bool nonblocking;
|
||||
@@ -163,13 +161,11 @@ static void ctr_csnd_audio_free(void *data)
|
||||
free(ctr);
|
||||
}
|
||||
|
||||
static ssize_t ctr_csnd_audio_write(void *data, const void *buf, size_t size,
|
||||
bool is_perfcnt_enable)
|
||||
static ssize_t ctr_csnd_audio_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
int i;
|
||||
uint32_t samples_played = 0;
|
||||
uint64_t current_tick = 0;
|
||||
static struct retro_perf_counter ctraudio_f = {0};
|
||||
const uint16_t *src = buf;
|
||||
ctr_csnd_audio_t *ctr = (ctr_csnd_audio_t*)data;
|
||||
|
||||
@@ -178,9 +174,6 @@ static ssize_t ctr_csnd_audio_write(void *data, const void *buf, size_t size,
|
||||
(void)samples_played;
|
||||
(void)current_tick;
|
||||
|
||||
performance_counter_init(ctraudio_f, "ctraudio_f");
|
||||
performance_counter_start_plus(is_perfcnt_enable, ctraudio_f);
|
||||
|
||||
ctr_csnd_audio_update_playpos(ctr);
|
||||
|
||||
if((((ctr->playpos - ctr->pos) & CTR_CSND_AUDIO_COUNT_MASK) < (CTR_CSND_AUDIO_COUNT >> 2)) ||
|
||||
@@ -211,8 +204,6 @@ static ssize_t ctr_csnd_audio_write(void *data, const void *buf, size_t size,
|
||||
GSPGPU_FlushDataCache(ctr->l, CTR_CSND_AUDIO_SIZE);
|
||||
GSPGPU_FlushDataCache(ctr->r, CTR_CSND_AUDIO_SIZE);
|
||||
|
||||
performance_counter_stop_plus(is_perfcnt_enable, ctraudio_f);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include <malloc.h>
|
||||
|
||||
#include "../audio_driver.h"
|
||||
#include "../../performance_counters.h"
|
||||
#include "../../ctr/ctr_debug.h"
|
||||
|
||||
typedef struct
|
||||
@@ -93,11 +92,9 @@ static void ctr_dsp_audio_free(void *data)
|
||||
ndspExit();
|
||||
}
|
||||
|
||||
static ssize_t ctr_dsp_audio_write(void *data, const void *buf, size_t size,
|
||||
bool is_perfcnt_enable)
|
||||
static ssize_t ctr_dsp_audio_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
u32 pos;
|
||||
static struct retro_perf_counter ctraudio_dsp_f = {0};
|
||||
ctr_dsp_audio_t * ctr = (ctr_dsp_audio_t*)data;
|
||||
uint32_t sample_pos = ndspChnGetSamplePos(ctr->channel);
|
||||
|
||||
@@ -117,9 +114,6 @@ static ssize_t ctr_dsp_audio_write(void *data, const void *buf, size_t size,
|
||||
}
|
||||
}
|
||||
|
||||
performance_counter_init(ctraudio_dsp_f, "ctraudio_dsp_f");
|
||||
performance_counter_start_plus(is_perfcnt_enable, ctraudio_dsp_f);
|
||||
|
||||
pos = ctr->pos << 2;
|
||||
|
||||
if((pos + size) > CTR_DSP_AUDIO_SIZE)
|
||||
@@ -141,8 +135,6 @@ static ssize_t ctr_dsp_audio_write(void *data, const void *buf, size_t size,
|
||||
ctr->pos += size >> 2;
|
||||
ctr->pos &= CTR_DSP_AUDIO_COUNT_MASK;
|
||||
|
||||
performance_counter_stop_plus(is_perfcnt_enable, ctraudio_dsp_f);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
@@ -426,8 +426,7 @@ static void dsound_set_nonblock_state(void *data, bool state)
|
||||
ds->nonblock = state;
|
||||
}
|
||||
|
||||
static ssize_t dsound_write(void *data, const void *buf_, size_t size,
|
||||
bool is_perfcnt_enable)
|
||||
static ssize_t dsound_write(void *data, const void *buf_, size_t size)
|
||||
{
|
||||
size_t written = 0;
|
||||
dsound_t *ds = (dsound_t*)data;
|
||||
|
||||
@@ -116,8 +116,7 @@ static INLINE void copy_swapped(uint32_t * restrict dst,
|
||||
}while(--size);
|
||||
}
|
||||
|
||||
static ssize_t gx_audio_write(void *data, const void *buf_, size_t size,
|
||||
bool is_perfcnt_enable)
|
||||
static ssize_t gx_audio_write(void *data, const void *buf_, size_t size)
|
||||
{
|
||||
size_t frames = size >> 2;
|
||||
const uint32_t *buf = buf_;
|
||||
|
||||
+13
-13
@@ -13,6 +13,7 @@
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -106,7 +107,7 @@ static int parse_ports(char **dest_ports, const char **jports)
|
||||
char *save = NULL;
|
||||
int parsed = 0;
|
||||
settings_t *settings = config_get_ptr();
|
||||
char *audio_device_cpy = strdup(settings->audio.device);
|
||||
char *audio_device_cpy = strdup(settings->arrays.audio_device);
|
||||
const char *con = strtok_r(audio_device_cpy, ",", &save);
|
||||
|
||||
if (con)
|
||||
@@ -136,12 +137,12 @@ static size_t find_buffersize(jack_t *jd, int latency, unsigned out_rate)
|
||||
jack_latency = range.max;
|
||||
}
|
||||
|
||||
RARCH_LOG("JACK: Jack latency is %d frames.\n", jack_latency);
|
||||
RARCH_LOG("[JACK]: Jack latency is %d frames.\n", jack_latency);
|
||||
|
||||
buffer_frames = frames - jack_latency;
|
||||
buffer_frames = frames - jack_latency;
|
||||
min_buffer_frames = jack_get_buffer_size(jd->client) * 2;
|
||||
|
||||
RARCH_LOG("JACK: Minimum buffer size is %d frames.\n", min_buffer_frames);
|
||||
RARCH_LOG("[JACK]: Minimum buffer size is %d frames.\n", min_buffer_frames);
|
||||
|
||||
if (buffer_frames < min_buffer_frames)
|
||||
buffer_frames = min_buffer_frames;
|
||||
@@ -181,27 +182,27 @@ static void *ja_init(const char *device, unsigned rate, unsigned latency,
|
||||
jd->ports[1] = jack_port_register(jd->client, "right", JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0);
|
||||
if (jd->ports[0] == NULL || jd->ports[1] == NULL)
|
||||
{
|
||||
RARCH_ERR("Failed to register ports.\n");
|
||||
RARCH_ERR("[JACK]: Failed to register ports.\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
jports = jack_get_ports(jd->client, NULL, NULL, JackPortIsPhysical | JackPortIsInput);
|
||||
if (jports == NULL)
|
||||
{
|
||||
RARCH_ERR("Failed to get ports.\n");
|
||||
RARCH_ERR("[JACK]: Failed to get ports.\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
bufsize = find_buffersize(jd, latency, *new_rate);
|
||||
bufsize = find_buffersize(jd, latency, *new_rate);
|
||||
jd->buffer_size = bufsize;
|
||||
|
||||
RARCH_LOG("JACK: Internal buffer size: %d frames.\n", (int)(bufsize / sizeof(jack_default_audio_sample_t)));
|
||||
RARCH_LOG("[JACK]: Internal buffer size: %d frames.\n", (int)(bufsize / sizeof(jack_default_audio_sample_t)));
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
jd->buffer[i] = jack_ringbuffer_create(bufsize);
|
||||
if (jd->buffer[i] == NULL)
|
||||
{
|
||||
RARCH_ERR("Failed to create buffers.\n");
|
||||
RARCH_ERR("[JACK]: Failed to create buffers.\n");
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
@@ -210,7 +211,7 @@ static void *ja_init(const char *device, unsigned rate, unsigned latency,
|
||||
|
||||
if (jack_activate(jd->client) < 0)
|
||||
{
|
||||
RARCH_ERR("Failed to activate Jack...\n");
|
||||
RARCH_ERR("[JACK]: Failed to activate Jack...\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -218,7 +219,7 @@ static void *ja_init(const char *device, unsigned rate, unsigned latency,
|
||||
{
|
||||
if (jack_connect(jd->client, jack_port_name(jd->ports[i]), dest_ports[i]))
|
||||
{
|
||||
RARCH_ERR("Failed to connect to Jack port.\n");
|
||||
RARCH_ERR("[JACK]: Failed to connect to Jack port.\n");
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
@@ -292,8 +293,7 @@ static size_t write_buffer(jack_t *jd, const float *buf, size_t size)
|
||||
return written * sizeof(float) * 2;
|
||||
}
|
||||
|
||||
static ssize_t ja_write(void *data, const void *buf, size_t size,
|
||||
bool is_perfcnt_enable)
|
||||
static ssize_t ja_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
jack_t *jd = (jack_t*)data;
|
||||
|
||||
|
||||
@@ -35,8 +35,7 @@ static void null_audio_free(void *data)
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static ssize_t null_audio_write(void *data, const void *buf, size_t size,
|
||||
bool is_perfcnt_enable)
|
||||
static ssize_t null_audio_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
(void)data;
|
||||
(void)buf;
|
||||
|
||||
@@ -173,8 +173,7 @@ static size_t al_fill_internal_buf(al_t *al, const void *buf, size_t size)
|
||||
return read_size;
|
||||
}
|
||||
|
||||
static ssize_t al_write(void *data, const void *buf_, size_t size,
|
||||
bool is_perfcnt_enable)
|
||||
static ssize_t al_write(void *data, const void *buf_, size_t size)
|
||||
{
|
||||
al_t *al = (al_t*)data;
|
||||
const uint8_t *buf = (const uint8_t*)buf_;
|
||||
|
||||
@@ -116,7 +116,7 @@ static void *sl_init(const char *device, unsigned rate, unsigned latency,
|
||||
if (!sl)
|
||||
goto error;
|
||||
|
||||
RARCH_LOG("[SLES]: Requested audio latency: %u ms.", latency);
|
||||
RARCH_LOG("[OpenSL]: Requested audio latency: %u ms.", latency);
|
||||
|
||||
GOTO_IF_FAIL(slCreateEngine(&sl->engine_object, 0, NULL, 0, NULL, NULL));
|
||||
GOTO_IF_FAIL(SLObjectItf_Realize(sl->engine_object, SL_BOOLEAN_FALSE));
|
||||
@@ -144,7 +144,7 @@ static void *sl_init(const char *device, unsigned rate, unsigned latency,
|
||||
for (i = 0; i < sl->buf_count; i++)
|
||||
sl->buffer[i] = sl->buffer_chunk + i * sl->buf_size;
|
||||
|
||||
RARCH_LOG("[SLES]: Setting audio latency: Block size = %u, Blocks = %u, Total = %u ...\n",
|
||||
RARCH_LOG("[OpenSL]: Setting audio latency: Block size = %u, Blocks = %u, Total = %u ...\n",
|
||||
sl->buf_size, sl->buf_count, sl->buf_size * sl->buf_count);
|
||||
|
||||
fmt_pcm.formatType = SL_DATAFORMAT_PCM;
|
||||
@@ -192,7 +192,7 @@ static void *sl_init(const char *device, unsigned rate, unsigned latency,
|
||||
return sl;
|
||||
|
||||
error:
|
||||
RARCH_ERR("Couldn't initialize OpenSL ES driver, error code: [%d].\n", (int)res);
|
||||
RARCH_ERR("[OpenSL]: Couldn't initialize OpenSL ES driver, error code: [%d].\n", (int)res);
|
||||
sl_free(sl);
|
||||
return NULL;
|
||||
}
|
||||
@@ -230,8 +230,7 @@ static bool sl_start(void *data, bool is_shutdown)
|
||||
}
|
||||
|
||||
|
||||
static ssize_t sl_write(void *data, const void *buf_, size_t size,
|
||||
bool is_perfcnt_enable)
|
||||
static ssize_t sl_write(void *data, const void *buf_, size_t size)
|
||||
{
|
||||
sl_t *sl = (sl_t*)data;
|
||||
size_t written = 0;
|
||||
|
||||
+3
-4
@@ -97,8 +97,7 @@ error:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static ssize_t oss_write(void *data, const void *buf, size_t size,
|
||||
bool is_perfcnt_enable)
|
||||
static ssize_t oss_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
ssize_t ret;
|
||||
int *fd = (int*)data;
|
||||
@@ -168,7 +167,7 @@ static size_t oss_write_avail(void *data)
|
||||
|
||||
if (ioctl(*fd, SNDCTL_DSP_GETOSPACE, &info) < 0)
|
||||
{
|
||||
RARCH_ERR("SNDCTL_DSP_GETOSPACE failed ...\n");
|
||||
RARCH_ERR("[OSS]: SNDCTL_DSP_GETOSPACE failed ...\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -182,7 +181,7 @@ static size_t oss_buffer_size(void *data)
|
||||
|
||||
if (ioctl(*fd, SNDCTL_DSP_GETOSPACE, &info) < 0)
|
||||
{
|
||||
RARCH_ERR("SNDCTL_DSP_GETOSPACE failed ...\n");
|
||||
RARCH_ERR("[OSS]: SNDCTL_DSP_GETOSPACE failed ...\n");
|
||||
return 1; /* Return something non-zero to avoid SIGFPE. */
|
||||
}
|
||||
|
||||
|
||||
@@ -146,8 +146,7 @@ static void *ps3_audio_init(const char *device,
|
||||
return data;
|
||||
}
|
||||
|
||||
static ssize_t ps3_audio_write(void *data, const void *buf, size_t size,
|
||||
bool is_perfcnt_enable)
|
||||
static ssize_t ps3_audio_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
ps3_audio_t *aud = data;
|
||||
|
||||
|
||||
+21
-38
@@ -184,14 +184,12 @@ static void psp_audio_free(void *data)
|
||||
free(psp);
|
||||
}
|
||||
|
||||
static ssize_t psp_audio_write(void *data, const void *buf, size_t size,
|
||||
bool is_perfcnt_enable)
|
||||
static ssize_t psp_audio_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
psp_audio_t* psp = (psp_audio_t*)data;
|
||||
uint16_t write_pos = psp->write_pos;
|
||||
uint16_t sampleCount = size / sizeof(uint32_t);
|
||||
|
||||
#ifdef VITA
|
||||
if (psp->nonblocking)
|
||||
{
|
||||
if (AUDIO_BUFFER_SIZE - ((uint16_t)
|
||||
@@ -199,12 +197,13 @@ static ssize_t psp_audio_write(void *data, const void *buf, size_t size,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef VITA
|
||||
while (AUDIO_BUFFER_SIZE - ((uint16_t)
|
||||
(psp->write_pos - psp->read_pos) & AUDIO_BUFFER_SIZE_MASK) < size){
|
||||
(psp->write_pos - psp->read_pos) & AUDIO_BUFFER_SIZE_MASK) < size)
|
||||
sceKernelWaitLwCond((struct SceKernelLwCondWork*)&psp->cond, 0);
|
||||
}
|
||||
|
||||
sceKernelLockLwMutex((struct SceKernelLwMutexWork*)&psp->lock, 1, 0);
|
||||
#endif
|
||||
|
||||
if((write_pos + sampleCount) > AUDIO_BUFFER_SIZE)
|
||||
{
|
||||
@@ -220,36 +219,13 @@ static ssize_t psp_audio_write(void *data, const void *buf, size_t size,
|
||||
write_pos += sampleCount;
|
||||
write_pos &= AUDIO_BUFFER_SIZE_MASK;
|
||||
psp->write_pos = write_pos;
|
||||
|
||||
#ifdef VITA
|
||||
sceKernelUnlockLwMutex((struct SceKernelLwMutexWork*)&psp->lock, 1);
|
||||
|
||||
return size;
|
||||
#else
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
if (psp->nonblocking)
|
||||
{
|
||||
/* TODO */
|
||||
}
|
||||
#endif
|
||||
|
||||
if((write_pos + sampleCount) > AUDIO_BUFFER_SIZE)
|
||||
{
|
||||
memcpy(psp->buffer + write_pos, buf,
|
||||
(AUDIO_BUFFER_SIZE - write_pos) * sizeof(uint32_t));
|
||||
memcpy(psp->buffer, (uint32_t*) buf +
|
||||
(AUDIO_BUFFER_SIZE - write_pos),
|
||||
(write_pos + sampleCount - AUDIO_BUFFER_SIZE) * sizeof(uint32_t));
|
||||
}
|
||||
else
|
||||
memcpy(psp->buffer + write_pos, buf, size);
|
||||
|
||||
write_pos += sampleCount;
|
||||
write_pos &= AUDIO_BUFFER_SIZE_MASK;
|
||||
psp->write_pos = write_pos;
|
||||
|
||||
return sampleCount;
|
||||
return sampleCount;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -268,6 +244,9 @@ static bool psp_audio_stop(void *data)
|
||||
SceUInt timeout = 100000;
|
||||
psp_audio_t* psp = (psp_audio_t*)data;
|
||||
|
||||
if(psp && !psp->running)
|
||||
return true;
|
||||
|
||||
info.size = sizeof(SceKernelThreadInfo);
|
||||
|
||||
if (sceKernelGetThreadInfo(
|
||||
@@ -290,6 +269,9 @@ static bool psp_audio_start(void *data, bool is_shutdown)
|
||||
{
|
||||
SceKernelThreadInfo info;
|
||||
psp_audio_t* psp = (psp_audio_t*)data;
|
||||
|
||||
if(psp && psp->running)
|
||||
return true;
|
||||
|
||||
info.size = sizeof(SceKernelThreadInfo);
|
||||
|
||||
@@ -322,20 +304,21 @@ static bool psp_audio_use_float(void *data)
|
||||
|
||||
static size_t psp_write_avail(void *data)
|
||||
{
|
||||
psp_audio_t* psp = (psp_audio_t*)data;
|
||||
#ifdef VITA
|
||||
size_t val;
|
||||
psp_audio_t* psp = (psp_audio_t*)data;
|
||||
|
||||
#ifdef VITA
|
||||
sceKernelLockLwMutex((struct SceKernelLwMutexWork*)&psp->lock, 1, 0);
|
||||
#endif
|
||||
|
||||
val = AUDIO_BUFFER_SIZE - ((uint16_t)
|
||||
(psp->write_pos - psp->read_pos) & AUDIO_BUFFER_SIZE_MASK);
|
||||
|
||||
#ifdef VITA
|
||||
sceKernelUnlockLwMutex((struct SceKernelLwMutexWork*)&psp->lock, 1);
|
||||
return val;
|
||||
#else
|
||||
/* TODO */
|
||||
return AUDIO_BUFFER_SIZE - ((uint16_t)
|
||||
(psp->write_pos - psp->read_pos) & AUDIO_BUFFER_SIZE_MASK);
|
||||
#endif
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static size_t psp_buffer_size(void *data)
|
||||
|
||||
@@ -236,8 +236,7 @@ error:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static ssize_t pulse_write(void *data, const void *buf_, size_t size,
|
||||
bool is_perfcnt_enable)
|
||||
static ssize_t pulse_write(void *data, const void *buf_, size_t size)
|
||||
{
|
||||
pa_t *pa = (pa_t*)data;
|
||||
const uint8_t *buf = (const uint8_t*)buf_;
|
||||
|
||||
@@ -58,8 +58,7 @@ static void *ra_init(const char *device, unsigned rate, unsigned latency,
|
||||
return roar;
|
||||
}
|
||||
|
||||
static ssize_t ra_write(void *data, const void *buf, size_t size,
|
||||
bool is_perfcnt_enable)
|
||||
static ssize_t ra_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
int err;
|
||||
size_t written = 0;
|
||||
|
||||
@@ -102,8 +102,7 @@ error:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static ssize_t rs_write(void *data, const void *buf, size_t size,
|
||||
bool is_perfcnt_enable)
|
||||
static ssize_t rs_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
rsd_t *rsd = (rsd_t*)data;
|
||||
|
||||
|
||||
@@ -51,8 +51,7 @@ static void *rwebaudio_init(const char *device, unsigned rate, unsigned latency,
|
||||
return data;
|
||||
}
|
||||
|
||||
static ssize_t rwebaudio_write(void *data, const void *buf, size_t size,
|
||||
bool is_perfcnt_enable)
|
||||
static ssize_t rwebaudio_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
(void)data;
|
||||
return RWebAudioWrite(buf, size);
|
||||
|
||||
@@ -96,7 +96,7 @@ static void *sdl_audio_init(const char *device,
|
||||
* carry approximately half of the latency.
|
||||
*
|
||||
* SDL double buffers audio and we do as well. */
|
||||
frames = find_num_frames(rate, latency / 4);
|
||||
frames = find_num_frames(rate, latency / 4);
|
||||
|
||||
spec.freq = rate;
|
||||
spec.format = AUDIO_S16SYS;
|
||||
@@ -107,9 +107,8 @@ static void *sdl_audio_init(const char *device,
|
||||
|
||||
if (SDL_OpenAudio(&spec, &out) < 0)
|
||||
{
|
||||
RARCH_ERR("Failed to open SDL audio: %s\n", SDL_GetError());
|
||||
free(sdl);
|
||||
return 0;
|
||||
RARCH_ERR("[SDL audio]: Failed to open SDL audio: %s\n", SDL_GetError());
|
||||
goto error;
|
||||
}
|
||||
|
||||
*new_rate = out.freq;
|
||||
@@ -119,7 +118,7 @@ static void *sdl_audio_init(const char *device,
|
||||
sdl->cond = scond_new();
|
||||
#endif
|
||||
|
||||
RARCH_LOG("SDL audio: Requested %u ms latency, got %d ms\n",
|
||||
RARCH_LOG("[SDL audio]: Requested %u ms latency, got %d ms\n",
|
||||
latency, (int)(out.samples * 4 * 1000 / (*new_rate)));
|
||||
|
||||
/* Create a buffer twice as big as needed and prefill the buffer. */
|
||||
@@ -135,12 +134,15 @@ static void *sdl_audio_init(const char *device,
|
||||
|
||||
SDL_PauseAudio(0);
|
||||
return sdl;
|
||||
|
||||
error:
|
||||
free(sdl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static ssize_t sdl_audio_write(void *data, const void *buf, size_t size,
|
||||
bool is_perfcnt_enable)
|
||||
static ssize_t sdl_audio_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
ssize_t ret = 0;
|
||||
ssize_t ret = 0;
|
||||
sdl_audio_t *sdl = (sdl_audio_t*)data;
|
||||
|
||||
if (sdl->nonblock)
|
||||
|
||||
@@ -0,0 +1,996 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch 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 Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch 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 RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef _WIN32_WINNT
|
||||
#undef _WIN32_WINNT
|
||||
#endif
|
||||
#define _WIN32_WINNT 0x0600
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
|
||||
#include <Windows.h>
|
||||
#include <Winerror.h>
|
||||
#include <initguid.h>
|
||||
#include <Mmdeviceapi.h>
|
||||
#include <Mmreg.h>
|
||||
#include <Audioclient.h>
|
||||
#include <Propidl.h>
|
||||
|
||||
#include <lists/string_list.h>
|
||||
#include <queues/fifo_queue.h>
|
||||
|
||||
#include "../audio_driver.h"
|
||||
#include "../../verbosity.h"
|
||||
#include "../../configuration.h"
|
||||
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14); /* DEVPROP_TYPE_STRING */
|
||||
|
||||
|
||||
#define WASAPI_WARN(bool_exp, err_str, warn_exp)\
|
||||
if (!(bool_exp)) {\
|
||||
wasapi_warn(err_str);\
|
||||
warn_exp; }
|
||||
|
||||
#define WASAPI_CHECK(bool_exp, err_str, err_exp)\
|
||||
if (!(bool_exp)) {\
|
||||
wasapi_err(err_str);\
|
||||
err_exp; }
|
||||
|
||||
#define WASAPI_HR_CHECK(hr, fun_str, err_exp)\
|
||||
if (FAILED(hr)) {\
|
||||
wasapi_com_err(fun_str, hr);\
|
||||
err_exp; }
|
||||
|
||||
#define WASAPI_HR_WARN(hr, fun_str, warn_exp)\
|
||||
if (FAILED(hr)) {\
|
||||
wasapi_com_warn(fun_str, hr);\
|
||||
warn_exp; }
|
||||
|
||||
#define WASAPI_SR_CHECK(bool_exp, fun_str, err_exp)\
|
||||
if (!(bool_exp)) {\
|
||||
wasapi_sys_err(fun_str);\
|
||||
err_exp; }
|
||||
|
||||
#define WASAPI_RELEASE(iface)\
|
||||
if(iface) {\
|
||||
iface->lpVtbl->Release(iface);\
|
||||
iface = NULL; }\
|
||||
|
||||
#define WASAPI_FREE(ptr)\
|
||||
if(ptr) {\
|
||||
free(ptr);\
|
||||
ptr = NULL; }\
|
||||
|
||||
#define WASAPI_CO_FREE(ptr)\
|
||||
if(ptr) {\
|
||||
CoTaskMemFree(ptr);\
|
||||
ptr = NULL; }\
|
||||
|
||||
typedef struct
|
||||
{
|
||||
IMMDevice *device;
|
||||
IAudioClient *client;
|
||||
IAudioRenderClient *renderer;
|
||||
HANDLE write_event;
|
||||
fifo_buffer_t *buffer; /* NULL in unbuffered shared mode */
|
||||
size_t frame_size; /* 4 or 8 only */
|
||||
size_t engine_buffer_size;
|
||||
bool exclusive;
|
||||
bool blocking;
|
||||
bool running;
|
||||
} wasapi_t;
|
||||
|
||||
static void wasapi_log(const char *msg)
|
||||
{
|
||||
RARCH_LOG("[WASAPI]: %s.\n", msg);
|
||||
}
|
||||
|
||||
static void wasapi_warn(const char *warn)
|
||||
{
|
||||
RARCH_WARN("[WASAPI]: %s.\n", warn);
|
||||
}
|
||||
|
||||
static void wasapi_err(const char *err)
|
||||
{
|
||||
RARCH_ERR("[WASAPI]: %s.\n", err);
|
||||
}
|
||||
|
||||
static void wasapi_com_warn(const char *fun, HRESULT hr)
|
||||
{
|
||||
RARCH_WARN("[WASAPI]: %s failed with error 0x%.8X.\n", fun, hr);
|
||||
}
|
||||
|
||||
static void wasapi_com_err(const char *fun, HRESULT hr)
|
||||
{
|
||||
RARCH_ERR("[WASAPI]: %s failed with error 0x%.8X.\n", fun, hr);
|
||||
}
|
||||
|
||||
static void wasapi_sys_err(const char *fun)
|
||||
{
|
||||
RARCH_ERR("[WASAPI]: %s failed with error %d.\n", fun, GetLastError());
|
||||
}
|
||||
|
||||
static bool wasapi_check_device_id(IMMDevice *device, const char *id)
|
||||
{
|
||||
HRESULT hr;
|
||||
bool result = false;
|
||||
LPWSTR dev_id = NULL, dev_cmp_id = NULL;
|
||||
int id_length = MultiByteToWideChar(CP_ACP, 0, id, -1, NULL, 0);
|
||||
|
||||
WASAPI_SR_CHECK(id_length > 0, "MultiByteToWideChar", goto error);
|
||||
|
||||
dev_cmp_id = (LPWSTR)malloc(id_length * sizeof(WCHAR));
|
||||
WASAPI_CHECK(dev_cmp_id, "Out of memory", goto error);
|
||||
|
||||
id_length = MultiByteToWideChar(CP_ACP, 0, id, -1, dev_cmp_id, id_length);
|
||||
WASAPI_SR_CHECK(id_length > 0, "MultiByteToWideChar", goto error);
|
||||
|
||||
hr = device->lpVtbl->GetId(device, &dev_id);
|
||||
WASAPI_HR_CHECK(hr, "IMMDevice::GetId", goto error);
|
||||
|
||||
result = lstrcmpW(dev_cmp_id, dev_id) == 0 ? true : false;
|
||||
|
||||
WASAPI_CO_FREE(dev_id);
|
||||
WASAPI_FREE(dev_cmp_id);
|
||||
|
||||
return result;
|
||||
|
||||
error:
|
||||
WASAPI_CO_FREE(dev_id);
|
||||
WASAPI_FREE(dev_cmp_id);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static IMMDevice *wasapi_init_device(const char *id)
|
||||
{
|
||||
HRESULT hr;
|
||||
UINT32 dev_count, i;
|
||||
IMMDeviceEnumerator *enumerator = NULL;
|
||||
IMMDevice *device = NULL;
|
||||
IMMDeviceCollection *collection = NULL;
|
||||
|
||||
if (id)
|
||||
RARCH_LOG("[WASAPI]: Initializing device %s ...\n", id);
|
||||
else
|
||||
wasapi_log("Initializing default device ..");
|
||||
|
||||
hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL,
|
||||
&IID_IMMDeviceEnumerator, (void **)&enumerator);
|
||||
WASAPI_HR_CHECK(hr, "CoCreateInstance", goto error);
|
||||
|
||||
if (id)
|
||||
{
|
||||
hr = enumerator->lpVtbl->EnumAudioEndpoints(enumerator,
|
||||
eRender, DEVICE_STATE_ACTIVE, &collection);
|
||||
WASAPI_HR_CHECK(hr, "IMMDeviceEnumerator::EnumAudioEndpoints",
|
||||
goto error);
|
||||
|
||||
hr = collection->lpVtbl->GetCount(collection, &dev_count);
|
||||
WASAPI_HR_CHECK(hr, "IMMDeviceCollection::GetCount", goto error);
|
||||
|
||||
for (i = 0; i < dev_count; ++i)
|
||||
{
|
||||
hr = collection->lpVtbl->Item(collection, i, &device);
|
||||
WASAPI_HR_CHECK(hr, "IMMDeviceCollection::Item", continue);
|
||||
|
||||
if (wasapi_check_device_id(device, id))
|
||||
break;
|
||||
|
||||
WASAPI_RELEASE(device);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
hr = enumerator->lpVtbl->GetDefaultAudioEndpoint(enumerator,
|
||||
eRender, eConsole, &device);
|
||||
WASAPI_HR_CHECK(hr, "IMMDeviceEnumerator::GetDefaultAudioEndpoint",
|
||||
goto error);
|
||||
}
|
||||
|
||||
if (!device)
|
||||
goto error;
|
||||
|
||||
WASAPI_RELEASE(collection);
|
||||
WASAPI_RELEASE(enumerator);
|
||||
|
||||
wasapi_log("Device initialized");
|
||||
|
||||
return device;
|
||||
|
||||
error:
|
||||
WASAPI_RELEASE(collection);
|
||||
WASAPI_RELEASE(enumerator);
|
||||
|
||||
if (id)
|
||||
wasapi_warn("Failed to initialize device");
|
||||
else
|
||||
wasapi_err("Failed to initialize device");
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static unsigned wasapi_pref_rate(unsigned i)
|
||||
{
|
||||
const unsigned r[] = { 48000, 44100, 96000, 192000 };
|
||||
|
||||
if (i >= sizeof(r) / sizeof(unsigned))
|
||||
return 0;
|
||||
|
||||
return r[i];
|
||||
}
|
||||
|
||||
static void wasapi_set_format(WAVEFORMATEXTENSIBLE *wf,
|
||||
bool float_fmt, unsigned rate)
|
||||
{
|
||||
wf->Format.nChannels = 2;
|
||||
wf->Format.nSamplesPerSec = rate;
|
||||
|
||||
if (float_fmt)
|
||||
{
|
||||
wf->Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
|
||||
wf->Format.nAvgBytesPerSec = rate * 8;
|
||||
wf->Format.nBlockAlign = 8;
|
||||
wf->Format.wBitsPerSample = 32;
|
||||
wf->Format.cbSize = sizeof(WORD) + sizeof(DWORD) + sizeof(GUID);
|
||||
wf->Samples.wValidBitsPerSample = 32;
|
||||
wf->dwChannelMask = KSAUDIO_SPEAKER_STEREO;
|
||||
wf->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
|
||||
}
|
||||
else
|
||||
{
|
||||
wf->Format.wFormatTag = WAVE_FORMAT_PCM;
|
||||
wf->Format.nAvgBytesPerSec = rate * 4;
|
||||
wf->Format.nBlockAlign = 4;
|
||||
wf->Format.wBitsPerSample = 16;
|
||||
wf->Format.cbSize = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static IAudioClient *wasapi_init_client_sh(IMMDevice *device,
|
||||
bool *float_fmt, unsigned *rate, unsigned latency)
|
||||
{
|
||||
HRESULT hr;
|
||||
WAVEFORMATEXTENSIBLE wf;
|
||||
int i, j;
|
||||
IAudioClient *client = NULL;
|
||||
bool float_fmt_res = *float_fmt;
|
||||
unsigned rate_res = *rate;
|
||||
|
||||
hr = device->lpVtbl->Activate(device, &IID_IAudioClient,
|
||||
CLSCTX_ALL, NULL, (void**)&client);
|
||||
WASAPI_HR_CHECK(hr, "IMMDevice::Activate", return NULL);
|
||||
|
||||
/* once for float, once for pcm (requested first) */
|
||||
for (i = 0; i < 2; ++i)
|
||||
{
|
||||
rate_res = *rate;
|
||||
if (i == 1)
|
||||
float_fmt_res = !float_fmt_res;
|
||||
|
||||
/* for requested rate (first) and all preferred rates */
|
||||
for (j = 0; rate_res; ++j)
|
||||
{
|
||||
RARCH_LOG("[WASAPI]: Initializing client (shared, %s, %uHz, %ums) ...\n",
|
||||
float_fmt_res ? "float" : "pcm", rate_res, latency);
|
||||
|
||||
wasapi_set_format(&wf, float_fmt_res, rate_res);
|
||||
hr = client->lpVtbl->Initialize(client, AUDCLNT_SHAREMODE_SHARED,
|
||||
AUDCLNT_STREAMFLAGS_EVENTCALLBACK | AUDCLNT_STREAMFLAGS_NOPERSIST,
|
||||
0, 0, (WAVEFORMATEX*)&wf, NULL);
|
||||
if (hr == AUDCLNT_E_ALREADY_INITIALIZED)
|
||||
{
|
||||
client->lpVtbl->Release(client);
|
||||
hr = device->lpVtbl->Activate(device, &IID_IAudioClient,
|
||||
CLSCTX_ALL, NULL, (void**)&client);
|
||||
WASAPI_HR_CHECK(hr, "IMMDevice::Activate", return NULL);
|
||||
|
||||
hr = client->lpVtbl->Initialize(client, AUDCLNT_SHAREMODE_SHARED,
|
||||
AUDCLNT_STREAMFLAGS_EVENTCALLBACK | AUDCLNT_STREAMFLAGS_NOPERSIST,
|
||||
0, 0, (WAVEFORMATEX*)&wf, NULL);
|
||||
}
|
||||
if (hr != AUDCLNT_E_UNSUPPORTED_FORMAT)
|
||||
{
|
||||
i = 2; /* break from outer loop too */
|
||||
break;
|
||||
}
|
||||
|
||||
wasapi_warn("Unsupported format");
|
||||
rate_res = wasapi_pref_rate(j);
|
||||
if (rate_res == *rate) /* requested rate is allready tested */
|
||||
rate_res = wasapi_pref_rate(++j); /* skip it */
|
||||
}
|
||||
}
|
||||
|
||||
WASAPI_HR_CHECK(hr, "IAudioClient::Initialize", goto error);
|
||||
|
||||
*float_fmt = float_fmt_res;
|
||||
*rate = rate_res;
|
||||
|
||||
return client;
|
||||
|
||||
error:
|
||||
WASAPI_RELEASE(client);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static IAudioClient *wasapi_init_client_ex(IMMDevice *device,
|
||||
bool *float_fmt, unsigned *rate, unsigned latency)
|
||||
{
|
||||
HRESULT hr;
|
||||
WAVEFORMATEXTENSIBLE wf;
|
||||
int i, j;
|
||||
IAudioClient *client = NULL;
|
||||
bool float_fmt_res = *float_fmt;
|
||||
unsigned rate_res = *rate;
|
||||
REFERENCE_TIME minimum_period = 0;
|
||||
REFERENCE_TIME buffer_duration = 0;
|
||||
UINT32 buffer_length = 0;
|
||||
|
||||
hr = device->lpVtbl->Activate(device, &IID_IAudioClient,
|
||||
CLSCTX_ALL, NULL, (void**)&client);
|
||||
WASAPI_HR_CHECK(hr, "IMMDevice::Activate", return NULL);
|
||||
|
||||
hr = client->lpVtbl->GetDevicePeriod(client, NULL, &minimum_period);
|
||||
WASAPI_HR_CHECK(hr, "IAudioClient::GetDevicePeriod", goto error);
|
||||
|
||||
/* buffer_duration is in 100ns units */
|
||||
buffer_duration = latency * 10000.0;
|
||||
if (buffer_duration < minimum_period)
|
||||
buffer_duration = minimum_period;
|
||||
|
||||
/* once for float, once for pcm (requested first) */
|
||||
for (i = 0; i < 2; ++i)
|
||||
{
|
||||
rate_res = *rate;
|
||||
if (i == 1)
|
||||
float_fmt_res = !float_fmt_res;
|
||||
|
||||
/* for requested rate (first) and all preferred rates */
|
||||
for (j = 0; rate_res; ++j)
|
||||
{
|
||||
RARCH_LOG("[WASAPI]: Initializing client (exclusive, %s, %uHz, %ums) ...\n",
|
||||
float_fmt_res ? "float" : "pcm", rate_res, latency);
|
||||
|
||||
wasapi_set_format(&wf, float_fmt_res, rate_res);
|
||||
hr = client->lpVtbl->Initialize(client, AUDCLNT_SHAREMODE_EXCLUSIVE,
|
||||
AUDCLNT_STREAMFLAGS_EVENTCALLBACK | AUDCLNT_STREAMFLAGS_NOPERSIST,
|
||||
buffer_duration, buffer_duration, (WAVEFORMATEX*)&wf, NULL);
|
||||
if (hr == AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED)
|
||||
{
|
||||
hr = client->lpVtbl->GetBufferSize(client, &buffer_length);
|
||||
WASAPI_HR_CHECK(hr, "IAudioClient::GetBufferSize", goto error);
|
||||
|
||||
client->lpVtbl->Release(client);
|
||||
hr = device->lpVtbl->Activate(device, &IID_IAudioClient,
|
||||
CLSCTX_ALL, NULL, (void**)&client);
|
||||
WASAPI_HR_CHECK(hr, "IMMDevice::Activate", return NULL);
|
||||
|
||||
buffer_duration = 10000.0 * 1000.0 / rate_res * buffer_length + 0.5;
|
||||
hr = client->lpVtbl->Initialize(client, AUDCLNT_SHAREMODE_EXCLUSIVE,
|
||||
AUDCLNT_STREAMFLAGS_EVENTCALLBACK | AUDCLNT_STREAMFLAGS_NOPERSIST,
|
||||
buffer_duration, buffer_duration, (WAVEFORMATEX*)&wf, NULL);
|
||||
}
|
||||
if (hr == AUDCLNT_E_ALREADY_INITIALIZED)
|
||||
{
|
||||
client->lpVtbl->Release(client);
|
||||
hr = device->lpVtbl->Activate(device, &IID_IAudioClient,
|
||||
CLSCTX_ALL, NULL, (void**)&client);
|
||||
WASAPI_HR_CHECK(hr, "IMMDevice::Activate", return NULL);
|
||||
|
||||
hr = client->lpVtbl->Initialize(client, AUDCLNT_SHAREMODE_EXCLUSIVE,
|
||||
AUDCLNT_STREAMFLAGS_EVENTCALLBACK | AUDCLNT_STREAMFLAGS_NOPERSIST,
|
||||
buffer_duration, buffer_duration, (WAVEFORMATEX*)&wf, NULL);
|
||||
}
|
||||
if (hr != AUDCLNT_E_UNSUPPORTED_FORMAT)
|
||||
{
|
||||
WASAPI_WARN(hr != AUDCLNT_E_DEVICE_IN_USE,
|
||||
"Device already in use", goto error);
|
||||
|
||||
WASAPI_WARN(hr != AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED,
|
||||
"Exclusive mode disabled", goto error);
|
||||
|
||||
i = 2; /* break from outer loop too */
|
||||
break;
|
||||
}
|
||||
|
||||
wasapi_warn("Unsupported format");
|
||||
rate_res = wasapi_pref_rate(j);
|
||||
if (rate_res == *rate) /* requested rate is allready tested */
|
||||
rate_res = wasapi_pref_rate(++j); /* skip it */
|
||||
}
|
||||
}
|
||||
|
||||
WASAPI_HR_CHECK(hr, "IAudioClient::Initialize", goto error);
|
||||
|
||||
*float_fmt = float_fmt_res;
|
||||
*rate = rate_res;
|
||||
|
||||
return client;
|
||||
|
||||
error:
|
||||
WASAPI_RELEASE(client);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static IAudioClient *wasapi_init_client(IMMDevice *device, bool *exclusive,
|
||||
bool *float_fmt, unsigned *rate, unsigned latency)
|
||||
{
|
||||
HRESULT hr;
|
||||
IAudioClient *client;
|
||||
double latency_res;
|
||||
REFERENCE_TIME device_period = 0;
|
||||
REFERENCE_TIME stream_latency = 0;
|
||||
UINT32 buffer_length = 0;
|
||||
|
||||
if (*exclusive)
|
||||
{
|
||||
client = wasapi_init_client_ex(device, float_fmt, rate, latency);
|
||||
if (!client)
|
||||
{
|
||||
client = wasapi_init_client_sh(device, float_fmt, rate, latency);
|
||||
if (client)
|
||||
*exclusive = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
client = wasapi_init_client_sh(device, float_fmt, rate, latency);
|
||||
if (!client)
|
||||
{
|
||||
client = wasapi_init_client_ex(device, float_fmt, rate, latency);
|
||||
if (client)
|
||||
*exclusive = true;
|
||||
}
|
||||
}
|
||||
|
||||
WASAPI_CHECK(client, "Failed to initialize client", return NULL);
|
||||
|
||||
/* next calls are allowed to fail (we losing info only) */
|
||||
|
||||
if (*exclusive)
|
||||
hr = client->lpVtbl->GetDevicePeriod(client, NULL, &device_period);
|
||||
else
|
||||
hr = client->lpVtbl->GetDevicePeriod(client, &device_period, NULL);
|
||||
if (FAILED(hr))
|
||||
wasapi_com_warn("IAudioClient::GetDevicePeriod", hr);
|
||||
|
||||
if (!*exclusive)
|
||||
{
|
||||
hr = client->lpVtbl->GetStreamLatency(client, &stream_latency);
|
||||
if (FAILED(hr))
|
||||
wasapi_com_warn("IAudioClient::GetStreamLatency", hr);
|
||||
}
|
||||
|
||||
hr = client->lpVtbl->GetBufferSize(client, &buffer_length);
|
||||
if (FAILED(hr))
|
||||
wasapi_com_warn("IAudioClient::GetBufferSize", hr);
|
||||
|
||||
if (*exclusive)
|
||||
latency_res = (double)buffer_length * 1000.0 / (*rate);
|
||||
else
|
||||
latency_res = (double)(stream_latency + device_period) / 10000.0;
|
||||
|
||||
RARCH_LOG("[WASAPI]: Client initialized (%s, %s, %uHz, %.1fms).\n",
|
||||
*exclusive ? "exclusive" : "shared",
|
||||
*float_fmt ? "float" : "pcm", *rate, latency_res);
|
||||
|
||||
RARCH_LOG("[WASAPI]: Client's buffer length is %u frames (%.1fms).\n",
|
||||
buffer_length, (double)buffer_length * 1000.0 / (*rate));
|
||||
|
||||
RARCH_LOG("[WASAPI]: Device period is %.1fms (%lld frames).\n",
|
||||
(double)device_period / 10000.0, device_period * (*rate) / 10000000);
|
||||
|
||||
return client;
|
||||
}
|
||||
|
||||
static void *wasapi_init(const char *dev_id, unsigned rate, unsigned latency,
|
||||
unsigned u1, unsigned *u2)
|
||||
{
|
||||
HRESULT hr;
|
||||
bool com_initialized = false;
|
||||
UINT32 frame_count = 0;
|
||||
REFERENCE_TIME dev_period = 0;
|
||||
BYTE *dest = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool float_format = settings->bools.audio_wasapi_float_format;
|
||||
int sh_buffer_length = settings->ints.audio_wasapi_sh_buffer_length;
|
||||
wasapi_t *w = (wasapi_t*)calloc(1, sizeof(wasapi_t));
|
||||
w->exclusive = settings->bools.audio_wasapi_exclusive_mode;
|
||||
|
||||
WASAPI_CHECK(w, "Out of memory", return NULL);
|
||||
|
||||
hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
|
||||
WASAPI_HR_CHECK(hr, "CoInitializeEx", goto error);
|
||||
|
||||
com_initialized = true;
|
||||
|
||||
w->device = wasapi_init_device(dev_id);
|
||||
if (!w->device && dev_id)
|
||||
w->device = wasapi_init_device(NULL);
|
||||
if (!w->device)
|
||||
goto error;
|
||||
|
||||
w->client = wasapi_init_client(w->device,
|
||||
&w->exclusive, &float_format, &rate, latency);
|
||||
if (!w->client)
|
||||
goto error;
|
||||
|
||||
hr = w->client->lpVtbl->GetBufferSize(w->client, &frame_count);
|
||||
WASAPI_HR_CHECK(hr, "IAudioClient::GetBufferSize", goto error);
|
||||
|
||||
w->frame_size = float_format ? 8 : 4;
|
||||
w->engine_buffer_size = frame_count * w->frame_size;
|
||||
if (w->exclusive)
|
||||
{
|
||||
w->buffer = fifo_new(w->engine_buffer_size);
|
||||
WASAPI_CHECK(w->buffer, "Out of memory", goto error);
|
||||
|
||||
RARCH_LOG("[WASAPI]: Intermediate buffer length is %u frames (%.1fms).\n",
|
||||
frame_count, (double)frame_count * 1000.0 / rate);
|
||||
}
|
||||
else if (sh_buffer_length)
|
||||
{
|
||||
if (sh_buffer_length < 0)
|
||||
{
|
||||
hr = w->client->lpVtbl->GetDevicePeriod(w->client, &dev_period, NULL);
|
||||
WASAPI_HR_CHECK(hr, "IAudioClient::GetDevicePeriod", goto error);
|
||||
|
||||
sh_buffer_length = dev_period * rate / 10000000;
|
||||
}
|
||||
|
||||
w->buffer = fifo_new(sh_buffer_length * w->frame_size);
|
||||
WASAPI_CHECK(w->buffer, "Out of memory", goto error);
|
||||
|
||||
RARCH_LOG("[WASAPI]: Intermediate buffer length is %u frames (%.1fms).\n",
|
||||
sh_buffer_length, (double)sh_buffer_length * 1000.0 / rate);
|
||||
}
|
||||
else
|
||||
wasapi_log("Intermediate buffer is off");
|
||||
|
||||
w->write_event = CreateEventA(NULL, FALSE, FALSE, NULL);
|
||||
WASAPI_SR_CHECK(w->write_event, "CreateEventA", goto error);
|
||||
|
||||
hr = w->client->lpVtbl->SetEventHandle(w->client, w->write_event);
|
||||
WASAPI_HR_CHECK(hr, "IAudioClient::SetEventHandle", goto error);
|
||||
|
||||
hr = w->client->lpVtbl->GetService(w->client,
|
||||
&IID_IAudioRenderClient, (void**)&w->renderer);
|
||||
WASAPI_HR_CHECK(hr, "IAudioClient::GetService", goto error);
|
||||
|
||||
hr = w->renderer->lpVtbl->GetBuffer(w->renderer, frame_count, &dest);
|
||||
WASAPI_HR_CHECK(hr, "IAudioRenderClient::GetBuffer", goto error);
|
||||
|
||||
hr = w->renderer->lpVtbl->ReleaseBuffer(w->renderer, frame_count,
|
||||
AUDCLNT_BUFFERFLAGS_SILENT);
|
||||
WASAPI_HR_CHECK(hr, "IAudioRenderClient::ReleaseBuffer", goto error);
|
||||
|
||||
hr = w->client->lpVtbl->Start(w->client);
|
||||
WASAPI_HR_CHECK(hr, "IAudioClient::Start", goto error);
|
||||
w->running = true;
|
||||
w->blocking = settings->bools.audio_sync;
|
||||
|
||||
return w;
|
||||
|
||||
error:
|
||||
WASAPI_RELEASE(w->renderer);
|
||||
WASAPI_RELEASE(w->client);
|
||||
WASAPI_RELEASE(w->device);
|
||||
if (w->write_event)
|
||||
CloseHandle(w->write_event);
|
||||
if (w->buffer)
|
||||
fifo_free(w->buffer);
|
||||
free(w);
|
||||
if (com_initialized)
|
||||
CoUninitialize();
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static bool wasapi_flush(wasapi_t * w, const void * data, size_t size)
|
||||
{
|
||||
BYTE *dest = NULL;
|
||||
UINT32 frame_count = size / w->frame_size;
|
||||
HRESULT hr = w->renderer->lpVtbl->GetBuffer(w->renderer, frame_count, &dest);
|
||||
|
||||
WASAPI_HR_CHECK(hr, "IAudioRenderClient::GetBuffer", return false)
|
||||
|
||||
memcpy(dest, data, size);
|
||||
hr = w->renderer->lpVtbl->ReleaseBuffer(w->renderer, frame_count, 0);
|
||||
|
||||
WASAPI_HR_CHECK(hr, "IAudioRenderClient::ReleaseBuffer", return false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool wasapi_flush_buffer(wasapi_t * w, size_t size)
|
||||
{
|
||||
BYTE *dest = NULL;
|
||||
UINT32 frame_count = size / w->frame_size;
|
||||
HRESULT hr = w->renderer->lpVtbl->GetBuffer(w->renderer, frame_count, &dest);
|
||||
|
||||
WASAPI_HR_CHECK(hr, "IAudioRenderClient::GetBuffer", return false)
|
||||
|
||||
fifo_read(w->buffer, dest, size);
|
||||
hr = w->renderer->lpVtbl->ReleaseBuffer(w->renderer, frame_count, 0);
|
||||
|
||||
WASAPI_HR_CHECK(hr, "IAudioRenderClient::ReleaseBuffer", return false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static ssize_t wasapi_write_sh(wasapi_t *w, const void * data, size_t size)
|
||||
{
|
||||
DWORD ir;
|
||||
size_t read_avail;
|
||||
size_t write_avail;
|
||||
HRESULT hr;
|
||||
bool br;
|
||||
ssize_t writen = -1;
|
||||
UINT32 padding = 0;
|
||||
|
||||
if (w->buffer)
|
||||
{
|
||||
write_avail = fifo_write_avail(w->buffer);
|
||||
if (!write_avail)
|
||||
{
|
||||
if (w->blocking)
|
||||
{
|
||||
ir = WaitForSingleObject(w->write_event, INFINITE);
|
||||
WASAPI_SR_CHECK(ir == WAIT_OBJECT_0, "WaitForSingleObject", return -1);
|
||||
}
|
||||
|
||||
hr = w->client->lpVtbl->GetCurrentPadding(w->client, &padding);
|
||||
WASAPI_HR_CHECK(hr, "IAudioClient::GetCurrentPadding", return -1);
|
||||
|
||||
read_avail = fifo_read_avail(w->buffer);
|
||||
write_avail = w->engine_buffer_size - padding * w->frame_size;
|
||||
writen = read_avail < write_avail ? read_avail : write_avail;
|
||||
if (writen)
|
||||
{
|
||||
br = wasapi_flush_buffer(w, writen);
|
||||
if (!br)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
write_avail = fifo_write_avail(w->buffer);
|
||||
writen = size < write_avail ? size : write_avail;
|
||||
if (writen)
|
||||
fifo_write(w->buffer, data, writen);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (w->blocking)
|
||||
{
|
||||
ir = WaitForSingleObject(w->write_event, INFINITE);
|
||||
WASAPI_SR_CHECK(ir == WAIT_OBJECT_0, "WaitForSingleObject", return -1);
|
||||
}
|
||||
|
||||
hr = w->client->lpVtbl->GetCurrentPadding(w->client, &padding);
|
||||
WASAPI_HR_CHECK(hr, "IAudioClient::GetCurrentPadding", return -1);
|
||||
|
||||
write_avail = w->engine_buffer_size - padding * w->frame_size;
|
||||
if (!write_avail)
|
||||
return 0;
|
||||
|
||||
writen = size < write_avail ? size : write_avail;
|
||||
if (writen)
|
||||
{
|
||||
br = wasapi_flush(w, data, writen);
|
||||
if (!br)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return writen;
|
||||
}
|
||||
|
||||
static ssize_t wasapi_write_ex(wasapi_t *w, const void * data, size_t size)
|
||||
{
|
||||
DWORD ir;
|
||||
size_t write_avail;
|
||||
bool br = false;
|
||||
ssize_t writen = 0;
|
||||
|
||||
write_avail = fifo_write_avail(w->buffer);
|
||||
if (!write_avail)
|
||||
{
|
||||
ir = WaitForSingleObject(w->write_event, w->blocking ? INFINITE : 0);
|
||||
if (ir != WAIT_OBJECT_0 && w->blocking)
|
||||
{
|
||||
wasapi_sys_err("WaitForSingleObject");
|
||||
return -1;
|
||||
}
|
||||
if (ir != WAIT_OBJECT_0)
|
||||
return 0;
|
||||
|
||||
br = wasapi_flush_buffer(w, w->engine_buffer_size);
|
||||
if (!br)
|
||||
return -1;
|
||||
|
||||
write_avail = w->engine_buffer_size;
|
||||
}
|
||||
|
||||
writen = size < write_avail ? size : write_avail;
|
||||
fifo_write(w->buffer, data, writen);
|
||||
|
||||
return writen;
|
||||
}
|
||||
|
||||
static ssize_t wasapi_write(void *wh, const void *data, size_t size)
|
||||
{
|
||||
size_t writen;
|
||||
ssize_t ir;
|
||||
wasapi_t *w = (wasapi_t*)wh;
|
||||
|
||||
if (w->blocking)
|
||||
{
|
||||
for (writen = 0, ir = -1; writen < size; writen += ir)
|
||||
{
|
||||
if (w->exclusive)
|
||||
ir = wasapi_write_ex(w, data + writen, size - writen);
|
||||
else
|
||||
ir = wasapi_write_sh(w, data + writen, size - writen);
|
||||
if (ir == -1)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else if (w->exclusive)
|
||||
writen = wasapi_write_ex(w, data, size);
|
||||
else
|
||||
writen = wasapi_write_sh(w, data, size);
|
||||
|
||||
return writen;
|
||||
}
|
||||
|
||||
static bool wasapi_stop(void *wh)
|
||||
{
|
||||
wasapi_t *w = (wasapi_t*)wh;
|
||||
HRESULT hr = w->client->lpVtbl->Stop(w->client);
|
||||
WASAPI_HR_CHECK(hr, "IAudioClient::Stop", return !w->running);
|
||||
|
||||
w->running = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool wasapi_start(void *wh, bool u)
|
||||
{
|
||||
wasapi_t *w = (wasapi_t*)wh;
|
||||
HRESULT hr = w->client->lpVtbl->Start(w->client);
|
||||
|
||||
if (hr == AUDCLNT_E_NOT_STOPPED)
|
||||
return true;
|
||||
|
||||
WASAPI_HR_CHECK(hr, "IAudioClient::Start", return w->running);
|
||||
|
||||
w->running = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool wasapi_alive(void *wh)
|
||||
{
|
||||
wasapi_t *w = (wasapi_t*)wh;
|
||||
|
||||
return w->running;
|
||||
}
|
||||
|
||||
static void wasapi_set_nonblock_state(void *wh, bool nonblock)
|
||||
{
|
||||
wasapi_t *w = (wasapi_t*)wh;
|
||||
|
||||
RARCH_LOG("[WASAPI]: Sync %s.\n", nonblock ? "off" : "on");
|
||||
|
||||
w->blocking = !nonblock;
|
||||
}
|
||||
|
||||
static void wasapi_free(void *wh)
|
||||
{
|
||||
wasapi_t *w = (wasapi_t*)wh;
|
||||
HANDLE write_event = w->write_event;
|
||||
DWORD ir;
|
||||
|
||||
WASAPI_RELEASE(w->renderer);
|
||||
if (w->client)
|
||||
w->client->lpVtbl->Stop(w->client);
|
||||
WASAPI_RELEASE(w->client);
|
||||
WASAPI_RELEASE(w->device);
|
||||
CoUninitialize();
|
||||
if (w->buffer)
|
||||
fifo_free(w->buffer);
|
||||
free(w);
|
||||
|
||||
ir = WaitForSingleObject(write_event, 20);
|
||||
if (ir == WAIT_FAILED)
|
||||
wasapi_sys_err("WaitForSingleObject");
|
||||
|
||||
/* If event isn't signaled log and leak */
|
||||
WASAPI_CHECK(ir == WAIT_OBJECT_0, "Memory leak in wasapi_free", return);
|
||||
|
||||
CloseHandle(write_event);
|
||||
}
|
||||
|
||||
static bool wasapi_use_float(void *wh)
|
||||
{
|
||||
wasapi_t *w = (wasapi_t*)wh;
|
||||
|
||||
return w->frame_size == 8;
|
||||
}
|
||||
|
||||
static void *wasapi_device_list_new(void *u)
|
||||
{
|
||||
HRESULT hr;
|
||||
UINT i;
|
||||
PROPVARIANT prop_var;
|
||||
int ir;
|
||||
union string_list_elem_attr attr;
|
||||
IMMDeviceEnumerator *enumerator = NULL;
|
||||
IMMDeviceCollection *collection = NULL;
|
||||
UINT dev_count = 0;
|
||||
IMMDevice *device = NULL;
|
||||
LPWSTR dev_id_wstr = NULL;
|
||||
IPropertyStore *prop_store = NULL;
|
||||
bool prop_var_init = false;
|
||||
bool br = false;
|
||||
char *dev_id_str = NULL;
|
||||
char *dev_name_str = NULL;
|
||||
struct string_list *sl = string_list_new();
|
||||
|
||||
wasapi_log("Enumerating active devices ..");
|
||||
|
||||
WASAPI_CHECK(sl, "string_list_new failed", return NULL);
|
||||
|
||||
attr.i = 0;
|
||||
hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL,
|
||||
&IID_IMMDeviceEnumerator, (void **)&enumerator);
|
||||
WASAPI_HR_CHECK(hr, "CoCreateInstance", goto error);
|
||||
|
||||
hr = enumerator->lpVtbl->EnumAudioEndpoints(enumerator,
|
||||
eRender, DEVICE_STATE_ACTIVE, &collection);
|
||||
WASAPI_HR_CHECK(hr, "IMMDeviceEnumerator::EnumAudioEndpoints", goto error);
|
||||
|
||||
hr = collection->lpVtbl->GetCount(collection, &dev_count);
|
||||
WASAPI_HR_CHECK(hr, "IMMDeviceCollection::GetCount", goto error);
|
||||
|
||||
for (i = 0; i < dev_count; ++i)
|
||||
{
|
||||
hr = collection->lpVtbl->Item(collection, i, &device);
|
||||
WASAPI_HR_CHECK(hr, "IMMDeviceCollection::Item", goto error);
|
||||
|
||||
hr = device->lpVtbl->GetId(device, &dev_id_wstr);
|
||||
WASAPI_HR_CHECK(hr, "IMMDevice::GetId", goto error);
|
||||
|
||||
ir = WideCharToMultiByte(CP_ACP, 0, dev_id_wstr, -1,
|
||||
NULL, 0, NULL, NULL);
|
||||
WASAPI_SR_CHECK(ir, "WideCharToMultiByte", goto error);
|
||||
|
||||
dev_id_str = (char *)malloc(ir);
|
||||
WASAPI_CHECK(dev_id_str, "Out of memory", goto error);
|
||||
|
||||
ir = WideCharToMultiByte(CP_ACP, 0, dev_id_wstr, -1,
|
||||
dev_id_str, ir, NULL, NULL);
|
||||
WASAPI_SR_CHECK(ir, "WideCharToMultiByte", goto error);
|
||||
|
||||
hr = device->lpVtbl->OpenPropertyStore(device, STGM_READ, &prop_store);
|
||||
WASAPI_HR_CHECK(hr, "IMMDevice::OpenPropertyStore", goto error);
|
||||
|
||||
PropVariantInit(&prop_var);
|
||||
prop_var_init = true;
|
||||
hr = prop_store->lpVtbl->GetValue(prop_store,
|
||||
&PKEY_Device_FriendlyName, &prop_var);
|
||||
WASAPI_HR_CHECK(hr, "IPropertyStore::GetValue", goto error);
|
||||
|
||||
ir = WideCharToMultiByte(CP_ACP, 0, prop_var.pwszVal, -1,
|
||||
NULL, 0, NULL, NULL);
|
||||
WASAPI_SR_CHECK(ir, "WideCharToMultiByte", goto error);
|
||||
|
||||
dev_name_str = (char *)malloc(ir);
|
||||
WASAPI_CHECK(dev_name_str, "Out of memory", goto error);
|
||||
|
||||
ir = WideCharToMultiByte(CP_ACP, 0, prop_var.pwszVal, -1,
|
||||
dev_name_str, ir, NULL, NULL);
|
||||
WASAPI_SR_CHECK(ir, "WideCharToMultiByte", goto error);
|
||||
|
||||
RARCH_LOG("[WASAPI]: %s %s\n", dev_name_str, dev_id_str);
|
||||
|
||||
br = string_list_append(sl, dev_id_str, attr);
|
||||
WASAPI_CHECK(br, "string_list_append failed", goto error);
|
||||
|
||||
PropVariantClear(&prop_var);
|
||||
prop_var_init = false;
|
||||
WASAPI_CO_FREE(dev_id_wstr);
|
||||
WASAPI_FREE(dev_id_str);
|
||||
WASAPI_FREE(dev_name_str);
|
||||
WASAPI_RELEASE(prop_store);
|
||||
WASAPI_RELEASE(device);
|
||||
}
|
||||
|
||||
WASAPI_RELEASE(collection);
|
||||
WASAPI_RELEASE(enumerator);
|
||||
|
||||
wasapi_log("Devices enumerated");
|
||||
|
||||
return sl;
|
||||
|
||||
error:
|
||||
WASAPI_FREE(dev_id_str);
|
||||
WASAPI_FREE(dev_name_str);
|
||||
if (prop_var_init)
|
||||
PropVariantClear(&prop_var);
|
||||
WASAPI_RELEASE(prop_store);
|
||||
WASAPI_CO_FREE(dev_id_wstr);
|
||||
WASAPI_RELEASE(device);
|
||||
WASAPI_RELEASE(collection);
|
||||
WASAPI_RELEASE(enumerator);
|
||||
if (sl)
|
||||
string_list_free(sl);
|
||||
|
||||
wasapi_err("Device enumeration failed");
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void wasapi_device_list_free(void *u, void *slp)
|
||||
{
|
||||
struct string_list *sl = (struct string_list*)slp;
|
||||
|
||||
string_list_free(sl);
|
||||
}
|
||||
|
||||
static size_t wasapi_write_avail(void *wh)
|
||||
{
|
||||
HRESULT hr;
|
||||
wasapi_t *w = (wasapi_t*)wh;
|
||||
UINT32 padding = 0;
|
||||
|
||||
if (w->buffer)
|
||||
return fifo_write_avail(w->buffer);
|
||||
|
||||
hr = w->client->lpVtbl->GetCurrentPadding(w->client, &padding);
|
||||
WASAPI_HR_CHECK(hr, "IAudioClient::GetCurrentPadding", return 0);
|
||||
|
||||
return w->engine_buffer_size - padding * w->frame_size;
|
||||
}
|
||||
|
||||
static size_t wasapi_buffer_size(void *wh)
|
||||
{
|
||||
wasapi_t *w = (wasapi_t*)wh;
|
||||
|
||||
if (!w->exclusive && w->buffer)
|
||||
return w->buffer->size;
|
||||
|
||||
return w->engine_buffer_size;
|
||||
}
|
||||
|
||||
audio_driver_t audio_wasapi = {
|
||||
wasapi_init,
|
||||
wasapi_write,
|
||||
wasapi_stop,
|
||||
wasapi_start,
|
||||
wasapi_alive,
|
||||
wasapi_set_nonblock_state,
|
||||
wasapi_free,
|
||||
wasapi_use_float,
|
||||
"wasapi",
|
||||
wasapi_device_list_new,
|
||||
wasapi_device_list_free,
|
||||
wasapi_write_avail,
|
||||
wasapi_buffer_size
|
||||
};
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "wiiu/system/memory.h"
|
||||
|
||||
#include "audio/audio_driver.h"
|
||||
#include "performance_counters.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -192,11 +191,9 @@ static bool ax_audio_start(void* data, bool is_shutdown)
|
||||
return true;
|
||||
}
|
||||
|
||||
static ssize_t ax_audio_write(void* data, const void* buf, size_t size,
|
||||
bool is_perfcnt_enable)
|
||||
static ssize_t ax_audio_write(void* data, const void* buf, size_t size)
|
||||
{
|
||||
int i;
|
||||
static struct retro_perf_counter ax_audio_write_perf = {0};
|
||||
size_t countAvail = 0;
|
||||
ax_audio_t* ax = (ax_audio_t*)data;
|
||||
const uint16_t* src = buf;
|
||||
@@ -205,10 +202,6 @@ static ssize_t ax_audio_write(void* data, const void* buf, size_t size,
|
||||
if(!size || (size & 0x3))
|
||||
return 0;
|
||||
|
||||
/* Measure copy performance from here */
|
||||
performance_counter_init(ax_audio_write_perf, "ax_audio_write");
|
||||
performance_counter_start_plus(is_perfcnt_enable, ax_audio_write_perf);
|
||||
|
||||
if(count > AX_AUDIO_MAX_FREE)
|
||||
count = AX_AUDIO_MAX_FREE;
|
||||
|
||||
@@ -286,9 +279,6 @@ static ssize_t ax_audio_write(void* data, const void* buf, size_t size,
|
||||
if(!AXIsMultiVoiceRunning(ax->mvoice))
|
||||
ax_audio_start(ax, false);
|
||||
|
||||
/* Done copying new data */
|
||||
performance_counter_stop_plus(is_perfcnt_enable, ax_audio_write_perf);
|
||||
|
||||
/* return what was actually copied */
|
||||
return (count << 2);
|
||||
}
|
||||
|
||||
@@ -201,10 +201,9 @@ static size_t xaudio2_write_avail(xaudio2_t *handle)
|
||||
return handle->bufsize * (MAX_BUFFERS - handle->buffers - 1);
|
||||
}
|
||||
|
||||
static size_t xaudio2_write(xaudio2_t *handle, const void *buf, size_t bytes_,
|
||||
bool is_perfcnt_enable)
|
||||
static size_t xaudio2_write(xaudio2_t *handle, const void *buf, size_t bytes_)
|
||||
{
|
||||
unsigned bytes = bytes_;
|
||||
unsigned bytes = bytes_;
|
||||
const uint8_t *buffer = (const uint8_t*)buf;
|
||||
|
||||
while (bytes)
|
||||
@@ -274,8 +273,7 @@ static void *xa_init(const char *device, unsigned rate, unsigned latency,
|
||||
return xa;
|
||||
}
|
||||
|
||||
static ssize_t xa_write(void *data, const void *buf, size_t size,
|
||||
bool is_perfcnt_enable)
|
||||
static ssize_t xa_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
size_t ret;
|
||||
xa_t *xa = (xa_t*)data;
|
||||
@@ -290,7 +288,7 @@ static ssize_t xa_write(void *data, const void *buf, size_t size,
|
||||
size = avail;
|
||||
}
|
||||
|
||||
ret = xaudio2_write(xa->xa, buf, size, is_perfcnt_enable);
|
||||
ret = xaudio2_write(xa->xa, buf, size);
|
||||
if (ret == 0 && size > 0)
|
||||
return -1;
|
||||
return ret;
|
||||
|
||||
@@ -57,8 +57,7 @@ static INLINE uint32_t bswap_32(uint32_t val)
|
||||
((val >> 8) & 0xff00) | ((val << 8) & 0xff0000);
|
||||
}
|
||||
|
||||
static ssize_t xenon360_audio_write(void *data, const void *buf, size_t size,
|
||||
bool is_perfcnt_enable)
|
||||
static ssize_t xenon360_audio_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
size_t written = 0, i;
|
||||
const uint32_t *in_buf = buf;
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ void autosave_lock(void);
|
||||
**/
|
||||
void autosave_unlock(void);
|
||||
|
||||
void autosave_init(void);
|
||||
bool autosave_init(void);
|
||||
|
||||
void autosave_deinit(void);
|
||||
|
||||
|
||||
@@ -0,0 +1,229 @@
|
||||
// This provides support for __getreent() as well as implementation of our thread-related wrappers
|
||||
|
||||
#include <reent.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <vitasdk/utils.h>
|
||||
#include <psp2/kernel/threadmgr.h>
|
||||
|
||||
#define MAX_THREADS 256
|
||||
|
||||
typedef struct reent_for_thread {
|
||||
int thread_id;
|
||||
int needs_reclaim;
|
||||
void *tls_data_ext;
|
||||
void *pthread_data_ext;
|
||||
struct _reent reent;
|
||||
} reent_for_thread;
|
||||
|
||||
static reent_for_thread reent_list[MAX_THREADS];
|
||||
static int _newlib_reent_mutex;
|
||||
static struct _reent _newlib_global_reent;
|
||||
|
||||
#define TLS_REENT_THID_PTR(thid) sceKernelGetThreadTLSAddr(thid, 0x88)
|
||||
#define TLS_REENT_PTR sceKernelGetTLSAddr(0x88)
|
||||
|
||||
#define list_entry(ptr, type, member) \
|
||||
((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
|
||||
|
||||
int __vita_delete_thread_reent(int thid)
|
||||
{
|
||||
struct reent_for_thread *for_thread;
|
||||
|
||||
// We only need to cleanup if reent is allocated, i.e. if it's on our TLS
|
||||
// We also don't need to clean up the global reent
|
||||
struct _reent **on_tls = NULL;
|
||||
|
||||
if (thid == 0)
|
||||
on_tls = TLS_REENT_PTR;
|
||||
else
|
||||
on_tls = TLS_REENT_THID_PTR(thid);
|
||||
|
||||
if (!*on_tls || *on_tls == &_newlib_global_reent)
|
||||
return 0;
|
||||
|
||||
for_thread = list_entry(*on_tls, struct reent_for_thread, reent);
|
||||
|
||||
// Remove from TLS
|
||||
*on_tls = 0;
|
||||
|
||||
// Set thread id to zero, which means the reent is free
|
||||
for_thread->thread_id = 0;
|
||||
|
||||
// We can't reclaim it here, will be done later in __getreent
|
||||
for_thread->needs_reclaim = 1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int vitasdk_delete_thread_reent(int thid)
|
||||
{
|
||||
int res = 0;
|
||||
// Lock the list because we'll be modifying it
|
||||
sceKernelLockMutex(_newlib_reent_mutex, 1, NULL);
|
||||
|
||||
res = __vita_delete_thread_reent(thid);
|
||||
|
||||
sceKernelUnlockMutex(_newlib_reent_mutex, 1);
|
||||
return res;
|
||||
}
|
||||
|
||||
int _exit_thread_common(int exit_status, int (*exit_func)(int)) {
|
||||
int res = 0;
|
||||
int ret = 0;
|
||||
int thid = sceKernelGetThreadId();
|
||||
|
||||
// Lock the list because we'll be modifying it
|
||||
sceKernelLockMutex(_newlib_reent_mutex, 1, NULL);
|
||||
|
||||
res = __vita_delete_thread_reent(0);
|
||||
|
||||
ret = exit_func(exit_status);
|
||||
|
||||
if (res)
|
||||
{
|
||||
struct _reent **on_tls = TLS_REENT_PTR;
|
||||
struct reent_for_thread *for_thread = list_entry(*on_tls, struct reent_for_thread, reent);
|
||||
|
||||
for_thread->thread_id = thid;
|
||||
|
||||
// And put it back on TLS
|
||||
*on_tls = &for_thread->reent;
|
||||
}
|
||||
|
||||
sceKernelUnlockMutex(_newlib_reent_mutex, 1);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int vita_exit_thread(int exit_status) {
|
||||
return _exit_thread_common(exit_status, sceKernelExitThread);
|
||||
}
|
||||
|
||||
int vita_exit_delete_thread(int exit_status) {
|
||||
return _exit_thread_common(exit_status, sceKernelExitDeleteThread);
|
||||
}
|
||||
|
||||
static inline void __vita_clean_reent(void)
|
||||
{
|
||||
int i;
|
||||
SceKernelThreadInfo info;
|
||||
|
||||
for (i = 0; i < MAX_THREADS; ++i)
|
||||
{
|
||||
info.size = sizeof(SceKernelThreadInfo);
|
||||
|
||||
if (sceKernelGetThreadInfo(reent_list[i].thread_id, &info) < 0)
|
||||
{
|
||||
reent_list[i].thread_id = 0;
|
||||
reent_list[i].needs_reclaim = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline struct reent_for_thread *__vita_allocate_reent(void)
|
||||
{
|
||||
int i;
|
||||
struct reent_for_thread *free_reent = 0;
|
||||
|
||||
for (i = 0; i < MAX_THREADS; ++i)
|
||||
if (reent_list[i].thread_id == 0) {
|
||||
free_reent = &reent_list[i];
|
||||
break;
|
||||
}
|
||||
|
||||
return free_reent;
|
||||
}
|
||||
|
||||
struct _reent *__getreent_for_thread(int thid) {
|
||||
struct reent_for_thread *free_reent = 0;
|
||||
struct _reent *returned_reent = 0;
|
||||
|
||||
// A pointer to our reent should be on the TLS
|
||||
struct _reent **on_tls = NULL;
|
||||
|
||||
if (thid == 0)
|
||||
on_tls = TLS_REENT_PTR;
|
||||
else
|
||||
on_tls = TLS_REENT_THID_PTR(thid);
|
||||
|
||||
if (*on_tls) {
|
||||
return *on_tls;
|
||||
}
|
||||
|
||||
sceKernelLockMutex(_newlib_reent_mutex, 1, 0);
|
||||
|
||||
// If it's not on the TLS this means the thread doesn't have a reent allocated yet
|
||||
// We allocate one and put a pointer to it on the TLS
|
||||
free_reent = __vita_allocate_reent();
|
||||
|
||||
if (!free_reent) {
|
||||
// clean any hanging thread references
|
||||
__vita_clean_reent();
|
||||
|
||||
free_reent = __vita_allocate_reent();
|
||||
|
||||
if (!free_reent) {
|
||||
// we've exhausted all our resources
|
||||
__builtin_trap();
|
||||
}
|
||||
} else {
|
||||
// First, check if it needs to be cleaned up (if it came from another thread)
|
||||
if (free_reent->needs_reclaim) {
|
||||
_reclaim_reent(&free_reent->reent);
|
||||
free_reent->needs_reclaim = 0;
|
||||
}
|
||||
|
||||
memset(free_reent, 0, sizeof(struct reent_for_thread));
|
||||
|
||||
// Set it up
|
||||
if(thid==0){
|
||||
thid = sceKernelGetThreadId();
|
||||
}
|
||||
free_reent->thread_id = thid;
|
||||
_REENT_INIT_PTR(&free_reent->reent);
|
||||
returned_reent = &free_reent->reent;
|
||||
}
|
||||
|
||||
// Put it on TLS for faster access time
|
||||
*on_tls = returned_reent;
|
||||
|
||||
sceKernelUnlockMutex(_newlib_reent_mutex, 1);
|
||||
return returned_reent;
|
||||
}
|
||||
|
||||
struct _reent *__getreent(void) {
|
||||
return __getreent_for_thread(0);
|
||||
}
|
||||
|
||||
void *vitasdk_get_tls_data(SceUID thid)
|
||||
{
|
||||
struct reent_for_thread *for_thread;
|
||||
struct _reent *reent = __getreent_for_thread(thid);
|
||||
|
||||
for_thread = list_entry(reent, struct reent_for_thread, reent);
|
||||
return &for_thread->tls_data_ext;
|
||||
}
|
||||
|
||||
void *vitasdk_get_pthread_data(SceUID thid)
|
||||
{
|
||||
struct reent_for_thread *for_thread;
|
||||
struct _reent *reent = __getreent_for_thread(thid);
|
||||
|
||||
for_thread = list_entry(reent, struct reent_for_thread, reent);
|
||||
return &for_thread->pthread_data_ext;
|
||||
}
|
||||
|
||||
// Called from _start to set up the main thread reentrancy structure
|
||||
void _init_vita_reent(void) {
|
||||
memset(reent_list, 0, sizeof(reent_list));
|
||||
_newlib_reent_mutex = sceKernelCreateMutex("reent list access mutex", 0, 0, 0);
|
||||
reent_list[0].thread_id = sceKernelGetThreadId();
|
||||
_REENT_INIT_PTR(&reent_list[0].reent);
|
||||
*(struct _reent **)(TLS_REENT_PTR) = &reent_list[0].reent;
|
||||
_REENT_INIT_PTR(&_newlib_global_reent);
|
||||
}
|
||||
|
||||
void _free_vita_reent(void) {
|
||||
sceKernelDeleteMutex(_newlib_reent_mutex);
|
||||
}
|
||||
+25
-23
@@ -25,7 +25,6 @@
|
||||
#include "../configuration.h"
|
||||
#include "../driver.h"
|
||||
#include "../retroarch.h"
|
||||
#include "../runloop.h"
|
||||
#include "../list_special.h"
|
||||
#include "../verbosity.h"
|
||||
|
||||
@@ -48,6 +47,12 @@ static const camera_driver_t *camera_drivers[] = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
static struct retro_camera_callback camera_cb;
|
||||
static const camera_driver_t *camera_driver = NULL;
|
||||
static void *camera_data = NULL;
|
||||
static bool camera_driver_active = false;
|
||||
static bool camera_driver_data_own = false;
|
||||
|
||||
/**
|
||||
* camera_driver_find_handle:
|
||||
* @idx : index of driver to get handle to.
|
||||
@@ -102,14 +107,20 @@ bool driver_camera_start(void)
|
||||
return camera_driver_ctl(RARCH_CAMERA_CTL_START, NULL);
|
||||
}
|
||||
|
||||
void camera_driver_poll(void)
|
||||
{
|
||||
if (!camera_cb.caps)
|
||||
return;
|
||||
if (!camera_driver || !camera_driver->poll || !camera_data)
|
||||
return;
|
||||
camera_driver->poll(camera_data,
|
||||
camera_cb.frame_raw_framebuffer,
|
||||
camera_cb.frame_opengl_texture);
|
||||
}
|
||||
|
||||
bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
static struct retro_camera_callback camera_cb;
|
||||
static const camera_driver_t *camera_driver = NULL;
|
||||
static void *camera_data = NULL;
|
||||
static bool camera_driver_active = false;
|
||||
static bool camera_driver_data_own = false;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
@@ -136,7 +147,7 @@ bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data)
|
||||
driver_ctx_info_t drv;
|
||||
|
||||
drv.label = "camera_driver";
|
||||
drv.s = settings->camera.driver;
|
||||
drv.s = settings->arrays.camera_driver;
|
||||
|
||||
driver_ctl(RARCH_DRIVER_CTL_FIND_INDEX, &drv);
|
||||
|
||||
@@ -148,7 +159,7 @@ bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data)
|
||||
{
|
||||
unsigned d;
|
||||
RARCH_ERR("Couldn't find any camera driver named \"%s\"\n",
|
||||
settings->camera.driver);
|
||||
settings->arrays.camera_driver);
|
||||
RARCH_LOG_OUTPUT("Available camera drivers are:\n");
|
||||
for (d = 0; camera_driver_find_handle(d); d++)
|
||||
RARCH_LOG_OUTPUT("\t%s\n", camera_driver_find_ident(d));
|
||||
@@ -188,22 +199,13 @@ bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data)
|
||||
case RARCH_CAMERA_CTL_START:
|
||||
if (camera_driver && camera_data && camera_driver->start)
|
||||
{
|
||||
if (settings->camera.allow)
|
||||
if (settings->bools.camera_allow)
|
||||
return camera_driver->start(camera_data);
|
||||
|
||||
runloop_msg_queue_push(
|
||||
"Camera is explicitly disabled.\n", 1, 180, false);
|
||||
}
|
||||
break;
|
||||
case RARCH_CAMERA_CTL_POLL:
|
||||
if (!camera_cb.caps)
|
||||
return false;
|
||||
if (!camera_driver || !camera_driver->poll || !camera_data)
|
||||
return false;
|
||||
camera_driver->poll(camera_data,
|
||||
camera_cb.frame_raw_framebuffer,
|
||||
camera_cb.frame_opengl_texture);
|
||||
break;
|
||||
case RARCH_CAMERA_CTL_SET_CB:
|
||||
{
|
||||
struct retro_camera_callback *cb =
|
||||
@@ -222,12 +224,12 @@ bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data)
|
||||
return false;
|
||||
|
||||
camera_data = camera_driver->init(
|
||||
*settings->camera.device ? settings->camera.device : NULL,
|
||||
*settings->arrays.camera_device ? settings->arrays.camera_device : NULL,
|
||||
camera_cb.caps,
|
||||
settings->camera.width ?
|
||||
settings->camera.width : camera_cb.width,
|
||||
settings->camera.height ?
|
||||
settings->camera.height : camera_cb.height);
|
||||
settings->uints.camera_width ?
|
||||
settings->uints.camera_width : camera_cb.width,
|
||||
settings->uints.camera_height ?
|
||||
settings->uints.camera_height : camera_cb.height);
|
||||
|
||||
if (!camera_data)
|
||||
{
|
||||
|
||||
@@ -37,7 +37,6 @@ enum rarch_camera_ctl_state
|
||||
RARCH_CAMERA_CTL_UNSET_ACTIVE,
|
||||
RARCH_CAMERA_CTL_IS_ACTIVE,
|
||||
RARCH_CAMERA_CTL_FIND_DRIVER,
|
||||
RARCH_CAMERA_CTL_POLL,
|
||||
RARCH_CAMERA_CTL_SET_CB,
|
||||
RARCH_CAMERA_CTL_STOP,
|
||||
RARCH_CAMERA_CTL_START,
|
||||
@@ -105,6 +104,8 @@ void driver_camera_stop(void);
|
||||
|
||||
bool driver_camera_start(void);
|
||||
|
||||
void camera_driver_poll(void);
|
||||
|
||||
bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <retro_assert.h>
|
||||
#include <retro_miscellaneous.h>
|
||||
#include <gfx/scaler/scaler.h>
|
||||
#include <gfx/video_frame.h>
|
||||
#include <retro_stat.h>
|
||||
|
||||
#include <compat/strl.h>
|
||||
@@ -89,15 +90,15 @@ static bool init_mmap(void *data)
|
||||
if (xioctl(v4l->fd, (uint8_t)VIDIOC_REQBUFS, &req) == -1)
|
||||
{
|
||||
if (errno == EINVAL)
|
||||
RARCH_ERR("%s does not support memory mapping.\n", v4l->dev_name);
|
||||
RARCH_ERR("[V4L2]: %s does not support memory mapping.\n", v4l->dev_name);
|
||||
else
|
||||
RARCH_ERR("xioctl of VIDIOC_REQBUFS failed.\n");
|
||||
RARCH_ERR("[V4L2]: xioctl of VIDIOC_REQBUFS failed.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (req.count < 2)
|
||||
{
|
||||
RARCH_ERR("Insufficient buffer memory on %s.\n", v4l->dev_name);
|
||||
RARCH_ERR("[V4L2]: Insufficient buffer memory on %s.\n", v4l->dev_name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -105,7 +106,7 @@ static bool init_mmap(void *data)
|
||||
|
||||
if (!v4l->buffers)
|
||||
{
|
||||
RARCH_ERR("Out of memory allocating V4L2 buffers.\n");
|
||||
RARCH_ERR("[V4L2]: Out of memory allocating V4L2 buffers.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -119,7 +120,7 @@ static bool init_mmap(void *data)
|
||||
|
||||
if (xioctl(v4l->fd, (uint8_t)VIDIOC_QUERYBUF, &buf) == -1)
|
||||
{
|
||||
RARCH_ERR("Error - xioctl VIDIOC_QUERYBUF.\n");
|
||||
RARCH_ERR("[V4L2]: Error - xioctl VIDIOC_QUERYBUF.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -131,7 +132,7 @@ static bool init_mmap(void *data)
|
||||
|
||||
if (v4l->buffers[v4l->n_buffers].start == MAP_FAILED)
|
||||
{
|
||||
RARCH_ERR("Error - mmap.\n");
|
||||
RARCH_ERR("[V4L2]: Error - mmap.\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -150,21 +151,21 @@ static bool init_device(void *data)
|
||||
if (xioctl(v4l->fd, (uint8_t)VIDIOC_QUERYCAP, &cap) < 0)
|
||||
{
|
||||
if (errno == EINVAL)
|
||||
RARCH_ERR("%s is no V4L2 device.\n", v4l->dev_name);
|
||||
RARCH_ERR("[V4L2]: %s is no V4L2 device.\n", v4l->dev_name);
|
||||
else
|
||||
RARCH_ERR("Error - VIDIOC_QUERYCAP.\n");
|
||||
RARCH_ERR("[V4L2]: Error - VIDIOC_QUERYCAP.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE))
|
||||
{
|
||||
RARCH_ERR("%s is no video capture device.\n", v4l->dev_name);
|
||||
RARCH_ERR("[V4L2]: %s is no video capture device.\n", v4l->dev_name);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(cap.capabilities & V4L2_CAP_STREAMING))
|
||||
{
|
||||
RARCH_ERR("%s does not support streaming I/O (V4L2_CAP_STREAMING).\n",
|
||||
RARCH_ERR("[V4L2]: %s does not support streaming I/O (V4L2_CAP_STREAMING).\n",
|
||||
v4l->dev_name);
|
||||
return false;
|
||||
}
|
||||
@@ -187,7 +188,7 @@ static bool init_device(void *data)
|
||||
|
||||
if (xioctl(v4l->fd, (uint8_t)VIDIOC_S_FMT, &fmt) < 0)
|
||||
{
|
||||
RARCH_ERR("Error - VIDIOC_S_FMT\n");
|
||||
RARCH_ERR("[V4L2]: Error - VIDIOC_S_FMT\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -202,18 +203,18 @@ static bool init_device(void *data)
|
||||
*/
|
||||
if (fmt.fmt.pix.pixelformat != V4L2_PIX_FMT_YUYV)
|
||||
{
|
||||
RARCH_ERR("The V4L2 device doesn't support YUYV.\n");
|
||||
RARCH_ERR("[V4L2]: The V4L2 device doesn't support YUYV.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (fmt.fmt.pix.field != V4L2_FIELD_NONE
|
||||
&& fmt.fmt.pix.field != V4L2_FIELD_INTERLACED)
|
||||
{
|
||||
RARCH_ERR("The V4L2 device doesn't support progressive nor interlaced video.\n");
|
||||
RARCH_ERR("[V4L2]: The V4L2 device doesn't support progressive nor interlaced video.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
RARCH_LOG("V4L2 device: %u x %u.\n", v4l->width, v4l->height);
|
||||
RARCH_LOG("[V4L2]: device: %u x %u.\n", v4l->width, v4l->height);
|
||||
|
||||
return init_mmap(v4l);
|
||||
}
|
||||
@@ -224,7 +225,7 @@ static void v4l_stop(void *data)
|
||||
enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||
|
||||
if (xioctl(v4l->fd, VIDIOC_STREAMOFF, &type) == -1)
|
||||
RARCH_ERR("Error - VIDIOC_STREAMOFF.\n");
|
||||
RARCH_ERR("[V4L2]: Error - VIDIOC_STREAMOFF.\n");
|
||||
|
||||
v4l->ready = false;
|
||||
}
|
||||
@@ -245,7 +246,7 @@ static bool v4l_start(void *data)
|
||||
|
||||
if (xioctl(v4l->fd, (uint8_t)VIDIOC_QBUF, &buf) == -1)
|
||||
{
|
||||
RARCH_ERR("Error - VIDIOC_QBUF.\n");
|
||||
RARCH_ERR("[V4L2]: Error - VIDIOC_QBUF.\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -254,7 +255,7 @@ static bool v4l_start(void *data)
|
||||
|
||||
if (xioctl(v4l->fd, VIDIOC_STREAMON, &type) == -1)
|
||||
{
|
||||
RARCH_ERR("Error - VIDIOC_STREAMON.\n");
|
||||
RARCH_ERR("[V4L2]: Error - VIDIOC_STREAMON.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -270,7 +271,7 @@ static void v4l_free(void *data)
|
||||
unsigned i;
|
||||
for (i = 0; i < v4l->n_buffers; i++)
|
||||
if (munmap(v4l->buffers[i].start, v4l->buffers[i].length) == -1)
|
||||
RARCH_ERR("munmap failed.\n");
|
||||
RARCH_ERR("[V4L2]: munmap failed.\n");
|
||||
|
||||
if (v4l->fd >= 0)
|
||||
close(v4l->fd);
|
||||
@@ -287,7 +288,7 @@ static void *v4l_init(const char *device, uint64_t caps,
|
||||
|
||||
if ((caps & (UINT64_C(1) << RETRO_CAMERA_BUFFER_RAW_FRAMEBUFFER)) == 0)
|
||||
{
|
||||
RARCH_ERR("video4linux2 returns raw framebuffers.\n");
|
||||
RARCH_ERR("[V4L2]: Returns raw framebuffers.\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -304,7 +305,7 @@ static void *v4l_init(const char *device, uint64_t caps,
|
||||
|
||||
if (!path_is_character_special(v4l->dev_name))
|
||||
{
|
||||
RARCH_ERR("%s is no device.\n", v4l->dev_name);
|
||||
RARCH_ERR("[V4L2]: %s is no device.\n", v4l->dev_name);
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -312,7 +313,7 @@ static void *v4l_init(const char *device, uint64_t caps,
|
||||
|
||||
if (v4l->fd == -1)
|
||||
{
|
||||
RARCH_ERR("Cannot open '%s': %d, %s\n", v4l->dev_name,
|
||||
RARCH_ERR("[V4L2]: Cannot open '%s': %d, %s\n", v4l->dev_name,
|
||||
errno, strerror(errno));
|
||||
goto error;
|
||||
}
|
||||
@@ -325,7 +326,7 @@ static void *v4l_init(const char *device, uint64_t caps,
|
||||
|
||||
if (!v4l->buffer_output)
|
||||
{
|
||||
RARCH_ERR("Failed to allocate output buffer.\n");
|
||||
RARCH_ERR("[V4L2]: Failed to allocate output buffer.\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -338,20 +339,21 @@ static void *v4l_init(const char *device, uint64_t caps,
|
||||
|
||||
if (!scaler_ctx_gen_filter(&v4l->scaler))
|
||||
{
|
||||
RARCH_ERR("Failed to create scaler.\n");
|
||||
RARCH_ERR("[V4L2]: Failed to create scaler.\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
return v4l;
|
||||
|
||||
error:
|
||||
RARCH_ERR("V4L2: Failed to initialize camera.\n");
|
||||
RARCH_ERR("[V4L2]: Failed to initialize camera.\n");
|
||||
v4l_free(v4l);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static bool preprocess_image(void *data)
|
||||
{
|
||||
struct scaler_ctx *ctx = NULL;
|
||||
video4linux_t *v4l = (video4linux_t*)data;
|
||||
struct v4l2_buffer buf = {0};
|
||||
|
||||
@@ -365,7 +367,7 @@ static bool preprocess_image(void *data)
|
||||
case EAGAIN:
|
||||
break;
|
||||
default:
|
||||
RARCH_ERR("VIDIOC_DQBUF.\n");
|
||||
RARCH_ERR("[V4L2]: VIDIOC_DQBUF.\n");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -374,10 +376,12 @@ static bool preprocess_image(void *data)
|
||||
|
||||
retro_assert(buf.index < v4l->n_buffers);
|
||||
|
||||
scaler_ctx_scale(&v4l->scaler, v4l->buffer_output, (const uint8_t*)v4l->buffers[buf.index].start);
|
||||
ctx = &v4l->scaler;
|
||||
|
||||
scaler_ctx_scale_direct(ctx, v4l->buffer_output, (const uint8_t*)v4l->buffers[buf.index].start);
|
||||
|
||||
if (xioctl(v4l->fd, (uint8_t)VIDIOC_QBUF, &buf) == -1)
|
||||
RARCH_ERR("VIDIOC_QBUF\n");
|
||||
RARCH_ERR("[V4L2]: VIDIOC_QBUF\n");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+916
-773
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,83 @@
|
||||
#ifndef CORO_H
|
||||
#define CORO_H
|
||||
|
||||
/*
|
||||
Released under the CC0: https://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
/* Use at the beginning of the coroutine, you must have declared a variable coro_t* coro */
|
||||
#define CORO_ENTER() \
|
||||
{ \
|
||||
CORO_again: ; \
|
||||
switch ( coro->step ) { \
|
||||
case CORO_BEGIN: ;
|
||||
|
||||
/* Use to define labels which are targets to GOTO and GOSUB */
|
||||
#define CORO_SUB( x ) \
|
||||
case x: ;
|
||||
|
||||
/* Use at the end of the coroutine */
|
||||
#define CORO_LEAVE() \
|
||||
} \
|
||||
} \
|
||||
do { return 0; } while ( 0 )
|
||||
|
||||
/* Go to the x label */
|
||||
#define CORO_GOTO( x ) \
|
||||
do { \
|
||||
coro->step = ( x ); \
|
||||
goto CORO_again; \
|
||||
} while ( 0 )
|
||||
|
||||
/* Go to a subroutine, execution continues until the subroutine returns via RET */
|
||||
/* x is the subroutine label, y and z are the A and B arguments */
|
||||
#define CORO_GOSUB( x ) \
|
||||
do { \
|
||||
coro->stack[ coro->sp++ ] = __LINE__; \
|
||||
coro->step = ( x ); \
|
||||
goto CORO_again; \
|
||||
case __LINE__: ; \
|
||||
} while ( 0 )
|
||||
|
||||
/* Returns from a subroutine */
|
||||
#define CORO_RET() \
|
||||
do { \
|
||||
coro->step = coro->stack[ --coro->sp ]; \
|
||||
goto CORO_again; \
|
||||
} while ( 0 )
|
||||
|
||||
/* Yields to the caller, execution continues from this point when the coroutine is resumed */
|
||||
#define CORO_YIELD() \
|
||||
do { \
|
||||
coro->step = __LINE__; \
|
||||
return 1; \
|
||||
case __LINE__: ; \
|
||||
} while ( 0 )
|
||||
|
||||
#define CORO_STOP() \
|
||||
do { \
|
||||
return 0; \
|
||||
} while ( 0 )
|
||||
|
||||
/* The coroutine entry point, never use 0 as a label */
|
||||
#define CORO_BEGIN 0
|
||||
|
||||
/* Sets up a coroutine, x is a pointer to coro_t */
|
||||
#define CORO_SETUP( x ) \
|
||||
do { \
|
||||
( x )->step = CORO_BEGIN; \
|
||||
( x )->sp = 0; \
|
||||
} while ( 0 )
|
||||
|
||||
#define CORO_VAR( x ) ( coro->x )
|
||||
|
||||
/* A coroutine */
|
||||
typedef struct
|
||||
{
|
||||
CORO_VARS
|
||||
int step, sp;
|
||||
int stack[ 8 ];
|
||||
}
|
||||
coro_t;
|
||||
|
||||
#endif /* CORO_H */
|
||||
@@ -195,8 +195,6 @@ enum event_command
|
||||
CMD_EVENT_AUDIO_REINIT,
|
||||
/* Resizes windowed scale. Will reinitialize video driver. */
|
||||
CMD_EVENT_RESIZE_WINDOWED_SCALE,
|
||||
/* Deinitializes temporary content. */
|
||||
CMD_EVENT_TEMPORARY_CONTENT_DEINIT,
|
||||
CMD_EVENT_LOG_FILE_DEINIT,
|
||||
/* Toggles disk eject. */
|
||||
CMD_EVENT_DISK_EJECT_TOGGLE,
|
||||
@@ -221,6 +219,8 @@ enum event_command
|
||||
CMD_EVENT_RESTORE_DEFAULT_SHADER_PRESET
|
||||
};
|
||||
|
||||
bool command_set_shader(const char *arg);
|
||||
|
||||
#ifdef HAVE_COMMAND
|
||||
#if defined(HAVE_NETWORKING) && defined(HAVE_NETWORK_CMD)
|
||||
bool command_network_send(const char *cmd_);
|
||||
@@ -233,7 +233,7 @@ bool command_network_new(
|
||||
bool network_enable,
|
||||
uint16_t port);
|
||||
|
||||
command_t *command_new(bool local_enable);
|
||||
command_t *command_new(void);
|
||||
|
||||
bool command_poll(command_t *handle);
|
||||
|
||||
@@ -243,6 +243,8 @@ bool command_set(command_handle_t *handle);
|
||||
|
||||
bool command_free(command_t *handle);
|
||||
|
||||
bool command_event_quit(void);
|
||||
|
||||
/**
|
||||
* command_event:
|
||||
* @cmd : Command index.
|
||||
|
||||
+12
-380
@@ -25,161 +25,6 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "input/input_driver.h"
|
||||
|
||||
#include "config.def.keybinds.h"
|
||||
|
||||
enum video_driver_enum
|
||||
{
|
||||
VIDEO_GL = 0,
|
||||
VIDEO_VULKAN,
|
||||
VIDEO_DRM,
|
||||
VIDEO_XVIDEO,
|
||||
VIDEO_SDL,
|
||||
VIDEO_SDL2,
|
||||
VIDEO_EXT,
|
||||
VIDEO_WII,
|
||||
VIDEO_WIIU,
|
||||
VIDEO_XENON360,
|
||||
VIDEO_XDK_D3D,
|
||||
VIDEO_PSP1,
|
||||
VIDEO_VITA2D,
|
||||
VIDEO_CTR,
|
||||
VIDEO_D3D9,
|
||||
VIDEO_VG,
|
||||
VIDEO_OMAP,
|
||||
VIDEO_EXYNOS,
|
||||
VIDEO_SUNXI,
|
||||
VIDEO_DISPMANX,
|
||||
VIDEO_CACA,
|
||||
VIDEO_GDI,
|
||||
VIDEO_VGA,
|
||||
VIDEO_NULL
|
||||
};
|
||||
|
||||
enum audio_driver_enum
|
||||
{
|
||||
AUDIO_RSOUND = VIDEO_NULL + 1,
|
||||
AUDIO_OSS,
|
||||
AUDIO_ALSA,
|
||||
AUDIO_ALSATHREAD,
|
||||
AUDIO_ROAR,
|
||||
AUDIO_AL,
|
||||
AUDIO_SL,
|
||||
AUDIO_JACK,
|
||||
AUDIO_SDL,
|
||||
AUDIO_SDL2,
|
||||
AUDIO_XAUDIO,
|
||||
AUDIO_PULSE,
|
||||
AUDIO_EXT,
|
||||
AUDIO_DSOUND,
|
||||
AUDIO_COREAUDIO,
|
||||
AUDIO_PS3,
|
||||
AUDIO_XENON360,
|
||||
AUDIO_WII,
|
||||
AUDIO_WIIU,
|
||||
AUDIO_RWEBAUDIO,
|
||||
AUDIO_PSP,
|
||||
AUDIO_CTR,
|
||||
AUDIO_NULL
|
||||
};
|
||||
|
||||
enum audio_resampler_driver_enum
|
||||
{
|
||||
AUDIO_RESAMPLER_CC = AUDIO_NULL + 1,
|
||||
AUDIO_RESAMPLER_SINC,
|
||||
AUDIO_RESAMPLER_NEAREST,
|
||||
AUDIO_RESAMPLER_NULL
|
||||
};
|
||||
|
||||
enum input_driver_enum
|
||||
{
|
||||
INPUT_ANDROID = AUDIO_RESAMPLER_NULL + 1,
|
||||
INPUT_SDL,
|
||||
INPUT_SDL2,
|
||||
INPUT_X,
|
||||
INPUT_WAYLAND,
|
||||
INPUT_DINPUT,
|
||||
INPUT_PS3,
|
||||
INPUT_PSP,
|
||||
INPUT_CTR,
|
||||
INPUT_XENON360,
|
||||
INPUT_WII,
|
||||
INPUT_WIIU,
|
||||
INPUT_XINPUT,
|
||||
INPUT_UDEV,
|
||||
INPUT_LINUXRAW,
|
||||
INPUT_COCOA,
|
||||
INPUT_QNX,
|
||||
INPUT_RWEBINPUT,
|
||||
INPUT_DOS,
|
||||
INPUT_NULL
|
||||
};
|
||||
|
||||
enum joypad_driver_enum
|
||||
{
|
||||
JOYPAD_PS3 = INPUT_NULL + 1,
|
||||
JOYPAD_XINPUT,
|
||||
JOYPAD_GX,
|
||||
JOYPAD_WIIU,
|
||||
JOYPAD_XDK,
|
||||
JOYPAD_PSP,
|
||||
JOYPAD_CTR,
|
||||
JOYPAD_DINPUT,
|
||||
JOYPAD_UDEV,
|
||||
JOYPAD_LINUXRAW,
|
||||
JOYPAD_ANDROID,
|
||||
JOYPAD_SDL,
|
||||
JOYPAD_DOS,
|
||||
JOYPAD_HID,
|
||||
JOYPAD_QNX,
|
||||
JOYPAD_NULL
|
||||
};
|
||||
|
||||
enum camera_driver_enum
|
||||
{
|
||||
CAMERA_V4L2 = JOYPAD_NULL + 1,
|
||||
CAMERA_RWEBCAM,
|
||||
CAMERA_ANDROID,
|
||||
CAMERA_AVFOUNDATION,
|
||||
CAMERA_NULL
|
||||
};
|
||||
|
||||
enum wifi_driver_enum
|
||||
{
|
||||
WIFI_CONNMANCTL = CAMERA_NULL + 1,
|
||||
WIFI_NULL
|
||||
};
|
||||
|
||||
enum location_driver_enum
|
||||
{
|
||||
LOCATION_ANDROID = WIFI_NULL + 1,
|
||||
LOCATION_CORELOCATION,
|
||||
LOCATION_NULL
|
||||
};
|
||||
|
||||
enum osk_driver_enum
|
||||
{
|
||||
OSK_PS3 = LOCATION_NULL + 1,
|
||||
OSK_NULL
|
||||
};
|
||||
|
||||
enum menu_driver_enum
|
||||
{
|
||||
MENU_RGUI = OSK_NULL + 1,
|
||||
MENU_XUI,
|
||||
MENU_MATERIALUI,
|
||||
MENU_XMB,
|
||||
MENU_NUKLEAR,
|
||||
MENU_NULL
|
||||
};
|
||||
|
||||
enum record_driver_enum
|
||||
{
|
||||
RECORD_FFMPEG = MENU_NULL + 1,
|
||||
RECORD_NULL
|
||||
};
|
||||
|
||||
#if defined(HW_RVL)
|
||||
#define MAX_GAMMA_SETTING 30
|
||||
#elif defined(GEKKO)
|
||||
@@ -188,224 +33,6 @@ enum record_driver_enum
|
||||
#define MAX_GAMMA_SETTING 1
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES) || defined(__CELLOS_LV2__)
|
||||
#define VIDEO_DEFAULT_DRIVER VIDEO_GL
|
||||
#elif defined(GEKKO)
|
||||
#define VIDEO_DEFAULT_DRIVER VIDEO_WII
|
||||
#elif defined(WIIU)
|
||||
#define VIDEO_DEFAULT_DRIVER VIDEO_WIIU
|
||||
#elif defined(XENON)
|
||||
#define VIDEO_DEFAULT_DRIVER VIDEO_XENON360
|
||||
#elif (defined(_XBOX1) || defined(_XBOX360)) && (defined(HAVE_D3D8) || defined(HAVE_D3D9))
|
||||
#define VIDEO_DEFAULT_DRIVER VIDEO_XDK_D3D
|
||||
#elif defined(HAVE_D3D9)
|
||||
#define VIDEO_DEFAULT_DRIVER VIDEO_D3D9
|
||||
#elif defined(HAVE_VG)
|
||||
#define VIDEO_DEFAULT_DRIVER VIDEO_VG
|
||||
#elif defined(HAVE_VITA2D)
|
||||
#define VIDEO_DEFAULT_DRIVER VIDEO_VITA2D
|
||||
#elif defined(PSP)
|
||||
#define VIDEO_DEFAULT_DRIVER VIDEO_PSP1
|
||||
#elif defined(_3DS)
|
||||
#define VIDEO_DEFAULT_DRIVER VIDEO_CTR
|
||||
#elif defined(HAVE_XVIDEO)
|
||||
#define VIDEO_DEFAULT_DRIVER VIDEO_XVIDEO
|
||||
#elif defined(HAVE_SDL)
|
||||
#define VIDEO_DEFAULT_DRIVER VIDEO_SDL
|
||||
#elif defined(HAVE_SDL2)
|
||||
#define VIDEO_DEFAULT_DRIVER VIDEO_SDL2
|
||||
#elif defined(_WIN32) && !defined(_XBOX)
|
||||
#define VIDEO_DEFAULT_DRIVER VIDEO_GDI
|
||||
#elif defined(DJGPP)
|
||||
#define VIDEO_DEFAULT_DRIVER VIDEO_VGA
|
||||
#elif defined(HAVE_DYLIB) && !defined(ANDROID)
|
||||
#define VIDEO_DEFAULT_DRIVER VIDEO_EXT
|
||||
#else
|
||||
#define VIDEO_DEFAULT_DRIVER VIDEO_NULL
|
||||
#endif
|
||||
|
||||
#if defined(__CELLOS_LV2__)
|
||||
#define AUDIO_DEFAULT_DRIVER AUDIO_PS3
|
||||
#elif defined(XENON)
|
||||
#define AUDIO_DEFAULT_DRIVER AUDIO_XENON360
|
||||
#elif defined(GEKKO)
|
||||
#define AUDIO_DEFAULT_DRIVER AUDIO_WII
|
||||
#elif defined(WIIU)
|
||||
#define AUDIO_DEFAULT_DRIVER AUDIO_WIIU
|
||||
#elif defined(PSP) || defined(VITA)
|
||||
#define AUDIO_DEFAULT_DRIVER AUDIO_PSP
|
||||
#elif defined(_3DS)
|
||||
#define AUDIO_DEFAULT_DRIVER AUDIO_CTR
|
||||
#elif defined(HAVE_PULSE)
|
||||
#define AUDIO_DEFAULT_DRIVER AUDIO_PULSE
|
||||
#elif defined(HAVE_ALSA) && defined(HAVE_VIDEOCORE)
|
||||
#define AUDIO_DEFAULT_DRIVER AUDIO_ALSATHREAD
|
||||
#elif defined(HAVE_ALSA)
|
||||
#define AUDIO_DEFAULT_DRIVER AUDIO_ALSA
|
||||
#elif defined(HAVE_OSS)
|
||||
#define AUDIO_DEFAULT_DRIVER AUDIO_OSS
|
||||
#elif defined(HAVE_JACK)
|
||||
#define AUDIO_DEFAULT_DRIVER AUDIO_JACK
|
||||
#elif defined(HAVE_COREAUDIO)
|
||||
#define AUDIO_DEFAULT_DRIVER AUDIO_COREAUDIO
|
||||
#elif defined(HAVE_XAUDIO)
|
||||
#define AUDIO_DEFAULT_DRIVER AUDIO_XAUDIO
|
||||
#elif defined(HAVE_DSOUND)
|
||||
#define AUDIO_DEFAULT_DRIVER AUDIO_DSOUND
|
||||
#elif defined(HAVE_AL)
|
||||
#define AUDIO_DEFAULT_DRIVER AUDIO_AL
|
||||
#elif defined(HAVE_SL)
|
||||
#define AUDIO_DEFAULT_DRIVER AUDIO_SL
|
||||
#elif defined(EMSCRIPTEN)
|
||||
#define AUDIO_DEFAULT_DRIVER AUDIO_RWEBAUDIO
|
||||
#elif defined(HAVE_SDL)
|
||||
#define AUDIO_DEFAULT_DRIVER AUDIO_SDL
|
||||
#elif defined(HAVE_SDL2)
|
||||
#define AUDIO_DEFAULT_DRIVER AUDIO_SDL2
|
||||
#elif defined(HAVE_RSOUND)
|
||||
#define AUDIO_DEFAULT_DRIVER AUDIO_RSOUND
|
||||
#elif defined(HAVE_ROAR)
|
||||
#define AUDIO_DEFAULT_DRIVER AUDIO_ROAR
|
||||
#elif defined(HAVE_DYLIB) && !defined(ANDROID)
|
||||
#define AUDIO_DEFAULT_DRIVER AUDIO_EXT
|
||||
#else
|
||||
#define AUDIO_DEFAULT_DRIVER AUDIO_NULL
|
||||
#endif
|
||||
|
||||
#if defined(PSP) || defined(EMSCRIPTEN)
|
||||
#define AUDIO_DEFAULT_RESAMPLER_DRIVER AUDIO_RESAMPLER_CC
|
||||
#else
|
||||
#define AUDIO_DEFAULT_RESAMPLER_DRIVER AUDIO_RESAMPLER_SINC
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_FFMPEG)
|
||||
#define RECORD_DEFAULT_DRIVER RECORD_FFMPEG
|
||||
#else
|
||||
#define RECORD_DEFAULT_DRIVER RECORD_NULL
|
||||
#endif
|
||||
|
||||
#if defined(XENON)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_XENON360
|
||||
#elif defined(_XBOX360) || defined(_XBOX) || defined(HAVE_XINPUT2) || defined(HAVE_XINPUT_XBOX1)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_XINPUT
|
||||
#elif defined(ANDROID)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_ANDROID
|
||||
#elif defined(EMSCRIPTEN) && defined(HAVE_SDL2)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_SDL2
|
||||
#elif defined(EMSCRIPTEN)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_RWEBINPUT
|
||||
#elif defined(_WIN32)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_DINPUT
|
||||
#elif defined(__CELLOS_LV2__)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_PS3
|
||||
#elif defined(PSP) || defined(VITA)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_PSP
|
||||
#elif defined(_3DS)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_CTR
|
||||
#elif defined(GEKKO)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_WII
|
||||
#elif defined(WIIU)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_WIIU
|
||||
#elif defined(HAVE_UDEV)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_UDEV
|
||||
#elif defined(__linux__) && !defined(ANDROID)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_LINUXRAW
|
||||
#elif defined(HAVE_X11)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_X
|
||||
#elif defined(HAVE_WAYLAND)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_WAYLAND
|
||||
#elif defined(HAVE_COCOA) || defined(HAVE_COCOATOUCH)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_COCOA
|
||||
#elif defined(__QNX__)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_QNX
|
||||
#elif defined(HAVE_SDL)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_SDL
|
||||
#elif defined(HAVE_SDL2)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_SDL2
|
||||
#elif defined(DJGPP)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_DOS
|
||||
#else
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_NULL
|
||||
#endif
|
||||
|
||||
#if defined(__CELLOS_LV2__)
|
||||
#define JOYPAD_DEFAULT_DRIVER JOYPAD_PS3
|
||||
#elif defined(HAVE_XINPUT)
|
||||
#define JOYPAD_DEFAULT_DRIVER JOYPAD_XINPUT
|
||||
#elif defined(GEKKO)
|
||||
#define JOYPAD_DEFAULT_DRIVER JOYPAD_GX
|
||||
#elif defined(WIIU)
|
||||
#define JOYPAD_DEFAULT_DRIVER JOYPAD_WIIU
|
||||
#elif defined(_XBOX)
|
||||
#define JOYPAD_DEFAULT_DRIVER JOYPAD_XDK
|
||||
#elif defined(PSP) || defined(VITA)
|
||||
#define JOYPAD_DEFAULT_DRIVER JOYPAD_PSP
|
||||
#elif defined(_3DS)
|
||||
#define JOYPAD_DEFAULT_DRIVER JOYPAD_CTR
|
||||
#elif defined(HAVE_DINPUT)
|
||||
#define JOYPAD_DEFAULT_DRIVER JOYPAD_DINPUT
|
||||
#elif defined(HAVE_UDEV)
|
||||
#define JOYPAD_DEFAULT_DRIVER JOYPAD_UDEV
|
||||
#elif defined(__linux) && !defined(ANDROID)
|
||||
#define JOYPAD_DEFAULT_DRIVER JOYPAD_LINUXRAW
|
||||
#elif defined(ANDROID)
|
||||
#define JOYPAD_DEFAULT_DRIVER JOYPAD_ANDROID
|
||||
#elif defined(HAVE_SDL) || defined(HAVE_SDL2)
|
||||
#define JOYPAD_DEFAULT_DRIVER JOYPAD_SDL
|
||||
#elif defined(DJGPP)
|
||||
#define JOYPAD_DEFAULT_DRIVER JOYPAD_DOS
|
||||
#elif defined(HAVE_HID)
|
||||
#define JOYPAD_DEFAULT_DRIVER JOYPAD_HID
|
||||
#elif defined(__QNX__)
|
||||
#define JOYPAD_DEFAULT_DRIVER JOYPAD_QNX
|
||||
#else
|
||||
#define JOYPAD_DEFAULT_DRIVER JOYPAD_NULL
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_V4L2)
|
||||
#define CAMERA_DEFAULT_DRIVER CAMERA_V4L2
|
||||
#elif defined(EMSCRIPTEN)
|
||||
#define CAMERA_DEFAULT_DRIVER CAMERA_RWEBCAM
|
||||
#elif defined(ANDROID)
|
||||
#define CAMERA_DEFAULT_DRIVER CAMERA_ANDROID
|
||||
#elif defined(HAVE_AVFOUNDATION) && (defined(HAVE_COCOA) || defined(HAVE_COCOATOUCH))
|
||||
#define CAMERA_DEFAULT_DRIVER CAMERA_AVFOUNDATION
|
||||
#else
|
||||
#define CAMERA_DEFAULT_DRIVER CAMERA_NULL
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_LAKKA)
|
||||
#define WIFI_DEFAULT_DRIVER WIFI_CONNMANCTL
|
||||
#else
|
||||
#define WIFI_DEFAULT_DRIVER WIFI_NULL
|
||||
#endif
|
||||
|
||||
#if defined(ANDROID)
|
||||
#define LOCATION_DEFAULT_DRIVER LOCATION_ANDROID
|
||||
#elif defined(HAVE_CORELOCATION) && (defined(HAVE_COCOA) || defined(HAVE_COCOATOUCH))
|
||||
#define LOCATION_DEFAULT_DRIVER LOCATION_CORELOCATION
|
||||
#else
|
||||
#define LOCATION_DEFAULT_DRIVER LOCATION_NULL
|
||||
#endif
|
||||
|
||||
#if defined(__CELLOS_LV2__)
|
||||
#define OSK_DEFAULT_DRIVER OSK_PS3
|
||||
#else
|
||||
#define OSK_DEFAULT_DRIVER OSK_NULL
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_XUI)
|
||||
#define MENU_DEFAULT_DRIVER MENU_XUI
|
||||
#elif defined(HAVE_MATERIALUI) && defined(RARCH_MOBILE)
|
||||
#define MENU_DEFAULT_DRIVER MENU_MATERIALUI
|
||||
#elif defined(HAVE_XMB)
|
||||
#define MENU_DEFAULT_DRIVER MENU_XMB
|
||||
#elif defined(HAVE_RGUI)
|
||||
#define MENU_DEFAULT_DRIVER MENU_RGUI
|
||||
#else
|
||||
#define MENU_DEFAULT_DRIVER MENU_NULL
|
||||
#endif
|
||||
|
||||
#if defined(XENON) || defined(_XBOX360) || defined(__CELLOS_LV2__)
|
||||
#define DEFAULT_ASPECT_RATIO 1.7778f
|
||||
#elif defined(_XBOX1) || defined(GEKKO) || defined(ANDROID)
|
||||
@@ -420,8 +47,6 @@ static const bool pointer_enable = true;
|
||||
static const bool pointer_enable = false;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Certain platforms might have assets stored in the bundle that
|
||||
* we need to extract to a user-writable directory on first boot.
|
||||
*
|
||||
@@ -601,7 +226,7 @@ static const bool overlay_hide_in_menu = true;
|
||||
static const bool display_keyboard_overlay = false;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#include "menu/menu_display.h"
|
||||
#include "menu/menu_driver.h"
|
||||
|
||||
static bool default_block_config_read = true;
|
||||
|
||||
@@ -619,8 +244,8 @@ static bool xmb_show_settings = true;
|
||||
#ifdef HAVE_IMAGEVIEWER
|
||||
static bool xmb_show_images = true;
|
||||
#endif
|
||||
#ifdef HAVE_FFMPEG
|
||||
static bool xmb_show_music = true;
|
||||
#ifdef HAVE_FFMPEG
|
||||
static bool xmb_show_video = true;
|
||||
#endif
|
||||
#ifdef HAVE_NETWORKING
|
||||
@@ -638,13 +263,11 @@ static float menu_footer_opacity = 1.000;
|
||||
|
||||
static float menu_header_opacity = 1.000;
|
||||
|
||||
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL) || defined(HAVE_VULKAN)
|
||||
#if defined(HAVE_OPENGLES2) || (defined(__MACH__) && (defined(__ppc__) || defined(__ppc64__)))
|
||||
static unsigned menu_shader_pipeline = 1;
|
||||
#else
|
||||
static unsigned menu_shader_pipeline = 2;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static bool show_advanced_settings = false;
|
||||
static const uint32_t menu_entry_normal_color = 0xffffffff;
|
||||
@@ -791,6 +414,13 @@ static const float max_timing_skew = 0.05;
|
||||
/* Default audio volume in dB. (0.0 dB == unity gain). */
|
||||
static const float audio_volume = 0.0;
|
||||
|
||||
#ifdef HAVE_WASAPI
|
||||
/* WASAPI defaults */
|
||||
static const bool wasapi_exclusive_mode = true;
|
||||
static const bool wasapi_float_format = false;
|
||||
static const int wasapi_sh_buffer_length = -16; /* auto */
|
||||
#endif
|
||||
|
||||
/* MISC */
|
||||
|
||||
/* Enables displaying the current frames per second. */
|
||||
@@ -897,7 +527,7 @@ static const unsigned menu_dpi_override_value = 200;
|
||||
#endif
|
||||
|
||||
/* Log level for libretro cores (GET_LOG_INTERFACE). */
|
||||
static const unsigned libretro_log_level = 0;
|
||||
static const unsigned libretro_log_level = 1;
|
||||
|
||||
#ifndef RARCH_DEFAULT_PORT
|
||||
#define RARCH_DEFAULT_PORT 55435
|
||||
@@ -973,6 +603,8 @@ static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/linux/
|
||||
#else
|
||||
static char buildbot_server_url[] = "";
|
||||
#endif
|
||||
#elif defined(WIIU)
|
||||
static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/nintendo/wiiu/latest/";
|
||||
#else
|
||||
static char buildbot_server_url[] = "";
|
||||
#endif
|
||||
|
||||
@@ -194,6 +194,12 @@ static const bool _dsound_supp = true;
|
||||
static const bool _dsound_supp = false;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WASAPI
|
||||
static const bool _wasapi_supp = true;
|
||||
#else
|
||||
static const bool _wasapi_supp = false;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_XAUDIO
|
||||
static const bool _xaudio_supp = true;
|
||||
#else
|
||||
|
||||
+1140
-682
File diff suppressed because it is too large.
Load diff
+340
-397
@@ -23,12 +23,12 @@
|
||||
|
||||
#include <boolean.h>
|
||||
#include <retro_common_api.h>
|
||||
#include <retro_miscellaneous.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "gfx/video_driver.h"
|
||||
#include "input/input_defines.h"
|
||||
|
||||
enum override_type
|
||||
@@ -42,448 +42,391 @@ RETRO_BEGIN_DECLS
|
||||
|
||||
typedef struct settings
|
||||
{
|
||||
video_viewport_t video_viewport_custom;
|
||||
|
||||
char playlist_names[PATH_MAX_LENGTH];
|
||||
char playlist_cores[PATH_MAX_LENGTH];
|
||||
|
||||
bool bundle_finished;
|
||||
|
||||
struct
|
||||
{
|
||||
char driver[32];
|
||||
char context_driver[32];
|
||||
float scale;
|
||||
unsigned window_x;
|
||||
unsigned window_y;
|
||||
bool fullscreen;
|
||||
bool windowed_fullscreen;
|
||||
unsigned monitor_index;
|
||||
unsigned fullscreen_x;
|
||||
unsigned fullscreen_y;
|
||||
bool vsync;
|
||||
bool hard_sync;
|
||||
bool black_frame_insertion;
|
||||
unsigned max_swapchain_images;
|
||||
unsigned swap_interval;
|
||||
unsigned hard_sync_frames;
|
||||
unsigned frame_delay;
|
||||
bool placeholder;
|
||||
|
||||
/* Video */
|
||||
bool video_fullscreen;
|
||||
bool video_windowed_fullscreen;
|
||||
bool video_vsync;
|
||||
bool video_hard_sync;
|
||||
bool video_black_frame_insertion;
|
||||
#ifdef GEKKO
|
||||
unsigned viwidth;
|
||||
bool vfilter;
|
||||
bool video_vfilter;
|
||||
#endif
|
||||
bool smooth;
|
||||
bool force_aspect;
|
||||
bool crop_overscan;
|
||||
float aspect_ratio;
|
||||
bool aspect_ratio_auto;
|
||||
bool scale_integer;
|
||||
unsigned aspect_ratio_idx;
|
||||
unsigned rotation;
|
||||
bool video_smooth;
|
||||
bool video_force_aspect;
|
||||
bool video_crop_overscan;
|
||||
bool video_aspect_ratio_auto;
|
||||
bool video_scale_integer;
|
||||
bool video_shader_enable;
|
||||
bool video_threaded;
|
||||
bool video_font_enable;
|
||||
bool video_disable_composition;
|
||||
bool video_post_filter_record;
|
||||
bool video_gpu_record;
|
||||
bool video_gpu_screenshot;
|
||||
bool video_allow_rotate;
|
||||
bool video_shared_context;
|
||||
bool video_force_srgb_disable;
|
||||
bool video_fps_show;
|
||||
|
||||
bool shader_enable;
|
||||
/* Audio */
|
||||
bool audio_enable;
|
||||
bool audio_sync;
|
||||
bool audio_rate_control;
|
||||
#ifdef HAVE_WASAPI
|
||||
bool audio_wasapi_exclusive_mode;
|
||||
bool audio_wasapi_float_format;
|
||||
#endif
|
||||
|
||||
float refresh_rate;
|
||||
bool threaded;
|
||||
|
||||
|
||||
float font_size;
|
||||
bool font_enable;
|
||||
float msg_pos_x;
|
||||
float msg_pos_y;
|
||||
float msg_color_r;
|
||||
float msg_color_g;
|
||||
float msg_color_b;
|
||||
|
||||
bool disable_composition;
|
||||
|
||||
bool post_filter_record;
|
||||
bool gpu_record;
|
||||
bool gpu_screenshot;
|
||||
|
||||
bool allow_rotate;
|
||||
bool shared_context;
|
||||
bool force_srgb_disable;
|
||||
} video;
|
||||
|
||||
struct
|
||||
{
|
||||
char driver[32];
|
||||
} record;
|
||||
|
||||
struct
|
||||
{
|
||||
bool menubar_enable;
|
||||
bool suspend_screensaver_enable;
|
||||
bool companion_start_on_boot;
|
||||
bool companion_enable;
|
||||
} ui;
|
||||
/* Input */
|
||||
bool input_remap_binds_enable;
|
||||
bool input_autodetect_enable;
|
||||
bool input_overlay_enable;
|
||||
bool input_overlay_enable_autopreferred;
|
||||
bool input_overlay_hide_in_menu;
|
||||
bool input_descriptor_label_show;
|
||||
bool input_descriptor_hide_unbound;
|
||||
bool input_all_users_control_menu;
|
||||
bool input_menu_swap_ok_cancel_buttons;
|
||||
#if defined(VITA)
|
||||
bool input_backtouch_enable;
|
||||
bool input_backtouch_toggle;
|
||||
#endif
|
||||
#if TARGET_OS_IPHONE
|
||||
bool input_small_keyboard_enable;
|
||||
#endif
|
||||
bool input_keyboard_gamepad_enable;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
struct
|
||||
{
|
||||
char driver[32];
|
||||
bool pause_libretro;
|
||||
bool timedate_enable;
|
||||
bool battery_level_enable;
|
||||
bool core_enable;
|
||||
bool dynamic_wallpaper_enable;
|
||||
unsigned thumbnails;
|
||||
bool throttle;
|
||||
|
||||
struct
|
||||
{
|
||||
float opacity;
|
||||
} wallpaper;
|
||||
|
||||
struct
|
||||
{
|
||||
float opacity;
|
||||
} footer;
|
||||
|
||||
struct
|
||||
{
|
||||
float opacity;
|
||||
} header;
|
||||
|
||||
struct
|
||||
{
|
||||
bool enable;
|
||||
} mouse;
|
||||
|
||||
struct
|
||||
{
|
||||
bool enable;
|
||||
} pointer;
|
||||
|
||||
struct
|
||||
{
|
||||
struct
|
||||
{
|
||||
bool enable;
|
||||
} wraparound;
|
||||
struct
|
||||
{
|
||||
struct
|
||||
{
|
||||
bool supported_extensions_enable;
|
||||
} filter;
|
||||
} browser;
|
||||
} navigation;
|
||||
|
||||
struct
|
||||
{
|
||||
bool override_enable;
|
||||
unsigned override_value;
|
||||
} dpi;
|
||||
|
||||
bool show_advanced_settings;
|
||||
|
||||
unsigned entry_normal_color;
|
||||
unsigned entry_hover_color;
|
||||
unsigned title_color;
|
||||
bool throttle_framerate;
|
||||
bool linear_filter;
|
||||
|
||||
struct
|
||||
{
|
||||
unsigned shader_pipeline;
|
||||
char font[PATH_MAX_LENGTH];
|
||||
unsigned scale_factor;
|
||||
unsigned alpha_factor;
|
||||
unsigned theme;
|
||||
unsigned menu_color_theme;
|
||||
bool shadows_enable;
|
||||
bool show_settings;
|
||||
bool show_images;
|
||||
bool show_music;
|
||||
bool show_video;
|
||||
bool show_netplay;
|
||||
bool show_history;
|
||||
bool show_add;
|
||||
} xmb;
|
||||
|
||||
struct
|
||||
{
|
||||
unsigned menu_color_theme;
|
||||
} materialui;
|
||||
|
||||
bool unified_controls;
|
||||
} menu;
|
||||
/* Menu */
|
||||
bool filter_by_current_core;
|
||||
bool menu_show_start_screen;
|
||||
bool menu_pause_libretro;
|
||||
bool menu_timedate_enable;
|
||||
bool menu_battery_level_enable;
|
||||
bool menu_core_enable;
|
||||
bool menu_dynamic_wallpaper_enable;
|
||||
bool menu_throttle;
|
||||
bool menu_mouse_enable;
|
||||
bool menu_pointer_enable;
|
||||
bool menu_navigation_wraparound_enable;
|
||||
bool menu_navigation_browser_filter_supported_extensions_enable;
|
||||
bool menu_dpi_override_enable;
|
||||
bool menu_show_advanced_settings;
|
||||
bool menu_throttle_framerate;
|
||||
bool menu_linear_filter;
|
||||
bool menu_xmb_shadows_enable;
|
||||
bool menu_xmb_show_settings;
|
||||
bool menu_xmb_show_images;
|
||||
bool menu_xmb_show_music;
|
||||
bool menu_xmb_show_video;
|
||||
bool menu_xmb_show_netplay;
|
||||
bool menu_xmb_show_history;
|
||||
bool menu_xmb_show_add;
|
||||
bool menu_unified_controls;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETWORKING
|
||||
/* Netplay */
|
||||
bool netplay_public_announce;
|
||||
bool netplay_start_as_spectator;
|
||||
bool netplay_allow_slaves;
|
||||
bool netplay_require_slaves;
|
||||
bool netplay_stateless_mode;
|
||||
bool netplay_swap_input;
|
||||
bool netplay_nat_traversal;
|
||||
bool netplay_use_mitm_server;
|
||||
#endif
|
||||
|
||||
/* Network */
|
||||
bool network_buildbot_auto_extract_archive;
|
||||
|
||||
/* UI */
|
||||
bool ui_menubar_enable;
|
||||
bool ui_suspend_screensaver_enable;
|
||||
bool ui_companion_start_on_boot;
|
||||
bool ui_companion_enable;
|
||||
|
||||
#ifdef HAVE_CHEEVOS
|
||||
/* Cheevos */
|
||||
bool cheevos_enable;
|
||||
bool cheevos_test_unofficial;
|
||||
bool cheevos_hardcore_mode_enable;
|
||||
#endif
|
||||
|
||||
/* Camera */
|
||||
bool camera_allow;
|
||||
|
||||
/* WiFi */
|
||||
bool wifi_allow;
|
||||
|
||||
/* Location */
|
||||
bool location_allow;
|
||||
|
||||
/* Multimedia */
|
||||
bool multimedia_builtin_mediaplayer_enable;
|
||||
bool multimedia_builtin_imageviewer_enable;
|
||||
|
||||
/* Bundle */
|
||||
bool bundle_finished;
|
||||
bool bundle_assets_extract_enable;
|
||||
|
||||
/* Misc. */
|
||||
#ifdef HAVE_THREADS
|
||||
bool threaded_data_runloop_enable;
|
||||
bool threaded_data_runloop_enable;
|
||||
#endif
|
||||
bool set_supports_no_game_enable;
|
||||
bool auto_screenshot_filename;
|
||||
bool history_list_enable;
|
||||
bool playlist_entry_remove;
|
||||
bool rewind_enable;
|
||||
bool pause_nonactive;
|
||||
bool block_sram_overwrite;
|
||||
bool savestate_auto_index;
|
||||
bool savestate_auto_save;
|
||||
bool savestate_auto_load;
|
||||
bool savestate_thumbnail_enable;
|
||||
bool network_cmd_enable;
|
||||
bool stdin_cmd_enable;
|
||||
bool network_remote_enable;
|
||||
bool network_remote_enable_user[MAX_USERS];
|
||||
bool load_dummy_on_core_shutdown;
|
||||
bool check_firmware_before_loading;
|
||||
|
||||
bool game_specific_options;
|
||||
bool auto_overrides_enable;
|
||||
bool auto_remaps_enable;
|
||||
bool auto_shaders_enable;
|
||||
|
||||
bool sort_savefiles_enable;
|
||||
bool sort_savestates_enable;
|
||||
bool config_save_on_exit;
|
||||
bool show_hidden_files;
|
||||
#ifdef HAVE_LAKKA
|
||||
bool ssh_enable;
|
||||
bool samba_enable;
|
||||
bool bluetooth_enable;
|
||||
#endif
|
||||
} bools;
|
||||
|
||||
struct
|
||||
{
|
||||
char driver[32];
|
||||
char device[255];
|
||||
bool allow;
|
||||
unsigned width;
|
||||
unsigned height;
|
||||
} camera;
|
||||
float placeholder;
|
||||
float video_scale;
|
||||
float video_aspect_ratio;
|
||||
float video_refresh_rate;
|
||||
float video_font_size;
|
||||
float video_msg_pos_x;
|
||||
float video_msg_pos_y;
|
||||
float video_msg_color_r;
|
||||
float video_msg_color_g;
|
||||
float video_msg_color_b;
|
||||
|
||||
float menu_wallpaper_opacity;
|
||||
float menu_footer_opacity;
|
||||
float menu_header_opacity;
|
||||
|
||||
float audio_max_timing_skew;
|
||||
float audio_volume; /* dB scale. */
|
||||
|
||||
float input_overlay_opacity;
|
||||
float input_overlay_scale;
|
||||
|
||||
float slowmotion_ratio;
|
||||
float fastforward_ratio;
|
||||
} floats;
|
||||
|
||||
struct
|
||||
{
|
||||
char driver[32];
|
||||
bool allow;
|
||||
} wifi;
|
||||
int placeholder;
|
||||
int netplay_check_frames;
|
||||
int location_update_interval_ms;
|
||||
int location_update_interval_distance;
|
||||
int state_slot;
|
||||
|
||||
#ifdef HAVE_WASAPI
|
||||
int audio_wasapi_sh_buffer_length;
|
||||
#endif
|
||||
} ints;
|
||||
|
||||
struct
|
||||
{
|
||||
char driver[32];
|
||||
bool allow;
|
||||
int update_interval_ms;
|
||||
int update_interval_distance;
|
||||
} location;
|
||||
|
||||
struct
|
||||
{
|
||||
char driver[32];
|
||||
char resampler[32];
|
||||
char device[255];
|
||||
bool enable;
|
||||
bool mute_enable;
|
||||
unsigned out_rate;
|
||||
unsigned block_frames;
|
||||
unsigned latency;
|
||||
bool sync;
|
||||
|
||||
|
||||
bool rate_control;
|
||||
float rate_control_delta;
|
||||
float max_timing_skew;
|
||||
float volume; /* dB scale. */
|
||||
} audio;
|
||||
|
||||
struct
|
||||
{
|
||||
char driver[32];
|
||||
char joypad_driver[32];
|
||||
char keyboard_layout[64];
|
||||
char device_names[MAX_USERS][64];
|
||||
|
||||
unsigned remap_ids[MAX_USERS][RARCH_BIND_LIST_END];
|
||||
struct retro_keybind binds[MAX_USERS][RARCH_BIND_LIST_END];
|
||||
struct retro_keybind autoconf_binds[MAX_USERS][RARCH_BIND_LIST_END];
|
||||
|
||||
unsigned max_users;
|
||||
unsigned placeholder;
|
||||
unsigned audio_out_rate;
|
||||
unsigned audio_block_frames;
|
||||
unsigned audio_latency;
|
||||
unsigned input_remap_ids[MAX_USERS][RARCH_BIND_LIST_END];
|
||||
|
||||
/* Set by autoconfiguration in joypad_autoconfig_dir.
|
||||
* Does not override main binds. */
|
||||
bool autoconfigured[MAX_USERS];
|
||||
int vid[MAX_USERS];
|
||||
int pid[MAX_USERS];
|
||||
unsigned input_libretro_device[MAX_USERS];
|
||||
unsigned input_analog_dpad_mode[MAX_USERS];
|
||||
|
||||
unsigned libretro_device[MAX_USERS];
|
||||
unsigned analog_dpad_mode[MAX_USERS];
|
||||
unsigned input_joypad_map[MAX_USERS];
|
||||
unsigned input_device[MAX_USERS];
|
||||
|
||||
bool remap_binds_enable;
|
||||
float axis_threshold;
|
||||
unsigned joypad_map[MAX_USERS];
|
||||
unsigned device[MAX_USERS];
|
||||
unsigned device_name_index[MAX_USERS];
|
||||
bool autodetect_enable;
|
||||
unsigned input_turbo_period;
|
||||
unsigned input_turbo_duty_cycle;
|
||||
|
||||
unsigned turbo_period;
|
||||
unsigned turbo_duty_cycle;
|
||||
unsigned input_bind_timeout;
|
||||
|
||||
bool overlay_enable;
|
||||
bool overlay_enable_autopreferred;
|
||||
bool overlay_hide_in_menu;
|
||||
float overlay_opacity;
|
||||
float overlay_scale;
|
||||
|
||||
unsigned bind_timeout;
|
||||
bool input_descriptor_label_show;
|
||||
bool input_descriptor_hide_unbound;
|
||||
|
||||
unsigned menu_toggle_gamepad_combo;
|
||||
bool all_users_control_menu;
|
||||
|
||||
bool menu_swap_ok_cancel_buttons;
|
||||
#if defined(VITA)
|
||||
bool backtouch_enable;
|
||||
bool backtouch_toggle;
|
||||
unsigned input_menu_toggle_gamepad_combo;
|
||||
unsigned input_keyboard_gamepad_mapping_type;
|
||||
unsigned input_poll_type_behavior;
|
||||
unsigned netplay_port;
|
||||
unsigned netplay_input_latency_frames_min;
|
||||
unsigned netplay_input_latency_frames_range;
|
||||
unsigned bundle_assets_extract_version_current;
|
||||
unsigned bundle_assets_extract_last_version;
|
||||
unsigned content_history_size;
|
||||
unsigned libretro_log_level;
|
||||
unsigned rewind_granularity;
|
||||
unsigned autosave_interval;
|
||||
unsigned network_cmd_port;
|
||||
unsigned network_remote_base_port;
|
||||
unsigned video_window_x;
|
||||
unsigned video_window_y;
|
||||
unsigned video_monitor_index;
|
||||
unsigned video_fullscreen_x;
|
||||
unsigned video_fullscreen_y;
|
||||
unsigned video_max_swapchain_images;
|
||||
unsigned video_swap_interval;
|
||||
unsigned video_hard_sync_frames;
|
||||
unsigned video_frame_delay;
|
||||
#ifdef GEKKO
|
||||
unsigned video_viwidth;
|
||||
#endif
|
||||
#if TARGET_OS_IPHONE
|
||||
bool small_keyboard_enable;
|
||||
unsigned video_aspect_ratio_idx;
|
||||
unsigned video_rotation;
|
||||
|
||||
unsigned menu_thumbnails;
|
||||
unsigned menu_dpi_override_value;
|
||||
unsigned menu_entry_normal_color;
|
||||
unsigned menu_entry_hover_color;
|
||||
unsigned menu_title_color;
|
||||
unsigned menu_xmb_shader_pipeline;
|
||||
unsigned menu_xmb_scale_factor;
|
||||
unsigned menu_xmb_alpha_factor;
|
||||
unsigned menu_xmb_theme;
|
||||
unsigned menu_xmb_color_theme;
|
||||
unsigned menu_materialui_color_theme;
|
||||
|
||||
unsigned camera_width;
|
||||
unsigned camera_height;
|
||||
} uints;
|
||||
|
||||
struct
|
||||
{
|
||||
char placeholder;
|
||||
|
||||
char playlist_names[PATH_MAX_LENGTH];
|
||||
char playlist_cores[PATH_MAX_LENGTH];
|
||||
char video_driver[32];
|
||||
char record_driver[32];
|
||||
char camera_driver[32];
|
||||
char wifi_driver[32];
|
||||
char location_driver[32];
|
||||
#ifdef HAVE_MENU
|
||||
char menu_driver[32];
|
||||
#endif
|
||||
bool keyboard_gamepad_enable;
|
||||
unsigned keyboard_gamepad_mapping_type;
|
||||
unsigned poll_type_behavior;
|
||||
} input;
|
||||
|
||||
struct
|
||||
{
|
||||
unsigned mode;
|
||||
} archive;
|
||||
|
||||
struct
|
||||
{
|
||||
char buildbot_url[255];
|
||||
char buildbot_assets_url[255];
|
||||
bool buildbot_auto_extract_archive;
|
||||
} network;
|
||||
|
||||
bool set_supports_no_game_enable;
|
||||
|
||||
struct
|
||||
{
|
||||
bool builtin_mediaplayer_enable;
|
||||
bool builtin_imageviewer_enable;
|
||||
} multimedia;
|
||||
|
||||
char audio_device[255];
|
||||
char camera_device[255];
|
||||
#ifdef HAVE_CHEEVOS
|
||||
struct
|
||||
{
|
||||
bool enable;
|
||||
bool test_unofficial;
|
||||
bool hardcore_mode_enable;
|
||||
char username[32];
|
||||
char password[32];
|
||||
} cheevos;
|
||||
char cheevos_username[32];
|
||||
char cheevos_password[32];
|
||||
#endif
|
||||
|
||||
char browse_url[4096];
|
||||
|
||||
int state_slot;
|
||||
|
||||
bool bundle_assets_extract_enable;
|
||||
unsigned bundle_assets_extract_version_current;
|
||||
unsigned bundle_assets_extract_last_version;
|
||||
|
||||
struct
|
||||
{
|
||||
char cheat_database[PATH_MAX_LENGTH];
|
||||
char content_database[PATH_MAX_LENGTH];
|
||||
char overlay[PATH_MAX_LENGTH];
|
||||
char menu_wallpaper[PATH_MAX_LENGTH];
|
||||
char audio_dsp_plugin[PATH_MAX_LENGTH];
|
||||
char softfilter_plugin[PATH_MAX_LENGTH];
|
||||
char core_options[PATH_MAX_LENGTH];
|
||||
char content_history[PATH_MAX_LENGTH];
|
||||
char content_music_history[PATH_MAX_LENGTH];
|
||||
char content_image_history[PATH_MAX_LENGTH];
|
||||
char content_video_history[PATH_MAX_LENGTH];
|
||||
char libretro_info[PATH_MAX_LENGTH];
|
||||
char cheat_settings[PATH_MAX_LENGTH];
|
||||
char video_context_driver[32];
|
||||
char audio_driver[32];
|
||||
char audio_resampler[32];
|
||||
char input_driver[32];
|
||||
char input_joypad_driver[32];
|
||||
char input_keyboard_layout[64];
|
||||
char bundle_assets_src[PATH_MAX_LENGTH];
|
||||
char bundle_assets_dst[PATH_MAX_LENGTH];
|
||||
char bundle_assets_dst_subdir[PATH_MAX_LENGTH];
|
||||
char shader[PATH_MAX_LENGTH];
|
||||
char font[PATH_MAX_LENGTH];
|
||||
} path;
|
||||
} arrays;
|
||||
|
||||
struct
|
||||
{
|
||||
char audio_filter[PATH_MAX_LENGTH];
|
||||
char autoconfig[PATH_MAX_LENGTH];
|
||||
char video_filter[PATH_MAX_LENGTH];
|
||||
char video_shader[PATH_MAX_LENGTH];
|
||||
char content_history[PATH_MAX_LENGTH];
|
||||
char libretro[PATH_MAX_LENGTH];
|
||||
char cursor[PATH_MAX_LENGTH];
|
||||
char input_remapping[PATH_MAX_LENGTH];
|
||||
char overlay[PATH_MAX_LENGTH];
|
||||
char resampler[PATH_MAX_LENGTH];
|
||||
char screenshot[PATH_MAX_LENGTH];
|
||||
char system[PATH_MAX_LENGTH];
|
||||
char cache[PATH_MAX_LENGTH];
|
||||
char playlist[PATH_MAX_LENGTH];
|
||||
char core_assets[PATH_MAX_LENGTH];
|
||||
char assets[PATH_MAX_LENGTH];
|
||||
char dynamic_wallpapers[PATH_MAX_LENGTH];
|
||||
char thumbnails[PATH_MAX_LENGTH];
|
||||
char menu_config[PATH_MAX_LENGTH];
|
||||
char menu_content[PATH_MAX_LENGTH];
|
||||
} directory;
|
||||
char placeholder;
|
||||
|
||||
|
||||
char browse_url[4096];
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
char path_menu_xmb_font[PATH_MAX_LENGTH];
|
||||
#endif
|
||||
char path_cheat_database[PATH_MAX_LENGTH];
|
||||
char path_content_database[PATH_MAX_LENGTH];
|
||||
char path_overlay[PATH_MAX_LENGTH];
|
||||
char path_menu_wallpaper[PATH_MAX_LENGTH];
|
||||
char path_audio_dsp_plugin[PATH_MAX_LENGTH];
|
||||
char path_softfilter_plugin[PATH_MAX_LENGTH];
|
||||
char path_core_options[PATH_MAX_LENGTH];
|
||||
char path_content_history[PATH_MAX_LENGTH];
|
||||
char path_content_music_history[PATH_MAX_LENGTH];
|
||||
char path_content_image_history[PATH_MAX_LENGTH];
|
||||
char path_content_video_history[PATH_MAX_LENGTH];
|
||||
char path_libretro_info[PATH_MAX_LENGTH];
|
||||
char path_cheat_settings[PATH_MAX_LENGTH];
|
||||
char path_shader[PATH_MAX_LENGTH];
|
||||
char path_font[PATH_MAX_LENGTH];
|
||||
|
||||
char network_buildbot_url[255];
|
||||
char network_buildbot_assets_url[255];
|
||||
|
||||
char directory_audio_filter[PATH_MAX_LENGTH];
|
||||
char directory_autoconfig[PATH_MAX_LENGTH];
|
||||
char directory_video_filter[PATH_MAX_LENGTH];
|
||||
char directory_video_shader[PATH_MAX_LENGTH];
|
||||
char directory_content_history[PATH_MAX_LENGTH];
|
||||
char directory_libretro[PATH_MAX_LENGTH];
|
||||
char directory_cursor[PATH_MAX_LENGTH];
|
||||
char directory_input_remapping[PATH_MAX_LENGTH];
|
||||
char directory_overlay[PATH_MAX_LENGTH];
|
||||
char directory_resampler[PATH_MAX_LENGTH];
|
||||
char directory_screenshot[PATH_MAX_LENGTH];
|
||||
char directory_system[PATH_MAX_LENGTH];
|
||||
char directory_cache[PATH_MAX_LENGTH];
|
||||
char directory_playlist[PATH_MAX_LENGTH];
|
||||
char directory_core_assets[PATH_MAX_LENGTH];
|
||||
char directory_assets[PATH_MAX_LENGTH];
|
||||
char directory_dynamic_wallpapers[PATH_MAX_LENGTH];
|
||||
char directory_thumbnails[PATH_MAX_LENGTH];
|
||||
char directory_menu_config[PATH_MAX_LENGTH];
|
||||
char directory_menu_content[PATH_MAX_LENGTH];
|
||||
#ifdef HAVE_NETWORKING
|
||||
struct
|
||||
{
|
||||
bool public_announce;
|
||||
char server[255];
|
||||
unsigned port;
|
||||
bool start_as_spectator;
|
||||
bool allow_slaves;
|
||||
bool require_slaves;
|
||||
bool stateless_mode;
|
||||
int check_frames;
|
||||
unsigned input_latency_frames_min;
|
||||
unsigned input_latency_frames_range;
|
||||
bool swap_input;
|
||||
bool nat_traversal;
|
||||
char password[128];
|
||||
char spectate_password[128];
|
||||
bool use_mitm_server;
|
||||
} netplay;
|
||||
char netplay_server[255];
|
||||
char netplay_password[128];
|
||||
char netplay_spectate_password[128];
|
||||
#endif
|
||||
char username[32];
|
||||
} paths;
|
||||
|
||||
unsigned content_history_size;
|
||||
bool modified;
|
||||
|
||||
unsigned libretro_log_level;
|
||||
|
||||
bool auto_screenshot_filename;
|
||||
|
||||
bool history_list_enable;
|
||||
bool playlist_entry_remove;
|
||||
bool rewind_enable;
|
||||
size_t rewind_buffer_size;
|
||||
unsigned rewind_granularity;
|
||||
|
||||
float slowmotion_ratio;
|
||||
float fastforward_ratio;
|
||||
|
||||
bool pause_nonactive;
|
||||
unsigned autosave_interval;
|
||||
|
||||
bool block_sram_overwrite;
|
||||
bool savestate_auto_index;
|
||||
bool savestate_auto_save;
|
||||
bool savestate_auto_load;
|
||||
bool savestate_thumbnail_enable;
|
||||
|
||||
bool network_cmd_enable;
|
||||
unsigned network_cmd_port;
|
||||
bool stdin_cmd_enable;
|
||||
bool network_remote_enable;
|
||||
bool network_remote_enable_user[MAX_USERS];
|
||||
unsigned network_remote_base_port;
|
||||
|
||||
#if defined(HAVE_MENU)
|
||||
bool menu_show_start_screen;
|
||||
#endif
|
||||
bool fps_show;
|
||||
bool load_dummy_on_core_shutdown;
|
||||
bool check_firmware_before_loading;
|
||||
|
||||
bool game_specific_options;
|
||||
bool auto_overrides_enable;
|
||||
bool auto_remaps_enable;
|
||||
bool auto_shaders_enable;
|
||||
|
||||
bool sort_savefiles_enable;
|
||||
bool sort_savestates_enable;
|
||||
|
||||
char username[32];
|
||||
#ifdef HAVE_LANGEXTRA
|
||||
unsigned int user_language;
|
||||
#endif
|
||||
|
||||
bool config_save_on_exit;
|
||||
bool show_hidden_files;
|
||||
|
||||
#ifdef HAVE_LAKKA
|
||||
bool ssh_enable;
|
||||
bool samba_enable;
|
||||
bool bluetooth_enable;
|
||||
#endif
|
||||
|
||||
} settings_t;
|
||||
|
||||
#define configuration_set_float(settings, var, newvar) \
|
||||
settings->modified = true; \
|
||||
var = newvar
|
||||
|
||||
#define configuration_set_bool(settings, var, newvar) \
|
||||
settings->modified = true; \
|
||||
var = newvar
|
||||
|
||||
#define configuration_set_uint(settings, var, newvar) \
|
||||
settings->modified = true; \
|
||||
var = newvar
|
||||
|
||||
#define configuration_set_int(settings, var, newvar) \
|
||||
settings->modified = true; \
|
||||
var = newvar
|
||||
|
||||
/**
|
||||
* config_get_default_camera:
|
||||
*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2016-2017 - Brad Parker
|
||||
*
|
||||
* RetroArch 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 Found-
|
||||
@@ -66,7 +66,7 @@ void content_set_does_not_need_content(void);
|
||||
|
||||
void content_unset_does_not_need_content(void);
|
||||
|
||||
bool content_get_crc(uint32_t **content_crc_ptr);
|
||||
uint32_t content_get_crc(void);
|
||||
|
||||
void content_deinit(void);
|
||||
|
||||
|
||||
@@ -60,6 +60,7 @@ typedef struct rarch_system_info
|
||||
|
||||
unsigned rotation;
|
||||
unsigned performance_level;
|
||||
bool load_no_content;
|
||||
|
||||
const char *input_desc_btn[MAX_USERS][RARCH_FIRST_META_KEY];
|
||||
char valid_extensions[255];
|
||||
@@ -141,14 +142,6 @@ typedef struct retro_ctx_environ_info
|
||||
retro_environment_t env;
|
||||
} retro_ctx_environ_info_t;
|
||||
|
||||
typedef struct retro_ctx_frame_info
|
||||
{
|
||||
const void *data;
|
||||
unsigned width;
|
||||
unsigned height;
|
||||
size_t pitch;
|
||||
} retro_ctx_frame_info_t;
|
||||
|
||||
typedef struct retro_callbacks
|
||||
{
|
||||
retro_video_refresh_t frame_cb;
|
||||
@@ -162,7 +155,7 @@ bool core_load(unsigned poll_type_behavior);
|
||||
|
||||
bool core_unload(void);
|
||||
|
||||
bool core_set_default_callbacks(void *data);
|
||||
bool core_set_default_callbacks(struct retro_callbacks *cbs);
|
||||
|
||||
bool core_set_rewind_callbacks(void);
|
||||
|
||||
@@ -185,10 +178,6 @@ bool core_unload_game(void);
|
||||
|
||||
bool core_reset(void);
|
||||
|
||||
void core_frame(retro_ctx_frame_info_t *info);
|
||||
|
||||
bool core_poll(void);
|
||||
|
||||
bool core_set_environment(retro_ctx_environ_info_t *info);
|
||||
|
||||
bool core_serialize_size(retro_ctx_size_info_t *info);
|
||||
@@ -249,6 +238,8 @@ bool core_is_inited(void);
|
||||
|
||||
bool core_is_game_loaded(void);
|
||||
|
||||
extern struct retro_callbacks retro_ctx;
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
+93
-114
@@ -1,8 +1,8 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2012-2015 - Michael Lelli
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
* Copyright (C) 2016-2017 - Brad Parker
|
||||
*
|
||||
* RetroArch 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 Found-
|
||||
@@ -44,39 +44,44 @@
|
||||
#include "gfx/video_driver.h"
|
||||
#include "audio/audio_driver.h"
|
||||
|
||||
static unsigned core_poll_type = POLL_TYPE_EARLY;
|
||||
static bool core_inited = false;
|
||||
static bool core_symbols_inited = false;
|
||||
static bool core_game_loaded = false;
|
||||
static bool core_input_polled = false;
|
||||
static bool core_has_set_input_descriptors = false;
|
||||
static uint64_t core_serialization_quirks_v = 0;
|
||||
struct retro_callbacks retro_ctx;
|
||||
struct retro_core_t current_core;
|
||||
|
||||
static struct retro_callbacks retro_ctx;
|
||||
static struct retro_core_t core;
|
||||
static void retro_run_null(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void retro_frame_null(const void *data, unsigned width,
|
||||
unsigned height, size_t pitch)
|
||||
{
|
||||
}
|
||||
|
||||
static void retro_input_poll_null(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void core_input_state_poll_maybe(void)
|
||||
{
|
||||
if (core_poll_type == POLL_TYPE_NORMAL)
|
||||
if (current_core.poll_type == POLL_TYPE_NORMAL)
|
||||
input_poll();
|
||||
}
|
||||
|
||||
static int16_t core_input_state_poll(unsigned port,
|
||||
unsigned device, unsigned idx, unsigned id)
|
||||
{
|
||||
if (core_poll_type == POLL_TYPE_LATE)
|
||||
if (current_core.poll_type == POLL_TYPE_LATE)
|
||||
{
|
||||
if (!core_input_polled)
|
||||
if (!current_core.input_polled)
|
||||
input_poll();
|
||||
|
||||
core_input_polled = true;
|
||||
current_core.input_polled = true;
|
||||
}
|
||||
return input_state(port, device, idx, id);
|
||||
}
|
||||
|
||||
void core_set_input_state(retro_ctx_input_state_info_t *info)
|
||||
{
|
||||
core.retro_set_input_state(info->cb);
|
||||
current_core.retro_set_input_state(info->cb);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,18 +91,13 @@ void core_set_input_state(retro_ctx_input_state_info_t *info)
|
||||
* Initializes libretro callbacks, and binds the libretro callbacks
|
||||
* to default callback functions.
|
||||
**/
|
||||
static bool core_init_libretro_cbs(void *data)
|
||||
static bool core_init_libretro_cbs(struct retro_callbacks *cbs)
|
||||
{
|
||||
struct retro_callbacks *cbs = (struct retro_callbacks*)data;
|
||||
|
||||
if (!cbs)
|
||||
return false;
|
||||
|
||||
core.retro_set_video_refresh(video_driver_frame);
|
||||
core.retro_set_audio_sample(audio_driver_sample);
|
||||
core.retro_set_audio_sample_batch(audio_driver_sample_batch);
|
||||
core.retro_set_input_state(core_input_state_poll);
|
||||
core.retro_set_input_poll(core_input_state_poll_maybe);
|
||||
current_core.retro_set_video_refresh(video_driver_frame);
|
||||
current_core.retro_set_audio_sample(audio_driver_sample);
|
||||
current_core.retro_set_audio_sample_batch(audio_driver_sample_batch);
|
||||
current_core.retro_set_input_state(core_input_state_poll);
|
||||
current_core.retro_set_input_poll(core_input_state_poll_maybe);
|
||||
|
||||
core_set_default_callbacks(cbs);
|
||||
|
||||
@@ -117,13 +117,8 @@ static bool core_init_libretro_cbs(void *data)
|
||||
*
|
||||
* Binds the libretro callbacks to default callback functions.
|
||||
**/
|
||||
bool core_set_default_callbacks(void *data)
|
||||
bool core_set_default_callbacks(struct retro_callbacks *cbs)
|
||||
{
|
||||
struct retro_callbacks *cbs = (struct retro_callbacks*)data;
|
||||
|
||||
if (!cbs)
|
||||
return false;
|
||||
|
||||
cbs->frame_cb = video_driver_frame;
|
||||
cbs->sample_cb = audio_driver_sample;
|
||||
cbs->sample_batch_cb = audio_driver_sample_batch;
|
||||
@@ -141,13 +136,13 @@ bool core_deinit(void *data)
|
||||
if (!cbs)
|
||||
return false;
|
||||
|
||||
cbs->frame_cb = NULL;
|
||||
cbs->frame_cb = retro_frame_null;
|
||||
cbs->sample_cb = NULL;
|
||||
cbs->sample_batch_cb = NULL;
|
||||
cbs->state_cb = NULL;
|
||||
cbs->poll_cb = NULL;
|
||||
cbs->poll_cb = retro_input_poll_null;
|
||||
|
||||
core_inited = false;
|
||||
current_core.inited = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -167,13 +162,13 @@ bool core_set_rewind_callbacks(void)
|
||||
{
|
||||
if (state_manager_frame_is_reversed())
|
||||
{
|
||||
core.retro_set_audio_sample(audio_driver_sample_rewind);
|
||||
core.retro_set_audio_sample_batch(audio_driver_sample_batch_rewind);
|
||||
current_core.retro_set_audio_sample(audio_driver_sample_rewind);
|
||||
current_core.retro_set_audio_sample_batch(audio_driver_sample_batch_rewind);
|
||||
}
|
||||
else
|
||||
{
|
||||
core.retro_set_audio_sample(audio_driver_sample);
|
||||
core.retro_set_audio_sample_batch(audio_driver_sample_batch);
|
||||
current_core.retro_set_audio_sample(audio_driver_sample);
|
||||
current_core.retro_set_audio_sample_batch(audio_driver_sample_batch);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -188,13 +183,13 @@ bool core_set_rewind_callbacks(void)
|
||||
bool core_set_netplay_callbacks(void)
|
||||
{
|
||||
/* Force normal poll type for netplay. */
|
||||
core_poll_type = POLL_TYPE_NORMAL;
|
||||
current_core.poll_type = POLL_TYPE_NORMAL;
|
||||
|
||||
/* And use netplay's interceding callbacks */
|
||||
core.retro_set_video_refresh(video_frame_net);
|
||||
core.retro_set_audio_sample(audio_sample_net);
|
||||
core.retro_set_audio_sample_batch(audio_sample_batch_net);
|
||||
core.retro_set_input_state(input_state_net);
|
||||
current_core.retro_set_video_refresh(video_frame_net);
|
||||
current_core.retro_set_audio_sample(audio_sample_net);
|
||||
current_core.retro_set_audio_sample_batch(audio_sample_batch_net);
|
||||
current_core.retro_set_input_state(input_state_net);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -211,10 +206,10 @@ bool core_unset_netplay_callbacks(void)
|
||||
if (!core_set_default_callbacks(&cbs))
|
||||
return false;
|
||||
|
||||
core.retro_set_video_refresh(cbs.frame_cb);
|
||||
core.retro_set_audio_sample(cbs.sample_cb);
|
||||
core.retro_set_audio_sample_batch(cbs.sample_batch_cb);
|
||||
core.retro_set_input_state(cbs.state_cb);
|
||||
current_core.retro_set_video_refresh(cbs.frame_cb);
|
||||
current_core.retro_set_audio_sample(cbs.sample_cb);
|
||||
current_core.retro_set_audio_sample_batch(cbs.sample_batch_cb);
|
||||
current_core.retro_set_input_state(cbs.state_cb);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -222,13 +217,13 @@ bool core_unset_netplay_callbacks(void)
|
||||
|
||||
bool core_set_cheat(retro_ctx_cheat_info_t *info)
|
||||
{
|
||||
core.retro_cheat_set(info->index, info->enabled, info->code);
|
||||
current_core.retro_cheat_set(info->index, info->enabled, info->code);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_reset_cheat(void)
|
||||
{
|
||||
core.retro_cheat_reset();
|
||||
current_core.retro_cheat_reset();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -236,29 +231,30 @@ bool core_api_version(retro_ctx_api_info_t *api)
|
||||
{
|
||||
if (!api)
|
||||
return false;
|
||||
api->version = core.retro_api_version();
|
||||
api->version = current_core.retro_api_version();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_set_poll_type(unsigned *type)
|
||||
{
|
||||
core_poll_type = *type;
|
||||
current_core.poll_type = *type;
|
||||
return true;
|
||||
}
|
||||
|
||||
void core_uninit_symbols(void)
|
||||
{
|
||||
uninit_libretro_sym(&core);
|
||||
core_symbols_inited = false;
|
||||
uninit_libretro_sym(¤t_core);
|
||||
current_core.symbols_inited = false;
|
||||
}
|
||||
|
||||
bool core_init_symbols(enum rarch_core_type *type)
|
||||
{
|
||||
if (!type)
|
||||
if (!type || !init_libretro_sym(*type, ¤t_core))
|
||||
return false;
|
||||
if (!init_libretro_sym(*type, &core))
|
||||
return false;
|
||||
core_symbols_inited = true;
|
||||
|
||||
if (!current_core.retro_run)
|
||||
current_core.retro_run = retro_run_null;
|
||||
current_core.symbols_inited = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -266,7 +262,7 @@ bool core_set_controller_port_device(retro_ctx_controller_info_t *pad)
|
||||
{
|
||||
if (!pad)
|
||||
return false;
|
||||
core.retro_set_controller_port_device(pad->port, pad->device);
|
||||
current_core.retro_set_controller_port_device(pad->port, pad->device);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -274,8 +270,8 @@ bool core_get_memory(retro_ctx_memory_info_t *info)
|
||||
{
|
||||
if (!info)
|
||||
return false;
|
||||
info->size = core.retro_get_memory_size(info->id);
|
||||
info->data = core.retro_get_memory_data(info->id);
|
||||
info->size = current_core.retro_get_memory_size(info->id);
|
||||
info->data = current_core.retro_get_memory_data(info->id);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -287,31 +283,29 @@ bool core_load_game(retro_ctx_load_content_info_t *load_info)
|
||||
content_get_status(&contentless, &is_inited);
|
||||
|
||||
if (load_info && load_info->special)
|
||||
core_game_loaded = core.retro_load_game_special(
|
||||
current_core.game_loaded = current_core.retro_load_game_special(
|
||||
load_info->special->id, load_info->info, load_info->content->size);
|
||||
else if (load_info && !string_is_empty(load_info->content->elems[0].data))
|
||||
core_game_loaded = core.retro_load_game(load_info->info);
|
||||
current_core.game_loaded = current_core.retro_load_game(load_info->info);
|
||||
else if (contentless)
|
||||
core_game_loaded = core.retro_load_game(NULL);
|
||||
current_core.game_loaded = current_core.retro_load_game(NULL);
|
||||
else
|
||||
core_game_loaded = false;
|
||||
current_core.game_loaded = false;
|
||||
|
||||
return core_game_loaded;
|
||||
return current_core.game_loaded;
|
||||
}
|
||||
|
||||
bool core_get_system_info(struct retro_system_info *system)
|
||||
{
|
||||
if (!system)
|
||||
return false;
|
||||
core.retro_get_system_info(system);
|
||||
current_core.retro_get_system_info(system);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_unserialize(retro_ctx_serialize_info_t *info)
|
||||
{
|
||||
if (!info)
|
||||
return false;
|
||||
if (!core.retro_unserialize(info->data_const, info->size))
|
||||
if (!info || !current_core.retro_unserialize(info->data_const, info->size))
|
||||
return false;
|
||||
|
||||
#if HAVE_NETWORKING
|
||||
@@ -323,9 +317,7 @@ bool core_unserialize(retro_ctx_serialize_info_t *info)
|
||||
|
||||
bool core_serialize(retro_ctx_serialize_info_t *info)
|
||||
{
|
||||
if (!info)
|
||||
return false;
|
||||
if (!core.retro_serialize(info->data, info->size))
|
||||
if (!info || !current_core.retro_serialize(info->data, info->size))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -334,40 +326,25 @@ bool core_serialize_size(retro_ctx_size_info_t *info)
|
||||
{
|
||||
if (!info)
|
||||
return false;
|
||||
info->size = core.retro_serialize_size();
|
||||
info->size = current_core.retro_serialize_size();
|
||||
return true;
|
||||
}
|
||||
|
||||
uint64_t core_serialization_quirks(void)
|
||||
{
|
||||
return core_serialization_quirks_v;
|
||||
return current_core.serialization_quirks_v;
|
||||
}
|
||||
|
||||
void core_set_serialization_quirks(uint64_t quirks)
|
||||
{
|
||||
core_serialization_quirks_v = quirks;
|
||||
}
|
||||
|
||||
void core_frame(retro_ctx_frame_info_t *info)
|
||||
{
|
||||
if (retro_ctx.frame_cb)
|
||||
retro_ctx.frame_cb(
|
||||
info->data, info->width, info->height, info->pitch);
|
||||
}
|
||||
|
||||
bool core_poll(void)
|
||||
{
|
||||
if (!retro_ctx.poll_cb)
|
||||
return false;
|
||||
retro_ctx.poll_cb();
|
||||
return true;
|
||||
current_core.serialization_quirks_v = quirks;
|
||||
}
|
||||
|
||||
bool core_set_environment(retro_ctx_environ_info_t *info)
|
||||
{
|
||||
if (!info)
|
||||
return false;
|
||||
core.retro_set_environment(info->env);
|
||||
current_core.retro_set_environment(info->env);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -375,26 +352,26 @@ bool core_get_system_av_info(struct retro_system_av_info *av_info)
|
||||
{
|
||||
if (!av_info)
|
||||
return false;
|
||||
core.retro_get_system_av_info(av_info);
|
||||
current_core.retro_get_system_av_info(av_info);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_reset(void)
|
||||
{
|
||||
core.retro_reset();
|
||||
current_core.retro_reset();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_init(void)
|
||||
{
|
||||
core.retro_init();
|
||||
core_inited = true;
|
||||
current_core.retro_init();
|
||||
current_core.inited = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_unload(void)
|
||||
{
|
||||
core.retro_deinit();
|
||||
current_core.retro_deinit();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -403,8 +380,10 @@ bool core_unload_game(void)
|
||||
{
|
||||
video_driver_free_hw_context();
|
||||
audio_driver_stop();
|
||||
core.retro_unload_game();
|
||||
core_game_loaded = false;
|
||||
|
||||
current_core.retro_unload_game();
|
||||
|
||||
current_core.game_loaded = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -421,21 +400,21 @@ bool core_run(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (core_poll_type)
|
||||
switch (current_core.poll_type)
|
||||
{
|
||||
case POLL_TYPE_EARLY:
|
||||
input_poll();
|
||||
break;
|
||||
case POLL_TYPE_LATE:
|
||||
core_input_polled = false;
|
||||
current_core.input_polled = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (core.retro_run)
|
||||
core.retro_run();
|
||||
if (core_poll_type == POLL_TYPE_LATE && !core_input_polled)
|
||||
current_core.retro_run();
|
||||
|
||||
if (current_core.poll_type == POLL_TYPE_LATE && !current_core.input_polled)
|
||||
input_poll();
|
||||
|
||||
#ifdef HAVE_NETWORKING
|
||||
@@ -447,7 +426,7 @@ bool core_run(void)
|
||||
|
||||
bool core_load(unsigned poll_type_behavior)
|
||||
{
|
||||
core_poll_type = poll_type_behavior;
|
||||
current_core.poll_type = poll_type_behavior;
|
||||
|
||||
if (!core_verify_api_version())
|
||||
return false;
|
||||
@@ -461,7 +440,7 @@ bool core_load(unsigned poll_type_behavior)
|
||||
|
||||
bool core_verify_api_version(void)
|
||||
{
|
||||
unsigned api_version = core.retro_api_version();
|
||||
unsigned api_version = current_core.retro_api_version();
|
||||
RARCH_LOG("%s: %u\n",
|
||||
msg_hash_to_str(MSG_VERSION_OF_LIBRETRO_API),
|
||||
api_version);
|
||||
@@ -481,36 +460,36 @@ bool core_get_region(retro_ctx_region_info_t *info)
|
||||
{
|
||||
if (!info)
|
||||
return false;
|
||||
info->region = core.retro_get_region();
|
||||
info->region = current_core.retro_get_region();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_has_set_input_descriptor(void)
|
||||
{
|
||||
return core_has_set_input_descriptors;
|
||||
return current_core.has_set_input_descriptors;
|
||||
}
|
||||
|
||||
void core_set_input_descriptors(void)
|
||||
{
|
||||
core_has_set_input_descriptors = true;
|
||||
current_core.has_set_input_descriptors = true;
|
||||
}
|
||||
|
||||
void core_unset_input_descriptors(void)
|
||||
{
|
||||
core_has_set_input_descriptors = false;
|
||||
current_core.has_set_input_descriptors = false;
|
||||
}
|
||||
|
||||
bool core_is_inited(void)
|
||||
{
|
||||
return core_inited;
|
||||
return current_core.inited;
|
||||
}
|
||||
|
||||
bool core_is_symbols_inited(void)
|
||||
{
|
||||
return core_symbols_inited;
|
||||
return current_core.symbols_inited;
|
||||
}
|
||||
|
||||
bool core_is_game_loaded(void)
|
||||
{
|
||||
return core_game_loaded;
|
||||
return current_core.game_loaded;
|
||||
}
|
||||
+13
-10
@@ -1,8 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2013-2015 - Jason Fetters
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2016-2017 - Brad Parker
|
||||
*
|
||||
* RetroArch 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 Found-
|
||||
@@ -28,7 +27,7 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "runloop.h"
|
||||
#include "retroarch.h"
|
||||
#include "verbosity.h"
|
||||
|
||||
#include "config.def.h"
|
||||
@@ -217,8 +216,8 @@ static bool core_info_list_iterate(
|
||||
sizeof(info_path_base));
|
||||
|
||||
fill_pathname_join(s,
|
||||
(!string_is_empty(settings->path.libretro_info)) ?
|
||||
settings->path.libretro_info : settings->directory.libretro,
|
||||
(!string_is_empty(settings->paths.path_libretro_info)) ?
|
||||
settings->paths.path_libretro_info : settings->paths.directory_libretro,
|
||||
info_path_base, len);
|
||||
|
||||
return true;
|
||||
@@ -508,7 +507,7 @@ static bool core_info_list_update_missing_firmware_internal(
|
||||
if (!info)
|
||||
return false;
|
||||
|
||||
runloop_ctl(RUNLOOP_CTL_UNSET_MISSING_BIOS, NULL);
|
||||
rarch_ctl(RARCH_CTL_UNSET_MISSING_BIOS, NULL);
|
||||
for (i = 0; i < info->firmware_count; i++)
|
||||
{
|
||||
if (string_is_empty(info->firmware[i].path))
|
||||
@@ -519,7 +518,7 @@ static bool core_info_list_update_missing_firmware_internal(
|
||||
info->firmware[i].missing = !path_file_exists(path);
|
||||
if (info->firmware[i].missing && !info->firmware[i].optional)
|
||||
{
|
||||
runloop_ctl(RUNLOOP_CTL_SET_MISSING_BIOS, NULL);
|
||||
rarch_ctl(RARCH_CTL_SET_MISSING_BIOS, NULL);
|
||||
RARCH_WARN("Firmware missing: %s\n", info->firmware[i].path);
|
||||
}
|
||||
}
|
||||
@@ -611,7 +610,7 @@ bool core_info_init_list(void)
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (settings)
|
||||
core_info_curr_list = core_info_list_new(settings->directory.libretro);
|
||||
core_info_curr_list = core_info_list_new(settings->paths.directory_libretro);
|
||||
|
||||
if (!core_info_curr_list)
|
||||
return false;
|
||||
@@ -727,7 +726,7 @@ void core_info_get_name(const char *path, char *s, size_t len)
|
||||
size_t i;
|
||||
settings_t *settings = config_get_ptr();
|
||||
struct string_list *contents = dir_list_new_special(
|
||||
settings->directory.libretro,
|
||||
settings->paths.directory_libretro,
|
||||
DIR_LIST_CORES, NULL);
|
||||
|
||||
if (!contents)
|
||||
@@ -837,7 +836,11 @@ bool core_info_database_supports_content_path(const char *database_path, const c
|
||||
database = strdup(new_path);
|
||||
|
||||
if (string_is_empty(database))
|
||||
{
|
||||
if (database)
|
||||
free(database);
|
||||
return false;
|
||||
}
|
||||
|
||||
path_remove_extension(database);
|
||||
|
||||
|
||||
+2
-3
@@ -1,8 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2013-2015 - Jason Fetters
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2016-2017 - Brad Parker
|
||||
*
|
||||
* RetroArch 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 Found-
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch 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 Found-
|
||||
|
||||
@@ -27,7 +27,11 @@ static uint16_t *frame_buf;
|
||||
|
||||
void libretro_dummy_retro_init(void)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
frame_buf = (uint16_t*)calloc(320 * 240, sizeof(uint16_t));
|
||||
for (i = 0; i < 320 * 240; i++)
|
||||
frame_buf[i] = 4 << 5;
|
||||
}
|
||||
|
||||
void libretro_dummy_retro_deinit(void)
|
||||
@@ -121,11 +125,7 @@ void libretro_dummy_retro_reset(void)
|
||||
|
||||
void libretro_dummy_retro_run(void)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
dummy_input_poll_cb();
|
||||
for (i = 0; i < 320 * 240; i++)
|
||||
frame_buf[i] = 4 << 5;
|
||||
dummy_video_cb(frame_buf, 320, 240, 640);
|
||||
}
|
||||
|
||||
|
||||
@@ -161,8 +161,7 @@ GL_SOURCE += $(LIBRETRO_COMM_DIR)/glsym/rglgen.c
|
||||
|
||||
ifeq ($(HAVE_GL_FFT), 1)
|
||||
DEFINES += -DHAVE_GL_FFT
|
||||
INCFLAGS += -I$(CORE_DIR)/fft
|
||||
FFT_SOURCE += $(CORE_DIR)/fft/fft.cpp
|
||||
FFT_SOURCE += $(CORE_DIR)/ffmpeg_fft.c
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -177,6 +176,7 @@ SOURCES_C := $(GL_SOURCE) \
|
||||
$(LIBAVFORMAT_SOURCE) \
|
||||
$(LIBSWSCALE_SOURCE) \
|
||||
$(LIBAVCODEC_SOURCE) \
|
||||
$(FFT_SOURCE) \
|
||||
$(LIBSWRESAMPLE_SOURCE)
|
||||
|
||||
SOURCES_CXX := $(FFT_SOURCE)
|
||||
SOURCES_CXX :=
|
||||
@@ -1,4 +1,3 @@
|
||||
/* Copyright (C) 2016 - Brad Parker */
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
@@ -36,7 +35,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GL_FFT
|
||||
#include "fft/fft.h"
|
||||
#include "ffmpeg_fft.h"
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
|
||||
@@ -45,6 +44,7 @@ extern "C" {
|
||||
|
||||
#include <rthreads/rthreads.h>
|
||||
#include <queues/fifo_queue.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include <libretro.h>
|
||||
#ifdef RARCH_INTERNAL
|
||||
@@ -115,7 +115,7 @@ static struct attachment *attachments;
|
||||
static size_t attachments_size;
|
||||
|
||||
#ifdef HAVE_GL_FFT
|
||||
static glfft_t *fft;
|
||||
static fft_t *fft;
|
||||
unsigned fft_width;
|
||||
unsigned fft_height;
|
||||
unsigned fft_multisample;
|
||||
@@ -274,8 +274,8 @@ void CORE_PREFIX(retro_set_environment)(retro_environment_t cb)
|
||||
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
|
||||
{ "ffmpeg_temporal_interp", "Temporal Interpolation; enabled|disabled" },
|
||||
#ifdef HAVE_GL_FFT
|
||||
{ "ffmpeg_fft_resolution", "GLFFT Resolution; 1280x720|1920x1080|640x360|320x180" },
|
||||
{ "ffmpeg_fft_multisample", "GLFFT Multisample; 1x|2x|4x" },
|
||||
{ "ffmpeg_fft_resolution", "FFT Resolution; 1280x720|1920x1080|2560x1440|3840x2160|640x360|320x180" },
|
||||
{ "ffmpeg_fft_multisample", "FFT Multisample; 1x|2x|4x" },
|
||||
#endif
|
||||
#endif
|
||||
{ "ffmpeg_color_space", "Colorspace; auto|BT.709|BT.601|FCC|SMPTE240M" },
|
||||
@@ -339,9 +339,9 @@ static void check_variables(void)
|
||||
|
||||
if (CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
|
||||
{
|
||||
if (!strcmp(var.value, "enabled"))
|
||||
if (memcmp(var.value, "enabled", 7) == 0)
|
||||
temporal_interpolation = true;
|
||||
else if (!strcmp(var.value, "disabled"))
|
||||
else if (memcmp(var.value, "disabled", 8) == 0)
|
||||
temporal_interpolation = false;
|
||||
}
|
||||
|
||||
@@ -373,13 +373,13 @@ static void check_variables(void)
|
||||
if (CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_GET_VARIABLE, &color_var) && color_var.value)
|
||||
{
|
||||
slock_lock(decode_thread_lock);
|
||||
if (!strcmp(color_var.value, "BT.709"))
|
||||
if (string_is_equal(color_var.value, "BT.709"))
|
||||
colorspace = AVCOL_SPC_BT709;
|
||||
else if (!strcmp(color_var.value, "BT.601"))
|
||||
else if (string_is_equal(color_var.value, "BT.601"))
|
||||
colorspace = AVCOL_SPC_BT470BG;
|
||||
else if (!strcmp(color_var.value, "FCC"))
|
||||
else if (memcmp(color_var.value, "FCC", 3) == 0)
|
||||
colorspace = AVCOL_SPC_FCC;
|
||||
else if (!strcmp(color_var.value, "SMPTE240M"))
|
||||
else if (string_is_equal(color_var.value, "SMPTE240M"))
|
||||
colorspace = AVCOL_SPC_SMPTE240M;
|
||||
else
|
||||
colorspace = AVCOL_SPC_UNSPECIFIED;
|
||||
@@ -462,7 +462,7 @@ void CORE_PREFIX(retro_run)(void)
|
||||
}
|
||||
|
||||
if (fft && (old_fft_multisample != fft_multisample))
|
||||
glfft_init_multisample(fft, fft_width, fft_height, fft_multisample);
|
||||
fft_init_multisample(fft, fft_width, fft_height, fft_multisample);
|
||||
#endif
|
||||
|
||||
CORE_PREFIX(input_poll_cb)();
|
||||
@@ -737,11 +737,11 @@ void CORE_PREFIX(retro_run)(void)
|
||||
if (to_read > (1 << 11))
|
||||
to_read = 1 << 11;
|
||||
|
||||
glfft_step_fft(fft, buffer, to_read);
|
||||
fft_step_fft(fft, buffer, to_read);
|
||||
buffer += to_read * 2;
|
||||
frames -= to_read;
|
||||
}
|
||||
glfft_render(fft, hw_render.get_current_framebuffer(), fft_width, fft_height);
|
||||
fft_render(fft, hw_render.get_current_framebuffer(), fft_width, fft_height);
|
||||
CORE_PREFIX(video_cb)(RETRO_HW_FRAME_BUFFER_VALID,
|
||||
fft_width, fft_height, fft_width * sizeof(uint32_t));
|
||||
}
|
||||
@@ -1369,7 +1369,7 @@ static void context_destroy(void)
|
||||
#ifdef HAVE_GL_FFT
|
||||
if (fft)
|
||||
{
|
||||
glfft_free(fft);
|
||||
fft_free(fft);
|
||||
fft = NULL;
|
||||
}
|
||||
#endif
|
||||
@@ -1400,9 +1400,9 @@ static void context_reset(void)
|
||||
#ifdef HAVE_GL_FFT
|
||||
if (audio_streams_num > 0 && video_stream < 0)
|
||||
{
|
||||
fft = glfft_new(11, hw_render.get_proc_address);
|
||||
fft = fft_new(11, hw_render.get_proc_address);
|
||||
if (fft)
|
||||
glfft_init_multisample(fft, fft_width, fft_height, fft_multisample);
|
||||
fft_init_multisample(fft, fft_width, fft_height, fft_multisample);
|
||||
}
|
||||
|
||||
/* Already inits symbols. */
|
||||
@@ -1555,7 +1555,7 @@ void CORE_PREFIX(retro_unload_game)(void)
|
||||
|
||||
bool CORE_PREFIX(retro_load_game)(const struct retro_game_info *info)
|
||||
{
|
||||
bool is_glfft = false;
|
||||
bool is_fft = false;
|
||||
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_XRGB8888;
|
||||
struct retro_input_descriptor desc[] = {
|
||||
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT, "Seek -10 seconds" },
|
||||
@@ -1606,21 +1606,21 @@ bool CORE_PREFIX(retro_load_game)(const struct retro_game_info *info)
|
||||
}
|
||||
|
||||
#ifdef HAVE_GL_FFT
|
||||
is_glfft = video_stream < 0 && audio_streams_num > 0;
|
||||
is_fft = video_stream < 0 && audio_streams_num > 0;
|
||||
#endif
|
||||
|
||||
if (video_stream >= 0 || is_glfft)
|
||||
if (video_stream >= 0 || is_fft)
|
||||
{
|
||||
video_decode_fifo = fifo_new(media.width
|
||||
* media.height * sizeof(uint32_t) * 32);
|
||||
|
||||
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
|
||||
use_gl = true;
|
||||
hw_render.context_reset = context_reset;
|
||||
hw_render.context_destroy = context_destroy;
|
||||
hw_render.bottom_left_origin = is_glfft;
|
||||
hw_render.depth = is_glfft;
|
||||
hw_render.stencil = is_glfft;
|
||||
hw_render.context_reset = context_reset;
|
||||
hw_render.context_destroy = context_destroy;
|
||||
hw_render.bottom_left_origin = is_fft;
|
||||
hw_render.depth = is_fft;
|
||||
hw_render.stencil = is_fft;
|
||||
#if defined(HAVE_OPENGLES)
|
||||
hw_render.context_type = RETRO_HW_CONTEXT_OPENGLES2;
|
||||
#else
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,24 @@
|
||||
#ifndef FFMPEG_FFT_H_
|
||||
#define FFMPEG_FFT_H_
|
||||
|
||||
#include <glsym/glsym.h>
|
||||
|
||||
#include <retro_common_api.h>
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
typedef struct GLFFT fft_t;
|
||||
|
||||
fft_t *fft_new(unsigned fft_steps, rglgen_proc_address_t proc);
|
||||
|
||||
void fft_free(fft_t *fft);
|
||||
|
||||
void fft_init_multisample(fft_t *fft, unsigned width, unsigned height, unsigned samples);
|
||||
|
||||
void fft_step_fft(fft_t *fft, const GLshort *buffer, unsigned frames);
|
||||
|
||||
void fft_render(fft_t *fft, GLuint backbuffer, unsigned width, unsigned height);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
@@ -1,26 +0,0 @@
|
||||
#ifndef FFT_H__
|
||||
#define FFT_H__
|
||||
|
||||
#include <glsym/glsym.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct glfft glfft_t;
|
||||
|
||||
glfft_t *glfft_new(unsigned fft_steps, rglgen_proc_address_t proc);
|
||||
|
||||
void glfft_free(glfft_t *fft);
|
||||
|
||||
void glfft_init_multisample(glfft_t *fft, unsigned width, unsigned height, unsigned samples);
|
||||
|
||||
void glfft_step_fft(glfft_t *fft, const GLshort *buffer, unsigned frames);
|
||||
void glfft_render(glfft_t *fft, GLuint backbuffer, unsigned width, unsigned height);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -59,7 +59,10 @@
|
||||
#include <libudev.h>
|
||||
#endif
|
||||
|
||||
struct video_buffer {
|
||||
#include <string/stdstring.h>
|
||||
|
||||
struct video_buffer
|
||||
{
|
||||
void *start;
|
||||
size_t len;
|
||||
};
|
||||
@@ -215,7 +218,7 @@ enumerate_audio_devices(char *buf, size_t buflen)
|
||||
{
|
||||
name = snd_device_name_get_hint(*n, "NAME");
|
||||
ioid = snd_device_name_get_hint(*n, "IOID");
|
||||
if ((ioid == NULL || !strcmp(ioid, "Input")) &&
|
||||
if ((ioid == NULL || string_is_equal(ioid, "Input")) &&
|
||||
(!strncmp(name, "hw:", strlen("hw:")) ||
|
||||
!strncmp(name, "default:", strlen("default:"))))
|
||||
{
|
||||
|
||||
+5
-4
@@ -1,8 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2013-2015 - Jason Fetters
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2016-2017 - Brad Parker
|
||||
*
|
||||
* RetroArch 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 Found-
|
||||
@@ -472,13 +471,15 @@ error:
|
||||
database_info_handle_t *database_info_file_init(const char *path,
|
||||
enum database_type type)
|
||||
{
|
||||
union string_list_elem_attr attr = {0};
|
||||
union string_list_elem_attr attr;
|
||||
database_info_handle_t *db = (database_info_handle_t*)
|
||||
calloc(1, sizeof(*db));
|
||||
|
||||
if (!db)
|
||||
return NULL;
|
||||
|
||||
attr.i = 0;
|
||||
|
||||
db->list = string_list_new();
|
||||
|
||||
if (!db->list)
|
||||
|
||||
+2
-8
@@ -1,8 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2013-2015 - Jason Fetters
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2016-2017 - Brad Parker
|
||||
*
|
||||
* RetroArch 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 Found-
|
||||
@@ -133,11 +132,6 @@ database_info_handle_t *database_info_file_init(const char *path,
|
||||
|
||||
void database_info_free(database_info_handle_t *handle);
|
||||
|
||||
#if 0
|
||||
int database_info_build_query(
|
||||
char *query, size_t len, const char *label, const char *path);
|
||||
#endif
|
||||
|
||||
int database_info_build_query_enum(
|
||||
char *query, size_t len, enum database_query_type type, const char *path);
|
||||
|
||||
|
||||
+36
-31
@@ -1,5 +1,5 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch 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 Found-
|
||||
@@ -24,6 +24,39 @@
|
||||
#include "playlist.h"
|
||||
#endif
|
||||
|
||||
enum default_dirs
|
||||
{
|
||||
DEFAULT_DIR_MENU_CONTENT = 0,
|
||||
DEFAULT_DIR_CORE_ASSETS,
|
||||
DEFAULT_DIR_MENU_CONFIG,
|
||||
DEFAULT_DIR_AUTOCONFIG,
|
||||
DEFAULT_DIR_AUDIO_FILTER,
|
||||
DEFAULT_DIR_VIDEO_FILTER,
|
||||
DEFAULT_DIR_ASSETS,
|
||||
DEFAULT_DIR_CORE,
|
||||
DEFAULT_DIR_CORE_INFO,
|
||||
DEFAULT_DIR_OVERLAY,
|
||||
DEFAULT_DIR_PORT,
|
||||
DEFAULT_DIR_SHADER,
|
||||
DEFAULT_DIR_SAVESTATE,
|
||||
DEFAULT_DIR_RESAMPLER,
|
||||
DEFAULT_DIR_SRAM,
|
||||
DEFAULT_DIR_SCREENSHOT,
|
||||
DEFAULT_DIR_SYSTEM,
|
||||
DEFAULT_DIR_PLAYLIST,
|
||||
DEFAULT_DIR_CONTENT_HISTORY,
|
||||
DEFAULT_DIR_REMAP,
|
||||
DEFAULT_DIR_CACHE,
|
||||
DEFAULT_DIR_WALLPAPERS,
|
||||
DEFAULT_DIR_THUMBNAILS,
|
||||
DEFAULT_DIR_DATABASE,
|
||||
DEFAULT_DIR_CURSOR,
|
||||
DEFAULT_DIR_CHEATS,
|
||||
DEFAULT_DIR_RECORD_CONFIG,
|
||||
DEFAULT_DIR_RECORD_OUTPUT,
|
||||
DEFAULT_DIR_LAST
|
||||
};
|
||||
|
||||
struct defaults
|
||||
{
|
||||
#ifdef HAVE_MENU
|
||||
@@ -50,35 +83,7 @@ struct defaults
|
||||
bool enable;
|
||||
} overlay;
|
||||
|
||||
struct
|
||||
{
|
||||
char menu_content[PATH_MAX_LENGTH];
|
||||
char core_assets[PATH_MAX_LENGTH];
|
||||
char menu_config[PATH_MAX_LENGTH];
|
||||
char autoconfig[PATH_MAX_LENGTH];
|
||||
char audio_filter[PATH_MAX_LENGTH];
|
||||
char video_filter[PATH_MAX_LENGTH];
|
||||
char assets[PATH_MAX_LENGTH];
|
||||
char core[PATH_MAX_LENGTH];
|
||||
char core_info[PATH_MAX_LENGTH];
|
||||
char overlay[PATH_MAX_LENGTH];
|
||||
char port[PATH_MAX_LENGTH];
|
||||
char shader[PATH_MAX_LENGTH];
|
||||
char savestate[PATH_MAX_LENGTH];
|
||||
char resampler[PATH_MAX_LENGTH];
|
||||
char sram[PATH_MAX_LENGTH];
|
||||
char screenshot[PATH_MAX_LENGTH];
|
||||
char system[PATH_MAX_LENGTH];
|
||||
char playlist[PATH_MAX_LENGTH];
|
||||
char content_history[PATH_MAX_LENGTH];
|
||||
char remap[PATH_MAX_LENGTH];
|
||||
char cache[PATH_MAX_LENGTH];
|
||||
char wallpapers[PATH_MAX_LENGTH];
|
||||
char thumbnails[PATH_MAX_LENGTH];
|
||||
char database[PATH_MAX_LENGTH];
|
||||
char cursor[PATH_MAX_LENGTH];
|
||||
char cheats[PATH_MAX_LENGTH];
|
||||
} dir;
|
||||
char dirs [DEFAULT_DIR_LAST + 1][PATH_MAX_LENGTH];
|
||||
|
||||
struct
|
||||
{
|
||||
@@ -100,9 +105,9 @@ struct defaults
|
||||
#ifdef HAVE_IMAGEVIEWER
|
||||
playlist_t *image_history;
|
||||
#endif
|
||||
playlist_t *music_history;
|
||||
#ifdef HAVE_FFMPEG
|
||||
playlist_t *video_history;
|
||||
playlist_t *music_history;
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -106,7 +106,7 @@ int sceClibPrintf ( const char * format, ... );
|
||||
|
||||
#if defined(VITA)
|
||||
#define CtrlSetSamplingMode(mode) sceCtrlSetSamplingModeExt(mode)
|
||||
#define CtrlPeekBufferPositive(port, pad_data, bufs) sceCtrlReadBufferPositiveExt2(port, pad_data, bufs)
|
||||
#define CtrlPeekBufferPositive(port, pad_data, bufs) sceCtrlPeekBufferPositiveExt2(port, pad_data, bufs)
|
||||
#else
|
||||
#define CtrlSetSamplingMode(mode) sceCtrlSetSamplingMode(mode)
|
||||
#define CtrlPeekBufferPositive(port, pad_data, bufs) sceCtrlPeekBufferPositive(port, pad_data, bufs)
|
||||
|
||||
Vendored
+2
-1
@@ -133,6 +133,7 @@ mg_static_assert(sizeof(void *) >= sizeof(int), "data type size check");
|
||||
#include <assert.h>
|
||||
|
||||
#include <compat/strl.h>
|
||||
#include <net/net_compat.h>
|
||||
|
||||
/* clock_gettime is not implemented on OSX */
|
||||
int clock_gettime(int clk_id, struct timespec *t);
|
||||
@@ -5727,7 +5728,7 @@ mg_inet_pton(int af, const char *src, void *dst, size_t dstlen)
|
||||
memset(&hints, 0, sizeof(struct addrinfo));
|
||||
hints.ai_family = af;
|
||||
|
||||
if (getaddrinfo(src, NULL, &hints, &res) != 0) {
|
||||
if (getaddrinfo_retro(src, NULL, &hints, &res) != 0) {
|
||||
/* bad src string or bad address family */
|
||||
return 0;
|
||||
}
|
||||
|
||||
Vendored
-34
@@ -1,34 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/common.hpp
|
||||
/// @date 2013-12-24 / 2013-12-24
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef GLM_COMMON_INCLUDED
|
||||
#define GLM_COMMON_INCLUDED
|
||||
|
||||
#include "detail/func_common.hpp"
|
||||
|
||||
#endif//GLM_COMMON_INCLUDED
|
||||
Vendored
-427
@@ -1,427 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/_features.hpp
|
||||
/// @date 2013-02-20 / 2013-02-20
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef glm_core_features
|
||||
#define glm_core_features
|
||||
|
||||
// #define GLM_CXX98_EXCEPTIONS
|
||||
// #define GLM_CXX98_RTTI
|
||||
|
||||
// #define GLM_CXX11_RVALUE_REFERENCES
|
||||
// Rvalue references - GCC 4.3
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html
|
||||
|
||||
// GLM_CXX11_TRAILING_RETURN
|
||||
// Rvalue references for *this - GCC not supported
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm
|
||||
|
||||
// GLM_CXX11_NONSTATIC_MEMBER_INIT
|
||||
// Initialization of class objects by rvalues - GCC any
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1610.html
|
||||
|
||||
// GLM_CXX11_NONSTATIC_MEMBER_INIT
|
||||
// Non-static data member initializers - GCC 4.7
|
||||
// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2756.htm
|
||||
|
||||
// #define GLM_CXX11_VARIADIC_TEMPLATE
|
||||
// Variadic templates - GCC 4.3
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf
|
||||
|
||||
//
|
||||
// Extending variadic template template parameters - GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf
|
||||
|
||||
// #define GLM_CXX11_GENERALIZED_INITIALIZERS
|
||||
// Initializer lists - GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm
|
||||
|
||||
// #define GLM_CXX11_STATIC_ASSERT
|
||||
// Static assertions - GCC 4.3
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html
|
||||
|
||||
// #define GLM_CXX11_AUTO_TYPE
|
||||
// auto-typed variables - GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf
|
||||
|
||||
// #define GLM_CXX11_AUTO_TYPE
|
||||
// Multi-declarator auto - GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1737.pdf
|
||||
|
||||
// #define GLM_CXX11_AUTO_TYPE
|
||||
// Removal of auto as a storage-class specifier - GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2546.htm
|
||||
|
||||
// #define GLM_CXX11_AUTO_TYPE
|
||||
// New function declarator syntax - GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm
|
||||
|
||||
// #define GLM_CXX11_LAMBDAS
|
||||
// New wording for C++0x lambdas - GCC 4.5
|
||||
// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2927.pdf
|
||||
|
||||
// #define GLM_CXX11_DECLTYPE
|
||||
// Declared type of an expression - GCC 4.3
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf
|
||||
|
||||
//
|
||||
// Right angle brackets - GCC 4.3
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html
|
||||
|
||||
//
|
||||
// Default template arguments for function templates DR226 GCC 4.3
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#226
|
||||
|
||||
//
|
||||
// Solving the SFINAE problem for expressions DR339 GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html
|
||||
|
||||
// #define GLM_CXX11_ALIAS_TEMPLATE
|
||||
// Template aliases N2258 GCC 4.7
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
|
||||
|
||||
//
|
||||
// Extern templates N1987 Yes
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm
|
||||
|
||||
// #define GLM_CXX11_NULLPTR
|
||||
// Null pointer constant N2431 GCC 4.6
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf
|
||||
|
||||
// #define GLM_CXX11_STRONG_ENUMS
|
||||
// Strongly-typed enums N2347 GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf
|
||||
|
||||
//
|
||||
// Forward declarations for enums N2764 GCC 4.6
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2764.pdf
|
||||
|
||||
//
|
||||
// Generalized attributes N2761 GCC 4.8
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf
|
||||
|
||||
//
|
||||
// Generalized constant expressions N2235 GCC 4.6
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf
|
||||
|
||||
//
|
||||
// Alignment support N2341 GCC 4.8
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf
|
||||
|
||||
// #define GLM_CXX11_DELEGATING_CONSTRUCTORS
|
||||
// Delegating constructors N1986 GCC 4.7
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf
|
||||
|
||||
//
|
||||
// Inheriting constructors N2540 GCC 4.8
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm
|
||||
|
||||
// #define GLM_CXX11_EXPLICIT_CONVERSIONS
|
||||
// Explicit conversion operators N2437 GCC 4.5
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf
|
||||
|
||||
//
|
||||
// New character types N2249 GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html
|
||||
|
||||
//
|
||||
// Unicode string literals N2442 GCC 4.5
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm
|
||||
|
||||
//
|
||||
// Raw string literals N2442 GCC 4.5
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm
|
||||
|
||||
//
|
||||
// Universal character name literals N2170 GCC 4.5
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html
|
||||
|
||||
// #define GLM_CXX11_USER_LITERALS
|
||||
// User-defined literals N2765 GCC 4.7
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf
|
||||
|
||||
//
|
||||
// Standard Layout Types N2342 GCC 4.5
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2342.htm
|
||||
|
||||
// #define GLM_CXX11_DEFAULTED_FUNCTIONS
|
||||
// #define GLM_CXX11_DELETED_FUNCTIONS
|
||||
// Defaulted and deleted functions N2346 GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm
|
||||
|
||||
//
|
||||
// Extended friend declarations N1791 GCC 4.7
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf
|
||||
|
||||
//
|
||||
// Extending sizeof N2253 GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html
|
||||
|
||||
// #define GLM_CXX11_INLINE_NAMESPACES
|
||||
// Inline namespaces N2535 GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm
|
||||
|
||||
// #define GLM_CXX11_UNRESTRICTED_UNIONS
|
||||
// Unrestricted unions N2544 GCC 4.6
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf
|
||||
|
||||
// #define GLM_CXX11_LOCAL_TYPE_TEMPLATE_ARGS
|
||||
// Local and unnamed types as template arguments N2657 GCC 4.5
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm
|
||||
|
||||
// #define GLM_CXX11_RANGE_FOR
|
||||
// Range-based for N2930 GCC 4.6
|
||||
// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2930.html
|
||||
|
||||
// #define GLM_CXX11_OVERRIDE_CONTROL
|
||||
// Explicit virtual overrides N2928 N3206 N3272 GCC 4.7
|
||||
// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm
|
||||
|
||||
//
|
||||
// Minimal support for garbage collection and reachability-based leak detection N2670 No
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2670.htm
|
||||
|
||||
// #define GLM_CXX11_NOEXCEPT
|
||||
// Allowing move constructors to throw [noexcept] N3050 GCC 4.6 (core language only)
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.html
|
||||
|
||||
//
|
||||
// Defining move special member functions N3053 GCC 4.6
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3053.html
|
||||
|
||||
//
|
||||
// Sequence points N2239 Yes
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html
|
||||
|
||||
//
|
||||
// Atomic operations N2427 GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html
|
||||
|
||||
//
|
||||
// Strong Compare and Exchange N2748 GCC 4.5
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html
|
||||
|
||||
//
|
||||
// Bidirectional Fences N2752 GCC 4.8
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2752.htm
|
||||
|
||||
//
|
||||
// Memory model N2429 GCC 4.8
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2429.htm
|
||||
|
||||
//
|
||||
// Data-dependency ordering: atomics and memory model N2664 GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2664.htm
|
||||
|
||||
//
|
||||
// Propagating exceptions N2179 GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html
|
||||
|
||||
//
|
||||
// Abandoning a process and at_quick_exit N2440 GCC 4.8
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2440.htm
|
||||
|
||||
//
|
||||
// Allow atomics use in signal handlers N2547 Yes
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2547.htm
|
||||
|
||||
//
|
||||
// Thread-local storage N2659 GCC 4.8
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm
|
||||
|
||||
//
|
||||
// Dynamic initialization and destruction with concurrency N2660 GCC 4.3
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm
|
||||
|
||||
//
|
||||
// __func__ predefined identifier N2340 GCC 4.3
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2340.htm
|
||||
|
||||
//
|
||||
// C99 preprocessor N1653 GCC 4.3
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm
|
||||
|
||||
//
|
||||
// long long N1811 GCC 4.3
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf
|
||||
|
||||
//
|
||||
// Extended integral types N1988 Yes
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1988.pdf
|
||||
|
||||
#if(GLM_COMPILER & GLM_COMPILER_GCC)
|
||||
|
||||
# if(GLM_COMPILER >= GLM_COMPILER_GCC43)
|
||||
# define GLM_CXX11_STATIC_ASSERT
|
||||
# endif
|
||||
|
||||
#elif(GLM_COMPILER & GLM_COMPILER_CLANG)
|
||||
# if(__has_feature(cxx_exceptions))
|
||||
# define GLM_CXX98_EXCEPTIONS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_rtti))
|
||||
# define GLM_CXX98_RTTI
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_access_control_sfinae))
|
||||
# define GLM_CXX11_ACCESS_CONTROL_SFINAE
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_alias_templates))
|
||||
# define GLM_CXX11_ALIAS_TEMPLATE
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_alignas))
|
||||
# define GLM_CXX11_ALIGNAS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_attributes))
|
||||
# define GLM_CXX11_ATTRIBUTES
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_constexpr))
|
||||
# define GLM_CXX11_CONSTEXPR
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_decltype))
|
||||
# define GLM_CXX11_DECLTYPE
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_default_function_template_args))
|
||||
# define GLM_CXX11_DEFAULT_FUNCTION_TEMPLATE_ARGS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_defaulted_functions))
|
||||
# define GLM_CXX11_DEFAULTED_FUNCTIONS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_delegating_constructors))
|
||||
# define GLM_CXX11_DELEGATING_CONSTRUCTORS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_deleted_functions))
|
||||
# define GLM_CXX11_DELETED_FUNCTIONS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_explicit_conversions))
|
||||
# define GLM_CXX11_EXPLICIT_CONVERSIONS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_generalized_initializers))
|
||||
# define GLM_CXX11_GENERALIZED_INITIALIZERS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_implicit_moves))
|
||||
# define GLM_CXX11_IMPLICIT_MOVES
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_inheriting_constructors))
|
||||
# define GLM_CXX11_INHERITING_CONSTRUCTORS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_inline_namespaces))
|
||||
# define GLM_CXX11_INLINE_NAMESPACES
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_lambdas))
|
||||
# define GLM_CXX11_LAMBDAS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_local_type_template_args))
|
||||
# define GLM_CXX11_LOCAL_TYPE_TEMPLATE_ARGS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_noexcept))
|
||||
# define GLM_CXX11_NOEXCEPT
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_nonstatic_member_init))
|
||||
# define GLM_CXX11_NONSTATIC_MEMBER_INIT
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_nullptr))
|
||||
# define GLM_CXX11_NULLPTR
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_override_control))
|
||||
# define GLM_CXX11_OVERRIDE_CONTROL
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_reference_qualified_functions))
|
||||
# define GLM_CXX11_REFERENCE_QUALIFIED_FUNCTIONS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_range_for))
|
||||
# define GLM_CXX11_RANGE_FOR
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_raw_string_literals))
|
||||
# define GLM_CXX11_RAW_STRING_LITERALS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_rvalue_references))
|
||||
# define GLM_CXX11_RVALUE_REFERENCES
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_static_assert))
|
||||
# define GLM_CXX11_STATIC_ASSERT
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_auto_type))
|
||||
# define GLM_CXX11_AUTO_TYPE
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_strong_enums))
|
||||
# define GLM_CXX11_STRONG_ENUMS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_trailing_return))
|
||||
# define GLM_CXX11_TRAILING_RETURN
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_unicode_literals))
|
||||
# define GLM_CXX11_UNICODE_LITERALS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_unrestricted_unions))
|
||||
# define GLM_CXX11_UNRESTRICTED_UNIONS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_user_literals))
|
||||
# define GLM_CXX11_USER_LITERALS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_variadic_templates))
|
||||
# define GLM_CXX11_VARIADIC_TEMPLATES
|
||||
# endif
|
||||
|
||||
#endif//(GLM_COMPILER & GLM_COMPILER_CLANG)
|
||||
|
||||
#endif//glm_core_features
|
||||
Vendored
-55
@@ -1,55 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/_fixes.hpp
|
||||
/// @date 2011-02-21 / 2011-11-22
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <cmath>
|
||||
|
||||
//! Workaround for compatibility with other libraries
|
||||
#ifdef max
|
||||
#undef max
|
||||
#endif
|
||||
|
||||
//! Workaround for compatibility with other libraries
|
||||
#ifdef min
|
||||
#undef min
|
||||
#endif
|
||||
|
||||
//! Workaround for Android
|
||||
#ifdef isnan
|
||||
#undef isnan
|
||||
#endif
|
||||
|
||||
//! Workaround for Android
|
||||
#ifdef isinf
|
||||
#undef isinf
|
||||
#endif
|
||||
|
||||
//! Workaround for Chrone Native Client
|
||||
#ifdef log2
|
||||
#undef log2
|
||||
#endif
|
||||
|
||||
Vendored
-109
@@ -1,109 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/detail/_noise.hpp
|
||||
/// @date 2013-12-24 / 2013-12-24
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef GLM_DETAIL_NOISE_INCLUDED
|
||||
#define GLM_DETAIL_NOISE_INCLUDED
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <typename T>
|
||||
inline T mod289(T const & x)
|
||||
{
|
||||
return x - floor(x * static_cast<T>(1.0) / static_cast<T>(289.0)) * static_cast<T>(289.0);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline T permute(T const & x)
|
||||
{
|
||||
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline tvec2<T, P> permute(tvec2<T, P> const & x)
|
||||
{
|
||||
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline tvec3<T, P> permute(tvec3<T, P> const & x)
|
||||
{
|
||||
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline tvec4<T, P> permute(tvec4<T, P> const & x)
|
||||
{
|
||||
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
|
||||
}
|
||||
template <typename T>
|
||||
inline T taylorInvSqrt(T const & r)
|
||||
{
|
||||
return T(1.79284291400159) - T(0.85373472095314) * r;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec2<T, P> taylorInvSqrt(detail::tvec2<T, P> const & r)
|
||||
{
|
||||
return T(1.79284291400159) - T(0.85373472095314) * r;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec3<T, P> taylorInvSqrt(detail::tvec3<T, P> const & r)
|
||||
{
|
||||
return T(1.79284291400159) - T(0.85373472095314) * r;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec4<T, P> taylorInvSqrt(detail::tvec4<T, P> const & r)
|
||||
{
|
||||
return T(1.79284291400159) - T(0.85373472095314) * r;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec2<T, P> fade(detail::tvec2<T, P> const & t)
|
||||
{
|
||||
return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec3<T, P> fade(detail::tvec3<T, P> const & t)
|
||||
{
|
||||
return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec4<T, P> fade(detail::tvec4<T, P> const & t)
|
||||
{
|
||||
return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
|
||||
}
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
|
||||
#endif//GLM_DETAIL_NOISE_INCLUDED
|
||||
|
||||
Vendored
-831
@@ -1,831 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/_swizzle.hpp
|
||||
/// @date 2006-04-20 / 2011-02-16
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef glm_core_swizzle
|
||||
#define glm_core_swizzle
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
// Internal class for implementing swizzle operators
|
||||
template <typename T, int N>
|
||||
struct _swizzle_base0
|
||||
{
|
||||
typedef T value_type;
|
||||
|
||||
protected:
|
||||
inline value_type& elem (size_t i) { return (reinterpret_cast<value_type*>(_buffer))[i]; }
|
||||
inline const value_type& elem (size_t i) const { return (reinterpret_cast<const value_type*>(_buffer))[i]; }
|
||||
|
||||
// Use an opaque buffer to *ensure* the compiler doesn't call a constructor.
|
||||
// The size 1 buffer is assumed to aligned to the actual members so that the
|
||||
// elem()
|
||||
char _buffer[1];
|
||||
};
|
||||
|
||||
template <typename T, precision P, typename V, int E0, int E1, int E2, int E3, int N>
|
||||
struct _swizzle_base1 : public _swizzle_base0<T, N>
|
||||
{
|
||||
};
|
||||
|
||||
template <typename T, precision P, typename V, int E0, int E1>
|
||||
struct _swizzle_base1<T, P, V,E0,E1,-1,-2,2> : public _swizzle_base0<T, 2>
|
||||
{
|
||||
inline V operator ()() const { return V(this->elem(E0), this->elem(E1)); }
|
||||
};
|
||||
|
||||
template <typename T, precision P, typename V, int E0, int E1, int E2>
|
||||
struct _swizzle_base1<T, P, V,E0,E1,E2,-1,3> : public _swizzle_base0<T, 3>
|
||||
{
|
||||
inline V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2)); }
|
||||
};
|
||||
|
||||
template <typename T, precision P, typename V, int E0, int E1, int E2, int E3>
|
||||
struct _swizzle_base1<T, P, V,E0,E1,E2,E3,4> : public _swizzle_base0<T, 4>
|
||||
{
|
||||
inline V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); }
|
||||
};
|
||||
|
||||
// Internal class for implementing swizzle operators
|
||||
/*
|
||||
Template parameters:
|
||||
|
||||
ValueType = type of scalar values (e.g. float, double)
|
||||
VecType = class the swizzle is applies to (e.g. tvec3<float>)
|
||||
N = number of components in the vector (e.g. 3)
|
||||
E0...3 = what index the n-th element of this swizzle refers to in the unswizzled vec
|
||||
|
||||
DUPLICATE_ELEMENTS = 1 if there is a repeated element, 0 otherwise (used to specialize swizzles
|
||||
containing duplicate elements so that they cannot be used as r-values).
|
||||
*/
|
||||
template <typename ValueType, precision P, typename VecType, int N, int E0, int E1, int E2, int E3, int DUPLICATE_ELEMENTS>
|
||||
struct _swizzle_base2 : public _swizzle_base1<ValueType, P, VecType,E0,E1,E2,E3,N>
|
||||
{
|
||||
typedef VecType vec_type;
|
||||
typedef ValueType value_type;
|
||||
|
||||
inline _swizzle_base2& operator= (const ValueType& t)
|
||||
{
|
||||
for (int i = 0; i < N; ++i)
|
||||
(*this)[i] = t;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline _swizzle_base2& operator= (const VecType& that)
|
||||
{
|
||||
struct op {
|
||||
inline void operator() (value_type& e, value_type& t) { e = t; }
|
||||
};
|
||||
_apply_op(that, op());
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline void operator -= (const VecType& that)
|
||||
{
|
||||
struct op {
|
||||
inline void operator() (value_type& e, value_type& t) { e -= t; }
|
||||
};
|
||||
_apply_op(that, op());
|
||||
}
|
||||
|
||||
inline void operator += (const VecType& that)
|
||||
{
|
||||
struct op {
|
||||
inline void operator() (value_type& e, value_type& t) { e += t; }
|
||||
};
|
||||
_apply_op(that, op());
|
||||
}
|
||||
|
||||
inline void operator *= (const VecType& that)
|
||||
{
|
||||
struct op {
|
||||
inline void operator() (value_type& e, value_type& t) { e *= t; }
|
||||
};
|
||||
_apply_op(that, op());
|
||||
}
|
||||
|
||||
inline void operator /= (const VecType& that)
|
||||
{
|
||||
struct op {
|
||||
inline void operator() (value_type& e, value_type& t) { e /= t; }
|
||||
};
|
||||
_apply_op(that, op());
|
||||
}
|
||||
|
||||
inline value_type& operator[] (size_t i)
|
||||
{
|
||||
static const int offset_dst[4] = { E0, E1, E2, E3 };
|
||||
return this->elem(offset_dst[i]);
|
||||
}
|
||||
inline value_type operator[] (size_t i) const
|
||||
{
|
||||
static const int offset_dst[4] = { E0, E1, E2, E3 };
|
||||
return this->elem(offset_dst[i]);
|
||||
}
|
||||
protected:
|
||||
template <typename T>
|
||||
inline void _apply_op(const VecType& that, T op)
|
||||
{
|
||||
// Make a copy of the data in this == &that.
|
||||
// The copier should optimize out the copy in cases where the function is
|
||||
// properly inlined and the copy is not necessary.
|
||||
ValueType t[N];
|
||||
for (int i = 0; i < N; ++i)
|
||||
t[i] = that[i];
|
||||
for (int i = 0; i < N; ++i)
|
||||
op( (*this)[i], t[i] );
|
||||
}
|
||||
};
|
||||
|
||||
// Specialization for swizzles containing duplicate elements. These cannot be modified.
|
||||
template <typename ValueType, precision P, typename VecType, int N, int E0, int E1, int E2, int E3>
|
||||
struct _swizzle_base2<ValueType, P, VecType,N,E0,E1,E2,E3,1> : public _swizzle_base1<ValueType, P, VecType,E0,E1,E2,E3,N>
|
||||
{
|
||||
typedef VecType vec_type;
|
||||
typedef ValueType value_type;
|
||||
|
||||
struct Stub {};
|
||||
inline _swizzle_base2& operator= (Stub const &) { return *this; }
|
||||
|
||||
inline value_type operator[] (size_t i) const
|
||||
{
|
||||
static const int offset_dst[4] = { E0, E1, E2, E3 };
|
||||
return this->elem(offset_dst[i]);
|
||||
}
|
||||
};
|
||||
|
||||
template <int N,typename ValueType, precision P, typename VecType, int E0,int E1,int E2,int E3>
|
||||
struct _swizzle : public _swizzle_base2<ValueType, P, VecType, N,E0,E1,E2,E3,(E0==E1||E0==E2||E0==E3||E1==E2||E1==E3||E2==E3)>
|
||||
{
|
||||
typedef _swizzle_base2<ValueType, P, VecType,N,E0,E1,E2,E3,(E0==E1||E0==E2||E0==E3||E1==E2||E1==E3||E2==E3)> base_type;
|
||||
|
||||
using base_type::operator=;
|
||||
|
||||
inline operator VecType () const { return (*this)(); }
|
||||
};
|
||||
|
||||
//
|
||||
// To prevent the C++ syntax from getting entirely overwhelming, define some alias macros
|
||||
//
|
||||
#define _GLM_SWIZZLE_TEMPLATE1 template <int N, typename T, precision P, typename V, int E0, int E1, int E2, int E3>
|
||||
#define _GLM_SWIZZLE_TEMPLATE2 template <int N, typename T, precision P, typename V, int E0, int E1, int E2, int E3, int F0, int F1, int F2, int F3>
|
||||
#define _GLM_SWIZZLE_TYPE1 _swizzle<N, T, P, V, E0, E1, E2, E3>
|
||||
#define _GLM_SWIZZLE_TYPE2 _swizzle<N, T, P, V, F0, F1, F2, F3>
|
||||
|
||||
//
|
||||
// Wrapper for a binary operator (e.g. u.yy + v.zy)
|
||||
//
|
||||
#define _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \
|
||||
_GLM_SWIZZLE_TEMPLATE2 \
|
||||
inline V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \
|
||||
{ \
|
||||
return a() OPERAND b(); \
|
||||
} \
|
||||
_GLM_SWIZZLE_TEMPLATE1 \
|
||||
inline V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const V& b) \
|
||||
{ \
|
||||
return a() OPERAND b; \
|
||||
} \
|
||||
_GLM_SWIZZLE_TEMPLATE1 \
|
||||
inline V operator OPERAND ( const V& a, const _GLM_SWIZZLE_TYPE1& b) \
|
||||
{ \
|
||||
return a OPERAND b(); \
|
||||
}
|
||||
|
||||
//
|
||||
// Wrapper for a operand between a swizzle and a binary (e.g. 1.0f - u.xyz)
|
||||
//
|
||||
#define _GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \
|
||||
_GLM_SWIZZLE_TEMPLATE1 \
|
||||
inline V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const T& b) \
|
||||
{ \
|
||||
return a() OPERAND b; \
|
||||
} \
|
||||
_GLM_SWIZZLE_TEMPLATE1 \
|
||||
inline V operator OPERAND ( const T& a, const _GLM_SWIZZLE_TYPE1& b) \
|
||||
{ \
|
||||
return a OPERAND b(); \
|
||||
}
|
||||
|
||||
//
|
||||
// Macro for wrapping a function taking one argument (e.g. abs())
|
||||
//
|
||||
#define _GLM_SWIZZLE_FUNCTION_1_ARGS(RETURN_TYPE,FUNCTION) \
|
||||
_GLM_SWIZZLE_TEMPLATE1 \
|
||||
inline typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a) \
|
||||
{ \
|
||||
return FUNCTION(a()); \
|
||||
}
|
||||
|
||||
//
|
||||
// Macro for wrapping a function taking two vector arguments (e.g. dot()).
|
||||
//
|
||||
#define _GLM_SWIZZLE_FUNCTION_2_ARGS(RETURN_TYPE,FUNCTION) \
|
||||
_GLM_SWIZZLE_TEMPLATE2 \
|
||||
inline typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \
|
||||
{ \
|
||||
return FUNCTION(a(), b()); \
|
||||
} \
|
||||
_GLM_SWIZZLE_TEMPLATE1 \
|
||||
inline typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b) \
|
||||
{ \
|
||||
return FUNCTION(a(), b()); \
|
||||
} \
|
||||
_GLM_SWIZZLE_TEMPLATE1 \
|
||||
inline typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename V& b) \
|
||||
{ \
|
||||
return FUNCTION(a(), b); \
|
||||
} \
|
||||
_GLM_SWIZZLE_TEMPLATE1 \
|
||||
inline typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const V& a, const _GLM_SWIZZLE_TYPE1& b) \
|
||||
{ \
|
||||
return FUNCTION(a, b()); \
|
||||
}
|
||||
|
||||
//
|
||||
// Macro for wrapping a function take 2 vec arguments followed by a scalar (e.g. mix()).
|
||||
//
|
||||
#define _GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(RETURN_TYPE,FUNCTION) \
|
||||
_GLM_SWIZZLE_TEMPLATE2 \
|
||||
inline typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b, const T& c) \
|
||||
{ \
|
||||
return FUNCTION(a(), b(), c); \
|
||||
} \
|
||||
_GLM_SWIZZLE_TEMPLATE1 \
|
||||
inline typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \
|
||||
{ \
|
||||
return FUNCTION(a(), b(), c); \
|
||||
} \
|
||||
_GLM_SWIZZLE_TEMPLATE1 \
|
||||
inline typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename S0::vec_type& b, const T& c)\
|
||||
{ \
|
||||
return FUNCTION(a(), b, c); \
|
||||
} \
|
||||
_GLM_SWIZZLE_TEMPLATE1 \
|
||||
inline typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const typename V& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \
|
||||
{ \
|
||||
return FUNCTION(a, b(), c); \
|
||||
}
|
||||
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
|
||||
namespace glm
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
_GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(-)
|
||||
_GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(*)
|
||||
_GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(+)
|
||||
_GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(-)
|
||||
_GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(*)
|
||||
_GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(/)
|
||||
}
|
||||
|
||||
//
|
||||
// Swizzles are distinct types from the unswizzled type. The below macros will
|
||||
// provide template specializations for the swizzle types for the given functions
|
||||
// so that the compiler does not have any ambiguity to choosing how to handle
|
||||
// the function.
|
||||
//
|
||||
// The alternative is to use the operator()() when calling the function in order
|
||||
// to explicitly convert the swizzled type to the unswizzled type.
|
||||
//
|
||||
|
||||
//_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, abs);
|
||||
//_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, acos);
|
||||
//_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, acosh);
|
||||
//_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, all);
|
||||
//_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, any);
|
||||
|
||||
//_GLM_SWIZZLE_FUNCTION_2_ARGS(value_type, dot);
|
||||
//_GLM_SWIZZLE_FUNCTION_2_ARGS(vec_type, cross);
|
||||
//_GLM_SWIZZLE_FUNCTION_2_ARGS(vec_type, step);
|
||||
//_GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(vec_type, mix);
|
||||
}
|
||||
|
||||
#define _GLM_SWIZZLE2_2_MEMBERS(T, P, V, E0,E1) \
|
||||
struct { _swizzle<2, T, P, V<T, P>, 0,0,-1,-2> E0 ## E0; }; \
|
||||
struct { _swizzle<2, T, P, V<T, P>, 0,1,-1,-2> E0 ## E1; }; \
|
||||
struct { _swizzle<2, T, P, V<T, P>, 1,0,-1,-2> E1 ## E0; }; \
|
||||
struct { _swizzle<2, T, P, V<T, P>, 1,1,-1,-2> E1 ## E1; };
|
||||
|
||||
#define _GLM_SWIZZLE2_3_MEMBERS(T, P, V, E0,E1) \
|
||||
struct { _swizzle<3,T, P, V<T, P>, 0,0,0,-1> E0 ## E0 ## E0; }; \
|
||||
struct { _swizzle<3,T, P, V<T, P>, 0,0,1,-1> E0 ## E0 ## E1; }; \
|
||||
struct { _swizzle<3,T, P, V<T, P>, 0,1,0,-1> E0 ## E1 ## E0; }; \
|
||||
struct { _swizzle<3,T, P, V<T, P>, 0,1,1,-1> E0 ## E1 ## E1; }; \
|
||||
struct { _swizzle<3,T, P, V<T, P>, 1,0,0,-1> E1 ## E0 ## E0; }; \
|
||||
struct { _swizzle<3,T, P, V<T, P>, 1,0,1,-1> E1 ## E0 ## E1; }; \
|
||||
struct { _swizzle<3,T, P, V<T, P>, 1,1,0,-1> E1 ## E1 ## E0; }; \
|
||||
struct { _swizzle<3,T, P, V<T, P>, 1,1,1,-1> E1 ## E1 ## E1; };
|
||||
|
||||
#define _GLM_SWIZZLE2_4_MEMBERS(T, P, V, E0,E1) \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,1,1> E1 ## E1 ## E1 ## E1; };
|
||||
|
||||
#define _GLM_SWIZZLE3_2_MEMBERS(T, P, V, E0,E1,E2) \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 0,0,-1,-2> E0 ## E0; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 0,1,-1,-2> E0 ## E1; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 0,2,-1,-2> E0 ## E2; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 1,0,-1,-2> E1 ## E0; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 1,1,-1,-2> E1 ## E1; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 1,2,-1,-2> E1 ## E2; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 2,0,-1,-2> E2 ## E0; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 2,1,-1,-2> E2 ## E1; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 2,2,-1,-2> E2 ## E2; };
|
||||
|
||||
#define _GLM_SWIZZLE3_3_MEMBERS(T, P, V ,E0,E1,E2) \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,0,0,-1> E0 ## E0 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,0,1,-1> E0 ## E0 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,0,2,-1> E0 ## E0 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,1,0,-1> E0 ## E1 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,1,1,-1> E0 ## E1 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,1,2,-1> E0 ## E1 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,2,0,-1> E0 ## E2 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,2,1,-1> E0 ## E2 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,2,2,-1> E0 ## E2 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,0,0,-1> E1 ## E0 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,0,1,-1> E1 ## E0 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,0,2,-1> E1 ## E0 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,1,0,-1> E1 ## E1 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,1,1,-1> E1 ## E1 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,1,2,-1> E1 ## E1 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,2,0,-1> E1 ## E2 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,2,1,-1> E1 ## E2 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,2,2,-1> E1 ## E2 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,0,0,-1> E2 ## E0 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,0,1,-1> E2 ## E0 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,0,2,-1> E2 ## E0 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,1,0,-1> E2 ## E1 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,1,1,-1> E2 ## E1 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,1,2,-1> E2 ## E1 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,2,0,-1> E2 ## E2 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,2,1,-1> E2 ## E2 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,2,2,-1> E2 ## E2 ## E2; };
|
||||
|
||||
#define _GLM_SWIZZLE3_4_MEMBERS(T, P, V, E0,E1,E2) \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,2,2,2> E2 ## E2 ## E2 ## E2; };
|
||||
|
||||
#define _GLM_SWIZZLE4_2_MEMBERS(T, P, V, E0,E1,E2,E3) \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 0,0,-1,-2> E0 ## E0; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 0,1,-1,-2> E0 ## E1; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 0,2,-1,-2> E0 ## E2; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 0,3,-1,-2> E0 ## E3; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 1,0,-1,-2> E1 ## E0; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 1,1,-1,-2> E1 ## E1; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 1,2,-1,-2> E1 ## E2; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 1,3,-1,-2> E1 ## E3; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 2,0,-1,-2> E2 ## E0; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 2,1,-1,-2> E2 ## E1; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 2,2,-1,-2> E2 ## E2; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 2,3,-1,-2> E2 ## E3; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 3,0,-1,-2> E3 ## E0; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 3,1,-1,-2> E3 ## E1; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 3,2,-1,-2> E3 ## E2; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 3,3,-1,-2> E3 ## E3; };
|
||||
|
||||
#define _GLM_SWIZZLE4_3_MEMBERS(T,P, V, E0,E1,E2,E3) \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,0,0,-1> E0 ## E0 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,0,1,-1> E0 ## E0 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,0,2,-1> E0 ## E0 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,0,3,-1> E0 ## E0 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,1,0,-1> E0 ## E1 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,1,1,-1> E0 ## E1 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,1,2,-1> E0 ## E1 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,1,3,-1> E0 ## E1 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,2,0,-1> E0 ## E2 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,2,1,-1> E0 ## E2 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,2,2,-1> E0 ## E2 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,2,3,-1> E0 ## E2 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,3,0,-1> E0 ## E3 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,3,1,-1> E0 ## E3 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,3,2,-1> E0 ## E3 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,3,3,-1> E0 ## E3 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,0,0,-1> E1 ## E0 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,0,1,-1> E1 ## E0 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,0,2,-1> E1 ## E0 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,0,3,-1> E1 ## E0 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,1,0,-1> E1 ## E1 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,1,1,-1> E1 ## E1 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,1,2,-1> E1 ## E1 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,1,3,-1> E1 ## E1 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,2,0,-1> E1 ## E2 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,2,1,-1> E1 ## E2 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,2,2,-1> E1 ## E2 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,2,3,-1> E1 ## E2 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,3,0,-1> E1 ## E3 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,3,1,-1> E1 ## E3 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,3,2,-1> E1 ## E3 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,3,3,-1> E1 ## E3 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,0,0,-1> E2 ## E0 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,0,1,-1> E2 ## E0 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,0,2,-1> E2 ## E0 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,0,3,-1> E2 ## E0 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,1,0,-1> E2 ## E1 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,1,1,-1> E2 ## E1 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,1,2,-1> E2 ## E1 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,1,3,-1> E2 ## E1 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,2,0,-1> E2 ## E2 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,2,1,-1> E2 ## E2 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,2,2,-1> E2 ## E2 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,2,3,-1> E2 ## E2 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,3,0,-1> E2 ## E3 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,3,1,-1> E2 ## E3 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,3,2,-1> E2 ## E3 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,3,3,-1> E2 ## E3 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,0,0,-1> E3 ## E0 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,0,1,-1> E3 ## E0 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,0,2,-1> E3 ## E0 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,0,3,-1> E3 ## E0 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,1,0,-1> E3 ## E1 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,1,1,-1> E3 ## E1 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,1,2,-1> E3 ## E1 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,1,3,-1> E3 ## E1 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,2,0,-1> E3 ## E2 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,2,1,-1> E3 ## E2 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,2,2,-1> E3 ## E2 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,2,3,-1> E3 ## E2 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,3,0,-1> E3 ## E3 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,3,1,-1> E3 ## E3 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,3,2,-1> E3 ## E3 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,3,3,-1> E3 ## E3 ## E3; };
|
||||
|
||||
#define _GLM_SWIZZLE4_4_MEMBERS(T, P, V, E0,E1,E2,E3) \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,0,3> E0 ## E0 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,1,3> E0 ## E0 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,2,3> E0 ## E0 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,3,0> E0 ## E0 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,3,1> E0 ## E0 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,3,2> E0 ## E0 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,3,3> E0 ## E0 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,0,3> E0 ## E1 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,1,3> E0 ## E1 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,2,3> E0 ## E1 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,3,0> E0 ## E1 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,3,1> E0 ## E1 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,3,2> E0 ## E1 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,3,3> E0 ## E1 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,0,3> E0 ## E2 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,1,3> E0 ## E2 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,2,3> E0 ## E2 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,3,0> E0 ## E2 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,3,1> E0 ## E2 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,3,2> E0 ## E2 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,3,3> E0 ## E2 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,0,0> E0 ## E3 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,0,1> E0 ## E3 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,0,2> E0 ## E3 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,0,3> E0 ## E3 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,1,0> E0 ## E3 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,1,1> E0 ## E3 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,1,2> E0 ## E3 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,1,3> E0 ## E3 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,2,0> E0 ## E3 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,2,1> E0 ## E3 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,2,2> E0 ## E3 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,2,3> E0 ## E3 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,3,0> E0 ## E3 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,3,1> E0 ## E3 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,3,2> E0 ## E3 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,3,3> E0 ## E3 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,0,3> E1 ## E0 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,1,3> E1 ## E0 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,2,3> E1 ## E0 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,3,0> E1 ## E0 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,3,1> E1 ## E0 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,3,2> E1 ## E0 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,3,3> E1 ## E0 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,0,3> E1 ## E1 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,1,3> E1 ## E1 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,2,3> E1 ## E1 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,3,0> E1 ## E1 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,3,1> E1 ## E1 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,3,2> E1 ## E1 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,3,3> E1 ## E1 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,0,3> E1 ## E2 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,1,3> E1 ## E2 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,2,3> E1 ## E2 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,3,0> E1 ## E2 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,3,1> E1 ## E2 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,3,2> E1 ## E2 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,3,3> E1 ## E2 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,0,0> E1 ## E3 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,0,1> E1 ## E3 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,0,2> E1 ## E3 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,0,3> E1 ## E3 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,1,0> E1 ## E3 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,1,1> E1 ## E3 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,1,2> E1 ## E3 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,1,3> E1 ## E3 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,2,0> E1 ## E3 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,2,1> E1 ## E3 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,2,2> E1 ## E3 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,2,3> E1 ## E3 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,3,0> E1 ## E3 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,3,1> E1 ## E3 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,3,2> E1 ## E3 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,3,3> E1 ## E3 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,0,3> E2 ## E0 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,1,3> E2 ## E0 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,2,3> E2 ## E0 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,3,0> E2 ## E0 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,3,1> E2 ## E0 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,3,2> E2 ## E0 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,3,3> E2 ## E0 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,0,3> E2 ## E1 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,1,3> E2 ## E1 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,2,3> E2 ## E1 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,3,0> E2 ## E1 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,3,1> E2 ## E1 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,3,2> E2 ## E1 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,3,3> E2 ## E1 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,0,3> E2 ## E2 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,1,3> E2 ## E2 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,2,3> E2 ## E2 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,3,0> E2 ## E2 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,3,1> E2 ## E2 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,3,2> E2 ## E2 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,3,3> E2 ## E2 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,0,0> E2 ## E3 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,0,1> E2 ## E3 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,0,2> E2 ## E3 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,0,3> E2 ## E3 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,1,0> E2 ## E3 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,1,1> E2 ## E3 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,1,2> E2 ## E3 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,1,3> E2 ## E3 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,2,0> E2 ## E3 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,2,1> E2 ## E3 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,2,2> E2 ## E3 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,2,3> E2 ## E3 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,3,0> E2 ## E3 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,3,1> E2 ## E3 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,3,2> E2 ## E3 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,3,3> E2 ## E3 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,0,0> E3 ## E0 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,0,1> E3 ## E0 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,0,2> E3 ## E0 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,0,3> E3 ## E0 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,1,0> E3 ## E0 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,1,1> E3 ## E0 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,1,2> E3 ## E0 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,1,3> E3 ## E0 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,2,0> E3 ## E0 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,2,1> E3 ## E0 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,2,2> E3 ## E0 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,2,3> E3 ## E0 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,3,0> E3 ## E0 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,3,1> E3 ## E0 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,3,2> E3 ## E0 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,3,3> E3 ## E0 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,0,0> E3 ## E1 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,0,1> E3 ## E1 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,0,2> E3 ## E1 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,0,3> E3 ## E1 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,1,0> E3 ## E1 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,1,1> E3 ## E1 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,1,2> E3 ## E1 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,1,3> E3 ## E1 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,2,0> E3 ## E1 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,2,1> E3 ## E1 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,2,2> E3 ## E1 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,2,3> E3 ## E1 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,3,0> E3 ## E1 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,3,1> E3 ## E1 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,3,2> E3 ## E1 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,3,3> E3 ## E1 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,0,0> E3 ## E2 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,0,1> E3 ## E2 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,0,2> E3 ## E2 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,0,3> E3 ## E2 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,1,0> E3 ## E2 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,1,1> E3 ## E2 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,1,2> E3 ## E2 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,1,3> E3 ## E2 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,2,0> E3 ## E2 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,2,1> E3 ## E2 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,2,2> E3 ## E2 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,2,3> E3 ## E2 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,3,0> E3 ## E2 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,3,1> E3 ## E2 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,3,2> E3 ## E2 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,3,3> E3 ## E2 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,0,0> E3 ## E3 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,0,1> E3 ## E3 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,0,2> E3 ## E3 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,0,3> E3 ## E3 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,1,0> E3 ## E3 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,1,1> E3 ## E3 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,1,2> E3 ## E3 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,1,3> E3 ## E3 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,2,0> E3 ## E3 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,2,1> E3 ## E3 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,2,2> E3 ## E3 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,2,3> E3 ## E3 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,3,0> E3 ## E3 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,3,1> E3 ## E3 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,3,2> E3 ## E3 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,3,3> E3 ## E3 ## E3 ## E3; };
|
||||
|
||||
#endif//glm_core_swizzle
|
||||
Vendored
-724
@@ -1,724 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/_swizzle_func.hpp
|
||||
/// @date 2011-10-16 / 2011-10-16
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef glm_core_swizzle_func
|
||||
#define glm_core_swizzle_func
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B) \
|
||||
SWIZZLED_TYPE<TMPL_TYPE, PRECISION> A ## B() CONST \
|
||||
{ \
|
||||
return SWIZZLED_TYPE<TMPL_TYPE, PRECISION>(this->A, this->B); \
|
||||
}
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C) \
|
||||
SWIZZLED_TYPE<TMPL_TYPE, PRECISION> A ## B ## C() CONST \
|
||||
{ \
|
||||
return SWIZZLED_TYPE<TMPL_TYPE, PRECISION>(this->A, this->B, this->C); \
|
||||
}
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C, D) \
|
||||
SWIZZLED_TYPE<TMPL_TYPE, PRECISION> A ## B ## C ## D() CONST \
|
||||
{ \
|
||||
return SWIZZLED_TYPE<TMPL_TYPE, PRECISION>(this->A, this->B, this->C, this->D); \
|
||||
}
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC2_ENTRY_DEF(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B) \
|
||||
template <typename TMPL_TYPE> \
|
||||
SWIZZLED_TYPE<TMPL_TYPE> CLASS_TYPE<TMPL_TYPE, PRECISION>::A ## B() CONST \
|
||||
{ \
|
||||
return SWIZZLED_TYPE<TMPL_TYPE, PRECISION>(this->A, this->B); \
|
||||
}
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC3_ENTRY_DEF(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C) \
|
||||
template <typename TMPL_TYPE> \
|
||||
SWIZZLED_TYPE<TMPL_TYPE> CLASS_TYPE<TMPL_TYPE, PRECISION>::A ## B ## C() CONST \
|
||||
{ \
|
||||
return SWIZZLED_TYPE<TMPL_TYPE, PRECISION>(this->A, this->B, this->C); \
|
||||
}
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC4_ENTRY_DEF(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C, D) \
|
||||
template <typename TMPL_TYPE> \
|
||||
SWIZZLED_TYPE<TMPL_TYPE> CLASS_TYPE<TMPL_TYPE, PRECISION>::A ## B ## C ## D() CONST \
|
||||
{ \
|
||||
return SWIZZLED_TYPE<TMPL_TYPE, PRECISION>(this->A, this->B, this->C, this->D); \
|
||||
}
|
||||
|
||||
#define GLM_MUTABLE
|
||||
|
||||
#define GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, A)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_REF_FROM_VEC2(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE) \
|
||||
GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, x, y) \
|
||||
GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, r, g) \
|
||||
GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, s, t)
|
||||
|
||||
//GLM_SWIZZLE_GEN_REF_FROM_VEC2(valType, detail::vec2, detail::ref2)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_REF2_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, B)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_REF3_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, B, A)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_REF3_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_REF2_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_REF_FROM_VEC3(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE) \
|
||||
GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, x, y, z) \
|
||||
GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, r, g, b) \
|
||||
GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, s, t, p)
|
||||
|
||||
//GLM_SWIZZLE_GEN_REF_FROM_VEC3(valType, detail::vec3, detail::ref2, detail::ref3)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_REF2_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, D, C)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_REF3_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, C, B)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_REF4_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, C, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, C, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, D, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, D, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, B, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, C, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, C, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, D, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, D, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, A, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, A, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, B, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, B, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, D, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, D, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, A, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, A, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, C, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, C, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, A, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, B, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, B, C, A)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_REF2_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_REF3_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_REF4_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC4_TYPE, A, B, C, D)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_REF_FROM_VEC4(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE) \
|
||||
GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, x, y, z, w) \
|
||||
GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, r, g, b, a) \
|
||||
GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, s, t, p, q)
|
||||
|
||||
//GLM_SWIZZLE_GEN_REF_FROM_VEC4(valType, detail::vec4, detail::ref2, detail::ref3, detail::ref4)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, B)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC4_TYPE, A, B)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC_FROM_VEC2(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE) \
|
||||
GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, x, y) \
|
||||
GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, r, g) \
|
||||
GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, s, t)
|
||||
|
||||
//GLM_SWIZZLE_GEN_VEC_FROM_VEC2(valType, detail::vec2, detail::vec2, detail::vec3, detail::vec4)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, C)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC4_TYPE, A, B, C)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC_FROM_VEC3(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE) \
|
||||
GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, x, y, z) \
|
||||
GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, r, g, b) \
|
||||
GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, s, t, p)
|
||||
|
||||
//GLM_SWIZZLE_GEN_VEC_FROM_VEC3(valType, detail::vec3, detail::vec2, detail::vec3, detail::vec4)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D, D)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC2_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC4_TYPE, A, B, C, D)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC_FROM_VEC4(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE) \
|
||||
GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, x, y, z, w) \
|
||||
GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, r, g, b, a) \
|
||||
GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, s, t, p, q)
|
||||
|
||||
//GLM_SWIZZLE_GEN_VEC_FROM_VEC4(valType, detail::vec4, detail::vec2, detail::vec3, detail::vec4)
|
||||
|
||||
#endif//glm_core_swizzle_func
|
||||
Vendored
-217
@@ -1,217 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/_vectorize.hpp
|
||||
/// @date 2011-10-14 / 2011-10-14
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef GLM_CORE_DETAIL_INCLUDED
|
||||
#define GLM_CORE_DETAIL_INCLUDED
|
||||
|
||||
#include "type_vec1.hpp"
|
||||
#include "type_vec2.hpp"
|
||||
#include "type_vec3.hpp"
|
||||
#include "type_vec4.hpp"
|
||||
|
||||
#define VECTORIZE1_VEC(func) \
|
||||
template <typename T, precision P> \
|
||||
inline detail::tvec1<T, P> func( \
|
||||
detail::tvec1<T, P> const & v) \
|
||||
{ \
|
||||
return detail::tvec1<T, P>( \
|
||||
func(v.x)); \
|
||||
}
|
||||
|
||||
#define VECTORIZE2_VEC(func) \
|
||||
template <typename T, precision P> \
|
||||
inline detail::tvec2<T, P> func( \
|
||||
detail::tvec2<T, P> const & v) \
|
||||
{ \
|
||||
return detail::tvec2<T, P>( \
|
||||
func(v.x), \
|
||||
func(v.y)); \
|
||||
}
|
||||
|
||||
#define VECTORIZE3_VEC(func) \
|
||||
template <typename T, precision P> \
|
||||
inline detail::tvec3<T, P> func( \
|
||||
detail::tvec3<T, P> const & v) \
|
||||
{ \
|
||||
return detail::tvec3<T, P>( \
|
||||
func(v.x), \
|
||||
func(v.y), \
|
||||
func(v.z)); \
|
||||
}
|
||||
|
||||
#define VECTORIZE4_VEC(func) \
|
||||
template <typename T, precision P> \
|
||||
inline detail::tvec4<T, P> func( \
|
||||
detail::tvec4<T, P> const & v) \
|
||||
{ \
|
||||
return detail::tvec4<T, P>( \
|
||||
func(v.x), \
|
||||
func(v.y), \
|
||||
func(v.z), \
|
||||
func(v.w)); \
|
||||
}
|
||||
|
||||
#define VECTORIZE_VEC(func) \
|
||||
VECTORIZE1_VEC(func) \
|
||||
VECTORIZE2_VEC(func) \
|
||||
VECTORIZE3_VEC(func) \
|
||||
VECTORIZE4_VEC(func)
|
||||
|
||||
#define VECTORIZE1_VEC_SCA(func) \
|
||||
template <typename T, precision P> \
|
||||
inline detail::tvec1<T, P> func \
|
||||
( \
|
||||
detail::tvec1<T, P> const & x, \
|
||||
T const & y \
|
||||
) \
|
||||
{ \
|
||||
return detail::tvec1<T, P>( \
|
||||
func(x.x, y)); \
|
||||
}
|
||||
|
||||
#define VECTORIZE2_VEC_SCA(func) \
|
||||
template <typename T, precision P> \
|
||||
inline detail::tvec2<T, P> func \
|
||||
( \
|
||||
detail::tvec2<T, P> const & x, \
|
||||
T const & y \
|
||||
) \
|
||||
{ \
|
||||
return detail::tvec2<T, P>( \
|
||||
func(x.x, y), \
|
||||
func(x.y, y)); \
|
||||
}
|
||||
|
||||
#define VECTORIZE3_VEC_SCA(func) \
|
||||
template <typename T, precision P> \
|
||||
inline detail::tvec3<T, P> func \
|
||||
( \
|
||||
detail::tvec3<T, P> const & x, \
|
||||
T const & y \
|
||||
) \
|
||||
{ \
|
||||
return detail::tvec3<T, P>( \
|
||||
func(x.x, y), \
|
||||
func(x.y, y), \
|
||||
func(x.z, y)); \
|
||||
}
|
||||
|
||||
#define VECTORIZE4_VEC_SCA(func) \
|
||||
template <typename T, precision P> \
|
||||
inline detail::tvec4<T, P> func \
|
||||
( \
|
||||
detail::tvec4<T, P> const & x, \
|
||||
T const & y \
|
||||
) \
|
||||
{ \
|
||||
return detail::tvec4<T, P>( \
|
||||
func(x.x, y), \
|
||||
func(x.y, y), \
|
||||
func(x.z, y), \
|
||||
func(x.w, y)); \
|
||||
}
|
||||
|
||||
#define VECTORIZE_VEC_SCA(func) \
|
||||
VECTORIZE1_VEC_SCA(func) \
|
||||
VECTORIZE2_VEC_SCA(func) \
|
||||
VECTORIZE3_VEC_SCA(func) \
|
||||
VECTORIZE4_VEC_SCA(func)
|
||||
|
||||
#define VECTORIZE2_VEC_VEC(func) \
|
||||
template <typename T, precision P> \
|
||||
inline detail::tvec2<T, P> func \
|
||||
( \
|
||||
detail::tvec2<T, P> const & x, \
|
||||
detail::tvec2<T, P> const & y \
|
||||
) \
|
||||
{ \
|
||||
return detail::tvec2<T, P>( \
|
||||
func(x.x, y.x), \
|
||||
func(x.y, y.y)); \
|
||||
}
|
||||
|
||||
#define VECTORIZE3_VEC_VEC(func) \
|
||||
template <typename T, precision P> \
|
||||
inline detail::tvec3<T, P> func \
|
||||
( \
|
||||
detail::tvec3<T, P> const & x, \
|
||||
detail::tvec3<T, P> const & y \
|
||||
) \
|
||||
{ \
|
||||
return detail::tvec3<T, P>( \
|
||||
func(x.x, y.x), \
|
||||
func(x.y, y.y), \
|
||||
func(x.z, y.z)); \
|
||||
}
|
||||
|
||||
#define VECTORIZE4_VEC_VEC(func) \
|
||||
template <typename T, precision P> \
|
||||
inline detail::tvec4<T, P> func \
|
||||
( \
|
||||
detail::tvec4<T, P> const & x, \
|
||||
detail::tvec4<T, P> const & y \
|
||||
) \
|
||||
{ \
|
||||
return detail::tvec4<T, P>( \
|
||||
func(x.x, y.x), \
|
||||
func(x.y, y.y), \
|
||||
func(x.z, y.z), \
|
||||
func(x.w, y.w)); \
|
||||
}
|
||||
|
||||
#define VECTORIZE_VEC_VEC(func) \
|
||||
VECTORIZE2_VEC_VEC(func) \
|
||||
VECTORIZE3_VEC_VEC(func) \
|
||||
VECTORIZE4_VEC_VEC(func)
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template<bool C>
|
||||
struct If
|
||||
{
|
||||
template<typename F, typename T>
|
||||
static inline T apply(F functor, const T& val)
|
||||
{
|
||||
return functor(val);
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct If<false>
|
||||
{
|
||||
template<typename F, typename T>
|
||||
static inline T apply(F, const T& val)
|
||||
{
|
||||
return val;
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
|
||||
#endif//GLM_CORE_DETAIL_INCLUDED
|
||||
Vendored
-472
@@ -1,472 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_common.hpp
|
||||
/// @date 2008-03-08 / 2010-01-26
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
///
|
||||
/// @defgroup core_func_common Common functions
|
||||
/// @ingroup core
|
||||
///
|
||||
/// These all operate component-wise. The description is per component.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef GLM_FUNC_COMMON_INCLUDED
|
||||
#define GLM_FUNC_COMMON_INCLUDED
|
||||
|
||||
#include "setup.hpp"
|
||||
#include "precision.hpp"
|
||||
#include "type_int.hpp"
|
||||
#include "_fixes.hpp"
|
||||
|
||||
namespace glm
|
||||
{
|
||||
/// @addtogroup core_func_common
|
||||
/// @{
|
||||
|
||||
/// Returns x if x >= 0; otherwise, it returns -x.
|
||||
///
|
||||
/// @tparam genType floating-point or signed integer; scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/abs.xml">GLSL abs man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
genType abs(genType const & x);
|
||||
|
||||
/// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0.
|
||||
///
|
||||
/// @tparam genType Floating-point or signed integer; scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sign.xml">GLSL sign man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
genType sign(genType const & x);
|
||||
|
||||
/// Returns a value equal to the nearest integer that is less then or equal to x.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floor.xml">GLSL floor man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
genType floor(genType const & x);
|
||||
|
||||
/// Returns a value equal to the nearest integer to x
|
||||
/// whose absolute value is not larger than the absolute value of x.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/trunc.xml">GLSL trunc man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
genType trunc(genType const & x);
|
||||
|
||||
/// Returns a value equal to the nearest integer to x.
|
||||
/// The fraction 0.5 will round in a direction chosen by the
|
||||
/// implementation, presumably the direction that is fastest.
|
||||
/// This includes the possibility that round(x) returns the
|
||||
/// same value as roundEven(x) for all values of x.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
genType round(genType const & x);
|
||||
|
||||
/// Returns a value equal to the nearest integer to x.
|
||||
/// A fractional part of 0.5 will round toward the nearest even
|
||||
/// integer. (Both 3.5 and 4.5 for x will return 4.0.)
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/roundEven.xml">GLSL roundEven man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
/// @see <a href="http://developer.amd.com/documentation/articles/pages/New-Round-to-Even-Technique.aspx">New round to even technique</a>
|
||||
template <typename genType>
|
||||
genType roundEven(genType const & x);
|
||||
|
||||
/// Returns a value equal to the nearest integer
|
||||
/// that is greater than or equal to x.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ceil.xml">GLSL ceil man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
genType ceil(genType const & x);
|
||||
|
||||
/// Return x - floor(x).
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fract.xml">GLSL fract man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
genType fract(genType const & x);
|
||||
|
||||
/// Modulus. Returns x - y * floor(x / y)
|
||||
/// for each component in x using the floating point value y.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
genType mod(
|
||||
genType const & x,
|
||||
genType const & y);
|
||||
|
||||
/// Modulus. Returns x - y * floor(x / y)
|
||||
/// for each component in x using the floating point value y.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
genType mod(
|
||||
genType const & x,
|
||||
typename genType::value_type const & y);
|
||||
|
||||
/// Returns the fractional part of x and sets i to the integer
|
||||
/// part (as a whole number floating point value). Both the
|
||||
/// return value and the output parameter will have the same
|
||||
/// sign as x.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/modf.xml">GLSL modf man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
genType modf(
|
||||
genType const & x,
|
||||
genType & i);
|
||||
|
||||
/// Returns y if y < x; otherwise, it returns x.
|
||||
///
|
||||
/// @tparam genType Floating-point or integer; scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/min.xml">GLSL min man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a><<<<<<< HEAD
|
||||
template <typename genType>
|
||||
genType min(
|
||||
genType const & x,
|
||||
genType const & y);
|
||||
|
||||
template <typename genType>
|
||||
genType min(
|
||||
genType const & x,
|
||||
typename genType::value_type const & y);
|
||||
|
||||
/// Returns y if x < y; otherwise, it returns x.
|
||||
///
|
||||
/// @tparam genType Floating-point or integer; scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/max.xml">GLSL max man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
genType max(
|
||||
genType const & x,
|
||||
genType const & y);
|
||||
|
||||
template <typename genType>
|
||||
genType max(
|
||||
genType const & x,
|
||||
typename genType::value_type const & y);
|
||||
|
||||
/// Returns min(max(x, minVal), maxVal) for each component in x
|
||||
/// using the floating-point values minVal and maxVal.
|
||||
///
|
||||
/// @tparam genType Floating-point or integer; scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/clamp.xml">GLSL clamp man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
genType clamp(
|
||||
genType const & x,
|
||||
genType const & minVal,
|
||||
genType const & maxVal);
|
||||
|
||||
template <typename genType, precision P>
|
||||
genType clamp(
|
||||
genType const & x,
|
||||
typename genType::value_type const & minVal,
|
||||
typename genType::value_type const & maxVal);
|
||||
|
||||
/// If genTypeU is a floating scalar or vector:
|
||||
/// Returns x * (1.0 - a) + y * a, i.e., the linear blend of
|
||||
/// x and y using the floating-point value a.
|
||||
/// The value for a is not restricted to the range [0, 1].
|
||||
///
|
||||
/// If genTypeU is a boolean scalar or vector:
|
||||
/// Selects which vector each returned component comes
|
||||
/// from. For a component of <a> that is false, the
|
||||
/// corresponding component of x is returned. For a
|
||||
/// component of a that is true, the corresponding
|
||||
/// component of y is returned. Components of x and y that
|
||||
/// are not selected are allowed to be invalid floating point
|
||||
/// values and will have no effect on the results. Thus, this
|
||||
/// provides different functionality than
|
||||
/// genType mix(genType x, genType y, genType(a))
|
||||
/// where a is a Boolean vector.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mix.xml">GLSL mix man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
///
|
||||
/// @param[in] x Value to interpolate.
|
||||
/// @param[in] y Value to interpolate.
|
||||
/// @param[in] a Interpolant.
|
||||
///
|
||||
/// @tparam genTypeT Floating point scalar or vector.
|
||||
/// @tparam genTypeU Floating point or boolean scalar or vector. It can't be a vector if it is the length of genTypeT.
|
||||
///
|
||||
/// @code
|
||||
/// #include <glm/glm.hpp>
|
||||
/// ...
|
||||
/// float a;
|
||||
/// bool b;
|
||||
/// glm::dvec3 e;
|
||||
/// glm::dvec3 f;
|
||||
/// glm::vec4 g;
|
||||
/// glm::vec4 h;
|
||||
/// ...
|
||||
/// glm::vec4 r = glm::mix(g, h, a); // Interpolate with a floating-point scalar two vectors.
|
||||
/// glm::vec4 s = glm::mix(g, h, b); // Teturns g or h;
|
||||
/// glm::dvec3 t = glm::mix(e, f, a); // Types of the third parameter is not required to match with the first and the second.
|
||||
/// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter.
|
||||
/// @endcode
|
||||
template <typename T, typename U, precision P, template <typename, precision> class vecType>
|
||||
vecType<T, P> mix(
|
||||
vecType<T, P> const & x,
|
||||
vecType<T, P> const & y,
|
||||
vecType<U, P> const & a);
|
||||
|
||||
template <typename T, typename U, precision P, template <typename, precision> class vecType>
|
||||
vecType<T, P> mix(
|
||||
vecType<T, P> const & x,
|
||||
vecType<T, P> const & y,
|
||||
U const & a);
|
||||
|
||||
template <typename genTypeT, typename genTypeU>
|
||||
genTypeT mix(
|
||||
genTypeT const & x,
|
||||
genTypeT const & y,
|
||||
genTypeU const & a);
|
||||
|
||||
/// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
genType step(
|
||||
genType const & edge,
|
||||
genType const & x);
|
||||
|
||||
/// Returns 0.0 if x < edge, otherwise it returns 1.0.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <template <typename, precision> class vecType, typename T, precision P>
|
||||
vecType<T, P> step(
|
||||
T const & edge,
|
||||
vecType<T, P> const & x);
|
||||
|
||||
/// Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and
|
||||
/// performs smooth Hermite interpolation between 0 and 1
|
||||
/// when edge0 < x < edge1. This is useful in cases where
|
||||
/// you would want a threshold function with a smooth
|
||||
/// transition. This is equivalent to:
|
||||
/// genType t;
|
||||
/// t = clamp ((x - edge0) / (edge1 - edge0), 0, 1);
|
||||
/// return t * t * (3 - 2 * t);
|
||||
/// Results are undefined if edge0 >= edge1.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/smoothstep.xml">GLSL smoothstep man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
genType smoothstep(
|
||||
genType const & edge0,
|
||||
genType const & edge1,
|
||||
genType const & x);
|
||||
|
||||
template <typename genType>
|
||||
genType smoothstep(
|
||||
typename genType::value_type const & edge0,
|
||||
typename genType::value_type const & edge1,
|
||||
genType const & x);
|
||||
|
||||
/// Returns true if x holds a NaN (not a number)
|
||||
/// representation in the underlying implementation's set of
|
||||
/// floating point representations. Returns false otherwise,
|
||||
/// including for implementations with no NaN
|
||||
/// representations.
|
||||
///
|
||||
/// /!\ When using compiler fast math, this function may fail.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isnan.xml">GLSL isnan man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
typename genType::bool_type isnan(genType const & x);
|
||||
|
||||
/// Returns true if x holds a positive infinity or negative
|
||||
/// infinity representation in the underlying implementation's
|
||||
/// set of floating point representations. Returns false
|
||||
/// otherwise, including for implementations with no infinity
|
||||
/// representations.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isinf.xml">GLSL isinf man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
typename genType::bool_type isinf(genType const & x);
|
||||
|
||||
/// Returns a signed integer value representing
|
||||
/// the encoding of a floating-point value. The floating-point
|
||||
/// value's bit-level representation is preserved.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToInt.xml">GLSL floatBitsToInt man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
int floatBitsToInt(float const & v);
|
||||
|
||||
/// Returns a signed integer value representing
|
||||
/// the encoding of a floating-point value. The floatingpoint
|
||||
/// value's bit-level representation is preserved.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToInt.xml">GLSL floatBitsToInt man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <template <typename, precision> class vecType, precision P>
|
||||
vecType<int, P> floatBitsToInt(vecType<float, P> const & v);
|
||||
|
||||
/// Returns a unsigned integer value representing
|
||||
/// the encoding of a floating-point value. The floatingpoint
|
||||
/// value's bit-level representation is preserved.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToUint.xml">GLSL floatBitsToUint man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
uint floatBitsToUint(float const & v);
|
||||
|
||||
/// Returns a unsigned integer value representing
|
||||
/// the encoding of a floating-point value. The floatingpoint
|
||||
/// value's bit-level representation is preserved.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToUint.xml">GLSL floatBitsToUint man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <template <typename, precision> class vecType, precision P>
|
||||
vecType<uint, P> floatBitsToUint(vecType<float, P> const & v);
|
||||
|
||||
/// Returns a floating-point value corresponding to a signed
|
||||
/// integer encoding of a floating-point value.
|
||||
/// If an inf or NaN is passed in, it will not signal, and the
|
||||
/// resulting floating point value is unspecified. Otherwise,
|
||||
/// the bit-level representation is preserved.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/intBitsToFloat.xml">GLSL intBitsToFloat man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
float intBitsToFloat(int const & v);
|
||||
|
||||
/// Returns a floating-point value corresponding to a signed
|
||||
/// integer encoding of a floating-point value.
|
||||
/// If an inf or NaN is passed in, it will not signal, and the
|
||||
/// resulting floating point value is unspecified. Otherwise,
|
||||
/// the bit-level representation is preserved.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/intBitsToFloat.xml">GLSL intBitsToFloat man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <template <typename, precision> class vecType, precision P>
|
||||
vecType<float, P> intBitsToFloat(vecType<int, P> const & v);
|
||||
|
||||
/// Returns a floating-point value corresponding to a
|
||||
/// unsigned integer encoding of a floating-point value.
|
||||
/// If an inf or NaN is passed in, it will not signal, and the
|
||||
/// resulting floating point value is unspecified. Otherwise,
|
||||
/// the bit-level representation is preserved.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uintBitsToFloat.xml">GLSL uintBitsToFloat man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
float uintBitsToFloat(uint const & v);
|
||||
|
||||
/// Returns a floating-point value corresponding to a
|
||||
/// unsigned integer encoding of a floating-point value.
|
||||
/// If an inf or NaN is passed in, it will not signal, and the
|
||||
/// resulting floating point value is unspecified. Otherwise,
|
||||
/// the bit-level representation is preserved.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uintBitsToFloat.xml">GLSL uintBitsToFloat man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <template <typename, precision> class vecType, precision P>
|
||||
vecType<float, P> uintBitsToFloat(vecType<uint, P> const & v);
|
||||
|
||||
/// Computes and returns a * b + c.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fma.xml">GLSL fma man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
genType fma(genType const & a, genType const & b, genType const & c);
|
||||
|
||||
/// Splits x into a floating-point significand in the range
|
||||
/// [0.5, 1.0) and an integral exponent of two, such that:
|
||||
/// x = significand * exp(2, exponent)
|
||||
///
|
||||
/// The significand is returned by the function and the
|
||||
/// exponent is returned in the parameter exp. For a
|
||||
/// floating-point value of zero, the significant and exponent
|
||||
/// are both zero. For a floating-point value that is an
|
||||
/// infinity or is not a number, the results are undefined.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/frexp.xml">GLSL frexp man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType, typename genIType>
|
||||
genType frexp(genType const & x, genIType & exp);
|
||||
|
||||
/// Builds a floating-point number from x and the
|
||||
/// corresponding integral exponent of two in exp, returning:
|
||||
/// significand * exp(2, exponent)
|
||||
///
|
||||
/// If this product is too large to be represented in the
|
||||
/// floating-point type, the result is undefined.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ldexp.xml">GLSL ldexp man page</a>;
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType, typename genIType>
|
||||
genType ldexp(genType const & x, genIType const & exp);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
#include "func_common.inl"
|
||||
|
||||
#endif//GLM_FUNC_COMMON_INCLUDED
|
||||
Vendored
-826
@@ -1,826 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_common.inl
|
||||
/// @date 2008-08-03 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "func_vector_relational.hpp"
|
||||
#include "type_vec2.hpp"
|
||||
#include "type_vec3.hpp"
|
||||
#include "type_vec4.hpp"
|
||||
#include "_vectorize.hpp"
|
||||
#include <limits>
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <typename genFIType, bool /*signed*/>
|
||||
struct compute_abs
|
||||
{};
|
||||
|
||||
template <typename genFIType>
|
||||
struct compute_abs<genFIType, true>
|
||||
{
|
||||
inline static genFIType call(genFIType const & x)
|
||||
{
|
||||
return x >= genFIType(0) ? x : -x;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename genFIType>
|
||||
struct compute_abs<genFIType, false>
|
||||
{
|
||||
inline static genFIType call(genFIType const & x)
|
||||
{
|
||||
return x;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, typename U, precision P, template <class, precision> class vecType>
|
||||
struct compute_mix_vector
|
||||
{
|
||||
inline static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, vecType<U, P> const & a)
|
||||
{
|
||||
return vecType<T, P>(vecType<U, P>(x) + a * vecType<U, P>(y - x));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <class, precision> class vecType>
|
||||
struct compute_mix_vector<T, bool, P, vecType>
|
||||
{
|
||||
inline static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, vecType<bool, P> const & a)
|
||||
{
|
||||
vecType<T, P> Result;
|
||||
for(length_t i = 0; i < x.length(); ++i)
|
||||
Result[i] = a[i] ? y[i] : x[i];
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, typename U, precision P, template <class, precision> class vecType>
|
||||
struct compute_mix_scalar
|
||||
{
|
||||
inline static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, U const & a)
|
||||
{
|
||||
return vecType<T, P>(vecType<U, P>(x) + a * vecType<U, P>(y - x));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <class, precision> class vecType>
|
||||
struct compute_mix_scalar<T, bool, P, vecType>
|
||||
{
|
||||
inline static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, bool const & a)
|
||||
{
|
||||
return a ? y : x;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, typename U>
|
||||
struct compute_mix
|
||||
{
|
||||
inline static T call(T const & x, T const & y, U const & a)
|
||||
{
|
||||
return static_cast<T>(static_cast<U>(x) + a * static_cast<U>(y - x));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct compute_mix<T, bool>
|
||||
{
|
||||
inline static T call(T const & x, T const & y, bool const & a)
|
||||
{
|
||||
return a ? y : x;
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
|
||||
// abs
|
||||
template <typename genFIType>
|
||||
inline genFIType abs
|
||||
(
|
||||
genFIType const & x
|
||||
)
|
||||
{
|
||||
return detail::compute_abs<genFIType, std::numeric_limits<genFIType>::is_signed>::call(x);
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(abs)
|
||||
|
||||
// sign
|
||||
//Try something like based on x >> 31 to get the sign bit
|
||||
template <typename genFIType>
|
||||
inline genFIType sign
|
||||
(
|
||||
genFIType const & x
|
||||
)
|
||||
{
|
||||
if(x > genFIType(0))
|
||||
return genFIType(1);
|
||||
else if(x < genFIType(0))
|
||||
return genFIType(-1);
|
||||
return genFIType(0);
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(sign)
|
||||
|
||||
// floor
|
||||
template <typename genType>
|
||||
inline genType floor(genType const & x)
|
||||
{
|
||||
return ::std::floor(x);
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(floor)
|
||||
|
||||
// trunc
|
||||
template <typename genType>
|
||||
inline genType trunc(genType const & x)
|
||||
{
|
||||
// TODO, add C++11 std::trunk
|
||||
return x < 0 ? -floor(-x) : floor(x);
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(trunc)
|
||||
|
||||
// round
|
||||
template <typename genType>
|
||||
inline genType round(genType const& x)
|
||||
{
|
||||
// TODO, add C++11 std::round
|
||||
return x < 0 ? genType(int(x - genType(0.5))) : genType(int(x + genType(0.5)));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(round)
|
||||
|
||||
// roundEven
|
||||
template <typename genType>
|
||||
inline genType roundEven(genType const & x)
|
||||
{
|
||||
int Integer = static_cast<int>(x);
|
||||
genType IntegerPart = static_cast<genType>(Integer);
|
||||
genType FractionalPart = fract(x);
|
||||
|
||||
if(FractionalPart > static_cast<genType>(0.5) || FractionalPart < static_cast<genType>(0.5))
|
||||
return round(x);
|
||||
if((Integer % 2) == 0)
|
||||
return IntegerPart;
|
||||
if(x <= static_cast<genType>(0)) // Work around...
|
||||
return IntegerPart - static_cast<genType>(1);
|
||||
return IntegerPart + static_cast<genType>(1);
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(roundEven)
|
||||
|
||||
// ceil
|
||||
template <typename genType>
|
||||
inline genType ceil(genType const & x)
|
||||
{
|
||||
return ::std::ceil(x);
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(ceil)
|
||||
|
||||
// fract
|
||||
template <typename genType>
|
||||
inline genType fract
|
||||
(
|
||||
genType const & x
|
||||
)
|
||||
{
|
||||
return x - floor(x);
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(fract)
|
||||
|
||||
// mod
|
||||
template <typename genType>
|
||||
inline genType mod
|
||||
(
|
||||
genType const & x,
|
||||
genType const & y
|
||||
)
|
||||
{
|
||||
return x - y * floor(x / y);
|
||||
}
|
||||
|
||||
VECTORIZE_VEC_SCA(mod)
|
||||
VECTORIZE_VEC_VEC(mod)
|
||||
|
||||
// modf
|
||||
template <typename genType>
|
||||
inline genType modf
|
||||
(
|
||||
genType const & x,
|
||||
genType & i
|
||||
)
|
||||
{
|
||||
return std::modf(x, &i);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec2<T, P> modf
|
||||
(
|
||||
detail::tvec2<T, P> const & x,
|
||||
detail::tvec2<T, P> & i
|
||||
)
|
||||
{
|
||||
return detail::tvec2<T, P>(
|
||||
modf(x.x, i.x),
|
||||
modf(x.y, i.y));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec3<T, P> modf
|
||||
(
|
||||
detail::tvec3<T, P> const & x,
|
||||
detail::tvec3<T, P> & i
|
||||
)
|
||||
{
|
||||
return detail::tvec3<T, P>(
|
||||
modf(x.x, i.x),
|
||||
modf(x.y, i.y),
|
||||
modf(x.z, i.z));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec4<T, P> modf
|
||||
(
|
||||
detail::tvec4<T, P> const & x,
|
||||
detail::tvec4<T, P> & i
|
||||
)
|
||||
{
|
||||
return detail::tvec4<T, P>(
|
||||
modf(x.x, i.x),
|
||||
modf(x.y, i.y),
|
||||
modf(x.z, i.z),
|
||||
modf(x.w, i.w));
|
||||
}
|
||||
|
||||
// min
|
||||
template <typename genType>
|
||||
inline genType min
|
||||
(
|
||||
genType const & x,
|
||||
genType const & y
|
||||
)
|
||||
{
|
||||
return x < y ? x : y;
|
||||
}
|
||||
|
||||
VECTORIZE_VEC_SCA(min)
|
||||
VECTORIZE_VEC_VEC(min)
|
||||
|
||||
// max
|
||||
template <typename genType>
|
||||
inline genType max
|
||||
(
|
||||
genType const & x,
|
||||
genType const & y
|
||||
)
|
||||
{
|
||||
return x > y ? x : y;
|
||||
}
|
||||
|
||||
VECTORIZE_VEC_SCA(max)
|
||||
VECTORIZE_VEC_VEC(max)
|
||||
|
||||
// clamp
|
||||
template <typename genType>
|
||||
inline genType clamp
|
||||
(
|
||||
genType const & x,
|
||||
genType const & minVal,
|
||||
genType const & maxVal
|
||||
)
|
||||
{
|
||||
return min(maxVal, max(minVal, x));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec2<T, P> clamp
|
||||
(
|
||||
detail::tvec2<T, P> const & x,
|
||||
T const & minVal,
|
||||
T const & maxVal
|
||||
)
|
||||
{
|
||||
return detail::tvec2<T, P>(
|
||||
clamp(x.x, minVal, maxVal),
|
||||
clamp(x.y, minVal, maxVal));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec3<T, P> clamp
|
||||
(
|
||||
detail::tvec3<T, P> const & x,
|
||||
T const & minVal,
|
||||
T const & maxVal
|
||||
)
|
||||
{
|
||||
return detail::tvec3<T, P>(
|
||||
clamp(x.x, minVal, maxVal),
|
||||
clamp(x.y, minVal, maxVal),
|
||||
clamp(x.z, minVal, maxVal));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec4<T, P> clamp
|
||||
(
|
||||
detail::tvec4<T, P> const & x,
|
||||
T const & minVal,
|
||||
T const & maxVal
|
||||
)
|
||||
{
|
||||
return detail::tvec4<T, P>(
|
||||
clamp(x.x, minVal, maxVal),
|
||||
clamp(x.y, minVal, maxVal),
|
||||
clamp(x.z, minVal, maxVal),
|
||||
clamp(x.w, minVal, maxVal));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec2<T, P> clamp
|
||||
(
|
||||
detail::tvec2<T, P> const & x,
|
||||
detail::tvec2<T, P> const & minVal,
|
||||
detail::tvec2<T, P> const & maxVal
|
||||
)
|
||||
{
|
||||
return detail::tvec2<T, P>(
|
||||
clamp(x.x, minVal.x, maxVal.x),
|
||||
clamp(x.y, minVal.y, maxVal.y));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec3<T, P> clamp
|
||||
(
|
||||
detail::tvec3<T, P> const & x,
|
||||
detail::tvec3<T, P> const & minVal,
|
||||
detail::tvec3<T, P> const & maxVal
|
||||
)
|
||||
{
|
||||
return detail::tvec3<T, P>(
|
||||
clamp(x.x, minVal.x, maxVal.x),
|
||||
clamp(x.y, minVal.y, maxVal.y),
|
||||
clamp(x.z, minVal.z, maxVal.z));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec4<T, P> clamp
|
||||
(
|
||||
detail::tvec4<T, P> const & x,
|
||||
detail::tvec4<T, P> const & minVal,
|
||||
detail::tvec4<T, P> const & maxVal
|
||||
)
|
||||
{
|
||||
return detail::tvec4<T, P>(
|
||||
clamp(x.x, minVal.x, maxVal.x),
|
||||
clamp(x.y, minVal.y, maxVal.y),
|
||||
clamp(x.z, minVal.z, maxVal.z),
|
||||
clamp(x.w, minVal.w, maxVal.w));
|
||||
}
|
||||
|
||||
template <typename T, typename U, precision P, template <typename, precision> class vecType>
|
||||
inline vecType<T, P> mix
|
||||
(
|
||||
vecType<T, P> const & x,
|
||||
vecType<T, P> const & y,
|
||||
vecType<U, P> const & a
|
||||
)
|
||||
{
|
||||
return detail::compute_mix_vector<T, U, P, vecType>::call(x, y, a);
|
||||
}
|
||||
|
||||
template <typename T, typename U, precision P, template <typename, precision> class vecType>
|
||||
inline vecType<T, P> mix
|
||||
(
|
||||
vecType<T, P> const & x,
|
||||
vecType<T, P> const & y,
|
||||
U const & a
|
||||
)
|
||||
{
|
||||
return detail::compute_mix_scalar<T, U, P, vecType>::call(x, y, a);
|
||||
}
|
||||
|
||||
template <typename genTypeT, typename genTypeU>
|
||||
inline genTypeT mix
|
||||
(
|
||||
genTypeT const & x,
|
||||
genTypeT const & y,
|
||||
genTypeU const & a
|
||||
)
|
||||
{
|
||||
return detail::compute_mix<genTypeT, genTypeU>::call(x, y, a);
|
||||
}
|
||||
|
||||
// step
|
||||
template <typename genType>
|
||||
inline genType step
|
||||
(
|
||||
genType const & edge,
|
||||
genType const & x
|
||||
)
|
||||
{
|
||||
return mix(genType(1), genType(0), glm::lessThan(x, edge));
|
||||
}
|
||||
|
||||
template <template <typename, precision> class vecType, typename T, precision P>
|
||||
inline vecType<T, P> step
|
||||
(
|
||||
T const & edge,
|
||||
vecType<T, P> const & x
|
||||
)
|
||||
{
|
||||
return mix(vecType<T, P>(1), vecType<T, P>(0), glm::lessThan(x, vecType<T, P>(edge)));
|
||||
}
|
||||
|
||||
// smoothstep
|
||||
template <typename genType>
|
||||
inline genType smoothstep
|
||||
(
|
||||
genType const & edge0,
|
||||
genType const & edge1,
|
||||
genType const & x
|
||||
)
|
||||
{
|
||||
genType tmp = clamp((x - edge0) / (edge1 - edge0), genType(0), genType(1));
|
||||
return tmp * tmp * (genType(3) - genType(2) * tmp);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec2<T, P> smoothstep
|
||||
(
|
||||
T const & edge0,
|
||||
T const & edge1,
|
||||
detail::tvec2<T, P> const & x
|
||||
)
|
||||
{
|
||||
return detail::tvec2<T, P>(
|
||||
smoothstep(edge0, edge1, x.x),
|
||||
smoothstep(edge0, edge1, x.y));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec3<T, P> smoothstep
|
||||
(
|
||||
T const & edge0,
|
||||
T const & edge1,
|
||||
detail::tvec3<T, P> const & x
|
||||
)
|
||||
{
|
||||
return detail::tvec3<T, P>(
|
||||
smoothstep(edge0, edge1, x.x),
|
||||
smoothstep(edge0, edge1, x.y),
|
||||
smoothstep(edge0, edge1, x.z));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec4<T, P> smoothstep
|
||||
(
|
||||
T const & edge0,
|
||||
T const & edge1,
|
||||
detail::tvec4<T, P> const & x
|
||||
)
|
||||
{
|
||||
return detail::tvec4<T, P>(
|
||||
smoothstep(edge0, edge1, x.x),
|
||||
smoothstep(edge0, edge1, x.y),
|
||||
smoothstep(edge0, edge1, x.z),
|
||||
smoothstep(edge0, edge1, x.w));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec2<T, P> smoothstep
|
||||
(
|
||||
detail::tvec2<T, P> const & edge0,
|
||||
detail::tvec2<T, P> const & edge1,
|
||||
detail::tvec2<T, P> const & x
|
||||
)
|
||||
{
|
||||
return detail::tvec2<T, P>(
|
||||
smoothstep(edge0.x, edge1.x, x.x),
|
||||
smoothstep(edge0.y, edge1.y, x.y));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec3<T, P> smoothstep
|
||||
(
|
||||
detail::tvec3<T, P> const & edge0,
|
||||
detail::tvec3<T, P> const & edge1,
|
||||
detail::tvec3<T, P> const & x
|
||||
)
|
||||
{
|
||||
return detail::tvec3<T, P>(
|
||||
smoothstep(edge0.x, edge1.x, x.x),
|
||||
smoothstep(edge0.y, edge1.y, x.y),
|
||||
smoothstep(edge0.z, edge1.z, x.z));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec4<T, P> smoothstep
|
||||
(
|
||||
detail::tvec4<T, P> const & edge0,
|
||||
detail::tvec4<T, P> const & edge1,
|
||||
detail::tvec4<T, P> const & x
|
||||
)
|
||||
{
|
||||
return detail::tvec4<T, P>(
|
||||
smoothstep(edge0.x, edge1.x, x.x),
|
||||
smoothstep(edge0.y, edge1.y, x.y),
|
||||
smoothstep(edge0.z, edge1.z, x.z),
|
||||
smoothstep(edge0.w, edge1.w, x.w));
|
||||
}
|
||||
|
||||
// TODO: Not working on MinGW...
|
||||
template <typename genType>
|
||||
inline bool isnan(genType const & x)
|
||||
{
|
||||
# if(GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_INTEL))
|
||||
return _isnan(x) != 0;
|
||||
# elif(GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG))
|
||||
# if(GLM_PLATFORM & GLM_PLATFORM_ANDROID)
|
||||
return _isnan(x) != 0;
|
||||
# else
|
||||
return std::isnan(x);
|
||||
# endif
|
||||
# elif(GLM_COMPILER & GLM_COMPILER_CUDA)
|
||||
return isnan(x) != 0;
|
||||
# else
|
||||
return std::isnan(x);
|
||||
# endif
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline typename detail::tvec2<T, P>::bool_type isnan
|
||||
(
|
||||
detail::tvec2<T, P> const & x
|
||||
)
|
||||
{
|
||||
return typename detail::tvec2<T, P>::bool_type(
|
||||
isnan(x.x),
|
||||
isnan(x.y));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline typename detail::tvec3<T, P>::bool_type isnan
|
||||
(
|
||||
detail::tvec3<T, P> const & x
|
||||
)
|
||||
{
|
||||
return typename detail::tvec3<T, P>::bool_type(
|
||||
isnan(x.x),
|
||||
isnan(x.y),
|
||||
isnan(x.z));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline typename detail::tvec4<T, P>::bool_type isnan
|
||||
(
|
||||
detail::tvec4<T, P> const & x
|
||||
)
|
||||
{
|
||||
return typename detail::tvec4<T, P>::bool_type(
|
||||
isnan(x.x),
|
||||
isnan(x.y),
|
||||
isnan(x.z),
|
||||
isnan(x.w));
|
||||
}
|
||||
|
||||
template <typename genType>
|
||||
inline bool isinf(
|
||||
genType const & x)
|
||||
{
|
||||
# if(GLM_COMPILER & (GLM_COMPILER_INTEL | GLM_COMPILER_VC))
|
||||
return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF;
|
||||
# elif(GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG))
|
||||
# if(GLM_PLATFORM & GLM_PLATFORM_ANDROID)
|
||||
return _isinf(x) != 0;
|
||||
# else
|
||||
return std::isinf(x);
|
||||
# endif
|
||||
# elif(GLM_COMPILER & GLM_COMPILER_CUDA)
|
||||
// http://developer.download.nvidia.com/compute/cuda/4_2/rel/toolkit/docs/online/group__CUDA__MATH__DOUBLE_g13431dd2b40b51f9139cbb7f50c18fab.html#g13431dd2b40b51f9139cbb7f50c18fab
|
||||
return isinf(double(x)) != 0;
|
||||
# else
|
||||
return std::isinf(x);
|
||||
# endif
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline typename detail::tvec2<T, P>::bool_type isinf
|
||||
(
|
||||
detail::tvec2<T, P> const & x
|
||||
)
|
||||
{
|
||||
return typename detail::tvec2<T, P>::bool_type(
|
||||
isinf(x.x),
|
||||
isinf(x.y));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline typename detail::tvec3<T, P>::bool_type isinf
|
||||
(
|
||||
detail::tvec3<T, P> const & x
|
||||
)
|
||||
{
|
||||
return typename detail::tvec3<T, P>::bool_type(
|
||||
isinf(x.x),
|
||||
isinf(x.y),
|
||||
isinf(x.z));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline typename detail::tvec4<T, P>::bool_type isinf
|
||||
(
|
||||
detail::tvec4<T, P> const & x
|
||||
)
|
||||
{
|
||||
return typename detail::tvec4<T, P>::bool_type(
|
||||
isinf(x.x),
|
||||
isinf(x.y),
|
||||
isinf(x.z),
|
||||
isinf(x.w));
|
||||
}
|
||||
|
||||
inline int floatBitsToInt(float const & v)
|
||||
{
|
||||
int Bits;
|
||||
std::memcpy(&Bits, &v, sizeof(Bits));
|
||||
return Bits;
|
||||
}
|
||||
|
||||
template <template <typename, precision> class vecType, precision P>
|
||||
inline vecType<int, P> floatBitsToInt(vecType<float, P> const & v)
|
||||
{
|
||||
int Bits;
|
||||
std::memcpy(&Bits, &v, sizeof(Bits));
|
||||
return Bits;
|
||||
}
|
||||
|
||||
inline uint floatBitsToUint(float const & v)
|
||||
{
|
||||
float Float;
|
||||
std::memcpy(&Float, &v, sizeof(Float));
|
||||
return Float;
|
||||
}
|
||||
|
||||
template <template <typename, precision> class vecType, precision P>
|
||||
inline vecType<uint, P> floatBitsToUint(vecType<float, P> const & v)
|
||||
{
|
||||
return reinterpret_cast<vecType<uint, P>&>(const_cast<vecType<float, P>&>(v));
|
||||
}
|
||||
|
||||
inline float intBitsToFloat(int const & v)
|
||||
{
|
||||
return reinterpret_cast<float&>(const_cast<int&>(v));
|
||||
}
|
||||
|
||||
template <template <typename, precision> class vecType, precision P>
|
||||
inline vecType<float, P> intBitsToFloat(vecType<int, P> const & v)
|
||||
{
|
||||
return reinterpret_cast<vecType<float, P>&>(const_cast<vecType<int, P>&>(v));
|
||||
}
|
||||
|
||||
inline float uintBitsToFloat(uint const & v)
|
||||
{
|
||||
return reinterpret_cast<float&>(const_cast<uint&>(v));
|
||||
}
|
||||
|
||||
template <template <typename, precision> class vecType, precision P>
|
||||
inline vecType<float, P> uintBitsToFloat(vecType<uint, P> const & v)
|
||||
{
|
||||
return reinterpret_cast<vecType<float, P>&>(const_cast<vecType<uint, P>&>(v));
|
||||
}
|
||||
|
||||
template <typename genType>
|
||||
inline genType fma
|
||||
(
|
||||
genType const & a,
|
||||
genType const & b,
|
||||
genType const & c
|
||||
)
|
||||
{
|
||||
return a * b + c;
|
||||
}
|
||||
|
||||
template <typename genType>
|
||||
inline genType frexp
|
||||
(
|
||||
genType const & x,
|
||||
int & exp
|
||||
)
|
||||
{
|
||||
return std::frexp(x, exp);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec2<T, P> frexp
|
||||
(
|
||||
detail::tvec2<T, P> const & x,
|
||||
detail::tvec2<int, P> & exp
|
||||
)
|
||||
{
|
||||
return detail::tvec2<T, P>(
|
||||
frexp(x.x, exp.x),
|
||||
frexp(x.y, exp.y));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec3<T, P> frexp
|
||||
(
|
||||
detail::tvec3<T, P> const & x,
|
||||
detail::tvec3<int, P> & exp
|
||||
)
|
||||
{
|
||||
return detail::tvec3<T, P>(
|
||||
frexp(x.x, exp.x),
|
||||
frexp(x.y, exp.y),
|
||||
frexp(x.z, exp.z));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec4<T, P> frexp
|
||||
(
|
||||
detail::tvec4<T, P> const & x,
|
||||
detail::tvec4<int, P> & exp
|
||||
)
|
||||
{
|
||||
return detail::tvec4<T, P>(
|
||||
frexp(x.x, exp.x),
|
||||
frexp(x.y, exp.y),
|
||||
frexp(x.z, exp.z),
|
||||
frexp(x.w, exp.w));
|
||||
}
|
||||
|
||||
template <typename genType, precision P>
|
||||
inline genType ldexp
|
||||
(
|
||||
genType const & x,
|
||||
int const & exp
|
||||
)
|
||||
{
|
||||
return std::ldexp(x, exp);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec2<T, P> ldexp
|
||||
(
|
||||
detail::tvec2<T, P> const & x,
|
||||
detail::tvec2<int, P> const & exp
|
||||
)
|
||||
{
|
||||
return detail::tvec2<T, P>(
|
||||
ldexp(x.x, exp.x),
|
||||
ldexp(x.y, exp.y));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec3<T, P> ldexp
|
||||
(
|
||||
detail::tvec3<T, P> const & x,
|
||||
detail::tvec3<int, P> const & exp
|
||||
)
|
||||
{
|
||||
return detail::tvec3<T, P>(
|
||||
ldexp(x.x, exp.x),
|
||||
ldexp(x.y, exp.y),
|
||||
ldexp(x.z, exp.z));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec4<T, P> ldexp
|
||||
(
|
||||
detail::tvec4<T, P> const & x,
|
||||
detail::tvec4<int, P> const & exp
|
||||
)
|
||||
{
|
||||
return detail::tvec4<T, P>(
|
||||
ldexp(x.x, exp.x),
|
||||
ldexp(x.y, exp.y),
|
||||
ldexp(x.z, exp.z),
|
||||
ldexp(x.w, exp.w));
|
||||
}
|
||||
|
||||
}//namespace glm
|
||||
Vendored
-132
@@ -1,132 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_exponential.hpp
|
||||
/// @date 2008-08-08 / 2011-06-14
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
|
||||
///
|
||||
/// @defgroup core_func_exponential Exponential functions
|
||||
/// @ingroup core
|
||||
///
|
||||
/// These all operate component-wise. The description is per component.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef glm_core_func_exponential
|
||||
#define glm_core_func_exponential
|
||||
|
||||
#include "type_vec1.hpp"
|
||||
#include "type_vec2.hpp"
|
||||
#include "type_vec3.hpp"
|
||||
#include "type_vec4.hpp"
|
||||
#include <cmath>
|
||||
|
||||
namespace glm
|
||||
{
|
||||
/// @addtogroup core_func_exponential
|
||||
/// @{
|
||||
|
||||
/// Returns 'base' raised to the power 'exponent'.
|
||||
///
|
||||
/// @param base Floating point value. pow function is defined for input values of x defined in the range (inf-, inf+) in the limit of the type precision.
|
||||
/// @param exponent Floating point value representing the 'exponent'.
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/pow.xml">GLSL pow man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
|
||||
template <typename genType>
|
||||
genType pow(genType const & base, genType const & exponent);
|
||||
|
||||
/// Returns the natural exponentiation of x, i.e., e^x.
|
||||
///
|
||||
/// @param x exp function is defined for input values of x defined in the range (inf-, inf+) in the limit of the type precision.
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp.xml">GLSL exp man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
|
||||
template <typename genType>
|
||||
genType exp(genType const & x);
|
||||
|
||||
/// Returns the natural logarithm of x, i.e.,
|
||||
/// returns the value y which satisfies the equation x = e^y.
|
||||
/// Results are undefined if x <= 0.
|
||||
///
|
||||
/// @param x log function is defined for input values of x defined in the range (0, inf+) in the limit of the type precision.
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log.xml">GLSL log man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
|
||||
template <typename genType>
|
||||
genType log(genType const & x);
|
||||
|
||||
/// Returns 2 raised to the x power.
|
||||
///
|
||||
/// @param x exp2 function is defined for input values of x defined in the range (inf-, inf+) in the limit of the type precision.
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp2.xml">GLSL exp2 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
|
||||
template <typename genType>
|
||||
genType exp2(genType const & x);
|
||||
|
||||
/// Returns the base 2 log of x, i.e., returns the value y,
|
||||
/// which satisfies the equation x = 2 ^ y.
|
||||
///
|
||||
/// @param x log2 function is defined for input values of x defined in the range (0, inf+) in the limit of the type precision.
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log2.xml">GLSL log2 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
|
||||
template <typename genType>
|
||||
genType log2(genType x);
|
||||
|
||||
/// Returns the positive square root of x.
|
||||
///
|
||||
/// @param x sqrt function is defined for input values of x defined in the range [0, inf+) in the limit of the type precision.
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sqrt.xml">GLSL sqrt man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
|
||||
//template <typename genType>
|
||||
// genType sqrt(genType const & x);
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
vecType<T, P> sqrt(vecType<T, P> const & x);
|
||||
|
||||
/// Returns the reciprocal of the positive square root of x.
|
||||
///
|
||||
/// @param x inversesqrt function is defined for input values of x defined in the range [0, inf+) in the limit of the type precision.
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inversesqrt.xml">GLSL inversesqrt man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
|
||||
template <typename genType>
|
||||
genType inversesqrt(genType const & x);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
#include "func_exponential.inl"
|
||||
|
||||
#endif//glm_core_func_exponential
|
||||
Vendored
-216
@@ -1,216 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_exponential.inl
|
||||
/// @date 2008-08-03 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "func_vector_relational.hpp"
|
||||
#include "_vectorize.hpp"
|
||||
#include <limits>
|
||||
#include <cassert>
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <bool isFloat>
|
||||
struct compute_log2
|
||||
{
|
||||
template <typename T>
|
||||
T operator() (T const & Value) const;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct compute_log2<true>
|
||||
{
|
||||
template <typename T>
|
||||
inline T operator() (T const & Value) const
|
||||
{
|
||||
return static_cast<T>(::std::log(Value)) * static_cast<T>(1.4426950408889634073599246810019);
|
||||
}
|
||||
};
|
||||
|
||||
template <template <class, precision> class vecType, typename T, precision P>
|
||||
struct compute_inversesqrt
|
||||
{
|
||||
inline static vecType<T, P> call(vecType<T, P> const & x)
|
||||
{
|
||||
return static_cast<T>(1) / sqrt(x);
|
||||
}
|
||||
};
|
||||
|
||||
template <template <class, precision> class vecType>
|
||||
struct compute_inversesqrt<vecType, float, lowp>
|
||||
{
|
||||
inline static vecType<float, lowp> call(vecType<float, lowp> const & x)
|
||||
{
|
||||
vecType<float, lowp> tmp(x);
|
||||
vecType<float, lowp> xhalf(tmp * 0.5f);
|
||||
vecType<uint, lowp>* p = reinterpret_cast<vecType<uint, lowp>*>(const_cast<vecType<float, lowp>*>(&x));
|
||||
vecType<uint, lowp> i = vecType<uint, lowp>(0x5f375a86) - (*p >> vecType<uint, lowp>(1));
|
||||
vecType<float, lowp>* ptmp = reinterpret_cast<vecType<float, lowp>*>(&i);
|
||||
tmp = *ptmp;
|
||||
tmp = tmp * (1.5f - xhalf * tmp * tmp);
|
||||
return tmp;
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
|
||||
// pow
|
||||
template <typename genType>
|
||||
inline genType pow
|
||||
(
|
||||
genType const & x,
|
||||
genType const & y
|
||||
)
|
||||
{
|
||||
return std::pow(x, y);
|
||||
}
|
||||
|
||||
VECTORIZE_VEC_VEC(pow)
|
||||
|
||||
// exp
|
||||
template <typename genType>
|
||||
inline genType exp
|
||||
(
|
||||
genType const & x
|
||||
)
|
||||
{
|
||||
return std::exp(x);
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(exp)
|
||||
|
||||
// log
|
||||
template <typename genType>
|
||||
inline genType log
|
||||
(
|
||||
genType const & x
|
||||
)
|
||||
{
|
||||
return std::log(x);
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(log)
|
||||
|
||||
//exp2, ln2 = 0.69314718055994530941723212145818f
|
||||
template <typename genType>
|
||||
inline genType exp2(genType const & x)
|
||||
{
|
||||
return std::exp(static_cast<genType>(0.69314718055994530941723212145818) * x);
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(exp2)
|
||||
|
||||
// log2, ln2 = 0.69314718055994530941723212145818f
|
||||
template <typename genType>
|
||||
inline genType log2(genType x)
|
||||
{
|
||||
assert(x > genType(0)); // log2 is only defined on the range (0, inf]
|
||||
return detail::compute_log2<std::numeric_limits<genType>::is_iec559>()(x);
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(log2)
|
||||
|
||||
namespace detail
|
||||
{
|
||||
template <template <class, precision> class vecType, typename T, precision P>
|
||||
struct compute_sqrt{};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_sqrt<detail::tvec1, T, P>
|
||||
{
|
||||
inline static detail::tvec1<T, P> call(detail::tvec1<T, P> const & x)
|
||||
{
|
||||
return detail::tvec1<T, P>(std::sqrt(x.x));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_sqrt<detail::tvec2, T, P>
|
||||
{
|
||||
inline static detail::tvec2<T, P> call(detail::tvec2<T, P> const & x)
|
||||
{
|
||||
return detail::tvec2<T, P>(std::sqrt(x.x), std::sqrt(x.y));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_sqrt<detail::tvec3, T, P>
|
||||
{
|
||||
inline static detail::tvec3<T, P> call(detail::tvec3<T, P> const & x)
|
||||
{
|
||||
return detail::tvec3<T, P>(std::sqrt(x.x), std::sqrt(x.y), std::sqrt(x.z));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_sqrt<detail::tvec4, T, P>
|
||||
{
|
||||
inline static detail::tvec4<T, P> call(detail::tvec4<T, P> const & x)
|
||||
{
|
||||
return detail::tvec4<T, P>(std::sqrt(x.x), std::sqrt(x.y), std::sqrt(x.z), std::sqrt(x.w));
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
|
||||
// sqrt
|
||||
inline float sqrt(float x)
|
||||
{
|
||||
return detail::compute_sqrt<detail::tvec1, float, highp>::call(x).x;
|
||||
}
|
||||
|
||||
inline double sqrt(double x)
|
||||
{
|
||||
return detail::compute_sqrt<detail::tvec1, double, highp>::call(x).x;
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
inline vecType<T, P> sqrt(vecType<T, P> const & x)
|
||||
{
|
||||
return detail::compute_sqrt<vecType, T, P>::call(x);
|
||||
}
|
||||
|
||||
// inversesqrt
|
||||
inline float inversesqrt(float const & x)
|
||||
{
|
||||
return 1.0f / sqrt(x);
|
||||
}
|
||||
|
||||
inline double inversesqrt(double const & x)
|
||||
{
|
||||
return 1.0 / sqrt(x);
|
||||
}
|
||||
|
||||
template <template <class, precision> class vecType, typename T, precision P>
|
||||
inline vecType<T, P> inversesqrt
|
||||
(
|
||||
vecType<T, P> const & x
|
||||
)
|
||||
{
|
||||
return detail::compute_inversesqrt<vecType, T, P>::call(x);
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(inversesqrt)
|
||||
}//namespace glm
|
||||
Vendored
-151
@@ -1,151 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_geometric.hpp
|
||||
/// @date 2008-08-03 / 2011-06-14
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
|
||||
///
|
||||
/// @defgroup core_func_geometric Geometric functions
|
||||
/// @ingroup core
|
||||
///
|
||||
/// These operate on vectors as vectors, not component-wise.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef glm_core_func_geometric
|
||||
#define glm_core_func_geometric
|
||||
|
||||
#include "type_vec3.hpp"
|
||||
|
||||
namespace glm
|
||||
{
|
||||
/// @addtogroup core_func_geometric
|
||||
/// @{
|
||||
|
||||
/// Returns the length of x, i.e., sqrt(x * x).
|
||||
///
|
||||
/// @tparam genType Floating-point vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/length.xml">GLSL length man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
|
||||
template <typename genType>
|
||||
typename genType::value_type length(
|
||||
genType const & x);
|
||||
|
||||
/// Returns the distance betwwen p0 and p1, i.e., length(p0 - p1).
|
||||
///
|
||||
/// @tparam genType Floating-point vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/distance.xml">GLSL distance man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
|
||||
template <typename genType>
|
||||
typename genType::value_type distance(
|
||||
genType const & p0,
|
||||
genType const & p1);
|
||||
|
||||
/// Returns the dot product of x and y, i.e., result = x * y.
|
||||
///
|
||||
/// @tparam genType Floating-point vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/dot.xml">GLSL dot man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
T dot(
|
||||
vecType<T, P> const & x,
|
||||
vecType<T, P> const & y);
|
||||
|
||||
/// Returns the dot product of x and y, i.e., result = x * y.
|
||||
///
|
||||
/// @tparam genType Floating-point vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/dot.xml">GLSL dot man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
|
||||
template <typename genType>
|
||||
genType dot(
|
||||
genType const & x,
|
||||
genType const & y);
|
||||
|
||||
/// Returns the cross product of x and y.
|
||||
///
|
||||
/// @tparam valType Floating-point scalar types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cross.xml">GLSL cross man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
|
||||
template <typename T, precision P>
|
||||
detail::tvec3<T, P> cross(
|
||||
detail::tvec3<T, P> const & x,
|
||||
detail::tvec3<T, P> const & y);
|
||||
|
||||
/// Returns a vector in the same direction as x but with length of 1.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/normalize.xml">GLSL normalize man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
|
||||
template <typename genType>
|
||||
genType normalize(
|
||||
genType const & x);
|
||||
|
||||
/// If dot(Nref, I) < 0.0, return N, otherwise, return -N.
|
||||
///
|
||||
/// @tparam genType Floating-point vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/faceforward.xml">GLSL faceforward man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
|
||||
template <typename genType>
|
||||
genType faceforward(
|
||||
genType const & N,
|
||||
genType const & I,
|
||||
genType const & Nref);
|
||||
|
||||
/// For the incident vector I and surface orientation N,
|
||||
/// returns the reflection direction : result = I - 2.0 * dot(N, I) * N.
|
||||
///
|
||||
/// @tparam genType Floating-point vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/reflect.xml">GLSL reflect man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
|
||||
template <typename genType>
|
||||
genType reflect(
|
||||
genType const & I,
|
||||
genType const & N);
|
||||
|
||||
/// For the incident vector I and surface normal N,
|
||||
/// and the ratio of indices of refraction eta,
|
||||
/// return the refraction vector.
|
||||
///
|
||||
/// @tparam genType Floating-point vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/refract.xml">GLSL refract man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
vecType<T, P> refract(
|
||||
vecType<T, P> const & I,
|
||||
vecType<T, P> const & N,
|
||||
T const & eta);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
#include "func_geometric.inl"
|
||||
|
||||
#endif//glm_core_func_geometric
|
||||
Vendored
-303
@@ -1,303 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_geometric.inl
|
||||
/// @date 2008-08-03 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "func_exponential.hpp"
|
||||
#include "func_common.hpp"
|
||||
#include "type_vec2.hpp"
|
||||
#include "type_vec4.hpp"
|
||||
#include "type_float.hpp"
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <template <class, precision> class vecType, typename T, precision P>
|
||||
struct compute_dot{};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_dot<detail::tvec1, T, P>
|
||||
{
|
||||
inline static T call(detail::tvec1<T, P> const & x, detail::tvec1<T, P> const & y)
|
||||
{
|
||||
return detail::tvec1<T, P>(x * y).x;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_dot<detail::tvec2, T, P>
|
||||
{
|
||||
inline static T call(detail::tvec2<T, P> const & x, detail::tvec2<T, P> const & y)
|
||||
{
|
||||
detail::tvec2<T, P> tmp(x * y);
|
||||
return tmp.x + tmp.y;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_dot<detail::tvec3, T, P>
|
||||
{
|
||||
inline static T call(detail::tvec3<T, P> const & x, detail::tvec3<T, P> const & y)
|
||||
{
|
||||
detail::tvec3<T, P> tmp(x * y);
|
||||
return tmp.x + tmp.y + tmp.z;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_dot<detail::tvec4, T, P>
|
||||
{
|
||||
inline static T call(detail::tvec4<T, P> const & x, detail::tvec4<T, P> const & y)
|
||||
{
|
||||
detail::tvec4<T, P> tmp(x * y);
|
||||
return (tmp.x + tmp.y) + (tmp.z + tmp.w);
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
|
||||
// length
|
||||
template <typename genType>
|
||||
inline genType length
|
||||
(
|
||||
genType const & x
|
||||
)
|
||||
{
|
||||
genType sqr = x * x;
|
||||
return sqrt(sqr);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline T length(detail::tvec2<T, P> const & v)
|
||||
{
|
||||
T sqr = v.x * v.x + v.y * v.y;
|
||||
return sqrt(sqr);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline T length(detail::tvec3<T, P> const & v)
|
||||
{
|
||||
T sqr = v.x * v.x + v.y * v.y + v.z * v.z;
|
||||
return sqrt(sqr);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline T length(detail::tvec4<T, P> const & v)
|
||||
{
|
||||
T sqr = v.x * v.x + v.y * v.y + v.z * v.z + v.w * v.w;
|
||||
return sqrt(sqr);
|
||||
}
|
||||
|
||||
// distance
|
||||
template <typename genType>
|
||||
inline genType distance
|
||||
(
|
||||
genType const & p0,
|
||||
genType const & p1
|
||||
)
|
||||
{
|
||||
return length(p1 - p0);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline T distance
|
||||
(
|
||||
detail::tvec2<T, P> const & p0,
|
||||
detail::tvec2<T, P> const & p1
|
||||
)
|
||||
{
|
||||
return length(p1 - p0);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline T distance
|
||||
(
|
||||
detail::tvec3<T, P> const & p0,
|
||||
detail::tvec3<T, P> const & p1
|
||||
)
|
||||
{
|
||||
return length(p1 - p0);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline T distance
|
||||
(
|
||||
detail::tvec4<T, P> const & p0,
|
||||
detail::tvec4<T, P> const & p1
|
||||
)
|
||||
{
|
||||
return length(p1 - p0);
|
||||
}
|
||||
|
||||
// dot
|
||||
template <typename T>
|
||||
inline T dot
|
||||
(
|
||||
T const & x,
|
||||
T const & y
|
||||
)
|
||||
{
|
||||
return detail::compute_dot<detail::tvec1, T, highp>::call(x, y);
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
inline T dot
|
||||
(
|
||||
vecType<T, P> const & x,
|
||||
vecType<T, P> const & y
|
||||
)
|
||||
{
|
||||
return detail::compute_dot<vecType, T, P>::call(x, y);
|
||||
}
|
||||
|
||||
/* // SSE3
|
||||
inline float dot(const tvec4<float>& x, const tvec4<float>& y)
|
||||
{
|
||||
float Result;
|
||||
__asm
|
||||
{
|
||||
mov esi, x
|
||||
mov edi, y
|
||||
movaps xmm0, [esi]
|
||||
mulps xmm0, [edi]
|
||||
haddps( _xmm0, _xmm0 )
|
||||
haddps( _xmm0, _xmm0 )
|
||||
movss Result, xmm0
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
*/
|
||||
// cross
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec3<T, P> cross
|
||||
(
|
||||
detail::tvec3<T, P> const & x,
|
||||
detail::tvec3<T, P> const & y
|
||||
)
|
||||
{
|
||||
return detail::tvec3<T, P>(
|
||||
x.y * y.z - y.y * x.z,
|
||||
x.z * y.x - y.z * x.x,
|
||||
x.x * y.y - y.x * x.y);
|
||||
}
|
||||
|
||||
// normalize
|
||||
template <typename genType>
|
||||
inline genType normalize
|
||||
(
|
||||
genType const & x
|
||||
)
|
||||
{
|
||||
return x < genType(0) ? genType(-1) : genType(1);
|
||||
}
|
||||
|
||||
// According to issue 10 GLSL 1.10 specification, if length(x) == 0 then result is undefine and generate an error
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec2<T, P> normalize
|
||||
(
|
||||
detail::tvec2<T, P> const & x
|
||||
)
|
||||
{
|
||||
T sqr = x.x * x.x + x.y * x.y;
|
||||
return x * inversesqrt(sqr);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec3<T, P> normalize
|
||||
(
|
||||
detail::tvec3<T, P> const & x
|
||||
)
|
||||
{
|
||||
T sqr = x.x * x.x + x.y * x.y + x.z * x.z;
|
||||
return x * inversesqrt(sqr);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec4<T, P> normalize
|
||||
(
|
||||
detail::tvec4<T, P> const & x
|
||||
)
|
||||
{
|
||||
T sqr = x.x * x.x + x.y * x.y + x.z * x.z + x.w * x.w;
|
||||
return x * inversesqrt(sqr);
|
||||
}
|
||||
|
||||
// faceforward
|
||||
template <typename genType>
|
||||
inline genType faceforward
|
||||
(
|
||||
genType const & N,
|
||||
genType const & I,
|
||||
genType const & Nref
|
||||
)
|
||||
{
|
||||
return dot(Nref, I) < 0 ? N : -N;
|
||||
}
|
||||
|
||||
// reflect
|
||||
template <typename genType>
|
||||
inline genType reflect
|
||||
(
|
||||
genType const & I,
|
||||
genType const & N
|
||||
)
|
||||
{
|
||||
return I - N * dot(N, I) * genType(2);
|
||||
}
|
||||
|
||||
// refract
|
||||
template <typename genType>
|
||||
inline genType refract
|
||||
(
|
||||
genType const & I,
|
||||
genType const & N,
|
||||
genType const & eta
|
||||
)
|
||||
{
|
||||
genType dotValue = dot(N, I);
|
||||
genType k = genType(1) - eta * eta * (genType(1) - dotValue * dotValue);
|
||||
if(k < genType(0))
|
||||
return genType(0);
|
||||
else
|
||||
return eta * I - (eta * dotValue + sqrt(k)) * N;
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
inline vecType<T, P> refract
|
||||
(
|
||||
vecType<T, P> const & I,
|
||||
vecType<T, P> const & N,
|
||||
T const & eta
|
||||
)
|
||||
{
|
||||
T dotValue = dot(N, I);
|
||||
T k = T(1) - eta * eta * (T(1) - dotValue * dotValue);
|
||||
if(k < T(0))
|
||||
return vecType<T, P>(0);
|
||||
else
|
||||
return eta * I - (eta * dotValue + std::sqrt(k)) * N;
|
||||
}
|
||||
|
||||
}//namespace glm
|
||||
Vendored
-203
@@ -1,203 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_integer.hpp
|
||||
/// @date 2010-03-17 / 2011-06-18
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
///
|
||||
/// @defgroup core_func_integer Integer functions
|
||||
/// @ingroup core
|
||||
///
|
||||
/// These all operate component-wise. The description is per component.
|
||||
/// The notation [a, b] means the set of bits from bit-number a through bit-number
|
||||
/// b, inclusive. The lowest-order bit is bit 0.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef glm_core_func_integer
|
||||
#define glm_core_func_integer
|
||||
|
||||
#include "setup.hpp"
|
||||
|
||||
namespace glm
|
||||
{
|
||||
/// @addtogroup core_func_integer
|
||||
/// @{
|
||||
|
||||
/// Adds 32-bit unsigned integer x and y, returning the sum
|
||||
/// modulo pow(2, 32). The value carry is set to 0 if the sum was
|
||||
/// less than pow(2, 32), or to 1 otherwise.
|
||||
///
|
||||
/// @tparam genUType Unsigned integer scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uaddCarry.xml">GLSL uaddCarry man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
template <typename genUType>
|
||||
genUType uaddCarry(
|
||||
genUType const & x,
|
||||
genUType const & y,
|
||||
genUType & carry);
|
||||
|
||||
/// Subtracts the 32-bit unsigned integer y from x, returning
|
||||
/// the difference if non-negative, or pow(2, 32) plus the difference
|
||||
/// otherwise. The value borrow is set to 0 if x >= y, or to 1 otherwise.
|
||||
///
|
||||
/// @tparam genUType Unsigned integer scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/usubBorrow.xml">GLSL usubBorrow man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
template <typename genUType>
|
||||
genUType usubBorrow(
|
||||
genUType const & x,
|
||||
genUType const & y,
|
||||
genUType & borrow);
|
||||
|
||||
/// Multiplies 32-bit integers x and y, producing a 64-bit
|
||||
/// result. The 32 least-significant bits are returned in lsb.
|
||||
/// The 32 most-significant bits are returned in msb.
|
||||
///
|
||||
/// @tparam genUType Unsigned integer scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/umulExtended.xml">GLSL umulExtended man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
template <typename genUType>
|
||||
void umulExtended(
|
||||
genUType const & x,
|
||||
genUType const & y,
|
||||
genUType & msb,
|
||||
genUType & lsb);
|
||||
|
||||
/// Multiplies 32-bit integers x and y, producing a 64-bit
|
||||
/// result. The 32 least-significant bits are returned in lsb.
|
||||
/// The 32 most-significant bits are returned in msb.
|
||||
///
|
||||
/// @tparam genIType Signed integer scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/imulExtended.xml">GLSL imulExtended man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
template <typename genIType>
|
||||
void imulExtended(
|
||||
genIType const & x,
|
||||
genIType const & y,
|
||||
genIType & msb,
|
||||
genIType & lsb);
|
||||
|
||||
/// Extracts bits [offset, offset + bits - 1] from value,
|
||||
/// returning them in the least significant bits of the result.
|
||||
/// For unsigned data types, the most significant bits of the
|
||||
/// result will be set to zero. For signed data types, the
|
||||
/// most significant bits will be set to the value of bit offset + base - 1.
|
||||
///
|
||||
/// If bits is zero, the result will be zero. The result will be
|
||||
/// undefined if offset or bits is negative, or if the sum of
|
||||
/// offset and bits is greater than the number of bits used
|
||||
/// to store the operand.
|
||||
///
|
||||
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldExtract.xml">GLSL bitfieldExtract man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
template <typename genIUType>
|
||||
genIUType bitfieldExtract(
|
||||
genIUType const & Value,
|
||||
int const & Offset,
|
||||
int const & Bits);
|
||||
|
||||
/// Returns the insertion the bits least-significant bits of insert into base.
|
||||
///
|
||||
/// The result will have bits [offset, offset + bits - 1] taken
|
||||
/// from bits [0, bits - 1] of insert, and all other bits taken
|
||||
/// directly from the corresponding bits of base. If bits is
|
||||
/// zero, the result will simply be base. The result will be
|
||||
/// undefined if offset or bits is negative, or if the sum of
|
||||
/// offset and bits is greater than the number of bits used to
|
||||
/// store the operand.
|
||||
///
|
||||
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldInsert.xml">GLSL bitfieldInsert man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
template <typename genIUType>
|
||||
genIUType bitfieldInsert(
|
||||
genIUType const & Base,
|
||||
genIUType const & Insert,
|
||||
int const & Offset,
|
||||
int const & Bits);
|
||||
|
||||
/// Returns the reversal of the bits of value.
|
||||
/// The bit numbered n of the result will be taken from bit (bits - 1) - n of value,
|
||||
/// where bits is the total number of bits used to represent value.
|
||||
///
|
||||
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldReverse.xml">GLSL bitfieldReverse man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
template <typename genIUType>
|
||||
genIUType bitfieldReverse(genIUType const & Value);
|
||||
|
||||
/// Returns the number of bits set to 1 in the binary representation of value.
|
||||
///
|
||||
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitCount.xml">GLSL bitCount man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
///
|
||||
/// @todo Clarify the declaration to specify that scalars are suported.
|
||||
template <typename T, template <typename> class genIUType>
|
||||
typename genIUType<T>::signed_type bitCount(genIUType<T> const & Value);
|
||||
|
||||
/// Returns the bit number of the least significant bit set to
|
||||
/// 1 in the binary representation of value.
|
||||
/// If value is zero, -1 will be returned.
|
||||
///
|
||||
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findLSB.xml">GLSL findLSB man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
///
|
||||
/// @todo Clarify the declaration to specify that scalars are suported.
|
||||
template <typename T, template <typename> class genIUType>
|
||||
typename genIUType<T>::signed_type findLSB(genIUType<T> const & Value);
|
||||
|
||||
/// Returns the bit number of the most significant bit in the binary representation of value.
|
||||
/// For positive integers, the result will be the bit number of the most significant bit set to 1.
|
||||
/// For negative integers, the result will be the bit number of the most significant
|
||||
/// bit set to 0. For a value of zero or negative one, -1 will be returned.
|
||||
///
|
||||
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findMSB.xml">GLSL findMSB man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
///
|
||||
/// @todo Clarify the declaration to specify that scalars are suported.
|
||||
template <typename T, template <typename> class genIUType>
|
||||
typename genIUType<T>::signed_type findMSB(genIUType<T> const & Value);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
#include "func_integer.inl"
|
||||
|
||||
#endif//glm_core_func_integer
|
||||
|
||||
Vendored
-611
@@ -1,611 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_integer.inl
|
||||
/// @date 2010-03-17 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "type_vec2.hpp"
|
||||
#include "type_vec3.hpp"
|
||||
#include "type_vec4.hpp"
|
||||
#include "type_int.hpp"
|
||||
#include "_vectorize.hpp"
|
||||
#if(GLM_ARCH != GLM_ARCH_PURE)
|
||||
#if(GLM_COMPILER & GLM_COMPILER_VC)
|
||||
# include <intrin.h>
|
||||
# pragma intrinsic(_BitScanReverse)
|
||||
#endif//(GLM_COMPILER & GLM_COMPILER_VC)
|
||||
#endif//(GLM_ARCH != GLM_ARCH_PURE)
|
||||
#include <limits>
|
||||
|
||||
namespace glm
|
||||
{
|
||||
// uaddCarry
|
||||
template <>
|
||||
inline uint uaddCarry
|
||||
(
|
||||
uint const & x,
|
||||
uint const & y,
|
||||
uint & Carry
|
||||
)
|
||||
{
|
||||
uint64 Value64 = static_cast<uint64>(x) + static_cast<uint64>(y);
|
||||
uint32 Result = static_cast<uint32>(Value64 % (static_cast<uint64>(1) << static_cast<uint64>(32)));
|
||||
Carry = (Value64 % (static_cast<uint64>(1) << static_cast<uint64>(32))) > 1 ? static_cast<uint32>(1) : static_cast<uint32>(0);
|
||||
return Result;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline uvec2 uaddCarry
|
||||
(
|
||||
uvec2 const & x,
|
||||
uvec2 const & y,
|
||||
uvec2 & Carry
|
||||
)
|
||||
{
|
||||
return uvec2(
|
||||
uaddCarry(x[0], y[0], Carry[0]),
|
||||
uaddCarry(x[1], y[1], Carry[1]));
|
||||
}
|
||||
|
||||
template <>
|
||||
inline uvec3 uaddCarry
|
||||
(
|
||||
uvec3 const & x,
|
||||
uvec3 const & y,
|
||||
uvec3 & Carry
|
||||
)
|
||||
{
|
||||
return uvec3(
|
||||
uaddCarry(x[0], y[0], Carry[0]),
|
||||
uaddCarry(x[1], y[1], Carry[1]),
|
||||
uaddCarry(x[2], y[2], Carry[2]));
|
||||
}
|
||||
|
||||
template <>
|
||||
inline uvec4 uaddCarry
|
||||
(
|
||||
uvec4 const & x,
|
||||
uvec4 const & y,
|
||||
uvec4 & Carry
|
||||
)
|
||||
{
|
||||
return uvec4(
|
||||
uaddCarry(x[0], y[0], Carry[0]),
|
||||
uaddCarry(x[1], y[1], Carry[1]),
|
||||
uaddCarry(x[2], y[2], Carry[2]),
|
||||
uaddCarry(x[3], y[3], Carry[3]));
|
||||
}
|
||||
|
||||
// usubBorrow
|
||||
template <>
|
||||
inline uint usubBorrow
|
||||
(
|
||||
uint const & x,
|
||||
uint const & y,
|
||||
uint & Borrow
|
||||
)
|
||||
{
|
||||
Borrow = x >= y ? static_cast<uint32>(0) : static_cast<uint32>(1);
|
||||
if(y >= x)
|
||||
return y - x;
|
||||
return static_cast<uint32>((static_cast<int64>(1) << static_cast<int64>(32)) + (static_cast<int64>(y) - static_cast<int64>(x)));
|
||||
}
|
||||
|
||||
template <>
|
||||
inline uvec2 usubBorrow
|
||||
(
|
||||
uvec2 const & x,
|
||||
uvec2 const & y,
|
||||
uvec2 & Borrow
|
||||
)
|
||||
{
|
||||
return uvec2(
|
||||
usubBorrow(x[0], y[0], Borrow[0]),
|
||||
usubBorrow(x[1], y[1], Borrow[1]));
|
||||
}
|
||||
|
||||
template <>
|
||||
inline uvec3 usubBorrow
|
||||
(
|
||||
uvec3 const & x,
|
||||
uvec3 const & y,
|
||||
uvec3 & Borrow
|
||||
)
|
||||
{
|
||||
return uvec3(
|
||||
usubBorrow(x[0], y[0], Borrow[0]),
|
||||
usubBorrow(x[1], y[1], Borrow[1]),
|
||||
usubBorrow(x[2], y[2], Borrow[2]));
|
||||
}
|
||||
|
||||
template <>
|
||||
inline uvec4 usubBorrow
|
||||
(
|
||||
uvec4 const & x,
|
||||
uvec4 const & y,
|
||||
uvec4 & Borrow
|
||||
)
|
||||
{
|
||||
return uvec4(
|
||||
usubBorrow(x[0], y[0], Borrow[0]),
|
||||
usubBorrow(x[1], y[1], Borrow[1]),
|
||||
usubBorrow(x[2], y[2], Borrow[2]),
|
||||
usubBorrow(x[3], y[3], Borrow[3]));
|
||||
}
|
||||
|
||||
// umulExtended
|
||||
template <>
|
||||
inline void umulExtended
|
||||
(
|
||||
uint const & x,
|
||||
uint const & y,
|
||||
uint & msb,
|
||||
uint & lsb
|
||||
)
|
||||
{
|
||||
uint64 Value64 = static_cast<uint64>(x) * static_cast<uint64>(y);
|
||||
msb = Value64 >> 32;
|
||||
lsb = Value64;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void umulExtended
|
||||
(
|
||||
uvec2 const & x,
|
||||
uvec2 const & y,
|
||||
uvec2 & msb,
|
||||
uvec2 & lsb
|
||||
)
|
||||
{
|
||||
umulExtended(x[0], y[0], msb[0], lsb[0]);
|
||||
umulExtended(x[1], y[1], msb[1], lsb[1]);
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void umulExtended
|
||||
(
|
||||
uvec3 const & x,
|
||||
uvec3 const & y,
|
||||
uvec3 & msb,
|
||||
uvec3 & lsb
|
||||
)
|
||||
{
|
||||
umulExtended(x[0], y[0], msb[0], lsb[0]);
|
||||
umulExtended(x[1], y[1], msb[1], lsb[1]);
|
||||
umulExtended(x[2], y[2], msb[2], lsb[2]);
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void umulExtended
|
||||
(
|
||||
uvec4 const & x,
|
||||
uvec4 const & y,
|
||||
uvec4 & msb,
|
||||
uvec4 & lsb
|
||||
)
|
||||
{
|
||||
umulExtended(x[0], y[0], msb[0], lsb[0]);
|
||||
umulExtended(x[1], y[1], msb[1], lsb[1]);
|
||||
umulExtended(x[2], y[2], msb[2], lsb[2]);
|
||||
umulExtended(x[3], y[3], msb[3], lsb[3]);
|
||||
}
|
||||
|
||||
// imulExtended
|
||||
template <>
|
||||
inline void imulExtended
|
||||
(
|
||||
int const & x,
|
||||
int const & y,
|
||||
int & msb,
|
||||
int & lsb
|
||||
)
|
||||
{
|
||||
int64 Value64 = static_cast<int64>(x) * static_cast<int64>(y);
|
||||
msb = Value64 >> 32;
|
||||
lsb = Value64;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void imulExtended
|
||||
(
|
||||
ivec2 const & x,
|
||||
ivec2 const & y,
|
||||
ivec2 & msb,
|
||||
ivec2 & lsb
|
||||
)
|
||||
{
|
||||
imulExtended(x[0], y[0], msb[0], lsb[0]),
|
||||
imulExtended(x[1], y[1], msb[1], lsb[1]);
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void imulExtended
|
||||
(
|
||||
ivec3 const & x,
|
||||
ivec3 const & y,
|
||||
ivec3 & msb,
|
||||
ivec3 & lsb
|
||||
)
|
||||
{
|
||||
imulExtended(x[0], y[0], msb[0], lsb[0]),
|
||||
imulExtended(x[1], y[1], msb[1], lsb[1]);
|
||||
imulExtended(x[2], y[2], msb[2], lsb[2]);
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void imulExtended
|
||||
(
|
||||
ivec4 const & x,
|
||||
ivec4 const & y,
|
||||
ivec4 & msb,
|
||||
ivec4 & lsb
|
||||
)
|
||||
{
|
||||
imulExtended(x[0], y[0], msb[0], lsb[0]),
|
||||
imulExtended(x[1], y[1], msb[1], lsb[1]);
|
||||
imulExtended(x[2], y[2], msb[2], lsb[2]);
|
||||
imulExtended(x[3], y[3], msb[3], lsb[3]);
|
||||
}
|
||||
|
||||
// bitfieldExtract
|
||||
template <typename genIUType>
|
||||
inline genIUType bitfieldExtract
|
||||
(
|
||||
genIUType const & Value,
|
||||
int const & Offset,
|
||||
int const & Bits
|
||||
)
|
||||
{
|
||||
int GenSize = int(sizeof(genIUType)) << int(3);
|
||||
|
||||
assert(Offset + Bits <= GenSize);
|
||||
|
||||
genIUType ShiftLeft = Bits ? Value << (GenSize - (Bits + Offset)) : genIUType(0);
|
||||
genIUType ShiftBack = ShiftLeft >> genIUType(GenSize - Bits);
|
||||
|
||||
return ShiftBack;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec2<T, P> bitfieldExtract
|
||||
(
|
||||
detail::tvec2<T, P> const & Value,
|
||||
int const & Offset,
|
||||
int const & Bits
|
||||
)
|
||||
{
|
||||
return detail::tvec2<T, P>(
|
||||
bitfieldExtract(Value[0], Offset, Bits),
|
||||
bitfieldExtract(Value[1], Offset, Bits));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec3<T, P> bitfieldExtract
|
||||
(
|
||||
detail::tvec3<T, P> const & Value,
|
||||
int const & Offset,
|
||||
int const & Bits
|
||||
)
|
||||
{
|
||||
return detail::tvec3<T, P>(
|
||||
bitfieldExtract(Value[0], Offset, Bits),
|
||||
bitfieldExtract(Value[1], Offset, Bits),
|
||||
bitfieldExtract(Value[2], Offset, Bits));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec4<T, P> bitfieldExtract
|
||||
(
|
||||
detail::tvec4<T, P> const & Value,
|
||||
int const & Offset,
|
||||
int const & Bits
|
||||
)
|
||||
{
|
||||
return detail::tvec4<T, P>(
|
||||
bitfieldExtract(Value[0], Offset, Bits),
|
||||
bitfieldExtract(Value[1], Offset, Bits),
|
||||
bitfieldExtract(Value[2], Offset, Bits),
|
||||
bitfieldExtract(Value[3], Offset, Bits));
|
||||
}
|
||||
|
||||
// bitfieldInsert
|
||||
template <typename genIUType>
|
||||
inline genIUType bitfieldInsert
|
||||
(
|
||||
genIUType const & Base,
|
||||
genIUType const & Insert,
|
||||
int const & Offset,
|
||||
int const & Bits
|
||||
)
|
||||
{
|
||||
assert(Offset + Bits <= sizeof(genIUType));
|
||||
|
||||
if(Bits == 0)
|
||||
return Base;
|
||||
|
||||
genIUType Mask = 0;
|
||||
for(int Bit = Offset; Bit < Offset + Bits; ++Bit)
|
||||
Mask |= (1 << Bit);
|
||||
|
||||
return (Base & ~Mask) | (Insert & Mask);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec2<T, P> bitfieldInsert
|
||||
(
|
||||
detail::tvec2<T, P> const & Base,
|
||||
detail::tvec2<T, P> const & Insert,
|
||||
int const & Offset,
|
||||
int const & Bits
|
||||
)
|
||||
{
|
||||
return detail::tvec2<T, P>(
|
||||
bitfieldInsert(Base[0], Insert[0], Offset, Bits),
|
||||
bitfieldInsert(Base[1], Insert[1], Offset, Bits));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec3<T, P> bitfieldInsert
|
||||
(
|
||||
detail::tvec3<T, P> const & Base,
|
||||
detail::tvec3<T, P> const & Insert,
|
||||
int const & Offset,
|
||||
int const & Bits
|
||||
)
|
||||
{
|
||||
return detail::tvec3<T, P>(
|
||||
bitfieldInsert(Base[0], Insert[0], Offset, Bits),
|
||||
bitfieldInsert(Base[1], Insert[1], Offset, Bits),
|
||||
bitfieldInsert(Base[2], Insert[2], Offset, Bits));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec4<T, P> bitfieldInsert
|
||||
(
|
||||
detail::tvec4<T, P> const & Base,
|
||||
detail::tvec4<T, P> const & Insert,
|
||||
int const & Offset,
|
||||
int const & Bits
|
||||
)
|
||||
{
|
||||
return detail::tvec4<T, P>(
|
||||
bitfieldInsert(Base[0], Insert[0], Offset, Bits),
|
||||
bitfieldInsert(Base[1], Insert[1], Offset, Bits),
|
||||
bitfieldInsert(Base[2], Insert[2], Offset, Bits),
|
||||
bitfieldInsert(Base[3], Insert[3], Offset, Bits));
|
||||
}
|
||||
|
||||
// bitfieldReverse
|
||||
template <typename genIUType>
|
||||
inline genIUType bitfieldReverse(genIUType const & Value)
|
||||
{
|
||||
genIUType Out = 0;
|
||||
std::size_t BitSize = sizeof(genIUType) * 8;
|
||||
for(std::size_t i = 0; i < BitSize; ++i)
|
||||
if(Value & (genIUType(1) << i))
|
||||
Out |= genIUType(1) << (BitSize - 1 - i);
|
||||
return Out;
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(bitfieldReverse)
|
||||
|
||||
// bitCount
|
||||
template <typename genIUType>
|
||||
inline int bitCount(genIUType const & Value)
|
||||
{
|
||||
int Count = 0;
|
||||
for(std::size_t i = 0; i < sizeof(genIUType) * std::size_t(8); ++i)
|
||||
{
|
||||
if(Value & (1 << i))
|
||||
++Count;
|
||||
}
|
||||
return Count;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec2<int, P> bitCount
|
||||
(
|
||||
detail::tvec2<T, P> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec2<int, P>(
|
||||
bitCount(value[0]),
|
||||
bitCount(value[1]));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec3<int, P> bitCount
|
||||
(
|
||||
detail::tvec3<T, P> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec3<int, P>(
|
||||
bitCount(value[0]),
|
||||
bitCount(value[1]),
|
||||
bitCount(value[2]));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec4<int, P> bitCount
|
||||
(
|
||||
detail::tvec4<T, P> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec4<int, P>(
|
||||
bitCount(value[0]),
|
||||
bitCount(value[1]),
|
||||
bitCount(value[2]),
|
||||
bitCount(value[3]));
|
||||
}
|
||||
|
||||
// findLSB
|
||||
template <typename genIUType>
|
||||
inline int findLSB
|
||||
(
|
||||
genIUType const & Value
|
||||
)
|
||||
{
|
||||
if(Value == 0)
|
||||
return -1;
|
||||
|
||||
genIUType Bit;
|
||||
for(Bit = genIUType(0); !(Value & (1 << Bit)); ++Bit){}
|
||||
return Bit;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec2<int, P> findLSB
|
||||
(
|
||||
detail::tvec2<T, P> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec2<int, P>(
|
||||
findLSB(value[0]),
|
||||
findLSB(value[1]));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec3<int, P> findLSB
|
||||
(
|
||||
detail::tvec3<T, P> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec3<int, P>(
|
||||
findLSB(value[0]),
|
||||
findLSB(value[1]),
|
||||
findLSB(value[2]));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec4<int, P> findLSB
|
||||
(
|
||||
detail::tvec4<T, P> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec4<int, P>(
|
||||
findLSB(value[0]),
|
||||
findLSB(value[1]),
|
||||
findLSB(value[2]),
|
||||
findLSB(value[3]));
|
||||
}
|
||||
|
||||
// findMSB
|
||||
#if((GLM_ARCH != GLM_ARCH_PURE) && (GLM_COMPILER & GLM_COMPILER_VC))
|
||||
|
||||
template <typename genIUType>
|
||||
inline int findMSB
|
||||
(
|
||||
genIUType const & Value
|
||||
)
|
||||
{
|
||||
if(Value == 0)
|
||||
return -1;
|
||||
|
||||
unsigned long Result(0);
|
||||
_BitScanReverse(&Result, Value);
|
||||
return int(Result);
|
||||
}
|
||||
#else
|
||||
|
||||
/* SSE implementation idea
|
||||
|
||||
__m128i const Zero = _mm_set_epi32( 0, 0, 0, 0);
|
||||
__m128i const One = _mm_set_epi32( 1, 1, 1, 1);
|
||||
__m128i Bit = _mm_set_epi32(-1, -1, -1, -1);
|
||||
__m128i Tmp = _mm_set_epi32(Value, Value, Value, Value);
|
||||
__m128i Mmi = Zero;
|
||||
for(int i = 0; i < 32; ++i)
|
||||
{
|
||||
__m128i Shilt = _mm_and_si128(_mm_cmpgt_epi32(Tmp, One), One);
|
||||
Tmp = _mm_srai_epi32(Tmp, One);
|
||||
Bit = _mm_add_epi32(Bit, _mm_and_si128(Shilt, i));
|
||||
Mmi = _mm_and_si128(Mmi, One);
|
||||
}
|
||||
return Bit;
|
||||
|
||||
*/
|
||||
|
||||
template <typename genIUType>
|
||||
inline int findMSB
|
||||
(
|
||||
genIUType const & Value
|
||||
)
|
||||
{
|
||||
if(Value == genIUType(0) || Value == genIUType(-1))
|
||||
return -1;
|
||||
else if(Value > 0)
|
||||
{
|
||||
genIUType Bit = genIUType(-1);
|
||||
for(genIUType tmp = Value; tmp > 0; tmp >>= 1, ++Bit){}
|
||||
return Bit;
|
||||
}
|
||||
else //if(Value < 0)
|
||||
{
|
||||
int const BitCount(sizeof(genIUType) * 8);
|
||||
int MostSignificantBit(-1);
|
||||
for(int BitIndex(0); BitIndex < BitCount; ++BitIndex)
|
||||
MostSignificantBit = (Value & (1 << BitIndex)) ? MostSignificantBit : BitIndex;
|
||||
assert(MostSignificantBit >= 0);
|
||||
return MostSignificantBit;
|
||||
}
|
||||
}
|
||||
#endif//(GLM_COMPILER)
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec2<int, P> findMSB
|
||||
(
|
||||
detail::tvec2<T, P> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec2<int, P>(
|
||||
findMSB(value[0]),
|
||||
findMSB(value[1]));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec3<int, P> findMSB
|
||||
(
|
||||
detail::tvec3<T, P> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec3<int, P>(
|
||||
findMSB(value[0]),
|
||||
findMSB(value[1]),
|
||||
findMSB(value[2]));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec4<int, P> findMSB
|
||||
(
|
||||
detail::tvec4<T, P> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec4<int, P>(
|
||||
findMSB(value[0]),
|
||||
findMSB(value[1]),
|
||||
findMSB(value[2]),
|
||||
findMSB(value[3]));
|
||||
}
|
||||
}//namespace glm
|
||||
Vendored
-179
@@ -1,179 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_matrix.hpp
|
||||
/// @date 2008-08-03 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
|
||||
///
|
||||
/// @defgroup core_func_matrix Matrix functions
|
||||
/// @ingroup core
|
||||
///
|
||||
/// For each of the following built-in matrix functions, there is both a
|
||||
/// single-precision floating point version, where all arguments and return values
|
||||
/// are single precision, and a double-precision floating version, where all
|
||||
/// arguments and return values are double precision. Only the single-precision
|
||||
/// floating point version is shown.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef GLM_CORE_func_matrix
|
||||
#define GLM_CORE_func_matrix
|
||||
|
||||
// Dependencies
|
||||
#include "../detail/precision.hpp"
|
||||
#include "../detail/setup.hpp"
|
||||
#include "../detail/type_mat.hpp"
|
||||
#include "../vec2.hpp"
|
||||
#include "../vec3.hpp"
|
||||
#include "../vec4.hpp"
|
||||
#include "../mat2x2.hpp"
|
||||
#include "../mat2x3.hpp"
|
||||
#include "../mat2x4.hpp"
|
||||
#include "../mat3x2.hpp"
|
||||
#include "../mat3x3.hpp"
|
||||
#include "../mat3x4.hpp"
|
||||
#include "../mat4x2.hpp"
|
||||
#include "../mat4x3.hpp"
|
||||
#include "../mat4x4.hpp"
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <typename T, precision P>
|
||||
struct outerProduct_trait<T, P, tvec2, tvec2>
|
||||
{
|
||||
typedef tmat2x2<T, P> type;
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct outerProduct_trait<T, P, tvec2, tvec3>
|
||||
{
|
||||
typedef tmat2x3<T, P> type;
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct outerProduct_trait<T, P, tvec2, tvec4>
|
||||
{
|
||||
typedef tmat2x4<T, P> type;
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct outerProduct_trait<T, P, tvec3, tvec2>
|
||||
{
|
||||
typedef tmat3x2<T, P> type;
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct outerProduct_trait<T, P, tvec3, tvec3>
|
||||
{
|
||||
typedef tmat3x3<T, P> type;
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct outerProduct_trait<T, P, tvec3, tvec4>
|
||||
{
|
||||
typedef tmat3x4<T, P> type;
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct outerProduct_trait<T, P, tvec4, tvec2>
|
||||
{
|
||||
typedef tmat4x2<T, P> type;
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct outerProduct_trait<T, P, tvec4, tvec3>
|
||||
{
|
||||
typedef tmat4x3<T, P> type;
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct outerProduct_trait<T, P, tvec4, tvec4>
|
||||
{
|
||||
typedef tmat4x4<T, P> type;
|
||||
};
|
||||
|
||||
}//namespace detail
|
||||
|
||||
/// @addtogroup core_func_matrix
|
||||
/// @{
|
||||
|
||||
/// Multiply matrix x by matrix y component-wise, i.e.,
|
||||
/// result[i][j] is the scalar product of x[i][j] and y[i][j].
|
||||
///
|
||||
/// @tparam matType Floating-point matrix types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/matrixCompMult.xml">GLSL matrixCompMult man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
|
||||
template <typename T, precision P, template <typename, precision> class matType>
|
||||
matType<T, P> matrixCompMult(matType<T, P> const & x, matType<T, P> const & y);
|
||||
|
||||
/// Treats the first parameter c as a column vector
|
||||
/// and the second parameter r as a row vector
|
||||
/// and does a linear algebraic matrix multiply c * r.
|
||||
///
|
||||
/// @tparam matType Floating-point matrix types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/outerProduct.xml">GLSL outerProduct man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
|
||||
///
|
||||
/// @todo Clarify the declaration to specify that matType doesn't have to be provided when used.
|
||||
template <typename T, precision P, template <typename, precision> class vecTypeA, template <typename, precision> class vecTypeB>
|
||||
typename detail::outerProduct_trait<T, P, vecTypeA, vecTypeB>::type outerProduct(vecTypeA<T, P> const & c, vecTypeB<T, P> const & r);
|
||||
|
||||
/// Returns the transposed matrix of x
|
||||
///
|
||||
/// @tparam matType Floating-point matrix types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/transpose.xml">GLSL transpose man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
|
||||
# if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC11))
|
||||
template <typename T, precision P, template <typename, precision> class matType>
|
||||
typename matType<T, P>::transpose_type transpose(matType<T, P> const & x);
|
||||
# endif
|
||||
|
||||
/// Return the determinant of a squared matrix.
|
||||
///
|
||||
/// @tparam valType Floating-point scalar types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
|
||||
template <typename T, precision P, template <typename, precision> class matType>
|
||||
T determinant(matType<T, P> const & m);
|
||||
|
||||
/// Return the inverse of a squared matrix.
|
||||
///
|
||||
/// @tparam valType Floating-point scalar types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
|
||||
template <typename T, precision P, template <typename, precision> class matType>
|
||||
matType<T, P> inverse(matType<T, P> const & m);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
#include "func_matrix.inl"
|
||||
|
||||
#endif//GLM_CORE_func_matrix
|
||||
Vendored
-454
@@ -1,454 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_matrix.inl
|
||||
/// @date 2008-03-08 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "../geometric.hpp"
|
||||
#include <limits>
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template
|
||||
<
|
||||
template <class, precision> class vecTypeA,
|
||||
template <class, precision> class vecTypeB,
|
||||
typename T, precision P
|
||||
>
|
||||
struct compute_outerProduct{};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_outerProduct<detail::tvec2, detail::tvec2, T, P>
|
||||
{
|
||||
inline static typename detail::outerProduct_trait<T, P, detail::tvec2, detail::tvec2>::type call(detail::tvec2<T, P> const & c, detail::tvec2<T, P> const & r)
|
||||
{
|
||||
detail::tmat2x2<T, P> m(detail::tmat2x2<T, P>::_null);
|
||||
m[0][0] = c[0] * r[0];
|
||||
m[0][1] = c[1] * r[0];
|
||||
m[1][0] = c[0] * r[1];
|
||||
m[1][1] = c[1] * r[1];
|
||||
return m;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_outerProduct<detail::tvec3, detail::tvec3, T, P>
|
||||
{
|
||||
inline static typename detail::outerProduct_trait<T, P, detail::tvec3, detail::tvec3>::type call(detail::tvec3<T, P> const & c, detail::tvec3<T, P> const & r)
|
||||
{
|
||||
detail::tmat3x3<T, P> m(detail::tmat3x3<T, P>::_null);
|
||||
for(length_t i(0); i < m.length(); ++i)
|
||||
m[i] = c * r[i];
|
||||
return m;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_outerProduct<detail::tvec4, detail::tvec4, T, P>
|
||||
{
|
||||
inline static typename detail::outerProduct_trait<T, P, detail::tvec4, detail::tvec4>::type call(detail::tvec4<T, P> const & c, detail::tvec4<T, P> const & r)
|
||||
{
|
||||
detail::tmat4x4<T, P> m(detail::tmat4x4<T, P>::_null);
|
||||
for(length_t i(0); i < m.length(); ++i)
|
||||
m[i] = c * r[i];
|
||||
return m;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_outerProduct<detail::tvec3, detail::tvec2, T, P>
|
||||
{
|
||||
inline static typename detail::outerProduct_trait<T, P, detail::tvec3, detail::tvec2>::type call(detail::tvec3<T, P> const & c, detail::tvec2<T, P> const & r)
|
||||
{
|
||||
detail::tmat2x3<T, P> m(detail::tmat2x3<T, P>::_null);
|
||||
m[0][0] = c.x * r.x;
|
||||
m[0][1] = c.y * r.x;
|
||||
m[0][2] = c.z * r.x;
|
||||
m[1][0] = c.x * r.y;
|
||||
m[1][1] = c.y * r.y;
|
||||
m[1][2] = c.z * r.y;
|
||||
return m;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_outerProduct<detail::tvec2, detail::tvec3, T, P>
|
||||
{
|
||||
inline static typename detail::outerProduct_trait<T, P, detail::tvec2, detail::tvec3>::type call(detail::tvec2<T, P> const & c, detail::tvec3<T, P> const & r)
|
||||
{
|
||||
detail::tmat3x2<T, P> m(detail::tmat3x2<T, P>::_null);
|
||||
m[0][0] = c.x * r.x;
|
||||
m[0][1] = c.y * r.x;
|
||||
m[1][0] = c.x * r.y;
|
||||
m[1][1] = c.y * r.y;
|
||||
m[2][0] = c.x * r.z;
|
||||
m[2][1] = c.y * r.z;
|
||||
return m;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_outerProduct<detail::tvec4, detail::tvec2, T, P>
|
||||
{
|
||||
inline static typename detail::outerProduct_trait<T, P, detail::tvec4, detail::tvec2>::type call(detail::tvec4<T, P> const & c, detail::tvec2<T, P> const & r)
|
||||
{
|
||||
detail::tmat2x4<T, P> m(detail::tmat2x4<T, P>::_null);
|
||||
m[0][0] = c.x * r.x;
|
||||
m[0][1] = c.y * r.x;
|
||||
m[0][2] = c.z * r.x;
|
||||
m[0][3] = c.w * r.x;
|
||||
m[1][0] = c.x * r.y;
|
||||
m[1][1] = c.y * r.y;
|
||||
m[1][2] = c.z * r.y;
|
||||
m[1][3] = c.w * r.y;
|
||||
return m;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_outerProduct<detail::tvec2, detail::tvec4, T, P>
|
||||
{
|
||||
inline static typename detail::outerProduct_trait<T, P, detail::tvec2, detail::tvec4>::type call(detail::tvec2<T, P> const & c, detail::tvec4<T, P> const & r)
|
||||
{
|
||||
detail::tmat4x2<T, P> m(detail::tmat4x2<T, P>::_null);
|
||||
m[0][0] = c.x * r.x;
|
||||
m[0][1] = c.y * r.x;
|
||||
m[1][0] = c.x * r.y;
|
||||
m[1][1] = c.y * r.y;
|
||||
m[2][0] = c.x * r.z;
|
||||
m[2][1] = c.y * r.z;
|
||||
m[3][0] = c.x * r.w;
|
||||
m[3][1] = c.y * r.w;
|
||||
return m;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_outerProduct<detail::tvec4, detail::tvec3, T, P>
|
||||
{
|
||||
inline static typename detail::outerProduct_trait<T, P, detail::tvec4, detail::tvec3>::type call(detail::tvec4<T, P> const & c, detail::tvec3<T, P> const & r)
|
||||
{
|
||||
detail::tmat3x4<T, P> m(detail::tmat3x4<T, P>::_null);
|
||||
m[0][0] = c.x * r.x;
|
||||
m[0][1] = c.y * r.x;
|
||||
m[0][2] = c.z * r.x;
|
||||
m[0][3] = c.w * r.x;
|
||||
m[1][0] = c.x * r.y;
|
||||
m[1][1] = c.y * r.y;
|
||||
m[1][2] = c.z * r.y;
|
||||
m[1][3] = c.w * r.y;
|
||||
m[2][0] = c.x * r.z;
|
||||
m[2][1] = c.y * r.z;
|
||||
m[2][2] = c.z * r.z;
|
||||
m[2][3] = c.w * r.z;
|
||||
return m;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_outerProduct<detail::tvec3, detail::tvec4, T, P>
|
||||
{
|
||||
inline static typename detail::outerProduct_trait<T, P, detail::tvec3, detail::tvec4>::type call(detail::tvec3<T, P> const & c, detail::tvec4<T, P> const & r)
|
||||
{
|
||||
detail::tmat4x3<T, P> m(detail::tmat4x3<T, P>::_null);
|
||||
m[0][0] = c.x * r.x;
|
||||
m[0][1] = c.y * r.x;
|
||||
m[0][2] = c.z * r.x;
|
||||
m[1][0] = c.x * r.y;
|
||||
m[1][1] = c.y * r.y;
|
||||
m[1][2] = c.z * r.y;
|
||||
m[2][0] = c.x * r.z;
|
||||
m[2][1] = c.y * r.z;
|
||||
m[2][2] = c.z * r.z;
|
||||
m[3][0] = c.x * r.w;
|
||||
m[3][1] = c.y * r.w;
|
||||
m[3][2] = c.z * r.w;
|
||||
return m;
|
||||
}
|
||||
};
|
||||
|
||||
template <template <class, precision> class matType, typename T, precision P>
|
||||
struct compute_transpose{};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<detail::tmat2x2, T, P>
|
||||
{
|
||||
inline static detail::tmat2x2<T, P> call(detail::tmat2x2<T, P> const & m)
|
||||
{
|
||||
detail::tmat2x2<T, P> result(detail::tmat2x2<T, P>::_null);
|
||||
result[0][0] = m[0][0];
|
||||
result[0][1] = m[1][0];
|
||||
result[1][0] = m[0][1];
|
||||
result[1][1] = m[1][1];
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<detail::tmat2x3, T, P>
|
||||
{
|
||||
inline static detail::tmat3x2<T, P> call(detail::tmat2x3<T, P> const & m)
|
||||
{
|
||||
detail::tmat3x2<T, P> result(detail::tmat3x2<T, P>::_null);
|
||||
result[0][0] = m[0][0];
|
||||
result[0][1] = m[1][0];
|
||||
result[1][0] = m[0][1];
|
||||
result[1][1] = m[1][1];
|
||||
result[2][0] = m[0][2];
|
||||
result[2][1] = m[1][2];
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<detail::tmat2x4, T, P>
|
||||
{
|
||||
inline static detail::tmat4x2<T, P> call(detail::tmat2x4<T, P> const & m)
|
||||
{
|
||||
detail::tmat4x2<T, P> result(detail::tmat4x2<T, P>::_null);
|
||||
result[0][0] = m[0][0];
|
||||
result[0][1] = m[1][0];
|
||||
result[1][0] = m[0][1];
|
||||
result[1][1] = m[1][1];
|
||||
result[2][0] = m[0][2];
|
||||
result[2][1] = m[1][2];
|
||||
result[3][0] = m[0][3];
|
||||
result[3][1] = m[1][3];
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<detail::tmat3x2, T, P>
|
||||
{
|
||||
inline static detail::tmat2x3<T, P> call(detail::tmat3x2<T, P> const & m)
|
||||
{
|
||||
detail::tmat2x3<T, P> result(detail::tmat2x3<T, P>::_null);
|
||||
result[0][0] = m[0][0];
|
||||
result[0][1] = m[1][0];
|
||||
result[0][2] = m[2][0];
|
||||
result[1][0] = m[0][1];
|
||||
result[1][1] = m[1][1];
|
||||
result[1][2] = m[2][1];
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<detail::tmat3x3, T, P>
|
||||
{
|
||||
inline static detail::tmat3x3<T, P> call(detail::tmat3x3<T, P> const & m)
|
||||
{
|
||||
detail::tmat3x3<T, P> result(detail::tmat3x3<T, P>::_null);
|
||||
result[0][0] = m[0][0];
|
||||
result[0][1] = m[1][0];
|
||||
result[0][2] = m[2][0];
|
||||
|
||||
result[1][0] = m[0][1];
|
||||
result[1][1] = m[1][1];
|
||||
result[1][2] = m[2][1];
|
||||
|
||||
result[2][0] = m[0][2];
|
||||
result[2][1] = m[1][2];
|
||||
result[2][2] = m[2][2];
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<detail::tmat3x4, T, P>
|
||||
{
|
||||
inline static detail::tmat4x3<T, P> call(detail::tmat3x4<T, P> const & m)
|
||||
{
|
||||
detail::tmat4x3<T, P> result(detail::tmat4x3<T, P>::_null);
|
||||
result[0][0] = m[0][0];
|
||||
result[0][1] = m[1][0];
|
||||
result[0][2] = m[2][0];
|
||||
result[1][0] = m[0][1];
|
||||
result[1][1] = m[1][1];
|
||||
result[1][2] = m[2][1];
|
||||
result[2][0] = m[0][2];
|
||||
result[2][1] = m[1][2];
|
||||
result[2][2] = m[2][2];
|
||||
result[3][0] = m[0][3];
|
||||
result[3][1] = m[1][3];
|
||||
result[3][2] = m[2][3];
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<detail::tmat4x2, T, P>
|
||||
{
|
||||
inline static detail::tmat2x4<T, P> call(detail::tmat4x2<T, P> const & m)
|
||||
{
|
||||
detail::tmat2x4<T, P> result(detail::tmat2x4<T, P>::_null);
|
||||
result[0][0] = m[0][0];
|
||||
result[0][1] = m[1][0];
|
||||
result[0][2] = m[2][0];
|
||||
result[0][3] = m[3][0];
|
||||
result[1][0] = m[0][1];
|
||||
result[1][1] = m[1][1];
|
||||
result[1][2] = m[2][1];
|
||||
result[1][3] = m[3][1];
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<detail::tmat4x3, T, P>
|
||||
{
|
||||
inline static detail::tmat3x4<T, P> call(detail::tmat4x3<T, P> const & m)
|
||||
{
|
||||
detail::tmat3x4<T, P> result(detail::tmat3x4<T, P>::_null);
|
||||
result[0][0] = m[0][0];
|
||||
result[0][1] = m[1][0];
|
||||
result[0][2] = m[2][0];
|
||||
result[0][3] = m[3][0];
|
||||
result[1][0] = m[0][1];
|
||||
result[1][1] = m[1][1];
|
||||
result[1][2] = m[2][1];
|
||||
result[1][3] = m[3][1];
|
||||
result[2][0] = m[0][2];
|
||||
result[2][1] = m[1][2];
|
||||
result[2][2] = m[2][2];
|
||||
result[2][3] = m[3][2];
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<detail::tmat4x4, T, P>
|
||||
{
|
||||
inline static detail::tmat4x4<T, P> call(detail::tmat4x4<T, P> const & m)
|
||||
{
|
||||
detail::tmat4x4<T, P> result(detail::tmat4x4<T, P>::_null);
|
||||
result[0][0] = m[0][0];
|
||||
result[0][1] = m[1][0];
|
||||
result[0][2] = m[2][0];
|
||||
result[0][3] = m[3][0];
|
||||
|
||||
result[1][0] = m[0][1];
|
||||
result[1][1] = m[1][1];
|
||||
result[1][2] = m[2][1];
|
||||
result[1][3] = m[3][1];
|
||||
|
||||
result[2][0] = m[0][2];
|
||||
result[2][1] = m[1][2];
|
||||
result[2][2] = m[2][2];
|
||||
result[2][3] = m[3][2];
|
||||
|
||||
result[3][0] = m[0][3];
|
||||
result[3][1] = m[1][3];
|
||||
result[3][2] = m[2][3];
|
||||
result[3][3] = m[3][3];
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <template <class, precision> class matType, typename T, precision P>
|
||||
struct compute_determinant{};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_determinant<detail::tmat2x2, T, P>
|
||||
{
|
||||
inline static T call(detail::tmat2x2<T, P> const & m)
|
||||
{
|
||||
return m[0][0] * m[1][1] - m[1][0] * m[0][1];
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_determinant<detail::tmat3x3, T, P>
|
||||
{
|
||||
inline static T call(detail::tmat3x3<T, P> const & m)
|
||||
{
|
||||
return
|
||||
+ m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2])
|
||||
- m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2])
|
||||
+ m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2]);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_determinant<detail::tmat4x4, T, P>
|
||||
{
|
||||
inline static T call(detail::tmat4x4<T, P> const & m)
|
||||
{
|
||||
T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];
|
||||
T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3];
|
||||
T SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2];
|
||||
T SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3];
|
||||
T SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2];
|
||||
T SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1];
|
||||
|
||||
detail::tvec4<T, P> DetCof(
|
||||
+ (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02),
|
||||
- (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04),
|
||||
+ (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05),
|
||||
- (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05));
|
||||
|
||||
return
|
||||
m[0][0] * DetCof[0] + m[0][1] * DetCof[1] +
|
||||
m[0][2] * DetCof[2] + m[0][3] * DetCof[3];
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class matType>
|
||||
inline matType<T, P> matrixCompMult(matType<T, P> const & x, matType<T, P> const & y)
|
||||
{
|
||||
matType<T, P> result(matType<T, P>::_null);
|
||||
for(length_t i = 0; i < result.length(); ++i)
|
||||
result[i] = x[i] * y[i];
|
||||
return result;
|
||||
}
|
||||
|
||||
template<typename T, precision P, template <typename, precision> class vecTypeA, template <typename, precision> class vecTypeB>
|
||||
inline typename detail::outerProduct_trait<T, P, vecTypeA, vecTypeB>::type outerProduct(vecTypeA<T, P> const & c, vecTypeB<T, P> const & r)
|
||||
{
|
||||
return detail::compute_outerProduct<vecTypeA, vecTypeB, T, P>::call(c, r);
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class matType>
|
||||
inline typename matType<T, P>::transpose_type transpose(matType<T, P> const & m)
|
||||
{
|
||||
return detail::compute_transpose<matType, T, P>::call(m);
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class matType>
|
||||
inline T determinant(matType<T, P> const & m)
|
||||
{
|
||||
return detail::compute_determinant<matType, T, P>::call(m);
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class matType>
|
||||
inline matType<T, P> inverse(matType<T, P> const & m)
|
||||
{
|
||||
return detail::compute_inverse<matType, T, P>::call(m);
|
||||
}
|
||||
|
||||
}//namespace glm
|
||||
Vendored
-92
@@ -1,92 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_noise.hpp
|
||||
/// @date 2008-08-01 / 2011-06-18
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
|
||||
///
|
||||
/// @defgroup core_func_noise Noise functions
|
||||
/// @ingroup core
|
||||
///
|
||||
/// Noise functions are stochastic functions that can be used to increase visual
|
||||
/// complexity. Values returned by the following noise functions give the
|
||||
/// appearance of randomness, but are not truly random.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef glm_core_func_noise
|
||||
#define glm_core_func_noise
|
||||
|
||||
#include "type_vec1.hpp"
|
||||
#include "type_vec2.hpp"
|
||||
#include "type_vec3.hpp"
|
||||
#include "setup.hpp"
|
||||
|
||||
namespace glm
|
||||
{
|
||||
/// @addtogroup core_func_noise
|
||||
/// @{
|
||||
|
||||
/// Returns a 1D noise value based on the input value x.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise1.xml">GLSL noise1 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
|
||||
template <typename genType>
|
||||
typename genType::value_type noise1(genType const & x);
|
||||
|
||||
/// Returns a 2D noise value based on the input value x.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise2.xml">GLSL noise2 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
|
||||
template <typename genType>
|
||||
detail::tvec2<typename genType::value_type, defaultp> noise2(genType const & x);
|
||||
|
||||
/// Returns a 3D noise value based on the input value x.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise3.xml">GLSL noise3 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
|
||||
template <typename genType>
|
||||
detail::tvec3<typename genType::value_type, defaultp> noise3(genType const & x);
|
||||
|
||||
/// Returns a 4D noise value based on the input value x.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise4.xml">GLSL noise4 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
|
||||
template <typename genType>
|
||||
detail::tvec4<typename genType::value_type, defaultp> noise4(genType const & x);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
#include "func_noise.inl"
|
||||
|
||||
#endif//glm_core_func_noise
|
||||
Vendored
-384
@@ -1,384 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_noise.inl
|
||||
/// @date 2008-08-01 / 2011-09-27
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "../detail/_noise.hpp"
|
||||
#include "./func_common.hpp"
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec4<T, P> grad4(T const & j, detail::tvec4<T, P> const & ip)
|
||||
{
|
||||
detail::tvec3<T, P> pXYZ = floor(fract(detail::tvec3<T, P>(j) * detail::tvec3<T, P>(ip)) * T(7)) * ip[2] - T(1);
|
||||
T pW = static_cast<T>(1.5) - dot(abs(pXYZ), detail::tvec3<T, P>(1));
|
||||
detail::tvec4<T, P> s = detail::tvec4<T, P>(lessThan(detail::tvec4<T, P>(pXYZ, pW), detail::tvec4<T, P>(0.0)));
|
||||
pXYZ = pXYZ + (detail::tvec3<T, P>(s) * T(2) - T(1)) * s.w;
|
||||
return detail::tvec4<T, P>(pXYZ, pW);
|
||||
}
|
||||
}//namespace detail
|
||||
|
||||
template <typename T>
|
||||
inline T noise1(T const & x)
|
||||
{
|
||||
return noise1(detail::tvec2<T, defaultp>(x, T(0)));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline detail::tvec2<T, defaultp> noise2(T const & x)
|
||||
{
|
||||
return detail::tvec2<T, defaultp>(
|
||||
noise1(x + T(0.0)),
|
||||
noise1(x + T(1.0)));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline detail::tvec3<T, defaultp> noise3(T const & x)
|
||||
{
|
||||
return detail::tvec3<T, defaultp>(
|
||||
noise1(x - T(1.0)),
|
||||
noise1(x + T(0.0)),
|
||||
noise1(x + T(1.0)));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline detail::tvec4<T, defaultp> noise4(T const & x)
|
||||
{
|
||||
return detail::tvec4<T, defaultp>(
|
||||
noise1(x - T(1.0)),
|
||||
noise1(x + T(0.0)),
|
||||
noise1(x + T(1.0)),
|
||||
noise1(x + T(2.0)));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline T noise1(detail::tvec2<T, P> const & v)
|
||||
{
|
||||
detail::tvec4<T, P> const C = detail::tvec4<T, P>(
|
||||
T( 0.211324865405187), // (3.0 - sqrt(3.0)) / 6.0
|
||||
T( 0.366025403784439), // 0.5 * (sqrt(3.0) - 1.0)
|
||||
T(-0.577350269189626), // -1.0 + 2.0 * C.x
|
||||
T( 0.024390243902439)); // 1.0 / 41.0
|
||||
|
||||
// First corner
|
||||
detail::tvec2<T, P> i = floor(v + dot(v, detail::tvec2<T, P>(C[1])));
|
||||
detail::tvec2<T, P> x0 = v - i + dot(i, detail::tvec2<T, P>(C[0]));
|
||||
|
||||
// Other corners
|
||||
//i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0
|
||||
//i1.y = 1.0 - i1.x;
|
||||
detail::tvec2<T, P> i1 = (x0.x > x0.y) ? detail::tvec2<T, P>(1, 0) : detail::tvec2<T, P>(0, 1);
|
||||
|
||||
// x0 = x0 - 0.0 + 0.0 * C.xx ;
|
||||
// x1 = x0 - i1 + 1.0 * C.xx ;
|
||||
// x2 = x0 - 1.0 + 2.0 * C.xx ;
|
||||
detail::tvec4<T, P> x12 = detail::tvec4<T, P>(x0.x, x0.y, x0.x, x0.y) + detail::tvec4<T, P>(C.x, C.x, C.z, C.z);
|
||||
x12 = detail::tvec4<T, P>(detail::tvec2<T, P>(x12) - i1, x12.z, x12.w);
|
||||
|
||||
// Permutations
|
||||
i = mod(i, T(289)); // Avoid truncation effects in permutation
|
||||
detail::tvec3<T, P> p = detail::permute(
|
||||
detail::permute(i.y + detail::tvec3<T, P>(T(0), i1.y, T(1))) + i.x + detail::tvec3<T, P>(T(0), i1.x, T(1)));
|
||||
|
||||
detail::tvec3<T, P> m = max(T(0.5) - detail::tvec3<T, P>(
|
||||
dot(x0, x0),
|
||||
dot(detail::tvec2<T, P>(x12.x, x12.y), detail::tvec2<T, P>(x12.x, x12.y)),
|
||||
dot(detail::tvec2<T, P>(x12.z, x12.w), detail::tvec2<T, P>(x12.z, x12.w))), T(0));
|
||||
|
||||
m = m * m;
|
||||
m = m * m;
|
||||
|
||||
// Gradients: 41 points uniformly over a line, mapped onto a diamond.
|
||||
// The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)
|
||||
|
||||
detail::tvec3<T, P> x = static_cast<T>(2) * fract(p * C.w) - T(1);
|
||||
detail::tvec3<T, P> h = abs(x) - T(0.5);
|
||||
detail::tvec3<T, P> ox = floor(x + T(0.5));
|
||||
detail::tvec3<T, P> a0 = x - ox;
|
||||
|
||||
// Normalise gradients implicitly by scaling m
|
||||
// Inlined for speed: m *= taylorInvSqrt( a0*a0 + h*h );
|
||||
m *= static_cast<T>(1.79284291400159) - T(0.85373472095314) * (a0 * a0 + h * h);
|
||||
|
||||
// Compute final noise value at P
|
||||
detail::tvec3<T, P> g;
|
||||
g.x = a0.x * x0.x + h.x * x0.y;
|
||||
//g.yz = a0.yz * x12.xz + h.yz * x12.yw;
|
||||
g.y = a0.y * x12.x + h.y * x12.y;
|
||||
g.z = a0.z * x12.z + h.z * x12.w;
|
||||
return T(130) * dot(m, g);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline T noise1(detail::tvec3<T, P> const & v)
|
||||
{
|
||||
detail::tvec2<T, P> const C(1.0 / 6.0, 1.0 / 3.0);
|
||||
detail::tvec4<T, P> const D(0.0, 0.5, 1.0, 2.0);
|
||||
|
||||
// First corner
|
||||
detail::tvec3<T, P> i(floor(v + dot(v, detail::tvec3<T, P>(C.y))));
|
||||
detail::tvec3<T, P> x0(v - i + dot(i, detail::tvec3<T, P>(C.x)));
|
||||
|
||||
// Other corners
|
||||
detail::tvec3<T, P> g(step(detail::tvec3<T, P>(x0.y, x0.z, x0.x), x0));
|
||||
detail::tvec3<T, P> l(T(1) - g);
|
||||
detail::tvec3<T, P> i1(min(g, detail::tvec3<T, P>(l.z, l.x, l.y)));
|
||||
detail::tvec3<T, P> i2(max(g, detail::tvec3<T, P>(l.z, l.x, l.y)));
|
||||
|
||||
// x0 = x0 - 0.0 + 0.0 * C.xxx;
|
||||
// x1 = x0 - i1 + 1.0 * C.xxx;
|
||||
// x2 = x0 - i2 + 2.0 * C.xxx;
|
||||
// x3 = x0 - 1.0 + 3.0 * C.xxx;
|
||||
detail::tvec3<T, P> x1(x0 - i1 + C.x);
|
||||
detail::tvec3<T, P> x2(x0 - i2 + C.y); // 2.0*C.x = 1/3 = C.y
|
||||
detail::tvec3<T, P> x3(x0 - D.y); // -1.0+3.0*C.x = -0.5 = -D.y
|
||||
|
||||
// Permutations
|
||||
i = mod289(i);
|
||||
detail::tvec4<T, P> p(detail::permute(detail::permute(detail::permute(
|
||||
i.z + detail::tvec4<T, P>(T(0), i1.z, i2.z, T(1))) +
|
||||
i.y + detail::tvec4<T, P>(T(0), i1.y, i2.y, T(1))) +
|
||||
i.x + detail::tvec4<T, P>(T(0), i1.x, i2.x, T(1))));
|
||||
|
||||
// Gradients: 7x7 points over a square, mapped onto an octahedron.
|
||||
// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)
|
||||
T n_ = static_cast<T>(0.142857142857); // 1.0/7.0
|
||||
detail::tvec3<T, P> ns(n_ * detail::tvec3<T, P>(D.w, D.y, D.z) - detail::tvec3<T, P>(D.x, D.z, D.x));
|
||||
|
||||
detail::tvec4<T, P> j(p - T(49) * floor(p * ns.z * ns.z)); // mod(p,7*7)
|
||||
|
||||
detail::tvec4<T, P> x_(floor(j * ns.z));
|
||||
detail::tvec4<T, P> y_(floor(j - T(7) * x_)); // mod(j,N)
|
||||
|
||||
detail::tvec4<T, P> x(x_ * ns.x + ns.y);
|
||||
detail::tvec4<T, P> y(y_ * ns.x + ns.y);
|
||||
detail::tvec4<T, P> h(T(1) - abs(x) - abs(y));
|
||||
|
||||
detail::tvec4<T, P> b0(x.x, x.y, y.x, y.y);
|
||||
detail::tvec4<T, P> b1(x.z, x.w, y.z, y.w);
|
||||
|
||||
// vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;
|
||||
// vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;
|
||||
detail::tvec4<T, P> s0(floor(b0) * T(2) + T(1));
|
||||
detail::tvec4<T, P> s1(floor(b1) * T(2) + T(1));
|
||||
detail::tvec4<T, P> sh(-step(h, detail::tvec4<T, P>(0.0)));
|
||||
|
||||
detail::tvec4<T, P> a0 = detail::tvec4<T, P>(b0.x, b0.z, b0.y, b0.w) + detail::tvec4<T, P>(s0.x, s0.z, s0.y, s0.w) * detail::tvec4<T, P>(sh.x, sh.x, sh.y, sh.y);
|
||||
detail::tvec4<T, P> a1 = detail::tvec4<T, P>(b1.x, b1.z, b1.y, b1.w) + detail::tvec4<T, P>(s1.x, s1.z, s1.y, s1.w) * detail::tvec4<T, P>(sh.z, sh.z, sh.w, sh.w);
|
||||
|
||||
detail::tvec3<T, P> p0(a0.x, a0.y, h.x);
|
||||
detail::tvec3<T, P> p1(a0.z, a0.w, h.y);
|
||||
detail::tvec3<T, P> p2(a1.x, a1.y, h.z);
|
||||
detail::tvec3<T, P> p3(a1.z, a1.w, h.w);
|
||||
|
||||
// Normalise gradients
|
||||
detail::tvec4<T, P> norm = taylorInvSqrt(detail::tvec4<T, P>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));
|
||||
p0 *= norm.x;
|
||||
p1 *= norm.y;
|
||||
p2 *= norm.z;
|
||||
p3 *= norm.w;
|
||||
|
||||
// Mix final noise value
|
||||
detail::tvec4<T, P> m = max(T(0.6) - detail::tvec4<T, P>(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), T(0));
|
||||
m = m * m;
|
||||
return T(42) * dot(m * m, detail::tvec4<T, P>(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline T noise1(detail::tvec4<T, P> const & v)
|
||||
{
|
||||
detail::tvec4<T, P> const C(
|
||||
0.138196601125011, // (5 - sqrt(5))/20 G4
|
||||
0.276393202250021, // 2 * G4
|
||||
0.414589803375032, // 3 * G4
|
||||
-0.447213595499958); // -1 + 4 * G4
|
||||
|
||||
// (sqrt(5) - 1)/4 = F4, used once below
|
||||
T const F4 = static_cast<T>(0.309016994374947451);
|
||||
|
||||
// First corner
|
||||
detail::tvec4<T, P> i = floor(v + dot(v, detail::tvec4<T, P>(F4)));
|
||||
detail::tvec4<T, P> x0 = v - i + dot(i, detail::tvec4<T, P>(C.x));
|
||||
|
||||
// Other corners
|
||||
|
||||
// Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)
|
||||
detail::tvec4<T, P> i0;
|
||||
detail::tvec3<T, P> isX = step(detail::tvec3<T, P>(x0.y, x0.z, x0.w), detail::tvec3<T, P>(x0.x));
|
||||
detail::tvec3<T, P> isYZ = step(detail::tvec3<T, P>(x0.z, x0.w, x0.w), detail::tvec3<T, P>(x0.y, x0.y, x0.z));
|
||||
|
||||
// i0.x = dot(isX, vec3(1.0));
|
||||
//i0.x = isX.x + isX.y + isX.z;
|
||||
//i0.yzw = static_cast<T>(1) - isX;
|
||||
i0 = detail::tvec4<T, P>(isX.x + isX.y + isX.z, T(1) - isX);
|
||||
|
||||
// i0.y += dot(isYZ.xy, vec2(1.0));
|
||||
i0.y += isYZ.x + isYZ.y;
|
||||
|
||||
//i0.zw += 1.0 - detail::tvec2<T, P>(isYZ.x, isYZ.y);
|
||||
i0.z += static_cast<T>(1) - isYZ.x;
|
||||
i0.w += static_cast<T>(1) - isYZ.y;
|
||||
i0.z += isYZ.z;
|
||||
i0.w += static_cast<T>(1) - isYZ.z;
|
||||
|
||||
// i0 now contains the unique values 0,1,2,3 in each channel
|
||||
detail::tvec4<T, P> i3 = clamp(i0, T(0), T(1));
|
||||
detail::tvec4<T, P> i2 = clamp(i0 - T(1), T(0), T(1));
|
||||
detail::tvec4<T, P> i1 = clamp(i0 - T(2), T(0), T(1));
|
||||
|
||||
// x0 = x0 - 0.0 + 0.0 * C.xxxx
|
||||
// x1 = x0 - i1 + 0.0 * C.xxxx
|
||||
// x2 = x0 - i2 + 0.0 * C.xxxx
|
||||
// x3 = x0 - i3 + 0.0 * C.xxxx
|
||||
// x4 = x0 - 1.0 + 4.0 * C.xxxx
|
||||
detail::tvec4<T, P> x1 = x0 - i1 + C.x;
|
||||
detail::tvec4<T, P> x2 = x0 - i2 + C.y;
|
||||
detail::tvec4<T, P> x3 = x0 - i3 + C.z;
|
||||
detail::tvec4<T, P> x4 = x0 + C.w;
|
||||
|
||||
// Permutations
|
||||
i = mod(i, T(289));
|
||||
T j0 = detail::permute(detail::permute(detail::permute(detail::permute(i.w) + i.z) + i.y) + i.x);
|
||||
detail::tvec4<T, P> j1 = detail::permute(detail::permute(detail::permute(detail::permute(
|
||||
i.w + detail::tvec4<T, P>(i1.w, i2.w, i3.w, T(1))) +
|
||||
i.z + detail::tvec4<T, P>(i1.z, i2.z, i3.z, T(1))) +
|
||||
i.y + detail::tvec4<T, P>(i1.y, i2.y, i3.y, T(1))) +
|
||||
i.x + detail::tvec4<T, P>(i1.x, i2.x, i3.x, T(1)));
|
||||
|
||||
// Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope
|
||||
// 7*7*6 = 294, which is close to the ring size 17*17 = 289.
|
||||
detail::tvec4<T, P> ip = detail::tvec4<T, P>(T(1) / T(294), T(1) / T(49), T(1) / T(7), T(0));
|
||||
|
||||
detail::tvec4<T, P> p0 = detail::grad4(j0, ip);
|
||||
detail::tvec4<T, P> p1 = detail::grad4(j1.x, ip);
|
||||
detail::tvec4<T, P> p2 = detail::grad4(j1.y, ip);
|
||||
detail::tvec4<T, P> p3 = detail::grad4(j1.z, ip);
|
||||
detail::tvec4<T, P> p4 = detail::grad4(j1.w, ip);
|
||||
|
||||
// Normalise gradients
|
||||
detail::tvec4<T, P> norm = detail::taylorInvSqrt(detail::tvec4<T, P>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));
|
||||
p0 *= norm.x;
|
||||
p1 *= norm.y;
|
||||
p2 *= norm.z;
|
||||
p3 *= norm.w;
|
||||
p4 *= taylorInvSqrt(dot(p4, p4));
|
||||
|
||||
// Mix contributions from the five corners
|
||||
detail::tvec3<T, P> m0 = max(T(0.6) - detail::tvec3<T, P>(dot(x0, x0), dot(x1, x1), dot(x2, x2)), T(0));
|
||||
detail::tvec2<T, P> m1 = max(T(0.6) - detail::tvec2<T, P>(dot(x3, x3), dot(x4, x4) ), T(0));
|
||||
m0 = m0 * m0;
|
||||
m1 = m1 * m1;
|
||||
|
||||
return T(49) * (
|
||||
dot(m0 * m0, detail::tvec3<T, P>(dot(p0, x0), dot(p1, x1), dot(p2, x2))) +
|
||||
dot(m1 * m1, detail::tvec2<T, P>(dot(p3, x3), dot(p4, x4))));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec2<T, P> noise2(detail::tvec2<T, P> const & x)
|
||||
{
|
||||
return detail::tvec2<T, P>(
|
||||
noise1(x + detail::tvec2<T, P>(0.0)),
|
||||
noise1(detail::tvec2<T, P>(0.0) - x));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec2<T, P> noise2(detail::tvec3<T, P> const & x)
|
||||
{
|
||||
return detail::tvec2<T, P>(
|
||||
noise1(x + detail::tvec3<T, P>(0.0)),
|
||||
noise1(detail::tvec3<T, P>(0.0) - x));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec2<T, P> noise2(detail::tvec4<T, P> const & x)
|
||||
{
|
||||
return detail::tvec2<T, P>(
|
||||
noise1(x + detail::tvec4<T, P>(0)),
|
||||
noise1(detail::tvec4<T, P>(0) - x));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec3<T, P> noise3(detail::tvec2<T, P> const & x)
|
||||
{
|
||||
return detail::tvec3<T, P>(
|
||||
noise1(x - detail::tvec2<T, P>(1.0)),
|
||||
noise1(x + detail::tvec2<T, P>(0.0)),
|
||||
noise1(x + detail::tvec2<T, P>(1.0)));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec3<T, P> noise3(detail::tvec3<T, P> const & x)
|
||||
{
|
||||
return detail::tvec3<T, P>(
|
||||
noise1(x - detail::tvec3<T, P>(1.0)),
|
||||
noise1(x + detail::tvec3<T, P>(0.0)),
|
||||
noise1(x + detail::tvec3<T, P>(1.0)));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec3<T, P> noise3(detail::tvec4<T, P> const & x)
|
||||
{
|
||||
return detail::tvec3<T, P>(
|
||||
noise1(x - detail::tvec4<T, P>(1)),
|
||||
noise1(x + detail::tvec4<T, P>(0)),
|
||||
noise1(x + detail::tvec4<T, P>(1)));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec4<T, P> noise4(detail::tvec2<T, P> const & x)
|
||||
{
|
||||
return detail::tvec4<T, P>(
|
||||
noise1(x - detail::tvec2<T, P>(1)),
|
||||
noise1(x + detail::tvec2<T, P>(0)),
|
||||
noise1(x + detail::tvec2<T, P>(1)),
|
||||
noise1(x + detail::tvec2<T, P>(2)));
|
||||
}
|
||||
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec4<T, P> noise4(detail::tvec3<T, P> const & x)
|
||||
{
|
||||
return detail::tvec4<T, P>(
|
||||
noise1(x - detail::tvec3<T, P>(1)),
|
||||
noise1(x + detail::tvec3<T, P>(0)),
|
||||
noise1(x + detail::tvec3<T, P>(1)),
|
||||
noise1(x + detail::tvec3<T, P>(2)));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
inline detail::tvec4<T, P> noise4(detail::tvec4<T, P> const & x)
|
||||
{
|
||||
return detail::tvec4<T, P>(
|
||||
noise1(x - detail::tvec4<T, P>(1)),
|
||||
noise1(x + detail::tvec4<T, P>(0)),
|
||||
noise1(x + detail::tvec4<T, P>(1)),
|
||||
noise1(x + detail::tvec4<T, P>(2)));
|
||||
}
|
||||
|
||||
}//namespace glm
|
||||
Vendored
-195
@@ -1,195 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_packing.hpp
|
||||
/// @date 2010-03-17 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
///
|
||||
/// @defgroup core_func_packing Floating-Point Pack and Unpack Functions
|
||||
/// @ingroup core
|
||||
///
|
||||
/// These functions do not operate component-wise, rather as described in each case.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef GLM_CORE_func_packing
|
||||
#define GLM_CORE_func_packing
|
||||
|
||||
#include "type_vec2.hpp"
|
||||
#include "type_vec4.hpp"
|
||||
|
||||
namespace glm
|
||||
{
|
||||
/// @addtogroup core_func_packing
|
||||
/// @{
|
||||
|
||||
/// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
|
||||
/// Then, the results are packed into the returned 32-bit unsigned integer.
|
||||
///
|
||||
/// The conversion for component c of v to fixed point is done as follows:
|
||||
/// packUnorm2x16: round(clamp(c, 0, +1) * 65535.0)
|
||||
///
|
||||
/// The first component of the vector will be written to the least significant bits of the output;
|
||||
/// the last component will be written to the most significant bits.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm2x16.xml">GLSL packUnorm2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
uint packUnorm2x16(vec2 const & v);
|
||||
|
||||
/// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
|
||||
/// Then, the results are packed into the returned 32-bit unsigned integer.
|
||||
///
|
||||
/// The conversion for component c of v to fixed point is done as follows:
|
||||
/// packSnorm2x16: round(clamp(v, -1, +1) * 32767.0)
|
||||
///
|
||||
/// The first component of the vector will be written to the least significant bits of the output;
|
||||
/// the last component will be written to the most significant bits.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm2x16.xml">GLSL packSnorm2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
uint packSnorm2x16(vec2 const & v);
|
||||
|
||||
/// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
|
||||
/// Then, the results are packed into the returned 32-bit unsigned integer.
|
||||
///
|
||||
/// The conversion for component c of v to fixed point is done as follows:
|
||||
/// packUnorm4x8: round(clamp(c, 0, +1) * 255.0)
|
||||
///
|
||||
/// The first component of the vector will be written to the least significant bits of the output;
|
||||
/// the last component will be written to the most significant bits.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
uint packUnorm4x8(vec4 const & v);
|
||||
|
||||
/// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
|
||||
/// Then, the results are packed into the returned 32-bit unsigned integer.
|
||||
///
|
||||
/// The conversion for component c of v to fixed point is done as follows:
|
||||
/// packSnorm4x8: round(clamp(c, -1, +1) * 127.0)
|
||||
///
|
||||
/// The first component of the vector will be written to the least significant bits of the output;
|
||||
/// the last component will be written to the most significant bits.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
uint packSnorm4x8(vec4 const & v);
|
||||
|
||||
/// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
|
||||
///
|
||||
/// The conversion for unpacked fixed-point value f to floating point is done as follows:
|
||||
/// unpackUnorm2x16: f / 65535.0
|
||||
///
|
||||
/// The first component of the returned vector will be extracted from the least significant bits of the input;
|
||||
/// the last component will be extracted from the most significant bits.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm2x16.xml">GLSL unpackUnorm2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
vec2 unpackUnorm2x16(uint const & p);
|
||||
|
||||
/// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
|
||||
///
|
||||
/// The conversion for unpacked fixed-point value f to floating point is done as follows:
|
||||
/// unpackSnorm2x16: clamp(f / 32767.0, -1, +1)
|
||||
///
|
||||
/// The first component of the returned vector will be extracted from the least significant bits of the input;
|
||||
/// the last component will be extracted from the most significant bits.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm2x16.xml">GLSL unpackSnorm2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
vec2 unpackSnorm2x16(uint const & p);
|
||||
|
||||
/// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
|
||||
///
|
||||
/// The conversion for unpacked fixed-point value f to floating point is done as follows:
|
||||
/// unpackUnorm4x8: f / 255.0
|
||||
///
|
||||
/// The first component of the returned vector will be extracted from the least significant bits of the input;
|
||||
/// the last component will be extracted from the most significant bits.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm4x8.xml">GLSL unpackUnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
vec4 unpackUnorm4x8(uint const & p);
|
||||
|
||||
/// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
|
||||
///
|
||||
/// The conversion for unpacked fixed-point value f to floating point is done as follows:
|
||||
/// unpackSnorm4x8: clamp(f / 127.0, -1, +1)
|
||||
///
|
||||
/// The first component of the returned vector will be extracted from the least significant bits of the input;
|
||||
/// the last component will be extracted from the most significant bits.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm4x8.xml">GLSL unpackSnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
vec4 unpackSnorm4x8(uint const & p);
|
||||
|
||||
/// Returns a double-precision value obtained by packing the components of v into a 64-bit value.
|
||||
/// If an IEEE 754 Inf or NaN is created, it will not signal, and the resulting floating point value is unspecified.
|
||||
/// Otherwise, the bit- level representation of v is preserved.
|
||||
/// The first vector component specifies the 32 least significant bits;
|
||||
/// the second component specifies the 32 most significant bits.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packDouble2x32.xml">GLSL packDouble2x32 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
double packDouble2x32(uvec2 const & v);
|
||||
|
||||
/// Returns a two-component unsigned integer vector representation of v.
|
||||
/// The bit-level representation of v is preserved.
|
||||
/// The first component of the vector contains the 32 least significant bits of the double;
|
||||
/// the second component consists the 32 most significant bits.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackDouble2x32.xml">GLSL unpackDouble2x32 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
uvec2 unpackDouble2x32(double const & v);
|
||||
|
||||
/// Returns an unsigned integer obtained by converting the components of a two-component floating-point vector
|
||||
/// to the 16-bit floating-point representation found in the OpenGL Specification,
|
||||
/// and then packing these two 16- bit integers into a 32-bit unsigned integer.
|
||||
/// The first vector component specifies the 16 least-significant bits of the result;
|
||||
/// the second component specifies the 16 most-significant bits.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packHalf2x16.xml">GLSL packHalf2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
uint packHalf2x16(vec2 const & v);
|
||||
|
||||
/// Returns a two-component floating-point vector with components obtained by unpacking a 32-bit unsigned integer into a pair of 16-bit values,
|
||||
/// interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification,
|
||||
/// and converting them to 32-bit floating-point values.
|
||||
/// The first component of the vector is obtained from the 16 least-significant bits of v;
|
||||
/// the second component is obtained from the 16 most-significant bits of v.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackHalf2x16.xml">GLSL unpackHalf2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
vec2 unpackHalf2x16(uint const & v);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
#include "func_packing.inl"
|
||||
|
||||
#endif//GLM_CORE_func_packing
|
||||
Vendored
-138
@@ -1,138 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_packing.inl
|
||||
/// @date 2010-03-17 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "func_common.hpp"
|
||||
#include "type_half.hpp"
|
||||
#include "../fwd.hpp"
|
||||
|
||||
namespace glm
|
||||
{
|
||||
inline uint packUnorm2x16(vec2 const & v)
|
||||
{
|
||||
u16vec2 Topack(round(clamp(v, 0.0f, 1.0f) * 65535.0f));
|
||||
uint Packed;
|
||||
std::memcpy(&Packed, &Topack, sizeof(Packed));
|
||||
return Packed;
|
||||
}
|
||||
|
||||
inline vec2 unpackUnorm2x16(uint const & p)
|
||||
{
|
||||
u16vec2 Packed;
|
||||
std::memcpy(&Packed, &p, sizeof(Packed));
|
||||
vec2 Unpack(Packed);
|
||||
return Unpack * float(1.5259021896696421759365224689097e-5); // 1.0 / 65535.0
|
||||
}
|
||||
|
||||
inline uint packSnorm2x16(vec2 const & v)
|
||||
{
|
||||
i16vec2 Topack(round(clamp(v ,-1.0f, 1.0f) * 32767.0f));
|
||||
uint32 Packed;
|
||||
std::memcpy(&Packed, &Topack, sizeof(Packed));
|
||||
return Packed;
|
||||
}
|
||||
|
||||
inline vec2 unpackSnorm2x16(uint const & p)
|
||||
{
|
||||
i16vec2 Packed;
|
||||
std::memcpy(&Packed, &p, sizeof(Packed));
|
||||
vec2 Unpack(Packed);
|
||||
return clamp(
|
||||
Unpack * 3.0518509475997192297128208258309e-5f, //1.0f / 32767.0f,
|
||||
-1.0f, 1.0f);
|
||||
}
|
||||
|
||||
inline uint packUnorm4x8(vec4 const & v)
|
||||
{
|
||||
u8vec4 Topack(round(clamp(v, 0.0f, 1.0f) * 255.0f));
|
||||
uint Packed;
|
||||
std::memcpy(&Packed, &Topack, sizeof(Packed));
|
||||
return Packed;
|
||||
}
|
||||
|
||||
inline vec4 unpackUnorm4x8(uint const & p)
|
||||
{
|
||||
u8vec4 Packed;
|
||||
std::memcpy(&Packed, &p, sizeof(Packed));
|
||||
vec4 Unpack(Packed);
|
||||
return Unpack * float(0.0039215686274509803921568627451); // 1 / 255
|
||||
}
|
||||
|
||||
inline uint packSnorm4x8(vec4 const & v)
|
||||
{
|
||||
i8vec4 Topack(round(clamp(v ,-1.0f, 1.0f) * 127.0f));
|
||||
uint Packed;
|
||||
std::memcpy(&Packed, &Topack, sizeof(Packed));
|
||||
return Packed;
|
||||
}
|
||||
|
||||
inline glm::vec4 unpackSnorm4x8(uint const & p)
|
||||
{
|
||||
i8vec4 Packed;
|
||||
std::memcpy(&Packed, &p, sizeof(Packed));
|
||||
vec4 Unpack(Packed);
|
||||
return clamp(
|
||||
Unpack * 0.0078740157480315f, // 1.0f / 127.0f
|
||||
-1.0f, 1.0f);
|
||||
}
|
||||
|
||||
inline double packDouble2x32(uvec2 const & v)
|
||||
{
|
||||
double Packed;
|
||||
std::memcpy(&Packed, &v, sizeof(Packed));
|
||||
return Packed;
|
||||
}
|
||||
|
||||
inline uvec2 unpackDouble2x32(double const & v)
|
||||
{
|
||||
uvec2 Unpack;
|
||||
std::memcpy(&Unpack, &v, sizeof(Unpack));
|
||||
return Unpack;
|
||||
}
|
||||
|
||||
inline uint packHalf2x16(vec2 const & v)
|
||||
{
|
||||
i16vec2 Unpack(
|
||||
detail::toFloat16(v.x),
|
||||
detail::toFloat16(v.y));
|
||||
|
||||
uint Packed;
|
||||
std::memcpy(&Packed, &Unpack, sizeof(Packed));
|
||||
return Packed;
|
||||
}
|
||||
|
||||
inline vec2 unpackHalf2x16(uint const & v)
|
||||
{
|
||||
i16vec2 Unpack;
|
||||
std::memcpy(&Unpack, &v, sizeof(Unpack));
|
||||
|
||||
return vec2(
|
||||
detail::toFloat32(Unpack.x),
|
||||
detail::toFloat32(Unpack.y));
|
||||
}
|
||||
}//namespace glm
|
||||
|
||||
-203
@@ -1,203 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_trigonometric.hpp
|
||||
/// @date 2008-08-01 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
///
|
||||
/// @defgroup core_func_trigonometric Angle and Trigonometry Functions
|
||||
/// @ingroup core
|
||||
///
|
||||
/// Function parameters specified as angle are assumed to be in units of radians.
|
||||
/// In no case will any of these functions result in a divide by zero error. If
|
||||
/// the divisor of a ratio is 0, then results will be undefined.
|
||||
///
|
||||
/// These all operate component-wise. The description is per component.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef GLM_CORE_func_trigonometric
|
||||
#define GLM_CORE_func_trigonometric
|
||||
|
||||
namespace glm
|
||||
{
|
||||
/// @addtogroup core_func_trigonometric
|
||||
/// @{
|
||||
|
||||
/// Converts degrees to radians and returns the result.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/radians.xml">GLSL radians man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
genType radians(genType const & degrees);
|
||||
|
||||
/// Converts radians to degrees and returns the result.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/degrees.xml">GLSL degrees man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
genType degrees(genType const & radians);
|
||||
|
||||
/// The standard trigonometric sine function.
|
||||
/// The values returned by this function will range from [-1, 1].
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sin.xml">GLSL sin man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
genType sin(genType const & angle);
|
||||
|
||||
/// The standard trigonometric cosine function.
|
||||
/// The values returned by this function will range from [-1, 1].
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cos.xml">GLSL cos man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
genType cos(genType const & angle);
|
||||
|
||||
/// The standard trigonometric tangent function.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/tan.xml">GLSL tan man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
genType tan(genType const & angle);
|
||||
|
||||
/// Arc sine. Returns an angle whose sine is x.
|
||||
/// The range of values returned by this function is [-PI/2, PI/2].
|
||||
/// Results are undefined if |x| > 1.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/asin.xml">GLSL asin man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
genType asin(genType const & x);
|
||||
|
||||
/// Arc cosine. Returns an angle whose sine is x.
|
||||
/// The range of values returned by this function is [0, PI].
|
||||
/// Results are undefined if |x| > 1.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/acos.xml">GLSL acos man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
genType acos(genType const & x);
|
||||
|
||||
/// Arc tangent. Returns an angle whose tangent is y/x.
|
||||
/// The signs of x and y are used to determine what
|
||||
/// quadrant the angle is in. The range of values returned
|
||||
/// by this function is [-PI, PI]. Results are undefined
|
||||
/// if x and y are both 0.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atan.xml">GLSL atan man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
genType atan(genType const & y, genType const & x);
|
||||
|
||||
/// Arc tangent. Returns an angle whose tangent is y_over_x.
|
||||
/// The range of values returned by this function is [-PI/2, PI/2].
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atan.xml">GLSL atan man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
genType atan(genType const & y_over_x);
|
||||
|
||||
/// Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sinh.xml">GLSL sinh man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
genType sinh(genType const & angle);
|
||||
|
||||
/// Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cosh.xml">GLSL cosh man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
genType cosh(genType const & angle);
|
||||
|
||||
/// Returns the hyperbolic tangent function, sinh(angle) / cosh(angle)
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/tanh.xml">GLSL tanh man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
genType tanh(genType const & angle);
|
||||
|
||||
/// Arc hyperbolic sine; returns the inverse of sinh.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/asinh.xml">GLSL asinh man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
genType asinh(genType const & x);
|
||||
|
||||
/// Arc hyperbolic cosine; returns the non-negative inverse
|
||||
/// of cosh. Results are undefined if x < 1.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/acosh.xml">GLSL acosh man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
genType acosh(genType const & x);
|
||||
|
||||
/// Arc hyperbolic tangent; returns the inverse of tanh.
|
||||
/// Results are undefined if abs(x) >= 1.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atanh.xml">GLSL atanh man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
genType atanh(genType const & x);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
#include "func_trigonometric.inl"
|
||||
|
||||
#endif//GLM_CORE_func_trigonometric
|
||||
|
||||
|
||||
-216
@@ -1,216 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_trigonometric.inl
|
||||
/// @date 2008-08-03 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "_vectorize.hpp"
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
|
||||
namespace glm
|
||||
{
|
||||
// radians
|
||||
template <typename genType>
|
||||
inline genType radians
|
||||
(
|
||||
genType const & degrees
|
||||
)
|
||||
{
|
||||
return degrees * genType(0.01745329251994329576923690768489);
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(radians)
|
||||
|
||||
// degrees
|
||||
template <typename genType>
|
||||
inline genType degrees
|
||||
(
|
||||
genType const & radians
|
||||
)
|
||||
{
|
||||
return radians * genType(57.295779513082320876798154814105);
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(degrees)
|
||||
|
||||
// sin
|
||||
template <typename genType>
|
||||
inline genType sin
|
||||
(
|
||||
genType const & angle
|
||||
)
|
||||
{
|
||||
return genType(::std::sin(angle));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(sin)
|
||||
|
||||
// cos
|
||||
template <typename genType>
|
||||
inline genType cos(genType const & angle)
|
||||
{
|
||||
return genType(::std::cos(angle));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(cos)
|
||||
|
||||
// tan
|
||||
template <typename genType>
|
||||
inline genType tan
|
||||
(
|
||||
genType const & angle
|
||||
)
|
||||
{
|
||||
return genType(::std::tan(angle));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(tan)
|
||||
|
||||
// asin
|
||||
template <typename genType>
|
||||
inline genType asin
|
||||
(
|
||||
genType const & x
|
||||
)
|
||||
{
|
||||
return genType(::std::asin(x));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(asin)
|
||||
|
||||
// acos
|
||||
template <typename genType>
|
||||
inline genType acos
|
||||
(
|
||||
genType const & x
|
||||
)
|
||||
{
|
||||
return genType(::std::acos(x));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(acos)
|
||||
|
||||
// atan
|
||||
template <typename genType>
|
||||
inline genType atan
|
||||
(
|
||||
genType const & y,
|
||||
genType const & x
|
||||
)
|
||||
{
|
||||
return genType(::std::atan2(y, x));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC_VEC(atan)
|
||||
|
||||
template <typename genType>
|
||||
inline genType atan
|
||||
(
|
||||
genType const & x
|
||||
)
|
||||
{
|
||||
return genType(::std::atan(x));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(atan)
|
||||
|
||||
// sinh
|
||||
template <typename genType>
|
||||
inline genType sinh
|
||||
(
|
||||
genType const & angle
|
||||
)
|
||||
{
|
||||
return genType(std::sinh(angle));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(sinh)
|
||||
|
||||
// cosh
|
||||
template <typename genType>
|
||||
inline genType cosh
|
||||
(
|
||||
genType const & angle
|
||||
)
|
||||
{
|
||||
return genType(std::cosh(angle));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(cosh)
|
||||
|
||||
// tanh
|
||||
template <typename genType>
|
||||
inline genType tanh
|
||||
(
|
||||
genType const & angle
|
||||
)
|
||||
{
|
||||
return genType(std::tanh(angle));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(tanh)
|
||||
|
||||
// asinh
|
||||
template <typename genType>
|
||||
inline genType asinh
|
||||
(
|
||||
genType const & x
|
||||
)
|
||||
{
|
||||
return (x < genType(0) ? genType(-1) : (x > genType(0) ? genType(1) : genType(0))) * log(abs(x) + sqrt(genType(1) + x * x));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(asinh)
|
||||
|
||||
// acosh
|
||||
template <typename genType>
|
||||
inline genType acosh
|
||||
(
|
||||
genType const & x
|
||||
)
|
||||
{
|
||||
if(x < genType(1))
|
||||
return genType(0);
|
||||
return log(x + sqrt(x * x - genType(1)));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(acosh)
|
||||
|
||||
// atanh
|
||||
template <typename genType>
|
||||
inline genType atanh
|
||||
(
|
||||
genType const & x
|
||||
)
|
||||
{
|
||||
if(abs(x) >= genType(1))
|
||||
return 0;
|
||||
return genType(0.5) * log((genType(1) + x) / (genType(1) - x));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(atanh)
|
||||
|
||||
}//namespace glm
|
||||
-145
@@ -1,145 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_vector_relational.hpp
|
||||
/// @date 2008-08-03 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
|
||||
///
|
||||
/// @defgroup core_func_vector_relational Vector Relational Functions
|
||||
/// @ingroup core
|
||||
///
|
||||
/// Relational and equality operators (<, <=, >, >=, ==, !=) are defined to
|
||||
/// operate on scalars and produce scalar Boolean results. For vector results,
|
||||
/// use the following built-in functions.
|
||||
///
|
||||
/// In all cases, the sizes of all the input and return vectors for any particular
|
||||
/// call must match.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef GLM_CORE_func_vector_relational
|
||||
#define GLM_CORE_func_vector_relational
|
||||
|
||||
#include "precision.hpp"
|
||||
#include "setup.hpp"
|
||||
|
||||
#if !((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER <= GLM_COMPILER_VC10)) // Workaround a Visual C++ bug
|
||||
|
||||
namespace glm
|
||||
{
|
||||
/// @addtogroup core_func_vector_relational
|
||||
/// @{
|
||||
|
||||
/// Returns the component-wise comparison result of x < y.
|
||||
///
|
||||
/// @tparam vecType Floating-point or integer vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThan.xml">GLSL lessThan man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
|
||||
// TODO: Mismatched
|
||||
//template <typename T, precision P, template <typename, precision> class vecType>
|
||||
//typename vecType<T, P>::bool_type lessThan(vecType<T, P> const & x, vecType<T, P> const & y);
|
||||
|
||||
/// Returns the component-wise comparison of result x <= y.
|
||||
///
|
||||
/// @tparam vecType Floating-point or integer vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThanEqual.xml">GLSL lessThanEqual man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
typename vecType<T, P>::bool_type lessThanEqual(vecType<T, P> const & x, vecType<T, P> const & y);
|
||||
|
||||
/// Returns the component-wise comparison of result x > y.
|
||||
///
|
||||
/// @tparam vecType Floating-point or integer vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThan.xml">GLSL greaterThan man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
typename vecType<T, P>::bool_type greaterThan(vecType<T, P> const & x, vecType<T, P> const & y);
|
||||
|
||||
/// Returns the component-wise comparison of result x >= y.
|
||||
///
|
||||
/// @tparam vecType Floating-point or integer vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThanEqual.xml">GLSL greaterThanEqual man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
typename vecType<T, P>::bool_type greaterThanEqual(vecType<T, P> const & x, vecType<T, P> const & y);
|
||||
|
||||
/// Returns the component-wise comparison of result x == y.
|
||||
///
|
||||
/// @tparam vecType Floating-point, integer or boolean vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/equal.xml">GLSL equal man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
|
||||
//TODO: conflicts with definision
|
||||
//template <typename T, precision P, template <typename, precision> class vecType>
|
||||
//typename vecType<T, P>::bool_type equal(vecType<T, P> const & x, vecType<T, P> const & y);
|
||||
|
||||
/// Returns the component-wise comparison of result x != y.
|
||||
///
|
||||
/// @tparam vecType Floating-point, integer or boolean vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/notEqual.xml">GLSL notEqual man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
typename vecType<T, P>::bool_type notEqual(vecType<T, P> const & x, vecType<T, P> const & y);
|
||||
|
||||
/// Returns true if any component of x is true.
|
||||
///
|
||||
/// @tparam vecType Boolean vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/any.xml">GLSL any man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
|
||||
template <precision P, template <typename, precision> class vecType>
|
||||
bool any(vecType<bool, P> const & v);
|
||||
|
||||
/// Returns true if all components of x are true.
|
||||
///
|
||||
/// @tparam vecType Boolean vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/all.xml">GLSL all man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
|
||||
template <precision P, template <typename, precision> class vecType>
|
||||
bool all(vecType<bool, P> const & v);
|
||||
|
||||
/// Returns the component-wise logical complement of x.
|
||||
/// /!\ Because of language incompatibilities between C++ and GLSL, GLM defines the function not but not_ instead.
|
||||
///
|
||||
/// @tparam vecType Boolean vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/not.xml">GLSL not man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
|
||||
template <precision P, template <typename, precision> class vecType>
|
||||
vecType<bool, P> not_(vecType<bool, P> const & v);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
#endif
|
||||
|
||||
#include "func_vector_relational.inl"
|
||||
|
||||
#endif//GLM_CORE_func_vector_relational
|
||||
Loaded 100 of 826 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user